Make FDO more tolerant to source changes
[official-gcc.git] / gcc / doc / invoke.texi
blobaaa5a688375af37b75065fdb161b3dc9c4f4f15c
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  -fno-use-all-virtuals  -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 -Wno-attributes -Wno-builtin-macro-redefined @gol
244 -Wc++-compat -Wc++11-compat -Wcast-align  -Wcast-qual  @gol
245 -Wchar-subscripts -Wclobbered  -Wcomment -Wconditionally-supported  @gol
246 -Wconversion -Wcoverage-mismatch -Wdate-time -Wdelete-incomplete -Wno-cpp  @gol
247 -Wno-deprecated -Wno-deprecated-declarations -Wdisabled-optimization  @gol
248 -Wno-discarded-qualifiers @gol
249 -Wno-div-by-zero -Wdouble-promotion -Wempty-body  -Wenum-compare @gol
250 -Wno-endif-labels -Werror  -Werror=* @gol
251 -Wfatal-errors  -Wfloat-equal  -Wformat  -Wformat=2 @gol
252 -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol
253 -Wformat-security  -Wformat-signedness  -Wformat-y2k @gol
254 -Wframe-larger-than=@var{len} -Wno-free-nonheap-object -Wjump-misses-init @gol
255 -Wignored-qualifiers  -Wincompatible-pointer-types @gol
256 -Wimplicit  -Wimplicit-function-declaration  -Wimplicit-int @gol
257 -Winit-self  -Winline  -Wno-int-conversion @gol
258 -Wno-int-to-pointer-cast -Wno-invalid-offsetof @gol
259 -Winvalid-pch -Wlarger-than=@var{len}  -Wunsafe-loop-optimizations @gol
260 -Wlogical-op -Wlogical-not-parentheses -Wlong-long @gol
261 -Wmain -Wmaybe-uninitialized -Wmemset-transposed-args -Wmissing-braces @gol
262 -Wmissing-field-initializers -Wmissing-include-dirs @gol
263 -Wno-multichar  -Wnonnull  -Wodr  -Wno-overflow  -Wopenmp-simd @gol
264 -Woverlength-strings  -Wpacked  -Wpacked-bitfield-compat  -Wpadded @gol
265 -Wparentheses  -Wpedantic-ms-format -Wno-pedantic-ms-format @gol
266 -Wpointer-arith  -Wno-pointer-to-int-cast @gol
267 -Wredundant-decls  -Wno-return-local-addr @gol
268 -Wreturn-type  -Wsequence-point  -Wshadow  -Wno-shadow-ivar @gol
269 -Wsign-compare  -Wsign-conversion -Wfloat-conversion @gol
270 -Wsizeof-pointer-memaccess  -Wsizeof-array-argument @gol
271 -Wstack-protector -Wstack-usage=@var{len} -Wstrict-aliasing @gol
272 -Wstrict-aliasing=n @gol -Wstrict-overflow -Wstrict-overflow=@var{n} @gol
273 -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{]} @gol
274 -Wmissing-format-attribute @gol
275 -Wswitch  -Wswitch-default  -Wswitch-enum -Wswitch-bool -Wsync-nand @gol
276 -Wsystem-headers  -Wtrampolines  -Wtrigraphs  -Wtype-limits  -Wundef @gol
277 -Wuninitialized  -Wunknown-pragmas  -Wno-pragmas @gol
278 -Wunsuffixed-float-constants  -Wunused  -Wunused-function @gol
279 -Wunused-label  -Wunused-local-typedefs -Wunused-parameter @gol
280 -Wno-unused-result -Wunused-value @gol -Wunused-variable @gol
281 -Wunused-but-set-parameter -Wunused-but-set-variable @gol
282 -Wuseless-cast -Wvariadic-macros -Wvector-operation-performance @gol
283 -Wvla -Wvolatile-register-var  -Wwrite-strings -Wzero-as-null-pointer-constant}
285 @item C and Objective-C-only Warning Options
286 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
287 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
288 -Wold-style-declaration  -Wold-style-definition @gol
289 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
290 -Wdeclaration-after-statement -Wpointer-sign}
292 @item Debugging Options
293 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
294 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
295 -fsanitize=@var{style} -fsanitize-recover @gol
296 -fsanitize-undefined-trap-on-error @gol
297 -fdbg-cnt-list -fdbg-cnt=@var{counter-value-list} @gol
298 -fdisable-ipa-@var{pass_name} @gol
299 -fdisable-rtl-@var{pass_name} @gol
300 -fdisable-rtl-@var{pass-name}=@var{range-list} @gol
301 -fdisable-tree-@var{pass_name} @gol
302 -fdisable-tree-@var{pass-name}=@var{range-list} @gol
303 -fdump-noaddr -fdump-unnumbered -fdump-unnumbered-links @gol
304 -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
305 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
306 -fdump-ipa-all -fdump-ipa-cgraph -fdump-ipa-inline @gol
307 -fdump-passes @gol
308 -fdump-statistics @gol
309 -fdump-tree-all @gol
310 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
311 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
312 -fdump-tree-cfg -fdump-tree-alias @gol
313 -fdump-tree-ch @gol
314 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
315 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
316 -fdump-tree-gimple@r{[}-raw@r{]} @gol
317 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
318 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
319 -fdump-tree-phiprop@r{[}-@var{n}@r{]} @gol
320 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
321 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
322 -fdump-tree-copyrename@r{[}-@var{n}@r{]} @gol
323 -fdump-tree-nrv -fdump-tree-vect @gol
324 -fdump-tree-sink @gol
325 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
326 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
327 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
328 -fdump-tree-vtable-verify @gol
329 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
330 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
331 -fdump-final-insns=@var{file} @gol
332 -fcompare-debug@r{[}=@var{opts}@r{]}  -fcompare-debug-second @gol
333 -feliminate-dwarf2-dups -fno-eliminate-unused-debug-types @gol
334 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
335 -fenable-@var{kind}-@var{pass} @gol
336 -fenable-@var{kind}-@var{pass}=@var{range-list} @gol
337 -fdebug-types-section -fmem-report-wpa @gol
338 -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
339 -fopt-info @gol
340 -fopt-info-@var{options}@r{[}=@var{file}@r{]} @gol
341 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
342 -fsel-sched-verbose -fsel-sched-dump-cfg -fsel-sched-pipelining-verbose @gol
343 -fstack-usage  -ftest-coverage  -ftime-report -fvar-tracking @gol
344 -fvar-tracking-assignments  -fvar-tracking-assignments-toggle @gol
345 -g  -g@var{level}  -gtoggle  -gcoff  -gdwarf-@var{version} @gol
346 -ggdb  -grecord-gcc-switches  -gno-record-gcc-switches @gol
347 -gstabs  -gstabs+  -gstrict-dwarf  -gno-strict-dwarf @gol
348 -gvms  -gxcoff  -gxcoff+ -gz@r{[}=@var{type}@r{]} @gol
349 -fno-merge-debug-strings -fno-dwarf2-cfi-asm @gol
350 -fdebug-prefix-map=@var{old}=@var{new} @gol
351 -femit-struct-debug-baseonly -femit-struct-debug-reduced @gol
352 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
353 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
354 -print-multi-directory  -print-multi-lib  -print-multi-os-directory @gol
355 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
356 -print-sysroot -print-sysroot-headers-suffix @gol
357 -save-temps -save-temps=cwd -save-temps=obj -time@r{[}=@var{file}@r{]}}
359 @item Optimization Options
360 @xref{Optimize Options,,Options that Control Optimization}.
361 @gccoptlist{-faggressive-loop-optimizations -falign-functions[=@var{n}] @gol
362 -falign-jumps[=@var{n}] @gol
363 -falign-labels[=@var{n}] -falign-loops[=@var{n}] @gol
364 -fassociative-math -fauto-inc-dec -fbranch-probabilities @gol
365 -fbranch-target-load-optimize -fbranch-target-load-optimize2 @gol
366 -fbtr-bb-exclusive -fcaller-saves @gol
367 -fcheck-data-deps -fcombine-stack-adjustments -fconserve-stack @gol
368 -fcompare-elim -fcprop-registers -fcrossjumping @gol
369 -fcse-follow-jumps -fcse-skip-blocks -fcx-fortran-rules @gol
370 -fcx-limited-range @gol
371 -fdata-sections -fdce -fdelayed-branch @gol
372 -fdelete-null-pointer-checks -fdevirtualize -fdevirtualize-speculatively -fdse @gol
373 -fearly-inlining -fipa-sra -fexpensive-optimizations -ffat-lto-objects @gol
374 -ffast-math -ffinite-math-only -ffloat-store -fexcess-precision=@var{style} @gol
375 -fforward-propagate -ffp-contract=@var{style} -ffunction-sections @gol
376 -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm -fgraphite-identity @gol
377 -fgcse-sm -fhoist-adjacent-loads -fif-conversion @gol
378 -fif-conversion2 -findirect-inlining @gol
379 -finline-functions -finline-functions-called-once -finline-limit=@var{n} @gol
380 -finline-small-functions -fipa-cp -fipa-cp-clone @gol
381 -fipa-pta -fipa-profile -fipa-pure-const -fipa-reference @gol
382 -fira-algorithm=@var{algorithm} @gol
383 -fira-region=@var{region} -fira-hoist-pressure @gol
384 -fira-loop-pressure -fno-ira-share-save-slots @gol
385 -fno-ira-share-spill-slots -fira-verbose=@var{n} @gol
386 -fisolate-erroneous-paths-dereference -fisolate-erroneous-paths-attribute
387 -fivopts -fkeep-inline-functions -fkeep-static-consts -flive-range-shrinkage @gol
388 -floop-block -floop-interchange -floop-strip-mine -floop-nest-optimize @gol
389 -floop-parallelize-all -flto -flto-compression-level @gol
390 -flto-partition=@var{alg} -flto-report -flto-report-wpa -fmerge-all-constants @gol
391 -fmerge-constants -fmodulo-sched -fmodulo-sched-allow-regmoves @gol
392 -fmove-loop-invariants -fno-branch-count-reg @gol
393 -fno-defer-pop -fno-function-cse -fno-guess-branch-probability @gol
394 -fno-inline -fno-math-errno -fno-peephole -fno-peephole2 @gol
395 -fno-sched-interblock -fno-sched-spec -fno-signed-zeros @gol
396 -fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss @gol
397 -fomit-frame-pointer -foptimize-sibling-calls @gol
398 -fpartial-inlining -fpeel-loops -fpredictive-commoning @gol
399 -fprefetch-loop-arrays -fprofile-report @gol
400 -fprofile-correction -fprofile-dir=@var{path} -fprofile-generate @gol
401 -fprofile-generate=@var{path} @gol
402 -fprofile-use -fprofile-use=@var{path} -fprofile-values -fprofile-reorder-functions @gol
403 -freciprocal-math -free -frename-registers -freorder-blocks @gol
404 -freorder-blocks-and-partition -freorder-functions @gol
405 -frerun-cse-after-loop -freschedule-modulo-scheduled-loops @gol
406 -frounding-math -fsched2-use-superblocks -fsched-pressure @gol
407 -fsched-spec-load -fsched-spec-load-dangerous @gol
408 -fsched-stalled-insns-dep[=@var{n}] -fsched-stalled-insns[=@var{n}] @gol
409 -fsched-group-heuristic -fsched-critical-path-heuristic @gol
410 -fsched-spec-insn-heuristic -fsched-rank-heuristic @gol
411 -fsched-last-insn-heuristic -fsched-dep-count-heuristic @gol
412 -fschedule-insns -fschedule-insns2 -fsection-anchors @gol
413 -fselective-scheduling -fselective-scheduling2 @gol
414 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops @gol
415 -fsemantic-interposition @gol
416 -fshrink-wrap -fsignaling-nans -fsingle-precision-constant @gol
417 -fsplit-ivs-in-unroller -fsplit-wide-types -fssa-phiopt -fstack-protector @gol
418 -fstack-protector-all -fstack-protector-strong -fstrict-aliasing @gol
419 -fstrict-overflow -fthread-jumps -ftracer -ftree-bit-ccp @gol
420 -ftree-builtin-call-dce -ftree-ccp -ftree-ch @gol
421 -ftree-coalesce-inline-vars -ftree-coalesce-vars -ftree-copy-prop @gol
422 -ftree-copyrename -ftree-dce -ftree-dominator-opts -ftree-dse @gol
423 -ftree-forwprop -ftree-fre -ftree-loop-if-convert @gol
424 -ftree-loop-if-convert-stores -ftree-loop-im @gol
425 -ftree-phiprop -ftree-loop-distribution -ftree-loop-distribute-patterns @gol
426 -ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize @gol
427 -ftree-loop-vectorize @gol
428 -ftree-parallelize-loops=@var{n} -ftree-pre -ftree-partial-pre -ftree-pta @gol
429 -ftree-reassoc -ftree-sink -ftree-slsr -ftree-sra @gol
430 -ftree-switch-conversion -ftree-tail-merge -ftree-ter @gol
431 -ftree-vectorize -ftree-vrp @gol
432 -funit-at-a-time -funroll-all-loops -funroll-loops @gol
433 -funsafe-loop-optimizations -funsafe-math-optimizations -funswitch-loops @gol
434 -fuse-caller-save -fvariable-expansion-in-unroller -fvect-cost-model -fvpt @gol
435 -fweb -fwhole-program -fwpa -fuse-ld=@var{linker} -fuse-linker-plugin @gol
436 --param @var{name}=@var{value}
437 -O  -O0  -O1  -O2  -O3  -Os -Ofast -Og}
439 @item Preprocessor Options
440 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
441 @gccoptlist{-A@var{question}=@var{answer} @gol
442 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
443 -C  -dD  -dI  -dM  -dN @gol
444 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
445 -idirafter @var{dir} @gol
446 -include @var{file}  -imacros @var{file} @gol
447 -iprefix @var{file}  -iwithprefix @var{dir} @gol
448 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
449 -imultilib @var{dir} -isysroot @var{dir} @gol
450 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
451 -P  -fdebug-cpp -ftrack-macro-expansion -fworking-directory @gol
452 -remap -trigraphs  -undef  -U@var{macro}  @gol
453 -Wp,@var{option} -Xpreprocessor @var{option} -no-integrated-cpp}
455 @item Assembler Option
456 @xref{Assembler Options,,Passing Options to the Assembler}.
457 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
459 @item Linker Options
460 @xref{Link Options,,Options for Linking}.
461 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
462 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
463 -s  -static -static-libgcc -static-libstdc++ @gol
464 -static-libasan -static-libtsan -static-liblsan -static-libubsan @gol
465 -shared -shared-libgcc  -symbolic @gol
466 -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
467 -u @var{symbol} -z @var{keyword}}
469 @item Directory Options
470 @xref{Directory Options,,Options for Directory Search}.
471 @gccoptlist{-B@var{prefix} -I@var{dir} -iplugindir=@var{dir} @gol
472 -iquote@var{dir} -L@var{dir} -specs=@var{file} -I- @gol
473 --sysroot=@var{dir} --no-sysroot-suffix}
475 @item Machine Dependent Options
476 @xref{Submodel Options,,Hardware Models and Configurations}.
477 @c This list is ordered alphanumerically by subsection name.
478 @c Try and put the significant identifier (CPU or system) first,
479 @c so users have a clue at guessing where the ones they want will be.
481 @emph{AArch64 Options}
482 @gccoptlist{-mabi=@var{name}  -mbig-endian  -mlittle-endian @gol
483 -mgeneral-regs-only @gol
484 -mcmodel=tiny  -mcmodel=small  -mcmodel=large @gol
485 -mstrict-align @gol
486 -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
487 -mtls-dialect=desc  -mtls-dialect=traditional @gol
488 -march=@var{name}  -mcpu=@var{name}  -mtune=@var{name}}
490 @emph{Adapteva Epiphany Options}
491 @gccoptlist{-mhalf-reg-file -mprefer-short-insn-regs @gol
492 -mbranch-cost=@var{num} -mcmove -mnops=@var{num} -msoft-cmpsf @gol
493 -msplit-lohi -mpost-inc -mpost-modify -mstack-offset=@var{num} @gol
494 -mround-nearest -mlong-calls -mshort-calls -msmall16 @gol
495 -mfp-mode=@var{mode} -mvect-double -max-vect-align=@var{num} @gol
496 -msplit-vecmove-early -m1reg-@var{reg}}
498 @emph{ARC Options}
499 @gccoptlist{-mbarrel-shifter @gol
500 -mcpu=@var{cpu} -mA6 -mARC600 -mA7 -mARC700 @gol
501 -mdpfp -mdpfp-compact -mdpfp-fast -mno-dpfp-lrsr @gol
502 -mea -mno-mpy -mmul32x16 -mmul64 @gol
503 -mnorm -mspfp -mspfp-compact -mspfp-fast -msimd -msoft-float -mswap @gol
504 -mcrc -mdsp-packa -mdvbf -mlock -mmac-d16 -mmac-24 -mrtsc -mswape @gol
505 -mtelephony -mxy -misize -mannotate-align -marclinux -marclinux_prof @gol
506 -mepilogue-cfi -mlong-calls -mmedium-calls -msdata @gol
507 -mucb-mcount -mvolatile-cache @gol
508 -malign-call -mauto-modify-reg -mbbit-peephole -mno-brcc @gol
509 -mcase-vector-pcrel -mcompact-casesi -mno-cond-exec -mearly-cbranchsi @gol
510 -mexpand-adddi -mindexed-loads -mlra -mlra-priority-none @gol
511 -mlra-priority-compact mlra-priority-noncompact -mno-millicode @gol
512 -mmixed-code -mq-class -mRcq -mRcw -msize-level=@var{level} @gol
513 -mtune=@var{cpu} -mmultcost=@var{num} -munalign-prob-threshold=@var{probability}}
515 @emph{ARM Options}
516 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
517 -mabi=@var{name} @gol
518 -mapcs-stack-check  -mno-apcs-stack-check @gol
519 -mapcs-float  -mno-apcs-float @gol
520 -mapcs-reentrant  -mno-apcs-reentrant @gol
521 -msched-prolog  -mno-sched-prolog @gol
522 -mlittle-endian  -mbig-endian @gol
523 -mfloat-abi=@var{name} @gol
524 -mfp16-format=@var{name}
525 -mthumb-interwork  -mno-thumb-interwork @gol
526 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
527 -mstructure-size-boundary=@var{n} @gol
528 -mabort-on-noreturn @gol
529 -mlong-calls  -mno-long-calls @gol
530 -msingle-pic-base  -mno-single-pic-base @gol
531 -mpic-register=@var{reg} @gol
532 -mnop-fun-dllimport @gol
533 -mpoke-function-name @gol
534 -mthumb  -marm @gol
535 -mtpcs-frame  -mtpcs-leaf-frame @gol
536 -mcaller-super-interworking  -mcallee-super-interworking @gol
537 -mtp=@var{name} -mtls-dialect=@var{dialect} @gol
538 -mword-relocations @gol
539 -mfix-cortex-m3-ldrd @gol
540 -munaligned-access @gol
541 -mneon-for-64bits @gol
542 -mslow-flash-data @gol
543 -mrestrict-it}
545 @emph{AVR Options}
546 @gccoptlist{-mmcu=@var{mcu} -maccumulate-args -mbranch-cost=@var{cost} @gol
547 -mcall-prologues -mint8 -mno-interrupts -mrelax @gol
548 -mstrict-X -mtiny-stack -Waddr-space-convert}
550 @emph{Blackfin Options}
551 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
552 -msim -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
553 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
554 -mlow-64k -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
555 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
556 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
557 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
558 -mfast-fp -minline-plt -mmulticore  -mcorea  -mcoreb  -msdram @gol
559 -micplb}
561 @emph{C6X Options}
562 @gccoptlist{-mbig-endian  -mlittle-endian -march=@var{cpu} @gol
563 -msim -msdata=@var{sdata-type}}
565 @emph{CRIS Options}
566 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
567 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
568 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
569 -mstack-align  -mdata-align  -mconst-align @gol
570 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
571 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
572 -mmul-bug-workaround  -mno-mul-bug-workaround}
574 @emph{CR16 Options}
575 @gccoptlist{-mmac @gol
576 -mcr16cplus -mcr16c @gol
577 -msim -mint32 -mbit-ops
578 -mdata-model=@var{model}}
580 @emph{Darwin Options}
581 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
582 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
583 -client_name  -compatibility_version  -current_version @gol
584 -dead_strip @gol
585 -dependency-file  -dylib_file  -dylinker_install_name @gol
586 -dynamic  -dynamiclib  -exported_symbols_list @gol
587 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
588 -force_flat_namespace  -headerpad_max_install_names @gol
589 -iframework @gol
590 -image_base  -init  -install_name  -keep_private_externs @gol
591 -multi_module  -multiply_defined  -multiply_defined_unused @gol
592 -noall_load   -no_dead_strip_inits_and_terms @gol
593 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
594 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
595 -private_bundle  -read_only_relocs  -sectalign @gol
596 -sectobjectsymbols  -whyload  -seg1addr @gol
597 -sectcreate  -sectobjectsymbols  -sectorder @gol
598 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
599 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
600 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
601 -single_module  -static  -sub_library  -sub_umbrella @gol
602 -twolevel_namespace  -umbrella  -undefined @gol
603 -unexported_symbols_list  -weak_reference_mismatches @gol
604 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
605 -mkernel -mone-byte-bool}
607 @emph{DEC Alpha Options}
608 @gccoptlist{-mno-fp-regs  -msoft-float @gol
609 -mieee  -mieee-with-inexact  -mieee-conformant @gol
610 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
611 -mtrap-precision=@var{mode}  -mbuild-constants @gol
612 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
613 -mbwx  -mmax  -mfix  -mcix @gol
614 -mfloat-vax  -mfloat-ieee @gol
615 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
616 -msmall-text  -mlarge-text @gol
617 -mmemory-latency=@var{time}}
619 @emph{FR30 Options}
620 @gccoptlist{-msmall-model -mno-lsim}
622 @emph{FRV Options}
623 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
624 -mhard-float  -msoft-float @gol
625 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
626 -mdouble  -mno-double @gol
627 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
628 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
629 -mlinked-fp  -mlong-calls  -malign-labels @gol
630 -mlibrary-pic  -macc-4  -macc-8 @gol
631 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
632 -moptimize-membar -mno-optimize-membar @gol
633 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
634 -mvliw-branch  -mno-vliw-branch @gol
635 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
636 -mno-nested-cond-exec  -mtomcat-stats @gol
637 -mTLS -mtls @gol
638 -mcpu=@var{cpu}}
640 @emph{GNU/Linux Options}
641 @gccoptlist{-mglibc -muclibc -mbionic -mandroid @gol
642 -tno-android-cc -tno-android-ld}
644 @emph{H8/300 Options}
645 @gccoptlist{-mrelax  -mh  -ms  -mn  -mexr -mno-exr  -mint32  -malign-300}
647 @emph{HPPA Options}
648 @gccoptlist{-march=@var{architecture-type} @gol
649 -mdisable-fpregs  -mdisable-indexing @gol
650 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
651 -mfixed-range=@var{register-range} @gol
652 -mjump-in-delay -mlinker-opt -mlong-calls @gol
653 -mlong-load-store  -mno-disable-fpregs @gol
654 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
655 -mno-jump-in-delay  -mno-long-load-store @gol
656 -mno-portable-runtime  -mno-soft-float @gol
657 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
658 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
659 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
660 -munix=@var{unix-std}  -nolibdld  -static  -threads}
662 @emph{i386 and x86-64 Options}
663 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
664 -mtune-ctrl=@var{feature-list} -mdump-tune-features -mno-default @gol
665 -mfpmath=@var{unit} @gol
666 -masm=@var{dialect}  -mno-fancy-math-387 @gol
667 -mno-fp-ret-in-387  -msoft-float @gol
668 -mno-wide-multiply  -mrtd  -malign-double @gol
669 -mpreferred-stack-boundary=@var{num} @gol
670 -mincoming-stack-boundary=@var{num} @gol
671 -mcld -mcx16 -msahf -mmovbe -mcrc32 @gol
672 -mrecip -mrecip=@var{opt} @gol
673 -mvzeroupper -mprefer-avx128 @gol
674 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx @gol
675 -mavx2 -mavx512f -mavx512pf -mavx512er -mavx512cd -msha @gol
676 -maes -mpclmul -mfsgsbase -mrdrnd -mf16c -mfma -mprefetchwt1 @gol
677 -mclflushopt -mxsavec -mxsaves @gol
678 -msse4a -m3dnow -mpopcnt -mabm -mbmi -mtbm -mfma4 -mxop -mlzcnt @gol
679 -mbmi2 -mfxsr -mxsave -mxsaveopt -mrtm -mlwp -mthreads @gol
680 -mno-align-stringops  -minline-all-stringops @gol
681 -minline-stringops-dynamically -mstringop-strategy=@var{alg} @gol
682 -mmemcpy-strategy=@var{strategy} -mmemset-strategy=@var{strategy}
683 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
684 -m96bit-long-double -mlong-double-64 -mlong-double-80 -mlong-double-128 @gol
685 -mregparm=@var{num}  -msseregparm @gol
686 -mveclibabi=@var{type} -mvect8-ret-in-mem @gol
687 -mpc32 -mpc64 -mpc80 -mstackrealign @gol
688 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
689 -mcmodel=@var{code-model} -mabi=@var{name} -maddress-mode=@var{mode} @gol
690 -m32 -m64 -mx32 -m16 -mlarge-data-threshold=@var{num} @gol
691 -msse2avx -mfentry -m8bit-idiv @gol
692 -mavx256-split-unaligned-load -mavx256-split-unaligned-store @gol
693 -mstack-protector-guard=@var{guard}}
695 @emph{i386 and x86-64 Windows Options}
696 @gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll @gol
697 -mnop-fun-dllimport -mthread @gol
698 -municode -mwin32 -mwindows -fno-set-stack-executable}
700 @emph{IA-64 Options}
701 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
702 -mvolatile-asm-stop  -mregister-names  -msdata -mno-sdata @gol
703 -mconstant-gp  -mauto-pic  -mfused-madd @gol
704 -minline-float-divide-min-latency @gol
705 -minline-float-divide-max-throughput @gol
706 -mno-inline-float-divide @gol
707 -minline-int-divide-min-latency @gol
708 -minline-int-divide-max-throughput  @gol
709 -mno-inline-int-divide @gol
710 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
711 -mno-inline-sqrt @gol
712 -mdwarf2-asm -mearly-stop-bits @gol
713 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
714 -mtune=@var{cpu-type} -milp32 -mlp64 @gol
715 -msched-br-data-spec -msched-ar-data-spec -msched-control-spec @gol
716 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
717 -msched-spec-ldc -msched-spec-control-ldc @gol
718 -msched-prefer-non-data-spec-insns -msched-prefer-non-control-spec-insns @gol
719 -msched-stop-bits-after-every-cycle -msched-count-spec-in-critical-path @gol
720 -msel-sched-dont-check-control-spec -msched-fp-mem-deps-zero-cost @gol
721 -msched-max-memory-insns-hard-limit -msched-max-memory-insns=@var{max-insns}}
723 @emph{LM32 Options}
724 @gccoptlist{-mbarrel-shift-enabled -mdivide-enabled -mmultiply-enabled @gol
725 -msign-extend-enabled -muser-enabled}
727 @emph{M32R/D Options}
728 @gccoptlist{-m32r2 -m32rx -m32r @gol
729 -mdebug @gol
730 -malign-loops -mno-align-loops @gol
731 -missue-rate=@var{number} @gol
732 -mbranch-cost=@var{number} @gol
733 -mmodel=@var{code-size-model-type} @gol
734 -msdata=@var{sdata-type} @gol
735 -mno-flush-func -mflush-func=@var{name} @gol
736 -mno-flush-trap -mflush-trap=@var{number} @gol
737 -G @var{num}}
739 @emph{M32C Options}
740 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
742 @emph{M680x0 Options}
743 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune}
744 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
745 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
746 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
747 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
748 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
749 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
750 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
751 -mxgot -mno-xgot}
753 @emph{MCore Options}
754 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
755 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
756 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
757 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
758 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
760 @emph{MeP Options}
761 @gccoptlist{-mabsdiff -mall-opts -maverage -mbased=@var{n} -mbitops @gol
762 -mc=@var{n} -mclip -mconfig=@var{name} -mcop -mcop32 -mcop64 -mivc2 @gol
763 -mdc -mdiv -meb -mel -mio-volatile -ml -mleadz -mm -mminmax @gol
764 -mmult -mno-opts -mrepeat -ms -msatur -msdram -msim -msimnovec -mtf @gol
765 -mtiny=@var{n}}
767 @emph{MicroBlaze Options}
768 @gccoptlist{-msoft-float -mhard-float -msmall-divides -mcpu=@var{cpu} @gol
769 -mmemcpy -mxl-soft-mul -mxl-soft-div -mxl-barrel-shift @gol
770 -mxl-pattern-compare -mxl-stack-check -mxl-gp-opt -mno-clearbss @gol
771 -mxl-multiply-high -mxl-float-convert -mxl-float-sqrt @gol
772 -mbig-endian -mlittle-endian -mxl-reorder -mxl-mode-@var{app-model}}
774 @emph{MIPS Options}
775 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
776 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2  -mips32r3  -mips32r5 @gol
777 -mips64  -mips64r2  -mips64r3  -mips64r5 @gol
778 -mips16  -mno-mips16  -mflip-mips16 @gol
779 -minterlink-compressed -mno-interlink-compressed @gol
780 -minterlink-mips16  -mno-interlink-mips16 @gol
781 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
782 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
783 -mgp32  -mgp64  -mfp32  -mfp64  -mhard-float  -msoft-float @gol
784 -mno-float  -msingle-float  -mdouble-float @gol
785 -mabs=@var{mode}  -mnan=@var{encoding} @gol
786 -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
787 -mmcu -mmno-mcu @gol
788 -meva -mno-eva @gol
789 -mvirt -mno-virt @gol
790 -mxpa -mno-xpa @gol
791 -mmicromips -mno-micromips @gol
792 -mfpu=@var{fpu-type} @gol
793 -msmartmips  -mno-smartmips @gol
794 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
795 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
796 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
797 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
798 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
799 -membedded-data  -mno-embedded-data @gol
800 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
801 -mcode-readable=@var{setting} @gol
802 -msplit-addresses  -mno-split-addresses @gol
803 -mexplicit-relocs  -mno-explicit-relocs @gol
804 -mcheck-zero-division  -mno-check-zero-division @gol
805 -mdivide-traps  -mdivide-breaks @gol
806 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
807 -mmad -mno-mad -mimadd -mno-imadd -mfused-madd  -mno-fused-madd  -nocpp @gol
808 -mfix-24k -mno-fix-24k @gol
809 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
810 -mfix-r10000 -mno-fix-r10000  -mfix-rm7000 -mno-fix-rm7000 @gol
811 -mfix-vr4120  -mno-fix-vr4120 @gol
812 -mfix-vr4130  -mno-fix-vr4130  -mfix-sb1  -mno-fix-sb1 @gol
813 -mflush-func=@var{func}  -mno-flush-func @gol
814 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
815 -mfp-exceptions -mno-fp-exceptions @gol
816 -mvr4130-align -mno-vr4130-align -msynci -mno-synci @gol
817 -mrelax-pic-calls -mno-relax-pic-calls -mmcount-ra-address}
819 @emph{MMIX Options}
820 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
821 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
822 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
823 -mno-base-addresses  -msingle-exit  -mno-single-exit}
825 @emph{MN10300 Options}
826 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
827 -mno-am33 -mam33 -mam33-2 -mam34 @gol
828 -mtune=@var{cpu-type} @gol
829 -mreturn-pointer-on-d0 @gol
830 -mno-crt0  -mrelax -mliw -msetlb}
832 @emph{Moxie Options}
833 @gccoptlist{-meb -mel -mno-crt0}
835 @emph{MSP430 Options}
836 @gccoptlist{-msim -masm-hex -mmcu= -mcpu= -mlarge -msmall -mrelax @gol
837 -mhwmult=}
839 @emph{NDS32 Options}
840 @gccoptlist{-mbig-endian -mlittle-endian @gol
841 -mreduced-regs -mfull-regs @gol
842 -mcmov -mno-cmov @gol
843 -mperf-ext -mno-perf-ext @gol
844 -mv3push -mno-v3push @gol
845 -m16bit -mno-16bit @gol
846 -mgp-direct -mno-gp-direct @gol
847 -misr-vector-size=@var{num} @gol
848 -mcache-block-size=@var{num} @gol
849 -march=@var{arch} @gol
850 -mforce-fp-as-gp -mforbid-fp-as-gp @gol
851 -mex9 -mctor-dtor -mrelax}
853 @emph{Nios II Options}
854 @gccoptlist{-G @var{num} -mgpopt -mno-gpopt -mel -meb @gol
855 -mno-bypass-cache -mbypass-cache @gol
856 -mno-cache-volatile -mcache-volatile @gol
857 -mno-fast-sw-div -mfast-sw-div @gol
858 -mhw-mul -mno-hw-mul -mhw-mulx -mno-hw-mulx -mno-hw-div -mhw-div @gol
859 -mcustom-@var{insn}=@var{N} -mno-custom-@var{insn} @gol
860 -mcustom-fpu-cfg=@var{name} @gol
861 -mhal -msmallc -msys-crt0=@var{name} -msys-lib=@var{name}}
863 @emph{PDP-11 Options}
864 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
865 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
866 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
867 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
868 -mbranch-expensive  -mbranch-cheap @gol
869 -munix-asm  -mdec-asm}
871 @emph{picoChip Options}
872 @gccoptlist{-mae=@var{ae_type} -mvliw-lookahead=@var{N} @gol
873 -msymbol-as-address -mno-inefficient-warnings}
875 @emph{PowerPC Options}
876 See RS/6000 and PowerPC Options.
878 @emph{RL78 Options}
879 @gccoptlist{-msim -mmul=none -mmul=g13 -mmul=rl78 -m64bit-doubles -m32bit-doubles}
881 @emph{RS/6000 and PowerPC Options}
882 @gccoptlist{-mcpu=@var{cpu-type} @gol
883 -mtune=@var{cpu-type} @gol
884 -mcmodel=@var{code-model} @gol
885 -mpowerpc64 @gol
886 -maltivec  -mno-altivec @gol
887 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
888 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
889 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb -mpopcntd -mno-popcntd @gol
890 -mfprnd  -mno-fprnd @gol
891 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp @gol
892 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
893 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
894 -malign-power  -malign-natural @gol
895 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
896 -msingle-float -mdouble-float -msimple-fpu @gol
897 -mstring  -mno-string  -mupdate  -mno-update @gol
898 -mavoid-indexed-addresses  -mno-avoid-indexed-addresses @gol
899 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
900 -mstrict-align  -mno-strict-align  -mrelocatable @gol
901 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
902 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
903 -mdynamic-no-pic  -maltivec -mswdiv  -msingle-pic-base @gol
904 -mprioritize-restricted-insns=@var{priority} @gol
905 -msched-costly-dep=@var{dependence_type} @gol
906 -minsert-sched-nops=@var{scheme} @gol
907 -mcall-sysv  -mcall-netbsd @gol
908 -maix-struct-return  -msvr4-struct-return @gol
909 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
910 -mblock-move-inline-limit=@var{num} @gol
911 -misel -mno-isel @gol
912 -misel=yes  -misel=no @gol
913 -mspe -mno-spe @gol
914 -mspe=yes  -mspe=no @gol
915 -mpaired @gol
916 -mgen-cell-microcode -mwarn-cell-microcode @gol
917 -mvrsave -mno-vrsave @gol
918 -mmulhw -mno-mulhw @gol
919 -mdlmzb -mno-dlmzb @gol
920 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
921 -mprototype  -mno-prototype @gol
922 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
923 -msdata=@var{opt}  -mvxworks  -G @var{num}  -pthread @gol
924 -mrecip -mrecip=@var{opt} -mno-recip -mrecip-precision @gol
925 -mno-recip-precision @gol
926 -mveclibabi=@var{type} -mfriz -mno-friz @gol
927 -mpointers-to-nested-functions -mno-pointers-to-nested-functions @gol
928 -msave-toc-indirect -mno-save-toc-indirect @gol
929 -mpower8-fusion -mno-mpower8-fusion -mpower8-vector -mno-power8-vector @gol
930 -mcrypto -mno-crypto -mdirect-move -mno-direct-move @gol
931 -mquad-memory -mno-quad-memory @gol
932 -mquad-memory-atomic -mno-quad-memory-atomic @gol
933 -mcompat-align-parm -mno-compat-align-parm}
935 @emph{RX Options}
936 @gccoptlist{-m64bit-doubles  -m32bit-doubles  -fpu  -nofpu@gol
937 -mcpu=@gol
938 -mbig-endian-data -mlittle-endian-data @gol
939 -msmall-data @gol
940 -msim  -mno-sim@gol
941 -mas100-syntax -mno-as100-syntax@gol
942 -mrelax@gol
943 -mmax-constant-size=@gol
944 -mint-register=@gol
945 -mpid@gol
946 -mno-warn-multiple-fast-interrupts@gol
947 -msave-acc-in-interrupts}
949 @emph{S/390 and zSeries Options}
950 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
951 -mhard-float  -msoft-float  -mhard-dfp -mno-hard-dfp @gol
952 -mlong-double-64 -mlong-double-128 @gol
953 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
954 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
955 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
956 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
957 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard @gol
958 -mhotpatch[=@var{halfwords}] -mno-hotpatch}
960 @emph{Score Options}
961 @gccoptlist{-meb -mel @gol
962 -mnhwloop @gol
963 -muls @gol
964 -mmac @gol
965 -mscore5 -mscore5u -mscore7 -mscore7d}
967 @emph{SH Options}
968 @gccoptlist{-m1  -m2  -m2e @gol
969 -m2a-nofpu -m2a-single-only -m2a-single -m2a @gol
970 -m3  -m3e @gol
971 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
972 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
973 -m5-64media  -m5-64media-nofpu @gol
974 -m5-32media  -m5-32media-nofpu @gol
975 -m5-compact  -m5-compact-nofpu @gol
976 -mb  -ml  -mdalign  -mrelax @gol
977 -mbigtable -mfmovd -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
978 -mieee -mno-ieee -mbitops  -misize  -minline-ic_invalidate -mpadstruct @gol
979 -mspace -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
980 -mdivsi3_libfunc=@var{name} -mfixed-range=@var{register-range} @gol
981 -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
982 -maccumulate-outgoing-args -minvalid-symbols @gol
983 -matomic-model=@var{atomic-model} @gol
984 -mbranch-cost=@var{num} -mzdcbranch -mno-zdcbranch @gol
985 -mfused-madd -mno-fused-madd -mfsca -mno-fsca -mfsrra -mno-fsrra @gol
986 -mpretend-cmove -mtas}
988 @emph{Solaris 2 Options}
989 @gccoptlist{-mclear-hwcap -mno-clear-hwcap -mimpure-text  -mno-impure-text @gol
990 -pthreads -pthread}
992 @emph{SPARC Options}
993 @gccoptlist{-mcpu=@var{cpu-type} @gol
994 -mtune=@var{cpu-type} @gol
995 -mcmodel=@var{code-model} @gol
996 -mmemory-model=@var{mem-model} @gol
997 -m32  -m64  -mapp-regs  -mno-app-regs @gol
998 -mfaster-structs  -mno-faster-structs  -mflat  -mno-flat @gol
999 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
1000 -mhard-quad-float  -msoft-quad-float @gol
1001 -mstack-bias  -mno-stack-bias @gol
1002 -munaligned-doubles  -mno-unaligned-doubles @gol
1003 -muser-mode  -mno-user-mode @gol
1004 -mv8plus  -mno-v8plus  -mvis  -mno-vis @gol
1005 -mvis2  -mno-vis2  -mvis3  -mno-vis3 @gol
1006 -mcbcond -mno-cbcond @gol
1007 -mfmaf  -mno-fmaf  -mpopc  -mno-popc @gol
1008 -mfix-at697f -mfix-ut699}
1010 @emph{SPU Options}
1011 @gccoptlist{-mwarn-reloc -merror-reloc @gol
1012 -msafe-dma -munsafe-dma @gol
1013 -mbranch-hints @gol
1014 -msmall-mem -mlarge-mem -mstdmain @gol
1015 -mfixed-range=@var{register-range} @gol
1016 -mea32 -mea64 @gol
1017 -maddress-space-conversion -mno-address-space-conversion @gol
1018 -mcache-size=@var{cache-size} @gol
1019 -matomic-updates -mno-atomic-updates}
1021 @emph{System V Options}
1022 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
1024 @emph{TILE-Gx Options}
1025 @gccoptlist{-mcpu=CPU -m32 -m64 -mbig-endian -mlittle-endian @gol
1026 -mcmodel=@var{code-model}}
1028 @emph{TILEPro Options}
1029 @gccoptlist{-mcpu=@var{cpu} -m32}
1031 @emph{V850 Options}
1032 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
1033 -mprolog-function  -mno-prolog-function  -mspace @gol
1034 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
1035 -mapp-regs  -mno-app-regs @gol
1036 -mdisable-callt  -mno-disable-callt @gol
1037 -mv850e2v3 -mv850e2 -mv850e1 -mv850es @gol
1038 -mv850e -mv850 -mv850e3v5 @gol
1039 -mloop @gol
1040 -mrelax @gol
1041 -mlong-jumps @gol
1042 -msoft-float @gol
1043 -mhard-float @gol
1044 -mgcc-abi @gol
1045 -mrh850-abi @gol
1046 -mbig-switch}
1048 @emph{VAX Options}
1049 @gccoptlist{-mg  -mgnu  -munix}
1051 @emph{VMS Options}
1052 @gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64 @gol
1053 -mpointer-size=@var{size}}
1055 @emph{VxWorks Options}
1056 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
1057 -Xbind-lazy  -Xbind-now}
1059 @emph{x86-64 Options}
1060 See i386 and x86-64 Options.
1062 @emph{Xstormy16 Options}
1063 @gccoptlist{-msim}
1065 @emph{Xtensa Options}
1066 @gccoptlist{-mconst16 -mno-const16 @gol
1067 -mfused-madd  -mno-fused-madd @gol
1068 -mforce-no-pic @gol
1069 -mserialize-volatile  -mno-serialize-volatile @gol
1070 -mtext-section-literals  -mno-text-section-literals @gol
1071 -mtarget-align  -mno-target-align @gol
1072 -mlongcalls  -mno-longcalls}
1074 @emph{zSeries Options}
1075 See S/390 and zSeries Options.
1077 @item Code Generation Options
1078 @xref{Code Gen Options,,Options for Code Generation Conventions}.
1079 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
1080 -ffixed-@var{reg}  -fexceptions @gol
1081 -fnon-call-exceptions  -fdelete-dead-exceptions  -funwind-tables @gol
1082 -fasynchronous-unwind-tables @gol
1083 -fno-gnu-unique @gol
1084 -finhibit-size-directive  -finstrument-functions @gol
1085 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
1086 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol
1087 -fno-common  -fno-ident @gol
1088 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
1089 -fno-jump-tables @gol
1090 -frecord-gcc-switches @gol
1091 -freg-struct-return  -fshort-enums @gol
1092 -fshort-double  -fshort-wchar @gol
1093 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
1094 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
1095 -fno-stack-limit -fsplit-stack @gol
1096 -fleading-underscore  -ftls-model=@var{model} @gol
1097 -fstack-reuse=@var{reuse_level} @gol
1098 -ftrapv  -fwrapv  -fbounds-check @gol
1099 -fvisibility -fstrict-volatile-bitfields -fsync-libcalls}
1100 @end table
1103 @node Overall Options
1104 @section Options Controlling the Kind of Output
1106 Compilation can involve up to four stages: preprocessing, compilation
1107 proper, assembly and linking, always in that order.  GCC is capable of
1108 preprocessing and compiling several files either into several
1109 assembler input files, or into one assembler input file; then each
1110 assembler input file produces an object file, and linking combines all
1111 the object files (those newly compiled, and those specified as input)
1112 into an executable file.
1114 @cindex file name suffix
1115 For any given input file, the file name suffix determines what kind of
1116 compilation is done:
1118 @table @gcctabopt
1119 @item @var{file}.c
1120 C source code that must be preprocessed.
1122 @item @var{file}.i
1123 C source code that should not be preprocessed.
1125 @item @var{file}.ii
1126 C++ source code that should not be preprocessed.
1128 @item @var{file}.m
1129 Objective-C source code.  Note that you must link with the @file{libobjc}
1130 library to make an Objective-C program work.
1132 @item @var{file}.mi
1133 Objective-C source code that should not be preprocessed.
1135 @item @var{file}.mm
1136 @itemx @var{file}.M
1137 Objective-C++ source code.  Note that you must link with the @file{libobjc}
1138 library to make an Objective-C++ program work.  Note that @samp{.M} refers
1139 to a literal capital M@.
1141 @item @var{file}.mii
1142 Objective-C++ source code that should not be preprocessed.
1144 @item @var{file}.h
1145 C, C++, Objective-C or Objective-C++ header file to be turned into a
1146 precompiled header (default), or C, C++ header file to be turned into an
1147 Ada spec (via the @option{-fdump-ada-spec} switch).
1149 @item @var{file}.cc
1150 @itemx @var{file}.cp
1151 @itemx @var{file}.cxx
1152 @itemx @var{file}.cpp
1153 @itemx @var{file}.CPP
1154 @itemx @var{file}.c++
1155 @itemx @var{file}.C
1156 C++ source code that must be preprocessed.  Note that in @samp{.cxx},
1157 the last two letters must both be literally @samp{x}.  Likewise,
1158 @samp{.C} refers to a literal capital C@.
1160 @item @var{file}.mm
1161 @itemx @var{file}.M
1162 Objective-C++ source code that must be preprocessed.
1164 @item @var{file}.mii
1165 Objective-C++ source code that should not be preprocessed.
1167 @item @var{file}.hh
1168 @itemx @var{file}.H
1169 @itemx @var{file}.hp
1170 @itemx @var{file}.hxx
1171 @itemx @var{file}.hpp
1172 @itemx @var{file}.HPP
1173 @itemx @var{file}.h++
1174 @itemx @var{file}.tcc
1175 C++ header file to be turned into a precompiled header or Ada spec.
1177 @item @var{file}.f
1178 @itemx @var{file}.for
1179 @itemx @var{file}.ftn
1180 Fixed form Fortran source code that should not be preprocessed.
1182 @item @var{file}.F
1183 @itemx @var{file}.FOR
1184 @itemx @var{file}.fpp
1185 @itemx @var{file}.FPP
1186 @itemx @var{file}.FTN
1187 Fixed form Fortran source code that must be preprocessed (with the traditional
1188 preprocessor).
1190 @item @var{file}.f90
1191 @itemx @var{file}.f95
1192 @itemx @var{file}.f03
1193 @itemx @var{file}.f08
1194 Free form Fortran source code that should not be preprocessed.
1196 @item @var{file}.F90
1197 @itemx @var{file}.F95
1198 @itemx @var{file}.F03
1199 @itemx @var{file}.F08
1200 Free form Fortran source code that must be preprocessed (with the
1201 traditional preprocessor).
1203 @item @var{file}.go
1204 Go source code.
1206 @c FIXME: Descriptions of Java file types.
1207 @c @var{file}.java
1208 @c @var{file}.class
1209 @c @var{file}.zip
1210 @c @var{file}.jar
1212 @item @var{file}.ads
1213 Ada source code file that contains a library unit declaration (a
1214 declaration of a package, subprogram, or generic, or a generic
1215 instantiation), or a library unit renaming declaration (a package,
1216 generic, or subprogram renaming declaration).  Such files are also
1217 called @dfn{specs}.
1219 @item @var{file}.adb
1220 Ada source code file containing a library unit body (a subprogram or
1221 package body).  Such files are also called @dfn{bodies}.
1223 @c GCC also knows about some suffixes for languages not yet included:
1224 @c Pascal:
1225 @c @var{file}.p
1226 @c @var{file}.pas
1227 @c Ratfor:
1228 @c @var{file}.r
1230 @item @var{file}.s
1231 Assembler code.
1233 @item @var{file}.S
1234 @itemx @var{file}.sx
1235 Assembler code that must be preprocessed.
1237 @item @var{other}
1238 An object file to be fed straight into linking.
1239 Any file name with no recognized suffix is treated this way.
1240 @end table
1242 @opindex x
1243 You can specify the input language explicitly with the @option{-x} option:
1245 @table @gcctabopt
1246 @item -x @var{language}
1247 Specify explicitly the @var{language} for the following input files
1248 (rather than letting the compiler choose a default based on the file
1249 name suffix).  This option applies to all following input files until
1250 the next @option{-x} option.  Possible values for @var{language} are:
1251 @smallexample
1252 c  c-header  cpp-output
1253 c++  c++-header  c++-cpp-output
1254 objective-c  objective-c-header  objective-c-cpp-output
1255 objective-c++ objective-c++-header objective-c++-cpp-output
1256 assembler  assembler-with-cpp
1258 f77  f77-cpp-input f95  f95-cpp-input
1260 java
1261 @end smallexample
1263 @item -x none
1264 Turn off any specification of a language, so that subsequent files are
1265 handled according to their file name suffixes (as they are if @option{-x}
1266 has not been used at all).
1268 @item -pass-exit-codes
1269 @opindex pass-exit-codes
1270 Normally the @command{gcc} program exits with the code of 1 if any
1271 phase of the compiler returns a non-success return code.  If you specify
1272 @option{-pass-exit-codes}, the @command{gcc} program instead returns with
1273 the numerically highest error produced by any phase returning an error
1274 indication.  The C, C++, and Fortran front ends return 4 if an internal
1275 compiler error is encountered.
1276 @end table
1278 If you only want some of the stages of compilation, you can use
1279 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1280 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1281 @command{gcc} is to stop.  Note that some combinations (for example,
1282 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1284 @table @gcctabopt
1285 @item -c
1286 @opindex c
1287 Compile or assemble the source files, but do not link.  The linking
1288 stage simply is not done.  The ultimate output is in the form of an
1289 object file for each source file.
1291 By default, the object file name for a source file is made by replacing
1292 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1294 Unrecognized input files, not requiring compilation or assembly, are
1295 ignored.
1297 @item -S
1298 @opindex S
1299 Stop after the stage of compilation proper; do not assemble.  The output
1300 is in the form of an assembler code file for each non-assembler input
1301 file specified.
1303 By default, the assembler file name for a source file is made by
1304 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1306 Input files that don't require compilation are ignored.
1308 @item -E
1309 @opindex E
1310 Stop after the preprocessing stage; do not run the compiler proper.  The
1311 output is in the form of preprocessed source code, which is sent to the
1312 standard output.
1314 Input files that don't require preprocessing are ignored.
1316 @cindex output file option
1317 @item -o @var{file}
1318 @opindex o
1319 Place output in file @var{file}.  This applies to whatever
1320 sort of output is being produced, whether it be an executable file,
1321 an object file, an assembler file or preprocessed C code.
1323 If @option{-o} is not specified, the default is to put an executable
1324 file in @file{a.out}, the object file for
1325 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1326 assembler file in @file{@var{source}.s}, a precompiled header file in
1327 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1328 standard output.
1330 @item -v
1331 @opindex v
1332 Print (on standard error output) the commands executed to run the stages
1333 of compilation.  Also print the version number of the compiler driver
1334 program and of the preprocessor and the compiler proper.
1336 @item -###
1337 @opindex ###
1338 Like @option{-v} except the commands are not executed and arguments
1339 are quoted unless they contain only alphanumeric characters or @code{./-_}.
1340 This is useful for shell scripts to capture the driver-generated command lines.
1342 @item -pipe
1343 @opindex pipe
1344 Use pipes rather than temporary files for communication between the
1345 various stages of compilation.  This fails to work on some systems where
1346 the assembler is unable to read from a pipe; but the GNU assembler has
1347 no trouble.
1349 @item --help
1350 @opindex help
1351 Print (on the standard output) a description of the command-line options
1352 understood by @command{gcc}.  If the @option{-v} option is also specified
1353 then @option{--help} is also passed on to the various processes
1354 invoked by @command{gcc}, so that they can display the command-line options
1355 they accept.  If the @option{-Wextra} option has also been specified
1356 (prior to the @option{--help} option), then command-line options that
1357 have no documentation associated with them are also displayed.
1359 @item --target-help
1360 @opindex target-help
1361 Print (on the standard output) a description of target-specific command-line
1362 options for each tool.  For some targets extra target-specific
1363 information may also be printed.
1365 @item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]}
1366 Print (on the standard output) a description of the command-line
1367 options understood by the compiler that fit into all specified classes
1368 and qualifiers.  These are the supported classes:
1370 @table @asis
1371 @item @samp{optimizers}
1372 Display all of the optimization options supported by the
1373 compiler.
1375 @item @samp{warnings}
1376 Display all of the options controlling warning messages
1377 produced by the compiler.
1379 @item @samp{target}
1380 Display target-specific options.  Unlike the
1381 @option{--target-help} option however, target-specific options of the
1382 linker and assembler are not displayed.  This is because those
1383 tools do not currently support the extended @option{--help=} syntax.
1385 @item @samp{params}
1386 Display the values recognized by the @option{--param}
1387 option.
1389 @item @var{language}
1390 Display the options supported for @var{language}, where
1391 @var{language} is the name of one of the languages supported in this
1392 version of GCC@.
1394 @item @samp{common}
1395 Display the options that are common to all languages.
1396 @end table
1398 These are the supported qualifiers:
1400 @table @asis
1401 @item @samp{undocumented}
1402 Display only those options that are undocumented.
1404 @item @samp{joined}
1405 Display options taking an argument that appears after an equal
1406 sign in the same continuous piece of text, such as:
1407 @samp{--help=target}.
1409 @item @samp{separate}
1410 Display options taking an argument that appears as a separate word
1411 following the original option, such as: @samp{-o output-file}.
1412 @end table
1414 Thus for example to display all the undocumented target-specific
1415 switches supported by the compiler, use:
1417 @smallexample
1418 --help=target,undocumented
1419 @end smallexample
1421 The sense of a qualifier can be inverted by prefixing it with the
1422 @samp{^} character, so for example to display all binary warning
1423 options (i.e., ones that are either on or off and that do not take an
1424 argument) that have a description, use:
1426 @smallexample
1427 --help=warnings,^joined,^undocumented
1428 @end smallexample
1430 The argument to @option{--help=} should not consist solely of inverted
1431 qualifiers.
1433 Combining several classes is possible, although this usually
1434 restricts the output so much that there is nothing to display.  One
1435 case where it does work, however, is when one of the classes is
1436 @var{target}.  For example, to display all the target-specific
1437 optimization options, use:
1439 @smallexample
1440 --help=target,optimizers
1441 @end smallexample
1443 The @option{--help=} option can be repeated on the command line.  Each
1444 successive use displays its requested class of options, skipping
1445 those that have already been displayed.
1447 If the @option{-Q} option appears on the command line before the
1448 @option{--help=} option, then the descriptive text displayed by
1449 @option{--help=} is changed.  Instead of describing the displayed
1450 options, an indication is given as to whether the option is enabled,
1451 disabled or set to a specific value (assuming that the compiler
1452 knows this at the point where the @option{--help=} option is used).
1454 Here is a truncated example from the ARM port of @command{gcc}:
1456 @smallexample
1457   % gcc -Q -mabi=2 --help=target -c
1458   The following options are target specific:
1459   -mabi=                                2
1460   -mabort-on-noreturn                   [disabled]
1461   -mapcs                                [disabled]
1462 @end smallexample
1464 The output is sensitive to the effects of previous command-line
1465 options, so for example it is possible to find out which optimizations
1466 are enabled at @option{-O2} by using:
1468 @smallexample
1469 -Q -O2 --help=optimizers
1470 @end smallexample
1472 Alternatively you can discover which binary optimizations are enabled
1473 by @option{-O3} by using:
1475 @smallexample
1476 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1477 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1478 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1479 @end smallexample
1481 @item -no-canonical-prefixes
1482 @opindex no-canonical-prefixes
1483 Do not expand any symbolic links, resolve references to @samp{/../}
1484 or @samp{/./}, or make the path absolute when generating a relative
1485 prefix.
1487 @item --version
1488 @opindex version
1489 Display the version number and copyrights of the invoked GCC@.
1491 @item -wrapper
1492 @opindex wrapper
1493 Invoke all subcommands under a wrapper program.  The name of the
1494 wrapper program and its parameters are passed as a comma separated
1495 list.
1497 @smallexample
1498 gcc -c t.c -wrapper gdb,--args
1499 @end smallexample
1501 @noindent
1502 This invokes all subprograms of @command{gcc} under
1503 @samp{gdb --args}, thus the invocation of @command{cc1} is
1504 @samp{gdb --args cc1 @dots{}}.
1506 @item -fplugin=@var{name}.so
1507 @opindex fplugin
1508 Load the plugin code in file @var{name}.so, assumed to be a
1509 shared object to be dlopen'd by the compiler.  The base name of
1510 the shared object file is used to identify the plugin for the
1511 purposes of argument parsing (See
1512 @option{-fplugin-arg-@var{name}-@var{key}=@var{value}} below).
1513 Each plugin should define the callback functions specified in the
1514 Plugins API.
1516 @item -fplugin-arg-@var{name}-@var{key}=@var{value}
1517 @opindex fplugin-arg
1518 Define an argument called @var{key} with a value of @var{value}
1519 for the plugin called @var{name}.
1521 @item -fdump-ada-spec@r{[}-slim@r{]}
1522 @opindex fdump-ada-spec
1523 For C and C++ source and include files, generate corresponding Ada specs.
1524 @xref{Generating Ada Bindings for C and C++ headers,,, gnat_ugn,
1525 GNAT User's Guide}, which provides detailed documentation on this feature.
1527 @item -fada-spec-parent=@var{unit}
1528 @opindex fada-spec-parent
1529 In conjunction with @option{-fdump-ada-spec@r{[}-slim@r{]}} above, generate
1530 Ada specs as child units of parent @var{unit}.
1532 @item -fdump-go-spec=@var{file}
1533 @opindex fdump-go-spec
1534 For input files in any language, generate corresponding Go
1535 declarations in @var{file}.  This generates Go @code{const},
1536 @code{type}, @code{var}, and @code{func} declarations which may be a
1537 useful way to start writing a Go interface to code written in some
1538 other language.
1540 @include @value{srcdir}/../libiberty/at-file.texi
1541 @end table
1543 @node Invoking G++
1544 @section Compiling C++ Programs
1546 @cindex suffixes for C++ source
1547 @cindex C++ source file suffixes
1548 C++ source files conventionally use one of the suffixes @samp{.C},
1549 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1550 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1551 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1552 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1553 files with these names and compiles them as C++ programs even if you
1554 call the compiler the same way as for compiling C programs (usually
1555 with the name @command{gcc}).
1557 @findex g++
1558 @findex c++
1559 However, the use of @command{gcc} does not add the C++ library.
1560 @command{g++} is a program that calls GCC and automatically specifies linking
1561 against the C++ library.  It treats @samp{.c},
1562 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1563 files unless @option{-x} is used.  This program is also useful when
1564 precompiling a C header file with a @samp{.h} extension for use in C++
1565 compilations.  On many systems, @command{g++} is also installed with
1566 the name @command{c++}.
1568 @cindex invoking @command{g++}
1569 When you compile C++ programs, you may specify many of the same
1570 command-line options that you use for compiling programs in any
1571 language; or command-line options meaningful for C and related
1572 languages; or options that are meaningful only for C++ programs.
1573 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1574 explanations of options for languages related to C@.
1575 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1576 explanations of options that are meaningful only for C++ programs.
1578 @node C Dialect Options
1579 @section Options Controlling C Dialect
1580 @cindex dialect options
1581 @cindex language dialect options
1582 @cindex options, dialect
1584 The following options control the dialect of C (or languages derived
1585 from C, such as C++, Objective-C and Objective-C++) that the compiler
1586 accepts:
1588 @table @gcctabopt
1589 @cindex ANSI support
1590 @cindex ISO support
1591 @item -ansi
1592 @opindex ansi
1593 In C mode, this is equivalent to @option{-std=c90}. In C++ mode, it is
1594 equivalent to @option{-std=c++98}.
1596 This turns off certain features of GCC that are incompatible with ISO
1597 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1598 such as the @code{asm} and @code{typeof} keywords, and
1599 predefined macros such as @code{unix} and @code{vax} that identify the
1600 type of system you are using.  It also enables the undesirable and
1601 rarely used ISO trigraph feature.  For the C compiler,
1602 it disables recognition of C++ style @samp{//} comments as well as
1603 the @code{inline} keyword.
1605 The alternate keywords @code{__asm__}, @code{__extension__},
1606 @code{__inline__} and @code{__typeof__} continue to work despite
1607 @option{-ansi}.  You would not want to use them in an ISO C program, of
1608 course, but it is useful to put them in header files that might be included
1609 in compilations done with @option{-ansi}.  Alternate predefined macros
1610 such as @code{__unix__} and @code{__vax__} are also available, with or
1611 without @option{-ansi}.
1613 The @option{-ansi} option does not cause non-ISO programs to be
1614 rejected gratuitously.  For that, @option{-Wpedantic} is required in
1615 addition to @option{-ansi}.  @xref{Warning Options}.
1617 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1618 option is used.  Some header files may notice this macro and refrain
1619 from declaring certain functions or defining certain macros that the
1620 ISO standard doesn't call for; this is to avoid interfering with any
1621 programs that might use these names for other things.
1623 Functions that are normally built in but do not have semantics
1624 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1625 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
1626 built-in functions provided by GCC}, for details of the functions
1627 affected.
1629 @item -std=
1630 @opindex std
1631 Determine the language standard. @xref{Standards,,Language Standards
1632 Supported by GCC}, for details of these standard versions.  This option
1633 is currently only supported when compiling C or C++.
1635 The compiler can accept several base standards, such as @samp{c90} or
1636 @samp{c++98}, and GNU dialects of those standards, such as
1637 @samp{gnu90} or @samp{gnu++98}.  When a base standard is specified, the
1638 compiler accepts all programs following that standard plus those
1639 using GNU extensions that do not contradict it.  For example,
1640 @option{-std=c90} turns off certain features of GCC that are
1641 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
1642 keywords, but not other GNU extensions that do not have a meaning in
1643 ISO C90, such as omitting the middle term of a @code{?:}
1644 expression. On the other hand, when a GNU dialect of a standard is
1645 specified, all features supported by the compiler are enabled, even when
1646 those features change the meaning of the base standard.  As a result, some
1647 strict-conforming programs may be rejected.  The particular standard
1648 is used by @option{-Wpedantic} to identify which features are GNU
1649 extensions given that version of the standard. For example
1650 @option{-std=gnu90 -Wpedantic} warns about C++ style @samp{//}
1651 comments, while @option{-std=gnu99 -Wpedantic} does not.
1653 A value for this option must be provided; possible values are
1655 @table @samp
1656 @item c90
1657 @itemx c89
1658 @itemx iso9899:1990
1659 Support all ISO C90 programs (certain GNU extensions that conflict
1660 with ISO C90 are disabled). Same as @option{-ansi} for C code.
1662 @item iso9899:199409
1663 ISO C90 as modified in amendment 1.
1665 @item c99
1666 @itemx c9x
1667 @itemx iso9899:1999
1668 @itemx iso9899:199x
1669 ISO C99.  This standard is substantially completely supported, modulo
1670 bugs, extended identifiers (supported except for corner cases when
1671 @option{-fextended-identifiers} is used) and floating-point issues
1672 (mainly but not entirely relating to optional C99 features from
1673 Annexes F and G).  See
1674 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1675 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1677 @item c11
1678 @itemx c1x
1679 @itemx iso9899:2011
1680 ISO C11, the 2011 revision of the ISO C standard.  This standard is
1681 substantially completely supported, modulo bugs, extended identifiers
1682 (supported except for corner cases when
1683 @option{-fextended-identifiers} is used), floating-point issues
1684 (mainly but not entirely relating to optional C11 features from
1685 Annexes F and G) and the optional Annexes K (Bounds-checking
1686 interfaces) and L (Analyzability).  The name @samp{c1x} is deprecated.
1688 @item gnu90
1689 @itemx gnu89
1690 GNU dialect of ISO C90 (including some C99 features). This
1691 is the default for C code.
1693 @item gnu99
1694 @itemx gnu9x
1695 GNU dialect of ISO C99.  The name @samp{gnu9x} is deprecated.
1697 @item gnu11
1698 @itemx gnu1x
1699 GNU dialect of ISO C11.  This is intended to become the default in a
1700 future release of GCC.  The name @samp{gnu1x} is deprecated.
1702 @item c++98
1703 @itemx c++03
1704 The 1998 ISO C++ standard plus the 2003 technical corrigendum and some
1705 additional defect reports. Same as @option{-ansi} for C++ code.
1707 @item gnu++98
1708 @itemx gnu++03
1709 GNU dialect of @option{-std=c++98}.  This is the default for
1710 C++ code.
1712 @item c++11
1713 @itemx c++0x
1714 The 2011 ISO C++ standard plus amendments.
1715 The name @samp{c++0x} is deprecated.
1717 @item gnu++11
1718 @itemx gnu++0x
1719 GNU dialect of @option{-std=c++11}.
1720 The name @samp{gnu++0x} is deprecated.
1722 @item c++1y
1723 The next revision of the ISO C++ standard, tentatively planned for
1724 2014.  Support is highly experimental, and will almost certainly
1725 change in incompatible ways in future releases.
1727 @item gnu++1y
1728 GNU dialect of @option{-std=c++1y}.  Support is highly experimental,
1729 and will almost certainly change in incompatible ways in future
1730 releases.
1731 @end table
1733 @item -fgnu89-inline
1734 @opindex fgnu89-inline
1735 The option @option{-fgnu89-inline} tells GCC to use the traditional
1736 GNU semantics for @code{inline} functions when in C99 mode.
1737 @xref{Inline,,An Inline Function is As Fast As a Macro}.  This option
1738 is accepted and ignored by GCC versions 4.1.3 up to but not including
1739 4.3.  In GCC versions 4.3 and later it changes the behavior of GCC in
1740 C99 mode.  Using this option is roughly equivalent to adding the
1741 @code{gnu_inline} function attribute to all inline functions
1742 (@pxref{Function Attributes}).
1744 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1745 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1746 specifies the default behavior).  This option was first supported in
1747 GCC 4.3.  This option is not supported in @option{-std=c90} or
1748 @option{-std=gnu90} mode.
1750 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1751 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1752 in effect for @code{inline} functions.  @xref{Common Predefined
1753 Macros,,,cpp,The C Preprocessor}.
1755 @item -aux-info @var{filename}
1756 @opindex aux-info
1757 Output to the given filename prototyped declarations for all functions
1758 declared and/or defined in a translation unit, including those in header
1759 files.  This option is silently ignored in any language other than C@.
1761 Besides declarations, the file indicates, in comments, the origin of
1762 each declaration (source file and line), whether the declaration was
1763 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1764 @samp{O} for old, respectively, in the first character after the line
1765 number and the colon), and whether it came from a declaration or a
1766 definition (@samp{C} or @samp{F}, respectively, in the following
1767 character).  In the case of function definitions, a K&R-style list of
1768 arguments followed by their declarations is also provided, inside
1769 comments, after the declaration.
1771 @item -fallow-parameterless-variadic-functions
1772 @opindex fallow-parameterless-variadic-functions
1773 Accept variadic functions without named parameters.
1775 Although it is possible to define such a function, this is not very
1776 useful as it is not possible to read the arguments.  This is only
1777 supported for C as this construct is allowed by C++.
1779 @item -fno-asm
1780 @opindex fno-asm
1781 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1782 keyword, so that code can use these words as identifiers.  You can use
1783 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1784 instead.  @option{-ansi} implies @option{-fno-asm}.
1786 In C++, this switch only affects the @code{typeof} keyword, since
1787 @code{asm} and @code{inline} are standard keywords.  You may want to
1788 use the @option{-fno-gnu-keywords} flag instead, which has the same
1789 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1790 switch only affects the @code{asm} and @code{typeof} keywords, since
1791 @code{inline} is a standard keyword in ISO C99.
1793 @item -fno-builtin
1794 @itemx -fno-builtin-@var{function}
1795 @opindex fno-builtin
1796 @cindex built-in functions
1797 Don't recognize built-in functions that do not begin with
1798 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1799 functions provided by GCC}, for details of the functions affected,
1800 including those which are not built-in functions when @option{-ansi} or
1801 @option{-std} options for strict ISO C conformance are used because they
1802 do not have an ISO standard meaning.
1804 GCC normally generates special code to handle certain built-in functions
1805 more efficiently; for instance, calls to @code{alloca} may become single
1806 instructions which adjust the stack directly, and calls to @code{memcpy}
1807 may become inline copy loops.  The resulting code is often both smaller
1808 and faster, but since the function calls no longer appear as such, you
1809 cannot set a breakpoint on those calls, nor can you change the behavior
1810 of the functions by linking with a different library.  In addition,
1811 when a function is recognized as a built-in function, GCC may use
1812 information about that function to warn about problems with calls to
1813 that function, or to generate more efficient code, even if the
1814 resulting code still contains calls to that function.  For example,
1815 warnings are given with @option{-Wformat} for bad calls to
1816 @code{printf} when @code{printf} is built in and @code{strlen} is
1817 known not to modify global memory.
1819 With the @option{-fno-builtin-@var{function}} option
1820 only the built-in function @var{function} is
1821 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1822 function is named that is not built-in in this version of GCC, this
1823 option is ignored.  There is no corresponding
1824 @option{-fbuiltin-@var{function}} option; if you wish to enable
1825 built-in functions selectively when using @option{-fno-builtin} or
1826 @option{-ffreestanding}, you may define macros such as:
1828 @smallexample
1829 #define abs(n)          __builtin_abs ((n))
1830 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1831 @end smallexample
1833 @item -fhosted
1834 @opindex fhosted
1835 @cindex hosted environment
1837 Assert that compilation targets a hosted environment.  This implies
1838 @option{-fbuiltin}.  A hosted environment is one in which the
1839 entire standard library is available, and in which @code{main} has a return
1840 type of @code{int}.  Examples are nearly everything except a kernel.
1841 This is equivalent to @option{-fno-freestanding}.
1843 @item -ffreestanding
1844 @opindex ffreestanding
1845 @cindex hosted environment
1847 Assert that compilation targets a freestanding environment.  This
1848 implies @option{-fno-builtin}.  A freestanding environment
1849 is one in which the standard library may not exist, and program startup may
1850 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1851 This is equivalent to @option{-fno-hosted}.
1853 @xref{Standards,,Language Standards Supported by GCC}, for details of
1854 freestanding and hosted environments.
1856 @item -fopenmp
1857 @opindex fopenmp
1858 @cindex OpenMP parallel
1859 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1860 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1861 compiler generates parallel code according to the OpenMP Application
1862 Program Interface v4.0 @w{@uref{http://www.openmp.org/}}.  This option
1863 implies @option{-pthread}, and thus is only supported on targets that
1864 have support for @option{-pthread}. @option{-fopenmp} implies
1865 @option{-fopenmp-simd}.
1867 @item -fopenmp-simd
1868 @opindex fopenmp-simd
1869 @cindex OpenMP SIMD
1870 @cindex SIMD
1871 Enable handling of OpenMP's SIMD directives with @code{#pragma omp}
1872 in C/C++ and @code{!$omp} in Fortran. Other OpenMP directives
1873 are ignored.
1875 @item -fcilkplus
1876 @opindex fcilkplus
1877 @cindex Enable Cilk Plus
1878 Enable the usage of Cilk Plus language extension features for C/C++.
1879 When the option @option{-fcilkplus} is specified, enable the usage of
1880 the Cilk Plus Language extension features for C/C++.  The present
1881 implementation follows ABI version 1.2.  This is an experimental
1882 feature that is only partially complete, and whose interface may
1883 change in future versions of GCC as the official specification
1884 changes.  Currently, all features but @code{_Cilk_for} have been
1885 implemented.
1887 @item -fgnu-tm
1888 @opindex fgnu-tm
1889 When the option @option{-fgnu-tm} is specified, the compiler
1890 generates code for the Linux variant of Intel's current Transactional
1891 Memory ABI specification document (Revision 1.1, May 6 2009).  This is
1892 an experimental feature whose interface may change in future versions
1893 of GCC, as the official specification changes.  Please note that not
1894 all architectures are supported for this feature.
1896 For more information on GCC's support for transactional memory,
1897 @xref{Enabling libitm,,The GNU Transactional Memory Library,libitm,GNU
1898 Transactional Memory Library}.
1900 Note that the transactional memory feature is not supported with
1901 non-call exceptions (@option{-fnon-call-exceptions}).
1903 @item -fms-extensions
1904 @opindex fms-extensions
1905 Accept some non-standard constructs used in Microsoft header files.
1907 In C++ code, this allows member names in structures to be similar
1908 to previous types declarations.
1910 @smallexample
1911 typedef int UOW;
1912 struct ABC @{
1913   UOW UOW;
1915 @end smallexample
1917 Some cases of unnamed fields in structures and unions are only
1918 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1919 fields within structs/unions}, for details.
1921 Note that this option is off for all targets but i?86 and x86_64
1922 targets using ms-abi.
1923 @item -fplan9-extensions
1924 Accept some non-standard constructs used in Plan 9 code.
1926 This enables @option{-fms-extensions}, permits passing pointers to
1927 structures with anonymous fields to functions that expect pointers to
1928 elements of the type of the field, and permits referring to anonymous
1929 fields declared using a typedef.  @xref{Unnamed Fields,,Unnamed
1930 struct/union fields within structs/unions}, for details.  This is only
1931 supported for C, not C++.
1933 @item -trigraphs
1934 @opindex trigraphs
1935 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1936 options for strict ISO C conformance) implies @option{-trigraphs}.
1938 @cindex traditional C language
1939 @cindex C language, traditional
1940 @item -traditional
1941 @itemx -traditional-cpp
1942 @opindex traditional-cpp
1943 @opindex traditional
1944 Formerly, these options caused GCC to attempt to emulate a pre-standard
1945 C compiler.  They are now only supported with the @option{-E} switch.
1946 The preprocessor continues to support a pre-standard mode.  See the GNU
1947 CPP manual for details.
1949 @item -fcond-mismatch
1950 @opindex fcond-mismatch
1951 Allow conditional expressions with mismatched types in the second and
1952 third arguments.  The value of such an expression is void.  This option
1953 is not supported for C++.
1955 @item -flax-vector-conversions
1956 @opindex flax-vector-conversions
1957 Allow implicit conversions between vectors with differing numbers of
1958 elements and/or incompatible element types.  This option should not be
1959 used for new code.
1961 @item -funsigned-char
1962 @opindex funsigned-char
1963 Let the type @code{char} be unsigned, like @code{unsigned char}.
1965 Each kind of machine has a default for what @code{char} should
1966 be.  It is either like @code{unsigned char} by default or like
1967 @code{signed char} by default.
1969 Ideally, a portable program should always use @code{signed char} or
1970 @code{unsigned char} when it depends on the signedness of an object.
1971 But many programs have been written to use plain @code{char} and
1972 expect it to be signed, or expect it to be unsigned, depending on the
1973 machines they were written for.  This option, and its inverse, let you
1974 make such a program work with the opposite default.
1976 The type @code{char} is always a distinct type from each of
1977 @code{signed char} or @code{unsigned char}, even though its behavior
1978 is always just like one of those two.
1980 @item -fsigned-char
1981 @opindex fsigned-char
1982 Let the type @code{char} be signed, like @code{signed char}.
1984 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1985 the negative form of @option{-funsigned-char}.  Likewise, the option
1986 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1988 @item -fsigned-bitfields
1989 @itemx -funsigned-bitfields
1990 @itemx -fno-signed-bitfields
1991 @itemx -fno-unsigned-bitfields
1992 @opindex fsigned-bitfields
1993 @opindex funsigned-bitfields
1994 @opindex fno-signed-bitfields
1995 @opindex fno-unsigned-bitfields
1996 These options control whether a bit-field is signed or unsigned, when the
1997 declaration does not use either @code{signed} or @code{unsigned}.  By
1998 default, such a bit-field is signed, because this is consistent: the
1999 basic integer types such as @code{int} are signed types.
2000 @end table
2002 @node C++ Dialect Options
2003 @section Options Controlling C++ Dialect
2005 @cindex compiler options, C++
2006 @cindex C++ options, command-line
2007 @cindex options, C++
2008 This section describes the command-line options that are only meaningful
2009 for C++ programs.  You can also use most of the GNU compiler options
2010 regardless of what language your program is in.  For example, you
2011 might compile a file @code{firstClass.C} like this:
2013 @smallexample
2014 g++ -g -frepo -O -c firstClass.C
2015 @end smallexample
2017 @noindent
2018 In this example, only @option{-frepo} is an option meant
2019 only for C++ programs; you can use the other options with any
2020 language supported by GCC@.
2022 Here is a list of options that are @emph{only} for compiling C++ programs:
2024 @table @gcctabopt
2026 @item -fabi-version=@var{n}
2027 @opindex fabi-version
2028 Use version @var{n} of the C++ ABI@.  The default is version 0.
2030 Version 0 refers to the version conforming most closely to
2031 the C++ ABI specification.  Therefore, the ABI obtained using version 0
2032 will change in different versions of G++ as ABI bugs are fixed.
2034 Version 1 is the version of the C++ ABI that first appeared in G++ 3.2.  
2036 Version 2 is the version of the C++ ABI that first appeared in G++
2037 3.4, and was the default through G++ 4.9.
2039 Version 3 corrects an error in mangling a constant address as a
2040 template argument.
2042 Version 4, which first appeared in G++ 4.5, implements a standard
2043 mangling for vector types.
2045 Version 5, which first appeared in G++ 4.6, corrects the mangling of
2046 attribute const/volatile on function pointer types, decltype of a
2047 plain decl, and use of a function parameter in the declaration of
2048 another parameter.
2050 Version 6, which first appeared in G++ 4.7, corrects the promotion
2051 behavior of C++11 scoped enums and the mangling of template argument
2052 packs, const/static_cast, prefix ++ and --, and a class scope function
2053 used as a template argument.
2055 Version 7, which first appeared in G++ 4.8, that treats nullptr_t as a
2056 builtin type and corrects the mangling of lambdas in default argument
2057 scope.
2059 Version 8, which first appeared in G++ 4.9, corrects the substitution
2060 behavior of function types with function-cv-qualifiers.
2062 See also @option{-Wabi}.
2064 @item -fabi-compat-version=@var{n}
2065 @opindex fabi-compat-version
2066 Starting with GCC 4.5, on targets that support strong aliases, G++
2067 works around mangling changes by creating an alias with the correct
2068 mangled name when defining a symbol with an incorrect mangled name.
2069 This switch specifies which ABI version to use for the alias.
2071 With @option{-fabi-version=0} (the default), this defaults to 2.  If
2072 another ABI version is explicitly selected, this defaults to 0.
2074 The compatibility version is also set by @option{-Wabi=@var{n}}.
2076 @item -fno-access-control
2077 @opindex fno-access-control
2078 Turn off all access checking.  This switch is mainly useful for working
2079 around bugs in the access control code.
2081 @item -fcheck-new
2082 @opindex fcheck-new
2083 Check that the pointer returned by @code{operator new} is non-null
2084 before attempting to modify the storage allocated.  This check is
2085 normally unnecessary because the C++ standard specifies that
2086 @code{operator new} only returns @code{0} if it is declared
2087 @samp{throw()}, in which case the compiler always checks the
2088 return value even without this option.  In all other cases, when
2089 @code{operator new} has a non-empty exception specification, memory
2090 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
2091 @samp{new (nothrow)}.
2093 @item -fconstexpr-depth=@var{n}
2094 @opindex fconstexpr-depth
2095 Set the maximum nested evaluation depth for C++11 constexpr functions
2096 to @var{n}.  A limit is needed to detect endless recursion during
2097 constant expression evaluation.  The minimum specified by the standard
2098 is 512.
2100 @item -fdeduce-init-list
2101 @opindex fdeduce-init-list
2102 Enable deduction of a template type parameter as
2103 @code{std::initializer_list} from a brace-enclosed initializer list, i.e.@:
2105 @smallexample
2106 template <class T> auto forward(T t) -> decltype (realfn (t))
2108   return realfn (t);
2111 void f()
2113   forward(@{1,2@}); // call forward<std::initializer_list<int>>
2115 @end smallexample
2117 This deduction was implemented as a possible extension to the
2118 originally proposed semantics for the C++11 standard, but was not part
2119 of the final standard, so it is disabled by default.  This option is
2120 deprecated, and may be removed in a future version of G++.
2122 @item -ffriend-injection
2123 @opindex ffriend-injection
2124 Inject friend functions into the enclosing namespace, so that they are
2125 visible outside the scope of the class in which they are declared.
2126 Friend functions were documented to work this way in the old Annotated
2127 C++ Reference Manual, and versions of G++ before 4.1 always worked
2128 that way.  However, in ISO C++ a friend function that is not declared
2129 in an enclosing scope can only be found using argument dependent
2130 lookup.  This option causes friends to be injected as they were in
2131 earlier releases.
2133 This option is for compatibility, and may be removed in a future
2134 release of G++.
2136 @item -fno-elide-constructors
2137 @opindex fno-elide-constructors
2138 The C++ standard allows an implementation to omit creating a temporary
2139 that is only used to initialize another object of the same type.
2140 Specifying this option disables that optimization, and forces G++ to
2141 call the copy constructor in all cases.
2143 @item -fno-enforce-eh-specs
2144 @opindex fno-enforce-eh-specs
2145 Don't generate code to check for violation of exception specifications
2146 at run time.  This option violates the C++ standard, but may be useful
2147 for reducing code size in production builds, much like defining
2148 @samp{NDEBUG}.  This does not give user code permission to throw
2149 exceptions in violation of the exception specifications; the compiler
2150 still optimizes based on the specifications, so throwing an
2151 unexpected exception results in undefined behavior at run time.
2153 @item -fextern-tls-init
2154 @itemx -fno-extern-tls-init
2155 @opindex fextern-tls-init
2156 @opindex fno-extern-tls-init
2157 The C++11 and OpenMP standards allow @samp{thread_local} and
2158 @samp{threadprivate} variables to have dynamic (runtime)
2159 initialization.  To support this, any use of such a variable goes
2160 through a wrapper function that performs any necessary initialization.
2161 When the use and definition of the variable are in the same
2162 translation unit, this overhead can be optimized away, but when the
2163 use is in a different translation unit there is significant overhead
2164 even if the variable doesn't actually need dynamic initialization.  If
2165 the programmer can be sure that no use of the variable in a
2166 non-defining TU needs to trigger dynamic initialization (either
2167 because the variable is statically initialized, or a use of the
2168 variable in the defining TU will be executed before any uses in
2169 another TU), they can avoid this overhead with the
2170 @option{-fno-extern-tls-init} option.
2172 On targets that support symbol aliases, the default is
2173 @option{-fextern-tls-init}.  On targets that do not support symbol
2174 aliases, the default is @option{-fno-extern-tls-init}.
2176 @item -ffor-scope
2177 @itemx -fno-for-scope
2178 @opindex ffor-scope
2179 @opindex fno-for-scope
2180 If @option{-ffor-scope} is specified, the scope of variables declared in
2181 a @i{for-init-statement} is limited to the @samp{for} loop itself,
2182 as specified by the C++ standard.
2183 If @option{-fno-for-scope} is specified, the scope of variables declared in
2184 a @i{for-init-statement} extends to the end of the enclosing scope,
2185 as was the case in old versions of G++, and other (traditional)
2186 implementations of C++.
2188 If neither flag is given, the default is to follow the standard,
2189 but to allow and give a warning for old-style code that would
2190 otherwise be invalid, or have different behavior.
2192 @item -fno-gnu-keywords
2193 @opindex fno-gnu-keywords
2194 Do not recognize @code{typeof} as a keyword, so that code can use this
2195 word as an identifier.  You can use the keyword @code{__typeof__} instead.
2196 @option{-ansi} implies @option{-fno-gnu-keywords}.
2198 @item -fno-implicit-templates
2199 @opindex fno-implicit-templates
2200 Never emit code for non-inline templates that are instantiated
2201 implicitly (i.e.@: by use); only emit code for explicit instantiations.
2202 @xref{Template Instantiation}, for more information.
2204 @item -fno-implicit-inline-templates
2205 @opindex fno-implicit-inline-templates
2206 Don't emit code for implicit instantiations of inline templates, either.
2207 The default is to handle inlines differently so that compiles with and
2208 without optimization need the same set of explicit instantiations.
2210 @item -fno-implement-inlines
2211 @opindex fno-implement-inlines
2212 To save space, do not emit out-of-line copies of inline functions
2213 controlled by @samp{#pragma implementation}.  This causes linker
2214 errors if these functions are not inlined everywhere they are called.
2216 @item -fms-extensions
2217 @opindex fms-extensions
2218 Disable Wpedantic warnings about constructs used in MFC, such as implicit
2219 int and getting a pointer to member function via non-standard syntax.
2221 @item -fno-nonansi-builtins
2222 @opindex fno-nonansi-builtins
2223 Disable built-in declarations of functions that are not mandated by
2224 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
2225 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
2227 @item -fnothrow-opt
2228 @opindex fnothrow-opt
2229 Treat a @code{throw()} exception specification as if it were a
2230 @code{noexcept} specification to reduce or eliminate the text size
2231 overhead relative to a function with no exception specification.  If
2232 the function has local variables of types with non-trivial
2233 destructors, the exception specification actually makes the
2234 function smaller because the EH cleanups for those variables can be
2235 optimized away.  The semantic effect is that an exception thrown out of
2236 a function with such an exception specification results in a call
2237 to @code{terminate} rather than @code{unexpected}.
2239 @item -fno-operator-names
2240 @opindex fno-operator-names
2241 Do not treat the operator name keywords @code{and}, @code{bitand},
2242 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
2243 synonyms as keywords.
2245 @item -fno-optional-diags
2246 @opindex fno-optional-diags
2247 Disable diagnostics that the standard says a compiler does not need to
2248 issue.  Currently, the only such diagnostic issued by G++ is the one for
2249 a name having multiple meanings within a class.
2251 @item -fpermissive
2252 @opindex fpermissive
2253 Downgrade some diagnostics about nonconformant code from errors to
2254 warnings.  Thus, using @option{-fpermissive} allows some
2255 nonconforming code to compile.
2257 @item -fno-pretty-templates
2258 @opindex fno-pretty-templates
2259 When an error message refers to a specialization of a function
2260 template, the compiler normally prints the signature of the
2261 template followed by the template arguments and any typedefs or
2262 typenames in the signature (e.g. @code{void f(T) [with T = int]}
2263 rather than @code{void f(int)}) so that it's clear which template is
2264 involved.  When an error message refers to a specialization of a class
2265 template, the compiler omits any template arguments that match
2266 the default template arguments for that template.  If either of these
2267 behaviors make it harder to understand the error message rather than
2268 easier, you can use @option{-fno-pretty-templates} to disable them.
2270 @item -frepo
2271 @opindex frepo
2272 Enable automatic template instantiation at link time.  This option also
2273 implies @option{-fno-implicit-templates}.  @xref{Template
2274 Instantiation}, for more information.
2276 @item -fno-rtti
2277 @opindex fno-rtti
2278 Disable generation of information about every class with virtual
2279 functions for use by the C++ run-time type identification features
2280 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
2281 of the language, you can save some space by using this flag.  Note that
2282 exception handling uses the same information, but G++ generates it as
2283 needed. The @samp{dynamic_cast} operator can still be used for casts that
2284 do not require run-time type information, i.e.@: casts to @code{void *} or to
2285 unambiguous base classes.
2287 @item -fstats
2288 @opindex fstats
2289 Emit statistics about front-end processing at the end of the compilation.
2290 This information is generally only useful to the G++ development team.
2292 @item -fstrict-enums
2293 @opindex fstrict-enums
2294 Allow the compiler to optimize using the assumption that a value of
2295 enumerated type can only be one of the values of the enumeration (as
2296 defined in the C++ standard; basically, a value that can be
2297 represented in the minimum number of bits needed to represent all the
2298 enumerators).  This assumption may not be valid if the program uses a
2299 cast to convert an arbitrary integer value to the enumerated type.
2301 @item -ftemplate-backtrace-limit=@var{n}
2302 @opindex ftemplate-backtrace-limit
2303 Set the maximum number of template instantiation notes for a single
2304 warning or error to @var{n}.  The default value is 10.
2306 @item -ftemplate-depth=@var{n}
2307 @opindex ftemplate-depth
2308 Set the maximum instantiation depth for template classes to @var{n}.
2309 A limit on the template instantiation depth is needed to detect
2310 endless recursions during template class instantiation.  ANSI/ISO C++
2311 conforming programs must not rely on a maximum depth greater than 17
2312 (changed to 1024 in C++11).  The default value is 900, as the compiler
2313 can run out of stack space before hitting 1024 in some situations.
2315 @item -fno-threadsafe-statics
2316 @opindex fno-threadsafe-statics
2317 Do not emit the extra code to use the routines specified in the C++
2318 ABI for thread-safe initialization of local statics.  You can use this
2319 option to reduce code size slightly in code that doesn't need to be
2320 thread-safe.
2322 @item -fno-use-all-virtuals
2323 @opindex fno-use-all-virtuals
2324 By default, G++ now treats all virtual functions declared in a
2325 translation unit as odr-used, so they will be instantiated or
2326 synthesized if possible even if they are not needed for the final
2327 output.  This is done so that such functions can be inlined after
2328 devirtualization changes an indirect call into a direct call.  If this
2329 instantiation and synthesis prevents your code from compiling
2330 successfully, you can disable it with this option.
2332 @item -fuse-cxa-atexit
2333 @opindex fuse-cxa-atexit
2334 Register destructors for objects with static storage duration with the
2335 @code{__cxa_atexit} function rather than the @code{atexit} function.
2336 This option is required for fully standards-compliant handling of static
2337 destructors, but only works if your C library supports
2338 @code{__cxa_atexit}.
2340 @item -fno-use-cxa-get-exception-ptr
2341 @opindex fno-use-cxa-get-exception-ptr
2342 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
2343 causes @code{std::uncaught_exception} to be incorrect, but is necessary
2344 if the runtime routine is not available.
2346 @item -fvisibility-inlines-hidden
2347 @opindex fvisibility-inlines-hidden
2348 This switch declares that the user does not attempt to compare
2349 pointers to inline functions or methods where the addresses of the two functions
2350 are taken in different shared objects.
2352 The effect of this is that GCC may, effectively, mark inline methods with
2353 @code{__attribute__ ((visibility ("hidden")))} so that they do not
2354 appear in the export table of a DSO and do not require a PLT indirection
2355 when used within the DSO@.  Enabling this option can have a dramatic effect
2356 on load and link times of a DSO as it massively reduces the size of the
2357 dynamic export table when the library makes heavy use of templates.
2359 The behavior of this switch is not quite the same as marking the
2360 methods as hidden directly, because it does not affect static variables
2361 local to the function or cause the compiler to deduce that
2362 the function is defined in only one shared object.
2364 You may mark a method as having a visibility explicitly to negate the
2365 effect of the switch for that method.  For example, if you do want to
2366 compare pointers to a particular inline method, you might mark it as
2367 having default visibility.  Marking the enclosing class with explicit
2368 visibility has no effect.
2370 Explicitly instantiated inline methods are unaffected by this option
2371 as their linkage might otherwise cross a shared library boundary.
2372 @xref{Template Instantiation}.
2374 @item -fvisibility-ms-compat
2375 @opindex fvisibility-ms-compat
2376 This flag attempts to use visibility settings to make GCC's C++
2377 linkage model compatible with that of Microsoft Visual Studio.
2379 The flag makes these changes to GCC's linkage model:
2381 @enumerate
2382 @item
2383 It sets the default visibility to @code{hidden}, like
2384 @option{-fvisibility=hidden}.
2386 @item
2387 Types, but not their members, are not hidden by default.
2389 @item
2390 The One Definition Rule is relaxed for types without explicit
2391 visibility specifications that are defined in more than one
2392 shared object: those declarations are permitted if they are
2393 permitted when this option is not used.
2394 @end enumerate
2396 In new code it is better to use @option{-fvisibility=hidden} and
2397 export those classes that are intended to be externally visible.
2398 Unfortunately it is possible for code to rely, perhaps accidentally,
2399 on the Visual Studio behavior.
2401 Among the consequences of these changes are that static data members
2402 of the same type with the same name but defined in different shared
2403 objects are different, so changing one does not change the other;
2404 and that pointers to function members defined in different shared
2405 objects may not compare equal.  When this flag is given, it is a
2406 violation of the ODR to define types with the same name differently.
2408 @item -fvtable-verify=@var{std|preinit|none}
2409 @opindex fvtable-verify
2410 Turn on (or off, if using @option{-fvtable-verify=none}) the security
2411 feature that verifies at runtime, for every virtual call that is made, that
2412 the vtable pointer through which the call is made is valid for the type of
2413 the object, and has not been corrupted or overwritten.  If an invalid vtable
2414 pointer is detected (at runtime), an error is reported and execution of the
2415 program is immediately halted.
2417 This option causes runtime data structures to be built, at program start up,
2418 for verifying the vtable pointers.  The options @code{std} and @code{preinit}
2419 control the timing of when these data structures are built.  In both cases the
2420 data structures are built before execution reaches 'main'.  The
2421 @option{-fvtable-verify=std} causes these data structure to be built after the
2422 shared libraries have been loaded and initialized.
2423 @option{-fvtable-verify=preinit} causes them to be built before the shared
2424 libraries have been loaded and initialized.
2426 If this option appears multiple times in the compiler line, with different
2427 values specified, 'none' will take highest priority over both 'std' and
2428 'preinit'; 'preinit' will take priority over 'std'.
2430 @item -fvtv-debug
2431 @opindex (fvtv-debug)
2432 Causes debug versions of the runtime functions for the vtable verification 
2433 feature to be called.  This assumes the @option{-fvtable-verify=std} or
2434 @option{-fvtable-verify=preinit} has been used.  This flag will also cause the
2435 compiler to keep track of which vtable pointers it found for each class, and
2436 record that information in the file ``vtv_set_ptr_data.log'', in the dump
2437 file directory on the user's machine.
2439 Note:  This feature APPENDS data to the log file. If you want a fresh log
2440 file, be sure to delete any existing one.
2442 @item -fvtv-counts
2443 @opindex fvtv-counts
2444 This is a debugging flag.  When used in conjunction with
2445 @option{-fvtable-verify=std} or @option{-fvtable-verify=preinit}, this
2446 causes the compiler to keep track of the total number of virtual calls
2447 it encountered and the number of verifications it inserted.  It also
2448 counts the number of calls to certain runtime library functions
2449 that it inserts.  This information, for each compilation unit, is written
2450 to a file named ``vtv_count_data.log'', in the dump_file directory on
2451 the user's machine.   It also counts the size of the vtable pointer sets
2452 for each class, and writes this information to ``vtv_class_set_sizes.log''
2453 in the same directory.
2455 Note:  This feature APPENDS data to the log files.  To get a fresh log
2456 files, be sure to delete any existing ones.
2458 @item -fno-weak
2459 @opindex fno-weak
2460 Do not use weak symbol support, even if it is provided by the linker.
2461 By default, G++ uses weak symbols if they are available.  This
2462 option exists only for testing, and should not be used by end-users;
2463 it results in inferior code and has no benefits.  This option may
2464 be removed in a future release of G++.
2466 @item -nostdinc++
2467 @opindex nostdinc++
2468 Do not search for header files in the standard directories specific to
2469 C++, but do still search the other standard directories.  (This option
2470 is used when building the C++ library.)
2471 @end table
2473 In addition, these optimization, warning, and code generation options
2474 have meanings only for C++ programs:
2476 @table @gcctabopt
2477 @item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)}
2478 @opindex Wabi
2479 @opindex Wno-abi
2480 When an explicit @option{-fabi-version=@var{n}} option is used, causes
2481 G++ to warn when it generates code that is probably not compatible with the
2482 vendor-neutral C++ ABI@.  Since G++ now defaults to
2483 @option{-fabi-version=0}, @option{-Wabi} has no effect unless either
2484 an older ABI version is selected (with @option{-fabi-version=@var{n}})
2485 or an older compatibility version is selected (with
2486 @option{-Wabi=@var{n}} or @option{-fabi-compat-version=@var{n}}).
2488 Although an effort has been made to warn about
2489 all such cases, there are probably some cases that are not warned about,
2490 even though G++ is generating incompatible code.  There may also be
2491 cases where warnings are emitted even though the code that is generated
2492 is compatible.
2494 You should rewrite your code to avoid these warnings if you are
2495 concerned about the fact that code generated by G++ may not be binary
2496 compatible with code generated by other compilers.
2498 @option{-Wabi} can also be used with an explicit version number to
2499 warn about compatibility with a particular @option{-fabi-version}
2500 level, e.g. @option{-Wabi=2} to warn about changes relative to
2501 @option{-fabi-version=2}.  Specifying a version number also sets
2502 @option{-fabi-compat-version=@var{n}}.
2504 The known incompatibilities in @option{-fabi-version=2} (which was the
2505 default from GCC 3.4 to 4.9) include:
2507 @itemize @bullet
2509 @item
2510 A template with a non-type template parameter of reference type was
2511 mangled incorrectly:
2512 @smallexample
2513 extern int N;
2514 template <int &> struct S @{@};
2515 void n (S<N>) @{2@}
2516 @end smallexample
2518 This was fixed in @option{-fabi-version=3}.
2520 @item
2521 SIMD vector types declared using @code{__attribute ((vector_size))} were
2522 mangled in a non-standard way that does not allow for overloading of
2523 functions taking vectors of different sizes.
2525 The mangling was changed in @option{-fabi-version=4}.
2527 @item
2528 @code{__attribute ((const))} and @code{noreturn} were mangled as type
2529 qualifiers, and @code{decltype} of a plain declaration was folded away.
2531 These mangling issues were fixed in @option{-fabi-version=5}.
2533 @item
2534 Scoped enumerators passed as arguments to a variadic function are
2535 promoted like unscoped enumerators, causing @samp{va_arg} to complain.
2536 On most targets this does not actually affect the parameter passing
2537 ABI, as there is no way to pass an argument smaller than @samp{int}.
2539 Also, the ABI changed the mangling of template argument packs,
2540 @code{const_cast}, @code{static_cast}, prefix increment/decrement, and
2541 a class scope function used as a template argument.
2543 These issues were corrected in @option{-fabi-version=6}.
2545 @item
2546 Lambdas in default argument scope were mangled incorrectly, and the
2547 ABI changed the mangling of nullptr_t.
2549 These issues were corrected in @option{-fabi-version=7}.
2551 @item
2552 When mangling a function type with function-cv-qualifiers, the
2553 un-qualified function type was incorrectly treated as a substitution
2554 candidate.
2556 This was fixed in @option{-fabi-version=8}.
2557 @end itemize
2559 It also warns about psABI-related changes.  The known psABI changes at this
2560 point include:
2562 @itemize @bullet
2564 @item
2565 For SysV/x86-64, unions with @code{long double} members are 
2566 passed in memory as specified in psABI.  For example:
2568 @smallexample
2569 union U @{
2570   long double ld;
2571   int i;
2573 @end smallexample
2575 @noindent
2576 @code{union U} is always passed in memory.
2578 @end itemize
2580 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
2581 @opindex Wctor-dtor-privacy
2582 @opindex Wno-ctor-dtor-privacy
2583 Warn when a class seems unusable because all the constructors or
2584 destructors in that class are private, and it has neither friends nor
2585 public static member functions.  Also warn if there are no non-private
2586 methods, and there's at least one private member function that isn't
2587 a constructor or destructor.
2589 @item -Wdelete-non-virtual-dtor @r{(C++ and Objective-C++ only)}
2590 @opindex Wdelete-non-virtual-dtor
2591 @opindex Wno-delete-non-virtual-dtor
2592 Warn when @samp{delete} is used to destroy an instance of a class that
2593 has virtual functions and non-virtual destructor. It is unsafe to delete
2594 an instance of a derived class through a pointer to a base class if the
2595 base class does not have a virtual destructor.  This warning is enabled
2596 by @option{-Wall}.
2598 @item -Wliteral-suffix @r{(C++ and Objective-C++ only)}
2599 @opindex Wliteral-suffix
2600 @opindex Wno-literal-suffix
2601 Warn when a string or character literal is followed by a ud-suffix which does
2602 not begin with an underscore.  As a conforming extension, GCC treats such
2603 suffixes as separate preprocessing tokens in order to maintain backwards
2604 compatibility with code that uses formatting macros from @code{<inttypes.h>}.
2605 For example:
2607 @smallexample
2608 #define __STDC_FORMAT_MACROS
2609 #include <inttypes.h>
2610 #include <stdio.h>
2612 int main() @{
2613   int64_t i64 = 123;
2614   printf("My int64: %"PRId64"\n", i64);
2616 @end smallexample
2618 In this case, @code{PRId64} is treated as a separate preprocessing token.
2620 This warning is enabled by default.
2622 @item -Wnarrowing @r{(C++ and Objective-C++ only)}
2623 @opindex Wnarrowing
2624 @opindex Wno-narrowing
2625 Warn when a narrowing conversion prohibited by C++11 occurs within
2626 @samp{@{ @}}, e.g.
2628 @smallexample
2629 int i = @{ 2.2 @}; // error: narrowing from double to int
2630 @end smallexample
2632 This flag is included in @option{-Wall} and @option{-Wc++11-compat}.
2634 With @option{-std=c++11}, @option{-Wno-narrowing} suppresses the diagnostic
2635 required by the standard.  Note that this does not affect the meaning
2636 of well-formed code; narrowing conversions are still considered
2637 ill-formed in SFINAE context.
2639 @item -Wnoexcept @r{(C++ and Objective-C++ only)}
2640 @opindex Wnoexcept
2641 @opindex Wno-noexcept
2642 Warn when a noexcept-expression evaluates to false because of a call
2643 to a function that does not have a non-throwing exception
2644 specification (i.e. @samp{throw()} or @samp{noexcept}) but is known by
2645 the compiler to never throw an exception.
2647 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
2648 @opindex Wnon-virtual-dtor
2649 @opindex Wno-non-virtual-dtor
2650 Warn when a class has virtual functions and an accessible non-virtual
2651 destructor itself or in an accessible polymorphic base class, in which
2652 case it is possible but unsafe to delete an instance of a derived
2653 class through a pointer to the class itself or base class.  This
2654 warning is automatically enabled if @option{-Weffc++} is specified.
2656 @item -Wreorder @r{(C++ and Objective-C++ only)}
2657 @opindex Wreorder
2658 @opindex Wno-reorder
2659 @cindex reordering, warning
2660 @cindex warning for reordering of member initializers
2661 Warn when the order of member initializers given in the code does not
2662 match the order in which they must be executed.  For instance:
2664 @smallexample
2665 struct A @{
2666   int i;
2667   int j;
2668   A(): j (0), i (1) @{ @}
2670 @end smallexample
2672 @noindent
2673 The compiler rearranges the member initializers for @samp{i}
2674 and @samp{j} to match the declaration order of the members, emitting
2675 a warning to that effect.  This warning is enabled by @option{-Wall}.
2677 @item -fext-numeric-literals @r{(C++ and Objective-C++ only)}
2678 @opindex fext-numeric-literals
2679 @opindex fno-ext-numeric-literals
2680 Accept imaginary, fixed-point, or machine-defined
2681 literal number suffixes as GNU extensions.
2682 When this option is turned off these suffixes are treated
2683 as C++11 user-defined literal numeric suffixes.
2684 This is on by default for all pre-C++11 dialects and all GNU dialects:
2685 @option{-std=c++98}, @option{-std=gnu++98}, @option{-std=gnu++11},
2686 @option{-std=gnu++1y}.
2687 This option is off by default
2688 for ISO C++11 onwards (@option{-std=c++11}, ...).
2689 @end table
2691 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
2693 @table @gcctabopt
2694 @item -Weffc++ @r{(C++ and Objective-C++ only)}
2695 @opindex Weffc++
2696 @opindex Wno-effc++
2697 Warn about violations of the following style guidelines from Scott Meyers'
2698 @cite{Effective C++} series of books:
2700 @itemize @bullet
2701 @item
2702 Define a copy constructor and an assignment operator for classes
2703 with dynamically-allocated memory.
2705 @item
2706 Prefer initialization to assignment in constructors.
2708 @item
2709 Have @code{operator=} return a reference to @code{*this}.
2711 @item
2712 Don't try to return a reference when you must return an object.
2714 @item
2715 Distinguish between prefix and postfix forms of increment and
2716 decrement operators.
2718 @item
2719 Never overload @code{&&}, @code{||}, or @code{,}.
2721 @end itemize
2723 This option also enables @option{-Wnon-virtual-dtor}, which is also
2724 one of the effective C++ recommendations.  However, the check is
2725 extended to warn about the lack of virtual destructor in accessible
2726 non-polymorphic bases classes too.
2728 When selecting this option, be aware that the standard library
2729 headers do not obey all of these guidelines; use @samp{grep -v}
2730 to filter out those warnings.
2732 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
2733 @opindex Wstrict-null-sentinel
2734 @opindex Wno-strict-null-sentinel
2735 Warn about the use of an uncasted @code{NULL} as sentinel.  When
2736 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2737 to @code{__null}.  Although it is a null pointer constant rather than a
2738 null pointer, it is guaranteed to be of the same size as a pointer.
2739 But this use is not portable across different compilers.
2741 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
2742 @opindex Wno-non-template-friend
2743 @opindex Wnon-template-friend
2744 Disable warnings when non-templatized friend functions are declared
2745 within a template.  Since the advent of explicit template specification
2746 support in G++, if the name of the friend is an unqualified-id (i.e.,
2747 @samp{friend foo(int)}), the C++ language specification demands that the
2748 friend declare or define an ordinary, nontemplate function.  (Section
2749 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2750 could be interpreted as a particular specialization of a templatized
2751 function.  Because this non-conforming behavior is no longer the default
2752 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2753 check existing code for potential trouble spots and is on by default.
2754 This new compiler behavior can be turned off with
2755 @option{-Wno-non-template-friend}, which keeps the conformant compiler code
2756 but disables the helpful warning.
2758 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
2759 @opindex Wold-style-cast
2760 @opindex Wno-old-style-cast
2761 Warn if an old-style (C-style) cast to a non-void type is used within
2762 a C++ program.  The new-style casts (@samp{dynamic_cast},
2763 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
2764 less vulnerable to unintended effects and much easier to search for.
2766 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
2767 @opindex Woverloaded-virtual
2768 @opindex Wno-overloaded-virtual
2769 @cindex overloaded virtual function, warning
2770 @cindex warning for overloaded virtual function
2771 Warn when a function declaration hides virtual functions from a
2772 base class.  For example, in:
2774 @smallexample
2775 struct A @{
2776   virtual void f();
2779 struct B: public A @{
2780   void f(int);
2782 @end smallexample
2784 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2785 like:
2787 @smallexample
2788 B* b;
2789 b->f();
2790 @end smallexample
2792 @noindent
2793 fails to compile.
2795 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
2796 @opindex Wno-pmf-conversions
2797 @opindex Wpmf-conversions
2798 Disable the diagnostic for converting a bound pointer to member function
2799 to a plain pointer.
2801 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
2802 @opindex Wsign-promo
2803 @opindex Wno-sign-promo
2804 Warn when overload resolution chooses a promotion from unsigned or
2805 enumerated type to a signed type, over a conversion to an unsigned type of
2806 the same size.  Previous versions of G++ tried to preserve
2807 unsignedness, but the standard mandates the current behavior.
2808 @end table
2810 @node Objective-C and Objective-C++ Dialect Options
2811 @section Options Controlling Objective-C and Objective-C++ Dialects
2813 @cindex compiler options, Objective-C and Objective-C++
2814 @cindex Objective-C and Objective-C++ options, command-line
2815 @cindex options, Objective-C and Objective-C++
2816 (NOTE: This manual does not describe the Objective-C and Objective-C++
2817 languages themselves.  @xref{Standards,,Language Standards
2818 Supported by GCC}, for references.)
2820 This section describes the command-line options that are only meaningful
2821 for Objective-C and Objective-C++ programs.  You can also use most of
2822 the language-independent GNU compiler options.
2823 For example, you might compile a file @code{some_class.m} like this:
2825 @smallexample
2826 gcc -g -fgnu-runtime -O -c some_class.m
2827 @end smallexample
2829 @noindent
2830 In this example, @option{-fgnu-runtime} is an option meant only for
2831 Objective-C and Objective-C++ programs; you can use the other options with
2832 any language supported by GCC@.
2834 Note that since Objective-C is an extension of the C language, Objective-C
2835 compilations may also use options specific to the C front-end (e.g.,
2836 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2837 C++-specific options (e.g., @option{-Wabi}).
2839 Here is a list of options that are @emph{only} for compiling Objective-C
2840 and Objective-C++ programs:
2842 @table @gcctabopt
2843 @item -fconstant-string-class=@var{class-name}
2844 @opindex fconstant-string-class
2845 Use @var{class-name} as the name of the class to instantiate for each
2846 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2847 class name is @code{NXConstantString} if the GNU runtime is being used, and
2848 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2849 @option{-fconstant-cfstrings} option, if also present, overrides the
2850 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2851 to be laid out as constant CoreFoundation strings.
2853 @item -fgnu-runtime
2854 @opindex fgnu-runtime
2855 Generate object code compatible with the standard GNU Objective-C
2856 runtime.  This is the default for most types of systems.
2858 @item -fnext-runtime
2859 @opindex fnext-runtime
2860 Generate output compatible with the NeXT runtime.  This is the default
2861 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2862 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2863 used.
2865 @item -fno-nil-receivers
2866 @opindex fno-nil-receivers
2867 Assume that all Objective-C message dispatches (@code{[receiver
2868 message:arg]}) in this translation unit ensure that the receiver is
2869 not @code{nil}.  This allows for more efficient entry points in the
2870 runtime to be used.  This option is only available in conjunction with
2871 the NeXT runtime and ABI version 0 or 1.
2873 @item -fobjc-abi-version=@var{n}
2874 @opindex fobjc-abi-version
2875 Use version @var{n} of the Objective-C ABI for the selected runtime.
2876 This option is currently supported only for the NeXT runtime.  In that
2877 case, Version 0 is the traditional (32-bit) ABI without support for
2878 properties and other Objective-C 2.0 additions.  Version 1 is the
2879 traditional (32-bit) ABI with support for properties and other
2880 Objective-C 2.0 additions.  Version 2 is the modern (64-bit) ABI.  If
2881 nothing is specified, the default is Version 0 on 32-bit target
2882 machines, and Version 2 on 64-bit target machines.
2884 @item -fobjc-call-cxx-cdtors
2885 @opindex fobjc-call-cxx-cdtors
2886 For each Objective-C class, check if any of its instance variables is a
2887 C++ object with a non-trivial default constructor.  If so, synthesize a
2888 special @code{- (id) .cxx_construct} instance method which runs
2889 non-trivial default constructors on any such instance variables, in order,
2890 and then return @code{self}.  Similarly, check if any instance variable
2891 is a C++ object with a non-trivial destructor, and if so, synthesize a
2892 special @code{- (void) .cxx_destruct} method which runs
2893 all such default destructors, in reverse order.
2895 The @code{- (id) .cxx_construct} and @code{- (void) .cxx_destruct}
2896 methods thusly generated only operate on instance variables
2897 declared in the current Objective-C class, and not those inherited
2898 from superclasses.  It is the responsibility of the Objective-C
2899 runtime to invoke all such methods in an object's inheritance
2900 hierarchy.  The @code{- (id) .cxx_construct} methods are invoked
2901 by the runtime immediately after a new object instance is allocated;
2902 the @code{- (void) .cxx_destruct} methods are invoked immediately
2903 before the runtime deallocates an object instance.
2905 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2906 support for invoking the @code{- (id) .cxx_construct} and
2907 @code{- (void) .cxx_destruct} methods.
2909 @item -fobjc-direct-dispatch
2910 @opindex fobjc-direct-dispatch
2911 Allow fast jumps to the message dispatcher.  On Darwin this is
2912 accomplished via the comm page.
2914 @item -fobjc-exceptions
2915 @opindex fobjc-exceptions
2916 Enable syntactic support for structured exception handling in
2917 Objective-C, similar to what is offered by C++ and Java.  This option
2918 is required to use the Objective-C keywords @code{@@try},
2919 @code{@@throw}, @code{@@catch}, @code{@@finally} and
2920 @code{@@synchronized}.  This option is available with both the GNU
2921 runtime and the NeXT runtime (but not available in conjunction with
2922 the NeXT runtime on Mac OS X 10.2 and earlier).
2924 @item -fobjc-gc
2925 @opindex fobjc-gc
2926 Enable garbage collection (GC) in Objective-C and Objective-C++
2927 programs.  This option is only available with the NeXT runtime; the
2928 GNU runtime has a different garbage collection implementation that
2929 does not require special compiler flags.
2931 @item -fobjc-nilcheck
2932 @opindex fobjc-nilcheck
2933 For the NeXT runtime with version 2 of the ABI, check for a nil
2934 receiver in method invocations before doing the actual method call.
2935 This is the default and can be disabled using
2936 @option{-fno-objc-nilcheck}.  Class methods and super calls are never
2937 checked for nil in this way no matter what this flag is set to.
2938 Currently this flag does nothing when the GNU runtime, or an older
2939 version of the NeXT runtime ABI, is used.
2941 @item -fobjc-std=objc1
2942 @opindex fobjc-std
2943 Conform to the language syntax of Objective-C 1.0, the language
2944 recognized by GCC 4.0.  This only affects the Objective-C additions to
2945 the C/C++ language; it does not affect conformance to C/C++ standards,
2946 which is controlled by the separate C/C++ dialect option flags.  When
2947 this option is used with the Objective-C or Objective-C++ compiler,
2948 any Objective-C syntax that is not recognized by GCC 4.0 is rejected.
2949 This is useful if you need to make sure that your Objective-C code can
2950 be compiled with older versions of GCC@.
2952 @item -freplace-objc-classes
2953 @opindex freplace-objc-classes
2954 Emit a special marker instructing @command{ld(1)} not to statically link in
2955 the resulting object file, and allow @command{dyld(1)} to load it in at
2956 run time instead.  This is used in conjunction with the Fix-and-Continue
2957 debugging mode, where the object file in question may be recompiled and
2958 dynamically reloaded in the course of program execution, without the need
2959 to restart the program itself.  Currently, Fix-and-Continue functionality
2960 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2961 and later.
2963 @item -fzero-link
2964 @opindex fzero-link
2965 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2966 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2967 compile time) with static class references that get initialized at load time,
2968 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2969 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2970 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2971 for individual class implementations to be modified during program execution.
2972 The GNU runtime currently always retains calls to @code{objc_get_class("@dots{}")}
2973 regardless of command-line options.
2975 @item -fno-local-ivars
2976 @opindex fno-local-ivars
2977 @opindex flocal-ivars
2978 By default instance variables in Objective-C can be accessed as if
2979 they were local variables from within the methods of the class they're
2980 declared in.  This can lead to shadowing between instance variables
2981 and other variables declared either locally inside a class method or
2982 globally with the same name.  Specifying the @option{-fno-local-ivars}
2983 flag disables this behavior thus avoiding variable shadowing issues.
2985 @item -fivar-visibility=@var{public|protected|private|package}
2986 @opindex fivar-visibility
2987 Set the default instance variable visibility to the specified option
2988 so that instance variables declared outside the scope of any access
2989 modifier directives default to the specified visibility.
2991 @item -gen-decls
2992 @opindex gen-decls
2993 Dump interface declarations for all classes seen in the source file to a
2994 file named @file{@var{sourcename}.decl}.
2996 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
2997 @opindex Wassign-intercept
2998 @opindex Wno-assign-intercept
2999 Warn whenever an Objective-C assignment is being intercepted by the
3000 garbage collector.
3002 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
3003 @opindex Wno-protocol
3004 @opindex Wprotocol
3005 If a class is declared to implement a protocol, a warning is issued for
3006 every method in the protocol that is not implemented by the class.  The
3007 default behavior is to issue a warning for every method not explicitly
3008 implemented in the class, even if a method implementation is inherited
3009 from the superclass.  If you use the @option{-Wno-protocol} option, then
3010 methods inherited from the superclass are considered to be implemented,
3011 and no warning is issued for them.
3013 @item -Wselector @r{(Objective-C and Objective-C++ only)}
3014 @opindex Wselector
3015 @opindex Wno-selector
3016 Warn if multiple methods of different types for the same selector are
3017 found during compilation.  The check is performed on the list of methods
3018 in the final stage of compilation.  Additionally, a check is performed
3019 for each selector appearing in a @code{@@selector(@dots{})}
3020 expression, and a corresponding method for that selector has been found
3021 during compilation.  Because these checks scan the method table only at
3022 the end of compilation, these warnings are not produced if the final
3023 stage of compilation is not reached, for example because an error is
3024 found during compilation, or because the @option{-fsyntax-only} option is
3025 being used.
3027 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
3028 @opindex Wstrict-selector-match
3029 @opindex Wno-strict-selector-match
3030 Warn if multiple methods with differing argument and/or return types are
3031 found for a given selector when attempting to send a message using this
3032 selector to a receiver of type @code{id} or @code{Class}.  When this flag
3033 is off (which is the default behavior), the compiler omits such warnings
3034 if any differences found are confined to types that share the same size
3035 and alignment.
3037 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
3038 @opindex Wundeclared-selector
3039 @opindex Wno-undeclared-selector
3040 Warn if a @code{@@selector(@dots{})} expression referring to an
3041 undeclared selector is found.  A selector is considered undeclared if no
3042 method with that name has been declared before the
3043 @code{@@selector(@dots{})} expression, either explicitly in an
3044 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
3045 an @code{@@implementation} section.  This option always performs its
3046 checks as soon as a @code{@@selector(@dots{})} expression is found,
3047 while @option{-Wselector} only performs its checks in the final stage of
3048 compilation.  This also enforces the coding style convention
3049 that methods and selectors must be declared before being used.
3051 @item -print-objc-runtime-info
3052 @opindex print-objc-runtime-info
3053 Generate C header describing the largest structure that is passed by
3054 value, if any.
3056 @end table
3058 @node Language Independent Options
3059 @section Options to Control Diagnostic Messages Formatting
3060 @cindex options to control diagnostics formatting
3061 @cindex diagnostic messages
3062 @cindex message formatting
3064 Traditionally, diagnostic messages have been formatted irrespective of
3065 the output device's aspect (e.g.@: its width, @dots{}).  You can use the
3066 options described below
3067 to control the formatting algorithm for diagnostic messages, 
3068 e.g.@: how many characters per line, how often source location
3069 information should be reported.  Note that some language front ends may not
3070 honor these options.
3072 @table @gcctabopt
3073 @item -fmessage-length=@var{n}
3074 @opindex fmessage-length
3075 Try to format error messages so that they fit on lines of about @var{n}
3076 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
3077 the front ends supported by GCC@.  If @var{n} is zero, then no
3078 line-wrapping is done; each error message appears on a single
3079 line.
3081 @item -fdiagnostics-show-location=once
3082 @opindex fdiagnostics-show-location
3083 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
3084 reporter to emit source location information @emph{once}; that is, in
3085 case the message is too long to fit on a single physical line and has to
3086 be wrapped, the source location won't be emitted (as prefix) again,
3087 over and over, in subsequent continuation lines.  This is the default
3088 behavior.
3090 @item -fdiagnostics-show-location=every-line
3091 Only meaningful in line-wrapping mode.  Instructs the diagnostic
3092 messages reporter to emit the same source location information (as
3093 prefix) for physical lines that result from the process of breaking
3094 a message which is too long to fit on a single line.
3096 @item -fdiagnostics-color[=@var{WHEN}]
3097 @itemx -fno-diagnostics-color
3098 @opindex fdiagnostics-color
3099 @cindex highlight, color, colour
3100 @vindex GCC_COLORS @r{environment variable}
3101 Use color in diagnostics.  @var{WHEN} is @samp{never}, @samp{always},
3102 or @samp{auto}.  The default is @samp{never} if @env{GCC_COLORS} environment
3103 variable isn't present in the environment, and @samp{auto} otherwise.
3104 @samp{auto} means to use color only when the standard error is a terminal.
3105 The forms @option{-fdiagnostics-color} and @option{-fno-diagnostics-color} are
3106 aliases for @option{-fdiagnostics-color=always} and
3107 @option{-fdiagnostics-color=never}, respectively.
3109 The colors are defined by the environment variable @env{GCC_COLORS}.
3110 Its value is a colon-separated list of capabilities and Select Graphic
3111 Rendition (SGR) substrings. SGR commands are interpreted by the
3112 terminal or terminal emulator.  (See the section in the documentation
3113 of your text terminal for permitted values and their meanings as
3114 character attributes.)  These substring values are integers in decimal
3115 representation and can be concatenated with semicolons.
3116 Common values to concatenate include
3117 @samp{1} for bold,
3118 @samp{4} for underline,
3119 @samp{5} for blink,
3120 @samp{7} for inverse,
3121 @samp{39} for default foreground color,
3122 @samp{30} to @samp{37} for foreground colors,
3123 @samp{90} to @samp{97} for 16-color mode foreground colors,
3124 @samp{38;5;0} to @samp{38;5;255}
3125 for 88-color and 256-color modes foreground colors,
3126 @samp{49} for default background color,
3127 @samp{40} to @samp{47} for background colors,
3128 @samp{100} to @samp{107} for 16-color mode background colors,
3129 and @samp{48;5;0} to @samp{48;5;255}
3130 for 88-color and 256-color modes background colors.
3132 The default @env{GCC_COLORS} is
3133 @samp{error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01}
3134 where @samp{01;31} is bold red, @samp{01;35} is bold magenta,
3135 @samp{01;36} is bold cyan, @samp{01;32} is bold green and
3136 @samp{01} is bold. Setting @env{GCC_COLORS} to the empty
3137 string disables colors.
3138 Supported capabilities are as follows.
3140 @table @code
3141 @item error=
3142 @vindex error GCC_COLORS @r{capability}
3143 SGR substring for error: markers.
3145 @item warning=
3146 @vindex warning GCC_COLORS @r{capability}
3147 SGR substring for warning: markers.
3149 @item note=
3150 @vindex note GCC_COLORS @r{capability}
3151 SGR substring for note: markers.
3153 @item caret=
3154 @vindex caret GCC_COLORS @r{capability}
3155 SGR substring for caret line.
3157 @item locus=
3158 @vindex locus GCC_COLORS @r{capability}
3159 SGR substring for location information, @samp{file:line} or
3160 @samp{file:line:column} etc.
3162 @item quote=
3163 @vindex quote GCC_COLORS @r{capability}
3164 SGR substring for information printed within quotes.
3165 @end table
3167 @item -fno-diagnostics-show-option
3168 @opindex fno-diagnostics-show-option
3169 @opindex fdiagnostics-show-option
3170 By default, each diagnostic emitted includes text indicating the
3171 command-line option that directly controls the diagnostic (if such an
3172 option is known to the diagnostic machinery).  Specifying the
3173 @option{-fno-diagnostics-show-option} flag suppresses that behavior.
3175 @item -fno-diagnostics-show-caret
3176 @opindex fno-diagnostics-show-caret
3177 @opindex fdiagnostics-show-caret
3178 By default, each diagnostic emitted includes the original source line
3179 and a caret '^' indicating the column.  This option suppresses this
3180 information.
3182 @end table
3184 @node Warning Options
3185 @section Options to Request or Suppress Warnings
3186 @cindex options to control warnings
3187 @cindex warning messages
3188 @cindex messages, warning
3189 @cindex suppressing warnings
3191 Warnings are diagnostic messages that report constructions that
3192 are not inherently erroneous but that are risky or suggest there
3193 may have been an error.
3195 The following language-independent options do not enable specific
3196 warnings but control the kinds of diagnostics produced by GCC@.
3198 @table @gcctabopt
3199 @cindex syntax checking
3200 @item -fsyntax-only
3201 @opindex fsyntax-only
3202 Check the code for syntax errors, but don't do anything beyond that.
3204 @item -fmax-errors=@var{n}
3205 @opindex fmax-errors
3206 Limits the maximum number of error messages to @var{n}, at which point
3207 GCC bails out rather than attempting to continue processing the source
3208 code.  If @var{n} is 0 (the default), there is no limit on the number
3209 of error messages produced.  If @option{-Wfatal-errors} is also
3210 specified, then @option{-Wfatal-errors} takes precedence over this
3211 option.
3213 @item -w
3214 @opindex w
3215 Inhibit all warning messages.
3217 @item -Werror
3218 @opindex Werror
3219 @opindex Wno-error
3220 Make all warnings into errors.
3222 @item -Werror=
3223 @opindex Werror=
3224 @opindex Wno-error=
3225 Make the specified warning into an error.  The specifier for a warning
3226 is appended; for example @option{-Werror=switch} turns the warnings
3227 controlled by @option{-Wswitch} into errors.  This switch takes a
3228 negative form, to be used to negate @option{-Werror} for specific
3229 warnings; for example @option{-Wno-error=switch} makes
3230 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
3231 is in effect.
3233 The warning message for each controllable warning includes the
3234 option that controls the warning.  That option can then be used with
3235 @option{-Werror=} and @option{-Wno-error=} as described above.
3236 (Printing of the option in the warning message can be disabled using the
3237 @option{-fno-diagnostics-show-option} flag.)
3239 Note that specifying @option{-Werror=}@var{foo} automatically implies
3240 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
3241 imply anything.
3243 @item -Wfatal-errors
3244 @opindex Wfatal-errors
3245 @opindex Wno-fatal-errors
3246 This option causes the compiler to abort compilation on the first error
3247 occurred rather than trying to keep going and printing further error
3248 messages.
3250 @end table
3252 You can request many specific warnings with options beginning with
3253 @samp{-W}, for example @option{-Wimplicit} to request warnings on
3254 implicit declarations.  Each of these specific warning options also
3255 has a negative form beginning @samp{-Wno-} to turn off warnings; for
3256 example, @option{-Wno-implicit}.  This manual lists only one of the
3257 two forms, whichever is not the default.  For further
3258 language-specific options also refer to @ref{C++ Dialect Options} and
3259 @ref{Objective-C and Objective-C++ Dialect Options}.
3261 When an unrecognized warning option is requested (e.g.,
3262 @option{-Wunknown-warning}), GCC emits a diagnostic stating
3263 that the option is not recognized.  However, if the @option{-Wno-} form
3264 is used, the behavior is slightly different: no diagnostic is
3265 produced for @option{-Wno-unknown-warning} unless other diagnostics
3266 are being produced.  This allows the use of new @option{-Wno-} options
3267 with old compilers, but if something goes wrong, the compiler
3268 warns that an unrecognized option is present.
3270 @table @gcctabopt
3271 @item -Wpedantic
3272 @itemx -pedantic
3273 @opindex pedantic
3274 @opindex Wpedantic
3275 Issue all the warnings demanded by strict ISO C and ISO C++;
3276 reject all programs that use forbidden extensions, and some other
3277 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
3278 version of the ISO C standard specified by any @option{-std} option used.
3280 Valid ISO C and ISO C++ programs should compile properly with or without
3281 this option (though a rare few require @option{-ansi} or a
3282 @option{-std} option specifying the required version of ISO C)@.  However,
3283 without this option, certain GNU extensions and traditional C and C++
3284 features are supported as well.  With this option, they are rejected.
3286 @option{-Wpedantic} does not cause warning messages for use of the
3287 alternate keywords whose names begin and end with @samp{__}.  Pedantic
3288 warnings are also disabled in the expression that follows
3289 @code{__extension__}.  However, only system header files should use
3290 these escape routes; application programs should avoid them.
3291 @xref{Alternate Keywords}.
3293 Some users try to use @option{-Wpedantic} to check programs for strict ISO
3294 C conformance.  They soon find that it does not do quite what they want:
3295 it finds some non-ISO practices, but not all---only those for which
3296 ISO C @emph{requires} a diagnostic, and some others for which
3297 diagnostics have been added.
3299 A feature to report any failure to conform to ISO C might be useful in
3300 some instances, but would require considerable additional work and would
3301 be quite different from @option{-Wpedantic}.  We don't have plans to
3302 support such a feature in the near future.
3304 Where the standard specified with @option{-std} represents a GNU
3305 extended dialect of C, such as @samp{gnu90} or @samp{gnu99}, there is a
3306 corresponding @dfn{base standard}, the version of ISO C on which the GNU
3307 extended dialect is based.  Warnings from @option{-Wpedantic} are given
3308 where they are required by the base standard.  (It does not make sense
3309 for such warnings to be given only for features not in the specified GNU
3310 C dialect, since by definition the GNU dialects of C include all
3311 features the compiler supports with the given option, and there would be
3312 nothing to warn about.)
3314 @item -pedantic-errors
3315 @opindex pedantic-errors
3316 Like @option{-Wpedantic}, except that errors are produced rather than
3317 warnings.
3319 @item -Wall
3320 @opindex Wall
3321 @opindex Wno-all
3322 This enables all the warnings about constructions that some users
3323 consider questionable, and that are easy to avoid (or modify to
3324 prevent the warning), even in conjunction with macros.  This also
3325 enables some language-specific warnings described in @ref{C++ Dialect
3326 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
3328 @option{-Wall} turns on the following warning flags:
3330 @gccoptlist{-Waddress   @gol
3331 -Warray-bounds @r{(only with} @option{-O2}@r{)}  @gol
3332 -Wc++11-compat  @gol
3333 -Wchar-subscripts  @gol
3334 -Wenum-compare @r{(in C/ObjC; this is on by default in C++)} @gol
3335 -Wimplicit-int @r{(C and Objective-C only)} @gol
3336 -Wimplicit-function-declaration @r{(C and Objective-C only)} @gol
3337 -Wcomment  @gol
3338 -Wformat   @gol
3339 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
3340 -Wmaybe-uninitialized @gol
3341 -Wmissing-braces @r{(only for C/ObjC)} @gol
3342 -Wnonnull  @gol
3343 -Wopenmp-simd @gol
3344 -Wparentheses  @gol
3345 -Wpointer-sign  @gol
3346 -Wreorder   @gol
3347 -Wreturn-type  @gol
3348 -Wsequence-point  @gol
3349 -Wsign-compare @r{(only in C++)}  @gol
3350 -Wstrict-aliasing  @gol
3351 -Wstrict-overflow=1  @gol
3352 -Wswitch  @gol
3353 -Wtrigraphs  @gol
3354 -Wuninitialized  @gol
3355 -Wunknown-pragmas  @gol
3356 -Wunused-function  @gol
3357 -Wunused-label     @gol
3358 -Wunused-value     @gol
3359 -Wunused-variable  @gol
3360 -Wvolatile-register-var @gol
3363 Note that some warning flags are not implied by @option{-Wall}.  Some of
3364 them warn about constructions that users generally do not consider
3365 questionable, but which occasionally you might wish to check for;
3366 others warn about constructions that are necessary or hard to avoid in
3367 some cases, and there is no simple way to modify the code to suppress
3368 the warning. Some of them are enabled by @option{-Wextra} but many of
3369 them must be enabled individually.
3371 @item -Wextra
3372 @opindex W
3373 @opindex Wextra
3374 @opindex Wno-extra
3375 This enables some extra warning flags that are not enabled by
3376 @option{-Wall}. (This option used to be called @option{-W}.  The older
3377 name is still supported, but the newer name is more descriptive.)
3379 @gccoptlist{-Wclobbered  @gol
3380 -Wempty-body  @gol
3381 -Wignored-qualifiers @gol
3382 -Wmissing-field-initializers  @gol
3383 -Wmissing-parameter-type @r{(C only)}  @gol
3384 -Wold-style-declaration @r{(C only)}  @gol
3385 -Woverride-init  @gol
3386 -Wsign-compare  @gol
3387 -Wtype-limits  @gol
3388 -Wuninitialized  @gol
3389 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)} @gol
3390 -Wunused-but-set-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}  @gol
3393 The option @option{-Wextra} also prints warning messages for the
3394 following cases:
3396 @itemize @bullet
3398 @item
3399 A pointer is compared against integer zero with @samp{<}, @samp{<=},
3400 @samp{>}, or @samp{>=}.
3402 @item
3403 (C++ only) An enumerator and a non-enumerator both appear in a
3404 conditional expression.
3406 @item
3407 (C++ only) Ambiguous virtual bases.
3409 @item
3410 (C++ only) Subscripting an array that has been declared @samp{register}.
3412 @item
3413 (C++ only) Taking the address of a variable that has been declared
3414 @samp{register}.
3416 @item
3417 (C++ only) A base class is not initialized in a derived class's copy
3418 constructor.
3420 @end itemize
3422 @item -Wchar-subscripts
3423 @opindex Wchar-subscripts
3424 @opindex Wno-char-subscripts
3425 Warn if an array subscript has type @code{char}.  This is a common cause
3426 of error, as programmers often forget that this type is signed on some
3427 machines.
3428 This warning is enabled by @option{-Wall}.
3430 @item -Wcomment
3431 @opindex Wcomment
3432 @opindex Wno-comment
3433 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
3434 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
3435 This warning is enabled by @option{-Wall}.
3437 @item -Wno-coverage-mismatch
3438 @opindex Wno-coverage-mismatch
3439 Warn if feedback profiles do not match when using the
3440 @option{-fprofile-use} option.
3441 If a source file is changed between compiling with @option{-fprofile-gen} and
3442 with @option{-fprofile-use}, the files with the profile feedback can fail
3443 to match the source file and GCC cannot use the profile feedback
3444 information.  By default, this warning is enabled and is treated as an
3445 error.  @option{-Wno-coverage-mismatch} can be used to disable the
3446 warning or @option{-Wno-error=coverage-mismatch} can be used to
3447 disable the error.  Disabling the error for this warning can result in
3448 poorly optimized code and is useful only in the
3449 case of very minor changes such as bug fixes to an existing code-base.
3450 Completely disabling the warning is not recommended.
3452 @item -Wno-cpp
3453 @r{(C, Objective-C, C++, Objective-C++ and Fortran only)}
3455 Suppress warning messages emitted by @code{#warning} directives.
3457 @item -Wdouble-promotion @r{(C, C++, Objective-C and Objective-C++ only)}
3458 @opindex Wdouble-promotion
3459 @opindex Wno-double-promotion
3460 Give a warning when a value of type @code{float} is implicitly
3461 promoted to @code{double}.  CPUs with a 32-bit ``single-precision''
3462 floating-point unit implement @code{float} in hardware, but emulate
3463 @code{double} in software.  On such a machine, doing computations
3464 using @code{double} values is much more expensive because of the
3465 overhead required for software emulation.
3467 It is easy to accidentally do computations with @code{double} because
3468 floating-point literals are implicitly of type @code{double}.  For
3469 example, in:
3470 @smallexample
3471 @group
3472 float area(float radius)
3474    return 3.14159 * radius * radius;
3476 @end group
3477 @end smallexample
3478 the compiler performs the entire computation with @code{double}
3479 because the floating-point literal is a @code{double}.
3481 @item -Wformat
3482 @itemx -Wformat=@var{n}
3483 @opindex Wformat
3484 @opindex Wno-format
3485 @opindex ffreestanding
3486 @opindex fno-builtin
3487 @opindex Wformat=
3488 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
3489 the arguments supplied have types appropriate to the format string
3490 specified, and that the conversions specified in the format string make
3491 sense.  This includes standard functions, and others specified by format
3492 attributes (@pxref{Function Attributes}), in the @code{printf},
3493 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
3494 not in the C standard) families (or other target-specific families).
3495 Which functions are checked without format attributes having been
3496 specified depends on the standard version selected, and such checks of
3497 functions without the attribute specified are disabled by
3498 @option{-ffreestanding} or @option{-fno-builtin}.
3500 The formats are checked against the format features supported by GNU
3501 libc version 2.2.  These include all ISO C90 and C99 features, as well
3502 as features from the Single Unix Specification and some BSD and GNU
3503 extensions.  Other library implementations may not support all these
3504 features; GCC does not support warning about features that go beyond a
3505 particular library's limitations.  However, if @option{-Wpedantic} is used
3506 with @option{-Wformat}, warnings are given about format features not
3507 in the selected standard version (but not for @code{strfmon} formats,
3508 since those are not in any version of the C standard).  @xref{C Dialect
3509 Options,,Options Controlling C Dialect}.
3511 @table @gcctabopt
3512 @item -Wformat=1
3513 @itemx -Wformat
3514 @opindex Wformat
3515 @opindex Wformat=1
3516 Option @option{-Wformat} is equivalent to @option{-Wformat=1}, and
3517 @option{-Wno-format} is equivalent to @option{-Wformat=0}.  Since
3518 @option{-Wformat} also checks for null format arguments for several
3519 functions, @option{-Wformat} also implies @option{-Wnonnull}.  Some
3520 aspects of this level of format checking can be disabled by the
3521 options: @option{-Wno-format-contains-nul},
3522 @option{-Wno-format-extra-args}, and @option{-Wno-format-zero-length}.
3523 @option{-Wformat} is enabled by @option{-Wall}.
3525 @item -Wno-format-contains-nul
3526 @opindex Wno-format-contains-nul
3527 @opindex Wformat-contains-nul
3528 If @option{-Wformat} is specified, do not warn about format strings that
3529 contain NUL bytes.
3531 @item -Wno-format-extra-args
3532 @opindex Wno-format-extra-args
3533 @opindex Wformat-extra-args
3534 If @option{-Wformat} is specified, do not warn about excess arguments to a
3535 @code{printf} or @code{scanf} format function.  The C standard specifies
3536 that such arguments are ignored.
3538 Where the unused arguments lie between used arguments that are
3539 specified with @samp{$} operand number specifications, normally
3540 warnings are still given, since the implementation could not know what
3541 type to pass to @code{va_arg} to skip the unused arguments.  However,
3542 in the case of @code{scanf} formats, this option suppresses the
3543 warning if the unused arguments are all pointers, since the Single
3544 Unix Specification says that such unused arguments are allowed.
3546 @item -Wno-format-zero-length
3547 @opindex Wno-format-zero-length
3548 @opindex Wformat-zero-length
3549 If @option{-Wformat} is specified, do not warn about zero-length formats.
3550 The C standard specifies that zero-length formats are allowed.
3553 @item -Wformat=2
3554 @opindex Wformat=2
3555 Enable @option{-Wformat} plus additional format checks.  Currently
3556 equivalent to @option{-Wformat -Wformat-nonliteral -Wformat-security
3557 -Wformat-signedness -Wformat-y2k}.
3559 @item -Wformat-nonliteral
3560 @opindex Wformat-nonliteral
3561 @opindex Wno-format-nonliteral
3562 If @option{-Wformat} is specified, also warn if the format string is not a
3563 string literal and so cannot be checked, unless the format function
3564 takes its format arguments as a @code{va_list}.
3566 @item -Wformat-security
3567 @opindex Wformat-security
3568 @opindex Wno-format-security
3569 If @option{-Wformat} is specified, also warn about uses of format
3570 functions that represent possible security problems.  At present, this
3571 warns about calls to @code{printf} and @code{scanf} functions where the
3572 format string is not a string literal and there are no format arguments,
3573 as in @code{printf (foo);}.  This may be a security hole if the format
3574 string came from untrusted input and contains @samp{%n}.  (This is
3575 currently a subset of what @option{-Wformat-nonliteral} warns about, but
3576 in future warnings may be added to @option{-Wformat-security} that are not
3577 included in @option{-Wformat-nonliteral}.)
3579 @item -Wformat-signedness
3580 @opindex Wformat-signedness
3581 @opindex Wno-format-signedness
3582 If @option{-Wformat} is specified, also warn if the format string
3583 requires an unsigned argument and the argument is signed and vice versa.
3585 @item -Wformat-y2k
3586 @opindex Wformat-y2k
3587 @opindex Wno-format-y2k
3588 If @option{-Wformat} is specified, also warn about @code{strftime}
3589 formats that may yield only a two-digit year.
3590 @end table
3592 @item -Wnonnull
3593 @opindex Wnonnull
3594 @opindex Wno-nonnull
3595 Warn about passing a null pointer for arguments marked as
3596 requiring a non-null value by the @code{nonnull} function attribute.
3598 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
3599 can be disabled with the @option{-Wno-nonnull} option.
3601 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
3602 @opindex Winit-self
3603 @opindex Wno-init-self
3604 Warn about uninitialized variables that are initialized with themselves.
3605 Note this option can only be used with the @option{-Wuninitialized} option.
3607 For example, GCC warns about @code{i} being uninitialized in the
3608 following snippet only when @option{-Winit-self} has been specified:
3609 @smallexample
3610 @group
3611 int f()
3613   int i = i;
3614   return i;
3616 @end group
3617 @end smallexample
3619 This warning is enabled by @option{-Wall} in C++.
3621 @item -Wimplicit-int @r{(C and Objective-C only)}
3622 @opindex Wimplicit-int
3623 @opindex Wno-implicit-int
3624 Warn when a declaration does not specify a type.
3625 This warning is enabled by @option{-Wall}.
3627 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
3628 @opindex Wimplicit-function-declaration
3629 @opindex Wno-implicit-function-declaration
3630 Give a warning whenever a function is used before being declared. In
3631 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
3632 enabled by default and it is made into an error by
3633 @option{-pedantic-errors}. This warning is also enabled by
3634 @option{-Wall}.
3636 @item -Wimplicit @r{(C and Objective-C only)}
3637 @opindex Wimplicit
3638 @opindex Wno-implicit
3639 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
3640 This warning is enabled by @option{-Wall}.
3642 @item -Wignored-qualifiers @r{(C and C++ only)}
3643 @opindex Wignored-qualifiers
3644 @opindex Wno-ignored-qualifiers
3645 Warn if the return type of a function has a type qualifier
3646 such as @code{const}.  For ISO C such a type qualifier has no effect,
3647 since the value returned by a function is not an lvalue.
3648 For C++, the warning is only emitted for scalar types or @code{void}.
3649 ISO C prohibits qualified @code{void} return types on function
3650 definitions, so such return types always receive a warning
3651 even without this option.
3653 This warning is also enabled by @option{-Wextra}.
3655 @item -Wmain
3656 @opindex Wmain
3657 @opindex Wno-main
3658 Warn if the type of @samp{main} is suspicious.  @samp{main} should be
3659 a function with external linkage, returning int, taking either zero
3660 arguments, two, or three arguments of appropriate types.  This warning
3661 is enabled by default in C++ and is enabled by either @option{-Wall}
3662 or @option{-Wpedantic}.
3664 @item -Wmissing-braces
3665 @opindex Wmissing-braces
3666 @opindex Wno-missing-braces
3667 Warn if an aggregate or union initializer is not fully bracketed.  In
3668 the following example, the initializer for @samp{a} is not fully
3669 bracketed, but that for @samp{b} is fully bracketed.  This warning is
3670 enabled by @option{-Wall} in C.
3672 @smallexample
3673 int a[2][2] = @{ 0, 1, 2, 3 @};
3674 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
3675 @end smallexample
3677 This warning is enabled by @option{-Wall}.
3679 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
3680 @opindex Wmissing-include-dirs
3681 @opindex Wno-missing-include-dirs
3682 Warn if a user-supplied include directory does not exist.
3684 @item -Wparentheses
3685 @opindex Wparentheses
3686 @opindex Wno-parentheses
3687 Warn if parentheses are omitted in certain contexts, such
3688 as when there is an assignment in a context where a truth value
3689 is expected, or when operators are nested whose precedence people
3690 often get confused about.
3692 Also warn if a comparison like @samp{x<=y<=z} appears; this is
3693 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
3694 interpretation from that of ordinary mathematical notation.
3696 Also warn about constructions where there may be confusion to which
3697 @code{if} statement an @code{else} branch belongs.  Here is an example of
3698 such a case:
3700 @smallexample
3701 @group
3703   if (a)
3704     if (b)
3705       foo ();
3706   else
3707     bar ();
3709 @end group
3710 @end smallexample
3712 In C/C++, every @code{else} branch belongs to the innermost possible
3713 @code{if} statement, which in this example is @code{if (b)}.  This is
3714 often not what the programmer expected, as illustrated in the above
3715 example by indentation the programmer chose.  When there is the
3716 potential for this confusion, GCC issues a warning when this flag
3717 is specified.  To eliminate the warning, add explicit braces around
3718 the innermost @code{if} statement so there is no way the @code{else}
3719 can belong to the enclosing @code{if}.  The resulting code
3720 looks like this:
3722 @smallexample
3723 @group
3725   if (a)
3726     @{
3727       if (b)
3728         foo ();
3729       else
3730         bar ();
3731     @}
3733 @end group
3734 @end smallexample
3736 Also warn for dangerous uses of the GNU extension to
3737 @code{?:} with omitted middle operand. When the condition
3738 in the @code{?}: operator is a boolean expression, the omitted value is
3739 always 1.  Often programmers expect it to be a value computed
3740 inside the conditional expression instead.
3742 This warning is enabled by @option{-Wall}.
3744 @item -Wsequence-point
3745 @opindex Wsequence-point
3746 @opindex Wno-sequence-point
3747 Warn about code that may have undefined semantics because of violations
3748 of sequence point rules in the C and C++ standards.
3750 The C and C++ standards define the order in which expressions in a C/C++
3751 program are evaluated in terms of @dfn{sequence points}, which represent
3752 a partial ordering between the execution of parts of the program: those
3753 executed before the sequence point, and those executed after it.  These
3754 occur after the evaluation of a full expression (one which is not part
3755 of a larger expression), after the evaluation of the first operand of a
3756 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
3757 function is called (but after the evaluation of its arguments and the
3758 expression denoting the called function), and in certain other places.
3759 Other than as expressed by the sequence point rules, the order of
3760 evaluation of subexpressions of an expression is not specified.  All
3761 these rules describe only a partial order rather than a total order,
3762 since, for example, if two functions are called within one expression
3763 with no sequence point between them, the order in which the functions
3764 are called is not specified.  However, the standards committee have
3765 ruled that function calls do not overlap.
3767 It is not specified when between sequence points modifications to the
3768 values of objects take effect.  Programs whose behavior depends on this
3769 have undefined behavior; the C and C++ standards specify that ``Between
3770 the previous and next sequence point an object shall have its stored
3771 value modified at most once by the evaluation of an expression.
3772 Furthermore, the prior value shall be read only to determine the value
3773 to be stored.''.  If a program breaks these rules, the results on any
3774 particular implementation are entirely unpredictable.
3776 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
3777 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
3778 diagnosed by this option, and it may give an occasional false positive
3779 result, but in general it has been found fairly effective at detecting
3780 this sort of problem in programs.
3782 The standard is worded confusingly, therefore there is some debate
3783 over the precise meaning of the sequence point rules in subtle cases.
3784 Links to discussions of the problem, including proposed formal
3785 definitions, may be found on the GCC readings page, at
3786 @uref{http://gcc.gnu.org/@/readings.html}.
3788 This warning is enabled by @option{-Wall} for C and C++.
3790 @item -Wno-return-local-addr
3791 @opindex Wno-return-local-addr
3792 @opindex Wreturn-local-addr
3793 Do not warn about returning a pointer (or in C++, a reference) to a
3794 variable that goes out of scope after the function returns.
3796 @item -Wreturn-type
3797 @opindex Wreturn-type
3798 @opindex Wno-return-type
3799 Warn whenever a function is defined with a return type that defaults
3800 to @code{int}.  Also warn about any @code{return} statement with no
3801 return value in a function whose return type is not @code{void}
3802 (falling off the end of the function body is considered returning
3803 without a value), and about a @code{return} statement with an
3804 expression in a function whose return type is @code{void}.
3806 For C++, a function without return type always produces a diagnostic
3807 message, even when @option{-Wno-return-type} is specified.  The only
3808 exceptions are @samp{main} and functions defined in system headers.
3810 This warning is enabled by @option{-Wall}.
3812 @item -Wswitch
3813 @opindex Wswitch
3814 @opindex Wno-switch
3815 Warn whenever a @code{switch} statement has an index of enumerated type
3816 and lacks a @code{case} for one or more of the named codes of that
3817 enumeration.  (The presence of a @code{default} label prevents this
3818 warning.)  @code{case} labels outside the enumeration range also
3819 provoke warnings when this option is used (even if there is a
3820 @code{default} label).
3821 This warning is enabled by @option{-Wall}.
3823 @item -Wswitch-default
3824 @opindex Wswitch-default
3825 @opindex Wno-switch-default
3826 Warn whenever a @code{switch} statement does not have a @code{default}
3827 case.
3829 @item -Wswitch-enum
3830 @opindex Wswitch-enum
3831 @opindex Wno-switch-enum
3832 Warn whenever a @code{switch} statement has an index of enumerated type
3833 and lacks a @code{case} for one or more of the named codes of that
3834 enumeration.  @code{case} labels outside the enumeration range also
3835 provoke warnings when this option is used.  The only difference
3836 between @option{-Wswitch} and this option is that this option gives a
3837 warning about an omitted enumeration code even if there is a
3838 @code{default} label.
3840 @item -Wswitch-bool
3841 @opindex Wswitch-bool
3842 @opindex Wno-switch-bool
3843 Warn whenever a @code{switch} statement has an index of boolean type.
3844 It is possible to suppress this warning by casting the controlling
3845 expression to a type other than @code{bool}.  For example:
3846 @smallexample
3847 @group
3848 switch ((int) (a == 4))
3849   @{
3850   @dots{}
3851   @}
3852 @end group
3853 @end smallexample
3854 This warning is enabled by default for C and C++ programs.
3856 @item -Wsync-nand @r{(C and C++ only)}
3857 @opindex Wsync-nand
3858 @opindex Wno-sync-nand
3859 Warn when @code{__sync_fetch_and_nand} and @code{__sync_nand_and_fetch}
3860 built-in functions are used.  These functions changed semantics in GCC 4.4.
3862 @item -Wtrigraphs
3863 @opindex Wtrigraphs
3864 @opindex Wno-trigraphs
3865 Warn if any trigraphs are encountered that might change the meaning of
3866 the program (trigraphs within comments are not warned about).
3867 This warning is enabled by @option{-Wall}.
3869 @item -Wunused-but-set-parameter
3870 @opindex Wunused-but-set-parameter
3871 @opindex Wno-unused-but-set-parameter
3872 Warn whenever a function parameter is assigned to, but otherwise unused
3873 (aside from its declaration).
3875 To suppress this warning use the @samp{unused} attribute
3876 (@pxref{Variable Attributes}).
3878 This warning is also enabled by @option{-Wunused} together with
3879 @option{-Wextra}.
3881 @item -Wunused-but-set-variable
3882 @opindex Wunused-but-set-variable
3883 @opindex Wno-unused-but-set-variable
3884 Warn whenever a local variable is assigned to, but otherwise unused
3885 (aside from its declaration).
3886 This warning is enabled by @option{-Wall}.
3888 To suppress this warning use the @samp{unused} attribute
3889 (@pxref{Variable Attributes}).
3891 This warning is also enabled by @option{-Wunused}, which is enabled
3892 by @option{-Wall}.
3894 @item -Wunused-function
3895 @opindex Wunused-function
3896 @opindex Wno-unused-function
3897 Warn whenever a static function is declared but not defined or a
3898 non-inline static function is unused.
3899 This warning is enabled by @option{-Wall}.
3901 @item -Wunused-label
3902 @opindex Wunused-label
3903 @opindex Wno-unused-label
3904 Warn whenever a label is declared but not used.
3905 This warning is enabled by @option{-Wall}.
3907 To suppress this warning use the @samp{unused} attribute
3908 (@pxref{Variable Attributes}).
3910 @item -Wunused-local-typedefs @r{(C, Objective-C, C++ and Objective-C++ only)}
3911 @opindex Wunused-local-typedefs
3912 Warn when a typedef locally defined in a function is not used.
3913 This warning is enabled by @option{-Wall}.
3915 @item -Wunused-parameter
3916 @opindex Wunused-parameter
3917 @opindex Wno-unused-parameter
3918 Warn whenever a function parameter is unused aside from its declaration.
3920 To suppress this warning use the @samp{unused} attribute
3921 (@pxref{Variable Attributes}).
3923 @item -Wno-unused-result
3924 @opindex Wunused-result
3925 @opindex Wno-unused-result
3926 Do not warn if a caller of a function marked with attribute
3927 @code{warn_unused_result} (@pxref{Function Attributes}) does not use
3928 its return value. The default is @option{-Wunused-result}.
3930 @item -Wunused-variable
3931 @opindex Wunused-variable
3932 @opindex Wno-unused-variable
3933 Warn whenever a local variable or non-constant static variable is unused
3934 aside from its declaration.
3935 This warning is enabled by @option{-Wall}.
3937 To suppress this warning use the @samp{unused} attribute
3938 (@pxref{Variable Attributes}).
3940 @item -Wunused-value
3941 @opindex Wunused-value
3942 @opindex Wno-unused-value
3943 Warn whenever a statement computes a result that is explicitly not
3944 used. To suppress this warning cast the unused expression to
3945 @samp{void}. This includes an expression-statement or the left-hand
3946 side of a comma expression that contains no side effects. For example,
3947 an expression such as @samp{x[i,j]} causes a warning, while
3948 @samp{x[(void)i,j]} does not.
3950 This warning is enabled by @option{-Wall}.
3952 @item -Wunused
3953 @opindex Wunused
3954 @opindex Wno-unused
3955 All the above @option{-Wunused} options combined.
3957 In order to get a warning about an unused function parameter, you must
3958 either specify @option{-Wextra -Wunused} (note that @option{-Wall} implies
3959 @option{-Wunused}), or separately specify @option{-Wunused-parameter}.
3961 @item -Wuninitialized
3962 @opindex Wuninitialized
3963 @opindex Wno-uninitialized
3964 Warn if an automatic variable is used without first being initialized
3965 or if a variable may be clobbered by a @code{setjmp} call. In C++,
3966 warn if a non-static reference or non-static @samp{const} member
3967 appears in a class without constructors.
3969 If you want to warn about code that uses the uninitialized value of the
3970 variable in its own initializer, use the @option{-Winit-self} option.
3972 These warnings occur for individual uninitialized or clobbered
3973 elements of structure, union or array variables as well as for
3974 variables that are uninitialized or clobbered as a whole.  They do
3975 not occur for variables or elements declared @code{volatile}.  Because
3976 these warnings depend on optimization, the exact variables or elements
3977 for which there are warnings depends on the precise optimization
3978 options and version of GCC used.
3980 Note that there may be no warning about a variable that is used only
3981 to compute a value that itself is never used, because such
3982 computations may be deleted by data flow analysis before the warnings
3983 are printed.
3985 @item -Wmaybe-uninitialized
3986 @opindex Wmaybe-uninitialized
3987 @opindex Wno-maybe-uninitialized
3988 For an automatic variable, if there exists a path from the function
3989 entry to a use of the variable that is initialized, but there exist
3990 some other paths for which the variable is not initialized, the compiler
3991 emits a warning if it cannot prove the uninitialized paths are not
3992 executed at run time. These warnings are made optional because GCC is
3993 not smart enough to see all the reasons why the code might be correct
3994 in spite of appearing to have an error.  Here is one example of how
3995 this can happen:
3997 @smallexample
3998 @group
4000   int x;
4001   switch (y)
4002     @{
4003     case 1: x = 1;
4004       break;
4005     case 2: x = 4;
4006       break;
4007     case 3: x = 5;
4008     @}
4009   foo (x);
4011 @end group
4012 @end smallexample
4014 @noindent
4015 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
4016 always initialized, but GCC doesn't know this. To suppress the
4017 warning, you need to provide a default case with assert(0) or
4018 similar code.
4020 @cindex @code{longjmp} warnings
4021 This option also warns when a non-volatile automatic variable might be
4022 changed by a call to @code{longjmp}.  These warnings as well are possible
4023 only in optimizing compilation.
4025 The compiler sees only the calls to @code{setjmp}.  It cannot know
4026 where @code{longjmp} will be called; in fact, a signal handler could
4027 call it at any point in the code.  As a result, you may get a warning
4028 even when there is in fact no problem because @code{longjmp} cannot
4029 in fact be called at the place that would cause a problem.
4031 Some spurious warnings can be avoided if you declare all the functions
4032 you use that never return as @code{noreturn}.  @xref{Function
4033 Attributes}.
4035 This warning is enabled by @option{-Wall} or @option{-Wextra}.
4037 @item -Wunknown-pragmas
4038 @opindex Wunknown-pragmas
4039 @opindex Wno-unknown-pragmas
4040 @cindex warning for unknown pragmas
4041 @cindex unknown pragmas, warning
4042 @cindex pragmas, warning of unknown
4043 Warn when a @code{#pragma} directive is encountered that is not understood by 
4044 GCC@.  If this command-line option is used, warnings are even issued
4045 for unknown pragmas in system header files.  This is not the case if
4046 the warnings are only enabled by the @option{-Wall} command-line option.
4048 @item -Wno-pragmas
4049 @opindex Wno-pragmas
4050 @opindex Wpragmas
4051 Do not warn about misuses of pragmas, such as incorrect parameters,
4052 invalid syntax, or conflicts between pragmas.  See also
4053 @option{-Wunknown-pragmas}.
4055 @item -Wstrict-aliasing
4056 @opindex Wstrict-aliasing
4057 @opindex Wno-strict-aliasing
4058 This option is only active when @option{-fstrict-aliasing} is active.
4059 It warns about code that might break the strict aliasing rules that the
4060 compiler is using for optimization.  The warning does not catch all
4061 cases, but does attempt to catch the more common pitfalls.  It is
4062 included in @option{-Wall}.
4063 It is equivalent to @option{-Wstrict-aliasing=3}
4065 @item -Wstrict-aliasing=n
4066 @opindex Wstrict-aliasing=n
4067 This option is only active when @option{-fstrict-aliasing} is active.
4068 It warns about code that might break the strict aliasing rules that the
4069 compiler is using for optimization.
4070 Higher levels correspond to higher accuracy (fewer false positives).
4071 Higher levels also correspond to more effort, similar to the way @option{-O} 
4072 works.
4073 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=3}.
4075 Level 1: Most aggressive, quick, least accurate.
4076 Possibly useful when higher levels
4077 do not warn but @option{-fstrict-aliasing} still breaks the code, as it has very few
4078 false negatives.  However, it has many false positives.
4079 Warns for all pointer conversions between possibly incompatible types,
4080 even if never dereferenced.  Runs in the front end only.
4082 Level 2: Aggressive, quick, not too precise.
4083 May still have many false positives (not as many as level 1 though),
4084 and few false negatives (but possibly more than level 1).
4085 Unlike level 1, it only warns when an address is taken.  Warns about
4086 incomplete types.  Runs in the front end only.
4088 Level 3 (default for @option{-Wstrict-aliasing}):
4089 Should have very few false positives and few false
4090 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
4091 Takes care of the common pun+dereference pattern in the front end:
4092 @code{*(int*)&some_float}.
4093 If optimization is enabled, it also runs in the back end, where it deals
4094 with multiple statement cases using flow-sensitive points-to information.
4095 Only warns when the converted pointer is dereferenced.
4096 Does not warn about incomplete types.
4098 @item -Wstrict-overflow
4099 @itemx -Wstrict-overflow=@var{n}
4100 @opindex Wstrict-overflow
4101 @opindex Wno-strict-overflow
4102 This option is only active when @option{-fstrict-overflow} is active.
4103 It warns about cases where the compiler optimizes based on the
4104 assumption that signed overflow does not occur.  Note that it does not
4105 warn about all cases where the code might overflow: it only warns
4106 about cases where the compiler implements some optimization.  Thus
4107 this warning depends on the optimization level.
4109 An optimization that assumes that signed overflow does not occur is
4110 perfectly safe if the values of the variables involved are such that
4111 overflow never does, in fact, occur.  Therefore this warning can
4112 easily give a false positive: a warning about code that is not
4113 actually a problem.  To help focus on important issues, several
4114 warning levels are defined.  No warnings are issued for the use of
4115 undefined signed overflow when estimating how many iterations a loop
4116 requires, in particular when determining whether a loop will be
4117 executed at all.
4119 @table @gcctabopt
4120 @item -Wstrict-overflow=1
4121 Warn about cases that are both questionable and easy to avoid.  For
4122 example,  with @option{-fstrict-overflow}, the compiler simplifies
4123 @code{x + 1 > x} to @code{1}.  This level of
4124 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
4125 are not, and must be explicitly requested.
4127 @item -Wstrict-overflow=2
4128 Also warn about other cases where a comparison is simplified to a
4129 constant.  For example: @code{abs (x) >= 0}.  This can only be
4130 simplified when @option{-fstrict-overflow} is in effect, because
4131 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
4132 zero.  @option{-Wstrict-overflow} (with no level) is the same as
4133 @option{-Wstrict-overflow=2}.
4135 @item -Wstrict-overflow=3
4136 Also warn about other cases where a comparison is simplified.  For
4137 example: @code{x + 1 > 1} is simplified to @code{x > 0}.
4139 @item -Wstrict-overflow=4
4140 Also warn about other simplifications not covered by the above cases.
4141 For example: @code{(x * 10) / 5} is simplified to @code{x * 2}.
4143 @item -Wstrict-overflow=5
4144 Also warn about cases where the compiler reduces the magnitude of a
4145 constant involved in a comparison.  For example: @code{x + 2 > y} is
4146 simplified to @code{x + 1 >= y}.  This is reported only at the
4147 highest warning level because this simplification applies to many
4148 comparisons, so this warning level gives a very large number of
4149 false positives.
4150 @end table
4152 @item -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{]}
4153 @opindex Wsuggest-attribute=
4154 @opindex Wno-suggest-attribute=
4155 Warn for cases where adding an attribute may be beneficial. The
4156 attributes currently supported are listed below.
4158 @table @gcctabopt
4159 @item -Wsuggest-attribute=pure
4160 @itemx -Wsuggest-attribute=const
4161 @itemx -Wsuggest-attribute=noreturn
4162 @opindex Wsuggest-attribute=pure
4163 @opindex Wno-suggest-attribute=pure
4164 @opindex Wsuggest-attribute=const
4165 @opindex Wno-suggest-attribute=const
4166 @opindex Wsuggest-attribute=noreturn
4167 @opindex Wno-suggest-attribute=noreturn
4169 Warn about functions that might be candidates for attributes
4170 @code{pure}, @code{const} or @code{noreturn}.  The compiler only warns for
4171 functions visible in other compilation units or (in the case of @code{pure} and
4172 @code{const}) if it cannot prove that the function returns normally. A function
4173 returns normally if it doesn't contain an infinite loop or return abnormally
4174 by throwing, calling @code{abort()} or trapping.  This analysis requires option
4175 @option{-fipa-pure-const}, which is enabled by default at @option{-O} and
4176 higher.  Higher optimization levels improve the accuracy of the analysis.
4178 @item -Wsuggest-attribute=format
4179 @itemx -Wmissing-format-attribute
4180 @opindex Wsuggest-attribute=format
4181 @opindex Wmissing-format-attribute
4182 @opindex Wno-suggest-attribute=format
4183 @opindex Wno-missing-format-attribute
4184 @opindex Wformat
4185 @opindex Wno-format
4187 Warn about function pointers that might be candidates for @code{format}
4188 attributes.  Note these are only possible candidates, not absolute ones.
4189 GCC guesses that function pointers with @code{format} attributes that
4190 are used in assignment, initialization, parameter passing or return
4191 statements should have a corresponding @code{format} attribute in the
4192 resulting type.  I.e.@: the left-hand side of the assignment or
4193 initialization, the type of the parameter variable, or the return type
4194 of the containing function respectively should also have a @code{format}
4195 attribute to avoid the warning.
4197 GCC also warns about function definitions that might be
4198 candidates for @code{format} attributes.  Again, these are only
4199 possible candidates.  GCC guesses that @code{format} attributes
4200 might be appropriate for any function that calls a function like
4201 @code{vprintf} or @code{vscanf}, but this might not always be the
4202 case, and some functions for which @code{format} attributes are
4203 appropriate may not be detected.
4204 @end table
4206 @item -Warray-bounds
4207 @opindex Wno-array-bounds
4208 @opindex Warray-bounds
4209 This option is only active when @option{-ftree-vrp} is active
4210 (default for @option{-O2} and above). It warns about subscripts to arrays
4211 that are always out of bounds. This warning is enabled by @option{-Wall}.
4213 @item -Wno-discarded-qualifiers @r{(C and Objective-C only)}
4214 @opindex Wno-discarded-qualifiers
4215 @opindex Wdiscarded-qualifiers
4216 Do not warn if type qualifiers on pointers are being discarded.
4217 Typically, the compiler will warn if a @code{const char *} variable is
4218 passed to a function that takes @code{char *} parameter.  This option
4219 can be used to suppress such a warning.
4221 @item -Wno-incompatible-pointer-types @r{(C and Objective-C only)}
4222 @opindex Wno-incompatible-pointer-types
4223 @opindex Wincompatible-pointer-types
4224 Do not warn when there is a conversion between pointers that have incompatible
4225 types.  This warning is for cases not covered by @option{-Wno-pointer-sign},
4226 which warns for pointer argument passing or assignment with different signedness
4228 @item -Wno-int-conversion @r{(C and Objective-C only)}
4229 @opindex Wno-int-conversion
4230 @opindex Wint-conversion
4231 Do not warn about incompatible integer to pointer and pointer to integer
4232 conversions.  This warning is about implicit conversions; for explicit
4233 conversions the warnings @option{-Wno-int-to-pointer-cast} and
4234 @option{-Wno-pointer-to-int-cast} may be used.
4236 @item -Wno-div-by-zero
4237 @opindex Wno-div-by-zero
4238 @opindex Wdiv-by-zero
4239 Do not warn about compile-time integer division by zero.  Floating-point
4240 division by zero is not warned about, as it can be a legitimate way of
4241 obtaining infinities and NaNs.
4243 @item -Wsystem-headers
4244 @opindex Wsystem-headers
4245 @opindex Wno-system-headers
4246 @cindex warnings from system headers
4247 @cindex system headers, warnings from
4248 Print warning messages for constructs found in system header files.
4249 Warnings from system headers are normally suppressed, on the assumption
4250 that they usually do not indicate real problems and would only make the
4251 compiler output harder to read.  Using this command-line option tells
4252 GCC to emit warnings from system headers as if they occurred in user
4253 code.  However, note that using @option{-Wall} in conjunction with this
4254 option does @emph{not} warn about unknown pragmas in system
4255 headers---for that, @option{-Wunknown-pragmas} must also be used.
4257 @item -Wtrampolines
4258 @opindex Wtrampolines
4259 @opindex Wno-trampolines
4260  Warn about trampolines generated for pointers to nested functions.
4262  A trampoline is a small piece of data or code that is created at run
4263  time on the stack when the address of a nested function is taken, and
4264  is used to call the nested function indirectly.  For some targets, it
4265  is made up of data only and thus requires no special treatment.  But,
4266  for most targets, it is made up of code and thus requires the stack
4267  to be made executable in order for the program to work properly.
4269 @item -Wfloat-equal
4270 @opindex Wfloat-equal
4271 @opindex Wno-float-equal
4272 Warn if floating-point values are used in equality comparisons.
4274 The idea behind this is that sometimes it is convenient (for the
4275 programmer) to consider floating-point values as approximations to
4276 infinitely precise real numbers.  If you are doing this, then you need
4277 to compute (by analyzing the code, or in some other way) the maximum or
4278 likely maximum error that the computation introduces, and allow for it
4279 when performing comparisons (and when producing output, but that's a
4280 different problem).  In particular, instead of testing for equality, you
4281 should check to see whether the two values have ranges that overlap; and
4282 this is done with the relational operators, so equality comparisons are
4283 probably mistaken.
4285 @item -Wtraditional @r{(C and Objective-C only)}
4286 @opindex Wtraditional
4287 @opindex Wno-traditional
4288 Warn about certain constructs that behave differently in traditional and
4289 ISO C@.  Also warn about ISO C constructs that have no traditional C
4290 equivalent, and/or problematic constructs that should be avoided.
4292 @itemize @bullet
4293 @item
4294 Macro parameters that appear within string literals in the macro body.
4295 In traditional C macro replacement takes place within string literals,
4296 but in ISO C it does not.
4298 @item
4299 In traditional C, some preprocessor directives did not exist.
4300 Traditional preprocessors only considered a line to be a directive
4301 if the @samp{#} appeared in column 1 on the line.  Therefore
4302 @option{-Wtraditional} warns about directives that traditional C
4303 understands but ignores because the @samp{#} does not appear as the
4304 first character on the line.  It also suggests you hide directives like
4305 @samp{#pragma} not understood by traditional C by indenting them.  Some
4306 traditional implementations do not recognize @samp{#elif}, so this option
4307 suggests avoiding it altogether.
4309 @item
4310 A function-like macro that appears without arguments.
4312 @item
4313 The unary plus operator.
4315 @item
4316 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating-point
4317 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
4318 constants.)  Note, these suffixes appear in macros defined in the system
4319 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
4320 Use of these macros in user code might normally lead to spurious
4321 warnings, however GCC's integrated preprocessor has enough context to
4322 avoid warning in these cases.
4324 @item
4325 A function declared external in one block and then used after the end of
4326 the block.
4328 @item
4329 A @code{switch} statement has an operand of type @code{long}.
4331 @item
4332 A non-@code{static} function declaration follows a @code{static} one.
4333 This construct is not accepted by some traditional C compilers.
4335 @item
4336 The ISO type of an integer constant has a different width or
4337 signedness from its traditional type.  This warning is only issued if
4338 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
4339 typically represent bit patterns, are not warned about.
4341 @item
4342 Usage of ISO string concatenation is detected.
4344 @item
4345 Initialization of automatic aggregates.
4347 @item
4348 Identifier conflicts with labels.  Traditional C lacks a separate
4349 namespace for labels.
4351 @item
4352 Initialization of unions.  If the initializer is zero, the warning is
4353 omitted.  This is done under the assumption that the zero initializer in
4354 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
4355 initializer warnings and relies on default initialization to zero in the
4356 traditional C case.
4358 @item
4359 Conversions by prototypes between fixed/floating-point values and vice
4360 versa.  The absence of these prototypes when compiling with traditional
4361 C causes serious problems.  This is a subset of the possible
4362 conversion warnings; for the full set use @option{-Wtraditional-conversion}.
4364 @item
4365 Use of ISO C style function definitions.  This warning intentionally is
4366 @emph{not} issued for prototype declarations or variadic functions
4367 because these ISO C features appear in your code when using
4368 libiberty's traditional C compatibility macros, @code{PARAMS} and
4369 @code{VPARAMS}.  This warning is also bypassed for nested functions
4370 because that feature is already a GCC extension and thus not relevant to
4371 traditional C compatibility.
4372 @end itemize
4374 @item -Wtraditional-conversion @r{(C and Objective-C only)}
4375 @opindex Wtraditional-conversion
4376 @opindex Wno-traditional-conversion
4377 Warn if a prototype causes a type conversion that is different from what
4378 would happen to the same argument in the absence of a prototype.  This
4379 includes conversions of fixed point to floating and vice versa, and
4380 conversions changing the width or signedness of a fixed-point argument
4381 except when the same as the default promotion.
4383 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
4384 @opindex Wdeclaration-after-statement
4385 @opindex Wno-declaration-after-statement
4386 Warn when a declaration is found after a statement in a block.  This
4387 construct, known from C++, was introduced with ISO C99 and is by default
4388 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
4389 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
4391 @item -Wundef
4392 @opindex Wundef
4393 @opindex Wno-undef
4394 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
4396 @item -Wno-endif-labels
4397 @opindex Wno-endif-labels
4398 @opindex Wendif-labels
4399 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
4401 @item -Wshadow
4402 @opindex Wshadow
4403 @opindex Wno-shadow
4404 Warn whenever a local variable or type declaration shadows another
4405 variable, parameter, type, class member (in C++), or instance variable
4406 (in Objective-C) or whenever a built-in function is shadowed. Note
4407 that in C++, the compiler warns if a local variable shadows an
4408 explicit typedef, but not if it shadows a struct/class/enum.
4410 @item -Wno-shadow-ivar @r{(Objective-C only)}
4411 @opindex Wno-shadow-ivar
4412 @opindex Wshadow-ivar
4413 Do not warn whenever a local variable shadows an instance variable in an
4414 Objective-C method.
4416 @item -Wlarger-than=@var{len}
4417 @opindex Wlarger-than=@var{len}
4418 @opindex Wlarger-than-@var{len}
4419 Warn whenever an object of larger than @var{len} bytes is defined.
4421 @item -Wframe-larger-than=@var{len}
4422 @opindex Wframe-larger-than
4423 Warn if the size of a function frame is larger than @var{len} bytes.
4424 The computation done to determine the stack frame size is approximate
4425 and not conservative.
4426 The actual requirements may be somewhat greater than @var{len}
4427 even if you do not get a warning.  In addition, any space allocated
4428 via @code{alloca}, variable-length arrays, or related constructs
4429 is not included by the compiler when determining
4430 whether or not to issue a warning.
4432 @item -Wno-free-nonheap-object
4433 @opindex Wno-free-nonheap-object
4434 @opindex Wfree-nonheap-object
4435 Do not warn when attempting to free an object that was not allocated
4436 on the heap.
4438 @item -Wstack-usage=@var{len}
4439 @opindex Wstack-usage
4440 Warn if the stack usage of a function might be larger than @var{len} bytes.
4441 The computation done to determine the stack usage is conservative.
4442 Any space allocated via @code{alloca}, variable-length arrays, or related
4443 constructs is included by the compiler when determining whether or not to
4444 issue a warning.
4446 The message is in keeping with the output of @option{-fstack-usage}.
4448 @itemize
4449 @item
4450 If the stack usage is fully static but exceeds the specified amount, it's:
4452 @smallexample
4453   warning: stack usage is 1120 bytes
4454 @end smallexample
4455 @item
4456 If the stack usage is (partly) dynamic but bounded, it's:
4458 @smallexample
4459   warning: stack usage might be 1648 bytes
4460 @end smallexample
4461 @item
4462 If the stack usage is (partly) dynamic and not bounded, it's:
4464 @smallexample
4465   warning: stack usage might be unbounded
4466 @end smallexample
4467 @end itemize
4469 @item -Wunsafe-loop-optimizations
4470 @opindex Wunsafe-loop-optimizations
4471 @opindex Wno-unsafe-loop-optimizations
4472 Warn if the loop cannot be optimized because the compiler cannot
4473 assume anything on the bounds of the loop indices.  With
4474 @option{-funsafe-loop-optimizations} warn if the compiler makes
4475 such assumptions.
4477 @item -Wno-pedantic-ms-format @r{(MinGW targets only)}
4478 @opindex Wno-pedantic-ms-format
4479 @opindex Wpedantic-ms-format
4480 When used in combination with @option{-Wformat}
4481 and @option{-pedantic} without GNU extensions, this option
4482 disables the warnings about non-ISO @code{printf} / @code{scanf} format
4483 width specifiers @code{I32}, @code{I64}, and @code{I} used on Windows targets,
4484 which depend on the MS runtime.
4486 @item -Wpointer-arith
4487 @opindex Wpointer-arith
4488 @opindex Wno-pointer-arith
4489 Warn about anything that depends on the ``size of'' a function type or
4490 of @code{void}.  GNU C assigns these types a size of 1, for
4491 convenience in calculations with @code{void *} pointers and pointers
4492 to functions.  In C++, warn also when an arithmetic operation involves
4493 @code{NULL}.  This warning is also enabled by @option{-Wpedantic}.
4495 @item -Wtype-limits
4496 @opindex Wtype-limits
4497 @opindex Wno-type-limits
4498 Warn if a comparison is always true or always false due to the limited
4499 range of the data type, but do not warn for constant expressions.  For
4500 example, warn if an unsigned variable is compared against zero with
4501 @samp{<} or @samp{>=}.  This warning is also enabled by
4502 @option{-Wextra}.
4504 @item -Wbad-function-cast @r{(C and Objective-C only)}
4505 @opindex Wbad-function-cast
4506 @opindex Wno-bad-function-cast
4507 Warn whenever a function call is cast to a non-matching type.
4508 For example, warn if @code{int malloc()} is cast to @code{anything *}.
4510 @item -Wc++-compat @r{(C and Objective-C only)}
4511 Warn about ISO C constructs that are outside of the common subset of
4512 ISO C and ISO C++, e.g.@: request for implicit conversion from
4513 @code{void *} to a pointer to non-@code{void} type.
4515 @item -Wc++11-compat @r{(C++ and Objective-C++ only)}
4516 Warn about C++ constructs whose meaning differs between ISO C++ 1998
4517 and ISO C++ 2011, e.g., identifiers in ISO C++ 1998 that are keywords
4518 in ISO C++ 2011.  This warning turns on @option{-Wnarrowing} and is
4519 enabled by @option{-Wall}.
4521 @item -Wcast-qual
4522 @opindex Wcast-qual
4523 @opindex Wno-cast-qual
4524 Warn whenever a pointer is cast so as to remove a type qualifier from
4525 the target type.  For example, warn if a @code{const char *} is cast
4526 to an ordinary @code{char *}.
4528 Also warn when making a cast that introduces a type qualifier in an
4529 unsafe way.  For example, casting @code{char **} to @code{const char **}
4530 is unsafe, as in this example:
4532 @smallexample
4533   /* p is char ** value.  */
4534   const char **q = (const char **) p;
4535   /* Assignment of readonly string to const char * is OK.  */
4536   *q = "string";
4537   /* Now char** pointer points to read-only memory.  */
4538   **p = 'b';
4539 @end smallexample
4541 @item -Wcast-align
4542 @opindex Wcast-align
4543 @opindex Wno-cast-align
4544 Warn whenever a pointer is cast such that the required alignment of the
4545 target is increased.  For example, warn if a @code{char *} is cast to
4546 an @code{int *} on machines where integers can only be accessed at
4547 two- or four-byte boundaries.
4549 @item -Wwrite-strings
4550 @opindex Wwrite-strings
4551 @opindex Wno-write-strings
4552 When compiling C, give string constants the type @code{const
4553 char[@var{length}]} so that copying the address of one into a
4554 non-@code{const} @code{char *} pointer produces a warning.  These
4555 warnings help you find at compile time code that can try to write
4556 into a string constant, but only if you have been very careful about
4557 using @code{const} in declarations and prototypes.  Otherwise, it is
4558 just a nuisance. This is why we did not make @option{-Wall} request
4559 these warnings.
4561 When compiling C++, warn about the deprecated conversion from string
4562 literals to @code{char *}.  This warning is enabled by default for C++
4563 programs.
4565 @item -Wclobbered
4566 @opindex Wclobbered
4567 @opindex Wno-clobbered
4568 Warn for variables that might be changed by @samp{longjmp} or
4569 @samp{vfork}.  This warning is also enabled by @option{-Wextra}.
4571 @item -Wconditionally-supported @r{(C++ and Objective-C++ only)}
4572 @opindex Wconditionally-supported
4573 @opindex Wno-conditionally-supported
4574 Warn for conditionally-supported (C++11 [intro.defs]) constructs.
4576 @item -Wconversion
4577 @opindex Wconversion
4578 @opindex Wno-conversion
4579 Warn for implicit conversions that may alter a value. This includes
4580 conversions between real and integer, like @code{abs (x)} when
4581 @code{x} is @code{double}; conversions between signed and unsigned,
4582 like @code{unsigned ui = -1}; and conversions to smaller types, like
4583 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
4584 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
4585 changed by the conversion like in @code{abs (2.0)}.  Warnings about
4586 conversions between signed and unsigned integers can be disabled by
4587 using @option{-Wno-sign-conversion}.
4589 For C++, also warn for confusing overload resolution for user-defined
4590 conversions; and conversions that never use a type conversion
4591 operator: conversions to @code{void}, the same type, a base class or a
4592 reference to them. Warnings about conversions between signed and
4593 unsigned integers are disabled by default in C++ unless
4594 @option{-Wsign-conversion} is explicitly enabled.
4596 @item -Wno-conversion-null @r{(C++ and Objective-C++ only)}
4597 @opindex Wconversion-null
4598 @opindex Wno-conversion-null
4599 Do not warn for conversions between @code{NULL} and non-pointer
4600 types. @option{-Wconversion-null} is enabled by default.
4602 @item -Wzero-as-null-pointer-constant @r{(C++ and Objective-C++ only)}
4603 @opindex Wzero-as-null-pointer-constant
4604 @opindex Wno-zero-as-null-pointer-constant
4605 Warn when a literal '0' is used as null pointer constant.  This can
4606 be useful to facilitate the conversion to @code{nullptr} in C++11.
4608 @item -Wdate-time
4609 @opindex Wdate-time
4610 @opindex Wno-date-time
4611 Warn when macros @code{__TIME__}, @code{__DATE__} or @code{__TIMESTAMP__}
4612 are encountered as they might prevent bit-wise-identical reproducible
4613 compilations.
4615 @item -Wdelete-incomplete @r{(C++ and Objective-C++ only)}
4616 @opindex Wdelete-incomplete
4617 @opindex Wno-delete-incomplete
4618 Warn when deleting a pointer to incomplete type, which may cause
4619 undefined behavior at runtime.  This warning is enabled by default.
4621 @item -Wuseless-cast @r{(C++ and Objective-C++ only)}
4622 @opindex Wuseless-cast
4623 @opindex Wno-useless-cast
4624 Warn when an expression is casted to its own type.
4626 @item -Wempty-body
4627 @opindex Wempty-body
4628 @opindex Wno-empty-body
4629 Warn if an empty body occurs in an @samp{if}, @samp{else} or @samp{do
4630 while} statement.  This warning is also enabled by @option{-Wextra}.
4632 @item -Wenum-compare
4633 @opindex Wenum-compare
4634 @opindex Wno-enum-compare
4635 Warn about a comparison between values of different enumerated types.
4636 In C++ enumeral mismatches in conditional expressions are also
4637 diagnosed and the warning is enabled by default.  In C this warning is 
4638 enabled by @option{-Wall}.
4640 @item -Wjump-misses-init @r{(C, Objective-C only)}
4641 @opindex Wjump-misses-init
4642 @opindex Wno-jump-misses-init
4643 Warn if a @code{goto} statement or a @code{switch} statement jumps
4644 forward across the initialization of a variable, or jumps backward to a
4645 label after the variable has been initialized.  This only warns about
4646 variables that are initialized when they are declared.  This warning is
4647 only supported for C and Objective-C; in C++ this sort of branch is an
4648 error in any case.
4650 @option{-Wjump-misses-init} is included in @option{-Wc++-compat}.  It
4651 can be disabled with the @option{-Wno-jump-misses-init} option.
4653 @item -Wsign-compare
4654 @opindex Wsign-compare
4655 @opindex Wno-sign-compare
4656 @cindex warning for comparison of signed and unsigned values
4657 @cindex comparison of signed and unsigned values, warning
4658 @cindex signed and unsigned values, comparison warning
4659 Warn when a comparison between signed and unsigned values could produce
4660 an incorrect result when the signed value is converted to unsigned.
4661 This warning is also enabled by @option{-Wextra}; to get the other warnings
4662 of @option{-Wextra} without this warning, use @option{-Wextra -Wno-sign-compare}.
4664 @item -Wsign-conversion
4665 @opindex Wsign-conversion
4666 @opindex Wno-sign-conversion
4667 Warn for implicit conversions that may change the sign of an integer
4668 value, like assigning a signed integer expression to an unsigned
4669 integer variable. An explicit cast silences the warning. In C, this
4670 option is enabled also by @option{-Wconversion}.
4672 @item -Wfloat-conversion
4673 @opindex Wfloat-conversion
4674 @opindex Wno-float-conversion
4675 Warn for implicit conversions that reduce the precision of a real value.
4676 This includes conversions from real to integer, and from higher precision
4677 real to lower precision real values.  This option is also enabled by
4678 @option{-Wconversion}.
4680 @item -Wsizeof-pointer-memaccess
4681 @opindex Wsizeof-pointer-memaccess
4682 @opindex Wno-sizeof-pointer-memaccess
4683 Warn for suspicious length parameters to certain string and memory built-in
4684 functions if the argument uses @code{sizeof}.  This warning warns e.g.@:
4685 about @code{memset (ptr, 0, sizeof (ptr));} if @code{ptr} is not an array,
4686 but a pointer, and suggests a possible fix, or about
4687 @code{memcpy (&foo, ptr, sizeof (&foo));}.  This warning is enabled by
4688 @option{-Wall}.
4690 @item -Wsizeof-array-argument
4691 @opindex Wsizeof-array-argument
4692 @opindex Wno-sizeof-array-argument
4693 Warn when the @code{sizeof} operator is applied to a parameter that is
4694 declared as an array in a function definition.  This warning is enabled by
4695 default for C and C++ programs.
4697 @item -Wmemset-transposed-args
4698 @opindex Wmemset-transposed-args
4699 @opindex Wno-memset-transposed-args
4700 Warn for suspicious calls to the @code{memset} built-in function, if the
4701 second argument is not zero and the third argument is zero.  This warns e.g.@
4702 about @code{memset (buf, sizeof buf, 0)} where most probably
4703 @code{memset (buf, 0, sizeof buf)} was meant instead.  The diagnostics
4704 is only emitted if the third argument is literal zero, if it is some expression
4705 that is folded to zero, or e.g. a cast of zero to some type etc., it
4706 is far less likely that user has mistakenly exchanged the arguments and
4707 no warning is emitted.  This warning is enabled by @option{-Wall}.
4709 @item -Waddress
4710 @opindex Waddress
4711 @opindex Wno-address
4712 Warn about suspicious uses of memory addresses. These include using
4713 the address of a function in a conditional expression, such as
4714 @code{void func(void); if (func)}, and comparisons against the memory
4715 address of a string literal, such as @code{if (x == "abc")}.  Such
4716 uses typically indicate a programmer error: the address of a function
4717 always evaluates to true, so their use in a conditional usually
4718 indicate that the programmer forgot the parentheses in a function
4719 call; and comparisons against string literals result in unspecified
4720 behavior and are not portable in C, so they usually indicate that the
4721 programmer intended to use @code{strcmp}.  This warning is enabled by
4722 @option{-Wall}.
4724 @item -Wlogical-op
4725 @opindex Wlogical-op
4726 @opindex Wno-logical-op
4727 Warn about suspicious uses of logical operators in expressions.
4728 This includes using logical operators in contexts where a
4729 bit-wise operator is likely to be expected.
4731 @item -Wlogical-not-parentheses
4732 @opindex Wlogical-not-parentheses
4733 @opindex Wno-logical-not-parentheses
4734 Warn about logical not used on the left hand side operand of a comparison.
4735 This option does not warn if the LHS or RHS operand is of a boolean or
4736 a vector type.  Its purpose is to detect suspicious code like the following:
4737 @smallexample
4738 int a;
4739 @dots{}
4740 if (!a > 1) @{ @dots{} @}
4741 @end smallexample
4743 It is possible to suppress the warning by wrapping the LHS into
4744 parentheses:
4745 @smallexample
4746 if ((!a) > 1) @{ @dots{} @}
4747 @end smallexample
4749 @item -Waggregate-return
4750 @opindex Waggregate-return
4751 @opindex Wno-aggregate-return
4752 Warn if any functions that return structures or unions are defined or
4753 called.  (In languages where you can return an array, this also elicits
4754 a warning.)
4756 @item -Wno-aggressive-loop-optimizations
4757 @opindex Wno-aggressive-loop-optimizations
4758 @opindex Waggressive-loop-optimizations
4759 Warn if in a loop with constant number of iterations the compiler detects
4760 undefined behavior in some statement during one or more of the iterations.
4762 @item -Wno-attributes
4763 @opindex Wno-attributes
4764 @opindex Wattributes
4765 Do not warn if an unexpected @code{__attribute__} is used, such as
4766 unrecognized attributes, function attributes applied to variables,
4767 etc.  This does not stop errors for incorrect use of supported
4768 attributes.
4770 @item -Wno-builtin-macro-redefined
4771 @opindex Wno-builtin-macro-redefined
4772 @opindex Wbuiltin-macro-redefined
4773 Do not warn if certain built-in macros are redefined.  This suppresses
4774 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
4775 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
4777 @item -Wstrict-prototypes @r{(C and Objective-C only)}
4778 @opindex Wstrict-prototypes
4779 @opindex Wno-strict-prototypes
4780 Warn if a function is declared or defined without specifying the
4781 argument types.  (An old-style function definition is permitted without
4782 a warning if preceded by a declaration that specifies the argument
4783 types.)
4785 @item -Wold-style-declaration @r{(C and Objective-C only)}
4786 @opindex Wold-style-declaration
4787 @opindex Wno-old-style-declaration
4788 Warn for obsolescent usages, according to the C Standard, in a
4789 declaration. For example, warn if storage-class specifiers like
4790 @code{static} are not the first things in a declaration.  This warning
4791 is also enabled by @option{-Wextra}.
4793 @item -Wold-style-definition @r{(C and Objective-C only)}
4794 @opindex Wold-style-definition
4795 @opindex Wno-old-style-definition
4796 Warn if an old-style function definition is used.  A warning is given
4797 even if there is a previous prototype.
4799 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
4800 @opindex Wmissing-parameter-type
4801 @opindex Wno-missing-parameter-type
4802 A function parameter is declared without a type specifier in K&R-style
4803 functions:
4805 @smallexample
4806 void foo(bar) @{ @}
4807 @end smallexample
4809 This warning is also enabled by @option{-Wextra}.
4811 @item -Wmissing-prototypes @r{(C and Objective-C only)}
4812 @opindex Wmissing-prototypes
4813 @opindex Wno-missing-prototypes
4814 Warn if a global function is defined without a previous prototype
4815 declaration.  This warning is issued even if the definition itself
4816 provides a prototype.  Use this option to detect global functions
4817 that do not have a matching prototype declaration in a header file.
4818 This option is not valid for C++ because all function declarations
4819 provide prototypes and a non-matching declaration will declare an
4820 overload rather than conflict with an earlier declaration.
4821 Use @option{-Wmissing-declarations} to detect missing declarations in C++.
4823 @item -Wmissing-declarations
4824 @opindex Wmissing-declarations
4825 @opindex Wno-missing-declarations
4826 Warn if a global function is defined without a previous declaration.
4827 Do so even if the definition itself provides a prototype.
4828 Use this option to detect global functions that are not declared in
4829 header files.  In C, no warnings are issued for functions with previous
4830 non-prototype declarations; use @option{-Wmissing-prototypes} to detect
4831 missing prototypes.  In C++, no warnings are issued for function templates,
4832 or for inline functions, or for functions in anonymous namespaces.
4834 @item -Wmissing-field-initializers
4835 @opindex Wmissing-field-initializers
4836 @opindex Wno-missing-field-initializers
4837 @opindex W
4838 @opindex Wextra
4839 @opindex Wno-extra
4840 Warn if a structure's initializer has some fields missing.  For
4841 example, the following code causes such a warning, because
4842 @code{x.h} is implicitly zero:
4844 @smallexample
4845 struct s @{ int f, g, h; @};
4846 struct s x = @{ 3, 4 @};
4847 @end smallexample
4849 This option does not warn about designated initializers, so the following
4850 modification does not trigger a warning:
4852 @smallexample
4853 struct s @{ int f, g, h; @};
4854 struct s x = @{ .f = 3, .g = 4 @};
4855 @end smallexample
4857 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
4858 warnings without this one, use @option{-Wextra -Wno-missing-field-initializers}.
4860 @item -Wno-multichar
4861 @opindex Wno-multichar
4862 @opindex Wmultichar
4863 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
4864 Usually they indicate a typo in the user's code, as they have
4865 implementation-defined values, and should not be used in portable code.
4867 @item -Wnormalized=<none|id|nfc|nfkc>
4868 @opindex Wnormalized=
4869 @cindex NFC
4870 @cindex NFKC
4871 @cindex character set, input normalization
4872 In ISO C and ISO C++, two identifiers are different if they are
4873 different sequences of characters.  However, sometimes when characters
4874 outside the basic ASCII character set are used, you can have two
4875 different character sequences that look the same.  To avoid confusion,
4876 the ISO 10646 standard sets out some @dfn{normalization rules} which
4877 when applied ensure that two sequences that look the same are turned into
4878 the same sequence.  GCC can warn you if you are using identifiers that
4879 have not been normalized; this option controls that warning.
4881 There are four levels of warning supported by GCC@.  The default is
4882 @option{-Wnormalized=nfc}, which warns about any identifier that is
4883 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
4884 recommended form for most uses.
4886 Unfortunately, there are some characters allowed in identifiers by
4887 ISO C and ISO C++ that, when turned into NFC, are not allowed in 
4888 identifiers.  That is, there's no way to use these symbols in portable
4889 ISO C or C++ and have all your identifiers in NFC@.
4890 @option{-Wnormalized=id} suppresses the warning for these characters.
4891 It is hoped that future versions of the standards involved will correct
4892 this, which is why this option is not the default.
4894 You can switch the warning off for all characters by writing
4895 @option{-Wnormalized=none}.  You should only do this if you
4896 are using some other normalization scheme (like ``D''), because
4897 otherwise you can easily create bugs that are literally impossible to see.
4899 Some characters in ISO 10646 have distinct meanings but look identical
4900 in some fonts or display methodologies, especially once formatting has
4901 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
4902 LETTER N'', displays just like a regular @code{n} that has been
4903 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
4904 normalization scheme to convert all these into a standard form as
4905 well, and GCC warns if your code is not in NFKC if you use
4906 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
4907 about every identifier that contains the letter O because it might be
4908 confused with the digit 0, and so is not the default, but may be
4909 useful as a local coding convention if the programming environment 
4910 cannot be fixed to display these characters distinctly.
4912 @item -Wno-deprecated
4913 @opindex Wno-deprecated
4914 @opindex Wdeprecated
4915 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
4917 @item -Wno-deprecated-declarations
4918 @opindex Wno-deprecated-declarations
4919 @opindex Wdeprecated-declarations
4920 Do not warn about uses of functions (@pxref{Function Attributes}),
4921 variables (@pxref{Variable Attributes}), and types (@pxref{Type
4922 Attributes}) marked as deprecated by using the @code{deprecated}
4923 attribute.
4925 @item -Wno-overflow
4926 @opindex Wno-overflow
4927 @opindex Woverflow
4928 Do not warn about compile-time overflow in constant expressions.
4930 @opindex Wodr
4931 @opindex Wno-odr
4932 @opindex Wodr
4933 Warn about One Definition Rule violations during link time optimization.
4934 Require @option{-flto-odr-type-merging} to be enabled. Enabled by default
4936 @item -Wopenmp-simd
4937 @opindex Wopenm-simd
4938 Warn if the vectorizer cost model overrides the OpenMP or the Cilk Plus
4939 simd directive set by user.  The @option{-fsimd-cost-model=unlimited} can
4940 be used to relax the cost model.
4942 @item -Woverride-init @r{(C and Objective-C only)}
4943 @opindex Woverride-init
4944 @opindex Wno-override-init
4945 @opindex W
4946 @opindex Wextra
4947 @opindex Wno-extra
4948 Warn if an initialized field without side effects is overridden when
4949 using designated initializers (@pxref{Designated Inits, , Designated
4950 Initializers}).
4952 This warning is included in @option{-Wextra}.  To get other
4953 @option{-Wextra} warnings without this one, use @option{-Wextra
4954 -Wno-override-init}.
4956 @item -Wpacked
4957 @opindex Wpacked
4958 @opindex Wno-packed
4959 Warn if a structure is given the packed attribute, but the packed
4960 attribute has no effect on the layout or size of the structure.
4961 Such structures may be mis-aligned for little benefit.  For
4962 instance, in this code, the variable @code{f.x} in @code{struct bar}
4963 is misaligned even though @code{struct bar} does not itself
4964 have the packed attribute:
4966 @smallexample
4967 @group
4968 struct foo @{
4969   int x;
4970   char a, b, c, d;
4971 @} __attribute__((packed));
4972 struct bar @{
4973   char z;
4974   struct foo f;
4976 @end group
4977 @end smallexample
4979 @item -Wpacked-bitfield-compat
4980 @opindex Wpacked-bitfield-compat
4981 @opindex Wno-packed-bitfield-compat
4982 The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
4983 on bit-fields of type @code{char}.  This has been fixed in GCC 4.4 but
4984 the change can lead to differences in the structure layout.  GCC
4985 informs you when the offset of such a field has changed in GCC 4.4.
4986 For example there is no longer a 4-bit padding between field @code{a}
4987 and @code{b} in this structure:
4989 @smallexample
4990 struct foo
4992   char a:4;
4993   char b:8;
4994 @} __attribute__ ((packed));
4995 @end smallexample
4997 This warning is enabled by default.  Use
4998 @option{-Wno-packed-bitfield-compat} to disable this warning.
5000 @item -Wpadded
5001 @opindex Wpadded
5002 @opindex Wno-padded
5003 Warn if padding is included in a structure, either to align an element
5004 of the structure or to align the whole structure.  Sometimes when this
5005 happens it is possible to rearrange the fields of the structure to
5006 reduce the padding and so make the structure smaller.
5008 @item -Wredundant-decls
5009 @opindex Wredundant-decls
5010 @opindex Wno-redundant-decls
5011 Warn if anything is declared more than once in the same scope, even in
5012 cases where multiple declaration is valid and changes nothing.
5014 @item -Wnested-externs @r{(C and Objective-C only)}
5015 @opindex Wnested-externs
5016 @opindex Wno-nested-externs
5017 Warn if an @code{extern} declaration is encountered within a function.
5019 @item -Wno-inherited-variadic-ctor
5020 @opindex Winherited-variadic-ctor
5021 @opindex Wno-inherited-variadic-ctor
5022 Suppress warnings about use of C++11 inheriting constructors when the
5023 base class inherited from has a C variadic constructor; the warning is
5024 on by default because the ellipsis is not inherited.
5026 @item -Winline
5027 @opindex Winline
5028 @opindex Wno-inline
5029 Warn if a function that is declared as inline cannot be inlined.
5030 Even with this option, the compiler does not warn about failures to
5031 inline functions declared in system headers.
5033 The compiler uses a variety of heuristics to determine whether or not
5034 to inline a function.  For example, the compiler takes into account
5035 the size of the function being inlined and the amount of inlining
5036 that has already been done in the current function.  Therefore,
5037 seemingly insignificant changes in the source program can cause the
5038 warnings produced by @option{-Winline} to appear or disappear.
5040 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
5041 @opindex Wno-invalid-offsetof
5042 @opindex Winvalid-offsetof
5043 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
5044 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
5045 to a non-POD type is undefined.  In existing C++ implementations,
5046 however, @samp{offsetof} typically gives meaningful results even when
5047 applied to certain kinds of non-POD types (such as a simple
5048 @samp{struct} that fails to be a POD type only by virtue of having a
5049 constructor).  This flag is for users who are aware that they are
5050 writing nonportable code and who have deliberately chosen to ignore the
5051 warning about it.
5053 The restrictions on @samp{offsetof} may be relaxed in a future version
5054 of the C++ standard.
5056 @item -Wno-int-to-pointer-cast
5057 @opindex Wno-int-to-pointer-cast
5058 @opindex Wint-to-pointer-cast
5059 Suppress warnings from casts to pointer type of an integer of a
5060 different size. In C++, casting to a pointer type of smaller size is
5061 an error. @option{Wint-to-pointer-cast} is enabled by default.
5064 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
5065 @opindex Wno-pointer-to-int-cast
5066 @opindex Wpointer-to-int-cast
5067 Suppress warnings from casts from a pointer to an integer type of a
5068 different size.
5070 @item -Winvalid-pch
5071 @opindex Winvalid-pch
5072 @opindex Wno-invalid-pch
5073 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
5074 the search path but can't be used.
5076 @item -Wlong-long
5077 @opindex Wlong-long
5078 @opindex Wno-long-long
5079 Warn if @samp{long long} type is used.  This is enabled by either
5080 @option{-Wpedantic} or @option{-Wtraditional} in ISO C90 and C++98
5081 modes.  To inhibit the warning messages, use @option{-Wno-long-long}.
5083 @item -Wvariadic-macros
5084 @opindex Wvariadic-macros
5085 @opindex Wno-variadic-macros
5086 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
5087 alternate syntax when in pedantic ISO C99 mode.  This is default.
5088 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
5090 @item -Wvarargs
5091 @opindex Wvarargs
5092 @opindex Wno-varargs
5093 Warn upon questionable usage of the macros used to handle variable
5094 arguments like @samp{va_start}.  This is default.  To inhibit the
5095 warning messages, use @option{-Wno-varargs}.
5097 @item -Wvector-operation-performance
5098 @opindex Wvector-operation-performance
5099 @opindex Wno-vector-operation-performance
5100 Warn if vector operation is not implemented via SIMD capabilities of the
5101 architecture.  Mainly useful for the performance tuning.
5102 Vector operation can be implemented @code{piecewise}, which means that the
5103 scalar operation is performed on every vector element; 
5104 @code{in parallel}, which means that the vector operation is implemented
5105 using scalars of wider type, which normally is more performance efficient;
5106 and @code{as a single scalar}, which means that vector fits into a
5107 scalar type.
5109 @item -Wno-virtual-move-assign
5110 @opindex Wvirtual-move-assign
5111 @opindex Wno-virtual-move-assign
5112 Suppress warnings about inheriting from a virtual base with a
5113 non-trivial C++11 move assignment operator.  This is dangerous because
5114 if the virtual base is reachable along more than one path, it will be
5115 moved multiple times, which can mean both objects end up in the
5116 moved-from state.  If the move assignment operator is written to avoid
5117 moving from a moved-from object, this warning can be disabled.
5119 @item -Wvla
5120 @opindex Wvla
5121 @opindex Wno-vla
5122 Warn if variable length array is used in the code.
5123 @option{-Wno-vla} prevents the @option{-Wpedantic} warning of
5124 the variable length array.
5126 @item -Wvolatile-register-var
5127 @opindex Wvolatile-register-var
5128 @opindex Wno-volatile-register-var
5129 Warn if a register variable is declared volatile.  The volatile
5130 modifier does not inhibit all optimizations that may eliminate reads
5131 and/or writes to register variables.  This warning is enabled by
5132 @option{-Wall}.
5134 @item -Wdisabled-optimization
5135 @opindex Wdisabled-optimization
5136 @opindex Wno-disabled-optimization
5137 Warn if a requested optimization pass is disabled.  This warning does
5138 not generally indicate that there is anything wrong with your code; it
5139 merely indicates that GCC's optimizers are unable to handle the code
5140 effectively.  Often, the problem is that your code is too big or too
5141 complex; GCC refuses to optimize programs when the optimization
5142 itself is likely to take inordinate amounts of time.
5144 @item -Wpointer-sign @r{(C and Objective-C only)}
5145 @opindex Wpointer-sign
5146 @opindex Wno-pointer-sign
5147 Warn for pointer argument passing or assignment with different signedness.
5148 This option is only supported for C and Objective-C@.  It is implied by
5149 @option{-Wall} and by @option{-Wpedantic}, which can be disabled with
5150 @option{-Wno-pointer-sign}.
5152 @item -Wstack-protector
5153 @opindex Wstack-protector
5154 @opindex Wno-stack-protector
5155 This option is only active when @option{-fstack-protector} is active.  It
5156 warns about functions that are not protected against stack smashing.
5158 @item -Woverlength-strings
5159 @opindex Woverlength-strings
5160 @opindex Wno-overlength-strings
5161 Warn about string constants that are longer than the ``minimum
5162 maximum'' length specified in the C standard.  Modern compilers
5163 generally allow string constants that are much longer than the
5164 standard's minimum limit, but very portable programs should avoid
5165 using longer strings.
5167 The limit applies @emph{after} string constant concatenation, and does
5168 not count the trailing NUL@.  In C90, the limit was 509 characters; in
5169 C99, it was raised to 4095.  C++98 does not specify a normative
5170 minimum maximum, so we do not diagnose overlength strings in C++@.
5172 This option is implied by @option{-Wpedantic}, and can be disabled with
5173 @option{-Wno-overlength-strings}.
5175 @item -Wunsuffixed-float-constants @r{(C and Objective-C only)}
5176 @opindex Wunsuffixed-float-constants
5178 Issue a warning for any floating constant that does not have
5179 a suffix.  When used together with @option{-Wsystem-headers} it
5180 warns about such constants in system header files.  This can be useful
5181 when preparing code to use with the @code{FLOAT_CONST_DECIMAL64} pragma
5182 from the decimal floating-point extension to C99.
5183 @end table
5185 @node Debugging Options
5186 @section Options for Debugging Your Program or GCC
5187 @cindex options, debugging
5188 @cindex debugging information options
5190 GCC has various special options that are used for debugging
5191 either your program or GCC:
5193 @table @gcctabopt
5194 @item -g
5195 @opindex g
5196 Produce debugging information in the operating system's native format
5197 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
5198 information.
5200 On most systems that use stabs format, @option{-g} enables use of extra
5201 debugging information that only GDB can use; this extra information
5202 makes debugging work better in GDB but probably makes other debuggers
5203 crash or
5204 refuse to read the program.  If you want to control for certain whether
5205 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
5206 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
5208 GCC allows you to use @option{-g} with
5209 @option{-O}.  The shortcuts taken by optimized code may occasionally
5210 produce surprising results: some variables you declared may not exist
5211 at all; flow of control may briefly move where you did not expect it;
5212 some statements may not be executed because they compute constant
5213 results or their values are already at hand; some statements may
5214 execute in different places because they have been moved out of loops.
5216 Nevertheless it proves possible to debug optimized output.  This makes
5217 it reasonable to use the optimizer for programs that might have bugs.
5219 The following options are useful when GCC is generated with the
5220 capability for more than one debugging format.
5222 @item -gsplit-dwarf
5223 @opindex gsplit-dwarf
5224 Separate as much dwarf debugging information as possible into a
5225 separate output file with the extension .dwo.  This option allows
5226 the build system to avoid linking files with debug information.  To
5227 be useful, this option requires a debugger capable of reading .dwo
5228 files.
5230 @item -ggdb
5231 @opindex ggdb
5232 Produce debugging information for use by GDB@.  This means to use the
5233 most expressive format available (DWARF 2, stabs, or the native format
5234 if neither of those are supported), including GDB extensions if at all
5235 possible.
5237 @item -gpubnames
5238 @opindex gpubnames
5239 Generate dwarf .debug_pubnames and .debug_pubtypes sections.
5241 @item -ggnu-pubnames
5242 @opindex ggnu-pubnames
5243 Generate .debug_pubnames and .debug_pubtypes sections in a format
5244 suitable for conversion into a GDB@ index.  This option is only useful
5245 with a linker that can produce GDB@ index version 7.
5247 @item -gstabs
5248 @opindex gstabs
5249 Produce debugging information in stabs format (if that is supported),
5250 without GDB extensions.  This is the format used by DBX on most BSD
5251 systems.  On MIPS, Alpha and System V Release 4 systems this option
5252 produces stabs debugging output that is not understood by DBX or SDB@.
5253 On System V Release 4 systems this option requires the GNU assembler.
5255 @item -feliminate-unused-debug-symbols
5256 @opindex feliminate-unused-debug-symbols
5257 Produce debugging information in stabs format (if that is supported),
5258 for only symbols that are actually used.
5260 @item -femit-class-debug-always
5261 Instead of emitting debugging information for a C++ class in only one
5262 object file, emit it in all object files using the class.  This option
5263 should be used only with debuggers that are unable to handle the way GCC
5264 normally emits debugging information for classes because using this
5265 option increases the size of debugging information by as much as a
5266 factor of two.
5268 @item -fdebug-types-section
5269 @opindex fdebug-types-section
5270 @opindex fno-debug-types-section
5271 When using DWARF Version 4 or higher, type DIEs can be put into
5272 their own @code{.debug_types} section instead of making them part of the
5273 @code{.debug_info} section.  It is more efficient to put them in a separate
5274 comdat sections since the linker can then remove duplicates.
5275 But not all DWARF consumers support @code{.debug_types} sections yet
5276 and on some objects @code{.debug_types} produces larger instead of smaller
5277 debugging information.
5279 @item -gstabs+
5280 @opindex gstabs+
5281 Produce debugging information in stabs format (if that is supported),
5282 using GNU extensions understood only by the GNU debugger (GDB)@.  The
5283 use of these extensions is likely to make other debuggers crash or
5284 refuse to read the program.
5286 @item -gcoff
5287 @opindex gcoff
5288 Produce debugging information in COFF format (if that is supported).
5289 This is the format used by SDB on most System V systems prior to
5290 System V Release 4.
5292 @item -gxcoff
5293 @opindex gxcoff
5294 Produce debugging information in XCOFF format (if that is supported).
5295 This is the format used by the DBX debugger on IBM RS/6000 systems.
5297 @item -gxcoff+
5298 @opindex gxcoff+
5299 Produce debugging information in XCOFF format (if that is supported),
5300 using GNU extensions understood only by the GNU debugger (GDB)@.  The
5301 use of these extensions is likely to make other debuggers crash or
5302 refuse to read the program, and may cause assemblers other than the GNU
5303 assembler (GAS) to fail with an error.
5305 @item -gdwarf-@var{version}
5306 @opindex gdwarf-@var{version}
5307 Produce debugging information in DWARF format (if that is supported).
5308 The value of @var{version} may be either 2, 3 or 4; the default version
5309 for most targets is 4.
5311 Note that with DWARF Version 2, some ports require and always
5312 use some non-conflicting DWARF 3 extensions in the unwind tables.
5314 Version 4 may require GDB 7.0 and @option{-fvar-tracking-assignments}
5315 for maximum benefit.
5317 @item -grecord-gcc-switches
5318 @opindex grecord-gcc-switches
5319 This switch causes the command-line options used to invoke the
5320 compiler that may affect code generation to be appended to the
5321 DW_AT_producer attribute in DWARF debugging information.  The options
5322 are concatenated with spaces separating them from each other and from
5323 the compiler version.  See also @option{-frecord-gcc-switches} for another
5324 way of storing compiler options into the object file.  This is the default.
5326 @item -gno-record-gcc-switches
5327 @opindex gno-record-gcc-switches
5328 Disallow appending command-line options to the DW_AT_producer attribute
5329 in DWARF debugging information.
5331 @item -gstrict-dwarf
5332 @opindex gstrict-dwarf
5333 Disallow using extensions of later DWARF standard version than selected
5334 with @option{-gdwarf-@var{version}}.  On most targets using non-conflicting
5335 DWARF extensions from later standard versions is allowed.
5337 @item -gno-strict-dwarf
5338 @opindex gno-strict-dwarf
5339 Allow using extensions of later DWARF standard version than selected with
5340 @option{-gdwarf-@var{version}}.
5342 @item -gz@r{[}=@var{type}@r{]}
5343 @opindex gz
5344 Produce compressed debug sections in DWARF format, if that is supported.
5345 If @var{type} is not given, the default type depends on the capabilities
5346 of the assembler and linker used.  @var{type} may be one of
5347 @option{none} (don't compress debug sections), @option{zlib} (use zlib
5348 compression in ELF gABI format), or @option{zlib-gnu} (use zlib
5349 compression in traditional GNU format).  If the linker doesn't support
5350 writing compressed debug sections, the option is rejected.  Otherwise,
5351 if the assembler does not support them, @option{-gz} is silently ignored
5352 when producing object files.
5354 @item -gvms
5355 @opindex gvms
5356 Produce debugging information in Alpha/VMS debug format (if that is
5357 supported).  This is the format used by DEBUG on Alpha/VMS systems.
5359 @item -g@var{level}
5360 @itemx -ggdb@var{level}
5361 @itemx -gstabs@var{level}
5362 @itemx -gcoff@var{level}
5363 @itemx -gxcoff@var{level}
5364 @itemx -gvms@var{level}
5365 Request debugging information and also use @var{level} to specify how
5366 much information.  The default level is 2.
5368 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
5369 @option{-g}.
5371 Level 1 produces minimal information, enough for making backtraces in
5372 parts of the program that you don't plan to debug.  This includes
5373 descriptions of functions and external variables, and line number
5374 tables, but no information about local variables.
5376 Level 3 includes extra information, such as all the macro definitions
5377 present in the program.  Some debuggers support macro expansion when
5378 you use @option{-g3}.
5380 @option{-gdwarf-2} does not accept a concatenated debug level, because
5381 GCC used to support an option @option{-gdwarf} that meant to generate
5382 debug information in version 1 of the DWARF format (which is very
5383 different from version 2), and it would have been too confusing.  That
5384 debug format is long obsolete, but the option cannot be changed now.
5385 Instead use an additional @option{-g@var{level}} option to change the
5386 debug level for DWARF.
5388 @item -gtoggle
5389 @opindex gtoggle
5390 Turn off generation of debug info, if leaving out this option
5391 generates it, or turn it on at level 2 otherwise.  The position of this
5392 argument in the command line does not matter; it takes effect after all
5393 other options are processed, and it does so only once, no matter how
5394 many times it is given.  This is mainly intended to be used with
5395 @option{-fcompare-debug}.
5397 @item -fsanitize=address
5398 @opindex fsanitize=address
5399 Enable AddressSanitizer, a fast memory error detector.
5400 Memory access instructions will be instrumented to detect
5401 out-of-bounds and use-after-free bugs.
5402 See @uref{http://code.google.com/p/address-sanitizer/} for
5403 more details.  The run-time behavior can be influenced using the
5404 @env{ASAN_OPTIONS} environment variable; see
5405 @url{https://code.google.com/p/address-sanitizer/wiki/Flags#Run-time_flags} for
5406 a list of supported options.
5408 @item -fsanitize=thread
5409 @opindex fsanitize=thread
5410 Enable ThreadSanitizer, a fast data race detector.
5411 Memory access instructions will be instrumented to detect
5412 data race bugs.  See @uref{http://code.google.com/p/thread-sanitizer/} for more
5413 details. The run-time behavior can be influenced using the @env{TSAN_OPTIONS}
5414 environment variable; see
5415 @url{https://code.google.com/p/thread-sanitizer/wiki/Flags} for a list of
5416 supported options.
5418 @item -fsanitize=leak
5419 @opindex fsanitize=leak
5420 Enable LeakSanitizer, a memory leak detector.
5421 This option only matters for linking of executables and if neither
5422 @option{-fsanitize=address} nor @option{-fsanitize=thread} is used.  In that
5423 case it will link the executable against a library that overrides @code{malloc}
5424 and other allocator functions.  See
5425 @uref{https://code.google.com/p/address-sanitizer/wiki/LeakSanitizer} for more
5426 details.  The run-time behavior can be influenced using the
5427 @env{LSAN_OPTIONS} environment variable.
5429 @item -fsanitize=undefined
5430 @opindex fsanitize=undefined
5431 Enable UndefinedBehaviorSanitizer, a fast undefined behavior detector.
5432 Various computations will be instrumented to detect undefined behavior
5433 at runtime.  Current suboptions are:
5435 @table @gcctabopt
5437 @item -fsanitize=shift
5438 @opindex fsanitize=shift
5439 This option enables checking that the result of a shift operation is
5440 not undefined.  Note that what exactly is considered undefined differs
5441 slightly between C and C++, as well as between ISO C90 and C99, etc.
5443 @item -fsanitize=integer-divide-by-zero
5444 @opindex fsanitize=integer-divide-by-zero
5445 Detect integer division by zero as well as @code{INT_MIN / -1} division.
5447 @item -fsanitize=unreachable
5448 @opindex fsanitize=unreachable
5449 With this option, the compiler will turn the @code{__builtin_unreachable}
5450 call into a diagnostics message call instead.  When reaching the
5451 @code{__builtin_unreachable} call, the behavior is undefined.
5453 @item -fsanitize=vla-bound
5454 @opindex fsanitize=vla-bound
5455 This option instructs the compiler to check that the size of a variable
5456 length array is positive.  This option does not have any effect in
5457 @option{-std=c++1y} mode, as the standard requires the exception be thrown
5458 instead.
5460 @item -fsanitize=null
5461 @opindex fsanitize=null
5462 This option enables pointer checking.  Particularly, the application
5463 built with this option turned on will issue an error message when it
5464 tries to dereference a NULL pointer, or if a reference (possibly an
5465 rvalue reference) is bound to a NULL pointer.
5467 @item -fsanitize=return
5468 @opindex fsanitize=return
5469 This option enables return statement checking.  Programs
5470 built with this option turned on will issue an error message
5471 when the end of a non-void function is reached without actually
5472 returning a value.  This option works in C++ only.
5474 @item -fsanitize=signed-integer-overflow
5475 @opindex fsanitize=signed-integer-overflow
5476 This option enables signed integer overflow checking.  We check that
5477 the result of @code{+}, @code{*}, and both unary and binary @code{-}
5478 does not overflow in the signed arithmetics.  Note, integer promotion
5479 rules must be taken into account.  That is, the following is not an
5480 overflow:
5481 @smallexample
5482 signed char a = SCHAR_MAX;
5483 a++;
5484 @end smallexample
5486 @item -fsanitize=bounds
5487 @opindex fsanitize=bounds
5488 This option enables instrumentation of array bounds.  Various out of bounds
5489 accesses are detected.  Flexible array members and initializers of variables
5490 with static storage are not instrumented.
5492 @item -fsanitize=float-divide-by-zero
5493 @opindex fsanitize=float-divide-by-zero
5494 Detect floating-point division by zero.  Unlike other similar options,
5495 @option{-fsanitize=float-divide-by-zero} is not enabled by
5496 @option{-fsanitize=undefined}, since floating-point division by zero can
5497 be a legitimate way of obtaining infinities and NaNs.
5499 @item -fsanitize=float-cast-overflow
5500 @opindex fsanitize=float-cast-overflow
5501 This option enables floating-point type to integer conversion checking.
5502 We check that the result of the conversion does not overflow.
5503 This option does not work well with @code{FE_INVALID} exceptions enabled.
5505 @end table
5507 While @option{-ftrapv} causes traps for signed overflows to be emitted,
5508 @option{-fsanitize=undefined} gives a diagnostic message.
5509 This currently works only for the C family of languages.
5511 @item -fsanitize-recover
5512 @opindex fsanitize-recover
5513 By default @option{-fsanitize=undefined} sanitization (and its suboptions
5514 except for @option{-fsanitize=unreachable} and @option{-fsanitize=return})
5515 after reporting undefined behavior attempts to continue running the
5516 program as if no undefined behavior happened.  This means multiple undefined
5517 behavior runtime errors can be reported in a single program run, and the exit
5518 code of the program may indicate success even when undefined behavior
5519 has been reported.  The @option{-fno-sanitize-recover} can be used to alter
5520 this behavior, only the first detected undefined behavior will be reported
5521 and program will exit after that with non-zero exit code.
5523 @item -fsanitize-undefined-trap-on-error
5524 @opindex fsanitize-undefined-trap-on-error
5525 The @option{-fsanitize-undefined-trap-on-error} instructs the compiler to
5526 report undefined behavior using @code{__builtin_trap ()} rather than
5527 a @code{libubsan} library routine.  The advantage of this is that the
5528 @code{libubsan} library is not needed and will not be linked in, so this
5529 is usable even for use in freestanding environments.
5531 @item -fdump-final-insns@r{[}=@var{file}@r{]}
5532 @opindex fdump-final-insns
5533 Dump the final internal representation (RTL) to @var{file}.  If the
5534 optional argument is omitted (or if @var{file} is @code{.}), the name
5535 of the dump file is determined by appending @code{.gkd} to the
5536 compilation output file name.
5538 @item -fcompare-debug@r{[}=@var{opts}@r{]}
5539 @opindex fcompare-debug
5540 @opindex fno-compare-debug
5541 If no error occurs during compilation, run the compiler a second time,
5542 adding @var{opts} and @option{-fcompare-debug-second} to the arguments
5543 passed to the second compilation.  Dump the final internal
5544 representation in both compilations, and print an error if they differ.
5546 If the equal sign is omitted, the default @option{-gtoggle} is used.
5548 The environment variable @env{GCC_COMPARE_DEBUG}, if defined, non-empty
5549 and nonzero, implicitly enables @option{-fcompare-debug}.  If
5550 @env{GCC_COMPARE_DEBUG} is defined to a string starting with a dash,
5551 then it is used for @var{opts}, otherwise the default @option{-gtoggle}
5552 is used.
5554 @option{-fcompare-debug=}, with the equal sign but without @var{opts},
5555 is equivalent to @option{-fno-compare-debug}, which disables the dumping
5556 of the final representation and the second compilation, preventing even
5557 @env{GCC_COMPARE_DEBUG} from taking effect.
5559 To verify full coverage during @option{-fcompare-debug} testing, set
5560 @env{GCC_COMPARE_DEBUG} to say @samp{-fcompare-debug-not-overridden},
5561 which GCC rejects as an invalid option in any actual compilation
5562 (rather than preprocessing, assembly or linking).  To get just a
5563 warning, setting @env{GCC_COMPARE_DEBUG} to @samp{-w%n-fcompare-debug
5564 not overridden} will do.
5566 @item -fcompare-debug-second
5567 @opindex fcompare-debug-second
5568 This option is implicitly passed to the compiler for the second
5569 compilation requested by @option{-fcompare-debug}, along with options to
5570 silence warnings, and omitting other options that would cause
5571 side-effect compiler outputs to files or to the standard output.  Dump
5572 files and preserved temporary files are renamed so as to contain the
5573 @code{.gk} additional extension during the second compilation, to avoid
5574 overwriting those generated by the first.
5576 When this option is passed to the compiler driver, it causes the
5577 @emph{first} compilation to be skipped, which makes it useful for little
5578 other than debugging the compiler proper.
5580 @item -feliminate-dwarf2-dups
5581 @opindex feliminate-dwarf2-dups
5582 Compress DWARF 2 debugging information by eliminating duplicated
5583 information about each symbol.  This option only makes sense when
5584 generating DWARF 2 debugging information with @option{-gdwarf-2}.
5586 @item -femit-struct-debug-baseonly
5587 @opindex femit-struct-debug-baseonly
5588 Emit debug information for struct-like types
5589 only when the base name of the compilation source file
5590 matches the base name of file in which the struct is defined.
5592 This option substantially reduces the size of debugging information,
5593 but at significant potential loss in type information to the debugger.
5594 See @option{-femit-struct-debug-reduced} for a less aggressive option.
5595 See @option{-femit-struct-debug-detailed} for more detailed control.
5597 This option works only with DWARF 2.
5599 @item -femit-struct-debug-reduced
5600 @opindex femit-struct-debug-reduced
5601 Emit debug information for struct-like types
5602 only when the base name of the compilation source file
5603 matches the base name of file in which the type is defined,
5604 unless the struct is a template or defined in a system header.
5606 This option significantly reduces the size of debugging information,
5607 with some potential loss in type information to the debugger.
5608 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
5609 See @option{-femit-struct-debug-detailed} for more detailed control.
5611 This option works only with DWARF 2.
5613 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
5614 Specify the struct-like types
5615 for which the compiler generates debug information.
5616 The intent is to reduce duplicate struct debug information
5617 between different object files within the same program.
5619 This option is a detailed version of
5620 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
5621 which serves for most needs.
5623 A specification has the syntax@*
5624 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
5626 The optional first word limits the specification to
5627 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
5628 A struct type is used directly when it is the type of a variable, member.
5629 Indirect uses arise through pointers to structs.
5630 That is, when use of an incomplete struct is valid, the use is indirect.
5631 An example is
5632 @samp{struct one direct; struct two * indirect;}.
5634 The optional second word limits the specification to
5635 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
5636 Generic structs are a bit complicated to explain.
5637 For C++, these are non-explicit specializations of template classes,
5638 or non-template classes within the above.
5639 Other programming languages have generics,
5640 but @option{-femit-struct-debug-detailed} does not yet implement them.
5642 The third word specifies the source files for those
5643 structs for which the compiler should emit debug information.
5644 The values @samp{none} and @samp{any} have the normal meaning.
5645 The value @samp{base} means that
5646 the base of name of the file in which the type declaration appears
5647 must match the base of the name of the main compilation file.
5648 In practice, this means that when compiling @file{foo.c}, debug information
5649 is generated for types declared in that file and @file{foo.h},
5650 but not other header files.
5651 The value @samp{sys} means those types satisfying @samp{base}
5652 or declared in system or compiler headers.
5654 You may need to experiment to determine the best settings for your application.
5656 The default is @option{-femit-struct-debug-detailed=all}.
5658 This option works only with DWARF 2.
5660 @item -fno-merge-debug-strings
5661 @opindex fmerge-debug-strings
5662 @opindex fno-merge-debug-strings
5663 Direct the linker to not merge together strings in the debugging
5664 information that are identical in different object files.  Merging is
5665 not supported by all assemblers or linkers.  Merging decreases the size
5666 of the debug information in the output file at the cost of increasing
5667 link processing time.  Merging is enabled by default.
5669 @item -fdebug-prefix-map=@var{old}=@var{new}
5670 @opindex fdebug-prefix-map
5671 When compiling files in directory @file{@var{old}}, record debugging
5672 information describing them as in @file{@var{new}} instead.
5674 @item -fno-dwarf2-cfi-asm
5675 @opindex fdwarf2-cfi-asm
5676 @opindex fno-dwarf2-cfi-asm
5677 Emit DWARF 2 unwind info as compiler generated @code{.eh_frame} section
5678 instead of using GAS @code{.cfi_*} directives.
5680 @cindex @command{prof}
5681 @item -p
5682 @opindex p
5683 Generate extra code to write profile information suitable for the
5684 analysis program @command{prof}.  You must use this option when compiling
5685 the source files you want data about, and you must also use it when
5686 linking.
5688 @cindex @command{gprof}
5689 @item -pg
5690 @opindex pg
5691 Generate extra code to write profile information suitable for the
5692 analysis program @command{gprof}.  You must use this option when compiling
5693 the source files you want data about, and you must also use it when
5694 linking.
5696 @item -Q
5697 @opindex Q
5698 Makes the compiler print out each function name as it is compiled, and
5699 print some statistics about each pass when it finishes.
5701 @item -ftime-report
5702 @opindex ftime-report
5703 Makes the compiler print some statistics about the time consumed by each
5704 pass when it finishes.
5706 @item -fmem-report
5707 @opindex fmem-report
5708 Makes the compiler print some statistics about permanent memory
5709 allocation when it finishes.
5711 @item -fmem-report-wpa
5712 @opindex fmem-report-wpa
5713 Makes the compiler print some statistics about permanent memory
5714 allocation for the WPA phase only.
5716 @item -fpre-ipa-mem-report
5717 @opindex fpre-ipa-mem-report
5718 @item -fpost-ipa-mem-report
5719 @opindex fpost-ipa-mem-report
5720 Makes the compiler print some statistics about permanent memory
5721 allocation before or after interprocedural optimization.
5723 @item -fprofile-report
5724 @opindex fprofile-report
5725 Makes the compiler print some statistics about consistency of the
5726 (estimated) profile and effect of individual passes.
5728 @item -fstack-usage
5729 @opindex fstack-usage
5730 Makes the compiler output stack usage information for the program, on a
5731 per-function basis.  The filename for the dump is made by appending
5732 @file{.su} to the @var{auxname}.  @var{auxname} is generated from the name of
5733 the output file, if explicitly specified and it is not an executable,
5734 otherwise it is the basename of the source file.  An entry is made up
5735 of three fields:
5737 @itemize
5738 @item
5739 The name of the function.
5740 @item
5741 A number of bytes.
5742 @item
5743 One or more qualifiers: @code{static}, @code{dynamic}, @code{bounded}.
5744 @end itemize
5746 The qualifier @code{static} means that the function manipulates the stack
5747 statically: a fixed number of bytes are allocated for the frame on function
5748 entry and released on function exit; no stack adjustments are otherwise made
5749 in the function.  The second field is this fixed number of bytes.
5751 The qualifier @code{dynamic} means that the function manipulates the stack
5752 dynamically: in addition to the static allocation described above, stack
5753 adjustments are made in the body of the function, for example to push/pop
5754 arguments around function calls.  If the qualifier @code{bounded} is also
5755 present, the amount of these adjustments is bounded at compile time and
5756 the second field is an upper bound of the total amount of stack used by
5757 the function.  If it is not present, the amount of these adjustments is
5758 not bounded at compile time and the second field only represents the
5759 bounded part.
5761 @item -fprofile-arcs
5762 @opindex fprofile-arcs
5763 Add code so that program flow @dfn{arcs} are instrumented.  During
5764 execution the program records how many times each branch and call is
5765 executed and how many times it is taken or returns.  When the compiled
5766 program exits it saves this data to a file called
5767 @file{@var{auxname}.gcda} for each source file.  The data may be used for
5768 profile-directed optimizations (@option{-fbranch-probabilities}), or for
5769 test coverage analysis (@option{-ftest-coverage}).  Each object file's
5770 @var{auxname} is generated from the name of the output file, if
5771 explicitly specified and it is not the final executable, otherwise it is
5772 the basename of the source file.  In both cases any suffix is removed
5773 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
5774 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
5775 @xref{Cross-profiling}.
5777 @cindex @command{gcov}
5778 @item --coverage
5779 @opindex coverage
5781 This option is used to compile and link code instrumented for coverage
5782 analysis.  The option is a synonym for @option{-fprofile-arcs}
5783 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
5784 linking).  See the documentation for those options for more details.
5786 @itemize
5788 @item
5789 Compile the source files with @option{-fprofile-arcs} plus optimization
5790 and code generation options.  For test coverage analysis, use the
5791 additional @option{-ftest-coverage} option.  You do not need to profile
5792 every source file in a program.
5794 @item
5795 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
5796 (the latter implies the former).
5798 @item
5799 Run the program on a representative workload to generate the arc profile
5800 information.  This may be repeated any number of times.  You can run
5801 concurrent instances of your program, and provided that the file system
5802 supports locking, the data files will be correctly updated.  Also
5803 @code{fork} calls are detected and correctly handled (double counting
5804 will not happen).
5806 @item
5807 For profile-directed optimizations, compile the source files again with
5808 the same optimization and code generation options plus
5809 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
5810 Control Optimization}).
5812 @item
5813 For test coverage analysis, use @command{gcov} to produce human readable
5814 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
5815 @command{gcov} documentation for further information.
5817 @end itemize
5819 With @option{-fprofile-arcs}, for each function of your program GCC
5820 creates a program flow graph, then finds a spanning tree for the graph.
5821 Only arcs that are not on the spanning tree have to be instrumented: the
5822 compiler adds code to count the number of times that these arcs are
5823 executed.  When an arc is the only exit or only entrance to a block, the
5824 instrumentation code can be added to the block; otherwise, a new basic
5825 block must be created to hold the instrumentation code.
5827 @need 2000
5828 @item -ftest-coverage
5829 @opindex ftest-coverage
5830 Produce a notes file that the @command{gcov} code-coverage utility
5831 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
5832 show program coverage.  Each source file's note file is called
5833 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
5834 above for a description of @var{auxname} and instructions on how to
5835 generate test coverage data.  Coverage data matches the source files
5836 more closely if you do not optimize.
5838 @item -fdbg-cnt-list
5839 @opindex fdbg-cnt-list
5840 Print the name and the counter upper bound for all debug counters.
5843 @item -fdbg-cnt=@var{counter-value-list}
5844 @opindex fdbg-cnt
5845 Set the internal debug counter upper bound.  @var{counter-value-list}
5846 is a comma-separated list of @var{name}:@var{value} pairs
5847 which sets the upper bound of each debug counter @var{name} to @var{value}.
5848 All debug counters have the initial upper bound of @code{UINT_MAX};
5849 thus @code{dbg_cnt()} returns true always unless the upper bound
5850 is set by this option.
5851 For example, with @option{-fdbg-cnt=dce:10,tail_call:0},
5852 @code{dbg_cnt(dce)} returns true only for first 10 invocations.
5854 @item -fenable-@var{kind}-@var{pass}
5855 @itemx -fdisable-@var{kind}-@var{pass}=@var{range-list}
5856 @opindex fdisable-
5857 @opindex fenable-
5859 This is a set of options that are used to explicitly disable/enable
5860 optimization passes.  These options are intended for use for debugging GCC.
5861 Compiler users should use regular options for enabling/disabling
5862 passes instead.
5864 @table @gcctabopt
5866 @item -fdisable-ipa-@var{pass}
5867 Disable IPA pass @var{pass}. @var{pass} is the pass name.  If the same pass is
5868 statically invoked in the compiler multiple times, the pass name should be
5869 appended with a sequential number starting from 1.
5871 @item -fdisable-rtl-@var{pass}
5872 @itemx -fdisable-rtl-@var{pass}=@var{range-list}
5873 Disable RTL pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
5874 statically invoked in the compiler multiple times, the pass name should be
5875 appended with a sequential number starting from 1.  @var{range-list} is a 
5876 comma-separated list of function ranges or assembler names.  Each range is a number
5877 pair separated by a colon.  The range is inclusive in both ends.  If the range
5878 is trivial, the number pair can be simplified as a single number.  If the
5879 function's call graph node's @var{uid} falls within one of the specified ranges,
5880 the @var{pass} is disabled for that function.  The @var{uid} is shown in the
5881 function header of a dump file, and the pass names can be dumped by using
5882 option @option{-fdump-passes}.
5884 @item -fdisable-tree-@var{pass}
5885 @itemx -fdisable-tree-@var{pass}=@var{range-list}
5886 Disable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description of
5887 option arguments.
5889 @item -fenable-ipa-@var{pass}
5890 Enable IPA pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
5891 statically invoked in the compiler multiple times, the pass name should be
5892 appended with a sequential number starting from 1.
5894 @item -fenable-rtl-@var{pass}
5895 @itemx -fenable-rtl-@var{pass}=@var{range-list}
5896 Enable RTL pass @var{pass}.  See @option{-fdisable-rtl} for option argument
5897 description and examples.
5899 @item -fenable-tree-@var{pass}
5900 @itemx -fenable-tree-@var{pass}=@var{range-list}
5901 Enable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description
5902 of option arguments.
5904 @end table
5906 Here are some examples showing uses of these options.
5908 @smallexample
5910 # disable ccp1 for all functions
5911    -fdisable-tree-ccp1
5912 # disable complete unroll for function whose cgraph node uid is 1
5913    -fenable-tree-cunroll=1
5914 # disable gcse2 for functions at the following ranges [1,1],
5915 # [300,400], and [400,1000]
5916 # disable gcse2 for functions foo and foo2
5917    -fdisable-rtl-gcse2=foo,foo2
5918 # disable early inlining
5919    -fdisable-tree-einline
5920 # disable ipa inlining
5921    -fdisable-ipa-inline
5922 # enable tree full unroll
5923    -fenable-tree-unroll
5925 @end smallexample
5927 @item -d@var{letters}
5928 @itemx -fdump-rtl-@var{pass}
5929 @itemx -fdump-rtl-@var{pass}=@var{filename}
5930 @opindex d
5931 @opindex fdump-rtl-@var{pass}
5932 Says to make debugging dumps during compilation at times specified by
5933 @var{letters}.  This is used for debugging the RTL-based passes of the
5934 compiler.  The file names for most of the dumps are made by appending
5935 a pass number and a word to the @var{dumpname}, and the files are
5936 created in the directory of the output file. In case of
5937 @option{=@var{filename}} option, the dump is output on the given file
5938 instead of the pass numbered dump files. Note that the pass number is
5939 computed statically as passes get registered into the pass manager.
5940 Thus the numbering is not related to the dynamic order of execution of
5941 passes.  In particular, a pass installed by a plugin could have a
5942 number over 200 even if it executed quite early.  @var{dumpname} is
5943 generated from the name of the output file, if explicitly specified
5944 and it is not an executable, otherwise it is the basename of the
5945 source file. These switches may have different effects when
5946 @option{-E} is used for preprocessing.
5948 Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
5949 @option{-d} option @var{letters}.  Here are the possible
5950 letters for use in @var{pass} and @var{letters}, and their meanings:
5952 @table @gcctabopt
5954 @item -fdump-rtl-alignments
5955 @opindex fdump-rtl-alignments
5956 Dump after branch alignments have been computed.
5958 @item -fdump-rtl-asmcons
5959 @opindex fdump-rtl-asmcons
5960 Dump after fixing rtl statements that have unsatisfied in/out constraints.
5962 @item -fdump-rtl-auto_inc_dec
5963 @opindex fdump-rtl-auto_inc_dec
5964 Dump after auto-inc-dec discovery.  This pass is only run on
5965 architectures that have auto inc or auto dec instructions.
5967 @item -fdump-rtl-barriers
5968 @opindex fdump-rtl-barriers
5969 Dump after cleaning up the barrier instructions.
5971 @item -fdump-rtl-bbpart
5972 @opindex fdump-rtl-bbpart
5973 Dump after partitioning hot and cold basic blocks.
5975 @item -fdump-rtl-bbro
5976 @opindex fdump-rtl-bbro
5977 Dump after block reordering.
5979 @item -fdump-rtl-btl1
5980 @itemx -fdump-rtl-btl2
5981 @opindex fdump-rtl-btl2
5982 @opindex fdump-rtl-btl2
5983 @option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
5984 after the two branch
5985 target load optimization passes.
5987 @item -fdump-rtl-bypass
5988 @opindex fdump-rtl-bypass
5989 Dump after jump bypassing and control flow optimizations.
5991 @item -fdump-rtl-combine
5992 @opindex fdump-rtl-combine
5993 Dump after the RTL instruction combination pass.
5995 @item -fdump-rtl-compgotos
5996 @opindex fdump-rtl-compgotos
5997 Dump after duplicating the computed gotos.
5999 @item -fdump-rtl-ce1
6000 @itemx -fdump-rtl-ce2
6001 @itemx -fdump-rtl-ce3
6002 @opindex fdump-rtl-ce1
6003 @opindex fdump-rtl-ce2
6004 @opindex fdump-rtl-ce3
6005 @option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
6006 @option{-fdump-rtl-ce3} enable dumping after the three
6007 if conversion passes.
6009 @item -fdump-rtl-cprop_hardreg
6010 @opindex fdump-rtl-cprop_hardreg
6011 Dump after hard register copy propagation.
6013 @item -fdump-rtl-csa
6014 @opindex fdump-rtl-csa
6015 Dump after combining stack adjustments.
6017 @item -fdump-rtl-cse1
6018 @itemx -fdump-rtl-cse2
6019 @opindex fdump-rtl-cse1
6020 @opindex fdump-rtl-cse2
6021 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
6022 the two common subexpression elimination passes.
6024 @item -fdump-rtl-dce
6025 @opindex fdump-rtl-dce
6026 Dump after the standalone dead code elimination passes.
6028 @item -fdump-rtl-dbr
6029 @opindex fdump-rtl-dbr
6030 Dump after delayed branch scheduling.
6032 @item -fdump-rtl-dce1
6033 @itemx -fdump-rtl-dce2
6034 @opindex fdump-rtl-dce1
6035 @opindex fdump-rtl-dce2
6036 @option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
6037 the two dead store elimination passes.
6039 @item -fdump-rtl-eh
6040 @opindex fdump-rtl-eh
6041 Dump after finalization of EH handling code.
6043 @item -fdump-rtl-eh_ranges
6044 @opindex fdump-rtl-eh_ranges
6045 Dump after conversion of EH handling range regions.
6047 @item -fdump-rtl-expand
6048 @opindex fdump-rtl-expand
6049 Dump after RTL generation.
6051 @item -fdump-rtl-fwprop1
6052 @itemx -fdump-rtl-fwprop2
6053 @opindex fdump-rtl-fwprop1
6054 @opindex fdump-rtl-fwprop2
6055 @option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
6056 dumping after the two forward propagation passes.
6058 @item -fdump-rtl-gcse1
6059 @itemx -fdump-rtl-gcse2
6060 @opindex fdump-rtl-gcse1
6061 @opindex fdump-rtl-gcse2
6062 @option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
6063 after global common subexpression elimination.
6065 @item -fdump-rtl-init-regs
6066 @opindex fdump-rtl-init-regs
6067 Dump after the initialization of the registers.
6069 @item -fdump-rtl-initvals
6070 @opindex fdump-rtl-initvals
6071 Dump after the computation of the initial value sets.
6073 @item -fdump-rtl-into_cfglayout
6074 @opindex fdump-rtl-into_cfglayout
6075 Dump after converting to cfglayout mode.
6077 @item -fdump-rtl-ira
6078 @opindex fdump-rtl-ira
6079 Dump after iterated register allocation.
6081 @item -fdump-rtl-jump
6082 @opindex fdump-rtl-jump
6083 Dump after the second jump optimization.
6085 @item -fdump-rtl-loop2
6086 @opindex fdump-rtl-loop2
6087 @option{-fdump-rtl-loop2} enables dumping after the rtl
6088 loop optimization passes.
6090 @item -fdump-rtl-mach
6091 @opindex fdump-rtl-mach
6092 Dump after performing the machine dependent reorganization pass, if that
6093 pass exists.
6095 @item -fdump-rtl-mode_sw
6096 @opindex fdump-rtl-mode_sw
6097 Dump after removing redundant mode switches.
6099 @item -fdump-rtl-rnreg
6100 @opindex fdump-rtl-rnreg
6101 Dump after register renumbering.
6103 @item -fdump-rtl-outof_cfglayout
6104 @opindex fdump-rtl-outof_cfglayout
6105 Dump after converting from cfglayout mode.
6107 @item -fdump-rtl-peephole2
6108 @opindex fdump-rtl-peephole2
6109 Dump after the peephole pass.
6111 @item -fdump-rtl-postreload
6112 @opindex fdump-rtl-postreload
6113 Dump after post-reload optimizations.
6115 @item -fdump-rtl-pro_and_epilogue
6116 @opindex fdump-rtl-pro_and_epilogue
6117 Dump after generating the function prologues and epilogues.
6119 @item -fdump-rtl-sched1
6120 @itemx -fdump-rtl-sched2
6121 @opindex fdump-rtl-sched1
6122 @opindex fdump-rtl-sched2
6123 @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
6124 after the basic block scheduling passes.
6126 @item -fdump-rtl-ree
6127 @opindex fdump-rtl-ree
6128 Dump after sign/zero extension elimination.
6130 @item -fdump-rtl-seqabstr
6131 @opindex fdump-rtl-seqabstr
6132 Dump after common sequence discovery.
6134 @item -fdump-rtl-shorten
6135 @opindex fdump-rtl-shorten
6136 Dump after shortening branches.
6138 @item -fdump-rtl-sibling
6139 @opindex fdump-rtl-sibling
6140 Dump after sibling call optimizations.
6142 @item -fdump-rtl-split1
6143 @itemx -fdump-rtl-split2
6144 @itemx -fdump-rtl-split3
6145 @itemx -fdump-rtl-split4
6146 @itemx -fdump-rtl-split5
6147 @opindex fdump-rtl-split1
6148 @opindex fdump-rtl-split2
6149 @opindex fdump-rtl-split3
6150 @opindex fdump-rtl-split4
6151 @opindex fdump-rtl-split5
6152 @option{-fdump-rtl-split1}, @option{-fdump-rtl-split2},
6153 @option{-fdump-rtl-split3}, @option{-fdump-rtl-split4} and
6154 @option{-fdump-rtl-split5} enable dumping after five rounds of
6155 instruction splitting.
6157 @item -fdump-rtl-sms
6158 @opindex fdump-rtl-sms
6159 Dump after modulo scheduling.  This pass is only run on some
6160 architectures.
6162 @item -fdump-rtl-stack
6163 @opindex fdump-rtl-stack
6164 Dump after conversion from GCC's ``flat register file'' registers to the
6165 x87's stack-like registers.  This pass is only run on x86 variants.
6167 @item -fdump-rtl-subreg1
6168 @itemx -fdump-rtl-subreg2
6169 @opindex fdump-rtl-subreg1
6170 @opindex fdump-rtl-subreg2
6171 @option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
6172 the two subreg expansion passes.
6174 @item -fdump-rtl-unshare
6175 @opindex fdump-rtl-unshare
6176 Dump after all rtl has been unshared.
6178 @item -fdump-rtl-vartrack
6179 @opindex fdump-rtl-vartrack
6180 Dump after variable tracking.
6182 @item -fdump-rtl-vregs
6183 @opindex fdump-rtl-vregs
6184 Dump after converting virtual registers to hard registers.
6186 @item -fdump-rtl-web
6187 @opindex fdump-rtl-web
6188 Dump after live range splitting.
6190 @item -fdump-rtl-regclass
6191 @itemx -fdump-rtl-subregs_of_mode_init
6192 @itemx -fdump-rtl-subregs_of_mode_finish
6193 @itemx -fdump-rtl-dfinit
6194 @itemx -fdump-rtl-dfinish
6195 @opindex fdump-rtl-regclass
6196 @opindex fdump-rtl-subregs_of_mode_init
6197 @opindex fdump-rtl-subregs_of_mode_finish
6198 @opindex fdump-rtl-dfinit
6199 @opindex fdump-rtl-dfinish
6200 These dumps are defined but always produce empty files.
6202 @item -da
6203 @itemx -fdump-rtl-all
6204 @opindex da
6205 @opindex fdump-rtl-all
6206 Produce all the dumps listed above.
6208 @item -dA
6209 @opindex dA
6210 Annotate the assembler output with miscellaneous debugging information.
6212 @item -dD
6213 @opindex dD
6214 Dump all macro definitions, at the end of preprocessing, in addition to
6215 normal output.
6217 @item -dH
6218 @opindex dH
6219 Produce a core dump whenever an error occurs.
6221 @item -dp
6222 @opindex dp
6223 Annotate the assembler output with a comment indicating which
6224 pattern and alternative is used.  The length of each instruction is
6225 also printed.
6227 @item -dP
6228 @opindex dP
6229 Dump the RTL in the assembler output as a comment before each instruction.
6230 Also turns on @option{-dp} annotation.
6232 @item -dx
6233 @opindex dx
6234 Just generate RTL for a function instead of compiling it.  Usually used
6235 with @option{-fdump-rtl-expand}.
6236 @end table
6238 @item -fdump-noaddr
6239 @opindex fdump-noaddr
6240 When doing debugging dumps, suppress address output.  This makes it more
6241 feasible to use diff on debugging dumps for compiler invocations with
6242 different compiler binaries and/or different
6243 text / bss / data / heap / stack / dso start locations.
6245 @item -fdump-unnumbered
6246 @opindex fdump-unnumbered
6247 When doing debugging dumps, suppress instruction numbers and address output.
6248 This makes it more feasible to use diff on debugging dumps for compiler
6249 invocations with different options, in particular with and without
6250 @option{-g}.
6252 @item -fdump-unnumbered-links
6253 @opindex fdump-unnumbered-links
6254 When doing debugging dumps (see @option{-d} option above), suppress
6255 instruction numbers for the links to the previous and next instructions
6256 in a sequence.
6258 @item -fdump-translation-unit @r{(C++ only)}
6259 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
6260 @opindex fdump-translation-unit
6261 Dump a representation of the tree structure for the entire translation
6262 unit to a file.  The file name is made by appending @file{.tu} to the
6263 source file name, and the file is created in the same directory as the
6264 output file.  If the @samp{-@var{options}} form is used, @var{options}
6265 controls the details of the dump as described for the
6266 @option{-fdump-tree} options.
6268 @item -fdump-class-hierarchy @r{(C++ only)}
6269 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
6270 @opindex fdump-class-hierarchy
6271 Dump a representation of each class's hierarchy and virtual function
6272 table layout to a file.  The file name is made by appending
6273 @file{.class} to the source file name, and the file is created in the
6274 same directory as the output file.  If the @samp{-@var{options}} form
6275 is used, @var{options} controls the details of the dump as described
6276 for the @option{-fdump-tree} options.
6278 @item -fdump-ipa-@var{switch}
6279 @opindex fdump-ipa
6280 Control the dumping at various stages of inter-procedural analysis
6281 language tree to a file.  The file name is generated by appending a
6282 switch specific suffix to the source file name, and the file is created
6283 in the same directory as the output file.  The following dumps are
6284 possible:
6286 @table @samp
6287 @item all
6288 Enables all inter-procedural analysis dumps.
6290 @item cgraph
6291 Dumps information about call-graph optimization, unused function removal,
6292 and inlining decisions.
6294 @item inline
6295 Dump after function inlining.
6297 @end table
6299 @item -fdump-passes
6300 @opindex fdump-passes
6301 Dump the list of optimization passes that are turned on and off by
6302 the current command-line options.
6304 @item -fdump-statistics-@var{option}
6305 @opindex fdump-statistics
6306 Enable and control dumping of pass statistics in a separate file.  The
6307 file name is generated by appending a suffix ending in
6308 @samp{.statistics} to the source file name, and the file is created in
6309 the same directory as the output file.  If the @samp{-@var{option}}
6310 form is used, @samp{-stats} causes counters to be summed over the
6311 whole compilation unit while @samp{-details} dumps every event as
6312 the passes generate them.  The default with no option is to sum
6313 counters for each function compiled.
6315 @item -fdump-tree-@var{switch}
6316 @itemx -fdump-tree-@var{switch}-@var{options}
6317 @itemx -fdump-tree-@var{switch}-@var{options}=@var{filename}
6318 @opindex fdump-tree
6319 Control the dumping at various stages of processing the intermediate
6320 language tree to a file.  The file name is generated by appending a
6321 switch-specific suffix to the source file name, and the file is
6322 created in the same directory as the output file. In case of
6323 @option{=@var{filename}} option, the dump is output on the given file
6324 instead of the auto named dump files.  If the @samp{-@var{options}}
6325 form is used, @var{options} is a list of @samp{-} separated options
6326 which control the details of the dump.  Not all options are applicable
6327 to all dumps; those that are not meaningful are ignored.  The
6328 following options are available
6330 @table @samp
6331 @item address
6332 Print the address of each node.  Usually this is not meaningful as it
6333 changes according to the environment and source file.  Its primary use
6334 is for tying up a dump file with a debug environment.
6335 @item asmname
6336 If @code{DECL_ASSEMBLER_NAME} has been set for a given decl, use that
6337 in the dump instead of @code{DECL_NAME}.  Its primary use is ease of
6338 use working backward from mangled names in the assembly file.
6339 @item slim
6340 When dumping front-end intermediate representations, inhibit dumping
6341 of members of a scope or body of a function merely because that scope
6342 has been reached.  Only dump such items when they are directly reachable
6343 by some other path.
6345 When dumping pretty-printed trees, this option inhibits dumping the
6346 bodies of control structures.
6348 When dumping RTL, print the RTL in slim (condensed) form instead of
6349 the default LISP-like representation.
6350 @item raw
6351 Print a raw representation of the tree.  By default, trees are
6352 pretty-printed into a C-like representation.
6353 @item details
6354 Enable more detailed dumps (not honored by every dump option). Also
6355 include information from the optimization passes.
6356 @item stats
6357 Enable dumping various statistics about the pass (not honored by every dump
6358 option).
6359 @item blocks
6360 Enable showing basic block boundaries (disabled in raw dumps).
6361 @item graph
6362 For each of the other indicated dump files (@option{-fdump-rtl-@var{pass}}),
6363 dump a representation of the control flow graph suitable for viewing with
6364 GraphViz to @file{@var{file}.@var{passid}.@var{pass}.dot}.  Each function in
6365 the file is pretty-printed as a subgraph, so that GraphViz can render them
6366 all in a single plot.
6368 This option currently only works for RTL dumps, and the RTL is always
6369 dumped in slim form.
6370 @item vops
6371 Enable showing virtual operands for every statement.
6372 @item lineno
6373 Enable showing line numbers for statements.
6374 @item uid
6375 Enable showing the unique ID (@code{DECL_UID}) for each variable.
6376 @item verbose
6377 Enable showing the tree dump for each statement.
6378 @item eh
6379 Enable showing the EH region number holding each statement.
6380 @item scev
6381 Enable showing scalar evolution analysis details.
6382 @item optimized
6383 Enable showing optimization information (only available in certain
6384 passes).
6385 @item missed
6386 Enable showing missed optimization information (only available in certain
6387 passes).
6388 @item note
6389 Enable other detailed optimization information (only available in
6390 certain passes).
6391 @item =@var{filename}
6392 Instead of an auto named dump file, output into the given file
6393 name. The file names @file{stdout} and @file{stderr} are treated
6394 specially and are considered already open standard streams. For
6395 example,
6397 @smallexample
6398 gcc -O2 -ftree-vectorize -fdump-tree-vect-blocks=foo.dump
6399      -fdump-tree-pre=stderr file.c
6400 @end smallexample
6402 outputs vectorizer dump into @file{foo.dump}, while the PRE dump is
6403 output on to @file{stderr}. If two conflicting dump filenames are
6404 given for the same pass, then the latter option overrides the earlier
6405 one.
6407 @item all
6408 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
6409 and @option{lineno}.
6411 @item optall
6412 Turn on all optimization options, i.e., @option{optimized},
6413 @option{missed}, and @option{note}.
6414 @end table
6416 The following tree dumps are possible:
6417 @table @samp
6419 @item original
6420 @opindex fdump-tree-original
6421 Dump before any tree based optimization, to @file{@var{file}.original}.
6423 @item optimized
6424 @opindex fdump-tree-optimized
6425 Dump after all tree based optimization, to @file{@var{file}.optimized}.
6427 @item gimple
6428 @opindex fdump-tree-gimple
6429 Dump each function before and after the gimplification pass to a file.  The
6430 file name is made by appending @file{.gimple} to the source file name.
6432 @item cfg
6433 @opindex fdump-tree-cfg
6434 Dump the control flow graph of each function to a file.  The file name is
6435 made by appending @file{.cfg} to the source file name.
6437 @item ch
6438 @opindex fdump-tree-ch
6439 Dump each function after copying loop headers.  The file name is made by
6440 appending @file{.ch} to the source file name.
6442 @item ssa
6443 @opindex fdump-tree-ssa
6444 Dump SSA related information to a file.  The file name is made by appending
6445 @file{.ssa} to the source file name.
6447 @item alias
6448 @opindex fdump-tree-alias
6449 Dump aliasing information for each function.  The file name is made by
6450 appending @file{.alias} to the source file name.
6452 @item ccp
6453 @opindex fdump-tree-ccp
6454 Dump each function after CCP@.  The file name is made by appending
6455 @file{.ccp} to the source file name.
6457 @item storeccp
6458 @opindex fdump-tree-storeccp
6459 Dump each function after STORE-CCP@.  The file name is made by appending
6460 @file{.storeccp} to the source file name.
6462 @item pre
6463 @opindex fdump-tree-pre
6464 Dump trees after partial redundancy elimination.  The file name is made
6465 by appending @file{.pre} to the source file name.
6467 @item fre
6468 @opindex fdump-tree-fre
6469 Dump trees after full redundancy elimination.  The file name is made
6470 by appending @file{.fre} to the source file name.
6472 @item copyprop
6473 @opindex fdump-tree-copyprop
6474 Dump trees after copy propagation.  The file name is made
6475 by appending @file{.copyprop} to the source file name.
6477 @item store_copyprop
6478 @opindex fdump-tree-store_copyprop
6479 Dump trees after store copy-propagation.  The file name is made
6480 by appending @file{.store_copyprop} to the source file name.
6482 @item dce
6483 @opindex fdump-tree-dce
6484 Dump each function after dead code elimination.  The file name is made by
6485 appending @file{.dce} to the source file name.
6487 @item sra
6488 @opindex fdump-tree-sra
6489 Dump each function after performing scalar replacement of aggregates.  The
6490 file name is made by appending @file{.sra} to the source file name.
6492 @item sink
6493 @opindex fdump-tree-sink
6494 Dump each function after performing code sinking.  The file name is made
6495 by appending @file{.sink} to the source file name.
6497 @item dom
6498 @opindex fdump-tree-dom
6499 Dump each function after applying dominator tree optimizations.  The file
6500 name is made by appending @file{.dom} to the source file name.
6502 @item dse
6503 @opindex fdump-tree-dse
6504 Dump each function after applying dead store elimination.  The file
6505 name is made by appending @file{.dse} to the source file name.
6507 @item phiopt
6508 @opindex fdump-tree-phiopt
6509 Dump each function after optimizing PHI nodes into straightline code.  The file
6510 name is made by appending @file{.phiopt} to the source file name.
6512 @item forwprop
6513 @opindex fdump-tree-forwprop
6514 Dump each function after forward propagating single use variables.  The file
6515 name is made by appending @file{.forwprop} to the source file name.
6517 @item copyrename
6518 @opindex fdump-tree-copyrename
6519 Dump each function after applying the copy rename optimization.  The file
6520 name is made by appending @file{.copyrename} to the source file name.
6522 @item nrv
6523 @opindex fdump-tree-nrv
6524 Dump each function after applying the named return value optimization on
6525 generic trees.  The file name is made by appending @file{.nrv} to the source
6526 file name.
6528 @item vect
6529 @opindex fdump-tree-vect
6530 Dump each function after applying vectorization of loops.  The file name is
6531 made by appending @file{.vect} to the source file name.
6533 @item slp
6534 @opindex fdump-tree-slp
6535 Dump each function after applying vectorization of basic blocks.  The file name
6536 is made by appending @file{.slp} to the source file name.
6538 @item vrp
6539 @opindex fdump-tree-vrp
6540 Dump each function after Value Range Propagation (VRP).  The file name
6541 is made by appending @file{.vrp} to the source file name.
6543 @item all
6544 @opindex fdump-tree-all
6545 Enable all the available tree dumps with the flags provided in this option.
6546 @end table
6548 @item -fopt-info
6549 @itemx -fopt-info-@var{options}
6550 @itemx -fopt-info-@var{options}=@var{filename}
6551 @opindex fopt-info
6552 Controls optimization dumps from various optimization passes. If the
6553 @samp{-@var{options}} form is used, @var{options} is a list of
6554 @samp{-} separated options to select the dump details and
6555 optimizations.  If @var{options} is not specified, it defaults to
6556 @option{optimized} for details and @option{optall} for optimization
6557 groups. If the @var{filename} is not specified, it defaults to
6558 @file{stderr}. Note that the output @var{filename} will be overwritten
6559 in case of multiple translation units. If a combined output from
6560 multiple translation units is desired, @file{stderr} should be used
6561 instead.
6563 The options can be divided into two groups, 1) options describing the
6564 verbosity of the dump, and 2) options describing which optimizations
6565 should be included. The options from both the groups can be freely
6566 mixed as they are non-overlapping. However, in case of any conflicts,
6567 the latter options override the earlier options on the command
6568 line. Though multiple -fopt-info options are accepted, only one of
6569 them can have @option{=filename}. If other filenames are provided then
6570 all but the first one are ignored.
6572 The dump verbosity has the following options
6574 @table @samp
6575 @item optimized
6576 Print information when an optimization is successfully applied. It is
6577 up to a pass to decide which information is relevant. For example, the
6578 vectorizer passes print the source location of loops which got
6579 successfully vectorized.
6580 @item missed
6581 Print information about missed optimizations. Individual passes
6582 control which information to include in the output. For example,
6584 @smallexample
6585 gcc -O2 -ftree-vectorize -fopt-info-vec-missed
6586 @end smallexample
6588 will print information about missed optimization opportunities from
6589 vectorization passes on stderr.
6590 @item note
6591 Print verbose information about optimizations, such as certain
6592 transformations, more detailed messages about decisions etc.
6593 @item all
6594 Print detailed optimization information. This includes
6595 @var{optimized}, @var{missed}, and @var{note}.
6596 @end table
6598 The second set of options describes a group of optimizations and may
6599 include one or more of the following.
6601 @table @samp
6602 @item ipa
6603 Enable dumps from all interprocedural optimizations.
6604 @item loop
6605 Enable dumps from all loop optimizations.
6606 @item inline
6607 Enable dumps from all inlining optimizations.
6608 @item vec
6609 Enable dumps from all vectorization optimizations.
6610 @item optall
6611 Enable dumps from all optimizations. This is a superset of
6612 the optimization groups listed above.
6613 @end table
6615 For example,
6616 @smallexample
6617 gcc -O3 -fopt-info-missed=missed.all
6618 @end smallexample
6620 outputs missed optimization report from all the passes into
6621 @file{missed.all}.
6623 As another example,
6624 @smallexample
6625 gcc -O3 -fopt-info-inline-optimized-missed=inline.txt
6626 @end smallexample
6628 will output information about missed optimizations as well as
6629 optimized locations from all the inlining passes into
6630 @file{inline.txt}.
6632 If the @var{filename} is provided, then the dumps from all the
6633 applicable optimizations are concatenated into the @file{filename}.
6634 Otherwise the dump is output onto @file{stderr}. If @var{options} is
6635 omitted, it defaults to @option{all-optall}, which means dump all
6636 available optimization info from all the passes. In the following
6637 example, all optimization info is output on to @file{stderr}.
6639 @smallexample
6640 gcc -O3 -fopt-info
6641 @end smallexample
6643 Note that @option{-fopt-info-vec-missed} behaves the same as
6644 @option{-fopt-info-missed-vec}.
6646 As another example, consider
6648 @smallexample
6649 gcc -fopt-info-vec-missed=vec.miss -fopt-info-loop-optimized=loop.opt
6650 @end smallexample
6652 Here the two output filenames @file{vec.miss} and @file{loop.opt} are
6653 in conflict since only one output file is allowed. In this case, only
6654 the first option takes effect and the subsequent options are
6655 ignored. Thus only the @file{vec.miss} is produced which contains
6656 dumps from the vectorizer about missed opportunities.
6658 @item -frandom-seed=@var{string}
6659 @opindex frandom-seed
6660 This option provides a seed that GCC uses in place of
6661 random numbers in generating certain symbol names
6662 that have to be different in every compiled file.  It is also used to
6663 place unique stamps in coverage data files and the object files that
6664 produce them.  You can use the @option{-frandom-seed} option to produce
6665 reproducibly identical object files.
6667 The @var{string} should be different for every file you compile.
6669 @item -fsched-verbose=@var{n}
6670 @opindex fsched-verbose
6671 On targets that use instruction scheduling, this option controls the
6672 amount of debugging output the scheduler prints.  This information is
6673 written to standard error, unless @option{-fdump-rtl-sched1} or
6674 @option{-fdump-rtl-sched2} is specified, in which case it is output
6675 to the usual dump listing file, @file{.sched1} or @file{.sched2}
6676 respectively.  However for @var{n} greater than nine, the output is
6677 always printed to standard error.
6679 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
6680 same information as @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2}.
6681 For @var{n} greater than one, it also output basic block probabilities,
6682 detailed ready list information and unit/insn info.  For @var{n} greater
6683 than two, it includes RTL at abort point, control-flow and regions info.
6684 And for @var{n} over four, @option{-fsched-verbose} also includes
6685 dependence info.
6687 @item -save-temps
6688 @itemx -save-temps=cwd
6689 @opindex save-temps
6690 Store the usual ``temporary'' intermediate files permanently; place them
6691 in the current directory and name them based on the source file.  Thus,
6692 compiling @file{foo.c} with @option{-c -save-temps} produces files
6693 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
6694 preprocessed @file{foo.i} output file even though the compiler now
6695 normally uses an integrated preprocessor.
6697 When used in combination with the @option{-x} command-line option,
6698 @option{-save-temps} is sensible enough to avoid over writing an
6699 input source file with the same extension as an intermediate file.
6700 The corresponding intermediate file may be obtained by renaming the
6701 source file before using @option{-save-temps}.
6703 If you invoke GCC in parallel, compiling several different source
6704 files that share a common base name in different subdirectories or the
6705 same source file compiled for multiple output destinations, it is
6706 likely that the different parallel compilers will interfere with each
6707 other, and overwrite the temporary files.  For instance:
6709 @smallexample
6710 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
6711 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
6712 @end smallexample
6714 may result in @file{foo.i} and @file{foo.o} being written to
6715 simultaneously by both compilers.
6717 @item -save-temps=obj
6718 @opindex save-temps=obj
6719 Store the usual ``temporary'' intermediate files permanently.  If the
6720 @option{-o} option is used, the temporary files are based on the
6721 object file.  If the @option{-o} option is not used, the
6722 @option{-save-temps=obj} switch behaves like @option{-save-temps}.
6724 For example:
6726 @smallexample
6727 gcc -save-temps=obj -c foo.c
6728 gcc -save-temps=obj -c bar.c -o dir/xbar.o
6729 gcc -save-temps=obj foobar.c -o dir2/yfoobar
6730 @end smallexample
6732 @noindent
6733 creates @file{foo.i}, @file{foo.s}, @file{dir/xbar.i},
6734 @file{dir/xbar.s}, @file{dir2/yfoobar.i}, @file{dir2/yfoobar.s}, and
6735 @file{dir2/yfoobar.o}.
6737 @item -time@r{[}=@var{file}@r{]}
6738 @opindex time
6739 Report the CPU time taken by each subprocess in the compilation
6740 sequence.  For C source files, this is the compiler proper and assembler
6741 (plus the linker if linking is done).
6743 Without the specification of an output file, the output looks like this:
6745 @smallexample
6746 # cc1 0.12 0.01
6747 # as 0.00 0.01
6748 @end smallexample
6750 The first number on each line is the ``user time'', that is time spent
6751 executing the program itself.  The second number is ``system time'',
6752 time spent executing operating system routines on behalf of the program.
6753 Both numbers are in seconds.
6755 With the specification of an output file, the output is appended to the
6756 named file, and it looks like this:
6758 @smallexample
6759 0.12 0.01 cc1 @var{options}
6760 0.00 0.01 as @var{options}
6761 @end smallexample
6763 The ``user time'' and the ``system time'' are moved before the program
6764 name, and the options passed to the program are displayed, so that one
6765 can later tell what file was being compiled, and with which options.
6767 @item -fvar-tracking
6768 @opindex fvar-tracking
6769 Run variable tracking pass.  It computes where variables are stored at each
6770 position in code.  Better debugging information is then generated
6771 (if the debugging information format supports this information).
6773 It is enabled by default when compiling with optimization (@option{-Os},
6774 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
6775 the debug info format supports it.
6777 @item -fvar-tracking-assignments
6778 @opindex fvar-tracking-assignments
6779 @opindex fno-var-tracking-assignments
6780 Annotate assignments to user variables early in the compilation and
6781 attempt to carry the annotations over throughout the compilation all the
6782 way to the end, in an attempt to improve debug information while
6783 optimizing.  Use of @option{-gdwarf-4} is recommended along with it.
6785 It can be enabled even if var-tracking is disabled, in which case
6786 annotations are created and maintained, but discarded at the end.
6788 @item -fvar-tracking-assignments-toggle
6789 @opindex fvar-tracking-assignments-toggle
6790 @opindex fno-var-tracking-assignments-toggle
6791 Toggle @option{-fvar-tracking-assignments}, in the same way that
6792 @option{-gtoggle} toggles @option{-g}.
6794 @item -print-file-name=@var{library}
6795 @opindex print-file-name
6796 Print the full absolute name of the library file @var{library} that
6797 would be used when linking---and don't do anything else.  With this
6798 option, GCC does not compile or link anything; it just prints the
6799 file name.
6801 @item -print-multi-directory
6802 @opindex print-multi-directory
6803 Print the directory name corresponding to the multilib selected by any
6804 other switches present in the command line.  This directory is supposed
6805 to exist in @env{GCC_EXEC_PREFIX}.
6807 @item -print-multi-lib
6808 @opindex print-multi-lib
6809 Print the mapping from multilib directory names to compiler switches
6810 that enable them.  The directory name is separated from the switches by
6811 @samp{;}, and each switch starts with an @samp{@@} instead of the
6812 @samp{-}, without spaces between multiple switches.  This is supposed to
6813 ease shell processing.
6815 @item -print-multi-os-directory
6816 @opindex print-multi-os-directory
6817 Print the path to OS libraries for the selected
6818 multilib, relative to some @file{lib} subdirectory.  If OS libraries are
6819 present in the @file{lib} subdirectory and no multilibs are used, this is
6820 usually just @file{.}, if OS libraries are present in @file{lib@var{suffix}}
6821 sibling directories this prints e.g.@: @file{../lib64}, @file{../lib} or
6822 @file{../lib32}, or if OS libraries are present in @file{lib/@var{subdir}}
6823 subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}.
6825 @item -print-multiarch
6826 @opindex print-multiarch
6827 Print the path to OS libraries for the selected multiarch,
6828 relative to some @file{lib} subdirectory.
6830 @item -print-prog-name=@var{program}
6831 @opindex print-prog-name
6832 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
6834 @item -print-libgcc-file-name
6835 @opindex print-libgcc-file-name
6836 Same as @option{-print-file-name=libgcc.a}.
6838 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
6839 but you do want to link with @file{libgcc.a}.  You can do:
6841 @smallexample
6842 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
6843 @end smallexample
6845 @item -print-search-dirs
6846 @opindex print-search-dirs
6847 Print the name of the configured installation directory and a list of
6848 program and library directories @command{gcc} searches---and don't do anything else.
6850 This is useful when @command{gcc} prints the error message
6851 @samp{installation problem, cannot exec cpp0: No such file or directory}.
6852 To resolve this you either need to put @file{cpp0} and the other compiler
6853 components where @command{gcc} expects to find them, or you can set the environment
6854 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
6855 Don't forget the trailing @samp{/}.
6856 @xref{Environment Variables}.
6858 @item -print-sysroot
6859 @opindex print-sysroot
6860 Print the target sysroot directory that is used during
6861 compilation.  This is the target sysroot specified either at configure
6862 time or using the @option{--sysroot} option, possibly with an extra
6863 suffix that depends on compilation options.  If no target sysroot is
6864 specified, the option prints nothing.
6866 @item -print-sysroot-headers-suffix
6867 @opindex print-sysroot-headers-suffix
6868 Print the suffix added to the target sysroot when searching for
6869 headers, or give an error if the compiler is not configured with such
6870 a suffix---and don't do anything else.
6872 @item -dumpmachine
6873 @opindex dumpmachine
6874 Print the compiler's target machine (for example,
6875 @samp{i686-pc-linux-gnu})---and don't do anything else.
6877 @item -dumpversion
6878 @opindex dumpversion
6879 Print the compiler version (for example, @samp{3.0})---and don't do
6880 anything else.
6882 @item -dumpspecs
6883 @opindex dumpspecs
6884 Print the compiler's built-in specs---and don't do anything else.  (This
6885 is used when GCC itself is being built.)  @xref{Spec Files}.
6887 @item -fno-eliminate-unused-debug-types
6888 @opindex feliminate-unused-debug-types
6889 @opindex fno-eliminate-unused-debug-types
6890 Normally, when producing DWARF 2 output, GCC avoids producing debug symbol 
6891 output for types that are nowhere used in the source file being compiled.
6892 Sometimes it is useful to have GCC emit debugging
6893 information for all types declared in a compilation
6894 unit, regardless of whether or not they are actually used
6895 in that compilation unit, for example 
6896 if, in the debugger, you want to cast a value to a type that is
6897 not actually used in your program (but is declared).  More often,
6898 however, this results in a significant amount of wasted space.
6899 @end table
6901 @node Optimize Options
6902 @section Options That Control Optimization
6903 @cindex optimize options
6904 @cindex options, optimization
6906 These options control various sorts of optimizations.
6908 Without any optimization option, the compiler's goal is to reduce the
6909 cost of compilation and to make debugging produce the expected
6910 results.  Statements are independent: if you stop the program with a
6911 breakpoint between statements, you can then assign a new value to any
6912 variable or change the program counter to any other statement in the
6913 function and get exactly the results you expect from the source
6914 code.
6916 Turning on optimization flags makes the compiler attempt to improve
6917 the performance and/or code size at the expense of compilation time
6918 and possibly the ability to debug the program.
6920 The compiler performs optimization based on the knowledge it has of the
6921 program.  Compiling multiple files at once to a single output file mode allows
6922 the compiler to use information gained from all of the files when compiling
6923 each of them.
6925 Not all optimizations are controlled directly by a flag.  Only
6926 optimizations that have a flag are listed in this section.
6928 Most optimizations are only enabled if an @option{-O} level is set on
6929 the command line.  Otherwise they are disabled, even if individual
6930 optimization flags are specified.
6932 Depending on the target and how GCC was configured, a slightly different
6933 set of optimizations may be enabled at each @option{-O} level than
6934 those listed here.  You can invoke GCC with @option{-Q --help=optimizers}
6935 to find out the exact set of optimizations that are enabled at each level.
6936 @xref{Overall Options}, for examples.
6938 @table @gcctabopt
6939 @item -O
6940 @itemx -O1
6941 @opindex O
6942 @opindex O1
6943 Optimize.  Optimizing compilation takes somewhat more time, and a lot
6944 more memory for a large function.
6946 With @option{-O}, the compiler tries to reduce code size and execution
6947 time, without performing any optimizations that take a great deal of
6948 compilation time.
6950 @option{-O} turns on the following optimization flags:
6951 @gccoptlist{
6952 -fauto-inc-dec @gol
6953 -fcompare-elim @gol
6954 -fcprop-registers @gol
6955 -fdce @gol
6956 -fdefer-pop @gol
6957 -fdelayed-branch @gol
6958 -fdse @gol
6959 -fguess-branch-probability @gol
6960 -fif-conversion2 @gol
6961 -fif-conversion @gol
6962 -fipa-pure-const @gol
6963 -fipa-profile @gol
6964 -fipa-reference @gol
6965 -fmerge-constants
6966 -fsplit-wide-types @gol
6967 -ftree-bit-ccp @gol
6968 -ftree-builtin-call-dce @gol
6969 -ftree-ccp @gol
6970 -fssa-phiopt @gol
6971 -ftree-ch @gol
6972 -ftree-copyrename @gol
6973 -ftree-dce @gol
6974 -ftree-dominator-opts @gol
6975 -ftree-dse @gol
6976 -ftree-forwprop @gol
6977 -ftree-fre @gol
6978 -ftree-phiprop @gol
6979 -ftree-slsr @gol
6980 -ftree-sra @gol
6981 -ftree-pta @gol
6982 -ftree-ter @gol
6983 -funit-at-a-time}
6985 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
6986 where doing so does not interfere with debugging.
6988 @item -O2
6989 @opindex O2
6990 Optimize even more.  GCC performs nearly all supported optimizations
6991 that do not involve a space-speed tradeoff.
6992 As compared to @option{-O}, this option increases both compilation time
6993 and the performance of the generated code.
6995 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
6996 also turns on the following optimization flags:
6997 @gccoptlist{-fthread-jumps @gol
6998 -falign-functions  -falign-jumps @gol
6999 -falign-loops  -falign-labels @gol
7000 -fcaller-saves @gol
7001 -fcrossjumping @gol
7002 -fcse-follow-jumps  -fcse-skip-blocks @gol
7003 -fdelete-null-pointer-checks @gol
7004 -fdevirtualize -fdevirtualize-speculatively @gol
7005 -fexpensive-optimizations @gol
7006 -fgcse  -fgcse-lm  @gol
7007 -fhoist-adjacent-loads @gol
7008 -finline-small-functions @gol
7009 -findirect-inlining @gol
7010 -fipa-sra @gol
7011 -fisolate-erroneous-paths-dereference @gol
7012 -foptimize-sibling-calls @gol
7013 -fpartial-inlining @gol
7014 -fpeephole2 @gol
7015 -freorder-blocks  -freorder-functions @gol
7016 -frerun-cse-after-loop  @gol
7017 -fsched-interblock  -fsched-spec @gol
7018 -fschedule-insns  -fschedule-insns2 @gol
7019 -fstrict-aliasing -fstrict-overflow @gol
7020 -ftree-switch-conversion -ftree-tail-merge @gol
7021 -ftree-pre @gol
7022 -ftree-vrp}
7024 Please note the warning under @option{-fgcse} about
7025 invoking @option{-O2} on programs that use computed gotos.
7027 @item -O3
7028 @opindex O3
7029 Optimize yet more.  @option{-O3} turns on all optimizations specified
7030 by @option{-O2} and also turns on the @option{-finline-functions},
7031 @option{-funswitch-loops}, @option{-fpredictive-commoning},
7032 @option{-fgcse-after-reload}, @option{-ftree-loop-vectorize},
7033 @option{-ftree-loop-distribute-patterns},
7034 @option{-ftree-slp-vectorize}, @option{-fvect-cost-model},
7035 @option{-ftree-partial-pre} and @option{-fipa-cp-clone} options.
7037 @item -O0
7038 @opindex O0
7039 Reduce compilation time and make debugging produce the expected
7040 results.  This is the default.
7042 @item -Os
7043 @opindex Os
7044 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
7045 do not typically increase code size.  It also performs further
7046 optimizations designed to reduce code size.
7048 @option{-Os} disables the following optimization flags:
7049 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
7050 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
7051 -fprefetch-loop-arrays}
7053 @item -Ofast
7054 @opindex Ofast
7055 Disregard strict standards compliance.  @option{-Ofast} enables all
7056 @option{-O3} optimizations.  It also enables optimizations that are not
7057 valid for all standard-compliant programs.
7058 It turns on @option{-ffast-math} and the Fortran-specific
7059 @option{-fno-protect-parens} and @option{-fstack-arrays}.
7061 @item -Og
7062 @opindex Og
7063 Optimize debugging experience.  @option{-Og} enables optimizations
7064 that do not interfere with debugging. It should be the optimization
7065 level of choice for the standard edit-compile-debug cycle, offering
7066 a reasonable level of optimization while maintaining fast compilation
7067 and a good debugging experience.
7069 If you use multiple @option{-O} options, with or without level numbers,
7070 the last such option is the one that is effective.
7071 @end table
7073 Options of the form @option{-f@var{flag}} specify machine-independent
7074 flags.  Most flags have both positive and negative forms; the negative
7075 form of @option{-ffoo} is @option{-fno-foo}.  In the table
7076 below, only one of the forms is listed---the one you typically 
7077 use.  You can figure out the other form by either removing @samp{no-}
7078 or adding it.
7080 The following options control specific optimizations.  They are either
7081 activated by @option{-O} options or are related to ones that are.  You
7082 can use the following flags in the rare cases when ``fine-tuning'' of
7083 optimizations to be performed is desired.
7085 @table @gcctabopt
7086 @item -fno-defer-pop
7087 @opindex fno-defer-pop
7088 Always pop the arguments to each function call as soon as that function
7089 returns.  For machines that must pop arguments after a function call,
7090 the compiler normally lets arguments accumulate on the stack for several
7091 function calls and pops them all at once.
7093 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7095 @item -fforward-propagate
7096 @opindex fforward-propagate
7097 Perform a forward propagation pass on RTL@.  The pass tries to combine two
7098 instructions and checks if the result can be simplified.  If loop unrolling
7099 is active, two passes are performed and the second is scheduled after
7100 loop unrolling.
7102 This option is enabled by default at optimization levels @option{-O},
7103 @option{-O2}, @option{-O3}, @option{-Os}.
7105 @item -ffp-contract=@var{style}
7106 @opindex ffp-contract
7107 @option{-ffp-contract=off} disables floating-point expression contraction.
7108 @option{-ffp-contract=fast} enables floating-point expression contraction
7109 such as forming of fused multiply-add operations if the target has
7110 native support for them.
7111 @option{-ffp-contract=on} enables floating-point expression contraction
7112 if allowed by the language standard.  This is currently not implemented
7113 and treated equal to @option{-ffp-contract=off}.
7115 The default is @option{-ffp-contract=fast}.
7117 @item -fomit-frame-pointer
7118 @opindex fomit-frame-pointer
7119 Don't keep the frame pointer in a register for functions that
7120 don't need one.  This avoids the instructions to save, set up and
7121 restore frame pointers; it also makes an extra register available
7122 in many functions.  @strong{It also makes debugging impossible on
7123 some machines.}
7125 On some machines, such as the VAX, this flag has no effect, because
7126 the standard calling sequence automatically handles the frame pointer
7127 and nothing is saved by pretending it doesn't exist.  The
7128 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
7129 whether a target machine supports this flag.  @xref{Registers,,Register
7130 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
7132 Starting with GCC version 4.6, the default setting (when not optimizing for
7133 size) for 32-bit GNU/Linux x86 and 32-bit Darwin x86 targets has been changed to
7134 @option{-fomit-frame-pointer}.  The default can be reverted to
7135 @option{-fno-omit-frame-pointer} by configuring GCC with the
7136 @option{--enable-frame-pointer} configure option.
7138 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7140 @item -foptimize-sibling-calls
7141 @opindex foptimize-sibling-calls
7142 Optimize sibling and tail recursive calls.
7144 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7146 @item -fno-inline
7147 @opindex fno-inline
7148 Do not expand any functions inline apart from those marked with
7149 the @code{always_inline} attribute.  This is the default when not
7150 optimizing.
7152 Single functions can be exempted from inlining by marking them
7153 with the @code{noinline} attribute.
7155 @item -finline-small-functions
7156 @opindex finline-small-functions
7157 Integrate functions into their callers when their body is smaller than expected
7158 function call code (so overall size of program gets smaller).  The compiler
7159 heuristically decides which functions are simple enough to be worth integrating
7160 in this way.  This inlining applies to all functions, even those not declared
7161 inline.
7163 Enabled at level @option{-O2}.
7165 @item -findirect-inlining
7166 @opindex findirect-inlining
7167 Inline also indirect calls that are discovered to be known at compile
7168 time thanks to previous inlining.  This option has any effect only
7169 when inlining itself is turned on by the @option{-finline-functions}
7170 or @option{-finline-small-functions} options.
7172 Enabled at level @option{-O2}.
7174 @item -finline-functions
7175 @opindex finline-functions
7176 Consider all functions for inlining, even if they are not declared inline.
7177 The compiler heuristically decides which functions are worth integrating
7178 in this way.
7180 If all calls to a given function are integrated, and the function is
7181 declared @code{static}, then the function is normally not output as
7182 assembler code in its own right.
7184 Enabled at level @option{-O3}.
7186 @item -finline-functions-called-once
7187 @opindex finline-functions-called-once
7188 Consider all @code{static} functions called once for inlining into their
7189 caller even if they are not marked @code{inline}.  If a call to a given
7190 function is integrated, then the function is not output as assembler code
7191 in its own right.
7193 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
7195 @item -fearly-inlining
7196 @opindex fearly-inlining
7197 Inline functions marked by @code{always_inline} and functions whose body seems
7198 smaller than the function call overhead early before doing
7199 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
7200 makes profiling significantly cheaper and usually inlining faster on programs
7201 having large chains of nested wrapper functions.
7203 Enabled by default.
7205 @item -fipa-sra
7206 @opindex fipa-sra
7207 Perform interprocedural scalar replacement of aggregates, removal of
7208 unused parameters and replacement of parameters passed by reference
7209 by parameters passed by value.
7211 Enabled at levels @option{-O2}, @option{-O3} and @option{-Os}.
7213 @item -finline-limit=@var{n}
7214 @opindex finline-limit
7215 By default, GCC limits the size of functions that can be inlined.  This flag
7216 allows coarse control of this limit.  @var{n} is the size of functions that
7217 can be inlined in number of pseudo instructions.
7219 Inlining is actually controlled by a number of parameters, which may be
7220 specified individually by using @option{--param @var{name}=@var{value}}.
7221 The @option{-finline-limit=@var{n}} option sets some of these parameters
7222 as follows:
7224 @table @gcctabopt
7225 @item max-inline-insns-single
7226 is set to @var{n}/2.
7227 @item max-inline-insns-auto
7228 is set to @var{n}/2.
7229 @end table
7231 See below for a documentation of the individual
7232 parameters controlling inlining and for the defaults of these parameters.
7234 @emph{Note:} there may be no value to @option{-finline-limit} that results
7235 in default behavior.
7237 @emph{Note:} pseudo instruction represents, in this particular context, an
7238 abstract measurement of function's size.  In no way does it represent a count
7239 of assembly instructions and as such its exact meaning might change from one
7240 release to an another.
7242 @item -fno-keep-inline-dllexport
7243 @opindex -fno-keep-inline-dllexport
7244 This is a more fine-grained version of @option{-fkeep-inline-functions},
7245 which applies only to functions that are declared using the @code{dllexport}
7246 attribute or declspec (@xref{Function Attributes,,Declaring Attributes of
7247 Functions}.)
7249 @item -fkeep-inline-functions
7250 @opindex fkeep-inline-functions
7251 In C, emit @code{static} functions that are declared @code{inline}
7252 into the object file, even if the function has been inlined into all
7253 of its callers.  This switch does not affect functions using the
7254 @code{extern inline} extension in GNU C90@.  In C++, emit any and all
7255 inline functions into the object file.
7257 @item -fkeep-static-consts
7258 @opindex fkeep-static-consts
7259 Emit variables declared @code{static const} when optimization isn't turned
7260 on, even if the variables aren't referenced.
7262 GCC enables this option by default.  If you want to force the compiler to
7263 check if a variable is referenced, regardless of whether or not
7264 optimization is turned on, use the @option{-fno-keep-static-consts} option.
7266 @item -fmerge-constants
7267 @opindex fmerge-constants
7268 Attempt to merge identical constants (string constants and floating-point
7269 constants) across compilation units.
7271 This option is the default for optimized compilation if the assembler and
7272 linker support it.  Use @option{-fno-merge-constants} to inhibit this
7273 behavior.
7275 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7277 @item -fmerge-all-constants
7278 @opindex fmerge-all-constants
7279 Attempt to merge identical constants and identical variables.
7281 This option implies @option{-fmerge-constants}.  In addition to
7282 @option{-fmerge-constants} this considers e.g.@: even constant initialized
7283 arrays or initialized constant variables with integral or floating-point
7284 types.  Languages like C or C++ require each variable, including multiple
7285 instances of the same variable in recursive calls, to have distinct locations,
7286 so using this option results in non-conforming
7287 behavior.
7289 @item -fmodulo-sched
7290 @opindex fmodulo-sched
7291 Perform swing modulo scheduling immediately before the first scheduling
7292 pass.  This pass looks at innermost loops and reorders their
7293 instructions by overlapping different iterations.
7295 @item -fmodulo-sched-allow-regmoves
7296 @opindex fmodulo-sched-allow-regmoves
7297 Perform more aggressive SMS-based modulo scheduling with register moves
7298 allowed.  By setting this flag certain anti-dependences edges are
7299 deleted, which triggers the generation of reg-moves based on the
7300 life-range analysis.  This option is effective only with
7301 @option{-fmodulo-sched} enabled.
7303 @item -fno-branch-count-reg
7304 @opindex fno-branch-count-reg
7305 Do not use ``decrement and branch'' instructions on a count register,
7306 but instead generate a sequence of instructions that decrement a
7307 register, compare it against zero, then branch based upon the result.
7308 This option is only meaningful on architectures that support such
7309 instructions, which include x86, PowerPC, IA-64 and S/390.
7311 The default is @option{-fbranch-count-reg}.
7313 @item -fno-function-cse
7314 @opindex fno-function-cse
7315 Do not put function addresses in registers; make each instruction that
7316 calls a constant function contain the function's address explicitly.
7318 This option results in less efficient code, but some strange hacks
7319 that alter the assembler output may be confused by the optimizations
7320 performed when this option is not used.
7322 The default is @option{-ffunction-cse}
7324 @item -fno-zero-initialized-in-bss
7325 @opindex fno-zero-initialized-in-bss
7326 If the target supports a BSS section, GCC by default puts variables that
7327 are initialized to zero into BSS@.  This can save space in the resulting
7328 code.
7330 This option turns off this behavior because some programs explicitly
7331 rely on variables going to the data section---e.g., so that the
7332 resulting executable can find the beginning of that section and/or make
7333 assumptions based on that.
7335 The default is @option{-fzero-initialized-in-bss}.
7337 @item -fthread-jumps
7338 @opindex fthread-jumps
7339 Perform optimizations that check to see if a jump branches to a
7340 location where another comparison subsumed by the first is found.  If
7341 so, the first branch is redirected to either the destination of the
7342 second branch or a point immediately following it, depending on whether
7343 the condition is known to be true or false.
7345 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7347 @item -fsplit-wide-types
7348 @opindex fsplit-wide-types
7349 When using a type that occupies multiple registers, such as @code{long
7350 long} on a 32-bit system, split the registers apart and allocate them
7351 independently.  This normally generates better code for those types,
7352 but may make debugging more difficult.
7354 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
7355 @option{-Os}.
7357 @item -fcse-follow-jumps
7358 @opindex fcse-follow-jumps
7359 In common subexpression elimination (CSE), scan through jump instructions
7360 when the target of the jump is not reached by any other path.  For
7361 example, when CSE encounters an @code{if} statement with an
7362 @code{else} clause, CSE follows the jump when the condition
7363 tested is false.
7365 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7367 @item -fcse-skip-blocks
7368 @opindex fcse-skip-blocks
7369 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
7370 follow jumps that conditionally skip over blocks.  When CSE
7371 encounters a simple @code{if} statement with no else clause,
7372 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
7373 body of the @code{if}.
7375 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7377 @item -frerun-cse-after-loop
7378 @opindex frerun-cse-after-loop
7379 Re-run common subexpression elimination after loop optimizations are
7380 performed.
7382 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7384 @item -fgcse
7385 @opindex fgcse
7386 Perform a global common subexpression elimination pass.
7387 This pass also performs global constant and copy propagation.
7389 @emph{Note:} When compiling a program using computed gotos, a GCC
7390 extension, you may get better run-time performance if you disable
7391 the global common subexpression elimination pass by adding
7392 @option{-fno-gcse} to the command line.
7394 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7396 @item -fgcse-lm
7397 @opindex fgcse-lm
7398 When @option{-fgcse-lm} is enabled, global common subexpression elimination
7399 attempts to move loads that are only killed by stores into themselves.  This
7400 allows a loop containing a load/store sequence to be changed to a load outside
7401 the loop, and a copy/store within the loop.
7403 Enabled by default when @option{-fgcse} is enabled.
7405 @item -fgcse-sm
7406 @opindex fgcse-sm
7407 When @option{-fgcse-sm} is enabled, a store motion pass is run after
7408 global common subexpression elimination.  This pass attempts to move
7409 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
7410 loops containing a load/store sequence can be changed to a load before
7411 the loop and a store after the loop.
7413 Not enabled at any optimization level.
7415 @item -fgcse-las
7416 @opindex fgcse-las
7417 When @option{-fgcse-las} is enabled, the global common subexpression
7418 elimination pass eliminates redundant loads that come after stores to the
7419 same memory location (both partial and full redundancies).
7421 Not enabled at any optimization level.
7423 @item -fgcse-after-reload
7424 @opindex fgcse-after-reload
7425 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
7426 pass is performed after reload.  The purpose of this pass is to clean up
7427 redundant spilling.
7429 @item -faggressive-loop-optimizations
7430 @opindex faggressive-loop-optimizations
7431 This option tells the loop optimizer to use language constraints to
7432 derive bounds for the number of iterations of a loop.  This assumes that
7433 loop code does not invoke undefined behavior by for example causing signed
7434 integer overflows or out-of-bound array accesses.  The bounds for the
7435 number of iterations of a loop are used to guide loop unrolling and peeling
7436 and loop exit test optimizations.
7437 This option is enabled by default.
7439 @item -funsafe-loop-optimizations
7440 @opindex funsafe-loop-optimizations
7441 This option tells the loop optimizer to assume that loop indices do not
7442 overflow, and that loops with nontrivial exit condition are not
7443 infinite.  This enables a wider range of loop optimizations even if
7444 the loop optimizer itself cannot prove that these assumptions are valid.
7445 If you use @option{-Wunsafe-loop-optimizations}, the compiler warns you
7446 if it finds this kind of loop.
7448 @item -fcrossjumping
7449 @opindex fcrossjumping
7450 Perform cross-jumping transformation.
7451 This transformation unifies equivalent code and saves code size.  The
7452 resulting code may or may not perform better than without cross-jumping.
7454 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7456 @item -fauto-inc-dec
7457 @opindex fauto-inc-dec
7458 Combine increments or decrements of addresses with memory accesses.
7459 This pass is always skipped on architectures that do not have
7460 instructions to support this.  Enabled by default at @option{-O} and
7461 higher on architectures that support this.
7463 @item -fdce
7464 @opindex fdce
7465 Perform dead code elimination (DCE) on RTL@.
7466 Enabled by default at @option{-O} and higher.
7468 @item -fdse
7469 @opindex fdse
7470 Perform dead store elimination (DSE) on RTL@.
7471 Enabled by default at @option{-O} and higher.
7473 @item -fif-conversion
7474 @opindex fif-conversion
7475 Attempt to transform conditional jumps into branch-less equivalents.  This
7476 includes use of conditional moves, min, max, set flags and abs instructions, and
7477 some tricks doable by standard arithmetics.  The use of conditional execution
7478 on chips where it is available is controlled by @code{if-conversion2}.
7480 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7482 @item -fif-conversion2
7483 @opindex fif-conversion2
7484 Use conditional execution (where available) to transform conditional jumps into
7485 branch-less equivalents.
7487 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7489 @item -fdeclone-ctor-dtor
7490 @opindex fdeclone-ctor-dtor
7491 The C++ ABI requires multiple entry points for constructors and
7492 destructors: one for a base subobject, one for a complete object, and
7493 one for a virtual destructor that calls operator delete afterwards.
7494 For a hierarchy with virtual bases, the base and complete variants are
7495 clones, which means two copies of the function.  With this option, the
7496 base and complete variants are changed to be thunks that call a common
7497 implementation.
7499 Enabled by @option{-Os}.
7501 @item -fdelete-null-pointer-checks
7502 @opindex fdelete-null-pointer-checks
7503 Assume that programs cannot safely dereference null pointers, and that
7504 no code or data element resides there.  This enables simple constant
7505 folding optimizations at all optimization levels.  In addition, other
7506 optimization passes in GCC use this flag to control global dataflow
7507 analyses that eliminate useless checks for null pointers; these assume
7508 that if a pointer is checked after it has already been dereferenced,
7509 it cannot be null.
7511 Note however that in some environments this assumption is not true.
7512 Use @option{-fno-delete-null-pointer-checks} to disable this optimization
7513 for programs that depend on that behavior.
7515 Some targets, especially embedded ones, disable this option at all levels.
7516 Otherwise it is enabled at all levels: @option{-O0}, @option{-O1},
7517 @option{-O2}, @option{-O3}, @option{-Os}.  Passes that use the information
7518 are enabled independently at different optimization levels.
7520 @item -fdevirtualize
7521 @opindex fdevirtualize
7522 Attempt to convert calls to virtual functions to direct calls.  This
7523 is done both within a procedure and interprocedurally as part of
7524 indirect inlining (@code{-findirect-inlining}) and interprocedural constant
7525 propagation (@option{-fipa-cp}).
7526 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7528 @item -fdevirtualize-speculatively
7529 @opindex fdevirtualize-speculatively
7530 Attempt to convert calls to virtual functions to speculative direct calls.
7531 Based on the analysis of the type inheritance graph, determine for a given call
7532 the set of likely targets. If the set is small, preferably of size 1, change
7533 the call into an conditional deciding on direct and indirect call.  The
7534 speculative calls enable more optimizations, such as inlining.  When they seem
7535 useless after further optimization, they are converted back into original form.
7537 @item -fexpensive-optimizations
7538 @opindex fexpensive-optimizations
7539 Perform a number of minor optimizations that are relatively expensive.
7541 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7543 @item -free
7544 @opindex free
7545 Attempt to remove redundant extension instructions.  This is especially
7546 helpful for the x86-64 architecture, which implicitly zero-extends in 64-bit
7547 registers after writing to their lower 32-bit half.
7549 Enabled for Alpha, AArch64 and x86 at levels @option{-O2},
7550 @option{-O3}, @option{-Os}.
7552 @item -flive-range-shrinkage
7553 @opindex flive-range-shrinkage
7554 Attempt to decrease register pressure through register live range
7555 shrinkage.  This is helpful for fast processors with small or moderate
7556 size register sets.
7558 @item -fira-algorithm=@var{algorithm}
7559 Use the specified coloring algorithm for the integrated register
7560 allocator.  The @var{algorithm} argument can be @samp{priority}, which
7561 specifies Chow's priority coloring, or @samp{CB}, which specifies
7562 Chaitin-Briggs coloring.  Chaitin-Briggs coloring is not implemented
7563 for all architectures, but for those targets that do support it, it is
7564 the default because it generates better code.
7566 @item -fira-region=@var{region}
7567 Use specified regions for the integrated register allocator.  The
7568 @var{region} argument should be one of the following:
7570 @table @samp
7572 @item all
7573 Use all loops as register allocation regions.
7574 This can give the best results for machines with a small and/or
7575 irregular register set.
7577 @item mixed
7578 Use all loops except for loops with small register pressure 
7579 as the regions.  This value usually gives
7580 the best results in most cases and for most architectures,
7581 and is enabled by default when compiling with optimization for speed
7582 (@option{-O}, @option{-O2}, @dots{}).
7584 @item one
7585 Use all functions as a single region.  
7586 This typically results in the smallest code size, and is enabled by default for
7587 @option{-Os} or @option{-O0}.
7589 @end table
7591 @item -fira-hoist-pressure
7592 @opindex fira-hoist-pressure
7593 Use IRA to evaluate register pressure in the code hoisting pass for
7594 decisions to hoist expressions.  This option usually results in smaller
7595 code, but it can slow the compiler down.
7597 This option is enabled at level @option{-Os} for all targets.
7599 @item -fira-loop-pressure
7600 @opindex fira-loop-pressure
7601 Use IRA to evaluate register pressure in loops for decisions to move
7602 loop invariants.  This option usually results in generation
7603 of faster and smaller code on machines with large register files (>= 32
7604 registers), but it can slow the compiler down.
7606 This option is enabled at level @option{-O3} for some targets.
7608 @item -fno-ira-share-save-slots
7609 @opindex fno-ira-share-save-slots
7610 Disable sharing of stack slots used for saving call-used hard
7611 registers living through a call.  Each hard register gets a
7612 separate stack slot, and as a result function stack frames are
7613 larger.
7615 @item -fno-ira-share-spill-slots
7616 @opindex fno-ira-share-spill-slots
7617 Disable sharing of stack slots allocated for pseudo-registers.  Each
7618 pseudo-register that does not get a hard register gets a separate
7619 stack slot, and as a result function stack frames are larger.
7621 @item -fira-verbose=@var{n}
7622 @opindex fira-verbose
7623 Control the verbosity of the dump file for the integrated register allocator.
7624 The default value is 5.  If the value @var{n} is greater or equal to 10,
7625 the dump output is sent to stderr using the same format as @var{n} minus 10.
7627 @item -fdelayed-branch
7628 @opindex fdelayed-branch
7629 If supported for the target machine, attempt to reorder instructions
7630 to exploit instruction slots available after delayed branch
7631 instructions.
7633 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7635 @item -fschedule-insns
7636 @opindex fschedule-insns
7637 If supported for the target machine, attempt to reorder instructions to
7638 eliminate execution stalls due to required data being unavailable.  This
7639 helps machines that have slow floating point or memory load instructions
7640 by allowing other instructions to be issued until the result of the load
7641 or floating-point instruction is required.
7643 Enabled at levels @option{-O2}, @option{-O3}.
7645 @item -fschedule-insns2
7646 @opindex fschedule-insns2
7647 Similar to @option{-fschedule-insns}, but requests an additional pass of
7648 instruction scheduling after register allocation has been done.  This is
7649 especially useful on machines with a relatively small number of
7650 registers and where memory load instructions take more than one cycle.
7652 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7654 @item -fno-sched-interblock
7655 @opindex fno-sched-interblock
7656 Don't schedule instructions across basic blocks.  This is normally
7657 enabled by default when scheduling before register allocation, i.e.@:
7658 with @option{-fschedule-insns} or at @option{-O2} or higher.
7660 @item -fno-sched-spec
7661 @opindex fno-sched-spec
7662 Don't allow speculative motion of non-load instructions.  This is normally
7663 enabled by default when scheduling before register allocation, i.e.@:
7664 with @option{-fschedule-insns} or at @option{-O2} or higher.
7666 @item -fsched-pressure
7667 @opindex fsched-pressure
7668 Enable register pressure sensitive insn scheduling before register
7669 allocation.  This only makes sense when scheduling before register
7670 allocation is enabled, i.e.@: with @option{-fschedule-insns} or at
7671 @option{-O2} or higher.  Usage of this option can improve the
7672 generated code and decrease its size by preventing register pressure
7673 increase above the number of available hard registers and subsequent
7674 spills in register allocation.
7676 @item -fsched-spec-load
7677 @opindex fsched-spec-load
7678 Allow speculative motion of some load instructions.  This only makes
7679 sense when scheduling before register allocation, i.e.@: with
7680 @option{-fschedule-insns} or at @option{-O2} or higher.
7682 @item -fsched-spec-load-dangerous
7683 @opindex fsched-spec-load-dangerous
7684 Allow speculative motion of more load instructions.  This only makes
7685 sense when scheduling before register allocation, i.e.@: with
7686 @option{-fschedule-insns} or at @option{-O2} or higher.
7688 @item -fsched-stalled-insns
7689 @itemx -fsched-stalled-insns=@var{n}
7690 @opindex fsched-stalled-insns
7691 Define how many insns (if any) can be moved prematurely from the queue
7692 of stalled insns into the ready list during the second scheduling pass.
7693 @option{-fno-sched-stalled-insns} means that no insns are moved
7694 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
7695 on how many queued insns can be moved prematurely.
7696 @option{-fsched-stalled-insns} without a value is equivalent to
7697 @option{-fsched-stalled-insns=1}.
7699 @item -fsched-stalled-insns-dep
7700 @itemx -fsched-stalled-insns-dep=@var{n}
7701 @opindex fsched-stalled-insns-dep
7702 Define how many insn groups (cycles) are examined for a dependency
7703 on a stalled insn that is a candidate for premature removal from the queue
7704 of stalled insns.  This has an effect only during the second scheduling pass,
7705 and only if @option{-fsched-stalled-insns} is used.
7706 @option{-fno-sched-stalled-insns-dep} is equivalent to
7707 @option{-fsched-stalled-insns-dep=0}.
7708 @option{-fsched-stalled-insns-dep} without a value is equivalent to
7709 @option{-fsched-stalled-insns-dep=1}.
7711 @item -fsched2-use-superblocks
7712 @opindex fsched2-use-superblocks
7713 When scheduling after register allocation, use superblock scheduling.
7714 This allows motion across basic block boundaries,
7715 resulting in faster schedules.  This option is experimental, as not all machine
7716 descriptions used by GCC model the CPU closely enough to avoid unreliable
7717 results from the algorithm.
7719 This only makes sense when scheduling after register allocation, i.e.@: with
7720 @option{-fschedule-insns2} or at @option{-O2} or higher.
7722 @item -fsched-group-heuristic
7723 @opindex fsched-group-heuristic
7724 Enable the group heuristic in the scheduler.  This heuristic favors
7725 the instruction that belongs to a schedule group.  This is enabled
7726 by default when scheduling is enabled, i.e.@: with @option{-fschedule-insns}
7727 or @option{-fschedule-insns2} or at @option{-O2} or higher.
7729 @item -fsched-critical-path-heuristic
7730 @opindex fsched-critical-path-heuristic
7731 Enable the critical-path heuristic in the scheduler.  This heuristic favors
7732 instructions on the critical path.  This is enabled by default when
7733 scheduling is enabled, i.e.@: with @option{-fschedule-insns}
7734 or @option{-fschedule-insns2} or at @option{-O2} or higher.
7736 @item -fsched-spec-insn-heuristic
7737 @opindex fsched-spec-insn-heuristic
7738 Enable the speculative instruction heuristic in the scheduler.  This
7739 heuristic favors speculative instructions with greater dependency weakness.
7740 This is enabled by default when scheduling is enabled, i.e.@:
7741 with @option{-fschedule-insns} or @option{-fschedule-insns2}
7742 or at @option{-O2} or higher.
7744 @item -fsched-rank-heuristic
7745 @opindex fsched-rank-heuristic
7746 Enable the rank heuristic in the scheduler.  This heuristic favors
7747 the instruction belonging to a basic block with greater size or frequency.
7748 This is enabled by default when scheduling is enabled, i.e.@:
7749 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7750 at @option{-O2} or higher.
7752 @item -fsched-last-insn-heuristic
7753 @opindex fsched-last-insn-heuristic
7754 Enable the last-instruction heuristic in the scheduler.  This heuristic
7755 favors the instruction that is less dependent on the last instruction
7756 scheduled.  This is enabled by default when scheduling is enabled,
7757 i.e.@: with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7758 at @option{-O2} or higher.
7760 @item -fsched-dep-count-heuristic
7761 @opindex fsched-dep-count-heuristic
7762 Enable the dependent-count heuristic in the scheduler.  This heuristic
7763 favors the instruction that has more instructions depending on it.
7764 This is enabled by default when scheduling is enabled, i.e.@:
7765 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7766 at @option{-O2} or higher.
7768 @item -freschedule-modulo-scheduled-loops
7769 @opindex freschedule-modulo-scheduled-loops
7770 Modulo scheduling is performed before traditional scheduling.  If a loop
7771 is modulo scheduled, later scheduling passes may change its schedule.  
7772 Use this option to control that behavior.
7774 @item -fselective-scheduling
7775 @opindex fselective-scheduling
7776 Schedule instructions using selective scheduling algorithm.  Selective
7777 scheduling runs instead of the first scheduler pass.
7779 @item -fselective-scheduling2
7780 @opindex fselective-scheduling2
7781 Schedule instructions using selective scheduling algorithm.  Selective
7782 scheduling runs instead of the second scheduler pass.
7784 @item -fsel-sched-pipelining
7785 @opindex fsel-sched-pipelining
7786 Enable software pipelining of innermost loops during selective scheduling.
7787 This option has no effect unless one of @option{-fselective-scheduling} or
7788 @option{-fselective-scheduling2} is turned on.
7790 @item -fsel-sched-pipelining-outer-loops
7791 @opindex fsel-sched-pipelining-outer-loops
7792 When pipelining loops during selective scheduling, also pipeline outer loops.
7793 This option has no effect unless @option{-fsel-sched-pipelining} is turned on.
7795 @item -fsemantic-interposition
7796 @opindex fsemantic-interposition
7797 Some object formats, like ELF, allow interposing of symbols by dynamic linker.
7798 This means that for symbols exported from the DSO compiler can not perform
7799 inter-procedural propagation, inlining and other optimizations in anticipation
7800 that the function or variable in question may change. While this feature is
7801 useful, for example, to rewrite memory allocation functions by a debugging
7802 implementation, it is expensive in the terms of code quality.
7803 With @option{-fno-semantic-inteposition} compiler assumest that if interposition
7804 happens for functions the overwritting function will have
7805 precisely same semantics (and side effects). Similarly if interposition happens
7806 for variables, the constructor of the variable will be the same. The flag
7807 has no effect for functions explicitly declared inline, where
7808 interposition changing semantic is never allowed and for symbols explicitly
7809 declared weak.
7811 @item -fshrink-wrap
7812 @opindex fshrink-wrap
7813 Emit function prologues only before parts of the function that need it,
7814 rather than at the top of the function.  This flag is enabled by default at
7815 @option{-O} and higher.
7817 @item -fcaller-saves
7818 @opindex fcaller-saves
7819 Enable allocation of values to registers that are clobbered by
7820 function calls, by emitting extra instructions to save and restore the
7821 registers around such calls.  Such allocation is done only when it
7822 seems to result in better code.
7824 This option is always enabled by default on certain machines, usually
7825 those which have no call-preserved registers to use instead.
7827 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7829 @item -fcombine-stack-adjustments
7830 @opindex fcombine-stack-adjustments
7831 Tracks stack adjustments (pushes and pops) and stack memory references
7832 and then tries to find ways to combine them.
7834 Enabled by default at @option{-O1} and higher.
7836 @item -fuse-caller-save
7837 Use caller save registers for allocation if those registers are not used by
7838 any called function.  In that case it is not necessary to save and restore
7839 them around calls.  This is only possible if called functions are part of
7840 same compilation unit as current function and they are compiled before it.
7842 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7844 @item -fconserve-stack
7845 @opindex fconserve-stack
7846 Attempt to minimize stack usage.  The compiler attempts to use less
7847 stack space, even if that makes the program slower.  This option
7848 implies setting the @option{large-stack-frame} parameter to 100
7849 and the @option{large-stack-frame-growth} parameter to 400.
7851 @item -ftree-reassoc
7852 @opindex ftree-reassoc
7853 Perform reassociation on trees.  This flag is enabled by default
7854 at @option{-O} and higher.
7856 @item -ftree-pre
7857 @opindex ftree-pre
7858 Perform partial redundancy elimination (PRE) on trees.  This flag is
7859 enabled by default at @option{-O2} and @option{-O3}.
7861 @item -ftree-partial-pre
7862 @opindex ftree-partial-pre
7863 Make partial redundancy elimination (PRE) more aggressive.  This flag is
7864 enabled by default at @option{-O3}.
7866 @item -ftree-forwprop
7867 @opindex ftree-forwprop
7868 Perform forward propagation on trees.  This flag is enabled by default
7869 at @option{-O} and higher.
7871 @item -ftree-fre
7872 @opindex ftree-fre
7873 Perform full redundancy elimination (FRE) on trees.  The difference
7874 between FRE and PRE is that FRE only considers expressions
7875 that are computed on all paths leading to the redundant computation.
7876 This analysis is faster than PRE, though it exposes fewer redundancies.
7877 This flag is enabled by default at @option{-O} and higher.
7879 @item -ftree-phiprop
7880 @opindex ftree-phiprop
7881 Perform hoisting of loads from conditional pointers on trees.  This
7882 pass is enabled by default at @option{-O} and higher.
7884 @item -fhoist-adjacent-loads
7885 @opindex hoist-adjacent-loads
7886 Speculatively hoist loads from both branches of an if-then-else if the
7887 loads are from adjacent locations in the same structure and the target
7888 architecture has a conditional move instruction.  This flag is enabled
7889 by default at @option{-O2} and higher.
7891 @item -ftree-copy-prop
7892 @opindex ftree-copy-prop
7893 Perform copy propagation on trees.  This pass eliminates unnecessary
7894 copy operations.  This flag is enabled by default at @option{-O} and
7895 higher.
7897 @item -fipa-pure-const
7898 @opindex fipa-pure-const
7899 Discover which functions are pure or constant.
7900 Enabled by default at @option{-O} and higher.
7902 @item -fipa-reference
7903 @opindex fipa-reference
7904 Discover which static variables do not escape the
7905 compilation unit.
7906 Enabled by default at @option{-O} and higher.
7908 @item -fipa-pta
7909 @opindex fipa-pta
7910 Perform interprocedural pointer analysis and interprocedural modification
7911 and reference analysis.  This option can cause excessive memory and
7912 compile-time usage on large compilation units.  It is not enabled by
7913 default at any optimization level.
7915 @item -fipa-profile
7916 @opindex fipa-profile
7917 Perform interprocedural profile propagation.  The functions called only from
7918 cold functions are marked as cold. Also functions executed once (such as
7919 @code{cold}, @code{noreturn}, static constructors or destructors) are identified. Cold
7920 functions and loop less parts of functions executed once are then optimized for
7921 size.
7922 Enabled by default at @option{-O} and higher.
7924 @item -fipa-cp
7925 @opindex fipa-cp
7926 Perform interprocedural constant propagation.
7927 This optimization analyzes the program to determine when values passed
7928 to functions are constants and then optimizes accordingly.
7929 This optimization can substantially increase performance
7930 if the application has constants passed to functions.
7931 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
7933 @item -fipa-cp-clone
7934 @opindex fipa-cp-clone
7935 Perform function cloning to make interprocedural constant propagation stronger.
7936 When enabled, interprocedural constant propagation performs function cloning
7937 when externally visible function can be called with constant arguments.
7938 Because this optimization can create multiple copies of functions,
7939 it may significantly increase code size
7940 (see @option{--param ipcp-unit-growth=@var{value}}).
7941 This flag is enabled by default at @option{-O3}.
7943 @item -fisolate-erroneous-paths-dereference
7944 Detect paths which trigger erroneous or undefined behaviour due to
7945 dereferencing a NULL pointer.  Isolate those paths from the main control
7946 flow and turn the statement with erroneous or undefined behaviour into a trap.
7948 @item -fisolate-erroneous-paths-attribute
7949 Detect paths which trigger erroneous or undefined behaviour due a NULL value
7950 being used in a way which is forbidden by a @code{returns_nonnull} or @code{nonnull}
7951 attribute.  Isolate those paths from the main control flow and turn the
7952 statement with erroneous or undefined behaviour into a trap.  This is not
7953 currently enabled, but may be enabled by @code{-O2} in the future.
7955 @item -ftree-sink
7956 @opindex ftree-sink
7957 Perform forward store motion  on trees.  This flag is
7958 enabled by default at @option{-O} and higher.
7960 @item -ftree-bit-ccp
7961 @opindex ftree-bit-ccp
7962 Perform sparse conditional bit constant propagation on trees and propagate
7963 pointer alignment information.
7964 This pass only operates on local scalar variables and is enabled by default
7965 at @option{-O} and higher.  It requires that @option{-ftree-ccp} is enabled.
7967 @item -ftree-ccp
7968 @opindex ftree-ccp
7969 Perform sparse conditional constant propagation (CCP) on trees.  This
7970 pass only operates on local scalar variables and is enabled by default
7971 at @option{-O} and higher.
7973 @item -fssa-phiopt
7974 @opindex fssa-phiopt
7975 Perform pattern matching on SSA PHI nodes to optimize conditional
7976 code.  This pass is enabled by default at @option{-O} and higher.
7978 @item -ftree-switch-conversion
7979 Perform conversion of simple initializations in a switch to
7980 initializations from a scalar array.  This flag is enabled by default
7981 at @option{-O2} and higher.
7983 @item -ftree-tail-merge
7984 Look for identical code sequences.  When found, replace one with a jump to the
7985 other.  This optimization is known as tail merging or cross jumping.  This flag
7986 is enabled by default at @option{-O2} and higher.  The compilation time
7987 in this pass can
7988 be limited using @option{max-tail-merge-comparisons} parameter and
7989 @option{max-tail-merge-iterations} parameter.
7991 @item -ftree-dce
7992 @opindex ftree-dce
7993 Perform dead code elimination (DCE) on trees.  This flag is enabled by
7994 default at @option{-O} and higher.
7996 @item -ftree-builtin-call-dce
7997 @opindex ftree-builtin-call-dce
7998 Perform conditional dead code elimination (DCE) for calls to built-in functions
7999 that may set @code{errno} but are otherwise side-effect free.  This flag is
8000 enabled by default at @option{-O2} and higher if @option{-Os} is not also
8001 specified.
8003 @item -ftree-dominator-opts
8004 @opindex ftree-dominator-opts
8005 Perform a variety of simple scalar cleanups (constant/copy
8006 propagation, redundancy elimination, range propagation and expression
8007 simplification) based on a dominator tree traversal.  This also
8008 performs jump threading (to reduce jumps to jumps). This flag is
8009 enabled by default at @option{-O} and higher.
8011 @item -ftree-dse
8012 @opindex ftree-dse
8013 Perform dead store elimination (DSE) on trees.  A dead store is a store into
8014 a memory location that is later overwritten by another store without
8015 any intervening loads.  In this case the earlier store can be deleted.  This
8016 flag is enabled by default at @option{-O} and higher.
8018 @item -ftree-ch
8019 @opindex ftree-ch
8020 Perform loop header copying on trees.  This is beneficial since it increases
8021 effectiveness of code motion optimizations.  It also saves one jump.  This flag
8022 is enabled by default at @option{-O} and higher.  It is not enabled
8023 for @option{-Os}, since it usually increases code size.
8025 @item -ftree-loop-optimize
8026 @opindex ftree-loop-optimize
8027 Perform loop optimizations on trees.  This flag is enabled by default
8028 at @option{-O} and higher.
8030 @item -ftree-loop-linear
8031 @opindex ftree-loop-linear
8032 Perform loop interchange transformations on tree.  Same as
8033 @option{-floop-interchange}.  To use this code transformation, GCC has
8034 to be configured with @option{--with-ppl} and @option{--with-cloog} to
8035 enable the Graphite loop transformation infrastructure.
8037 @item -floop-interchange
8038 @opindex floop-interchange
8039 Perform loop interchange transformations on loops.  Interchanging two
8040 nested loops switches the inner and outer loops.  For example, given a
8041 loop like:
8042 @smallexample
8043 DO J = 1, M
8044   DO I = 1, N
8045     A(J, I) = A(J, I) * C
8046   ENDDO
8047 ENDDO
8048 @end smallexample
8049 loop interchange transforms the loop as if it were written:
8050 @smallexample
8051 DO I = 1, N
8052   DO J = 1, M
8053     A(J, I) = A(J, I) * C
8054   ENDDO
8055 ENDDO
8056 @end smallexample
8057 which can be beneficial when @code{N} is larger than the caches,
8058 because in Fortran, the elements of an array are stored in memory
8059 contiguously by column, and the original loop iterates over rows,
8060 potentially creating at each access a cache miss.  This optimization
8061 applies to all the languages supported by GCC and is not limited to
8062 Fortran.  To use this code transformation, GCC has to be configured
8063 with @option{--with-ppl} and @option{--with-cloog} to enable the
8064 Graphite loop transformation infrastructure.
8066 @item -floop-strip-mine
8067 @opindex floop-strip-mine
8068 Perform loop strip mining transformations on loops.  Strip mining
8069 splits a loop into two nested loops.  The outer loop has strides
8070 equal to the strip size and the inner loop has strides of the
8071 original loop within a strip.  The strip length can be changed
8072 using the @option{loop-block-tile-size} parameter.  For example,
8073 given a loop like:
8074 @smallexample
8075 DO I = 1, N
8076   A(I) = A(I) + C
8077 ENDDO
8078 @end smallexample
8079 loop strip mining transforms the loop as if it were written:
8080 @smallexample
8081 DO II = 1, N, 51
8082   DO I = II, min (II + 50, N)
8083     A(I) = A(I) + C
8084   ENDDO
8085 ENDDO
8086 @end smallexample
8087 This optimization applies to all the languages supported by GCC and is
8088 not limited to Fortran.  To use this code transformation, GCC has to
8089 be configured with @option{--with-ppl} and @option{--with-cloog} to
8090 enable the Graphite loop transformation infrastructure.
8092 @item -floop-block
8093 @opindex floop-block
8094 Perform loop blocking transformations on loops.  Blocking strip mines
8095 each loop in the loop nest such that the memory accesses of the
8096 element loops fit inside caches.  The strip length can be changed
8097 using the @option{loop-block-tile-size} parameter.  For example, given
8098 a loop like:
8099 @smallexample
8100 DO I = 1, N
8101   DO J = 1, M
8102     A(J, I) = B(I) + C(J)
8103   ENDDO
8104 ENDDO
8105 @end smallexample
8106 loop blocking transforms the loop as if it were written:
8107 @smallexample
8108 DO II = 1, N, 51
8109   DO JJ = 1, M, 51
8110     DO I = II, min (II + 50, N)
8111       DO J = JJ, min (JJ + 50, M)
8112         A(J, I) = B(I) + C(J)
8113       ENDDO
8114     ENDDO
8115   ENDDO
8116 ENDDO
8117 @end smallexample
8118 which can be beneficial when @code{M} is larger than the caches,
8119 because the innermost loop iterates over a smaller amount of data
8120 which can be kept in the caches.  This optimization applies to all the
8121 languages supported by GCC and is not limited to Fortran.  To use this
8122 code transformation, GCC has to be configured with @option{--with-ppl}
8123 and @option{--with-cloog} to enable the Graphite loop transformation
8124 infrastructure.
8126 @item -fgraphite-identity
8127 @opindex fgraphite-identity
8128 Enable the identity transformation for graphite.  For every SCoP we generate
8129 the polyhedral representation and transform it back to gimple.  Using
8130 @option{-fgraphite-identity} we can check the costs or benefits of the
8131 GIMPLE -> GRAPHITE -> GIMPLE transformation.  Some minimal optimizations
8132 are also performed by the code generator CLooG, like index splitting and
8133 dead code elimination in loops.
8135 @item -floop-nest-optimize
8136 @opindex floop-nest-optimize
8137 Enable the ISL based loop nest optimizer.  This is a generic loop nest
8138 optimizer based on the Pluto optimization algorithms.  It calculates a loop
8139 structure optimized for data-locality and parallelism.  This option
8140 is experimental.
8142 @item -floop-parallelize-all
8143 @opindex floop-parallelize-all
8144 Use the Graphite data dependence analysis to identify loops that can
8145 be parallelized.  Parallelize all the loops that can be analyzed to
8146 not contain loop carried dependences without checking that it is
8147 profitable to parallelize the loops.
8149 @item -fcheck-data-deps
8150 @opindex fcheck-data-deps
8151 Compare the results of several data dependence analyzers.  This option
8152 is used for debugging the data dependence analyzers.
8154 @item -ftree-loop-if-convert
8155 Attempt to transform conditional jumps in the innermost loops to
8156 branch-less equivalents.  The intent is to remove control-flow from
8157 the innermost loops in order to improve the ability of the
8158 vectorization pass to handle these loops.  This is enabled by default
8159 if vectorization is enabled.
8161 @item -ftree-loop-if-convert-stores
8162 Attempt to also if-convert conditional jumps containing memory writes.
8163 This transformation can be unsafe for multi-threaded programs as it
8164 transforms conditional memory writes into unconditional memory writes.
8165 For example,
8166 @smallexample
8167 for (i = 0; i < N; i++)
8168   if (cond)
8169     A[i] = expr;
8170 @end smallexample
8171 is transformed to
8172 @smallexample
8173 for (i = 0; i < N; i++)
8174   A[i] = cond ? expr : A[i];
8175 @end smallexample
8176 potentially producing data races.
8178 @item -ftree-loop-distribution
8179 Perform loop distribution.  This flag can improve cache performance on
8180 big loop bodies and allow further loop optimizations, like
8181 parallelization or vectorization, to take place.  For example, the loop
8182 @smallexample
8183 DO I = 1, N
8184   A(I) = B(I) + C
8185   D(I) = E(I) * F
8186 ENDDO
8187 @end smallexample
8188 is transformed to
8189 @smallexample
8190 DO I = 1, N
8191    A(I) = B(I) + C
8192 ENDDO
8193 DO I = 1, N
8194    D(I) = E(I) * F
8195 ENDDO
8196 @end smallexample
8198 @item -ftree-loop-distribute-patterns
8199 Perform loop distribution of patterns that can be code generated with
8200 calls to a library.  This flag is enabled by default at @option{-O3}.
8202 This pass distributes the initialization loops and generates a call to
8203 memset zero.  For example, the loop
8204 @smallexample
8205 DO I = 1, N
8206   A(I) = 0
8207   B(I) = A(I) + I
8208 ENDDO
8209 @end smallexample
8210 is transformed to
8211 @smallexample
8212 DO I = 1, N
8213    A(I) = 0
8214 ENDDO
8215 DO I = 1, N
8216    B(I) = A(I) + I
8217 ENDDO
8218 @end smallexample
8219 and the initialization loop is transformed into a call to memset zero.
8221 @item -ftree-loop-im
8222 @opindex ftree-loop-im
8223 Perform loop invariant motion on trees.  This pass moves only invariants that
8224 are hard to handle at RTL level (function calls, operations that expand to
8225 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
8226 operands of conditions that are invariant out of the loop, so that we can use
8227 just trivial invariantness analysis in loop unswitching.  The pass also includes
8228 store motion.
8230 @item -ftree-loop-ivcanon
8231 @opindex ftree-loop-ivcanon
8232 Create a canonical counter for number of iterations in loops for which
8233 determining number of iterations requires complicated analysis.  Later
8234 optimizations then may determine the number easily.  Useful especially
8235 in connection with unrolling.
8237 @item -fivopts
8238 @opindex fivopts
8239 Perform induction variable optimizations (strength reduction, induction
8240 variable merging and induction variable elimination) on trees.
8242 @item -ftree-parallelize-loops=n
8243 @opindex ftree-parallelize-loops
8244 Parallelize loops, i.e., split their iteration space to run in n threads.
8245 This is only possible for loops whose iterations are independent
8246 and can be arbitrarily reordered.  The optimization is only
8247 profitable on multiprocessor machines, for loops that are CPU-intensive,
8248 rather than constrained e.g.@: by memory bandwidth.  This option
8249 implies @option{-pthread}, and thus is only supported on targets
8250 that have support for @option{-pthread}.
8252 @item -ftree-pta
8253 @opindex ftree-pta
8254 Perform function-local points-to analysis on trees.  This flag is
8255 enabled by default at @option{-O} and higher.
8257 @item -ftree-sra
8258 @opindex ftree-sra
8259 Perform scalar replacement of aggregates.  This pass replaces structure
8260 references with scalars to prevent committing structures to memory too
8261 early.  This flag is enabled by default at @option{-O} and higher.
8263 @item -ftree-copyrename
8264 @opindex ftree-copyrename
8265 Perform copy renaming on trees.  This pass attempts to rename compiler
8266 temporaries to other variables at copy locations, usually resulting in
8267 variable names which more closely resemble the original variables.  This flag
8268 is enabled by default at @option{-O} and higher.
8270 @item -ftree-coalesce-inlined-vars
8271 @opindex ftree-coalesce-inlined-vars
8272 Tell the copyrename pass (see @option{-ftree-copyrename}) to attempt to
8273 combine small user-defined variables too, but only if they were inlined
8274 from other functions.  It is a more limited form of
8275 @option{-ftree-coalesce-vars}.  This may harm debug information of such
8276 inlined variables, but it will keep variables of the inlined-into
8277 function apart from each other, such that they are more likely to
8278 contain the expected values in a debugging session.  This was the
8279 default in GCC versions older than 4.7.
8281 @item -ftree-coalesce-vars
8282 @opindex ftree-coalesce-vars
8283 Tell the copyrename pass (see @option{-ftree-copyrename}) to attempt to
8284 combine small user-defined variables too, instead of just compiler
8285 temporaries.  This may severely limit the ability to debug an optimized
8286 program compiled with @option{-fno-var-tracking-assignments}.  In the
8287 negated form, this flag prevents SSA coalescing of user variables,
8288 including inlined ones.  This option is enabled by default.
8290 @item -ftree-ter
8291 @opindex ftree-ter
8292 Perform temporary expression replacement during the SSA->normal phase.  Single
8293 use/single def temporaries are replaced at their use location with their
8294 defining expression.  This results in non-GIMPLE code, but gives the expanders
8295 much more complex trees to work on resulting in better RTL generation.  This is
8296 enabled by default at @option{-O} and higher.
8298 @item -ftree-slsr
8299 @opindex ftree-slsr
8300 Perform straight-line strength reduction on trees.  This recognizes related
8301 expressions involving multiplications and replaces them by less expensive
8302 calculations when possible.  This is enabled by default at @option{-O} and
8303 higher.
8305 @item -ftree-vectorize
8306 @opindex ftree-vectorize
8307 Perform vectorization on trees. This flag enables @option{-ftree-loop-vectorize}
8308 and @option{-ftree-slp-vectorize} if not explicitly specified.
8310 @item -ftree-loop-vectorize
8311 @opindex ftree-loop-vectorize
8312 Perform loop vectorization on trees. This flag is enabled by default at
8313 @option{-O3} and when @option{-ftree-vectorize} is enabled.
8315 @item -ftree-slp-vectorize
8316 @opindex ftree-slp-vectorize
8317 Perform basic block vectorization on trees. This flag is enabled by default at
8318 @option{-O3} and when @option{-ftree-vectorize} is enabled.
8320 @item -fvect-cost-model=@var{model}
8321 @opindex fvect-cost-model
8322 Alter the cost model used for vectorization.  The @var{model} argument
8323 should be one of @code{unlimited}, @code{dynamic} or @code{cheap}.
8324 With the @code{unlimited} model the vectorized code-path is assumed
8325 to be profitable while with the @code{dynamic} model a runtime check
8326 will guard the vectorized code-path to enable it only for iteration
8327 counts that will likely execute faster than when executing the original
8328 scalar loop.  The @code{cheap} model will disable vectorization of
8329 loops where doing so would be cost prohibitive for example due to
8330 required runtime checks for data dependence or alignment but otherwise
8331 is equal to the @code{dynamic} model.
8332 The default cost model depends on other optimization flags and is
8333 either @code{dynamic} or @code{cheap}.
8335 @item -fsimd-cost-model=@var{model}
8336 @opindex fsimd-cost-model
8337 Alter the cost model used for vectorization of loops marked with the OpenMP
8338 or Cilk Plus simd directive.  The @var{model} argument should be one of
8339 @code{unlimited}, @code{dynamic}, @code{cheap}.  All values of @var{model}
8340 have the same meaning as described in @option{-fvect-cost-model} and by
8341 default a cost model defined with @option{-fvect-cost-model} is used.
8343 @item -ftree-vrp
8344 @opindex ftree-vrp
8345 Perform Value Range Propagation on trees.  This is similar to the
8346 constant propagation pass, but instead of values, ranges of values are
8347 propagated.  This allows the optimizers to remove unnecessary range
8348 checks like array bound checks and null pointer checks.  This is
8349 enabled by default at @option{-O2} and higher.  Null pointer check
8350 elimination is only done if @option{-fdelete-null-pointer-checks} is
8351 enabled.
8353 @item -ftracer
8354 @opindex ftracer
8355 Perform tail duplication to enlarge superblock size.  This transformation
8356 simplifies the control flow of the function allowing other optimizations to do
8357 a better job.
8359 @item -funroll-loops
8360 @opindex funroll-loops
8361 Unroll loops whose number of iterations can be determined at compile
8362 time or upon entry to the loop.  @option{-funroll-loops} implies
8363 @option{-frerun-cse-after-loop}.  This option makes code larger,
8364 and may or may not make it run faster.
8366 @item -funroll-all-loops
8367 @opindex funroll-all-loops
8368 Unroll all loops, even if their number of iterations is uncertain when
8369 the loop is entered.  This usually makes programs run more slowly.
8370 @option{-funroll-all-loops} implies the same options as
8371 @option{-funroll-loops},
8373 @item -fsplit-ivs-in-unroller
8374 @opindex fsplit-ivs-in-unroller
8375 Enables expression of values of induction variables in later iterations
8376 of the unrolled loop using the value in the first iteration.  This breaks
8377 long dependency chains, thus improving efficiency of the scheduling passes.
8379 A combination of @option{-fweb} and CSE is often sufficient to obtain the
8380 same effect.  However, that is not reliable in cases where the loop body
8381 is more complicated than a single basic block.  It also does not work at all
8382 on some architectures due to restrictions in the CSE pass.
8384 This optimization is enabled by default.
8386 @item -fvariable-expansion-in-unroller
8387 @opindex fvariable-expansion-in-unroller
8388 With this option, the compiler creates multiple copies of some
8389 local variables when unrolling a loop, which can result in superior code.
8391 @item -fpartial-inlining
8392 @opindex fpartial-inlining
8393 Inline parts of functions.  This option has any effect only
8394 when inlining itself is turned on by the @option{-finline-functions}
8395 or @option{-finline-small-functions} options.
8397 Enabled at level @option{-O2}.
8399 @item -fpredictive-commoning
8400 @opindex fpredictive-commoning
8401 Perform predictive commoning optimization, i.e., reusing computations
8402 (especially memory loads and stores) performed in previous
8403 iterations of loops.
8405 This option is enabled at level @option{-O3}.
8407 @item -fprefetch-loop-arrays
8408 @opindex fprefetch-loop-arrays
8409 If supported by the target machine, generate instructions to prefetch
8410 memory to improve the performance of loops that access large arrays.
8412 This option may generate better or worse code; results are highly
8413 dependent on the structure of loops within the source code.
8415 Disabled at level @option{-Os}.
8417 @item -fno-peephole
8418 @itemx -fno-peephole2
8419 @opindex fno-peephole
8420 @opindex fno-peephole2
8421 Disable any machine-specific peephole optimizations.  The difference
8422 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
8423 are implemented in the compiler; some targets use one, some use the
8424 other, a few use both.
8426 @option{-fpeephole} is enabled by default.
8427 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8429 @item -fno-guess-branch-probability
8430 @opindex fno-guess-branch-probability
8431 Do not guess branch probabilities using heuristics.
8433 GCC uses heuristics to guess branch probabilities if they are
8434 not provided by profiling feedback (@option{-fprofile-arcs}).  These
8435 heuristics are based on the control flow graph.  If some branch probabilities
8436 are specified by @samp{__builtin_expect}, then the heuristics are
8437 used to guess branch probabilities for the rest of the control flow graph,
8438 taking the @samp{__builtin_expect} info into account.  The interactions
8439 between the heuristics and @samp{__builtin_expect} can be complex, and in
8440 some cases, it may be useful to disable the heuristics so that the effects
8441 of @samp{__builtin_expect} are easier to understand.
8443 The default is @option{-fguess-branch-probability} at levels
8444 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8446 @item -freorder-blocks
8447 @opindex freorder-blocks
8448 Reorder basic blocks in the compiled function in order to reduce number of
8449 taken branches and improve code locality.
8451 Enabled at levels @option{-O2}, @option{-O3}.
8453 @item -freorder-blocks-and-partition
8454 @opindex freorder-blocks-and-partition
8455 In addition to reordering basic blocks in the compiled function, in order
8456 to reduce number of taken branches, partitions hot and cold basic blocks
8457 into separate sections of the assembly and .o files, to improve
8458 paging and cache locality performance.
8460 This optimization is automatically turned off in the presence of
8461 exception handling, for linkonce sections, for functions with a user-defined
8462 section attribute and on any architecture that does not support named
8463 sections.
8465 Enabled for x86 at levels @option{-O2}, @option{-O3}.
8467 @item -freorder-functions
8468 @opindex freorder-functions
8469 Reorder functions in the object file in order to
8470 improve code locality.  This is implemented by using special
8471 subsections @code{.text.hot} for most frequently executed functions and
8472 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
8473 the linker so object file format must support named sections and linker must
8474 place them in a reasonable way.
8476 Also profile feedback must be available to make this option effective.  See
8477 @option{-fprofile-arcs} for details.
8479 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8481 @item -fstrict-aliasing
8482 @opindex fstrict-aliasing
8483 Allow the compiler to assume the strictest aliasing rules applicable to
8484 the language being compiled.  For C (and C++), this activates
8485 optimizations based on the type of expressions.  In particular, an
8486 object of one type is assumed never to reside at the same address as an
8487 object of a different type, unless the types are almost the same.  For
8488 example, an @code{unsigned int} can alias an @code{int}, but not a
8489 @code{void*} or a @code{double}.  A character type may alias any other
8490 type.
8492 @anchor{Type-punning}Pay special attention to code like this:
8493 @smallexample
8494 union a_union @{
8495   int i;
8496   double d;
8499 int f() @{
8500   union a_union t;
8501   t.d = 3.0;
8502   return t.i;
8504 @end smallexample
8505 The practice of reading from a different union member than the one most
8506 recently written to (called ``type-punning'') is common.  Even with
8507 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
8508 is accessed through the union type.  So, the code above works as
8509 expected.  @xref{Structures unions enumerations and bit-fields
8510 implementation}.  However, this code might not:
8511 @smallexample
8512 int f() @{
8513   union a_union t;
8514   int* ip;
8515   t.d = 3.0;
8516   ip = &t.i;
8517   return *ip;
8519 @end smallexample
8521 Similarly, access by taking the address, casting the resulting pointer
8522 and dereferencing the result has undefined behavior, even if the cast
8523 uses a union type, e.g.:
8524 @smallexample
8525 int f() @{
8526   double d = 3.0;
8527   return ((union a_union *) &d)->i;
8529 @end smallexample
8531 The @option{-fstrict-aliasing} option is enabled at levels
8532 @option{-O2}, @option{-O3}, @option{-Os}.
8534 @item -fstrict-overflow
8535 @opindex fstrict-overflow
8536 Allow the compiler to assume strict signed overflow rules, depending
8537 on the language being compiled.  For C (and C++) this means that
8538 overflow when doing arithmetic with signed numbers is undefined, which
8539 means that the compiler may assume that it does not happen.  This
8540 permits various optimizations.  For example, the compiler assumes
8541 that an expression like @code{i + 10 > i} is always true for
8542 signed @code{i}.  This assumption is only valid if signed overflow is
8543 undefined, as the expression is false if @code{i + 10} overflows when
8544 using twos complement arithmetic.  When this option is in effect any
8545 attempt to determine whether an operation on signed numbers 
8546 overflows must be written carefully to not actually involve overflow.
8548 This option also allows the compiler to assume strict pointer
8549 semantics: given a pointer to an object, if adding an offset to that
8550 pointer does not produce a pointer to the same object, the addition is
8551 undefined.  This permits the compiler to conclude that @code{p + u >
8552 p} is always true for a pointer @code{p} and unsigned integer
8553 @code{u}.  This assumption is only valid because pointer wraparound is
8554 undefined, as the expression is false if @code{p + u} overflows using
8555 twos complement arithmetic.
8557 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
8558 that integer signed overflow is fully defined: it wraps.  When
8559 @option{-fwrapv} is used, there is no difference between
8560 @option{-fstrict-overflow} and @option{-fno-strict-overflow} for
8561 integers.  With @option{-fwrapv} certain types of overflow are
8562 permitted.  For example, if the compiler gets an overflow when doing
8563 arithmetic on constants, the overflowed value can still be used with
8564 @option{-fwrapv}, but not otherwise.
8566 The @option{-fstrict-overflow} option is enabled at levels
8567 @option{-O2}, @option{-O3}, @option{-Os}.
8569 @item -falign-functions
8570 @itemx -falign-functions=@var{n}
8571 @opindex falign-functions
8572 Align the start of functions to the next power-of-two greater than
8573 @var{n}, skipping up to @var{n} bytes.  For instance,
8574 @option{-falign-functions=32} aligns functions to the next 32-byte
8575 boundary, but @option{-falign-functions=24} aligns to the next
8576 32-byte boundary only if this can be done by skipping 23 bytes or less.
8578 @option{-fno-align-functions} and @option{-falign-functions=1} are
8579 equivalent and mean that functions are not aligned.
8581 Some assemblers only support this flag when @var{n} is a power of two;
8582 in that case, it is rounded up.
8584 If @var{n} is not specified or is zero, use a machine-dependent default.
8586 Enabled at levels @option{-O2}, @option{-O3}.
8588 @item -falign-labels
8589 @itemx -falign-labels=@var{n}
8590 @opindex falign-labels
8591 Align all branch targets to a power-of-two boundary, skipping up to
8592 @var{n} bytes like @option{-falign-functions}.  This option can easily
8593 make code slower, because it must insert dummy operations for when the
8594 branch target is reached in the usual flow of the code.
8596 @option{-fno-align-labels} and @option{-falign-labels=1} are
8597 equivalent and mean that labels are not aligned.
8599 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
8600 are greater than this value, then their values are used instead.
8602 If @var{n} is not specified or is zero, use a machine-dependent default
8603 which is very likely to be @samp{1}, meaning no alignment.
8605 Enabled at levels @option{-O2}, @option{-O3}.
8607 @item -falign-loops
8608 @itemx -falign-loops=@var{n}
8609 @opindex falign-loops
8610 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
8611 like @option{-falign-functions}.  If the loops are
8612 executed many times, this makes up for any execution of the dummy
8613 operations.
8615 @option{-fno-align-loops} and @option{-falign-loops=1} are
8616 equivalent and mean that loops are not aligned.
8618 If @var{n} is not specified or is zero, use a machine-dependent default.
8620 Enabled at levels @option{-O2}, @option{-O3}.
8622 @item -falign-jumps
8623 @itemx -falign-jumps=@var{n}
8624 @opindex falign-jumps
8625 Align branch targets to a power-of-two boundary, for branch targets
8626 where the targets can only be reached by jumping, skipping up to @var{n}
8627 bytes like @option{-falign-functions}.  In this case, no dummy operations
8628 need be executed.
8630 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
8631 equivalent and mean that loops are not aligned.
8633 If @var{n} is not specified or is zero, use a machine-dependent default.
8635 Enabled at levels @option{-O2}, @option{-O3}.
8637 @item -funit-at-a-time
8638 @opindex funit-at-a-time
8639 This option is left for compatibility reasons. @option{-funit-at-a-time}
8640 has no effect, while @option{-fno-unit-at-a-time} implies
8641 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
8643 Enabled by default.
8645 @item -fno-toplevel-reorder
8646 @opindex fno-toplevel-reorder
8647 Do not reorder top-level functions, variables, and @code{asm}
8648 statements.  Output them in the same order that they appear in the
8649 input file.  When this option is used, unreferenced static variables
8650 are not removed.  This option is intended to support existing code
8651 that relies on a particular ordering.  For new code, it is better to
8652 use attributes when possible.
8654 Enabled at level @option{-O0}.  When disabled explicitly, it also implies
8655 @option{-fno-section-anchors}, which is otherwise enabled at @option{-O0} on some
8656 targets.
8658 @item -fweb
8659 @opindex fweb
8660 Constructs webs as commonly used for register allocation purposes and assign
8661 each web individual pseudo register.  This allows the register allocation pass
8662 to operate on pseudos directly, but also strengthens several other optimization
8663 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
8664 however, make debugging impossible, since variables no longer stay in a
8665 ``home register''.
8667 Enabled by default with @option{-funroll-loops}.
8669 @item -fwhole-program
8670 @opindex fwhole-program
8671 Assume that the current compilation unit represents the whole program being
8672 compiled.  All public functions and variables with the exception of @code{main}
8673 and those merged by attribute @code{externally_visible} become static functions
8674 and in effect are optimized more aggressively by interprocedural optimizers.
8676 This option should not be used in combination with @code{-flto}.
8677 Instead relying on a linker plugin should provide safer and more precise
8678 information.
8680 @item -flto[=@var{n}]
8681 @opindex flto
8682 This option runs the standard link-time optimizer.  When invoked
8683 with source code, it generates GIMPLE (one of GCC's internal
8684 representations) and writes it to special ELF sections in the object
8685 file.  When the object files are linked together, all the function
8686 bodies are read from these ELF sections and instantiated as if they
8687 had been part of the same translation unit.
8689 To use the link-time optimizer, @option{-flto} and optimization
8690 options should be specified at compile time and during the final link.
8691 For example:
8693 @smallexample
8694 gcc -c -O2 -flto foo.c
8695 gcc -c -O2 -flto bar.c
8696 gcc -o myprog -flto -O2 foo.o bar.o
8697 @end smallexample
8699 The first two invocations to GCC save a bytecode representation
8700 of GIMPLE into special ELF sections inside @file{foo.o} and
8701 @file{bar.o}.  The final invocation reads the GIMPLE bytecode from
8702 @file{foo.o} and @file{bar.o}, merges the two files into a single
8703 internal image, and compiles the result as usual.  Since both
8704 @file{foo.o} and @file{bar.o} are merged into a single image, this
8705 causes all the interprocedural analyses and optimizations in GCC to
8706 work across the two files as if they were a single one.  This means,
8707 for example, that the inliner is able to inline functions in
8708 @file{bar.o} into functions in @file{foo.o} and vice-versa.
8710 Another (simpler) way to enable link-time optimization is:
8712 @smallexample
8713 gcc -o myprog -flto -O2 foo.c bar.c
8714 @end smallexample
8716 The above generates bytecode for @file{foo.c} and @file{bar.c},
8717 merges them together into a single GIMPLE representation and optimizes
8718 them as usual to produce @file{myprog}.
8720 The only important thing to keep in mind is that to enable link-time
8721 optimizations you need to use the GCC driver to perform the link-step.
8722 GCC then automatically performs link-time optimization if any of the
8723 objects involved were compiled with the @option{-flto}.  You generally
8724 should specify the optimization options to be used for link-time
8725 optimization though GCC will try to be clever at guessing an
8726 optimization level to use from the options used at compile-time
8727 if you fail to specify one at link-time.  You can always override
8728 the automatic decision to do link-time optimization at link-time
8729 by passing @option{-fno-lto} to the link command.
8731 To make whole program optimization effective, it is necessary to make
8732 certain whole program assumptions.  The compiler needs to know
8733 what functions and variables can be accessed by libraries and runtime
8734 outside of the link-time optimized unit.  When supported by the linker,
8735 the linker plugin (see @option{-fuse-linker-plugin}) passes information
8736 to the compiler about used and externally visible symbols.  When
8737 the linker plugin is not available, @option{-fwhole-program} should be
8738 used to allow the compiler to make these assumptions, which leads
8739 to more aggressive optimization decisions.
8741 When @option{-fuse-linker-plugin} is not enabled then, when a file is
8742 compiled with @option{-flto}, the generated object file is larger than
8743 a regular object file because it contains GIMPLE bytecodes and the usual
8744 final code (see @option{-ffat-lto-objects}.  This means that
8745 object files with LTO information can be linked as normal object
8746 files; if @option{-fno-lto} is passed to the linker, no
8747 interprocedural optimizations are applied.  Note that when
8748 @option{-fno-fat-lto-objects} is enabled the compile-stage is faster
8749 but you cannot perform a regular, non-LTO link on them.
8751 Additionally, the optimization flags used to compile individual files
8752 are not necessarily related to those used at link time.  For instance,
8754 @smallexample
8755 gcc -c -O0 -ffat-lto-objects -flto foo.c
8756 gcc -c -O0 -ffat-lto-objects -flto bar.c
8757 gcc -o myprog -O3 foo.o bar.o
8758 @end smallexample
8760 This produces individual object files with unoptimized assembler
8761 code, but the resulting binary @file{myprog} is optimized at
8762 @option{-O3}.  If, instead, the final binary is generated with
8763 @option{-fno-lto}, then @file{myprog} is not optimized.
8765 When producing the final binary, GCC only
8766 applies link-time optimizations to those files that contain bytecode.
8767 Therefore, you can mix and match object files and libraries with
8768 GIMPLE bytecodes and final object code.  GCC automatically selects
8769 which files to optimize in LTO mode and which files to link without
8770 further processing.
8772 There are some code generation flags preserved by GCC when
8773 generating bytecodes, as they need to be used during the final link
8774 stage.  Generally options specified at link-time override those
8775 specified at compile-time.
8777 If you do not specify an optimization level option @option{-O} at
8778 link-time then GCC will compute one based on the optimization levels
8779 used when compiling the object files.  The highest optimization
8780 level will win here.
8782 Currently, the following options and their setting are take from
8783 the first object file that explicitely specified it: 
8784 @option{-fPIC}, @option{-fpic}, @option{-fpie}, @option{-fcommon},
8785 @option{-fexceptions}, @option{-fnon-call-exceptions}, @option{-fgnu-tm}
8786 and all the @option{-m} target flags.
8788 Certain ABI changing flags are required to match in all compilation-units
8789 and trying to override this at link-time with a conflicting value
8790 is ignored.  This includes options such as @option{-freg-struct-return}
8791 and @option{-fpcc-struct-return}. 
8793 Other options such as @option{-ffp-contract}, @option{-fno-strict-overflow},
8794 @option{-fwrapv}, @option{-fno-trapv} or @option{-fno-strict-aliasing}
8795 are passed through to the link stage and merged conservatively for
8796 conflicting translation units.  Specifically
8797 @option{-fno-strict-overflow}, @option{-fwrapv} and @option{-fno-trapv} take
8798 precedence and for example @option{-ffp-contract=off} takes precedence
8799 over @option{-ffp-contract=fast}.  You can override them at linke-time.
8801 It is recommended that you compile all the files participating in the
8802 same link with the same options and also specify those options at
8803 link time.
8805 If LTO encounters objects with C linkage declared with incompatible
8806 types in separate translation units to be linked together (undefined
8807 behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be
8808 issued.  The behavior is still undefined at run time.  Similar
8809 diagnostics may be raised for other languages.
8811 Another feature of LTO is that it is possible to apply interprocedural
8812 optimizations on files written in different languages:
8814 @smallexample
8815 gcc -c -flto foo.c
8816 g++ -c -flto bar.cc
8817 gfortran -c -flto baz.f90
8818 g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
8819 @end smallexample
8821 Notice that the final link is done with @command{g++} to get the C++
8822 runtime libraries and @option{-lgfortran} is added to get the Fortran
8823 runtime libraries.  In general, when mixing languages in LTO mode, you
8824 should use the same link command options as when mixing languages in a
8825 regular (non-LTO) compilation.
8827 If object files containing GIMPLE bytecode are stored in a library archive, say
8828 @file{libfoo.a}, it is possible to extract and use them in an LTO link if you
8829 are using a linker with plugin support.  To create static libraries suitable
8830 for LTO, use @command{gcc-ar} and @command{gcc-ranlib} instead of @command{ar}
8831 and @code{ranlib}; to show the symbols of object files with GIMPLE bytecode, use
8832 @command{gcc-nm}.  Those commands require that @command{ar}, @command{ranlib}
8833 and @command{nm} have been compiled with plugin support.  At link time, use the the
8834 flag @option{-fuse-linker-plugin} to ensure that the library participates in
8835 the LTO optimization process:
8837 @smallexample
8838 gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
8839 @end smallexample
8841 With the linker plugin enabled, the linker extracts the needed
8842 GIMPLE files from @file{libfoo.a} and passes them on to the running GCC
8843 to make them part of the aggregated GIMPLE image to be optimized.
8845 If you are not using a linker with plugin support and/or do not
8846 enable the linker plugin, then the objects inside @file{libfoo.a}
8847 are extracted and linked as usual, but they do not participate
8848 in the LTO optimization process.  In order to make a static library suitable
8849 for both LTO optimization and usual linkage, compile its object files with
8850 @option{-flto} @code{-ffat-lto-objects}.
8852 Link-time optimizations do not require the presence of the whole program to
8853 operate.  If the program does not require any symbols to be exported, it is
8854 possible to combine @option{-flto} and @option{-fwhole-program} to allow
8855 the interprocedural optimizers to use more aggressive assumptions which may
8856 lead to improved optimization opportunities.
8857 Use of @option{-fwhole-program} is not needed when linker plugin is
8858 active (see @option{-fuse-linker-plugin}).
8860 The current implementation of LTO makes no
8861 attempt to generate bytecode that is portable between different
8862 types of hosts.  The bytecode files are versioned and there is a
8863 strict version check, so bytecode files generated in one version of
8864 GCC will not work with an older or newer version of GCC.
8866 Link-time optimization does not work well with generation of debugging
8867 information.  Combining @option{-flto} with
8868 @option{-g} is currently experimental and expected to produce unexpected
8869 results.
8871 If you specify the optional @var{n}, the optimization and code
8872 generation done at link time is executed in parallel using @var{n}
8873 parallel jobs by utilizing an installed @command{make} program.  The
8874 environment variable @env{MAKE} may be used to override the program
8875 used.  The default value for @var{n} is 1.
8877 You can also specify @option{-flto=jobserver} to use GNU make's
8878 job server mode to determine the number of parallel jobs. This
8879 is useful when the Makefile calling GCC is already executing in parallel.
8880 You must prepend a @samp{+} to the command recipe in the parent Makefile
8881 for this to work.  This option likely only works if @env{MAKE} is
8882 GNU make.
8884 @item -flto-partition=@var{alg}
8885 @opindex flto-partition
8886 Specify the partitioning algorithm used by the link-time optimizer.
8887 The value is either @code{1to1} to specify a partitioning mirroring
8888 the original source files or @code{balanced} to specify partitioning
8889 into equally sized chunks (whenever possible) or @code{max} to create
8890 new partition for every symbol where possible.  Specifying @code{none}
8891 as an algorithm disables partitioning and streaming completely. 
8892 The default value is @code{balanced}. While @code{1to1} can be used
8893 as an workaround for various code ordering issues, the @code{max}
8894 partitioning is intended for internal testing only.
8895 The value @code{one} specifies that exactly one partition should be
8896 used while the value @code{none} bypasses partitioning and executes
8897 the link-time optimization step directly from the WPA phase.
8899 @item -flto-compression-level=@var{n}
8900 This option specifies the level of compression used for intermediate
8901 language written to LTO object files, and is only meaningful in
8902 conjunction with LTO mode (@option{-flto}).  Valid
8903 values are 0 (no compression) to 9 (maximum compression).  Values
8904 outside this range are clamped to either 0 or 9.  If the option is not
8905 given, a default balanced compression setting is used.
8907 @item -flto-report
8908 Prints a report with internal details on the workings of the link-time
8909 optimizer.  The contents of this report vary from version to version.
8910 It is meant to be useful to GCC developers when processing object
8911 files in LTO mode (via @option{-flto}).
8913 Disabled by default.
8915 @item -flto-report-wpa
8916 Like @option{-flto-report}, but only print for the WPA phase of Link
8917 Time Optimization.
8919 @item -fuse-linker-plugin
8920 Enables the use of a linker plugin during link-time optimization.  This
8921 option relies on plugin support in the linker, which is available in gold
8922 or in GNU ld 2.21 or newer.
8924 This option enables the extraction of object files with GIMPLE bytecode out
8925 of library archives. This improves the quality of optimization by exposing
8926 more code to the link-time optimizer.  This information specifies what
8927 symbols can be accessed externally (by non-LTO object or during dynamic
8928 linking).  Resulting code quality improvements on binaries (and shared
8929 libraries that use hidden visibility) are similar to @code{-fwhole-program}.
8930 See @option{-flto} for a description of the effect of this flag and how to
8931 use it.
8933 This option is enabled by default when LTO support in GCC is enabled
8934 and GCC was configured for use with
8935 a linker supporting plugins (GNU ld 2.21 or newer or gold).
8937 @item -ffat-lto-objects
8938 @opindex ffat-lto-objects
8939 Fat LTO objects are object files that contain both the intermediate language
8940 and the object code. This makes them usable for both LTO linking and normal
8941 linking. This option is effective only when compiling with @option{-flto}
8942 and is ignored at link time.
8944 @option{-fno-fat-lto-objects} improves compilation time over plain LTO, but
8945 requires the complete toolchain to be aware of LTO. It requires a linker with
8946 linker plugin support for basic functionality.  Additionally,
8947 @command{nm}, @command{ar} and @command{ranlib}
8948 need to support linker plugins to allow a full-featured build environment
8949 (capable of building static libraries etc).  GCC provides the @command{gcc-ar},
8950 @command{gcc-nm}, @command{gcc-ranlib} wrappers to pass the right options
8951 to these tools. With non fat LTO makefiles need to be modified to use them.
8953 The default is @option{-fno-fat-lto-objects} on targets with linker plugin
8954 support.
8956 @item -fcompare-elim
8957 @opindex fcompare-elim
8958 After register allocation and post-register allocation instruction splitting,
8959 identify arithmetic instructions that compute processor flags similar to a
8960 comparison operation based on that arithmetic.  If possible, eliminate the
8961 explicit comparison operation.
8963 This pass only applies to certain targets that cannot explicitly represent
8964 the comparison operation before register allocation is complete.
8966 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8968 @item -fuse-ld=bfd
8969 @opindex fuse-ld=bfd
8970 Use the @command{bfd} linker instead of the default linker.
8972 @item -fuse-ld=gold
8973 @opindex fuse-ld=gold
8974 Use the @command{gold} linker instead of the default linker.
8976 @item -fcprop-registers
8977 @opindex fcprop-registers
8978 After register allocation and post-register allocation instruction splitting,
8979 perform a copy-propagation pass to try to reduce scheduling dependencies
8980 and occasionally eliminate the copy.
8982 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8984 @item -fprofile-correction
8985 @opindex fprofile-correction
8986 Profiles collected using an instrumented binary for multi-threaded programs may
8987 be inconsistent due to missed counter updates. When this option is specified,
8988 GCC uses heuristics to correct or smooth out such inconsistencies. By
8989 default, GCC emits an error message when an inconsistent profile is detected.
8991 @item -fprofile-dir=@var{path}
8992 @opindex fprofile-dir
8994 Set the directory to search for the profile data files in to @var{path}.
8995 This option affects only the profile data generated by
8996 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
8997 and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
8998 and its related options.  Both absolute and relative paths can be used.
8999 By default, GCC uses the current directory as @var{path}, thus the
9000 profile data file appears in the same directory as the object file.
9002 @item -fprofile-generate
9003 @itemx -fprofile-generate=@var{path}
9004 @opindex fprofile-generate
9006 Enable options usually used for instrumenting application to produce
9007 profile useful for later recompilation with profile feedback based
9008 optimization.  You must use @option{-fprofile-generate} both when
9009 compiling and when linking your program.
9011 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
9013 If @var{path} is specified, GCC looks at the @var{path} to find
9014 the profile feedback data files. See @option{-fprofile-dir}.
9016 @item -fprofile-use
9017 @itemx -fprofile-use=@var{path}
9018 @opindex fprofile-use
9019 Enable profile feedback directed optimizations, and optimizations
9020 generally profitable only with profile feedback available.
9022 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
9023 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}, @code{-ftree-vectorize},
9024 @code{ftree-loop-distribute-patterns}
9026 By default, GCC emits an error message if the feedback profiles do not
9027 match the source code.  This error can be turned into a warning by using
9028 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
9029 code.
9031 If @var{path} is specified, GCC looks at the @var{path} to find
9032 the profile feedback data files. See @option{-fprofile-dir}.
9033 @end table
9035 The following options control compiler behavior regarding floating-point 
9036 arithmetic.  These options trade off between speed and
9037 correctness.  All must be specifically enabled.
9039 @table @gcctabopt
9040 @item -ffloat-store
9041 @opindex ffloat-store
9042 Do not store floating-point variables in registers, and inhibit other
9043 options that might change whether a floating-point value is taken from a
9044 register or memory.
9046 @cindex floating-point precision
9047 This option prevents undesirable excess precision on machines such as
9048 the 68000 where the floating registers (of the 68881) keep more
9049 precision than a @code{double} is supposed to have.  Similarly for the
9050 x86 architecture.  For most programs, the excess precision does only
9051 good, but a few programs rely on the precise definition of IEEE floating
9052 point.  Use @option{-ffloat-store} for such programs, after modifying
9053 them to store all pertinent intermediate computations into variables.
9055 @item -fexcess-precision=@var{style}
9056 @opindex fexcess-precision
9057 This option allows further control over excess precision on machines
9058 where floating-point registers have more precision than the IEEE
9059 @code{float} and @code{double} types and the processor does not
9060 support operations rounding to those types.  By default,
9061 @option{-fexcess-precision=fast} is in effect; this means that
9062 operations are carried out in the precision of the registers and that
9063 it is unpredictable when rounding to the types specified in the source
9064 code takes place.  When compiling C, if
9065 @option{-fexcess-precision=standard} is specified then excess
9066 precision follows the rules specified in ISO C99; in particular,
9067 both casts and assignments cause values to be rounded to their
9068 semantic types (whereas @option{-ffloat-store} only affects
9069 assignments).  This option is enabled by default for C if a strict
9070 conformance option such as @option{-std=c99} is used.
9072 @opindex mfpmath
9073 @option{-fexcess-precision=standard} is not implemented for languages
9074 other than C, and has no effect if
9075 @option{-funsafe-math-optimizations} or @option{-ffast-math} is
9076 specified.  On the x86, it also has no effect if @option{-mfpmath=sse}
9077 or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
9078 semantics apply without excess precision, and in the latter, rounding
9079 is unpredictable.
9081 @item -ffast-math
9082 @opindex ffast-math
9083 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
9084 @option{-ffinite-math-only}, @option{-fno-rounding-math},
9085 @option{-fno-signaling-nans} and @option{-fcx-limited-range}.
9087 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
9089 This option is not turned on by any @option{-O} option besides
9090 @option{-Ofast} since it can result in incorrect output for programs
9091 that depend on an exact implementation of IEEE or ISO rules/specifications
9092 for math functions. It may, however, yield faster code for programs
9093 that do not require the guarantees of these specifications.
9095 @item -fno-math-errno
9096 @opindex fno-math-errno
9097 Do not set @code{errno} after calling math functions that are executed
9098 with a single instruction, e.g., @code{sqrt}.  A program that relies on
9099 IEEE exceptions for math error handling may want to use this flag
9100 for speed while maintaining IEEE arithmetic compatibility.
9102 This option is not turned on by any @option{-O} option since
9103 it can result in incorrect output for programs that depend on
9104 an exact implementation of IEEE or ISO rules/specifications for
9105 math functions. It may, however, yield faster code for programs
9106 that do not require the guarantees of these specifications.
9108 The default is @option{-fmath-errno}.
9110 On Darwin systems, the math library never sets @code{errno}.  There is
9111 therefore no reason for the compiler to consider the possibility that
9112 it might, and @option{-fno-math-errno} is the default.
9114 @item -funsafe-math-optimizations
9115 @opindex funsafe-math-optimizations
9117 Allow optimizations for floating-point arithmetic that (a) assume
9118 that arguments and results are valid and (b) may violate IEEE or
9119 ANSI standards.  When used at link-time, it may include libraries
9120 or startup files that change the default FPU control word or other
9121 similar optimizations.
9123 This option is not turned on by any @option{-O} option since
9124 it can result in incorrect output for programs that depend on
9125 an exact implementation of IEEE or ISO rules/specifications for
9126 math functions. It may, however, yield faster code for programs
9127 that do not require the guarantees of these specifications.
9128 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
9129 @option{-fassociative-math} and @option{-freciprocal-math}.
9131 The default is @option{-fno-unsafe-math-optimizations}.
9133 @item -fassociative-math
9134 @opindex fassociative-math
9136 Allow re-association of operands in series of floating-point operations.
9137 This violates the ISO C and C++ language standard by possibly changing
9138 computation result.  NOTE: re-ordering may change the sign of zero as
9139 well as ignore NaNs and inhibit or create underflow or overflow (and
9140 thus cannot be used on code that relies on rounding behavior like
9141 @code{(x + 2**52) - 2**52}.  May also reorder floating-point comparisons
9142 and thus may not be used when ordered comparisons are required.
9143 This option requires that both @option{-fno-signed-zeros} and
9144 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
9145 much sense with @option{-frounding-math}. For Fortran the option
9146 is automatically enabled when both @option{-fno-signed-zeros} and
9147 @option{-fno-trapping-math} are in effect.
9149 The default is @option{-fno-associative-math}.
9151 @item -freciprocal-math
9152 @opindex freciprocal-math
9154 Allow the reciprocal of a value to be used instead of dividing by
9155 the value if this enables optimizations.  For example @code{x / y}
9156 can be replaced with @code{x * (1/y)}, which is useful if @code{(1/y)}
9157 is subject to common subexpression elimination.  Note that this loses
9158 precision and increases the number of flops operating on the value.
9160 The default is @option{-fno-reciprocal-math}.
9162 @item -ffinite-math-only
9163 @opindex ffinite-math-only
9164 Allow optimizations for floating-point arithmetic that assume
9165 that arguments and results are not NaNs or +-Infs.
9167 This option is not turned on by any @option{-O} option since
9168 it can result in incorrect output for programs that depend on
9169 an exact implementation of IEEE or ISO rules/specifications for
9170 math functions. It may, however, yield faster code for programs
9171 that do not require the guarantees of these specifications.
9173 The default is @option{-fno-finite-math-only}.
9175 @item -fno-signed-zeros
9176 @opindex fno-signed-zeros
9177 Allow optimizations for floating-point arithmetic that ignore the
9178 signedness of zero.  IEEE arithmetic specifies the behavior of
9179 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
9180 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
9181 This option implies that the sign of a zero result isn't significant.
9183 The default is @option{-fsigned-zeros}.
9185 @item -fno-trapping-math
9186 @opindex fno-trapping-math
9187 Compile code assuming that floating-point operations cannot generate
9188 user-visible traps.  These traps include division by zero, overflow,
9189 underflow, inexact result and invalid operation.  This option requires
9190 that @option{-fno-signaling-nans} be in effect.  Setting this option may
9191 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
9193 This option should never be turned on by any @option{-O} option since
9194 it can result in incorrect output for programs that depend on
9195 an exact implementation of IEEE or ISO rules/specifications for
9196 math functions.
9198 The default is @option{-ftrapping-math}.
9200 @item -frounding-math
9201 @opindex frounding-math
9202 Disable transformations and optimizations that assume default floating-point
9203 rounding behavior.  This is round-to-zero for all floating point
9204 to integer conversions, and round-to-nearest for all other arithmetic
9205 truncations.  This option should be specified for programs that change
9206 the FP rounding mode dynamically, or that may be executed with a
9207 non-default rounding mode.  This option disables constant folding of
9208 floating-point expressions at compile time (which may be affected by
9209 rounding mode) and arithmetic transformations that are unsafe in the
9210 presence of sign-dependent rounding modes.
9212 The default is @option{-fno-rounding-math}.
9214 This option is experimental and does not currently guarantee to
9215 disable all GCC optimizations that are affected by rounding mode.
9216 Future versions of GCC may provide finer control of this setting
9217 using C99's @code{FENV_ACCESS} pragma.  This command-line option
9218 will be used to specify the default state for @code{FENV_ACCESS}.
9220 @item -fsignaling-nans
9221 @opindex fsignaling-nans
9222 Compile code assuming that IEEE signaling NaNs may generate user-visible
9223 traps during floating-point operations.  Setting this option disables
9224 optimizations that may change the number of exceptions visible with
9225 signaling NaNs.  This option implies @option{-ftrapping-math}.
9227 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
9228 be defined.
9230 The default is @option{-fno-signaling-nans}.
9232 This option is experimental and does not currently guarantee to
9233 disable all GCC optimizations that affect signaling NaN behavior.
9235 @item -fsingle-precision-constant
9236 @opindex fsingle-precision-constant
9237 Treat floating-point constants as single precision instead of
9238 implicitly converting them to double-precision constants.
9240 @item -fcx-limited-range
9241 @opindex fcx-limited-range
9242 When enabled, this option states that a range reduction step is not
9243 needed when performing complex division.  Also, there is no checking
9244 whether the result of a complex multiplication or division is @code{NaN
9245 + I*NaN}, with an attempt to rescue the situation in that case.  The
9246 default is @option{-fno-cx-limited-range}, but is enabled by
9247 @option{-ffast-math}.
9249 This option controls the default setting of the ISO C99
9250 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
9251 all languages.
9253 @item -fcx-fortran-rules
9254 @opindex fcx-fortran-rules
9255 Complex multiplication and division follow Fortran rules.  Range
9256 reduction is done as part of complex division, but there is no checking
9257 whether the result of a complex multiplication or division is @code{NaN
9258 + I*NaN}, with an attempt to rescue the situation in that case.
9260 The default is @option{-fno-cx-fortran-rules}.
9262 @end table
9264 The following options control optimizations that may improve
9265 performance, but are not enabled by any @option{-O} options.  This
9266 section includes experimental options that may produce broken code.
9268 @table @gcctabopt
9269 @item -fbranch-probabilities
9270 @opindex fbranch-probabilities
9271 After running a program compiled with @option{-fprofile-arcs}
9272 (@pxref{Debugging Options,, Options for Debugging Your Program or
9273 @command{gcc}}), you can compile it a second time using
9274 @option{-fbranch-probabilities}, to improve optimizations based on
9275 the number of times each branch was taken.  When a program
9276 compiled with @option{-fprofile-arcs} exits, it saves arc execution
9277 counts to a file called @file{@var{sourcename}.gcda} for each source
9278 file.  The information in this data file is very dependent on the
9279 structure of the generated code, so you must use the same source code
9280 and the same optimization options for both compilations.
9282 With @option{-fbranch-probabilities}, GCC puts a
9283 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
9284 These can be used to improve optimization.  Currently, they are only
9285 used in one place: in @file{reorg.c}, instead of guessing which path a
9286 branch is most likely to take, the @samp{REG_BR_PROB} values are used to
9287 exactly determine which path is taken more often.
9289 @item -fprofile-values
9290 @opindex fprofile-values
9291 If combined with @option{-fprofile-arcs}, it adds code so that some
9292 data about values of expressions in the program is gathered.
9294 With @option{-fbranch-probabilities}, it reads back the data gathered
9295 from profiling values of expressions for usage in optimizations.
9297 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
9299 @item -fprofile-reorder-functions
9300 @opindex fprofile-reorder-functions
9301 Function reordering based on profile instrumentation collects
9302 first time of execution of a function and orders these functions
9303 in ascending order.
9305 Enabled with @option{-fprofile-use}.
9307 @item -fvpt
9308 @opindex fvpt
9309 If combined with @option{-fprofile-arcs}, this option instructs the compiler
9310 to add code to gather information about values of expressions.
9312 With @option{-fbranch-probabilities}, it reads back the data gathered
9313 and actually performs the optimizations based on them.
9314 Currently the optimizations include specialization of division operations
9315 using the knowledge about the value of the denominator.
9317 @item -frename-registers
9318 @opindex frename-registers
9319 Attempt to avoid false dependencies in scheduled code by making use
9320 of registers left over after register allocation.  This optimization
9321 most benefits processors with lots of registers.  Depending on the
9322 debug information format adopted by the target, however, it can
9323 make debugging impossible, since variables no longer stay in
9324 a ``home register''.
9326 Enabled by default with @option{-funroll-loops} and @option{-fpeel-loops}.
9328 @item -ftracer
9329 @opindex ftracer
9330 Perform tail duplication to enlarge superblock size.  This transformation
9331 simplifies the control flow of the function allowing other optimizations to do
9332 a better job.
9334 Enabled with @option{-fprofile-use}.
9336 @item -funroll-loops
9337 @opindex funroll-loops
9338 Unroll loops whose number of iterations can be determined at compile time or
9339 upon entry to the loop.  @option{-funroll-loops} implies
9340 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
9341 It also turns on complete loop peeling (i.e.@: complete removal of loops with
9342 a small constant number of iterations).  This option makes code larger, and may
9343 or may not make it run faster.
9345 Enabled with @option{-fprofile-use}.
9347 @item -funroll-all-loops
9348 @opindex funroll-all-loops
9349 Unroll all loops, even if their number of iterations is uncertain when
9350 the loop is entered.  This usually makes programs run more slowly.
9351 @option{-funroll-all-loops} implies the same options as
9352 @option{-funroll-loops}.
9354 @item -fpeel-loops
9355 @opindex fpeel-loops
9356 Peels loops for which there is enough information that they do not
9357 roll much (from profile feedback).  It also turns on complete loop peeling
9358 (i.e.@: complete removal of loops with small constant number of iterations).
9360 Enabled with @option{-fprofile-use}.
9362 @item -fmove-loop-invariants
9363 @opindex fmove-loop-invariants
9364 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
9365 at level @option{-O1}
9367 @item -funswitch-loops
9368 @opindex funswitch-loops
9369 Move branches with loop invariant conditions out of the loop, with duplicates
9370 of the loop on both branches (modified according to result of the condition).
9372 @item -ffunction-sections
9373 @itemx -fdata-sections
9374 @opindex ffunction-sections
9375 @opindex fdata-sections
9376 Place each function or data item into its own section in the output
9377 file if the target supports arbitrary sections.  The name of the
9378 function or the name of the data item determines the section's name
9379 in the output file.
9381 Use these options on systems where the linker can perform optimizations
9382 to improve locality of reference in the instruction space.  Most systems
9383 using the ELF object format and SPARC processors running Solaris 2 have
9384 linkers with such optimizations.  AIX may have these optimizations in
9385 the future.
9387 Only use these options when there are significant benefits from doing
9388 so.  When you specify these options, the assembler and linker
9389 create larger object and executable files and are also slower.
9390 You cannot use @code{gprof} on all systems if you
9391 specify this option, and you may have problems with debugging if
9392 you specify both this option and @option{-g}.
9394 @item -fbranch-target-load-optimize
9395 @opindex fbranch-target-load-optimize
9396 Perform branch target register load optimization before prologue / epilogue
9397 threading.
9398 The use of target registers can typically be exposed only during reload,
9399 thus hoisting loads out of loops and doing inter-block scheduling needs
9400 a separate optimization pass.
9402 @item -fbranch-target-load-optimize2
9403 @opindex fbranch-target-load-optimize2
9404 Perform branch target register load optimization after prologue / epilogue
9405 threading.
9407 @item -fbtr-bb-exclusive
9408 @opindex fbtr-bb-exclusive
9409 When performing branch target register load optimization, don't reuse
9410 branch target registers within any basic block.
9412 @item -fstack-protector
9413 @opindex fstack-protector
9414 Emit extra code to check for buffer overflows, such as stack smashing
9415 attacks.  This is done by adding a guard variable to functions with
9416 vulnerable objects.  This includes functions that call @code{alloca}, and
9417 functions with buffers larger than 8 bytes.  The guards are initialized
9418 when a function is entered and then checked when the function exits.
9419 If a guard check fails, an error message is printed and the program exits.
9421 @item -fstack-protector-all
9422 @opindex fstack-protector-all
9423 Like @option{-fstack-protector} except that all functions are protected.
9425 @item -fstack-protector-strong
9426 @opindex fstack-protector-strong
9427 Like @option{-fstack-protector} but includes additional functions to
9428 be protected --- those that have local array definitions, or have
9429 references to local frame addresses.
9431 @item -fsection-anchors
9432 @opindex fsection-anchors
9433 Try to reduce the number of symbolic address calculations by using
9434 shared ``anchor'' symbols to address nearby objects.  This transformation
9435 can help to reduce the number of GOT entries and GOT accesses on some
9436 targets.
9438 For example, the implementation of the following function @code{foo}:
9440 @smallexample
9441 static int a, b, c;
9442 int foo (void) @{ return a + b + c; @}
9443 @end smallexample
9445 @noindent
9446 usually calculates the addresses of all three variables, but if you
9447 compile it with @option{-fsection-anchors}, it accesses the variables
9448 from a common anchor point instead.  The effect is similar to the
9449 following pseudocode (which isn't valid C):
9451 @smallexample
9452 int foo (void)
9454   register int *xr = &x;
9455   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
9457 @end smallexample
9459 Not all targets support this option.
9461 @item --param @var{name}=@var{value}
9462 @opindex param
9463 In some places, GCC uses various constants to control the amount of
9464 optimization that is done.  For example, GCC does not inline functions
9465 that contain more than a certain number of instructions.  You can
9466 control some of these constants on the command line using the
9467 @option{--param} option.
9469 The names of specific parameters, and the meaning of the values, are
9470 tied to the internals of the compiler, and are subject to change
9471 without notice in future releases.
9473 In each case, the @var{value} is an integer.  The allowable choices for
9474 @var{name} are:
9476 @table @gcctabopt
9477 @item predictable-branch-outcome
9478 When branch is predicted to be taken with probability lower than this threshold
9479 (in percent), then it is considered well predictable. The default is 10.
9481 @item max-crossjump-edges
9482 The maximum number of incoming edges to consider for cross-jumping.
9483 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
9484 the number of edges incoming to each block.  Increasing values mean
9485 more aggressive optimization, making the compilation time increase with
9486 probably small improvement in executable size.
9488 @item min-crossjump-insns
9489 The minimum number of instructions that must be matched at the end
9490 of two blocks before cross-jumping is performed on them.  This
9491 value is ignored in the case where all instructions in the block being
9492 cross-jumped from are matched.  The default value is 5.
9494 @item max-grow-copy-bb-insns
9495 The maximum code size expansion factor when copying basic blocks
9496 instead of jumping.  The expansion is relative to a jump instruction.
9497 The default value is 8.
9499 @item max-goto-duplication-insns
9500 The maximum number of instructions to duplicate to a block that jumps
9501 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
9502 passes, GCC factors computed gotos early in the compilation process,
9503 and unfactors them as late as possible.  Only computed jumps at the
9504 end of a basic blocks with no more than max-goto-duplication-insns are
9505 unfactored.  The default value is 8.
9507 @item max-delay-slot-insn-search
9508 The maximum number of instructions to consider when looking for an
9509 instruction to fill a delay slot.  If more than this arbitrary number of
9510 instructions are searched, the time savings from filling the delay slot
9511 are minimal, so stop searching.  Increasing values mean more
9512 aggressive optimization, making the compilation time increase with probably
9513 small improvement in execution time.
9515 @item max-delay-slot-live-search
9516 When trying to fill delay slots, the maximum number of instructions to
9517 consider when searching for a block with valid live register
9518 information.  Increasing this arbitrarily chosen value means more
9519 aggressive optimization, increasing the compilation time.  This parameter
9520 should be removed when the delay slot code is rewritten to maintain the
9521 control-flow graph.
9523 @item max-gcse-memory
9524 The approximate maximum amount of memory that can be allocated in
9525 order to perform the global common subexpression elimination
9526 optimization.  If more memory than specified is required, the
9527 optimization is not done.
9529 @item max-gcse-insertion-ratio
9530 If the ratio of expression insertions to deletions is larger than this value
9531 for any expression, then RTL PRE inserts or removes the expression and thus
9532 leaves partially redundant computations in the instruction stream.  The default value is 20.
9534 @item max-pending-list-length
9535 The maximum number of pending dependencies scheduling allows
9536 before flushing the current state and starting over.  Large functions
9537 with few branches or calls can create excessively large lists which
9538 needlessly consume memory and resources.
9540 @item max-modulo-backtrack-attempts
9541 The maximum number of backtrack attempts the scheduler should make
9542 when modulo scheduling a loop.  Larger values can exponentially increase
9543 compilation time.
9545 @item max-inline-insns-single
9546 Several parameters control the tree inliner used in GCC@.
9547 This number sets the maximum number of instructions (counted in GCC's
9548 internal representation) in a single function that the tree inliner
9549 considers for inlining.  This only affects functions declared
9550 inline and methods implemented in a class declaration (C++).
9551 The default value is 400.
9553 @item max-inline-insns-auto
9554 When you use @option{-finline-functions} (included in @option{-O3}),
9555 a lot of functions that would otherwise not be considered for inlining
9556 by the compiler are investigated.  To those functions, a different
9557 (more restrictive) limit compared to functions declared inline can
9558 be applied.
9559 The default value is 40.
9561 @item inline-min-speedup
9562 When estimated performance improvement of caller + callee runtime exceeds this
9563 threshold (in precent), the function can be inlined regardless the limit on
9564 @option{--param max-inline-insns-single} and @option{--param
9565 max-inline-insns-auto}.
9567 @item large-function-insns
9568 The limit specifying really large functions.  For functions larger than this
9569 limit after inlining, inlining is constrained by
9570 @option{--param large-function-growth}.  This parameter is useful primarily
9571 to avoid extreme compilation time caused by non-linear algorithms used by the
9572 back end.
9573 The default value is 2700.
9575 @item large-function-growth
9576 Specifies maximal growth of large function caused by inlining in percents.
9577 The default value is 100 which limits large function growth to 2.0 times
9578 the original size.
9580 @item large-unit-insns
9581 The limit specifying large translation unit.  Growth caused by inlining of
9582 units larger than this limit is limited by @option{--param inline-unit-growth}.
9583 For small units this might be too tight.
9584 For example, consider a unit consisting of function A
9585 that is inline and B that just calls A three times.  If B is small relative to
9586 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
9587 large units consisting of small inlineable functions, however, the overall unit
9588 growth limit is needed to avoid exponential explosion of code size.  Thus for
9589 smaller units, the size is increased to @option{--param large-unit-insns}
9590 before applying @option{--param inline-unit-growth}.  The default is 10000.
9592 @item inline-unit-growth
9593 Specifies maximal overall growth of the compilation unit caused by inlining.
9594 The default value is 30 which limits unit growth to 1.3 times the original
9595 size. Cold functions (either marked cold via an attribibute or by profile
9596 feedback) are not accounted into the unit size.
9598 @item ipcp-unit-growth
9599 Specifies maximal overall growth of the compilation unit caused by
9600 interprocedural constant propagation.  The default value is 10 which limits
9601 unit growth to 1.1 times the original size.
9603 @item large-stack-frame
9604 The limit specifying large stack frames.  While inlining the algorithm is trying
9605 to not grow past this limit too much.  The default value is 256 bytes.
9607 @item large-stack-frame-growth
9608 Specifies maximal growth of large stack frames caused by inlining in percents.
9609 The default value is 1000 which limits large stack frame growth to 11 times
9610 the original size.
9612 @item max-inline-insns-recursive
9613 @itemx max-inline-insns-recursive-auto
9614 Specifies the maximum number of instructions an out-of-line copy of a
9615 self-recursive inline
9616 function can grow into by performing recursive inlining.
9618 For functions declared inline, @option{--param max-inline-insns-recursive} is
9619 taken into account.  For functions not declared inline, recursive inlining
9620 happens only when @option{-finline-functions} (included in @option{-O3}) is
9621 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
9622 default value is 450.
9624 @item max-inline-recursive-depth
9625 @itemx max-inline-recursive-depth-auto
9626 Specifies the maximum recursion depth used for recursive inlining.
9628 For functions declared inline, @option{--param max-inline-recursive-depth} is
9629 taken into account.  For functions not declared inline, recursive inlining
9630 happens only when @option{-finline-functions} (included in @option{-O3}) is
9631 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
9632 default value is 8.
9634 @item min-inline-recursive-probability
9635 Recursive inlining is profitable only for function having deep recursion
9636 in average and can hurt for function having little recursion depth by
9637 increasing the prologue size or complexity of function body to other
9638 optimizers.
9640 When profile feedback is available (see @option{-fprofile-generate}) the actual
9641 recursion depth can be guessed from probability that function recurses via a
9642 given call expression.  This parameter limits inlining only to call expressions
9643 whose probability exceeds the given threshold (in percents).
9644 The default value is 10.
9646 @item early-inlining-insns
9647 Specify growth that the early inliner can make.  In effect it increases
9648 the amount of inlining for code having a large abstraction penalty.
9649 The default value is 10.
9651 @item max-early-inliner-iterations
9652 @itemx max-early-inliner-iterations
9653 Limit of iterations of the early inliner.  This basically bounds
9654 the number of nested indirect calls the early inliner can resolve.
9655 Deeper chains are still handled by late inlining.
9657 @item comdat-sharing-probability
9658 @itemx comdat-sharing-probability
9659 Probability (in percent) that C++ inline function with comdat visibility
9660 are shared across multiple compilation units.  The default value is 20.
9662 @item profile-func-internal-id
9663 @itemx profile-func-internal-id
9664 A parameter to control whether to use function internal id in profile
9665 database lookup. If the value is 0, the compiler will use id that
9666 is based on function assembler name and filename, which makes old profile
9667 data more tolerant to source changes such as function reordering etc.
9668 The default value is 0.
9670 @item min-vect-loop-bound
9671 The minimum number of iterations under which loops are not vectorized
9672 when @option{-ftree-vectorize} is used.  The number of iterations after
9673 vectorization needs to be greater than the value specified by this option
9674 to allow vectorization.  The default value is 0.
9676 @item gcse-cost-distance-ratio
9677 Scaling factor in calculation of maximum distance an expression
9678 can be moved by GCSE optimizations.  This is currently supported only in the
9679 code hoisting pass.  The bigger the ratio, the more aggressive code hoisting
9680 is with simple expressions, i.e., the expressions that have cost
9681 less than @option{gcse-unrestricted-cost}.  Specifying 0 disables
9682 hoisting of simple expressions.  The default value is 10.
9684 @item gcse-unrestricted-cost
9685 Cost, roughly measured as the cost of a single typical machine
9686 instruction, at which GCSE optimizations do not constrain
9687 the distance an expression can travel.  This is currently
9688 supported only in the code hoisting pass.  The lesser the cost,
9689 the more aggressive code hoisting is.  Specifying 0 
9690 allows all expressions to travel unrestricted distances.
9691 The default value is 3.
9693 @item max-hoist-depth
9694 The depth of search in the dominator tree for expressions to hoist.
9695 This is used to avoid quadratic behavior in hoisting algorithm.
9696 The value of 0 does not limit on the search, but may slow down compilation
9697 of huge functions.  The default value is 30.
9699 @item max-tail-merge-comparisons
9700 The maximum amount of similar bbs to compare a bb with.  This is used to
9701 avoid quadratic behavior in tree tail merging.  The default value is 10.
9703 @item max-tail-merge-iterations
9704 The maximum amount of iterations of the pass over the function.  This is used to
9705 limit compilation time in tree tail merging.  The default value is 2.
9707 @item max-unrolled-insns
9708 The maximum number of instructions that a loop may have to be unrolled.
9709 If a loop is unrolled, this parameter also determines how many times
9710 the loop code is unrolled.
9712 @item max-average-unrolled-insns
9713 The maximum number of instructions biased by probabilities of their execution
9714 that a loop may have to be unrolled.  If a loop is unrolled,
9715 this parameter also determines how many times the loop code is unrolled.
9717 @item max-unroll-times
9718 The maximum number of unrollings of a single loop.
9720 @item max-peeled-insns
9721 The maximum number of instructions that a loop may have to be peeled.
9722 If a loop is peeled, this parameter also determines how many times
9723 the loop code is peeled.
9725 @item max-peel-times
9726 The maximum number of peelings of a single loop.
9728 @item max-peel-branches
9729 The maximum number of branches on the hot path through the peeled sequence.
9731 @item max-completely-peeled-insns
9732 The maximum number of insns of a completely peeled loop.
9734 @item max-completely-peel-times
9735 The maximum number of iterations of a loop to be suitable for complete peeling.
9737 @item max-completely-peel-loop-nest-depth
9738 The maximum depth of a loop nest suitable for complete peeling.
9740 @item max-unswitch-insns
9741 The maximum number of insns of an unswitched loop.
9743 @item max-unswitch-level
9744 The maximum number of branches unswitched in a single loop.
9746 @item lim-expensive
9747 The minimum cost of an expensive expression in the loop invariant motion.
9749 @item iv-consider-all-candidates-bound
9750 Bound on number of candidates for induction variables, below which
9751 all candidates are considered for each use in induction variable
9752 optimizations.  If there are more candidates than this,
9753 only the most relevant ones are considered to avoid quadratic time complexity.
9755 @item iv-max-considered-uses
9756 The induction variable optimizations give up on loops that contain more
9757 induction variable uses.
9759 @item iv-always-prune-cand-set-bound
9760 If the number of candidates in the set is smaller than this value,
9761 always try to remove unnecessary ivs from the set
9762 when adding a new one.
9764 @item scev-max-expr-size
9765 Bound on size of expressions used in the scalar evolutions analyzer.
9766 Large expressions slow the analyzer.
9768 @item scev-max-expr-complexity
9769 Bound on the complexity of the expressions in the scalar evolutions analyzer.
9770 Complex expressions slow the analyzer.
9772 @item omega-max-vars
9773 The maximum number of variables in an Omega constraint system.
9774 The default value is 128.
9776 @item omega-max-geqs
9777 The maximum number of inequalities in an Omega constraint system.
9778 The default value is 256.
9780 @item omega-max-eqs
9781 The maximum number of equalities in an Omega constraint system.
9782 The default value is 128.
9784 @item omega-max-wild-cards
9785 The maximum number of wildcard variables that the Omega solver is
9786 able to insert.  The default value is 18.
9788 @item omega-hash-table-size
9789 The size of the hash table in the Omega solver.  The default value is
9790 550.
9792 @item omega-max-keys
9793 The maximal number of keys used by the Omega solver.  The default
9794 value is 500.
9796 @item omega-eliminate-redundant-constraints
9797 When set to 1, use expensive methods to eliminate all redundant
9798 constraints.  The default value is 0.
9800 @item vect-max-version-for-alignment-checks
9801 The maximum number of run-time checks that can be performed when
9802 doing loop versioning for alignment in the vectorizer. 
9804 @item vect-max-version-for-alias-checks
9805 The maximum number of run-time checks that can be performed when
9806 doing loop versioning for alias in the vectorizer. 
9808 @item vect-max-peeling-for-alignment
9809 The maximum number of loop peels to enhance access alignment
9810 for vectorizer. Value -1 means 'no limit'.
9812 @item max-iterations-to-track
9813 The maximum number of iterations of a loop the brute-force algorithm
9814 for analysis of the number of iterations of the loop tries to evaluate.
9816 @item hot-bb-count-ws-permille
9817 A basic block profile count is considered hot if it contributes to 
9818 the given permillage (i.e. 0...1000) of the entire profiled execution.
9820 @item hot-bb-frequency-fraction
9821 Select fraction of the entry block frequency of executions of basic block in
9822 function given basic block needs to have to be considered hot.
9824 @item max-predicted-iterations
9825 The maximum number of loop iterations we predict statically.  This is useful
9826 in cases where a function contains a single loop with known bound and
9827 another loop with unknown bound.
9828 The known number of iterations is predicted correctly, while
9829 the unknown number of iterations average to roughly 10.  This means that the
9830 loop without bounds appears artificially cold relative to the other one.
9832 @item builtin-expect-probability
9833 Control the probability of the expression having the specified value. This
9834 parameter takes a percentage (i.e. 0 ... 100) as input.
9835 The default probability of 90 is obtained empirically.
9837 @item align-threshold
9839 Select fraction of the maximal frequency of executions of a basic block in
9840 a function to align the basic block.
9842 @item align-loop-iterations
9844 A loop expected to iterate at least the selected number of iterations is
9845 aligned.
9847 @item tracer-dynamic-coverage
9848 @itemx tracer-dynamic-coverage-feedback
9850 This value is used to limit superblock formation once the given percentage of
9851 executed instructions is covered.  This limits unnecessary code size
9852 expansion.
9854 The @option{tracer-dynamic-coverage-feedback} is used only when profile
9855 feedback is available.  The real profiles (as opposed to statically estimated
9856 ones) are much less balanced allowing the threshold to be larger value.
9858 @item tracer-max-code-growth
9859 Stop tail duplication once code growth has reached given percentage.  This is
9860 a rather artificial limit, as most of the duplicates are eliminated later in
9861 cross jumping, so it may be set to much higher values than is the desired code
9862 growth.
9864 @item tracer-min-branch-ratio
9866 Stop reverse growth when the reverse probability of best edge is less than this
9867 threshold (in percent).
9869 @item tracer-min-branch-ratio
9870 @itemx tracer-min-branch-ratio-feedback
9872 Stop forward growth if the best edge has probability lower than this
9873 threshold.
9875 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
9876 compilation for profile feedback and one for compilation without.  The value
9877 for compilation with profile feedback needs to be more conservative (higher) in
9878 order to make tracer effective.
9880 @item max-cse-path-length
9882 The maximum number of basic blocks on path that CSE considers.
9883 The default is 10.
9885 @item max-cse-insns
9886 The maximum number of instructions CSE processes before flushing.
9887 The default is 1000.
9889 @item ggc-min-expand
9891 GCC uses a garbage collector to manage its own memory allocation.  This
9892 parameter specifies the minimum percentage by which the garbage
9893 collector's heap should be allowed to expand between collections.
9894 Tuning this may improve compilation speed; it has no effect on code
9895 generation.
9897 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
9898 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of ``RAM'' is
9899 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
9900 GCC is not able to calculate RAM on a particular platform, the lower
9901 bound of 30% is used.  Setting this parameter and
9902 @option{ggc-min-heapsize} to zero causes a full collection to occur at
9903 every opportunity.  This is extremely slow, but can be useful for
9904 debugging.
9906 @item ggc-min-heapsize
9908 Minimum size of the garbage collector's heap before it begins bothering
9909 to collect garbage.  The first collection occurs after the heap expands
9910 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
9911 tuning this may improve compilation speed, and has no effect on code
9912 generation.
9914 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit that
9915 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
9916 with a lower bound of 4096 (four megabytes) and an upper bound of
9917 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
9918 particular platform, the lower bound is used.  Setting this parameter
9919 very large effectively disables garbage collection.  Setting this
9920 parameter and @option{ggc-min-expand} to zero causes a full collection
9921 to occur at every opportunity.
9923 @item max-reload-search-insns
9924 The maximum number of instruction reload should look backward for equivalent
9925 register.  Increasing values mean more aggressive optimization, making the
9926 compilation time increase with probably slightly better performance.
9927 The default value is 100.
9929 @item max-cselib-memory-locations
9930 The maximum number of memory locations cselib should take into account.
9931 Increasing values mean more aggressive optimization, making the compilation time
9932 increase with probably slightly better performance.  The default value is 500.
9934 @item reorder-blocks-duplicate
9935 @itemx reorder-blocks-duplicate-feedback
9937 Used by the basic block reordering pass to decide whether to use unconditional
9938 branch or duplicate the code on its destination.  Code is duplicated when its
9939 estimated size is smaller than this value multiplied by the estimated size of
9940 unconditional jump in the hot spots of the program.
9942 The @option{reorder-block-duplicate-feedback} is used only when profile
9943 feedback is available.  It may be set to higher values than
9944 @option{reorder-block-duplicate} since information about the hot spots is more
9945 accurate.
9947 @item max-sched-ready-insns
9948 The maximum number of instructions ready to be issued the scheduler should
9949 consider at any given time during the first scheduling pass.  Increasing
9950 values mean more thorough searches, making the compilation time increase
9951 with probably little benefit.  The default value is 100.
9953 @item max-sched-region-blocks
9954 The maximum number of blocks in a region to be considered for
9955 interblock scheduling.  The default value is 10.
9957 @item max-pipeline-region-blocks
9958 The maximum number of blocks in a region to be considered for
9959 pipelining in the selective scheduler.  The default value is 15.
9961 @item max-sched-region-insns
9962 The maximum number of insns in a region to be considered for
9963 interblock scheduling.  The default value is 100.
9965 @item max-pipeline-region-insns
9966 The maximum number of insns in a region to be considered for
9967 pipelining in the selective scheduler.  The default value is 200.
9969 @item min-spec-prob
9970 The minimum probability (in percents) of reaching a source block
9971 for interblock speculative scheduling.  The default value is 40.
9973 @item max-sched-extend-regions-iters
9974 The maximum number of iterations through CFG to extend regions.
9975 A value of 0 (the default) disables region extensions.
9977 @item max-sched-insn-conflict-delay
9978 The maximum conflict delay for an insn to be considered for speculative motion.
9979 The default value is 3.
9981 @item sched-spec-prob-cutoff
9982 The minimal probability of speculation success (in percents), so that
9983 speculative insns are scheduled.
9984 The default value is 40.
9986 @item sched-spec-state-edge-prob-cutoff
9987 The minimum probability an edge must have for the scheduler to save its
9988 state across it.
9989 The default value is 10.
9991 @item sched-mem-true-dep-cost
9992 Minimal distance (in CPU cycles) between store and load targeting same
9993 memory locations.  The default value is 1.
9995 @item selsched-max-lookahead
9996 The maximum size of the lookahead window of selective scheduling.  It is a
9997 depth of search for available instructions.
9998 The default value is 50.
10000 @item selsched-max-sched-times
10001 The maximum number of times that an instruction is scheduled during
10002 selective scheduling.  This is the limit on the number of iterations
10003 through which the instruction may be pipelined.  The default value is 2.
10005 @item selsched-max-insns-to-rename
10006 The maximum number of best instructions in the ready list that are considered
10007 for renaming in the selective scheduler.  The default value is 2.
10009 @item sms-min-sc
10010 The minimum value of stage count that swing modulo scheduler
10011 generates.  The default value is 2.
10013 @item max-last-value-rtl
10014 The maximum size measured as number of RTLs that can be recorded in an expression
10015 in combiner for a pseudo register as last known value of that register.  The default
10016 is 10000.
10018 @item max-combine-insns
10019 The maximum number of instructions the RTL combiner tries to combine.
10020 The default value is 2 at @option{-Og} and 4 otherwise.
10022 @item integer-share-limit
10023 Small integer constants can use a shared data structure, reducing the
10024 compiler's memory usage and increasing its speed.  This sets the maximum
10025 value of a shared integer constant.  The default value is 256.
10027 @item ssp-buffer-size
10028 The minimum size of buffers (i.e.@: arrays) that receive stack smashing
10029 protection when @option{-fstack-protection} is used.
10031 @item min-size-for-stack-sharing
10032 The minimum size of variables taking part in stack slot sharing when not
10033 optimizing. The default value is 32.
10035 @item max-jump-thread-duplication-stmts
10036 Maximum number of statements allowed in a block that needs to be
10037 duplicated when threading jumps.
10039 @item max-fields-for-field-sensitive
10040 Maximum number of fields in a structure treated in
10041 a field sensitive manner during pointer analysis.  The default is zero
10042 for @option{-O0} and @option{-O1},
10043 and 100 for @option{-Os}, @option{-O2}, and @option{-O3}.
10045 @item prefetch-latency
10046 Estimate on average number of instructions that are executed before
10047 prefetch finishes.  The distance prefetched ahead is proportional
10048 to this constant.  Increasing this number may also lead to less
10049 streams being prefetched (see @option{simultaneous-prefetches}).
10051 @item simultaneous-prefetches
10052 Maximum number of prefetches that can run at the same time.
10054 @item l1-cache-line-size
10055 The size of cache line in L1 cache, in bytes.
10057 @item l1-cache-size
10058 The size of L1 cache, in kilobytes.
10060 @item l2-cache-size
10061 The size of L2 cache, in kilobytes.
10063 @item min-insn-to-prefetch-ratio
10064 The minimum ratio between the number of instructions and the
10065 number of prefetches to enable prefetching in a loop.
10067 @item prefetch-min-insn-to-mem-ratio
10068 The minimum ratio between the number of instructions and the
10069 number of memory references to enable prefetching in a loop.
10071 @item use-canonical-types
10072 Whether the compiler should use the ``canonical'' type system.  By
10073 default, this should always be 1, which uses a more efficient internal
10074 mechanism for comparing types in C++ and Objective-C++.  However, if
10075 bugs in the canonical type system are causing compilation failures,
10076 set this value to 0 to disable canonical types.
10078 @item switch-conversion-max-branch-ratio
10079 Switch initialization conversion refuses to create arrays that are
10080 bigger than @option{switch-conversion-max-branch-ratio} times the number of
10081 branches in the switch.
10083 @item max-partial-antic-length
10084 Maximum length of the partial antic set computed during the tree
10085 partial redundancy elimination optimization (@option{-ftree-pre}) when
10086 optimizing at @option{-O3} and above.  For some sorts of source code
10087 the enhanced partial redundancy elimination optimization can run away,
10088 consuming all of the memory available on the host machine.  This
10089 parameter sets a limit on the length of the sets that are computed,
10090 which prevents the runaway behavior.  Setting a value of 0 for
10091 this parameter allows an unlimited set length.
10093 @item sccvn-max-scc-size
10094 Maximum size of a strongly connected component (SCC) during SCCVN
10095 processing.  If this limit is hit, SCCVN processing for the whole
10096 function is not done and optimizations depending on it are
10097 disabled.  The default maximum SCC size is 10000.
10099 @item sccvn-max-alias-queries-per-access
10100 Maximum number of alias-oracle queries we perform when looking for
10101 redundancies for loads and stores.  If this limit is hit the search
10102 is aborted and the load or store is not considered redundant.  The
10103 number of queries is algorithmically limited to the number of
10104 stores on all paths from the load to the function entry.
10105 The default maxmimum number of queries is 1000.
10107 @item ira-max-loops-num
10108 IRA uses regional register allocation by default.  If a function
10109 contains more loops than the number given by this parameter, only at most
10110 the given number of the most frequently-executed loops form regions
10111 for regional register allocation.  The default value of the
10112 parameter is 100.
10114 @item ira-max-conflict-table-size 
10115 Although IRA uses a sophisticated algorithm to compress the conflict
10116 table, the table can still require excessive amounts of memory for
10117 huge functions.  If the conflict table for a function could be more
10118 than the size in MB given by this parameter, the register allocator
10119 instead uses a faster, simpler, and lower-quality
10120 algorithm that does not require building a pseudo-register conflict table.  
10121 The default value of the parameter is 2000.
10123 @item ira-loop-reserved-regs
10124 IRA can be used to evaluate more accurate register pressure in loops
10125 for decisions to move loop invariants (see @option{-O3}).  The number
10126 of available registers reserved for some other purposes is given
10127 by this parameter.  The default value of the parameter is 2, which is
10128 the minimal number of registers needed by typical instructions.
10129 This value is the best found from numerous experiments.
10131 @item loop-invariant-max-bbs-in-loop
10132 Loop invariant motion can be very expensive, both in compilation time and
10133 in amount of needed compile-time memory, with very large loops.  Loops
10134 with more basic blocks than this parameter won't have loop invariant
10135 motion optimization performed on them.  The default value of the
10136 parameter is 1000 for @option{-O1} and 10000 for @option{-O2} and above.
10138 @item loop-max-datarefs-for-datadeps
10139 Building data dapendencies is expensive for very large loops.  This
10140 parameter limits the number of data references in loops that are
10141 considered for data dependence analysis.  These large loops are no
10142 handled by the optimizations using loop data dependencies.
10143 The default value is 1000.
10145 @item max-vartrack-size
10146 Sets a maximum number of hash table slots to use during variable
10147 tracking dataflow analysis of any function.  If this limit is exceeded
10148 with variable tracking at assignments enabled, analysis for that
10149 function is retried without it, after removing all debug insns from
10150 the function.  If the limit is exceeded even without debug insns, var
10151 tracking analysis is completely disabled for the function.  Setting
10152 the parameter to zero makes it unlimited.
10154 @item max-vartrack-expr-depth
10155 Sets a maximum number of recursion levels when attempting to map
10156 variable names or debug temporaries to value expressions.  This trades
10157 compilation time for more complete debug information.  If this is set too
10158 low, value expressions that are available and could be represented in
10159 debug information may end up not being used; setting this higher may
10160 enable the compiler to find more complex debug expressions, but compile
10161 time and memory use may grow.  The default is 12.
10163 @item min-nondebug-insn-uid
10164 Use uids starting at this parameter for nondebug insns.  The range below
10165 the parameter is reserved exclusively for debug insns created by
10166 @option{-fvar-tracking-assignments}, but debug insns may get
10167 (non-overlapping) uids above it if the reserved range is exhausted.
10169 @item ipa-sra-ptr-growth-factor
10170 IPA-SRA replaces a pointer to an aggregate with one or more new
10171 parameters only when their cumulative size is less or equal to
10172 @option{ipa-sra-ptr-growth-factor} times the size of the original
10173 pointer parameter.
10175 @item tm-max-aggregate-size
10176 When making copies of thread-local variables in a transaction, this
10177 parameter specifies the size in bytes after which variables are
10178 saved with the logging functions as opposed to save/restore code
10179 sequence pairs.  This option only applies when using
10180 @option{-fgnu-tm}.
10182 @item graphite-max-nb-scop-params
10183 To avoid exponential effects in the Graphite loop transforms, the
10184 number of parameters in a Static Control Part (SCoP) is bounded.  The
10185 default value is 10 parameters.  A variable whose value is unknown at
10186 compilation time and defined outside a SCoP is a parameter of the SCoP.
10188 @item graphite-max-bbs-per-function
10189 To avoid exponential effects in the detection of SCoPs, the size of
10190 the functions analyzed by Graphite is bounded.  The default value is
10191 100 basic blocks.
10193 @item loop-block-tile-size
10194 Loop blocking or strip mining transforms, enabled with
10195 @option{-floop-block} or @option{-floop-strip-mine}, strip mine each
10196 loop in the loop nest by a given number of iterations.  The strip
10197 length can be changed using the @option{loop-block-tile-size}
10198 parameter.  The default value is 51 iterations.
10200 @item ipa-cp-value-list-size
10201 IPA-CP attempts to track all possible values and types passed to a function's
10202 parameter in order to propagate them and perform devirtualization.
10203 @option{ipa-cp-value-list-size} is the maximum number of values and types it
10204 stores per one formal parameter of a function.
10206 @item ipa-cp-eval-threshold
10207 IPA-CP calculates its own score of cloning profitability heuristics
10208 and performs those cloning opportunities with scores that exceed
10209 @option{ipa-cp-eval-threshold}.
10211 @item ipa-max-agg-items
10212 IPA-CP is also capable to propagate a number of scalar values passed
10213 in an aggregate. @option{ipa-max-agg-items} controls the maximum
10214 number of such values per one parameter.
10216 @item ipa-cp-loop-hint-bonus
10217 When IPA-CP determines that a cloning candidate would make the number
10218 of iterations of a loop known, it adds a bonus of
10219 @option{ipa-cp-loop-hint-bonus} to the profitability score of
10220 the candidate.
10222 @item ipa-cp-array-index-hint-bonus
10223 When IPA-CP determines that a cloning candidate would make the index of
10224 an array access known, it adds a bonus of
10225 @option{ipa-cp-array-index-hint-bonus} to the profitability
10226 score of the candidate.
10228 @item ipa-max-aa-steps
10229 During its analysis of function bodies, IPA-CP employs alias analysis
10230 in order to track values pointed to by function parameters.  In order
10231 not spend too much time analyzing huge functions, it will give up and
10232 consider all memory clobbered after examining
10233 @option{ipa-max-aa-steps} statements modifying memory.
10235 @item lto-partitions
10236 Specify desired number of partitions produced during WHOPR compilation.
10237 The number of partitions should exceed the number of CPUs used for compilation.
10238 The default value is 32.
10240 @item lto-minpartition
10241 Size of minimal partition for WHOPR (in estimated instructions).
10242 This prevents expenses of splitting very small programs into too many
10243 partitions.
10245 @item cxx-max-namespaces-for-diagnostic-help
10246 The maximum number of namespaces to consult for suggestions when C++
10247 name lookup fails for an identifier.  The default is 1000.
10249 @item sink-frequency-threshold
10250 The maximum relative execution frequency (in percents) of the target block
10251 relative to a statement's original block to allow statement sinking of a
10252 statement.  Larger numbers result in more aggressive statement sinking.
10253 The default value is 75.  A small positive adjustment is applied for
10254 statements with memory operands as those are even more profitable so sink.
10256 @item max-stores-to-sink
10257 The maximum number of conditional stores paires that can be sunk.  Set to 0
10258 if either vectorization (@option{-ftree-vectorize}) or if-conversion
10259 (@option{-ftree-loop-if-convert}) is disabled.  The default is 2.
10261 @item allow-store-data-races
10262 Allow optimizers to introduce new data races on stores.
10263 Set to 1 to allow, otherwise to 0.  This option is enabled by default
10264 at optimization level @option{-Ofast}.
10266 @item case-values-threshold
10267 The smallest number of different values for which it is best to use a
10268 jump-table instead of a tree of conditional branches.  If the value is
10269 0, use the default for the machine.  The default is 0.
10271 @item tree-reassoc-width
10272 Set the maximum number of instructions executed in parallel in
10273 reassociated tree. This parameter overrides target dependent
10274 heuristics used by default if has non zero value.
10276 @item sched-pressure-algorithm
10277 Choose between the two available implementations of
10278 @option{-fsched-pressure}.  Algorithm 1 is the original implementation
10279 and is the more likely to prevent instructions from being reordered.
10280 Algorithm 2 was designed to be a compromise between the relatively
10281 conservative approach taken by algorithm 1 and the rather aggressive
10282 approach taken by the default scheduler.  It relies more heavily on
10283 having a regular register file and accurate register pressure classes.
10284 See @file{haifa-sched.c} in the GCC sources for more details.
10286 The default choice depends on the target.
10288 @item max-slsr-cand-scan
10289 Set the maximum number of existing candidates that will be considered when
10290 seeking a basis for a new straight-line strength reduction candidate.
10292 @item asan-globals
10293 Enable buffer overflow detection for global objects.  This kind
10294 of protection is enabled by default if you are using
10295 @option{-fsanitize=address} option.
10296 To disable global objects protection use @option{--param asan-globals=0}.
10298 @item asan-stack
10299 Enable buffer overflow detection for stack objects.  This kind of
10300 protection is enabled by default when using@option{-fsanitize=address}.
10301 To disable stack protection use @option{--param asan-stack=0} option.
10303 @item asan-instrument-reads
10304 Enable buffer overflow detection for memory reads.  This kind of
10305 protection is enabled by default when using @option{-fsanitize=address}.
10306 To disable memory reads protection use
10307 @option{--param asan-instrument-reads=0}.
10309 @item asan-instrument-writes
10310 Enable buffer overflow detection for memory writes.  This kind of
10311 protection is enabled by default when using @option{-fsanitize=address}.
10312 To disable memory writes protection use
10313 @option{--param asan-instrument-writes=0} option.
10315 @item asan-memintrin
10316 Enable detection for built-in functions.  This kind of protection
10317 is enabled by default when using @option{-fsanitize=address}.
10318 To disable built-in functions protection use
10319 @option{--param asan-memintrin=0}.
10321 @item asan-use-after-return
10322 Enable detection of use-after-return.  This kind of protection
10323 is enabled by default when using @option{-fsanitize=address} option.
10324 To disable use-after-return detection use 
10325 @option{--param asan-use-after-return=0}.
10327 @item asan-instrumentation-with-call-threshold
10328 Once number of memory accesses  in function becomes greater
10329 or equal than this number, use callbacks instead of
10330 generating inline code.  E.g. to disable inline code use
10331 @option{--param asan-instrumentation-with-call-threshold=0}.
10333 @end table
10334 @end table
10336 @node Preprocessor Options
10337 @section Options Controlling the Preprocessor
10338 @cindex preprocessor options
10339 @cindex options, preprocessor
10341 These options control the C preprocessor, which is run on each C source
10342 file before actual compilation.
10344 If you use the @option{-E} option, nothing is done except preprocessing.
10345 Some of these options make sense only together with @option{-E} because
10346 they cause the preprocessor output to be unsuitable for actual
10347 compilation.
10349 @table @gcctabopt
10350 @item -Wp,@var{option}
10351 @opindex Wp
10352 You can use @option{-Wp,@var{option}} to bypass the compiler driver
10353 and pass @var{option} directly through to the preprocessor.  If
10354 @var{option} contains commas, it is split into multiple options at the
10355 commas.  However, many options are modified, translated or interpreted
10356 by the compiler driver before being passed to the preprocessor, and
10357 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
10358 interface is undocumented and subject to change, so whenever possible
10359 you should avoid using @option{-Wp} and let the driver handle the
10360 options instead.
10362 @item -Xpreprocessor @var{option}
10363 @opindex Xpreprocessor
10364 Pass @var{option} as an option to the preprocessor.  You can use this to
10365 supply system-specific preprocessor options that GCC does not 
10366 recognize.
10368 If you want to pass an option that takes an argument, you must use
10369 @option{-Xpreprocessor} twice, once for the option and once for the argument.
10371 @item -no-integrated-cpp
10372 @opindex no-integrated-cpp
10373 Perform preprocessing as a separate pass before compilation.
10374 By default, GCC performs preprocessing as an integrated part of
10375 input tokenization and parsing.
10376 If this option is provided, the appropriate language front end
10377 (@command{cc1}, @command{cc1plus}, or @command{cc1obj} for C, C++,
10378 and Objective-C, respectively) is instead invoked twice,
10379 once for preprocessing only and once for actual compilation
10380 of the preprocessed input.
10381 This option may be useful in conjunction with the @option{-B} or
10382 @option{-wrapper} options to specify an alternate preprocessor or
10383 perform additional processing of the program source between
10384 normal preprocessing and compilation.
10385 @end table
10387 @include cppopts.texi
10389 @node Assembler Options
10390 @section Passing Options to the Assembler
10392 @c prevent bad page break with this line
10393 You can pass options to the assembler.
10395 @table @gcctabopt
10396 @item -Wa,@var{option}
10397 @opindex Wa
10398 Pass @var{option} as an option to the assembler.  If @var{option}
10399 contains commas, it is split into multiple options at the commas.
10401 @item -Xassembler @var{option}
10402 @opindex Xassembler
10403 Pass @var{option} as an option to the assembler.  You can use this to
10404 supply system-specific assembler options that GCC does not
10405 recognize.
10407 If you want to pass an option that takes an argument, you must use
10408 @option{-Xassembler} twice, once for the option and once for the argument.
10410 @end table
10412 @node Link Options
10413 @section Options for Linking
10414 @cindex link options
10415 @cindex options, linking
10417 These options come into play when the compiler links object files into
10418 an executable output file.  They are meaningless if the compiler is
10419 not doing a link step.
10421 @table @gcctabopt
10422 @cindex file names
10423 @item @var{object-file-name}
10424 A file name that does not end in a special recognized suffix is
10425 considered to name an object file or library.  (Object files are
10426 distinguished from libraries by the linker according to the file
10427 contents.)  If linking is done, these object files are used as input
10428 to the linker.
10430 @item -c
10431 @itemx -S
10432 @itemx -E
10433 @opindex c
10434 @opindex S
10435 @opindex E
10436 If any of these options is used, then the linker is not run, and
10437 object file names should not be used as arguments.  @xref{Overall
10438 Options}.
10440 @cindex Libraries
10441 @item -l@var{library}
10442 @itemx -l @var{library}
10443 @opindex l
10444 Search the library named @var{library} when linking.  (The second
10445 alternative with the library as a separate argument is only for
10446 POSIX compliance and is not recommended.)
10448 It makes a difference where in the command you write this option; the
10449 linker searches and processes libraries and object files in the order they
10450 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
10451 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
10452 to functions in @samp{z}, those functions may not be loaded.
10454 The linker searches a standard list of directories for the library,
10455 which is actually a file named @file{lib@var{library}.a}.  The linker
10456 then uses this file as if it had been specified precisely by name.
10458 The directories searched include several standard system directories
10459 plus any that you specify with @option{-L}.
10461 Normally the files found this way are library files---archive files
10462 whose members are object files.  The linker handles an archive file by
10463 scanning through it for members which define symbols that have so far
10464 been referenced but not defined.  But if the file that is found is an
10465 ordinary object file, it is linked in the usual fashion.  The only
10466 difference between using an @option{-l} option and specifying a file name
10467 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
10468 and searches several directories.
10470 @item -lobjc
10471 @opindex lobjc
10472 You need this special case of the @option{-l} option in order to
10473 link an Objective-C or Objective-C++ program.
10475 @item -nostartfiles
10476 @opindex nostartfiles
10477 Do not use the standard system startup files when linking.
10478 The standard system libraries are used normally, unless @option{-nostdlib}
10479 or @option{-nodefaultlibs} is used.
10481 @item -nodefaultlibs
10482 @opindex nodefaultlibs
10483 Do not use the standard system libraries when linking.
10484 Only the libraries you specify are passed to the linker, and options
10485 specifying linkage of the system libraries, such as @code{-static-libgcc}
10486 or @code{-shared-libgcc}, are ignored.  
10487 The standard startup files are used normally, unless @option{-nostartfiles}
10488 is used.  
10490 The compiler may generate calls to @code{memcmp},
10491 @code{memset}, @code{memcpy} and @code{memmove}.
10492 These entries are usually resolved by entries in
10493 libc.  These entry points should be supplied through some other
10494 mechanism when this option is specified.
10496 @item -nostdlib
10497 @opindex nostdlib
10498 Do not use the standard system startup files or libraries when linking.
10499 No startup files and only the libraries you specify are passed to
10500 the linker, and options specifying linkage of the system libraries, such as
10501 @code{-static-libgcc} or @code{-shared-libgcc}, are ignored.
10503 The compiler may generate calls to @code{memcmp}, @code{memset},
10504 @code{memcpy} and @code{memmove}.
10505 These entries are usually resolved by entries in
10506 libc.  These entry points should be supplied through some other
10507 mechanism when this option is specified.
10509 @cindex @option{-lgcc}, use with @option{-nostdlib}
10510 @cindex @option{-nostdlib} and unresolved references
10511 @cindex unresolved references and @option{-nostdlib}
10512 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
10513 @cindex @option{-nodefaultlibs} and unresolved references
10514 @cindex unresolved references and @option{-nodefaultlibs}
10515 One of the standard libraries bypassed by @option{-nostdlib} and
10516 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
10517 which GCC uses to overcome shortcomings of particular machines, or special
10518 needs for some languages.
10519 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
10520 Collection (GCC) Internals},
10521 for more discussion of @file{libgcc.a}.)
10522 In most cases, you need @file{libgcc.a} even when you want to avoid
10523 other standard libraries.  In other words, when you specify @option{-nostdlib}
10524 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
10525 This ensures that you have no unresolved references to internal GCC
10526 library subroutines.
10527 (An example of such an internal subroutine is @samp{__main}, used to ensure C++
10528 constructors are called; @pxref{Collect2,,@code{collect2}, gccint,
10529 GNU Compiler Collection (GCC) Internals}.)
10531 @item -pie
10532 @opindex pie
10533 Produce a position independent executable on targets that support it.
10534 For predictable results, you must also specify the same set of options
10535 used for compilation (@option{-fpie}, @option{-fPIE},
10536 or model suboptions) when you specify this linker option.
10538 @item -rdynamic
10539 @opindex rdynamic
10540 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
10541 that support it. This instructs the linker to add all symbols, not
10542 only used ones, to the dynamic symbol table. This option is needed
10543 for some uses of @code{dlopen} or to allow obtaining backtraces
10544 from within a program.
10546 @item -s
10547 @opindex s
10548 Remove all symbol table and relocation information from the executable.
10550 @item -static
10551 @opindex static
10552 On systems that support dynamic linking, this prevents linking with the shared
10553 libraries.  On other systems, this option has no effect.
10555 @item -shared
10556 @opindex shared
10557 Produce a shared object which can then be linked with other objects to
10558 form an executable.  Not all systems support this option.  For predictable
10559 results, you must also specify the same set of options used for compilation
10560 (@option{-fpic}, @option{-fPIC}, or model suboptions) when
10561 you specify this linker option.@footnote{On some systems, @samp{gcc -shared}
10562 needs to build supplementary stub code for constructors to work.  On
10563 multi-libbed systems, @samp{gcc -shared} must select the correct support
10564 libraries to link against.  Failing to supply the correct flags may lead
10565 to subtle defects.  Supplying them in cases where they are not necessary
10566 is innocuous.}
10568 @item -shared-libgcc
10569 @itemx -static-libgcc
10570 @opindex shared-libgcc
10571 @opindex static-libgcc
10572 On systems that provide @file{libgcc} as a shared library, these options
10573 force the use of either the shared or static version, respectively.
10574 If no shared version of @file{libgcc} was built when the compiler was
10575 configured, these options have no effect.
10577 There are several situations in which an application should use the
10578 shared @file{libgcc} instead of the static version.  The most common
10579 of these is when the application wishes to throw and catch exceptions
10580 across different shared libraries.  In that case, each of the libraries
10581 as well as the application itself should use the shared @file{libgcc}.
10583 Therefore, the G++ and GCJ drivers automatically add
10584 @option{-shared-libgcc} whenever you build a shared library or a main
10585 executable, because C++ and Java programs typically use exceptions, so
10586 this is the right thing to do.
10588 If, instead, you use the GCC driver to create shared libraries, you may
10589 find that they are not always linked with the shared @file{libgcc}.
10590 If GCC finds, at its configuration time, that you have a non-GNU linker
10591 or a GNU linker that does not support option @option{--eh-frame-hdr},
10592 it links the shared version of @file{libgcc} into shared libraries
10593 by default.  Otherwise, it takes advantage of the linker and optimizes
10594 away the linking with the shared version of @file{libgcc}, linking with
10595 the static version of libgcc by default.  This allows exceptions to
10596 propagate through such shared libraries, without incurring relocation
10597 costs at library load time.
10599 However, if a library or main executable is supposed to throw or catch
10600 exceptions, you must link it using the G++ or GCJ driver, as appropriate
10601 for the languages used in the program, or using the option
10602 @option{-shared-libgcc}, such that it is linked with the shared
10603 @file{libgcc}.
10605 @item -static-libasan
10606 @opindex static-libasan
10607 When the @option{-fsanitize=address} option is used to link a program,
10608 the GCC driver automatically links against @option{libasan}.  If
10609 @file{libasan} is available as a shared library, and the @option{-static}
10610 option is not used, then this links against the shared version of
10611 @file{libasan}.  The @option{-static-libasan} option directs the GCC
10612 driver to link @file{libasan} statically, without necessarily linking
10613 other libraries statically.
10615 @item -static-libtsan
10616 @opindex static-libtsan
10617 When the @option{-fsanitize=thread} option is used to link a program,
10618 the GCC driver automatically links against @option{libtsan}.  If
10619 @file{libtsan} is available as a shared library, and the @option{-static}
10620 option is not used, then this links against the shared version of
10621 @file{libtsan}.  The @option{-static-libtsan} option directs the GCC
10622 driver to link @file{libtsan} statically, without necessarily linking
10623 other libraries statically.
10625 @item -static-liblsan
10626 @opindex static-liblsan
10627 When the @option{-fsanitize=leak} option is used to link a program,
10628 the GCC driver automatically links against @option{liblsan}.  If
10629 @file{liblsan} is available as a shared library, and the @option{-static}
10630 option is not used, then this links against the shared version of
10631 @file{liblsan}.  The @option{-static-liblsan} option directs the GCC
10632 driver to link @file{liblsan} statically, without necessarily linking
10633 other libraries statically.
10635 @item -static-libubsan
10636 @opindex static-libubsan
10637 When the @option{-fsanitize=undefined} option is used to link a program,
10638 the GCC driver automatically links against @option{libubsan}.  If
10639 @file{libubsan} is available as a shared library, and the @option{-static}
10640 option is not used, then this links against the shared version of
10641 @file{libubsan}.  The @option{-static-libubsan} option directs the GCC
10642 driver to link @file{libubsan} statically, without necessarily linking
10643 other libraries statically.
10645 @item -static-libstdc++
10646 @opindex static-libstdc++
10647 When the @command{g++} program is used to link a C++ program, it
10648 normally automatically links against @option{libstdc++}.  If
10649 @file{libstdc++} is available as a shared library, and the
10650 @option{-static} option is not used, then this links against the
10651 shared version of @file{libstdc++}.  That is normally fine.  However, it
10652 is sometimes useful to freeze the version of @file{libstdc++} used by
10653 the program without going all the way to a fully static link.  The
10654 @option{-static-libstdc++} option directs the @command{g++} driver to
10655 link @file{libstdc++} statically, without necessarily linking other
10656 libraries statically.
10658 @item -symbolic
10659 @opindex symbolic
10660 Bind references to global symbols when building a shared object.  Warn
10661 about any unresolved references (unless overridden by the link editor
10662 option @option{-Xlinker -z -Xlinker defs}).  Only a few systems support
10663 this option.
10665 @item -T @var{script}
10666 @opindex T
10667 @cindex linker script
10668 Use @var{script} as the linker script.  This option is supported by most
10669 systems using the GNU linker.  On some targets, such as bare-board
10670 targets without an operating system, the @option{-T} option may be required
10671 when linking to avoid references to undefined symbols.
10673 @item -Xlinker @var{option}
10674 @opindex Xlinker
10675 Pass @var{option} as an option to the linker.  You can use this to
10676 supply system-specific linker options that GCC does not recognize.
10678 If you want to pass an option that takes a separate argument, you must use
10679 @option{-Xlinker} twice, once for the option and once for the argument.
10680 For example, to pass @option{-assert definitions}, you must write
10681 @option{-Xlinker -assert -Xlinker definitions}.  It does not work to write
10682 @option{-Xlinker "-assert definitions"}, because this passes the entire
10683 string as a single argument, which is not what the linker expects.
10685 When using the GNU linker, it is usually more convenient to pass
10686 arguments to linker options using the @option{@var{option}=@var{value}}
10687 syntax than as separate arguments.  For example, you can specify
10688 @option{-Xlinker -Map=output.map} rather than
10689 @option{-Xlinker -Map -Xlinker output.map}.  Other linkers may not support
10690 this syntax for command-line options.
10692 @item -Wl,@var{option}
10693 @opindex Wl
10694 Pass @var{option} as an option to the linker.  If @var{option} contains
10695 commas, it is split into multiple options at the commas.  You can use this
10696 syntax to pass an argument to the option.
10697 For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
10698 linker.  When using the GNU linker, you can also get the same effect with
10699 @option{-Wl,-Map=output.map}.
10701 @item -u @var{symbol}
10702 @opindex u
10703 Pretend the symbol @var{symbol} is undefined, to force linking of
10704 library modules to define it.  You can use @option{-u} multiple times with
10705 different symbols to force loading of additional library modules.
10707 @item -z @var{keyword}
10708 @opindex z
10709 @option{-z} is passed directly on to the linker along with the keyword
10710 @var{keyword}. See the section in the documentation of your linker for
10711 permitted values and their meanings.
10712 @end table
10714 @node Directory Options
10715 @section Options for Directory Search
10716 @cindex directory options
10717 @cindex options, directory search
10718 @cindex search path
10720 These options specify directories to search for header files, for
10721 libraries and for parts of the compiler:
10723 @table @gcctabopt
10724 @item -I@var{dir}
10725 @opindex I
10726 Add the directory @var{dir} to the head of the list of directories to be
10727 searched for header files.  This can be used to override a system header
10728 file, substituting your own version, since these directories are
10729 searched before the system header file directories.  However, you should
10730 not use this option to add directories that contain vendor-supplied
10731 system header files (use @option{-isystem} for that).  If you use more than
10732 one @option{-I} option, the directories are scanned in left-to-right
10733 order; the standard system directories come after.
10735 If a standard system include directory, or a directory specified with
10736 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
10737 option is ignored.  The directory is still searched but as a
10738 system directory at its normal position in the system include chain.
10739 This is to ensure that GCC's procedure to fix buggy system headers and
10740 the ordering for the @code{include_next} directive are not inadvertently changed.
10741 If you really need to change the search order for system directories,
10742 use the @option{-nostdinc} and/or @option{-isystem} options.
10744 @item -iplugindir=@var{dir}
10745 @opindex iplugindir=
10746 Set the directory to search for plugins that are passed
10747 by @option{-fplugin=@var{name}} instead of
10748 @option{-fplugin=@var{path}/@var{name}.so}.  This option is not meant
10749 to be used by the user, but only passed by the driver.
10751 @item -iquote@var{dir}
10752 @opindex iquote
10753 Add the directory @var{dir} to the head of the list of directories to
10754 be searched for header files only for the case of @samp{#include
10755 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
10756 otherwise just like @option{-I}.
10758 @item -L@var{dir}
10759 @opindex L
10760 Add directory @var{dir} to the list of directories to be searched
10761 for @option{-l}.
10763 @item -B@var{prefix}
10764 @opindex B
10765 This option specifies where to find the executables, libraries,
10766 include files, and data files of the compiler itself.
10768 The compiler driver program runs one or more of the subprograms
10769 @command{cpp}, @command{cc1}, @command{as} and @command{ld}.  It tries
10770 @var{prefix} as a prefix for each program it tries to run, both with and
10771 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
10773 For each subprogram to be run, the compiler driver first tries the
10774 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
10775 is not specified, the driver tries two standard prefixes, 
10776 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
10777 those results in a file name that is found, the unmodified program
10778 name is searched for using the directories specified in your
10779 @env{PATH} environment variable.
10781 The compiler checks to see if the path provided by the @option{-B}
10782 refers to a directory, and if necessary it adds a directory
10783 separator character at the end of the path.
10785 @option{-B} prefixes that effectively specify directory names also apply
10786 to libraries in the linker, because the compiler translates these
10787 options into @option{-L} options for the linker.  They also apply to
10788 include files in the preprocessor, because the compiler translates these
10789 options into @option{-isystem} options for the preprocessor.  In this case,
10790 the compiler appends @samp{include} to the prefix.
10792 The runtime support file @file{libgcc.a} can also be searched for using
10793 the @option{-B} prefix, if needed.  If it is not found there, the two
10794 standard prefixes above are tried, and that is all.  The file is left
10795 out of the link if it is not found by those means.
10797 Another way to specify a prefix much like the @option{-B} prefix is to use
10798 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
10799 Variables}.
10801 As a special kludge, if the path provided by @option{-B} is
10802 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
10803 9, then it is replaced by @file{[dir/]include}.  This is to help
10804 with boot-strapping the compiler.
10806 @item -specs=@var{file}
10807 @opindex specs
10808 Process @var{file} after the compiler reads in the standard @file{specs}
10809 file, in order to override the defaults which the @command{gcc} driver
10810 program uses when determining what switches to pass to @command{cc1},
10811 @command{cc1plus}, @command{as}, @command{ld}, etc.  More than one
10812 @option{-specs=@var{file}} can be specified on the command line, and they
10813 are processed in order, from left to right.
10815 @item --sysroot=@var{dir}
10816 @opindex sysroot
10817 Use @var{dir} as the logical root directory for headers and libraries.
10818 For example, if the compiler normally searches for headers in
10819 @file{/usr/include} and libraries in @file{/usr/lib}, it instead
10820 searches @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
10822 If you use both this option and the @option{-isysroot} option, then
10823 the @option{--sysroot} option applies to libraries, but the
10824 @option{-isysroot} option applies to header files.
10826 The GNU linker (beginning with version 2.16) has the necessary support
10827 for this option.  If your linker does not support this option, the
10828 header file aspect of @option{--sysroot} still works, but the
10829 library aspect does not.
10831 @item --no-sysroot-suffix
10832 @opindex no-sysroot-suffix
10833 For some targets, a suffix is added to the root directory specified
10834 with @option{--sysroot}, depending on the other options used, so that
10835 headers may for example be found in
10836 @file{@var{dir}/@var{suffix}/usr/include} instead of
10837 @file{@var{dir}/usr/include}.  This option disables the addition of
10838 such a suffix.
10840 @item -I-
10841 @opindex I-
10842 This option has been deprecated.  Please use @option{-iquote} instead for
10843 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
10844 Any directories you specify with @option{-I} options before the @option{-I-}
10845 option are searched only for the case of @samp{#include "@var{file}"};
10846 they are not searched for @samp{#include <@var{file}>}.
10848 If additional directories are specified with @option{-I} options after
10849 the @option{-I-}, these directories are searched for all @samp{#include}
10850 directives.  (Ordinarily @emph{all} @option{-I} directories are used
10851 this way.)
10853 In addition, the @option{-I-} option inhibits the use of the current
10854 directory (where the current input file came from) as the first search
10855 directory for @samp{#include "@var{file}"}.  There is no way to
10856 override this effect of @option{-I-}.  With @option{-I.} you can specify
10857 searching the directory that is current when the compiler is
10858 invoked.  That is not exactly the same as what the preprocessor does
10859 by default, but it is often satisfactory.
10861 @option{-I-} does not inhibit the use of the standard system directories
10862 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
10863 independent.
10864 @end table
10866 @c man end
10868 @node Spec Files
10869 @section Specifying subprocesses and the switches to pass to them
10870 @cindex Spec Files
10872 @command{gcc} is a driver program.  It performs its job by invoking a
10873 sequence of other programs to do the work of compiling, assembling and
10874 linking.  GCC interprets its command-line parameters and uses these to
10875 deduce which programs it should invoke, and which command-line options
10876 it ought to place on their command lines.  This behavior is controlled
10877 by @dfn{spec strings}.  In most cases there is one spec string for each
10878 program that GCC can invoke, but a few programs have multiple spec
10879 strings to control their behavior.  The spec strings built into GCC can
10880 be overridden by using the @option{-specs=} command-line switch to specify
10881 a spec file.
10883 @dfn{Spec files} are plaintext files that are used to construct spec
10884 strings.  They consist of a sequence of directives separated by blank
10885 lines.  The type of directive is determined by the first non-whitespace
10886 character on the line, which can be one of the following:
10888 @table @code
10889 @item %@var{command}
10890 Issues a @var{command} to the spec file processor.  The commands that can
10891 appear here are:
10893 @table @code
10894 @item %include <@var{file}>
10895 @cindex @code{%include}
10896 Search for @var{file} and insert its text at the current point in the
10897 specs file.
10899 @item %include_noerr <@var{file}>
10900 @cindex @code{%include_noerr}
10901 Just like @samp{%include}, but do not generate an error message if the include
10902 file cannot be found.
10904 @item %rename @var{old_name} @var{new_name}
10905 @cindex @code{%rename}
10906 Rename the spec string @var{old_name} to @var{new_name}.
10908 @end table
10910 @item *[@var{spec_name}]:
10911 This tells the compiler to create, override or delete the named spec
10912 string.  All lines after this directive up to the next directive or
10913 blank line are considered to be the text for the spec string.  If this
10914 results in an empty string then the spec is deleted.  (Or, if the
10915 spec did not exist, then nothing happens.)  Otherwise, if the spec
10916 does not currently exist a new spec is created.  If the spec does
10917 exist then its contents are overridden by the text of this
10918 directive, unless the first character of that text is the @samp{+}
10919 character, in which case the text is appended to the spec.
10921 @item [@var{suffix}]:
10922 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
10923 and up to the next directive or blank line are considered to make up the
10924 spec string for the indicated suffix.  When the compiler encounters an
10925 input file with the named suffix, it processes the spec string in
10926 order to work out how to compile that file.  For example:
10928 @smallexample
10929 .ZZ:
10930 z-compile -input %i
10931 @end smallexample
10933 This says that any input file whose name ends in @samp{.ZZ} should be
10934 passed to the program @samp{z-compile}, which should be invoked with the
10935 command-line switch @option{-input} and with the result of performing the
10936 @samp{%i} substitution.  (See below.)
10938 As an alternative to providing a spec string, the text following a
10939 suffix directive can be one of the following:
10941 @table @code
10942 @item @@@var{language}
10943 This says that the suffix is an alias for a known @var{language}.  This is
10944 similar to using the @option{-x} command-line switch to GCC to specify a
10945 language explicitly.  For example:
10947 @smallexample
10948 .ZZ:
10949 @@c++
10950 @end smallexample
10952 Says that .ZZ files are, in fact, C++ source files.
10954 @item #@var{name}
10955 This causes an error messages saying:
10957 @smallexample
10958 @var{name} compiler not installed on this system.
10959 @end smallexample
10960 @end table
10962 GCC already has an extensive list of suffixes built into it.
10963 This directive adds an entry to the end of the list of suffixes, but
10964 since the list is searched from the end backwards, it is effectively
10965 possible to override earlier entries using this technique.
10967 @end table
10969 GCC has the following spec strings built into it.  Spec files can
10970 override these strings or create their own.  Note that individual
10971 targets can also add their own spec strings to this list.
10973 @smallexample
10974 asm          Options to pass to the assembler
10975 asm_final    Options to pass to the assembler post-processor
10976 cpp          Options to pass to the C preprocessor
10977 cc1          Options to pass to the C compiler
10978 cc1plus      Options to pass to the C++ compiler
10979 endfile      Object files to include at the end of the link
10980 link         Options to pass to the linker
10981 lib          Libraries to include on the command line to the linker
10982 libgcc       Decides which GCC support library to pass to the linker
10983 linker       Sets the name of the linker
10984 predefines   Defines to be passed to the C preprocessor
10985 signed_char  Defines to pass to CPP to say whether @code{char} is signed
10986              by default
10987 startfile    Object files to include at the start of the link
10988 @end smallexample
10990 Here is a small example of a spec file:
10992 @smallexample
10993 %rename lib                 old_lib
10995 *lib:
10996 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
10997 @end smallexample
10999 This example renames the spec called @samp{lib} to @samp{old_lib} and
11000 then overrides the previous definition of @samp{lib} with a new one.
11001 The new definition adds in some extra command-line options before
11002 including the text of the old definition.
11004 @dfn{Spec strings} are a list of command-line options to be passed to their
11005 corresponding program.  In addition, the spec strings can contain
11006 @samp{%}-prefixed sequences to substitute variable text or to
11007 conditionally insert text into the command line.  Using these constructs
11008 it is possible to generate quite complex command lines.
11010 Here is a table of all defined @samp{%}-sequences for spec
11011 strings.  Note that spaces are not generated automatically around the
11012 results of expanding these sequences.  Therefore you can concatenate them
11013 together or combine them with constant text in a single argument.
11015 @table @code
11016 @item %%
11017 Substitute one @samp{%} into the program name or argument.
11019 @item %i
11020 Substitute the name of the input file being processed.
11022 @item %b
11023 Substitute the basename of the input file being processed.
11024 This is the substring up to (and not including) the last period
11025 and not including the directory.
11027 @item %B
11028 This is the same as @samp{%b}, but include the file suffix (text after
11029 the last period).
11031 @item %d
11032 Marks the argument containing or following the @samp{%d} as a
11033 temporary file name, so that that file is deleted if GCC exits
11034 successfully.  Unlike @samp{%g}, this contributes no text to the
11035 argument.
11037 @item %g@var{suffix}
11038 Substitute a file name that has suffix @var{suffix} and is chosen
11039 once per compilation, and mark the argument in the same way as
11040 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
11041 name is now chosen in a way that is hard to predict even when previously
11042 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
11043 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
11044 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
11045 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
11046 was simply substituted with a file name chosen once per compilation,
11047 without regard to any appended suffix (which was therefore treated
11048 just like ordinary text), making such attacks more likely to succeed.
11050 @item %u@var{suffix}
11051 Like @samp{%g}, but generates a new temporary file name
11052 each time it appears instead of once per compilation.
11054 @item %U@var{suffix}
11055 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
11056 new one if there is no such last file name.  In the absence of any
11057 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
11058 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
11059 involves the generation of two distinct file names, one
11060 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
11061 simply substituted with a file name chosen for the previous @samp{%u},
11062 without regard to any appended suffix.
11064 @item %j@var{suffix}
11065 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
11066 writable, and if @option{-save-temps} is not used; 
11067 otherwise, substitute the name
11068 of a temporary file, just like @samp{%u}.  This temporary file is not
11069 meant for communication between processes, but rather as a junk
11070 disposal mechanism.
11072 @item %|@var{suffix}
11073 @itemx %m@var{suffix}
11074 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
11075 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
11076 all.  These are the two most common ways to instruct a program that it
11077 should read from standard input or write to standard output.  If you
11078 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
11079 construct: see for example @file{f/lang-specs.h}.
11081 @item %.@var{SUFFIX}
11082 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
11083 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
11084 terminated by the next space or %.
11086 @item %w
11087 Marks the argument containing or following the @samp{%w} as the
11088 designated output file of this compilation.  This puts the argument
11089 into the sequence of arguments that @samp{%o} substitutes.
11091 @item %o
11092 Substitutes the names of all the output files, with spaces
11093 automatically placed around them.  You should write spaces
11094 around the @samp{%o} as well or the results are undefined.
11095 @samp{%o} is for use in the specs for running the linker.
11096 Input files whose names have no recognized suffix are not compiled
11097 at all, but they are included among the output files, so they are
11098 linked.
11100 @item %O
11101 Substitutes the suffix for object files.  Note that this is
11102 handled specially when it immediately follows @samp{%g, %u, or %U},
11103 because of the need for those to form complete file names.  The
11104 handling is such that @samp{%O} is treated exactly as if it had already
11105 been substituted, except that @samp{%g, %u, and %U} do not currently
11106 support additional @var{suffix} characters following @samp{%O} as they do
11107 following, for example, @samp{.o}.
11109 @item %p
11110 Substitutes the standard macro predefinitions for the
11111 current target machine.  Use this when running @code{cpp}.
11113 @item %P
11114 Like @samp{%p}, but puts @samp{__} before and after the name of each
11115 predefined macro, except for macros that start with @samp{__} or with
11116 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
11119 @item %I
11120 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
11121 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
11122 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
11123 and @option{-imultilib} as necessary.
11125 @item %s
11126 Current argument is the name of a library or startup file of some sort.
11127 Search for that file in a standard list of directories and substitute
11128 the full name found.  The current working directory is included in the
11129 list of directories scanned.
11131 @item %T
11132 Current argument is the name of a linker script.  Search for that file
11133 in the current list of directories to scan for libraries. If the file
11134 is located insert a @option{--script} option into the command line
11135 followed by the full path name found.  If the file is not found then
11136 generate an error message.  Note: the current working directory is not
11137 searched.
11139 @item %e@var{str}
11140 Print @var{str} as an error message.  @var{str} is terminated by a newline.
11141 Use this when inconsistent options are detected.
11143 @item %(@var{name})
11144 Substitute the contents of spec string @var{name} at this point.
11146 @item %x@{@var{option}@}
11147 Accumulate an option for @samp{%X}.
11149 @item %X
11150 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
11151 spec string.
11153 @item %Y
11154 Output the accumulated assembler options specified by @option{-Wa}.
11156 @item %Z
11157 Output the accumulated preprocessor options specified by @option{-Wp}.
11159 @item %a
11160 Process the @code{asm} spec.  This is used to compute the
11161 switches to be passed to the assembler.
11163 @item %A
11164 Process the @code{asm_final} spec.  This is a spec string for
11165 passing switches to an assembler post-processor, if such a program is
11166 needed.
11168 @item %l
11169 Process the @code{link} spec.  This is the spec for computing the
11170 command line passed to the linker.  Typically it makes use of the
11171 @samp{%L %G %S %D and %E} sequences.
11173 @item %D
11174 Dump out a @option{-L} option for each directory that GCC believes might
11175 contain startup files.  If the target supports multilibs then the
11176 current multilib directory is prepended to each of these paths.
11178 @item %L
11179 Process the @code{lib} spec.  This is a spec string for deciding which
11180 libraries are included on the command line to the linker.
11182 @item %G
11183 Process the @code{libgcc} spec.  This is a spec string for deciding
11184 which GCC support library is included on the command line to the linker.
11186 @item %S
11187 Process the @code{startfile} spec.  This is a spec for deciding which
11188 object files are the first ones passed to the linker.  Typically
11189 this might be a file named @file{crt0.o}.
11191 @item %E
11192 Process the @code{endfile} spec.  This is a spec string that specifies
11193 the last object files that are passed to the linker.
11195 @item %C
11196 Process the @code{cpp} spec.  This is used to construct the arguments
11197 to be passed to the C preprocessor.
11199 @item %1
11200 Process the @code{cc1} spec.  This is used to construct the options to be
11201 passed to the actual C compiler (@samp{cc1}).
11203 @item %2
11204 Process the @code{cc1plus} spec.  This is used to construct the options to be
11205 passed to the actual C++ compiler (@samp{cc1plus}).
11207 @item %*
11208 Substitute the variable part of a matched option.  See below.
11209 Note that each comma in the substituted string is replaced by
11210 a single space.
11212 @item %<@code{S}
11213 Remove all occurrences of @code{-S} from the command line.  Note---this
11214 command is position dependent.  @samp{%} commands in the spec string
11215 before this one see @code{-S}, @samp{%} commands in the spec string
11216 after this one do not.
11218 @item %:@var{function}(@var{args})
11219 Call the named function @var{function}, passing it @var{args}.
11220 @var{args} is first processed as a nested spec string, then split
11221 into an argument vector in the usual fashion.  The function returns
11222 a string which is processed as if it had appeared literally as part
11223 of the current spec.
11225 The following built-in spec functions are provided:
11227 @table @code
11228 @item @code{getenv}
11229 The @code{getenv} spec function takes two arguments: an environment
11230 variable name and a string.  If the environment variable is not
11231 defined, a fatal error is issued.  Otherwise, the return value is the
11232 value of the environment variable concatenated with the string.  For
11233 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
11235 @smallexample
11236 %:getenv(TOPDIR /include)
11237 @end smallexample
11239 expands to @file{/path/to/top/include}.
11241 @item @code{if-exists}
11242 The @code{if-exists} spec function takes one argument, an absolute
11243 pathname to a file.  If the file exists, @code{if-exists} returns the
11244 pathname.  Here is a small example of its usage:
11246 @smallexample
11247 *startfile:
11248 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
11249 @end smallexample
11251 @item @code{if-exists-else}
11252 The @code{if-exists-else} spec function is similar to the @code{if-exists}
11253 spec function, except that it takes two arguments.  The first argument is
11254 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
11255 returns the pathname.  If it does not exist, it returns the second argument.
11256 This way, @code{if-exists-else} can be used to select one file or another,
11257 based on the existence of the first.  Here is a small example of its usage:
11259 @smallexample
11260 *startfile:
11261 crt0%O%s %:if-exists(crti%O%s) \
11262 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
11263 @end smallexample
11265 @item @code{replace-outfile}
11266 The @code{replace-outfile} spec function takes two arguments.  It looks for the
11267 first argument in the outfiles array and replaces it with the second argument.  Here
11268 is a small example of its usage:
11270 @smallexample
11271 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
11272 @end smallexample
11274 @item @code{remove-outfile}
11275 The @code{remove-outfile} spec function takes one argument.  It looks for the
11276 first argument in the outfiles array and removes it.  Here is a small example
11277 its usage:
11279 @smallexample
11280 %:remove-outfile(-lm)
11281 @end smallexample
11283 @item @code{pass-through-libs}
11284 The @code{pass-through-libs} spec function takes any number of arguments.  It
11285 finds any @option{-l} options and any non-options ending in @file{.a} (which it
11286 assumes are the names of linker input library archive files) and returns a
11287 result containing all the found arguments each prepended by
11288 @option{-plugin-opt=-pass-through=} and joined by spaces.  This list is
11289 intended to be passed to the LTO linker plugin.
11291 @smallexample
11292 %:pass-through-libs(%G %L %G)
11293 @end smallexample
11295 @item @code{print-asm-header}
11296 The @code{print-asm-header} function takes no arguments and simply
11297 prints a banner like:
11299 @smallexample
11300 Assembler options
11301 =================
11303 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
11304 @end smallexample
11306 It is used to separate compiler options from assembler options
11307 in the @option{--target-help} output.
11308 @end table
11310 @item %@{@code{S}@}
11311 Substitutes the @code{-S} switch, if that switch is given to GCC@.
11312 If that switch is not specified, this substitutes nothing.  Note that
11313 the leading dash is omitted when specifying this option, and it is
11314 automatically inserted if the substitution is performed.  Thus the spec
11315 string @samp{%@{foo@}} matches the command-line option @option{-foo}
11316 and outputs the command-line option @option{-foo}.
11318 @item %W@{@code{S}@}
11319 Like %@{@code{S}@} but mark last argument supplied within as a file to be
11320 deleted on failure.
11322 @item %@{@code{S}*@}
11323 Substitutes all the switches specified to GCC whose names start
11324 with @code{-S}, but which also take an argument.  This is used for
11325 switches like @option{-o}, @option{-D}, @option{-I}, etc.
11326 GCC considers @option{-o foo} as being
11327 one switch whose name starts with @samp{o}.  %@{o*@} substitutes this
11328 text, including the space.  Thus two arguments are generated.
11330 @item %@{@code{S}*&@code{T}*@}
11331 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
11332 (the order of @code{S} and @code{T} in the spec is not significant).
11333 There can be any number of ampersand-separated variables; for each the
11334 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
11336 @item %@{@code{S}:@code{X}@}
11337 Substitutes @code{X}, if the @option{-S} switch is given to GCC@.
11339 @item %@{!@code{S}:@code{X}@}
11340 Substitutes @code{X}, if the @option{-S} switch is @emph{not} given to GCC@.
11342 @item %@{@code{S}*:@code{X}@}
11343 Substitutes @code{X} if one or more switches whose names start with
11344 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
11345 once, no matter how many such switches appeared.  However, if @code{%*}
11346 appears somewhere in @code{X}, then @code{X} is substituted once
11347 for each matching switch, with the @code{%*} replaced by the part of
11348 that switch matching the @code{*}.
11350 If @code{%*} appears as the last part of a spec sequence then a space
11351 will be added after the end of the last substitution.  If there is more
11352 text in the sequence however then a space will not be generated.  This
11353 allows the @code{%*} substitution to be used as part of a larger
11354 string.  For example, a spec string like this:
11356 @smallexample
11357 %@{mcu=*:--script=%*/memory.ld@}
11358 @end smallexample
11360 when matching an option like @code{-mcu=newchip} will produce:
11362 @smallexample
11363 --script=newchip/memory.ld
11364 @end smallexample
11366 @item %@{.@code{S}:@code{X}@}
11367 Substitutes @code{X}, if processing a file with suffix @code{S}.
11369 @item %@{!.@code{S}:@code{X}@}
11370 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
11372 @item %@{,@code{S}:@code{X}@}
11373 Substitutes @code{X}, if processing a file for language @code{S}.
11375 @item %@{!,@code{S}:@code{X}@}
11376 Substitutes @code{X}, if not processing a file for language @code{S}.
11378 @item %@{@code{S}|@code{P}:@code{X}@}
11379 Substitutes @code{X} if either @code{-S} or @code{-P} is given to
11380 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
11381 @code{*} sequences as well, although they have a stronger binding than
11382 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
11383 alternatives must be starred, and only the first matching alternative
11384 is substituted.
11386 For example, a spec string like this:
11388 @smallexample
11389 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
11390 @end smallexample
11392 @noindent
11393 outputs the following command-line options from the following input
11394 command-line options:
11396 @smallexample
11397 fred.c        -foo -baz
11398 jim.d         -bar -boggle
11399 -d fred.c     -foo -baz -boggle
11400 -d jim.d      -bar -baz -boggle
11401 @end smallexample
11403 @item %@{S:X; T:Y; :D@}
11405 If @code{S} is given to GCC, substitutes @code{X}; else if @code{T} is
11406 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
11407 be as many clauses as you need.  This may be combined with @code{.},
11408 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
11411 @end table
11413 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
11414 construct may contain other nested @samp{%} constructs or spaces, or
11415 even newlines.  They are processed as usual, as described above.
11416 Trailing white space in @code{X} is ignored.  White space may also
11417 appear anywhere on the left side of the colon in these constructs,
11418 except between @code{.} or @code{*} and the corresponding word.
11420 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
11421 handled specifically in these constructs.  If another value of
11422 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
11423 @option{-W} switch is found later in the command line, the earlier
11424 switch value is ignored, except with @{@code{S}*@} where @code{S} is
11425 just one letter, which passes all matching options.
11427 The character @samp{|} at the beginning of the predicate text is used to
11428 indicate that a command should be piped to the following command, but
11429 only if @option{-pipe} is specified.
11431 It is built into GCC which switches take arguments and which do not.
11432 (You might think it would be useful to generalize this to allow each
11433 compiler's spec to say which switches take arguments.  But this cannot
11434 be done in a consistent fashion.  GCC cannot even decide which input
11435 files have been specified without knowing which switches take arguments,
11436 and it must know which input files to compile in order to tell which
11437 compilers to run).
11439 GCC also knows implicitly that arguments starting in @option{-l} are to be
11440 treated as compiler output files, and passed to the linker in their
11441 proper position among the other output files.
11443 @c man begin OPTIONS
11445 @node Target Options
11446 @section Specifying Target Machine and Compiler Version
11447 @cindex target options
11448 @cindex cross compiling
11449 @cindex specifying machine version
11450 @cindex specifying compiler version and target machine
11451 @cindex compiler version, specifying
11452 @cindex target machine, specifying
11454 The usual way to run GCC is to run the executable called @command{gcc}, or
11455 @command{@var{machine}-gcc} when cross-compiling, or
11456 @command{@var{machine}-gcc-@var{version}} to run a version other than the
11457 one that was installed last.
11459 @node Submodel Options
11460 @section Hardware Models and Configurations
11461 @cindex submodel options
11462 @cindex specifying hardware config
11463 @cindex hardware models and configurations, specifying
11464 @cindex machine dependent options
11466 Each target machine types can have its own
11467 special options, starting with @samp{-m}, to choose among various
11468 hardware models or configurations---for example, 68010 vs 68020,
11469 floating coprocessor or none.  A single installed version of the
11470 compiler can compile for any model or configuration, according to the
11471 options specified.
11473 Some configurations of the compiler also support additional special
11474 options, usually for compatibility with other compilers on the same
11475 platform.
11477 @c This list is ordered alphanumerically by subsection name.
11478 @c It should be the same order and spelling as these options are listed
11479 @c in Machine Dependent Options
11481 @menu
11482 * AArch64 Options::
11483 * Adapteva Epiphany Options::
11484 * ARC Options::
11485 * ARM Options::
11486 * AVR Options::
11487 * Blackfin Options::
11488 * C6X Options::
11489 * CRIS Options::
11490 * CR16 Options::
11491 * Darwin Options::
11492 * DEC Alpha Options::
11493 * FR30 Options::
11494 * FRV Options::
11495 * GNU/Linux Options::
11496 * H8/300 Options::
11497 * HPPA Options::
11498 * i386 and x86-64 Options::
11499 * i386 and x86-64 Windows Options::
11500 * IA-64 Options::
11501 * LM32 Options::
11502 * M32C Options::
11503 * M32R/D Options::
11504 * M680x0 Options::
11505 * MCore Options::
11506 * MeP Options::
11507 * MicroBlaze Options::
11508 * MIPS Options::
11509 * MMIX Options::
11510 * MN10300 Options::
11511 * Moxie Options::
11512 * MSP430 Options::
11513 * NDS32 Options::
11514 * Nios II Options::
11515 * PDP-11 Options::
11516 * picoChip Options::
11517 * PowerPC Options::
11518 * RL78 Options::
11519 * RS/6000 and PowerPC Options::
11520 * RX Options::
11521 * S/390 and zSeries Options::
11522 * Score Options::
11523 * SH Options::
11524 * Solaris 2 Options::
11525 * SPARC Options::
11526 * SPU Options::
11527 * System V Options::
11528 * TILE-Gx Options::
11529 * TILEPro Options::
11530 * V850 Options::
11531 * VAX Options::
11532 * VMS Options::
11533 * VxWorks Options::
11534 * x86-64 Options::
11535 * Xstormy16 Options::
11536 * Xtensa Options::
11537 * zSeries Options::
11538 @end menu
11540 @node AArch64 Options
11541 @subsection AArch64 Options
11542 @cindex AArch64 Options
11544 These options are defined for AArch64 implementations:
11546 @table @gcctabopt
11548 @item -mabi=@var{name}
11549 @opindex mabi
11550 Generate code for the specified data model.  Permissible values
11551 are @samp{ilp32} for SysV-like data model where int, long int and pointer
11552 are 32-bit, and @samp{lp64} for SysV-like data model where int is 32-bit,
11553 but long int and pointer are 64-bit.
11555 The default depends on the specific target configuration.  Note that
11556 the LP64 and ILP32 ABIs are not link-compatible; you must compile your
11557 entire program with the same ABI, and link with a compatible set of libraries.
11559 @item -mbig-endian
11560 @opindex mbig-endian
11561 Generate big-endian code.  This is the default when GCC is configured for an
11562 @samp{aarch64_be-*-*} target.
11564 @item -mgeneral-regs-only
11565 @opindex mgeneral-regs-only
11566 Generate code which uses only the general registers.
11568 @item -mlittle-endian
11569 @opindex mlittle-endian
11570 Generate little-endian code.  This is the default when GCC is configured for an
11571 @samp{aarch64-*-*} but not an @samp{aarch64_be-*-*} target.
11573 @item -mcmodel=tiny
11574 @opindex mcmodel=tiny
11575 Generate code for the tiny code model.  The program and its statically defined
11576 symbols must be within 1GB of each other.  Pointers are 64 bits.  Programs can
11577 be statically or dynamically linked.  This model is not fully implemented and
11578 mostly treated as @samp{small}.
11580 @item -mcmodel=small
11581 @opindex mcmodel=small
11582 Generate code for the small code model.  The program and its statically defined
11583 symbols must be within 4GB of each other.  Pointers are 64 bits.  Programs can
11584 be statically or dynamically linked.  This is the default code model.
11586 @item -mcmodel=large
11587 @opindex mcmodel=large
11588 Generate code for the large code model.  This makes no assumptions about
11589 addresses and sizes of sections.  Pointers are 64 bits.  Programs can be
11590 statically linked only.
11592 @item -mstrict-align
11593 @opindex mstrict-align
11594 Do not assume that unaligned memory references will be handled by the system.
11596 @item -momit-leaf-frame-pointer
11597 @itemx -mno-omit-leaf-frame-pointer
11598 @opindex momit-leaf-frame-pointer
11599 @opindex mno-omit-leaf-frame-pointer
11600 Omit or keep the frame pointer in leaf functions.  The former behaviour is the
11601 default.
11603 @item -mtls-dialect=desc
11604 @opindex mtls-dialect=desc
11605 Use TLS descriptors as the thread-local storage mechanism for dynamic accesses
11606 of TLS variables.  This is the default.
11608 @item -mtls-dialect=traditional
11609 @opindex mtls-dialect=traditional
11610 Use traditional TLS as the thread-local storage mechanism for dynamic accesses
11611 of TLS variables.
11613 @item -march=@var{name}
11614 @opindex march
11615 Specify the name of the target architecture, optionally suffixed by one or
11616 more feature modifiers.  This option has the form
11617 @option{-march=@var{arch}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}, where the
11618 only permissible value for @var{arch} is @samp{armv8-a}.  The permissible
11619 values for @var{feature} are documented in the sub-section below.
11621 Where conflicting feature modifiers are specified, the right-most feature is
11622 used.
11624 GCC uses this name to determine what kind of instructions it can emit when
11625 generating assembly code.
11627 Where @option{-march} is specified without either of @option{-mtune}
11628 or @option{-mcpu} also being specified, the code will be tuned to perform
11629 well across a range of target processors implementing the target
11630 architecture.
11632 @item -mtune=@var{name}
11633 @opindex mtune
11634 Specify the name of the target processor for which GCC should tune the
11635 performance of the code.  Permissible values for this option are:
11636 @samp{generic}, @samp{cortex-a53}, @samp{cortex-a57}.
11638 Additionally, this option can specify that GCC should tune the performance
11639 of the code for a big.LITTLE system.  The only permissible value is
11640 @samp{cortex-a57.cortex-a53}.
11642 Where none of @option{-mtune=}, @option{-mcpu=} or @option{-march=}
11643 are specified, the code will be tuned to perform well across a range
11644 of target processors.
11646 This option cannot be suffixed by feature modifiers.
11648 @item -mcpu=@var{name}
11649 @opindex mcpu
11650 Specify the name of the target processor, optionally suffixed by one or more
11651 feature modifiers.  This option has the form
11652 @option{-mcpu=@var{cpu}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}, where the
11653 permissible values for @var{cpu} are the same as those available for
11654 @option{-mtune}.
11656 The permissible values for @var{feature} are documented in the sub-section
11657 below.
11659 Where conflicting feature modifiers are specified, the right-most feature is
11660 used.
11662 GCC uses this name to determine what kind of instructions it can emit when
11663 generating assembly code (as if by @option{-march}) and to determine
11664 the target processor for which to tune for performance (as if
11665 by @option{-mtune}).  Where this option is used in conjunction
11666 with @option{-march} or @option{-mtune}, those options take precedence
11667 over the appropriate part of this option.
11668 @end table
11670 @subsubsection @option{-march} and @option{-mcpu} feature modifiers
11671 @cindex @option{-march} feature modifiers
11672 @cindex @option{-mcpu} feature modifiers
11673 Feature modifiers used with @option{-march} and @option{-mcpu} can be one
11674 the following:
11676 @table @samp
11677 @item crc
11678 Enable CRC extension.
11679 @item crypto
11680 Enable Crypto extension.  This implies Advanced SIMD is enabled.
11681 @item fp
11682 Enable floating-point instructions.
11683 @item simd
11684 Enable Advanced SIMD instructions.  This implies floating-point instructions
11685 are enabled.  This is the default for all current possible values for options
11686 @option{-march} and @option{-mcpu=}.
11687 @end table
11689 @node Adapteva Epiphany Options
11690 @subsection Adapteva Epiphany Options
11692 These @samp{-m} options are defined for Adapteva Epiphany:
11694 @table @gcctabopt
11695 @item -mhalf-reg-file
11696 @opindex mhalf-reg-file
11697 Don't allocate any register in the range @code{r32}@dots{}@code{r63}.
11698 That allows code to run on hardware variants that lack these registers.
11700 @item -mprefer-short-insn-regs
11701 @opindex mprefer-short-insn-regs
11702 Preferrentially allocate registers that allow short instruction generation.
11703 This can result in increased instruction count, so this may either reduce or
11704 increase overall code size.
11706 @item -mbranch-cost=@var{num}
11707 @opindex mbranch-cost
11708 Set the cost of branches to roughly @var{num} ``simple'' instructions.
11709 This cost is only a heuristic and is not guaranteed to produce
11710 consistent results across releases.
11712 @item -mcmove
11713 @opindex mcmove
11714 Enable the generation of conditional moves.
11716 @item -mnops=@var{num}
11717 @opindex mnops
11718 Emit @var{num} NOPs before every other generated instruction.
11720 @item -mno-soft-cmpsf
11721 @opindex mno-soft-cmpsf
11722 For single-precision floating-point comparisons, emit an @code{fsub} instruction
11723 and test the flags.  This is faster than a software comparison, but can
11724 get incorrect results in the presence of NaNs, or when two different small
11725 numbers are compared such that their difference is calculated as zero.
11726 The default is @option{-msoft-cmpsf}, which uses slower, but IEEE-compliant,
11727 software comparisons.
11729 @item -mstack-offset=@var{num}
11730 @opindex mstack-offset
11731 Set the offset between the top of the stack and the stack pointer.
11732 E.g., a value of 8 means that the eight bytes in the range @code{sp+0@dots{}sp+7}
11733 can be used by leaf functions without stack allocation.
11734 Values other than @samp{8} or @samp{16} are untested and unlikely to work.
11735 Note also that this option changes the ABI; compiling a program with a
11736 different stack offset than the libraries have been compiled with
11737 generally does not work.
11738 This option can be useful if you want to evaluate if a different stack
11739 offset would give you better code, but to actually use a different stack
11740 offset to build working programs, it is recommended to configure the
11741 toolchain with the appropriate @option{--with-stack-offset=@var{num}} option.
11743 @item -mno-round-nearest
11744 @opindex mno-round-nearest
11745 Make the scheduler assume that the rounding mode has been set to
11746 truncating.  The default is @option{-mround-nearest}.
11748 @item -mlong-calls
11749 @opindex mlong-calls
11750 If not otherwise specified by an attribute, assume all calls might be beyond
11751 the offset range of the @code{b} / @code{bl} instructions, and therefore load the
11752 function address into a register before performing a (otherwise direct) call.
11753 This is the default.
11755 @item -mshort-calls
11756 @opindex short-calls
11757 If not otherwise specified by an attribute, assume all direct calls are
11758 in the range of the @code{b} / @code{bl} instructions, so use these instructions
11759 for direct calls.  The default is @option{-mlong-calls}.
11761 @item -msmall16
11762 @opindex msmall16
11763 Assume addresses can be loaded as 16-bit unsigned values.  This does not
11764 apply to function addresses for which @option{-mlong-calls} semantics
11765 are in effect.
11767 @item -mfp-mode=@var{mode}
11768 @opindex mfp-mode
11769 Set the prevailing mode of the floating-point unit.
11770 This determines the floating-point mode that is provided and expected
11771 at function call and return time.  Making this mode match the mode you
11772 predominantly need at function start can make your programs smaller and
11773 faster by avoiding unnecessary mode switches.
11775 @var{mode} can be set to one the following values:
11777 @table @samp
11778 @item caller
11779 Any mode at function entry is valid, and retained or restored when
11780 the function returns, and when it calls other functions.
11781 This mode is useful for compiling libraries or other compilation units
11782 you might want to incorporate into different programs with different
11783 prevailing FPU modes, and the convenience of being able to use a single
11784 object file outweighs the size and speed overhead for any extra
11785 mode switching that might be needed, compared with what would be needed
11786 with a more specific choice of prevailing FPU mode.
11788 @item truncate
11789 This is the mode used for floating-point calculations with
11790 truncating (i.e.@: round towards zero) rounding mode.  That includes
11791 conversion from floating point to integer.
11793 @item round-nearest
11794 This is the mode used for floating-point calculations with
11795 round-to-nearest-or-even rounding mode.
11797 @item int
11798 This is the mode used to perform integer calculations in the FPU, e.g.@:
11799 integer multiply, or integer multiply-and-accumulate.
11800 @end table
11802 The default is @option{-mfp-mode=caller}
11804 @item -mnosplit-lohi
11805 @itemx -mno-postinc
11806 @itemx -mno-postmodify
11807 @opindex mnosplit-lohi
11808 @opindex mno-postinc
11809 @opindex mno-postmodify
11810 Code generation tweaks that disable, respectively, splitting of 32-bit
11811 loads, generation of post-increment addresses, and generation of
11812 post-modify addresses.  The defaults are @option{msplit-lohi},
11813 @option{-mpost-inc}, and @option{-mpost-modify}.
11815 @item -mnovect-double
11816 @opindex mno-vect-double
11817 Change the preferred SIMD mode to SImode.  The default is
11818 @option{-mvect-double}, which uses DImode as preferred SIMD mode.
11820 @item -max-vect-align=@var{num}
11821 @opindex max-vect-align
11822 The maximum alignment for SIMD vector mode types.
11823 @var{num} may be 4 or 8.  The default is 8.
11824 Note that this is an ABI change, even though many library function
11825 interfaces are unaffected if they don't use SIMD vector modes
11826 in places that affect size and/or alignment of relevant types.
11828 @item -msplit-vecmove-early
11829 @opindex msplit-vecmove-early
11830 Split vector moves into single word moves before reload.  In theory this
11831 can give better register allocation, but so far the reverse seems to be
11832 generally the case.
11834 @item -m1reg-@var{reg}
11835 @opindex m1reg-
11836 Specify a register to hold the constant @minus{}1, which makes loading small negative
11837 constants and certain bitmasks faster.
11838 Allowable values for @var{reg} are @samp{r43} and @samp{r63},
11839 which specify use of that register as a fixed register,
11840 and @samp{none}, which means that no register is used for this
11841 purpose.  The default is @option{-m1reg-none}.
11843 @end table
11845 @node ARC Options
11846 @subsection ARC Options
11847 @cindex ARC options
11849 The following options control the architecture variant for which code
11850 is being compiled:
11852 @c architecture variants
11853 @table @gcctabopt
11855 @item -mbarrel-shifter
11856 @opindex mbarrel-shifter
11857 Generate instructions supported by barrel shifter.  This is the default
11858 unless @samp{-mcpu=ARC601} is in effect.
11860 @item -mcpu=@var{cpu}
11861 @opindex mcpu
11862 Set architecture type, register usage, and instruction scheduling
11863 parameters for @var{cpu}.  There are also shortcut alias options
11864 available for backward compatibility and convenience.  Supported
11865 values for @var{cpu} are
11867 @table @samp
11868 @opindex mA6
11869 @opindex mARC600
11870 @item ARC600
11871 Compile for ARC600.  Aliases: @option{-mA6}, @option{-mARC600}.
11873 @item ARC601
11874 @opindex mARC601
11875 Compile for ARC601.  Alias: @option{-mARC601}.
11877 @item ARC700
11878 @opindex mA7
11879 @opindex mARC700
11880 Compile for ARC700.  Aliases: @option{-mA7}, @option{-mARC700}.
11881 This is the default when configured with @samp{--with-cpu=arc700}@.
11882 @end table
11884 @item -mdpfp
11885 @opindex mdpfp
11886 @itemx -mdpfp-compact
11887 @opindex mdpfp-compact
11888 FPX: Generate Double Precision FPX instructions, tuned for the compact
11889 implementation.
11891 @item -mdpfp-fast
11892 @opindex mdpfp-fast
11893 FPX: Generate Double Precision FPX instructions, tuned for the fast
11894 implementation.
11896 @item -mno-dpfp-lrsr
11897 @opindex mno-dpfp-lrsr
11898 Disable LR and SR instructions from using FPX extension aux registers.
11900 @item -mea
11901 @opindex mea
11902 Generate Extended arithmetic instructions.  Currently only
11903 @code{divaw}, @code{adds}, @code{subs}, and @code{sat16} are
11904 supported.  This is always enabled for @samp{-mcpu=ARC700}.
11906 @item -mno-mpy
11907 @opindex mno-mpy
11908 Do not generate mpy instructions for ARC700.
11910 @item -mmul32x16
11911 @opindex mmul32x16
11912 Generate 32x16 bit multiply and mac instructions.
11914 @item -mmul64
11915 @opindex mmul64
11916 Generate mul64 and mulu64 instructions.  Only valid for @samp{-mcpu=ARC600}.
11918 @item -mnorm
11919 @opindex mnorm
11920 Generate norm instruction.  This is the default if @samp{-mcpu=ARC700}
11921 is in effect.
11923 @item -mspfp
11924 @opindex mspfp
11925 @itemx -mspfp-compact
11926 @opindex mspfp-compact
11927 FPX: Generate Single Precision FPX instructions, tuned for the compact
11928 implementation.
11930 @item -mspfp-fast
11931 @opindex mspfp-fast
11932 FPX: Generate Single Precision FPX instructions, tuned for the fast
11933 implementation.
11935 @item -msimd
11936 @opindex msimd
11937 Enable generation of ARC SIMD instructions via target-specific
11938 builtins.  Only valid for @samp{-mcpu=ARC700}.
11940 @item -msoft-float
11941 @opindex msoft-float
11942 This option ignored; it is provided for compatibility purposes only.
11943 Software floating point code is emitted by default, and this default
11944 can overridden by FPX options; @samp{mspfp}, @samp{mspfp-compact}, or
11945 @samp{mspfp-fast} for single precision, and @samp{mdpfp},
11946 @samp{mdpfp-compact}, or @samp{mdpfp-fast} for double precision.
11948 @item -mswap
11949 @opindex mswap
11950 Generate swap instructions.
11952 @end table
11954 The following options are passed through to the assembler, and also
11955 define preprocessor macro symbols.
11957 @c Flags used by the assembler, but for which we define preprocessor
11958 @c macro symbols as well.
11959 @table @gcctabopt
11960 @item -mdsp-packa
11961 @opindex mdsp-packa
11962 Passed down to the assembler to enable the DSP Pack A extensions.
11963 Also sets the preprocessor symbol @code{__Xdsp_packa}.
11965 @item -mdvbf
11966 @opindex mdvbf
11967 Passed down to the assembler to enable the dual viterbi butterfly
11968 extension.  Also sets the preprocessor symbol @code{__Xdvbf}.
11970 @c ARC700 4.10 extension instruction
11971 @item -mlock
11972 @opindex mlock
11973 Passed down to the assembler to enable the Locked Load/Store
11974 Conditional extension.  Also sets the preprocessor symbol
11975 @code{__Xlock}.
11977 @item -mmac-d16
11978 @opindex mmac-d16
11979 Passed down to the assembler.  Also sets the preprocessor symbol
11980 @code{__Xxmac_d16}.
11982 @item -mmac-24
11983 @opindex mmac-24
11984 Passed down to the assembler.  Also sets the preprocessor symbol
11985 @code{__Xxmac_24}.
11987 @c ARC700 4.10 extension instruction
11988 @item -mrtsc
11989 @opindex mrtsc
11990 Passed down to the assembler to enable the 64-bit Time-Stamp Counter
11991 extension instruction.  Also sets the preprocessor symbol
11992 @code{__Xrtsc}.
11994 @c ARC700 4.10 extension instruction
11995 @item -mswape
11996 @opindex mswape
11997 Passed down to the assembler to enable the swap byte ordering
11998 extension instruction.  Also sets the preprocessor symbol
11999 @code{__Xswape}.
12001 @item -mtelephony
12002 @opindex mtelephony
12003 Passed down to the assembler to enable dual and single operand
12004 instructions for telephony.  Also sets the preprocessor symbol
12005 @code{__Xtelephony}.
12007 @item -mxy
12008 @opindex mxy
12009 Passed down to the assembler to enable the XY Memory extension.  Also
12010 sets the preprocessor symbol @code{__Xxy}.
12012 @end table
12014 The following options control how the assembly code is annotated:
12016 @c Assembly annotation options
12017 @table @gcctabopt
12018 @item -misize
12019 @opindex misize
12020 Annotate assembler instructions with estimated addresses.
12022 @item -mannotate-align
12023 @opindex mannotate-align
12024 Explain what alignment considerations lead to the decision to make an
12025 instruction short or long.
12027 @end table
12029 The following options are passed through to the linker:
12031 @c options passed through to the linker
12032 @table @gcctabopt
12033 @item -marclinux
12034 @opindex marclinux
12035 Passed through to the linker, to specify use of the @code{arclinux} emulation.
12036 This option is enabled by default in tool chains built for
12037 @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets
12038 when profiling is not requested.
12040 @item -marclinux_prof
12041 @opindex marclinux_prof
12042 Passed through to the linker, to specify use of the
12043 @code{arclinux_prof} emulation.  This option is enabled by default in
12044 tool chains built for @w{@code{arc-linux-uclibc}} and
12045 @w{@code{arceb-linux-uclibc}} targets when profiling is requested.
12047 @end table
12049 The following options control the semantics of generated code:
12051 @c semantically relevant code generation options
12052 @table @gcctabopt
12053 @item -mepilogue-cfi
12054 @opindex mepilogue-cfi
12055 Enable generation of call frame information for epilogues.
12057 @item -mno-epilogue-cfi
12058 @opindex mno-epilogue-cfi
12059 Disable generation of call frame information for epilogues.
12061 @item -mlong-calls
12062 @opindex mlong-calls
12063 Generate call insns as register indirect calls, thus providing access
12064 to the full 32-bit address range.
12066 @item -mmedium-calls
12067 @opindex mmedium-calls
12068 Don't use less than 25 bit addressing range for calls, which is the
12069 offset available for an unconditional branch-and-link
12070 instruction.  Conditional execution of function calls is suppressed, to
12071 allow use of the 25-bit range, rather than the 21-bit range with
12072 conditional branch-and-link.  This is the default for tool chains built
12073 for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets.
12075 @item -mno-sdata
12076 @opindex mno-sdata
12077 Do not generate sdata references.  This is the default for tool chains
12078 built for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}}
12079 targets.
12081 @item -mucb-mcount
12082 @opindex mucb-mcount
12083 Instrument with mcount calls as used in UCB code.  I.e. do the
12084 counting in the callee, not the caller.  By default ARC instrumentation
12085 counts in the caller.
12087 @item -mvolatile-cache
12088 @opindex mvolatile-cache
12089 Use ordinarily cached memory accesses for volatile references.  This is the
12090 default.
12092 @item -mno-volatile-cache
12093 @opindex mno-volatile-cache
12094 Enable cache bypass for volatile references.
12096 @end table
12098 The following options fine tune code generation:
12099 @c code generation tuning options
12100 @table @gcctabopt
12101 @item -malign-call
12102 @opindex malign-call
12103 Do alignment optimizations for call instructions.
12105 @item -mauto-modify-reg
12106 @opindex mauto-modify-reg
12107 Enable the use of pre/post modify with register displacement.
12109 @item -mbbit-peephole
12110 @opindex mbbit-peephole
12111 Enable bbit peephole2.
12113 @item -mno-brcc
12114 @opindex mno-brcc
12115 This option disables a target-specific pass in @file{arc_reorg} to
12116 generate @code{BRcc} instructions.  It has no effect on @code{BRcc}
12117 generation driven by the combiner pass.
12119 @item -mcase-vector-pcrel
12120 @opindex mcase-vector-pcrel
12121 Use pc-relative switch case tables - this enables case table shortening.
12122 This is the default for @option{-Os}.
12124 @item -mcompact-casesi
12125 @opindex mcompact-casesi
12126 Enable compact casesi pattern.
12127 This is the default for @option{-Os}.
12129 @item -mno-cond-exec
12130 @opindex mno-cond-exec
12131 Disable ARCompact specific pass to generate conditional execution instructions.
12132 Due to delay slot scheduling and interactions between operand numbers,
12133 literal sizes, instruction lengths, and the support for conditional execution,
12134 the target-independent pass to generate conditional execution is often lacking,
12135 so the ARC port has kept a special pass around that tries to find more
12136 conditional execution generating opportunities after register allocation,
12137 branch shortening, and delay slot scheduling have been done.  This pass
12138 generally, but not always, improves performance and code size, at the cost of
12139 extra compilation time, which is why there is an option to switch it off.
12140 If you have a problem with call instructions exceeding their allowable
12141 offset range because they are conditionalized, you should consider using
12142 @option{-mmedium-calls} instead.
12144 @item -mearly-cbranchsi
12145 @opindex mearly-cbranchsi
12146 Enable pre-reload use of the cbranchsi pattern.
12148 @item -mexpand-adddi
12149 @opindex mexpand-adddi
12150 Expand @code{adddi3} and @code{subdi3} at rtl generation time into
12151 @code{add.f}, @code{adc} etc.
12153 @item -mindexed-loads
12154 @opindex mindexed-loads
12155 Enable the use of indexed loads.  This can be problematic because some
12156 optimizers will then assume the that indexed stores exist, which is not
12157 the case.
12159 @item -mlra
12160 @opindex mlra
12161 Enable Local Register Allocation.  This is still experimental for ARC,
12162 so by default the compiler uses standard reload
12163 (i.e. @samp{-mno-lra}).
12165 @item -mlra-priority-none
12166 @opindex mlra-priority-none
12167 Don't indicate any priority for target registers.
12169 @item -mlra-priority-compact
12170 @opindex mlra-priority-compact
12171 Indicate target register priority for r0..r3 / r12..r15.
12173 @item -mlra-priority-noncompact
12174 @opindex mlra-priority-noncompact
12175 Reduce target regsiter priority for r0..r3 / r12..r15.
12177 @item -mno-millicode
12178 @opindex mno-millicode
12179 When optimizing for size (using @option{-Os}), prologues and epilogues
12180 that have to save or restore a large number of registers are often
12181 shortened by using call to a special function in libgcc; this is
12182 referred to as a @emph{millicode} call.  As these calls can pose
12183 performance issues, and/or cause linking issues when linking in a
12184 nonstandard way, this option is provided to turn off millicode call
12185 generation.
12187 @item -mmixed-code
12188 @opindex mmixed-code
12189 Tweak register allocation to help 16-bit instruction generation.
12190 This generally has the effect of decreasing the average instruction size
12191 while increasing the instruction count.
12193 @item -mq-class
12194 @opindex mq-class
12195 Enable 'q' instruction alternatives.
12196 This is the default for @option{-Os}.
12198 @item -mRcq
12199 @opindex mRcq
12200 Enable Rcq constraint handling - most short code generation depends on this.
12201 This is the default.
12203 @item -mRcw
12204 @opindex mRcw
12205 Enable Rcw constraint handling - ccfsm condexec mostly depends on this.
12206 This is the default.
12208 @item -msize-level=@var{level}
12209 @opindex msize-level
12210 Fine-tune size optimization with regards to instruction lengths and alignment.
12211 The recognized values for @var{level} are:
12212 @table @samp
12213 @item 0
12214 No size optimization.  This level is deprecated and treated like @samp{1}.
12216 @item 1
12217 Short instructions are used opportunistically.
12219 @item 2
12220 In addition, alignment of loops and of code after barriers are dropped.
12222 @item 3
12223 In addition, optional data alignment is dropped, and the option @option{Os} is enabled.
12225 @end table
12227 This defaults to @samp{3} when @option{-Os} is in effect.  Otherwise,
12228 the behavior when this is not set is equivalent to level @samp{1}.
12230 @item -mtune=@var{cpu}
12231 @opindex mtune
12232 Set instruction scheduling parameters for @var{cpu}, overriding any implied
12233 by @option{-mcpu=}.
12235 Supported values for @var{cpu} are
12237 @table @samp
12238 @item ARC600
12239 Tune for ARC600 cpu.
12241 @item ARC601
12242 Tune for ARC601 cpu.
12244 @item ARC700
12245 Tune for ARC700 cpu with standard multiplier block.
12247 @item ARC700-xmac
12248 Tune for ARC700 cpu with XMAC block.
12250 @item ARC725D
12251 Tune for ARC725D cpu.
12253 @item ARC750D
12254 Tune for ARC750D cpu.
12256 @end table
12258 @item -mmultcost=@var{num}
12259 @opindex mmultcost
12260 Cost to assume for a multiply instruction, with @samp{4} being equal to a
12261 normal instruction.
12263 @item -munalign-prob-threshold=@var{probability}
12264 @opindex munalign-prob-threshold
12265 Set probability threshold for unaligning branches.
12266 When tuning for @samp{ARC700} and optimizing for speed, branches without
12267 filled delay slot are preferably emitted unaligned and long, unless
12268 profiling indicates that the probability for the branch to be taken
12269 is below @var{probability}.  @xref{Cross-profiling}.
12270 The default is (REG_BR_PROB_BASE/2), i.e.@: 5000.
12272 @end table
12274 The following options are maintained for backward compatibility, but
12275 are now deprecated and will be removed in a future release:
12277 @c Deprecated options
12278 @table @gcctabopt
12280 @item -margonaut
12281 @opindex margonaut
12282 Obsolete FPX.
12284 @item -mbig-endian
12285 @opindex mbig-endian
12286 @itemx -EB
12287 @opindex EB
12288 Compile code for big endian targets.  Use of these options is now
12289 deprecated.  Users wanting big-endian code, should use the
12290 @w{@code{arceb-elf32}} and @w{@code{arceb-linux-uclibc}} targets when
12291 building the tool chain, for which big-endian is the default.
12293 @item -mlittle-endian
12294 @opindex mlittle-endian
12295 @itemx -EL
12296 @opindex EL
12297 Compile code for little endian targets.  Use of these options is now
12298 deprecated.  Users wanting little-endian code should use the
12299 @w{@code{arc-elf32}} and @w{@code{arc-linux-uclibc}} targets when
12300 building the tool chain, for which little-endian is the default.
12302 @item -mbarrel_shifter
12303 @opindex mbarrel_shifter
12304 Replaced by @samp{-mbarrel-shifter}
12306 @item -mdpfp_compact
12307 @opindex mdpfp_compact
12308 Replaced by @samp{-mdpfp-compact}
12310 @item -mdpfp_fast
12311 @opindex mdpfp_fast
12312 Replaced by @samp{-mdpfp-fast}
12314 @item -mdsp_packa
12315 @opindex mdsp_packa
12316 Replaced by @samp{-mdsp-packa}
12318 @item -mEA
12319 @opindex mEA
12320 Replaced by @samp{-mea}
12322 @item -mmac_24
12323 @opindex mmac_24
12324 Replaced by @samp{-mmac-24}
12326 @item -mmac_d16
12327 @opindex mmac_d16
12328 Replaced by @samp{-mmac-d16}
12330 @item -mspfp_compact
12331 @opindex mspfp_compact
12332 Replaced by @samp{-mspfp-compact}
12334 @item -mspfp_fast
12335 @opindex mspfp_fast
12336 Replaced by @samp{-mspfp-fast}
12338 @item -mtune=@var{cpu}
12339 @opindex mtune
12340 Values @samp{arc600}, @samp{arc601}, @samp{arc700} and
12341 @samp{arc700-xmac} for @var{cpu} are replaced by @samp{ARC600},
12342 @samp{ARC601}, @samp{ARC700} and @samp{ARC700-xmac} respectively
12344 @item -multcost=@var{num}
12345 @opindex multcost
12346 Replaced by @samp{-mmultcost}.
12348 @end table
12350 @node ARM Options
12351 @subsection ARM Options
12352 @cindex ARM options
12354 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
12355 architectures:
12357 @table @gcctabopt
12358 @item -mabi=@var{name}
12359 @opindex mabi
12360 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
12361 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
12363 @item -mapcs-frame
12364 @opindex mapcs-frame
12365 Generate a stack frame that is compliant with the ARM Procedure Call
12366 Standard for all functions, even if this is not strictly necessary for
12367 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
12368 with this option causes the stack frames not to be generated for
12369 leaf functions.  The default is @option{-mno-apcs-frame}.
12371 @item -mapcs
12372 @opindex mapcs
12373 This is a synonym for @option{-mapcs-frame}.
12375 @ignore
12376 @c not currently implemented
12377 @item -mapcs-stack-check
12378 @opindex mapcs-stack-check
12379 Generate code to check the amount of stack space available upon entry to
12380 every function (that actually uses some stack space).  If there is
12381 insufficient space available then either the function
12382 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} is
12383 called, depending upon the amount of stack space required.  The runtime
12384 system is required to provide these functions.  The default is
12385 @option{-mno-apcs-stack-check}, since this produces smaller code.
12387 @c not currently implemented
12388 @item -mapcs-float
12389 @opindex mapcs-float
12390 Pass floating-point arguments using the floating-point registers.  This is
12391 one of the variants of the APCS@.  This option is recommended if the
12392 target hardware has a floating-point unit or if a lot of floating-point
12393 arithmetic is going to be performed by the code.  The default is
12394 @option{-mno-apcs-float}, since the size of integer-only code is 
12395 slightly increased if @option{-mapcs-float} is used.
12397 @c not currently implemented
12398 @item -mapcs-reentrant
12399 @opindex mapcs-reentrant
12400 Generate reentrant, position-independent code.  The default is
12401 @option{-mno-apcs-reentrant}.
12402 @end ignore
12404 @item -mthumb-interwork
12405 @opindex mthumb-interwork
12406 Generate code that supports calling between the ARM and Thumb
12407 instruction sets.  Without this option, on pre-v5 architectures, the
12408 two instruction sets cannot be reliably used inside one program.  The
12409 default is @option{-mno-thumb-interwork}, since slightly larger code
12410 is generated when @option{-mthumb-interwork} is specified.  In AAPCS
12411 configurations this option is meaningless.
12413 @item -mno-sched-prolog
12414 @opindex mno-sched-prolog
12415 Prevent the reordering of instructions in the function prologue, or the
12416 merging of those instruction with the instructions in the function's
12417 body.  This means that all functions start with a recognizable set
12418 of instructions (or in fact one of a choice from a small set of
12419 different function prologues), and this information can be used to
12420 locate the start of functions inside an executable piece of code.  The
12421 default is @option{-msched-prolog}.
12423 @item -mfloat-abi=@var{name}
12424 @opindex mfloat-abi
12425 Specifies which floating-point ABI to use.  Permissible values
12426 are: @samp{soft}, @samp{softfp} and @samp{hard}.
12428 Specifying @samp{soft} causes GCC to generate output containing
12429 library calls for floating-point operations.
12430 @samp{softfp} allows the generation of code using hardware floating-point
12431 instructions, but still uses the soft-float calling conventions.
12432 @samp{hard} allows generation of floating-point instructions
12433 and uses FPU-specific calling conventions.
12435 The default depends on the specific target configuration.  Note that
12436 the hard-float and soft-float ABIs are not link-compatible; you must
12437 compile your entire program with the same ABI, and link with a
12438 compatible set of libraries.
12440 @item -mlittle-endian
12441 @opindex mlittle-endian
12442 Generate code for a processor running in little-endian mode.  This is
12443 the default for all standard configurations.
12445 @item -mbig-endian
12446 @opindex mbig-endian
12447 Generate code for a processor running in big-endian mode; the default is
12448 to compile code for a little-endian processor.
12450 @item -march=@var{name}
12451 @opindex march
12452 This specifies the name of the target ARM architecture.  GCC uses this
12453 name to determine what kind of instructions it can emit when generating
12454 assembly code.  This option can be used in conjunction with or instead
12455 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
12456 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
12457 @samp{armv5}, @samp{armv5t}, @samp{armv5e}, @samp{armv5te},
12458 @samp{armv6}, @samp{armv6j},
12459 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv6-m},
12460 @samp{armv7}, @samp{armv7-a}, @samp{armv7-r}, @samp{armv7-m}, @samp{armv7e-m},
12461 @samp{armv7ve}, @samp{armv8-a}, @samp{armv8-a+crc},
12462 @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}.
12464 @option{-march=armv7ve} is the armv7-a architecture with virtualization
12465 extensions.
12467 @option{-march=armv8-a+crc} enables code generation for the ARMv8-A
12468 architecture together with the optional CRC32 extensions.
12470 @option{-march=native} causes the compiler to auto-detect the architecture
12471 of the build computer.  At present, this feature is only supported on
12472 Linux, and not all architectures are recognized.  If the auto-detect is
12473 unsuccessful the option has no effect.
12475 @item -mtune=@var{name}
12476 @opindex mtune
12477 This option specifies the name of the target ARM processor for
12478 which GCC should tune the performance of the code.
12479 For some ARM implementations better performance can be obtained by using
12480 this option.
12481 Permissible names are: @samp{arm2}, @samp{arm250},
12482 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
12483 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
12484 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
12485 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
12486 @samp{arm720},
12487 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
12488 @samp{arm710t}, @samp{arm720t}, @samp{arm740t},
12489 @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
12490 @samp{strongarm1110},
12491 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
12492 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
12493 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
12494 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
12495 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
12496 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
12497 @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
12498 @samp{cortex-a5}, @samp{cortex-a7}, @samp{cortex-a8}, @samp{cortex-a9},
12499 @samp{cortex-a12}, @samp{cortex-a15}, @samp{cortex-a53}, @samp{cortex-a57},
12500 @samp{cortex-r4},
12501 @samp{cortex-r4f}, @samp{cortex-r5}, @samp{cortex-r7}, @samp{cortex-m4},
12502 @samp{cortex-m3},
12503 @samp{cortex-m1},
12504 @samp{cortex-m0},
12505 @samp{cortex-m0plus},
12506 @samp{marvell-pj4},
12507 @samp{xscale}, @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312},
12508 @samp{fa526}, @samp{fa626},
12509 @samp{fa606te}, @samp{fa626te}, @samp{fmp626}, @samp{fa726te}.
12511 Additionally, this option can specify that GCC should tune the performance
12512 of the code for a big.LITTLE system.  Permissible names are:
12513 @samp{cortex-a15.cortex-a7}, @samp{cortex-a57.cortex-a53}.
12515 @option{-mtune=generic-@var{arch}} specifies that GCC should tune the
12516 performance for a blend of processors within architecture @var{arch}.
12517 The aim is to generate code that run well on the current most popular
12518 processors, balancing between optimizations that benefit some CPUs in the
12519 range, and avoiding performance pitfalls of other CPUs.  The effects of
12520 this option may change in future GCC versions as CPU models come and go.
12522 @option{-mtune=native} causes the compiler to auto-detect the CPU
12523 of the build computer.  At present, this feature is only supported on
12524 Linux, and not all architectures are recognized.  If the auto-detect is
12525 unsuccessful the option has no effect.
12527 @item -mcpu=@var{name}
12528 @opindex mcpu
12529 This specifies the name of the target ARM processor.  GCC uses this name
12530 to derive the name of the target ARM architecture (as if specified
12531 by @option{-march}) and the ARM processor type for which to tune for
12532 performance (as if specified by @option{-mtune}).  Where this option
12533 is used in conjunction with @option{-march} or @option{-mtune},
12534 those options take precedence over the appropriate part of this option.
12536 Permissible names for this option are the same as those for
12537 @option{-mtune}.
12539 @option{-mcpu=generic-@var{arch}} is also permissible, and is
12540 equivalent to @option{-march=@var{arch} -mtune=generic-@var{arch}}.
12541 See @option{-mtune} for more information.
12543 @option{-mcpu=native} causes the compiler to auto-detect the CPU
12544 of the build computer.  At present, this feature is only supported on
12545 Linux, and not all architectures are recognized.  If the auto-detect is
12546 unsuccessful the option has no effect.
12548 @item -mfpu=@var{name}
12549 @opindex mfpu
12550 This specifies what floating-point hardware (or hardware emulation) is
12551 available on the target.  Permissible names are: @samp{vfp}, @samp{vfpv3},
12552 @samp{vfpv3-fp16}, @samp{vfpv3-d16}, @samp{vfpv3-d16-fp16}, @samp{vfpv3xd},
12553 @samp{vfpv3xd-fp16}, @samp{neon}, @samp{neon-fp16}, @samp{vfpv4},
12554 @samp{vfpv4-d16}, @samp{fpv4-sp-d16}, @samp{neon-vfpv4},
12555 @samp{fp-armv8}, @samp{neon-fp-armv8}, and @samp{crypto-neon-fp-armv8}.
12557 If @option{-msoft-float} is specified this specifies the format of
12558 floating-point values.
12560 If the selected floating-point hardware includes the NEON extension
12561 (e.g. @option{-mfpu}=@samp{neon}), note that floating-point
12562 operations are not generated by GCC's auto-vectorization pass unless
12563 @option{-funsafe-math-optimizations} is also specified.  This is
12564 because NEON hardware does not fully implement the IEEE 754 standard for
12565 floating-point arithmetic (in particular denormal values are treated as
12566 zero), so the use of NEON instructions may lead to a loss of precision.
12568 @item -mfp16-format=@var{name}
12569 @opindex mfp16-format
12570 Specify the format of the @code{__fp16} half-precision floating-point type.
12571 Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative};
12572 the default is @samp{none}, in which case the @code{__fp16} type is not
12573 defined.  @xref{Half-Precision}, for more information.
12575 @item -mstructure-size-boundary=@var{n}
12576 @opindex mstructure-size-boundary
12577 The sizes of all structures and unions are rounded up to a multiple
12578 of the number of bits set by this option.  Permissible values are 8, 32
12579 and 64.  The default value varies for different toolchains.  For the COFF
12580 targeted toolchain the default value is 8.  A value of 64 is only allowed
12581 if the underlying ABI supports it.
12583 Specifying a larger number can produce faster, more efficient code, but
12584 can also increase the size of the program.  Different values are potentially
12585 incompatible.  Code compiled with one value cannot necessarily expect to
12586 work with code or libraries compiled with another value, if they exchange
12587 information using structures or unions.
12589 @item -mabort-on-noreturn
12590 @opindex mabort-on-noreturn
12591 Generate a call to the function @code{abort} at the end of a
12592 @code{noreturn} function.  It is executed if the function tries to
12593 return.
12595 @item -mlong-calls
12596 @itemx -mno-long-calls
12597 @opindex mlong-calls
12598 @opindex mno-long-calls
12599 Tells the compiler to perform function calls by first loading the
12600 address of the function into a register and then performing a subroutine
12601 call on this register.  This switch is needed if the target function
12602 lies outside of the 64-megabyte addressing range of the offset-based
12603 version of subroutine call instruction.
12605 Even if this switch is enabled, not all function calls are turned
12606 into long calls.  The heuristic is that static functions, functions
12607 that have the @samp{short-call} attribute, functions that are inside
12608 the scope of a @samp{#pragma no_long_calls} directive, and functions whose
12609 definitions have already been compiled within the current compilation
12610 unit are not turned into long calls.  The exceptions to this rule are
12611 that weak function definitions, functions with the @samp{long-call}
12612 attribute or the @samp{section} attribute, and functions that are within
12613 the scope of a @samp{#pragma long_calls} directive are always
12614 turned into long calls.
12616 This feature is not enabled by default.  Specifying
12617 @option{-mno-long-calls} restores the default behavior, as does
12618 placing the function calls within the scope of a @samp{#pragma
12619 long_calls_off} directive.  Note these switches have no effect on how
12620 the compiler generates code to handle function calls via function
12621 pointers.
12623 @item -msingle-pic-base
12624 @opindex msingle-pic-base
12625 Treat the register used for PIC addressing as read-only, rather than
12626 loading it in the prologue for each function.  The runtime system is
12627 responsible for initializing this register with an appropriate value
12628 before execution begins.
12630 @item -mpic-register=@var{reg}
12631 @opindex mpic-register
12632 Specify the register to be used for PIC addressing.
12633 For standard PIC base case, the default will be any suitable register
12634 determined by compiler.  For single PIC base case, the default is
12635 @samp{R9} if target is EABI based or stack-checking is enabled,
12636 otherwise the default is @samp{R10}.
12638 @item -mpic-data-is-text-relative
12639 @opindex mpic-data-is-text-relative
12640 Assume that each data segments are relative to text segment at load time.
12641 Therefore, it permits addressing data using PC-relative operations.
12642 This option is on by default for targets other than VxWorks RTP.
12644 @item -mpoke-function-name
12645 @opindex mpoke-function-name
12646 Write the name of each function into the text section, directly
12647 preceding the function prologue.  The generated code is similar to this:
12649 @smallexample
12650      t0
12651          .ascii "arm_poke_function_name", 0
12652          .align
12653      t1
12654          .word 0xff000000 + (t1 - t0)
12655      arm_poke_function_name
12656          mov     ip, sp
12657          stmfd   sp!, @{fp, ip, lr, pc@}
12658          sub     fp, ip, #4
12659 @end smallexample
12661 When performing a stack backtrace, code can inspect the value of
12662 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
12663 location @code{pc - 12} and the top 8 bits are set, then we know that
12664 there is a function name embedded immediately preceding this location
12665 and has length @code{((pc[-3]) & 0xff000000)}.
12667 @item -mthumb
12668 @itemx -marm
12669 @opindex marm
12670 @opindex mthumb
12672 Select between generating code that executes in ARM and Thumb
12673 states.  The default for most configurations is to generate code
12674 that executes in ARM state, but the default can be changed by
12675 configuring GCC with the @option{--with-mode=}@var{state}
12676 configure option.
12678 @item -mtpcs-frame
12679 @opindex mtpcs-frame
12680 Generate a stack frame that is compliant with the Thumb Procedure Call
12681 Standard for all non-leaf functions.  (A leaf function is one that does
12682 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
12684 @item -mtpcs-leaf-frame
12685 @opindex mtpcs-leaf-frame
12686 Generate a stack frame that is compliant with the Thumb Procedure Call
12687 Standard for all leaf functions.  (A leaf function is one that does
12688 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
12690 @item -mcallee-super-interworking
12691 @opindex mcallee-super-interworking
12692 Gives all externally visible functions in the file being compiled an ARM
12693 instruction set header which switches to Thumb mode before executing the
12694 rest of the function.  This allows these functions to be called from
12695 non-interworking code.  This option is not valid in AAPCS configurations
12696 because interworking is enabled by default.
12698 @item -mcaller-super-interworking
12699 @opindex mcaller-super-interworking
12700 Allows calls via function pointers (including virtual functions) to
12701 execute correctly regardless of whether the target code has been
12702 compiled for interworking or not.  There is a small overhead in the cost
12703 of executing a function pointer if this option is enabled.  This option
12704 is not valid in AAPCS configurations because interworking is enabled
12705 by default.
12707 @item -mtp=@var{name}
12708 @opindex mtp
12709 Specify the access model for the thread local storage pointer.  The valid
12710 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
12711 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
12712 (supported in the arm6k architecture), and @option{auto}, which uses the
12713 best available method for the selected processor.  The default setting is
12714 @option{auto}.
12716 @item -mtls-dialect=@var{dialect}
12717 @opindex mtls-dialect
12718 Specify the dialect to use for accessing thread local storage.  Two
12719 @var{dialect}s are supported---@samp{gnu} and @samp{gnu2}.  The
12720 @samp{gnu} dialect selects the original GNU scheme for supporting
12721 local and global dynamic TLS models.  The @samp{gnu2} dialect
12722 selects the GNU descriptor scheme, which provides better performance
12723 for shared libraries.  The GNU descriptor scheme is compatible with
12724 the original scheme, but does require new assembler, linker and
12725 library support.  Initial and local exec TLS models are unaffected by
12726 this option and always use the original scheme.
12728 @item -mword-relocations
12729 @opindex mword-relocations
12730 Only generate absolute relocations on word-sized values (i.e. R_ARM_ABS32).
12731 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
12732 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
12733 is specified.
12735 @item -mfix-cortex-m3-ldrd
12736 @opindex mfix-cortex-m3-ldrd
12737 Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
12738 with overlapping destination and base registers are used.  This option avoids
12739 generating these instructions.  This option is enabled by default when
12740 @option{-mcpu=cortex-m3} is specified.
12742 @item -munaligned-access
12743 @itemx -mno-unaligned-access
12744 @opindex munaligned-access
12745 @opindex mno-unaligned-access
12746 Enables (or disables) reading and writing of 16- and 32- bit values
12747 from addresses that are not 16- or 32- bit aligned.  By default
12748 unaligned access is disabled for all pre-ARMv6 and all ARMv6-M
12749 architectures, and enabled for all other architectures.  If unaligned
12750 access is not enabled then words in packed data structures will be
12751 accessed a byte at a time.
12753 The ARM attribute @code{Tag_CPU_unaligned_access} will be set in the
12754 generated object file to either true or false, depending upon the
12755 setting of this option.  If unaligned access is enabled then the
12756 preprocessor symbol @code{__ARM_FEATURE_UNALIGNED} will also be
12757 defined.
12759 @item -mneon-for-64bits
12760 @opindex mneon-for-64bits
12761 Enables using Neon to handle scalar 64-bits operations. This is
12762 disabled by default since the cost of moving data from core registers
12763 to Neon is high.
12765 @item -mslow-flash-data
12766 @opindex mslow-flash-data
12767 Assume loading data from flash is slower than fetching instruction.
12768 Therefore literal load is minimized for better performance.
12769 This option is only supported when compiling for ARMv7 M-profile and
12770 off by default.
12772 @item -mrestrict-it
12773 @opindex mrestrict-it
12774 Restricts generation of IT blocks to conform to the rules of ARMv8.
12775 IT blocks can only contain a single 16-bit instruction from a select
12776 set of instructions. This option is on by default for ARMv8 Thumb mode.
12777 @end table
12779 @node AVR Options
12780 @subsection AVR Options
12781 @cindex AVR Options
12783 These options are defined for AVR implementations:
12785 @table @gcctabopt
12786 @item -mmcu=@var{mcu}
12787 @opindex mmcu
12788 Specify Atmel AVR instruction set architectures (ISA) or MCU type.
12790 The default for this option is@tie{}@code{avr2}.
12792 GCC supports the following AVR devices and ISAs:
12794 @include avr-mmcu.texi
12796 @item -maccumulate-args
12797 @opindex maccumulate-args
12798 Accumulate outgoing function arguments and acquire/release the needed
12799 stack space for outgoing function arguments once in function
12800 prologue/epilogue.  Without this option, outgoing arguments are pushed
12801 before calling a function and popped afterwards.
12803 Popping the arguments after the function call can be expensive on
12804 AVR so that accumulating the stack space might lead to smaller
12805 executables because arguments need not to be removed from the
12806 stack after such a function call.
12808 This option can lead to reduced code size for functions that perform
12809 several calls to functions that get their arguments on the stack like
12810 calls to printf-like functions.
12812 @item -mbranch-cost=@var{cost}
12813 @opindex mbranch-cost
12814 Set the branch costs for conditional branch instructions to
12815 @var{cost}.  Reasonable values for @var{cost} are small, non-negative
12816 integers. The default branch cost is 0.
12818 @item -mcall-prologues
12819 @opindex mcall-prologues
12820 Functions prologues/epilogues are expanded as calls to appropriate
12821 subroutines.  Code size is smaller.
12823 @item -mint8
12824 @opindex mint8
12825 Assume @code{int} to be 8-bit integer.  This affects the sizes of all types: a
12826 @code{char} is 1 byte, an @code{int} is 1 byte, a @code{long} is 2 bytes,
12827 and @code{long long} is 4 bytes.  Please note that this option does not
12828 conform to the C standards, but it results in smaller code
12829 size.
12831 @item -mno-interrupts
12832 @opindex mno-interrupts
12833 Generated code is not compatible with hardware interrupts.
12834 Code size is smaller.
12836 @item -mrelax
12837 @opindex mrelax
12838 Try to replace @code{CALL} resp.@: @code{JMP} instruction by the shorter
12839 @code{RCALL} resp.@: @code{RJMP} instruction if applicable.
12840 Setting @code{-mrelax} just adds the @code{--relax} option to the
12841 linker command line when the linker is called.
12843 Jump relaxing is performed by the linker because jump offsets are not
12844 known before code is located. Therefore, the assembler code generated by the
12845 compiler is the same, but the instructions in the executable may
12846 differ from instructions in the assembler code.
12848 Relaxing must be turned on if linker stubs are needed, see the
12849 section on @code{EIND} and linker stubs below.
12851 @item -msp8
12852 @opindex msp8
12853 Treat the stack pointer register as an 8-bit register,
12854 i.e.@: assume the high byte of the stack pointer is zero.
12855 In general, you don't need to set this option by hand.
12857 This option is used internally by the compiler to select and
12858 build multilibs for architectures @code{avr2} and @code{avr25}.
12859 These architectures mix devices with and without @code{SPH}.
12860 For any setting other than @code{-mmcu=avr2} or @code{-mmcu=avr25}
12861 the compiler driver will add or remove this option from the compiler
12862 proper's command line, because the compiler then knows if the device
12863 or architecture has an 8-bit stack pointer and thus no @code{SPH}
12864 register or not.
12866 @item -mstrict-X
12867 @opindex mstrict-X
12868 Use address register @code{X} in a way proposed by the hardware.  This means
12869 that @code{X} is only used in indirect, post-increment or
12870 pre-decrement addressing.
12872 Without this option, the @code{X} register may be used in the same way
12873 as @code{Y} or @code{Z} which then is emulated by additional
12874 instructions.  
12875 For example, loading a value with @code{X+const} addressing with a
12876 small non-negative @code{const < 64} to a register @var{Rn} is
12877 performed as
12879 @example
12880 adiw r26, const   ; X += const
12881 ld   @var{Rn}, X        ; @var{Rn} = *X
12882 sbiw r26, const   ; X -= const
12883 @end example
12885 @item -mtiny-stack
12886 @opindex mtiny-stack
12887 Only change the lower 8@tie{}bits of the stack pointer.
12889 @item -Waddr-space-convert
12890 @opindex Waddr-space-convert
12891 Warn about conversions between address spaces in the case where the
12892 resulting address space is not contained in the incoming address space.
12893 @end table
12895 @subsubsection @code{EIND} and Devices with more than 128 Ki Bytes of Flash
12896 @cindex @code{EIND}
12897 Pointers in the implementation are 16@tie{}bits wide.
12898 The address of a function or label is represented as word address so
12899 that indirect jumps and calls can target any code address in the
12900 range of 64@tie{}Ki words.
12902 In order to facilitate indirect jump on devices with more than 128@tie{}Ki
12903 bytes of program memory space, there is a special function register called
12904 @code{EIND} that serves as most significant part of the target address
12905 when @code{EICALL} or @code{EIJMP} instructions are used.
12907 Indirect jumps and calls on these devices are handled as follows by
12908 the compiler and are subject to some limitations:
12910 @itemize @bullet
12912 @item
12913 The compiler never sets @code{EIND}.
12915 @item
12916 The compiler uses @code{EIND} implicitely in @code{EICALL}/@code{EIJMP}
12917 instructions or might read @code{EIND} directly in order to emulate an
12918 indirect call/jump by means of a @code{RET} instruction.
12920 @item
12921 The compiler assumes that @code{EIND} never changes during the startup
12922 code or during the application. In particular, @code{EIND} is not
12923 saved/restored in function or interrupt service routine
12924 prologue/epilogue.
12926 @item
12927 For indirect calls to functions and computed goto, the linker
12928 generates @emph{stubs}. Stubs are jump pads sometimes also called
12929 @emph{trampolines}. Thus, the indirect call/jump jumps to such a stub.
12930 The stub contains a direct jump to the desired address.
12932 @item
12933 Linker relaxation must be turned on so that the linker will generate
12934 the stubs correctly an all situaltion. See the compiler option
12935 @code{-mrelax} and the linler option @code{--relax}.
12936 There are corner cases where the linker is supposed to generate stubs
12937 but aborts without relaxation and without a helpful error message.
12939 @item
12940 The default linker script is arranged for code with @code{EIND = 0}.
12941 If code is supposed to work for a setup with @code{EIND != 0}, a custom
12942 linker script has to be used in order to place the sections whose
12943 name start with @code{.trampolines} into the segment where @code{EIND}
12944 points to.
12946 @item
12947 The startup code from libgcc never sets @code{EIND}.
12948 Notice that startup code is a blend of code from libgcc and AVR-LibC.
12949 For the impact of AVR-LibC on @code{EIND}, see the
12950 @w{@uref{http://nongnu.org/avr-libc/user-manual/,AVR-LibC user manual}}.
12952 @item
12953 It is legitimate for user-specific startup code to set up @code{EIND}
12954 early, for example by means of initialization code located in
12955 section @code{.init3}. Such code runs prior to general startup code
12956 that initializes RAM and calls constructors, but after the bit
12957 of startup code from AVR-LibC that sets @code{EIND} to the segment
12958 where the vector table is located.
12959 @example
12960 #include <avr/io.h>
12962 static void
12963 __attribute__((section(".init3"),naked,used,no_instrument_function))
12964 init3_set_eind (void)
12966   __asm volatile ("ldi r24,pm_hh8(__trampolines_start)\n\t"
12967                   "out %i0,r24" :: "n" (&EIND) : "r24","memory");
12969 @end example
12971 @noindent
12972 The @code{__trampolines_start} symbol is defined in the linker script.
12974 @item
12975 Stubs are generated automatically by the linker if
12976 the following two conditions are met:
12977 @itemize @minus
12979 @item The address of a label is taken by means of the @code{gs} modifier
12980 (short for @emph{generate stubs}) like so:
12981 @example
12982 LDI r24, lo8(gs(@var{func}))
12983 LDI r25, hi8(gs(@var{func}))
12984 @end example
12985 @item The final location of that label is in a code segment
12986 @emph{outside} the segment where the stubs are located.
12987 @end itemize
12989 @item
12990 The compiler emits such @code{gs} modifiers for code labels in the
12991 following situations:
12992 @itemize @minus
12993 @item Taking address of a function or code label.
12994 @item Computed goto.
12995 @item If prologue-save function is used, see @option{-mcall-prologues}
12996 command-line option.
12997 @item Switch/case dispatch tables. If you do not want such dispatch
12998 tables you can specify the @option{-fno-jump-tables} command-line option.
12999 @item C and C++ constructors/destructors called during startup/shutdown.
13000 @item If the tools hit a @code{gs()} modifier explained above.
13001 @end itemize
13003 @item
13004 Jumping to non-symbolic addresses like so is @emph{not} supported:
13006 @example
13007 int main (void)
13009     /* Call function at word address 0x2 */
13010     return ((int(*)(void)) 0x2)();
13012 @end example
13014 Instead, a stub has to be set up, i.e.@: the function has to be called
13015 through a symbol (@code{func_4} in the example):
13017 @example
13018 int main (void)
13020     extern int func_4 (void);
13022     /* Call function at byte address 0x4 */
13023     return func_4();
13025 @end example
13027 and the application be linked with @code{-Wl,--defsym,func_4=0x4}.
13028 Alternatively, @code{func_4} can be defined in the linker script.
13029 @end itemize
13031 @subsubsection Handling of the @code{RAMPD}, @code{RAMPX}, @code{RAMPY} and @code{RAMPZ} Special Function Registers
13032 @cindex @code{RAMPD}
13033 @cindex @code{RAMPX}
13034 @cindex @code{RAMPY}
13035 @cindex @code{RAMPZ}
13036 Some AVR devices support memories larger than the 64@tie{}KiB range
13037 that can be accessed with 16-bit pointers.  To access memory locations
13038 outside this 64@tie{}KiB range, the contentent of a @code{RAMP}
13039 register is used as high part of the address:
13040 The @code{X}, @code{Y}, @code{Z} address register is concatenated
13041 with the @code{RAMPX}, @code{RAMPY}, @code{RAMPZ} special function
13042 register, respectively, to get a wide address. Similarly,
13043 @code{RAMPD} is used together with direct addressing.
13045 @itemize
13046 @item
13047 The startup code initializes the @code{RAMP} special function
13048 registers with zero.
13050 @item
13051 If a @ref{AVR Named Address Spaces,named address space} other than
13052 generic or @code{__flash} is used, then @code{RAMPZ} is set
13053 as needed before the operation.
13055 @item
13056 If the device supports RAM larger than 64@tie{}KiB and the compiler
13057 needs to change @code{RAMPZ} to accomplish an operation, @code{RAMPZ}
13058 is reset to zero after the operation.
13060 @item
13061 If the device comes with a specific @code{RAMP} register, the ISR
13062 prologue/epilogue saves/restores that SFR and initializes it with
13063 zero in case the ISR code might (implicitly) use it.
13065 @item
13066 RAM larger than 64@tie{}KiB is not supported by GCC for AVR targets.
13067 If you use inline assembler to read from locations outside the
13068 16-bit address range and change one of the @code{RAMP} registers,
13069 you must reset it to zero after the access.
13071 @end itemize
13073 @subsubsection AVR Built-in Macros
13075 GCC defines several built-in macros so that the user code can test
13076 for the presence or absence of features.  Almost any of the following
13077 built-in macros are deduced from device capabilities and thus
13078 triggered by the @code{-mmcu=} command-line option.
13080 For even more AVR-specific built-in macros see
13081 @ref{AVR Named Address Spaces} and @ref{AVR Built-in Functions}.
13083 @table @code
13085 @item __AVR_ARCH__
13086 Build-in macro that resolves to a decimal number that identifies the
13087 architecture and depends on the @code{-mmcu=@var{mcu}} option.
13088 Possible values are:
13090 @code{2}, @code{25}, @code{3}, @code{31}, @code{35},
13091 @code{4}, @code{5}, @code{51}, @code{6}, @code{102}, @code{104},
13092 @code{105}, @code{106}, @code{107}
13094 for @var{mcu}=@code{avr2}, @code{avr25}, @code{avr3},
13095 @code{avr31}, @code{avr35}, @code{avr4}, @code{avr5}, @code{avr51},
13096 @code{avr6}, @code{avrxmega2}, @code{avrxmega4}, @code{avrxmega5},
13097 @code{avrxmega6}, @code{avrxmega7}, respectively.
13098 If @var{mcu} specifies a device, this built-in macro is set
13099 accordingly. For example, with @code{-mmcu=atmega8} the macro will be
13100 defined to @code{4}.
13102 @item __AVR_@var{Device}__
13103 Setting @code{-mmcu=@var{device}} defines this built-in macro which reflects
13104 the device's name. For example, @code{-mmcu=atmega8} defines the
13105 built-in macro @code{__AVR_ATmega8__}, @code{-mmcu=attiny261a} defines
13106 @code{__AVR_ATtiny261A__}, etc.
13108 The built-in macros' names follow
13109 the scheme @code{__AVR_@var{Device}__} where @var{Device} is
13110 the device name as from the AVR user manual. The difference between
13111 @var{Device} in the built-in macro and @var{device} in
13112 @code{-mmcu=@var{device}} is that the latter is always lowercase.
13114 If @var{device} is not a device but only a core architecture like
13115 @code{avr51}, this macro will not be defined.
13117 @item __AVR_XMEGA__
13118 The device / architecture belongs to the XMEGA family of devices.
13120 @item __AVR_HAVE_ELPM__
13121 The device has the the @code{ELPM} instruction.
13123 @item __AVR_HAVE_ELPMX__
13124 The device has the @code{ELPM R@var{n},Z} and @code{ELPM
13125 R@var{n},Z+} instructions.
13127 @item __AVR_HAVE_MOVW__
13128 The device has the @code{MOVW} instruction to perform 16-bit
13129 register-register moves.
13131 @item __AVR_HAVE_LPMX__
13132 The device has the @code{LPM R@var{n},Z} and
13133 @code{LPM R@var{n},Z+} instructions.
13135 @item __AVR_HAVE_MUL__
13136 The device has a hardware multiplier. 
13138 @item __AVR_HAVE_JMP_CALL__
13139 The device has the @code{JMP} and @code{CALL} instructions.
13140 This is the case for devices with at least 16@tie{}KiB of program
13141 memory.
13143 @item __AVR_HAVE_EIJMP_EICALL__
13144 @itemx __AVR_3_BYTE_PC__
13145 The device has the @code{EIJMP} and @code{EICALL} instructions.
13146 This is the case for devices with more than 128@tie{}KiB of program memory.
13147 This also means that the program counter
13148 (PC) is 3@tie{}bytes wide.
13150 @item __AVR_2_BYTE_PC__
13151 The program counter (PC) is 2@tie{}bytes wide. This is the case for devices
13152 with up to 128@tie{}KiB of program memory.
13154 @item __AVR_HAVE_8BIT_SP__
13155 @itemx __AVR_HAVE_16BIT_SP__
13156 The stack pointer (SP) register is treated as 8-bit respectively
13157 16-bit register by the compiler.
13158 The definition of these macros is affected by @code{-mtiny-stack}.
13160 @item __AVR_HAVE_SPH__
13161 @itemx __AVR_SP8__
13162 The device has the SPH (high part of stack pointer) special function
13163 register or has an 8-bit stack pointer, respectively.
13164 The definition of these macros is affected by @code{-mmcu=} and
13165 in the cases of @code{-mmcu=avr2} and @code{-mmcu=avr25} also
13166 by @code{-msp8}.
13168 @item __AVR_HAVE_RAMPD__
13169 @itemx __AVR_HAVE_RAMPX__
13170 @itemx __AVR_HAVE_RAMPY__
13171 @itemx __AVR_HAVE_RAMPZ__
13172 The device has the @code{RAMPD}, @code{RAMPX}, @code{RAMPY},
13173 @code{RAMPZ} special function register, respectively.
13175 @item __NO_INTERRUPTS__
13176 This macro reflects the @code{-mno-interrupts} command line option.
13178 @item __AVR_ERRATA_SKIP__
13179 @itemx __AVR_ERRATA_SKIP_JMP_CALL__
13180 Some AVR devices (AT90S8515, ATmega103) must not skip 32-bit
13181 instructions because of a hardware erratum.  Skip instructions are
13182 @code{SBRS}, @code{SBRC}, @code{SBIS}, @code{SBIC} and @code{CPSE}.
13183 The second macro is only defined if @code{__AVR_HAVE_JMP_CALL__} is also
13184 set.
13186 @item __AVR_ISA_RMW__
13187 The device has Read-Modify-Write instructions (XCH, LAC, LAS and LAT).
13189 @item __AVR_SFR_OFFSET__=@var{offset}
13190 Instructions that can address I/O special function registers directly
13191 like @code{IN}, @code{OUT}, @code{SBI}, etc.@: may use a different
13192 address as if addressed by an instruction to access RAM like @code{LD}
13193 or @code{STS}. This offset depends on the device architecture and has
13194 to be subtracted from the RAM address in order to get the
13195 respective I/O@tie{}address.
13197 @item __WITH_AVRLIBC__
13198 The compiler is configured to be used together with AVR-Libc.
13199 See the @code{--with-avrlibc} configure option.
13201 @end table
13203 @node Blackfin Options
13204 @subsection Blackfin Options
13205 @cindex Blackfin Options
13207 @table @gcctabopt
13208 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
13209 @opindex mcpu=
13210 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
13211 can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
13212 @samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
13213 @samp{bf527}, @samp{bf531}, @samp{bf532}, @samp{bf533},
13214 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
13215 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
13216 @samp{bf542m}, @samp{bf544m}, @samp{bf547m}, @samp{bf548m}, @samp{bf549m},
13217 @samp{bf561}, @samp{bf592}.
13219 The optional @var{sirevision} specifies the silicon revision of the target
13220 Blackfin processor.  Any workarounds available for the targeted silicon revision
13221 are enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
13222 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
13223 are enabled.  The @code{__SILICON_REVISION__} macro is defined to two
13224 hexadecimal digits representing the major and minor numbers in the silicon
13225 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
13226 is not defined.  If @var{sirevision} is @samp{any}, the
13227 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
13228 If this optional @var{sirevision} is not used, GCC assumes the latest known
13229 silicon revision of the targeted Blackfin processor.
13231 GCC defines a preprocessor macro for the specified @var{cpu}.
13232 For the @samp{bfin-elf} toolchain, this option causes the hardware BSP
13233 provided by libgloss to be linked in if @option{-msim} is not given.
13235 Without this option, @samp{bf532} is used as the processor by default.
13237 Note that support for @samp{bf561} is incomplete.  For @samp{bf561},
13238 only the preprocessor macro is defined.
13240 @item -msim
13241 @opindex msim
13242 Specifies that the program will be run on the simulator.  This causes
13243 the simulator BSP provided by libgloss to be linked in.  This option
13244 has effect only for @samp{bfin-elf} toolchain.
13245 Certain other options, such as @option{-mid-shared-library} and
13246 @option{-mfdpic}, imply @option{-msim}.
13248 @item -momit-leaf-frame-pointer
13249 @opindex momit-leaf-frame-pointer
13250 Don't keep the frame pointer in a register for leaf functions.  This
13251 avoids the instructions to save, set up and restore frame pointers and
13252 makes an extra register available in leaf functions.  The option
13253 @option{-fomit-frame-pointer} removes the frame pointer for all functions,
13254 which might make debugging harder.
13256 @item -mspecld-anomaly
13257 @opindex mspecld-anomaly
13258 When enabled, the compiler ensures that the generated code does not
13259 contain speculative loads after jump instructions. If this option is used,
13260 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
13262 @item -mno-specld-anomaly
13263 @opindex mno-specld-anomaly
13264 Don't generate extra code to prevent speculative loads from occurring.
13266 @item -mcsync-anomaly
13267 @opindex mcsync-anomaly
13268 When enabled, the compiler ensures that the generated code does not
13269 contain CSYNC or SSYNC instructions too soon after conditional branches.
13270 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
13272 @item -mno-csync-anomaly
13273 @opindex mno-csync-anomaly
13274 Don't generate extra code to prevent CSYNC or SSYNC instructions from
13275 occurring too soon after a conditional branch.
13277 @item -mlow-64k
13278 @opindex mlow-64k
13279 When enabled, the compiler is free to take advantage of the knowledge that
13280 the entire program fits into the low 64k of memory.
13282 @item -mno-low-64k
13283 @opindex mno-low-64k
13284 Assume that the program is arbitrarily large.  This is the default.
13286 @item -mstack-check-l1
13287 @opindex mstack-check-l1
13288 Do stack checking using information placed into L1 scratchpad memory by the
13289 uClinux kernel.
13291 @item -mid-shared-library
13292 @opindex mid-shared-library
13293 Generate code that supports shared libraries via the library ID method.
13294 This allows for execute in place and shared libraries in an environment
13295 without virtual memory management.  This option implies @option{-fPIC}.
13296 With a @samp{bfin-elf} target, this option implies @option{-msim}.
13298 @item -mno-id-shared-library
13299 @opindex mno-id-shared-library
13300 Generate code that doesn't assume ID-based shared libraries are being used.
13301 This is the default.
13303 @item -mleaf-id-shared-library
13304 @opindex mleaf-id-shared-library
13305 Generate code that supports shared libraries via the library ID method,
13306 but assumes that this library or executable won't link against any other
13307 ID shared libraries.  That allows the compiler to use faster code for jumps
13308 and calls.
13310 @item -mno-leaf-id-shared-library
13311 @opindex mno-leaf-id-shared-library
13312 Do not assume that the code being compiled won't link against any ID shared
13313 libraries.  Slower code is generated for jump and call insns.
13315 @item -mshared-library-id=n
13316 @opindex mshared-library-id
13317 Specifies the identification number of the ID-based shared library being
13318 compiled.  Specifying a value of 0 generates more compact code; specifying
13319 other values forces the allocation of that number to the current
13320 library but is no more space- or time-efficient than omitting this option.
13322 @item -msep-data
13323 @opindex msep-data
13324 Generate code that allows the data segment to be located in a different
13325 area of memory from the text segment.  This allows for execute in place in
13326 an environment without virtual memory management by eliminating relocations
13327 against the text section.
13329 @item -mno-sep-data
13330 @opindex mno-sep-data
13331 Generate code that assumes that the data segment follows the text segment.
13332 This is the default.
13334 @item -mlong-calls
13335 @itemx -mno-long-calls
13336 @opindex mlong-calls
13337 @opindex mno-long-calls
13338 Tells the compiler to perform function calls by first loading the
13339 address of the function into a register and then performing a subroutine
13340 call on this register.  This switch is needed if the target function
13341 lies outside of the 24-bit addressing range of the offset-based
13342 version of subroutine call instruction.
13344 This feature is not enabled by default.  Specifying
13345 @option{-mno-long-calls} restores the default behavior.  Note these
13346 switches have no effect on how the compiler generates code to handle
13347 function calls via function pointers.
13349 @item -mfast-fp
13350 @opindex mfast-fp
13351 Link with the fast floating-point library. This library relaxes some of
13352 the IEEE floating-point standard's rules for checking inputs against
13353 Not-a-Number (NAN), in the interest of performance.
13355 @item -minline-plt
13356 @opindex minline-plt
13357 Enable inlining of PLT entries in function calls to functions that are
13358 not known to bind locally.  It has no effect without @option{-mfdpic}.
13360 @item -mmulticore
13361 @opindex mmulticore
13362 Build a standalone application for multicore Blackfin processors. 
13363 This option causes proper start files and link scripts supporting 
13364 multicore to be used, and defines the macro @code{__BFIN_MULTICORE}. 
13365 It can only be used with @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. 
13367 This option can be used with @option{-mcorea} or @option{-mcoreb}, which
13368 selects the one-application-per-core programming model.  Without
13369 @option{-mcorea} or @option{-mcoreb}, the single-application/dual-core
13370 programming model is used. In this model, the main function of Core B
13371 should be named as @code{coreb_main}.
13373 If this option is not used, the single-core application programming
13374 model is used.
13376 @item -mcorea
13377 @opindex mcorea
13378 Build a standalone application for Core A of BF561 when using
13379 the one-application-per-core programming model. Proper start files
13380 and link scripts are used to support Core A, and the macro
13381 @code{__BFIN_COREA} is defined.
13382 This option can only be used in conjunction with @option{-mmulticore}.
13384 @item -mcoreb
13385 @opindex mcoreb
13386 Build a standalone application for Core B of BF561 when using
13387 the one-application-per-core programming model. Proper start files
13388 and link scripts are used to support Core B, and the macro
13389 @code{__BFIN_COREB} is defined. When this option is used, @code{coreb_main}
13390 should be used instead of @code{main}. 
13391 This option can only be used in conjunction with @option{-mmulticore}.
13393 @item -msdram
13394 @opindex msdram
13395 Build a standalone application for SDRAM. Proper start files and
13396 link scripts are used to put the application into SDRAM, and the macro
13397 @code{__BFIN_SDRAM} is defined.
13398 The loader should initialize SDRAM before loading the application.
13400 @item -micplb
13401 @opindex micplb
13402 Assume that ICPLBs are enabled at run time.  This has an effect on certain
13403 anomaly workarounds.  For Linux targets, the default is to assume ICPLBs
13404 are enabled; for standalone applications the default is off.
13405 @end table
13407 @node C6X Options
13408 @subsection C6X Options
13409 @cindex C6X Options
13411 @table @gcctabopt
13412 @item -march=@var{name}
13413 @opindex march
13414 This specifies the name of the target architecture.  GCC uses this
13415 name to determine what kind of instructions it can emit when generating
13416 assembly code.  Permissible names are: @samp{c62x},
13417 @samp{c64x}, @samp{c64x+}, @samp{c67x}, @samp{c67x+}, @samp{c674x}.
13419 @item -mbig-endian
13420 @opindex mbig-endian
13421 Generate code for a big-endian target.
13423 @item -mlittle-endian
13424 @opindex mlittle-endian
13425 Generate code for a little-endian target.  This is the default.
13427 @item -msim
13428 @opindex msim
13429 Choose startup files and linker script suitable for the simulator.
13431 @item -msdata=default
13432 @opindex msdata=default
13433 Put small global and static data in the @samp{.neardata} section,
13434 which is pointed to by register @code{B14}.  Put small uninitialized
13435 global and static data in the @samp{.bss} section, which is adjacent
13436 to the @samp{.neardata} section.  Put small read-only data into the
13437 @samp{.rodata} section.  The corresponding sections used for large
13438 pieces of data are @samp{.fardata}, @samp{.far} and @samp{.const}.
13440 @item -msdata=all
13441 @opindex msdata=all
13442 Put all data, not just small objects, into the sections reserved for
13443 small data, and use addressing relative to the @code{B14} register to
13444 access them.
13446 @item -msdata=none
13447 @opindex msdata=none
13448 Make no use of the sections reserved for small data, and use absolute
13449 addresses to access all data.  Put all initialized global and static
13450 data in the @samp{.fardata} section, and all uninitialized data in the
13451 @samp{.far} section.  Put all constant data into the @samp{.const}
13452 section.
13453 @end table
13455 @node CRIS Options
13456 @subsection CRIS Options
13457 @cindex CRIS Options
13459 These options are defined specifically for the CRIS ports.
13461 @table @gcctabopt
13462 @item -march=@var{architecture-type}
13463 @itemx -mcpu=@var{architecture-type}
13464 @opindex march
13465 @opindex mcpu
13466 Generate code for the specified architecture.  The choices for
13467 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
13468 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
13469 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
13470 @samp{v10}.
13472 @item -mtune=@var{architecture-type}
13473 @opindex mtune
13474 Tune to @var{architecture-type} everything applicable about the generated
13475 code, except for the ABI and the set of available instructions.  The
13476 choices for @var{architecture-type} are the same as for
13477 @option{-march=@var{architecture-type}}.
13479 @item -mmax-stack-frame=@var{n}
13480 @opindex mmax-stack-frame
13481 Warn when the stack frame of a function exceeds @var{n} bytes.
13483 @item -metrax4
13484 @itemx -metrax100
13485 @opindex metrax4
13486 @opindex metrax100
13487 The options @option{-metrax4} and @option{-metrax100} are synonyms for
13488 @option{-march=v3} and @option{-march=v8} respectively.
13490 @item -mmul-bug-workaround
13491 @itemx -mno-mul-bug-workaround
13492 @opindex mmul-bug-workaround
13493 @opindex mno-mul-bug-workaround
13494 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
13495 models where it applies.  This option is active by default.
13497 @item -mpdebug
13498 @opindex mpdebug
13499 Enable CRIS-specific verbose debug-related information in the assembly
13500 code.  This option also has the effect of turning off the @samp{#NO_APP}
13501 formatted-code indicator to the assembler at the beginning of the
13502 assembly file.
13504 @item -mcc-init
13505 @opindex mcc-init
13506 Do not use condition-code results from previous instruction; always emit
13507 compare and test instructions before use of condition codes.
13509 @item -mno-side-effects
13510 @opindex mno-side-effects
13511 Do not emit instructions with side effects in addressing modes other than
13512 post-increment.
13514 @item -mstack-align
13515 @itemx -mno-stack-align
13516 @itemx -mdata-align
13517 @itemx -mno-data-align
13518 @itemx -mconst-align
13519 @itemx -mno-const-align
13520 @opindex mstack-align
13521 @opindex mno-stack-align
13522 @opindex mdata-align
13523 @opindex mno-data-align
13524 @opindex mconst-align
13525 @opindex mno-const-align
13526 These options (@samp{no-} options) arrange (eliminate arrangements) for the
13527 stack frame, individual data and constants to be aligned for the maximum
13528 single data access size for the chosen CPU model.  The default is to
13529 arrange for 32-bit alignment.  ABI details such as structure layout are
13530 not affected by these options.
13532 @item -m32-bit
13533 @itemx -m16-bit
13534 @itemx -m8-bit
13535 @opindex m32-bit
13536 @opindex m16-bit
13537 @opindex m8-bit
13538 Similar to the stack- data- and const-align options above, these options
13539 arrange for stack frame, writable data and constants to all be 32-bit,
13540 16-bit or 8-bit aligned.  The default is 32-bit alignment.
13542 @item -mno-prologue-epilogue
13543 @itemx -mprologue-epilogue
13544 @opindex mno-prologue-epilogue
13545 @opindex mprologue-epilogue
13546 With @option{-mno-prologue-epilogue}, the normal function prologue and
13547 epilogue which set up the stack frame are omitted and no return
13548 instructions or return sequences are generated in the code.  Use this
13549 option only together with visual inspection of the compiled code: no
13550 warnings or errors are generated when call-saved registers must be saved,
13551 or storage for local variables needs to be allocated.
13553 @item -mno-gotplt
13554 @itemx -mgotplt
13555 @opindex mno-gotplt
13556 @opindex mgotplt
13557 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
13558 instruction sequences that load addresses for functions from the PLT part
13559 of the GOT rather than (traditional on other architectures) calls to the
13560 PLT@.  The default is @option{-mgotplt}.
13562 @item -melf
13563 @opindex melf
13564 Legacy no-op option only recognized with the cris-axis-elf and
13565 cris-axis-linux-gnu targets.
13567 @item -mlinux
13568 @opindex mlinux
13569 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
13571 @item -sim
13572 @opindex sim
13573 This option, recognized for the cris-axis-elf, arranges
13574 to link with input-output functions from a simulator library.  Code,
13575 initialized data and zero-initialized data are allocated consecutively.
13577 @item -sim2
13578 @opindex sim2
13579 Like @option{-sim}, but pass linker options to locate initialized data at
13580 0x40000000 and zero-initialized data at 0x80000000.
13581 @end table
13583 @node CR16 Options
13584 @subsection CR16 Options
13585 @cindex CR16 Options
13587 These options are defined specifically for the CR16 ports.
13589 @table @gcctabopt
13591 @item -mmac
13592 @opindex mmac
13593 Enable the use of multiply-accumulate instructions. Disabled by default.
13595 @item -mcr16cplus
13596 @itemx -mcr16c
13597 @opindex mcr16cplus
13598 @opindex mcr16c
13599 Generate code for CR16C or CR16C+ architecture. CR16C+ architecture 
13600 is default.
13602 @item -msim
13603 @opindex msim
13604 Links the library libsim.a which is in compatible with simulator. Applicable
13605 to ELF compiler only.
13607 @item -mint32
13608 @opindex mint32
13609 Choose integer type as 32-bit wide.
13611 @item -mbit-ops
13612 @opindex mbit-ops
13613 Generates @code{sbit}/@code{cbit} instructions for bit manipulations.
13615 @item -mdata-model=@var{model}
13616 @opindex mdata-model
13617 Choose a data model. The choices for @var{model} are @samp{near},
13618 @samp{far} or @samp{medium}. @samp{medium} is default.
13619 However, @samp{far} is not valid with @option{-mcr16c}, as the
13620 CR16C architecture does not support the far data model.
13621 @end table
13623 @node Darwin Options
13624 @subsection Darwin Options
13625 @cindex Darwin options
13627 These options are defined for all architectures running the Darwin operating
13628 system.
13630 FSF GCC on Darwin does not create ``fat'' object files; it creates
13631 an object file for the single architecture that GCC was built to
13632 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
13633 @option{-arch} options are used; it does so by running the compiler or
13634 linker multiple times and joining the results together with
13635 @file{lipo}.
13637 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
13638 @samp{i686}) is determined by the flags that specify the ISA
13639 that GCC is targeting, like @option{-mcpu} or @option{-march}.  The
13640 @option{-force_cpusubtype_ALL} option can be used to override this.
13642 The Darwin tools vary in their behavior when presented with an ISA
13643 mismatch.  The assembler, @file{as}, only permits instructions to
13644 be used that are valid for the subtype of the file it is generating,
13645 so you cannot put 64-bit instructions in a @samp{ppc750} object file.
13646 The linker for shared libraries, @file{/usr/bin/libtool}, fails
13647 and prints an error if asked to create a shared library with a less
13648 restrictive subtype than its input files (for instance, trying to put
13649 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
13650 for executables, @command{ld}, quietly gives the executable the most
13651 restrictive subtype of any of its input files.
13653 @table @gcctabopt
13654 @item -F@var{dir}
13655 @opindex F
13656 Add the framework directory @var{dir} to the head of the list of
13657 directories to be searched for header files.  These directories are
13658 interleaved with those specified by @option{-I} options and are
13659 scanned in a left-to-right order.
13661 A framework directory is a directory with frameworks in it.  A
13662 framework is a directory with a @file{Headers} and/or
13663 @file{PrivateHeaders} directory contained directly in it that ends
13664 in @file{.framework}.  The name of a framework is the name of this
13665 directory excluding the @file{.framework}.  Headers associated with
13666 the framework are found in one of those two directories, with
13667 @file{Headers} being searched first.  A subframework is a framework
13668 directory that is in a framework's @file{Frameworks} directory.
13669 Includes of subframework headers can only appear in a header of a
13670 framework that contains the subframework, or in a sibling subframework
13671 header.  Two subframeworks are siblings if they occur in the same
13672 framework.  A subframework should not have the same name as a
13673 framework; a warning is issued if this is violated.  Currently a
13674 subframework cannot have subframeworks; in the future, the mechanism
13675 may be extended to support this.  The standard frameworks can be found
13676 in @file{/System/Library/Frameworks} and
13677 @file{/Library/Frameworks}.  An example include looks like
13678 @code{#include <Framework/header.h>}, where @file{Framework} denotes
13679 the name of the framework and @file{header.h} is found in the
13680 @file{PrivateHeaders} or @file{Headers} directory.
13682 @item -iframework@var{dir}
13683 @opindex iframework
13684 Like @option{-F} except the directory is a treated as a system
13685 directory.  The main difference between this @option{-iframework} and
13686 @option{-F} is that with @option{-iframework} the compiler does not
13687 warn about constructs contained within header files found via
13688 @var{dir}.  This option is valid only for the C family of languages.
13690 @item -gused
13691 @opindex gused
13692 Emit debugging information for symbols that are used.  For stabs
13693 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
13694 This is by default ON@.
13696 @item -gfull
13697 @opindex gfull
13698 Emit debugging information for all symbols and types.
13700 @item -mmacosx-version-min=@var{version}
13701 The earliest version of MacOS X that this executable will run on
13702 is @var{version}.  Typical values of @var{version} include @code{10.1},
13703 @code{10.2}, and @code{10.3.9}.
13705 If the compiler was built to use the system's headers by default,
13706 then the default for this option is the system version on which the
13707 compiler is running, otherwise the default is to make choices that
13708 are compatible with as many systems and code bases as possible.
13710 @item -mkernel
13711 @opindex mkernel
13712 Enable kernel development mode.  The @option{-mkernel} option sets
13713 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
13714 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
13715 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
13716 applicable.  This mode also sets @option{-mno-altivec},
13717 @option{-msoft-float}, @option{-fno-builtin} and
13718 @option{-mlong-branch} for PowerPC targets.
13720 @item -mone-byte-bool
13721 @opindex mone-byte-bool
13722 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
13723 By default @samp{sizeof(bool)} is @samp{4} when compiling for
13724 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
13725 option has no effect on x86.
13727 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
13728 to generate code that is not binary compatible with code generated
13729 without that switch.  Using this switch may require recompiling all
13730 other modules in a program, including system libraries.  Use this
13731 switch to conform to a non-default data model.
13733 @item -mfix-and-continue
13734 @itemx -ffix-and-continue
13735 @itemx -findirect-data
13736 @opindex mfix-and-continue
13737 @opindex ffix-and-continue
13738 @opindex findirect-data
13739 Generate code suitable for fast turnaround development, such as to
13740 allow GDB to dynamically load @code{.o} files into already-running
13741 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
13742 are provided for backwards compatibility.
13744 @item -all_load
13745 @opindex all_load
13746 Loads all members of static archive libraries.
13747 See man ld(1) for more information.
13749 @item -arch_errors_fatal
13750 @opindex arch_errors_fatal
13751 Cause the errors having to do with files that have the wrong architecture
13752 to be fatal.
13754 @item -bind_at_load
13755 @opindex bind_at_load
13756 Causes the output file to be marked such that the dynamic linker will
13757 bind all undefined references when the file is loaded or launched.
13759 @item -bundle
13760 @opindex bundle
13761 Produce a Mach-o bundle format file.
13762 See man ld(1) for more information.
13764 @item -bundle_loader @var{executable}
13765 @opindex bundle_loader
13766 This option specifies the @var{executable} that will load the build
13767 output file being linked.  See man ld(1) for more information.
13769 @item -dynamiclib
13770 @opindex dynamiclib
13771 When passed this option, GCC produces a dynamic library instead of
13772 an executable when linking, using the Darwin @file{libtool} command.
13774 @item -force_cpusubtype_ALL
13775 @opindex force_cpusubtype_ALL
13776 This causes GCC's output file to have the @var{ALL} subtype, instead of
13777 one controlled by the @option{-mcpu} or @option{-march} option.
13779 @item -allowable_client  @var{client_name}
13780 @itemx -client_name
13781 @itemx -compatibility_version
13782 @itemx -current_version
13783 @itemx -dead_strip
13784 @itemx -dependency-file
13785 @itemx -dylib_file
13786 @itemx -dylinker_install_name
13787 @itemx -dynamic
13788 @itemx -exported_symbols_list
13789 @itemx -filelist
13790 @need 800
13791 @itemx -flat_namespace
13792 @itemx -force_flat_namespace
13793 @itemx -headerpad_max_install_names
13794 @itemx -image_base
13795 @itemx -init
13796 @itemx -install_name
13797 @itemx -keep_private_externs
13798 @itemx -multi_module
13799 @itemx -multiply_defined
13800 @itemx -multiply_defined_unused
13801 @need 800
13802 @itemx -noall_load
13803 @itemx -no_dead_strip_inits_and_terms
13804 @itemx -nofixprebinding
13805 @itemx -nomultidefs
13806 @itemx -noprebind
13807 @itemx -noseglinkedit
13808 @itemx -pagezero_size
13809 @itemx -prebind
13810 @itemx -prebind_all_twolevel_modules
13811 @itemx -private_bundle
13812 @need 800
13813 @itemx -read_only_relocs
13814 @itemx -sectalign
13815 @itemx -sectobjectsymbols
13816 @itemx -whyload
13817 @itemx -seg1addr
13818 @itemx -sectcreate
13819 @itemx -sectobjectsymbols
13820 @itemx -sectorder
13821 @itemx -segaddr
13822 @itemx -segs_read_only_addr
13823 @need 800
13824 @itemx -segs_read_write_addr
13825 @itemx -seg_addr_table
13826 @itemx -seg_addr_table_filename
13827 @itemx -seglinkedit
13828 @itemx -segprot
13829 @itemx -segs_read_only_addr
13830 @itemx -segs_read_write_addr
13831 @itemx -single_module
13832 @itemx -static
13833 @itemx -sub_library
13834 @need 800
13835 @itemx -sub_umbrella
13836 @itemx -twolevel_namespace
13837 @itemx -umbrella
13838 @itemx -undefined
13839 @itemx -unexported_symbols_list
13840 @itemx -weak_reference_mismatches
13841 @itemx -whatsloaded
13842 @opindex allowable_client
13843 @opindex client_name
13844 @opindex compatibility_version
13845 @opindex current_version
13846 @opindex dead_strip
13847 @opindex dependency-file
13848 @opindex dylib_file
13849 @opindex dylinker_install_name
13850 @opindex dynamic
13851 @opindex exported_symbols_list
13852 @opindex filelist
13853 @opindex flat_namespace
13854 @opindex force_flat_namespace
13855 @opindex headerpad_max_install_names
13856 @opindex image_base
13857 @opindex init
13858 @opindex install_name
13859 @opindex keep_private_externs
13860 @opindex multi_module
13861 @opindex multiply_defined
13862 @opindex multiply_defined_unused
13863 @opindex noall_load
13864 @opindex no_dead_strip_inits_and_terms
13865 @opindex nofixprebinding
13866 @opindex nomultidefs
13867 @opindex noprebind
13868 @opindex noseglinkedit
13869 @opindex pagezero_size
13870 @opindex prebind
13871 @opindex prebind_all_twolevel_modules
13872 @opindex private_bundle
13873 @opindex read_only_relocs
13874 @opindex sectalign
13875 @opindex sectobjectsymbols
13876 @opindex whyload
13877 @opindex seg1addr
13878 @opindex sectcreate
13879 @opindex sectobjectsymbols
13880 @opindex sectorder
13881 @opindex segaddr
13882 @opindex segs_read_only_addr
13883 @opindex segs_read_write_addr
13884 @opindex seg_addr_table
13885 @opindex seg_addr_table_filename
13886 @opindex seglinkedit
13887 @opindex segprot
13888 @opindex segs_read_only_addr
13889 @opindex segs_read_write_addr
13890 @opindex single_module
13891 @opindex static
13892 @opindex sub_library
13893 @opindex sub_umbrella
13894 @opindex twolevel_namespace
13895 @opindex umbrella
13896 @opindex undefined
13897 @opindex unexported_symbols_list
13898 @opindex weak_reference_mismatches
13899 @opindex whatsloaded
13900 These options are passed to the Darwin linker.  The Darwin linker man page
13901 describes them in detail.
13902 @end table
13904 @node DEC Alpha Options
13905 @subsection DEC Alpha Options
13907 These @samp{-m} options are defined for the DEC Alpha implementations:
13909 @table @gcctabopt
13910 @item -mno-soft-float
13911 @itemx -msoft-float
13912 @opindex mno-soft-float
13913 @opindex msoft-float
13914 Use (do not use) the hardware floating-point instructions for
13915 floating-point operations.  When @option{-msoft-float} is specified,
13916 functions in @file{libgcc.a} are used to perform floating-point
13917 operations.  Unless they are replaced by routines that emulate the
13918 floating-point operations, or compiled in such a way as to call such
13919 emulations routines, these routines issue floating-point
13920 operations.   If you are compiling for an Alpha without floating-point
13921 operations, you must ensure that the library is built so as not to call
13922 them.
13924 Note that Alpha implementations without floating-point operations are
13925 required to have floating-point registers.
13927 @item -mfp-reg
13928 @itemx -mno-fp-regs
13929 @opindex mfp-reg
13930 @opindex mno-fp-regs
13931 Generate code that uses (does not use) the floating-point register set.
13932 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
13933 register set is not used, floating-point operands are passed in integer
13934 registers as if they were integers and floating-point results are passed
13935 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
13936 so any function with a floating-point argument or return value called by code
13937 compiled with @option{-mno-fp-regs} must also be compiled with that
13938 option.
13940 A typical use of this option is building a kernel that does not use,
13941 and hence need not save and restore, any floating-point registers.
13943 @item -mieee
13944 @opindex mieee
13945 The Alpha architecture implements floating-point hardware optimized for
13946 maximum performance.  It is mostly compliant with the IEEE floating-point
13947 standard.  However, for full compliance, software assistance is
13948 required.  This option generates code fully IEEE-compliant code
13949 @emph{except} that the @var{inexact-flag} is not maintained (see below).
13950 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
13951 defined during compilation.  The resulting code is less efficient but is
13952 able to correctly support denormalized numbers and exceptional IEEE
13953 values such as not-a-number and plus/minus infinity.  Other Alpha
13954 compilers call this option @option{-ieee_with_no_inexact}.
13956 @item -mieee-with-inexact
13957 @opindex mieee-with-inexact
13958 This is like @option{-mieee} except the generated code also maintains
13959 the IEEE @var{inexact-flag}.  Turning on this option causes the
13960 generated code to implement fully-compliant IEEE math.  In addition to
13961 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
13962 macro.  On some Alpha implementations the resulting code may execute
13963 significantly slower than the code generated by default.  Since there is
13964 very little code that depends on the @var{inexact-flag}, you should
13965 normally not specify this option.  Other Alpha compilers call this
13966 option @option{-ieee_with_inexact}.
13968 @item -mfp-trap-mode=@var{trap-mode}
13969 @opindex mfp-trap-mode
13970 This option controls what floating-point related traps are enabled.
13971 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
13972 The trap mode can be set to one of four values:
13974 @table @samp
13975 @item n
13976 This is the default (normal) setting.  The only traps that are enabled
13977 are the ones that cannot be disabled in software (e.g., division by zero
13978 trap).
13980 @item u
13981 In addition to the traps enabled by @samp{n}, underflow traps are enabled
13982 as well.
13984 @item su
13985 Like @samp{u}, but the instructions are marked to be safe for software
13986 completion (see Alpha architecture manual for details).
13988 @item sui
13989 Like @samp{su}, but inexact traps are enabled as well.
13990 @end table
13992 @item -mfp-rounding-mode=@var{rounding-mode}
13993 @opindex mfp-rounding-mode
13994 Selects the IEEE rounding mode.  Other Alpha compilers call this option
13995 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
13998 @table @samp
13999 @item n
14000 Normal IEEE rounding mode.  Floating-point numbers are rounded towards
14001 the nearest machine number or towards the even machine number in case
14002 of a tie.
14004 @item m
14005 Round towards minus infinity.
14007 @item c
14008 Chopped rounding mode.  Floating-point numbers are rounded towards zero.
14010 @item d
14011 Dynamic rounding mode.  A field in the floating-point control register
14012 (@var{fpcr}, see Alpha architecture reference manual) controls the
14013 rounding mode in effect.  The C library initializes this register for
14014 rounding towards plus infinity.  Thus, unless your program modifies the
14015 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
14016 @end table
14018 @item -mtrap-precision=@var{trap-precision}
14019 @opindex mtrap-precision
14020 In the Alpha architecture, floating-point traps are imprecise.  This
14021 means without software assistance it is impossible to recover from a
14022 floating trap and program execution normally needs to be terminated.
14023 GCC can generate code that can assist operating system trap handlers
14024 in determining the exact location that caused a floating-point trap.
14025 Depending on the requirements of an application, different levels of
14026 precisions can be selected:
14028 @table @samp
14029 @item p
14030 Program precision.  This option is the default and means a trap handler
14031 can only identify which program caused a floating-point exception.
14033 @item f
14034 Function precision.  The trap handler can determine the function that
14035 caused a floating-point exception.
14037 @item i
14038 Instruction precision.  The trap handler can determine the exact
14039 instruction that caused a floating-point exception.
14040 @end table
14042 Other Alpha compilers provide the equivalent options called
14043 @option{-scope_safe} and @option{-resumption_safe}.
14045 @item -mieee-conformant
14046 @opindex mieee-conformant
14047 This option marks the generated code as IEEE conformant.  You must not
14048 use this option unless you also specify @option{-mtrap-precision=i} and either
14049 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
14050 is to emit the line @samp{.eflag 48} in the function prologue of the
14051 generated assembly file.
14053 @item -mbuild-constants
14054 @opindex mbuild-constants
14055 Normally GCC examines a 32- or 64-bit integer constant to
14056 see if it can construct it from smaller constants in two or three
14057 instructions.  If it cannot, it outputs the constant as a literal and
14058 generates code to load it from the data segment at run time.
14060 Use this option to require GCC to construct @emph{all} integer constants
14061 using code, even if it takes more instructions (the maximum is six).
14063 You typically use this option to build a shared library dynamic
14064 loader.  Itself a shared library, it must relocate itself in memory
14065 before it can find the variables and constants in its own data segment.
14067 @item -mbwx
14068 @itemx -mno-bwx
14069 @itemx -mcix
14070 @itemx -mno-cix
14071 @itemx -mfix
14072 @itemx -mno-fix
14073 @itemx -mmax
14074 @itemx -mno-max
14075 @opindex mbwx
14076 @opindex mno-bwx
14077 @opindex mcix
14078 @opindex mno-cix
14079 @opindex mfix
14080 @opindex mno-fix
14081 @opindex mmax
14082 @opindex mno-max
14083 Indicate whether GCC should generate code to use the optional BWX,
14084 CIX, FIX and MAX instruction sets.  The default is to use the instruction
14085 sets supported by the CPU type specified via @option{-mcpu=} option or that
14086 of the CPU on which GCC was built if none is specified.
14088 @item -mfloat-vax
14089 @itemx -mfloat-ieee
14090 @opindex mfloat-vax
14091 @opindex mfloat-ieee
14092 Generate code that uses (does not use) VAX F and G floating-point
14093 arithmetic instead of IEEE single and double precision.
14095 @item -mexplicit-relocs
14096 @itemx -mno-explicit-relocs
14097 @opindex mexplicit-relocs
14098 @opindex mno-explicit-relocs
14099 Older Alpha assemblers provided no way to generate symbol relocations
14100 except via assembler macros.  Use of these macros does not allow
14101 optimal instruction scheduling.  GNU binutils as of version 2.12
14102 supports a new syntax that allows the compiler to explicitly mark
14103 which relocations should apply to which instructions.  This option
14104 is mostly useful for debugging, as GCC detects the capabilities of
14105 the assembler when it is built and sets the default accordingly.
14107 @item -msmall-data
14108 @itemx -mlarge-data
14109 @opindex msmall-data
14110 @opindex mlarge-data
14111 When @option{-mexplicit-relocs} is in effect, static data is
14112 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
14113 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
14114 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
14115 16-bit relocations off of the @code{$gp} register.  This limits the
14116 size of the small data area to 64KB, but allows the variables to be
14117 directly accessed via a single instruction.
14119 The default is @option{-mlarge-data}.  With this option the data area
14120 is limited to just below 2GB@.  Programs that require more than 2GB of
14121 data must use @code{malloc} or @code{mmap} to allocate the data in the
14122 heap instead of in the program's data segment.
14124 When generating code for shared libraries, @option{-fpic} implies
14125 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
14127 @item -msmall-text
14128 @itemx -mlarge-text
14129 @opindex msmall-text
14130 @opindex mlarge-text
14131 When @option{-msmall-text} is used, the compiler assumes that the
14132 code of the entire program (or shared library) fits in 4MB, and is
14133 thus reachable with a branch instruction.  When @option{-msmall-data}
14134 is used, the compiler can assume that all local symbols share the
14135 same @code{$gp} value, and thus reduce the number of instructions
14136 required for a function call from 4 to 1.
14138 The default is @option{-mlarge-text}.
14140 @item -mcpu=@var{cpu_type}
14141 @opindex mcpu
14142 Set the instruction set and instruction scheduling parameters for
14143 machine type @var{cpu_type}.  You can specify either the @samp{EV}
14144 style name or the corresponding chip number.  GCC supports scheduling
14145 parameters for the EV4, EV5 and EV6 family of processors and
14146 chooses the default values for the instruction set from the processor
14147 you specify.  If you do not specify a processor type, GCC defaults
14148 to the processor on which the compiler was built.
14150 Supported values for @var{cpu_type} are
14152 @table @samp
14153 @item ev4
14154 @itemx ev45
14155 @itemx 21064
14156 Schedules as an EV4 and has no instruction set extensions.
14158 @item ev5
14159 @itemx 21164
14160 Schedules as an EV5 and has no instruction set extensions.
14162 @item ev56
14163 @itemx 21164a
14164 Schedules as an EV5 and supports the BWX extension.
14166 @item pca56
14167 @itemx 21164pc
14168 @itemx 21164PC
14169 Schedules as an EV5 and supports the BWX and MAX extensions.
14171 @item ev6
14172 @itemx 21264
14173 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
14175 @item ev67
14176 @itemx 21264a
14177 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
14178 @end table
14180 Native toolchains also support the value @samp{native},
14181 which selects the best architecture option for the host processor.
14182 @option{-mcpu=native} has no effect if GCC does not recognize
14183 the processor.
14185 @item -mtune=@var{cpu_type}
14186 @opindex mtune
14187 Set only the instruction scheduling parameters for machine type
14188 @var{cpu_type}.  The instruction set is not changed.
14190 Native toolchains also support the value @samp{native},
14191 which selects the best architecture option for the host processor.
14192 @option{-mtune=native} has no effect if GCC does not recognize
14193 the processor.
14195 @item -mmemory-latency=@var{time}
14196 @opindex mmemory-latency
14197 Sets the latency the scheduler should assume for typical memory
14198 references as seen by the application.  This number is highly
14199 dependent on the memory access patterns used by the application
14200 and the size of the external cache on the machine.
14202 Valid options for @var{time} are
14204 @table @samp
14205 @item @var{number}
14206 A decimal number representing clock cycles.
14208 @item L1
14209 @itemx L2
14210 @itemx L3
14211 @itemx main
14212 The compiler contains estimates of the number of clock cycles for
14213 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
14214 (also called Dcache, Scache, and Bcache), as well as to main memory.
14215 Note that L3 is only valid for EV5.
14217 @end table
14218 @end table
14220 @node FR30 Options
14221 @subsection FR30 Options
14222 @cindex FR30 Options
14224 These options are defined specifically for the FR30 port.
14226 @table @gcctabopt
14228 @item -msmall-model
14229 @opindex msmall-model
14230 Use the small address space model.  This can produce smaller code, but
14231 it does assume that all symbolic values and addresses fit into a
14232 20-bit range.
14234 @item -mno-lsim
14235 @opindex mno-lsim
14236 Assume that runtime support has been provided and so there is no need
14237 to include the simulator library (@file{libsim.a}) on the linker
14238 command line.
14240 @end table
14242 @node FRV Options
14243 @subsection FRV Options
14244 @cindex FRV Options
14246 @table @gcctabopt
14247 @item -mgpr-32
14248 @opindex mgpr-32
14250 Only use the first 32 general-purpose registers.
14252 @item -mgpr-64
14253 @opindex mgpr-64
14255 Use all 64 general-purpose registers.
14257 @item -mfpr-32
14258 @opindex mfpr-32
14260 Use only the first 32 floating-point registers.
14262 @item -mfpr-64
14263 @opindex mfpr-64
14265 Use all 64 floating-point registers.
14267 @item -mhard-float
14268 @opindex mhard-float
14270 Use hardware instructions for floating-point operations.
14272 @item -msoft-float
14273 @opindex msoft-float
14275 Use library routines for floating-point operations.
14277 @item -malloc-cc
14278 @opindex malloc-cc
14280 Dynamically allocate condition code registers.
14282 @item -mfixed-cc
14283 @opindex mfixed-cc
14285 Do not try to dynamically allocate condition code registers, only
14286 use @code{icc0} and @code{fcc0}.
14288 @item -mdword
14289 @opindex mdword
14291 Change ABI to use double word insns.
14293 @item -mno-dword
14294 @opindex mno-dword
14296 Do not use double word instructions.
14298 @item -mdouble
14299 @opindex mdouble
14301 Use floating-point double instructions.
14303 @item -mno-double
14304 @opindex mno-double
14306 Do not use floating-point double instructions.
14308 @item -mmedia
14309 @opindex mmedia
14311 Use media instructions.
14313 @item -mno-media
14314 @opindex mno-media
14316 Do not use media instructions.
14318 @item -mmuladd
14319 @opindex mmuladd
14321 Use multiply and add/subtract instructions.
14323 @item -mno-muladd
14324 @opindex mno-muladd
14326 Do not use multiply and add/subtract instructions.
14328 @item -mfdpic
14329 @opindex mfdpic
14331 Select the FDPIC ABI, which uses function descriptors to represent
14332 pointers to functions.  Without any PIC/PIE-related options, it
14333 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
14334 assumes GOT entries and small data are within a 12-bit range from the
14335 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
14336 are computed with 32 bits.
14337 With a @samp{bfin-elf} target, this option implies @option{-msim}.
14339 @item -minline-plt
14340 @opindex minline-plt
14342 Enable inlining of PLT entries in function calls to functions that are
14343 not known to bind locally.  It has no effect without @option{-mfdpic}.
14344 It's enabled by default if optimizing for speed and compiling for
14345 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
14346 optimization option such as @option{-O3} or above is present in the
14347 command line.
14349 @item -mTLS
14350 @opindex mTLS
14352 Assume a large TLS segment when generating thread-local code.
14354 @item -mtls
14355 @opindex mtls
14357 Do not assume a large TLS segment when generating thread-local code.
14359 @item -mgprel-ro
14360 @opindex mgprel-ro
14362 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
14363 that is known to be in read-only sections.  It's enabled by default,
14364 except for @option{-fpic} or @option{-fpie}: even though it may help
14365 make the global offset table smaller, it trades 1 instruction for 4.
14366 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
14367 one of which may be shared by multiple symbols, and it avoids the need
14368 for a GOT entry for the referenced symbol, so it's more likely to be a
14369 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
14371 @item -multilib-library-pic
14372 @opindex multilib-library-pic
14374 Link with the (library, not FD) pic libraries.  It's implied by
14375 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
14376 @option{-fpic} without @option{-mfdpic}.  You should never have to use
14377 it explicitly.
14379 @item -mlinked-fp
14380 @opindex mlinked-fp
14382 Follow the EABI requirement of always creating a frame pointer whenever
14383 a stack frame is allocated.  This option is enabled by default and can
14384 be disabled with @option{-mno-linked-fp}.
14386 @item -mlong-calls
14387 @opindex mlong-calls
14389 Use indirect addressing to call functions outside the current
14390 compilation unit.  This allows the functions to be placed anywhere
14391 within the 32-bit address space.
14393 @item -malign-labels
14394 @opindex malign-labels
14396 Try to align labels to an 8-byte boundary by inserting NOPs into the
14397 previous packet.  This option only has an effect when VLIW packing
14398 is enabled.  It doesn't create new packets; it merely adds NOPs to
14399 existing ones.
14401 @item -mlibrary-pic
14402 @opindex mlibrary-pic
14404 Generate position-independent EABI code.
14406 @item -macc-4
14407 @opindex macc-4
14409 Use only the first four media accumulator registers.
14411 @item -macc-8
14412 @opindex macc-8
14414 Use all eight media accumulator registers.
14416 @item -mpack
14417 @opindex mpack
14419 Pack VLIW instructions.
14421 @item -mno-pack
14422 @opindex mno-pack
14424 Do not pack VLIW instructions.
14426 @item -mno-eflags
14427 @opindex mno-eflags
14429 Do not mark ABI switches in e_flags.
14431 @item -mcond-move
14432 @opindex mcond-move
14434 Enable the use of conditional-move instructions (default).
14436 This switch is mainly for debugging the compiler and will likely be removed
14437 in a future version.
14439 @item -mno-cond-move
14440 @opindex mno-cond-move
14442 Disable the use of conditional-move instructions.
14444 This switch is mainly for debugging the compiler and will likely be removed
14445 in a future version.
14447 @item -mscc
14448 @opindex mscc
14450 Enable the use of conditional set instructions (default).
14452 This switch is mainly for debugging the compiler and will likely be removed
14453 in a future version.
14455 @item -mno-scc
14456 @opindex mno-scc
14458 Disable the use of conditional set instructions.
14460 This switch is mainly for debugging the compiler and will likely be removed
14461 in a future version.
14463 @item -mcond-exec
14464 @opindex mcond-exec
14466 Enable the use of conditional execution (default).
14468 This switch is mainly for debugging the compiler and will likely be removed
14469 in a future version.
14471 @item -mno-cond-exec
14472 @opindex mno-cond-exec
14474 Disable the use of conditional execution.
14476 This switch is mainly for debugging the compiler and will likely be removed
14477 in a future version.
14479 @item -mvliw-branch
14480 @opindex mvliw-branch
14482 Run a pass to pack branches into VLIW instructions (default).
14484 This switch is mainly for debugging the compiler and will likely be removed
14485 in a future version.
14487 @item -mno-vliw-branch
14488 @opindex mno-vliw-branch
14490 Do not run a pass to pack branches into VLIW instructions.
14492 This switch is mainly for debugging the compiler and will likely be removed
14493 in a future version.
14495 @item -mmulti-cond-exec
14496 @opindex mmulti-cond-exec
14498 Enable optimization of @code{&&} and @code{||} in conditional execution
14499 (default).
14501 This switch is mainly for debugging the compiler and will likely be removed
14502 in a future version.
14504 @item -mno-multi-cond-exec
14505 @opindex mno-multi-cond-exec
14507 Disable optimization of @code{&&} and @code{||} in conditional execution.
14509 This switch is mainly for debugging the compiler and will likely be removed
14510 in a future version.
14512 @item -mnested-cond-exec
14513 @opindex mnested-cond-exec
14515 Enable nested conditional execution optimizations (default).
14517 This switch is mainly for debugging the compiler and will likely be removed
14518 in a future version.
14520 @item -mno-nested-cond-exec
14521 @opindex mno-nested-cond-exec
14523 Disable nested conditional execution optimizations.
14525 This switch is mainly for debugging the compiler and will likely be removed
14526 in a future version.
14528 @item -moptimize-membar
14529 @opindex moptimize-membar
14531 This switch removes redundant @code{membar} instructions from the
14532 compiler-generated code.  It is enabled by default.
14534 @item -mno-optimize-membar
14535 @opindex mno-optimize-membar
14537 This switch disables the automatic removal of redundant @code{membar}
14538 instructions from the generated code.
14540 @item -mtomcat-stats
14541 @opindex mtomcat-stats
14543 Cause gas to print out tomcat statistics.
14545 @item -mcpu=@var{cpu}
14546 @opindex mcpu
14548 Select the processor type for which to generate code.  Possible values are
14549 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
14550 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
14552 @end table
14554 @node GNU/Linux Options
14555 @subsection GNU/Linux Options
14557 These @samp{-m} options are defined for GNU/Linux targets:
14559 @table @gcctabopt
14560 @item -mglibc
14561 @opindex mglibc
14562 Use the GNU C library.  This is the default except
14563 on @samp{*-*-linux-*uclibc*} and @samp{*-*-linux-*android*} targets.
14565 @item -muclibc
14566 @opindex muclibc
14567 Use uClibc C library.  This is the default on
14568 @samp{*-*-linux-*uclibc*} targets.
14570 @item -mbionic
14571 @opindex mbionic
14572 Use Bionic C library.  This is the default on
14573 @samp{*-*-linux-*android*} targets.
14575 @item -mandroid
14576 @opindex mandroid
14577 Compile code compatible with Android platform.  This is the default on
14578 @samp{*-*-linux-*android*} targets.
14580 When compiling, this option enables @option{-mbionic}, @option{-fPIC},
14581 @option{-fno-exceptions} and @option{-fno-rtti} by default.  When linking,
14582 this option makes the GCC driver pass Android-specific options to the linker.
14583 Finally, this option causes the preprocessor macro @code{__ANDROID__}
14584 to be defined.
14586 @item -tno-android-cc
14587 @opindex tno-android-cc
14588 Disable compilation effects of @option{-mandroid}, i.e., do not enable
14589 @option{-mbionic}, @option{-fPIC}, @option{-fno-exceptions} and
14590 @option{-fno-rtti} by default.
14592 @item -tno-android-ld
14593 @opindex tno-android-ld
14594 Disable linking effects of @option{-mandroid}, i.e., pass standard Linux
14595 linking options to the linker.
14597 @end table
14599 @node H8/300 Options
14600 @subsection H8/300 Options
14602 These @samp{-m} options are defined for the H8/300 implementations:
14604 @table @gcctabopt
14605 @item -mrelax
14606 @opindex mrelax
14607 Shorten some address references at link time, when possible; uses the
14608 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
14609 ld, Using ld}, for a fuller description.
14611 @item -mh
14612 @opindex mh
14613 Generate code for the H8/300H@.
14615 @item -ms
14616 @opindex ms
14617 Generate code for the H8S@.
14619 @item -mn
14620 @opindex mn
14621 Generate code for the H8S and H8/300H in the normal mode.  This switch
14622 must be used either with @option{-mh} or @option{-ms}.
14624 @item -ms2600
14625 @opindex ms2600
14626 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
14628 @item -mexr
14629 @opindex mexr
14630 Extended registers are stored on stack before execution of function
14631 with monitor attribute. Default option is @option{-mexr}.
14632 This option is valid only for H8S targets.
14634 @item -mno-exr
14635 @opindex mno-exr
14636 Extended registers are not stored on stack before execution of function 
14637 with monitor attribute. Default option is @option{-mno-exr}. 
14638 This option is valid only for H8S targets.
14640 @item -mint32
14641 @opindex mint32
14642 Make @code{int} data 32 bits by default.
14644 @item -malign-300
14645 @opindex malign-300
14646 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
14647 The default for the H8/300H and H8S is to align longs and floats on
14648 4-byte boundaries.
14649 @option{-malign-300} causes them to be aligned on 2-byte boundaries.
14650 This option has no effect on the H8/300.
14651 @end table
14653 @node HPPA Options
14654 @subsection HPPA Options
14655 @cindex HPPA Options
14657 These @samp{-m} options are defined for the HPPA family of computers:
14659 @table @gcctabopt
14660 @item -march=@var{architecture-type}
14661 @opindex march
14662 Generate code for the specified architecture.  The choices for
14663 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
14664 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
14665 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
14666 architecture option for your machine.  Code compiled for lower numbered
14667 architectures runs on higher numbered architectures, but not the
14668 other way around.
14670 @item -mpa-risc-1-0
14671 @itemx -mpa-risc-1-1
14672 @itemx -mpa-risc-2-0
14673 @opindex mpa-risc-1-0
14674 @opindex mpa-risc-1-1
14675 @opindex mpa-risc-2-0
14676 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
14678 @item -mjump-in-delay
14679 @opindex mjump-in-delay
14680 Fill delay slots of function calls with unconditional jump instructions
14681 by modifying the return pointer for the function call to be the target
14682 of the conditional jump.
14684 @item -mdisable-fpregs
14685 @opindex mdisable-fpregs
14686 Prevent floating-point registers from being used in any manner.  This is
14687 necessary for compiling kernels that perform lazy context switching of
14688 floating-point registers.  If you use this option and attempt to perform
14689 floating-point operations, the compiler aborts.
14691 @item -mdisable-indexing
14692 @opindex mdisable-indexing
14693 Prevent the compiler from using indexing address modes.  This avoids some
14694 rather obscure problems when compiling MIG generated code under MACH@.
14696 @item -mno-space-regs
14697 @opindex mno-space-regs
14698 Generate code that assumes the target has no space registers.  This allows
14699 GCC to generate faster indirect calls and use unscaled index address modes.
14701 Such code is suitable for level 0 PA systems and kernels.
14703 @item -mfast-indirect-calls
14704 @opindex mfast-indirect-calls
14705 Generate code that assumes calls never cross space boundaries.  This
14706 allows GCC to emit code that performs faster indirect calls.
14708 This option does not work in the presence of shared libraries or nested
14709 functions.
14711 @item -mfixed-range=@var{register-range}
14712 @opindex mfixed-range
14713 Generate code treating the given register range as fixed registers.
14714 A fixed register is one that the register allocator cannot use.  This is
14715 useful when compiling kernel code.  A register range is specified as
14716 two registers separated by a dash.  Multiple register ranges can be
14717 specified separated by a comma.
14719 @item -mlong-load-store
14720 @opindex mlong-load-store
14721 Generate 3-instruction load and store sequences as sometimes required by
14722 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
14723 the HP compilers.
14725 @item -mportable-runtime
14726 @opindex mportable-runtime
14727 Use the portable calling conventions proposed by HP for ELF systems.
14729 @item -mgas
14730 @opindex mgas
14731 Enable the use of assembler directives only GAS understands.
14733 @item -mschedule=@var{cpu-type}
14734 @opindex mschedule
14735 Schedule code according to the constraints for the machine type
14736 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
14737 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
14738 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
14739 proper scheduling option for your machine.  The default scheduling is
14740 @samp{8000}.
14742 @item -mlinker-opt
14743 @opindex mlinker-opt
14744 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
14745 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
14746 linkers in which they give bogus error messages when linking some programs.
14748 @item -msoft-float
14749 @opindex msoft-float
14750 Generate output containing library calls for floating point.
14751 @strong{Warning:} the requisite libraries are not available for all HPPA
14752 targets.  Normally the facilities of the machine's usual C compiler are
14753 used, but this cannot be done directly in cross-compilation.  You must make
14754 your own arrangements to provide suitable library functions for
14755 cross-compilation.
14757 @option{-msoft-float} changes the calling convention in the output file;
14758 therefore, it is only useful if you compile @emph{all} of a program with
14759 this option.  In particular, you need to compile @file{libgcc.a}, the
14760 library that comes with GCC, with @option{-msoft-float} in order for
14761 this to work.
14763 @item -msio
14764 @opindex msio
14765 Generate the predefine, @code{_SIO}, for server IO@.  The default is
14766 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
14767 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
14768 options are available under HP-UX and HI-UX@.
14770 @item -mgnu-ld
14771 @opindex mgnu-ld
14772 Use options specific to GNU @command{ld}.
14773 This passes @option{-shared} to @command{ld} when
14774 building a shared library.  It is the default when GCC is configured,
14775 explicitly or implicitly, with the GNU linker.  This option does not
14776 affect which @command{ld} is called; it only changes what parameters
14777 are passed to that @command{ld}.
14778 The @command{ld} that is called is determined by the
14779 @option{--with-ld} configure option, GCC's program search path, and
14780 finally by the user's @env{PATH}.  The linker used by GCC can be printed
14781 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
14782 on the 64-bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
14784 @item -mhp-ld
14785 @opindex mhp-ld
14786 Use options specific to HP @command{ld}.
14787 This passes @option{-b} to @command{ld} when building
14788 a shared library and passes @option{+Accept TypeMismatch} to @command{ld} on all
14789 links.  It is the default when GCC is configured, explicitly or
14790 implicitly, with the HP linker.  This option does not affect
14791 which @command{ld} is called; it only changes what parameters are passed to that
14792 @command{ld}.
14793 The @command{ld} that is called is determined by the @option{--with-ld}
14794 configure option, GCC's program search path, and finally by the user's
14795 @env{PATH}.  The linker used by GCC can be printed using @samp{which
14796 `gcc -print-prog-name=ld`}.  This option is only available on the 64-bit
14797 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
14799 @item -mlong-calls
14800 @opindex mno-long-calls
14801 Generate code that uses long call sequences.  This ensures that a call
14802 is always able to reach linker generated stubs.  The default is to generate
14803 long calls only when the distance from the call site to the beginning
14804 of the function or translation unit, as the case may be, exceeds a
14805 predefined limit set by the branch type being used.  The limits for
14806 normal calls are 7,600,000 and 240,000 bytes, respectively for the
14807 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
14808 240,000 bytes.
14810 Distances are measured from the beginning of functions when using the
14811 @option{-ffunction-sections} option, or when using the @option{-mgas}
14812 and @option{-mno-portable-runtime} options together under HP-UX with
14813 the SOM linker.
14815 It is normally not desirable to use this option as it degrades
14816 performance.  However, it may be useful in large applications,
14817 particularly when partial linking is used to build the application.
14819 The types of long calls used depends on the capabilities of the
14820 assembler and linker, and the type of code being generated.  The
14821 impact on systems that support long absolute calls, and long pic
14822 symbol-difference or pc-relative calls should be relatively small.
14823 However, an indirect call is used on 32-bit ELF systems in pic code
14824 and it is quite long.
14826 @item -munix=@var{unix-std}
14827 @opindex march
14828 Generate compiler predefines and select a startfile for the specified
14829 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
14830 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
14831 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
14832 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
14833 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
14834 and later.
14836 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
14837 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
14838 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
14839 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
14840 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
14841 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
14843 It is @emph{important} to note that this option changes the interfaces
14844 for various library routines.  It also affects the operational behavior
14845 of the C library.  Thus, @emph{extreme} care is needed in using this
14846 option.
14848 Library code that is intended to operate with more than one UNIX
14849 standard must test, set and restore the variable @var{__xpg4_extended_mask}
14850 as appropriate.  Most GNU software doesn't provide this capability.
14852 @item -nolibdld
14853 @opindex nolibdld
14854 Suppress the generation of link options to search libdld.sl when the
14855 @option{-static} option is specified on HP-UX 10 and later.
14857 @item -static
14858 @opindex static
14859 The HP-UX implementation of setlocale in libc has a dependency on
14860 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
14861 when the @option{-static} option is specified, special link options
14862 are needed to resolve this dependency.
14864 On HP-UX 10 and later, the GCC driver adds the necessary options to
14865 link with libdld.sl when the @option{-static} option is specified.
14866 This causes the resulting binary to be dynamic.  On the 64-bit port,
14867 the linkers generate dynamic binaries by default in any case.  The
14868 @option{-nolibdld} option can be used to prevent the GCC driver from
14869 adding these link options.
14871 @item -threads
14872 @opindex threads
14873 Add support for multithreading with the @dfn{dce thread} library
14874 under HP-UX@.  This option sets flags for both the preprocessor and
14875 linker.
14876 @end table
14878 @node i386 and x86-64 Options
14879 @subsection Intel 386 and AMD x86-64 Options
14880 @cindex i386 Options
14881 @cindex x86-64 Options
14882 @cindex Intel 386 Options
14883 @cindex AMD x86-64 Options
14885 These @samp{-m} options are defined for the i386 and x86-64 family of
14886 computers:
14888 @table @gcctabopt
14890 @item -march=@var{cpu-type}
14891 @opindex march
14892 Generate instructions for the machine type @var{cpu-type}.  In contrast to
14893 @option{-mtune=@var{cpu-type}}, which merely tunes the generated code 
14894 for the specified @var{cpu-type}, @option{-march=@var{cpu-type}} allows GCC
14895 to generate code that may not run at all on processors other than the one
14896 indicated.  Specifying @option{-march=@var{cpu-type}} implies 
14897 @option{-mtune=@var{cpu-type}}.
14899 The choices for @var{cpu-type} are:
14901 @table @samp
14902 @item native
14903 This selects the CPU to generate code for at compilation time by determining
14904 the processor type of the compiling machine.  Using @option{-march=native}
14905 enables all instruction subsets supported by the local machine (hence
14906 the result might not run on different machines).  Using @option{-mtune=native}
14907 produces code optimized for the local machine under the constraints
14908 of the selected instruction set.  
14910 @item i386
14911 Original Intel i386 CPU@.
14913 @item i486
14914 Intel i486 CPU@.  (No scheduling is implemented for this chip.)
14916 @item i586
14917 @itemx pentium
14918 Intel Pentium CPU with no MMX support.
14920 @item pentium-mmx
14921 Intel Pentium MMX CPU, based on Pentium core with MMX instruction set support.
14923 @item pentiumpro
14924 Intel Pentium Pro CPU@.
14926 @item i686
14927 When used with @option{-march}, the Pentium Pro
14928 instruction set is used, so the code runs on all i686 family chips.
14929 When used with @option{-mtune}, it has the same meaning as @samp{generic}.
14931 @item pentium2
14932 Intel Pentium II CPU, based on Pentium Pro core with MMX instruction set
14933 support.
14935 @item pentium3
14936 @itemx pentium3m
14937 Intel Pentium III CPU, based on Pentium Pro core with MMX and SSE instruction
14938 set support.
14940 @item pentium-m
14941 Intel Pentium M; low-power version of Intel Pentium III CPU
14942 with MMX, SSE and SSE2 instruction set support.  Used by Centrino notebooks.
14944 @item pentium4
14945 @itemx pentium4m
14946 Intel Pentium 4 CPU with MMX, SSE and SSE2 instruction set support.
14948 @item prescott
14949 Improved version of Intel Pentium 4 CPU with MMX, SSE, SSE2 and SSE3 instruction
14950 set support.
14952 @item nocona
14953 Improved version of Intel Pentium 4 CPU with 64-bit extensions, MMX, SSE,
14954 SSE2 and SSE3 instruction set support.
14956 @item core2
14957 Intel Core 2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
14958 instruction set support.
14960 @item nehalem
14961 Intel Nehalem CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
14962 SSE4.1, SSE4.2 and POPCNT instruction set support.
14964 @item westmere
14965 Intel Westmere CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
14966 SSE4.1, SSE4.2, POPCNT, AES and PCLMUL instruction set support.
14968 @item sandybridge
14969 Intel Sandy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
14970 SSE4.1, SSE4.2, POPCNT, AVX, AES and PCLMUL instruction set support.
14972 @item ivybridge
14973 Intel Ivy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
14974 SSE4.1, SSE4.2, POPCNT, AVX, AES, PCLMUL, FSGSBASE, RDRND and F16C
14975 instruction set support.
14977 @item haswell
14978 Intel Haswell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
14979 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
14980 BMI, BMI2 and F16C instruction set support.
14982 @item broadwell
14983 Intel Broadwell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
14984 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
14985 BMI, BMI2, F16C, RDSEED, ADCX and PREFETCHW instruction set support.
14987 @item bonnell
14988 Intel Bonnell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3 and SSSE3
14989 instruction set support.
14991 @item silvermont
14992 Intel Silvermont CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
14993 SSE4.1, SSE4.2, POPCNT, AES, PCLMUL and RDRND instruction set support.
14995 @item k6
14996 AMD K6 CPU with MMX instruction set support.
14998 @item k6-2
14999 @itemx k6-3
15000 Improved versions of AMD K6 CPU with MMX and 3DNow!@: instruction set support.
15002 @item athlon
15003 @itemx athlon-tbird
15004 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3DNow!@: and SSE prefetch instructions
15005 support.
15007 @item athlon-4
15008 @itemx athlon-xp
15009 @itemx athlon-mp
15010 Improved AMD Athlon CPU with MMX, 3DNow!, enhanced 3DNow!@: and full SSE
15011 instruction set support.
15013 @item k8
15014 @itemx opteron
15015 @itemx athlon64
15016 @itemx athlon-fx
15017 Processors based on the AMD K8 core with x86-64 instruction set support,
15018 including the AMD Opteron, Athlon 64, and Athlon 64 FX processors.
15019 (This supersets MMX, SSE, SSE2, 3DNow!, enhanced 3DNow!@: and 64-bit
15020 instruction set extensions.)
15022 @item k8-sse3
15023 @itemx opteron-sse3
15024 @itemx athlon64-sse3
15025 Improved versions of AMD K8 cores with SSE3 instruction set support.
15027 @item amdfam10
15028 @itemx barcelona
15029 CPUs based on AMD Family 10h cores with x86-64 instruction set support.  (This
15030 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!, enhanced 3DNow!, ABM and 64-bit
15031 instruction set extensions.)
15033 @item bdver1
15034 CPUs based on AMD Family 15h cores with x86-64 instruction set support.  (This
15035 supersets FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A,
15036 SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set extensions.)
15037 @item bdver2
15038 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
15039 supersets BMI, TBM, F16C, FMA, FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX,
15040 SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set 
15041 extensions.)
15042 @item bdver3
15043 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
15044 supersets BMI, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, XOP, LWP, AES, 
15045 PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 
15046 64-bit instruction set extensions.
15047 @item bdver4
15048 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
15049 supersets BMI, BMI2, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, AVX2, XOP, LWP, 
15050 AES, PCL_MUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, 
15051 SSE4.2, ABM and 64-bit instruction set extensions.
15053 @item btver1
15054 CPUs based on AMD Family 14h cores with x86-64 instruction set support.  (This
15055 supersets MMX, SSE, SSE2, SSE3, SSSE3, SSE4A, CX16, ABM and 64-bit
15056 instruction set extensions.)
15058 @item btver2
15059 CPUs based on AMD Family 16h cores with x86-64 instruction set support. This
15060 includes MOVBE, F16C, BMI, AVX, PCL_MUL, AES, SSE4.2, SSE4.1, CX16, ABM,
15061 SSE4A, SSSE3, SSE3, SSE2, SSE, MMX and 64-bit instruction set extensions.
15063 @item winchip-c6
15064 IDT WinChip C6 CPU, dealt in same way as i486 with additional MMX instruction
15065 set support.
15067 @item winchip2
15068 IDT WinChip 2 CPU, dealt in same way as i486 with additional MMX and 3DNow!@:
15069 instruction set support.
15071 @item c3
15072 VIA C3 CPU with MMX and 3DNow!@: instruction set support.  (No scheduling is
15073 implemented for this chip.)
15075 @item c3-2
15076 VIA C3-2 (Nehemiah/C5XL) CPU with MMX and SSE instruction set support.
15077 (No scheduling is
15078 implemented for this chip.)
15080 @item geode
15081 AMD Geode embedded processor with MMX and 3DNow!@: instruction set support.
15082 @end table
15084 @item -mtune=@var{cpu-type}
15085 @opindex mtune
15086 Tune to @var{cpu-type} everything applicable about the generated code, except
15087 for the ABI and the set of available instructions.  
15088 While picking a specific @var{cpu-type} schedules things appropriately
15089 for that particular chip, the compiler does not generate any code that
15090 cannot run on the default machine type unless you use a
15091 @option{-march=@var{cpu-type}} option.
15092 For example, if GCC is configured for i686-pc-linux-gnu
15093 then @option{-mtune=pentium4} generates code that is tuned for Pentium 4
15094 but still runs on i686 machines.
15096 The choices for @var{cpu-type} are the same as for @option{-march}.
15097 In addition, @option{-mtune} supports 2 extra choices for @var{cpu-type}:
15099 @table @samp
15100 @item generic
15101 Produce code optimized for the most common IA32/@/AMD64/@/EM64T processors.
15102 If you know the CPU on which your code will run, then you should use
15103 the corresponding @option{-mtune} or @option{-march} option instead of
15104 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
15105 of your application will have, then you should use this option.
15107 As new processors are deployed in the marketplace, the behavior of this
15108 option will change.  Therefore, if you upgrade to a newer version of
15109 GCC, code generation controlled by this option will change to reflect
15110 the processors
15111 that are most common at the time that version of GCC is released.
15113 There is no @option{-march=generic} option because @option{-march}
15114 indicates the instruction set the compiler can use, and there is no
15115 generic instruction set applicable to all processors.  In contrast,
15116 @option{-mtune} indicates the processor (or, in this case, collection of
15117 processors) for which the code is optimized.
15119 @item intel
15120 Produce code optimized for the most current Intel processors, which are
15121 Haswell and Silvermont for this version of GCC.  If you know the CPU
15122 on which your code will run, then you should use the corresponding
15123 @option{-mtune} or @option{-march} option instead of @option{-mtune=intel}.
15124 But, if you want your application performs better on both Haswell and
15125 Silvermont, then you should use this option.
15127 As new Intel processors are deployed in the marketplace, the behavior of
15128 this option will change.  Therefore, if you upgrade to a newer version of
15129 GCC, code generation controlled by this option will change to reflect
15130 the most current Intel processors at the time that version of GCC is
15131 released.
15133 There is no @option{-march=intel} option because @option{-march} indicates
15134 the instruction set the compiler can use, and there is no common
15135 instruction set applicable to all processors.  In contrast,
15136 @option{-mtune} indicates the processor (or, in this case, collection of
15137 processors) for which the code is optimized.
15138 @end table
15140 @item -mcpu=@var{cpu-type}
15141 @opindex mcpu
15142 A deprecated synonym for @option{-mtune}.
15144 @item -mfpmath=@var{unit}
15145 @opindex mfpmath
15146 Generate floating-point arithmetic for selected unit @var{unit}.  The choices
15147 for @var{unit} are:
15149 @table @samp
15150 @item 387
15151 Use the standard 387 floating-point coprocessor present on the majority of chips and
15152 emulated otherwise.  Code compiled with this option runs almost everywhere.
15153 The temporary results are computed in 80-bit precision instead of the precision
15154 specified by the type, resulting in slightly different results compared to most
15155 of other chips.  See @option{-ffloat-store} for more detailed description.
15157 This is the default choice for i386 compiler.
15159 @item sse
15160 Use scalar floating-point instructions present in the SSE instruction set.
15161 This instruction set is supported by Pentium III and newer chips,
15162 and in the AMD line
15163 by Athlon-4, Athlon XP and Athlon MP chips.  The earlier version of the SSE
15164 instruction set supports only single-precision arithmetic, thus the double and
15165 extended-precision arithmetic are still done using 387.  A later version, present
15166 only in Pentium 4 and AMD x86-64 chips, supports double-precision
15167 arithmetic too.
15169 For the i386 compiler, you must use @option{-march=@var{cpu-type}}, @option{-msse}
15170 or @option{-msse2} switches to enable SSE extensions and make this option
15171 effective.  For the x86-64 compiler, these extensions are enabled by default.
15173 The resulting code should be considerably faster in the majority of cases and avoid
15174 the numerical instability problems of 387 code, but may break some existing
15175 code that expects temporaries to be 80 bits.
15177 This is the default choice for the x86-64 compiler.
15179 @item sse,387
15180 @itemx sse+387
15181 @itemx both
15182 Attempt to utilize both instruction sets at once.  This effectively doubles the
15183 amount of available registers, and on chips with separate execution units for
15184 387 and SSE the execution resources too.  Use this option with care, as it is
15185 still experimental, because the GCC register allocator does not model separate
15186 functional units well, resulting in unstable performance.
15187 @end table
15189 @item -masm=@var{dialect}
15190 @opindex masm=@var{dialect}
15191 Output assembly instructions using selected @var{dialect}.  Supported
15192 choices are @samp{intel} or @samp{att} (the default).  Darwin does
15193 not support @samp{intel}.
15195 @item -mieee-fp
15196 @itemx -mno-ieee-fp
15197 @opindex mieee-fp
15198 @opindex mno-ieee-fp
15199 Control whether or not the compiler uses IEEE floating-point
15200 comparisons.  These correctly handle the case where the result of a
15201 comparison is unordered.
15203 @item -msoft-float
15204 @opindex msoft-float
15205 Generate output containing library calls for floating point.
15207 @strong{Warning:} the requisite libraries are not part of GCC@.
15208 Normally the facilities of the machine's usual C compiler are used, but
15209 this can't be done directly in cross-compilation.  You must make your
15210 own arrangements to provide suitable library functions for
15211 cross-compilation.
15213 On machines where a function returns floating-point results in the 80387
15214 register stack, some floating-point opcodes may be emitted even if
15215 @option{-msoft-float} is used.
15217 @item -mno-fp-ret-in-387
15218 @opindex mno-fp-ret-in-387
15219 Do not use the FPU registers for return values of functions.
15221 The usual calling convention has functions return values of types
15222 @code{float} and @code{double} in an FPU register, even if there
15223 is no FPU@.  The idea is that the operating system should emulate
15224 an FPU@.
15226 The option @option{-mno-fp-ret-in-387} causes such values to be returned
15227 in ordinary CPU registers instead.
15229 @item -mno-fancy-math-387
15230 @opindex mno-fancy-math-387
15231 Some 387 emulators do not support the @code{sin}, @code{cos} and
15232 @code{sqrt} instructions for the 387.  Specify this option to avoid
15233 generating those instructions.  This option is the default on FreeBSD,
15234 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
15235 indicates that the target CPU always has an FPU and so the
15236 instruction does not need emulation.  These
15237 instructions are not generated unless you also use the
15238 @option{-funsafe-math-optimizations} switch.
15240 @item -malign-double
15241 @itemx -mno-align-double
15242 @opindex malign-double
15243 @opindex mno-align-double
15244 Control whether GCC aligns @code{double}, @code{long double}, and
15245 @code{long long} variables on a two-word boundary or a one-word
15246 boundary.  Aligning @code{double} variables on a two-word boundary
15247 produces code that runs somewhat faster on a Pentium at the
15248 expense of more memory.
15250 On x86-64, @option{-malign-double} is enabled by default.
15252 @strong{Warning:} if you use the @option{-malign-double} switch,
15253 structures containing the above types are aligned differently than
15254 the published application binary interface specifications for the 386
15255 and are not binary compatible with structures in code compiled
15256 without that switch.
15258 @item -m96bit-long-double
15259 @itemx -m128bit-long-double
15260 @opindex m96bit-long-double
15261 @opindex m128bit-long-double
15262 These switches control the size of @code{long double} type.  The i386
15263 application binary interface specifies the size to be 96 bits,
15264 so @option{-m96bit-long-double} is the default in 32-bit mode.
15266 Modern architectures (Pentium and newer) prefer @code{long double}
15267 to be aligned to an 8- or 16-byte boundary.  In arrays or structures
15268 conforming to the ABI, this is not possible.  So specifying
15269 @option{-m128bit-long-double} aligns @code{long double}
15270 to a 16-byte boundary by padding the @code{long double} with an additional
15271 32-bit zero.
15273 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
15274 its ABI specifies that @code{long double} is aligned on 16-byte boundary.
15276 Notice that neither of these options enable any extra precision over the x87
15277 standard of 80 bits for a @code{long double}.
15279 @strong{Warning:} if you override the default value for your target ABI, this
15280 changes the size of 
15281 structures and arrays containing @code{long double} variables,
15282 as well as modifying the function calling convention for functions taking
15283 @code{long double}.  Hence they are not binary-compatible
15284 with code compiled without that switch.
15286 @item -mlong-double-64
15287 @itemx -mlong-double-80
15288 @itemx -mlong-double-128
15289 @opindex mlong-double-64
15290 @opindex mlong-double-80
15291 @opindex mlong-double-128
15292 These switches control the size of @code{long double} type. A size
15293 of 64 bits makes the @code{long double} type equivalent to the @code{double}
15294 type. This is the default for 32-bit Bionic C library.  A size
15295 of 128 bits makes the @code{long double} type equivalent to the
15296 @code{__float128} type. This is the default for 64-bit Bionic C library.
15298 @strong{Warning:} if you override the default value for your target ABI, this
15299 changes the size of
15300 structures and arrays containing @code{long double} variables,
15301 as well as modifying the function calling convention for functions taking
15302 @code{long double}.  Hence they are not binary-compatible
15303 with code compiled without that switch.
15305 @item -mlarge-data-threshold=@var{threshold}
15306 @opindex mlarge-data-threshold
15307 When @option{-mcmodel=medium} is specified, data objects larger than
15308 @var{threshold} are placed in the large data section.  This value must be the
15309 same across all objects linked into the binary, and defaults to 65535.
15311 @item -mrtd
15312 @opindex mrtd
15313 Use a different function-calling convention, in which functions that
15314 take a fixed number of arguments return with the @code{ret @var{num}}
15315 instruction, which pops their arguments while returning.  This saves one
15316 instruction in the caller since there is no need to pop the arguments
15317 there.
15319 You can specify that an individual function is called with this calling
15320 sequence with the function attribute @samp{stdcall}.  You can also
15321 override the @option{-mrtd} option by using the function attribute
15322 @samp{cdecl}.  @xref{Function Attributes}.
15324 @strong{Warning:} this calling convention is incompatible with the one
15325 normally used on Unix, so you cannot use it if you need to call
15326 libraries compiled with the Unix compiler.
15328 Also, you must provide function prototypes for all functions that
15329 take variable numbers of arguments (including @code{printf});
15330 otherwise incorrect code is generated for calls to those
15331 functions.
15333 In addition, seriously incorrect code results if you call a
15334 function with too many arguments.  (Normally, extra arguments are
15335 harmlessly ignored.)
15337 @item -mregparm=@var{num}
15338 @opindex mregparm
15339 Control how many registers are used to pass integer arguments.  By
15340 default, no registers are used to pass arguments, and at most 3
15341 registers can be used.  You can control this behavior for a specific
15342 function by using the function attribute @samp{regparm}.
15343 @xref{Function Attributes}.
15345 @strong{Warning:} if you use this switch, and
15346 @var{num} is nonzero, then you must build all modules with the same
15347 value, including any libraries.  This includes the system libraries and
15348 startup modules.
15350 @item -msseregparm
15351 @opindex msseregparm
15352 Use SSE register passing conventions for float and double arguments
15353 and return values.  You can control this behavior for a specific
15354 function by using the function attribute @samp{sseregparm}.
15355 @xref{Function Attributes}.
15357 @strong{Warning:} if you use this switch then you must build all
15358 modules with the same value, including any libraries.  This includes
15359 the system libraries and startup modules.
15361 @item -mvect8-ret-in-mem
15362 @opindex mvect8-ret-in-mem
15363 Return 8-byte vectors in memory instead of MMX registers.  This is the
15364 default on Solaris@tie{}8 and 9 and VxWorks to match the ABI of the Sun
15365 Studio compilers until version 12.  Later compiler versions (starting
15366 with Studio 12 Update@tie{}1) follow the ABI used by other x86 targets, which
15367 is the default on Solaris@tie{}10 and later.  @emph{Only} use this option if
15368 you need to remain compatible with existing code produced by those
15369 previous compiler versions or older versions of GCC@.
15371 @item -mpc32
15372 @itemx -mpc64
15373 @itemx -mpc80
15374 @opindex mpc32
15375 @opindex mpc64
15376 @opindex mpc80
15378 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
15379 is specified, the significands of results of floating-point operations are
15380 rounded to 24 bits (single precision); @option{-mpc64} rounds the
15381 significands of results of floating-point operations to 53 bits (double
15382 precision) and @option{-mpc80} rounds the significands of results of
15383 floating-point operations to 64 bits (extended double precision), which is
15384 the default.  When this option is used, floating-point operations in higher
15385 precisions are not available to the programmer without setting the FPU
15386 control word explicitly.
15388 Setting the rounding of floating-point operations to less than the default
15389 80 bits can speed some programs by 2% or more.  Note that some mathematical
15390 libraries assume that extended-precision (80-bit) floating-point operations
15391 are enabled by default; routines in such libraries could suffer significant
15392 loss of accuracy, typically through so-called ``catastrophic cancellation'',
15393 when this option is used to set the precision to less than extended precision.
15395 @item -mstackrealign
15396 @opindex mstackrealign
15397 Realign the stack at entry.  On the Intel x86, the @option{-mstackrealign}
15398 option generates an alternate prologue and epilogue that realigns the
15399 run-time stack if necessary.  This supports mixing legacy codes that keep
15400 4-byte stack alignment with modern codes that keep 16-byte stack alignment for
15401 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
15402 applicable to individual functions.
15404 @item -mpreferred-stack-boundary=@var{num}
15405 @opindex mpreferred-stack-boundary
15406 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
15407 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
15408 the default is 4 (16 bytes or 128 bits).
15410 @strong{Warning:} When generating code for the x86-64 architecture with
15411 SSE extensions disabled, @option{-mpreferred-stack-boundary=3} can be
15412 used to keep the stack boundary aligned to 8 byte boundary.  Since
15413 x86-64 ABI require 16 byte stack alignment, this is ABI incompatible and
15414 intended to be used in controlled environment where stack space is
15415 important limitation.  This option will lead to wrong code when functions
15416 compiled with 16 byte stack alignment (such as functions from a standard
15417 library) are called with misaligned stack.  In this case, SSE
15418 instructions may lead to misaligned memory access traps.  In addition,
15419 variable arguments will be handled incorrectly for 16 byte aligned
15420 objects (including x87 long double and __int128), leading to wrong
15421 results.  You must build all modules with
15422 @option{-mpreferred-stack-boundary=3}, including any libraries.  This
15423 includes the system libraries and startup modules.
15425 @item -mincoming-stack-boundary=@var{num}
15426 @opindex mincoming-stack-boundary
15427 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
15428 boundary.  If @option{-mincoming-stack-boundary} is not specified,
15429 the one specified by @option{-mpreferred-stack-boundary} is used.
15431 On Pentium and Pentium Pro, @code{double} and @code{long double} values
15432 should be aligned to an 8-byte boundary (see @option{-malign-double}) or
15433 suffer significant run time performance penalties.  On Pentium III, the
15434 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
15435 properly if it is not 16-byte aligned.
15437 To ensure proper alignment of this values on the stack, the stack boundary
15438 must be as aligned as that required by any value stored on the stack.
15439 Further, every function must be generated such that it keeps the stack
15440 aligned.  Thus calling a function compiled with a higher preferred
15441 stack boundary from a function compiled with a lower preferred stack
15442 boundary most likely misaligns the stack.  It is recommended that
15443 libraries that use callbacks always use the default setting.
15445 This extra alignment does consume extra stack space, and generally
15446 increases code size.  Code that is sensitive to stack space usage, such
15447 as embedded systems and operating system kernels, may want to reduce the
15448 preferred alignment to @option{-mpreferred-stack-boundary=2}.
15450 @item -mmmx
15451 @itemx -mno-mmx
15452 @itemx -msse
15453 @itemx -mno-sse
15454 @itemx -msse2
15455 @itemx -mno-sse2
15456 @itemx -msse3
15457 @itemx -mno-sse3
15458 @itemx -mssse3
15459 @itemx -mno-ssse3
15460 @itemx -msse4.1
15461 @need 800
15462 @itemx -mno-sse4.1
15463 @itemx -msse4.2
15464 @itemx -mno-sse4.2
15465 @itemx -msse4
15466 @itemx -mno-sse4
15467 @itemx -mavx
15468 @itemx -mno-avx
15469 @itemx -mavx2
15470 @itemx -mno-avx2
15471 @itemx -mavx512f
15472 @itemx -mno-avx512f
15473 @need 800
15474 @itemx -mavx512pf
15475 @itemx -mno-avx512pf
15476 @itemx -mavx512er
15477 @itemx -mno-avx512er
15478 @itemx -mavx512cd
15479 @itemx -mno-avx512cd
15480 @itemx -msha
15481 @itemx -mno-sha
15482 @itemx -maes
15483 @itemx -mno-aes
15484 @itemx -mpclmul
15485 @itemx -mno-pclmul
15486 @itemx -mclfushopt
15487 @itemx -mno-clflsuhopt
15488 @need 800
15489 @itemx -mfsgsbase
15490 @itemx -mno-fsgsbase
15491 @itemx -mrdrnd
15492 @itemx -mno-rdrnd
15493 @itemx -mf16c
15494 @itemx -mno-f16c
15495 @itemx -mfma
15496 @itemx -mno-fma
15497 @itemx -mprefetchwt1
15498 @itemx -mno-prefetchwt1
15499 @itemx -msse4a
15500 @itemx -mno-sse4a
15501 @itemx -mfma4
15502 @itemx -mno-fma4
15503 @need 800
15504 @itemx -mxop
15505 @itemx -mno-xop
15506 @itemx -mlwp
15507 @itemx -mno-lwp
15508 @itemx -m3dnow
15509 @itemx -mno-3dnow
15510 @itemx -mpopcnt
15511 @itemx -mno-popcnt
15512 @itemx -mabm
15513 @itemx -mno-abm
15514 @itemx -mbmi
15515 @itemx -mbmi2
15516 @itemx -mno-bmi
15517 @itemx -mno-bmi2
15518 @itemx -mlzcnt
15519 @itemx -mno-lzcnt
15520 @itemx -mfxsr
15521 @itemx -mxsave
15522 @itemx -mxsaveopt
15523 @itemx -mrtm
15524 @itemx -mtbm
15525 @itemx -mno-tbm
15526 @itemx -mxsavec
15527 @itemx -mno-xsavec
15528 @itemx -mxsaves
15529 @itemx -mno-xsaves
15530 @opindex mmmx
15531 @opindex mno-mmx
15532 @opindex msse
15533 @opindex mno-sse
15534 @opindex m3dnow
15535 @opindex mno-3dnow
15536 These switches enable or disable the use of instructions in the MMX, SSE,
15537 SSE2, SSE3, SSSE3, SSE4.1, AVX, AVX2, AVX512F, AVX512PF, AVX512ER, AVX512CD,
15538 SHA, AES, PCLMUL, FSGSBASE, RDRND, F16C, FMA, SSE4A, FMA4, XOP, LWP, ABM,
15539 BMI, BMI2, FXSR, XSAVE, XSAVEOPT, LZCNT, RTM, or 3DNow!@:
15540 extended instruction sets.
15541 These extensions are also available as built-in functions: see
15542 @ref{X86 Built-in Functions}, for details of the functions enabled and
15543 disabled by these switches.
15545 To generate SSE/SSE2 instructions automatically from floating-point
15546 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
15548 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
15549 generates new AVX instructions or AVX equivalence for all SSEx instructions
15550 when needed.
15552 These options enable GCC to use these extended instructions in
15553 generated code, even without @option{-mfpmath=sse}.  Applications that
15554 perform run-time CPU detection must compile separate files for each
15555 supported architecture, using the appropriate flags.  In particular,
15556 the file containing the CPU detection code should be compiled without
15557 these options.
15559 @item -mdump-tune-features
15560 @opindex mdump-tune-features
15561 This option instructs GCC to dump the names of the x86 performance 
15562 tuning features and default settings. The names can be used in 
15563 @option{-mtune-ctrl=@var{feature-list}}.
15565 @item -mtune-ctrl=@var{feature-list}
15566 @opindex mtune-ctrl=@var{feature-list}
15567 This option is used to do fine grain control of x86 code generation features.
15568 @var{feature-list} is a comma separated list of @var{feature} names. See also
15569 @option{-mdump-tune-features}. When specified, the @var{feature} will be turned
15570 on if it is not preceded with @code{^}, otherwise, it will be turned off. 
15571 @option{-mtune-ctrl=@var{feature-list}} is intended to be used by GCC
15572 developers. Using it may lead to code paths not covered by testing and can
15573 potentially result in compiler ICEs or runtime errors.
15575 @item -mno-default
15576 @opindex mno-default
15577 This option instructs GCC to turn off all tunable features. See also 
15578 @option{-mtune-ctrl=@var{feature-list}} and @option{-mdump-tune-features}.
15580 @item -mcld
15581 @opindex mcld
15582 This option instructs GCC to emit a @code{cld} instruction in the prologue
15583 of functions that use string instructions.  String instructions depend on
15584 the DF flag to select between autoincrement or autodecrement mode.  While the
15585 ABI specifies the DF flag to be cleared on function entry, some operating
15586 systems violate this specification by not clearing the DF flag in their
15587 exception dispatchers.  The exception handler can be invoked with the DF flag
15588 set, which leads to wrong direction mode when string instructions are used.
15589 This option can be enabled by default on 32-bit x86 targets by configuring
15590 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
15591 instructions can be suppressed with the @option{-mno-cld} compiler option
15592 in this case.
15594 @item -mvzeroupper
15595 @opindex mvzeroupper
15596 This option instructs GCC to emit a @code{vzeroupper} instruction
15597 before a transfer of control flow out of the function to minimize
15598 the AVX to SSE transition penalty as well as remove unnecessary @code{zeroupper}
15599 intrinsics.
15601 @item -mprefer-avx128
15602 @opindex mprefer-avx128
15603 This option instructs GCC to use 128-bit AVX instructions instead of
15604 256-bit AVX instructions in the auto-vectorizer.
15606 @item -mcx16
15607 @opindex mcx16
15608 This option enables GCC to generate @code{CMPXCHG16B} instructions.
15609 @code{CMPXCHG16B} allows for atomic operations on 128-bit double quadword
15610 (or oword) data types.  
15611 This is useful for high-resolution counters that can be updated
15612 by multiple processors (or cores).  This instruction is generated as part of
15613 atomic built-in functions: see @ref{__sync Builtins} or
15614 @ref{__atomic Builtins} for details.
15616 @item -msahf
15617 @opindex msahf
15618 This option enables generation of @code{SAHF} instructions in 64-bit code.
15619 Early Intel Pentium 4 CPUs with Intel 64 support,
15620 prior to the introduction of Pentium 4 G1 step in December 2005,
15621 lacked the @code{LAHF} and @code{SAHF} instructions
15622 which were supported by AMD64.
15623 These are load and store instructions, respectively, for certain status flags.
15624 In 64-bit mode, the @code{SAHF} instruction is used to optimize @code{fmod},
15625 @code{drem}, and @code{remainder} built-in functions;
15626 see @ref{Other Builtins} for details.
15628 @item -mmovbe
15629 @opindex mmovbe
15630 This option enables use of the @code{movbe} instruction to implement
15631 @code{__builtin_bswap32} and @code{__builtin_bswap64}.
15633 @item -mcrc32
15634 @opindex mcrc32
15635 This option enables built-in functions @code{__builtin_ia32_crc32qi},
15636 @code{__builtin_ia32_crc32hi}, @code{__builtin_ia32_crc32si} and
15637 @code{__builtin_ia32_crc32di} to generate the @code{crc32} machine instruction.
15639 @item -mrecip
15640 @opindex mrecip
15641 This option enables use of @code{RCPSS} and @code{RSQRTSS} instructions
15642 (and their vectorized variants @code{RCPPS} and @code{RSQRTPS})
15643 with an additional Newton-Raphson step
15644 to increase precision instead of @code{DIVSS} and @code{SQRTSS}
15645 (and their vectorized
15646 variants) for single-precision floating-point arguments.  These instructions
15647 are generated only when @option{-funsafe-math-optimizations} is enabled
15648 together with @option{-finite-math-only} and @option{-fno-trapping-math}.
15649 Note that while the throughput of the sequence is higher than the throughput
15650 of the non-reciprocal instruction, the precision of the sequence can be
15651 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
15653 Note that GCC implements @code{1.0f/sqrtf(@var{x})} in terms of @code{RSQRTSS}
15654 (or @code{RSQRTPS}) already with @option{-ffast-math} (or the above option
15655 combination), and doesn't need @option{-mrecip}.
15657 Also note that GCC emits the above sequence with additional Newton-Raphson step
15658 for vectorized single-float division and vectorized @code{sqrtf(@var{x})}
15659 already with @option{-ffast-math} (or the above option combination), and
15660 doesn't need @option{-mrecip}.
15662 @item -mrecip=@var{opt}
15663 @opindex mrecip=opt
15664 This option controls which reciprocal estimate instructions
15665 may be used.  @var{opt} is a comma-separated list of options, which may
15666 be preceded by a @samp{!} to invert the option:
15668 @table @samp
15669 @item all
15670 Enable all estimate instructions.
15672 @item default
15673 Enable the default instructions, equivalent to @option{-mrecip}.
15675 @item none
15676 Disable all estimate instructions, equivalent to @option{-mno-recip}.
15678 @item div
15679 Enable the approximation for scalar division.
15681 @item vec-div
15682 Enable the approximation for vectorized division.
15684 @item sqrt
15685 Enable the approximation for scalar square root.
15687 @item vec-sqrt
15688 Enable the approximation for vectorized square root.
15689 @end table
15691 So, for example, @option{-mrecip=all,!sqrt} enables
15692 all of the reciprocal approximations, except for square root.
15694 @item -mveclibabi=@var{type}
15695 @opindex mveclibabi
15696 Specifies the ABI type to use for vectorizing intrinsics using an
15697 external library.  Supported values for @var{type} are @samp{svml} 
15698 for the Intel short
15699 vector math library and @samp{acml} for the AMD math core library.
15700 To use this option, both @option{-ftree-vectorize} and
15701 @option{-funsafe-math-optimizations} have to be enabled, and an SVML or ACML 
15702 ABI-compatible library must be specified at link time.
15704 GCC currently emits calls to @code{vmldExp2},
15705 @code{vmldLn2}, @code{vmldLog102}, @code{vmldLog102}, @code{vmldPow2},
15706 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
15707 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
15708 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
15709 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4}, @code{vmlsLog104},
15710 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
15711 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
15712 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
15713 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
15714 function type when @option{-mveclibabi=svml} is used, and @code{__vrd2_sin},
15715 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
15716 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
15717 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
15718 @code{__vrs4_log10f} and @code{__vrs4_powf} for the corresponding function type
15719 when @option{-mveclibabi=acml} is used.  
15721 @item -mabi=@var{name}
15722 @opindex mabi
15723 Generate code for the specified calling convention.  Permissible values
15724 are @samp{sysv} for the ABI used on GNU/Linux and other systems, and
15725 @samp{ms} for the Microsoft ABI.  The default is to use the Microsoft
15726 ABI when targeting Microsoft Windows and the SysV ABI on all other systems.
15727 You can control this behavior for a specific function by
15728 using the function attribute @samp{ms_abi}/@samp{sysv_abi}.
15729 @xref{Function Attributes}.
15731 @item -mtls-dialect=@var{type}
15732 @opindex mtls-dialect
15733 Generate code to access thread-local storage using the @samp{gnu} or
15734 @samp{gnu2} conventions.  @samp{gnu} is the conservative default;
15735 @samp{gnu2} is more efficient, but it may add compile- and run-time
15736 requirements that cannot be satisfied on all systems.
15738 @item -mpush-args
15739 @itemx -mno-push-args
15740 @opindex mpush-args
15741 @opindex mno-push-args
15742 Use PUSH operations to store outgoing parameters.  This method is shorter
15743 and usually equally fast as method using SUB/MOV operations and is enabled
15744 by default.  In some cases disabling it may improve performance because of
15745 improved scheduling and reduced dependencies.
15747 @item -maccumulate-outgoing-args
15748 @opindex maccumulate-outgoing-args
15749 If enabled, the maximum amount of space required for outgoing arguments is
15750 computed in the function prologue.  This is faster on most modern CPUs
15751 because of reduced dependencies, improved scheduling and reduced stack usage
15752 when the preferred stack boundary is not equal to 2.  The drawback is a notable
15753 increase in code size.  This switch implies @option{-mno-push-args}.
15755 @item -mthreads
15756 @opindex mthreads
15757 Support thread-safe exception handling on MinGW.  Programs that rely
15758 on thread-safe exception handling must compile and link all code with the
15759 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
15760 @code{-D_MT}; when linking, it links in a special thread helper library
15761 @option{-lmingwthrd} which cleans up per-thread exception-handling data.
15763 @item -mno-align-stringops
15764 @opindex mno-align-stringops
15765 Do not align the destination of inlined string operations.  This switch reduces
15766 code size and improves performance in case the destination is already aligned,
15767 but GCC doesn't know about it.
15769 @item -minline-all-stringops
15770 @opindex minline-all-stringops
15771 By default GCC inlines string operations only when the destination is 
15772 known to be aligned to least a 4-byte boundary.  
15773 This enables more inlining and increases code
15774 size, but may improve performance of code that depends on fast
15775 @code{memcpy}, @code{strlen},
15776 and @code{memset} for short lengths.
15778 @item -minline-stringops-dynamically
15779 @opindex minline-stringops-dynamically
15780 For string operations of unknown size, use run-time checks with
15781 inline code for small blocks and a library call for large blocks.
15783 @item -mstringop-strategy=@var{alg}
15784 @opindex mstringop-strategy=@var{alg}
15785 Override the internal decision heuristic for the particular algorithm to use
15786 for inlining string operations.  The allowed values for @var{alg} are:
15788 @table @samp
15789 @item rep_byte
15790 @itemx rep_4byte
15791 @itemx rep_8byte
15792 Expand using i386 @code{rep} prefix of the specified size.
15794 @item byte_loop
15795 @itemx loop
15796 @itemx unrolled_loop
15797 Expand into an inline loop.
15799 @item libcall
15800 Always use a library call.
15801 @end table
15803 @item -mmemcpy-strategy=@var{strategy}
15804 @opindex mmemcpy-strategy=@var{strategy}
15805 Override the internal decision heuristic to decide if @code{__builtin_memcpy}
15806 should be inlined and what inline algorithm to use when the expected size
15807 of the copy operation is known. @var{strategy} 
15808 is a comma-separated list of @var{alg}:@var{max_size}:@var{dest_align} triplets. 
15809 @var{alg} is specified in @option{-mstringop-strategy}, @var{max_size} specifies
15810 the max byte size with which inline algorithm @var{alg} is allowed.  For the last
15811 triplet, the @var{max_size} must be @code{-1}. The @var{max_size} of the triplets
15812 in the list must be specified in increasing order.  The minimal byte size for 
15813 @var{alg} is @code{0} for the first triplet and @code{@var{max_size} + 1} of the 
15814 preceding range.
15816 @item -mmemset-strategy=@var{strategy}
15817 @opindex mmemset-strategy=@var{strategy}
15818 The option is similar to @option{-mmemcpy-strategy=} except that it is to control
15819 @code{__builtin_memset} expansion.
15821 @item -momit-leaf-frame-pointer
15822 @opindex momit-leaf-frame-pointer
15823 Don't keep the frame pointer in a register for leaf functions.  This
15824 avoids the instructions to save, set up, and restore frame pointers and
15825 makes an extra register available in leaf functions.  The option
15826 @option{-fomit-leaf-frame-pointer} removes the frame pointer for leaf functions,
15827 which might make debugging harder.
15829 @item -mtls-direct-seg-refs
15830 @itemx -mno-tls-direct-seg-refs
15831 @opindex mtls-direct-seg-refs
15832 Controls whether TLS variables may be accessed with offsets from the
15833 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
15834 or whether the thread base pointer must be added.  Whether or not this
15835 is valid depends on the operating system, and whether it maps the
15836 segment to cover the entire TLS area.
15838 For systems that use the GNU C Library, the default is on.
15840 @item -msse2avx
15841 @itemx -mno-sse2avx
15842 @opindex msse2avx
15843 Specify that the assembler should encode SSE instructions with VEX
15844 prefix.  The option @option{-mavx} turns this on by default.
15846 @item -mfentry
15847 @itemx -mno-fentry
15848 @opindex mfentry
15849 If profiling is active (@option{-pg}), put the profiling
15850 counter call before the prologue.
15851 Note: On x86 architectures the attribute @code{ms_hook_prologue}
15852 isn't possible at the moment for @option{-mfentry} and @option{-pg}.
15854 @item -m8bit-idiv
15855 @itemx -mno-8bit-idiv
15856 @opindex 8bit-idiv
15857 On some processors, like Intel Atom, 8-bit unsigned integer divide is
15858 much faster than 32-bit/64-bit integer divide.  This option generates a
15859 run-time check.  If both dividend and divisor are within range of 0
15860 to 255, 8-bit unsigned integer divide is used instead of
15861 32-bit/64-bit integer divide.
15863 @item -mavx256-split-unaligned-load
15864 @itemx -mavx256-split-unaligned-store
15865 @opindex avx256-split-unaligned-load
15866 @opindex avx256-split-unaligned-store
15867 Split 32-byte AVX unaligned load and store.
15869 @item -mstack-protector-guard=@var{guard}
15870 @opindex mstack-protector-guard=@var{guard}
15871 Generate stack protection code using canary at @var{guard}.  Supported
15872 locations are @samp{global} for global canary or @samp{tls} for per-thread
15873 canary in the TLS block (the default).  This option has effect only when
15874 @option{-fstack-protector} or @option{-fstack-protector-all} is specified.
15876 @end table
15878 These @samp{-m} switches are supported in addition to the above
15879 on x86-64 processors in 64-bit environments.
15881 @table @gcctabopt
15882 @item -m32
15883 @itemx -m64
15884 @itemx -mx32
15885 @itemx -m16
15886 @opindex m32
15887 @opindex m64
15888 @opindex mx32
15889 @opindex m16
15890 Generate code for a 16-bit, 32-bit or 64-bit environment.
15891 The @option{-m32} option sets @code{int}, @code{long}, and pointer types
15892 to 32 bits, and
15893 generates code that runs on any i386 system.
15895 The @option{-m64} option sets @code{int} to 32 bits and @code{long} and pointer
15896 types to 64 bits, and generates code for the x86-64 architecture.
15897 For Darwin only the @option{-m64} option also turns off the @option{-fno-pic}
15898 and @option{-mdynamic-no-pic} options.
15900 The @option{-mx32} option sets @code{int}, @code{long}, and pointer types
15901 to 32 bits, and
15902 generates code for the x86-64 architecture.
15904 The @option{-m16} option is the same as @option{-m32}, except for that
15905 it outputs the @code{.code16gcc} assembly directive at the beginning of
15906 the assembly output so that the binary can run in 16-bit mode.
15908 @item -mno-red-zone
15909 @opindex mno-red-zone
15910 Do not use a so-called ``red zone'' for x86-64 code.  The red zone is mandated
15911 by the x86-64 ABI; it is a 128-byte area beyond the location of the
15912 stack pointer that is not modified by signal or interrupt handlers
15913 and therefore can be used for temporary data without adjusting the stack
15914 pointer.  The flag @option{-mno-red-zone} disables this red zone.
15916 @item -mcmodel=small
15917 @opindex mcmodel=small
15918 Generate code for the small code model: the program and its symbols must
15919 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
15920 Programs can be statically or dynamically linked.  This is the default
15921 code model.
15923 @item -mcmodel=kernel
15924 @opindex mcmodel=kernel
15925 Generate code for the kernel code model.  The kernel runs in the
15926 negative 2 GB of the address space.
15927 This model has to be used for Linux kernel code.
15929 @item -mcmodel=medium
15930 @opindex mcmodel=medium
15931 Generate code for the medium model: the program is linked in the lower 2
15932 GB of the address space.  Small symbols are also placed there.  Symbols
15933 with sizes larger than @option{-mlarge-data-threshold} are put into
15934 large data or BSS sections and can be located above 2GB.  Programs can
15935 be statically or dynamically linked.
15937 @item -mcmodel=large
15938 @opindex mcmodel=large
15939 Generate code for the large model.  This model makes no assumptions
15940 about addresses and sizes of sections.
15942 @item -maddress-mode=long
15943 @opindex maddress-mode=long
15944 Generate code for long address mode.  This is only supported for 64-bit
15945 and x32 environments.  It is the default address mode for 64-bit
15946 environments.
15948 @item -maddress-mode=short
15949 @opindex maddress-mode=short
15950 Generate code for short address mode.  This is only supported for 32-bit
15951 and x32 environments.  It is the default address mode for 32-bit and
15952 x32 environments.
15953 @end table
15955 @node i386 and x86-64 Windows Options
15956 @subsection i386 and x86-64 Windows Options
15957 @cindex i386 and x86-64 Windows Options
15959 These additional options are available for Microsoft Windows targets:
15961 @table @gcctabopt
15962 @item -mconsole
15963 @opindex mconsole
15964 This option
15965 specifies that a console application is to be generated, by
15966 instructing the linker to set the PE header subsystem type
15967 required for console applications.
15968 This option is available for Cygwin and MinGW targets and is
15969 enabled by default on those targets.
15971 @item -mdll
15972 @opindex mdll
15973 This option is available for Cygwin and MinGW targets.  It
15974 specifies that a DLL---a dynamic link library---is to be
15975 generated, enabling the selection of the required runtime
15976 startup object and entry point.
15978 @item -mnop-fun-dllimport
15979 @opindex mnop-fun-dllimport
15980 This option is available for Cygwin and MinGW targets.  It
15981 specifies that the @code{dllimport} attribute should be ignored.
15983 @item -mthread
15984 @opindex mthread
15985 This option is available for MinGW targets. It specifies
15986 that MinGW-specific thread support is to be used.
15988 @item -municode
15989 @opindex municode
15990 This option is available for MinGW-w64 targets.  It causes
15991 the @code{UNICODE} preprocessor macro to be predefined, and
15992 chooses Unicode-capable runtime startup code.
15994 @item -mwin32
15995 @opindex mwin32
15996 This option is available for Cygwin and MinGW targets.  It
15997 specifies that the typical Microsoft Windows predefined macros are to
15998 be set in the pre-processor, but does not influence the choice
15999 of runtime library/startup code.
16001 @item -mwindows
16002 @opindex mwindows
16003 This option is available for Cygwin and MinGW targets.  It
16004 specifies that a GUI application is to be generated by
16005 instructing the linker to set the PE header subsystem type
16006 appropriately.
16008 @item -fno-set-stack-executable
16009 @opindex fno-set-stack-executable
16010 This option is available for MinGW targets. It specifies that
16011 the executable flag for the stack used by nested functions isn't
16012 set. This is necessary for binaries running in kernel mode of
16013 Microsoft Windows, as there the User32 API, which is used to set executable
16014 privileges, isn't available.
16016 @item -fwritable-relocated-rdata
16017 @opindex fno-writable-relocated-rdata
16018 This option is available for MinGW and Cygwin targets.  It specifies
16019 that relocated-data in read-only section is put into .data
16020 section.  This is a necessary for older runtimes not supporting
16021 modification of .rdata sections for pseudo-relocation.
16023 @item -mpe-aligned-commons
16024 @opindex mpe-aligned-commons
16025 This option is available for Cygwin and MinGW targets.  It
16026 specifies that the GNU extension to the PE file format that
16027 permits the correct alignment of COMMON variables should be
16028 used when generating code.  It is enabled by default if
16029 GCC detects that the target assembler found during configuration
16030 supports the feature.
16031 @end table
16033 See also under @ref{i386 and x86-64 Options} for standard options.
16035 @node IA-64 Options
16036 @subsection IA-64 Options
16037 @cindex IA-64 Options
16039 These are the @samp{-m} options defined for the Intel IA-64 architecture.
16041 @table @gcctabopt
16042 @item -mbig-endian
16043 @opindex mbig-endian
16044 Generate code for a big-endian target.  This is the default for HP-UX@.
16046 @item -mlittle-endian
16047 @opindex mlittle-endian
16048 Generate code for a little-endian target.  This is the default for AIX5
16049 and GNU/Linux.
16051 @item -mgnu-as
16052 @itemx -mno-gnu-as
16053 @opindex mgnu-as
16054 @opindex mno-gnu-as
16055 Generate (or don't) code for the GNU assembler.  This is the default.
16056 @c Also, this is the default if the configure option @option{--with-gnu-as}
16057 @c is used.
16059 @item -mgnu-ld
16060 @itemx -mno-gnu-ld
16061 @opindex mgnu-ld
16062 @opindex mno-gnu-ld
16063 Generate (or don't) code for the GNU linker.  This is the default.
16064 @c Also, this is the default if the configure option @option{--with-gnu-ld}
16065 @c is used.
16067 @item -mno-pic
16068 @opindex mno-pic
16069 Generate code that does not use a global pointer register.  The result
16070 is not position independent code, and violates the IA-64 ABI@.
16072 @item -mvolatile-asm-stop
16073 @itemx -mno-volatile-asm-stop
16074 @opindex mvolatile-asm-stop
16075 @opindex mno-volatile-asm-stop
16076 Generate (or don't) a stop bit immediately before and after volatile asm
16077 statements.
16079 @item -mregister-names
16080 @itemx -mno-register-names
16081 @opindex mregister-names
16082 @opindex mno-register-names
16083 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
16084 the stacked registers.  This may make assembler output more readable.
16086 @item -mno-sdata
16087 @itemx -msdata
16088 @opindex mno-sdata
16089 @opindex msdata
16090 Disable (or enable) optimizations that use the small data section.  This may
16091 be useful for working around optimizer bugs.
16093 @item -mconstant-gp
16094 @opindex mconstant-gp
16095 Generate code that uses a single constant global pointer value.  This is
16096 useful when compiling kernel code.
16098 @item -mauto-pic
16099 @opindex mauto-pic
16100 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
16101 This is useful when compiling firmware code.
16103 @item -minline-float-divide-min-latency
16104 @opindex minline-float-divide-min-latency
16105 Generate code for inline divides of floating-point values
16106 using the minimum latency algorithm.
16108 @item -minline-float-divide-max-throughput
16109 @opindex minline-float-divide-max-throughput
16110 Generate code for inline divides of floating-point values
16111 using the maximum throughput algorithm.
16113 @item -mno-inline-float-divide
16114 @opindex mno-inline-float-divide
16115 Do not generate inline code for divides of floating-point values.
16117 @item -minline-int-divide-min-latency
16118 @opindex minline-int-divide-min-latency
16119 Generate code for inline divides of integer values
16120 using the minimum latency algorithm.
16122 @item -minline-int-divide-max-throughput
16123 @opindex minline-int-divide-max-throughput
16124 Generate code for inline divides of integer values
16125 using the maximum throughput algorithm.
16127 @item -mno-inline-int-divide
16128 @opindex mno-inline-int-divide
16129 Do not generate inline code for divides of integer values.
16131 @item -minline-sqrt-min-latency
16132 @opindex minline-sqrt-min-latency
16133 Generate code for inline square roots
16134 using the minimum latency algorithm.
16136 @item -minline-sqrt-max-throughput
16137 @opindex minline-sqrt-max-throughput
16138 Generate code for inline square roots
16139 using the maximum throughput algorithm.
16141 @item -mno-inline-sqrt
16142 @opindex mno-inline-sqrt
16143 Do not generate inline code for @code{sqrt}.
16145 @item -mfused-madd
16146 @itemx -mno-fused-madd
16147 @opindex mfused-madd
16148 @opindex mno-fused-madd
16149 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
16150 instructions.  The default is to use these instructions.
16152 @item -mno-dwarf2-asm
16153 @itemx -mdwarf2-asm
16154 @opindex mno-dwarf2-asm
16155 @opindex mdwarf2-asm
16156 Don't (or do) generate assembler code for the DWARF 2 line number debugging
16157 info.  This may be useful when not using the GNU assembler.
16159 @item -mearly-stop-bits
16160 @itemx -mno-early-stop-bits
16161 @opindex mearly-stop-bits
16162 @opindex mno-early-stop-bits
16163 Allow stop bits to be placed earlier than immediately preceding the
16164 instruction that triggered the stop bit.  This can improve instruction
16165 scheduling, but does not always do so.
16167 @item -mfixed-range=@var{register-range}
16168 @opindex mfixed-range
16169 Generate code treating the given register range as fixed registers.
16170 A fixed register is one that the register allocator cannot use.  This is
16171 useful when compiling kernel code.  A register range is specified as
16172 two registers separated by a dash.  Multiple register ranges can be
16173 specified separated by a comma.
16175 @item -mtls-size=@var{tls-size}
16176 @opindex mtls-size
16177 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
16180 @item -mtune=@var{cpu-type}
16181 @opindex mtune
16182 Tune the instruction scheduling for a particular CPU, Valid values are
16183 @samp{itanium}, @samp{itanium1}, @samp{merced}, @samp{itanium2},
16184 and @samp{mckinley}.
16186 @item -milp32
16187 @itemx -mlp64
16188 @opindex milp32
16189 @opindex mlp64
16190 Generate code for a 32-bit or 64-bit environment.
16191 The 32-bit environment sets int, long and pointer to 32 bits.
16192 The 64-bit environment sets int to 32 bits and long and pointer
16193 to 64 bits.  These are HP-UX specific flags.
16195 @item -mno-sched-br-data-spec
16196 @itemx -msched-br-data-spec
16197 @opindex mno-sched-br-data-spec
16198 @opindex msched-br-data-spec
16199 (Dis/En)able data speculative scheduling before reload.
16200 This results in generation of @code{ld.a} instructions and
16201 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
16202 The default is 'disable'.
16204 @item -msched-ar-data-spec
16205 @itemx -mno-sched-ar-data-spec
16206 @opindex msched-ar-data-spec
16207 @opindex mno-sched-ar-data-spec
16208 (En/Dis)able data speculative scheduling after reload.
16209 This results in generation of @code{ld.a} instructions and
16210 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
16211 The default is 'enable'.
16213 @item -mno-sched-control-spec
16214 @itemx -msched-control-spec
16215 @opindex mno-sched-control-spec
16216 @opindex msched-control-spec
16217 (Dis/En)able control speculative scheduling.  This feature is
16218 available only during region scheduling (i.e.@: before reload).
16219 This results in generation of the @code{ld.s} instructions and
16220 the corresponding check instructions @code{chk.s}.
16221 The default is 'disable'.
16223 @item -msched-br-in-data-spec
16224 @itemx -mno-sched-br-in-data-spec
16225 @opindex msched-br-in-data-spec
16226 @opindex mno-sched-br-in-data-spec
16227 (En/Dis)able speculative scheduling of the instructions that
16228 are dependent on the data speculative loads before reload.
16229 This is effective only with @option{-msched-br-data-spec} enabled.
16230 The default is 'enable'.
16232 @item -msched-ar-in-data-spec
16233 @itemx -mno-sched-ar-in-data-spec
16234 @opindex msched-ar-in-data-spec
16235 @opindex mno-sched-ar-in-data-spec
16236 (En/Dis)able speculative scheduling of the instructions that
16237 are dependent on the data speculative loads after reload.
16238 This is effective only with @option{-msched-ar-data-spec} enabled.
16239 The default is 'enable'.
16241 @item -msched-in-control-spec
16242 @itemx -mno-sched-in-control-spec
16243 @opindex msched-in-control-spec
16244 @opindex mno-sched-in-control-spec
16245 (En/Dis)able speculative scheduling of the instructions that
16246 are dependent on the control speculative loads.
16247 This is effective only with @option{-msched-control-spec} enabled.
16248 The default is 'enable'.
16250 @item -mno-sched-prefer-non-data-spec-insns
16251 @itemx -msched-prefer-non-data-spec-insns
16252 @opindex mno-sched-prefer-non-data-spec-insns
16253 @opindex msched-prefer-non-data-spec-insns
16254 If enabled, data-speculative instructions are chosen for schedule
16255 only if there are no other choices at the moment.  This makes
16256 the use of the data speculation much more conservative.
16257 The default is 'disable'.
16259 @item -mno-sched-prefer-non-control-spec-insns
16260 @itemx -msched-prefer-non-control-spec-insns
16261 @opindex mno-sched-prefer-non-control-spec-insns
16262 @opindex msched-prefer-non-control-spec-insns
16263 If enabled, control-speculative instructions are chosen for schedule
16264 only if there are no other choices at the moment.  This makes
16265 the use of the control speculation much more conservative.
16266 The default is 'disable'.
16268 @item -mno-sched-count-spec-in-critical-path
16269 @itemx -msched-count-spec-in-critical-path
16270 @opindex mno-sched-count-spec-in-critical-path
16271 @opindex msched-count-spec-in-critical-path
16272 If enabled, speculative dependencies are considered during
16273 computation of the instructions priorities.  This makes the use of the
16274 speculation a bit more conservative.
16275 The default is 'disable'.
16277 @item -msched-spec-ldc
16278 @opindex msched-spec-ldc
16279 Use a simple data speculation check.  This option is on by default.
16281 @item -msched-control-spec-ldc
16282 @opindex msched-spec-ldc
16283 Use a simple check for control speculation.  This option is on by default.
16285 @item -msched-stop-bits-after-every-cycle
16286 @opindex msched-stop-bits-after-every-cycle
16287 Place a stop bit after every cycle when scheduling.  This option is on
16288 by default.
16290 @item -msched-fp-mem-deps-zero-cost
16291 @opindex msched-fp-mem-deps-zero-cost
16292 Assume that floating-point stores and loads are not likely to cause a conflict
16293 when placed into the same instruction group.  This option is disabled by
16294 default.
16296 @item -msel-sched-dont-check-control-spec
16297 @opindex msel-sched-dont-check-control-spec
16298 Generate checks for control speculation in selective scheduling.
16299 This flag is disabled by default.
16301 @item -msched-max-memory-insns=@var{max-insns}
16302 @opindex msched-max-memory-insns
16303 Limit on the number of memory insns per instruction group, giving lower
16304 priority to subsequent memory insns attempting to schedule in the same
16305 instruction group. Frequently useful to prevent cache bank conflicts.
16306 The default value is 1.
16308 @item -msched-max-memory-insns-hard-limit
16309 @opindex msched-max-memory-insns-hard-limit
16310 Makes the limit specified by @option{msched-max-memory-insns} a hard limit,
16311 disallowing more than that number in an instruction group.
16312 Otherwise, the limit is ``soft'', meaning that non-memory operations
16313 are preferred when the limit is reached, but memory operations may still
16314 be scheduled.
16316 @end table
16318 @node LM32 Options
16319 @subsection LM32 Options
16320 @cindex LM32 options
16322 These @option{-m} options are defined for the LatticeMico32 architecture:
16324 @table @gcctabopt
16325 @item -mbarrel-shift-enabled
16326 @opindex mbarrel-shift-enabled
16327 Enable barrel-shift instructions.
16329 @item -mdivide-enabled
16330 @opindex mdivide-enabled
16331 Enable divide and modulus instructions.
16333 @item -mmultiply-enabled
16334 @opindex multiply-enabled
16335 Enable multiply instructions.
16337 @item -msign-extend-enabled
16338 @opindex msign-extend-enabled
16339 Enable sign extend instructions.
16341 @item -muser-enabled
16342 @opindex muser-enabled
16343 Enable user-defined instructions.
16345 @end table
16347 @node M32C Options
16348 @subsection M32C Options
16349 @cindex M32C options
16351 @table @gcctabopt
16352 @item -mcpu=@var{name}
16353 @opindex mcpu=
16354 Select the CPU for which code is generated.  @var{name} may be one of
16355 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
16356 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
16357 the M32C/80 series.
16359 @item -msim
16360 @opindex msim
16361 Specifies that the program will be run on the simulator.  This causes
16362 an alternate runtime library to be linked in which supports, for
16363 example, file I/O@.  You must not use this option when generating
16364 programs that will run on real hardware; you must provide your own
16365 runtime library for whatever I/O functions are needed.
16367 @item -memregs=@var{number}
16368 @opindex memregs=
16369 Specifies the number of memory-based pseudo-registers GCC uses
16370 during code generation.  These pseudo-registers are used like real
16371 registers, so there is a tradeoff between GCC's ability to fit the
16372 code into available registers, and the performance penalty of using
16373 memory instead of registers.  Note that all modules in a program must
16374 be compiled with the same value for this option.  Because of that, you
16375 must not use this option with GCC's default runtime libraries.
16377 @end table
16379 @node M32R/D Options
16380 @subsection M32R/D Options
16381 @cindex M32R/D options
16383 These @option{-m} options are defined for Renesas M32R/D architectures:
16385 @table @gcctabopt
16386 @item -m32r2
16387 @opindex m32r2
16388 Generate code for the M32R/2@.
16390 @item -m32rx
16391 @opindex m32rx
16392 Generate code for the M32R/X@.
16394 @item -m32r
16395 @opindex m32r
16396 Generate code for the M32R@.  This is the default.
16398 @item -mmodel=small
16399 @opindex mmodel=small
16400 Assume all objects live in the lower 16MB of memory (so that their addresses
16401 can be loaded with the @code{ld24} instruction), and assume all subroutines
16402 are reachable with the @code{bl} instruction.
16403 This is the default.
16405 The addressability of a particular object can be set with the
16406 @code{model} attribute.
16408 @item -mmodel=medium
16409 @opindex mmodel=medium
16410 Assume objects may be anywhere in the 32-bit address space (the compiler
16411 generates @code{seth/add3} instructions to load their addresses), and
16412 assume all subroutines are reachable with the @code{bl} instruction.
16414 @item -mmodel=large
16415 @opindex mmodel=large
16416 Assume objects may be anywhere in the 32-bit address space (the compiler
16417 generates @code{seth/add3} instructions to load their addresses), and
16418 assume subroutines may not be reachable with the @code{bl} instruction
16419 (the compiler generates the much slower @code{seth/add3/jl}
16420 instruction sequence).
16422 @item -msdata=none
16423 @opindex msdata=none
16424 Disable use of the small data area.  Variables are put into
16425 one of @samp{.data}, @samp{.bss}, or @samp{.rodata} (unless the
16426 @code{section} attribute has been specified).
16427 This is the default.
16429 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
16430 Objects may be explicitly put in the small data area with the
16431 @code{section} attribute using one of these sections.
16433 @item -msdata=sdata
16434 @opindex msdata=sdata
16435 Put small global and static data in the small data area, but do not
16436 generate special code to reference them.
16438 @item -msdata=use
16439 @opindex msdata=use
16440 Put small global and static data in the small data area, and generate
16441 special instructions to reference them.
16443 @item -G @var{num}
16444 @opindex G
16445 @cindex smaller data references
16446 Put global and static objects less than or equal to @var{num} bytes
16447 into the small data or BSS sections instead of the normal data or BSS
16448 sections.  The default value of @var{num} is 8.
16449 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
16450 for this option to have any effect.
16452 All modules should be compiled with the same @option{-G @var{num}} value.
16453 Compiling with different values of @var{num} may or may not work; if it
16454 doesn't the linker gives an error message---incorrect code is not
16455 generated.
16457 @item -mdebug
16458 @opindex mdebug
16459 Makes the M32R-specific code in the compiler display some statistics
16460 that might help in debugging programs.
16462 @item -malign-loops
16463 @opindex malign-loops
16464 Align all loops to a 32-byte boundary.
16466 @item -mno-align-loops
16467 @opindex mno-align-loops
16468 Do not enforce a 32-byte alignment for loops.  This is the default.
16470 @item -missue-rate=@var{number}
16471 @opindex missue-rate=@var{number}
16472 Issue @var{number} instructions per cycle.  @var{number} can only be 1
16473 or 2.
16475 @item -mbranch-cost=@var{number}
16476 @opindex mbranch-cost=@var{number}
16477 @var{number} can only be 1 or 2.  If it is 1 then branches are
16478 preferred over conditional code, if it is 2, then the opposite applies.
16480 @item -mflush-trap=@var{number}
16481 @opindex mflush-trap=@var{number}
16482 Specifies the trap number to use to flush the cache.  The default is
16483 12.  Valid numbers are between 0 and 15 inclusive.
16485 @item -mno-flush-trap
16486 @opindex mno-flush-trap
16487 Specifies that the cache cannot be flushed by using a trap.
16489 @item -mflush-func=@var{name}
16490 @opindex mflush-func=@var{name}
16491 Specifies the name of the operating system function to call to flush
16492 the cache.  The default is @emph{_flush_cache}, but a function call
16493 is only used if a trap is not available.
16495 @item -mno-flush-func
16496 @opindex mno-flush-func
16497 Indicates that there is no OS function for flushing the cache.
16499 @end table
16501 @node M680x0 Options
16502 @subsection M680x0 Options
16503 @cindex M680x0 options
16505 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
16506 The default settings depend on which architecture was selected when
16507 the compiler was configured; the defaults for the most common choices
16508 are given below.
16510 @table @gcctabopt
16511 @item -march=@var{arch}
16512 @opindex march
16513 Generate code for a specific M680x0 or ColdFire instruction set
16514 architecture.  Permissible values of @var{arch} for M680x0
16515 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
16516 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
16517 architectures are selected according to Freescale's ISA classification
16518 and the permissible values are: @samp{isaa}, @samp{isaaplus},
16519 @samp{isab} and @samp{isac}.
16521 GCC defines a macro @samp{__mcf@var{arch}__} whenever it is generating
16522 code for a ColdFire target.  The @var{arch} in this macro is one of the
16523 @option{-march} arguments given above.
16525 When used together, @option{-march} and @option{-mtune} select code
16526 that runs on a family of similar processors but that is optimized
16527 for a particular microarchitecture.
16529 @item -mcpu=@var{cpu}
16530 @opindex mcpu
16531 Generate code for a specific M680x0 or ColdFire processor.
16532 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
16533 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
16534 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
16535 below, which also classifies the CPUs into families:
16537 @multitable @columnfractions 0.20 0.80
16538 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
16539 @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}
16540 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
16541 @item @samp{5206e} @tab @samp{5206e}
16542 @item @samp{5208} @tab @samp{5207} @samp{5208}
16543 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
16544 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
16545 @item @samp{5216} @tab @samp{5214} @samp{5216}
16546 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
16547 @item @samp{5225} @tab @samp{5224} @samp{5225}
16548 @item @samp{52259} @tab @samp{52252} @samp{52254} @samp{52255} @samp{52256} @samp{52258} @samp{52259}
16549 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
16550 @item @samp{5249} @tab @samp{5249}
16551 @item @samp{5250} @tab @samp{5250}
16552 @item @samp{5271} @tab @samp{5270} @samp{5271}
16553 @item @samp{5272} @tab @samp{5272}
16554 @item @samp{5275} @tab @samp{5274} @samp{5275}
16555 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
16556 @item @samp{53017} @tab @samp{53011} @samp{53012} @samp{53013} @samp{53014} @samp{53015} @samp{53016} @samp{53017}
16557 @item @samp{5307} @tab @samp{5307}
16558 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
16559 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
16560 @item @samp{5407} @tab @samp{5407}
16561 @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}
16562 @end multitable
16564 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
16565 @var{arch} is compatible with @var{cpu}.  Other combinations of
16566 @option{-mcpu} and @option{-march} are rejected.
16568 GCC defines the macro @samp{__mcf_cpu_@var{cpu}} when ColdFire target
16569 @var{cpu} is selected.  It also defines @samp{__mcf_family_@var{family}},
16570 where the value of @var{family} is given by the table above.
16572 @item -mtune=@var{tune}
16573 @opindex mtune
16574 Tune the code for a particular microarchitecture within the
16575 constraints set by @option{-march} and @option{-mcpu}.
16576 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
16577 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
16578 and @samp{cpu32}.  The ColdFire microarchitectures
16579 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
16581 You can also use @option{-mtune=68020-40} for code that needs
16582 to run relatively well on 68020, 68030 and 68040 targets.
16583 @option{-mtune=68020-60} is similar but includes 68060 targets
16584 as well.  These two options select the same tuning decisions as
16585 @option{-m68020-40} and @option{-m68020-60} respectively.
16587 GCC defines the macros @samp{__mc@var{arch}} and @samp{__mc@var{arch}__}
16588 when tuning for 680x0 architecture @var{arch}.  It also defines
16589 @samp{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
16590 option is used.  If GCC is tuning for a range of architectures,
16591 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
16592 it defines the macros for every architecture in the range.
16594 GCC also defines the macro @samp{__m@var{uarch}__} when tuning for
16595 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
16596 of the arguments given above.
16598 @item -m68000
16599 @itemx -mc68000
16600 @opindex m68000
16601 @opindex mc68000
16602 Generate output for a 68000.  This is the default
16603 when the compiler is configured for 68000-based systems.
16604 It is equivalent to @option{-march=68000}.
16606 Use this option for microcontrollers with a 68000 or EC000 core,
16607 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
16609 @item -m68010
16610 @opindex m68010
16611 Generate output for a 68010.  This is the default
16612 when the compiler is configured for 68010-based systems.
16613 It is equivalent to @option{-march=68010}.
16615 @item -m68020
16616 @itemx -mc68020
16617 @opindex m68020
16618 @opindex mc68020
16619 Generate output for a 68020.  This is the default
16620 when the compiler is configured for 68020-based systems.
16621 It is equivalent to @option{-march=68020}.
16623 @item -m68030
16624 @opindex m68030
16625 Generate output for a 68030.  This is the default when the compiler is
16626 configured for 68030-based systems.  It is equivalent to
16627 @option{-march=68030}.
16629 @item -m68040
16630 @opindex m68040
16631 Generate output for a 68040.  This is the default when the compiler is
16632 configured for 68040-based systems.  It is equivalent to
16633 @option{-march=68040}.
16635 This option inhibits the use of 68881/68882 instructions that have to be
16636 emulated by software on the 68040.  Use this option if your 68040 does not
16637 have code to emulate those instructions.
16639 @item -m68060
16640 @opindex m68060
16641 Generate output for a 68060.  This is the default when the compiler is
16642 configured for 68060-based systems.  It is equivalent to
16643 @option{-march=68060}.
16645 This option inhibits the use of 68020 and 68881/68882 instructions that
16646 have to be emulated by software on the 68060.  Use this option if your 68060
16647 does not have code to emulate those instructions.
16649 @item -mcpu32
16650 @opindex mcpu32
16651 Generate output for a CPU32.  This is the default
16652 when the compiler is configured for CPU32-based systems.
16653 It is equivalent to @option{-march=cpu32}.
16655 Use this option for microcontrollers with a
16656 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
16657 68336, 68340, 68341, 68349 and 68360.
16659 @item -m5200
16660 @opindex m5200
16661 Generate output for a 520X ColdFire CPU@.  This is the default
16662 when the compiler is configured for 520X-based systems.
16663 It is equivalent to @option{-mcpu=5206}, and is now deprecated
16664 in favor of that option.
16666 Use this option for microcontroller with a 5200 core, including
16667 the MCF5202, MCF5203, MCF5204 and MCF5206.
16669 @item -m5206e
16670 @opindex m5206e
16671 Generate output for a 5206e ColdFire CPU@.  The option is now
16672 deprecated in favor of the equivalent @option{-mcpu=5206e}.
16674 @item -m528x
16675 @opindex m528x
16676 Generate output for a member of the ColdFire 528X family.
16677 The option is now deprecated in favor of the equivalent
16678 @option{-mcpu=528x}.
16680 @item -m5307
16681 @opindex m5307
16682 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
16683 in favor of the equivalent @option{-mcpu=5307}.
16685 @item -m5407
16686 @opindex m5407
16687 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
16688 in favor of the equivalent @option{-mcpu=5407}.
16690 @item -mcfv4e
16691 @opindex mcfv4e
16692 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
16693 This includes use of hardware floating-point instructions.
16694 The option is equivalent to @option{-mcpu=547x}, and is now
16695 deprecated in favor of that option.
16697 @item -m68020-40
16698 @opindex m68020-40
16699 Generate output for a 68040, without using any of the new instructions.
16700 This results in code that can run relatively efficiently on either a
16701 68020/68881 or a 68030 or a 68040.  The generated code does use the
16702 68881 instructions that are emulated on the 68040.
16704 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
16706 @item -m68020-60
16707 @opindex m68020-60
16708 Generate output for a 68060, without using any of the new instructions.
16709 This results in code that can run relatively efficiently on either a
16710 68020/68881 or a 68030 or a 68040.  The generated code does use the
16711 68881 instructions that are emulated on the 68060.
16713 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
16715 @item -mhard-float
16716 @itemx -m68881
16717 @opindex mhard-float
16718 @opindex m68881
16719 Generate floating-point instructions.  This is the default for 68020
16720 and above, and for ColdFire devices that have an FPU@.  It defines the
16721 macro @samp{__HAVE_68881__} on M680x0 targets and @samp{__mcffpu__}
16722 on ColdFire targets.
16724 @item -msoft-float
16725 @opindex msoft-float
16726 Do not generate floating-point instructions; use library calls instead.
16727 This is the default for 68000, 68010, and 68832 targets.  It is also
16728 the default for ColdFire devices that have no FPU.
16730 @item -mdiv
16731 @itemx -mno-div
16732 @opindex mdiv
16733 @opindex mno-div
16734 Generate (do not generate) ColdFire hardware divide and remainder
16735 instructions.  If @option{-march} is used without @option{-mcpu},
16736 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
16737 architectures.  Otherwise, the default is taken from the target CPU
16738 (either the default CPU, or the one specified by @option{-mcpu}).  For
16739 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
16740 @option{-mcpu=5206e}.
16742 GCC defines the macro @samp{__mcfhwdiv__} when this option is enabled.
16744 @item -mshort
16745 @opindex mshort
16746 Consider type @code{int} to be 16 bits wide, like @code{short int}.
16747 Additionally, parameters passed on the stack are also aligned to a
16748 16-bit boundary even on targets whose API mandates promotion to 32-bit.
16750 @item -mno-short
16751 @opindex mno-short
16752 Do not consider type @code{int} to be 16 bits wide.  This is the default.
16754 @item -mnobitfield
16755 @itemx -mno-bitfield
16756 @opindex mnobitfield
16757 @opindex mno-bitfield
16758 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
16759 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
16761 @item -mbitfield
16762 @opindex mbitfield
16763 Do use the bit-field instructions.  The @option{-m68020} option implies
16764 @option{-mbitfield}.  This is the default if you use a configuration
16765 designed for a 68020.
16767 @item -mrtd
16768 @opindex mrtd
16769 Use a different function-calling convention, in which functions
16770 that take a fixed number of arguments return with the @code{rtd}
16771 instruction, which pops their arguments while returning.  This
16772 saves one instruction in the caller since there is no need to pop
16773 the arguments there.
16775 This calling convention is incompatible with the one normally
16776 used on Unix, so you cannot use it if you need to call libraries
16777 compiled with the Unix compiler.
16779 Also, you must provide function prototypes for all functions that
16780 take variable numbers of arguments (including @code{printf});
16781 otherwise incorrect code is generated for calls to those
16782 functions.
16784 In addition, seriously incorrect code results if you call a
16785 function with too many arguments.  (Normally, extra arguments are
16786 harmlessly ignored.)
16788 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
16789 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
16791 @item -mno-rtd
16792 @opindex mno-rtd
16793 Do not use the calling conventions selected by @option{-mrtd}.
16794 This is the default.
16796 @item -malign-int
16797 @itemx -mno-align-int
16798 @opindex malign-int
16799 @opindex mno-align-int
16800 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
16801 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
16802 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
16803 Aligning variables on 32-bit boundaries produces code that runs somewhat
16804 faster on processors with 32-bit busses at the expense of more memory.
16806 @strong{Warning:} if you use the @option{-malign-int} switch, GCC
16807 aligns structures containing the above types differently than
16808 most published application binary interface specifications for the m68k.
16810 @item -mpcrel
16811 @opindex mpcrel
16812 Use the pc-relative addressing mode of the 68000 directly, instead of
16813 using a global offset table.  At present, this option implies @option{-fpic},
16814 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
16815 not presently supported with @option{-mpcrel}, though this could be supported for
16816 68020 and higher processors.
16818 @item -mno-strict-align
16819 @itemx -mstrict-align
16820 @opindex mno-strict-align
16821 @opindex mstrict-align
16822 Do not (do) assume that unaligned memory references are handled by
16823 the system.
16825 @item -msep-data
16826 Generate code that allows the data segment to be located in a different
16827 area of memory from the text segment.  This allows for execute-in-place in
16828 an environment without virtual memory management.  This option implies
16829 @option{-fPIC}.
16831 @item -mno-sep-data
16832 Generate code that assumes that the data segment follows the text segment.
16833 This is the default.
16835 @item -mid-shared-library
16836 Generate code that supports shared libraries via the library ID method.
16837 This allows for execute-in-place and shared libraries in an environment
16838 without virtual memory management.  This option implies @option{-fPIC}.
16840 @item -mno-id-shared-library
16841 Generate code that doesn't assume ID-based shared libraries are being used.
16842 This is the default.
16844 @item -mshared-library-id=n
16845 Specifies the identification number of the ID-based shared library being
16846 compiled.  Specifying a value of 0 generates more compact code; specifying
16847 other values forces the allocation of that number to the current
16848 library, but is no more space- or time-efficient than omitting this option.
16850 @item -mxgot
16851 @itemx -mno-xgot
16852 @opindex mxgot
16853 @opindex mno-xgot
16854 When generating position-independent code for ColdFire, generate code
16855 that works if the GOT has more than 8192 entries.  This code is
16856 larger and slower than code generated without this option.  On M680x0
16857 processors, this option is not needed; @option{-fPIC} suffices.
16859 GCC normally uses a single instruction to load values from the GOT@.
16860 While this is relatively efficient, it only works if the GOT
16861 is smaller than about 64k.  Anything larger causes the linker
16862 to report an error such as:
16864 @cindex relocation truncated to fit (ColdFire)
16865 @smallexample
16866 relocation truncated to fit: R_68K_GOT16O foobar
16867 @end smallexample
16869 If this happens, you should recompile your code with @option{-mxgot}.
16870 It should then work with very large GOTs.  However, code generated with
16871 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
16872 the value of a global symbol.
16874 Note that some linkers, including newer versions of the GNU linker,
16875 can create multiple GOTs and sort GOT entries.  If you have such a linker,
16876 you should only need to use @option{-mxgot} when compiling a single
16877 object file that accesses more than 8192 GOT entries.  Very few do.
16879 These options have no effect unless GCC is generating
16880 position-independent code.
16882 @end table
16884 @node MCore Options
16885 @subsection MCore Options
16886 @cindex MCore options
16888 These are the @samp{-m} options defined for the Motorola M*Core
16889 processors.
16891 @table @gcctabopt
16893 @item -mhardlit
16894 @itemx -mno-hardlit
16895 @opindex mhardlit
16896 @opindex mno-hardlit
16897 Inline constants into the code stream if it can be done in two
16898 instructions or less.
16900 @item -mdiv
16901 @itemx -mno-div
16902 @opindex mdiv
16903 @opindex mno-div
16904 Use the divide instruction.  (Enabled by default).
16906 @item -mrelax-immediate
16907 @itemx -mno-relax-immediate
16908 @opindex mrelax-immediate
16909 @opindex mno-relax-immediate
16910 Allow arbitrary-sized immediates in bit operations.
16912 @item -mwide-bitfields
16913 @itemx -mno-wide-bitfields
16914 @opindex mwide-bitfields
16915 @opindex mno-wide-bitfields
16916 Always treat bit-fields as @code{int}-sized.
16918 @item -m4byte-functions
16919 @itemx -mno-4byte-functions
16920 @opindex m4byte-functions
16921 @opindex mno-4byte-functions
16922 Force all functions to be aligned to a 4-byte boundary.
16924 @item -mcallgraph-data
16925 @itemx -mno-callgraph-data
16926 @opindex mcallgraph-data
16927 @opindex mno-callgraph-data
16928 Emit callgraph information.
16930 @item -mslow-bytes
16931 @itemx -mno-slow-bytes
16932 @opindex mslow-bytes
16933 @opindex mno-slow-bytes
16934 Prefer word access when reading byte quantities.
16936 @item -mlittle-endian
16937 @itemx -mbig-endian
16938 @opindex mlittle-endian
16939 @opindex mbig-endian
16940 Generate code for a little-endian target.
16942 @item -m210
16943 @itemx -m340
16944 @opindex m210
16945 @opindex m340
16946 Generate code for the 210 processor.
16948 @item -mno-lsim
16949 @opindex mno-lsim
16950 Assume that runtime support has been provided and so omit the
16951 simulator library (@file{libsim.a)} from the linker command line.
16953 @item -mstack-increment=@var{size}
16954 @opindex mstack-increment
16955 Set the maximum amount for a single stack increment operation.  Large
16956 values can increase the speed of programs that contain functions
16957 that need a large amount of stack space, but they can also trigger a
16958 segmentation fault if the stack is extended too much.  The default
16959 value is 0x1000.
16961 @end table
16963 @node MeP Options
16964 @subsection MeP Options
16965 @cindex MeP options
16967 @table @gcctabopt
16969 @item -mabsdiff
16970 @opindex mabsdiff
16971 Enables the @code{abs} instruction, which is the absolute difference
16972 between two registers.
16974 @item -mall-opts
16975 @opindex mall-opts
16976 Enables all the optional instructions---average, multiply, divide, bit
16977 operations, leading zero, absolute difference, min/max, clip, and
16978 saturation.
16981 @item -maverage
16982 @opindex maverage
16983 Enables the @code{ave} instruction, which computes the average of two
16984 registers.
16986 @item -mbased=@var{n}
16987 @opindex mbased=
16988 Variables of size @var{n} bytes or smaller are placed in the
16989 @code{.based} section by default.  Based variables use the @code{$tp}
16990 register as a base register, and there is a 128-byte limit to the
16991 @code{.based} section.
16993 @item -mbitops
16994 @opindex mbitops
16995 Enables the bit operation instructions---bit test (@code{btstm}), set
16996 (@code{bsetm}), clear (@code{bclrm}), invert (@code{bnotm}), and
16997 test-and-set (@code{tas}).
16999 @item -mc=@var{name}
17000 @opindex mc=
17001 Selects which section constant data is placed in.  @var{name} may
17002 be @code{tiny}, @code{near}, or @code{far}.
17004 @item -mclip
17005 @opindex mclip
17006 Enables the @code{clip} instruction.  Note that @code{-mclip} is not
17007 useful unless you also provide @code{-mminmax}.
17009 @item -mconfig=@var{name}
17010 @opindex mconfig=
17011 Selects one of the built-in core configurations.  Each MeP chip has
17012 one or more modules in it; each module has a core CPU and a variety of
17013 coprocessors, optional instructions, and peripherals.  The
17014 @code{MeP-Integrator} tool, not part of GCC, provides these
17015 configurations through this option; using this option is the same as
17016 using all the corresponding command-line options.  The default
17017 configuration is @code{default}.
17019 @item -mcop
17020 @opindex mcop
17021 Enables the coprocessor instructions.  By default, this is a 32-bit
17022 coprocessor.  Note that the coprocessor is normally enabled via the
17023 @code{-mconfig=} option.
17025 @item -mcop32
17026 @opindex mcop32
17027 Enables the 32-bit coprocessor's instructions.
17029 @item -mcop64
17030 @opindex mcop64
17031 Enables the 64-bit coprocessor's instructions.
17033 @item -mivc2
17034 @opindex mivc2
17035 Enables IVC2 scheduling.  IVC2 is a 64-bit VLIW coprocessor.
17037 @item -mdc
17038 @opindex mdc
17039 Causes constant variables to be placed in the @code{.near} section.
17041 @item -mdiv
17042 @opindex mdiv
17043 Enables the @code{div} and @code{divu} instructions.
17045 @item -meb
17046 @opindex meb
17047 Generate big-endian code.
17049 @item -mel
17050 @opindex mel
17051 Generate little-endian code.
17053 @item -mio-volatile
17054 @opindex mio-volatile
17055 Tells the compiler that any variable marked with the @code{io}
17056 attribute is to be considered volatile.
17058 @item -ml
17059 @opindex ml
17060 Causes variables to be assigned to the @code{.far} section by default.
17062 @item -mleadz
17063 @opindex mleadz
17064 Enables the @code{leadz} (leading zero) instruction.
17066 @item -mm
17067 @opindex mm
17068 Causes variables to be assigned to the @code{.near} section by default.
17070 @item -mminmax
17071 @opindex mminmax
17072 Enables the @code{min} and @code{max} instructions.
17074 @item -mmult
17075 @opindex mmult
17076 Enables the multiplication and multiply-accumulate instructions.
17078 @item -mno-opts
17079 @opindex mno-opts
17080 Disables all the optional instructions enabled by @code{-mall-opts}.
17082 @item -mrepeat
17083 @opindex mrepeat
17084 Enables the @code{repeat} and @code{erepeat} instructions, used for
17085 low-overhead looping.
17087 @item -ms
17088 @opindex ms
17089 Causes all variables to default to the @code{.tiny} section.  Note
17090 that there is a 65536-byte limit to this section.  Accesses to these
17091 variables use the @code{%gp} base register.
17093 @item -msatur
17094 @opindex msatur
17095 Enables the saturation instructions.  Note that the compiler does not
17096 currently generate these itself, but this option is included for
17097 compatibility with other tools, like @code{as}.
17099 @item -msdram
17100 @opindex msdram
17101 Link the SDRAM-based runtime instead of the default ROM-based runtime.
17103 @item -msim
17104 @opindex msim
17105 Link the simulator run-time libraries.
17107 @item -msimnovec
17108 @opindex msimnovec
17109 Link the simulator runtime libraries, excluding built-in support
17110 for reset and exception vectors and tables.
17112 @item -mtf
17113 @opindex mtf
17114 Causes all functions to default to the @code{.far} section.  Without
17115 this option, functions default to the @code{.near} section.
17117 @item -mtiny=@var{n}
17118 @opindex mtiny=
17119 Variables that are @var{n} bytes or smaller are allocated to the
17120 @code{.tiny} section.  These variables use the @code{$gp} base
17121 register.  The default for this option is 4, but note that there's a
17122 65536-byte limit to the @code{.tiny} section.
17124 @end table
17126 @node MicroBlaze Options
17127 @subsection MicroBlaze Options
17128 @cindex MicroBlaze Options
17130 @table @gcctabopt
17132 @item -msoft-float
17133 @opindex msoft-float
17134 Use software emulation for floating point (default).
17136 @item -mhard-float
17137 @opindex mhard-float
17138 Use hardware floating-point instructions.
17140 @item -mmemcpy
17141 @opindex mmemcpy
17142 Do not optimize block moves, use @code{memcpy}.
17144 @item -mno-clearbss
17145 @opindex mno-clearbss
17146 This option is deprecated.  Use @option{-fno-zero-initialized-in-bss} instead.
17148 @item -mcpu=@var{cpu-type}
17149 @opindex mcpu=
17150 Use features of, and schedule code for, the given CPU.
17151 Supported values are in the format @samp{v@var{X}.@var{YY}.@var{Z}},
17152 where @var{X} is a major version, @var{YY} is the minor version, and
17153 @var{Z} is compatibility code.  Example values are @samp{v3.00.a},
17154 @samp{v4.00.b}, @samp{v5.00.a}, @samp{v5.00.b}, @samp{v5.00.b}, @samp{v6.00.a}.
17156 @item -mxl-soft-mul
17157 @opindex mxl-soft-mul
17158 Use software multiply emulation (default).
17160 @item -mxl-soft-div
17161 @opindex mxl-soft-div
17162 Use software emulation for divides (default).
17164 @item -mxl-barrel-shift
17165 @opindex mxl-barrel-shift
17166 Use the hardware barrel shifter.
17168 @item -mxl-pattern-compare
17169 @opindex mxl-pattern-compare
17170 Use pattern compare instructions.
17172 @item -msmall-divides
17173 @opindex msmall-divides
17174 Use table lookup optimization for small signed integer divisions.
17176 @item -mxl-stack-check
17177 @opindex mxl-stack-check
17178 This option is deprecated.  Use @option{-fstack-check} instead.
17180 @item -mxl-gp-opt
17181 @opindex mxl-gp-opt
17182 Use GP-relative @code{.sdata}/@code{.sbss} sections.
17184 @item -mxl-multiply-high
17185 @opindex mxl-multiply-high
17186 Use multiply high instructions for high part of 32x32 multiply.
17188 @item -mxl-float-convert
17189 @opindex mxl-float-convert
17190 Use hardware floating-point conversion instructions.
17192 @item -mxl-float-sqrt
17193 @opindex mxl-float-sqrt
17194 Use hardware floating-point square root instruction.
17196 @item -mbig-endian
17197 @opindex mbig-endian
17198 Generate code for a big-endian target.
17200 @item -mlittle-endian
17201 @opindex mlittle-endian
17202 Generate code for a little-endian target.
17204 @item -mxl-reorder
17205 @opindex mxl-reorder
17206 Use reorder instructions (swap and byte reversed load/store).
17208 @item -mxl-mode-@var{app-model}
17209 Select application model @var{app-model}.  Valid models are
17210 @table @samp
17211 @item executable
17212 normal executable (default), uses startup code @file{crt0.o}.
17214 @item xmdstub
17215 for use with Xilinx Microprocessor Debugger (XMD) based
17216 software intrusive debug agent called xmdstub. This uses startup file
17217 @file{crt1.o} and sets the start address of the program to 0x800.
17219 @item bootstrap
17220 for applications that are loaded using a bootloader.
17221 This model uses startup file @file{crt2.o} which does not contain a processor
17222 reset vector handler. This is suitable for transferring control on a
17223 processor reset to the bootloader rather than the application.
17225 @item novectors
17226 for applications that do not require any of the
17227 MicroBlaze vectors. This option may be useful for applications running
17228 within a monitoring application. This model uses @file{crt3.o} as a startup file.
17229 @end table
17231 Option @option{-xl-mode-@var{app-model}} is a deprecated alias for
17232 @option{-mxl-mode-@var{app-model}}.
17234 @end table
17236 @node MIPS Options
17237 @subsection MIPS Options
17238 @cindex MIPS options
17240 @table @gcctabopt
17242 @item -EB
17243 @opindex EB
17244 Generate big-endian code.
17246 @item -EL
17247 @opindex EL
17248 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
17249 configurations.
17251 @item -march=@var{arch}
17252 @opindex march
17253 Generate code that runs on @var{arch}, which can be the name of a
17254 generic MIPS ISA, or the name of a particular processor.
17255 The ISA names are:
17256 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
17257 @samp{mips32}, @samp{mips32r2}, @samp{mips32r3}, @samp{mips32r5}, 
17258 @samp{mips64}, @samp{mips64r2}, @samp{mips64r3} and @samp{mips64r5}.
17259 The processor names are:
17260 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
17261 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
17262 @samp{5kc}, @samp{5kf},
17263 @samp{20kc},
17264 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
17265 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
17266 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1}, @samp{34kn},
17267 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
17268 @samp{1004kc}, @samp{1004kf2_1}, @samp{1004kf1_1},
17269 @samp{loongson2e}, @samp{loongson2f}, @samp{loongson3a},
17270 @samp{m4k},
17271 @samp{m14k}, @samp{m14kc}, @samp{m14ke}, @samp{m14kec},
17272 @samp{octeon}, @samp{octeon+}, @samp{octeon2},
17273 @samp{orion},
17274 @samp{p5600},
17275 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
17276 @samp{r4600}, @samp{r4650}, @samp{r4700}, @samp{r6000}, @samp{r8000},
17277 @samp{rm7000}, @samp{rm9000},
17278 @samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
17279 @samp{sb1},
17280 @samp{sr71000},
17281 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
17282 @samp{vr5000}, @samp{vr5400}, @samp{vr5500},
17283 @samp{xlr} and @samp{xlp}.
17284 The special value @samp{from-abi} selects the
17285 most compatible architecture for the selected ABI (that is,
17286 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
17288 The native Linux/GNU toolchain also supports the value @samp{native},
17289 which selects the best architecture option for the host processor.
17290 @option{-march=native} has no effect if GCC does not recognize
17291 the processor.
17293 In processor names, a final @samp{000} can be abbreviated as @samp{k}
17294 (for example, @option{-march=r2k}).  Prefixes are optional, and
17295 @samp{vr} may be written @samp{r}.
17297 Names of the form @samp{@var{n}f2_1} refer to processors with
17298 FPUs clocked at half the rate of the core, names of the form
17299 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
17300 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
17301 processors with FPUs clocked a ratio of 3:2 with respect to the core.
17302 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
17303 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
17304 accepted as synonyms for @samp{@var{n}f1_1}.
17306 GCC defines two macros based on the value of this option.  The first
17307 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
17308 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
17309 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
17310 For example, @option{-march=r2000} sets @samp{_MIPS_ARCH}
17311 to @samp{"r2000"} and defines the macro @samp{_MIPS_ARCH_R2000}.
17313 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
17314 above.  In other words, it has the full prefix and does not
17315 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
17316 the macro names the resolved architecture (either @samp{"mips1"} or
17317 @samp{"mips3"}).  It names the default architecture when no
17318 @option{-march} option is given.
17320 @item -mtune=@var{arch}
17321 @opindex mtune
17322 Optimize for @var{arch}.  Among other things, this option controls
17323 the way instructions are scheduled, and the perceived cost of arithmetic
17324 operations.  The list of @var{arch} values is the same as for
17325 @option{-march}.
17327 When this option is not used, GCC optimizes for the processor
17328 specified by @option{-march}.  By using @option{-march} and
17329 @option{-mtune} together, it is possible to generate code that
17330 runs on a family of processors, but optimize the code for one
17331 particular member of that family.
17333 @option{-mtune} defines the macros @samp{_MIPS_TUNE} and
17334 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
17335 @option{-march} ones described above.
17337 @item -mips1
17338 @opindex mips1
17339 Equivalent to @option{-march=mips1}.
17341 @item -mips2
17342 @opindex mips2
17343 Equivalent to @option{-march=mips2}.
17345 @item -mips3
17346 @opindex mips3
17347 Equivalent to @option{-march=mips3}.
17349 @item -mips4
17350 @opindex mips4
17351 Equivalent to @option{-march=mips4}.
17353 @item -mips32
17354 @opindex mips32
17355 Equivalent to @option{-march=mips32}.
17357 @item -mips32r3
17358 @opindex mips32r3
17359 Equivalent to @option{-march=mips32r3}.
17361 @item -mips32r5
17362 @opindex mips32r5
17363 Equivalent to @option{-march=mips32r5}.
17365 @item -mips64
17366 @opindex mips64
17367 Equivalent to @option{-march=mips64}.
17369 @item -mips64r2
17370 @opindex mips64r2
17371 Equivalent to @option{-march=mips64r2}.
17373 @item -mips64r3
17374 @opindex mips64r3
17375 Equivalent to @option{-march=mips64r3}.
17377 @item -mips64r5
17378 @opindex mips64r5
17379 Equivalent to @option{-march=mips64r5}.
17381 @item -mips16
17382 @itemx -mno-mips16
17383 @opindex mips16
17384 @opindex mno-mips16
17385 Generate (do not generate) MIPS16 code.  If GCC is targeting a
17386 MIPS32 or MIPS64 architecture, it makes use of the MIPS16e ASE@.
17388 MIPS16 code generation can also be controlled on a per-function basis
17389 by means of @code{mips16} and @code{nomips16} attributes.
17390 @xref{Function Attributes}, for more information.
17392 @item -mflip-mips16
17393 @opindex mflip-mips16
17394 Generate MIPS16 code on alternating functions.  This option is provided
17395 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
17396 not intended for ordinary use in compiling user code.
17398 @item -minterlink-compressed
17399 @item -mno-interlink-compressed
17400 @opindex minterlink-compressed
17401 @opindex mno-interlink-compressed
17402 Require (do not require) that code using the standard (uncompressed) MIPS ISA
17403 be link-compatible with MIPS16 and microMIPS code, and vice versa.
17405 For example, code using the standard ISA encoding cannot jump directly
17406 to MIPS16 or microMIPS code; it must either use a call or an indirect jump.
17407 @option{-minterlink-compressed} therefore disables direct jumps unless GCC
17408 knows that the target of the jump is not compressed.
17410 @item -minterlink-mips16
17411 @itemx -mno-interlink-mips16
17412 @opindex minterlink-mips16
17413 @opindex mno-interlink-mips16
17414 Aliases of @option{-minterlink-compressed} and
17415 @option{-mno-interlink-compressed}.  These options predate the microMIPS ASE
17416 and are retained for backwards compatibility.
17418 @item -mabi=32
17419 @itemx -mabi=o64
17420 @itemx -mabi=n32
17421 @itemx -mabi=64
17422 @itemx -mabi=eabi
17423 @opindex mabi=32
17424 @opindex mabi=o64
17425 @opindex mabi=n32
17426 @opindex mabi=64
17427 @opindex mabi=eabi
17428 Generate code for the given ABI@.
17430 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
17431 generates 64-bit code when you select a 64-bit architecture, but you
17432 can use @option{-mgp32} to get 32-bit code instead.
17434 For information about the O64 ABI, see
17435 @uref{http://gcc.gnu.org/@/projects/@/mipso64-abi.html}.
17437 GCC supports a variant of the o32 ABI in which floating-point registers
17438 are 64 rather than 32 bits wide.  You can select this combination with
17439 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @code{mthc1}
17440 and @code{mfhc1} instructions and is therefore only supported for
17441 MIPS32R2, MIPS32R3 and MIPS32R5 processors.
17443 The register assignments for arguments and return values remain the
17444 same, but each scalar value is passed in a single 64-bit register
17445 rather than a pair of 32-bit registers.  For example, scalar
17446 floating-point values are returned in @samp{$f0} only, not a
17447 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
17448 remains the same, but all 64 bits are saved.
17450 @item -mabicalls
17451 @itemx -mno-abicalls
17452 @opindex mabicalls
17453 @opindex mno-abicalls
17454 Generate (do not generate) code that is suitable for SVR4-style
17455 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
17456 systems.
17458 @item -mshared
17459 @itemx -mno-shared
17460 Generate (do not generate) code that is fully position-independent,
17461 and that can therefore be linked into shared libraries.  This option
17462 only affects @option{-mabicalls}.
17464 All @option{-mabicalls} code has traditionally been position-independent,
17465 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
17466 as an extension, the GNU toolchain allows executables to use absolute
17467 accesses for locally-binding symbols.  It can also use shorter GP
17468 initialization sequences and generate direct calls to locally-defined
17469 functions.  This mode is selected by @option{-mno-shared}.
17471 @option{-mno-shared} depends on binutils 2.16 or higher and generates
17472 objects that can only be linked by the GNU linker.  However, the option
17473 does not affect the ABI of the final executable; it only affects the ABI
17474 of relocatable objects.  Using @option{-mno-shared} generally makes
17475 executables both smaller and quicker.
17477 @option{-mshared} is the default.
17479 @item -mplt
17480 @itemx -mno-plt
17481 @opindex mplt
17482 @opindex mno-plt
17483 Assume (do not assume) that the static and dynamic linkers
17484 support PLTs and copy relocations.  This option only affects
17485 @option{-mno-shared -mabicalls}.  For the n64 ABI, this option
17486 has no effect without @option{-msym32}.
17488 You can make @option{-mplt} the default by configuring
17489 GCC with @option{--with-mips-plt}.  The default is
17490 @option{-mno-plt} otherwise.
17492 @item -mxgot
17493 @itemx -mno-xgot
17494 @opindex mxgot
17495 @opindex mno-xgot
17496 Lift (do not lift) the usual restrictions on the size of the global
17497 offset table.
17499 GCC normally uses a single instruction to load values from the GOT@.
17500 While this is relatively efficient, it only works if the GOT
17501 is smaller than about 64k.  Anything larger causes the linker
17502 to report an error such as:
17504 @cindex relocation truncated to fit (MIPS)
17505 @smallexample
17506 relocation truncated to fit: R_MIPS_GOT16 foobar
17507 @end smallexample
17509 If this happens, you should recompile your code with @option{-mxgot}.
17510 This works with very large GOTs, although the code is also
17511 less efficient, since it takes three instructions to fetch the
17512 value of a global symbol.
17514 Note that some linkers can create multiple GOTs.  If you have such a
17515 linker, you should only need to use @option{-mxgot} when a single object
17516 file accesses more than 64k's worth of GOT entries.  Very few do.
17518 These options have no effect unless GCC is generating position
17519 independent code.
17521 @item -mgp32
17522 @opindex mgp32
17523 Assume that general-purpose registers are 32 bits wide.
17525 @item -mgp64
17526 @opindex mgp64
17527 Assume that general-purpose registers are 64 bits wide.
17529 @item -mfp32
17530 @opindex mfp32
17531 Assume that floating-point registers are 32 bits wide.
17533 @item -mfp64
17534 @opindex mfp64
17535 Assume that floating-point registers are 64 bits wide.
17537 @item -mhard-float
17538 @opindex mhard-float
17539 Use floating-point coprocessor instructions.
17541 @item -msoft-float
17542 @opindex msoft-float
17543 Do not use floating-point coprocessor instructions.  Implement
17544 floating-point calculations using library calls instead.
17546 @item -mno-float
17547 @opindex mno-float
17548 Equivalent to @option{-msoft-float}, but additionally asserts that the
17549 program being compiled does not perform any floating-point operations.
17550 This option is presently supported only by some bare-metal MIPS
17551 configurations, where it may select a special set of libraries
17552 that lack all floating-point support (including, for example, the
17553 floating-point @code{printf} formats).  
17554 If code compiled with @code{-mno-float} accidentally contains
17555 floating-point operations, it is likely to suffer a link-time
17556 or run-time failure.
17558 @item -msingle-float
17559 @opindex msingle-float
17560 Assume that the floating-point coprocessor only supports single-precision
17561 operations.
17563 @item -mdouble-float
17564 @opindex mdouble-float
17565 Assume that the floating-point coprocessor supports double-precision
17566 operations.  This is the default.
17568 @item -mabs=2008
17569 @itemx -mabs=legacy
17570 @opindex mabs=2008
17571 @opindex mabs=legacy
17572 These options control the treatment of the special not-a-number (NaN)
17573 IEEE 754 floating-point data with the @code{abs.@i{fmt}} and
17574 @code{neg.@i{fmt}} machine instructions.
17576 By default or when the @option{-mabs=legacy} is used the legacy
17577 treatment is selected.  In this case these instructions are considered
17578 arithmetic and avoided where correct operation is required and the
17579 input operand might be a NaN.  A longer sequence of instructions that
17580 manipulate the sign bit of floating-point datum manually is used
17581 instead unless the @option{-ffinite-math-only} option has also been
17582 specified.
17584 The @option{-mabs=2008} option selects the IEEE 754-2008 treatment.  In
17585 this case these instructions are considered non-arithmetic and therefore
17586 operating correctly in all cases, including in particular where the
17587 input operand is a NaN.  These instructions are therefore always used
17588 for the respective operations.
17590 @item -mnan=2008
17591 @itemx -mnan=legacy
17592 @opindex mnan=2008
17593 @opindex mnan=legacy
17594 These options control the encoding of the special not-a-number (NaN)
17595 IEEE 754 floating-point data.
17597 The @option{-mnan=legacy} option selects the legacy encoding.  In this
17598 case quiet NaNs (qNaNs) are denoted by the first bit of their trailing
17599 significand field being 0, whereas signalling NaNs (sNaNs) are denoted
17600 by the first bit of their trailing significand field being 1.
17602 The @option{-mnan=2008} option selects the IEEE 754-2008 encoding.  In
17603 this case qNaNs are denoted by the first bit of their trailing
17604 significand field being 1, whereas sNaNs are denoted by the first bit of
17605 their trailing significand field being 0.
17607 The default is @option{-mnan=legacy} unless GCC has been configured with
17608 @option{--with-nan=2008}.
17610 @item -mllsc
17611 @itemx -mno-llsc
17612 @opindex mllsc
17613 @opindex mno-llsc
17614 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
17615 implement atomic memory built-in functions.  When neither option is
17616 specified, GCC uses the instructions if the target architecture
17617 supports them.
17619 @option{-mllsc} is useful if the runtime environment can emulate the
17620 instructions and @option{-mno-llsc} can be useful when compiling for
17621 nonstandard ISAs.  You can make either option the default by
17622 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
17623 respectively.  @option{--with-llsc} is the default for some
17624 configurations; see the installation documentation for details.
17626 @item -mdsp
17627 @itemx -mno-dsp
17628 @opindex mdsp
17629 @opindex mno-dsp
17630 Use (do not use) revision 1 of the MIPS DSP ASE@.
17631 @xref{MIPS DSP Built-in Functions}.  This option defines the
17632 preprocessor macro @samp{__mips_dsp}.  It also defines
17633 @samp{__mips_dsp_rev} to 1.
17635 @item -mdspr2
17636 @itemx -mno-dspr2
17637 @opindex mdspr2
17638 @opindex mno-dspr2
17639 Use (do not use) revision 2 of the MIPS DSP ASE@.
17640 @xref{MIPS DSP Built-in Functions}.  This option defines the
17641 preprocessor macros @samp{__mips_dsp} and @samp{__mips_dspr2}.
17642 It also defines @samp{__mips_dsp_rev} to 2.
17644 @item -msmartmips
17645 @itemx -mno-smartmips
17646 @opindex msmartmips
17647 @opindex mno-smartmips
17648 Use (do not use) the MIPS SmartMIPS ASE.
17650 @item -mpaired-single
17651 @itemx -mno-paired-single
17652 @opindex mpaired-single
17653 @opindex mno-paired-single
17654 Use (do not use) paired-single floating-point instructions.
17655 @xref{MIPS Paired-Single Support}.  This option requires
17656 hardware floating-point support to be enabled.
17658 @item -mdmx
17659 @itemx -mno-mdmx
17660 @opindex mdmx
17661 @opindex mno-mdmx
17662 Use (do not use) MIPS Digital Media Extension instructions.
17663 This option can only be used when generating 64-bit code and requires
17664 hardware floating-point support to be enabled.
17666 @item -mips3d
17667 @itemx -mno-mips3d
17668 @opindex mips3d
17669 @opindex mno-mips3d
17670 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
17671 The option @option{-mips3d} implies @option{-mpaired-single}.
17673 @item -mmicromips
17674 @itemx -mno-micromips
17675 @opindex mmicromips
17676 @opindex mno-mmicromips
17677 Generate (do not generate) microMIPS code.
17679 MicroMIPS code generation can also be controlled on a per-function basis
17680 by means of @code{micromips} and @code{nomicromips} attributes.
17681 @xref{Function Attributes}, for more information.
17683 @item -mmt
17684 @itemx -mno-mt
17685 @opindex mmt
17686 @opindex mno-mt
17687 Use (do not use) MT Multithreading instructions.
17689 @item -mmcu
17690 @itemx -mno-mcu
17691 @opindex mmcu
17692 @opindex mno-mcu
17693 Use (do not use) the MIPS MCU ASE instructions.
17695 @item -meva
17696 @itemx -mno-eva
17697 @opindex meva
17698 @opindex mno-eva
17699 Use (do not use) the MIPS Enhanced Virtual Addressing instructions.
17701 @item -mvirt
17702 @itemx -mno-virt
17703 @opindex mvirt
17704 @opindex mno-virt
17705 Use (do not use) the MIPS Virtualization Application Specific instructions.
17707 @item -mxpa
17708 @itemx -mno-xpa
17709 @opindex mxpa
17710 @opindex mno-xpa
17711 Use (do not use) the MIPS eXtended Physical Address (XPA) instructions.
17713 @item -mlong64
17714 @opindex mlong64
17715 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
17716 an explanation of the default and the way that the pointer size is
17717 determined.
17719 @item -mlong32
17720 @opindex mlong32
17721 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
17723 The default size of @code{int}s, @code{long}s and pointers depends on
17724 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
17725 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
17726 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
17727 or the same size as integer registers, whichever is smaller.
17729 @item -msym32
17730 @itemx -mno-sym32
17731 @opindex msym32
17732 @opindex mno-sym32
17733 Assume (do not assume) that all symbols have 32-bit values, regardless
17734 of the selected ABI@.  This option is useful in combination with
17735 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
17736 to generate shorter and faster references to symbolic addresses.
17738 @item -G @var{num}
17739 @opindex G
17740 Put definitions of externally-visible data in a small data section
17741 if that data is no bigger than @var{num} bytes.  GCC can then generate
17742 more efficient accesses to the data; see @option{-mgpopt} for details.
17744 The default @option{-G} option depends on the configuration.
17746 @item -mlocal-sdata
17747 @itemx -mno-local-sdata
17748 @opindex mlocal-sdata
17749 @opindex mno-local-sdata
17750 Extend (do not extend) the @option{-G} behavior to local data too,
17751 such as to static variables in C@.  @option{-mlocal-sdata} is the
17752 default for all configurations.
17754 If the linker complains that an application is using too much small data,
17755 you might want to try rebuilding the less performance-critical parts with
17756 @option{-mno-local-sdata}.  You might also want to build large
17757 libraries with @option{-mno-local-sdata}, so that the libraries leave
17758 more room for the main program.
17760 @item -mextern-sdata
17761 @itemx -mno-extern-sdata
17762 @opindex mextern-sdata
17763 @opindex mno-extern-sdata
17764 Assume (do not assume) that externally-defined data is in
17765 a small data section if the size of that data is within the @option{-G} limit.
17766 @option{-mextern-sdata} is the default for all configurations.
17768 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
17769 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
17770 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
17771 is placed in a small data section.  If @var{Var} is defined by another
17772 module, you must either compile that module with a high-enough
17773 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
17774 definition.  If @var{Var} is common, you must link the application
17775 with a high-enough @option{-G} setting.
17777 The easiest way of satisfying these restrictions is to compile
17778 and link every module with the same @option{-G} option.  However,
17779 you may wish to build a library that supports several different
17780 small data limits.  You can do this by compiling the library with
17781 the highest supported @option{-G} setting and additionally using
17782 @option{-mno-extern-sdata} to stop the library from making assumptions
17783 about externally-defined data.
17785 @item -mgpopt
17786 @itemx -mno-gpopt
17787 @opindex mgpopt
17788 @opindex mno-gpopt
17789 Use (do not use) GP-relative accesses for symbols that are known to be
17790 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
17791 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
17792 configurations.
17794 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
17795 might not hold the value of @code{_gp}.  For example, if the code is
17796 part of a library that might be used in a boot monitor, programs that
17797 call boot monitor routines pass an unknown value in @code{$gp}.
17798 (In such situations, the boot monitor itself is usually compiled
17799 with @option{-G0}.)
17801 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
17802 @option{-mno-extern-sdata}.
17804 @item -membedded-data
17805 @itemx -mno-embedded-data
17806 @opindex membedded-data
17807 @opindex mno-embedded-data
17808 Allocate variables to the read-only data section first if possible, then
17809 next in the small data section if possible, otherwise in data.  This gives
17810 slightly slower code than the default, but reduces the amount of RAM required
17811 when executing, and thus may be preferred for some embedded systems.
17813 @item -muninit-const-in-rodata
17814 @itemx -mno-uninit-const-in-rodata
17815 @opindex muninit-const-in-rodata
17816 @opindex mno-uninit-const-in-rodata
17817 Put uninitialized @code{const} variables in the read-only data section.
17818 This option is only meaningful in conjunction with @option{-membedded-data}.
17820 @item -mcode-readable=@var{setting}
17821 @opindex mcode-readable
17822 Specify whether GCC may generate code that reads from executable sections.
17823 There are three possible settings:
17825 @table @gcctabopt
17826 @item -mcode-readable=yes
17827 Instructions may freely access executable sections.  This is the
17828 default setting.
17830 @item -mcode-readable=pcrel
17831 MIPS16 PC-relative load instructions can access executable sections,
17832 but other instructions must not do so.  This option is useful on 4KSc
17833 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
17834 It is also useful on processors that can be configured to have a dual
17835 instruction/data SRAM interface and that, like the M4K, automatically
17836 redirect PC-relative loads to the instruction RAM.
17838 @item -mcode-readable=no
17839 Instructions must not access executable sections.  This option can be
17840 useful on targets that are configured to have a dual instruction/data
17841 SRAM interface but that (unlike the M4K) do not automatically redirect
17842 PC-relative loads to the instruction RAM.
17843 @end table
17845 @item -msplit-addresses
17846 @itemx -mno-split-addresses
17847 @opindex msplit-addresses
17848 @opindex mno-split-addresses
17849 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
17850 relocation operators.  This option has been superseded by
17851 @option{-mexplicit-relocs} but is retained for backwards compatibility.
17853 @item -mexplicit-relocs
17854 @itemx -mno-explicit-relocs
17855 @opindex mexplicit-relocs
17856 @opindex mno-explicit-relocs
17857 Use (do not use) assembler relocation operators when dealing with symbolic
17858 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
17859 is to use assembler macros instead.
17861 @option{-mexplicit-relocs} is the default if GCC was configured
17862 to use an assembler that supports relocation operators.
17864 @item -mcheck-zero-division
17865 @itemx -mno-check-zero-division
17866 @opindex mcheck-zero-division
17867 @opindex mno-check-zero-division
17868 Trap (do not trap) on integer division by zero.
17870 The default is @option{-mcheck-zero-division}.
17872 @item -mdivide-traps
17873 @itemx -mdivide-breaks
17874 @opindex mdivide-traps
17875 @opindex mdivide-breaks
17876 MIPS systems check for division by zero by generating either a
17877 conditional trap or a break instruction.  Using traps results in
17878 smaller code, but is only supported on MIPS II and later.  Also, some
17879 versions of the Linux kernel have a bug that prevents trap from
17880 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
17881 allow conditional traps on architectures that support them and
17882 @option{-mdivide-breaks} to force the use of breaks.
17884 The default is usually @option{-mdivide-traps}, but this can be
17885 overridden at configure time using @option{--with-divide=breaks}.
17886 Divide-by-zero checks can be completely disabled using
17887 @option{-mno-check-zero-division}.
17889 @item -mmemcpy
17890 @itemx -mno-memcpy
17891 @opindex mmemcpy
17892 @opindex mno-memcpy
17893 Force (do not force) the use of @code{memcpy()} for non-trivial block
17894 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
17895 most constant-sized copies.
17897 @item -mlong-calls
17898 @itemx -mno-long-calls
17899 @opindex mlong-calls
17900 @opindex mno-long-calls
17901 Disable (do not disable) use of the @code{jal} instruction.  Calling
17902 functions using @code{jal} is more efficient but requires the caller
17903 and callee to be in the same 256 megabyte segment.
17905 This option has no effect on abicalls code.  The default is
17906 @option{-mno-long-calls}.
17908 @item -mmad
17909 @itemx -mno-mad
17910 @opindex mmad
17911 @opindex mno-mad
17912 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
17913 instructions, as provided by the R4650 ISA@.
17915 @item -mimadd
17916 @itemx -mno-imadd
17917 @opindex mimadd
17918 @opindex mno-imadd
17919 Enable (disable) use of the @code{madd} and @code{msub} integer
17920 instructions.  The default is @option{-mimadd} on architectures
17921 that support @code{madd} and @code{msub} except for the 74k 
17922 architecture where it was found to generate slower code.
17924 @item -mfused-madd
17925 @itemx -mno-fused-madd
17926 @opindex mfused-madd
17927 @opindex mno-fused-madd
17928 Enable (disable) use of the floating-point multiply-accumulate
17929 instructions, when they are available.  The default is
17930 @option{-mfused-madd}.
17932 On the R8000 CPU when multiply-accumulate instructions are used,
17933 the intermediate product is calculated to infinite precision
17934 and is not subject to the FCSR Flush to Zero bit.  This may be
17935 undesirable in some circumstances.  On other processors the result
17936 is numerically identical to the equivalent computation using
17937 separate multiply, add, subtract and negate instructions.
17939 @item -nocpp
17940 @opindex nocpp
17941 Tell the MIPS assembler to not run its preprocessor over user
17942 assembler files (with a @samp{.s} suffix) when assembling them.
17944 @item -mfix-24k
17945 @item -mno-fix-24k
17946 @opindex mfix-24k
17947 @opindex mno-fix-24k
17948 Work around the 24K E48 (lost data on stores during refill) errata.
17949 The workarounds are implemented by the assembler rather than by GCC@.
17951 @item -mfix-r4000
17952 @itemx -mno-fix-r4000
17953 @opindex mfix-r4000
17954 @opindex mno-fix-r4000
17955 Work around certain R4000 CPU errata:
17956 @itemize @minus
17957 @item
17958 A double-word or a variable shift may give an incorrect result if executed
17959 immediately after starting an integer division.
17960 @item
17961 A double-word or a variable shift may give an incorrect result if executed
17962 while an integer multiplication is in progress.
17963 @item
17964 An integer division may give an incorrect result if started in a delay slot
17965 of a taken branch or a jump.
17966 @end itemize
17968 @item -mfix-r4400
17969 @itemx -mno-fix-r4400
17970 @opindex mfix-r4400
17971 @opindex mno-fix-r4400
17972 Work around certain R4400 CPU errata:
17973 @itemize @minus
17974 @item
17975 A double-word or a variable shift may give an incorrect result if executed
17976 immediately after starting an integer division.
17977 @end itemize
17979 @item -mfix-r10000
17980 @itemx -mno-fix-r10000
17981 @opindex mfix-r10000
17982 @opindex mno-fix-r10000
17983 Work around certain R10000 errata:
17984 @itemize @minus
17985 @item
17986 @code{ll}/@code{sc} sequences may not behave atomically on revisions
17987 prior to 3.0.  They may deadlock on revisions 2.6 and earlier.
17988 @end itemize
17990 This option can only be used if the target architecture supports
17991 branch-likely instructions.  @option{-mfix-r10000} is the default when
17992 @option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
17993 otherwise.
17995 @item -mfix-rm7000
17996 @itemx -mno-fix-rm7000
17997 @opindex mfix-rm7000
17998 Work around the RM7000 @code{dmult}/@code{dmultu} errata.  The
17999 workarounds are implemented by the assembler rather than by GCC@.
18001 @item -mfix-vr4120
18002 @itemx -mno-fix-vr4120
18003 @opindex mfix-vr4120
18004 Work around certain VR4120 errata:
18005 @itemize @minus
18006 @item
18007 @code{dmultu} does not always produce the correct result.
18008 @item
18009 @code{div} and @code{ddiv} do not always produce the correct result if one
18010 of the operands is negative.
18011 @end itemize
18012 The workarounds for the division errata rely on special functions in
18013 @file{libgcc.a}.  At present, these functions are only provided by
18014 the @code{mips64vr*-elf} configurations.
18016 Other VR4120 errata require a NOP to be inserted between certain pairs of
18017 instructions.  These errata are handled by the assembler, not by GCC itself.
18019 @item -mfix-vr4130
18020 @opindex mfix-vr4130
18021 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
18022 workarounds are implemented by the assembler rather than by GCC,
18023 although GCC avoids using @code{mflo} and @code{mfhi} if the
18024 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
18025 instructions are available instead.
18027 @item -mfix-sb1
18028 @itemx -mno-fix-sb1
18029 @opindex mfix-sb1
18030 Work around certain SB-1 CPU core errata.
18031 (This flag currently works around the SB-1 revision 2
18032 ``F1'' and ``F2'' floating-point errata.)
18034 @item -mr10k-cache-barrier=@var{setting}
18035 @opindex mr10k-cache-barrier
18036 Specify whether GCC should insert cache barriers to avoid the
18037 side-effects of speculation on R10K processors.
18039 In common with many processors, the R10K tries to predict the outcome
18040 of a conditional branch and speculatively executes instructions from
18041 the ``taken'' branch.  It later aborts these instructions if the
18042 predicted outcome is wrong.  However, on the R10K, even aborted
18043 instructions can have side effects.
18045 This problem only affects kernel stores and, depending on the system,
18046 kernel loads.  As an example, a speculatively-executed store may load
18047 the target memory into cache and mark the cache line as dirty, even if
18048 the store itself is later aborted.  If a DMA operation writes to the
18049 same area of memory before the ``dirty'' line is flushed, the cached
18050 data overwrites the DMA-ed data.  See the R10K processor manual
18051 for a full description, including other potential problems.
18053 One workaround is to insert cache barrier instructions before every memory
18054 access that might be speculatively executed and that might have side
18055 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
18056 controls GCC's implementation of this workaround.  It assumes that
18057 aborted accesses to any byte in the following regions does not have
18058 side effects:
18060 @enumerate
18061 @item
18062 the memory occupied by the current function's stack frame;
18064 @item
18065 the memory occupied by an incoming stack argument;
18067 @item
18068 the memory occupied by an object with a link-time-constant address.
18069 @end enumerate
18071 It is the kernel's responsibility to ensure that speculative
18072 accesses to these regions are indeed safe.
18074 If the input program contains a function declaration such as:
18076 @smallexample
18077 void foo (void);
18078 @end smallexample
18080 then the implementation of @code{foo} must allow @code{j foo} and
18081 @code{jal foo} to be executed speculatively.  GCC honors this
18082 restriction for functions it compiles itself.  It expects non-GCC
18083 functions (such as hand-written assembly code) to do the same.
18085 The option has three forms:
18087 @table @gcctabopt
18088 @item -mr10k-cache-barrier=load-store
18089 Insert a cache barrier before a load or store that might be
18090 speculatively executed and that might have side effects even
18091 if aborted.
18093 @item -mr10k-cache-barrier=store
18094 Insert a cache barrier before a store that might be speculatively
18095 executed and that might have side effects even if aborted.
18097 @item -mr10k-cache-barrier=none
18098 Disable the insertion of cache barriers.  This is the default setting.
18099 @end table
18101 @item -mflush-func=@var{func}
18102 @itemx -mno-flush-func
18103 @opindex mflush-func
18104 Specifies the function to call to flush the I and D caches, or to not
18105 call any such function.  If called, the function must take the same
18106 arguments as the common @code{_flush_func()}, that is, the address of the
18107 memory range for which the cache is being flushed, the size of the
18108 memory range, and the number 3 (to flush both caches).  The default
18109 depends on the target GCC was configured for, but commonly is either
18110 @samp{_flush_func} or @samp{__cpu_flush}.
18112 @item mbranch-cost=@var{num}
18113 @opindex mbranch-cost
18114 Set the cost of branches to roughly @var{num} ``simple'' instructions.
18115 This cost is only a heuristic and is not guaranteed to produce
18116 consistent results across releases.  A zero cost redundantly selects
18117 the default, which is based on the @option{-mtune} setting.
18119 @item -mbranch-likely
18120 @itemx -mno-branch-likely
18121 @opindex mbranch-likely
18122 @opindex mno-branch-likely
18123 Enable or disable use of Branch Likely instructions, regardless of the
18124 default for the selected architecture.  By default, Branch Likely
18125 instructions may be generated if they are supported by the selected
18126 architecture.  An exception is for the MIPS32 and MIPS64 architectures
18127 and processors that implement those architectures; for those, Branch
18128 Likely instructions are not be generated by default because the MIPS32
18129 and MIPS64 architectures specifically deprecate their use.
18131 @item -mfp-exceptions
18132 @itemx -mno-fp-exceptions
18133 @opindex mfp-exceptions
18134 Specifies whether FP exceptions are enabled.  This affects how
18135 FP instructions are scheduled for some processors.
18136 The default is that FP exceptions are
18137 enabled.
18139 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
18140 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
18141 FP pipe.
18143 @item -mvr4130-align
18144 @itemx -mno-vr4130-align
18145 @opindex mvr4130-align
18146 The VR4130 pipeline is two-way superscalar, but can only issue two
18147 instructions together if the first one is 8-byte aligned.  When this
18148 option is enabled, GCC aligns pairs of instructions that it
18149 thinks should execute in parallel.
18151 This option only has an effect when optimizing for the VR4130.
18152 It normally makes code faster, but at the expense of making it bigger.
18153 It is enabled by default at optimization level @option{-O3}.
18155 @item -msynci
18156 @itemx -mno-synci
18157 @opindex msynci
18158 Enable (disable) generation of @code{synci} instructions on
18159 architectures that support it.  The @code{synci} instructions (if
18160 enabled) are generated when @code{__builtin___clear_cache()} is
18161 compiled.
18163 This option defaults to @code{-mno-synci}, but the default can be
18164 overridden by configuring with @code{--with-synci}.
18166 When compiling code for single processor systems, it is generally safe
18167 to use @code{synci}.  However, on many multi-core (SMP) systems, it
18168 does not invalidate the instruction caches on all cores and may lead
18169 to undefined behavior.
18171 @item -mrelax-pic-calls
18172 @itemx -mno-relax-pic-calls
18173 @opindex mrelax-pic-calls
18174 Try to turn PIC calls that are normally dispatched via register
18175 @code{$25} into direct calls.  This is only possible if the linker can
18176 resolve the destination at link-time and if the destination is within
18177 range for a direct call.
18179 @option{-mrelax-pic-calls} is the default if GCC was configured to use
18180 an assembler and a linker that support the @code{.reloc} assembly
18181 directive and @code{-mexplicit-relocs} is in effect.  With
18182 @code{-mno-explicit-relocs}, this optimization can be performed by the
18183 assembler and the linker alone without help from the compiler.
18185 @item -mmcount-ra-address
18186 @itemx -mno-mcount-ra-address
18187 @opindex mmcount-ra-address
18188 @opindex mno-mcount-ra-address
18189 Emit (do not emit) code that allows @code{_mcount} to modify the
18190 calling function's return address.  When enabled, this option extends
18191 the usual @code{_mcount} interface with a new @var{ra-address}
18192 parameter, which has type @code{intptr_t *} and is passed in register
18193 @code{$12}.  @code{_mcount} can then modify the return address by
18194 doing both of the following:
18195 @itemize
18196 @item
18197 Returning the new address in register @code{$31}.
18198 @item
18199 Storing the new address in @code{*@var{ra-address}},
18200 if @var{ra-address} is nonnull.
18201 @end itemize
18203 The default is @option{-mno-mcount-ra-address}.
18205 @end table
18207 @node MMIX Options
18208 @subsection MMIX Options
18209 @cindex MMIX Options
18211 These options are defined for the MMIX:
18213 @table @gcctabopt
18214 @item -mlibfuncs
18215 @itemx -mno-libfuncs
18216 @opindex mlibfuncs
18217 @opindex mno-libfuncs
18218 Specify that intrinsic library functions are being compiled, passing all
18219 values in registers, no matter the size.
18221 @item -mepsilon
18222 @itemx -mno-epsilon
18223 @opindex mepsilon
18224 @opindex mno-epsilon
18225 Generate floating-point comparison instructions that compare with respect
18226 to the @code{rE} epsilon register.
18228 @item -mabi=mmixware
18229 @itemx -mabi=gnu
18230 @opindex mabi=mmixware
18231 @opindex mabi=gnu
18232 Generate code that passes function parameters and return values that (in
18233 the called function) are seen as registers @code{$0} and up, as opposed to
18234 the GNU ABI which uses global registers @code{$231} and up.
18236 @item -mzero-extend
18237 @itemx -mno-zero-extend
18238 @opindex mzero-extend
18239 @opindex mno-zero-extend
18240 When reading data from memory in sizes shorter than 64 bits, use (do not
18241 use) zero-extending load instructions by default, rather than
18242 sign-extending ones.
18244 @item -mknuthdiv
18245 @itemx -mno-knuthdiv
18246 @opindex mknuthdiv
18247 @opindex mno-knuthdiv
18248 Make the result of a division yielding a remainder have the same sign as
18249 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
18250 remainder follows the sign of the dividend.  Both methods are
18251 arithmetically valid, the latter being almost exclusively used.
18253 @item -mtoplevel-symbols
18254 @itemx -mno-toplevel-symbols
18255 @opindex mtoplevel-symbols
18256 @opindex mno-toplevel-symbols
18257 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
18258 code can be used with the @code{PREFIX} assembly directive.
18260 @item -melf
18261 @opindex melf
18262 Generate an executable in the ELF format, rather than the default
18263 @samp{mmo} format used by the @command{mmix} simulator.
18265 @item -mbranch-predict
18266 @itemx -mno-branch-predict
18267 @opindex mbranch-predict
18268 @opindex mno-branch-predict
18269 Use (do not use) the probable-branch instructions, when static branch
18270 prediction indicates a probable branch.
18272 @item -mbase-addresses
18273 @itemx -mno-base-addresses
18274 @opindex mbase-addresses
18275 @opindex mno-base-addresses
18276 Generate (do not generate) code that uses @emph{base addresses}.  Using a
18277 base address automatically generates a request (handled by the assembler
18278 and the linker) for a constant to be set up in a global register.  The
18279 register is used for one or more base address requests within the range 0
18280 to 255 from the value held in the register.  The generally leads to short
18281 and fast code, but the number of different data items that can be
18282 addressed is limited.  This means that a program that uses lots of static
18283 data may require @option{-mno-base-addresses}.
18285 @item -msingle-exit
18286 @itemx -mno-single-exit
18287 @opindex msingle-exit
18288 @opindex mno-single-exit
18289 Force (do not force) generated code to have a single exit point in each
18290 function.
18291 @end table
18293 @node MN10300 Options
18294 @subsection MN10300 Options
18295 @cindex MN10300 options
18297 These @option{-m} options are defined for Matsushita MN10300 architectures:
18299 @table @gcctabopt
18300 @item -mmult-bug
18301 @opindex mmult-bug
18302 Generate code to avoid bugs in the multiply instructions for the MN10300
18303 processors.  This is the default.
18305 @item -mno-mult-bug
18306 @opindex mno-mult-bug
18307 Do not generate code to avoid bugs in the multiply instructions for the
18308 MN10300 processors.
18310 @item -mam33
18311 @opindex mam33
18312 Generate code using features specific to the AM33 processor.
18314 @item -mno-am33
18315 @opindex mno-am33
18316 Do not generate code using features specific to the AM33 processor.  This
18317 is the default.
18319 @item -mam33-2
18320 @opindex mam33-2
18321 Generate code using features specific to the AM33/2.0 processor.
18323 @item -mam34
18324 @opindex mam34
18325 Generate code using features specific to the AM34 processor.
18327 @item -mtune=@var{cpu-type}
18328 @opindex mtune
18329 Use the timing characteristics of the indicated CPU type when
18330 scheduling instructions.  This does not change the targeted processor
18331 type.  The CPU type must be one of @samp{mn10300}, @samp{am33},
18332 @samp{am33-2} or @samp{am34}.
18334 @item -mreturn-pointer-on-d0
18335 @opindex mreturn-pointer-on-d0
18336 When generating a function that returns a pointer, return the pointer
18337 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
18338 only in @code{a0}, and attempts to call such functions without a prototype
18339 result in errors.  Note that this option is on by default; use
18340 @option{-mno-return-pointer-on-d0} to disable it.
18342 @item -mno-crt0
18343 @opindex mno-crt0
18344 Do not link in the C run-time initialization object file.
18346 @item -mrelax
18347 @opindex mrelax
18348 Indicate to the linker that it should perform a relaxation optimization pass
18349 to shorten branches, calls and absolute memory addresses.  This option only
18350 has an effect when used on the command line for the final link step.
18352 This option makes symbolic debugging impossible.
18354 @item -mliw
18355 @opindex mliw
18356 Allow the compiler to generate @emph{Long Instruction Word}
18357 instructions if the target is the @samp{AM33} or later.  This is the
18358 default.  This option defines the preprocessor macro @samp{__LIW__}.
18360 @item -mnoliw
18361 @opindex mnoliw
18362 Do not allow the compiler to generate @emph{Long Instruction Word}
18363 instructions.  This option defines the preprocessor macro
18364 @samp{__NO_LIW__}.
18366 @item -msetlb
18367 @opindex msetlb
18368 Allow the compiler to generate the @emph{SETLB} and @emph{Lcc}
18369 instructions if the target is the @samp{AM33} or later.  This is the
18370 default.  This option defines the preprocessor macro @samp{__SETLB__}.
18372 @item -mnosetlb
18373 @opindex mnosetlb
18374 Do not allow the compiler to generate @emph{SETLB} or @emph{Lcc}
18375 instructions.  This option defines the preprocessor macro
18376 @samp{__NO_SETLB__}.
18378 @end table
18380 @node Moxie Options
18381 @subsection Moxie Options
18382 @cindex Moxie Options
18384 @table @gcctabopt
18386 @item -meb
18387 @opindex meb
18388 Generate big-endian code.  This is the default for @samp{moxie-*-*}
18389 configurations.
18391 @item -mel
18392 @opindex mel
18393 Generate little-endian code.
18395 @item -mno-crt0
18396 @opindex mno-crt0
18397 Do not link in the C run-time initialization object file.
18399 @end table
18401 @node MSP430 Options
18402 @subsection MSP430 Options
18403 @cindex MSP430 Options
18405 These options are defined for the MSP430:
18407 @table @gcctabopt
18409 @item -masm-hex
18410 @opindex masm-hex
18411 Force assembly output to always use hex constants.  Normally such
18412 constants are signed decimals, but this option is available for
18413 testsuite and/or aesthetic purposes.
18415 @item -mmcu=
18416 @opindex mmcu=
18417 Select the MCU to target.  This is used to create a C preprocessor
18418 symbol based upon the MCU name, converted to upper case and pre- and
18419 post- fixed with @code{__}.  This in turn will be used by the
18420 @code{msp430.h} header file to select an MCU specific supplimentary
18421 header file.
18423 The option also sets the ISA to use.  If the MCU name is one that is
18424 known to only support the 430 ISA then that is selected, otherwise the
18425 430X ISA is selected.  A generic MCU name of @code{msp430} can also be
18426 used to select the 430 ISA.  Similarly the generic @code{msp430x} MCU
18427 name will select the 430X ISA.
18429 In addition an MCU specific linker script will be added to the linker
18430 command line.  The script's name is the name of the MCU with
18431 @code{.ld} appended.  Thus specifying @option{-mmcu=xxx} on the gcc
18432 command line will define the C preprocessor symbol @code{__XXX__} and
18433 cause the linker to search for a script called @file{xxx.ld}.
18435 This option is also passed on to the assembler.
18437 @item -mcpu=
18438 @opindex -mcpu=
18439 Specifies the ISA to use.  Accepted values are @code{msp430},
18440 @code{msp430x} and @code{msp430xv2}.  This option is deprecated.  The
18441 @option{-mmcu=} option should be used to select the ISA.
18443 @item -msim
18444 @opindex msim
18445 Link to the simulator runtime libraries and linker script.  Overrides
18446 any scripts that would be selected by the @option{-mmcu=} option.
18448 @item -mlarge
18449 @opindex mlarge
18450 Use large-model addressing (20-bit pointers, 32-bit @code{size_t}).
18452 @item -msmall
18453 @opindex msmall
18454 Use small-model addressing (16-bit pointers, 16-bit @code{size_t}).
18456 @item -mrelax
18457 @opindex mrelax
18458 This option is passed to the assembler and linker, and allows the
18459 linker to perform certain optimizations that cannot be done until
18460 the final link.
18462 @item mhwmult=
18463 @opindex mhwmult=
18464 Describes the type of hardware multiply supported by the target.
18465 Accepted values are @code{none} for no hardware multiply, @code{16bit}
18466 for the original 16-bit-only multiply supported by early MCUs.
18467 @code{32bit} for the 16/32-bit multiply supported by later MCUs and
18468 @code{f5series} for the 16/32-bit multiply supported by F5-series MCUs.
18469 A value of @code{auto} can also be given.  This tells GCC to deduce
18470 the hardware multiply support based upon the MCU name provided by the
18471 @option{-mmcu} option.  If no @option{-mmcu} option is specified then
18472 @code{32bit} hardware multiply support is assumed.  @code{auto} is the
18473 default setting.
18475 Hardware multiplies are normally performed by calling a library
18476 routine.  This saves space in the generated code.  When compiling at
18477 @code{-O3} or higher however the hardware multiplier is invoked
18478 inline.  This makes for bigger, but faster code.
18480 The hardware multiply routines disable interrupts whilst running and
18481 restore the previous interrupt state when they finish.  This makes
18482 them safe to use inside interrupt handlers as well as in normal code.
18484 @end table
18486 @node NDS32 Options
18487 @subsection NDS32 Options
18488 @cindex NDS32 Options
18490 These options are defined for NDS32 implementations:
18492 @table @gcctabopt
18494 @item -mbig-endian
18495 @opindex mbig-endian
18496 Generate code in big-endian mode.
18498 @item -mlittle-endian
18499 @opindex mlittle-endian
18500 Generate code in little-endian mode.
18502 @item -mreduced-regs
18503 @opindex mreduced-regs
18504 Use reduced-set registers for register allocation.
18506 @item -mfull-regs
18507 @opindex mfull-regs
18508 Use full-set registers for register allocation.
18510 @item -mcmov
18511 @opindex mcmov
18512 Generate conditional move instructions.
18514 @item -mno-cmov
18515 @opindex mno-cmov
18516 Do not generate conditional move instructions.
18518 @item -mperf-ext
18519 @opindex mperf-ext
18520 Generate performance extension instructions.
18522 @item -mno-perf-ext
18523 @opindex mno-perf-ext
18524 Do not generate performance extension instructions.
18526 @item -mv3push
18527 @opindex mv3push
18528 Generate v3 push25/pop25 instructions.
18530 @item -mno-v3push
18531 @opindex mno-v3push
18532 Do not generate v3 push25/pop25 instructions.
18534 @item -m16-bit
18535 @opindex m16-bit
18536 Generate 16-bit instructions.
18538 @item -mno-16-bit
18539 @opindex mno-16-bit
18540 Do not generate 16-bit instructions.
18542 @item -mgp-direct
18543 @opindex mgp-direct
18544 Generate GP base instructions directly.
18546 @item -mno-gp-direct
18547 @opindex mno-gp-direct
18548 Do no generate GP base instructions directly.
18550 @item -misr-vector-size=@var{num}
18551 @opindex misr-vector-size
18552 Specify the size of each interrupt vector, which must be 4 or 16.
18554 @item -mcache-block-size=@var{num}
18555 @opindex mcache-block-size
18556 Specify the size of each cache block,
18557 which must be a power of 2 between 4 and 512.
18559 @item -march=@var{arch}
18560 @opindex march
18561 Specify the name of the target architecture.
18563 @item -mforce-fp-as-gp
18564 @opindex mforce-fp-as-gp
18565 Prevent $fp being allocated during register allocation so that compiler
18566 is able to force performing fp-as-gp optimization.
18568 @item -mforbid-fp-as-gp
18569 @opindex mforbid-fp-as-gp
18570 Forbid using $fp to access static and global variables.
18571 This option strictly forbids fp-as-gp optimization
18572 regardless of @option{-mforce-fp-as-gp}.
18574 @item -mex9
18575 @opindex mex9
18576 Use special directives to guide linker doing ex9 optimization.
18578 @item -mctor-dtor
18579 @opindex mctor-dtor
18580 Enable constructor/destructor feature.
18582 @item -mrelax
18583 @opindex mrelax
18584 Guide linker to relax instructions.
18586 @end table
18588 @node Nios II Options
18589 @subsection Nios II Options
18590 @cindex Nios II options
18591 @cindex Altera Nios II options
18593 These are the options defined for the Altera Nios II processor.
18595 @table @gcctabopt
18597 @item -G @var{num}
18598 @opindex G
18599 @cindex smaller data references
18600 Put global and static objects less than or equal to @var{num} bytes
18601 into the small data or BSS sections instead of the normal data or BSS
18602 sections.  The default value of @var{num} is 8.
18604 @item -mgpopt
18605 @itemx -mno-gpopt
18606 @opindex mgpopt
18607 @opindex mno-gpopt
18608 Generate (do not generate) GP-relative accesses for objects in the
18609 small data or BSS sections.  The default is @option{-mgpopt} except
18610 when @option{-fpic} or @option{-fPIC} is specified to generate
18611 position-independent code.  Note that the Nios II ABI does not permit
18612 GP-relative accesses from shared libraries.
18614 You may need to specify @option{-mno-gpopt} explicitly when building
18615 programs that include large amounts of small data, including large
18616 GOT data sections.  In this case, the 16-bit offset for GP-relative
18617 addressing may not be large enough to allow access to the entire 
18618 small data section.
18620 @item -mel
18621 @itemx -meb
18622 @opindex mel
18623 @opindex meb
18624 Generate little-endian (default) or big-endian (experimental) code,
18625 respectively.
18627 @item -mbypass-cache
18628 @itemx -mno-bypass-cache
18629 @opindex mno-bypass-cache
18630 @opindex mbypass-cache
18631 Force all load and store instructions to always bypass cache by 
18632 using I/O variants of the instructions. The default is not to
18633 bypass the cache.
18635 @item -mno-cache-volatile 
18636 @itemx -mcache-volatile       
18637 @opindex mcache-volatile 
18638 @opindex mno-cache-volatile
18639 Volatile memory access bypass the cache using the I/O variants of 
18640 the load and store instructions. The default is not to bypass the cache.
18642 @item -mno-fast-sw-div
18643 @itemx -mfast-sw-div
18644 @opindex mno-fast-sw-div
18645 @opindex mfast-sw-div
18646 Do not use table-based fast divide for small numbers. The default 
18647 is to use the fast divide at @option{-O3} and above.
18649 @item -mno-hw-mul
18650 @itemx -mhw-mul
18651 @itemx -mno-hw-mulx
18652 @itemx -mhw-mulx
18653 @itemx -mno-hw-div
18654 @itemx -mhw-div
18655 @opindex mno-hw-mul
18656 @opindex mhw-mul
18657 @opindex mno-hw-mulx
18658 @opindex mhw-mulx
18659 @opindex mno-hw-div
18660 @opindex mhw-div
18661 Enable or disable emitting @code{mul}, @code{mulx} and @code{div} family of 
18662 instructions by the compiler. The default is to emit @code{mul}
18663 and not emit @code{div} and @code{mulx}.
18665 @item -mcustom-@var{insn}=@var{N}
18666 @itemx -mno-custom-@var{insn}
18667 @opindex mcustom-@var{insn}
18668 @opindex mno-custom-@var{insn}
18669 Each @option{-mcustom-@var{insn}=@var{N}} option enables use of a
18670 custom instruction with encoding @var{N} when generating code that uses 
18671 @var{insn}.  For example, @code{-mcustom-fadds=253} generates custom
18672 instruction 253 for single-precision floating-point add operations instead
18673 of the default behavior of using a library call.
18675 The following values of @var{insn} are supported.  Except as otherwise
18676 noted, floating-point operations are expected to be implemented with
18677 normal IEEE 754 semantics and correspond directly to the C operators or the
18678 equivalent GCC built-in functions (@pxref{Other Builtins}).
18680 Single-precision floating point:
18681 @table @asis
18683 @item @samp{fadds}, @samp{fsubs}, @samp{fdivs}, @samp{fmuls}
18684 Binary arithmetic operations.
18686 @item @samp{fnegs}
18687 Unary negation.
18689 @item @samp{fabss}
18690 Unary absolute value.
18692 @item @samp{fcmpeqs}, @samp{fcmpges}, @samp{fcmpgts}, @samp{fcmples}, @samp{fcmplts}, @samp{fcmpnes}
18693 Comparison operations.
18695 @item @samp{fmins}, @samp{fmaxs}
18696 Floating-point minimum and maximum.  These instructions are only
18697 generated if @option{-ffinite-math-only} is specified.
18699 @item @samp{fsqrts}
18700 Unary square root operation.
18702 @item @samp{fcoss}, @samp{fsins}, @samp{ftans}, @samp{fatans}, @samp{fexps}, @samp{flogs}
18703 Floating-point trigonometric and exponential functions.  These instructions
18704 are only generated if @option{-funsafe-math-optimizations} is also specified.
18706 @end table
18708 Double-precision floating point:
18709 @table @asis
18711 @item @samp{faddd}, @samp{fsubd}, @samp{fdivd}, @samp{fmuld}
18712 Binary arithmetic operations.
18714 @item @samp{fnegd}
18715 Unary negation.
18717 @item @samp{fabsd}
18718 Unary absolute value.
18720 @item @samp{fcmpeqd}, @samp{fcmpged}, @samp{fcmpgtd}, @samp{fcmpled}, @samp{fcmpltd}, @samp{fcmpned}
18721 Comparison operations.
18723 @item @samp{fmind}, @samp{fmaxd}
18724 Double-precision minimum and maximum.  These instructions are only
18725 generated if @option{-ffinite-math-only} is specified.
18727 @item @samp{fsqrtd}
18728 Unary square root operation.
18730 @item @samp{fcosd}, @samp{fsind}, @samp{ftand}, @samp{fatand}, @samp{fexpd}, @samp{flogd}
18731 Double-precision trigonometric and exponential functions.  These instructions
18732 are only generated if @option{-funsafe-math-optimizations} is also specified.
18734 @end table
18736 Conversions:
18737 @table @asis
18738 @item @samp{fextsd}
18739 Conversion from single precision to double precision.
18741 @item @samp{ftruncds}
18742 Conversion from double precision to single precision.
18744 @item @samp{fixsi}, @samp{fixsu}, @samp{fixdi}, @samp{fixdu}
18745 Conversion from floating point to signed or unsigned integer types, with
18746 truncation towards zero.
18748 @item @samp{round}
18749 Conversion from single-precision floating point to signed integer,
18750 rounding to the nearest integer and ties away from zero.
18751 This corresponds to the @code{__builtin_lroundf} function when
18752 @option{-fno-math-errno} is used.
18754 @item @samp{floatis}, @samp{floatus}, @samp{floatid}, @samp{floatud}
18755 Conversion from signed or unsigned integer types to floating-point types.
18757 @end table
18759 In addition, all of the following transfer instructions for internal
18760 registers X and Y must be provided to use any of the double-precision
18761 floating-point instructions.  Custom instructions taking two
18762 double-precision source operands expect the first operand in the
18763 64-bit register X.  The other operand (or only operand of a unary
18764 operation) is given to the custom arithmetic instruction with the
18765 least significant half in source register @var{src1} and the most
18766 significant half in @var{src2}.  A custom instruction that returns a
18767 double-precision result returns the most significant 32 bits in the
18768 destination register and the other half in 32-bit register Y.  
18769 GCC automatically generates the necessary code sequences to write
18770 register X and/or read register Y when double-precision floating-point
18771 instructions are used.
18773 @table @asis
18775 @item @samp{fwrx}
18776 Write @var{src1} into the least significant half of X and @var{src2} into
18777 the most significant half of X.
18779 @item @samp{fwry}
18780 Write @var{src1} into Y.
18782 @item @samp{frdxhi}, @samp{frdxlo}
18783 Read the most or least (respectively) significant half of X and store it in
18784 @var{dest}.
18786 @item @samp{frdy}
18787 Read the value of Y and store it into @var{dest}.
18788 @end table
18790 Note that you can gain more local control over generation of Nios II custom
18791 instructions by using the @code{target("custom-@var{insn}=@var{N}")}
18792 and @code{target("no-custom-@var{insn}")} function attributes
18793 (@pxref{Function Attributes})
18794 or pragmas (@pxref{Function Specific Option Pragmas}).
18796 @item -mcustom-fpu-cfg=@var{name}
18797 @opindex mcustom-fpu-cfg
18799 This option enables a predefined, named set of custom instruction encodings
18800 (see @option{-mcustom-@var{insn}} above).  
18801 Currently, the following sets are defined:
18803 @option{-mcustom-fpu-cfg=60-1} is equivalent to:
18804 @gccoptlist{-mcustom-fmuls=252 @gol
18805 -mcustom-fadds=253 @gol
18806 -mcustom-fsubs=254 @gol
18807 -fsingle-precision-constant}
18809 @option{-mcustom-fpu-cfg=60-2} is equivalent to:
18810 @gccoptlist{-mcustom-fmuls=252 @gol
18811 -mcustom-fadds=253 @gol
18812 -mcustom-fsubs=254 @gol
18813 -mcustom-fdivs=255 @gol
18814 -fsingle-precision-constant}
18816 @option{-mcustom-fpu-cfg=72-3} is equivalent to:
18817 @gccoptlist{-mcustom-floatus=243 @gol
18818 -mcustom-fixsi=244 @gol
18819 -mcustom-floatis=245 @gol
18820 -mcustom-fcmpgts=246 @gol
18821 -mcustom-fcmples=249 @gol
18822 -mcustom-fcmpeqs=250 @gol
18823 -mcustom-fcmpnes=251 @gol
18824 -mcustom-fmuls=252 @gol
18825 -mcustom-fadds=253 @gol
18826 -mcustom-fsubs=254 @gol
18827 -mcustom-fdivs=255 @gol
18828 -fsingle-precision-constant}
18830 Custom instruction assignments given by individual
18831 @option{-mcustom-@var{insn}=} options override those given by
18832 @option{-mcustom-fpu-cfg=}, regardless of the
18833 order of the options on the command line.
18835 Note that you can gain more local control over selection of a FPU
18836 configuration by using the @code{target("custom-fpu-cfg=@var{name}")}
18837 function attribute (@pxref{Function Attributes})
18838 or pragma (@pxref{Function Specific Option Pragmas}).
18840 @end table
18842 These additional @samp{-m} options are available for the Altera Nios II
18843 ELF (bare-metal) target:
18845 @table @gcctabopt
18847 @item -mhal
18848 @opindex mhal
18849 Link with HAL BSP.  This suppresses linking with the GCC-provided C runtime
18850 startup and termination code, and is typically used in conjunction with
18851 @option{-msys-crt0=} to specify the location of the alternate startup code
18852 provided by the HAL BSP.
18854 @item -msmallc
18855 @opindex msmallc
18856 Link with a limited version of the C library, @option{-lsmallc}, rather than
18857 Newlib.
18859 @item -msys-crt0=@var{startfile}
18860 @opindex msys-crt0
18861 @var{startfile} is the file name of the startfile (crt0) to use 
18862 when linking.  This option is only useful in conjunction with @option{-mhal}.
18864 @item -msys-lib=@var{systemlib}
18865 @opindex msys-lib
18866 @var{systemlib} is the library name of the library that provides
18867 low-level system calls required by the C library,
18868 e.g. @code{read} and @code{write}.
18869 This option is typically used to link with a library provided by a HAL BSP.
18871 @end table
18873 @node PDP-11 Options
18874 @subsection PDP-11 Options
18875 @cindex PDP-11 Options
18877 These options are defined for the PDP-11:
18879 @table @gcctabopt
18880 @item -mfpu
18881 @opindex mfpu
18882 Use hardware FPP floating point.  This is the default.  (FIS floating
18883 point on the PDP-11/40 is not supported.)
18885 @item -msoft-float
18886 @opindex msoft-float
18887 Do not use hardware floating point.
18889 @item -mac0
18890 @opindex mac0
18891 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
18893 @item -mno-ac0
18894 @opindex mno-ac0
18895 Return floating-point results in memory.  This is the default.
18897 @item -m40
18898 @opindex m40
18899 Generate code for a PDP-11/40.
18901 @item -m45
18902 @opindex m45
18903 Generate code for a PDP-11/45.  This is the default.
18905 @item -m10
18906 @opindex m10
18907 Generate code for a PDP-11/10.
18909 @item -mbcopy-builtin
18910 @opindex mbcopy-builtin
18911 Use inline @code{movmemhi} patterns for copying memory.  This is the
18912 default.
18914 @item -mbcopy
18915 @opindex mbcopy
18916 Do not use inline @code{movmemhi} patterns for copying memory.
18918 @item -mint16
18919 @itemx -mno-int32
18920 @opindex mint16
18921 @opindex mno-int32
18922 Use 16-bit @code{int}.  This is the default.
18924 @item -mint32
18925 @itemx -mno-int16
18926 @opindex mint32
18927 @opindex mno-int16
18928 Use 32-bit @code{int}.
18930 @item -mfloat64
18931 @itemx -mno-float32
18932 @opindex mfloat64
18933 @opindex mno-float32
18934 Use 64-bit @code{float}.  This is the default.
18936 @item -mfloat32
18937 @itemx -mno-float64
18938 @opindex mfloat32
18939 @opindex mno-float64
18940 Use 32-bit @code{float}.
18942 @item -mabshi
18943 @opindex mabshi
18944 Use @code{abshi2} pattern.  This is the default.
18946 @item -mno-abshi
18947 @opindex mno-abshi
18948 Do not use @code{abshi2} pattern.
18950 @item -mbranch-expensive
18951 @opindex mbranch-expensive
18952 Pretend that branches are expensive.  This is for experimenting with
18953 code generation only.
18955 @item -mbranch-cheap
18956 @opindex mbranch-cheap
18957 Do not pretend that branches are expensive.  This is the default.
18959 @item -munix-asm
18960 @opindex munix-asm
18961 Use Unix assembler syntax.  This is the default when configured for
18962 @samp{pdp11-*-bsd}.
18964 @item -mdec-asm
18965 @opindex mdec-asm
18966 Use DEC assembler syntax.  This is the default when configured for any
18967 PDP-11 target other than @samp{pdp11-*-bsd}.
18968 @end table
18970 @node picoChip Options
18971 @subsection picoChip Options
18972 @cindex picoChip options
18974 These @samp{-m} options are defined for picoChip implementations:
18976 @table @gcctabopt
18978 @item -mae=@var{ae_type}
18979 @opindex mcpu
18980 Set the instruction set, register set, and instruction scheduling
18981 parameters for array element type @var{ae_type}.  Supported values
18982 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
18984 @option{-mae=ANY} selects a completely generic AE type.  Code
18985 generated with this option runs on any of the other AE types.  The
18986 code is not as efficient as it would be if compiled for a specific
18987 AE type, and some types of operation (e.g., multiplication) do not
18988 work properly on all types of AE.
18990 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
18991 for compiled code, and is the default.
18993 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
18994 option may suffer from poor performance of byte (char) manipulation,
18995 since the DSP AE does not provide hardware support for byte load/stores.
18997 @item -msymbol-as-address
18998 Enable the compiler to directly use a symbol name as an address in a
18999 load/store instruction, without first loading it into a
19000 register.  Typically, the use of this option generates larger
19001 programs, which run faster than when the option isn't used.  However, the
19002 results vary from program to program, so it is left as a user option,
19003 rather than being permanently enabled.
19005 @item -mno-inefficient-warnings
19006 Disables warnings about the generation of inefficient code.  These
19007 warnings can be generated, for example, when compiling code that
19008 performs byte-level memory operations on the MAC AE type.  The MAC AE has
19009 no hardware support for byte-level memory operations, so all byte
19010 load/stores must be synthesized from word load/store operations.  This is
19011 inefficient and a warning is generated to indicate
19012 that you should rewrite the code to avoid byte operations, or to target
19013 an AE type that has the necessary hardware support.  This option disables
19014 these warnings.
19016 @end table
19018 @node PowerPC Options
19019 @subsection PowerPC Options
19020 @cindex PowerPC options
19022 These are listed under @xref{RS/6000 and PowerPC Options}.
19024 @node RL78 Options
19025 @subsection RL78 Options
19026 @cindex RL78 Options
19028 @table @gcctabopt
19030 @item -msim
19031 @opindex msim
19032 Links in additional target libraries to support operation within a
19033 simulator.
19035 @item -mmul=none
19036 @itemx -mmul=g13
19037 @itemx -mmul=rl78
19038 @opindex mmul
19039 Specifies the type of hardware multiplication support to be used.  The
19040 default is @code{none}, which uses software multiplication functions.
19041 The @code{g13} option is for the hardware multiply/divide peripheral
19042 only on the RL78/G13 targets.  The @code{rl78} option is for the
19043 standard hardware multiplication defined in the RL78 software manual.
19045 @item -m64bit-doubles
19046 @itemx -m32bit-doubles
19047 @opindex m64bit-doubles
19048 @opindex m32bit-doubles
19049 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
19050 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
19051 @option{-m32bit-doubles}.
19053 @end table
19055 @node RS/6000 and PowerPC Options
19056 @subsection IBM RS/6000 and PowerPC Options
19057 @cindex RS/6000 and PowerPC Options
19058 @cindex IBM RS/6000 and PowerPC Options
19060 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
19061 @table @gcctabopt
19062 @item -mpowerpc-gpopt
19063 @itemx -mno-powerpc-gpopt
19064 @itemx -mpowerpc-gfxopt
19065 @itemx -mno-powerpc-gfxopt
19066 @need 800
19067 @itemx -mpowerpc64
19068 @itemx -mno-powerpc64
19069 @itemx -mmfcrf
19070 @itemx -mno-mfcrf
19071 @itemx -mpopcntb
19072 @itemx -mno-popcntb
19073 @itemx -mpopcntd
19074 @itemx -mno-popcntd
19075 @itemx -mfprnd
19076 @itemx -mno-fprnd
19077 @need 800
19078 @itemx -mcmpb
19079 @itemx -mno-cmpb
19080 @itemx -mmfpgpr
19081 @itemx -mno-mfpgpr
19082 @itemx -mhard-dfp
19083 @itemx -mno-hard-dfp
19084 @opindex mpowerpc-gpopt
19085 @opindex mno-powerpc-gpopt
19086 @opindex mpowerpc-gfxopt
19087 @opindex mno-powerpc-gfxopt
19088 @opindex mpowerpc64
19089 @opindex mno-powerpc64
19090 @opindex mmfcrf
19091 @opindex mno-mfcrf
19092 @opindex mpopcntb
19093 @opindex mno-popcntb
19094 @opindex mpopcntd
19095 @opindex mno-popcntd
19096 @opindex mfprnd
19097 @opindex mno-fprnd
19098 @opindex mcmpb
19099 @opindex mno-cmpb
19100 @opindex mmfpgpr
19101 @opindex mno-mfpgpr
19102 @opindex mhard-dfp
19103 @opindex mno-hard-dfp
19104 You use these options to specify which instructions are available on the
19105 processor you are using.  The default value of these options is
19106 determined when configuring GCC@.  Specifying the
19107 @option{-mcpu=@var{cpu_type}} overrides the specification of these
19108 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
19109 rather than the options listed above.
19111 Specifying @option{-mpowerpc-gpopt} allows
19112 GCC to use the optional PowerPC architecture instructions in the
19113 General Purpose group, including floating-point square root.  Specifying
19114 @option{-mpowerpc-gfxopt} allows GCC to
19115 use the optional PowerPC architecture instructions in the Graphics
19116 group, including floating-point select.
19118 The @option{-mmfcrf} option allows GCC to generate the move from
19119 condition register field instruction implemented on the POWER4
19120 processor and other processors that support the PowerPC V2.01
19121 architecture.
19122 The @option{-mpopcntb} option allows GCC to generate the popcount and
19123 double-precision FP reciprocal estimate instruction implemented on the
19124 POWER5 processor and other processors that support the PowerPC V2.02
19125 architecture.
19126 The @option{-mpopcntd} option allows GCC to generate the popcount
19127 instruction implemented on the POWER7 processor and other processors
19128 that support the PowerPC V2.06 architecture.
19129 The @option{-mfprnd} option allows GCC to generate the FP round to
19130 integer instructions implemented on the POWER5+ processor and other
19131 processors that support the PowerPC V2.03 architecture.
19132 The @option{-mcmpb} option allows GCC to generate the compare bytes
19133 instruction implemented on the POWER6 processor and other processors
19134 that support the PowerPC V2.05 architecture.
19135 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
19136 general-purpose register instructions implemented on the POWER6X
19137 processor and other processors that support the extended PowerPC V2.05
19138 architecture.
19139 The @option{-mhard-dfp} option allows GCC to generate the decimal
19140 floating-point instructions implemented on some POWER processors.
19142 The @option{-mpowerpc64} option allows GCC to generate the additional
19143 64-bit instructions that are found in the full PowerPC64 architecture
19144 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
19145 @option{-mno-powerpc64}.
19147 @item -mcpu=@var{cpu_type}
19148 @opindex mcpu
19149 Set architecture type, register usage, and
19150 instruction scheduling parameters for machine type @var{cpu_type}.
19151 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
19152 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
19153 @samp{476}, @samp{476fp}, @samp{505}, @samp{601}, @samp{602}, @samp{603},
19154 @samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{630}, @samp{740},
19155 @samp{7400}, @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
19156 @samp{860}, @samp{970}, @samp{8540}, @samp{a2}, @samp{e300c2},
19157 @samp{e300c3}, @samp{e500mc}, @samp{e500mc64}, @samp{e5500},
19158 @samp{e6500}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5},
19159 @samp{titan}, @samp{power3}, @samp{power4}, @samp{power5}, @samp{power5+},
19160 @samp{power6}, @samp{power6x}, @samp{power7}, @samp{power8}, @samp{powerpc},
19161 @samp{powerpc64}, and @samp{rs64}.
19163 @option{-mcpu=powerpc}, and @option{-mcpu=powerpc64} specify pure 32-bit
19164 PowerPC and 64-bit PowerPC architecture machine
19165 types, with an appropriate, generic processor model assumed for
19166 scheduling purposes.
19168 The other options specify a specific processor.  Code generated under
19169 those options runs best on that processor, and may not run at all on
19170 others.
19172 The @option{-mcpu} options automatically enable or disable the
19173 following options:
19175 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
19176 -mpopcntb -mpopcntd  -mpowerpc64 @gol
19177 -mpowerpc-gpopt  -mpowerpc-gfxopt  -msingle-float -mdouble-float @gol
19178 -msimple-fpu -mstring  -mmulhw  -mdlmzb  -mmfpgpr -mvsx @gol
19179 -mcrypto -mdirect-move -mpower8-fusion -mpower8-vector @gol
19180 -mquad-memory -mquad-memory-atomic}
19182 The particular options set for any particular CPU varies between
19183 compiler versions, depending on what setting seems to produce optimal
19184 code for that CPU; it doesn't necessarily reflect the actual hardware's
19185 capabilities.  If you wish to set an individual option to a particular
19186 value, you may specify it after the @option{-mcpu} option, like
19187 @option{-mcpu=970 -mno-altivec}.
19189 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
19190 not enabled or disabled by the @option{-mcpu} option at present because
19191 AIX does not have full support for these options.  You may still
19192 enable or disable them individually if you're sure it'll work in your
19193 environment.
19195 @item -mtune=@var{cpu_type}
19196 @opindex mtune
19197 Set the instruction scheduling parameters for machine type
19198 @var{cpu_type}, but do not set the architecture type or register usage,
19199 as @option{-mcpu=@var{cpu_type}} does.  The same
19200 values for @var{cpu_type} are used for @option{-mtune} as for
19201 @option{-mcpu}.  If both are specified, the code generated uses the
19202 architecture and registers set by @option{-mcpu}, but the
19203 scheduling parameters set by @option{-mtune}.
19205 @item -mcmodel=small
19206 @opindex mcmodel=small
19207 Generate PowerPC64 code for the small model: The TOC is limited to
19208 64k.
19210 @item -mcmodel=medium
19211 @opindex mcmodel=medium
19212 Generate PowerPC64 code for the medium model: The TOC and other static
19213 data may be up to a total of 4G in size.
19215 @item -mcmodel=large
19216 @opindex mcmodel=large
19217 Generate PowerPC64 code for the large model: The TOC may be up to 4G
19218 in size.  Other data and code is only limited by the 64-bit address
19219 space.
19221 @item -maltivec
19222 @itemx -mno-altivec
19223 @opindex maltivec
19224 @opindex mno-altivec
19225 Generate code that uses (does not use) AltiVec instructions, and also
19226 enable the use of built-in functions that allow more direct access to
19227 the AltiVec instruction set.  You may also need to set
19228 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
19229 enhancements.
19231 When @option{-maltivec} is used, rather than @option{-maltivec=le} or
19232 @option{-maltivec=be}, the element order for Altivec intrinsics such
19233 as @code{vec_splat}, @code{vec_extract}, and @code{vec_insert} will
19234 match array element order corresponding to the endianness of the
19235 target.  That is, element zero identifies the leftmost element in a
19236 vector register when targeting a big-endian platform, and identifies
19237 the rightmost element in a vector register when targeting a
19238 little-endian platform.
19240 @item -maltivec=be
19241 @opindex maltivec=be
19242 Generate Altivec instructions using big-endian element order,
19243 regardless of whether the target is big- or little-endian.  This is
19244 the default when targeting a big-endian platform.
19246 The element order is used to interpret element numbers in Altivec
19247 intrinsics such as @code{vec_splat}, @code{vec_extract}, and
19248 @code{vec_insert}.  By default, these will match array element order
19249 corresponding to the endianness for the target.
19251 @item -maltivec=le
19252 @opindex maltivec=le
19253 Generate Altivec instructions using little-endian element order,
19254 regardless of whether the target is big- or little-endian.  This is
19255 the default when targeting a little-endian platform.  This option is
19256 currently ignored when targeting a big-endian platform.
19258 The element order is used to interpret element numbers in Altivec
19259 intrinsics such as @code{vec_splat}, @code{vec_extract}, and
19260 @code{vec_insert}.  By default, these will match array element order
19261 corresponding to the endianness for the target.
19263 @item -mvrsave
19264 @itemx -mno-vrsave
19265 @opindex mvrsave
19266 @opindex mno-vrsave
19267 Generate VRSAVE instructions when generating AltiVec code.
19269 @item -mgen-cell-microcode
19270 @opindex mgen-cell-microcode
19271 Generate Cell microcode instructions.
19273 @item -mwarn-cell-microcode
19274 @opindex mwarn-cell-microcode
19275 Warn when a Cell microcode instruction is emitted.  An example
19276 of a Cell microcode instruction is a variable shift.
19278 @item -msecure-plt
19279 @opindex msecure-plt
19280 Generate code that allows @command{ld} and @command{ld.so}
19281 to build executables and shared
19282 libraries with non-executable @code{.plt} and @code{.got} sections.
19283 This is a PowerPC
19284 32-bit SYSV ABI option.
19286 @item -mbss-plt
19287 @opindex mbss-plt
19288 Generate code that uses a BSS @code{.plt} section that @command{ld.so}
19289 fills in, and
19290 requires @code{.plt} and @code{.got}
19291 sections that are both writable and executable.
19292 This is a PowerPC 32-bit SYSV ABI option.
19294 @item -misel
19295 @itemx -mno-isel
19296 @opindex misel
19297 @opindex mno-isel
19298 This switch enables or disables the generation of ISEL instructions.
19300 @item -misel=@var{yes/no}
19301 This switch has been deprecated.  Use @option{-misel} and
19302 @option{-mno-isel} instead.
19304 @item -mspe
19305 @itemx -mno-spe
19306 @opindex mspe
19307 @opindex mno-spe
19308 This switch enables or disables the generation of SPE simd
19309 instructions.
19311 @item -mpaired
19312 @itemx -mno-paired
19313 @opindex mpaired
19314 @opindex mno-paired
19315 This switch enables or disables the generation of PAIRED simd
19316 instructions.
19318 @item -mspe=@var{yes/no}
19319 This option has been deprecated.  Use @option{-mspe} and
19320 @option{-mno-spe} instead.
19322 @item -mvsx
19323 @itemx -mno-vsx
19324 @opindex mvsx
19325 @opindex mno-vsx
19326 Generate code that uses (does not use) vector/scalar (VSX)
19327 instructions, and also enable the use of built-in functions that allow
19328 more direct access to the VSX instruction set.
19330 @item -mcrypto
19331 @itemx -mno-crypto
19332 @opindex mcrypto
19333 @opindex mno-crypto
19334 Enable the use (disable) of the built-in functions that allow direct
19335 access to the cryptographic instructions that were added in version
19336 2.07 of the PowerPC ISA.
19338 @item -mdirect-move
19339 @itemx -mno-direct-move
19340 @opindex mdirect-move
19341 @opindex mno-direct-move
19342 Generate code that uses (does not use) the instructions to move data
19343 between the general purpose registers and the vector/scalar (VSX)
19344 registers that were added in version 2.07 of the PowerPC ISA.
19346 @item -mpower8-fusion
19347 @itemx -mno-power8-fusion
19348 @opindex mpower8-fusion
19349 @opindex mno-power8-fusion
19350 Generate code that keeps (does not keeps) some integer operations
19351 adjacent so that the instructions can be fused together on power8 and
19352 later processors.
19354 @item -mpower8-vector
19355 @itemx -mno-power8-vector
19356 @opindex mpower8-vector
19357 @opindex mno-power8-vector
19358 Generate code that uses (does not use) the vector and scalar
19359 instructions that were added in version 2.07 of the PowerPC ISA.  Also
19360 enable the use of built-in functions that allow more direct access to
19361 the vector instructions.
19363 @item -mquad-memory
19364 @itemx -mno-quad-memory
19365 @opindex mquad-memory
19366 @opindex mno-quad-memory
19367 Generate code that uses (does not use) the non-atomic quad word memory
19368 instructions.  The @option{-mquad-memory} option requires use of
19369 64-bit mode.
19371 @item -mquad-memory-atomic
19372 @itemx -mno-quad-memory-atomic
19373 @opindex mquad-memory-atomic
19374 @opindex mno-quad-memory-atomic
19375 Generate code that uses (does not use) the atomic quad word memory
19376 instructions.  The @option{-mquad-memory-atomic} option requires use of
19377 64-bit mode.
19379 @item -mfloat-gprs=@var{yes/single/double/no}
19380 @itemx -mfloat-gprs
19381 @opindex mfloat-gprs
19382 This switch enables or disables the generation of floating-point
19383 operations on the general-purpose registers for architectures that
19384 support it.
19386 The argument @var{yes} or @var{single} enables the use of
19387 single-precision floating-point operations.
19389 The argument @var{double} enables the use of single and
19390 double-precision floating-point operations.
19392 The argument @var{no} disables floating-point operations on the
19393 general-purpose registers.
19395 This option is currently only available on the MPC854x.
19397 @item -m32
19398 @itemx -m64
19399 @opindex m32
19400 @opindex m64
19401 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
19402 targets (including GNU/Linux).  The 32-bit environment sets int, long
19403 and pointer to 32 bits and generates code that runs on any PowerPC
19404 variant.  The 64-bit environment sets int to 32 bits and long and
19405 pointer to 64 bits, and generates code for PowerPC64, as for
19406 @option{-mpowerpc64}.
19408 @item -mfull-toc
19409 @itemx -mno-fp-in-toc
19410 @itemx -mno-sum-in-toc
19411 @itemx -mminimal-toc
19412 @opindex mfull-toc
19413 @opindex mno-fp-in-toc
19414 @opindex mno-sum-in-toc
19415 @opindex mminimal-toc
19416 Modify generation of the TOC (Table Of Contents), which is created for
19417 every executable file.  The @option{-mfull-toc} option is selected by
19418 default.  In that case, GCC allocates at least one TOC entry for
19419 each unique non-automatic variable reference in your program.  GCC
19420 also places floating-point constants in the TOC@.  However, only
19421 16,384 entries are available in the TOC@.
19423 If you receive a linker error message that saying you have overflowed
19424 the available TOC space, you can reduce the amount of TOC space used
19425 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
19426 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
19427 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
19428 generate code to calculate the sum of an address and a constant at
19429 run time instead of putting that sum into the TOC@.  You may specify one
19430 or both of these options.  Each causes GCC to produce very slightly
19431 slower and larger code at the expense of conserving TOC space.
19433 If you still run out of space in the TOC even when you specify both of
19434 these options, specify @option{-mminimal-toc} instead.  This option causes
19435 GCC to make only one TOC entry for every file.  When you specify this
19436 option, GCC produces code that is slower and larger but which
19437 uses extremely little TOC space.  You may wish to use this option
19438 only on files that contain less frequently-executed code.
19440 @item -maix64
19441 @itemx -maix32
19442 @opindex maix64
19443 @opindex maix32
19444 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
19445 @code{long} type, and the infrastructure needed to support them.
19446 Specifying @option{-maix64} implies @option{-mpowerpc64},
19447 while @option{-maix32} disables the 64-bit ABI and
19448 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
19450 @item -mxl-compat
19451 @itemx -mno-xl-compat
19452 @opindex mxl-compat
19453 @opindex mno-xl-compat
19454 Produce code that conforms more closely to IBM XL compiler semantics
19455 when using AIX-compatible ABI@.  Pass floating-point arguments to
19456 prototyped functions beyond the register save area (RSA) on the stack
19457 in addition to argument FPRs.  Do not assume that most significant
19458 double in 128-bit long double value is properly rounded when comparing
19459 values and converting to double.  Use XL symbol names for long double
19460 support routines.
19462 The AIX calling convention was extended but not initially documented to
19463 handle an obscure K&R C case of calling a function that takes the
19464 address of its arguments with fewer arguments than declared.  IBM XL
19465 compilers access floating-point arguments that do not fit in the
19466 RSA from the stack when a subroutine is compiled without
19467 optimization.  Because always storing floating-point arguments on the
19468 stack is inefficient and rarely needed, this option is not enabled by
19469 default and only is necessary when calling subroutines compiled by IBM
19470 XL compilers without optimization.
19472 @item -mpe
19473 @opindex mpe
19474 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
19475 application written to use message passing with special startup code to
19476 enable the application to run.  The system must have PE installed in the
19477 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
19478 must be overridden with the @option{-specs=} option to specify the
19479 appropriate directory location.  The Parallel Environment does not
19480 support threads, so the @option{-mpe} option and the @option{-pthread}
19481 option are incompatible.
19483 @item -malign-natural
19484 @itemx -malign-power
19485 @opindex malign-natural
19486 @opindex malign-power
19487 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
19488 @option{-malign-natural} overrides the ABI-defined alignment of larger
19489 types, such as floating-point doubles, on their natural size-based boundary.
19490 The option @option{-malign-power} instructs GCC to follow the ABI-specified
19491 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
19493 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
19494 is not supported.
19496 @item -msoft-float
19497 @itemx -mhard-float
19498 @opindex msoft-float
19499 @opindex mhard-float
19500 Generate code that does not use (uses) the floating-point register set.
19501 Software floating-point emulation is provided if you use the
19502 @option{-msoft-float} option, and pass the option to GCC when linking.
19504 @item -msingle-float
19505 @itemx -mdouble-float
19506 @opindex msingle-float
19507 @opindex mdouble-float
19508 Generate code for single- or double-precision floating-point operations.
19509 @option{-mdouble-float} implies @option{-msingle-float}.
19511 @item -msimple-fpu
19512 @opindex msimple-fpu
19513 Do not generate @code{sqrt} and @code{div} instructions for hardware
19514 floating-point unit.
19516 @item -mfpu=@var{name}
19517 @opindex mfpu
19518 Specify type of floating-point unit.  Valid values for @var{name} are
19519 @samp{sp_lite} (equivalent to @option{-msingle-float -msimple-fpu}),
19520 @samp{dp_lite} (equivalent to @option{-mdouble-float -msimple-fpu}),
19521 @samp{sp_full} (equivalent to @option{-msingle-float}),
19522 and @samp{dp_full} (equivalent to @option{-mdouble-float}).
19524 @item -mxilinx-fpu
19525 @opindex mxilinx-fpu
19526 Perform optimizations for the floating-point unit on Xilinx PPC 405/440.
19528 @item -mmultiple
19529 @itemx -mno-multiple
19530 @opindex mmultiple
19531 @opindex mno-multiple
19532 Generate code that uses (does not use) the load multiple word
19533 instructions and the store multiple word instructions.  These
19534 instructions are generated by default on POWER systems, and not
19535 generated on PowerPC systems.  Do not use @option{-mmultiple} on little-endian
19536 PowerPC systems, since those instructions do not work when the
19537 processor is in little-endian mode.  The exceptions are PPC740 and
19538 PPC750 which permit these instructions in little-endian mode.
19540 @item -mstring
19541 @itemx -mno-string
19542 @opindex mstring
19543 @opindex mno-string
19544 Generate code that uses (does not use) the load string instructions
19545 and the store string word instructions to save multiple registers and
19546 do small block moves.  These instructions are generated by default on
19547 POWER systems, and not generated on PowerPC systems.  Do not use
19548 @option{-mstring} on little-endian PowerPC systems, since those
19549 instructions do not work when the processor is in little-endian mode.
19550 The exceptions are PPC740 and PPC750 which permit these instructions
19551 in little-endian mode.
19553 @item -mupdate
19554 @itemx -mno-update
19555 @opindex mupdate
19556 @opindex mno-update
19557 Generate code that uses (does not use) the load or store instructions
19558 that update the base register to the address of the calculated memory
19559 location.  These instructions are generated by default.  If you use
19560 @option{-mno-update}, there is a small window between the time that the
19561 stack pointer is updated and the address of the previous frame is
19562 stored, which means code that walks the stack frame across interrupts or
19563 signals may get corrupted data.
19565 @item -mavoid-indexed-addresses
19566 @itemx -mno-avoid-indexed-addresses
19567 @opindex mavoid-indexed-addresses
19568 @opindex mno-avoid-indexed-addresses
19569 Generate code that tries to avoid (not avoid) the use of indexed load
19570 or store instructions. These instructions can incur a performance
19571 penalty on Power6 processors in certain situations, such as when
19572 stepping through large arrays that cross a 16M boundary.  This option
19573 is enabled by default when targeting Power6 and disabled otherwise.
19575 @item -mfused-madd
19576 @itemx -mno-fused-madd
19577 @opindex mfused-madd
19578 @opindex mno-fused-madd
19579 Generate code that uses (does not use) the floating-point multiply and
19580 accumulate instructions.  These instructions are generated by default
19581 if hardware floating point is used.  The machine-dependent
19582 @option{-mfused-madd} option is now mapped to the machine-independent
19583 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
19584 mapped to @option{-ffp-contract=off}.
19586 @item -mmulhw
19587 @itemx -mno-mulhw
19588 @opindex mmulhw
19589 @opindex mno-mulhw
19590 Generate code that uses (does not use) the half-word multiply and
19591 multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors.
19592 These instructions are generated by default when targeting those
19593 processors.
19595 @item -mdlmzb
19596 @itemx -mno-dlmzb
19597 @opindex mdlmzb
19598 @opindex mno-dlmzb
19599 Generate code that uses (does not use) the string-search @samp{dlmzb}
19600 instruction on the IBM 405, 440, 464 and 476 processors.  This instruction is
19601 generated by default when targeting those processors.
19603 @item -mno-bit-align
19604 @itemx -mbit-align
19605 @opindex mno-bit-align
19606 @opindex mbit-align
19607 On System V.4 and embedded PowerPC systems do not (do) force structures
19608 and unions that contain bit-fields to be aligned to the base type of the
19609 bit-field.
19611 For example, by default a structure containing nothing but 8
19612 @code{unsigned} bit-fields of length 1 is aligned to a 4-byte
19613 boundary and has a size of 4 bytes.  By using @option{-mno-bit-align},
19614 the structure is aligned to a 1-byte boundary and is 1 byte in
19615 size.
19617 @item -mno-strict-align
19618 @itemx -mstrict-align
19619 @opindex mno-strict-align
19620 @opindex mstrict-align
19621 On System V.4 and embedded PowerPC systems do not (do) assume that
19622 unaligned memory references are handled by the system.
19624 @item -mrelocatable
19625 @itemx -mno-relocatable
19626 @opindex mrelocatable
19627 @opindex mno-relocatable
19628 Generate code that allows (does not allow) a static executable to be
19629 relocated to a different address at run time.  A simple embedded
19630 PowerPC system loader should relocate the entire contents of
19631 @code{.got2} and 4-byte locations listed in the @code{.fixup} section,
19632 a table of 32-bit addresses generated by this option.  For this to
19633 work, all objects linked together must be compiled with
19634 @option{-mrelocatable} or @option{-mrelocatable-lib}.
19635 @option{-mrelocatable} code aligns the stack to an 8-byte boundary.
19637 @item -mrelocatable-lib
19638 @itemx -mno-relocatable-lib
19639 @opindex mrelocatable-lib
19640 @opindex mno-relocatable-lib
19641 Like @option{-mrelocatable}, @option{-mrelocatable-lib} generates a
19642 @code{.fixup} section to allow static executables to be relocated at
19643 run time, but @option{-mrelocatable-lib} does not use the smaller stack
19644 alignment of @option{-mrelocatable}.  Objects compiled with
19645 @option{-mrelocatable-lib} may be linked with objects compiled with
19646 any combination of the @option{-mrelocatable} options.
19648 @item -mno-toc
19649 @itemx -mtoc
19650 @opindex mno-toc
19651 @opindex mtoc
19652 On System V.4 and embedded PowerPC systems do not (do) assume that
19653 register 2 contains a pointer to a global area pointing to the addresses
19654 used in the program.
19656 @item -mlittle
19657 @itemx -mlittle-endian
19658 @opindex mlittle
19659 @opindex mlittle-endian
19660 On System V.4 and embedded PowerPC systems compile code for the
19661 processor in little-endian mode.  The @option{-mlittle-endian} option is
19662 the same as @option{-mlittle}.
19664 @item -mbig
19665 @itemx -mbig-endian
19666 @opindex mbig
19667 @opindex mbig-endian
19668 On System V.4 and embedded PowerPC systems compile code for the
19669 processor in big-endian mode.  The @option{-mbig-endian} option is
19670 the same as @option{-mbig}.
19672 @item -mdynamic-no-pic
19673 @opindex mdynamic-no-pic
19674 On Darwin and Mac OS X systems, compile code so that it is not
19675 relocatable, but that its external references are relocatable.  The
19676 resulting code is suitable for applications, but not shared
19677 libraries.
19679 @item -msingle-pic-base
19680 @opindex msingle-pic-base
19681 Treat the register used for PIC addressing as read-only, rather than
19682 loading it in the prologue for each function.  The runtime system is
19683 responsible for initializing this register with an appropriate value
19684 before execution begins.
19686 @item -mprioritize-restricted-insns=@var{priority}
19687 @opindex mprioritize-restricted-insns
19688 This option controls the priority that is assigned to
19689 dispatch-slot restricted instructions during the second scheduling
19690 pass.  The argument @var{priority} takes the value @samp{0}, @samp{1},
19691 or @samp{2} to assign no, highest, or second-highest (respectively) 
19692 priority to dispatch-slot restricted
19693 instructions.
19695 @item -msched-costly-dep=@var{dependence_type}
19696 @opindex msched-costly-dep
19697 This option controls which dependences are considered costly
19698 by the target during instruction scheduling.  The argument
19699 @var{dependence_type} takes one of the following values:
19701 @table @asis
19702 @item @samp{no}
19703 No dependence is costly.
19705 @item @samp{all}
19706 All dependences are costly.
19708 @item @samp{true_store_to_load}
19709 A true dependence from store to load is costly.
19711 @item @samp{store_to_load}
19712 Any dependence from store to load is costly.
19714 @item @var{number}
19715 Any dependence for which the latency is greater than or equal to 
19716 @var{number} is costly.
19717 @end table
19719 @item -minsert-sched-nops=@var{scheme}
19720 @opindex minsert-sched-nops
19721 This option controls which NOP insertion scheme is used during
19722 the second scheduling pass.  The argument @var{scheme} takes one of the
19723 following values:
19725 @table @asis
19726 @item @samp{no}
19727 Don't insert NOPs.
19729 @item @samp{pad}
19730 Pad with NOPs any dispatch group that has vacant issue slots,
19731 according to the scheduler's grouping.
19733 @item @samp{regroup_exact}
19734 Insert NOPs to force costly dependent insns into
19735 separate groups.  Insert exactly as many NOPs as needed to force an insn
19736 to a new group, according to the estimated processor grouping.
19738 @item @var{number}
19739 Insert NOPs to force costly dependent insns into
19740 separate groups.  Insert @var{number} NOPs to force an insn to a new group.
19741 @end table
19743 @item -mcall-sysv
19744 @opindex mcall-sysv
19745 On System V.4 and embedded PowerPC systems compile code using calling
19746 conventions that adhere to the March 1995 draft of the System V
19747 Application Binary Interface, PowerPC processor supplement.  This is the
19748 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
19750 @item -mcall-sysv-eabi
19751 @itemx -mcall-eabi
19752 @opindex mcall-sysv-eabi
19753 @opindex mcall-eabi
19754 Specify both @option{-mcall-sysv} and @option{-meabi} options.
19756 @item -mcall-sysv-noeabi
19757 @opindex mcall-sysv-noeabi
19758 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
19760 @item -mcall-aixdesc
19761 @opindex m
19762 On System V.4 and embedded PowerPC systems compile code for the AIX
19763 operating system.
19765 @item -mcall-linux
19766 @opindex mcall-linux
19767 On System V.4 and embedded PowerPC systems compile code for the
19768 Linux-based GNU system.
19770 @item -mcall-freebsd
19771 @opindex mcall-freebsd
19772 On System V.4 and embedded PowerPC systems compile code for the
19773 FreeBSD operating system.
19775 @item -mcall-netbsd
19776 @opindex mcall-netbsd
19777 On System V.4 and embedded PowerPC systems compile code for the
19778 NetBSD operating system.
19780 @item -mcall-openbsd
19781 @opindex mcall-netbsd
19782 On System V.4 and embedded PowerPC systems compile code for the
19783 OpenBSD operating system.
19785 @item -maix-struct-return
19786 @opindex maix-struct-return
19787 Return all structures in memory (as specified by the AIX ABI)@.
19789 @item -msvr4-struct-return
19790 @opindex msvr4-struct-return
19791 Return structures smaller than 8 bytes in registers (as specified by the
19792 SVR4 ABI)@.
19794 @item -mabi=@var{abi-type}
19795 @opindex mabi
19796 Extend the current ABI with a particular extension, or remove such extension.
19797 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
19798 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble},
19799 @var{elfv1}, @var{elfv2}@.
19801 @item -mabi=spe
19802 @opindex mabi=spe
19803 Extend the current ABI with SPE ABI extensions.  This does not change
19804 the default ABI, instead it adds the SPE ABI extensions to the current
19805 ABI@.
19807 @item -mabi=no-spe
19808 @opindex mabi=no-spe
19809 Disable Book-E SPE ABI extensions for the current ABI@.
19811 @item -mabi=ibmlongdouble
19812 @opindex mabi=ibmlongdouble
19813 Change the current ABI to use IBM extended-precision long double.
19814 This is a PowerPC 32-bit SYSV ABI option.
19816 @item -mabi=ieeelongdouble
19817 @opindex mabi=ieeelongdouble
19818 Change the current ABI to use IEEE extended-precision long double.
19819 This is a PowerPC 32-bit Linux ABI option.
19821 @item -mabi=elfv1
19822 @opindex mabi=elfv1
19823 Change the current ABI to use the ELFv1 ABI.
19824 This is the default ABI for big-endian PowerPC 64-bit Linux.
19825 Overriding the default ABI requires special system support and is
19826 likely to fail in spectacular ways.
19828 @item -mabi=elfv2
19829 @opindex mabi=elfv2
19830 Change the current ABI to use the ELFv2 ABI.
19831 This is the default ABI for little-endian PowerPC 64-bit Linux.
19832 Overriding the default ABI requires special system support and is
19833 likely to fail in spectacular ways.
19835 @item -mprototype
19836 @itemx -mno-prototype
19837 @opindex mprototype
19838 @opindex mno-prototype
19839 On System V.4 and embedded PowerPC systems assume that all calls to
19840 variable argument functions are properly prototyped.  Otherwise, the
19841 compiler must insert an instruction before every non-prototyped call to
19842 set or clear bit 6 of the condition code register (@var{CR}) to
19843 indicate whether floating-point values are passed in the floating-point
19844 registers in case the function takes variable arguments.  With
19845 @option{-mprototype}, only calls to prototyped variable argument functions
19846 set or clear the bit.
19848 @item -msim
19849 @opindex msim
19850 On embedded PowerPC systems, assume that the startup module is called
19851 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
19852 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
19853 configurations.
19855 @item -mmvme
19856 @opindex mmvme
19857 On embedded PowerPC systems, assume that the startup module is called
19858 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
19859 @file{libc.a}.
19861 @item -mads
19862 @opindex mads
19863 On embedded PowerPC systems, assume that the startup module is called
19864 @file{crt0.o} and the standard C libraries are @file{libads.a} and
19865 @file{libc.a}.
19867 @item -myellowknife
19868 @opindex myellowknife
19869 On embedded PowerPC systems, assume that the startup module is called
19870 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
19871 @file{libc.a}.
19873 @item -mvxworks
19874 @opindex mvxworks
19875 On System V.4 and embedded PowerPC systems, specify that you are
19876 compiling for a VxWorks system.
19878 @item -memb
19879 @opindex memb
19880 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
19881 header to indicate that @samp{eabi} extended relocations are used.
19883 @item -meabi
19884 @itemx -mno-eabi
19885 @opindex meabi
19886 @opindex mno-eabi
19887 On System V.4 and embedded PowerPC systems do (do not) adhere to the
19888 Embedded Applications Binary Interface (EABI), which is a set of
19889 modifications to the System V.4 specifications.  Selecting @option{-meabi}
19890 means that the stack is aligned to an 8-byte boundary, a function
19891 @code{__eabi} is called from @code{main} to set up the EABI
19892 environment, and the @option{-msdata} option can use both @code{r2} and
19893 @code{r13} to point to two separate small data areas.  Selecting
19894 @option{-mno-eabi} means that the stack is aligned to a 16-byte boundary,
19895 no EABI initialization function is called from @code{main}, and the
19896 @option{-msdata} option only uses @code{r13} to point to a single
19897 small data area.  The @option{-meabi} option is on by default if you
19898 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
19900 @item -msdata=eabi
19901 @opindex msdata=eabi
19902 On System V.4 and embedded PowerPC systems, put small initialized
19903 @code{const} global and static data in the @samp{.sdata2} section, which
19904 is pointed to by register @code{r2}.  Put small initialized
19905 non-@code{const} global and static data in the @samp{.sdata} section,
19906 which is pointed to by register @code{r13}.  Put small uninitialized
19907 global and static data in the @samp{.sbss} section, which is adjacent to
19908 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
19909 incompatible with the @option{-mrelocatable} option.  The
19910 @option{-msdata=eabi} option also sets the @option{-memb} option.
19912 @item -msdata=sysv
19913 @opindex msdata=sysv
19914 On System V.4 and embedded PowerPC systems, put small global and static
19915 data in the @samp{.sdata} section, which is pointed to by register
19916 @code{r13}.  Put small uninitialized global and static data in the
19917 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
19918 The @option{-msdata=sysv} option is incompatible with the
19919 @option{-mrelocatable} option.
19921 @item -msdata=default
19922 @itemx -msdata
19923 @opindex msdata=default
19924 @opindex msdata
19925 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
19926 compile code the same as @option{-msdata=eabi}, otherwise compile code the
19927 same as @option{-msdata=sysv}.
19929 @item -msdata=data
19930 @opindex msdata=data
19931 On System V.4 and embedded PowerPC systems, put small global
19932 data in the @samp{.sdata} section.  Put small uninitialized global
19933 data in the @samp{.sbss} section.  Do not use register @code{r13}
19934 to address small data however.  This is the default behavior unless
19935 other @option{-msdata} options are used.
19937 @item -msdata=none
19938 @itemx -mno-sdata
19939 @opindex msdata=none
19940 @opindex mno-sdata
19941 On embedded PowerPC systems, put all initialized global and static data
19942 in the @samp{.data} section, and all uninitialized data in the
19943 @samp{.bss} section.
19945 @item -mblock-move-inline-limit=@var{num}
19946 @opindex mblock-move-inline-limit
19947 Inline all block moves (such as calls to @code{memcpy} or structure
19948 copies) less than or equal to @var{num} bytes.  The minimum value for
19949 @var{num} is 32 bytes on 32-bit targets and 64 bytes on 64-bit
19950 targets.  The default value is target-specific.
19952 @item -G @var{num}
19953 @opindex G
19954 @cindex smaller data references (PowerPC)
19955 @cindex .sdata/.sdata2 references (PowerPC)
19956 On embedded PowerPC systems, put global and static items less than or
19957 equal to @var{num} bytes into the small data or BSS sections instead of
19958 the normal data or BSS section.  By default, @var{num} is 8.  The
19959 @option{-G @var{num}} switch is also passed to the linker.
19960 All modules should be compiled with the same @option{-G @var{num}} value.
19962 @item -mregnames
19963 @itemx -mno-regnames
19964 @opindex mregnames
19965 @opindex mno-regnames
19966 On System V.4 and embedded PowerPC systems do (do not) emit register
19967 names in the assembly language output using symbolic forms.
19969 @item -mlongcall
19970 @itemx -mno-longcall
19971 @opindex mlongcall
19972 @opindex mno-longcall
19973 By default assume that all calls are far away so that a longer and more
19974 expensive calling sequence is required.  This is required for calls
19975 farther than 32 megabytes (33,554,432 bytes) from the current location.
19976 A short call is generated if the compiler knows
19977 the call cannot be that far away.  This setting can be overridden by
19978 the @code{shortcall} function attribute, or by @code{#pragma
19979 longcall(0)}.
19981 Some linkers are capable of detecting out-of-range calls and generating
19982 glue code on the fly.  On these systems, long calls are unnecessary and
19983 generate slower code.  As of this writing, the AIX linker can do this,
19984 as can the GNU linker for PowerPC/64.  It is planned to add this feature
19985 to the GNU linker for 32-bit PowerPC systems as well.
19987 On Darwin/PPC systems, @code{#pragma longcall} generates @code{jbsr
19988 callee, L42}, plus a @dfn{branch island} (glue code).  The two target
19989 addresses represent the callee and the branch island.  The
19990 Darwin/PPC linker prefers the first address and generates a @code{bl
19991 callee} if the PPC @code{bl} instruction reaches the callee directly;
19992 otherwise, the linker generates @code{bl L42} to call the branch
19993 island.  The branch island is appended to the body of the
19994 calling function; it computes the full 32-bit address of the callee
19995 and jumps to it.
19997 On Mach-O (Darwin) systems, this option directs the compiler emit to
19998 the glue for every direct call, and the Darwin linker decides whether
19999 to use or discard it.
20001 In the future, GCC may ignore all longcall specifications
20002 when the linker is known to generate glue.
20004 @item -mtls-markers
20005 @itemx -mno-tls-markers
20006 @opindex mtls-markers
20007 @opindex mno-tls-markers
20008 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
20009 specifying the function argument.  The relocation allows the linker to
20010 reliably associate function call with argument setup instructions for
20011 TLS optimization, which in turn allows GCC to better schedule the
20012 sequence.
20014 @item -pthread
20015 @opindex pthread
20016 Adds support for multithreading with the @dfn{pthreads} library.
20017 This option sets flags for both the preprocessor and linker.
20019 @item -mrecip
20020 @itemx -mno-recip
20021 @opindex mrecip
20022 This option enables use of the reciprocal estimate and
20023 reciprocal square root estimate instructions with additional
20024 Newton-Raphson steps to increase precision instead of doing a divide or
20025 square root and divide for floating-point arguments.  You should use
20026 the @option{-ffast-math} option when using @option{-mrecip} (or at
20027 least @option{-funsafe-math-optimizations},
20028 @option{-finite-math-only}, @option{-freciprocal-math} and
20029 @option{-fno-trapping-math}).  Note that while the throughput of the
20030 sequence is generally higher than the throughput of the non-reciprocal
20031 instruction, the precision of the sequence can be decreased by up to 2
20032 ulp (i.e.@: the inverse of 1.0 equals 0.99999994) for reciprocal square
20033 roots.
20035 @item -mrecip=@var{opt}
20036 @opindex mrecip=opt
20037 This option controls which reciprocal estimate instructions
20038 may be used.  @var{opt} is a comma-separated list of options, which may
20039 be preceded by a @code{!} to invert the option:
20040 @code{all}: enable all estimate instructions,
20041 @code{default}: enable the default instructions, equivalent to @option{-mrecip},
20042 @code{none}: disable all estimate instructions, equivalent to @option{-mno-recip};
20043 @code{div}: enable the reciprocal approximation instructions for both single and double precision;
20044 @code{divf}: enable the single-precision reciprocal approximation instructions;
20045 @code{divd}: enable the double-precision reciprocal approximation instructions;
20046 @code{rsqrt}: enable the reciprocal square root approximation instructions for both single and double precision;
20047 @code{rsqrtf}: enable the single-precision reciprocal square root approximation instructions;
20048 @code{rsqrtd}: enable the double-precision reciprocal square root approximation instructions;
20050 So, for example, @option{-mrecip=all,!rsqrtd} enables
20051 all of the reciprocal estimate instructions, except for the
20052 @code{FRSQRTE}, @code{XSRSQRTEDP}, and @code{XVRSQRTEDP} instructions
20053 which handle the double-precision reciprocal square root calculations.
20055 @item -mrecip-precision
20056 @itemx -mno-recip-precision
20057 @opindex mrecip-precision
20058 Assume (do not assume) that the reciprocal estimate instructions
20059 provide higher-precision estimates than is mandated by the PowerPC
20060 ABI.  Selecting @option{-mcpu=power6}, @option{-mcpu=power7} or
20061 @option{-mcpu=power8} automatically selects @option{-mrecip-precision}.
20062 The double-precision square root estimate instructions are not generated by
20063 default on low-precision machines, since they do not provide an
20064 estimate that converges after three steps.
20066 @item -mveclibabi=@var{type}
20067 @opindex mveclibabi
20068 Specifies the ABI type to use for vectorizing intrinsics using an
20069 external library.  The only type supported at present is @code{mass},
20070 which specifies to use IBM's Mathematical Acceleration Subsystem
20071 (MASS) libraries for vectorizing intrinsics using external libraries.
20072 GCC currently emits calls to @code{acosd2}, @code{acosf4},
20073 @code{acoshd2}, @code{acoshf4}, @code{asind2}, @code{asinf4},
20074 @code{asinhd2}, @code{asinhf4}, @code{atan2d2}, @code{atan2f4},
20075 @code{atand2}, @code{atanf4}, @code{atanhd2}, @code{atanhf4},
20076 @code{cbrtd2}, @code{cbrtf4}, @code{cosd2}, @code{cosf4},
20077 @code{coshd2}, @code{coshf4}, @code{erfcd2}, @code{erfcf4},
20078 @code{erfd2}, @code{erff4}, @code{exp2d2}, @code{exp2f4},
20079 @code{expd2}, @code{expf4}, @code{expm1d2}, @code{expm1f4},
20080 @code{hypotd2}, @code{hypotf4}, @code{lgammad2}, @code{lgammaf4},
20081 @code{log10d2}, @code{log10f4}, @code{log1pd2}, @code{log1pf4},
20082 @code{log2d2}, @code{log2f4}, @code{logd2}, @code{logf4},
20083 @code{powd2}, @code{powf4}, @code{sind2}, @code{sinf4}, @code{sinhd2},
20084 @code{sinhf4}, @code{sqrtd2}, @code{sqrtf4}, @code{tand2},
20085 @code{tanf4}, @code{tanhd2}, and @code{tanhf4} when generating code
20086 for power7.  Both @option{-ftree-vectorize} and
20087 @option{-funsafe-math-optimizations} must also be enabled.  The MASS
20088 libraries must be specified at link time.
20090 @item -mfriz
20091 @itemx -mno-friz
20092 @opindex mfriz
20093 Generate (do not generate) the @code{friz} instruction when the
20094 @option{-funsafe-math-optimizations} option is used to optimize
20095 rounding of floating-point values to 64-bit integer and back to floating
20096 point.  The @code{friz} instruction does not return the same value if
20097 the floating-point number is too large to fit in an integer.
20099 @item -mpointers-to-nested-functions
20100 @itemx -mno-pointers-to-nested-functions
20101 @opindex mpointers-to-nested-functions
20102 Generate (do not generate) code to load up the static chain register
20103 (@var{r11}) when calling through a pointer on AIX and 64-bit Linux
20104 systems where a function pointer points to a 3-word descriptor giving
20105 the function address, TOC value to be loaded in register @var{r2}, and
20106 static chain value to be loaded in register @var{r11}.  The
20107 @option{-mpointers-to-nested-functions} is on by default.  You cannot
20108 call through pointers to nested functions or pointers
20109 to functions compiled in other languages that use the static chain if
20110 you use the @option{-mno-pointers-to-nested-functions}.
20112 @item -msave-toc-indirect
20113 @itemx -mno-save-toc-indirect
20114 @opindex msave-toc-indirect
20115 Generate (do not generate) code to save the TOC value in the reserved
20116 stack location in the function prologue if the function calls through
20117 a pointer on AIX and 64-bit Linux systems.  If the TOC value is not
20118 saved in the prologue, it is saved just before the call through the
20119 pointer.  The @option{-mno-save-toc-indirect} option is the default.
20121 @item -mcompat-align-parm
20122 @itemx -mno-compat-align-parm
20123 @opindex mcompat-align-parm
20124 Generate (do not generate) code to pass structure parameters with a
20125 maximum alignment of 64 bits, for compatibility with older versions
20126 of GCC.
20128 Older versions of GCC (prior to 4.9.0) incorrectly did not align a
20129 structure parameter on a 128-bit boundary when that structure contained
20130 a member requiring 128-bit alignment.  This is corrected in more
20131 recent versions of GCC.  This option may be used to generate code
20132 that is compatible with functions compiled with older versions of
20133 GCC.
20135 The @option{-mno-compat-align-parm} option is the default.
20136 @end table
20138 @node RX Options
20139 @subsection RX Options
20140 @cindex RX Options
20142 These command-line options are defined for RX targets:
20144 @table @gcctabopt
20145 @item -m64bit-doubles
20146 @itemx -m32bit-doubles
20147 @opindex m64bit-doubles
20148 @opindex m32bit-doubles
20149 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
20150 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
20151 @option{-m32bit-doubles}.  @emph{Note} RX floating-point hardware only
20152 works on 32-bit values, which is why the default is
20153 @option{-m32bit-doubles}.
20155 @item -fpu
20156 @itemx -nofpu
20157 @opindex fpu
20158 @opindex nofpu
20159 Enables (@option{-fpu}) or disables (@option{-nofpu}) the use of RX
20160 floating-point hardware.  The default is enabled for the @var{RX600}
20161 series and disabled for the @var{RX200} series.
20163 Floating-point instructions are only generated for 32-bit floating-point 
20164 values, however, so the FPU hardware is not used for doubles if the
20165 @option{-m64bit-doubles} option is used.
20167 @emph{Note} If the @option{-fpu} option is enabled then
20168 @option{-funsafe-math-optimizations} is also enabled automatically.
20169 This is because the RX FPU instructions are themselves unsafe.
20171 @item -mcpu=@var{name}
20172 @opindex -mcpu
20173 Selects the type of RX CPU to be targeted.  Currently three types are
20174 supported, the generic @var{RX600} and @var{RX200} series hardware and
20175 the specific @var{RX610} CPU.  The default is @var{RX600}.
20177 The only difference between @var{RX600} and @var{RX610} is that the
20178 @var{RX610} does not support the @code{MVTIPL} instruction.
20180 The @var{RX200} series does not have a hardware floating-point unit
20181 and so @option{-nofpu} is enabled by default when this type is
20182 selected.
20184 @item -mbig-endian-data
20185 @itemx -mlittle-endian-data
20186 @opindex mbig-endian-data
20187 @opindex mlittle-endian-data
20188 Store data (but not code) in the big-endian format.  The default is
20189 @option{-mlittle-endian-data}, i.e.@: to store data in the little-endian
20190 format.
20192 @item -msmall-data-limit=@var{N}
20193 @opindex msmall-data-limit
20194 Specifies the maximum size in bytes of global and static variables
20195 which can be placed into the small data area.  Using the small data
20196 area can lead to smaller and faster code, but the size of area is
20197 limited and it is up to the programmer to ensure that the area does
20198 not overflow.  Also when the small data area is used one of the RX's
20199 registers (usually @code{r13}) is reserved for use pointing to this
20200 area, so it is no longer available for use by the compiler.  This
20201 could result in slower and/or larger code if variables are pushed onto
20202 the stack instead of being held in this register.
20204 Note, common variables (variables that have not been initialized) and
20205 constants are not placed into the small data area as they are assigned
20206 to other sections in the output executable.
20208 The default value is zero, which disables this feature.  Note, this
20209 feature is not enabled by default with higher optimization levels
20210 (@option{-O2} etc) because of the potentially detrimental effects of
20211 reserving a register.  It is up to the programmer to experiment and
20212 discover whether this feature is of benefit to their program.  See the
20213 description of the @option{-mpid} option for a description of how the
20214 actual register to hold the small data area pointer is chosen.
20216 @item -msim
20217 @itemx -mno-sim
20218 @opindex msim
20219 @opindex mno-sim
20220 Use the simulator runtime.  The default is to use the libgloss
20221 board-specific runtime.
20223 @item -mas100-syntax
20224 @itemx -mno-as100-syntax
20225 @opindex mas100-syntax
20226 @opindex mno-as100-syntax
20227 When generating assembler output use a syntax that is compatible with
20228 Renesas's AS100 assembler.  This syntax can also be handled by the GAS
20229 assembler, but it has some restrictions so it is not generated by default.
20231 @item -mmax-constant-size=@var{N}
20232 @opindex mmax-constant-size
20233 Specifies the maximum size, in bytes, of a constant that can be used as
20234 an operand in a RX instruction.  Although the RX instruction set does
20235 allow constants of up to 4 bytes in length to be used in instructions,
20236 a longer value equates to a longer instruction.  Thus in some
20237 circumstances it can be beneficial to restrict the size of constants
20238 that are used in instructions.  Constants that are too big are instead
20239 placed into a constant pool and referenced via register indirection.
20241 The value @var{N} can be between 0 and 4.  A value of 0 (the default)
20242 or 4 means that constants of any size are allowed.
20244 @item -mrelax
20245 @opindex mrelax
20246 Enable linker relaxation.  Linker relaxation is a process whereby the
20247 linker attempts to reduce the size of a program by finding shorter
20248 versions of various instructions.  Disabled by default.
20250 @item -mint-register=@var{N}
20251 @opindex mint-register
20252 Specify the number of registers to reserve for fast interrupt handler
20253 functions.  The value @var{N} can be between 0 and 4.  A value of 1
20254 means that register @code{r13} is reserved for the exclusive use
20255 of fast interrupt handlers.  A value of 2 reserves @code{r13} and
20256 @code{r12}.  A value of 3 reserves @code{r13}, @code{r12} and
20257 @code{r11}, and a value of 4 reserves @code{r13} through @code{r10}.
20258 A value of 0, the default, does not reserve any registers.
20260 @item -msave-acc-in-interrupts
20261 @opindex msave-acc-in-interrupts
20262 Specifies that interrupt handler functions should preserve the
20263 accumulator register.  This is only necessary if normal code might use
20264 the accumulator register, for example because it performs 64-bit
20265 multiplications.  The default is to ignore the accumulator as this
20266 makes the interrupt handlers faster.
20268 @item -mpid
20269 @itemx -mno-pid
20270 @opindex mpid
20271 @opindex mno-pid
20272 Enables the generation of position independent data.  When enabled any
20273 access to constant data is done via an offset from a base address
20274 held in a register.  This allows the location of constant data to be
20275 determined at run time without requiring the executable to be
20276 relocated, which is a benefit to embedded applications with tight
20277 memory constraints.  Data that can be modified is not affected by this
20278 option.
20280 Note, using this feature reserves a register, usually @code{r13}, for
20281 the constant data base address.  This can result in slower and/or
20282 larger code, especially in complicated functions.
20284 The actual register chosen to hold the constant data base address
20285 depends upon whether the @option{-msmall-data-limit} and/or the
20286 @option{-mint-register} command-line options are enabled.  Starting
20287 with register @code{r13} and proceeding downwards, registers are
20288 allocated first to satisfy the requirements of @option{-mint-register},
20289 then @option{-mpid} and finally @option{-msmall-data-limit}.  Thus it
20290 is possible for the small data area register to be @code{r8} if both
20291 @option{-mint-register=4} and @option{-mpid} are specified on the
20292 command line.
20294 By default this feature is not enabled.  The default can be restored
20295 via the @option{-mno-pid} command-line option.
20297 @item -mno-warn-multiple-fast-interrupts
20298 @itemx -mwarn-multiple-fast-interrupts
20299 @opindex mno-warn-multiple-fast-interrupts
20300 @opindex mwarn-multiple-fast-interrupts
20301 Prevents GCC from issuing a warning message if it finds more than one
20302 fast interrupt handler when it is compiling a file.  The default is to
20303 issue a warning for each extra fast interrupt handler found, as the RX
20304 only supports one such interrupt.
20306 @end table
20308 @emph{Note:} The generic GCC command-line option @option{-ffixed-@var{reg}}
20309 has special significance to the RX port when used with the
20310 @code{interrupt} function attribute.  This attribute indicates a
20311 function intended to process fast interrupts.  GCC ensures
20312 that it only uses the registers @code{r10}, @code{r11}, @code{r12}
20313 and/or @code{r13} and only provided that the normal use of the
20314 corresponding registers have been restricted via the
20315 @option{-ffixed-@var{reg}} or @option{-mint-register} command-line
20316 options.
20318 @node S/390 and zSeries Options
20319 @subsection S/390 and zSeries Options
20320 @cindex S/390 and zSeries Options
20322 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
20324 @table @gcctabopt
20325 @item -mhard-float
20326 @itemx -msoft-float
20327 @opindex mhard-float
20328 @opindex msoft-float
20329 Use (do not use) the hardware floating-point instructions and registers
20330 for floating-point operations.  When @option{-msoft-float} is specified,
20331 functions in @file{libgcc.a} are used to perform floating-point
20332 operations.  When @option{-mhard-float} is specified, the compiler
20333 generates IEEE floating-point instructions.  This is the default.
20335 @item -mhard-dfp
20336 @itemx -mno-hard-dfp
20337 @opindex mhard-dfp
20338 @opindex mno-hard-dfp
20339 Use (do not use) the hardware decimal-floating-point instructions for
20340 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
20341 specified, functions in @file{libgcc.a} are used to perform
20342 decimal-floating-point operations.  When @option{-mhard-dfp} is
20343 specified, the compiler generates decimal-floating-point hardware
20344 instructions.  This is the default for @option{-march=z9-ec} or higher.
20346 @item -mlong-double-64
20347 @itemx -mlong-double-128
20348 @opindex mlong-double-64
20349 @opindex mlong-double-128
20350 These switches control the size of @code{long double} type. A size
20351 of 64 bits makes the @code{long double} type equivalent to the @code{double}
20352 type. This is the default.
20354 @item -mbackchain
20355 @itemx -mno-backchain
20356 @opindex mbackchain
20357 @opindex mno-backchain
20358 Store (do not store) the address of the caller's frame as backchain pointer
20359 into the callee's stack frame.
20360 A backchain may be needed to allow debugging using tools that do not understand
20361 DWARF 2 call frame information.
20362 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
20363 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
20364 the backchain is placed into the topmost word of the 96/160 byte register
20365 save area.
20367 In general, code compiled with @option{-mbackchain} is call-compatible with
20368 code compiled with @option{-mmo-backchain}; however, use of the backchain
20369 for debugging purposes usually requires that the whole binary is built with
20370 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
20371 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
20372 to build a linux kernel use @option{-msoft-float}.
20374 The default is to not maintain the backchain.
20376 @item -mpacked-stack
20377 @itemx -mno-packed-stack
20378 @opindex mpacked-stack
20379 @opindex mno-packed-stack
20380 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
20381 specified, the compiler uses the all fields of the 96/160 byte register save
20382 area only for their default purpose; unused fields still take up stack space.
20383 When @option{-mpacked-stack} is specified, register save slots are densely
20384 packed at the top of the register save area; unused space is reused for other
20385 purposes, allowing for more efficient use of the available stack space.
20386 However, when @option{-mbackchain} is also in effect, the topmost word of
20387 the save area is always used to store the backchain, and the return address
20388 register is always saved two words below the backchain.
20390 As long as the stack frame backchain is not used, code generated with
20391 @option{-mpacked-stack} is call-compatible with code generated with
20392 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
20393 S/390 or zSeries generated code that uses the stack frame backchain at run
20394 time, not just for debugging purposes.  Such code is not call-compatible
20395 with code compiled with @option{-mpacked-stack}.  Also, note that the
20396 combination of @option{-mbackchain},
20397 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
20398 to build a linux kernel use @option{-msoft-float}.
20400 The default is to not use the packed stack layout.
20402 @item -msmall-exec
20403 @itemx -mno-small-exec
20404 @opindex msmall-exec
20405 @opindex mno-small-exec
20406 Generate (or do not generate) code using the @code{bras} instruction
20407 to do subroutine calls.
20408 This only works reliably if the total executable size does not
20409 exceed 64k.  The default is to use the @code{basr} instruction instead,
20410 which does not have this limitation.
20412 @item -m64
20413 @itemx -m31
20414 @opindex m64
20415 @opindex m31
20416 When @option{-m31} is specified, generate code compliant to the
20417 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
20418 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
20419 particular to generate 64-bit instructions.  For the @samp{s390}
20420 targets, the default is @option{-m31}, while the @samp{s390x}
20421 targets default to @option{-m64}.
20423 @item -mzarch
20424 @itemx -mesa
20425 @opindex mzarch
20426 @opindex mesa
20427 When @option{-mzarch} is specified, generate code using the
20428 instructions available on z/Architecture.
20429 When @option{-mesa} is specified, generate code using the
20430 instructions available on ESA/390.  Note that @option{-mesa} is
20431 not possible with @option{-m64}.
20432 When generating code compliant to the GNU/Linux for S/390 ABI,
20433 the default is @option{-mesa}.  When generating code compliant
20434 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
20436 @item -mmvcle
20437 @itemx -mno-mvcle
20438 @opindex mmvcle
20439 @opindex mno-mvcle
20440 Generate (or do not generate) code using the @code{mvcle} instruction
20441 to perform block moves.  When @option{-mno-mvcle} is specified,
20442 use a @code{mvc} loop instead.  This is the default unless optimizing for
20443 size.
20445 @item -mdebug
20446 @itemx -mno-debug
20447 @opindex mdebug
20448 @opindex mno-debug
20449 Print (or do not print) additional debug information when compiling.
20450 The default is to not print debug information.
20452 @item -march=@var{cpu-type}
20453 @opindex march
20454 Generate code that runs on @var{cpu-type}, which is the name of a system
20455 representing a certain processor type.  Possible values for
20456 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, @samp{z990},
20457 @samp{z9-109}, @samp{z9-ec} and @samp{z10}.
20458 When generating code using the instructions available on z/Architecture,
20459 the default is @option{-march=z900}.  Otherwise, the default is
20460 @option{-march=g5}.
20462 @item -mtune=@var{cpu-type}
20463 @opindex mtune
20464 Tune to @var{cpu-type} everything applicable about the generated code,
20465 except for the ABI and the set of available instructions.
20466 The list of @var{cpu-type} values is the same as for @option{-march}.
20467 The default is the value used for @option{-march}.
20469 @item -mtpf-trace
20470 @itemx -mno-tpf-trace
20471 @opindex mtpf-trace
20472 @opindex mno-tpf-trace
20473 Generate code that adds (does not add) in TPF OS specific branches to trace
20474 routines in the operating system.  This option is off by default, even
20475 when compiling for the TPF OS@.
20477 @item -mfused-madd
20478 @itemx -mno-fused-madd
20479 @opindex mfused-madd
20480 @opindex mno-fused-madd
20481 Generate code that uses (does not use) the floating-point multiply and
20482 accumulate instructions.  These instructions are generated by default if
20483 hardware floating point is used.
20485 @item -mwarn-framesize=@var{framesize}
20486 @opindex mwarn-framesize
20487 Emit a warning if the current function exceeds the given frame size.  Because
20488 this is a compile-time check it doesn't need to be a real problem when the program
20489 runs.  It is intended to identify functions that most probably cause
20490 a stack overflow.  It is useful to be used in an environment with limited stack
20491 size e.g.@: the linux kernel.
20493 @item -mwarn-dynamicstack
20494 @opindex mwarn-dynamicstack
20495 Emit a warning if the function calls @code{alloca} or uses dynamically-sized
20496 arrays.  This is generally a bad idea with a limited stack size.
20498 @item -mstack-guard=@var{stack-guard}
20499 @itemx -mstack-size=@var{stack-size}
20500 @opindex mstack-guard
20501 @opindex mstack-size
20502 If these options are provided the S/390 back end emits additional instructions in
20503 the function prologue that trigger a trap if the stack size is @var{stack-guard}
20504 bytes above the @var{stack-size} (remember that the stack on S/390 grows downward).
20505 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
20506 the frame size of the compiled function is chosen.
20507 These options are intended to be used to help debugging stack overflow problems.
20508 The additionally emitted code causes only little overhead and hence can also be
20509 used in production-like systems without greater performance degradation.  The given
20510 values have to be exact powers of 2 and @var{stack-size} has to be greater than
20511 @var{stack-guard} without exceeding 64k.
20512 In order to be efficient the extra code makes the assumption that the stack starts
20513 at an address aligned to the value given by @var{stack-size}.
20514 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
20516 @item -mhotpatch[=@var{halfwords}]
20517 @itemx -mno-hotpatch
20518 @opindex mhotpatch
20519 If the hotpatch option is enabled, a ``hot-patching'' function
20520 prologue is generated for all functions in the compilation unit.
20521 The funtion label is prepended with the given number of two-byte
20522 Nop instructions (@var{halfwords}, maximum 1000000) or 12 Nop
20523 instructions if no argument is present.  Functions with a
20524 hot-patching prologue are never inlined automatically, and a
20525 hot-patching prologue is never generated for functions functions
20526 that are explicitly inline.
20528 This option can be overridden for individual functions with the
20529 @code{hotpatch} attribute.
20530 @end table
20532 @node Score Options
20533 @subsection Score Options
20534 @cindex Score Options
20536 These options are defined for Score implementations:
20538 @table @gcctabopt
20539 @item -meb
20540 @opindex meb
20541 Compile code for big-endian mode.  This is the default.
20543 @item -mel
20544 @opindex mel
20545 Compile code for little-endian mode.
20547 @item -mnhwloop
20548 @opindex mnhwloop
20549 Disable generation of @code{bcnz} instructions.
20551 @item -muls
20552 @opindex muls
20553 Enable generation of unaligned load and store instructions.
20555 @item -mmac
20556 @opindex mmac
20557 Enable the use of multiply-accumulate instructions. Disabled by default.
20559 @item -mscore5
20560 @opindex mscore5
20561 Specify the SCORE5 as the target architecture.
20563 @item -mscore5u
20564 @opindex mscore5u
20565 Specify the SCORE5U of the target architecture.
20567 @item -mscore7
20568 @opindex mscore7
20569 Specify the SCORE7 as the target architecture. This is the default.
20571 @item -mscore7d
20572 @opindex mscore7d
20573 Specify the SCORE7D as the target architecture.
20574 @end table
20576 @node SH Options
20577 @subsection SH Options
20579 These @samp{-m} options are defined for the SH implementations:
20581 @table @gcctabopt
20582 @item -m1
20583 @opindex m1
20584 Generate code for the SH1.
20586 @item -m2
20587 @opindex m2
20588 Generate code for the SH2.
20590 @item -m2e
20591 Generate code for the SH2e.
20593 @item -m2a-nofpu
20594 @opindex m2a-nofpu
20595 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a way
20596 that the floating-point unit is not used.
20598 @item -m2a-single-only
20599 @opindex m2a-single-only
20600 Generate code for the SH2a-FPU, in such a way that no double-precision
20601 floating-point operations are used.
20603 @item -m2a-single
20604 @opindex m2a-single
20605 Generate code for the SH2a-FPU assuming the floating-point unit is in
20606 single-precision mode by default.
20608 @item -m2a
20609 @opindex m2a
20610 Generate code for the SH2a-FPU assuming the floating-point unit is in
20611 double-precision mode by default.
20613 @item -m3
20614 @opindex m3
20615 Generate code for the SH3.
20617 @item -m3e
20618 @opindex m3e
20619 Generate code for the SH3e.
20621 @item -m4-nofpu
20622 @opindex m4-nofpu
20623 Generate code for the SH4 without a floating-point unit.
20625 @item -m4-single-only
20626 @opindex m4-single-only
20627 Generate code for the SH4 with a floating-point unit that only
20628 supports single-precision arithmetic.
20630 @item -m4-single
20631 @opindex m4-single
20632 Generate code for the SH4 assuming the floating-point unit is in
20633 single-precision mode by default.
20635 @item -m4
20636 @opindex m4
20637 Generate code for the SH4.
20639 @item -m4a-nofpu
20640 @opindex m4a-nofpu
20641 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
20642 floating-point unit is not used.
20644 @item -m4a-single-only
20645 @opindex m4a-single-only
20646 Generate code for the SH4a, in such a way that no double-precision
20647 floating-point operations are used.
20649 @item -m4a-single
20650 @opindex m4a-single
20651 Generate code for the SH4a assuming the floating-point unit is in
20652 single-precision mode by default.
20654 @item -m4a
20655 @opindex m4a
20656 Generate code for the SH4a.
20658 @item -m4al
20659 @opindex m4al
20660 Same as @option{-m4a-nofpu}, except that it implicitly passes
20661 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
20662 instructions at the moment.
20664 @item -mb
20665 @opindex mb
20666 Compile code for the processor in big-endian mode.
20668 @item -ml
20669 @opindex ml
20670 Compile code for the processor in little-endian mode.
20672 @item -mdalign
20673 @opindex mdalign
20674 Align doubles at 64-bit boundaries.  Note that this changes the calling
20675 conventions, and thus some functions from the standard C library do
20676 not work unless you recompile it first with @option{-mdalign}.
20678 @item -mrelax
20679 @opindex mrelax
20680 Shorten some address references at link time, when possible; uses the
20681 linker option @option{-relax}.
20683 @item -mbigtable
20684 @opindex mbigtable
20685 Use 32-bit offsets in @code{switch} tables.  The default is to use
20686 16-bit offsets.
20688 @item -mbitops
20689 @opindex mbitops
20690 Enable the use of bit manipulation instructions on SH2A.
20692 @item -mfmovd
20693 @opindex mfmovd
20694 Enable the use of the instruction @code{fmovd}.  Check @option{-mdalign} for
20695 alignment constraints.
20697 @item -mhitachi
20698 @opindex mhitachi
20699 Comply with the calling conventions defined by Renesas.
20701 @item -mrenesas
20702 @opindex mhitachi
20703 Comply with the calling conventions defined by Renesas.
20705 @item -mno-renesas
20706 @opindex mhitachi
20707 Comply with the calling conventions defined for GCC before the Renesas
20708 conventions were available.  This option is the default for all
20709 targets of the SH toolchain.
20711 @item -mnomacsave
20712 @opindex mnomacsave
20713 Mark the @code{MAC} register as call-clobbered, even if
20714 @option{-mhitachi} is given.
20716 @item -mieee
20717 @itemx -mno-ieee
20718 @opindex mieee
20719 @opindex mnoieee
20720 Control the IEEE compliance of floating-point comparisons, which affects the
20721 handling of cases where the result of a comparison is unordered.  By default
20722 @option{-mieee} is implicitly enabled.  If @option{-ffinite-math-only} is
20723 enabled @option{-mno-ieee} is implicitly set, which results in faster
20724 floating-point greater-equal and less-equal comparisons.  The implcit settings
20725 can be overridden by specifying either @option{-mieee} or @option{-mno-ieee}.
20727 @item -minline-ic_invalidate
20728 @opindex minline-ic_invalidate
20729 Inline code to invalidate instruction cache entries after setting up
20730 nested function trampolines.
20731 This option has no effect if @option{-musermode} is in effect and the selected
20732 code generation option (e.g. @option{-m4}) does not allow the use of the @code{icbi}
20733 instruction.
20734 If the selected code generation option does not allow the use of the @code{icbi}
20735 instruction, and @option{-musermode} is not in effect, the inlined code
20736 manipulates the instruction cache address array directly with an associative
20737 write.  This not only requires privileged mode at run time, but it also
20738 fails if the cache line had been mapped via the TLB and has become unmapped.
20740 @item -misize
20741 @opindex misize
20742 Dump instruction size and location in the assembly code.
20744 @item -mpadstruct
20745 @opindex mpadstruct
20746 This option is deprecated.  It pads structures to multiple of 4 bytes,
20747 which is incompatible with the SH ABI@.
20749 @item -matomic-model=@var{model}
20750 @opindex matomic-model=@var{model}
20751 Sets the model of atomic operations and additional parameters as a comma
20752 separated list.  For details on the atomic built-in functions see
20753 @ref{__atomic Builtins}.  The following models and parameters are supported:
20755 @table @samp
20757 @item none
20758 Disable compiler generated atomic sequences and emit library calls for atomic
20759 operations.  This is the default if the target is not @code{sh-*-linux*}.
20761 @item soft-gusa
20762 Generate GNU/Linux compatible gUSA software atomic sequences for the atomic
20763 built-in functions.  The generated atomic sequences require additional support
20764 from the interrupt/exception handling code of the system and are only suitable
20765 for SH3* and SH4* single-core systems.  This option is enabled by default when
20766 the target is @code{sh-*-linux*} and SH3* or SH4*.  When the target is SH4A,
20767 this option will also partially utilize the hardware atomic instructions
20768 @code{movli.l} and @code{movco.l} to create more efficient code, unless
20769 @samp{strict} is specified.  
20771 @item soft-tcb
20772 Generate software atomic sequences that use a variable in the thread control
20773 block.  This is a variation of the gUSA sequences which can also be used on
20774 SH1* and SH2* targets.  The generated atomic sequences require additional
20775 support from the interrupt/exception handling code of the system and are only
20776 suitable for single-core systems.  When using this model, the @samp{gbr-offset=}
20777 parameter has to be specified as well.
20779 @item soft-imask
20780 Generate software atomic sequences that temporarily disable interrupts by
20781 setting @code{SR.IMASK = 1111}.  This model works only when the program runs
20782 in privileged mode and is only suitable for single-core systems.  Additional
20783 support from the interrupt/exception handling code of the system is not
20784 required.  This model is enabled by default when the target is
20785 @code{sh-*-linux*} and SH1* or SH2*.
20787 @item hard-llcs
20788 Generate hardware atomic sequences using the @code{movli.l} and @code{movco.l}
20789 instructions only.  This is only available on SH4A and is suitable for
20790 multi-core systems.  Since the hardware instructions support only 32 bit atomic
20791 variables access to 8 or 16 bit variables is emulated with 32 bit accesses.
20792 Code compiled with this option will also be compatible with other software
20793 atomic model interrupt/exception handling systems if executed on an SH4A
20794 system.  Additional support from the interrupt/exception handling code of the
20795 system is not required for this model.
20797 @item gbr-offset=
20798 This parameter specifies the offset in bytes of the variable in the thread
20799 control block structure that should be used by the generated atomic sequences
20800 when the @samp{soft-tcb} model has been selected.  For other models this
20801 parameter is ignored.  The specified value must be an integer multiple of four
20802 and in the range 0-1020.
20804 @item strict
20805 This parameter prevents mixed usage of multiple atomic models, even though they
20806 would be compatible, and will make the compiler generate atomic sequences of the
20807 specified model only.
20809 @end table
20811 @item -mtas
20812 @opindex mtas
20813 Generate the @code{tas.b} opcode for @code{__atomic_test_and_set}.
20814 Notice that depending on the particular hardware and software configuration
20815 this can degrade overall performance due to the operand cache line flushes
20816 that are implied by the @code{tas.b} instruction.  On multi-core SH4A
20817 processors the @code{tas.b} instruction must be used with caution since it
20818 can result in data corruption for certain cache configurations.
20820 @item -mspace
20821 @opindex mspace
20822 Optimize for space instead of speed.  Implied by @option{-Os}.
20824 @item -mprefergot
20825 @opindex mprefergot
20826 When generating position-independent code, emit function calls using
20827 the Global Offset Table instead of the Procedure Linkage Table.
20829 @item -musermode
20830 @opindex musermode
20831 Don't generate privileged mode only code.  This option
20832 implies @option{-mno-inline-ic_invalidate}
20833 if the inlined code would not work in user mode.
20834 This is the default when the target is @code{sh-*-linux*}.
20836 @item -multcost=@var{number}
20837 @opindex multcost=@var{number}
20838 Set the cost to assume for a multiply insn.
20840 @item -mdiv=@var{strategy}
20841 @opindex mdiv=@var{strategy}
20842 Set the division strategy to be used for integer division operations.
20843 For SHmedia @var{strategy} can be one of: 
20845 @table @samp
20847 @item fp 
20848 Performs the operation in floating point.  This has a very high latency,
20849 but needs only a few instructions, so it might be a good choice if
20850 your code has enough easily-exploitable ILP to allow the compiler to
20851 schedule the floating-point instructions together with other instructions.
20852 Division by zero causes a floating-point exception.
20854 @item inv
20855 Uses integer operations to calculate the inverse of the divisor,
20856 and then multiplies the dividend with the inverse.  This strategy allows
20857 CSE and hoisting of the inverse calculation.  Division by zero calculates
20858 an unspecified result, but does not trap.
20860 @item inv:minlat
20861 A variant of @samp{inv} where, if no CSE or hoisting opportunities
20862 have been found, or if the entire operation has been hoisted to the same
20863 place, the last stages of the inverse calculation are intertwined with the
20864 final multiply to reduce the overall latency, at the expense of using a few
20865 more instructions, and thus offering fewer scheduling opportunities with
20866 other code.
20868 @item call
20869 Calls a library function that usually implements the @samp{inv:minlat}
20870 strategy.
20871 This gives high code density for @code{m5-*media-nofpu} compilations.
20873 @item call2
20874 Uses a different entry point of the same library function, where it
20875 assumes that a pointer to a lookup table has already been set up, which
20876 exposes the pointer load to CSE and code hoisting optimizations.
20878 @item inv:call
20879 @itemx inv:call2
20880 @itemx inv:fp
20881 Use the @samp{inv} algorithm for initial
20882 code generation, but if the code stays unoptimized, revert to the @samp{call},
20883 @samp{call2}, or @samp{fp} strategies, respectively.  Note that the
20884 potentially-trapping side effect of division by zero is carried by a
20885 separate instruction, so it is possible that all the integer instructions
20886 are hoisted out, but the marker for the side effect stays where it is.
20887 A recombination to floating-point operations or a call is not possible
20888 in that case.
20890 @item inv20u
20891 @itemx inv20l
20892 Variants of the @samp{inv:minlat} strategy.  In the case
20893 that the inverse calculation is not separated from the multiply, they speed
20894 up division where the dividend fits into 20 bits (plus sign where applicable)
20895 by inserting a test to skip a number of operations in this case; this test
20896 slows down the case of larger dividends.  @samp{inv20u} assumes the case of a such
20897 a small dividend to be unlikely, and @samp{inv20l} assumes it to be likely.
20899 @end table
20901 For targets other than SHmedia @var{strategy} can be one of:
20903 @table @samp
20905 @item call-div1
20906 Calls a library function that uses the single-step division instruction
20907 @code{div1} to perform the operation.  Division by zero calculates an
20908 unspecified result and does not trap.  This is the default except for SH4,
20909 SH2A and SHcompact.
20911 @item call-fp
20912 Calls a library function that performs the operation in double precision
20913 floating point.  Division by zero causes a floating-point exception.  This is
20914 the default for SHcompact with FPU.  Specifying this for targets that do not
20915 have a double precision FPU will default to @code{call-div1}.
20917 @item call-table
20918 Calls a library function that uses a lookup table for small divisors and
20919 the @code{div1} instruction with case distinction for larger divisors.  Division
20920 by zero calculates an unspecified result and does not trap.  This is the default
20921 for SH4.  Specifying this for targets that do not have dynamic shift
20922 instructions will default to @code{call-div1}.
20924 @end table
20926 When a division strategy has not been specified the default strategy will be
20927 selected based on the current target.  For SH2A the default strategy is to
20928 use the @code{divs} and @code{divu} instructions instead of library function
20929 calls.
20931 @item -maccumulate-outgoing-args
20932 @opindex maccumulate-outgoing-args
20933 Reserve space once for outgoing arguments in the function prologue rather
20934 than around each call.  Generally beneficial for performance and size.  Also
20935 needed for unwinding to avoid changing the stack frame around conditional code.
20937 @item -mdivsi3_libfunc=@var{name}
20938 @opindex mdivsi3_libfunc=@var{name}
20939 Set the name of the library function used for 32-bit signed division to
20940 @var{name}.
20941 This only affects the name used in the @samp{call} and @samp{inv:call}
20942 division strategies, and the compiler still expects the same
20943 sets of input/output/clobbered registers as if this option were not present.
20945 @item -mfixed-range=@var{register-range}
20946 @opindex mfixed-range
20947 Generate code treating the given register range as fixed registers.
20948 A fixed register is one that the register allocator can not use.  This is
20949 useful when compiling kernel code.  A register range is specified as
20950 two registers separated by a dash.  Multiple register ranges can be
20951 specified separated by a comma.
20953 @item -mindexed-addressing
20954 @opindex mindexed-addressing
20955 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
20956 This is only safe if the hardware and/or OS implement 32-bit wrap-around
20957 semantics for the indexed addressing mode.  The architecture allows the
20958 implementation of processors with 64-bit MMU, which the OS could use to
20959 get 32-bit addressing, but since no current hardware implementation supports
20960 this or any other way to make the indexed addressing mode safe to use in
20961 the 32-bit ABI, the default is @option{-mno-indexed-addressing}.
20963 @item -mgettrcost=@var{number}
20964 @opindex mgettrcost=@var{number}
20965 Set the cost assumed for the @code{gettr} instruction to @var{number}.
20966 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
20968 @item -mpt-fixed
20969 @opindex mpt-fixed
20970 Assume @code{pt*} instructions won't trap.  This generally generates
20971 better-scheduled code, but is unsafe on current hardware.
20972 The current architecture
20973 definition says that @code{ptabs} and @code{ptrel} trap when the target 
20974 anded with 3 is 3.
20975 This has the unintentional effect of making it unsafe to schedule these
20976 instructions before a branch, or hoist them out of a loop.  For example,
20977 @code{__do_global_ctors}, a part of @file{libgcc}
20978 that runs constructors at program
20979 startup, calls functions in a list which is delimited by @minus{}1.  With the
20980 @option{-mpt-fixed} option, the @code{ptabs} is done before testing against @minus{}1.
20981 That means that all the constructors run a bit more quickly, but when
20982 the loop comes to the end of the list, the program crashes because @code{ptabs}
20983 loads @minus{}1 into a target register.  
20985 Since this option is unsafe for any
20986 hardware implementing the current architecture specification, the default
20987 is @option{-mno-pt-fixed}.  Unless specified explicitly with 
20988 @option{-mgettrcost}, @option{-mno-pt-fixed} also implies @option{-mgettrcost=100};
20989 this deters register allocation from using target registers for storing
20990 ordinary integers.
20992 @item -minvalid-symbols
20993 @opindex minvalid-symbols
20994 Assume symbols might be invalid.  Ordinary function symbols generated by
20995 the compiler are always valid to load with
20996 @code{movi}/@code{shori}/@code{ptabs} or
20997 @code{movi}/@code{shori}/@code{ptrel},
20998 but with assembler and/or linker tricks it is possible
20999 to generate symbols that cause @code{ptabs} or @code{ptrel} to trap.
21000 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
21001 It prevents cross-basic-block CSE, hoisting and most scheduling
21002 of symbol loads.  The default is @option{-mno-invalid-symbols}.
21004 @item -mbranch-cost=@var{num}
21005 @opindex mbranch-cost=@var{num}
21006 Assume @var{num} to be the cost for a branch instruction.  Higher numbers
21007 make the compiler try to generate more branch-free code if possible.  
21008 If not specified the value is selected depending on the processor type that
21009 is being compiled for.
21011 @item -mzdcbranch
21012 @itemx -mno-zdcbranch
21013 @opindex mzdcbranch
21014 @opindex mno-zdcbranch
21015 Assume (do not assume) that zero displacement conditional branch instructions
21016 @code{bt} and @code{bf} are fast.  If @option{-mzdcbranch} is specified, the
21017 compiler will try to prefer zero displacement branch code sequences.  This is
21018 enabled by default when generating code for SH4 and SH4A.  It can be explicitly
21019 disabled by specifying @option{-mno-zdcbranch}.
21021 @item -mfused-madd
21022 @itemx -mno-fused-madd
21023 @opindex mfused-madd
21024 @opindex mno-fused-madd
21025 Generate code that uses (does not use) the floating-point multiply and
21026 accumulate instructions.  These instructions are generated by default
21027 if hardware floating point is used.  The machine-dependent
21028 @option{-mfused-madd} option is now mapped to the machine-independent
21029 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
21030 mapped to @option{-ffp-contract=off}.
21032 @item -mfsca
21033 @itemx -mno-fsca
21034 @opindex mfsca
21035 @opindex mno-fsca
21036 Allow or disallow the compiler to emit the @code{fsca} instruction for sine
21037 and cosine approximations.  The option @code{-mfsca} must be used in
21038 combination with @code{-funsafe-math-optimizations}.  It is enabled by default
21039 when generating code for SH4A.  Using @code{-mno-fsca} disables sine and cosine
21040 approximations even if @code{-funsafe-math-optimizations} is in effect.
21042 @item -mfsrra
21043 @itemx -mno-fsrra
21044 @opindex mfsrra
21045 @opindex mno-fsrra
21046 Allow or disallow the compiler to emit the @code{fsrra} instruction for
21047 reciprocal square root approximations.  The option @code{-mfsrra} must be used
21048 in combination with @code{-funsafe-math-optimizations} and
21049 @code{-ffinite-math-only}.  It is enabled by default when generating code for
21050 SH4A.  Using @code{-mno-fsrra} disables reciprocal square root approximations
21051 even if @code{-funsafe-math-optimizations} and @code{-ffinite-math-only} are
21052 in effect.
21054 @item -mpretend-cmove
21055 @opindex mpretend-cmove
21056 Prefer zero-displacement conditional branches for conditional move instruction
21057 patterns.  This can result in faster code on the SH4 processor.
21059 @end table
21061 @node Solaris 2 Options
21062 @subsection Solaris 2 Options
21063 @cindex Solaris 2 options
21065 These @samp{-m} options are supported on Solaris 2:
21067 @table @gcctabopt
21068 @item -mclear-hwcap
21069 @opindex mclear-hwcap
21070 @option{-mclear-hwcap} tells the compiler to remove the hardware
21071 capabilities generated by the Solaris assembler.  This is only necessary
21072 when object files use ISA extensions not supported by the current
21073 machine, but check at runtime whether or not to use them.
21075 @item -mimpure-text
21076 @opindex mimpure-text
21077 @option{-mimpure-text}, used in addition to @option{-shared}, tells
21078 the compiler to not pass @option{-z text} to the linker when linking a
21079 shared object.  Using this option, you can link position-dependent
21080 code into a shared object.
21082 @option{-mimpure-text} suppresses the ``relocations remain against
21083 allocatable but non-writable sections'' linker error message.
21084 However, the necessary relocations trigger copy-on-write, and the
21085 shared object is not actually shared across processes.  Instead of
21086 using @option{-mimpure-text}, you should compile all source code with
21087 @option{-fpic} or @option{-fPIC}.
21089 @end table
21091 These switches are supported in addition to the above on Solaris 2:
21093 @table @gcctabopt
21094 @item -pthreads
21095 @opindex pthreads
21096 Add support for multithreading using the POSIX threads library.  This
21097 option sets flags for both the preprocessor and linker.  This option does
21098 not affect the thread safety of object code produced  by the compiler or
21099 that of libraries supplied with it.
21101 @item -pthread
21102 @opindex pthread
21103 This is a synonym for @option{-pthreads}.
21104 @end table
21106 @node SPARC Options
21107 @subsection SPARC Options
21108 @cindex SPARC options
21110 These @samp{-m} options are supported on the SPARC:
21112 @table @gcctabopt
21113 @item -mno-app-regs
21114 @itemx -mapp-regs
21115 @opindex mno-app-regs
21116 @opindex mapp-regs
21117 Specify @option{-mapp-regs} to generate output using the global registers
21118 2 through 4, which the SPARC SVR4 ABI reserves for applications.  Like the
21119 global register 1, each global register 2 through 4 is then treated as an
21120 allocable register that is clobbered by function calls.  This is the default.
21122 To be fully SVR4 ABI-compliant at the cost of some performance loss,
21123 specify @option{-mno-app-regs}.  You should compile libraries and system
21124 software with this option.
21126 @item -mflat
21127 @itemx -mno-flat
21128 @opindex mflat
21129 @opindex mno-flat
21130 With @option{-mflat}, the compiler does not generate save/restore instructions
21131 and uses a ``flat'' or single register window model.  This model is compatible
21132 with the regular register window model.  The local registers and the input
21133 registers (0--5) are still treated as ``call-saved'' registers and are
21134 saved on the stack as needed.
21136 With @option{-mno-flat} (the default), the compiler generates save/restore
21137 instructions (except for leaf functions).  This is the normal operating mode.
21139 @item -mfpu
21140 @itemx -mhard-float
21141 @opindex mfpu
21142 @opindex mhard-float
21143 Generate output containing floating-point instructions.  This is the
21144 default.
21146 @item -mno-fpu
21147 @itemx -msoft-float
21148 @opindex mno-fpu
21149 @opindex msoft-float
21150 Generate output containing library calls for floating point.
21151 @strong{Warning:} the requisite libraries are not available for all SPARC
21152 targets.  Normally the facilities of the machine's usual C compiler are
21153 used, but this cannot be done directly in cross-compilation.  You must make
21154 your own arrangements to provide suitable library functions for
21155 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
21156 @samp{sparclite-*-*} do provide software floating-point support.
21158 @option{-msoft-float} changes the calling convention in the output file;
21159 therefore, it is only useful if you compile @emph{all} of a program with
21160 this option.  In particular, you need to compile @file{libgcc.a}, the
21161 library that comes with GCC, with @option{-msoft-float} in order for
21162 this to work.
21164 @item -mhard-quad-float
21165 @opindex mhard-quad-float
21166 Generate output containing quad-word (long double) floating-point
21167 instructions.
21169 @item -msoft-quad-float
21170 @opindex msoft-quad-float
21171 Generate output containing library calls for quad-word (long double)
21172 floating-point instructions.  The functions called are those specified
21173 in the SPARC ABI@.  This is the default.
21175 As of this writing, there are no SPARC implementations that have hardware
21176 support for the quad-word floating-point instructions.  They all invoke
21177 a trap handler for one of these instructions, and then the trap handler
21178 emulates the effect of the instruction.  Because of the trap handler overhead,
21179 this is much slower than calling the ABI library routines.  Thus the
21180 @option{-msoft-quad-float} option is the default.
21182 @item -mno-unaligned-doubles
21183 @itemx -munaligned-doubles
21184 @opindex mno-unaligned-doubles
21185 @opindex munaligned-doubles
21186 Assume that doubles have 8-byte alignment.  This is the default.
21188 With @option{-munaligned-doubles}, GCC assumes that doubles have 8-byte
21189 alignment only if they are contained in another type, or if they have an
21190 absolute address.  Otherwise, it assumes they have 4-byte alignment.
21191 Specifying this option avoids some rare compatibility problems with code
21192 generated by other compilers.  It is not the default because it results
21193 in a performance loss, especially for floating-point code.
21195 @item -muser-mode
21196 @itemx -mno-user-mode
21197 @opindex muser-mode
21198 @opindex mno-user-mode
21199 Do not generate code that can only run in supervisor mode.  This is relevant
21200 only for the @code{casa} instruction emitted for the LEON3 processor.  The
21201 default is @option{-mno-user-mode}.
21203 @item -mno-faster-structs
21204 @itemx -mfaster-structs
21205 @opindex mno-faster-structs
21206 @opindex mfaster-structs
21207 With @option{-mfaster-structs}, the compiler assumes that structures
21208 should have 8-byte alignment.  This enables the use of pairs of
21209 @code{ldd} and @code{std} instructions for copies in structure
21210 assignment, in place of twice as many @code{ld} and @code{st} pairs.
21211 However, the use of this changed alignment directly violates the SPARC
21212 ABI@.  Thus, it's intended only for use on targets where the developer
21213 acknowledges that their resulting code is not directly in line with
21214 the rules of the ABI@.
21216 @item -mcpu=@var{cpu_type}
21217 @opindex mcpu
21218 Set the instruction set, register set, and instruction scheduling parameters
21219 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
21220 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{hypersparc},
21221 @samp{leon}, @samp{leon3}, @samp{sparclite}, @samp{f930}, @samp{f934},
21222 @samp{sparclite86x}, @samp{sparclet}, @samp{tsc701}, @samp{v9},
21223 @samp{ultrasparc}, @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2},
21224 @samp{niagara3} and @samp{niagara4}.
21226 Native Solaris and GNU/Linux toolchains also support the value @samp{native},
21227 which selects the best architecture option for the host processor.
21228 @option{-mcpu=native} has no effect if GCC does not recognize
21229 the processor.
21231 Default instruction scheduling parameters are used for values that select
21232 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
21233 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
21235 Here is a list of each supported architecture and their supported
21236 implementations.
21238 @table @asis
21239 @item v7
21240 cypress
21242 @item v8
21243 supersparc, hypersparc, leon, leon3
21245 @item sparclite
21246 f930, f934, sparclite86x
21248 @item sparclet
21249 tsc701
21251 @item v9
21252 ultrasparc, ultrasparc3, niagara, niagara2, niagara3, niagara4
21253 @end table
21255 By default (unless configured otherwise), GCC generates code for the V7
21256 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
21257 additionally optimizes it for the Cypress CY7C602 chip, as used in the
21258 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
21259 SPARCStation 1, 2, IPX etc.
21261 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
21262 architecture.  The only difference from V7 code is that the compiler emits
21263 the integer multiply and integer divide instructions which exist in SPARC-V8
21264 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
21265 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
21266 2000 series.
21268 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
21269 the SPARC architecture.  This adds the integer multiply, integer divide step
21270 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
21271 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
21272 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
21273 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
21274 MB86934 chip, which is the more recent SPARClite with FPU@.
21276 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
21277 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
21278 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
21279 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
21280 optimizes it for the TEMIC SPARClet chip.
21282 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
21283 architecture.  This adds 64-bit integer and floating-point move instructions,
21284 3 additional floating-point condition code registers and conditional move
21285 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
21286 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
21287 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
21288 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
21289 @option{-mcpu=niagara}, the compiler additionally optimizes it for
21290 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
21291 additionally optimizes it for Sun UltraSPARC T2 chips. With
21292 @option{-mcpu=niagara3}, the compiler additionally optimizes it for Sun
21293 UltraSPARC T3 chips.  With @option{-mcpu=niagara4}, the compiler
21294 additionally optimizes it for Sun UltraSPARC T4 chips.
21296 @item -mtune=@var{cpu_type}
21297 @opindex mtune
21298 Set the instruction scheduling parameters for machine type
21299 @var{cpu_type}, but do not set the instruction set or register set that the
21300 option @option{-mcpu=@var{cpu_type}} does.
21302 The same values for @option{-mcpu=@var{cpu_type}} can be used for
21303 @option{-mtune=@var{cpu_type}}, but the only useful values are those
21304 that select a particular CPU implementation.  Those are @samp{cypress},
21305 @samp{supersparc}, @samp{hypersparc}, @samp{leon}, @samp{leon3}, @samp{f930},
21306 @samp{f934}, @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
21307 @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2}, @samp{niagara3} and
21308 @samp{niagara4}.  With native Solaris and GNU/Linux toolchains, @samp{native}
21309 can also be used.
21311 @item -mv8plus
21312 @itemx -mno-v8plus
21313 @opindex mv8plus
21314 @opindex mno-v8plus
21315 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
21316 difference from the V8 ABI is that the global and out registers are
21317 considered 64 bits wide.  This is enabled by default on Solaris in 32-bit
21318 mode for all SPARC-V9 processors.
21320 @item -mvis
21321 @itemx -mno-vis
21322 @opindex mvis
21323 @opindex mno-vis
21324 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
21325 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
21327 @item -mvis2
21328 @itemx -mno-vis2
21329 @opindex mvis2
21330 @opindex mno-vis2
21331 With @option{-mvis2}, GCC generates code that takes advantage of
21332 version 2.0 of the UltraSPARC Visual Instruction Set extensions.  The
21333 default is @option{-mvis2} when targeting a cpu that supports such
21334 instructions, such as UltraSPARC-III and later.  Setting @option{-mvis2}
21335 also sets @option{-mvis}.
21337 @item -mvis3
21338 @itemx -mno-vis3
21339 @opindex mvis3
21340 @opindex mno-vis3
21341 With @option{-mvis3}, GCC generates code that takes advantage of
21342 version 3.0 of the UltraSPARC Visual Instruction Set extensions.  The
21343 default is @option{-mvis3} when targeting a cpu that supports such
21344 instructions, such as niagara-3 and later.  Setting @option{-mvis3}
21345 also sets @option{-mvis2} and @option{-mvis}.
21347 @item -mcbcond
21348 @itemx -mno-cbcond
21349 @opindex mcbcond
21350 @opindex mno-cbcond
21351 With @option{-mcbcond}, GCC generates code that takes advantage of
21352 compare-and-branch instructions, as defined in the Sparc Architecture 2011.
21353 The default is @option{-mcbcond} when targeting a cpu that supports such
21354 instructions, such as niagara-4 and later.
21356 @item -mpopc
21357 @itemx -mno-popc
21358 @opindex mpopc
21359 @opindex mno-popc
21360 With @option{-mpopc}, GCC generates code that takes advantage of the UltraSPARC
21361 population count instruction.  The default is @option{-mpopc}
21362 when targeting a cpu that supports such instructions, such as Niagara-2 and
21363 later.
21365 @item -mfmaf
21366 @itemx -mno-fmaf
21367 @opindex mfmaf
21368 @opindex mno-fmaf
21369 With @option{-mfmaf}, GCC generates code that takes advantage of the UltraSPARC
21370 Fused Multiply-Add Floating-point extensions.  The default is @option{-mfmaf}
21371 when targeting a cpu that supports such instructions, such as Niagara-3 and
21372 later.
21374 @item -mfix-at697f
21375 @opindex mfix-at697f
21376 Enable the documented workaround for the single erratum of the Atmel AT697F
21377 processor (which corresponds to erratum #13 of the AT697E processor).
21379 @item -mfix-ut699
21380 @opindex mfix-ut699
21381 Enable the documented workarounds for the floating-point errata and the data
21382 cache nullify errata of the UT699 processor.
21383 @end table
21385 These @samp{-m} options are supported in addition to the above
21386 on SPARC-V9 processors in 64-bit environments:
21388 @table @gcctabopt
21389 @item -m32
21390 @itemx -m64
21391 @opindex m32
21392 @opindex m64
21393 Generate code for a 32-bit or 64-bit environment.
21394 The 32-bit environment sets int, long and pointer to 32 bits.
21395 The 64-bit environment sets int to 32 bits and long and pointer
21396 to 64 bits.
21398 @item -mcmodel=@var{which}
21399 @opindex mcmodel
21400 Set the code model to one of
21402 @table @samp
21403 @item medlow
21404 The Medium/Low code model: 64-bit addresses, programs
21405 must be linked in the low 32 bits of memory.  Programs can be statically
21406 or dynamically linked.
21408 @item medmid
21409 The Medium/Middle code model: 64-bit addresses, programs
21410 must be linked in the low 44 bits of memory, the text and data segments must
21411 be less than 2GB in size and the data segment must be located within 2GB of
21412 the text segment.
21414 @item medany
21415 The Medium/Anywhere code model: 64-bit addresses, programs
21416 may be linked anywhere in memory, the text and data segments must be less
21417 than 2GB in size and the data segment must be located within 2GB of the
21418 text segment.
21420 @item embmedany
21421 The Medium/Anywhere code model for embedded systems:
21422 64-bit addresses, the text and data segments must be less than 2GB in
21423 size, both starting anywhere in memory (determined at link time).  The
21424 global register %g4 points to the base of the data segment.  Programs
21425 are statically linked and PIC is not supported.
21426 @end table
21428 @item -mmemory-model=@var{mem-model}
21429 @opindex mmemory-model
21430 Set the memory model in force on the processor to one of
21432 @table @samp
21433 @item default
21434 The default memory model for the processor and operating system.
21436 @item rmo
21437 Relaxed Memory Order
21439 @item pso
21440 Partial Store Order
21442 @item tso
21443 Total Store Order
21445 @item sc
21446 Sequential Consistency
21447 @end table
21449 These memory models are formally defined in Appendix D of the Sparc V9
21450 architecture manual, as set in the processor's @code{PSTATE.MM} field.
21452 @item -mstack-bias
21453 @itemx -mno-stack-bias
21454 @opindex mstack-bias
21455 @opindex mno-stack-bias
21456 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
21457 frame pointer if present, are offset by @minus{}2047 which must be added back
21458 when making stack frame references.  This is the default in 64-bit mode.
21459 Otherwise, assume no such offset is present.
21460 @end table
21462 @node SPU Options
21463 @subsection SPU Options
21464 @cindex SPU options
21466 These @samp{-m} options are supported on the SPU:
21468 @table @gcctabopt
21469 @item -mwarn-reloc
21470 @itemx -merror-reloc
21471 @opindex mwarn-reloc
21472 @opindex merror-reloc
21474 The loader for SPU does not handle dynamic relocations.  By default, GCC
21475 gives an error when it generates code that requires a dynamic
21476 relocation.  @option{-mno-error-reloc} disables the error,
21477 @option{-mwarn-reloc} generates a warning instead.
21479 @item -msafe-dma
21480 @itemx -munsafe-dma
21481 @opindex msafe-dma
21482 @opindex munsafe-dma
21484 Instructions that initiate or test completion of DMA must not be
21485 reordered with respect to loads and stores of the memory that is being
21486 accessed.
21487 With @option{-munsafe-dma} you must use the @code{volatile} keyword to protect
21488 memory accesses, but that can lead to inefficient code in places where the
21489 memory is known to not change.  Rather than mark the memory as volatile,
21490 you can use @option{-msafe-dma} to tell the compiler to treat
21491 the DMA instructions as potentially affecting all memory.  
21493 @item -mbranch-hints
21494 @opindex mbranch-hints
21496 By default, GCC generates a branch hint instruction to avoid
21497 pipeline stalls for always-taken or probably-taken branches.  A hint
21498 is not generated closer than 8 instructions away from its branch.
21499 There is little reason to disable them, except for debugging purposes,
21500 or to make an object a little bit smaller.
21502 @item -msmall-mem
21503 @itemx -mlarge-mem
21504 @opindex msmall-mem
21505 @opindex mlarge-mem
21507 By default, GCC generates code assuming that addresses are never larger
21508 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
21509 a full 32-bit address.
21511 @item -mstdmain
21512 @opindex mstdmain
21514 By default, GCC links against startup code that assumes the SPU-style
21515 main function interface (which has an unconventional parameter list).
21516 With @option{-mstdmain}, GCC links your program against startup
21517 code that assumes a C99-style interface to @code{main}, including a
21518 local copy of @code{argv} strings.
21520 @item -mfixed-range=@var{register-range}
21521 @opindex mfixed-range
21522 Generate code treating the given register range as fixed registers.
21523 A fixed register is one that the register allocator cannot use.  This is
21524 useful when compiling kernel code.  A register range is specified as
21525 two registers separated by a dash.  Multiple register ranges can be
21526 specified separated by a comma.
21528 @item -mea32
21529 @itemx -mea64
21530 @opindex mea32
21531 @opindex mea64
21532 Compile code assuming that pointers to the PPU address space accessed
21533 via the @code{__ea} named address space qualifier are either 32 or 64
21534 bits wide.  The default is 32 bits.  As this is an ABI-changing option,
21535 all object code in an executable must be compiled with the same setting.
21537 @item -maddress-space-conversion
21538 @itemx -mno-address-space-conversion
21539 @opindex maddress-space-conversion
21540 @opindex mno-address-space-conversion
21541 Allow/disallow treating the @code{__ea} address space as superset
21542 of the generic address space.  This enables explicit type casts
21543 between @code{__ea} and generic pointer as well as implicit
21544 conversions of generic pointers to @code{__ea} pointers.  The
21545 default is to allow address space pointer conversions.
21547 @item -mcache-size=@var{cache-size}
21548 @opindex mcache-size
21549 This option controls the version of libgcc that the compiler links to an
21550 executable and selects a software-managed cache for accessing variables
21551 in the @code{__ea} address space with a particular cache size.  Possible
21552 options for @var{cache-size} are @samp{8}, @samp{16}, @samp{32}, @samp{64}
21553 and @samp{128}.  The default cache size is 64KB.
21555 @item -matomic-updates
21556 @itemx -mno-atomic-updates
21557 @opindex matomic-updates
21558 @opindex mno-atomic-updates
21559 This option controls the version of libgcc that the compiler links to an
21560 executable and selects whether atomic updates to the software-managed
21561 cache of PPU-side variables are used.  If you use atomic updates, changes
21562 to a PPU variable from SPU code using the @code{__ea} named address space
21563 qualifier do not interfere with changes to other PPU variables residing
21564 in the same cache line from PPU code.  If you do not use atomic updates,
21565 such interference may occur; however, writing back cache lines is
21566 more efficient.  The default behavior is to use atomic updates.
21568 @item -mdual-nops
21569 @itemx -mdual-nops=@var{n}
21570 @opindex mdual-nops
21571 By default, GCC inserts nops to increase dual issue when it expects
21572 it to increase performance.  @var{n} can be a value from 0 to 10.  A
21573 smaller @var{n} inserts fewer nops.  10 is the default, 0 is the
21574 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
21576 @item -mhint-max-nops=@var{n}
21577 @opindex mhint-max-nops
21578 Maximum number of nops to insert for a branch hint.  A branch hint must
21579 be at least 8 instructions away from the branch it is affecting.  GCC
21580 inserts up to @var{n} nops to enforce this, otherwise it does not
21581 generate the branch hint.
21583 @item -mhint-max-distance=@var{n}
21584 @opindex mhint-max-distance
21585 The encoding of the branch hint instruction limits the hint to be within
21586 256 instructions of the branch it is affecting.  By default, GCC makes
21587 sure it is within 125.
21589 @item -msafe-hints
21590 @opindex msafe-hints
21591 Work around a hardware bug that causes the SPU to stall indefinitely.
21592 By default, GCC inserts the @code{hbrp} instruction to make sure
21593 this stall won't happen.
21595 @end table
21597 @node System V Options
21598 @subsection Options for System V
21600 These additional options are available on System V Release 4 for
21601 compatibility with other compilers on those systems:
21603 @table @gcctabopt
21604 @item -G
21605 @opindex G
21606 Create a shared object.
21607 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
21609 @item -Qy
21610 @opindex Qy
21611 Identify the versions of each tool used by the compiler, in a
21612 @code{.ident} assembler directive in the output.
21614 @item -Qn
21615 @opindex Qn
21616 Refrain from adding @code{.ident} directives to the output file (this is
21617 the default).
21619 @item -YP,@var{dirs}
21620 @opindex YP
21621 Search the directories @var{dirs}, and no others, for libraries
21622 specified with @option{-l}.
21624 @item -Ym,@var{dir}
21625 @opindex Ym
21626 Look in the directory @var{dir} to find the M4 preprocessor.
21627 The assembler uses this option.
21628 @c This is supposed to go with a -Yd for predefined M4 macro files, but
21629 @c the generic assembler that comes with Solaris takes just -Ym.
21630 @end table
21632 @node TILE-Gx Options
21633 @subsection TILE-Gx Options
21634 @cindex TILE-Gx options
21636 These @samp{-m} options are supported on the TILE-Gx:
21638 @table @gcctabopt
21639 @item -mcmodel=small
21640 @opindex mcmodel=small
21641 Generate code for the small model.  The distance for direct calls is
21642 limited to 500M in either direction.  PC-relative addresses are 32
21643 bits.  Absolute addresses support the full address range.
21645 @item -mcmodel=large
21646 @opindex mcmodel=large
21647 Generate code for the large model.  There is no limitation on call
21648 distance, pc-relative addresses, or absolute addresses.
21650 @item -mcpu=@var{name}
21651 @opindex mcpu
21652 Selects the type of CPU to be targeted.  Currently the only supported
21653 type is @samp{tilegx}.
21655 @item -m32
21656 @itemx -m64
21657 @opindex m32
21658 @opindex m64
21659 Generate code for a 32-bit or 64-bit environment.  The 32-bit
21660 environment sets int, long, and pointer to 32 bits.  The 64-bit
21661 environment sets int to 32 bits and long and pointer to 64 bits.
21663 @item -mbig-endian
21664 @itemx -mlittle-endian
21665 @opindex mbig-endian
21666 @opindex mlittle-endian
21667 Generate code in big/little endian mode, respectively.
21668 @end table
21670 @node TILEPro Options
21671 @subsection TILEPro Options
21672 @cindex TILEPro options
21674 These @samp{-m} options are supported on the TILEPro:
21676 @table @gcctabopt
21677 @item -mcpu=@var{name}
21678 @opindex mcpu
21679 Selects the type of CPU to be targeted.  Currently the only supported
21680 type is @samp{tilepro}.
21682 @item -m32
21683 @opindex m32
21684 Generate code for a 32-bit environment, which sets int, long, and
21685 pointer to 32 bits.  This is the only supported behavior so the flag
21686 is essentially ignored.
21687 @end table
21689 @node V850 Options
21690 @subsection V850 Options
21691 @cindex V850 Options
21693 These @samp{-m} options are defined for V850 implementations:
21695 @table @gcctabopt
21696 @item -mlong-calls
21697 @itemx -mno-long-calls
21698 @opindex mlong-calls
21699 @opindex mno-long-calls
21700 Treat all calls as being far away (near).  If calls are assumed to be
21701 far away, the compiler always loads the function's address into a
21702 register, and calls indirect through the pointer.
21704 @item -mno-ep
21705 @itemx -mep
21706 @opindex mno-ep
21707 @opindex mep
21708 Do not optimize (do optimize) basic blocks that use the same index
21709 pointer 4 or more times to copy pointer into the @code{ep} register, and
21710 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
21711 option is on by default if you optimize.
21713 @item -mno-prolog-function
21714 @itemx -mprolog-function
21715 @opindex mno-prolog-function
21716 @opindex mprolog-function
21717 Do not use (do use) external functions to save and restore registers
21718 at the prologue and epilogue of a function.  The external functions
21719 are slower, but use less code space if more than one function saves
21720 the same number of registers.  The @option{-mprolog-function} option
21721 is on by default if you optimize.
21723 @item -mspace
21724 @opindex mspace
21725 Try to make the code as small as possible.  At present, this just turns
21726 on the @option{-mep} and @option{-mprolog-function} options.
21728 @item -mtda=@var{n}
21729 @opindex mtda
21730 Put static or global variables whose size is @var{n} bytes or less into
21731 the tiny data area that register @code{ep} points to.  The tiny data
21732 area can hold up to 256 bytes in total (128 bytes for byte references).
21734 @item -msda=@var{n}
21735 @opindex msda
21736 Put static or global variables whose size is @var{n} bytes or less into
21737 the small data area that register @code{gp} points to.  The small data
21738 area can hold up to 64 kilobytes.
21740 @item -mzda=@var{n}
21741 @opindex mzda
21742 Put static or global variables whose size is @var{n} bytes or less into
21743 the first 32 kilobytes of memory.
21745 @item -mv850
21746 @opindex mv850
21747 Specify that the target processor is the V850.
21749 @item -mv850e3v5
21750 @opindex mv850e3v5
21751 Specify that the target processor is the V850E3V5.  The preprocessor
21752 constant @samp{__v850e3v5__} is defined if this option is used.
21754 @item -mv850e2v4
21755 @opindex mv850e2v4
21756 Specify that the target processor is the V850E3V5.  This is an alias for
21757 the @option{-mv850e3v5} option.
21759 @item -mv850e2v3
21760 @opindex mv850e2v3
21761 Specify that the target processor is the V850E2V3.  The preprocessor
21762 constant @samp{__v850e2v3__} is defined if this option is used.
21764 @item -mv850e2
21765 @opindex mv850e2
21766 Specify that the target processor is the V850E2.  The preprocessor
21767 constant @samp{__v850e2__} is defined if this option is used.
21769 @item -mv850e1
21770 @opindex mv850e1
21771 Specify that the target processor is the V850E1.  The preprocessor
21772 constants @samp{__v850e1__} and @samp{__v850e__} are defined if
21773 this option is used.
21775 @item -mv850es
21776 @opindex mv850es
21777 Specify that the target processor is the V850ES.  This is an alias for
21778 the @option{-mv850e1} option.
21780 @item -mv850e
21781 @opindex mv850e
21782 Specify that the target processor is the V850E@.  The preprocessor
21783 constant @samp{__v850e__} is defined if this option is used.
21785 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
21786 nor @option{-mv850e2} nor @option{-mv850e2v3} nor @option{-mv850e3v5}
21787 are defined then a default target processor is chosen and the
21788 relevant @samp{__v850*__} preprocessor constant is defined.
21790 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
21791 defined, regardless of which processor variant is the target.
21793 @item -mdisable-callt
21794 @itemx -mno-disable-callt
21795 @opindex mdisable-callt
21796 @opindex mno-disable-callt
21797 This option suppresses generation of the @code{CALLT} instruction for the
21798 v850e, v850e1, v850e2, v850e2v3 and v850e3v5 flavors of the v850
21799 architecture.
21801 This option is enabled by default when the RH850 ABI is
21802 in use (see @option{-mrh850-abi}), and disabled by default when the
21803 GCC ABI is in use.  If @code{CALLT} instructions are being generated
21804 then the C preprocessor symbol @code{__V850_CALLT__} will be defined.
21806 @item -mrelax
21807 @itemx -mno-relax
21808 @opindex mrelax
21809 @opindex mno-relax
21810 Pass on (or do not pass on) the @option{-mrelax} command line option
21811 to the assembler.
21813 @item -mlong-jumps
21814 @itemx -mno-long-jumps
21815 @opindex mlong-jumps
21816 @opindex mno-long-jumps
21817 Disable (or re-enable) the generation of PC-relative jump instructions.
21819 @item -msoft-float
21820 @itemx -mhard-float
21821 @opindex msoft-float
21822 @opindex mhard-float
21823 Disable (or re-enable) the generation of hardware floating point
21824 instructions.  This option is only significant when the target
21825 architecture is @samp{V850E2V3} or higher.  If hardware floating point
21826 instructions are being generated then the C preprocessor symbol
21827 @code{__FPU_OK__} will be defined, otherwise the symbol
21828 @code{__NO_FPU__} will be defined.
21830 @item -mloop
21831 @opindex mloop
21832 Enables the use of the e3v5 LOOP instruction.  The use of this
21833 instruction is not enabled by default when the e3v5 architecture is
21834 selected because its use is still experimental.
21836 @item -mrh850-abi
21837 @itemx -mghs
21838 @opindex mrh850-abi
21839 @opindex mghs
21840 Enables support for the RH850 version of the V850 ABI.  This is the
21841 default.  With this version of the ABI the following rules apply:
21843 @itemize
21844 @item
21845 Integer sized structures and unions are returned via a memory pointer
21846 rather than a register.
21848 @item
21849 Large structures and unions (more than 8 bytes in size) are passed by
21850 value.
21852 @item
21853 Functions are aligned to 16-bit boundaries.
21855 @item
21856 The @option{-m8byte-align} command line option is supported.
21858 @item
21859 The @option{-mdisable-callt} command line option is enabled by
21860 default.  The @option{-mno-disable-callt} command line option is not
21861 supported.
21862 @end itemize
21864 When this version of the ABI is enabled the C preprocessor symbol
21865 @code{__V850_RH850_ABI__} is defined.
21867 @item -mgcc-abi
21868 @opindex mgcc-abi
21869 Enables support for the old GCC version of the V850 ABI.  With this
21870 version of the ABI the following rules apply:
21872 @itemize
21873 @item
21874 Integer sized structures and unions are returned in register @code{r10}.
21876 @item
21877 Large structures and unions (more than 8 bytes in size) are passed by
21878 reference.
21880 @item
21881 Functions are aligned to 32-bit boundaries, unless optimizing for
21882 size.
21884 @item
21885 The @option{-m8byte-align} command line option is not supported.
21887 @item
21888 The @option{-mdisable-callt} command line option is supported but not
21889 enabled by default.
21890 @end itemize
21892 When this version of the ABI is enabled the C preprocessor symbol
21893 @code{__V850_GCC_ABI__} is defined.
21895 @item -m8byte-align
21896 @itemx -mno-8byte-align
21897 @opindex m8byte-align
21898 @opindex mno-8byte-align
21899 Enables support for @code{doubles} and @code{long long} types to be
21900 aligned on 8-byte boundaries.  The default is to restrict the
21901 alignment of all objects to at most 4-bytes.  When
21902 @option{-m8byte-align} is in effect the C preprocessor symbol
21903 @code{__V850_8BYTE_ALIGN__} will be defined.
21905 @item -mbig-switch
21906 @opindex mbig-switch
21907 Generate code suitable for big switch tables.  Use this option only if
21908 the assembler/linker complain about out of range branches within a switch
21909 table.
21911 @item -mapp-regs
21912 @opindex mapp-regs
21913 This option causes r2 and r5 to be used in the code generated by
21914 the compiler.  This setting is the default.
21916 @item -mno-app-regs
21917 @opindex mno-app-regs
21918 This option causes r2 and r5 to be treated as fixed registers.
21920 @end table
21922 @node VAX Options
21923 @subsection VAX Options
21924 @cindex VAX options
21926 These @samp{-m} options are defined for the VAX:
21928 @table @gcctabopt
21929 @item -munix
21930 @opindex munix
21931 Do not output certain jump instructions (@code{aobleq} and so on)
21932 that the Unix assembler for the VAX cannot handle across long
21933 ranges.
21935 @item -mgnu
21936 @opindex mgnu
21937 Do output those jump instructions, on the assumption that the
21938 GNU assembler is being used.
21940 @item -mg
21941 @opindex mg
21942 Output code for G-format floating-point numbers instead of D-format.
21943 @end table
21945 @node VMS Options
21946 @subsection VMS Options
21948 These @samp{-m} options are defined for the VMS implementations:
21950 @table @gcctabopt
21951 @item -mvms-return-codes
21952 @opindex mvms-return-codes
21953 Return VMS condition codes from @code{main}. The default is to return POSIX-style
21954 condition (e.g.@ error) codes.
21956 @item -mdebug-main=@var{prefix}
21957 @opindex mdebug-main=@var{prefix}
21958 Flag the first routine whose name starts with @var{prefix} as the main
21959 routine for the debugger.
21961 @item -mmalloc64
21962 @opindex mmalloc64
21963 Default to 64-bit memory allocation routines.
21965 @item -mpointer-size=@var{size}
21966 @opindex -mpointer-size=@var{size}
21967 Set the default size of pointers. Possible options for @var{size} are
21968 @samp{32} or @samp{short} for 32 bit pointers, @samp{64} or @samp{long}
21969 for 64 bit pointers, and @samp{no} for supporting only 32 bit pointers.
21970 The later option disables @code{pragma pointer_size}.
21971 @end table
21973 @node VxWorks Options
21974 @subsection VxWorks Options
21975 @cindex VxWorks Options
21977 The options in this section are defined for all VxWorks targets.
21978 Options specific to the target hardware are listed with the other
21979 options for that target.
21981 @table @gcctabopt
21982 @item -mrtp
21983 @opindex mrtp
21984 GCC can generate code for both VxWorks kernels and real time processes
21985 (RTPs).  This option switches from the former to the latter.  It also
21986 defines the preprocessor macro @code{__RTP__}.
21988 @item -non-static
21989 @opindex non-static
21990 Link an RTP executable against shared libraries rather than static
21991 libraries.  The options @option{-static} and @option{-shared} can
21992 also be used for RTPs (@pxref{Link Options}); @option{-static}
21993 is the default.
21995 @item -Bstatic
21996 @itemx -Bdynamic
21997 @opindex Bstatic
21998 @opindex Bdynamic
21999 These options are passed down to the linker.  They are defined for
22000 compatibility with Diab.
22002 @item -Xbind-lazy
22003 @opindex Xbind-lazy
22004 Enable lazy binding of function calls.  This option is equivalent to
22005 @option{-Wl,-z,now} and is defined for compatibility with Diab.
22007 @item -Xbind-now
22008 @opindex Xbind-now
22009 Disable lazy binding of function calls.  This option is the default and
22010 is defined for compatibility with Diab.
22011 @end table
22013 @node x86-64 Options
22014 @subsection x86-64 Options
22015 @cindex x86-64 options
22017 These are listed under @xref{i386 and x86-64 Options}.
22019 @node Xstormy16 Options
22020 @subsection Xstormy16 Options
22021 @cindex Xstormy16 Options
22023 These options are defined for Xstormy16:
22025 @table @gcctabopt
22026 @item -msim
22027 @opindex msim
22028 Choose startup files and linker script suitable for the simulator.
22029 @end table
22031 @node Xtensa Options
22032 @subsection Xtensa Options
22033 @cindex Xtensa Options
22035 These options are supported for Xtensa targets:
22037 @table @gcctabopt
22038 @item -mconst16
22039 @itemx -mno-const16
22040 @opindex mconst16
22041 @opindex mno-const16
22042 Enable or disable use of @code{CONST16} instructions for loading
22043 constant values.  The @code{CONST16} instruction is currently not a
22044 standard option from Tensilica.  When enabled, @code{CONST16}
22045 instructions are always used in place of the standard @code{L32R}
22046 instructions.  The use of @code{CONST16} is enabled by default only if
22047 the @code{L32R} instruction is not available.
22049 @item -mfused-madd
22050 @itemx -mno-fused-madd
22051 @opindex mfused-madd
22052 @opindex mno-fused-madd
22053 Enable or disable use of fused multiply/add and multiply/subtract
22054 instructions in the floating-point option.  This has no effect if the
22055 floating-point option is not also enabled.  Disabling fused multiply/add
22056 and multiply/subtract instructions forces the compiler to use separate
22057 instructions for the multiply and add/subtract operations.  This may be
22058 desirable in some cases where strict IEEE 754-compliant results are
22059 required: the fused multiply add/subtract instructions do not round the
22060 intermediate result, thereby producing results with @emph{more} bits of
22061 precision than specified by the IEEE standard.  Disabling fused multiply
22062 add/subtract instructions also ensures that the program output is not
22063 sensitive to the compiler's ability to combine multiply and add/subtract
22064 operations.
22066 @item -mserialize-volatile
22067 @itemx -mno-serialize-volatile
22068 @opindex mserialize-volatile
22069 @opindex mno-serialize-volatile
22070 When this option is enabled, GCC inserts @code{MEMW} instructions before
22071 @code{volatile} memory references to guarantee sequential consistency.
22072 The default is @option{-mserialize-volatile}.  Use
22073 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
22075 @item -mforce-no-pic
22076 @opindex mforce-no-pic
22077 For targets, like GNU/Linux, where all user-mode Xtensa code must be
22078 position-independent code (PIC), this option disables PIC for compiling
22079 kernel code.
22081 @item -mtext-section-literals
22082 @itemx -mno-text-section-literals
22083 @opindex mtext-section-literals
22084 @opindex mno-text-section-literals
22085 Control the treatment of literal pools.  The default is
22086 @option{-mno-text-section-literals}, which places literals in a separate
22087 section in the output file.  This allows the literal pool to be placed
22088 in a data RAM/ROM, and it also allows the linker to combine literal
22089 pools from separate object files to remove redundant literals and
22090 improve code size.  With @option{-mtext-section-literals}, the literals
22091 are interspersed in the text section in order to keep them as close as
22092 possible to their references.  This may be necessary for large assembly
22093 files.
22095 @item -mtarget-align
22096 @itemx -mno-target-align
22097 @opindex mtarget-align
22098 @opindex mno-target-align
22099 When this option is enabled, GCC instructs the assembler to
22100 automatically align instructions to reduce branch penalties at the
22101 expense of some code density.  The assembler attempts to widen density
22102 instructions to align branch targets and the instructions following call
22103 instructions.  If there are not enough preceding safe density
22104 instructions to align a target, no widening is performed.  The
22105 default is @option{-mtarget-align}.  These options do not affect the
22106 treatment of auto-aligned instructions like @code{LOOP}, which the
22107 assembler always aligns, either by widening density instructions or
22108 by inserting NOP instructions.
22110 @item -mlongcalls
22111 @itemx -mno-longcalls
22112 @opindex mlongcalls
22113 @opindex mno-longcalls
22114 When this option is enabled, GCC instructs the assembler to translate
22115 direct calls to indirect calls unless it can determine that the target
22116 of a direct call is in the range allowed by the call instruction.  This
22117 translation typically occurs for calls to functions in other source
22118 files.  Specifically, the assembler translates a direct @code{CALL}
22119 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
22120 The default is @option{-mno-longcalls}.  This option should be used in
22121 programs where the call target can potentially be out of range.  This
22122 option is implemented in the assembler, not the compiler, so the
22123 assembly code generated by GCC still shows direct call
22124 instructions---look at the disassembled object code to see the actual
22125 instructions.  Note that the assembler uses an indirect call for
22126 every cross-file call, not just those that really are out of range.
22127 @end table
22129 @node zSeries Options
22130 @subsection zSeries Options
22131 @cindex zSeries options
22133 These are listed under @xref{S/390 and zSeries Options}.
22135 @node Code Gen Options
22136 @section Options for Code Generation Conventions
22137 @cindex code generation conventions
22138 @cindex options, code generation
22139 @cindex run-time options
22141 These machine-independent options control the interface conventions
22142 used in code generation.
22144 Most of them have both positive and negative forms; the negative form
22145 of @option{-ffoo} is @option{-fno-foo}.  In the table below, only
22146 one of the forms is listed---the one that is not the default.  You
22147 can figure out the other form by either removing @samp{no-} or adding
22150 @table @gcctabopt
22151 @item -fbounds-check
22152 @opindex fbounds-check
22153 For front ends that support it, generate additional code to check that
22154 indices used to access arrays are within the declared range.  This is
22155 currently only supported by the Java and Fortran front ends, where
22156 this option defaults to true and false respectively.
22158 @item -fstack-reuse=@var{reuse-level}
22159 @opindex fstack_reuse
22160 This option controls stack space reuse for user declared local/auto variables
22161 and compiler generated temporaries.  @var{reuse_level} can be @samp{all},
22162 @samp{named_vars}, or @samp{none}. @samp{all} enables stack reuse for all
22163 local variables and temporaries, @samp{named_vars} enables the reuse only for
22164 user defined local variables with names, and @samp{none} disables stack reuse
22165 completely. The default value is @samp{all}. The option is needed when the
22166 program extends the lifetime of a scoped local variable or a compiler generated
22167 temporary beyond the end point defined by the language.  When a lifetime of
22168 a variable ends, and if the variable lives in memory, the optimizing compiler
22169 has the freedom to reuse its stack space with other temporaries or scoped
22170 local variables whose live range does not overlap with it. Legacy code extending
22171 local lifetime will likely to break with the stack reuse optimization.
22173 For example,
22175 @smallexample
22176    int *p;
22177    @{
22178      int local1;
22180      p = &local1;
22181      local1 = 10;
22182      ....
22183    @}
22184    @{
22185       int local2;
22186       local2 = 20;
22187       ...
22188    @}
22190    if (*p == 10)  // out of scope use of local1
22191      @{
22193      @}
22194 @end smallexample
22196 Another example:
22197 @smallexample
22199    struct A
22200    @{
22201        A(int k) : i(k), j(k) @{ @}
22202        int i;
22203        int j;
22204    @};
22206    A *ap;
22208    void foo(const A& ar)
22209    @{
22210       ap = &ar;
22211    @}
22213    void bar()
22214    @{
22215       foo(A(10)); // temp object's lifetime ends when foo returns
22217       @{
22218         A a(20);
22219         ....
22220       @}
22221       ap->i+= 10;  // ap references out of scope temp whose space
22222                    // is reused with a. What is the value of ap->i?
22223    @}
22225 @end smallexample
22227 The lifetime of a compiler generated temporary is well defined by the C++
22228 standard. When a lifetime of a temporary ends, and if the temporary lives
22229 in memory, the optimizing compiler has the freedom to reuse its stack
22230 space with other temporaries or scoped local variables whose live range
22231 does not overlap with it. However some of the legacy code relies on
22232 the behavior of older compilers in which temporaries' stack space is
22233 not reused, the aggressive stack reuse can lead to runtime errors. This
22234 option is used to control the temporary stack reuse optimization.
22236 @item -ftrapv
22237 @opindex ftrapv
22238 This option generates traps for signed overflow on addition, subtraction,
22239 multiplication operations.
22241 @item -fwrapv
22242 @opindex fwrapv
22243 This option instructs the compiler to assume that signed arithmetic
22244 overflow of addition, subtraction and multiplication wraps around
22245 using twos-complement representation.  This flag enables some optimizations
22246 and disables others.  This option is enabled by default for the Java
22247 front end, as required by the Java language specification.
22249 @item -fexceptions
22250 @opindex fexceptions
22251 Enable exception handling.  Generates extra code needed to propagate
22252 exceptions.  For some targets, this implies GCC generates frame
22253 unwind information for all functions, which can produce significant data
22254 size overhead, although it does not affect execution.  If you do not
22255 specify this option, GCC enables it by default for languages like
22256 C++ that normally require exception handling, and disables it for
22257 languages like C that do not normally require it.  However, you may need
22258 to enable this option when compiling C code that needs to interoperate
22259 properly with exception handlers written in C++.  You may also wish to
22260 disable this option if you are compiling older C++ programs that don't
22261 use exception handling.
22263 @item -fnon-call-exceptions
22264 @opindex fnon-call-exceptions
22265 Generate code that allows trapping instructions to throw exceptions.
22266 Note that this requires platform-specific runtime support that does
22267 not exist everywhere.  Moreover, it only allows @emph{trapping}
22268 instructions to throw exceptions, i.e.@: memory references or floating-point
22269 instructions.  It does not allow exceptions to be thrown from
22270 arbitrary signal handlers such as @code{SIGALRM}.
22272 @item -fdelete-dead-exceptions
22273 @opindex fdelete-dead-exceptions
22274 Consider that instructions that may throw exceptions but don't otherwise
22275 contribute to the execution of the program can be optimized away.
22276 This option is enabled by default for the Ada front end, as permitted by
22277 the Ada language specification.
22278 Optimization passes that cause dead exceptions to be removed are enabled independently at different optimization levels.
22280 @item -funwind-tables
22281 @opindex funwind-tables
22282 Similar to @option{-fexceptions}, except that it just generates any needed
22283 static data, but does not affect the generated code in any other way.
22284 You normally do not need to enable this option; instead, a language processor
22285 that needs this handling enables it on your behalf.
22287 @item -fasynchronous-unwind-tables
22288 @opindex fasynchronous-unwind-tables
22289 Generate unwind table in DWARF 2 format, if supported by target machine.  The
22290 table is exact at each instruction boundary, so it can be used for stack
22291 unwinding from asynchronous events (such as debugger or garbage collector).
22293 @item -fno-gnu-unique
22294 @opindex fno-gnu-unique
22295 On systems with recent GNU assembler and C library, the C++ compiler
22296 uses the @code{STB_GNU_UNIQUE} binding to make sure that definitions
22297 of template static data members and static local variables in inline
22298 functions are unique even in the presence of @code{RTLD_LOCAL}; this
22299 is necessary to avoid problems with a library used by two different
22300 @code{RTLD_LOCAL} plugins depending on a definition in one of them and
22301 therefore disagreeing with the other one about the binding of the
22302 symbol.  But this causes @code{dlclose} to be ignored for affected
22303 DSOs; if your program relies on reinitialization of a DSO via
22304 @code{dlclose} and @code{dlopen}, you can use
22305 @option{-fno-gnu-unique}.
22307 @item -fpcc-struct-return
22308 @opindex fpcc-struct-return
22309 Return ``short'' @code{struct} and @code{union} values in memory like
22310 longer ones, rather than in registers.  This convention is less
22311 efficient, but it has the advantage of allowing intercallability between
22312 GCC-compiled files and files compiled with other compilers, particularly
22313 the Portable C Compiler (pcc).
22315 The precise convention for returning structures in memory depends
22316 on the target configuration macros.
22318 Short structures and unions are those whose size and alignment match
22319 that of some integer type.
22321 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
22322 switch is not binary compatible with code compiled with the
22323 @option{-freg-struct-return} switch.
22324 Use it to conform to a non-default application binary interface.
22326 @item -freg-struct-return
22327 @opindex freg-struct-return
22328 Return @code{struct} and @code{union} values in registers when possible.
22329 This is more efficient for small structures than
22330 @option{-fpcc-struct-return}.
22332 If you specify neither @option{-fpcc-struct-return} nor
22333 @option{-freg-struct-return}, GCC defaults to whichever convention is
22334 standard for the target.  If there is no standard convention, GCC
22335 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
22336 the principal compiler.  In those cases, we can choose the standard, and
22337 we chose the more efficient register return alternative.
22339 @strong{Warning:} code compiled with the @option{-freg-struct-return}
22340 switch is not binary compatible with code compiled with the
22341 @option{-fpcc-struct-return} switch.
22342 Use it to conform to a non-default application binary interface.
22344 @item -fshort-enums
22345 @opindex fshort-enums
22346 Allocate to an @code{enum} type only as many bytes as it needs for the
22347 declared range of possible values.  Specifically, the @code{enum} type
22348 is equivalent to the smallest integer type that has enough room.
22350 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
22351 code that is not binary compatible with code generated without that switch.
22352 Use it to conform to a non-default application binary interface.
22354 @item -fshort-double
22355 @opindex fshort-double
22356 Use the same size for @code{double} as for @code{float}.
22358 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
22359 code that is not binary compatible with code generated without that switch.
22360 Use it to conform to a non-default application binary interface.
22362 @item -fshort-wchar
22363 @opindex fshort-wchar
22364 Override the underlying type for @samp{wchar_t} to be @samp{short
22365 unsigned int} instead of the default for the target.  This option is
22366 useful for building programs to run under WINE@.
22368 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
22369 code that is not binary compatible with code generated without that switch.
22370 Use it to conform to a non-default application binary interface.
22372 @item -fno-common
22373 @opindex fno-common
22374 In C code, controls the placement of uninitialized global variables.
22375 Unix C compilers have traditionally permitted multiple definitions of
22376 such variables in different compilation units by placing the variables
22377 in a common block.
22378 This is the behavior specified by @option{-fcommon}, and is the default
22379 for GCC on most targets.
22380 On the other hand, this behavior is not required by ISO C, and on some
22381 targets may carry a speed or code size penalty on variable references.
22382 The @option{-fno-common} option specifies that the compiler should place
22383 uninitialized global variables in the data section of the object file,
22384 rather than generating them as common blocks.
22385 This has the effect that if the same variable is declared
22386 (without @code{extern}) in two different compilations,
22387 you get a multiple-definition error when you link them.
22388 In this case, you must compile with @option{-fcommon} instead.
22389 Compiling with @option{-fno-common} is useful on targets for which
22390 it provides better performance, or if you wish to verify that the
22391 program will work on other systems that always treat uninitialized
22392 variable declarations this way.
22394 @item -fno-ident
22395 @opindex fno-ident
22396 Ignore the @samp{#ident} directive.
22398 @item -finhibit-size-directive
22399 @opindex finhibit-size-directive
22400 Don't output a @code{.size} assembler directive, or anything else that
22401 would cause trouble if the function is split in the middle, and the
22402 two halves are placed at locations far apart in memory.  This option is
22403 used when compiling @file{crtstuff.c}; you should not need to use it
22404 for anything else.
22406 @item -fverbose-asm
22407 @opindex fverbose-asm
22408 Put extra commentary information in the generated assembly code to
22409 make it more readable.  This option is generally only of use to those
22410 who actually need to read the generated assembly code (perhaps while
22411 debugging the compiler itself).
22413 @option{-fno-verbose-asm}, the default, causes the
22414 extra information to be omitted and is useful when comparing two assembler
22415 files.
22417 @item -frecord-gcc-switches
22418 @opindex frecord-gcc-switches
22419 This switch causes the command line used to invoke the
22420 compiler to be recorded into the object file that is being created.
22421 This switch is only implemented on some targets and the exact format
22422 of the recording is target and binary file format dependent, but it
22423 usually takes the form of a section containing ASCII text.  This
22424 switch is related to the @option{-fverbose-asm} switch, but that
22425 switch only records information in the assembler output file as
22426 comments, so it never reaches the object file.
22427 See also @option{-grecord-gcc-switches} for another
22428 way of storing compiler options into the object file.
22430 @item -fpic
22431 @opindex fpic
22432 @cindex global offset table
22433 @cindex PIC
22434 Generate position-independent code (PIC) suitable for use in a shared
22435 library, if supported for the target machine.  Such code accesses all
22436 constant addresses through a global offset table (GOT)@.  The dynamic
22437 loader resolves the GOT entries when the program starts (the dynamic
22438 loader is not part of GCC; it is part of the operating system).  If
22439 the GOT size for the linked executable exceeds a machine-specific
22440 maximum size, you get an error message from the linker indicating that
22441 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
22442 instead.  (These maximums are 8k on the SPARC and 32k
22443 on the m68k and RS/6000.  The 386 has no such limit.)
22445 Position-independent code requires special support, and therefore works
22446 only on certain machines.  For the 386, GCC supports PIC for System V
22447 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
22448 position-independent.
22450 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
22451 are defined to 1.
22453 @item -fPIC
22454 @opindex fPIC
22455 If supported for the target machine, emit position-independent code,
22456 suitable for dynamic linking and avoiding any limit on the size of the
22457 global offset table.  This option makes a difference on the m68k,
22458 PowerPC and SPARC@.
22460 Position-independent code requires special support, and therefore works
22461 only on certain machines.
22463 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
22464 are defined to 2.
22466 @item -fpie
22467 @itemx -fPIE
22468 @opindex fpie
22469 @opindex fPIE
22470 These options are similar to @option{-fpic} and @option{-fPIC}, but
22471 generated position independent code can be only linked into executables.
22472 Usually these options are used when @option{-pie} GCC option is
22473 used during linking.
22475 @option{-fpie} and @option{-fPIE} both define the macros
22476 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
22477 for @option{-fpie} and 2 for @option{-fPIE}.
22479 @item -fno-jump-tables
22480 @opindex fno-jump-tables
22481 Do not use jump tables for switch statements even where it would be
22482 more efficient than other code generation strategies.  This option is
22483 of use in conjunction with @option{-fpic} or @option{-fPIC} for
22484 building code that forms part of a dynamic linker and cannot
22485 reference the address of a jump table.  On some targets, jump tables
22486 do not require a GOT and this option is not needed.
22488 @item -ffixed-@var{reg}
22489 @opindex ffixed
22490 Treat the register named @var{reg} as a fixed register; generated code
22491 should never refer to it (except perhaps as a stack pointer, frame
22492 pointer or in some other fixed role).
22494 @var{reg} must be the name of a register.  The register names accepted
22495 are machine-specific and are defined in the @code{REGISTER_NAMES}
22496 macro in the machine description macro file.
22498 This flag does not have a negative form, because it specifies a
22499 three-way choice.
22501 @item -fcall-used-@var{reg}
22502 @opindex fcall-used
22503 Treat the register named @var{reg} as an allocable register that is
22504 clobbered by function calls.  It may be allocated for temporaries or
22505 variables that do not live across a call.  Functions compiled this way
22506 do not save and restore the register @var{reg}.
22508 It is an error to use this flag with the frame pointer or stack pointer.
22509 Use of this flag for other registers that have fixed pervasive roles in
22510 the machine's execution model produces disastrous results.
22512 This flag does not have a negative form, because it specifies a
22513 three-way choice.
22515 @item -fcall-saved-@var{reg}
22516 @opindex fcall-saved
22517 Treat the register named @var{reg} as an allocable register saved by
22518 functions.  It may be allocated even for temporaries or variables that
22519 live across a call.  Functions compiled this way save and restore
22520 the register @var{reg} if they use it.
22522 It is an error to use this flag with the frame pointer or stack pointer.
22523 Use of this flag for other registers that have fixed pervasive roles in
22524 the machine's execution model produces disastrous results.
22526 A different sort of disaster results from the use of this flag for
22527 a register in which function values may be returned.
22529 This flag does not have a negative form, because it specifies a
22530 three-way choice.
22532 @item -fpack-struct[=@var{n}]
22533 @opindex fpack-struct
22534 Without a value specified, pack all structure members together without
22535 holes.  When a value is specified (which must be a small power of two), pack
22536 structure members according to this value, representing the maximum
22537 alignment (that is, objects with default alignment requirements larger than
22538 this are output potentially unaligned at the next fitting location.
22540 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
22541 code that is not binary compatible with code generated without that switch.
22542 Additionally, it makes the code suboptimal.
22543 Use it to conform to a non-default application binary interface.
22545 @item -finstrument-functions
22546 @opindex finstrument-functions
22547 Generate instrumentation calls for entry and exit to functions.  Just
22548 after function entry and just before function exit, the following
22549 profiling functions are called with the address of the current
22550 function and its call site.  (On some platforms,
22551 @code{__builtin_return_address} does not work beyond the current
22552 function, so the call site information may not be available to the
22553 profiling functions otherwise.)
22555 @smallexample
22556 void __cyg_profile_func_enter (void *this_fn,
22557                                void *call_site);
22558 void __cyg_profile_func_exit  (void *this_fn,
22559                                void *call_site);
22560 @end smallexample
22562 The first argument is the address of the start of the current function,
22563 which may be looked up exactly in the symbol table.
22565 This instrumentation is also done for functions expanded inline in other
22566 functions.  The profiling calls indicate where, conceptually, the
22567 inline function is entered and exited.  This means that addressable
22568 versions of such functions must be available.  If all your uses of a
22569 function are expanded inline, this may mean an additional expansion of
22570 code size.  If you use @samp{extern inline} in your C code, an
22571 addressable version of such functions must be provided.  (This is
22572 normally the case anyway, but if you get lucky and the optimizer always
22573 expands the functions inline, you might have gotten away without
22574 providing static copies.)
22576 A function may be given the attribute @code{no_instrument_function}, in
22577 which case this instrumentation is not done.  This can be used, for
22578 example, for the profiling functions listed above, high-priority
22579 interrupt routines, and any functions from which the profiling functions
22580 cannot safely be called (perhaps signal handlers, if the profiling
22581 routines generate output or allocate memory).
22583 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
22584 @opindex finstrument-functions-exclude-file-list
22586 Set the list of functions that are excluded from instrumentation (see
22587 the description of @code{-finstrument-functions}).  If the file that
22588 contains a function definition matches with one of @var{file}, then
22589 that function is not instrumented.  The match is done on substrings:
22590 if the @var{file} parameter is a substring of the file name, it is
22591 considered to be a match.
22593 For example:
22595 @smallexample
22596 -finstrument-functions-exclude-file-list=/bits/stl,include/sys
22597 @end smallexample
22599 @noindent
22600 excludes any inline function defined in files whose pathnames
22601 contain @code{/bits/stl} or @code{include/sys}.
22603 If, for some reason, you want to include letter @code{','} in one of
22604 @var{sym}, write @code{'\,'}. For example,
22605 @code{-finstrument-functions-exclude-file-list='\,\,tmp'}
22606 (note the single quote surrounding the option).
22608 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
22609 @opindex finstrument-functions-exclude-function-list
22611 This is similar to @code{-finstrument-functions-exclude-file-list},
22612 but this option sets the list of function names to be excluded from
22613 instrumentation.  The function name to be matched is its user-visible
22614 name, such as @code{vector<int> blah(const vector<int> &)}, not the
22615 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
22616 match is done on substrings: if the @var{sym} parameter is a substring
22617 of the function name, it is considered to be a match.  For C99 and C++
22618 extended identifiers, the function name must be given in UTF-8, not
22619 using universal character names.
22621 @item -fstack-check
22622 @opindex fstack-check
22623 Generate code to verify that you do not go beyond the boundary of the
22624 stack.  You should specify this flag if you are running in an
22625 environment with multiple threads, but you only rarely need to specify it in
22626 a single-threaded environment since stack overflow is automatically
22627 detected on nearly all systems if there is only one stack.
22629 Note that this switch does not actually cause checking to be done; the
22630 operating system or the language runtime must do that.  The switch causes
22631 generation of code to ensure that they see the stack being extended.
22633 You can additionally specify a string parameter: @code{no} means no
22634 checking, @code{generic} means force the use of old-style checking,
22635 @code{specific} means use the best checking method and is equivalent
22636 to bare @option{-fstack-check}.
22638 Old-style checking is a generic mechanism that requires no specific
22639 target support in the compiler but comes with the following drawbacks:
22641 @enumerate
22642 @item
22643 Modified allocation strategy for large objects: they are always
22644 allocated dynamically if their size exceeds a fixed threshold.
22646 @item
22647 Fixed limit on the size of the static frame of functions: when it is
22648 topped by a particular function, stack checking is not reliable and
22649 a warning is issued by the compiler.
22651 @item
22652 Inefficiency: because of both the modified allocation strategy and the
22653 generic implementation, code performance is hampered.
22654 @end enumerate
22656 Note that old-style stack checking is also the fallback method for
22657 @code{specific} if no target support has been added in the compiler.
22659 @item -fstack-limit-register=@var{reg}
22660 @itemx -fstack-limit-symbol=@var{sym}
22661 @itemx -fno-stack-limit
22662 @opindex fstack-limit-register
22663 @opindex fstack-limit-symbol
22664 @opindex fno-stack-limit
22665 Generate code to ensure that the stack does not grow beyond a certain value,
22666 either the value of a register or the address of a symbol.  If a larger
22667 stack is required, a signal is raised at run time.  For most targets,
22668 the signal is raised before the stack overruns the boundary, so
22669 it is possible to catch the signal without taking special precautions.
22671 For instance, if the stack starts at absolute address @samp{0x80000000}
22672 and grows downwards, you can use the flags
22673 @option{-fstack-limit-symbol=__stack_limit} and
22674 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
22675 of 128KB@.  Note that this may only work with the GNU linker.
22677 @item -fsplit-stack
22678 @opindex fsplit-stack
22679 Generate code to automatically split the stack before it overflows.
22680 The resulting program has a discontiguous stack which can only
22681 overflow if the program is unable to allocate any more memory.  This
22682 is most useful when running threaded programs, as it is no longer
22683 necessary to calculate a good stack size to use for each thread.  This
22684 is currently only implemented for the i386 and x86_64 back ends running
22685 GNU/Linux.
22687 When code compiled with @option{-fsplit-stack} calls code compiled
22688 without @option{-fsplit-stack}, there may not be much stack space
22689 available for the latter code to run.  If compiling all code,
22690 including library code, with @option{-fsplit-stack} is not an option,
22691 then the linker can fix up these calls so that the code compiled
22692 without @option{-fsplit-stack} always has a large stack.  Support for
22693 this is implemented in the gold linker in GNU binutils release 2.21
22694 and later.
22696 @item -fleading-underscore
22697 @opindex fleading-underscore
22698 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
22699 change the way C symbols are represented in the object file.  One use
22700 is to help link with legacy assembly code.
22702 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
22703 generate code that is not binary compatible with code generated without that
22704 switch.  Use it to conform to a non-default application binary interface.
22705 Not all targets provide complete support for this switch.
22707 @item -ftls-model=@var{model}
22708 @opindex ftls-model
22709 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
22710 The @var{model} argument should be one of @code{global-dynamic},
22711 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
22712 Note that the choice is subject to optimization: the compiler may use
22713 a more efficient model for symbols not visible outside of the translation
22714 unit, or if @option{-fpic} is not given on the command line.
22716 The default without @option{-fpic} is @code{initial-exec}; with
22717 @option{-fpic} the default is @code{global-dynamic}.
22719 @item -fvisibility=@var{default|internal|hidden|protected}
22720 @opindex fvisibility
22721 Set the default ELF image symbol visibility to the specified option---all
22722 symbols are marked with this unless overridden within the code.
22723 Using this feature can very substantially improve linking and
22724 load times of shared object libraries, produce more optimized
22725 code, provide near-perfect API export and prevent symbol clashes.
22726 It is @strong{strongly} recommended that you use this in any shared objects
22727 you distribute.
22729 Despite the nomenclature, @code{default} always means public; i.e.,
22730 available to be linked against from outside the shared object.
22731 @code{protected} and @code{internal} are pretty useless in real-world
22732 usage so the only other commonly used option is @code{hidden}.
22733 The default if @option{-fvisibility} isn't specified is
22734 @code{default}, i.e., make every
22735 symbol public---this causes the same behavior as previous versions of
22736 GCC@.
22738 A good explanation of the benefits offered by ensuring ELF
22739 symbols have the correct visibility is given by ``How To Write
22740 Shared Libraries'' by Ulrich Drepper (which can be found at
22741 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
22742 solution made possible by this option to marking things hidden when
22743 the default is public is to make the default hidden and mark things
22744 public.  This is the norm with DLLs on Windows and with @option{-fvisibility=hidden}
22745 and @code{__attribute__ ((visibility("default")))} instead of
22746 @code{__declspec(dllexport)} you get almost identical semantics with
22747 identical syntax.  This is a great boon to those working with
22748 cross-platform projects.
22750 For those adding visibility support to existing code, you may find
22751 @samp{#pragma GCC visibility} of use.  This works by you enclosing
22752 the declarations you wish to set visibility for with (for example)
22753 @samp{#pragma GCC visibility push(hidden)} and
22754 @samp{#pragma GCC visibility pop}.
22755 Bear in mind that symbol visibility should be viewed @strong{as
22756 part of the API interface contract} and thus all new code should
22757 always specify visibility when it is not the default; i.e., declarations
22758 only for use within the local DSO should @strong{always} be marked explicitly
22759 as hidden as so to avoid PLT indirection overheads---making this
22760 abundantly clear also aids readability and self-documentation of the code.
22761 Note that due to ISO C++ specification requirements, @code{operator new} and
22762 @code{operator delete} must always be of default visibility.
22764 Be aware that headers from outside your project, in particular system
22765 headers and headers from any other library you use, may not be
22766 expecting to be compiled with visibility other than the default.  You
22767 may need to explicitly say @samp{#pragma GCC visibility push(default)}
22768 before including any such headers.
22770 @samp{extern} declarations are not affected by @option{-fvisibility}, so
22771 a lot of code can be recompiled with @option{-fvisibility=hidden} with
22772 no modifications.  However, this means that calls to @code{extern}
22773 functions with no explicit visibility use the PLT, so it is more
22774 effective to use @code{__attribute ((visibility))} and/or
22775 @code{#pragma GCC visibility} to tell the compiler which @code{extern}
22776 declarations should be treated as hidden.
22778 Note that @option{-fvisibility} does affect C++ vague linkage
22779 entities. This means that, for instance, an exception class that is
22780 be thrown between DSOs must be explicitly marked with default
22781 visibility so that the @samp{type_info} nodes are unified between
22782 the DSOs.
22784 An overview of these techniques, their benefits and how to use them
22785 is at @uref{http://gcc.gnu.org/@/wiki/@/Visibility}.
22787 @item -fstrict-volatile-bitfields
22788 @opindex fstrict-volatile-bitfields
22789 This option should be used if accesses to volatile bit-fields (or other
22790 structure fields, although the compiler usually honors those types
22791 anyway) should use a single access of the width of the
22792 field's type, aligned to a natural alignment if possible.  For
22793 example, targets with memory-mapped peripheral registers might require
22794 all such accesses to be 16 bits wide; with this flag you can
22795 declare all peripheral bit-fields as @code{unsigned short} (assuming short
22796 is 16 bits on these targets) to force GCC to use 16-bit accesses
22797 instead of, perhaps, a more efficient 32-bit access.
22799 If this option is disabled, the compiler uses the most efficient
22800 instruction.  In the previous example, that might be a 32-bit load
22801 instruction, even though that accesses bytes that do not contain
22802 any portion of the bit-field, or memory-mapped registers unrelated to
22803 the one being updated.
22805 In some cases, such as when the @code{packed} attribute is applied to a 
22806 structure field, it may not be possible to access the field with a single
22807 read or write that is correctly aligned for the target machine.  In this
22808 case GCC falls back to generating multiple accesses rather than code that 
22809 will fault or truncate the result at run time.
22811 Note:  Due to restrictions of the C/C++11 memory model, write accesses are
22812 not allowed to touch non bit-field members.  It is therefore recommended
22813 to define all bits of the field's type as bit-field members.
22815 The default value of this option is determined by the application binary
22816 interface for the target processor.
22818 @item -fsync-libcalls
22819 @opindex fsync-libcalls
22820 This option controls whether any out-of-line instance of the @code{__sync}
22821 family of functions may be used to implement the C++11 @code{__atomic}
22822 family of functions.
22824 The default value of this option is enabled, thus the only useful form
22825 of the option is @option{-fno-sync-libcalls}.  This option is used in
22826 the implementation of the @file{libatomic} runtime library.
22828 @end table
22830 @c man end
22832 @node Environment Variables
22833 @section Environment Variables Affecting GCC
22834 @cindex environment variables
22836 @c man begin ENVIRONMENT
22837 This section describes several environment variables that affect how GCC
22838 operates.  Some of them work by specifying directories or prefixes to use
22839 when searching for various kinds of files.  Some are used to specify other
22840 aspects of the compilation environment.
22842 Note that you can also specify places to search using options such as
22843 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
22844 take precedence over places specified using environment variables, which
22845 in turn take precedence over those specified by the configuration of GCC@.
22846 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
22847 GNU Compiler Collection (GCC) Internals}.
22849 @table @env
22850 @item LANG
22851 @itemx LC_CTYPE
22852 @c @itemx LC_COLLATE
22853 @itemx LC_MESSAGES
22854 @c @itemx LC_MONETARY
22855 @c @itemx LC_NUMERIC
22856 @c @itemx LC_TIME
22857 @itemx LC_ALL
22858 @findex LANG
22859 @findex LC_CTYPE
22860 @c @findex LC_COLLATE
22861 @findex LC_MESSAGES
22862 @c @findex LC_MONETARY
22863 @c @findex LC_NUMERIC
22864 @c @findex LC_TIME
22865 @findex LC_ALL
22866 @cindex locale
22867 These environment variables control the way that GCC uses
22868 localization information which allows GCC to work with different
22869 national conventions.  GCC inspects the locale categories
22870 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
22871 so.  These locale categories can be set to any value supported by your
22872 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
22873 Kingdom encoded in UTF-8.
22875 The @env{LC_CTYPE} environment variable specifies character
22876 classification.  GCC uses it to determine the character boundaries in
22877 a string; this is needed for some multibyte encodings that contain quote
22878 and escape characters that are otherwise interpreted as a string
22879 end or escape.
22881 The @env{LC_MESSAGES} environment variable specifies the language to
22882 use in diagnostic messages.
22884 If the @env{LC_ALL} environment variable is set, it overrides the value
22885 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
22886 and @env{LC_MESSAGES} default to the value of the @env{LANG}
22887 environment variable.  If none of these variables are set, GCC
22888 defaults to traditional C English behavior.
22890 @item TMPDIR
22891 @findex TMPDIR
22892 If @env{TMPDIR} is set, it specifies the directory to use for temporary
22893 files.  GCC uses temporary files to hold the output of one stage of
22894 compilation which is to be used as input to the next stage: for example,
22895 the output of the preprocessor, which is the input to the compiler
22896 proper.
22898 @item GCC_COMPARE_DEBUG
22899 @findex GCC_COMPARE_DEBUG
22900 Setting @env{GCC_COMPARE_DEBUG} is nearly equivalent to passing
22901 @option{-fcompare-debug} to the compiler driver.  See the documentation
22902 of this option for more details.
22904 @item GCC_EXEC_PREFIX
22905 @findex GCC_EXEC_PREFIX
22906 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
22907 names of the subprograms executed by the compiler.  No slash is added
22908 when this prefix is combined with the name of a subprogram, but you can
22909 specify a prefix that ends with a slash if you wish.
22911 If @env{GCC_EXEC_PREFIX} is not set, GCC attempts to figure out
22912 an appropriate prefix to use based on the pathname it is invoked with.
22914 If GCC cannot find the subprogram using the specified prefix, it
22915 tries looking in the usual places for the subprogram.
22917 The default value of @env{GCC_EXEC_PREFIX} is
22918 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
22919 the installed compiler. In many cases @var{prefix} is the value
22920 of @code{prefix} when you ran the @file{configure} script.
22922 Other prefixes specified with @option{-B} take precedence over this prefix.
22924 This prefix is also used for finding files such as @file{crt0.o} that are
22925 used for linking.
22927 In addition, the prefix is used in an unusual way in finding the
22928 directories to search for header files.  For each of the standard
22929 directories whose name normally begins with @samp{/usr/local/lib/gcc}
22930 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
22931 replacing that beginning with the specified prefix to produce an
22932 alternate directory name.  Thus, with @option{-Bfoo/}, GCC searches
22933 @file{foo/bar} just before it searches the standard directory 
22934 @file{/usr/local/lib/bar}.
22935 If a standard directory begins with the configured
22936 @var{prefix} then the value of @var{prefix} is replaced by
22937 @env{GCC_EXEC_PREFIX} when looking for header files.
22939 @item COMPILER_PATH
22940 @findex COMPILER_PATH
22941 The value of @env{COMPILER_PATH} is a colon-separated list of
22942 directories, much like @env{PATH}.  GCC tries the directories thus
22943 specified when searching for subprograms, if it can't find the
22944 subprograms using @env{GCC_EXEC_PREFIX}.
22946 @item LIBRARY_PATH
22947 @findex LIBRARY_PATH
22948 The value of @env{LIBRARY_PATH} is a colon-separated list of
22949 directories, much like @env{PATH}.  When configured as a native compiler,
22950 GCC tries the directories thus specified when searching for special
22951 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
22952 using GCC also uses these directories when searching for ordinary
22953 libraries for the @option{-l} option (but directories specified with
22954 @option{-L} come first).
22956 @item LANG
22957 @findex LANG
22958 @cindex locale definition
22959 This variable is used to pass locale information to the compiler.  One way in
22960 which this information is used is to determine the character set to be used
22961 when character literals, string literals and comments are parsed in C and C++.
22962 When the compiler is configured to allow multibyte characters,
22963 the following values for @env{LANG} are recognized:
22965 @table @samp
22966 @item C-JIS
22967 Recognize JIS characters.
22968 @item C-SJIS
22969 Recognize SJIS characters.
22970 @item C-EUCJP
22971 Recognize EUCJP characters.
22972 @end table
22974 If @env{LANG} is not defined, or if it has some other value, then the
22975 compiler uses @code{mblen} and @code{mbtowc} as defined by the default locale to
22976 recognize and translate multibyte characters.
22977 @end table
22979 @noindent
22980 Some additional environment variables affect the behavior of the
22981 preprocessor.
22983 @include cppenv.texi
22985 @c man end
22987 @node Precompiled Headers
22988 @section Using Precompiled Headers
22989 @cindex precompiled headers
22990 @cindex speed of compilation
22992 Often large projects have many header files that are included in every
22993 source file.  The time the compiler takes to process these header files
22994 over and over again can account for nearly all of the time required to
22995 build the project.  To make builds faster, GCC allows you to
22996 @dfn{precompile} a header file.
22998 To create a precompiled header file, simply compile it as you would any
22999 other file, if necessary using the @option{-x} option to make the driver
23000 treat it as a C or C++ header file.  You may want to use a
23001 tool like @command{make} to keep the precompiled header up-to-date when
23002 the headers it contains change.
23004 A precompiled header file is searched for when @code{#include} is
23005 seen in the compilation.  As it searches for the included file
23006 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
23007 compiler looks for a precompiled header in each directory just before it
23008 looks for the include file in that directory.  The name searched for is
23009 the name specified in the @code{#include} with @samp{.gch} appended.  If
23010 the precompiled header file can't be used, it is ignored.
23012 For instance, if you have @code{#include "all.h"}, and you have
23013 @file{all.h.gch} in the same directory as @file{all.h}, then the
23014 precompiled header file is used if possible, and the original
23015 header is used otherwise.
23017 Alternatively, you might decide to put the precompiled header file in a
23018 directory and use @option{-I} to ensure that directory is searched
23019 before (or instead of) the directory containing the original header.
23020 Then, if you want to check that the precompiled header file is always
23021 used, you can put a file of the same name as the original header in this
23022 directory containing an @code{#error} command.
23024 This also works with @option{-include}.  So yet another way to use
23025 precompiled headers, good for projects not designed with precompiled
23026 header files in mind, is to simply take most of the header files used by
23027 a project, include them from another header file, precompile that header
23028 file, and @option{-include} the precompiled header.  If the header files
23029 have guards against multiple inclusion, they are skipped because
23030 they've already been included (in the precompiled header).
23032 If you need to precompile the same header file for different
23033 languages, targets, or compiler options, you can instead make a
23034 @emph{directory} named like @file{all.h.gch}, and put each precompiled
23035 header in the directory, perhaps using @option{-o}.  It doesn't matter
23036 what you call the files in the directory; every precompiled header in
23037 the directory is considered.  The first precompiled header
23038 encountered in the directory that is valid for this compilation is
23039 used; they're searched in no particular order.
23041 There are many other possibilities, limited only by your imagination,
23042 good sense, and the constraints of your build system.
23044 A precompiled header file can be used only when these conditions apply:
23046 @itemize
23047 @item
23048 Only one precompiled header can be used in a particular compilation.
23050 @item
23051 A precompiled header can't be used once the first C token is seen.  You
23052 can have preprocessor directives before a precompiled header; you cannot
23053 include a precompiled header from inside another header.
23055 @item
23056 The precompiled header file must be produced for the same language as
23057 the current compilation.  You can't use a C precompiled header for a C++
23058 compilation.
23060 @item
23061 The precompiled header file must have been produced by the same compiler
23062 binary as the current compilation is using.
23064 @item
23065 Any macros defined before the precompiled header is included must
23066 either be defined in the same way as when the precompiled header was
23067 generated, or must not affect the precompiled header, which usually
23068 means that they don't appear in the precompiled header at all.
23070 The @option{-D} option is one way to define a macro before a
23071 precompiled header is included; using a @code{#define} can also do it.
23072 There are also some options that define macros implicitly, like
23073 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
23074 defined this way.
23076 @item If debugging information is output when using the precompiled
23077 header, using @option{-g} or similar, the same kind of debugging information
23078 must have been output when building the precompiled header.  However,
23079 a precompiled header built using @option{-g} can be used in a compilation
23080 when no debugging information is being output.
23082 @item The same @option{-m} options must generally be used when building
23083 and using the precompiled header.  @xref{Submodel Options},
23084 for any cases where this rule is relaxed.
23086 @item Each of the following options must be the same when building and using
23087 the precompiled header:
23089 @gccoptlist{-fexceptions}
23091 @item
23092 Some other command-line options starting with @option{-f},
23093 @option{-p}, or @option{-O} must be defined in the same way as when
23094 the precompiled header was generated.  At present, it's not clear
23095 which options are safe to change and which are not; the safest choice
23096 is to use exactly the same options when generating and using the
23097 precompiled header.  The following are known to be safe:
23099 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
23100 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
23101 -fsched-verbose=@var{number}  -fschedule-insns  -fvisibility= @gol
23102 -pedantic-errors}
23104 @end itemize
23106 For all of these except the last, the compiler automatically
23107 ignores the precompiled header if the conditions aren't met.  If you
23108 find an option combination that doesn't work and doesn't cause the
23109 precompiled header to be ignored, please consider filing a bug report,
23110 see @ref{Bugs}.
23112 If you do use differing options when generating and using the
23113 precompiled header, the actual behavior is a mixture of the
23114 behavior for the options.  For instance, if you use @option{-g} to
23115 generate the precompiled header but not when using it, you may or may
23116 not get debugging information for routines in the precompiled header.