svn merge -r210100:210672 svn+ssh://gcc.gnu.org/svn/gcc/trunk
[official-gcc.git] / gcc / doc / invoke.texi
blobe078f04a435620f0a9a476958d704485ed8abbee
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 -fopenacc -fopenmp -fopenmp-simd @gol
172 -fms-extensions -fplan9-extensions -trigraphs -traditional -traditional-cpp @gol
173 -fallow-single-precision  -fcond-mismatch -flax-vector-conversions @gol
174 -fsigned-bitfields  -fsigned-char @gol
175 -funsigned-bitfields  -funsigned-char}
177 @item C++ Language Options
178 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
179 @gccoptlist{-fabi-version=@var{n}  -fno-access-control  -fcheck-new @gol
180 -fconstexpr-depth=@var{n}  -ffriend-injection @gol
181 -fno-elide-constructors @gol
182 -fno-enforce-eh-specs @gol
183 -ffor-scope  -fno-for-scope  -fno-gnu-keywords @gol
184 -fno-implicit-templates @gol
185 -fno-implicit-inline-templates @gol
186 -fno-implement-inlines  -fms-extensions @gol
187 -fno-nonansi-builtins  -fnothrow-opt  -fno-operator-names @gol
188 -fno-optional-diags  -fpermissive @gol
189 -fno-pretty-templates @gol
190 -frepo  -fno-rtti  -fstats  -ftemplate-backtrace-limit=@var{n} @gol
191 -ftemplate-depth=@var{n} @gol
192 -fno-threadsafe-statics -fuse-cxa-atexit  -fno-weak  -nostdinc++ @gol
193 -fvisibility-inlines-hidden @gol
194 -fvtable-verify=@var{std|preinit|none} @gol
195 -fvtv-counts -fvtv-debug @gol
196 -fvisibility-ms-compat @gol
197 -fext-numeric-literals @gol
198 -Wabi  -Wconversion-null  -Wctor-dtor-privacy @gol
199 -Wdelete-non-virtual-dtor -Wliteral-suffix -Wnarrowing @gol
200 -Wnoexcept -Wnon-virtual-dtor  -Wreorder @gol
201 -Weffc++  -Wstrict-null-sentinel @gol
202 -Wno-non-template-friend  -Wold-style-cast @gol
203 -Woverloaded-virtual  -Wno-pmf-conversions @gol
204 -Wsign-promo}
206 @item Objective-C and Objective-C++ Language Options
207 @xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling
208 Objective-C and Objective-C++ Dialects}.
209 @gccoptlist{-fconstant-string-class=@var{class-name} @gol
210 -fgnu-runtime  -fnext-runtime @gol
211 -fno-nil-receivers @gol
212 -fobjc-abi-version=@var{n} @gol
213 -fobjc-call-cxx-cdtors @gol
214 -fobjc-direct-dispatch @gol
215 -fobjc-exceptions @gol
216 -fobjc-gc @gol
217 -fobjc-nilcheck @gol
218 -fobjc-std=objc1 @gol
219 -fno-local-ivars @gol
220 -fivar-visibility=@var{public|protected|private|package} @gol
221 -freplace-objc-classes @gol
222 -fzero-link @gol
223 -gen-decls @gol
224 -Wassign-intercept @gol
225 -Wno-protocol  -Wselector @gol
226 -Wstrict-selector-match @gol
227 -Wundeclared-selector}
229 @item Language Independent Options
230 @xref{Language Independent Options,,Options to Control Diagnostic Messages Formatting}.
231 @gccoptlist{-fmessage-length=@var{n}  @gol
232 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol
233 -fdiagnostics-color=@r{[}auto@r{|}never@r{|}always@r{]}  @gol
234 -fno-diagnostics-show-option -fno-diagnostics-show-caret}
236 @item Warning Options
237 @xref{Warning Options,,Options to Request or Suppress Warnings}.
238 @gccoptlist{-fsyntax-only  -fmax-errors=@var{n}  -Wpedantic @gol
239 -pedantic-errors @gol
240 -w  -Wextra  -Wall  -Waddress  -Waggregate-return  @gol
241 -Waggressive-loop-optimizations -Warray-bounds @gol
242 -Wno-attributes -Wno-builtin-macro-redefined @gol
243 -Wc++-compat -Wc++11-compat -Wcast-align  -Wcast-qual  @gol
244 -Wchar-subscripts -Wclobbered  -Wcomment -Wconditionally-supported  @gol
245 -Wconversion -Wcoverage-mismatch -Wdate-time -Wdelete-incomplete -Wno-cpp  @gol
246 -Wno-deprecated -Wno-deprecated-declarations -Wdisabled-optimization  @gol
247 -Wno-discarded-qualifiers @gol
248 -Wno-div-by-zero -Wdouble-promotion -Wempty-body  -Wenum-compare @gol
249 -Wno-endif-labels -Werror  -Werror=* @gol
250 -Wfatal-errors  -Wfloat-equal  -Wformat  -Wformat=2 @gol
251 -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol
252 -Wformat-security  -Wformat-signedness  -Wformat-y2k @gol
253 -Wframe-larger-than=@var{len} -Wno-free-nonheap-object -Wjump-misses-init @gol
254 -Wignored-qualifiers @gol
255 -Wimplicit  -Wimplicit-function-declaration  -Wimplicit-int @gol
256 -Winit-self  -Winline -Wmaybe-uninitialized @gol
257 -Wno-int-to-pointer-cast -Wno-invalid-offsetof @gol
258 -Winvalid-pch -Wlarger-than=@var{len}  -Wunsafe-loop-optimizations @gol
259 -Wlogical-op -Wlong-long @gol
260 -Wmain -Wmaybe-uninitialized -Wmissing-braces  -Wmissing-field-initializers @gol
261 -Wmissing-include-dirs @gol
262 -Wno-multichar  -Wnonnull  -Wno-overflow -Wopenmp-simd @gol
263 -Woverlength-strings  -Wpacked  -Wpacked-bitfield-compat  -Wpadded @gol
264 -Wparentheses  -Wpedantic-ms-format -Wno-pedantic-ms-format @gol
265 -Wpointer-arith  -Wno-pointer-to-int-cast @gol
266 -Wredundant-decls  -Wno-return-local-addr @gol
267 -Wreturn-type  -Wsequence-point  -Wshadow  -Wno-shadow-ivar @gol
268 -Wsign-compare  -Wsign-conversion -Wfloat-conversion @gol
269 -Wsizeof-pointer-memaccess @gol
270 -Wstack-protector -Wstack-usage=@var{len} -Wstrict-aliasing @gol
271 -Wstrict-aliasing=n @gol -Wstrict-overflow -Wstrict-overflow=@var{n} @gol
272 -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{]} @gol
273 -Wmissing-format-attribute @gol
274 -Wswitch  -Wswitch-default  -Wswitch-enum -Wsync-nand @gol
275 -Wsystem-headers  -Wtrampolines  -Wtrigraphs  -Wtype-limits  -Wundef @gol
276 -Wuninitialized  -Wunknown-pragmas  -Wno-pragmas @gol
277 -Wunsuffixed-float-constants  -Wunused  -Wunused-function @gol
278 -Wunused-label  -Wunused-local-typedefs -Wunused-parameter @gol
279 -Wno-unused-result -Wunused-value @gol -Wunused-variable @gol
280 -Wunused-but-set-parameter -Wunused-but-set-variable @gol
281 -Wuseless-cast -Wvariadic-macros -Wvector-operation-performance @gol
282 -Wvla -Wvolatile-register-var  -Wwrite-strings -Wzero-as-null-pointer-constant}
284 @item C and Objective-C-only Warning Options
285 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
286 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
287 -Wold-style-declaration  -Wold-style-definition @gol
288 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
289 -Wdeclaration-after-statement -Wpointer-sign}
291 @item Debugging Options
292 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
293 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
294 -fsanitize=@var{style} -fsanitize-recover @gol
295 -fsanitize-undefined-trap-on-error @gol
296 -fdbg-cnt-list -fdbg-cnt=@var{counter-value-list} @gol
297 -fdisable-ipa-@var{pass_name} @gol
298 -fdisable-rtl-@var{pass_name} @gol
299 -fdisable-rtl-@var{pass-name}=@var{range-list} @gol
300 -fdisable-tree-@var{pass_name} @gol
301 -fdisable-tree-@var{pass-name}=@var{range-list} @gol
302 -fdump-noaddr -fdump-unnumbered -fdump-unnumbered-links @gol
303 -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
304 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
305 -fdump-ipa-all -fdump-ipa-cgraph -fdump-ipa-inline @gol
306 -fdump-passes @gol
307 -fdump-statistics @gol
308 -fdump-tree-all @gol
309 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
310 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
311 -fdump-tree-cfg -fdump-tree-alias @gol
312 -fdump-tree-ch @gol
313 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
314 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
315 -fdump-tree-gimple@r{[}-raw@r{]} @gol
316 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
317 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
318 -fdump-tree-phiprop@r{[}-@var{n}@r{]} @gol
319 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
320 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
321 -fdump-tree-copyrename@r{[}-@var{n}@r{]} @gol
322 -fdump-tree-nrv -fdump-tree-vect @gol
323 -fdump-tree-sink @gol
324 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
325 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
326 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
327 -fdump-tree-vtable-verify @gol
328 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
329 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
330 -fdump-final-insns=@var{file} @gol
331 -fcompare-debug@r{[}=@var{opts}@r{]}  -fcompare-debug-second @gol
332 -feliminate-dwarf2-dups -fno-eliminate-unused-debug-types @gol
333 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
334 -fenable-@var{kind}-@var{pass} @gol
335 -fenable-@var{kind}-@var{pass}=@var{range-list} @gol
336 -fdebug-types-section -fmem-report-wpa @gol
337 -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
338 -fopt-info @gol
339 -fopt-info-@var{options}@r{[}=@var{file}@r{]} @gol
340 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
341 -fsel-sched-verbose -fsel-sched-dump-cfg -fsel-sched-pipelining-verbose @gol
342 -fstack-usage  -ftest-coverage  -ftime-report -fvar-tracking @gol
343 -fvar-tracking-assignments  -fvar-tracking-assignments-toggle @gol
344 -g  -g@var{level}  -gtoggle  -gcoff  -gdwarf-@var{version} @gol
345 -ggdb  -grecord-gcc-switches  -gno-record-gcc-switches @gol
346 -gstabs  -gstabs+  -gstrict-dwarf  -gno-strict-dwarf @gol
347 -gvms  -gxcoff  -gxcoff+ @gol
348 -fno-merge-debug-strings -fno-dwarf2-cfi-asm @gol
349 -fdebug-prefix-map=@var{old}=@var{new} @gol
350 -femit-struct-debug-baseonly -femit-struct-debug-reduced @gol
351 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
352 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
353 -print-multi-directory  -print-multi-lib  -print-multi-os-directory @gol
354 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
355 -print-sysroot -print-sysroot-headers-suffix @gol
356 -save-temps -save-temps=cwd -save-temps=obj -time@r{[}=@var{file}@r{]}}
358 @item Optimization Options
359 @xref{Optimize Options,,Options that Control Optimization}.
360 @gccoptlist{-faggressive-loop-optimizations -falign-functions[=@var{n}] @gol
361 -falign-jumps[=@var{n}] @gol
362 -falign-labels[=@var{n}] -falign-loops[=@var{n}] @gol
363 -fassociative-math -fauto-inc-dec -fbranch-probabilities @gol
364 -fbranch-target-load-optimize -fbranch-target-load-optimize2 @gol
365 -fbtr-bb-exclusive -fcaller-saves @gol
366 -fcheck-data-deps -fcombine-stack-adjustments -fconserve-stack @gol
367 -fcompare-elim -fcprop-registers -fcrossjumping @gol
368 -fcse-follow-jumps -fcse-skip-blocks -fcx-fortran-rules @gol
369 -fcx-limited-range @gol
370 -fdata-sections -fdce -fdelayed-branch @gol
371 -fdelete-null-pointer-checks -fdevirtualize -fdevirtualize-speculatively -fdse @gol
372 -fearly-inlining -fipa-sra -fexpensive-optimizations -ffat-lto-objects @gol
373 -ffast-math -ffinite-math-only -ffloat-store -fexcess-precision=@var{style} @gol
374 -fforward-propagate -ffp-contract=@var{style} -ffunction-sections @gol
375 -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm -fgraphite-identity @gol
376 -fgcse-sm -fhoist-adjacent-loads -fif-conversion @gol
377 -fif-conversion2 -findirect-inlining @gol
378 -finline-functions -finline-functions-called-once -finline-limit=@var{n} @gol
379 -finline-small-functions -fipa-cp -fipa-cp-clone @gol
380 -fipa-pta -fipa-profile -fipa-pure-const -fipa-reference @gol
381 -fira-algorithm=@var{algorithm} @gol
382 -fira-region=@var{region} -fira-hoist-pressure @gol
383 -fira-loop-pressure -fno-ira-share-save-slots @gol
384 -fno-ira-share-spill-slots -fira-verbose=@var{n} @gol
385 -fisolate-erroneous-paths-dereference -fisolate-erroneous-paths-attribute
386 -fivopts -fkeep-inline-functions -fkeep-static-consts -flive-range-shrinkage @gol
387 -floop-block -floop-interchange -floop-strip-mine -floop-nest-optimize @gol
388 -floop-parallelize-all -flto -flto-compression-level @gol
389 -flto-partition=@var{alg} -flto-report -flto-report-wpa -fmerge-all-constants @gol
390 -fmerge-constants -fmodulo-sched -fmodulo-sched-allow-regmoves @gol
391 -fmove-loop-invariants -fno-branch-count-reg @gol
392 -fno-defer-pop -fno-function-cse -fno-guess-branch-probability @gol
393 -fno-inline -fno-math-errno -fno-peephole -fno-peephole2 @gol
394 -fno-sched-interblock -fno-sched-spec -fno-signed-zeros @gol
395 -fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss @gol
396 -fomit-frame-pointer -foptimize-sibling-calls @gol
397 -fpartial-inlining -fpeel-loops -fpredictive-commoning @gol
398 -fprefetch-loop-arrays -fprofile-report @gol
399 -fprofile-correction -fprofile-dir=@var{path} -fprofile-generate @gol
400 -fprofile-generate=@var{path} @gol
401 -fprofile-use -fprofile-use=@var{path} -fprofile-values -fprofile-reorder-functions @gol
402 -freciprocal-math -free -frename-registers -freorder-blocks @gol
403 -freorder-blocks-and-partition -freorder-functions @gol
404 -frerun-cse-after-loop -freschedule-modulo-scheduled-loops @gol
405 -frounding-math -fsched2-use-superblocks -fsched-pressure @gol
406 -fsched-spec-load -fsched-spec-load-dangerous @gol
407 -fsched-stalled-insns-dep[=@var{n}] -fsched-stalled-insns[=@var{n}] @gol
408 -fsched-group-heuristic -fsched-critical-path-heuristic @gol
409 -fsched-spec-insn-heuristic -fsched-rank-heuristic @gol
410 -fsched-last-insn-heuristic -fsched-dep-count-heuristic @gol
411 -fschedule-insns -fschedule-insns2 -fsection-anchors @gol
412 -fselective-scheduling -fselective-scheduling2 @gol
413 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops @gol
414 -fshrink-wrap -fsignaling-nans -fsingle-precision-constant @gol
415 -fsplit-ivs-in-unroller -fsplit-wide-types -fstack-protector @gol
416 -fstack-protector-all -fstack-protector-strong -fstrict-aliasing @gol
417 -fstrict-overflow -fthread-jumps -ftracer -ftree-bit-ccp @gol
418 -ftree-builtin-call-dce -ftree-ccp -ftree-ch @gol
419 -ftree-coalesce-inline-vars -ftree-coalesce-vars -ftree-copy-prop @gol
420 -ftree-copyrename -ftree-dce -ftree-dominator-opts -ftree-dse @gol
421 -ftree-forwprop -ftree-fre -ftree-loop-if-convert @gol
422 -ftree-loop-if-convert-stores -ftree-loop-im @gol
423 -ftree-phiprop -ftree-loop-distribution -ftree-loop-distribute-patterns @gol
424 -ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize @gol
425 -ftree-loop-vectorize @gol
426 -ftree-parallelize-loops=@var{n} -ftree-pre -ftree-partial-pre -ftree-pta @gol
427 -ftree-reassoc -ftree-sink -ftree-slsr -ftree-sra @gol
428 -ftree-switch-conversion -ftree-tail-merge -ftree-ter @gol
429 -ftree-vectorize -ftree-vrp @gol
430 -funit-at-a-time -funroll-all-loops -funroll-loops @gol
431 -funsafe-loop-optimizations -funsafe-math-optimizations -funswitch-loops @gol
432 -fvariable-expansion-in-unroller -fvect-cost-model -fvpt -fweb @gol
433 -fwhole-program -fwpa -fuse-ld=@var{linker} -fuse-linker-plugin @gol
434 --param @var{name}=@var{value}
435 -O  -O0  -O1  -O2  -O3  -Os -Ofast -Og}
437 @item Preprocessor Options
438 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
439 @gccoptlist{-A@var{question}=@var{answer} @gol
440 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
441 -C  -dD  -dI  -dM  -dN @gol
442 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
443 -idirafter @var{dir} @gol
444 -include @var{file}  -imacros @var{file} @gol
445 -iprefix @var{file}  -iwithprefix @var{dir} @gol
446 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
447 -imultilib @var{dir} -isysroot @var{dir} @gol
448 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
449 -P  -fdebug-cpp -ftrack-macro-expansion -fworking-directory @gol
450 -remap -trigraphs  -undef  -U@var{macro}  @gol
451 -Wp,@var{option} -Xpreprocessor @var{option} -no-integrated-cpp}
453 @item Assembler Option
454 @xref{Assembler Options,,Passing Options to the Assembler}.
455 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
457 @item Linker Options
458 @xref{Link Options,,Options for Linking}.
459 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
460 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
461 -s  -static -static-libgcc -static-libstdc++ @gol
462 -static-libasan -static-libtsan -static-liblsan -static-libubsan @gol
463 -shared -shared-libgcc  -symbolic @gol
464 -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
465 -u @var{symbol}}
467 @item Directory Options
468 @xref{Directory Options,,Options for Directory Search}.
469 @gccoptlist{-B@var{prefix} -I@var{dir} -iplugindir=@var{dir} @gol
470 -iquote@var{dir} -L@var{dir} -specs=@var{file} -I- @gol
471 --sysroot=@var{dir} --no-sysroot-suffix}
473 @item Machine Dependent Options
474 @xref{Submodel Options,,Hardware Models and Configurations}.
475 @c This list is ordered alphanumerically by subsection name.
476 @c Try and put the significant identifier (CPU or system) first,
477 @c so users have a clue at guessing where the ones they want will be.
479 @emph{AArch64 Options}
480 @gccoptlist{-mabi=@var{name}  -mbig-endian  -mlittle-endian @gol
481 -mgeneral-regs-only @gol
482 -mcmodel=tiny  -mcmodel=small  -mcmodel=large @gol
483 -mstrict-align @gol
484 -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
485 -mtls-dialect=desc  -mtls-dialect=traditional @gol
486 -march=@var{name}  -mcpu=@var{name}  -mtune=@var{name}}
488 @emph{Adapteva Epiphany Options}
489 @gccoptlist{-mhalf-reg-file -mprefer-short-insn-regs @gol
490 -mbranch-cost=@var{num} -mcmove -mnops=@var{num} -msoft-cmpsf @gol
491 -msplit-lohi -mpost-inc -mpost-modify -mstack-offset=@var{num} @gol
492 -mround-nearest -mlong-calls -mshort-calls -msmall16 @gol
493 -mfp-mode=@var{mode} -mvect-double -max-vect-align=@var{num} @gol
494 -msplit-vecmove-early -m1reg-@var{reg}}
496 @emph{ARC Options}
497 @gccoptlist{-mbarrel-shifter @gol
498 -mcpu=@var{cpu} -mA6 -mARC600 -mA7 -mARC700 @gol
499 -mdpfp -mdpfp-compact -mdpfp-fast -mno-dpfp-lrsr @gol
500 -mea -mno-mpy -mmul32x16 -mmul64 @gol
501 -mnorm -mspfp -mspfp-compact -mspfp-fast -msimd -msoft-float -mswap @gol
502 -mcrc -mdsp-packa -mdvbf -mlock -mmac-d16 -mmac-24 -mrtsc -mswape @gol
503 -mtelephony -mxy -misize -mannotate-align -marclinux -marclinux_prof @gol
504 -mepilogue-cfi -mlong-calls -mmedium-calls -msdata @gol
505 -mucb-mcount -mvolatile-cache @gol
506 -malign-call -mauto-modify-reg -mbbit-peephole -mno-brcc @gol
507 -mcase-vector-pcrel -mcompact-casesi -mno-cond-exec -mearly-cbranchsi @gol
508 -mexpand-adddi -mindexed-loads -mlra -mlra-priority-none @gol
509 -mlra-priority-compact mlra-priority-noncompact -mno-millicode @gol
510 -mmixed-code -mq-class -mRcq -mRcw -msize-level=@var{level} @gol
511 -mtune=@var{cpu} -mmultcost=@var{num} -munalign-prob-threshold=@var{probability}}
513 @emph{ARM Options}
514 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
515 -mabi=@var{name} @gol
516 -mapcs-stack-check  -mno-apcs-stack-check @gol
517 -mapcs-float  -mno-apcs-float @gol
518 -mapcs-reentrant  -mno-apcs-reentrant @gol
519 -msched-prolog  -mno-sched-prolog @gol
520 -mlittle-endian  -mbig-endian  -mwords-little-endian @gol
521 -mfloat-abi=@var{name} @gol
522 -mfp16-format=@var{name}
523 -mthumb-interwork  -mno-thumb-interwork @gol
524 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
525 -mstructure-size-boundary=@var{n} @gol
526 -mabort-on-noreturn @gol
527 -mlong-calls  -mno-long-calls @gol
528 -msingle-pic-base  -mno-single-pic-base @gol
529 -mpic-register=@var{reg} @gol
530 -mnop-fun-dllimport @gol
531 -mpoke-function-name @gol
532 -mthumb  -marm @gol
533 -mtpcs-frame  -mtpcs-leaf-frame @gol
534 -mcaller-super-interworking  -mcallee-super-interworking @gol
535 -mtp=@var{name} -mtls-dialect=@var{dialect} @gol
536 -mword-relocations @gol
537 -mfix-cortex-m3-ldrd @gol
538 -munaligned-access @gol
539 -mneon-for-64bits @gol
540 -mslow-flash-data @gol
541 -mrestrict-it}
543 @emph{AVR Options}
544 @gccoptlist{-mmcu=@var{mcu} -maccumulate-args -mbranch-cost=@var{cost} @gol
545 -mcall-prologues -mint8 -mno-interrupts -mrelax @gol
546 -mstrict-X -mtiny-stack -Waddr-space-convert}
548 @emph{Blackfin Options}
549 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
550 -msim -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
551 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
552 -mlow-64k -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
553 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
554 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
555 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
556 -mfast-fp -minline-plt -mmulticore  -mcorea  -mcoreb  -msdram @gol
557 -micplb}
559 @emph{C6X Options}
560 @gccoptlist{-mbig-endian  -mlittle-endian -march=@var{cpu} @gol
561 -msim -msdata=@var{sdata-type}}
563 @emph{CRIS Options}
564 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
565 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
566 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
567 -mstack-align  -mdata-align  -mconst-align @gol
568 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
569 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
570 -mmul-bug-workaround  -mno-mul-bug-workaround}
572 @emph{CR16 Options}
573 @gccoptlist{-mmac @gol
574 -mcr16cplus -mcr16c @gol
575 -msim -mint32 -mbit-ops
576 -mdata-model=@var{model}}
578 @emph{Darwin Options}
579 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
580 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
581 -client_name  -compatibility_version  -current_version @gol
582 -dead_strip @gol
583 -dependency-file  -dylib_file  -dylinker_install_name @gol
584 -dynamic  -dynamiclib  -exported_symbols_list @gol
585 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
586 -force_flat_namespace  -headerpad_max_install_names @gol
587 -iframework @gol
588 -image_base  -init  -install_name  -keep_private_externs @gol
589 -multi_module  -multiply_defined  -multiply_defined_unused @gol
590 -noall_load   -no_dead_strip_inits_and_terms @gol
591 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
592 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
593 -private_bundle  -read_only_relocs  -sectalign @gol
594 -sectobjectsymbols  -whyload  -seg1addr @gol
595 -sectcreate  -sectobjectsymbols  -sectorder @gol
596 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
597 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
598 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
599 -single_module  -static  -sub_library  -sub_umbrella @gol
600 -twolevel_namespace  -umbrella  -undefined @gol
601 -unexported_symbols_list  -weak_reference_mismatches @gol
602 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
603 -mkernel -mone-byte-bool}
605 @emph{DEC Alpha Options}
606 @gccoptlist{-mno-fp-regs  -msoft-float @gol
607 -mieee  -mieee-with-inexact  -mieee-conformant @gol
608 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
609 -mtrap-precision=@var{mode}  -mbuild-constants @gol
610 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
611 -mbwx  -mmax  -mfix  -mcix @gol
612 -mfloat-vax  -mfloat-ieee @gol
613 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
614 -msmall-text  -mlarge-text @gol
615 -mmemory-latency=@var{time}}
617 @emph{FR30 Options}
618 @gccoptlist{-msmall-model -mno-lsim}
620 @emph{FRV Options}
621 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
622 -mhard-float  -msoft-float @gol
623 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
624 -mdouble  -mno-double @gol
625 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
626 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
627 -mlinked-fp  -mlong-calls  -malign-labels @gol
628 -mlibrary-pic  -macc-4  -macc-8 @gol
629 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
630 -moptimize-membar -mno-optimize-membar @gol
631 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
632 -mvliw-branch  -mno-vliw-branch @gol
633 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
634 -mno-nested-cond-exec  -mtomcat-stats @gol
635 -mTLS -mtls @gol
636 -mcpu=@var{cpu}}
638 @emph{GNU/Linux Options}
639 @gccoptlist{-mglibc -muclibc -mbionic -mandroid @gol
640 -tno-android-cc -tno-android-ld}
642 @emph{H8/300 Options}
643 @gccoptlist{-mrelax  -mh  -ms  -mn  -mexr -mno-exr  -mint32  -malign-300}
645 @emph{HPPA Options}
646 @gccoptlist{-march=@var{architecture-type} @gol
647 -mdisable-fpregs  -mdisable-indexing @gol
648 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
649 -mfixed-range=@var{register-range} @gol
650 -mjump-in-delay -mlinker-opt -mlong-calls @gol
651 -mlong-load-store  -mno-disable-fpregs @gol
652 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
653 -mno-jump-in-delay  -mno-long-load-store @gol
654 -mno-portable-runtime  -mno-soft-float @gol
655 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
656 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
657 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
658 -munix=@var{unix-std}  -nolibdld  -static  -threads}
660 @emph{i386 and x86-64 Options}
661 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
662 -mtune-ctrl=@var{feature-list} -mdump-tune-features -mno-default @gol
663 -mfpmath=@var{unit} @gol
664 -masm=@var{dialect}  -mno-fancy-math-387 @gol
665 -mno-fp-ret-in-387  -msoft-float @gol
666 -mno-wide-multiply  -mrtd  -malign-double @gol
667 -mpreferred-stack-boundary=@var{num} @gol
668 -mincoming-stack-boundary=@var{num} @gol
669 -mcld -mcx16 -msahf -mmovbe -mcrc32 @gol
670 -mrecip -mrecip=@var{opt} @gol
671 -mvzeroupper -mprefer-avx128 @gol
672 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx @gol
673 -mavx2 -mavx512f -mavx512pf -mavx512er -mavx512cd -msha @gol
674 -maes -mpclmul -mfsgsbase -mrdrnd -mf16c -mfma -mprefetchwt1 @gol
675 -mclflushopt -mxsavec -mxsaves @gol
676 -msse4a -m3dnow -mpopcnt -mabm -mbmi -mtbm -mfma4 -mxop -mlzcnt @gol
677 -mbmi2 -mfxsr -mxsave -mxsaveopt -mrtm -mlwp -mthreads @gol
678 -mno-align-stringops  -minline-all-stringops @gol
679 -minline-stringops-dynamically -mstringop-strategy=@var{alg} @gol
680 -mmemcpy-strategy=@var{strategy} -mmemset-strategy=@var{strategy}
681 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
682 -m96bit-long-double -mlong-double-64 -mlong-double-80 -mlong-double-128 @gol
683 -mregparm=@var{num}  -msseregparm @gol
684 -mveclibabi=@var{type} -mvect8-ret-in-mem @gol
685 -mpc32 -mpc64 -mpc80 -mstackrealign @gol
686 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
687 -mcmodel=@var{code-model} -mabi=@var{name} -maddress-mode=@var{mode} @gol
688 -m32 -m64 -mx32 -m16 -mlarge-data-threshold=@var{num} @gol
689 -msse2avx -mfentry -m8bit-idiv @gol
690 -mavx256-split-unaligned-load -mavx256-split-unaligned-store @gol
691 -mstack-protector-guard=@var{guard}}
693 @emph{i386 and x86-64 Windows Options}
694 @gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll @gol
695 -mnop-fun-dllimport -mthread @gol
696 -municode -mwin32 -mwindows -fno-set-stack-executable}
698 @emph{IA-64 Options}
699 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
700 -mvolatile-asm-stop  -mregister-names  -msdata -mno-sdata @gol
701 -mconstant-gp  -mauto-pic  -mfused-madd @gol
702 -minline-float-divide-min-latency @gol
703 -minline-float-divide-max-throughput @gol
704 -mno-inline-float-divide @gol
705 -minline-int-divide-min-latency @gol
706 -minline-int-divide-max-throughput  @gol
707 -mno-inline-int-divide @gol
708 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
709 -mno-inline-sqrt @gol
710 -mdwarf2-asm -mearly-stop-bits @gol
711 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
712 -mtune=@var{cpu-type} -milp32 -mlp64 @gol
713 -msched-br-data-spec -msched-ar-data-spec -msched-control-spec @gol
714 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
715 -msched-spec-ldc -msched-spec-control-ldc @gol
716 -msched-prefer-non-data-spec-insns -msched-prefer-non-control-spec-insns @gol
717 -msched-stop-bits-after-every-cycle -msched-count-spec-in-critical-path @gol
718 -msel-sched-dont-check-control-spec -msched-fp-mem-deps-zero-cost @gol
719 -msched-max-memory-insns-hard-limit -msched-max-memory-insns=@var{max-insns}}
721 @emph{LM32 Options}
722 @gccoptlist{-mbarrel-shift-enabled -mdivide-enabled -mmultiply-enabled @gol
723 -msign-extend-enabled -muser-enabled}
725 @emph{M32R/D Options}
726 @gccoptlist{-m32r2 -m32rx -m32r @gol
727 -mdebug @gol
728 -malign-loops -mno-align-loops @gol
729 -missue-rate=@var{number} @gol
730 -mbranch-cost=@var{number} @gol
731 -mmodel=@var{code-size-model-type} @gol
732 -msdata=@var{sdata-type} @gol
733 -mno-flush-func -mflush-func=@var{name} @gol
734 -mno-flush-trap -mflush-trap=@var{number} @gol
735 -G @var{num}}
737 @emph{M32C Options}
738 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
740 @emph{M680x0 Options}
741 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune}
742 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
743 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
744 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
745 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
746 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
747 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
748 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
749 -mxgot -mno-xgot}
751 @emph{MCore Options}
752 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
753 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
754 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
755 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
756 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
758 @emph{MeP Options}
759 @gccoptlist{-mabsdiff -mall-opts -maverage -mbased=@var{n} -mbitops @gol
760 -mc=@var{n} -mclip -mconfig=@var{name} -mcop -mcop32 -mcop64 -mivc2 @gol
761 -mdc -mdiv -meb -mel -mio-volatile -ml -mleadz -mm -mminmax @gol
762 -mmult -mno-opts -mrepeat -ms -msatur -msdram -msim -msimnovec -mtf @gol
763 -mtiny=@var{n}}
765 @emph{MicroBlaze Options}
766 @gccoptlist{-msoft-float -mhard-float -msmall-divides -mcpu=@var{cpu} @gol
767 -mmemcpy -mxl-soft-mul -mxl-soft-div -mxl-barrel-shift @gol
768 -mxl-pattern-compare -mxl-stack-check -mxl-gp-opt -mno-clearbss @gol
769 -mxl-multiply-high -mxl-float-convert -mxl-float-sqrt @gol
770 -mbig-endian -mlittle-endian -mxl-reorder -mxl-mode-@var{app-model}}
772 @emph{MIPS Options}
773 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
774 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2 @gol
775 -mips64  -mips64r2 @gol
776 -mips16  -mno-mips16  -mflip-mips16 @gol
777 -minterlink-compressed -mno-interlink-compressed @gol
778 -minterlink-mips16  -mno-interlink-mips16 @gol
779 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
780 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
781 -mgp32  -mgp64  -mfp32  -mfp64  -mhard-float  -msoft-float @gol
782 -mno-float  -msingle-float  -mdouble-float @gol
783 -mabs=@var{mode}  -mnan=@var{encoding} @gol
784 -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
785 -mmcu -mmno-mcu @gol
786 -meva -mno-eva @gol
787 -mvirt -mno-virt @gol
788 -mmicromips -mno-micromips @gol
789 -mfpu=@var{fpu-type} @gol
790 -msmartmips  -mno-smartmips @gol
791 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
792 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
793 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
794 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
795 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
796 -membedded-data  -mno-embedded-data @gol
797 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
798 -mcode-readable=@var{setting} @gol
799 -msplit-addresses  -mno-split-addresses @gol
800 -mexplicit-relocs  -mno-explicit-relocs @gol
801 -mcheck-zero-division  -mno-check-zero-division @gol
802 -mdivide-traps  -mdivide-breaks @gol
803 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
804 -mmad -mno-mad -mimadd -mno-imadd -mfused-madd  -mno-fused-madd  -nocpp @gol
805 -mfix-24k -mno-fix-24k @gol
806 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
807 -mfix-r10000 -mno-fix-r10000  -mfix-rm7000 -mno-fix-rm7000 @gol
808 -mfix-vr4120  -mno-fix-vr4120 @gol
809 -mfix-vr4130  -mno-fix-vr4130  -mfix-sb1  -mno-fix-sb1 @gol
810 -mflush-func=@var{func}  -mno-flush-func @gol
811 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
812 -mfp-exceptions -mno-fp-exceptions @gol
813 -mvr4130-align -mno-vr4130-align -msynci -mno-synci @gol
814 -mrelax-pic-calls -mno-relax-pic-calls -mmcount-ra-address}
816 @emph{MMIX Options}
817 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
818 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
819 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
820 -mno-base-addresses  -msingle-exit  -mno-single-exit}
822 @emph{MN10300 Options}
823 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
824 -mno-am33 -mam33 -mam33-2 -mam34 @gol
825 -mtune=@var{cpu-type} @gol
826 -mreturn-pointer-on-d0 @gol
827 -mno-crt0  -mrelax -mliw -msetlb}
829 @emph{Moxie Options}
830 @gccoptlist{-meb -mel -mno-crt0}
832 @emph{MSP430 Options}
833 @gccoptlist{-msim -masm-hex -mmcu= -mcpu= -mlarge -msmall -mrelax @gol
834 -mhwmult=}
836 @emph{NDS32 Options}
837 @gccoptlist{-mbig-endian -mlittle-endian @gol
838 -mreduced-regs -mfull-regs @gol
839 -mcmov -mno-cmov @gol
840 -mperf-ext -mno-perf-ext @gol
841 -mv3push -mno-v3push @gol
842 -m16bit -mno-16bit @gol
843 -mgp-direct -mno-gp-direct @gol
844 -misr-vector-size=@var{num} @gol
845 -mcache-block-size=@var{num} @gol
846 -march=@var{arch} @gol
847 -mforce-fp-as-gp -mforbid-fp-as-gp @gol
848 -mex9 -mctor-dtor -mrelax}
850 @emph{Nios II Options}
851 @gccoptlist{-G @var{num} -mgpopt -mno-gpopt -mel -meb @gol
852 -mno-bypass-cache -mbypass-cache @gol
853 -mno-cache-volatile -mcache-volatile @gol
854 -mno-fast-sw-div -mfast-sw-div @gol
855 -mhw-mul -mno-hw-mul -mhw-mulx -mno-hw-mulx -mno-hw-div -mhw-div @gol
856 -mcustom-@var{insn}=@var{N} -mno-custom-@var{insn} @gol
857 -mcustom-fpu-cfg=@var{name} @gol
858 -mhal -msmallc -msys-crt0=@var{name} -msys-lib=@var{name}}
860 @emph{PDP-11 Options}
861 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
862 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
863 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
864 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
865 -mbranch-expensive  -mbranch-cheap @gol
866 -munix-asm  -mdec-asm}
868 @emph{picoChip Options}
869 @gccoptlist{-mae=@var{ae_type} -mvliw-lookahead=@var{N} @gol
870 -msymbol-as-address -mno-inefficient-warnings}
872 @emph{PowerPC Options}
873 See RS/6000 and PowerPC Options.
875 @emph{RL78 Options}
876 @gccoptlist{-msim -mmul=none -mmul=g13 -mmul=rl78}
878 @emph{RS/6000 and PowerPC Options}
879 @gccoptlist{-mcpu=@var{cpu-type} @gol
880 -mtune=@var{cpu-type} @gol
881 -mcmodel=@var{code-model} @gol
882 -mpowerpc64 @gol
883 -maltivec  -mno-altivec @gol
884 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
885 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
886 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb -mpopcntd -mno-popcntd @gol
887 -mfprnd  -mno-fprnd @gol
888 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp @gol
889 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
890 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
891 -malign-power  -malign-natural @gol
892 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
893 -msingle-float -mdouble-float -msimple-fpu @gol
894 -mstring  -mno-string  -mupdate  -mno-update @gol
895 -mavoid-indexed-addresses  -mno-avoid-indexed-addresses @gol
896 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
897 -mstrict-align  -mno-strict-align  -mrelocatable @gol
898 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
899 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
900 -mdynamic-no-pic  -maltivec -mswdiv  -msingle-pic-base @gol
901 -mprioritize-restricted-insns=@var{priority} @gol
902 -msched-costly-dep=@var{dependence_type} @gol
903 -minsert-sched-nops=@var{scheme} @gol
904 -mcall-sysv  -mcall-netbsd @gol
905 -maix-struct-return  -msvr4-struct-return @gol
906 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
907 -mblock-move-inline-limit=@var{num} @gol
908 -misel -mno-isel @gol
909 -misel=yes  -misel=no @gol
910 -mspe -mno-spe @gol
911 -mspe=yes  -mspe=no @gol
912 -mpaired @gol
913 -mgen-cell-microcode -mwarn-cell-microcode @gol
914 -mvrsave -mno-vrsave @gol
915 -mmulhw -mno-mulhw @gol
916 -mdlmzb -mno-dlmzb @gol
917 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
918 -mprototype  -mno-prototype @gol
919 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
920 -msdata=@var{opt}  -mvxworks  -G @var{num}  -pthread @gol
921 -mrecip -mrecip=@var{opt} -mno-recip -mrecip-precision @gol
922 -mno-recip-precision @gol
923 -mveclibabi=@var{type} -mfriz -mno-friz @gol
924 -mpointers-to-nested-functions -mno-pointers-to-nested-functions @gol
925 -msave-toc-indirect -mno-save-toc-indirect @gol
926 -mpower8-fusion -mno-mpower8-fusion -mpower8-vector -mno-power8-vector @gol
927 -mcrypto -mno-crypto -mdirect-move -mno-direct-move @gol
928 -mquad-memory -mno-quad-memory @gol
929 -mquad-memory-atomic -mno-quad-memory-atomic @gol
930 -mcompat-align-parm -mno-compat-align-parm}
932 @emph{RX Options}
933 @gccoptlist{-m64bit-doubles  -m32bit-doubles  -fpu  -nofpu@gol
934 -mcpu=@gol
935 -mbig-endian-data -mlittle-endian-data @gol
936 -msmall-data @gol
937 -msim  -mno-sim@gol
938 -mas100-syntax -mno-as100-syntax@gol
939 -mrelax@gol
940 -mmax-constant-size=@gol
941 -mint-register=@gol
942 -mpid@gol
943 -mno-warn-multiple-fast-interrupts@gol
944 -msave-acc-in-interrupts}
946 @emph{S/390 and zSeries Options}
947 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
948 -mhard-float  -msoft-float  -mhard-dfp -mno-hard-dfp @gol
949 -mlong-double-64 -mlong-double-128 @gol
950 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
951 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
952 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
953 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
954 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard @gol
955 -mhotpatch[=@var{halfwords}] -mno-hotpatch}
957 @emph{Score Options}
958 @gccoptlist{-meb -mel @gol
959 -mnhwloop @gol
960 -muls @gol
961 -mmac @gol
962 -mscore5 -mscore5u -mscore7 -mscore7d}
964 @emph{SH Options}
965 @gccoptlist{-m1  -m2  -m2e @gol
966 -m2a-nofpu -m2a-single-only -m2a-single -m2a @gol
967 -m3  -m3e @gol
968 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
969 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
970 -m5-64media  -m5-64media-nofpu @gol
971 -m5-32media  -m5-32media-nofpu @gol
972 -m5-compact  -m5-compact-nofpu @gol
973 -mb  -ml  -mdalign  -mrelax @gol
974 -mbigtable -mfmovd -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
975 -mieee -mno-ieee -mbitops  -misize  -minline-ic_invalidate -mpadstruct @gol
976 -mspace -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
977 -mdivsi3_libfunc=@var{name} -mfixed-range=@var{register-range} @gol
978 -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
979 -maccumulate-outgoing-args -minvalid-symbols @gol
980 -matomic-model=@var{atomic-model} @gol
981 -mbranch-cost=@var{num} -mzdcbranch -mno-zdcbranch @gol
982 -mfused-madd -mno-fused-madd -mfsca -mno-fsca -mfsrra -mno-fsrra @gol
983 -mpretend-cmove -mtas}
985 @emph{Solaris 2 Options}
986 @gccoptlist{-mimpure-text  -mno-impure-text @gol
987 -pthreads -pthread}
989 @emph{SPARC Options}
990 @gccoptlist{-mcpu=@var{cpu-type} @gol
991 -mtune=@var{cpu-type} @gol
992 -mcmodel=@var{code-model} @gol
993 -mmemory-model=@var{mem-model} @gol
994 -m32  -m64  -mapp-regs  -mno-app-regs @gol
995 -mfaster-structs  -mno-faster-structs  -mflat  -mno-flat @gol
996 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
997 -mhard-quad-float  -msoft-quad-float @gol
998 -mstack-bias  -mno-stack-bias @gol
999 -munaligned-doubles  -mno-unaligned-doubles @gol
1000 -muser-mode  -mno-user-mode @gol
1001 -mv8plus  -mno-v8plus  -mvis  -mno-vis @gol
1002 -mvis2  -mno-vis2  -mvis3  -mno-vis3 @gol
1003 -mcbcond -mno-cbcond @gol
1004 -mfmaf  -mno-fmaf  -mpopc  -mno-popc @gol
1005 -mfix-at697f -mfix-ut699}
1007 @emph{SPU Options}
1008 @gccoptlist{-mwarn-reloc -merror-reloc @gol
1009 -msafe-dma -munsafe-dma @gol
1010 -mbranch-hints @gol
1011 -msmall-mem -mlarge-mem -mstdmain @gol
1012 -mfixed-range=@var{register-range} @gol
1013 -mea32 -mea64 @gol
1014 -maddress-space-conversion -mno-address-space-conversion @gol
1015 -mcache-size=@var{cache-size} @gol
1016 -matomic-updates -mno-atomic-updates}
1018 @emph{System V Options}
1019 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
1021 @emph{TILE-Gx Options}
1022 @gccoptlist{-mcpu=CPU -m32 -m64 -mbig-endian -mlittle-endian @gol
1023 -mcmodel=@var{code-model}}
1025 @emph{TILEPro Options}
1026 @gccoptlist{-mcpu=@var{cpu} -m32}
1028 @emph{V850 Options}
1029 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
1030 -mprolog-function  -mno-prolog-function  -mspace @gol
1031 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
1032 -mapp-regs  -mno-app-regs @gol
1033 -mdisable-callt  -mno-disable-callt @gol
1034 -mv850e2v3 -mv850e2 -mv850e1 -mv850es @gol
1035 -mv850e -mv850 -mv850e3v5 @gol
1036 -mloop @gol
1037 -mrelax @gol
1038 -mlong-jumps @gol
1039 -msoft-float @gol
1040 -mhard-float @gol
1041 -mgcc-abi @gol
1042 -mrh850-abi @gol
1043 -mbig-switch}
1045 @emph{VAX Options}
1046 @gccoptlist{-mg  -mgnu  -munix}
1048 @emph{VMS Options}
1049 @gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64 @gol
1050 -mpointer-size=@var{size}}
1052 @emph{VxWorks Options}
1053 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
1054 -Xbind-lazy  -Xbind-now}
1056 @emph{x86-64 Options}
1057 See i386 and x86-64 Options.
1059 @emph{Xstormy16 Options}
1060 @gccoptlist{-msim}
1062 @emph{Xtensa Options}
1063 @gccoptlist{-mconst16 -mno-const16 @gol
1064 -mfused-madd  -mno-fused-madd @gol
1065 -mforce-no-pic @gol
1066 -mserialize-volatile  -mno-serialize-volatile @gol
1067 -mtext-section-literals  -mno-text-section-literals @gol
1068 -mtarget-align  -mno-target-align @gol
1069 -mlongcalls  -mno-longcalls}
1071 @emph{zSeries Options}
1072 See S/390 and zSeries Options.
1074 @item Code Generation Options
1075 @xref{Code Gen Options,,Options for Code Generation Conventions}.
1076 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
1077 -ffixed-@var{reg}  -fexceptions @gol
1078 -fnon-call-exceptions  -fdelete-dead-exceptions  -funwind-tables @gol
1079 -fasynchronous-unwind-tables @gol
1080 -fno-gnu-unique @gol
1081 -finhibit-size-directive  -finstrument-functions @gol
1082 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
1083 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol
1084 -fno-common  -fno-ident @gol
1085 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
1086 -fno-jump-tables @gol
1087 -frecord-gcc-switches @gol
1088 -freg-struct-return  -fshort-enums @gol
1089 -fshort-double  -fshort-wchar @gol
1090 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
1091 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
1092 -fno-stack-limit -fsplit-stack @gol
1093 -fleading-underscore  -ftls-model=@var{model} @gol
1094 -fstack-reuse=@var{reuse_level} @gol
1095 -ftrapv  -fwrapv  -fbounds-check @gol
1096 -fvisibility -fstrict-volatile-bitfields -fsync-libcalls}
1097 @end table
1100 @node Overall Options
1101 @section Options Controlling the Kind of Output
1103 Compilation can involve up to four stages: preprocessing, compilation
1104 proper, assembly and linking, always in that order.  GCC is capable of
1105 preprocessing and compiling several files either into several
1106 assembler input files, or into one assembler input file; then each
1107 assembler input file produces an object file, and linking combines all
1108 the object files (those newly compiled, and those specified as input)
1109 into an executable file.
1111 @cindex file name suffix
1112 For any given input file, the file name suffix determines what kind of
1113 compilation is done:
1115 @table @gcctabopt
1116 @item @var{file}.c
1117 C source code that must be preprocessed.
1119 @item @var{file}.i
1120 C source code that should not be preprocessed.
1122 @item @var{file}.ii
1123 C++ source code that should not be preprocessed.
1125 @item @var{file}.m
1126 Objective-C source code.  Note that you must link with the @file{libobjc}
1127 library to make an Objective-C program work.
1129 @item @var{file}.mi
1130 Objective-C source code that should not be preprocessed.
1132 @item @var{file}.mm
1133 @itemx @var{file}.M
1134 Objective-C++ source code.  Note that you must link with the @file{libobjc}
1135 library to make an Objective-C++ program work.  Note that @samp{.M} refers
1136 to a literal capital M@.
1138 @item @var{file}.mii
1139 Objective-C++ source code that should not be preprocessed.
1141 @item @var{file}.h
1142 C, C++, Objective-C or Objective-C++ header file to be turned into a
1143 precompiled header (default), or C, C++ header file to be turned into an
1144 Ada spec (via the @option{-fdump-ada-spec} switch).
1146 @item @var{file}.cc
1147 @itemx @var{file}.cp
1148 @itemx @var{file}.cxx
1149 @itemx @var{file}.cpp
1150 @itemx @var{file}.CPP
1151 @itemx @var{file}.c++
1152 @itemx @var{file}.C
1153 C++ source code that must be preprocessed.  Note that in @samp{.cxx},
1154 the last two letters must both be literally @samp{x}.  Likewise,
1155 @samp{.C} refers to a literal capital C@.
1157 @item @var{file}.mm
1158 @itemx @var{file}.M
1159 Objective-C++ source code that must be preprocessed.
1161 @item @var{file}.mii
1162 Objective-C++ source code that should not be preprocessed.
1164 @item @var{file}.hh
1165 @itemx @var{file}.H
1166 @itemx @var{file}.hp
1167 @itemx @var{file}.hxx
1168 @itemx @var{file}.hpp
1169 @itemx @var{file}.HPP
1170 @itemx @var{file}.h++
1171 @itemx @var{file}.tcc
1172 C++ header file to be turned into a precompiled header or Ada spec.
1174 @item @var{file}.f
1175 @itemx @var{file}.for
1176 @itemx @var{file}.ftn
1177 Fixed form Fortran source code that should not be preprocessed.
1179 @item @var{file}.F
1180 @itemx @var{file}.FOR
1181 @itemx @var{file}.fpp
1182 @itemx @var{file}.FPP
1183 @itemx @var{file}.FTN
1184 Fixed form Fortran source code that must be preprocessed (with the traditional
1185 preprocessor).
1187 @item @var{file}.f90
1188 @itemx @var{file}.f95
1189 @itemx @var{file}.f03
1190 @itemx @var{file}.f08
1191 Free form Fortran source code that should not be preprocessed.
1193 @item @var{file}.F90
1194 @itemx @var{file}.F95
1195 @itemx @var{file}.F03
1196 @itemx @var{file}.F08
1197 Free form Fortran source code that must be preprocessed (with the
1198 traditional preprocessor).
1200 @item @var{file}.go
1201 Go source code.
1203 @c FIXME: Descriptions of Java file types.
1204 @c @var{file}.java
1205 @c @var{file}.class
1206 @c @var{file}.zip
1207 @c @var{file}.jar
1209 @item @var{file}.ads
1210 Ada source code file that contains a library unit declaration (a
1211 declaration of a package, subprogram, or generic, or a generic
1212 instantiation), or a library unit renaming declaration (a package,
1213 generic, or subprogram renaming declaration).  Such files are also
1214 called @dfn{specs}.
1216 @item @var{file}.adb
1217 Ada source code file containing a library unit body (a subprogram or
1218 package body).  Such files are also called @dfn{bodies}.
1220 @c GCC also knows about some suffixes for languages not yet included:
1221 @c Pascal:
1222 @c @var{file}.p
1223 @c @var{file}.pas
1224 @c Ratfor:
1225 @c @var{file}.r
1227 @item @var{file}.s
1228 Assembler code.
1230 @item @var{file}.S
1231 @itemx @var{file}.sx
1232 Assembler code that must be preprocessed.
1234 @item @var{other}
1235 An object file to be fed straight into linking.
1236 Any file name with no recognized suffix is treated this way.
1237 @end table
1239 @opindex x
1240 You can specify the input language explicitly with the @option{-x} option:
1242 @table @gcctabopt
1243 @item -x @var{language}
1244 Specify explicitly the @var{language} for the following input files
1245 (rather than letting the compiler choose a default based on the file
1246 name suffix).  This option applies to all following input files until
1247 the next @option{-x} option.  Possible values for @var{language} are:
1248 @smallexample
1249 c  c-header  cpp-output
1250 c++  c++-header  c++-cpp-output
1251 objective-c  objective-c-header  objective-c-cpp-output
1252 objective-c++ objective-c++-header objective-c++-cpp-output
1253 assembler  assembler-with-cpp
1255 f77  f77-cpp-input f95  f95-cpp-input
1257 java
1258 @end smallexample
1260 @item -x none
1261 Turn off any specification of a language, so that subsequent files are
1262 handled according to their file name suffixes (as they are if @option{-x}
1263 has not been used at all).
1265 @item -pass-exit-codes
1266 @opindex pass-exit-codes
1267 Normally the @command{gcc} program exits with the code of 1 if any
1268 phase of the compiler returns a non-success return code.  If you specify
1269 @option{-pass-exit-codes}, the @command{gcc} program instead returns with
1270 the numerically highest error produced by any phase returning an error
1271 indication.  The C, C++, and Fortran front ends return 4 if an internal
1272 compiler error is encountered.
1273 @end table
1275 If you only want some of the stages of compilation, you can use
1276 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1277 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1278 @command{gcc} is to stop.  Note that some combinations (for example,
1279 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1281 @table @gcctabopt
1282 @item -c
1283 @opindex c
1284 Compile or assemble the source files, but do not link.  The linking
1285 stage simply is not done.  The ultimate output is in the form of an
1286 object file for each source file.
1288 By default, the object file name for a source file is made by replacing
1289 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1291 Unrecognized input files, not requiring compilation or assembly, are
1292 ignored.
1294 @item -S
1295 @opindex S
1296 Stop after the stage of compilation proper; do not assemble.  The output
1297 is in the form of an assembler code file for each non-assembler input
1298 file specified.
1300 By default, the assembler file name for a source file is made by
1301 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1303 Input files that don't require compilation are ignored.
1305 @item -E
1306 @opindex E
1307 Stop after the preprocessing stage; do not run the compiler proper.  The
1308 output is in the form of preprocessed source code, which is sent to the
1309 standard output.
1311 Input files that don't require preprocessing are ignored.
1313 @cindex output file option
1314 @item -o @var{file}
1315 @opindex o
1316 Place output in file @var{file}.  This applies to whatever
1317 sort of output is being produced, whether it be an executable file,
1318 an object file, an assembler file or preprocessed C code.
1320 If @option{-o} is not specified, the default is to put an executable
1321 file in @file{a.out}, the object file for
1322 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1323 assembler file in @file{@var{source}.s}, a precompiled header file in
1324 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1325 standard output.
1327 @item -v
1328 @opindex v
1329 Print (on standard error output) the commands executed to run the stages
1330 of compilation.  Also print the version number of the compiler driver
1331 program and of the preprocessor and the compiler proper.
1333 @item -###
1334 @opindex ###
1335 Like @option{-v} except the commands are not executed and arguments
1336 are quoted unless they contain only alphanumeric characters or @code{./-_}.
1337 This is useful for shell scripts to capture the driver-generated command lines.
1339 @item -pipe
1340 @opindex pipe
1341 Use pipes rather than temporary files for communication between the
1342 various stages of compilation.  This fails to work on some systems where
1343 the assembler is unable to read from a pipe; but the GNU assembler has
1344 no trouble.
1346 @item --help
1347 @opindex help
1348 Print (on the standard output) a description of the command-line options
1349 understood by @command{gcc}.  If the @option{-v} option is also specified
1350 then @option{--help} is also passed on to the various processes
1351 invoked by @command{gcc}, so that they can display the command-line options
1352 they accept.  If the @option{-Wextra} option has also been specified
1353 (prior to the @option{--help} option), then command-line options that
1354 have no documentation associated with them are also displayed.
1356 @item --target-help
1357 @opindex target-help
1358 Print (on the standard output) a description of target-specific command-line
1359 options for each tool.  For some targets extra target-specific
1360 information may also be printed.
1362 @item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]}
1363 Print (on the standard output) a description of the command-line
1364 options understood by the compiler that fit into all specified classes
1365 and qualifiers.  These are the supported classes:
1367 @table @asis
1368 @item @samp{optimizers}
1369 Display all of the optimization options supported by the
1370 compiler.
1372 @item @samp{warnings}
1373 Display all of the options controlling warning messages
1374 produced by the compiler.
1376 @item @samp{target}
1377 Display target-specific options.  Unlike the
1378 @option{--target-help} option however, target-specific options of the
1379 linker and assembler are not displayed.  This is because those
1380 tools do not currently support the extended @option{--help=} syntax.
1382 @item @samp{params}
1383 Display the values recognized by the @option{--param}
1384 option.
1386 @item @var{language}
1387 Display the options supported for @var{language}, where
1388 @var{language} is the name of one of the languages supported in this
1389 version of GCC@.
1391 @item @samp{common}
1392 Display the options that are common to all languages.
1393 @end table
1395 These are the supported qualifiers:
1397 @table @asis
1398 @item @samp{undocumented}
1399 Display only those options that are undocumented.
1401 @item @samp{joined}
1402 Display options taking an argument that appears after an equal
1403 sign in the same continuous piece of text, such as:
1404 @samp{--help=target}.
1406 @item @samp{separate}
1407 Display options taking an argument that appears as a separate word
1408 following the original option, such as: @samp{-o output-file}.
1409 @end table
1411 Thus for example to display all the undocumented target-specific
1412 switches supported by the compiler, use:
1414 @smallexample
1415 --help=target,undocumented
1416 @end smallexample
1418 The sense of a qualifier can be inverted by prefixing it with the
1419 @samp{^} character, so for example to display all binary warning
1420 options (i.e., ones that are either on or off and that do not take an
1421 argument) that have a description, use:
1423 @smallexample
1424 --help=warnings,^joined,^undocumented
1425 @end smallexample
1427 The argument to @option{--help=} should not consist solely of inverted
1428 qualifiers.
1430 Combining several classes is possible, although this usually
1431 restricts the output so much that there is nothing to display.  One
1432 case where it does work, however, is when one of the classes is
1433 @var{target}.  For example, to display all the target-specific
1434 optimization options, use:
1436 @smallexample
1437 --help=target,optimizers
1438 @end smallexample
1440 The @option{--help=} option can be repeated on the command line.  Each
1441 successive use displays its requested class of options, skipping
1442 those that have already been displayed.
1444 If the @option{-Q} option appears on the command line before the
1445 @option{--help=} option, then the descriptive text displayed by
1446 @option{--help=} is changed.  Instead of describing the displayed
1447 options, an indication is given as to whether the option is enabled,
1448 disabled or set to a specific value (assuming that the compiler
1449 knows this at the point where the @option{--help=} option is used).
1451 Here is a truncated example from the ARM port of @command{gcc}:
1453 @smallexample
1454   % gcc -Q -mabi=2 --help=target -c
1455   The following options are target specific:
1456   -mabi=                                2
1457   -mabort-on-noreturn                   [disabled]
1458   -mapcs                                [disabled]
1459 @end smallexample
1461 The output is sensitive to the effects of previous command-line
1462 options, so for example it is possible to find out which optimizations
1463 are enabled at @option{-O2} by using:
1465 @smallexample
1466 -Q -O2 --help=optimizers
1467 @end smallexample
1469 Alternatively you can discover which binary optimizations are enabled
1470 by @option{-O3} by using:
1472 @smallexample
1473 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1474 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1475 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1476 @end smallexample
1478 @item -no-canonical-prefixes
1479 @opindex no-canonical-prefixes
1480 Do not expand any symbolic links, resolve references to @samp{/../}
1481 or @samp{/./}, or make the path absolute when generating a relative
1482 prefix.
1484 @item --version
1485 @opindex version
1486 Display the version number and copyrights of the invoked GCC@.
1488 @item -wrapper
1489 @opindex wrapper
1490 Invoke all subcommands under a wrapper program.  The name of the
1491 wrapper program and its parameters are passed as a comma separated
1492 list.
1494 @smallexample
1495 gcc -c t.c -wrapper gdb,--args
1496 @end smallexample
1498 @noindent
1499 This invokes all subprograms of @command{gcc} under
1500 @samp{gdb --args}, thus the invocation of @command{cc1} is
1501 @samp{gdb --args cc1 @dots{}}.
1503 @item -fplugin=@var{name}.so
1504 @opindex fplugin
1505 Load the plugin code in file @var{name}.so, assumed to be a
1506 shared object to be dlopen'd by the compiler.  The base name of
1507 the shared object file is used to identify the plugin for the
1508 purposes of argument parsing (See
1509 @option{-fplugin-arg-@var{name}-@var{key}=@var{value}} below).
1510 Each plugin should define the callback functions specified in the
1511 Plugins API.
1513 @item -fplugin-arg-@var{name}-@var{key}=@var{value}
1514 @opindex fplugin-arg
1515 Define an argument called @var{key} with a value of @var{value}
1516 for the plugin called @var{name}.
1518 @item -fdump-ada-spec@r{[}-slim@r{]}
1519 @opindex fdump-ada-spec
1520 For C and C++ source and include files, generate corresponding Ada specs.
1521 @xref{Generating Ada Bindings for C and C++ headers,,, gnat_ugn,
1522 GNAT User's Guide}, which provides detailed documentation on this feature.
1524 @item -fada-spec-parent=@var{unit}
1525 @opindex fada-spec-parent
1526 In conjunction with @option{-fdump-ada-spec@r{[}-slim@r{]}} above, generate
1527 Ada specs as child units of parent @var{unit}.
1529 @item -fdump-go-spec=@var{file}
1530 @opindex fdump-go-spec
1531 For input files in any language, generate corresponding Go
1532 declarations in @var{file}.  This generates Go @code{const},
1533 @code{type}, @code{var}, and @code{func} declarations which may be a
1534 useful way to start writing a Go interface to code written in some
1535 other language.
1537 @include @value{srcdir}/../libiberty/at-file.texi
1538 @end table
1540 @node Invoking G++
1541 @section Compiling C++ Programs
1543 @cindex suffixes for C++ source
1544 @cindex C++ source file suffixes
1545 C++ source files conventionally use one of the suffixes @samp{.C},
1546 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1547 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1548 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1549 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1550 files with these names and compiles them as C++ programs even if you
1551 call the compiler the same way as for compiling C programs (usually
1552 with the name @command{gcc}).
1554 @findex g++
1555 @findex c++
1556 However, the use of @command{gcc} does not add the C++ library.
1557 @command{g++} is a program that calls GCC and automatically specifies linking
1558 against the C++ library.  It treats @samp{.c},
1559 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1560 files unless @option{-x} is used.  This program is also useful when
1561 precompiling a C header file with a @samp{.h} extension for use in C++
1562 compilations.  On many systems, @command{g++} is also installed with
1563 the name @command{c++}.
1565 @cindex invoking @command{g++}
1566 When you compile C++ programs, you may specify many of the same
1567 command-line options that you use for compiling programs in any
1568 language; or command-line options meaningful for C and related
1569 languages; or options that are meaningful only for C++ programs.
1570 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1571 explanations of options for languages related to C@.
1572 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1573 explanations of options that are meaningful only for C++ programs.
1575 @node C Dialect Options
1576 @section Options Controlling C Dialect
1577 @cindex dialect options
1578 @cindex language dialect options
1579 @cindex options, dialect
1581 The following options control the dialect of C (or languages derived
1582 from C, such as C++, Objective-C and Objective-C++) that the compiler
1583 accepts:
1585 @table @gcctabopt
1586 @cindex ANSI support
1587 @cindex ISO support
1588 @item -ansi
1589 @opindex ansi
1590 In C mode, this is equivalent to @option{-std=c90}. In C++ mode, it is
1591 equivalent to @option{-std=c++98}.
1593 This turns off certain features of GCC that are incompatible with ISO
1594 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1595 such as the @code{asm} and @code{typeof} keywords, and
1596 predefined macros such as @code{unix} and @code{vax} that identify the
1597 type of system you are using.  It also enables the undesirable and
1598 rarely used ISO trigraph feature.  For the C compiler,
1599 it disables recognition of C++ style @samp{//} comments as well as
1600 the @code{inline} keyword.
1602 The alternate keywords @code{__asm__}, @code{__extension__},
1603 @code{__inline__} and @code{__typeof__} continue to work despite
1604 @option{-ansi}.  You would not want to use them in an ISO C program, of
1605 course, but it is useful to put them in header files that might be included
1606 in compilations done with @option{-ansi}.  Alternate predefined macros
1607 such as @code{__unix__} and @code{__vax__} are also available, with or
1608 without @option{-ansi}.
1610 The @option{-ansi} option does not cause non-ISO programs to be
1611 rejected gratuitously.  For that, @option{-Wpedantic} is required in
1612 addition to @option{-ansi}.  @xref{Warning Options}.
1614 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1615 option is used.  Some header files may notice this macro and refrain
1616 from declaring certain functions or defining certain macros that the
1617 ISO standard doesn't call for; this is to avoid interfering with any
1618 programs that might use these names for other things.
1620 Functions that are normally built in but do not have semantics
1621 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1622 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
1623 built-in functions provided by GCC}, for details of the functions
1624 affected.
1626 @item -std=
1627 @opindex std
1628 Determine the language standard. @xref{Standards,,Language Standards
1629 Supported by GCC}, for details of these standard versions.  This option
1630 is currently only supported when compiling C or C++.
1632 The compiler can accept several base standards, such as @samp{c90} or
1633 @samp{c++98}, and GNU dialects of those standards, such as
1634 @samp{gnu90} or @samp{gnu++98}.  When a base standard is specified, the
1635 compiler accepts all programs following that standard plus those
1636 using GNU extensions that do not contradict it.  For example,
1637 @option{-std=c90} turns off certain features of GCC that are
1638 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
1639 keywords, but not other GNU extensions that do not have a meaning in
1640 ISO C90, such as omitting the middle term of a @code{?:}
1641 expression. On the other hand, when a GNU dialect of a standard is
1642 specified, all features supported by the compiler are enabled, even when
1643 those features change the meaning of the base standard.  As a result, some
1644 strict-conforming programs may be rejected.  The particular standard
1645 is used by @option{-Wpedantic} to identify which features are GNU
1646 extensions given that version of the standard. For example
1647 @option{-std=gnu90 -Wpedantic} warns about C++ style @samp{//}
1648 comments, while @option{-std=gnu99 -Wpedantic} does not.
1650 A value for this option must be provided; possible values are
1652 @table @samp
1653 @item c90
1654 @itemx c89
1655 @itemx iso9899:1990
1656 Support all ISO C90 programs (certain GNU extensions that conflict
1657 with ISO C90 are disabled). Same as @option{-ansi} for C code.
1659 @item iso9899:199409
1660 ISO C90 as modified in amendment 1.
1662 @item c99
1663 @itemx c9x
1664 @itemx iso9899:1999
1665 @itemx iso9899:199x
1666 ISO C99.  This standard is substantially completely supported, modulo
1667 bugs, extended identifiers (supported except for corner cases when
1668 @option{-fextended-identifiers} is used) and floating-point issues
1669 (mainly but not entirely relating to optional C99 features from
1670 Annexes F and G).  See
1671 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1672 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1674 @item c11
1675 @itemx c1x
1676 @itemx iso9899:2011
1677 ISO C11, the 2011 revision of the ISO C standard.  This standard is
1678 substantially completely supported, modulo bugs, extended identifiers
1679 (supported except for corner cases when
1680 @option{-fextended-identifiers} is used), floating-point issues
1681 (mainly but not entirely relating to optional C11 features from
1682 Annexes F and G) and the optional Annexes K (Bounds-checking
1683 interfaces) and L (Analyzability).  The name @samp{c1x} is deprecated.
1685 @item gnu90
1686 @itemx gnu89
1687 GNU dialect of ISO C90 (including some C99 features). This
1688 is the default for C code.
1690 @item gnu99
1691 @itemx gnu9x
1692 GNU dialect of ISO C99.  The name @samp{gnu9x} is deprecated.
1694 @item gnu11
1695 @itemx gnu1x
1696 GNU dialect of ISO C11.  This is intended to become the default in a
1697 future release of GCC.  The name @samp{gnu1x} is deprecated.
1699 @item c++98
1700 @itemx c++03
1701 The 1998 ISO C++ standard plus the 2003 technical corrigendum and some
1702 additional defect reports. Same as @option{-ansi} for C++ code.
1704 @item gnu++98
1705 @itemx gnu++03
1706 GNU dialect of @option{-std=c++98}.  This is the default for
1707 C++ code.
1709 @item c++11
1710 @itemx c++0x
1711 The 2011 ISO C++ standard plus amendments.
1712 The name @samp{c++0x} is deprecated.
1714 @item gnu++11
1715 @itemx gnu++0x
1716 GNU dialect of @option{-std=c++11}.
1717 The name @samp{gnu++0x} is deprecated.
1719 @item c++1y
1720 The next revision of the ISO C++ standard, tentatively planned for
1721 2014.  Support is highly experimental, and will almost certainly
1722 change in incompatible ways in future releases.
1724 @item gnu++1y
1725 GNU dialect of @option{-std=c++1y}.  Support is highly experimental,
1726 and will almost certainly change in incompatible ways in future
1727 releases.
1728 @end table
1730 @item -fgnu89-inline
1731 @opindex fgnu89-inline
1732 The option @option{-fgnu89-inline} tells GCC to use the traditional
1733 GNU semantics for @code{inline} functions when in C99 mode.
1734 @xref{Inline,,An Inline Function is As Fast As a Macro}.  This option
1735 is accepted and ignored by GCC versions 4.1.3 up to but not including
1736 4.3.  In GCC versions 4.3 and later it changes the behavior of GCC in
1737 C99 mode.  Using this option is roughly equivalent to adding the
1738 @code{gnu_inline} function attribute to all inline functions
1739 (@pxref{Function Attributes}).
1741 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1742 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1743 specifies the default behavior).  This option was first supported in
1744 GCC 4.3.  This option is not supported in @option{-std=c90} or
1745 @option{-std=gnu90} mode.
1747 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1748 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1749 in effect for @code{inline} functions.  @xref{Common Predefined
1750 Macros,,,cpp,The C Preprocessor}.
1752 @item -aux-info @var{filename}
1753 @opindex aux-info
1754 Output to the given filename prototyped declarations for all functions
1755 declared and/or defined in a translation unit, including those in header
1756 files.  This option is silently ignored in any language other than C@.
1758 Besides declarations, the file indicates, in comments, the origin of
1759 each declaration (source file and line), whether the declaration was
1760 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1761 @samp{O} for old, respectively, in the first character after the line
1762 number and the colon), and whether it came from a declaration or a
1763 definition (@samp{C} or @samp{F}, respectively, in the following
1764 character).  In the case of function definitions, a K&R-style list of
1765 arguments followed by their declarations is also provided, inside
1766 comments, after the declaration.
1768 @item -fallow-parameterless-variadic-functions
1769 @opindex fallow-parameterless-variadic-functions
1770 Accept variadic functions without named parameters.
1772 Although it is possible to define such a function, this is not very
1773 useful as it is not possible to read the arguments.  This is only
1774 supported for C as this construct is allowed by C++.
1776 @item -fno-asm
1777 @opindex fno-asm
1778 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1779 keyword, so that code can use these words as identifiers.  You can use
1780 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1781 instead.  @option{-ansi} implies @option{-fno-asm}.
1783 In C++, this switch only affects the @code{typeof} keyword, since
1784 @code{asm} and @code{inline} are standard keywords.  You may want to
1785 use the @option{-fno-gnu-keywords} flag instead, which has the same
1786 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1787 switch only affects the @code{asm} and @code{typeof} keywords, since
1788 @code{inline} is a standard keyword in ISO C99.
1790 @item -fno-builtin
1791 @itemx -fno-builtin-@var{function}
1792 @opindex fno-builtin
1793 @cindex built-in functions
1794 Don't recognize built-in functions that do not begin with
1795 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1796 functions provided by GCC}, for details of the functions affected,
1797 including those which are not built-in functions when @option{-ansi} or
1798 @option{-std} options for strict ISO C conformance are used because they
1799 do not have an ISO standard meaning.
1801 GCC normally generates special code to handle certain built-in functions
1802 more efficiently; for instance, calls to @code{alloca} may become single
1803 instructions which adjust the stack directly, and calls to @code{memcpy}
1804 may become inline copy loops.  The resulting code is often both smaller
1805 and faster, but since the function calls no longer appear as such, you
1806 cannot set a breakpoint on those calls, nor can you change the behavior
1807 of the functions by linking with a different library.  In addition,
1808 when a function is recognized as a built-in function, GCC may use
1809 information about that function to warn about problems with calls to
1810 that function, or to generate more efficient code, even if the
1811 resulting code still contains calls to that function.  For example,
1812 warnings are given with @option{-Wformat} for bad calls to
1813 @code{printf} when @code{printf} is built in and @code{strlen} is
1814 known not to modify global memory.
1816 With the @option{-fno-builtin-@var{function}} option
1817 only the built-in function @var{function} is
1818 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1819 function is named that is not built-in in this version of GCC, this
1820 option is ignored.  There is no corresponding
1821 @option{-fbuiltin-@var{function}} option; if you wish to enable
1822 built-in functions selectively when using @option{-fno-builtin} or
1823 @option{-ffreestanding}, you may define macros such as:
1825 @smallexample
1826 #define abs(n)          __builtin_abs ((n))
1827 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1828 @end smallexample
1830 @item -fhosted
1831 @opindex fhosted
1832 @cindex hosted environment
1834 Assert that compilation targets a hosted environment.  This implies
1835 @option{-fbuiltin}.  A hosted environment is one in which the
1836 entire standard library is available, and in which @code{main} has a return
1837 type of @code{int}.  Examples are nearly everything except a kernel.
1838 This is equivalent to @option{-fno-freestanding}.
1840 @item -ffreestanding
1841 @opindex ffreestanding
1842 @cindex hosted environment
1844 Assert that compilation targets a freestanding environment.  This
1845 implies @option{-fno-builtin}.  A freestanding environment
1846 is one in which the standard library may not exist, and program startup may
1847 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1848 This is equivalent to @option{-fno-hosted}.
1850 @xref{Standards,,Language Standards Supported by GCC}, for details of
1851 freestanding and hosted environments.
1853 @item -fopenacc
1854 @opindex fopenacc
1855 @cindex OpenACC accelerator programming
1856 Enable handling of OpenACC directives @code{#pragma acc} in C.
1857 When @option{-fopenacc} is specified, the
1858 compiler generates accelerated code according to the OpenACC Application
1859 Programming Interface v2.0 @w{@uref{http://www.openacc.org/}}.  This option
1860 implies @option{-pthread}, and thus is only supported on targets that
1861 have support for @option{-pthread}.
1863 @item -fopenmp
1864 @opindex fopenmp
1865 @cindex OpenMP parallel
1866 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1867 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1868 compiler generates parallel code according to the OpenMP Application
1869 Program Interface v4.0 @w{@uref{http://www.openmp.org/}}.  This option
1870 implies @option{-pthread}, and thus is only supported on targets that
1871 have support for @option{-pthread}. @option{-fopenmp} implies
1872 @option{-fopenmp-simd}.
1874 @item -fopenmp-simd
1875 @opindex fopenmp-simd
1876 @cindex OpenMP SIMD
1877 @cindex SIMD
1878 Enable handling of OpenMP's SIMD directives with @code{#pragma omp}
1879 in C/C++ and @code{!$omp} in Fortran. Other OpenMP directives
1880 are ignored.
1882 @item -fcilkplus
1883 @opindex fcilkplus
1884 @cindex Enable Cilk Plus
1885 Enable the usage of Cilk Plus language extension features for C/C++.
1886 When the option @option{-fcilkplus} is specified, enable the usage of
1887 the Cilk Plus Language extension features for C/C++.  The present
1888 implementation follows ABI version 1.2.  This is an experimental
1889 feature that is only partially complete, and whose interface may
1890 change in future versions of GCC as the official specification
1891 changes.  Currently, all features but @code{_Cilk_for} have been
1892 implemented.
1894 @item -fgnu-tm
1895 @opindex fgnu-tm
1896 When the option @option{-fgnu-tm} is specified, the compiler
1897 generates code for the Linux variant of Intel's current Transactional
1898 Memory ABI specification document (Revision 1.1, May 6 2009).  This is
1899 an experimental feature whose interface may change in future versions
1900 of GCC, as the official specification changes.  Please note that not
1901 all architectures are supported for this feature.
1903 For more information on GCC's support for transactional memory,
1904 @xref{Enabling libitm,,The GNU Transactional Memory Library,libitm,GNU
1905 Transactional Memory Library}.
1907 Note that the transactional memory feature is not supported with
1908 non-call exceptions (@option{-fnon-call-exceptions}).
1910 @item -fms-extensions
1911 @opindex fms-extensions
1912 Accept some non-standard constructs used in Microsoft header files.
1914 In C++ code, this allows member names in structures to be similar
1915 to previous types declarations.
1917 @smallexample
1918 typedef int UOW;
1919 struct ABC @{
1920   UOW UOW;
1922 @end smallexample
1924 Some cases of unnamed fields in structures and unions are only
1925 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1926 fields within structs/unions}, for details.
1928 Note that this option is off for all targets but i?86 and x86_64
1929 targets using ms-abi.
1930 @item -fplan9-extensions
1931 Accept some non-standard constructs used in Plan 9 code.
1933 This enables @option{-fms-extensions}, permits passing pointers to
1934 structures with anonymous fields to functions that expect pointers to
1935 elements of the type of the field, and permits referring to anonymous
1936 fields declared using a typedef.  @xref{Unnamed Fields,,Unnamed
1937 struct/union fields within structs/unions}, for details.  This is only
1938 supported for C, not C++.
1940 @item -trigraphs
1941 @opindex trigraphs
1942 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1943 options for strict ISO C conformance) implies @option{-trigraphs}.
1945 @cindex traditional C language
1946 @cindex C language, traditional
1947 @item -traditional
1948 @itemx -traditional-cpp
1949 @opindex traditional-cpp
1950 @opindex traditional
1951 Formerly, these options caused GCC to attempt to emulate a pre-standard
1952 C compiler.  They are now only supported with the @option{-E} switch.
1953 The preprocessor continues to support a pre-standard mode.  See the GNU
1954 CPP manual for details.
1956 @item -fcond-mismatch
1957 @opindex fcond-mismatch
1958 Allow conditional expressions with mismatched types in the second and
1959 third arguments.  The value of such an expression is void.  This option
1960 is not supported for C++.
1962 @item -flax-vector-conversions
1963 @opindex flax-vector-conversions
1964 Allow implicit conversions between vectors with differing numbers of
1965 elements and/or incompatible element types.  This option should not be
1966 used for new code.
1968 @item -funsigned-char
1969 @opindex funsigned-char
1970 Let the type @code{char} be unsigned, like @code{unsigned char}.
1972 Each kind of machine has a default for what @code{char} should
1973 be.  It is either like @code{unsigned char} by default or like
1974 @code{signed char} by default.
1976 Ideally, a portable program should always use @code{signed char} or
1977 @code{unsigned char} when it depends on the signedness of an object.
1978 But many programs have been written to use plain @code{char} and
1979 expect it to be signed, or expect it to be unsigned, depending on the
1980 machines they were written for.  This option, and its inverse, let you
1981 make such a program work with the opposite default.
1983 The type @code{char} is always a distinct type from each of
1984 @code{signed char} or @code{unsigned char}, even though its behavior
1985 is always just like one of those two.
1987 @item -fsigned-char
1988 @opindex fsigned-char
1989 Let the type @code{char} be signed, like @code{signed char}.
1991 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1992 the negative form of @option{-funsigned-char}.  Likewise, the option
1993 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1995 @item -fsigned-bitfields
1996 @itemx -funsigned-bitfields
1997 @itemx -fno-signed-bitfields
1998 @itemx -fno-unsigned-bitfields
1999 @opindex fsigned-bitfields
2000 @opindex funsigned-bitfields
2001 @opindex fno-signed-bitfields
2002 @opindex fno-unsigned-bitfields
2003 These options control whether a bit-field is signed or unsigned, when the
2004 declaration does not use either @code{signed} or @code{unsigned}.  By
2005 default, such a bit-field is signed, because this is consistent: the
2006 basic integer types such as @code{int} are signed types.
2007 @end table
2009 @node C++ Dialect Options
2010 @section Options Controlling C++ Dialect
2012 @cindex compiler options, C++
2013 @cindex C++ options, command-line
2014 @cindex options, C++
2015 This section describes the command-line options that are only meaningful
2016 for C++ programs.  You can also use most of the GNU compiler options
2017 regardless of what language your program is in.  For example, you
2018 might compile a file @code{firstClass.C} like this:
2020 @smallexample
2021 g++ -g -frepo -O -c firstClass.C
2022 @end smallexample
2024 @noindent
2025 In this example, only @option{-frepo} is an option meant
2026 only for C++ programs; you can use the other options with any
2027 language supported by GCC@.
2029 Here is a list of options that are @emph{only} for compiling C++ programs:
2031 @table @gcctabopt
2033 @item -fabi-version=@var{n}
2034 @opindex fabi-version
2035 Use version @var{n} of the C++ ABI@.  The default is version 2.
2037 Version 0 refers to the version conforming most closely to
2038 the C++ ABI specification.  Therefore, the ABI obtained using version 0
2039 will change in different versions of G++ as ABI bugs are fixed.
2041 Version 1 is the version of the C++ ABI that first appeared in G++ 3.2.  
2043 Version 2 is the version of the C++ ABI that first appeared in G++ 3.4.  
2045 Version 3 corrects an error in mangling a constant address as a
2046 template argument.
2048 Version 4, which first appeared in G++ 4.5, implements a standard
2049 mangling for vector types.
2051 Version 5, which first appeared in G++ 4.6, corrects the mangling of
2052 attribute const/volatile on function pointer types, decltype of a
2053 plain decl, and use of a function parameter in the declaration of
2054 another parameter.
2056 Version 6, which first appeared in G++ 4.7, corrects the promotion
2057 behavior of C++11 scoped enums and the mangling of template argument
2058 packs, const/static_cast, prefix ++ and --, and a class scope function
2059 used as a template argument.
2061 See also @option{-Wabi}.
2063 @item -fno-access-control
2064 @opindex fno-access-control
2065 Turn off all access checking.  This switch is mainly useful for working
2066 around bugs in the access control code.
2068 @item -fcheck-new
2069 @opindex fcheck-new
2070 Check that the pointer returned by @code{operator new} is non-null
2071 before attempting to modify the storage allocated.  This check is
2072 normally unnecessary because the C++ standard specifies that
2073 @code{operator new} only returns @code{0} if it is declared
2074 @samp{throw()}, in which case the compiler always checks the
2075 return value even without this option.  In all other cases, when
2076 @code{operator new} has a non-empty exception specification, memory
2077 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
2078 @samp{new (nothrow)}.
2080 @item -fconstexpr-depth=@var{n}
2081 @opindex fconstexpr-depth
2082 Set the maximum nested evaluation depth for C++11 constexpr functions
2083 to @var{n}.  A limit is needed to detect endless recursion during
2084 constant expression evaluation.  The minimum specified by the standard
2085 is 512.
2087 @item -fdeduce-init-list
2088 @opindex fdeduce-init-list
2089 Enable deduction of a template type parameter as
2090 @code{std::initializer_list} from a brace-enclosed initializer list, i.e.@:
2092 @smallexample
2093 template <class T> auto forward(T t) -> decltype (realfn (t))
2095   return realfn (t);
2098 void f()
2100   forward(@{1,2@}); // call forward<std::initializer_list<int>>
2102 @end smallexample
2104 This deduction was implemented as a possible extension to the
2105 originally proposed semantics for the C++11 standard, but was not part
2106 of the final standard, so it is disabled by default.  This option is
2107 deprecated, and may be removed in a future version of G++.
2109 @item -ffriend-injection
2110 @opindex ffriend-injection
2111 Inject friend functions into the enclosing namespace, so that they are
2112 visible outside the scope of the class in which they are declared.
2113 Friend functions were documented to work this way in the old Annotated
2114 C++ Reference Manual, and versions of G++ before 4.1 always worked
2115 that way.  However, in ISO C++ a friend function that is not declared
2116 in an enclosing scope can only be found using argument dependent
2117 lookup.  This option causes friends to be injected as they were in
2118 earlier releases.
2120 This option is for compatibility, and may be removed in a future
2121 release of G++.
2123 @item -fno-elide-constructors
2124 @opindex fno-elide-constructors
2125 The C++ standard allows an implementation to omit creating a temporary
2126 that is only used to initialize another object of the same type.
2127 Specifying this option disables that optimization, and forces G++ to
2128 call the copy constructor in all cases.
2130 @item -fno-enforce-eh-specs
2131 @opindex fno-enforce-eh-specs
2132 Don't generate code to check for violation of exception specifications
2133 at run time.  This option violates the C++ standard, but may be useful
2134 for reducing code size in production builds, much like defining
2135 @samp{NDEBUG}.  This does not give user code permission to throw
2136 exceptions in violation of the exception specifications; the compiler
2137 still optimizes based on the specifications, so throwing an
2138 unexpected exception results in undefined behavior at run time.
2140 @item -fextern-tls-init
2141 @itemx -fno-extern-tls-init
2142 @opindex fextern-tls-init
2143 @opindex fno-extern-tls-init
2144 The C++11 and OpenMP standards allow @samp{thread_local} and
2145 @samp{threadprivate} variables to have dynamic (runtime)
2146 initialization.  To support this, any use of such a variable goes
2147 through a wrapper function that performs any necessary initialization.
2148 When the use and definition of the variable are in the same
2149 translation unit, this overhead can be optimized away, but when the
2150 use is in a different translation unit there is significant overhead
2151 even if the variable doesn't actually need dynamic initialization.  If
2152 the programmer can be sure that no use of the variable in a
2153 non-defining TU needs to trigger dynamic initialization (either
2154 because the variable is statically initialized, or a use of the
2155 variable in the defining TU will be executed before any uses in
2156 another TU), they can avoid this overhead with the
2157 @option{-fno-extern-tls-init} option.
2159 On targets that support symbol aliases, the default is
2160 @option{-fextern-tls-init}.  On targets that do not support symbol
2161 aliases, the default is @option{-fno-extern-tls-init}.
2163 @item -ffor-scope
2164 @itemx -fno-for-scope
2165 @opindex ffor-scope
2166 @opindex fno-for-scope
2167 If @option{-ffor-scope} is specified, the scope of variables declared in
2168 a @i{for-init-statement} is limited to the @samp{for} loop itself,
2169 as specified by the C++ standard.
2170 If @option{-fno-for-scope} is specified, the scope of variables declared in
2171 a @i{for-init-statement} extends to the end of the enclosing scope,
2172 as was the case in old versions of G++, and other (traditional)
2173 implementations of C++.
2175 If neither flag is given, the default is to follow the standard,
2176 but to allow and give a warning for old-style code that would
2177 otherwise be invalid, or have different behavior.
2179 @item -fno-gnu-keywords
2180 @opindex fno-gnu-keywords
2181 Do not recognize @code{typeof} as a keyword, so that code can use this
2182 word as an identifier.  You can use the keyword @code{__typeof__} instead.
2183 @option{-ansi} implies @option{-fno-gnu-keywords}.
2185 @item -fno-implicit-templates
2186 @opindex fno-implicit-templates
2187 Never emit code for non-inline templates that are instantiated
2188 implicitly (i.e.@: by use); only emit code for explicit instantiations.
2189 @xref{Template Instantiation}, for more information.
2191 @item -fno-implicit-inline-templates
2192 @opindex fno-implicit-inline-templates
2193 Don't emit code for implicit instantiations of inline templates, either.
2194 The default is to handle inlines differently so that compiles with and
2195 without optimization need the same set of explicit instantiations.
2197 @item -fno-implement-inlines
2198 @opindex fno-implement-inlines
2199 To save space, do not emit out-of-line copies of inline functions
2200 controlled by @samp{#pragma implementation}.  This causes linker
2201 errors if these functions are not inlined everywhere they are called.
2203 @item -fms-extensions
2204 @opindex fms-extensions
2205 Disable Wpedantic warnings about constructs used in MFC, such as implicit
2206 int and getting a pointer to member function via non-standard syntax.
2208 @item -fno-nonansi-builtins
2209 @opindex fno-nonansi-builtins
2210 Disable built-in declarations of functions that are not mandated by
2211 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
2212 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
2214 @item -fnothrow-opt
2215 @opindex fnothrow-opt
2216 Treat a @code{throw()} exception specification as if it were a
2217 @code{noexcept} specification to reduce or eliminate the text size
2218 overhead relative to a function with no exception specification.  If
2219 the function has local variables of types with non-trivial
2220 destructors, the exception specification actually makes the
2221 function smaller because the EH cleanups for those variables can be
2222 optimized away.  The semantic effect is that an exception thrown out of
2223 a function with such an exception specification results in a call
2224 to @code{terminate} rather than @code{unexpected}.
2226 @item -fno-operator-names
2227 @opindex fno-operator-names
2228 Do not treat the operator name keywords @code{and}, @code{bitand},
2229 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
2230 synonyms as keywords.
2232 @item -fno-optional-diags
2233 @opindex fno-optional-diags
2234 Disable diagnostics that the standard says a compiler does not need to
2235 issue.  Currently, the only such diagnostic issued by G++ is the one for
2236 a name having multiple meanings within a class.
2238 @item -fpermissive
2239 @opindex fpermissive
2240 Downgrade some diagnostics about nonconformant code from errors to
2241 warnings.  Thus, using @option{-fpermissive} allows some
2242 nonconforming code to compile.
2244 @item -fno-pretty-templates
2245 @opindex fno-pretty-templates
2246 When an error message refers to a specialization of a function
2247 template, the compiler normally prints the signature of the
2248 template followed by the template arguments and any typedefs or
2249 typenames in the signature (e.g. @code{void f(T) [with T = int]}
2250 rather than @code{void f(int)}) so that it's clear which template is
2251 involved.  When an error message refers to a specialization of a class
2252 template, the compiler omits any template arguments that match
2253 the default template arguments for that template.  If either of these
2254 behaviors make it harder to understand the error message rather than
2255 easier, you can use @option{-fno-pretty-templates} to disable them.
2257 @item -frepo
2258 @opindex frepo
2259 Enable automatic template instantiation at link time.  This option also
2260 implies @option{-fno-implicit-templates}.  @xref{Template
2261 Instantiation}, for more information.
2263 @item -fno-rtti
2264 @opindex fno-rtti
2265 Disable generation of information about every class with virtual
2266 functions for use by the C++ run-time type identification features
2267 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
2268 of the language, you can save some space by using this flag.  Note that
2269 exception handling uses the same information, but G++ generates it as
2270 needed. The @samp{dynamic_cast} operator can still be used for casts that
2271 do not require run-time type information, i.e.@: casts to @code{void *} or to
2272 unambiguous base classes.
2274 @item -fstats
2275 @opindex fstats
2276 Emit statistics about front-end processing at the end of the compilation.
2277 This information is generally only useful to the G++ development team.
2279 @item -fstrict-enums
2280 @opindex fstrict-enums
2281 Allow the compiler to optimize using the assumption that a value of
2282 enumerated type can only be one of the values of the enumeration (as
2283 defined in the C++ standard; basically, a value that can be
2284 represented in the minimum number of bits needed to represent all the
2285 enumerators).  This assumption may not be valid if the program uses a
2286 cast to convert an arbitrary integer value to the enumerated type.
2288 @item -ftemplate-backtrace-limit=@var{n}
2289 @opindex ftemplate-backtrace-limit
2290 Set the maximum number of template instantiation notes for a single
2291 warning or error to @var{n}.  The default value is 10.
2293 @item -ftemplate-depth=@var{n}
2294 @opindex ftemplate-depth
2295 Set the maximum instantiation depth for template classes to @var{n}.
2296 A limit on the template instantiation depth is needed to detect
2297 endless recursions during template class instantiation.  ANSI/ISO C++
2298 conforming programs must not rely on a maximum depth greater than 17
2299 (changed to 1024 in C++11).  The default value is 900, as the compiler
2300 can run out of stack space before hitting 1024 in some situations.
2302 @item -fno-threadsafe-statics
2303 @opindex fno-threadsafe-statics
2304 Do not emit the extra code to use the routines specified in the C++
2305 ABI for thread-safe initialization of local statics.  You can use this
2306 option to reduce code size slightly in code that doesn't need to be
2307 thread-safe.
2309 @item -fuse-cxa-atexit
2310 @opindex fuse-cxa-atexit
2311 Register destructors for objects with static storage duration with the
2312 @code{__cxa_atexit} function rather than the @code{atexit} function.
2313 This option is required for fully standards-compliant handling of static
2314 destructors, but only works if your C library supports
2315 @code{__cxa_atexit}.
2317 @item -fno-use-cxa-get-exception-ptr
2318 @opindex fno-use-cxa-get-exception-ptr
2319 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
2320 causes @code{std::uncaught_exception} to be incorrect, but is necessary
2321 if the runtime routine is not available.
2323 @item -fvisibility-inlines-hidden
2324 @opindex fvisibility-inlines-hidden
2325 This switch declares that the user does not attempt to compare
2326 pointers to inline functions or methods where the addresses of the two functions
2327 are taken in different shared objects.
2329 The effect of this is that GCC may, effectively, mark inline methods with
2330 @code{__attribute__ ((visibility ("hidden")))} so that they do not
2331 appear in the export table of a DSO and do not require a PLT indirection
2332 when used within the DSO@.  Enabling this option can have a dramatic effect
2333 on load and link times of a DSO as it massively reduces the size of the
2334 dynamic export table when the library makes heavy use of templates.
2336 The behavior of this switch is not quite the same as marking the
2337 methods as hidden directly, because it does not affect static variables
2338 local to the function or cause the compiler to deduce that
2339 the function is defined in only one shared object.
2341 You may mark a method as having a visibility explicitly to negate the
2342 effect of the switch for that method.  For example, if you do want to
2343 compare pointers to a particular inline method, you might mark it as
2344 having default visibility.  Marking the enclosing class with explicit
2345 visibility has no effect.
2347 Explicitly instantiated inline methods are unaffected by this option
2348 as their linkage might otherwise cross a shared library boundary.
2349 @xref{Template Instantiation}.
2351 @item -fvisibility-ms-compat
2352 @opindex fvisibility-ms-compat
2353 This flag attempts to use visibility settings to make GCC's C++
2354 linkage model compatible with that of Microsoft Visual Studio.
2356 The flag makes these changes to GCC's linkage model:
2358 @enumerate
2359 @item
2360 It sets the default visibility to @code{hidden}, like
2361 @option{-fvisibility=hidden}.
2363 @item
2364 Types, but not their members, are not hidden by default.
2366 @item
2367 The One Definition Rule is relaxed for types without explicit
2368 visibility specifications that are defined in more than one
2369 shared object: those declarations are permitted if they are
2370 permitted when this option is not used.
2371 @end enumerate
2373 In new code it is better to use @option{-fvisibility=hidden} and
2374 export those classes that are intended to be externally visible.
2375 Unfortunately it is possible for code to rely, perhaps accidentally,
2376 on the Visual Studio behavior.
2378 Among the consequences of these changes are that static data members
2379 of the same type with the same name but defined in different shared
2380 objects are different, so changing one does not change the other;
2381 and that pointers to function members defined in different shared
2382 objects may not compare equal.  When this flag is given, it is a
2383 violation of the ODR to define types with the same name differently.
2385 @item -fvtable-verify=@var{std|preinit|none}
2386 @opindex fvtable-verify
2387 Turn on (or off, if using @option{-fvtable-verify=none}) the security
2388 feature that verifies at runtime, for every virtual call that is made, that
2389 the vtable pointer through which the call is made is valid for the type of
2390 the object, and has not been corrupted or overwritten.  If an invalid vtable
2391 pointer is detected (at runtime), an error is reported and execution of the
2392 program is immediately halted.
2394 This option causes runtime data structures to be built, at program start up,
2395 for verifying the vtable pointers.  The options @code{std} and @code{preinit}
2396 control the timing of when these data structures are built.  In both cases the
2397 data structures are built before execution reaches 'main'.  The
2398 @option{-fvtable-verify=std} causes these data structure to be built after the
2399 shared libraries have been loaded and initialized.
2400 @option{-fvtable-verify=preinit} causes them to be built before the shared
2401 libraries have been loaded and initialized.
2403 If this option appears multiple times in the compiler line, with different
2404 values specified, 'none' will take highest priority over both 'std' and
2405 'preinit'; 'preinit' will take priority over 'std'.
2407 @item -fvtv-debug
2408 @opindex (fvtv-debug)
2409 Causes debug versions of the runtime functions for the vtable verification 
2410 feature to be called.  This assumes the @option{-fvtable-verify=std} or
2411 @option{-fvtable-verify=preinit} has been used.  This flag will also cause the
2412 compiler to keep track of which vtable pointers it found for each class, and
2413 record that information in the file ``vtv_set_ptr_data.log'', in the dump
2414 file directory on the user's machine.
2416 Note:  This feature APPENDS data to the log file. If you want a fresh log
2417 file, be sure to delete any existing one.
2419 @item -fvtv-counts
2420 @opindex fvtv-counts
2421 This is a debugging flag.  When used in conjunction with
2422 @option{-fvtable-verify=std} or @option{-fvtable-verify=preinit}, this
2423 causes the compiler to keep track of the total number of virtual calls
2424 it encountered and the number of verifications it inserted.  It also
2425 counts the number of calls to certain runtime library functions
2426 that it inserts.  This information, for each compilation unit, is written
2427 to a file named ``vtv_count_data.log'', in the dump_file directory on
2428 the user's machine.   It also counts the size of the vtable pointer sets
2429 for each class, and writes this information to ``vtv_class_set_sizes.log''
2430 in the same directory.
2432 Note:  This feature APPENDS data to the log files.  To get a fresh log
2433 files, be sure to delete any existing ones.
2435 @item -fno-weak
2436 @opindex fno-weak
2437 Do not use weak symbol support, even if it is provided by the linker.
2438 By default, G++ uses weak symbols if they are available.  This
2439 option exists only for testing, and should not be used by end-users;
2440 it results in inferior code and has no benefits.  This option may
2441 be removed in a future release of G++.
2443 @item -nostdinc++
2444 @opindex nostdinc++
2445 Do not search for header files in the standard directories specific to
2446 C++, but do still search the other standard directories.  (This option
2447 is used when building the C++ library.)
2448 @end table
2450 In addition, these optimization, warning, and code generation options
2451 have meanings only for C++ programs:
2453 @table @gcctabopt
2454 @item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)}
2455 @opindex Wabi
2456 @opindex Wno-abi
2457 Warn when G++ generates code that is probably not compatible with the
2458 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
2459 all such cases, there are probably some cases that are not warned about,
2460 even though G++ is generating incompatible code.  There may also be
2461 cases where warnings are emitted even though the code that is generated
2462 is compatible.
2464 You should rewrite your code to avoid these warnings if you are
2465 concerned about the fact that code generated by G++ may not be binary
2466 compatible with code generated by other compilers.
2468 The known incompatibilities in @option{-fabi-version=2} (the default) include:
2470 @itemize @bullet
2472 @item
2473 A template with a non-type template parameter of reference type is
2474 mangled incorrectly:
2475 @smallexample
2476 extern int N;
2477 template <int &> struct S @{@};
2478 void n (S<N>) @{2@}
2479 @end smallexample
2481 This is fixed in @option{-fabi-version=3}.
2483 @item
2484 SIMD vector types declared using @code{__attribute ((vector_size))} are
2485 mangled in a non-standard way that does not allow for overloading of
2486 functions taking vectors of different sizes.
2488 The mangling is changed in @option{-fabi-version=4}.
2489 @end itemize
2491 The known incompatibilities in @option{-fabi-version=1} include:
2493 @itemize @bullet
2495 @item
2496 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
2497 pack data into the same byte as a base class.  For example:
2499 @smallexample
2500 struct A @{ virtual void f(); int f1 : 1; @};
2501 struct B : public A @{ int f2 : 1; @};
2502 @end smallexample
2504 @noindent
2505 In this case, G++ places @code{B::f2} into the same byte
2506 as @code{A::f1}; other compilers do not.  You can avoid this problem
2507 by explicitly padding @code{A} so that its size is a multiple of the
2508 byte size on your platform; that causes G++ and other compilers to
2509 lay out @code{B} identically.
2511 @item
2512 Incorrect handling of tail-padding for virtual bases.  G++ does not use
2513 tail padding when laying out virtual bases.  For example:
2515 @smallexample
2516 struct A @{ virtual void f(); char c1; @};
2517 struct B @{ B(); char c2; @};
2518 struct C : public A, public virtual B @{@};
2519 @end smallexample
2521 @noindent
2522 In this case, G++ does not place @code{B} into the tail-padding for
2523 @code{A}; other compilers do.  You can avoid this problem by
2524 explicitly padding @code{A} so that its size is a multiple of its
2525 alignment (ignoring virtual base classes); that causes G++ and other
2526 compilers to lay out @code{C} identically.
2528 @item
2529 Incorrect handling of bit-fields with declared widths greater than that
2530 of their underlying types, when the bit-fields appear in a union.  For
2531 example:
2533 @smallexample
2534 union U @{ int i : 4096; @};
2535 @end smallexample
2537 @noindent
2538 Assuming that an @code{int} does not have 4096 bits, G++ makes the
2539 union too small by the number of bits in an @code{int}.
2541 @item
2542 Empty classes can be placed at incorrect offsets.  For example:
2544 @smallexample
2545 struct A @{@};
2547 struct B @{
2548   A a;
2549   virtual void f ();
2552 struct C : public B, public A @{@};
2553 @end smallexample
2555 @noindent
2556 G++ places the @code{A} base class of @code{C} at a nonzero offset;
2557 it should be placed at offset zero.  G++ mistakenly believes that the
2558 @code{A} data member of @code{B} is already at offset zero.
2560 @item
2561 Names of template functions whose types involve @code{typename} or
2562 template template parameters can be mangled incorrectly.
2564 @smallexample
2565 template <typename Q>
2566 void f(typename Q::X) @{@}
2568 template <template <typename> class Q>
2569 void f(typename Q<int>::X) @{@}
2570 @end smallexample
2572 @noindent
2573 Instantiations of these templates may be mangled incorrectly.
2575 @end itemize
2577 It also warns about psABI-related changes.  The known psABI changes at this
2578 point include:
2580 @itemize @bullet
2582 @item
2583 For SysV/x86-64, unions with @code{long double} members are 
2584 passed in memory as specified in psABI.  For example:
2586 @smallexample
2587 union U @{
2588   long double ld;
2589   int i;
2591 @end smallexample
2593 @noindent
2594 @code{union U} is always passed in memory.
2596 @end itemize
2598 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
2599 @opindex Wctor-dtor-privacy
2600 @opindex Wno-ctor-dtor-privacy
2601 Warn when a class seems unusable because all the constructors or
2602 destructors in that class are private, and it has neither friends nor
2603 public static member functions.  Also warn if there are no non-private
2604 methods, and there's at least one private member function that isn't
2605 a constructor or destructor.
2607 @item -Wdelete-non-virtual-dtor @r{(C++ and Objective-C++ only)}
2608 @opindex Wdelete-non-virtual-dtor
2609 @opindex Wno-delete-non-virtual-dtor
2610 Warn when @samp{delete} is used to destroy an instance of a class that
2611 has virtual functions and non-virtual destructor. It is unsafe to delete
2612 an instance of a derived class through a pointer to a base class if the
2613 base class does not have a virtual destructor.  This warning is enabled
2614 by @option{-Wall}.
2616 @item -Wliteral-suffix @r{(C++ and Objective-C++ only)}
2617 @opindex Wliteral-suffix
2618 @opindex Wno-literal-suffix
2619 Warn when a string or character literal is followed by a ud-suffix which does
2620 not begin with an underscore.  As a conforming extension, GCC treats such
2621 suffixes as separate preprocessing tokens in order to maintain backwards
2622 compatibility with code that uses formatting macros from @code{<inttypes.h>}.
2623 For example:
2625 @smallexample
2626 #define __STDC_FORMAT_MACROS
2627 #include <inttypes.h>
2628 #include <stdio.h>
2630 int main() @{
2631   int64_t i64 = 123;
2632   printf("My int64: %"PRId64"\n", i64);
2634 @end smallexample
2636 In this case, @code{PRId64} is treated as a separate preprocessing token.
2638 This warning is enabled by default.
2640 @item -Wnarrowing @r{(C++ and Objective-C++ only)}
2641 @opindex Wnarrowing
2642 @opindex Wno-narrowing
2643 Warn when a narrowing conversion prohibited by C++11 occurs within
2644 @samp{@{ @}}, e.g.
2646 @smallexample
2647 int i = @{ 2.2 @}; // error: narrowing from double to int
2648 @end smallexample
2650 This flag is included in @option{-Wall} and @option{-Wc++11-compat}.
2652 With @option{-std=c++11}, @option{-Wno-narrowing} suppresses the diagnostic
2653 required by the standard.  Note that this does not affect the meaning
2654 of well-formed code; narrowing conversions are still considered
2655 ill-formed in SFINAE context.
2657 @item -Wnoexcept @r{(C++ and Objective-C++ only)}
2658 @opindex Wnoexcept
2659 @opindex Wno-noexcept
2660 Warn when a noexcept-expression evaluates to false because of a call
2661 to a function that does not have a non-throwing exception
2662 specification (i.e. @samp{throw()} or @samp{noexcept}) but is known by
2663 the compiler to never throw an exception.
2665 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
2666 @opindex Wnon-virtual-dtor
2667 @opindex Wno-non-virtual-dtor
2668 Warn when a class has virtual functions and an accessible non-virtual
2669 destructor itself or in an accessible polymorphic base class, in which
2670 case it is possible but unsafe to delete an instance of a derived
2671 class through a pointer to the class itself or base class.  This
2672 warning is automatically enabled if @option{-Weffc++} is specified.
2674 @item -Wreorder @r{(C++ and Objective-C++ only)}
2675 @opindex Wreorder
2676 @opindex Wno-reorder
2677 @cindex reordering, warning
2678 @cindex warning for reordering of member initializers
2679 Warn when the order of member initializers given in the code does not
2680 match the order in which they must be executed.  For instance:
2682 @smallexample
2683 struct A @{
2684   int i;
2685   int j;
2686   A(): j (0), i (1) @{ @}
2688 @end smallexample
2690 @noindent
2691 The compiler rearranges the member initializers for @samp{i}
2692 and @samp{j} to match the declaration order of the members, emitting
2693 a warning to that effect.  This warning is enabled by @option{-Wall}.
2695 @item -fext-numeric-literals @r{(C++ and Objective-C++ only)}
2696 @opindex fext-numeric-literals
2697 @opindex fno-ext-numeric-literals
2698 Accept imaginary, fixed-point, or machine-defined
2699 literal number suffixes as GNU extensions.
2700 When this option is turned off these suffixes are treated
2701 as C++11 user-defined literal numeric suffixes.
2702 This is on by default for all pre-C++11 dialects and all GNU dialects:
2703 @option{-std=c++98}, @option{-std=gnu++98}, @option{-std=gnu++11},
2704 @option{-std=gnu++1y}.
2705 This option is off by default
2706 for ISO C++11 onwards (@option{-std=c++11}, ...).
2707 @end table
2709 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
2711 @table @gcctabopt
2712 @item -Weffc++ @r{(C++ and Objective-C++ only)}
2713 @opindex Weffc++
2714 @opindex Wno-effc++
2715 Warn about violations of the following style guidelines from Scott Meyers'
2716 @cite{Effective C++} series of books:
2718 @itemize @bullet
2719 @item
2720 Define a copy constructor and an assignment operator for classes
2721 with dynamically-allocated memory.
2723 @item
2724 Prefer initialization to assignment in constructors.
2726 @item
2727 Have @code{operator=} return a reference to @code{*this}.
2729 @item
2730 Don't try to return a reference when you must return an object.
2732 @item
2733 Distinguish between prefix and postfix forms of increment and
2734 decrement operators.
2736 @item
2737 Never overload @code{&&}, @code{||}, or @code{,}.
2739 @end itemize
2741 This option also enables @option{-Wnon-virtual-dtor}, which is also
2742 one of the effective C++ recommendations.  However, the check is
2743 extended to warn about the lack of virtual destructor in accessible
2744 non-polymorphic bases classes too.
2746 When selecting this option, be aware that the standard library
2747 headers do not obey all of these guidelines; use @samp{grep -v}
2748 to filter out those warnings.
2750 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
2751 @opindex Wstrict-null-sentinel
2752 @opindex Wno-strict-null-sentinel
2753 Warn about the use of an uncasted @code{NULL} as sentinel.  When
2754 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2755 to @code{__null}.  Although it is a null pointer constant rather than a
2756 null pointer, it is guaranteed to be of the same size as a pointer.
2757 But this use is not portable across different compilers.
2759 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
2760 @opindex Wno-non-template-friend
2761 @opindex Wnon-template-friend
2762 Disable warnings when non-templatized friend functions are declared
2763 within a template.  Since the advent of explicit template specification
2764 support in G++, if the name of the friend is an unqualified-id (i.e.,
2765 @samp{friend foo(int)}), the C++ language specification demands that the
2766 friend declare or define an ordinary, nontemplate function.  (Section
2767 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2768 could be interpreted as a particular specialization of a templatized
2769 function.  Because this non-conforming behavior is no longer the default
2770 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2771 check existing code for potential trouble spots and is on by default.
2772 This new compiler behavior can be turned off with
2773 @option{-Wno-non-template-friend}, which keeps the conformant compiler code
2774 but disables the helpful warning.
2776 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
2777 @opindex Wold-style-cast
2778 @opindex Wno-old-style-cast
2779 Warn if an old-style (C-style) cast to a non-void type is used within
2780 a C++ program.  The new-style casts (@samp{dynamic_cast},
2781 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
2782 less vulnerable to unintended effects and much easier to search for.
2784 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
2785 @opindex Woverloaded-virtual
2786 @opindex Wno-overloaded-virtual
2787 @cindex overloaded virtual function, warning
2788 @cindex warning for overloaded virtual function
2789 Warn when a function declaration hides virtual functions from a
2790 base class.  For example, in:
2792 @smallexample
2793 struct A @{
2794   virtual void f();
2797 struct B: public A @{
2798   void f(int);
2800 @end smallexample
2802 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2803 like:
2805 @smallexample
2806 B* b;
2807 b->f();
2808 @end smallexample
2810 @noindent
2811 fails to compile.
2813 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
2814 @opindex Wno-pmf-conversions
2815 @opindex Wpmf-conversions
2816 Disable the diagnostic for converting a bound pointer to member function
2817 to a plain pointer.
2819 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
2820 @opindex Wsign-promo
2821 @opindex Wno-sign-promo
2822 Warn when overload resolution chooses a promotion from unsigned or
2823 enumerated type to a signed type, over a conversion to an unsigned type of
2824 the same size.  Previous versions of G++ tried to preserve
2825 unsignedness, but the standard mandates the current behavior.
2826 @end table
2828 @node Objective-C and Objective-C++ Dialect Options
2829 @section Options Controlling Objective-C and Objective-C++ Dialects
2831 @cindex compiler options, Objective-C and Objective-C++
2832 @cindex Objective-C and Objective-C++ options, command-line
2833 @cindex options, Objective-C and Objective-C++
2834 (NOTE: This manual does not describe the Objective-C and Objective-C++
2835 languages themselves.  @xref{Standards,,Language Standards
2836 Supported by GCC}, for references.)
2838 This section describes the command-line options that are only meaningful
2839 for Objective-C and Objective-C++ programs.  You can also use most of
2840 the language-independent GNU compiler options.
2841 For example, you might compile a file @code{some_class.m} like this:
2843 @smallexample
2844 gcc -g -fgnu-runtime -O -c some_class.m
2845 @end smallexample
2847 @noindent
2848 In this example, @option{-fgnu-runtime} is an option meant only for
2849 Objective-C and Objective-C++ programs; you can use the other options with
2850 any language supported by GCC@.
2852 Note that since Objective-C is an extension of the C language, Objective-C
2853 compilations may also use options specific to the C front-end (e.g.,
2854 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2855 C++-specific options (e.g., @option{-Wabi}).
2857 Here is a list of options that are @emph{only} for compiling Objective-C
2858 and Objective-C++ programs:
2860 @table @gcctabopt
2861 @item -fconstant-string-class=@var{class-name}
2862 @opindex fconstant-string-class
2863 Use @var{class-name} as the name of the class to instantiate for each
2864 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2865 class name is @code{NXConstantString} if the GNU runtime is being used, and
2866 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2867 @option{-fconstant-cfstrings} option, if also present, overrides the
2868 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2869 to be laid out as constant CoreFoundation strings.
2871 @item -fgnu-runtime
2872 @opindex fgnu-runtime
2873 Generate object code compatible with the standard GNU Objective-C
2874 runtime.  This is the default for most types of systems.
2876 @item -fnext-runtime
2877 @opindex fnext-runtime
2878 Generate output compatible with the NeXT runtime.  This is the default
2879 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2880 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2881 used.
2883 @item -fno-nil-receivers
2884 @opindex fno-nil-receivers
2885 Assume that all Objective-C message dispatches (@code{[receiver
2886 message:arg]}) in this translation unit ensure that the receiver is
2887 not @code{nil}.  This allows for more efficient entry points in the
2888 runtime to be used.  This option is only available in conjunction with
2889 the NeXT runtime and ABI version 0 or 1.
2891 @item -fobjc-abi-version=@var{n}
2892 @opindex fobjc-abi-version
2893 Use version @var{n} of the Objective-C ABI for the selected runtime.
2894 This option is currently supported only for the NeXT runtime.  In that
2895 case, Version 0 is the traditional (32-bit) ABI without support for
2896 properties and other Objective-C 2.0 additions.  Version 1 is the
2897 traditional (32-bit) ABI with support for properties and other
2898 Objective-C 2.0 additions.  Version 2 is the modern (64-bit) ABI.  If
2899 nothing is specified, the default is Version 0 on 32-bit target
2900 machines, and Version 2 on 64-bit target machines.
2902 @item -fobjc-call-cxx-cdtors
2903 @opindex fobjc-call-cxx-cdtors
2904 For each Objective-C class, check if any of its instance variables is a
2905 C++ object with a non-trivial default constructor.  If so, synthesize a
2906 special @code{- (id) .cxx_construct} instance method which runs
2907 non-trivial default constructors on any such instance variables, in order,
2908 and then return @code{self}.  Similarly, check if any instance variable
2909 is a C++ object with a non-trivial destructor, and if so, synthesize a
2910 special @code{- (void) .cxx_destruct} method which runs
2911 all such default destructors, in reverse order.
2913 The @code{- (id) .cxx_construct} and @code{- (void) .cxx_destruct}
2914 methods thusly generated only operate on instance variables
2915 declared in the current Objective-C class, and not those inherited
2916 from superclasses.  It is the responsibility of the Objective-C
2917 runtime to invoke all such methods in an object's inheritance
2918 hierarchy.  The @code{- (id) .cxx_construct} methods are invoked
2919 by the runtime immediately after a new object instance is allocated;
2920 the @code{- (void) .cxx_destruct} methods are invoked immediately
2921 before the runtime deallocates an object instance.
2923 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2924 support for invoking the @code{- (id) .cxx_construct} and
2925 @code{- (void) .cxx_destruct} methods.
2927 @item -fobjc-direct-dispatch
2928 @opindex fobjc-direct-dispatch
2929 Allow fast jumps to the message dispatcher.  On Darwin this is
2930 accomplished via the comm page.
2932 @item -fobjc-exceptions
2933 @opindex fobjc-exceptions
2934 Enable syntactic support for structured exception handling in
2935 Objective-C, similar to what is offered by C++ and Java.  This option
2936 is required to use the Objective-C keywords @code{@@try},
2937 @code{@@throw}, @code{@@catch}, @code{@@finally} and
2938 @code{@@synchronized}.  This option is available with both the GNU
2939 runtime and the NeXT runtime (but not available in conjunction with
2940 the NeXT runtime on Mac OS X 10.2 and earlier).
2942 @item -fobjc-gc
2943 @opindex fobjc-gc
2944 Enable garbage collection (GC) in Objective-C and Objective-C++
2945 programs.  This option is only available with the NeXT runtime; the
2946 GNU runtime has a different garbage collection implementation that
2947 does not require special compiler flags.
2949 @item -fobjc-nilcheck
2950 @opindex fobjc-nilcheck
2951 For the NeXT runtime with version 2 of the ABI, check for a nil
2952 receiver in method invocations before doing the actual method call.
2953 This is the default and can be disabled using
2954 @option{-fno-objc-nilcheck}.  Class methods and super calls are never
2955 checked for nil in this way no matter what this flag is set to.
2956 Currently this flag does nothing when the GNU runtime, or an older
2957 version of the NeXT runtime ABI, is used.
2959 @item -fobjc-std=objc1
2960 @opindex fobjc-std
2961 Conform to the language syntax of Objective-C 1.0, the language
2962 recognized by GCC 4.0.  This only affects the Objective-C additions to
2963 the C/C++ language; it does not affect conformance to C/C++ standards,
2964 which is controlled by the separate C/C++ dialect option flags.  When
2965 this option is used with the Objective-C or Objective-C++ compiler,
2966 any Objective-C syntax that is not recognized by GCC 4.0 is rejected.
2967 This is useful if you need to make sure that your Objective-C code can
2968 be compiled with older versions of GCC@.
2970 @item -freplace-objc-classes
2971 @opindex freplace-objc-classes
2972 Emit a special marker instructing @command{ld(1)} not to statically link in
2973 the resulting object file, and allow @command{dyld(1)} to load it in at
2974 run time instead.  This is used in conjunction with the Fix-and-Continue
2975 debugging mode, where the object file in question may be recompiled and
2976 dynamically reloaded in the course of program execution, without the need
2977 to restart the program itself.  Currently, Fix-and-Continue functionality
2978 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2979 and later.
2981 @item -fzero-link
2982 @opindex fzero-link
2983 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2984 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2985 compile time) with static class references that get initialized at load time,
2986 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2987 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2988 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2989 for individual class implementations to be modified during program execution.
2990 The GNU runtime currently always retains calls to @code{objc_get_class("@dots{}")}
2991 regardless of command-line options.
2993 @item -fno-local-ivars
2994 @opindex fno-local-ivars
2995 @opindex flocal-ivars
2996 By default instance variables in Objective-C can be accessed as if
2997 they were local variables from within the methods of the class they're
2998 declared in.  This can lead to shadowing between instance variables
2999 and other variables declared either locally inside a class method or
3000 globally with the same name.  Specifying the @option{-fno-local-ivars}
3001 flag disables this behavior thus avoiding variable shadowing issues.
3003 @item -fivar-visibility=@var{public|protected|private|package}
3004 @opindex fivar-visibility
3005 Set the default instance variable visibility to the specified option
3006 so that instance variables declared outside the scope of any access
3007 modifier directives default to the specified visibility.
3009 @item -gen-decls
3010 @opindex gen-decls
3011 Dump interface declarations for all classes seen in the source file to a
3012 file named @file{@var{sourcename}.decl}.
3014 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
3015 @opindex Wassign-intercept
3016 @opindex Wno-assign-intercept
3017 Warn whenever an Objective-C assignment is being intercepted by the
3018 garbage collector.
3020 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
3021 @opindex Wno-protocol
3022 @opindex Wprotocol
3023 If a class is declared to implement a protocol, a warning is issued for
3024 every method in the protocol that is not implemented by the class.  The
3025 default behavior is to issue a warning for every method not explicitly
3026 implemented in the class, even if a method implementation is inherited
3027 from the superclass.  If you use the @option{-Wno-protocol} option, then
3028 methods inherited from the superclass are considered to be implemented,
3029 and no warning is issued for them.
3031 @item -Wselector @r{(Objective-C and Objective-C++ only)}
3032 @opindex Wselector
3033 @opindex Wno-selector
3034 Warn if multiple methods of different types for the same selector are
3035 found during compilation.  The check is performed on the list of methods
3036 in the final stage of compilation.  Additionally, a check is performed
3037 for each selector appearing in a @code{@@selector(@dots{})}
3038 expression, and a corresponding method for that selector has been found
3039 during compilation.  Because these checks scan the method table only at
3040 the end of compilation, these warnings are not produced if the final
3041 stage of compilation is not reached, for example because an error is
3042 found during compilation, or because the @option{-fsyntax-only} option is
3043 being used.
3045 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
3046 @opindex Wstrict-selector-match
3047 @opindex Wno-strict-selector-match
3048 Warn if multiple methods with differing argument and/or return types are
3049 found for a given selector when attempting to send a message using this
3050 selector to a receiver of type @code{id} or @code{Class}.  When this flag
3051 is off (which is the default behavior), the compiler omits such warnings
3052 if any differences found are confined to types that share the same size
3053 and alignment.
3055 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
3056 @opindex Wundeclared-selector
3057 @opindex Wno-undeclared-selector
3058 Warn if a @code{@@selector(@dots{})} expression referring to an
3059 undeclared selector is found.  A selector is considered undeclared if no
3060 method with that name has been declared before the
3061 @code{@@selector(@dots{})} expression, either explicitly in an
3062 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
3063 an @code{@@implementation} section.  This option always performs its
3064 checks as soon as a @code{@@selector(@dots{})} expression is found,
3065 while @option{-Wselector} only performs its checks in the final stage of
3066 compilation.  This also enforces the coding style convention
3067 that methods and selectors must be declared before being used.
3069 @item -print-objc-runtime-info
3070 @opindex print-objc-runtime-info
3071 Generate C header describing the largest structure that is passed by
3072 value, if any.
3074 @end table
3076 @node Language Independent Options
3077 @section Options to Control Diagnostic Messages Formatting
3078 @cindex options to control diagnostics formatting
3079 @cindex diagnostic messages
3080 @cindex message formatting
3082 Traditionally, diagnostic messages have been formatted irrespective of
3083 the output device's aspect (e.g.@: its width, @dots{}).  You can use the
3084 options described below
3085 to control the formatting algorithm for diagnostic messages, 
3086 e.g.@: how many characters per line, how often source location
3087 information should be reported.  Note that some language front ends may not
3088 honor these options.
3090 @table @gcctabopt
3091 @item -fmessage-length=@var{n}
3092 @opindex fmessage-length
3093 Try to format error messages so that they fit on lines of about @var{n}
3094 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
3095 the front ends supported by GCC@.  If @var{n} is zero, then no
3096 line-wrapping is done; each error message appears on a single
3097 line.
3099 @item -fdiagnostics-show-location=once
3100 @opindex fdiagnostics-show-location
3101 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
3102 reporter to emit source location information @emph{once}; that is, in
3103 case the message is too long to fit on a single physical line and has to
3104 be wrapped, the source location won't be emitted (as prefix) again,
3105 over and over, in subsequent continuation lines.  This is the default
3106 behavior.
3108 @item -fdiagnostics-show-location=every-line
3109 Only meaningful in line-wrapping mode.  Instructs the diagnostic
3110 messages reporter to emit the same source location information (as
3111 prefix) for physical lines that result from the process of breaking
3112 a message which is too long to fit on a single line.
3114 @item -fdiagnostics-color[=@var{WHEN}]
3115 @itemx -fno-diagnostics-color
3116 @opindex fdiagnostics-color
3117 @cindex highlight, color, colour
3118 @vindex GCC_COLORS @r{environment variable}
3119 Use color in diagnostics.  @var{WHEN} is @samp{never}, @samp{always},
3120 or @samp{auto}.  The default is @samp{never} if @env{GCC_COLORS} environment
3121 variable isn't present in the environment, and @samp{auto} otherwise.
3122 @samp{auto} means to use color only when the standard error is a terminal.
3123 The forms @option{-fdiagnostics-color} and @option{-fno-diagnostics-color} are
3124 aliases for @option{-fdiagnostics-color=always} and
3125 @option{-fdiagnostics-color=never}, respectively.
3127 The colors are defined by the environment variable @env{GCC_COLORS}.
3128 Its value is a colon-separated list of capabilities and Select Graphic
3129 Rendition (SGR) substrings. SGR commands are interpreted by the
3130 terminal or terminal emulator.  (See the section in the documentation
3131 of your text terminal for permitted values and their meanings as
3132 character attributes.)  These substring values are integers in decimal
3133 representation and can be concatenated with semicolons.
3134 Common values to concatenate include
3135 @samp{1} for bold,
3136 @samp{4} for underline,
3137 @samp{5} for blink,
3138 @samp{7} for inverse,
3139 @samp{39} for default foreground color,
3140 @samp{30} to @samp{37} for foreground colors,
3141 @samp{90} to @samp{97} for 16-color mode foreground colors,
3142 @samp{38;5;0} to @samp{38;5;255}
3143 for 88-color and 256-color modes foreground colors,
3144 @samp{49} for default background color,
3145 @samp{40} to @samp{47} for background colors,
3146 @samp{100} to @samp{107} for 16-color mode background colors,
3147 and @samp{48;5;0} to @samp{48;5;255}
3148 for 88-color and 256-color modes background colors.
3150 The default @env{GCC_COLORS} is
3151 @samp{error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01}
3152 where @samp{01;31} is bold red, @samp{01;35} is bold magenta,
3153 @samp{01;36} is bold cyan, @samp{01;32} is bold green and
3154 @samp{01} is bold. Setting @env{GCC_COLORS} to the empty
3155 string disables colors.
3156 Supported capabilities are as follows.
3158 @table @code
3159 @item error=
3160 @vindex error GCC_COLORS @r{capability}
3161 SGR substring for error: markers.
3163 @item warning=
3164 @vindex warning GCC_COLORS @r{capability}
3165 SGR substring for warning: markers.
3167 @item note=
3168 @vindex note GCC_COLORS @r{capability}
3169 SGR substring for note: markers.
3171 @item caret=
3172 @vindex caret GCC_COLORS @r{capability}
3173 SGR substring for caret line.
3175 @item locus=
3176 @vindex locus GCC_COLORS @r{capability}
3177 SGR substring for location information, @samp{file:line} or
3178 @samp{file:line:column} etc.
3180 @item quote=
3181 @vindex quote GCC_COLORS @r{capability}
3182 SGR substring for information printed within quotes.
3183 @end table
3185 @item -fno-diagnostics-show-option
3186 @opindex fno-diagnostics-show-option
3187 @opindex fdiagnostics-show-option
3188 By default, each diagnostic emitted includes text indicating the
3189 command-line option that directly controls the diagnostic (if such an
3190 option is known to the diagnostic machinery).  Specifying the
3191 @option{-fno-diagnostics-show-option} flag suppresses that behavior.
3193 @item -fno-diagnostics-show-caret
3194 @opindex fno-diagnostics-show-caret
3195 @opindex fdiagnostics-show-caret
3196 By default, each diagnostic emitted includes the original source line
3197 and a caret '^' indicating the column.  This option suppresses this
3198 information.
3200 @end table
3202 @node Warning Options
3203 @section Options to Request or Suppress Warnings
3204 @cindex options to control warnings
3205 @cindex warning messages
3206 @cindex messages, warning
3207 @cindex suppressing warnings
3209 Warnings are diagnostic messages that report constructions that
3210 are not inherently erroneous but that are risky or suggest there
3211 may have been an error.
3213 The following language-independent options do not enable specific
3214 warnings but control the kinds of diagnostics produced by GCC@.
3216 @table @gcctabopt
3217 @cindex syntax checking
3218 @item -fsyntax-only
3219 @opindex fsyntax-only
3220 Check the code for syntax errors, but don't do anything beyond that.
3222 @item -fmax-errors=@var{n}
3223 @opindex fmax-errors
3224 Limits the maximum number of error messages to @var{n}, at which point
3225 GCC bails out rather than attempting to continue processing the source
3226 code.  If @var{n} is 0 (the default), there is no limit on the number
3227 of error messages produced.  If @option{-Wfatal-errors} is also
3228 specified, then @option{-Wfatal-errors} takes precedence over this
3229 option.
3231 @item -w
3232 @opindex w
3233 Inhibit all warning messages.
3235 @item -Werror
3236 @opindex Werror
3237 @opindex Wno-error
3238 Make all warnings into errors.
3240 @item -Werror=
3241 @opindex Werror=
3242 @opindex Wno-error=
3243 Make the specified warning into an error.  The specifier for a warning
3244 is appended; for example @option{-Werror=switch} turns the warnings
3245 controlled by @option{-Wswitch} into errors.  This switch takes a
3246 negative form, to be used to negate @option{-Werror} for specific
3247 warnings; for example @option{-Wno-error=switch} makes
3248 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
3249 is in effect.
3251 The warning message for each controllable warning includes the
3252 option that controls the warning.  That option can then be used with
3253 @option{-Werror=} and @option{-Wno-error=} as described above.
3254 (Printing of the option in the warning message can be disabled using the
3255 @option{-fno-diagnostics-show-option} flag.)
3257 Note that specifying @option{-Werror=}@var{foo} automatically implies
3258 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
3259 imply anything.
3261 @item -Wfatal-errors
3262 @opindex Wfatal-errors
3263 @opindex Wno-fatal-errors
3264 This option causes the compiler to abort compilation on the first error
3265 occurred rather than trying to keep going and printing further error
3266 messages.
3268 @end table
3270 You can request many specific warnings with options beginning with
3271 @samp{-W}, for example @option{-Wimplicit} to request warnings on
3272 implicit declarations.  Each of these specific warning options also
3273 has a negative form beginning @samp{-Wno-} to turn off warnings; for
3274 example, @option{-Wno-implicit}.  This manual lists only one of the
3275 two forms, whichever is not the default.  For further
3276 language-specific options also refer to @ref{C++ Dialect Options} and
3277 @ref{Objective-C and Objective-C++ Dialect Options}.
3279 When an unrecognized warning option is requested (e.g.,
3280 @option{-Wunknown-warning}), GCC emits a diagnostic stating
3281 that the option is not recognized.  However, if the @option{-Wno-} form
3282 is used, the behavior is slightly different: no diagnostic is
3283 produced for @option{-Wno-unknown-warning} unless other diagnostics
3284 are being produced.  This allows the use of new @option{-Wno-} options
3285 with old compilers, but if something goes wrong, the compiler
3286 warns that an unrecognized option is present.
3288 @table @gcctabopt
3289 @item -Wpedantic
3290 @itemx -pedantic
3291 @opindex pedantic
3292 @opindex Wpedantic
3293 Issue all the warnings demanded by strict ISO C and ISO C++;
3294 reject all programs that use forbidden extensions, and some other
3295 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
3296 version of the ISO C standard specified by any @option{-std} option used.
3298 Valid ISO C and ISO C++ programs should compile properly with or without
3299 this option (though a rare few require @option{-ansi} or a
3300 @option{-std} option specifying the required version of ISO C)@.  However,
3301 without this option, certain GNU extensions and traditional C and C++
3302 features are supported as well.  With this option, they are rejected.
3304 @option{-Wpedantic} does not cause warning messages for use of the
3305 alternate keywords whose names begin and end with @samp{__}.  Pedantic
3306 warnings are also disabled in the expression that follows
3307 @code{__extension__}.  However, only system header files should use
3308 these escape routes; application programs should avoid them.
3309 @xref{Alternate Keywords}.
3311 Some users try to use @option{-Wpedantic} to check programs for strict ISO
3312 C conformance.  They soon find that it does not do quite what they want:
3313 it finds some non-ISO practices, but not all---only those for which
3314 ISO C @emph{requires} a diagnostic, and some others for which
3315 diagnostics have been added.
3317 A feature to report any failure to conform to ISO C might be useful in
3318 some instances, but would require considerable additional work and would
3319 be quite different from @option{-Wpedantic}.  We don't have plans to
3320 support such a feature in the near future.
3322 Where the standard specified with @option{-std} represents a GNU
3323 extended dialect of C, such as @samp{gnu90} or @samp{gnu99}, there is a
3324 corresponding @dfn{base standard}, the version of ISO C on which the GNU
3325 extended dialect is based.  Warnings from @option{-Wpedantic} are given
3326 where they are required by the base standard.  (It does not make sense
3327 for such warnings to be given only for features not in the specified GNU
3328 C dialect, since by definition the GNU dialects of C include all
3329 features the compiler supports with the given option, and there would be
3330 nothing to warn about.)
3332 @item -pedantic-errors
3333 @opindex pedantic-errors
3334 Like @option{-Wpedantic}, except that errors are produced rather than
3335 warnings.
3337 @item -Wall
3338 @opindex Wall
3339 @opindex Wno-all
3340 This enables all the warnings about constructions that some users
3341 consider questionable, and that are easy to avoid (or modify to
3342 prevent the warning), even in conjunction with macros.  This also
3343 enables some language-specific warnings described in @ref{C++ Dialect
3344 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
3346 @option{-Wall} turns on the following warning flags:
3348 @gccoptlist{-Waddress   @gol
3349 -Warray-bounds @r{(only with} @option{-O2}@r{)}  @gol
3350 -Wc++11-compat  @gol
3351 -Wchar-subscripts  @gol
3352 -Wenum-compare @r{(in C/ObjC; this is on by default in C++)} @gol
3353 -Wimplicit-int @r{(C and Objective-C only)} @gol
3354 -Wimplicit-function-declaration @r{(C and Objective-C only)} @gol
3355 -Wcomment  @gol
3356 -Wformat   @gol
3357 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
3358 -Wmaybe-uninitialized @gol
3359 -Wmissing-braces @r{(only for C/ObjC)} @gol
3360 -Wnonnull  @gol
3361 -Wopenmp-simd @gol
3362 -Wparentheses  @gol
3363 -Wpointer-sign  @gol
3364 -Wreorder   @gol
3365 -Wreturn-type  @gol
3366 -Wsequence-point  @gol
3367 -Wsign-compare @r{(only in C++)}  @gol
3368 -Wstrict-aliasing  @gol
3369 -Wstrict-overflow=1  @gol
3370 -Wswitch  @gol
3371 -Wtrigraphs  @gol
3372 -Wuninitialized  @gol
3373 -Wunknown-pragmas  @gol
3374 -Wunused-function  @gol
3375 -Wunused-label     @gol
3376 -Wunused-value     @gol
3377 -Wunused-variable  @gol
3378 -Wvolatile-register-var @gol
3381 Note that some warning flags are not implied by @option{-Wall}.  Some of
3382 them warn about constructions that users generally do not consider
3383 questionable, but which occasionally you might wish to check for;
3384 others warn about constructions that are necessary or hard to avoid in
3385 some cases, and there is no simple way to modify the code to suppress
3386 the warning. Some of them are enabled by @option{-Wextra} but many of
3387 them must be enabled individually.
3389 @item -Wextra
3390 @opindex W
3391 @opindex Wextra
3392 @opindex Wno-extra
3393 This enables some extra warning flags that are not enabled by
3394 @option{-Wall}. (This option used to be called @option{-W}.  The older
3395 name is still supported, but the newer name is more descriptive.)
3397 @gccoptlist{-Wclobbered  @gol
3398 -Wempty-body  @gol
3399 -Wignored-qualifiers @gol
3400 -Wmissing-field-initializers  @gol
3401 -Wmissing-parameter-type @r{(C only)}  @gol
3402 -Wold-style-declaration @r{(C only)}  @gol
3403 -Woverride-init  @gol
3404 -Wsign-compare  @gol
3405 -Wtype-limits  @gol
3406 -Wuninitialized  @gol
3407 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)} @gol
3408 -Wunused-but-set-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}  @gol
3411 The option @option{-Wextra} also prints warning messages for the
3412 following cases:
3414 @itemize @bullet
3416 @item
3417 A pointer is compared against integer zero with @samp{<}, @samp{<=},
3418 @samp{>}, or @samp{>=}.
3420 @item
3421 (C++ only) An enumerator and a non-enumerator both appear in a
3422 conditional expression.
3424 @item
3425 (C++ only) Ambiguous virtual bases.
3427 @item
3428 (C++ only) Subscripting an array that has been declared @samp{register}.
3430 @item
3431 (C++ only) Taking the address of a variable that has been declared
3432 @samp{register}.
3434 @item
3435 (C++ only) A base class is not initialized in a derived class's copy
3436 constructor.
3438 @end itemize
3440 @item -Wchar-subscripts
3441 @opindex Wchar-subscripts
3442 @opindex Wno-char-subscripts
3443 Warn if an array subscript has type @code{char}.  This is a common cause
3444 of error, as programmers often forget that this type is signed on some
3445 machines.
3446 This warning is enabled by @option{-Wall}.
3448 @item -Wcomment
3449 @opindex Wcomment
3450 @opindex Wno-comment
3451 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
3452 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
3453 This warning is enabled by @option{-Wall}.
3455 @item -Wno-coverage-mismatch
3456 @opindex Wno-coverage-mismatch
3457 Warn if feedback profiles do not match when using the
3458 @option{-fprofile-use} option.
3459 If a source file is changed between compiling with @option{-fprofile-gen} and
3460 with @option{-fprofile-use}, the files with the profile feedback can fail
3461 to match the source file and GCC cannot use the profile feedback
3462 information.  By default, this warning is enabled and is treated as an
3463 error.  @option{-Wno-coverage-mismatch} can be used to disable the
3464 warning or @option{-Wno-error=coverage-mismatch} can be used to
3465 disable the error.  Disabling the error for this warning can result in
3466 poorly optimized code and is useful only in the
3467 case of very minor changes such as bug fixes to an existing code-base.
3468 Completely disabling the warning is not recommended.
3470 @item -Wno-cpp
3471 @r{(C, Objective-C, C++, Objective-C++ and Fortran only)}
3473 Suppress warning messages emitted by @code{#warning} directives.
3475 @item -Wdouble-promotion @r{(C, C++, Objective-C and Objective-C++ only)}
3476 @opindex Wdouble-promotion
3477 @opindex Wno-double-promotion
3478 Give a warning when a value of type @code{float} is implicitly
3479 promoted to @code{double}.  CPUs with a 32-bit ``single-precision''
3480 floating-point unit implement @code{float} in hardware, but emulate
3481 @code{double} in software.  On such a machine, doing computations
3482 using @code{double} values is much more expensive because of the
3483 overhead required for software emulation.
3485 It is easy to accidentally do computations with @code{double} because
3486 floating-point literals are implicitly of type @code{double}.  For
3487 example, in:
3488 @smallexample
3489 @group
3490 float area(float radius)
3492    return 3.14159 * radius * radius;
3494 @end group
3495 @end smallexample
3496 the compiler performs the entire computation with @code{double}
3497 because the floating-point literal is a @code{double}.
3499 @item -Wformat
3500 @itemx -Wformat=@var{n}
3501 @opindex Wformat
3502 @opindex Wno-format
3503 @opindex ffreestanding
3504 @opindex fno-builtin
3505 @opindex Wformat=
3506 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
3507 the arguments supplied have types appropriate to the format string
3508 specified, and that the conversions specified in the format string make
3509 sense.  This includes standard functions, and others specified by format
3510 attributes (@pxref{Function Attributes}), in the @code{printf},
3511 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
3512 not in the C standard) families (or other target-specific families).
3513 Which functions are checked without format attributes having been
3514 specified depends on the standard version selected, and such checks of
3515 functions without the attribute specified are disabled by
3516 @option{-ffreestanding} or @option{-fno-builtin}.
3518 The formats are checked against the format features supported by GNU
3519 libc version 2.2.  These include all ISO C90 and C99 features, as well
3520 as features from the Single Unix Specification and some BSD and GNU
3521 extensions.  Other library implementations may not support all these
3522 features; GCC does not support warning about features that go beyond a
3523 particular library's limitations.  However, if @option{-Wpedantic} is used
3524 with @option{-Wformat}, warnings are given about format features not
3525 in the selected standard version (but not for @code{strfmon} formats,
3526 since those are not in any version of the C standard).  @xref{C Dialect
3527 Options,,Options Controlling C Dialect}.
3529 @table @gcctabopt
3530 @item -Wformat=1
3531 @itemx -Wformat
3532 @opindex Wformat
3533 @opindex Wformat=1
3534 Option @option{-Wformat} is equivalent to @option{-Wformat=1}, and
3535 @option{-Wno-format} is equivalent to @option{-Wformat=0}.  Since
3536 @option{-Wformat} also checks for null format arguments for several
3537 functions, @option{-Wformat} also implies @option{-Wnonnull}.  Some
3538 aspects of this level of format checking can be disabled by the
3539 options: @option{-Wno-format-contains-nul},
3540 @option{-Wno-format-extra-args}, and @option{-Wno-format-zero-length}.
3541 @option{-Wformat} is enabled by @option{-Wall}.
3543 @item -Wno-format-contains-nul
3544 @opindex Wno-format-contains-nul
3545 @opindex Wformat-contains-nul
3546 If @option{-Wformat} is specified, do not warn about format strings that
3547 contain NUL bytes.
3549 @item -Wno-format-extra-args
3550 @opindex Wno-format-extra-args
3551 @opindex Wformat-extra-args
3552 If @option{-Wformat} is specified, do not warn about excess arguments to a
3553 @code{printf} or @code{scanf} format function.  The C standard specifies
3554 that such arguments are ignored.
3556 Where the unused arguments lie between used arguments that are
3557 specified with @samp{$} operand number specifications, normally
3558 warnings are still given, since the implementation could not know what
3559 type to pass to @code{va_arg} to skip the unused arguments.  However,
3560 in the case of @code{scanf} formats, this option suppresses the
3561 warning if the unused arguments are all pointers, since the Single
3562 Unix Specification says that such unused arguments are allowed.
3564 @item -Wno-format-zero-length
3565 @opindex Wno-format-zero-length
3566 @opindex Wformat-zero-length
3567 If @option{-Wformat} is specified, do not warn about zero-length formats.
3568 The C standard specifies that zero-length formats are allowed.
3571 @item -Wformat=2
3572 @opindex Wformat=2
3573 Enable @option{-Wformat} plus additional format checks.  Currently
3574 equivalent to @option{-Wformat -Wformat-nonliteral -Wformat-security
3575 -Wformat-signedness -Wformat-y2k}.
3577 @item -Wformat-nonliteral
3578 @opindex Wformat-nonliteral
3579 @opindex Wno-format-nonliteral
3580 If @option{-Wformat} is specified, also warn if the format string is not a
3581 string literal and so cannot be checked, unless the format function
3582 takes its format arguments as a @code{va_list}.
3584 @item -Wformat-security
3585 @opindex Wformat-security
3586 @opindex Wno-format-security
3587 If @option{-Wformat} is specified, also warn about uses of format
3588 functions that represent possible security problems.  At present, this
3589 warns about calls to @code{printf} and @code{scanf} functions where the
3590 format string is not a string literal and there are no format arguments,
3591 as in @code{printf (foo);}.  This may be a security hole if the format
3592 string came from untrusted input and contains @samp{%n}.  (This is
3593 currently a subset of what @option{-Wformat-nonliteral} warns about, but
3594 in future warnings may be added to @option{-Wformat-security} that are not
3595 included in @option{-Wformat-nonliteral}.)
3597 @item -Wformat-signedness
3598 @opindex Wformat-signedness
3599 @opindex Wno-format-signedness
3600 If @option{-Wformat} is specified, also warn if the format string
3601 requires an unsigned argument and the argument is signed and vice versa.
3603 @item -Wformat-y2k
3604 @opindex Wformat-y2k
3605 @opindex Wno-format-y2k
3606 If @option{-Wformat} is specified, also warn about @code{strftime}
3607 formats that may yield only a two-digit year.
3608 @end table
3610 @item -Wnonnull
3611 @opindex Wnonnull
3612 @opindex Wno-nonnull
3613 Warn about passing a null pointer for arguments marked as
3614 requiring a non-null value by the @code{nonnull} function attribute.
3616 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
3617 can be disabled with the @option{-Wno-nonnull} option.
3619 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
3620 @opindex Winit-self
3621 @opindex Wno-init-self
3622 Warn about uninitialized variables that are initialized with themselves.
3623 Note this option can only be used with the @option{-Wuninitialized} option.
3625 For example, GCC warns about @code{i} being uninitialized in the
3626 following snippet only when @option{-Winit-self} has been specified:
3627 @smallexample
3628 @group
3629 int f()
3631   int i = i;
3632   return i;
3634 @end group
3635 @end smallexample
3637 This warning is enabled by @option{-Wall} in C++.
3639 @item -Wimplicit-int @r{(C and Objective-C only)}
3640 @opindex Wimplicit-int
3641 @opindex Wno-implicit-int
3642 Warn when a declaration does not specify a type.
3643 This warning is enabled by @option{-Wall}.
3645 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
3646 @opindex Wimplicit-function-declaration
3647 @opindex Wno-implicit-function-declaration
3648 Give a warning whenever a function is used before being declared. In
3649 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
3650 enabled by default and it is made into an error by
3651 @option{-pedantic-errors}. This warning is also enabled by
3652 @option{-Wall}.
3654 @item -Wimplicit @r{(C and Objective-C only)}
3655 @opindex Wimplicit
3656 @opindex Wno-implicit
3657 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
3658 This warning is enabled by @option{-Wall}.
3660 @item -Wignored-qualifiers @r{(C and C++ only)}
3661 @opindex Wignored-qualifiers
3662 @opindex Wno-ignored-qualifiers
3663 Warn if the return type of a function has a type qualifier
3664 such as @code{const}.  For ISO C such a type qualifier has no effect,
3665 since the value returned by a function is not an lvalue.
3666 For C++, the warning is only emitted for scalar types or @code{void}.
3667 ISO C prohibits qualified @code{void} return types on function
3668 definitions, so such return types always receive a warning
3669 even without this option.
3671 This warning is also enabled by @option{-Wextra}.
3673 @item -Wmain
3674 @opindex Wmain
3675 @opindex Wno-main
3676 Warn if the type of @samp{main} is suspicious.  @samp{main} should be
3677 a function with external linkage, returning int, taking either zero
3678 arguments, two, or three arguments of appropriate types.  This warning
3679 is enabled by default in C++ and is enabled by either @option{-Wall}
3680 or @option{-Wpedantic}.
3682 @item -Wmissing-braces
3683 @opindex Wmissing-braces
3684 @opindex Wno-missing-braces
3685 Warn if an aggregate or union initializer is not fully bracketed.  In
3686 the following example, the initializer for @samp{a} is not fully
3687 bracketed, but that for @samp{b} is fully bracketed.  This warning is
3688 enabled by @option{-Wall} in C.
3690 @smallexample
3691 int a[2][2] = @{ 0, 1, 2, 3 @};
3692 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
3693 @end smallexample
3695 This warning is enabled by @option{-Wall}.
3697 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
3698 @opindex Wmissing-include-dirs
3699 @opindex Wno-missing-include-dirs
3700 Warn if a user-supplied include directory does not exist.
3702 @item -Wparentheses
3703 @opindex Wparentheses
3704 @opindex Wno-parentheses
3705 Warn if parentheses are omitted in certain contexts, such
3706 as when there is an assignment in a context where a truth value
3707 is expected, or when operators are nested whose precedence people
3708 often get confused about.
3710 Also warn if a comparison like @samp{x<=y<=z} appears; this is
3711 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
3712 interpretation from that of ordinary mathematical notation.
3714 Also warn about constructions where there may be confusion to which
3715 @code{if} statement an @code{else} branch belongs.  Here is an example of
3716 such a case:
3718 @smallexample
3719 @group
3721   if (a)
3722     if (b)
3723       foo ();
3724   else
3725     bar ();
3727 @end group
3728 @end smallexample
3730 In C/C++, every @code{else} branch belongs to the innermost possible
3731 @code{if} statement, which in this example is @code{if (b)}.  This is
3732 often not what the programmer expected, as illustrated in the above
3733 example by indentation the programmer chose.  When there is the
3734 potential for this confusion, GCC issues a warning when this flag
3735 is specified.  To eliminate the warning, add explicit braces around
3736 the innermost @code{if} statement so there is no way the @code{else}
3737 can belong to the enclosing @code{if}.  The resulting code
3738 looks like this:
3740 @smallexample
3741 @group
3743   if (a)
3744     @{
3745       if (b)
3746         foo ();
3747       else
3748         bar ();
3749     @}
3751 @end group
3752 @end smallexample
3754 Also warn for dangerous uses of the GNU extension to
3755 @code{?:} with omitted middle operand. When the condition
3756 in the @code{?}: operator is a boolean expression, the omitted value is
3757 always 1.  Often programmers expect it to be a value computed
3758 inside the conditional expression instead.
3760 This warning is enabled by @option{-Wall}.
3762 @item -Wsequence-point
3763 @opindex Wsequence-point
3764 @opindex Wno-sequence-point
3765 Warn about code that may have undefined semantics because of violations
3766 of sequence point rules in the C and C++ standards.
3768 The C and C++ standards define the order in which expressions in a C/C++
3769 program are evaluated in terms of @dfn{sequence points}, which represent
3770 a partial ordering between the execution of parts of the program: those
3771 executed before the sequence point, and those executed after it.  These
3772 occur after the evaluation of a full expression (one which is not part
3773 of a larger expression), after the evaluation of the first operand of a
3774 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
3775 function is called (but after the evaluation of its arguments and the
3776 expression denoting the called function), and in certain other places.
3777 Other than as expressed by the sequence point rules, the order of
3778 evaluation of subexpressions of an expression is not specified.  All
3779 these rules describe only a partial order rather than a total order,
3780 since, for example, if two functions are called within one expression
3781 with no sequence point between them, the order in which the functions
3782 are called is not specified.  However, the standards committee have
3783 ruled that function calls do not overlap.
3785 It is not specified when between sequence points modifications to the
3786 values of objects take effect.  Programs whose behavior depends on this
3787 have undefined behavior; the C and C++ standards specify that ``Between
3788 the previous and next sequence point an object shall have its stored
3789 value modified at most once by the evaluation of an expression.
3790 Furthermore, the prior value shall be read only to determine the value
3791 to be stored.''.  If a program breaks these rules, the results on any
3792 particular implementation are entirely unpredictable.
3794 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
3795 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
3796 diagnosed by this option, and it may give an occasional false positive
3797 result, but in general it has been found fairly effective at detecting
3798 this sort of problem in programs.
3800 The standard is worded confusingly, therefore there is some debate
3801 over the precise meaning of the sequence point rules in subtle cases.
3802 Links to discussions of the problem, including proposed formal
3803 definitions, may be found on the GCC readings page, at
3804 @uref{http://gcc.gnu.org/@/readings.html}.
3806 This warning is enabled by @option{-Wall} for C and C++.
3808 @item -Wno-return-local-addr
3809 @opindex Wno-return-local-addr
3810 @opindex Wreturn-local-addr
3811 Do not warn about returning a pointer (or in C++, a reference) to a
3812 variable that goes out of scope after the function returns.
3814 @item -Wreturn-type
3815 @opindex Wreturn-type
3816 @opindex Wno-return-type
3817 Warn whenever a function is defined with a return type that defaults
3818 to @code{int}.  Also warn about any @code{return} statement with no
3819 return value in a function whose return type is not @code{void}
3820 (falling off the end of the function body is considered returning
3821 without a value), and about a @code{return} statement with an
3822 expression in a function whose return type is @code{void}.
3824 For C++, a function without return type always produces a diagnostic
3825 message, even when @option{-Wno-return-type} is specified.  The only
3826 exceptions are @samp{main} and functions defined in system headers.
3828 This warning is enabled by @option{-Wall}.
3830 @item -Wswitch
3831 @opindex Wswitch
3832 @opindex Wno-switch
3833 Warn whenever a @code{switch} statement has an index of enumerated type
3834 and lacks a @code{case} for one or more of the named codes of that
3835 enumeration.  (The presence of a @code{default} label prevents this
3836 warning.)  @code{case} labels outside the enumeration range also
3837 provoke warnings when this option is used (even if there is a
3838 @code{default} label).
3839 This warning is enabled by @option{-Wall}.
3841 @item -Wswitch-default
3842 @opindex Wswitch-default
3843 @opindex Wno-switch-default
3844 Warn whenever a @code{switch} statement does not have a @code{default}
3845 case.
3847 @item -Wswitch-enum
3848 @opindex Wswitch-enum
3849 @opindex Wno-switch-enum
3850 Warn whenever a @code{switch} statement has an index of enumerated type
3851 and lacks a @code{case} for one or more of the named codes of that
3852 enumeration.  @code{case} labels outside the enumeration range also
3853 provoke warnings when this option is used.  The only difference
3854 between @option{-Wswitch} and this option is that this option gives a
3855 warning about an omitted enumeration code even if there is a
3856 @code{default} label.
3858 @item -Wsync-nand @r{(C and C++ only)}
3859 @opindex Wsync-nand
3860 @opindex Wno-sync-nand
3861 Warn when @code{__sync_fetch_and_nand} and @code{__sync_nand_and_fetch}
3862 built-in functions are used.  These functions changed semantics in GCC 4.4.
3864 @item -Wtrigraphs
3865 @opindex Wtrigraphs
3866 @opindex Wno-trigraphs
3867 Warn if any trigraphs are encountered that might change the meaning of
3868 the program (trigraphs within comments are not warned about).
3869 This warning is enabled by @option{-Wall}.
3871 @item -Wunused-but-set-parameter
3872 @opindex Wunused-but-set-parameter
3873 @opindex Wno-unused-but-set-parameter
3874 Warn whenever a function parameter is assigned to, but otherwise unused
3875 (aside from its declaration).
3877 To suppress this warning use the @samp{unused} attribute
3878 (@pxref{Variable Attributes}).
3880 This warning is also enabled by @option{-Wunused} together with
3881 @option{-Wextra}.
3883 @item -Wunused-but-set-variable
3884 @opindex Wunused-but-set-variable
3885 @opindex Wno-unused-but-set-variable
3886 Warn whenever a local variable is assigned to, but otherwise unused
3887 (aside from its declaration).
3888 This warning is enabled by @option{-Wall}.
3890 To suppress this warning use the @samp{unused} attribute
3891 (@pxref{Variable Attributes}).
3893 This warning is also enabled by @option{-Wunused}, which is enabled
3894 by @option{-Wall}.
3896 @item -Wunused-function
3897 @opindex Wunused-function
3898 @opindex Wno-unused-function
3899 Warn whenever a static function is declared but not defined or a
3900 non-inline static function is unused.
3901 This warning is enabled by @option{-Wall}.
3903 @item -Wunused-label
3904 @opindex Wunused-label
3905 @opindex Wno-unused-label
3906 Warn whenever a label is declared but not used.
3907 This warning is enabled by @option{-Wall}.
3909 To suppress this warning use the @samp{unused} attribute
3910 (@pxref{Variable Attributes}).
3912 @item -Wunused-local-typedefs @r{(C, Objective-C, C++ and Objective-C++ only)}
3913 @opindex Wunused-local-typedefs
3914 Warn when a typedef locally defined in a function is not used.
3915 This warning is enabled by @option{-Wall}.
3917 @item -Wunused-parameter
3918 @opindex Wunused-parameter
3919 @opindex Wno-unused-parameter
3920 Warn whenever a function parameter is unused aside from its declaration.
3922 To suppress this warning use the @samp{unused} attribute
3923 (@pxref{Variable Attributes}).
3925 @item -Wno-unused-result
3926 @opindex Wunused-result
3927 @opindex Wno-unused-result
3928 Do not warn if a caller of a function marked with attribute
3929 @code{warn_unused_result} (@pxref{Function Attributes}) does not use
3930 its return value. The default is @option{-Wunused-result}.
3932 @item -Wunused-variable
3933 @opindex Wunused-variable
3934 @opindex Wno-unused-variable
3935 Warn whenever a local variable or non-constant static variable is unused
3936 aside from its declaration.
3937 This warning is enabled by @option{-Wall}.
3939 To suppress this warning use the @samp{unused} attribute
3940 (@pxref{Variable Attributes}).
3942 @item -Wunused-value
3943 @opindex Wunused-value
3944 @opindex Wno-unused-value
3945 Warn whenever a statement computes a result that is explicitly not
3946 used. To suppress this warning cast the unused expression to
3947 @samp{void}. This includes an expression-statement or the left-hand
3948 side of a comma expression that contains no side effects. For example,
3949 an expression such as @samp{x[i,j]} causes a warning, while
3950 @samp{x[(void)i,j]} does not.
3952 This warning is enabled by @option{-Wall}.
3954 @item -Wunused
3955 @opindex Wunused
3956 @opindex Wno-unused
3957 All the above @option{-Wunused} options combined.
3959 In order to get a warning about an unused function parameter, you must
3960 either specify @option{-Wextra -Wunused} (note that @option{-Wall} implies
3961 @option{-Wunused}), or separately specify @option{-Wunused-parameter}.
3963 @item -Wuninitialized
3964 @opindex Wuninitialized
3965 @opindex Wno-uninitialized
3966 Warn if an automatic variable is used without first being initialized
3967 or if a variable may be clobbered by a @code{setjmp} call. In C++,
3968 warn if a non-static reference or non-static @samp{const} member
3969 appears in a class without constructors.
3971 If you want to warn about code that uses the uninitialized value of the
3972 variable in its own initializer, use the @option{-Winit-self} option.
3974 These warnings occur for individual uninitialized or clobbered
3975 elements of structure, union or array variables as well as for
3976 variables that are uninitialized or clobbered as a whole.  They do
3977 not occur for variables or elements declared @code{volatile}.  Because
3978 these warnings depend on optimization, the exact variables or elements
3979 for which there are warnings depends on the precise optimization
3980 options and version of GCC used.
3982 Note that there may be no warning about a variable that is used only
3983 to compute a value that itself is never used, because such
3984 computations may be deleted by data flow analysis before the warnings
3985 are printed.
3987 @item -Wmaybe-uninitialized
3988 @opindex Wmaybe-uninitialized
3989 @opindex Wno-maybe-uninitialized
3990 For an automatic variable, if there exists a path from the function
3991 entry to a use of the variable that is initialized, but there exist
3992 some other paths for which the variable is not initialized, the compiler
3993 emits a warning if it cannot prove the uninitialized paths are not
3994 executed at run time. These warnings are made optional because GCC is
3995 not smart enough to see all the reasons why the code might be correct
3996 in spite of appearing to have an error.  Here is one example of how
3997 this can happen:
3999 @smallexample
4000 @group
4002   int x;
4003   switch (y)
4004     @{
4005     case 1: x = 1;
4006       break;
4007     case 2: x = 4;
4008       break;
4009     case 3: x = 5;
4010     @}
4011   foo (x);
4013 @end group
4014 @end smallexample
4016 @noindent
4017 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
4018 always initialized, but GCC doesn't know this. To suppress the
4019 warning, you need to provide a default case with assert(0) or
4020 similar code.
4022 @cindex @code{longjmp} warnings
4023 This option also warns when a non-volatile automatic variable might be
4024 changed by a call to @code{longjmp}.  These warnings as well are possible
4025 only in optimizing compilation.
4027 The compiler sees only the calls to @code{setjmp}.  It cannot know
4028 where @code{longjmp} will be called; in fact, a signal handler could
4029 call it at any point in the code.  As a result, you may get a warning
4030 even when there is in fact no problem because @code{longjmp} cannot
4031 in fact be called at the place that would cause a problem.
4033 Some spurious warnings can be avoided if you declare all the functions
4034 you use that never return as @code{noreturn}.  @xref{Function
4035 Attributes}.
4037 This warning is enabled by @option{-Wall} or @option{-Wextra}.
4039 @item -Wunknown-pragmas
4040 @opindex Wunknown-pragmas
4041 @opindex Wno-unknown-pragmas
4042 @cindex warning for unknown pragmas
4043 @cindex unknown pragmas, warning
4044 @cindex pragmas, warning of unknown
4045 Warn when a @code{#pragma} directive is encountered that is not understood by 
4046 GCC@.  If this command-line option is used, warnings are even issued
4047 for unknown pragmas in system header files.  This is not the case if
4048 the warnings are only enabled by the @option{-Wall} command-line option.
4050 @item -Wno-pragmas
4051 @opindex Wno-pragmas
4052 @opindex Wpragmas
4053 Do not warn about misuses of pragmas, such as incorrect parameters,
4054 invalid syntax, or conflicts between pragmas.  See also
4055 @option{-Wunknown-pragmas}.
4057 @item -Wstrict-aliasing
4058 @opindex Wstrict-aliasing
4059 @opindex Wno-strict-aliasing
4060 This option is only active when @option{-fstrict-aliasing} is active.
4061 It warns about code that might break the strict aliasing rules that the
4062 compiler is using for optimization.  The warning does not catch all
4063 cases, but does attempt to catch the more common pitfalls.  It is
4064 included in @option{-Wall}.
4065 It is equivalent to @option{-Wstrict-aliasing=3}
4067 @item -Wstrict-aliasing=n
4068 @opindex Wstrict-aliasing=n
4069 This option is only active when @option{-fstrict-aliasing} is active.
4070 It warns about code that might break the strict aliasing rules that the
4071 compiler is using for optimization.
4072 Higher levels correspond to higher accuracy (fewer false positives).
4073 Higher levels also correspond to more effort, similar to the way @option{-O} 
4074 works.
4075 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=3}.
4077 Level 1: Most aggressive, quick, least accurate.
4078 Possibly useful when higher levels
4079 do not warn but @option{-fstrict-aliasing} still breaks the code, as it has very few
4080 false negatives.  However, it has many false positives.
4081 Warns for all pointer conversions between possibly incompatible types,
4082 even if never dereferenced.  Runs in the front end only.
4084 Level 2: Aggressive, quick, not too precise.
4085 May still have many false positives (not as many as level 1 though),
4086 and few false negatives (but possibly more than level 1).
4087 Unlike level 1, it only warns when an address is taken.  Warns about
4088 incomplete types.  Runs in the front end only.
4090 Level 3 (default for @option{-Wstrict-aliasing}):
4091 Should have very few false positives and few false
4092 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
4093 Takes care of the common pun+dereference pattern in the front end:
4094 @code{*(int*)&some_float}.
4095 If optimization is enabled, it also runs in the back end, where it deals
4096 with multiple statement cases using flow-sensitive points-to information.
4097 Only warns when the converted pointer is dereferenced.
4098 Does not warn about incomplete types.
4100 @item -Wstrict-overflow
4101 @itemx -Wstrict-overflow=@var{n}
4102 @opindex Wstrict-overflow
4103 @opindex Wno-strict-overflow
4104 This option is only active when @option{-fstrict-overflow} is active.
4105 It warns about cases where the compiler optimizes based on the
4106 assumption that signed overflow does not occur.  Note that it does not
4107 warn about all cases where the code might overflow: it only warns
4108 about cases where the compiler implements some optimization.  Thus
4109 this warning depends on the optimization level.
4111 An optimization that assumes that signed overflow does not occur is
4112 perfectly safe if the values of the variables involved are such that
4113 overflow never does, in fact, occur.  Therefore this warning can
4114 easily give a false positive: a warning about code that is not
4115 actually a problem.  To help focus on important issues, several
4116 warning levels are defined.  No warnings are issued for the use of
4117 undefined signed overflow when estimating how many iterations a loop
4118 requires, in particular when determining whether a loop will be
4119 executed at all.
4121 @table @gcctabopt
4122 @item -Wstrict-overflow=1
4123 Warn about cases that are both questionable and easy to avoid.  For
4124 example,  with @option{-fstrict-overflow}, the compiler simplifies
4125 @code{x + 1 > x} to @code{1}.  This level of
4126 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
4127 are not, and must be explicitly requested.
4129 @item -Wstrict-overflow=2
4130 Also warn about other cases where a comparison is simplified to a
4131 constant.  For example: @code{abs (x) >= 0}.  This can only be
4132 simplified when @option{-fstrict-overflow} is in effect, because
4133 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
4134 zero.  @option{-Wstrict-overflow} (with no level) is the same as
4135 @option{-Wstrict-overflow=2}.
4137 @item -Wstrict-overflow=3
4138 Also warn about other cases where a comparison is simplified.  For
4139 example: @code{x + 1 > 1} is simplified to @code{x > 0}.
4141 @item -Wstrict-overflow=4
4142 Also warn about other simplifications not covered by the above cases.
4143 For example: @code{(x * 10) / 5} is simplified to @code{x * 2}.
4145 @item -Wstrict-overflow=5
4146 Also warn about cases where the compiler reduces the magnitude of a
4147 constant involved in a comparison.  For example: @code{x + 2 > y} is
4148 simplified to @code{x + 1 >= y}.  This is reported only at the
4149 highest warning level because this simplification applies to many
4150 comparisons, so this warning level gives a very large number of
4151 false positives.
4152 @end table
4154 @item -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{]}
4155 @opindex Wsuggest-attribute=
4156 @opindex Wno-suggest-attribute=
4157 Warn for cases where adding an attribute may be beneficial. The
4158 attributes currently supported are listed below.
4160 @table @gcctabopt
4161 @item -Wsuggest-attribute=pure
4162 @itemx -Wsuggest-attribute=const
4163 @itemx -Wsuggest-attribute=noreturn
4164 @opindex Wsuggest-attribute=pure
4165 @opindex Wno-suggest-attribute=pure
4166 @opindex Wsuggest-attribute=const
4167 @opindex Wno-suggest-attribute=const
4168 @opindex Wsuggest-attribute=noreturn
4169 @opindex Wno-suggest-attribute=noreturn
4171 Warn about functions that might be candidates for attributes
4172 @code{pure}, @code{const} or @code{noreturn}.  The compiler only warns for
4173 functions visible in other compilation units or (in the case of @code{pure} and
4174 @code{const}) if it cannot prove that the function returns normally. A function
4175 returns normally if it doesn't contain an infinite loop or return abnormally
4176 by throwing, calling @code{abort()} or trapping.  This analysis requires option
4177 @option{-fipa-pure-const}, which is enabled by default at @option{-O} and
4178 higher.  Higher optimization levels improve the accuracy of the analysis.
4180 @item -Wsuggest-attribute=format
4181 @itemx -Wmissing-format-attribute
4182 @opindex Wsuggest-attribute=format
4183 @opindex Wmissing-format-attribute
4184 @opindex Wno-suggest-attribute=format
4185 @opindex Wno-missing-format-attribute
4186 @opindex Wformat
4187 @opindex Wno-format
4189 Warn about function pointers that might be candidates for @code{format}
4190 attributes.  Note these are only possible candidates, not absolute ones.
4191 GCC guesses that function pointers with @code{format} attributes that
4192 are used in assignment, initialization, parameter passing or return
4193 statements should have a corresponding @code{format} attribute in the
4194 resulting type.  I.e.@: the left-hand side of the assignment or
4195 initialization, the type of the parameter variable, or the return type
4196 of the containing function respectively should also have a @code{format}
4197 attribute to avoid the warning.
4199 GCC also warns about function definitions that might be
4200 candidates for @code{format} attributes.  Again, these are only
4201 possible candidates.  GCC guesses that @code{format} attributes
4202 might be appropriate for any function that calls a function like
4203 @code{vprintf} or @code{vscanf}, but this might not always be the
4204 case, and some functions for which @code{format} attributes are
4205 appropriate may not be detected.
4206 @end table
4208 @item -Warray-bounds
4209 @opindex Wno-array-bounds
4210 @opindex Warray-bounds
4211 This option is only active when @option{-ftree-vrp} is active
4212 (default for @option{-O2} and above). It warns about subscripts to arrays
4213 that are always out of bounds. This warning is enabled by @option{-Wall}.
4215 @item -Wno-discarded-qualifiers
4216 @opindex Wno-discarded-qualifiers
4217 @opindex Wdiscarded-qualifiers
4218 Do not warn if type qualifiers on pointers are being discarded.
4219 Typically, the compiler will warn if a @code{const char *} variable is
4220 passed to a function that takes @code{char *} parameter.  This option
4221 can be used to suppress such a warning.  This warning is only supported
4222 for C.
4224 @item -Wno-div-by-zero
4225 @opindex Wno-div-by-zero
4226 @opindex Wdiv-by-zero
4227 Do not warn about compile-time integer division by zero.  Floating-point
4228 division by zero is not warned about, as it can be a legitimate way of
4229 obtaining infinities and NaNs.
4231 @item -Wsystem-headers
4232 @opindex Wsystem-headers
4233 @opindex Wno-system-headers
4234 @cindex warnings from system headers
4235 @cindex system headers, warnings from
4236 Print warning messages for constructs found in system header files.
4237 Warnings from system headers are normally suppressed, on the assumption
4238 that they usually do not indicate real problems and would only make the
4239 compiler output harder to read.  Using this command-line option tells
4240 GCC to emit warnings from system headers as if they occurred in user
4241 code.  However, note that using @option{-Wall} in conjunction with this
4242 option does @emph{not} warn about unknown pragmas in system
4243 headers---for that, @option{-Wunknown-pragmas} must also be used.
4245 @item -Wtrampolines
4246 @opindex Wtrampolines
4247 @opindex Wno-trampolines
4248  Warn about trampolines generated for pointers to nested functions.
4250  A trampoline is a small piece of data or code that is created at run
4251  time on the stack when the address of a nested function is taken, and
4252  is used to call the nested function indirectly.  For some targets, it
4253  is made up of data only and thus requires no special treatment.  But,
4254  for most targets, it is made up of code and thus requires the stack
4255  to be made executable in order for the program to work properly.
4257 @item -Wfloat-equal
4258 @opindex Wfloat-equal
4259 @opindex Wno-float-equal
4260 Warn if floating-point values are used in equality comparisons.
4262 The idea behind this is that sometimes it is convenient (for the
4263 programmer) to consider floating-point values as approximations to
4264 infinitely precise real numbers.  If you are doing this, then you need
4265 to compute (by analyzing the code, or in some other way) the maximum or
4266 likely maximum error that the computation introduces, and allow for it
4267 when performing comparisons (and when producing output, but that's a
4268 different problem).  In particular, instead of testing for equality, you
4269 should check to see whether the two values have ranges that overlap; and
4270 this is done with the relational operators, so equality comparisons are
4271 probably mistaken.
4273 @item -Wtraditional @r{(C and Objective-C only)}
4274 @opindex Wtraditional
4275 @opindex Wno-traditional
4276 Warn about certain constructs that behave differently in traditional and
4277 ISO C@.  Also warn about ISO C constructs that have no traditional C
4278 equivalent, and/or problematic constructs that should be avoided.
4280 @itemize @bullet
4281 @item
4282 Macro parameters that appear within string literals in the macro body.
4283 In traditional C macro replacement takes place within string literals,
4284 but in ISO C it does not.
4286 @item
4287 In traditional C, some preprocessor directives did not exist.
4288 Traditional preprocessors only considered a line to be a directive
4289 if the @samp{#} appeared in column 1 on the line.  Therefore
4290 @option{-Wtraditional} warns about directives that traditional C
4291 understands but ignores because the @samp{#} does not appear as the
4292 first character on the line.  It also suggests you hide directives like
4293 @samp{#pragma} not understood by traditional C by indenting them.  Some
4294 traditional implementations do not recognize @samp{#elif}, so this option
4295 suggests avoiding it altogether.
4297 @item
4298 A function-like macro that appears without arguments.
4300 @item
4301 The unary plus operator.
4303 @item
4304 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating-point
4305 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
4306 constants.)  Note, these suffixes appear in macros defined in the system
4307 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
4308 Use of these macros in user code might normally lead to spurious
4309 warnings, however GCC's integrated preprocessor has enough context to
4310 avoid warning in these cases.
4312 @item
4313 A function declared external in one block and then used after the end of
4314 the block.
4316 @item
4317 A @code{switch} statement has an operand of type @code{long}.
4319 @item
4320 A non-@code{static} function declaration follows a @code{static} one.
4321 This construct is not accepted by some traditional C compilers.
4323 @item
4324 The ISO type of an integer constant has a different width or
4325 signedness from its traditional type.  This warning is only issued if
4326 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
4327 typically represent bit patterns, are not warned about.
4329 @item
4330 Usage of ISO string concatenation is detected.
4332 @item
4333 Initialization of automatic aggregates.
4335 @item
4336 Identifier conflicts with labels.  Traditional C lacks a separate
4337 namespace for labels.
4339 @item
4340 Initialization of unions.  If the initializer is zero, the warning is
4341 omitted.  This is done under the assumption that the zero initializer in
4342 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
4343 initializer warnings and relies on default initialization to zero in the
4344 traditional C case.
4346 @item
4347 Conversions by prototypes between fixed/floating-point values and vice
4348 versa.  The absence of these prototypes when compiling with traditional
4349 C causes serious problems.  This is a subset of the possible
4350 conversion warnings; for the full set use @option{-Wtraditional-conversion}.
4352 @item
4353 Use of ISO C style function definitions.  This warning intentionally is
4354 @emph{not} issued for prototype declarations or variadic functions
4355 because these ISO C features appear in your code when using
4356 libiberty's traditional C compatibility macros, @code{PARAMS} and
4357 @code{VPARAMS}.  This warning is also bypassed for nested functions
4358 because that feature is already a GCC extension and thus not relevant to
4359 traditional C compatibility.
4360 @end itemize
4362 @item -Wtraditional-conversion @r{(C and Objective-C only)}
4363 @opindex Wtraditional-conversion
4364 @opindex Wno-traditional-conversion
4365 Warn if a prototype causes a type conversion that is different from what
4366 would happen to the same argument in the absence of a prototype.  This
4367 includes conversions of fixed point to floating and vice versa, and
4368 conversions changing the width or signedness of a fixed-point argument
4369 except when the same as the default promotion.
4371 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
4372 @opindex Wdeclaration-after-statement
4373 @opindex Wno-declaration-after-statement
4374 Warn when a declaration is found after a statement in a block.  This
4375 construct, known from C++, was introduced with ISO C99 and is by default
4376 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
4377 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
4379 @item -Wundef
4380 @opindex Wundef
4381 @opindex Wno-undef
4382 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
4384 @item -Wno-endif-labels
4385 @opindex Wno-endif-labels
4386 @opindex Wendif-labels
4387 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
4389 @item -Wshadow
4390 @opindex Wshadow
4391 @opindex Wno-shadow
4392 Warn whenever a local variable or type declaration shadows another
4393 variable, parameter, type, class member (in C++), or instance variable
4394 (in Objective-C) or whenever a built-in function is shadowed. Note
4395 that in C++, the compiler warns if a local variable shadows an
4396 explicit typedef, but not if it shadows a struct/class/enum.
4398 @item -Wno-shadow-ivar @r{(Objective-C only)}
4399 @opindex Wno-shadow-ivar
4400 @opindex Wshadow-ivar
4401 Do not warn whenever a local variable shadows an instance variable in an
4402 Objective-C method.
4404 @item -Wlarger-than=@var{len}
4405 @opindex Wlarger-than=@var{len}
4406 @opindex Wlarger-than-@var{len}
4407 Warn whenever an object of larger than @var{len} bytes is defined.
4409 @item -Wframe-larger-than=@var{len}
4410 @opindex Wframe-larger-than
4411 Warn if the size of a function frame is larger than @var{len} bytes.
4412 The computation done to determine the stack frame size is approximate
4413 and not conservative.
4414 The actual requirements may be somewhat greater than @var{len}
4415 even if you do not get a warning.  In addition, any space allocated
4416 via @code{alloca}, variable-length arrays, or related constructs
4417 is not included by the compiler when determining
4418 whether or not to issue a warning.
4420 @item -Wno-free-nonheap-object
4421 @opindex Wno-free-nonheap-object
4422 @opindex Wfree-nonheap-object
4423 Do not warn when attempting to free an object that was not allocated
4424 on the heap.
4426 @item -Wstack-usage=@var{len}
4427 @opindex Wstack-usage
4428 Warn if the stack usage of a function might be larger than @var{len} bytes.
4429 The computation done to determine the stack usage is conservative.
4430 Any space allocated via @code{alloca}, variable-length arrays, or related
4431 constructs is included by the compiler when determining whether or not to
4432 issue a warning.
4434 The message is in keeping with the output of @option{-fstack-usage}.
4436 @itemize
4437 @item
4438 If the stack usage is fully static but exceeds the specified amount, it's:
4440 @smallexample
4441   warning: stack usage is 1120 bytes
4442 @end smallexample
4443 @item
4444 If the stack usage is (partly) dynamic but bounded, it's:
4446 @smallexample
4447   warning: stack usage might be 1648 bytes
4448 @end smallexample
4449 @item
4450 If the stack usage is (partly) dynamic and not bounded, it's:
4452 @smallexample
4453   warning: stack usage might be unbounded
4454 @end smallexample
4455 @end itemize
4457 @item -Wunsafe-loop-optimizations
4458 @opindex Wunsafe-loop-optimizations
4459 @opindex Wno-unsafe-loop-optimizations
4460 Warn if the loop cannot be optimized because the compiler cannot
4461 assume anything on the bounds of the loop indices.  With
4462 @option{-funsafe-loop-optimizations} warn if the compiler makes
4463 such assumptions.
4465 @item -Wno-pedantic-ms-format @r{(MinGW targets only)}
4466 @opindex Wno-pedantic-ms-format
4467 @opindex Wpedantic-ms-format
4468 When used in combination with @option{-Wformat}
4469 and @option{-pedantic} without GNU extensions, this option
4470 disables the warnings about non-ISO @code{printf} / @code{scanf} format
4471 width specifiers @code{I32}, @code{I64}, and @code{I} used on Windows targets,
4472 which depend on the MS runtime.
4474 @item -Wpointer-arith
4475 @opindex Wpointer-arith
4476 @opindex Wno-pointer-arith
4477 Warn about anything that depends on the ``size of'' a function type or
4478 of @code{void}.  GNU C assigns these types a size of 1, for
4479 convenience in calculations with @code{void *} pointers and pointers
4480 to functions.  In C++, warn also when an arithmetic operation involves
4481 @code{NULL}.  This warning is also enabled by @option{-Wpedantic}.
4483 @item -Wtype-limits
4484 @opindex Wtype-limits
4485 @opindex Wno-type-limits
4486 Warn if a comparison is always true or always false due to the limited
4487 range of the data type, but do not warn for constant expressions.  For
4488 example, warn if an unsigned variable is compared against zero with
4489 @samp{<} or @samp{>=}.  This warning is also enabled by
4490 @option{-Wextra}.
4492 @item -Wbad-function-cast @r{(C and Objective-C only)}
4493 @opindex Wbad-function-cast
4494 @opindex Wno-bad-function-cast
4495 Warn whenever a function call is cast to a non-matching type.
4496 For example, warn if @code{int malloc()} is cast to @code{anything *}.
4498 @item -Wc++-compat @r{(C and Objective-C only)}
4499 Warn about ISO C constructs that are outside of the common subset of
4500 ISO C and ISO C++, e.g.@: request for implicit conversion from
4501 @code{void *} to a pointer to non-@code{void} type.
4503 @item -Wc++11-compat @r{(C++ and Objective-C++ only)}
4504 Warn about C++ constructs whose meaning differs between ISO C++ 1998
4505 and ISO C++ 2011, e.g., identifiers in ISO C++ 1998 that are keywords
4506 in ISO C++ 2011.  This warning turns on @option{-Wnarrowing} and is
4507 enabled by @option{-Wall}.
4509 @item -Wcast-qual
4510 @opindex Wcast-qual
4511 @opindex Wno-cast-qual
4512 Warn whenever a pointer is cast so as to remove a type qualifier from
4513 the target type.  For example, warn if a @code{const char *} is cast
4514 to an ordinary @code{char *}.
4516 Also warn when making a cast that introduces a type qualifier in an
4517 unsafe way.  For example, casting @code{char **} to @code{const char **}
4518 is unsafe, as in this example:
4520 @smallexample
4521   /* p is char ** value.  */
4522   const char **q = (const char **) p;
4523   /* Assignment of readonly string to const char * is OK.  */
4524   *q = "string";
4525   /* Now char** pointer points to read-only memory.  */
4526   **p = 'b';
4527 @end smallexample
4529 @item -Wcast-align
4530 @opindex Wcast-align
4531 @opindex Wno-cast-align
4532 Warn whenever a pointer is cast such that the required alignment of the
4533 target is increased.  For example, warn if a @code{char *} is cast to
4534 an @code{int *} on machines where integers can only be accessed at
4535 two- or four-byte boundaries.
4537 @item -Wwrite-strings
4538 @opindex Wwrite-strings
4539 @opindex Wno-write-strings
4540 When compiling C, give string constants the type @code{const
4541 char[@var{length}]} so that copying the address of one into a
4542 non-@code{const} @code{char *} pointer produces a warning.  These
4543 warnings help you find at compile time code that can try to write
4544 into a string constant, but only if you have been very careful about
4545 using @code{const} in declarations and prototypes.  Otherwise, it is
4546 just a nuisance. This is why we did not make @option{-Wall} request
4547 these warnings.
4549 When compiling C++, warn about the deprecated conversion from string
4550 literals to @code{char *}.  This warning is enabled by default for C++
4551 programs.
4553 @item -Wclobbered
4554 @opindex Wclobbered
4555 @opindex Wno-clobbered
4556 Warn for variables that might be changed by @samp{longjmp} or
4557 @samp{vfork}.  This warning is also enabled by @option{-Wextra}.
4559 @item -Wconditionally-supported @r{(C++ and Objective-C++ only)}
4560 @opindex Wconditionally-supported
4561 @opindex Wno-conditionally-supported
4562 Warn for conditionally-supported (C++11 [intro.defs]) constructs.
4564 @item -Wconversion
4565 @opindex Wconversion
4566 @opindex Wno-conversion
4567 Warn for implicit conversions that may alter a value. This includes
4568 conversions between real and integer, like @code{abs (x)} when
4569 @code{x} is @code{double}; conversions between signed and unsigned,
4570 like @code{unsigned ui = -1}; and conversions to smaller types, like
4571 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
4572 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
4573 changed by the conversion like in @code{abs (2.0)}.  Warnings about
4574 conversions between signed and unsigned integers can be disabled by
4575 using @option{-Wno-sign-conversion}.
4577 For C++, also warn for confusing overload resolution for user-defined
4578 conversions; and conversions that never use a type conversion
4579 operator: conversions to @code{void}, the same type, a base class or a
4580 reference to them. Warnings about conversions between signed and
4581 unsigned integers are disabled by default in C++ unless
4582 @option{-Wsign-conversion} is explicitly enabled.
4584 @item -Wno-conversion-null @r{(C++ and Objective-C++ only)}
4585 @opindex Wconversion-null
4586 @opindex Wno-conversion-null
4587 Do not warn for conversions between @code{NULL} and non-pointer
4588 types. @option{-Wconversion-null} is enabled by default.
4590 @item -Wzero-as-null-pointer-constant @r{(C++ and Objective-C++ only)}
4591 @opindex Wzero-as-null-pointer-constant
4592 @opindex Wno-zero-as-null-pointer-constant
4593 Warn when a literal '0' is used as null pointer constant.  This can
4594 be useful to facilitate the conversion to @code{nullptr} in C++11.
4596 @item -Wdate-time
4597 @opindex Wdate-time
4598 @opindex Wno-date-time
4599 Warn when macros @code{__TIME__}, @code{__DATE__} or @code{__TIMESTAMP__}
4600 are encountered as they might prevent bit-wise-identical reproducible
4601 compilations.
4603 @item -Wdelete-incomplete @r{(C++ and Objective-C++ only)}
4604 @opindex Wdelete-incomplete
4605 @opindex Wno-delete-incomplete
4606 Warn when deleting a pointer to incomplete type, which may cause
4607 undefined behavior at runtime.  This warning is enabled by default.
4609 @item -Wuseless-cast @r{(C++ and Objective-C++ only)}
4610 @opindex Wuseless-cast
4611 @opindex Wno-useless-cast
4612 Warn when an expression is casted to its own type.
4614 @item -Wempty-body
4615 @opindex Wempty-body
4616 @opindex Wno-empty-body
4617 Warn if an empty body occurs in an @samp{if}, @samp{else} or @samp{do
4618 while} statement.  This warning is also enabled by @option{-Wextra}.
4620 @item -Wenum-compare
4621 @opindex Wenum-compare
4622 @opindex Wno-enum-compare
4623 Warn about a comparison between values of different enumerated types.
4624 In C++ enumeral mismatches in conditional expressions are also
4625 diagnosed and the warning is enabled by default.  In C this warning is 
4626 enabled by @option{-Wall}.
4628 @item -Wjump-misses-init @r{(C, Objective-C only)}
4629 @opindex Wjump-misses-init
4630 @opindex Wno-jump-misses-init
4631 Warn if a @code{goto} statement or a @code{switch} statement jumps
4632 forward across the initialization of a variable, or jumps backward to a
4633 label after the variable has been initialized.  This only warns about
4634 variables that are initialized when they are declared.  This warning is
4635 only supported for C and Objective-C; in C++ this sort of branch is an
4636 error in any case.
4638 @option{-Wjump-misses-init} is included in @option{-Wc++-compat}.  It
4639 can be disabled with the @option{-Wno-jump-misses-init} option.
4641 @item -Wsign-compare
4642 @opindex Wsign-compare
4643 @opindex Wno-sign-compare
4644 @cindex warning for comparison of signed and unsigned values
4645 @cindex comparison of signed and unsigned values, warning
4646 @cindex signed and unsigned values, comparison warning
4647 Warn when a comparison between signed and unsigned values could produce
4648 an incorrect result when the signed value is converted to unsigned.
4649 This warning is also enabled by @option{-Wextra}; to get the other warnings
4650 of @option{-Wextra} without this warning, use @option{-Wextra -Wno-sign-compare}.
4652 @item -Wsign-conversion
4653 @opindex Wsign-conversion
4654 @opindex Wno-sign-conversion
4655 Warn for implicit conversions that may change the sign of an integer
4656 value, like assigning a signed integer expression to an unsigned
4657 integer variable. An explicit cast silences the warning. In C, this
4658 option is enabled also by @option{-Wconversion}.
4660 @item -Wfloat-conversion
4661 @opindex Wfloat-conversion
4662 @opindex Wno-float-conversion
4663 Warn for implicit conversions that reduce the precision of a real value.
4664 This includes conversions from real to integer, and from higher precision
4665 real to lower precision real values.  This option is also enabled by
4666 @option{-Wconversion}.
4668 @item -Wsizeof-pointer-memaccess
4669 @opindex Wsizeof-pointer-memaccess
4670 @opindex Wno-sizeof-pointer-memaccess
4671 Warn for suspicious length parameters to certain string and memory built-in
4672 functions if the argument uses @code{sizeof}.  This warning warns e.g.@:
4673 about @code{memset (ptr, 0, sizeof (ptr));} if @code{ptr} is not an array,
4674 but a pointer, and suggests a possible fix, or about
4675 @code{memcpy (&foo, ptr, sizeof (&foo));}.  This warning is enabled by
4676 @option{-Wall}.
4678 @item -Waddress
4679 @opindex Waddress
4680 @opindex Wno-address
4681 Warn about suspicious uses of memory addresses. These include using
4682 the address of a function in a conditional expression, such as
4683 @code{void func(void); if (func)}, and comparisons against the memory
4684 address of a string literal, such as @code{if (x == "abc")}.  Such
4685 uses typically indicate a programmer error: the address of a function
4686 always evaluates to true, so their use in a conditional usually
4687 indicate that the programmer forgot the parentheses in a function
4688 call; and comparisons against string literals result in unspecified
4689 behavior and are not portable in C, so they usually indicate that the
4690 programmer intended to use @code{strcmp}.  This warning is enabled by
4691 @option{-Wall}.
4693 @item -Wlogical-op
4694 @opindex Wlogical-op
4695 @opindex Wno-logical-op
4696 Warn about suspicious uses of logical operators in expressions.
4697 This includes using logical operators in contexts where a
4698 bit-wise operator is likely to be expected.
4700 @item -Waggregate-return
4701 @opindex Waggregate-return
4702 @opindex Wno-aggregate-return
4703 Warn if any functions that return structures or unions are defined or
4704 called.  (In languages where you can return an array, this also elicits
4705 a warning.)
4707 @item -Wno-aggressive-loop-optimizations
4708 @opindex Wno-aggressive-loop-optimizations
4709 @opindex Waggressive-loop-optimizations
4710 Warn if in a loop with constant number of iterations the compiler detects
4711 undefined behavior in some statement during one or more of the iterations.
4713 @item -Wno-attributes
4714 @opindex Wno-attributes
4715 @opindex Wattributes
4716 Do not warn if an unexpected @code{__attribute__} is used, such as
4717 unrecognized attributes, function attributes applied to variables,
4718 etc.  This does not stop errors for incorrect use of supported
4719 attributes.
4721 @item -Wno-builtin-macro-redefined
4722 @opindex Wno-builtin-macro-redefined
4723 @opindex Wbuiltin-macro-redefined
4724 Do not warn if certain built-in macros are redefined.  This suppresses
4725 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
4726 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
4728 @item -Wstrict-prototypes @r{(C and Objective-C only)}
4729 @opindex Wstrict-prototypes
4730 @opindex Wno-strict-prototypes
4731 Warn if a function is declared or defined without specifying the
4732 argument types.  (An old-style function definition is permitted without
4733 a warning if preceded by a declaration that specifies the argument
4734 types.)
4736 @item -Wold-style-declaration @r{(C and Objective-C only)}
4737 @opindex Wold-style-declaration
4738 @opindex Wno-old-style-declaration
4739 Warn for obsolescent usages, according to the C Standard, in a
4740 declaration. For example, warn if storage-class specifiers like
4741 @code{static} are not the first things in a declaration.  This warning
4742 is also enabled by @option{-Wextra}.
4744 @item -Wold-style-definition @r{(C and Objective-C only)}
4745 @opindex Wold-style-definition
4746 @opindex Wno-old-style-definition
4747 Warn if an old-style function definition is used.  A warning is given
4748 even if there is a previous prototype.
4750 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
4751 @opindex Wmissing-parameter-type
4752 @opindex Wno-missing-parameter-type
4753 A function parameter is declared without a type specifier in K&R-style
4754 functions:
4756 @smallexample
4757 void foo(bar) @{ @}
4758 @end smallexample
4760 This warning is also enabled by @option{-Wextra}.
4762 @item -Wmissing-prototypes @r{(C and Objective-C only)}
4763 @opindex Wmissing-prototypes
4764 @opindex Wno-missing-prototypes
4765 Warn if a global function is defined without a previous prototype
4766 declaration.  This warning is issued even if the definition itself
4767 provides a prototype.  Use this option to detect global functions
4768 that do not have a matching prototype declaration in a header file.
4769 This option is not valid for C++ because all function declarations
4770 provide prototypes and a non-matching declaration will declare an
4771 overload rather than conflict with an earlier declaration.
4772 Use @option{-Wmissing-declarations} to detect missing declarations in C++.
4774 @item -Wmissing-declarations
4775 @opindex Wmissing-declarations
4776 @opindex Wno-missing-declarations
4777 Warn if a global function is defined without a previous declaration.
4778 Do so even if the definition itself provides a prototype.
4779 Use this option to detect global functions that are not declared in
4780 header files.  In C, no warnings are issued for functions with previous
4781 non-prototype declarations; use @option{-Wmissing-prototypes} to detect
4782 missing prototypes.  In C++, no warnings are issued for function templates,
4783 or for inline functions, or for functions in anonymous namespaces.
4785 @item -Wmissing-field-initializers
4786 @opindex Wmissing-field-initializers
4787 @opindex Wno-missing-field-initializers
4788 @opindex W
4789 @opindex Wextra
4790 @opindex Wno-extra
4791 Warn if a structure's initializer has some fields missing.  For
4792 example, the following code causes such a warning, because
4793 @code{x.h} is implicitly zero:
4795 @smallexample
4796 struct s @{ int f, g, h; @};
4797 struct s x = @{ 3, 4 @};
4798 @end smallexample
4800 This option does not warn about designated initializers, so the following
4801 modification does not trigger a warning:
4803 @smallexample
4804 struct s @{ int f, g, h; @};
4805 struct s x = @{ .f = 3, .g = 4 @};
4806 @end smallexample
4808 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
4809 warnings without this one, use @option{-Wextra -Wno-missing-field-initializers}.
4811 @item -Wno-multichar
4812 @opindex Wno-multichar
4813 @opindex Wmultichar
4814 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
4815 Usually they indicate a typo in the user's code, as they have
4816 implementation-defined values, and should not be used in portable code.
4818 @item -Wnormalized=<none|id|nfc|nfkc>
4819 @opindex Wnormalized=
4820 @cindex NFC
4821 @cindex NFKC
4822 @cindex character set, input normalization
4823 In ISO C and ISO C++, two identifiers are different if they are
4824 different sequences of characters.  However, sometimes when characters
4825 outside the basic ASCII character set are used, you can have two
4826 different character sequences that look the same.  To avoid confusion,
4827 the ISO 10646 standard sets out some @dfn{normalization rules} which
4828 when applied ensure that two sequences that look the same are turned into
4829 the same sequence.  GCC can warn you if you are using identifiers that
4830 have not been normalized; this option controls that warning.
4832 There are four levels of warning supported by GCC@.  The default is
4833 @option{-Wnormalized=nfc}, which warns about any identifier that is
4834 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
4835 recommended form for most uses.
4837 Unfortunately, there are some characters allowed in identifiers by
4838 ISO C and ISO C++ that, when turned into NFC, are not allowed in 
4839 identifiers.  That is, there's no way to use these symbols in portable
4840 ISO C or C++ and have all your identifiers in NFC@.
4841 @option{-Wnormalized=id} suppresses the warning for these characters.
4842 It is hoped that future versions of the standards involved will correct
4843 this, which is why this option is not the default.
4845 You can switch the warning off for all characters by writing
4846 @option{-Wnormalized=none}.  You should only do this if you
4847 are using some other normalization scheme (like ``D''), because
4848 otherwise you can easily create bugs that are literally impossible to see.
4850 Some characters in ISO 10646 have distinct meanings but look identical
4851 in some fonts or display methodologies, especially once formatting has
4852 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
4853 LETTER N'', displays just like a regular @code{n} that has been
4854 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
4855 normalization scheme to convert all these into a standard form as
4856 well, and GCC warns if your code is not in NFKC if you use
4857 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
4858 about every identifier that contains the letter O because it might be
4859 confused with the digit 0, and so is not the default, but may be
4860 useful as a local coding convention if the programming environment 
4861 cannot be fixed to display these characters distinctly.
4863 @item -Wno-deprecated
4864 @opindex Wno-deprecated
4865 @opindex Wdeprecated
4866 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
4868 @item -Wno-deprecated-declarations
4869 @opindex Wno-deprecated-declarations
4870 @opindex Wdeprecated-declarations
4871 Do not warn about uses of functions (@pxref{Function Attributes}),
4872 variables (@pxref{Variable Attributes}), and types (@pxref{Type
4873 Attributes}) marked as deprecated by using the @code{deprecated}
4874 attribute.
4876 @item -Wno-overflow
4877 @opindex Wno-overflow
4878 @opindex Woverflow
4879 Do not warn about compile-time overflow in constant expressions.
4881 @item -Wopenmp-simd
4882 @opindex Wopenm-simd
4883 Warn if the vectorizer cost model overrides the OpenMP or the Cilk Plus
4884 simd directive set by user.  The @option{-fsimd-cost-model=unlimited} can
4885 be used to relax the cost model.
4887 @item -Woverride-init @r{(C and Objective-C only)}
4888 @opindex Woverride-init
4889 @opindex Wno-override-init
4890 @opindex W
4891 @opindex Wextra
4892 @opindex Wno-extra
4893 Warn if an initialized field without side effects is overridden when
4894 using designated initializers (@pxref{Designated Inits, , Designated
4895 Initializers}).
4897 This warning is included in @option{-Wextra}.  To get other
4898 @option{-Wextra} warnings without this one, use @option{-Wextra
4899 -Wno-override-init}.
4901 @item -Wpacked
4902 @opindex Wpacked
4903 @opindex Wno-packed
4904 Warn if a structure is given the packed attribute, but the packed
4905 attribute has no effect on the layout or size of the structure.
4906 Such structures may be mis-aligned for little benefit.  For
4907 instance, in this code, the variable @code{f.x} in @code{struct bar}
4908 is misaligned even though @code{struct bar} does not itself
4909 have the packed attribute:
4911 @smallexample
4912 @group
4913 struct foo @{
4914   int x;
4915   char a, b, c, d;
4916 @} __attribute__((packed));
4917 struct bar @{
4918   char z;
4919   struct foo f;
4921 @end group
4922 @end smallexample
4924 @item -Wpacked-bitfield-compat
4925 @opindex Wpacked-bitfield-compat
4926 @opindex Wno-packed-bitfield-compat
4927 The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
4928 on bit-fields of type @code{char}.  This has been fixed in GCC 4.4 but
4929 the change can lead to differences in the structure layout.  GCC
4930 informs you when the offset of such a field has changed in GCC 4.4.
4931 For example there is no longer a 4-bit padding between field @code{a}
4932 and @code{b} in this structure:
4934 @smallexample
4935 struct foo
4937   char a:4;
4938   char b:8;
4939 @} __attribute__ ((packed));
4940 @end smallexample
4942 This warning is enabled by default.  Use
4943 @option{-Wno-packed-bitfield-compat} to disable this warning.
4945 @item -Wpadded
4946 @opindex Wpadded
4947 @opindex Wno-padded
4948 Warn if padding is included in a structure, either to align an element
4949 of the structure or to align the whole structure.  Sometimes when this
4950 happens it is possible to rearrange the fields of the structure to
4951 reduce the padding and so make the structure smaller.
4953 @item -Wredundant-decls
4954 @opindex Wredundant-decls
4955 @opindex Wno-redundant-decls
4956 Warn if anything is declared more than once in the same scope, even in
4957 cases where multiple declaration is valid and changes nothing.
4959 @item -Wnested-externs @r{(C and Objective-C only)}
4960 @opindex Wnested-externs
4961 @opindex Wno-nested-externs
4962 Warn if an @code{extern} declaration is encountered within a function.
4964 @item -Wno-inherited-variadic-ctor
4965 @opindex Winherited-variadic-ctor
4966 @opindex Wno-inherited-variadic-ctor
4967 Suppress warnings about use of C++11 inheriting constructors when the
4968 base class inherited from has a C variadic constructor; the warning is
4969 on by default because the ellipsis is not inherited.
4971 @item -Winline
4972 @opindex Winline
4973 @opindex Wno-inline
4974 Warn if a function that is declared as inline cannot be inlined.
4975 Even with this option, the compiler does not warn about failures to
4976 inline functions declared in system headers.
4978 The compiler uses a variety of heuristics to determine whether or not
4979 to inline a function.  For example, the compiler takes into account
4980 the size of the function being inlined and the amount of inlining
4981 that has already been done in the current function.  Therefore,
4982 seemingly insignificant changes in the source program can cause the
4983 warnings produced by @option{-Winline} to appear or disappear.
4985 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
4986 @opindex Wno-invalid-offsetof
4987 @opindex Winvalid-offsetof
4988 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
4989 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
4990 to a non-POD type is undefined.  In existing C++ implementations,
4991 however, @samp{offsetof} typically gives meaningful results even when
4992 applied to certain kinds of non-POD types (such as a simple
4993 @samp{struct} that fails to be a POD type only by virtue of having a
4994 constructor).  This flag is for users who are aware that they are
4995 writing nonportable code and who have deliberately chosen to ignore the
4996 warning about it.
4998 The restrictions on @samp{offsetof} may be relaxed in a future version
4999 of the C++ standard.
5001 @item -Wno-int-to-pointer-cast
5002 @opindex Wno-int-to-pointer-cast
5003 @opindex Wint-to-pointer-cast
5004 Suppress warnings from casts to pointer type of an integer of a
5005 different size. In C++, casting to a pointer type of smaller size is
5006 an error. @option{Wint-to-pointer-cast} is enabled by default.
5009 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
5010 @opindex Wno-pointer-to-int-cast
5011 @opindex Wpointer-to-int-cast
5012 Suppress warnings from casts from a pointer to an integer type of a
5013 different size.
5015 @item -Winvalid-pch
5016 @opindex Winvalid-pch
5017 @opindex Wno-invalid-pch
5018 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
5019 the search path but can't be used.
5021 @item -Wlong-long
5022 @opindex Wlong-long
5023 @opindex Wno-long-long
5024 Warn if @samp{long long} type is used.  This is enabled by either
5025 @option{-Wpedantic} or @option{-Wtraditional} in ISO C90 and C++98
5026 modes.  To inhibit the warning messages, use @option{-Wno-long-long}.
5028 @item -Wvariadic-macros
5029 @opindex Wvariadic-macros
5030 @opindex Wno-variadic-macros
5031 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
5032 alternate syntax when in pedantic ISO C99 mode.  This is default.
5033 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
5035 @item -Wvarargs
5036 @opindex Wvarargs
5037 @opindex Wno-varargs
5038 Warn upon questionable usage of the macros used to handle variable
5039 arguments like @samp{va_start}.  This is default.  To inhibit the
5040 warning messages, use @option{-Wno-varargs}.
5042 @item -Wvector-operation-performance
5043 @opindex Wvector-operation-performance
5044 @opindex Wno-vector-operation-performance
5045 Warn if vector operation is not implemented via SIMD capabilities of the
5046 architecture.  Mainly useful for the performance tuning.
5047 Vector operation can be implemented @code{piecewise}, which means that the
5048 scalar operation is performed on every vector element; 
5049 @code{in parallel}, which means that the vector operation is implemented
5050 using scalars of wider type, which normally is more performance efficient;
5051 and @code{as a single scalar}, which means that vector fits into a
5052 scalar type.
5054 @item -Wno-virtual-move-assign
5055 @opindex Wvirtual-move-assign
5056 @opindex Wno-virtual-move-assign
5057 Suppress warnings about inheriting from a virtual base with a
5058 non-trivial C++11 move assignment operator.  This is dangerous because
5059 if the virtual base is reachable along more than one path, it will be
5060 moved multiple times, which can mean both objects end up in the
5061 moved-from state.  If the move assignment operator is written to avoid
5062 moving from a moved-from object, this warning can be disabled.
5064 @item -Wvla
5065 @opindex Wvla
5066 @opindex Wno-vla
5067 Warn if variable length array is used in the code.
5068 @option{-Wno-vla} prevents the @option{-Wpedantic} warning of
5069 the variable length array.
5071 @item -Wvolatile-register-var
5072 @opindex Wvolatile-register-var
5073 @opindex Wno-volatile-register-var
5074 Warn if a register variable is declared volatile.  The volatile
5075 modifier does not inhibit all optimizations that may eliminate reads
5076 and/or writes to register variables.  This warning is enabled by
5077 @option{-Wall}.
5079 @item -Wdisabled-optimization
5080 @opindex Wdisabled-optimization
5081 @opindex Wno-disabled-optimization
5082 Warn if a requested optimization pass is disabled.  This warning does
5083 not generally indicate that there is anything wrong with your code; it
5084 merely indicates that GCC's optimizers are unable to handle the code
5085 effectively.  Often, the problem is that your code is too big or too
5086 complex; GCC refuses to optimize programs when the optimization
5087 itself is likely to take inordinate amounts of time.
5089 @item -Wpointer-sign @r{(C and Objective-C only)}
5090 @opindex Wpointer-sign
5091 @opindex Wno-pointer-sign
5092 Warn for pointer argument passing or assignment with different signedness.
5093 This option is only supported for C and Objective-C@.  It is implied by
5094 @option{-Wall} and by @option{-Wpedantic}, which can be disabled with
5095 @option{-Wno-pointer-sign}.
5097 @item -Wstack-protector
5098 @opindex Wstack-protector
5099 @opindex Wno-stack-protector
5100 This option is only active when @option{-fstack-protector} is active.  It
5101 warns about functions that are not protected against stack smashing.
5103 @item -Woverlength-strings
5104 @opindex Woverlength-strings
5105 @opindex Wno-overlength-strings
5106 Warn about string constants that are longer than the ``minimum
5107 maximum'' length specified in the C standard.  Modern compilers
5108 generally allow string constants that are much longer than the
5109 standard's minimum limit, but very portable programs should avoid
5110 using longer strings.
5112 The limit applies @emph{after} string constant concatenation, and does
5113 not count the trailing NUL@.  In C90, the limit was 509 characters; in
5114 C99, it was raised to 4095.  C++98 does not specify a normative
5115 minimum maximum, so we do not diagnose overlength strings in C++@.
5117 This option is implied by @option{-Wpedantic}, and can be disabled with
5118 @option{-Wno-overlength-strings}.
5120 @item -Wunsuffixed-float-constants @r{(C and Objective-C only)}
5121 @opindex Wunsuffixed-float-constants
5123 Issue a warning for any floating constant that does not have
5124 a suffix.  When used together with @option{-Wsystem-headers} it
5125 warns about such constants in system header files.  This can be useful
5126 when preparing code to use with the @code{FLOAT_CONST_DECIMAL64} pragma
5127 from the decimal floating-point extension to C99.
5128 @end table
5130 @node Debugging Options
5131 @section Options for Debugging Your Program or GCC
5132 @cindex options, debugging
5133 @cindex debugging information options
5135 GCC has various special options that are used for debugging
5136 either your program or GCC:
5138 @table @gcctabopt
5139 @item -g
5140 @opindex g
5141 Produce debugging information in the operating system's native format
5142 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
5143 information.
5145 On most systems that use stabs format, @option{-g} enables use of extra
5146 debugging information that only GDB can use; this extra information
5147 makes debugging work better in GDB but probably makes other debuggers
5148 crash or
5149 refuse to read the program.  If you want to control for certain whether
5150 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
5151 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
5153 GCC allows you to use @option{-g} with
5154 @option{-O}.  The shortcuts taken by optimized code may occasionally
5155 produce surprising results: some variables you declared may not exist
5156 at all; flow of control may briefly move where you did not expect it;
5157 some statements may not be executed because they compute constant
5158 results or their values are already at hand; some statements may
5159 execute in different places because they have been moved out of loops.
5161 Nevertheless it proves possible to debug optimized output.  This makes
5162 it reasonable to use the optimizer for programs that might have bugs.
5164 The following options are useful when GCC is generated with the
5165 capability for more than one debugging format.
5167 @item -gsplit-dwarf
5168 @opindex gsplit-dwarf
5169 Separate as much dwarf debugging information as possible into a
5170 separate output file with the extension .dwo.  This option allows
5171 the build system to avoid linking files with debug information.  To
5172 be useful, this option requires a debugger capable of reading .dwo
5173 files.
5175 @item -ggdb
5176 @opindex ggdb
5177 Produce debugging information for use by GDB@.  This means to use the
5178 most expressive format available (DWARF 2, stabs, or the native format
5179 if neither of those are supported), including GDB extensions if at all
5180 possible.
5182 @item -gpubnames
5183 @opindex gpubnames
5184 Generate dwarf .debug_pubnames and .debug_pubtypes sections.
5186 @item -ggnu-pubnames
5187 @opindex ggnu-pubnames
5188 Generate .debug_pubnames and .debug_pubtypes sections in a format
5189 suitable for conversion into a GDB@ index.  This option is only useful
5190 with a linker that can produce GDB@ index version 7.
5192 @item -gstabs
5193 @opindex gstabs
5194 Produce debugging information in stabs format (if that is supported),
5195 without GDB extensions.  This is the format used by DBX on most BSD
5196 systems.  On MIPS, Alpha and System V Release 4 systems this option
5197 produces stabs debugging output that is not understood by DBX or SDB@.
5198 On System V Release 4 systems this option requires the GNU assembler.
5200 @item -feliminate-unused-debug-symbols
5201 @opindex feliminate-unused-debug-symbols
5202 Produce debugging information in stabs format (if that is supported),
5203 for only symbols that are actually used.
5205 @item -femit-class-debug-always
5206 Instead of emitting debugging information for a C++ class in only one
5207 object file, emit it in all object files using the class.  This option
5208 should be used only with debuggers that are unable to handle the way GCC
5209 normally emits debugging information for classes because using this
5210 option increases the size of debugging information by as much as a
5211 factor of two.
5213 @item -fdebug-types-section
5214 @opindex fdebug-types-section
5215 @opindex fno-debug-types-section
5216 When using DWARF Version 4 or higher, type DIEs can be put into
5217 their own @code{.debug_types} section instead of making them part of the
5218 @code{.debug_info} section.  It is more efficient to put them in a separate
5219 comdat sections since the linker can then remove duplicates.
5220 But not all DWARF consumers support @code{.debug_types} sections yet
5221 and on some objects @code{.debug_types} produces larger instead of smaller
5222 debugging information.
5224 @item -gstabs+
5225 @opindex gstabs+
5226 Produce debugging information in stabs format (if that is supported),
5227 using GNU extensions understood only by the GNU debugger (GDB)@.  The
5228 use of these extensions is likely to make other debuggers crash or
5229 refuse to read the program.
5231 @item -gcoff
5232 @opindex gcoff
5233 Produce debugging information in COFF format (if that is supported).
5234 This is the format used by SDB on most System V systems prior to
5235 System V Release 4.
5237 @item -gxcoff
5238 @opindex gxcoff
5239 Produce debugging information in XCOFF format (if that is supported).
5240 This is the format used by the DBX debugger on IBM RS/6000 systems.
5242 @item -gxcoff+
5243 @opindex gxcoff+
5244 Produce debugging information in XCOFF format (if that is supported),
5245 using GNU extensions understood only by the GNU debugger (GDB)@.  The
5246 use of these extensions is likely to make other debuggers crash or
5247 refuse to read the program, and may cause assemblers other than the GNU
5248 assembler (GAS) to fail with an error.
5250 @item -gdwarf-@var{version}
5251 @opindex gdwarf-@var{version}
5252 Produce debugging information in DWARF format (if that is supported).
5253 The value of @var{version} may be either 2, 3 or 4; the default version
5254 for most targets is 4.
5256 Note that with DWARF Version 2, some ports require and always
5257 use some non-conflicting DWARF 3 extensions in the unwind tables.
5259 Version 4 may require GDB 7.0 and @option{-fvar-tracking-assignments}
5260 for maximum benefit.
5262 @item -grecord-gcc-switches
5263 @opindex grecord-gcc-switches
5264 This switch causes the command-line options used to invoke the
5265 compiler that may affect code generation to be appended to the
5266 DW_AT_producer attribute in DWARF debugging information.  The options
5267 are concatenated with spaces separating them from each other and from
5268 the compiler version.  See also @option{-frecord-gcc-switches} for another
5269 way of storing compiler options into the object file.  This is the default.
5271 @item -gno-record-gcc-switches
5272 @opindex gno-record-gcc-switches
5273 Disallow appending command-line options to the DW_AT_producer attribute
5274 in DWARF debugging information.
5276 @item -gstrict-dwarf
5277 @opindex gstrict-dwarf
5278 Disallow using extensions of later DWARF standard version than selected
5279 with @option{-gdwarf-@var{version}}.  On most targets using non-conflicting
5280 DWARF extensions from later standard versions is allowed.
5282 @item -gno-strict-dwarf
5283 @opindex gno-strict-dwarf
5284 Allow using extensions of later DWARF standard version than selected with
5285 @option{-gdwarf-@var{version}}.
5287 @item -gvms
5288 @opindex gvms
5289 Produce debugging information in Alpha/VMS debug format (if that is
5290 supported).  This is the format used by DEBUG on Alpha/VMS systems.
5292 @item -g@var{level}
5293 @itemx -ggdb@var{level}
5294 @itemx -gstabs@var{level}
5295 @itemx -gcoff@var{level}
5296 @itemx -gxcoff@var{level}
5297 @itemx -gvms@var{level}
5298 Request debugging information and also use @var{level} to specify how
5299 much information.  The default level is 2.
5301 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
5302 @option{-g}.
5304 Level 1 produces minimal information, enough for making backtraces in
5305 parts of the program that you don't plan to debug.  This includes
5306 descriptions of functions and external variables, and line number
5307 tables, but no information about local variables.
5309 Level 3 includes extra information, such as all the macro definitions
5310 present in the program.  Some debuggers support macro expansion when
5311 you use @option{-g3}.
5313 @option{-gdwarf-2} does not accept a concatenated debug level, because
5314 GCC used to support an option @option{-gdwarf} that meant to generate
5315 debug information in version 1 of the DWARF format (which is very
5316 different from version 2), and it would have been too confusing.  That
5317 debug format is long obsolete, but the option cannot be changed now.
5318 Instead use an additional @option{-g@var{level}} option to change the
5319 debug level for DWARF.
5321 @item -gtoggle
5322 @opindex gtoggle
5323 Turn off generation of debug info, if leaving out this option
5324 generates it, or turn it on at level 2 otherwise.  The position of this
5325 argument in the command line does not matter; it takes effect after all
5326 other options are processed, and it does so only once, no matter how
5327 many times it is given.  This is mainly intended to be used with
5328 @option{-fcompare-debug}.
5330 @item -fsanitize=address
5331 @opindex fsanitize=address
5332 Enable AddressSanitizer, a fast memory error detector.
5333 Memory access instructions will be instrumented to detect
5334 out-of-bounds and use-after-free bugs.
5335 See @uref{http://code.google.com/p/address-sanitizer/} for
5336 more details.  The run-time behavior can be influenced using the
5337 @env{ASAN_OPTIONS} environment variable; see
5338 @url{https://code.google.com/p/address-sanitizer/wiki/Flags#Run-time_flags} for
5339 a list of supported options.
5341 @item -fsanitize=thread
5342 @opindex fsanitize=thread
5343 Enable ThreadSanitizer, a fast data race detector.
5344 Memory access instructions will be instrumented to detect
5345 data race bugs.  See @uref{http://code.google.com/p/thread-sanitizer/} for more
5346 details. The run-time behavior can be influenced using the @env{TSAN_OPTIONS}
5347 environment variable; see
5348 @url{https://code.google.com/p/thread-sanitizer/wiki/Flags} for a list of
5349 supported options.
5351 @item -fsanitize=leak
5352 @opindex fsanitize=leak
5353 Enable LeakSanitizer, a memory leak detector.
5354 This option only matters for linking of executables and if neither
5355 @option{-fsanitize=address} nor @option{-fsanitize=thread} is used.  In that
5356 case it will link the executable against a library that overrides @code{malloc}
5357 and other allocator functions.  See
5358 @uref{https://code.google.com/p/address-sanitizer/wiki/LeakSanitizer} for more
5359 details.  The run-time behavior can be influenced using the
5360 @env{LSAN_OPTIONS} environment variable.
5362 @item -fsanitize=undefined
5363 @opindex fsanitize=undefined
5364 Enable UndefinedBehaviorSanitizer, a fast undefined behavior detector.
5365 Various computations will be instrumented to detect undefined behavior
5366 at runtime.  Current suboptions are:
5368 @table @gcctabopt
5370 @item -fsanitize=shift
5371 @opindex fsanitize=shift
5373 This option enables checking that the result of a shift operation is
5374 not undefined.  Note that what exactly is considered undefined differs
5375 slightly between C and C++, as well as between ISO C90 and C99, etc.
5377 @item -fsanitize=integer-divide-by-zero
5378 @opindex fsanitize=integer-divide-by-zero
5380 Detect integer division by zero as well as @code{INT_MIN / -1} division.
5382 @item -fsanitize=unreachable
5383 @opindex fsanitize=unreachable
5385 With this option, the compiler will turn the @code{__builtin_unreachable}
5386 call into a diagnostics message call instead.  When reaching the
5387 @code{__builtin_unreachable} call, the behavior is undefined.
5389 @item -fsanitize=vla-bound
5390 @opindex fsanitize=vla-bound
5392 This option instructs the compiler to check that the size of a variable
5393 length array is positive.  This option does not have any effect in
5394 @option{-std=c++1y} mode, as the standard requires the exception be thrown
5395 instead.
5397 @item -fsanitize=null
5398 @opindex fsanitize=null
5400 This option enables pointer checking.  Particularly, the application
5401 built with this option turned on will issue an error message when it
5402 tries to dereference a NULL pointer, or if a reference (possibly an
5403 rvalue reference) is bound to a NULL pointer.
5405 @item -fsanitize=return
5406 @opindex fsanitize=return
5408 This option enables return statement checking.  Programs
5409 built with this option turned on will issue an error message
5410 when the end of a non-void function is reached without actually
5411 returning a value.  This option works in C++ only.
5413 @item -fsanitize=signed-integer-overflow
5414 @opindex fsanitize=signed-integer-overflow
5416 This option enables signed integer overflow checking.  We check that
5417 the result of @code{+}, @code{*}, and both unary and binary @code{-}
5418 does not overflow in the signed arithmetics.  Note, integer promotion
5419 rules must be taken into account.  That is, the following is not an
5420 overflow:
5421 @smallexample
5422 signed char a = SCHAR_MAX;
5423 a++;
5424 @end smallexample
5426 @end table
5428 While @option{-ftrapv} causes traps for signed overflows to be emitted,
5429 @option{-fsanitize=undefined} gives a diagnostic message.
5430 This currently works only for the C family of languages.
5432 @item -fsanitize=float-divide-by-zero
5433 @opindex fsanitize=float-divide-by-zero
5435 Detect floating-point division by zero.  Unlike other similar options,
5436 @option{-fsanitize=float-divide-by-zero} is not enabled by
5437 @option{-fsanitize=undefined}, since floating-point division by zero can
5438 be a legitimate way of obtaining infinities and NaNs.
5440 @item -fsanitize-recover
5441 @opindex fsanitize-recover
5442 By default @option{-fsanitize=undefined} sanitization (and its suboptions
5443 except for @option{-fsanitize=unreachable} and @option{-fsanitize=return})
5444 after reporting undefined behavior attempts to continue running the
5445 program as if no undefined behavior happened.  This means multiple undefined
5446 behavior runtime errors can be reported in a single program run, and the exit
5447 code of the program may indicate success even when undefined behavior
5448 has been reported.  The @option{-fno-sanitize-recover} can be used to alter
5449 this behavior, only the first detected undefined behavior will be reported
5450 and program will exit after that with non-zero exit code.
5452 @item -fsanitize-undefined-trap-on-error
5453 @opindex fsanitize-undefined-trap-on-error
5454 The @option{-fsanitize-undefined-trap-on-error} instructs the compiler to
5455 report undefined behavior using @code{__builtin_trap ()} rather than
5456 a @code{libubsan} library routine.  The advantage of this is that the
5457 @code{libubsan} library is not needed and will not be linked in, so this
5458 is usable even for use in freestanding environments.
5460 @item -fdump-final-insns@r{[}=@var{file}@r{]}
5461 @opindex fdump-final-insns
5462 Dump the final internal representation (RTL) to @var{file}.  If the
5463 optional argument is omitted (or if @var{file} is @code{.}), the name
5464 of the dump file is determined by appending @code{.gkd} to the
5465 compilation output file name.
5467 @item -fcompare-debug@r{[}=@var{opts}@r{]}
5468 @opindex fcompare-debug
5469 @opindex fno-compare-debug
5470 If no error occurs during compilation, run the compiler a second time,
5471 adding @var{opts} and @option{-fcompare-debug-second} to the arguments
5472 passed to the second compilation.  Dump the final internal
5473 representation in both compilations, and print an error if they differ.
5475 If the equal sign is omitted, the default @option{-gtoggle} is used.
5477 The environment variable @env{GCC_COMPARE_DEBUG}, if defined, non-empty
5478 and nonzero, implicitly enables @option{-fcompare-debug}.  If
5479 @env{GCC_COMPARE_DEBUG} is defined to a string starting with a dash,
5480 then it is used for @var{opts}, otherwise the default @option{-gtoggle}
5481 is used.
5483 @option{-fcompare-debug=}, with the equal sign but without @var{opts},
5484 is equivalent to @option{-fno-compare-debug}, which disables the dumping
5485 of the final representation and the second compilation, preventing even
5486 @env{GCC_COMPARE_DEBUG} from taking effect.
5488 To verify full coverage during @option{-fcompare-debug} testing, set
5489 @env{GCC_COMPARE_DEBUG} to say @samp{-fcompare-debug-not-overridden},
5490 which GCC rejects as an invalid option in any actual compilation
5491 (rather than preprocessing, assembly or linking).  To get just a
5492 warning, setting @env{GCC_COMPARE_DEBUG} to @samp{-w%n-fcompare-debug
5493 not overridden} will do.
5495 @item -fcompare-debug-second
5496 @opindex fcompare-debug-second
5497 This option is implicitly passed to the compiler for the second
5498 compilation requested by @option{-fcompare-debug}, along with options to
5499 silence warnings, and omitting other options that would cause
5500 side-effect compiler outputs to files or to the standard output.  Dump
5501 files and preserved temporary files are renamed so as to contain the
5502 @code{.gk} additional extension during the second compilation, to avoid
5503 overwriting those generated by the first.
5505 When this option is passed to the compiler driver, it causes the
5506 @emph{first} compilation to be skipped, which makes it useful for little
5507 other than debugging the compiler proper.
5509 @item -feliminate-dwarf2-dups
5510 @opindex feliminate-dwarf2-dups
5511 Compress DWARF 2 debugging information by eliminating duplicated
5512 information about each symbol.  This option only makes sense when
5513 generating DWARF 2 debugging information with @option{-gdwarf-2}.
5515 @item -femit-struct-debug-baseonly
5516 @opindex femit-struct-debug-baseonly
5517 Emit debug information for struct-like types
5518 only when the base name of the compilation source file
5519 matches the base name of file in which the struct is defined.
5521 This option substantially reduces the size of debugging information,
5522 but at significant potential loss in type information to the debugger.
5523 See @option{-femit-struct-debug-reduced} for a less aggressive option.
5524 See @option{-femit-struct-debug-detailed} for more detailed control.
5526 This option works only with DWARF 2.
5528 @item -femit-struct-debug-reduced
5529 @opindex femit-struct-debug-reduced
5530 Emit debug information for struct-like types
5531 only when the base name of the compilation source file
5532 matches the base name of file in which the type is defined,
5533 unless the struct is a template or defined in a system header.
5535 This option significantly reduces the size of debugging information,
5536 with some potential loss in type information to the debugger.
5537 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
5538 See @option{-femit-struct-debug-detailed} for more detailed control.
5540 This option works only with DWARF 2.
5542 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
5543 Specify the struct-like types
5544 for which the compiler generates debug information.
5545 The intent is to reduce duplicate struct debug information
5546 between different object files within the same program.
5548 This option is a detailed version of
5549 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
5550 which serves for most needs.
5552 A specification has the syntax@*
5553 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
5555 The optional first word limits the specification to
5556 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
5557 A struct type is used directly when it is the type of a variable, member.
5558 Indirect uses arise through pointers to structs.
5559 That is, when use of an incomplete struct is valid, the use is indirect.
5560 An example is
5561 @samp{struct one direct; struct two * indirect;}.
5563 The optional second word limits the specification to
5564 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
5565 Generic structs are a bit complicated to explain.
5566 For C++, these are non-explicit specializations of template classes,
5567 or non-template classes within the above.
5568 Other programming languages have generics,
5569 but @option{-femit-struct-debug-detailed} does not yet implement them.
5571 The third word specifies the source files for those
5572 structs for which the compiler should emit debug information.
5573 The values @samp{none} and @samp{any} have the normal meaning.
5574 The value @samp{base} means that
5575 the base of name of the file in which the type declaration appears
5576 must match the base of the name of the main compilation file.
5577 In practice, this means that when compiling @file{foo.c}, debug information
5578 is generated for types declared in that file and @file{foo.h},
5579 but not other header files.
5580 The value @samp{sys} means those types satisfying @samp{base}
5581 or declared in system or compiler headers.
5583 You may need to experiment to determine the best settings for your application.
5585 The default is @option{-femit-struct-debug-detailed=all}.
5587 This option works only with DWARF 2.
5589 @item -fno-merge-debug-strings
5590 @opindex fmerge-debug-strings
5591 @opindex fno-merge-debug-strings
5592 Direct the linker to not merge together strings in the debugging
5593 information that are identical in different object files.  Merging is
5594 not supported by all assemblers or linkers.  Merging decreases the size
5595 of the debug information in the output file at the cost of increasing
5596 link processing time.  Merging is enabled by default.
5598 @item -fdebug-prefix-map=@var{old}=@var{new}
5599 @opindex fdebug-prefix-map
5600 When compiling files in directory @file{@var{old}}, record debugging
5601 information describing them as in @file{@var{new}} instead.
5603 @item -fno-dwarf2-cfi-asm
5604 @opindex fdwarf2-cfi-asm
5605 @opindex fno-dwarf2-cfi-asm
5606 Emit DWARF 2 unwind info as compiler generated @code{.eh_frame} section
5607 instead of using GAS @code{.cfi_*} directives.
5609 @cindex @command{prof}
5610 @item -p
5611 @opindex p
5612 Generate extra code to write profile information suitable for the
5613 analysis program @command{prof}.  You must use this option when compiling
5614 the source files you want data about, and you must also use it when
5615 linking.
5617 @cindex @command{gprof}
5618 @item -pg
5619 @opindex pg
5620 Generate extra code to write profile information suitable for the
5621 analysis program @command{gprof}.  You must use this option when compiling
5622 the source files you want data about, and you must also use it when
5623 linking.
5625 @item -Q
5626 @opindex Q
5627 Makes the compiler print out each function name as it is compiled, and
5628 print some statistics about each pass when it finishes.
5630 @item -ftime-report
5631 @opindex ftime-report
5632 Makes the compiler print some statistics about the time consumed by each
5633 pass when it finishes.
5635 @item -fmem-report
5636 @opindex fmem-report
5637 Makes the compiler print some statistics about permanent memory
5638 allocation when it finishes.
5640 @item -fmem-report-wpa
5641 @opindex fmem-report-wpa
5642 Makes the compiler print some statistics about permanent memory
5643 allocation for the WPA phase only.
5645 @item -fpre-ipa-mem-report
5646 @opindex fpre-ipa-mem-report
5647 @item -fpost-ipa-mem-report
5648 @opindex fpost-ipa-mem-report
5649 Makes the compiler print some statistics about permanent memory
5650 allocation before or after interprocedural optimization.
5652 @item -fprofile-report
5653 @opindex fprofile-report
5654 Makes the compiler print some statistics about consistency of the
5655 (estimated) profile and effect of individual passes.
5657 @item -fstack-usage
5658 @opindex fstack-usage
5659 Makes the compiler output stack usage information for the program, on a
5660 per-function basis.  The filename for the dump is made by appending
5661 @file{.su} to the @var{auxname}.  @var{auxname} is generated from the name of
5662 the output file, if explicitly specified and it is not an executable,
5663 otherwise it is the basename of the source file.  An entry is made up
5664 of three fields:
5666 @itemize
5667 @item
5668 The name of the function.
5669 @item
5670 A number of bytes.
5671 @item
5672 One or more qualifiers: @code{static}, @code{dynamic}, @code{bounded}.
5673 @end itemize
5675 The qualifier @code{static} means that the function manipulates the stack
5676 statically: a fixed number of bytes are allocated for the frame on function
5677 entry and released on function exit; no stack adjustments are otherwise made
5678 in the function.  The second field is this fixed number of bytes.
5680 The qualifier @code{dynamic} means that the function manipulates the stack
5681 dynamically: in addition to the static allocation described above, stack
5682 adjustments are made in the body of the function, for example to push/pop
5683 arguments around function calls.  If the qualifier @code{bounded} is also
5684 present, the amount of these adjustments is bounded at compile time and
5685 the second field is an upper bound of the total amount of stack used by
5686 the function.  If it is not present, the amount of these adjustments is
5687 not bounded at compile time and the second field only represents the
5688 bounded part.
5690 @item -fprofile-arcs
5691 @opindex fprofile-arcs
5692 Add code so that program flow @dfn{arcs} are instrumented.  During
5693 execution the program records how many times each branch and call is
5694 executed and how many times it is taken or returns.  When the compiled
5695 program exits it saves this data to a file called
5696 @file{@var{auxname}.gcda} for each source file.  The data may be used for
5697 profile-directed optimizations (@option{-fbranch-probabilities}), or for
5698 test coverage analysis (@option{-ftest-coverage}).  Each object file's
5699 @var{auxname} is generated from the name of the output file, if
5700 explicitly specified and it is not the final executable, otherwise it is
5701 the basename of the source file.  In both cases any suffix is removed
5702 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
5703 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
5704 @xref{Cross-profiling}.
5706 @cindex @command{gcov}
5707 @item --coverage
5708 @opindex coverage
5710 This option is used to compile and link code instrumented for coverage
5711 analysis.  The option is a synonym for @option{-fprofile-arcs}
5712 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
5713 linking).  See the documentation for those options for more details.
5715 @itemize
5717 @item
5718 Compile the source files with @option{-fprofile-arcs} plus optimization
5719 and code generation options.  For test coverage analysis, use the
5720 additional @option{-ftest-coverage} option.  You do not need to profile
5721 every source file in a program.
5723 @item
5724 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
5725 (the latter implies the former).
5727 @item
5728 Run the program on a representative workload to generate the arc profile
5729 information.  This may be repeated any number of times.  You can run
5730 concurrent instances of your program, and provided that the file system
5731 supports locking, the data files will be correctly updated.  Also
5732 @code{fork} calls are detected and correctly handled (double counting
5733 will not happen).
5735 @item
5736 For profile-directed optimizations, compile the source files again with
5737 the same optimization and code generation options plus
5738 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
5739 Control Optimization}).
5741 @item
5742 For test coverage analysis, use @command{gcov} to produce human readable
5743 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
5744 @command{gcov} documentation for further information.
5746 @end itemize
5748 With @option{-fprofile-arcs}, for each function of your program GCC
5749 creates a program flow graph, then finds a spanning tree for the graph.
5750 Only arcs that are not on the spanning tree have to be instrumented: the
5751 compiler adds code to count the number of times that these arcs are
5752 executed.  When an arc is the only exit or only entrance to a block, the
5753 instrumentation code can be added to the block; otherwise, a new basic
5754 block must be created to hold the instrumentation code.
5756 @need 2000
5757 @item -ftest-coverage
5758 @opindex ftest-coverage
5759 Produce a notes file that the @command{gcov} code-coverage utility
5760 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
5761 show program coverage.  Each source file's note file is called
5762 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
5763 above for a description of @var{auxname} and instructions on how to
5764 generate test coverage data.  Coverage data matches the source files
5765 more closely if you do not optimize.
5767 @item -fdbg-cnt-list
5768 @opindex fdbg-cnt-list
5769 Print the name and the counter upper bound for all debug counters.
5772 @item -fdbg-cnt=@var{counter-value-list}
5773 @opindex fdbg-cnt
5774 Set the internal debug counter upper bound.  @var{counter-value-list}
5775 is a comma-separated list of @var{name}:@var{value} pairs
5776 which sets the upper bound of each debug counter @var{name} to @var{value}.
5777 All debug counters have the initial upper bound of @code{UINT_MAX};
5778 thus @code{dbg_cnt()} returns true always unless the upper bound
5779 is set by this option.
5780 For example, with @option{-fdbg-cnt=dce:10,tail_call:0},
5781 @code{dbg_cnt(dce)} returns true only for first 10 invocations.
5783 @item -fenable-@var{kind}-@var{pass}
5784 @itemx -fdisable-@var{kind}-@var{pass}=@var{range-list}
5785 @opindex fdisable-
5786 @opindex fenable-
5788 This is a set of options that are used to explicitly disable/enable
5789 optimization passes.  These options are intended for use for debugging GCC.
5790 Compiler users should use regular options for enabling/disabling
5791 passes instead.
5793 @table @gcctabopt
5795 @item -fdisable-ipa-@var{pass}
5796 Disable IPA pass @var{pass}. @var{pass} is the pass name.  If the same pass is
5797 statically invoked in the compiler multiple times, the pass name should be
5798 appended with a sequential number starting from 1.
5800 @item -fdisable-rtl-@var{pass}
5801 @itemx -fdisable-rtl-@var{pass}=@var{range-list}
5802 Disable RTL pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
5803 statically invoked in the compiler multiple times, the pass name should be
5804 appended with a sequential number starting from 1.  @var{range-list} is a 
5805 comma-separated list of function ranges or assembler names.  Each range is a number
5806 pair separated by a colon.  The range is inclusive in both ends.  If the range
5807 is trivial, the number pair can be simplified as a single number.  If the
5808 function's call graph node's @var{uid} falls within one of the specified ranges,
5809 the @var{pass} is disabled for that function.  The @var{uid} is shown in the
5810 function header of a dump file, and the pass names can be dumped by using
5811 option @option{-fdump-passes}.
5813 @item -fdisable-tree-@var{pass}
5814 @itemx -fdisable-tree-@var{pass}=@var{range-list}
5815 Disable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description of
5816 option arguments.
5818 @item -fenable-ipa-@var{pass}
5819 Enable IPA pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
5820 statically invoked in the compiler multiple times, the pass name should be
5821 appended with a sequential number starting from 1.
5823 @item -fenable-rtl-@var{pass}
5824 @itemx -fenable-rtl-@var{pass}=@var{range-list}
5825 Enable RTL pass @var{pass}.  See @option{-fdisable-rtl} for option argument
5826 description and examples.
5828 @item -fenable-tree-@var{pass}
5829 @itemx -fenable-tree-@var{pass}=@var{range-list}
5830 Enable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description
5831 of option arguments.
5833 @end table
5835 Here are some examples showing uses of these options.
5837 @smallexample
5839 # disable ccp1 for all functions
5840    -fdisable-tree-ccp1
5841 # disable complete unroll for function whose cgraph node uid is 1
5842    -fenable-tree-cunroll=1
5843 # disable gcse2 for functions at the following ranges [1,1],
5844 # [300,400], and [400,1000]
5845 # disable gcse2 for functions foo and foo2
5846    -fdisable-rtl-gcse2=foo,foo2
5847 # disable early inlining
5848    -fdisable-tree-einline
5849 # disable ipa inlining
5850    -fdisable-ipa-inline
5851 # enable tree full unroll
5852    -fenable-tree-unroll
5854 @end smallexample
5856 @item -d@var{letters}
5857 @itemx -fdump-rtl-@var{pass}
5858 @itemx -fdump-rtl-@var{pass}=@var{filename}
5859 @opindex d
5860 @opindex fdump-rtl-@var{pass}
5861 Says to make debugging dumps during compilation at times specified by
5862 @var{letters}.  This is used for debugging the RTL-based passes of the
5863 compiler.  The file names for most of the dumps are made by appending
5864 a pass number and a word to the @var{dumpname}, and the files are
5865 created in the directory of the output file. In case of
5866 @option{=@var{filename}} option, the dump is output on the given file
5867 instead of the pass numbered dump files. Note that the pass number is
5868 computed statically as passes get registered into the pass manager.
5869 Thus the numbering is not related to the dynamic order of execution of
5870 passes.  In particular, a pass installed by a plugin could have a
5871 number over 200 even if it executed quite early.  @var{dumpname} is
5872 generated from the name of the output file, if explicitly specified
5873 and it is not an executable, otherwise it is the basename of the
5874 source file. These switches may have different effects when
5875 @option{-E} is used for preprocessing.
5877 Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
5878 @option{-d} option @var{letters}.  Here are the possible
5879 letters for use in @var{pass} and @var{letters}, and their meanings:
5881 @table @gcctabopt
5883 @item -fdump-rtl-alignments
5884 @opindex fdump-rtl-alignments
5885 Dump after branch alignments have been computed.
5887 @item -fdump-rtl-asmcons
5888 @opindex fdump-rtl-asmcons
5889 Dump after fixing rtl statements that have unsatisfied in/out constraints.
5891 @item -fdump-rtl-auto_inc_dec
5892 @opindex fdump-rtl-auto_inc_dec
5893 Dump after auto-inc-dec discovery.  This pass is only run on
5894 architectures that have auto inc or auto dec instructions.
5896 @item -fdump-rtl-barriers
5897 @opindex fdump-rtl-barriers
5898 Dump after cleaning up the barrier instructions.
5900 @item -fdump-rtl-bbpart
5901 @opindex fdump-rtl-bbpart
5902 Dump after partitioning hot and cold basic blocks.
5904 @item -fdump-rtl-bbro
5905 @opindex fdump-rtl-bbro
5906 Dump after block reordering.
5908 @item -fdump-rtl-btl1
5909 @itemx -fdump-rtl-btl2
5910 @opindex fdump-rtl-btl2
5911 @opindex fdump-rtl-btl2
5912 @option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
5913 after the two branch
5914 target load optimization passes.
5916 @item -fdump-rtl-bypass
5917 @opindex fdump-rtl-bypass
5918 Dump after jump bypassing and control flow optimizations.
5920 @item -fdump-rtl-combine
5921 @opindex fdump-rtl-combine
5922 Dump after the RTL instruction combination pass.
5924 @item -fdump-rtl-compgotos
5925 @opindex fdump-rtl-compgotos
5926 Dump after duplicating the computed gotos.
5928 @item -fdump-rtl-ce1
5929 @itemx -fdump-rtl-ce2
5930 @itemx -fdump-rtl-ce3
5931 @opindex fdump-rtl-ce1
5932 @opindex fdump-rtl-ce2
5933 @opindex fdump-rtl-ce3
5934 @option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
5935 @option{-fdump-rtl-ce3} enable dumping after the three
5936 if conversion passes.
5938 @item -fdump-rtl-cprop_hardreg
5939 @opindex fdump-rtl-cprop_hardreg
5940 Dump after hard register copy propagation.
5942 @item -fdump-rtl-csa
5943 @opindex fdump-rtl-csa
5944 Dump after combining stack adjustments.
5946 @item -fdump-rtl-cse1
5947 @itemx -fdump-rtl-cse2
5948 @opindex fdump-rtl-cse1
5949 @opindex fdump-rtl-cse2
5950 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
5951 the two common subexpression elimination passes.
5953 @item -fdump-rtl-dce
5954 @opindex fdump-rtl-dce
5955 Dump after the standalone dead code elimination passes.
5957 @item -fdump-rtl-dbr
5958 @opindex fdump-rtl-dbr
5959 Dump after delayed branch scheduling.
5961 @item -fdump-rtl-dce1
5962 @itemx -fdump-rtl-dce2
5963 @opindex fdump-rtl-dce1
5964 @opindex fdump-rtl-dce2
5965 @option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
5966 the two dead store elimination passes.
5968 @item -fdump-rtl-eh
5969 @opindex fdump-rtl-eh
5970 Dump after finalization of EH handling code.
5972 @item -fdump-rtl-eh_ranges
5973 @opindex fdump-rtl-eh_ranges
5974 Dump after conversion of EH handling range regions.
5976 @item -fdump-rtl-expand
5977 @opindex fdump-rtl-expand
5978 Dump after RTL generation.
5980 @item -fdump-rtl-fwprop1
5981 @itemx -fdump-rtl-fwprop2
5982 @opindex fdump-rtl-fwprop1
5983 @opindex fdump-rtl-fwprop2
5984 @option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
5985 dumping after the two forward propagation passes.
5987 @item -fdump-rtl-gcse1
5988 @itemx -fdump-rtl-gcse2
5989 @opindex fdump-rtl-gcse1
5990 @opindex fdump-rtl-gcse2
5991 @option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
5992 after global common subexpression elimination.
5994 @item -fdump-rtl-init-regs
5995 @opindex fdump-rtl-init-regs
5996 Dump after the initialization of the registers.
5998 @item -fdump-rtl-initvals
5999 @opindex fdump-rtl-initvals
6000 Dump after the computation of the initial value sets.
6002 @item -fdump-rtl-into_cfglayout
6003 @opindex fdump-rtl-into_cfglayout
6004 Dump after converting to cfglayout mode.
6006 @item -fdump-rtl-ira
6007 @opindex fdump-rtl-ira
6008 Dump after iterated register allocation.
6010 @item -fdump-rtl-jump
6011 @opindex fdump-rtl-jump
6012 Dump after the second jump optimization.
6014 @item -fdump-rtl-loop2
6015 @opindex fdump-rtl-loop2
6016 @option{-fdump-rtl-loop2} enables dumping after the rtl
6017 loop optimization passes.
6019 @item -fdump-rtl-mach
6020 @opindex fdump-rtl-mach
6021 Dump after performing the machine dependent reorganization pass, if that
6022 pass exists.
6024 @item -fdump-rtl-mode_sw
6025 @opindex fdump-rtl-mode_sw
6026 Dump after removing redundant mode switches.
6028 @item -fdump-rtl-rnreg
6029 @opindex fdump-rtl-rnreg
6030 Dump after register renumbering.
6032 @item -fdump-rtl-outof_cfglayout
6033 @opindex fdump-rtl-outof_cfglayout
6034 Dump after converting from cfglayout mode.
6036 @item -fdump-rtl-peephole2
6037 @opindex fdump-rtl-peephole2
6038 Dump after the peephole pass.
6040 @item -fdump-rtl-postreload
6041 @opindex fdump-rtl-postreload
6042 Dump after post-reload optimizations.
6044 @item -fdump-rtl-pro_and_epilogue
6045 @opindex fdump-rtl-pro_and_epilogue
6046 Dump after generating the function prologues and epilogues.
6048 @item -fdump-rtl-sched1
6049 @itemx -fdump-rtl-sched2
6050 @opindex fdump-rtl-sched1
6051 @opindex fdump-rtl-sched2
6052 @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
6053 after the basic block scheduling passes.
6055 @item -fdump-rtl-ree
6056 @opindex fdump-rtl-ree
6057 Dump after sign/zero extension elimination.
6059 @item -fdump-rtl-seqabstr
6060 @opindex fdump-rtl-seqabstr
6061 Dump after common sequence discovery.
6063 @item -fdump-rtl-shorten
6064 @opindex fdump-rtl-shorten
6065 Dump after shortening branches.
6067 @item -fdump-rtl-sibling
6068 @opindex fdump-rtl-sibling
6069 Dump after sibling call optimizations.
6071 @item -fdump-rtl-split1
6072 @itemx -fdump-rtl-split2
6073 @itemx -fdump-rtl-split3
6074 @itemx -fdump-rtl-split4
6075 @itemx -fdump-rtl-split5
6076 @opindex fdump-rtl-split1
6077 @opindex fdump-rtl-split2
6078 @opindex fdump-rtl-split3
6079 @opindex fdump-rtl-split4
6080 @opindex fdump-rtl-split5
6081 @option{-fdump-rtl-split1}, @option{-fdump-rtl-split2},
6082 @option{-fdump-rtl-split3}, @option{-fdump-rtl-split4} and
6083 @option{-fdump-rtl-split5} enable dumping after five rounds of
6084 instruction splitting.
6086 @item -fdump-rtl-sms
6087 @opindex fdump-rtl-sms
6088 Dump after modulo scheduling.  This pass is only run on some
6089 architectures.
6091 @item -fdump-rtl-stack
6092 @opindex fdump-rtl-stack
6093 Dump after conversion from GCC's ``flat register file'' registers to the
6094 x87's stack-like registers.  This pass is only run on x86 variants.
6096 @item -fdump-rtl-subreg1
6097 @itemx -fdump-rtl-subreg2
6098 @opindex fdump-rtl-subreg1
6099 @opindex fdump-rtl-subreg2
6100 @option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
6101 the two subreg expansion passes.
6103 @item -fdump-rtl-unshare
6104 @opindex fdump-rtl-unshare
6105 Dump after all rtl has been unshared.
6107 @item -fdump-rtl-vartrack
6108 @opindex fdump-rtl-vartrack
6109 Dump after variable tracking.
6111 @item -fdump-rtl-vregs
6112 @opindex fdump-rtl-vregs
6113 Dump after converting virtual registers to hard registers.
6115 @item -fdump-rtl-web
6116 @opindex fdump-rtl-web
6117 Dump after live range splitting.
6119 @item -fdump-rtl-regclass
6120 @itemx -fdump-rtl-subregs_of_mode_init
6121 @itemx -fdump-rtl-subregs_of_mode_finish
6122 @itemx -fdump-rtl-dfinit
6123 @itemx -fdump-rtl-dfinish
6124 @opindex fdump-rtl-regclass
6125 @opindex fdump-rtl-subregs_of_mode_init
6126 @opindex fdump-rtl-subregs_of_mode_finish
6127 @opindex fdump-rtl-dfinit
6128 @opindex fdump-rtl-dfinish
6129 These dumps are defined but always produce empty files.
6131 @item -da
6132 @itemx -fdump-rtl-all
6133 @opindex da
6134 @opindex fdump-rtl-all
6135 Produce all the dumps listed above.
6137 @item -dA
6138 @opindex dA
6139 Annotate the assembler output with miscellaneous debugging information.
6141 @item -dD
6142 @opindex dD
6143 Dump all macro definitions, at the end of preprocessing, in addition to
6144 normal output.
6146 @item -dH
6147 @opindex dH
6148 Produce a core dump whenever an error occurs.
6150 @item -dp
6151 @opindex dp
6152 Annotate the assembler output with a comment indicating which
6153 pattern and alternative is used.  The length of each instruction is
6154 also printed.
6156 @item -dP
6157 @opindex dP
6158 Dump the RTL in the assembler output as a comment before each instruction.
6159 Also turns on @option{-dp} annotation.
6161 @item -dx
6162 @opindex dx
6163 Just generate RTL for a function instead of compiling it.  Usually used
6164 with @option{-fdump-rtl-expand}.
6165 @end table
6167 @item -fdump-noaddr
6168 @opindex fdump-noaddr
6169 When doing debugging dumps, suppress address output.  This makes it more
6170 feasible to use diff on debugging dumps for compiler invocations with
6171 different compiler binaries and/or different
6172 text / bss / data / heap / stack / dso start locations.
6174 @item -fdump-unnumbered
6175 @opindex fdump-unnumbered
6176 When doing debugging dumps, suppress instruction numbers and address output.
6177 This makes it more feasible to use diff on debugging dumps for compiler
6178 invocations with different options, in particular with and without
6179 @option{-g}.
6181 @item -fdump-unnumbered-links
6182 @opindex fdump-unnumbered-links
6183 When doing debugging dumps (see @option{-d} option above), suppress
6184 instruction numbers for the links to the previous and next instructions
6185 in a sequence.
6187 @item -fdump-translation-unit @r{(C++ only)}
6188 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
6189 @opindex fdump-translation-unit
6190 Dump a representation of the tree structure for the entire translation
6191 unit to a file.  The file name is made by appending @file{.tu} to the
6192 source file name, and the file is created in the same directory as the
6193 output file.  If the @samp{-@var{options}} form is used, @var{options}
6194 controls the details of the dump as described for the
6195 @option{-fdump-tree} options.
6197 @item -fdump-class-hierarchy @r{(C++ only)}
6198 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
6199 @opindex fdump-class-hierarchy
6200 Dump a representation of each class's hierarchy and virtual function
6201 table layout to a file.  The file name is made by appending
6202 @file{.class} to the source file name, and the file is created in the
6203 same directory as the output file.  If the @samp{-@var{options}} form
6204 is used, @var{options} controls the details of the dump as described
6205 for the @option{-fdump-tree} options.
6207 @item -fdump-ipa-@var{switch}
6208 @opindex fdump-ipa
6209 Control the dumping at various stages of inter-procedural analysis
6210 language tree to a file.  The file name is generated by appending a
6211 switch specific suffix to the source file name, and the file is created
6212 in the same directory as the output file.  The following dumps are
6213 possible:
6215 @table @samp
6216 @item all
6217 Enables all inter-procedural analysis dumps.
6219 @item cgraph
6220 Dumps information about call-graph optimization, unused function removal,
6221 and inlining decisions.
6223 @item inline
6224 Dump after function inlining.
6226 @end table
6228 @item -fdump-passes
6229 @opindex fdump-passes
6230 Dump the list of optimization passes that are turned on and off by
6231 the current command-line options.
6233 @item -fdump-statistics-@var{option}
6234 @opindex fdump-statistics
6235 Enable and control dumping of pass statistics in a separate file.  The
6236 file name is generated by appending a suffix ending in
6237 @samp{.statistics} to the source file name, and the file is created in
6238 the same directory as the output file.  If the @samp{-@var{option}}
6239 form is used, @samp{-stats} causes counters to be summed over the
6240 whole compilation unit while @samp{-details} dumps every event as
6241 the passes generate them.  The default with no option is to sum
6242 counters for each function compiled.
6244 @item -fdump-tree-@var{switch}
6245 @itemx -fdump-tree-@var{switch}-@var{options}
6246 @itemx -fdump-tree-@var{switch}-@var{options}=@var{filename}
6247 @opindex fdump-tree
6248 Control the dumping at various stages of processing the intermediate
6249 language tree to a file.  The file name is generated by appending a
6250 switch-specific suffix to the source file name, and the file is
6251 created in the same directory as the output file. In case of
6252 @option{=@var{filename}} option, the dump is output on the given file
6253 instead of the auto named dump files.  If the @samp{-@var{options}}
6254 form is used, @var{options} is a list of @samp{-} separated options
6255 which control the details of the dump.  Not all options are applicable
6256 to all dumps; those that are not meaningful are ignored.  The
6257 following options are available
6259 @table @samp
6260 @item address
6261 Print the address of each node.  Usually this is not meaningful as it
6262 changes according to the environment and source file.  Its primary use
6263 is for tying up a dump file with a debug environment.
6264 @item asmname
6265 If @code{DECL_ASSEMBLER_NAME} has been set for a given decl, use that
6266 in the dump instead of @code{DECL_NAME}.  Its primary use is ease of
6267 use working backward from mangled names in the assembly file.
6268 @item slim
6269 When dumping front-end intermediate representations, inhibit dumping
6270 of members of a scope or body of a function merely because that scope
6271 has been reached.  Only dump such items when they are directly reachable
6272 by some other path.
6274 When dumping pretty-printed trees, this option inhibits dumping the
6275 bodies of control structures.
6277 When dumping RTL, print the RTL in slim (condensed) form instead of
6278 the default LISP-like representation.
6279 @item raw
6280 Print a raw representation of the tree.  By default, trees are
6281 pretty-printed into a C-like representation.
6282 @item details
6283 Enable more detailed dumps (not honored by every dump option). Also
6284 include information from the optimization passes.
6285 @item stats
6286 Enable dumping various statistics about the pass (not honored by every dump
6287 option).
6288 @item blocks
6289 Enable showing basic block boundaries (disabled in raw dumps).
6290 @item graph
6291 For each of the other indicated dump files (@option{-fdump-rtl-@var{pass}}),
6292 dump a representation of the control flow graph suitable for viewing with
6293 GraphViz to @file{@var{file}.@var{passid}.@var{pass}.dot}.  Each function in
6294 the file is pretty-printed as a subgraph, so that GraphViz can render them
6295 all in a single plot.
6297 This option currently only works for RTL dumps, and the RTL is always
6298 dumped in slim form.
6299 @item vops
6300 Enable showing virtual operands for every statement.
6301 @item lineno
6302 Enable showing line numbers for statements.
6303 @item uid
6304 Enable showing the unique ID (@code{DECL_UID}) for each variable.
6305 @item verbose
6306 Enable showing the tree dump for each statement.
6307 @item eh
6308 Enable showing the EH region number holding each statement.
6309 @item scev
6310 Enable showing scalar evolution analysis details.
6311 @item optimized
6312 Enable showing optimization information (only available in certain
6313 passes).
6314 @item missed
6315 Enable showing missed optimization information (only available in certain
6316 passes).
6317 @item notes
6318 Enable other detailed optimization information (only available in
6319 certain passes).
6320 @item =@var{filename}
6321 Instead of an auto named dump file, output into the given file
6322 name. The file names @file{stdout} and @file{stderr} are treated
6323 specially and are considered already open standard streams. For
6324 example,
6326 @smallexample
6327 gcc -O2 -ftree-vectorize -fdump-tree-vect-blocks=foo.dump
6328      -fdump-tree-pre=stderr file.c
6329 @end smallexample
6331 outputs vectorizer dump into @file{foo.dump}, while the PRE dump is
6332 output on to @file{stderr}. If two conflicting dump filenames are
6333 given for the same pass, then the latter option overrides the earlier
6334 one.
6336 @item all
6337 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
6338 and @option{lineno}.
6340 @item optall
6341 Turn on all optimization options, i.e., @option{optimized},
6342 @option{missed}, and @option{note}.
6343 @end table
6345 The following tree dumps are possible:
6346 @table @samp
6348 @item original
6349 @opindex fdump-tree-original
6350 Dump before any tree based optimization, to @file{@var{file}.original}.
6352 @item optimized
6353 @opindex fdump-tree-optimized
6354 Dump after all tree based optimization, to @file{@var{file}.optimized}.
6356 @item gimple
6357 @opindex fdump-tree-gimple
6358 Dump each function before and after the gimplification pass to a file.  The
6359 file name is made by appending @file{.gimple} to the source file name.
6361 @item cfg
6362 @opindex fdump-tree-cfg
6363 Dump the control flow graph of each function to a file.  The file name is
6364 made by appending @file{.cfg} to the source file name.
6366 @item ch
6367 @opindex fdump-tree-ch
6368 Dump each function after copying loop headers.  The file name is made by
6369 appending @file{.ch} to the source file name.
6371 @item ssa
6372 @opindex fdump-tree-ssa
6373 Dump SSA related information to a file.  The file name is made by appending
6374 @file{.ssa} to the source file name.
6376 @item alias
6377 @opindex fdump-tree-alias
6378 Dump aliasing information for each function.  The file name is made by
6379 appending @file{.alias} to the source file name.
6381 @item ccp
6382 @opindex fdump-tree-ccp
6383 Dump each function after CCP@.  The file name is made by appending
6384 @file{.ccp} to the source file name.
6386 @item storeccp
6387 @opindex fdump-tree-storeccp
6388 Dump each function after STORE-CCP@.  The file name is made by appending
6389 @file{.storeccp} to the source file name.
6391 @item pre
6392 @opindex fdump-tree-pre
6393 Dump trees after partial redundancy elimination.  The file name is made
6394 by appending @file{.pre} to the source file name.
6396 @item fre
6397 @opindex fdump-tree-fre
6398 Dump trees after full redundancy elimination.  The file name is made
6399 by appending @file{.fre} to the source file name.
6401 @item copyprop
6402 @opindex fdump-tree-copyprop
6403 Dump trees after copy propagation.  The file name is made
6404 by appending @file{.copyprop} to the source file name.
6406 @item store_copyprop
6407 @opindex fdump-tree-store_copyprop
6408 Dump trees after store copy-propagation.  The file name is made
6409 by appending @file{.store_copyprop} to the source file name.
6411 @item dce
6412 @opindex fdump-tree-dce
6413 Dump each function after dead code elimination.  The file name is made by
6414 appending @file{.dce} to the source file name.
6416 @item sra
6417 @opindex fdump-tree-sra
6418 Dump each function after performing scalar replacement of aggregates.  The
6419 file name is made by appending @file{.sra} to the source file name.
6421 @item sink
6422 @opindex fdump-tree-sink
6423 Dump each function after performing code sinking.  The file name is made
6424 by appending @file{.sink} to the source file name.
6426 @item dom
6427 @opindex fdump-tree-dom
6428 Dump each function after applying dominator tree optimizations.  The file
6429 name is made by appending @file{.dom} to the source file name.
6431 @item dse
6432 @opindex fdump-tree-dse
6433 Dump each function after applying dead store elimination.  The file
6434 name is made by appending @file{.dse} to the source file name.
6436 @item phiopt
6437 @opindex fdump-tree-phiopt
6438 Dump each function after optimizing PHI nodes into straightline code.  The file
6439 name is made by appending @file{.phiopt} to the source file name.
6441 @item forwprop
6442 @opindex fdump-tree-forwprop
6443 Dump each function after forward propagating single use variables.  The file
6444 name is made by appending @file{.forwprop} to the source file name.
6446 @item copyrename
6447 @opindex fdump-tree-copyrename
6448 Dump each function after applying the copy rename optimization.  The file
6449 name is made by appending @file{.copyrename} to the source file name.
6451 @item nrv
6452 @opindex fdump-tree-nrv
6453 Dump each function after applying the named return value optimization on
6454 generic trees.  The file name is made by appending @file{.nrv} to the source
6455 file name.
6457 @item vect
6458 @opindex fdump-tree-vect
6459 Dump each function after applying vectorization of loops.  The file name is
6460 made by appending @file{.vect} to the source file name.
6462 @item slp
6463 @opindex fdump-tree-slp
6464 Dump each function after applying vectorization of basic blocks.  The file name
6465 is made by appending @file{.slp} to the source file name.
6467 @item vrp
6468 @opindex fdump-tree-vrp
6469 Dump each function after Value Range Propagation (VRP).  The file name
6470 is made by appending @file{.vrp} to the source file name.
6472 @item all
6473 @opindex fdump-tree-all
6474 Enable all the available tree dumps with the flags provided in this option.
6475 @end table
6477 @item -fopt-info
6478 @itemx -fopt-info-@var{options}
6479 @itemx -fopt-info-@var{options}=@var{filename}
6480 @opindex fopt-info
6481 Controls optimization dumps from various optimization passes. If the
6482 @samp{-@var{options}} form is used, @var{options} is a list of
6483 @samp{-} separated options to select the dump details and
6484 optimizations.  If @var{options} is not specified, it defaults to
6485 @option{optimized} for details and @option{optall} for optimization
6486 groups. If the @var{filename} is not specified, it defaults to
6487 @file{stderr}. Note that the output @var{filename} will be overwritten
6488 in case of multiple translation units. If a combined output from
6489 multiple translation units is desired, @file{stderr} should be used
6490 instead.
6492 The options can be divided into two groups, 1) options describing the
6493 verbosity of the dump, and 2) options describing which optimizations
6494 should be included. The options from both the groups can be freely
6495 mixed as they are non-overlapping. However, in case of any conflicts,
6496 the latter options override the earlier options on the command
6497 line. Though multiple -fopt-info options are accepted, only one of
6498 them can have @option{=filename}. If other filenames are provided then
6499 all but the first one are ignored.
6501 The dump verbosity has the following options
6503 @table @samp
6504 @item optimized
6505 Print information when an optimization is successfully applied. It is
6506 up to a pass to decide which information is relevant. For example, the
6507 vectorizer passes print the source location of loops which got
6508 successfully vectorized.
6509 @item missed
6510 Print information about missed optimizations. Individual passes
6511 control which information to include in the output. For example,
6513 @smallexample
6514 gcc -O2 -ftree-vectorize -fopt-info-vec-missed
6515 @end smallexample
6517 will print information about missed optimization opportunities from
6518 vectorization passes on stderr.
6519 @item note
6520 Print verbose information about optimizations, such as certain
6521 transformations, more detailed messages about decisions etc.
6522 @item all
6523 Print detailed optimization information. This includes
6524 @var{optimized}, @var{missed}, and @var{note}.
6525 @end table
6527 The second set of options describes a group of optimizations and may
6528 include one or more of the following.
6530 @table @samp
6531 @item ipa
6532 Enable dumps from all interprocedural optimizations.
6533 @item loop
6534 Enable dumps from all loop optimizations.
6535 @item inline
6536 Enable dumps from all inlining optimizations.
6537 @item vec
6538 Enable dumps from all vectorization optimizations.
6539 @item optall
6540 Enable dumps from all optimizations. This is a superset of
6541 the optimization groups listed above.
6542 @end table
6544 For example,
6545 @smallexample
6546 gcc -O3 -fopt-info-missed=missed.all
6547 @end smallexample
6549 outputs missed optimization report from all the passes into
6550 @file{missed.all}.
6552 As another example,
6553 @smallexample
6554 gcc -O3 -fopt-info-inline-optimized-missed=inline.txt
6555 @end smallexample
6557 will output information about missed optimizations as well as
6558 optimized locations from all the inlining passes into
6559 @file{inline.txt}.
6561 If the @var{filename} is provided, then the dumps from all the
6562 applicable optimizations are concatenated into the @file{filename}.
6563 Otherwise the dump is output onto @file{stderr}. If @var{options} is
6564 omitted, it defaults to @option{all-optall}, which means dump all
6565 available optimization info from all the passes. In the following
6566 example, all optimization info is output on to @file{stderr}.
6568 @smallexample
6569 gcc -O3 -fopt-info
6570 @end smallexample
6572 Note that @option{-fopt-info-vec-missed} behaves the same as
6573 @option{-fopt-info-missed-vec}.
6575 As another example, consider
6577 @smallexample
6578 gcc -fopt-info-vec-missed=vec.miss -fopt-info-loop-optimized=loop.opt
6579 @end smallexample
6581 Here the two output filenames @file{vec.miss} and @file{loop.opt} are
6582 in conflict since only one output file is allowed. In this case, only
6583 the first option takes effect and the subsequent options are
6584 ignored. Thus only the @file{vec.miss} is produced which contains
6585 dumps from the vectorizer about missed opportunities.
6587 @item -frandom-seed=@var{string}
6588 @opindex frandom-seed
6589 This option provides a seed that GCC uses in place of
6590 random numbers in generating certain symbol names
6591 that have to be different in every compiled file.  It is also used to
6592 place unique stamps in coverage data files and the object files that
6593 produce them.  You can use the @option{-frandom-seed} option to produce
6594 reproducibly identical object files.
6596 The @var{string} should be different for every file you compile.
6598 @item -fsched-verbose=@var{n}
6599 @opindex fsched-verbose
6600 On targets that use instruction scheduling, this option controls the
6601 amount of debugging output the scheduler prints.  This information is
6602 written to standard error, unless @option{-fdump-rtl-sched1} or
6603 @option{-fdump-rtl-sched2} is specified, in which case it is output
6604 to the usual dump listing file, @file{.sched1} or @file{.sched2}
6605 respectively.  However for @var{n} greater than nine, the output is
6606 always printed to standard error.
6608 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
6609 same information as @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2}.
6610 For @var{n} greater than one, it also output basic block probabilities,
6611 detailed ready list information and unit/insn info.  For @var{n} greater
6612 than two, it includes RTL at abort point, control-flow and regions info.
6613 And for @var{n} over four, @option{-fsched-verbose} also includes
6614 dependence info.
6616 @item -save-temps
6617 @itemx -save-temps=cwd
6618 @opindex save-temps
6619 Store the usual ``temporary'' intermediate files permanently; place them
6620 in the current directory and name them based on the source file.  Thus,
6621 compiling @file{foo.c} with @option{-c -save-temps} produces files
6622 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
6623 preprocessed @file{foo.i} output file even though the compiler now
6624 normally uses an integrated preprocessor.
6626 When used in combination with the @option{-x} command-line option,
6627 @option{-save-temps} is sensible enough to avoid over writing an
6628 input source file with the same extension as an intermediate file.
6629 The corresponding intermediate file may be obtained by renaming the
6630 source file before using @option{-save-temps}.
6632 If you invoke GCC in parallel, compiling several different source
6633 files that share a common base name in different subdirectories or the
6634 same source file compiled for multiple output destinations, it is
6635 likely that the different parallel compilers will interfere with each
6636 other, and overwrite the temporary files.  For instance:
6638 @smallexample
6639 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
6640 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
6641 @end smallexample
6643 may result in @file{foo.i} and @file{foo.o} being written to
6644 simultaneously by both compilers.
6646 @item -save-temps=obj
6647 @opindex save-temps=obj
6648 Store the usual ``temporary'' intermediate files permanently.  If the
6649 @option{-o} option is used, the temporary files are based on the
6650 object file.  If the @option{-o} option is not used, the
6651 @option{-save-temps=obj} switch behaves like @option{-save-temps}.
6653 For example:
6655 @smallexample
6656 gcc -save-temps=obj -c foo.c
6657 gcc -save-temps=obj -c bar.c -o dir/xbar.o
6658 gcc -save-temps=obj foobar.c -o dir2/yfoobar
6659 @end smallexample
6661 @noindent
6662 creates @file{foo.i}, @file{foo.s}, @file{dir/xbar.i},
6663 @file{dir/xbar.s}, @file{dir2/yfoobar.i}, @file{dir2/yfoobar.s}, and
6664 @file{dir2/yfoobar.o}.
6666 @item -time@r{[}=@var{file}@r{]}
6667 @opindex time
6668 Report the CPU time taken by each subprocess in the compilation
6669 sequence.  For C source files, this is the compiler proper and assembler
6670 (plus the linker if linking is done).
6672 Without the specification of an output file, the output looks like this:
6674 @smallexample
6675 # cc1 0.12 0.01
6676 # as 0.00 0.01
6677 @end smallexample
6679 The first number on each line is the ``user time'', that is time spent
6680 executing the program itself.  The second number is ``system time'',
6681 time spent executing operating system routines on behalf of the program.
6682 Both numbers are in seconds.
6684 With the specification of an output file, the output is appended to the
6685 named file, and it looks like this:
6687 @smallexample
6688 0.12 0.01 cc1 @var{options}
6689 0.00 0.01 as @var{options}
6690 @end smallexample
6692 The ``user time'' and the ``system time'' are moved before the program
6693 name, and the options passed to the program are displayed, so that one
6694 can later tell what file was being compiled, and with which options.
6696 @item -fvar-tracking
6697 @opindex fvar-tracking
6698 Run variable tracking pass.  It computes where variables are stored at each
6699 position in code.  Better debugging information is then generated
6700 (if the debugging information format supports this information).
6702 It is enabled by default when compiling with optimization (@option{-Os},
6703 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
6704 the debug info format supports it.
6706 @item -fvar-tracking-assignments
6707 @opindex fvar-tracking-assignments
6708 @opindex fno-var-tracking-assignments
6709 Annotate assignments to user variables early in the compilation and
6710 attempt to carry the annotations over throughout the compilation all the
6711 way to the end, in an attempt to improve debug information while
6712 optimizing.  Use of @option{-gdwarf-4} is recommended along with it.
6714 It can be enabled even if var-tracking is disabled, in which case
6715 annotations are created and maintained, but discarded at the end.
6717 @item -fvar-tracking-assignments-toggle
6718 @opindex fvar-tracking-assignments-toggle
6719 @opindex fno-var-tracking-assignments-toggle
6720 Toggle @option{-fvar-tracking-assignments}, in the same way that
6721 @option{-gtoggle} toggles @option{-g}.
6723 @item -print-file-name=@var{library}
6724 @opindex print-file-name
6725 Print the full absolute name of the library file @var{library} that
6726 would be used when linking---and don't do anything else.  With this
6727 option, GCC does not compile or link anything; it just prints the
6728 file name.
6730 @item -print-multi-directory
6731 @opindex print-multi-directory
6732 Print the directory name corresponding to the multilib selected by any
6733 other switches present in the command line.  This directory is supposed
6734 to exist in @env{GCC_EXEC_PREFIX}.
6736 @item -print-multi-lib
6737 @opindex print-multi-lib
6738 Print the mapping from multilib directory names to compiler switches
6739 that enable them.  The directory name is separated from the switches by
6740 @samp{;}, and each switch starts with an @samp{@@} instead of the
6741 @samp{-}, without spaces between multiple switches.  This is supposed to
6742 ease shell processing.
6744 @item -print-multi-os-directory
6745 @opindex print-multi-os-directory
6746 Print the path to OS libraries for the selected
6747 multilib, relative to some @file{lib} subdirectory.  If OS libraries are
6748 present in the @file{lib} subdirectory and no multilibs are used, this is
6749 usually just @file{.}, if OS libraries are present in @file{lib@var{suffix}}
6750 sibling directories this prints e.g.@: @file{../lib64}, @file{../lib} or
6751 @file{../lib32}, or if OS libraries are present in @file{lib/@var{subdir}}
6752 subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}.
6754 @item -print-multiarch
6755 @opindex print-multiarch
6756 Print the path to OS libraries for the selected multiarch,
6757 relative to some @file{lib} subdirectory.
6759 @item -print-prog-name=@var{program}
6760 @opindex print-prog-name
6761 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
6763 @item -print-libgcc-file-name
6764 @opindex print-libgcc-file-name
6765 Same as @option{-print-file-name=libgcc.a}.
6767 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
6768 but you do want to link with @file{libgcc.a}.  You can do:
6770 @smallexample
6771 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
6772 @end smallexample
6774 @item -print-search-dirs
6775 @opindex print-search-dirs
6776 Print the name of the configured installation directory and a list of
6777 program and library directories @command{gcc} searches---and don't do anything else.
6779 This is useful when @command{gcc} prints the error message
6780 @samp{installation problem, cannot exec cpp0: No such file or directory}.
6781 To resolve this you either need to put @file{cpp0} and the other compiler
6782 components where @command{gcc} expects to find them, or you can set the environment
6783 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
6784 Don't forget the trailing @samp{/}.
6785 @xref{Environment Variables}.
6787 @item -print-sysroot
6788 @opindex print-sysroot
6789 Print the target sysroot directory that is used during
6790 compilation.  This is the target sysroot specified either at configure
6791 time or using the @option{--sysroot} option, possibly with an extra
6792 suffix that depends on compilation options.  If no target sysroot is
6793 specified, the option prints nothing.
6795 @item -print-sysroot-headers-suffix
6796 @opindex print-sysroot-headers-suffix
6797 Print the suffix added to the target sysroot when searching for
6798 headers, or give an error if the compiler is not configured with such
6799 a suffix---and don't do anything else.
6801 @item -dumpmachine
6802 @opindex dumpmachine
6803 Print the compiler's target machine (for example,
6804 @samp{i686-pc-linux-gnu})---and don't do anything else.
6806 @item -dumpversion
6807 @opindex dumpversion
6808 Print the compiler version (for example, @samp{3.0})---and don't do
6809 anything else.
6811 @item -dumpspecs
6812 @opindex dumpspecs
6813 Print the compiler's built-in specs---and don't do anything else.  (This
6814 is used when GCC itself is being built.)  @xref{Spec Files}.
6816 @item -fno-eliminate-unused-debug-types
6817 @opindex feliminate-unused-debug-types
6818 @opindex fno-eliminate-unused-debug-types
6819 Normally, when producing DWARF 2 output, GCC avoids producing debug symbol 
6820 output for types that are nowhere used in the source file being compiled.
6821 Sometimes it is useful to have GCC emit debugging
6822 information for all types declared in a compilation
6823 unit, regardless of whether or not they are actually used
6824 in that compilation unit, for example 
6825 if, in the debugger, you want to cast a value to a type that is
6826 not actually used in your program (but is declared).  More often,
6827 however, this results in a significant amount of wasted space.
6828 @end table
6830 @node Optimize Options
6831 @section Options That Control Optimization
6832 @cindex optimize options
6833 @cindex options, optimization
6835 These options control various sorts of optimizations.
6837 Without any optimization option, the compiler's goal is to reduce the
6838 cost of compilation and to make debugging produce the expected
6839 results.  Statements are independent: if you stop the program with a
6840 breakpoint between statements, you can then assign a new value to any
6841 variable or change the program counter to any other statement in the
6842 function and get exactly the results you expect from the source
6843 code.
6845 Turning on optimization flags makes the compiler attempt to improve
6846 the performance and/or code size at the expense of compilation time
6847 and possibly the ability to debug the program.
6849 The compiler performs optimization based on the knowledge it has of the
6850 program.  Compiling multiple files at once to a single output file mode allows
6851 the compiler to use information gained from all of the files when compiling
6852 each of them.
6854 Not all optimizations are controlled directly by a flag.  Only
6855 optimizations that have a flag are listed in this section.
6857 Most optimizations are only enabled if an @option{-O} level is set on
6858 the command line.  Otherwise they are disabled, even if individual
6859 optimization flags are specified.
6861 Depending on the target and how GCC was configured, a slightly different
6862 set of optimizations may be enabled at each @option{-O} level than
6863 those listed here.  You can invoke GCC with @option{-Q --help=optimizers}
6864 to find out the exact set of optimizations that are enabled at each level.
6865 @xref{Overall Options}, for examples.
6867 @table @gcctabopt
6868 @item -O
6869 @itemx -O1
6870 @opindex O
6871 @opindex O1
6872 Optimize.  Optimizing compilation takes somewhat more time, and a lot
6873 more memory for a large function.
6875 With @option{-O}, the compiler tries to reduce code size and execution
6876 time, without performing any optimizations that take a great deal of
6877 compilation time.
6879 @option{-O} turns on the following optimization flags:
6880 @gccoptlist{
6881 -fauto-inc-dec @gol
6882 -fcompare-elim @gol
6883 -fcprop-registers @gol
6884 -fdce @gol
6885 -fdefer-pop @gol
6886 -fdelayed-branch @gol
6887 -fdse @gol
6888 -fguess-branch-probability @gol
6889 -fif-conversion2 @gol
6890 -fif-conversion @gol
6891 -fipa-pure-const @gol
6892 -fipa-profile @gol
6893 -fipa-reference @gol
6894 -fmerge-constants
6895 -fsplit-wide-types @gol
6896 -ftree-bit-ccp @gol
6897 -ftree-builtin-call-dce @gol
6898 -ftree-ccp @gol
6899 -ftree-ch @gol
6900 -ftree-copyrename @gol
6901 -ftree-dce @gol
6902 -ftree-dominator-opts @gol
6903 -ftree-dse @gol
6904 -ftree-forwprop @gol
6905 -ftree-fre @gol
6906 -ftree-phiprop @gol
6907 -ftree-slsr @gol
6908 -ftree-sra @gol
6909 -ftree-pta @gol
6910 -ftree-ter @gol
6911 -funit-at-a-time}
6913 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
6914 where doing so does not interfere with debugging.
6916 @item -O2
6917 @opindex O2
6918 Optimize even more.  GCC performs nearly all supported optimizations
6919 that do not involve a space-speed tradeoff.
6920 As compared to @option{-O}, this option increases both compilation time
6921 and the performance of the generated code.
6923 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
6924 also turns on the following optimization flags:
6925 @gccoptlist{-fthread-jumps @gol
6926 -falign-functions  -falign-jumps @gol
6927 -falign-loops  -falign-labels @gol
6928 -fcaller-saves @gol
6929 -fcrossjumping @gol
6930 -fcse-follow-jumps  -fcse-skip-blocks @gol
6931 -fdelete-null-pointer-checks @gol
6932 -fdevirtualize -fdevirtualize-speculatively @gol
6933 -fexpensive-optimizations @gol
6934 -fgcse  -fgcse-lm  @gol
6935 -fhoist-adjacent-loads @gol
6936 -finline-small-functions @gol
6937 -findirect-inlining @gol
6938 -fipa-sra @gol
6939 -fisolate-erroneous-paths-dereference @gol
6940 -foptimize-sibling-calls @gol
6941 -fpartial-inlining @gol
6942 -fpeephole2 @gol
6943 -freorder-blocks  -freorder-functions @gol
6944 -frerun-cse-after-loop  @gol
6945 -fsched-interblock  -fsched-spec @gol
6946 -fschedule-insns  -fschedule-insns2 @gol
6947 -fstrict-aliasing -fstrict-overflow @gol
6948 -ftree-switch-conversion -ftree-tail-merge @gol
6949 -ftree-pre @gol
6950 -ftree-vrp}
6952 Please note the warning under @option{-fgcse} about
6953 invoking @option{-O2} on programs that use computed gotos.
6955 @item -O3
6956 @opindex O3
6957 Optimize yet more.  @option{-O3} turns on all optimizations specified
6958 by @option{-O2} and also turns on the @option{-finline-functions},
6959 @option{-funswitch-loops}, @option{-fpredictive-commoning},
6960 @option{-fgcse-after-reload}, @option{-ftree-loop-vectorize},
6961 @option{-ftree-slp-vectorize}, @option{-fvect-cost-model},
6962 @option{-ftree-partial-pre} and @option{-fipa-cp-clone} options.
6964 @item -O0
6965 @opindex O0
6966 Reduce compilation time and make debugging produce the expected
6967 results.  This is the default.
6969 @item -Os
6970 @opindex Os
6971 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
6972 do not typically increase code size.  It also performs further
6973 optimizations designed to reduce code size.
6975 @option{-Os} disables the following optimization flags:
6976 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
6977 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
6978 -fprefetch-loop-arrays}
6980 @item -Ofast
6981 @opindex Ofast
6982 Disregard strict standards compliance.  @option{-Ofast} enables all
6983 @option{-O3} optimizations.  It also enables optimizations that are not
6984 valid for all standard-compliant programs.
6985 It turns on @option{-ffast-math} and the Fortran-specific
6986 @option{-fno-protect-parens} and @option{-fstack-arrays}.
6988 @item -Og
6989 @opindex Og
6990 Optimize debugging experience.  @option{-Og} enables optimizations
6991 that do not interfere with debugging. It should be the optimization
6992 level of choice for the standard edit-compile-debug cycle, offering
6993 a reasonable level of optimization while maintaining fast compilation
6994 and a good debugging experience.
6996 If you use multiple @option{-O} options, with or without level numbers,
6997 the last such option is the one that is effective.
6998 @end table
7000 Options of the form @option{-f@var{flag}} specify machine-independent
7001 flags.  Most flags have both positive and negative forms; the negative
7002 form of @option{-ffoo} is @option{-fno-foo}.  In the table
7003 below, only one of the forms is listed---the one you typically 
7004 use.  You can figure out the other form by either removing @samp{no-}
7005 or adding it.
7007 The following options control specific optimizations.  They are either
7008 activated by @option{-O} options or are related to ones that are.  You
7009 can use the following flags in the rare cases when ``fine-tuning'' of
7010 optimizations to be performed is desired.
7012 @table @gcctabopt
7013 @item -fno-defer-pop
7014 @opindex fno-defer-pop
7015 Always pop the arguments to each function call as soon as that function
7016 returns.  For machines that must pop arguments after a function call,
7017 the compiler normally lets arguments accumulate on the stack for several
7018 function calls and pops them all at once.
7020 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7022 @item -fforward-propagate
7023 @opindex fforward-propagate
7024 Perform a forward propagation pass on RTL@.  The pass tries to combine two
7025 instructions and checks if the result can be simplified.  If loop unrolling
7026 is active, two passes are performed and the second is scheduled after
7027 loop unrolling.
7029 This option is enabled by default at optimization levels @option{-O},
7030 @option{-O2}, @option{-O3}, @option{-Os}.
7032 @item -ffp-contract=@var{style}
7033 @opindex ffp-contract
7034 @option{-ffp-contract=off} disables floating-point expression contraction.
7035 @option{-ffp-contract=fast} enables floating-point expression contraction
7036 such as forming of fused multiply-add operations if the target has
7037 native support for them.
7038 @option{-ffp-contract=on} enables floating-point expression contraction
7039 if allowed by the language standard.  This is currently not implemented
7040 and treated equal to @option{-ffp-contract=off}.
7042 The default is @option{-ffp-contract=fast}.
7044 @item -fomit-frame-pointer
7045 @opindex fomit-frame-pointer
7046 Don't keep the frame pointer in a register for functions that
7047 don't need one.  This avoids the instructions to save, set up and
7048 restore frame pointers; it also makes an extra register available
7049 in many functions.  @strong{It also makes debugging impossible on
7050 some machines.}
7052 On some machines, such as the VAX, this flag has no effect, because
7053 the standard calling sequence automatically handles the frame pointer
7054 and nothing is saved by pretending it doesn't exist.  The
7055 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
7056 whether a target machine supports this flag.  @xref{Registers,,Register
7057 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
7059 Starting with GCC version 4.6, the default setting (when not optimizing for
7060 size) for 32-bit GNU/Linux x86 and 32-bit Darwin x86 targets has been changed to
7061 @option{-fomit-frame-pointer}.  The default can be reverted to
7062 @option{-fno-omit-frame-pointer} by configuring GCC with the
7063 @option{--enable-frame-pointer} configure option.
7065 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7067 @item -foptimize-sibling-calls
7068 @opindex foptimize-sibling-calls
7069 Optimize sibling and tail recursive calls.
7071 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7073 @item -fno-inline
7074 @opindex fno-inline
7075 Do not expand any functions inline apart from those marked with
7076 the @code{always_inline} attribute.  This is the default when not
7077 optimizing.
7079 Single functions can be exempted from inlining by marking them
7080 with the @code{noinline} attribute.
7082 @item -finline-small-functions
7083 @opindex finline-small-functions
7084 Integrate functions into their callers when their body is smaller than expected
7085 function call code (so overall size of program gets smaller).  The compiler
7086 heuristically decides which functions are simple enough to be worth integrating
7087 in this way.  This inlining applies to all functions, even those not declared
7088 inline.
7090 Enabled at level @option{-O2}.
7092 @item -findirect-inlining
7093 @opindex findirect-inlining
7094 Inline also indirect calls that are discovered to be known at compile
7095 time thanks to previous inlining.  This option has any effect only
7096 when inlining itself is turned on by the @option{-finline-functions}
7097 or @option{-finline-small-functions} options.
7099 Enabled at level @option{-O2}.
7101 @item -finline-functions
7102 @opindex finline-functions
7103 Consider all functions for inlining, even if they are not declared inline.
7104 The compiler heuristically decides which functions are worth integrating
7105 in this way.
7107 If all calls to a given function are integrated, and the function is
7108 declared @code{static}, then the function is normally not output as
7109 assembler code in its own right.
7111 Enabled at level @option{-O3}.
7113 @item -finline-functions-called-once
7114 @opindex finline-functions-called-once
7115 Consider all @code{static} functions called once for inlining into their
7116 caller even if they are not marked @code{inline}.  If a call to a given
7117 function is integrated, then the function is not output as assembler code
7118 in its own right.
7120 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
7122 @item -fearly-inlining
7123 @opindex fearly-inlining
7124 Inline functions marked by @code{always_inline} and functions whose body seems
7125 smaller than the function call overhead early before doing
7126 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
7127 makes profiling significantly cheaper and usually inlining faster on programs
7128 having large chains of nested wrapper functions.
7130 Enabled by default.
7132 @item -fipa-sra
7133 @opindex fipa-sra
7134 Perform interprocedural scalar replacement of aggregates, removal of
7135 unused parameters and replacement of parameters passed by reference
7136 by parameters passed by value.
7138 Enabled at levels @option{-O2}, @option{-O3} and @option{-Os}.
7140 @item -finline-limit=@var{n}
7141 @opindex finline-limit
7142 By default, GCC limits the size of functions that can be inlined.  This flag
7143 allows coarse control of this limit.  @var{n} is the size of functions that
7144 can be inlined in number of pseudo instructions.
7146 Inlining is actually controlled by a number of parameters, which may be
7147 specified individually by using @option{--param @var{name}=@var{value}}.
7148 The @option{-finline-limit=@var{n}} option sets some of these parameters
7149 as follows:
7151 @table @gcctabopt
7152 @item max-inline-insns-single
7153 is set to @var{n}/2.
7154 @item max-inline-insns-auto
7155 is set to @var{n}/2.
7156 @end table
7158 See below for a documentation of the individual
7159 parameters controlling inlining and for the defaults of these parameters.
7161 @emph{Note:} there may be no value to @option{-finline-limit} that results
7162 in default behavior.
7164 @emph{Note:} pseudo instruction represents, in this particular context, an
7165 abstract measurement of function's size.  In no way does it represent a count
7166 of assembly instructions and as such its exact meaning might change from one
7167 release to an another.
7169 @item -fno-keep-inline-dllexport
7170 @opindex -fno-keep-inline-dllexport
7171 This is a more fine-grained version of @option{-fkeep-inline-functions},
7172 which applies only to functions that are declared using the @code{dllexport}
7173 attribute or declspec (@xref{Function Attributes,,Declaring Attributes of
7174 Functions}.)
7176 @item -fkeep-inline-functions
7177 @opindex fkeep-inline-functions
7178 In C, emit @code{static} functions that are declared @code{inline}
7179 into the object file, even if the function has been inlined into all
7180 of its callers.  This switch does not affect functions using the
7181 @code{extern inline} extension in GNU C90@.  In C++, emit any and all
7182 inline functions into the object file.
7184 @item -fkeep-static-consts
7185 @opindex fkeep-static-consts
7186 Emit variables declared @code{static const} when optimization isn't turned
7187 on, even if the variables aren't referenced.
7189 GCC enables this option by default.  If you want to force the compiler to
7190 check if a variable is referenced, regardless of whether or not
7191 optimization is turned on, use the @option{-fno-keep-static-consts} option.
7193 @item -fmerge-constants
7194 @opindex fmerge-constants
7195 Attempt to merge identical constants (string constants and floating-point
7196 constants) across compilation units.
7198 This option is the default for optimized compilation if the assembler and
7199 linker support it.  Use @option{-fno-merge-constants} to inhibit this
7200 behavior.
7202 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7204 @item -fmerge-all-constants
7205 @opindex fmerge-all-constants
7206 Attempt to merge identical constants and identical variables.
7208 This option implies @option{-fmerge-constants}.  In addition to
7209 @option{-fmerge-constants} this considers e.g.@: even constant initialized
7210 arrays or initialized constant variables with integral or floating-point
7211 types.  Languages like C or C++ require each variable, including multiple
7212 instances of the same variable in recursive calls, to have distinct locations,
7213 so using this option results in non-conforming
7214 behavior.
7216 @item -fmodulo-sched
7217 @opindex fmodulo-sched
7218 Perform swing modulo scheduling immediately before the first scheduling
7219 pass.  This pass looks at innermost loops and reorders their
7220 instructions by overlapping different iterations.
7222 @item -fmodulo-sched-allow-regmoves
7223 @opindex fmodulo-sched-allow-regmoves
7224 Perform more aggressive SMS-based modulo scheduling with register moves
7225 allowed.  By setting this flag certain anti-dependences edges are
7226 deleted, which triggers the generation of reg-moves based on the
7227 life-range analysis.  This option is effective only with
7228 @option{-fmodulo-sched} enabled.
7230 @item -fno-branch-count-reg
7231 @opindex fno-branch-count-reg
7232 Do not use ``decrement and branch'' instructions on a count register,
7233 but instead generate a sequence of instructions that decrement a
7234 register, compare it against zero, then branch based upon the result.
7235 This option is only meaningful on architectures that support such
7236 instructions, which include x86, PowerPC, IA-64 and S/390.
7238 The default is @option{-fbranch-count-reg}.
7240 @item -fno-function-cse
7241 @opindex fno-function-cse
7242 Do not put function addresses in registers; make each instruction that
7243 calls a constant function contain the function's address explicitly.
7245 This option results in less efficient code, but some strange hacks
7246 that alter the assembler output may be confused by the optimizations
7247 performed when this option is not used.
7249 The default is @option{-ffunction-cse}
7251 @item -fno-zero-initialized-in-bss
7252 @opindex fno-zero-initialized-in-bss
7253 If the target supports a BSS section, GCC by default puts variables that
7254 are initialized to zero into BSS@.  This can save space in the resulting
7255 code.
7257 This option turns off this behavior because some programs explicitly
7258 rely on variables going to the data section---e.g., so that the
7259 resulting executable can find the beginning of that section and/or make
7260 assumptions based on that.
7262 The default is @option{-fzero-initialized-in-bss}.
7264 @item -fthread-jumps
7265 @opindex fthread-jumps
7266 Perform optimizations that check to see if a jump branches to a
7267 location where another comparison subsumed by the first is found.  If
7268 so, the first branch is redirected to either the destination of the
7269 second branch or a point immediately following it, depending on whether
7270 the condition is known to be true or false.
7272 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7274 @item -fsplit-wide-types
7275 @opindex fsplit-wide-types
7276 When using a type that occupies multiple registers, such as @code{long
7277 long} on a 32-bit system, split the registers apart and allocate them
7278 independently.  This normally generates better code for those types,
7279 but may make debugging more difficult.
7281 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
7282 @option{-Os}.
7284 @item -fcse-follow-jumps
7285 @opindex fcse-follow-jumps
7286 In common subexpression elimination (CSE), scan through jump instructions
7287 when the target of the jump is not reached by any other path.  For
7288 example, when CSE encounters an @code{if} statement with an
7289 @code{else} clause, CSE follows the jump when the condition
7290 tested is false.
7292 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7294 @item -fcse-skip-blocks
7295 @opindex fcse-skip-blocks
7296 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
7297 follow jumps that conditionally skip over blocks.  When CSE
7298 encounters a simple @code{if} statement with no else clause,
7299 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
7300 body of the @code{if}.
7302 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7304 @item -frerun-cse-after-loop
7305 @opindex frerun-cse-after-loop
7306 Re-run common subexpression elimination after loop optimizations are
7307 performed.
7309 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7311 @item -fgcse
7312 @opindex fgcse
7313 Perform a global common subexpression elimination pass.
7314 This pass also performs global constant and copy propagation.
7316 @emph{Note:} When compiling a program using computed gotos, a GCC
7317 extension, you may get better run-time performance if you disable
7318 the global common subexpression elimination pass by adding
7319 @option{-fno-gcse} to the command line.
7321 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7323 @item -fgcse-lm
7324 @opindex fgcse-lm
7325 When @option{-fgcse-lm} is enabled, global common subexpression elimination
7326 attempts to move loads that are only killed by stores into themselves.  This
7327 allows a loop containing a load/store sequence to be changed to a load outside
7328 the loop, and a copy/store within the loop.
7330 Enabled by default when @option{-fgcse} is enabled.
7332 @item -fgcse-sm
7333 @opindex fgcse-sm
7334 When @option{-fgcse-sm} is enabled, a store motion pass is run after
7335 global common subexpression elimination.  This pass attempts to move
7336 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
7337 loops containing a load/store sequence can be changed to a load before
7338 the loop and a store after the loop.
7340 Not enabled at any optimization level.
7342 @item -fgcse-las
7343 @opindex fgcse-las
7344 When @option{-fgcse-las} is enabled, the global common subexpression
7345 elimination pass eliminates redundant loads that come after stores to the
7346 same memory location (both partial and full redundancies).
7348 Not enabled at any optimization level.
7350 @item -fgcse-after-reload
7351 @opindex fgcse-after-reload
7352 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
7353 pass is performed after reload.  The purpose of this pass is to clean up
7354 redundant spilling.
7356 @item -faggressive-loop-optimizations
7357 @opindex faggressive-loop-optimizations
7358 This option tells the loop optimizer to use language constraints to
7359 derive bounds for the number of iterations of a loop.  This assumes that
7360 loop code does not invoke undefined behavior by for example causing signed
7361 integer overflows or out-of-bound array accesses.  The bounds for the
7362 number of iterations of a loop are used to guide loop unrolling and peeling
7363 and loop exit test optimizations.
7364 This option is enabled by default.
7366 @item -funsafe-loop-optimizations
7367 @opindex funsafe-loop-optimizations
7368 This option tells the loop optimizer to assume that loop indices do not
7369 overflow, and that loops with nontrivial exit condition are not
7370 infinite.  This enables a wider range of loop optimizations even if
7371 the loop optimizer itself cannot prove that these assumptions are valid.
7372 If you use @option{-Wunsafe-loop-optimizations}, the compiler warns you
7373 if it finds this kind of loop.
7375 @item -fcrossjumping
7376 @opindex fcrossjumping
7377 Perform cross-jumping transformation.
7378 This transformation unifies equivalent code and saves code size.  The
7379 resulting code may or may not perform better than without cross-jumping.
7381 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7383 @item -fauto-inc-dec
7384 @opindex fauto-inc-dec
7385 Combine increments or decrements of addresses with memory accesses.
7386 This pass is always skipped on architectures that do not have
7387 instructions to support this.  Enabled by default at @option{-O} and
7388 higher on architectures that support this.
7390 @item -fdce
7391 @opindex fdce
7392 Perform dead code elimination (DCE) on RTL@.
7393 Enabled by default at @option{-O} and higher.
7395 @item -fdse
7396 @opindex fdse
7397 Perform dead store elimination (DSE) on RTL@.
7398 Enabled by default at @option{-O} and higher.
7400 @item -fif-conversion
7401 @opindex fif-conversion
7402 Attempt to transform conditional jumps into branch-less equivalents.  This
7403 includes use of conditional moves, min, max, set flags and abs instructions, and
7404 some tricks doable by standard arithmetics.  The use of conditional execution
7405 on chips where it is available is controlled by @code{if-conversion2}.
7407 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7409 @item -fif-conversion2
7410 @opindex fif-conversion2
7411 Use conditional execution (where available) to transform conditional jumps into
7412 branch-less equivalents.
7414 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7416 @item -fdeclone-ctor-dtor
7417 @opindex fdeclone-ctor-dtor
7418 The C++ ABI requires multiple entry points for constructors and
7419 destructors: one for a base subobject, one for a complete object, and
7420 one for a virtual destructor that calls operator delete afterwards.
7421 For a hierarchy with virtual bases, the base and complete variants are
7422 clones, which means two copies of the function.  With this option, the
7423 base and complete variants are changed to be thunks that call a common
7424 implementation.
7426 Enabled by @option{-Os}.
7428 @item -fdelete-null-pointer-checks
7429 @opindex fdelete-null-pointer-checks
7430 Assume that programs cannot safely dereference null pointers, and that
7431 no code or data element resides there.  This enables simple constant
7432 folding optimizations at all optimization levels.  In addition, other
7433 optimization passes in GCC use this flag to control global dataflow
7434 analyses that eliminate useless checks for null pointers; these assume
7435 that if a pointer is checked after it has already been dereferenced,
7436 it cannot be null.
7438 Note however that in some environments this assumption is not true.
7439 Use @option{-fno-delete-null-pointer-checks} to disable this optimization
7440 for programs that depend on that behavior.
7442 Some targets, especially embedded ones, disable this option at all levels.
7443 Otherwise it is enabled at all levels: @option{-O0}, @option{-O1},
7444 @option{-O2}, @option{-O3}, @option{-Os}.  Passes that use the information
7445 are enabled independently at different optimization levels.
7447 @item -fdevirtualize
7448 @opindex fdevirtualize
7449 Attempt to convert calls to virtual functions to direct calls.  This
7450 is done both within a procedure and interprocedurally as part of
7451 indirect inlining (@code{-findirect-inlining}) and interprocedural constant
7452 propagation (@option{-fipa-cp}).
7453 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7455 @item -fdevirtualize-speculatively
7456 @opindex fdevirtualize-speculatively
7457 Attempt to convert calls to virtual functions to speculative direct calls.
7458 Based on the analysis of the type inheritance graph, determine for a given call
7459 the set of likely targets. If the set is small, preferably of size 1, change
7460 the call into an conditional deciding on direct and indirect call.  The
7461 speculative calls enable more optimizations, such as inlining.  When they seem
7462 useless after further optimization, they are converted back into original form.
7464 @item -fexpensive-optimizations
7465 @opindex fexpensive-optimizations
7466 Perform a number of minor optimizations that are relatively expensive.
7468 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7470 @item -free
7471 @opindex free
7472 Attempt to remove redundant extension instructions.  This is especially
7473 helpful for the x86-64 architecture, which implicitly zero-extends in 64-bit
7474 registers after writing to their lower 32-bit half.
7476 Enabled for Alpha, AArch64 and x86 at levels @option{-O2},
7477 @option{-O3}, @option{-Os}.
7479 @item -flive-range-shrinkage
7480 @opindex flive-range-shrinkage
7481 Attempt to decrease register pressure through register live range
7482 shrinkage.  This is helpful for fast processors with small or moderate
7483 size register sets.
7485 @item -fira-algorithm=@var{algorithm}
7486 Use the specified coloring algorithm for the integrated register
7487 allocator.  The @var{algorithm} argument can be @samp{priority}, which
7488 specifies Chow's priority coloring, or @samp{CB}, which specifies
7489 Chaitin-Briggs coloring.  Chaitin-Briggs coloring is not implemented
7490 for all architectures, but for those targets that do support it, it is
7491 the default because it generates better code.
7493 @item -fira-region=@var{region}
7494 Use specified regions for the integrated register allocator.  The
7495 @var{region} argument should be one of the following:
7497 @table @samp
7499 @item all
7500 Use all loops as register allocation regions.
7501 This can give the best results for machines with a small and/or
7502 irregular register set.
7504 @item mixed
7505 Use all loops except for loops with small register pressure 
7506 as the regions.  This value usually gives
7507 the best results in most cases and for most architectures,
7508 and is enabled by default when compiling with optimization for speed
7509 (@option{-O}, @option{-O2}, @dots{}).
7511 @item one
7512 Use all functions as a single region.  
7513 This typically results in the smallest code size, and is enabled by default for
7514 @option{-Os} or @option{-O0}.
7516 @end table
7518 @item -fira-hoist-pressure
7519 @opindex fira-hoist-pressure
7520 Use IRA to evaluate register pressure in the code hoisting pass for
7521 decisions to hoist expressions.  This option usually results in smaller
7522 code, but it can slow the compiler down.
7524 This option is enabled at level @option{-Os} for all targets.
7526 @item -fira-loop-pressure
7527 @opindex fira-loop-pressure
7528 Use IRA to evaluate register pressure in loops for decisions to move
7529 loop invariants.  This option usually results in generation
7530 of faster and smaller code on machines with large register files (>= 32
7531 registers), but it can slow the compiler down.
7533 This option is enabled at level @option{-O3} for some targets.
7535 @item -fno-ira-share-save-slots
7536 @opindex fno-ira-share-save-slots
7537 Disable sharing of stack slots used for saving call-used hard
7538 registers living through a call.  Each hard register gets a
7539 separate stack slot, and as a result function stack frames are
7540 larger.
7542 @item -fno-ira-share-spill-slots
7543 @opindex fno-ira-share-spill-slots
7544 Disable sharing of stack slots allocated for pseudo-registers.  Each
7545 pseudo-register that does not get a hard register gets a separate
7546 stack slot, and as a result function stack frames are larger.
7548 @item -fira-verbose=@var{n}
7549 @opindex fira-verbose
7550 Control the verbosity of the dump file for the integrated register allocator.
7551 The default value is 5.  If the value @var{n} is greater or equal to 10,
7552 the dump output is sent to stderr using the same format as @var{n} minus 10.
7554 @item -fdelayed-branch
7555 @opindex fdelayed-branch
7556 If supported for the target machine, attempt to reorder instructions
7557 to exploit instruction slots available after delayed branch
7558 instructions.
7560 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7562 @item -fschedule-insns
7563 @opindex fschedule-insns
7564 If supported for the target machine, attempt to reorder instructions to
7565 eliminate execution stalls due to required data being unavailable.  This
7566 helps machines that have slow floating point or memory load instructions
7567 by allowing other instructions to be issued until the result of the load
7568 or floating-point instruction is required.
7570 Enabled at levels @option{-O2}, @option{-O3}.
7572 @item -fschedule-insns2
7573 @opindex fschedule-insns2
7574 Similar to @option{-fschedule-insns}, but requests an additional pass of
7575 instruction scheduling after register allocation has been done.  This is
7576 especially useful on machines with a relatively small number of
7577 registers and where memory load instructions take more than one cycle.
7579 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7581 @item -fno-sched-interblock
7582 @opindex fno-sched-interblock
7583 Don't schedule instructions across basic blocks.  This is normally
7584 enabled by default when scheduling before register allocation, i.e.@:
7585 with @option{-fschedule-insns} or at @option{-O2} or higher.
7587 @item -fno-sched-spec
7588 @opindex fno-sched-spec
7589 Don't allow speculative motion of non-load instructions.  This is normally
7590 enabled by default when scheduling before register allocation, i.e.@:
7591 with @option{-fschedule-insns} or at @option{-O2} or higher.
7593 @item -fsched-pressure
7594 @opindex fsched-pressure
7595 Enable register pressure sensitive insn scheduling before register
7596 allocation.  This only makes sense when scheduling before register
7597 allocation is enabled, i.e.@: with @option{-fschedule-insns} or at
7598 @option{-O2} or higher.  Usage of this option can improve the
7599 generated code and decrease its size by preventing register pressure
7600 increase above the number of available hard registers and subsequent
7601 spills in register allocation.
7603 @item -fsched-spec-load
7604 @opindex fsched-spec-load
7605 Allow speculative motion of some load instructions.  This only makes
7606 sense when scheduling before register allocation, i.e.@: with
7607 @option{-fschedule-insns} or at @option{-O2} or higher.
7609 @item -fsched-spec-load-dangerous
7610 @opindex fsched-spec-load-dangerous
7611 Allow speculative motion of more load instructions.  This only makes
7612 sense when scheduling before register allocation, i.e.@: with
7613 @option{-fschedule-insns} or at @option{-O2} or higher.
7615 @item -fsched-stalled-insns
7616 @itemx -fsched-stalled-insns=@var{n}
7617 @opindex fsched-stalled-insns
7618 Define how many insns (if any) can be moved prematurely from the queue
7619 of stalled insns into the ready list during the second scheduling pass.
7620 @option{-fno-sched-stalled-insns} means that no insns are moved
7621 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
7622 on how many queued insns can be moved prematurely.
7623 @option{-fsched-stalled-insns} without a value is equivalent to
7624 @option{-fsched-stalled-insns=1}.
7626 @item -fsched-stalled-insns-dep
7627 @itemx -fsched-stalled-insns-dep=@var{n}
7628 @opindex fsched-stalled-insns-dep
7629 Define how many insn groups (cycles) are examined for a dependency
7630 on a stalled insn that is a candidate for premature removal from the queue
7631 of stalled insns.  This has an effect only during the second scheduling pass,
7632 and only if @option{-fsched-stalled-insns} is used.
7633 @option{-fno-sched-stalled-insns-dep} is equivalent to
7634 @option{-fsched-stalled-insns-dep=0}.
7635 @option{-fsched-stalled-insns-dep} without a value is equivalent to
7636 @option{-fsched-stalled-insns-dep=1}.
7638 @item -fsched2-use-superblocks
7639 @opindex fsched2-use-superblocks
7640 When scheduling after register allocation, use superblock scheduling.
7641 This allows motion across basic block boundaries,
7642 resulting in faster schedules.  This option is experimental, as not all machine
7643 descriptions used by GCC model the CPU closely enough to avoid unreliable
7644 results from the algorithm.
7646 This only makes sense when scheduling after register allocation, i.e.@: with
7647 @option{-fschedule-insns2} or at @option{-O2} or higher.
7649 @item -fsched-group-heuristic
7650 @opindex fsched-group-heuristic
7651 Enable the group heuristic in the scheduler.  This heuristic favors
7652 the instruction that belongs to a schedule group.  This is enabled
7653 by default when scheduling is enabled, i.e.@: with @option{-fschedule-insns}
7654 or @option{-fschedule-insns2} or at @option{-O2} or higher.
7656 @item -fsched-critical-path-heuristic
7657 @opindex fsched-critical-path-heuristic
7658 Enable the critical-path heuristic in the scheduler.  This heuristic favors
7659 instructions on the critical path.  This is enabled by default when
7660 scheduling is enabled, i.e.@: with @option{-fschedule-insns}
7661 or @option{-fschedule-insns2} or at @option{-O2} or higher.
7663 @item -fsched-spec-insn-heuristic
7664 @opindex fsched-spec-insn-heuristic
7665 Enable the speculative instruction heuristic in the scheduler.  This
7666 heuristic favors speculative instructions with greater dependency weakness.
7667 This is enabled by default when scheduling is enabled, i.e.@:
7668 with @option{-fschedule-insns} or @option{-fschedule-insns2}
7669 or at @option{-O2} or higher.
7671 @item -fsched-rank-heuristic
7672 @opindex fsched-rank-heuristic
7673 Enable the rank heuristic in the scheduler.  This heuristic favors
7674 the instruction belonging to a basic block with greater size or frequency.
7675 This is enabled by default when scheduling is enabled, i.e.@:
7676 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7677 at @option{-O2} or higher.
7679 @item -fsched-last-insn-heuristic
7680 @opindex fsched-last-insn-heuristic
7681 Enable the last-instruction heuristic in the scheduler.  This heuristic
7682 favors the instruction that is less dependent on the last instruction
7683 scheduled.  This is enabled by default when scheduling is enabled,
7684 i.e.@: with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7685 at @option{-O2} or higher.
7687 @item -fsched-dep-count-heuristic
7688 @opindex fsched-dep-count-heuristic
7689 Enable the dependent-count heuristic in the scheduler.  This heuristic
7690 favors the instruction that has more instructions depending on it.
7691 This is enabled by default when scheduling is enabled, i.e.@:
7692 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7693 at @option{-O2} or higher.
7695 @item -freschedule-modulo-scheduled-loops
7696 @opindex freschedule-modulo-scheduled-loops
7697 Modulo scheduling is performed before traditional scheduling.  If a loop
7698 is modulo scheduled, later scheduling passes may change its schedule.  
7699 Use this option to control that behavior.
7701 @item -fselective-scheduling
7702 @opindex fselective-scheduling
7703 Schedule instructions using selective scheduling algorithm.  Selective
7704 scheduling runs instead of the first scheduler pass.
7706 @item -fselective-scheduling2
7707 @opindex fselective-scheduling2
7708 Schedule instructions using selective scheduling algorithm.  Selective
7709 scheduling runs instead of the second scheduler pass.
7711 @item -fsel-sched-pipelining
7712 @opindex fsel-sched-pipelining
7713 Enable software pipelining of innermost loops during selective scheduling.
7714 This option has no effect unless one of @option{-fselective-scheduling} or
7715 @option{-fselective-scheduling2} is turned on.
7717 @item -fsel-sched-pipelining-outer-loops
7718 @opindex fsel-sched-pipelining-outer-loops
7719 When pipelining loops during selective scheduling, also pipeline outer loops.
7720 This option has no effect unless @option{-fsel-sched-pipelining} is turned on.
7722 @item -fshrink-wrap
7723 @opindex fshrink-wrap
7724 Emit function prologues only before parts of the function that need it,
7725 rather than at the top of the function.  This flag is enabled by default at
7726 @option{-O} and higher.
7728 @item -fcaller-saves
7729 @opindex fcaller-saves
7730 Enable allocation of values to registers that are clobbered by
7731 function calls, by emitting extra instructions to save and restore the
7732 registers around such calls.  Such allocation is done only when it
7733 seems to result in better code.
7735 This option is always enabled by default on certain machines, usually
7736 those which have no call-preserved registers to use instead.
7738 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7740 @item -fcombine-stack-adjustments
7741 @opindex fcombine-stack-adjustments
7742 Tracks stack adjustments (pushes and pops) and stack memory references
7743 and then tries to find ways to combine them.
7745 Enabled by default at @option{-O1} and higher.
7747 @item -fconserve-stack
7748 @opindex fconserve-stack
7749 Attempt to minimize stack usage.  The compiler attempts to use less
7750 stack space, even if that makes the program slower.  This option
7751 implies setting the @option{large-stack-frame} parameter to 100
7752 and the @option{large-stack-frame-growth} parameter to 400.
7754 @item -ftree-reassoc
7755 @opindex ftree-reassoc
7756 Perform reassociation on trees.  This flag is enabled by default
7757 at @option{-O} and higher.
7759 @item -ftree-pre
7760 @opindex ftree-pre
7761 Perform partial redundancy elimination (PRE) on trees.  This flag is
7762 enabled by default at @option{-O2} and @option{-O3}.
7764 @item -ftree-partial-pre
7765 @opindex ftree-partial-pre
7766 Make partial redundancy elimination (PRE) more aggressive.  This flag is
7767 enabled by default at @option{-O3}.
7769 @item -ftree-forwprop
7770 @opindex ftree-forwprop
7771 Perform forward propagation on trees.  This flag is enabled by default
7772 at @option{-O} and higher.
7774 @item -ftree-fre
7775 @opindex ftree-fre
7776 Perform full redundancy elimination (FRE) on trees.  The difference
7777 between FRE and PRE is that FRE only considers expressions
7778 that are computed on all paths leading to the redundant computation.
7779 This analysis is faster than PRE, though it exposes fewer redundancies.
7780 This flag is enabled by default at @option{-O} and higher.
7782 @item -ftree-phiprop
7783 @opindex ftree-phiprop
7784 Perform hoisting of loads from conditional pointers on trees.  This
7785 pass is enabled by default at @option{-O} and higher.
7787 @item -fhoist-adjacent-loads
7788 @opindex hoist-adjacent-loads
7789 Speculatively hoist loads from both branches of an if-then-else if the
7790 loads are from adjacent locations in the same structure and the target
7791 architecture has a conditional move instruction.  This flag is enabled
7792 by default at @option{-O2} and higher.
7794 @item -ftree-copy-prop
7795 @opindex ftree-copy-prop
7796 Perform copy propagation on trees.  This pass eliminates unnecessary
7797 copy operations.  This flag is enabled by default at @option{-O} and
7798 higher.
7800 @item -fipa-pure-const
7801 @opindex fipa-pure-const
7802 Discover which functions are pure or constant.
7803 Enabled by default at @option{-O} and higher.
7805 @item -fipa-reference
7806 @opindex fipa-reference
7807 Discover which static variables do not escape the
7808 compilation unit.
7809 Enabled by default at @option{-O} and higher.
7811 @item -fipa-pta
7812 @opindex fipa-pta
7813 Perform interprocedural pointer analysis and interprocedural modification
7814 and reference analysis.  This option can cause excessive memory and
7815 compile-time usage on large compilation units.  It is not enabled by
7816 default at any optimization level.
7818 @item -fipa-profile
7819 @opindex fipa-profile
7820 Perform interprocedural profile propagation.  The functions called only from
7821 cold functions are marked as cold. Also functions executed once (such as
7822 @code{cold}, @code{noreturn}, static constructors or destructors) are identified. Cold
7823 functions and loop less parts of functions executed once are then optimized for
7824 size.
7825 Enabled by default at @option{-O} and higher.
7827 @item -fipa-cp
7828 @opindex fipa-cp
7829 Perform interprocedural constant propagation.
7830 This optimization analyzes the program to determine when values passed
7831 to functions are constants and then optimizes accordingly.
7832 This optimization can substantially increase performance
7833 if the application has constants passed to functions.
7834 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
7836 @item -fipa-cp-clone
7837 @opindex fipa-cp-clone
7838 Perform function cloning to make interprocedural constant propagation stronger.
7839 When enabled, interprocedural constant propagation performs function cloning
7840 when externally visible function can be called with constant arguments.
7841 Because this optimization can create multiple copies of functions,
7842 it may significantly increase code size
7843 (see @option{--param ipcp-unit-growth=@var{value}}).
7844 This flag is enabled by default at @option{-O3}.
7846 @item -fisolate-erroneous-paths-dereference
7847 Detect paths which trigger erroneous or undefined behaviour due to
7848 dereferencing a NULL pointer.  Isolate those paths from the main control
7849 flow and turn the statement with erroneous or undefined behaviour into a trap.
7851 @item -fisolate-erroneous-paths-attribute
7852 Detect paths which trigger erroneous or undefined behaviour due a NULL value
7853 being used in a way which is forbidden by a @code{returns_nonnull} or @code{nonnull}
7854 attribute.  Isolate those paths from the main control flow and turn the
7855 statement with erroneous or undefined behaviour into a trap.  This is not
7856 currently enabled, but may be enabled by @code{-O2} in the future.
7858 @item -ftree-sink
7859 @opindex ftree-sink
7860 Perform forward store motion  on trees.  This flag is
7861 enabled by default at @option{-O} and higher.
7863 @item -ftree-bit-ccp
7864 @opindex ftree-bit-ccp
7865 Perform sparse conditional bit constant propagation on trees and propagate
7866 pointer alignment information.
7867 This pass only operates on local scalar variables and is enabled by default
7868 at @option{-O} and higher.  It requires that @option{-ftree-ccp} is enabled.
7870 @item -ftree-ccp
7871 @opindex ftree-ccp
7872 Perform sparse conditional constant propagation (CCP) on trees.  This
7873 pass only operates on local scalar variables and is enabled by default
7874 at @option{-O} and higher.
7876 @item -ftree-switch-conversion
7877 Perform conversion of simple initializations in a switch to
7878 initializations from a scalar array.  This flag is enabled by default
7879 at @option{-O2} and higher.
7881 @item -ftree-tail-merge
7882 Look for identical code sequences.  When found, replace one with a jump to the
7883 other.  This optimization is known as tail merging or cross jumping.  This flag
7884 is enabled by default at @option{-O2} and higher.  The compilation time
7885 in this pass can
7886 be limited using @option{max-tail-merge-comparisons} parameter and
7887 @option{max-tail-merge-iterations} parameter.
7889 @item -ftree-dce
7890 @opindex ftree-dce
7891 Perform dead code elimination (DCE) on trees.  This flag is enabled by
7892 default at @option{-O} and higher.
7894 @item -ftree-builtin-call-dce
7895 @opindex ftree-builtin-call-dce
7896 Perform conditional dead code elimination (DCE) for calls to built-in functions
7897 that may set @code{errno} but are otherwise side-effect free.  This flag is
7898 enabled by default at @option{-O2} and higher if @option{-Os} is not also
7899 specified.
7901 @item -ftree-dominator-opts
7902 @opindex ftree-dominator-opts
7903 Perform a variety of simple scalar cleanups (constant/copy
7904 propagation, redundancy elimination, range propagation and expression
7905 simplification) based on a dominator tree traversal.  This also
7906 performs jump threading (to reduce jumps to jumps). This flag is
7907 enabled by default at @option{-O} and higher.
7909 @item -ftree-dse
7910 @opindex ftree-dse
7911 Perform dead store elimination (DSE) on trees.  A dead store is a store into
7912 a memory location that is later overwritten by another store without
7913 any intervening loads.  In this case the earlier store can be deleted.  This
7914 flag is enabled by default at @option{-O} and higher.
7916 @item -ftree-ch
7917 @opindex ftree-ch
7918 Perform loop header copying on trees.  This is beneficial since it increases
7919 effectiveness of code motion optimizations.  It also saves one jump.  This flag
7920 is enabled by default at @option{-O} and higher.  It is not enabled
7921 for @option{-Os}, since it usually increases code size.
7923 @item -ftree-loop-optimize
7924 @opindex ftree-loop-optimize
7925 Perform loop optimizations on trees.  This flag is enabled by default
7926 at @option{-O} and higher.
7928 @item -ftree-loop-linear
7929 @opindex ftree-loop-linear
7930 Perform loop interchange transformations on tree.  Same as
7931 @option{-floop-interchange}.  To use this code transformation, GCC has
7932 to be configured with @option{--with-ppl} and @option{--with-cloog} to
7933 enable the Graphite loop transformation infrastructure.
7935 @item -floop-interchange
7936 @opindex floop-interchange
7937 Perform loop interchange transformations on loops.  Interchanging two
7938 nested loops switches the inner and outer loops.  For example, given a
7939 loop like:
7940 @smallexample
7941 DO J = 1, M
7942   DO I = 1, N
7943     A(J, I) = A(J, I) * C
7944   ENDDO
7945 ENDDO
7946 @end smallexample
7947 loop interchange transforms the loop as if it were written:
7948 @smallexample
7949 DO I = 1, N
7950   DO J = 1, M
7951     A(J, I) = A(J, I) * C
7952   ENDDO
7953 ENDDO
7954 @end smallexample
7955 which can be beneficial when @code{N} is larger than the caches,
7956 because in Fortran, the elements of an array are stored in memory
7957 contiguously by column, and the original loop iterates over rows,
7958 potentially creating at each access a cache miss.  This optimization
7959 applies to all the languages supported by GCC and is not limited to
7960 Fortran.  To use this code transformation, GCC has to be configured
7961 with @option{--with-ppl} and @option{--with-cloog} to enable the
7962 Graphite loop transformation infrastructure.
7964 @item -floop-strip-mine
7965 @opindex floop-strip-mine
7966 Perform loop strip mining transformations on loops.  Strip mining
7967 splits a loop into two nested loops.  The outer loop has strides
7968 equal to the strip size and the inner loop has strides of the
7969 original loop within a strip.  The strip length can be changed
7970 using the @option{loop-block-tile-size} parameter.  For example,
7971 given a loop like:
7972 @smallexample
7973 DO I = 1, N
7974   A(I) = A(I) + C
7975 ENDDO
7976 @end smallexample
7977 loop strip mining transforms the loop as if it were written:
7978 @smallexample
7979 DO II = 1, N, 51
7980   DO I = II, min (II + 50, N)
7981     A(I) = A(I) + C
7982   ENDDO
7983 ENDDO
7984 @end smallexample
7985 This optimization applies to all the languages supported by GCC and is
7986 not limited to Fortran.  To use this code transformation, GCC has to
7987 be configured with @option{--with-ppl} and @option{--with-cloog} to
7988 enable the Graphite loop transformation infrastructure.
7990 @item -floop-block
7991 @opindex floop-block
7992 Perform loop blocking transformations on loops.  Blocking strip mines
7993 each loop in the loop nest such that the memory accesses of the
7994 element loops fit inside caches.  The strip length can be changed
7995 using the @option{loop-block-tile-size} parameter.  For example, given
7996 a loop like:
7997 @smallexample
7998 DO I = 1, N
7999   DO J = 1, M
8000     A(J, I) = B(I) + C(J)
8001   ENDDO
8002 ENDDO
8003 @end smallexample
8004 loop blocking transforms the loop as if it were written:
8005 @smallexample
8006 DO II = 1, N, 51
8007   DO JJ = 1, M, 51
8008     DO I = II, min (II + 50, N)
8009       DO J = JJ, min (JJ + 50, M)
8010         A(J, I) = B(I) + C(J)
8011       ENDDO
8012     ENDDO
8013   ENDDO
8014 ENDDO
8015 @end smallexample
8016 which can be beneficial when @code{M} is larger than the caches,
8017 because the innermost loop iterates over a smaller amount of data
8018 which can be kept in the caches.  This optimization applies to all the
8019 languages supported by GCC and is not limited to Fortran.  To use this
8020 code transformation, GCC has to be configured with @option{--with-ppl}
8021 and @option{--with-cloog} to enable the Graphite loop transformation
8022 infrastructure.
8024 @item -fgraphite-identity
8025 @opindex fgraphite-identity
8026 Enable the identity transformation for graphite.  For every SCoP we generate
8027 the polyhedral representation and transform it back to gimple.  Using
8028 @option{-fgraphite-identity} we can check the costs or benefits of the
8029 GIMPLE -> GRAPHITE -> GIMPLE transformation.  Some minimal optimizations
8030 are also performed by the code generator CLooG, like index splitting and
8031 dead code elimination in loops.
8033 @item -floop-nest-optimize
8034 @opindex floop-nest-optimize
8035 Enable the ISL based loop nest optimizer.  This is a generic loop nest
8036 optimizer based on the Pluto optimization algorithms.  It calculates a loop
8037 structure optimized for data-locality and parallelism.  This option
8038 is experimental.
8040 @item -floop-parallelize-all
8041 @opindex floop-parallelize-all
8042 Use the Graphite data dependence analysis to identify loops that can
8043 be parallelized.  Parallelize all the loops that can be analyzed to
8044 not contain loop carried dependences without checking that it is
8045 profitable to parallelize the loops.
8047 @item -fcheck-data-deps
8048 @opindex fcheck-data-deps
8049 Compare the results of several data dependence analyzers.  This option
8050 is used for debugging the data dependence analyzers.
8052 @item -ftree-loop-if-convert
8053 Attempt to transform conditional jumps in the innermost loops to
8054 branch-less equivalents.  The intent is to remove control-flow from
8055 the innermost loops in order to improve the ability of the
8056 vectorization pass to handle these loops.  This is enabled by default
8057 if vectorization is enabled.
8059 @item -ftree-loop-if-convert-stores
8060 Attempt to also if-convert conditional jumps containing memory writes.
8061 This transformation can be unsafe for multi-threaded programs as it
8062 transforms conditional memory writes into unconditional memory writes.
8063 For example,
8064 @smallexample
8065 for (i = 0; i < N; i++)
8066   if (cond)
8067     A[i] = expr;
8068 @end smallexample
8069 is transformed to
8070 @smallexample
8071 for (i = 0; i < N; i++)
8072   A[i] = cond ? expr : A[i];
8073 @end smallexample
8074 potentially producing data races.
8076 @item -ftree-loop-distribution
8077 Perform loop distribution.  This flag can improve cache performance on
8078 big loop bodies and allow further loop optimizations, like
8079 parallelization or vectorization, to take place.  For example, the loop
8080 @smallexample
8081 DO I = 1, N
8082   A(I) = B(I) + C
8083   D(I) = E(I) * F
8084 ENDDO
8085 @end smallexample
8086 is transformed to
8087 @smallexample
8088 DO I = 1, N
8089    A(I) = B(I) + C
8090 ENDDO
8091 DO I = 1, N
8092    D(I) = E(I) * F
8093 ENDDO
8094 @end smallexample
8096 @item -ftree-loop-distribute-patterns
8097 Perform loop distribution of patterns that can be code generated with
8098 calls to a library.  This flag is enabled by default at @option{-O3}.
8100 This pass distributes the initialization loops and generates a call to
8101 memset zero.  For example, the loop
8102 @smallexample
8103 DO I = 1, N
8104   A(I) = 0
8105   B(I) = A(I) + I
8106 ENDDO
8107 @end smallexample
8108 is transformed to
8109 @smallexample
8110 DO I = 1, N
8111    A(I) = 0
8112 ENDDO
8113 DO I = 1, N
8114    B(I) = A(I) + I
8115 ENDDO
8116 @end smallexample
8117 and the initialization loop is transformed into a call to memset zero.
8119 @item -ftree-loop-im
8120 @opindex ftree-loop-im
8121 Perform loop invariant motion on trees.  This pass moves only invariants that
8122 are hard to handle at RTL level (function calls, operations that expand to
8123 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
8124 operands of conditions that are invariant out of the loop, so that we can use
8125 just trivial invariantness analysis in loop unswitching.  The pass also includes
8126 store motion.
8128 @item -ftree-loop-ivcanon
8129 @opindex ftree-loop-ivcanon
8130 Create a canonical counter for number of iterations in loops for which
8131 determining number of iterations requires complicated analysis.  Later
8132 optimizations then may determine the number easily.  Useful especially
8133 in connection with unrolling.
8135 @item -fivopts
8136 @opindex fivopts
8137 Perform induction variable optimizations (strength reduction, induction
8138 variable merging and induction variable elimination) on trees.
8140 @item -ftree-parallelize-loops=n
8141 @opindex ftree-parallelize-loops
8142 Parallelize loops, i.e., split their iteration space to run in n threads.
8143 This is only possible for loops whose iterations are independent
8144 and can be arbitrarily reordered.  The optimization is only
8145 profitable on multiprocessor machines, for loops that are CPU-intensive,
8146 rather than constrained e.g.@: by memory bandwidth.  This option
8147 implies @option{-pthread}, and thus is only supported on targets
8148 that have support for @option{-pthread}.
8150 @item -ftree-pta
8151 @opindex ftree-pta
8152 Perform function-local points-to analysis on trees.  This flag is
8153 enabled by default at @option{-O} and higher.
8155 @item -ftree-sra
8156 @opindex ftree-sra
8157 Perform scalar replacement of aggregates.  This pass replaces structure
8158 references with scalars to prevent committing structures to memory too
8159 early.  This flag is enabled by default at @option{-O} and higher.
8161 @item -ftree-copyrename
8162 @opindex ftree-copyrename
8163 Perform copy renaming on trees.  This pass attempts to rename compiler
8164 temporaries to other variables at copy locations, usually resulting in
8165 variable names which more closely resemble the original variables.  This flag
8166 is enabled by default at @option{-O} and higher.
8168 @item -ftree-coalesce-inlined-vars
8169 @opindex ftree-coalesce-inlined-vars
8170 Tell the copyrename pass (see @option{-ftree-copyrename}) to attempt to
8171 combine small user-defined variables too, but only if they were inlined
8172 from other functions.  It is a more limited form of
8173 @option{-ftree-coalesce-vars}.  This may harm debug information of such
8174 inlined variables, but it will keep variables of the inlined-into
8175 function apart from each other, such that they are more likely to
8176 contain the expected values in a debugging session.  This was the
8177 default in GCC versions older than 4.7.
8179 @item -ftree-coalesce-vars
8180 @opindex ftree-coalesce-vars
8181 Tell the copyrename pass (see @option{-ftree-copyrename}) to attempt to
8182 combine small user-defined variables too, instead of just compiler
8183 temporaries.  This may severely limit the ability to debug an optimized
8184 program compiled with @option{-fno-var-tracking-assignments}.  In the
8185 negated form, this flag prevents SSA coalescing of user variables,
8186 including inlined ones.  This option is enabled by default.
8188 @item -ftree-ter
8189 @opindex ftree-ter
8190 Perform temporary expression replacement during the SSA->normal phase.  Single
8191 use/single def temporaries are replaced at their use location with their
8192 defining expression.  This results in non-GIMPLE code, but gives the expanders
8193 much more complex trees to work on resulting in better RTL generation.  This is
8194 enabled by default at @option{-O} and higher.
8196 @item -ftree-slsr
8197 @opindex ftree-slsr
8198 Perform straight-line strength reduction on trees.  This recognizes related
8199 expressions involving multiplications and replaces them by less expensive
8200 calculations when possible.  This is enabled by default at @option{-O} and
8201 higher.
8203 @item -ftree-vectorize
8204 @opindex ftree-vectorize
8205 Perform vectorization on trees. This flag enables @option{-ftree-loop-vectorize}
8206 and @option{-ftree-slp-vectorize} if not explicitly specified.
8208 @item -ftree-loop-vectorize
8209 @opindex ftree-loop-vectorize
8210 Perform loop vectorization on trees. This flag is enabled by default at
8211 @option{-O3} and when @option{-ftree-vectorize} is enabled.
8213 @item -ftree-slp-vectorize
8214 @opindex ftree-slp-vectorize
8215 Perform basic block vectorization on trees. This flag is enabled by default at
8216 @option{-O3} and when @option{-ftree-vectorize} is enabled.
8218 @item -fvect-cost-model=@var{model}
8219 @opindex fvect-cost-model
8220 Alter the cost model used for vectorization.  The @var{model} argument
8221 should be one of @code{unlimited}, @code{dynamic} or @code{cheap}.
8222 With the @code{unlimited} model the vectorized code-path is assumed
8223 to be profitable while with the @code{dynamic} model a runtime check
8224 will guard the vectorized code-path to enable it only for iteration
8225 counts that will likely execute faster than when executing the original
8226 scalar loop.  The @code{cheap} model will disable vectorization of
8227 loops where doing so would be cost prohibitive for example due to
8228 required runtime checks for data dependence or alignment but otherwise
8229 is equal to the @code{dynamic} model.
8230 The default cost model depends on other optimization flags and is
8231 either @code{dynamic} or @code{cheap}.
8233 @item -fsimd-cost-model=@var{model}
8234 @opindex fsimd-cost-model
8235 Alter the cost model used for vectorization of loops marked with the OpenMP
8236 or Cilk Plus simd directive.  The @var{model} argument should be one of
8237 @code{unlimited}, @code{dynamic}, @code{cheap}.  All values of @var{model}
8238 have the same meaning as described in @option{-fvect-cost-model} and by
8239 default a cost model defined with @option{-fvect-cost-model} is used.
8241 @item -ftree-vrp
8242 @opindex ftree-vrp
8243 Perform Value Range Propagation on trees.  This is similar to the
8244 constant propagation pass, but instead of values, ranges of values are
8245 propagated.  This allows the optimizers to remove unnecessary range
8246 checks like array bound checks and null pointer checks.  This is
8247 enabled by default at @option{-O2} and higher.  Null pointer check
8248 elimination is only done if @option{-fdelete-null-pointer-checks} is
8249 enabled.
8251 @item -ftracer
8252 @opindex ftracer
8253 Perform tail duplication to enlarge superblock size.  This transformation
8254 simplifies the control flow of the function allowing other optimizations to do
8255 a better job.
8257 @item -funroll-loops
8258 @opindex funroll-loops
8259 Unroll loops whose number of iterations can be determined at compile
8260 time or upon entry to the loop.  @option{-funroll-loops} implies
8261 @option{-frerun-cse-after-loop}.  This option makes code larger,
8262 and may or may not make it run faster.
8264 @item -funroll-all-loops
8265 @opindex funroll-all-loops
8266 Unroll all loops, even if their number of iterations is uncertain when
8267 the loop is entered.  This usually makes programs run more slowly.
8268 @option{-funroll-all-loops} implies the same options as
8269 @option{-funroll-loops},
8271 @item -fsplit-ivs-in-unroller
8272 @opindex fsplit-ivs-in-unroller
8273 Enables expression of values of induction variables in later iterations
8274 of the unrolled loop using the value in the first iteration.  This breaks
8275 long dependency chains, thus improving efficiency of the scheduling passes.
8277 A combination of @option{-fweb} and CSE is often sufficient to obtain the
8278 same effect.  However, that is not reliable in cases where the loop body
8279 is more complicated than a single basic block.  It also does not work at all
8280 on some architectures due to restrictions in the CSE pass.
8282 This optimization is enabled by default.
8284 @item -fvariable-expansion-in-unroller
8285 @opindex fvariable-expansion-in-unroller
8286 With this option, the compiler creates multiple copies of some
8287 local variables when unrolling a loop, which can result in superior code.
8289 @item -fpartial-inlining
8290 @opindex fpartial-inlining
8291 Inline parts of functions.  This option has any effect only
8292 when inlining itself is turned on by the @option{-finline-functions}
8293 or @option{-finline-small-functions} options.
8295 Enabled at level @option{-O2}.
8297 @item -fpredictive-commoning
8298 @opindex fpredictive-commoning
8299 Perform predictive commoning optimization, i.e., reusing computations
8300 (especially memory loads and stores) performed in previous
8301 iterations of loops.
8303 This option is enabled at level @option{-O3}.
8305 @item -fprefetch-loop-arrays
8306 @opindex fprefetch-loop-arrays
8307 If supported by the target machine, generate instructions to prefetch
8308 memory to improve the performance of loops that access large arrays.
8310 This option may generate better or worse code; results are highly
8311 dependent on the structure of loops within the source code.
8313 Disabled at level @option{-Os}.
8315 @item -fno-peephole
8316 @itemx -fno-peephole2
8317 @opindex fno-peephole
8318 @opindex fno-peephole2
8319 Disable any machine-specific peephole optimizations.  The difference
8320 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
8321 are implemented in the compiler; some targets use one, some use the
8322 other, a few use both.
8324 @option{-fpeephole} is enabled by default.
8325 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8327 @item -fno-guess-branch-probability
8328 @opindex fno-guess-branch-probability
8329 Do not guess branch probabilities using heuristics.
8331 GCC uses heuristics to guess branch probabilities if they are
8332 not provided by profiling feedback (@option{-fprofile-arcs}).  These
8333 heuristics are based on the control flow graph.  If some branch probabilities
8334 are specified by @samp{__builtin_expect}, then the heuristics are
8335 used to guess branch probabilities for the rest of the control flow graph,
8336 taking the @samp{__builtin_expect} info into account.  The interactions
8337 between the heuristics and @samp{__builtin_expect} can be complex, and in
8338 some cases, it may be useful to disable the heuristics so that the effects
8339 of @samp{__builtin_expect} are easier to understand.
8341 The default is @option{-fguess-branch-probability} at levels
8342 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8344 @item -freorder-blocks
8345 @opindex freorder-blocks
8346 Reorder basic blocks in the compiled function in order to reduce number of
8347 taken branches and improve code locality.
8349 Enabled at levels @option{-O2}, @option{-O3}.
8351 @item -freorder-blocks-and-partition
8352 @opindex freorder-blocks-and-partition
8353 In addition to reordering basic blocks in the compiled function, in order
8354 to reduce number of taken branches, partitions hot and cold basic blocks
8355 into separate sections of the assembly and .o files, to improve
8356 paging and cache locality performance.
8358 This optimization is automatically turned off in the presence of
8359 exception handling, for linkonce sections, for functions with a user-defined
8360 section attribute and on any architecture that does not support named
8361 sections.
8363 Enabled for x86 at levels @option{-O2}, @option{-O3}.
8365 @item -freorder-functions
8366 @opindex freorder-functions
8367 Reorder functions in the object file in order to
8368 improve code locality.  This is implemented by using special
8369 subsections @code{.text.hot} for most frequently executed functions and
8370 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
8371 the linker so object file format must support named sections and linker must
8372 place them in a reasonable way.
8374 Also profile feedback must be available to make this option effective.  See
8375 @option{-fprofile-arcs} for details.
8377 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8379 @item -fstrict-aliasing
8380 @opindex fstrict-aliasing
8381 Allow the compiler to assume the strictest aliasing rules applicable to
8382 the language being compiled.  For C (and C++), this activates
8383 optimizations based on the type of expressions.  In particular, an
8384 object of one type is assumed never to reside at the same address as an
8385 object of a different type, unless the types are almost the same.  For
8386 example, an @code{unsigned int} can alias an @code{int}, but not a
8387 @code{void*} or a @code{double}.  A character type may alias any other
8388 type.
8390 @anchor{Type-punning}Pay special attention to code like this:
8391 @smallexample
8392 union a_union @{
8393   int i;
8394   double d;
8397 int f() @{
8398   union a_union t;
8399   t.d = 3.0;
8400   return t.i;
8402 @end smallexample
8403 The practice of reading from a different union member than the one most
8404 recently written to (called ``type-punning'') is common.  Even with
8405 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
8406 is accessed through the union type.  So, the code above works as
8407 expected.  @xref{Structures unions enumerations and bit-fields
8408 implementation}.  However, this code might not:
8409 @smallexample
8410 int f() @{
8411   union a_union t;
8412   int* ip;
8413   t.d = 3.0;
8414   ip = &t.i;
8415   return *ip;
8417 @end smallexample
8419 Similarly, access by taking the address, casting the resulting pointer
8420 and dereferencing the result has undefined behavior, even if the cast
8421 uses a union type, e.g.:
8422 @smallexample
8423 int f() @{
8424   double d = 3.0;
8425   return ((union a_union *) &d)->i;
8427 @end smallexample
8429 The @option{-fstrict-aliasing} option is enabled at levels
8430 @option{-O2}, @option{-O3}, @option{-Os}.
8432 @item -fstrict-overflow
8433 @opindex fstrict-overflow
8434 Allow the compiler to assume strict signed overflow rules, depending
8435 on the language being compiled.  For C (and C++) this means that
8436 overflow when doing arithmetic with signed numbers is undefined, which
8437 means that the compiler may assume that it does not happen.  This
8438 permits various optimizations.  For example, the compiler assumes
8439 that an expression like @code{i + 10 > i} is always true for
8440 signed @code{i}.  This assumption is only valid if signed overflow is
8441 undefined, as the expression is false if @code{i + 10} overflows when
8442 using twos complement arithmetic.  When this option is in effect any
8443 attempt to determine whether an operation on signed numbers 
8444 overflows must be written carefully to not actually involve overflow.
8446 This option also allows the compiler to assume strict pointer
8447 semantics: given a pointer to an object, if adding an offset to that
8448 pointer does not produce a pointer to the same object, the addition is
8449 undefined.  This permits the compiler to conclude that @code{p + u >
8450 p} is always true for a pointer @code{p} and unsigned integer
8451 @code{u}.  This assumption is only valid because pointer wraparound is
8452 undefined, as the expression is false if @code{p + u} overflows using
8453 twos complement arithmetic.
8455 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
8456 that integer signed overflow is fully defined: it wraps.  When
8457 @option{-fwrapv} is used, there is no difference between
8458 @option{-fstrict-overflow} and @option{-fno-strict-overflow} for
8459 integers.  With @option{-fwrapv} certain types of overflow are
8460 permitted.  For example, if the compiler gets an overflow when doing
8461 arithmetic on constants, the overflowed value can still be used with
8462 @option{-fwrapv}, but not otherwise.
8464 The @option{-fstrict-overflow} option is enabled at levels
8465 @option{-O2}, @option{-O3}, @option{-Os}.
8467 @item -falign-functions
8468 @itemx -falign-functions=@var{n}
8469 @opindex falign-functions
8470 Align the start of functions to the next power-of-two greater than
8471 @var{n}, skipping up to @var{n} bytes.  For instance,
8472 @option{-falign-functions=32} aligns functions to the next 32-byte
8473 boundary, but @option{-falign-functions=24} aligns to the next
8474 32-byte boundary only if this can be done by skipping 23 bytes or less.
8476 @option{-fno-align-functions} and @option{-falign-functions=1} are
8477 equivalent and mean that functions are not aligned.
8479 Some assemblers only support this flag when @var{n} is a power of two;
8480 in that case, it is rounded up.
8482 If @var{n} is not specified or is zero, use a machine-dependent default.
8484 Enabled at levels @option{-O2}, @option{-O3}.
8486 @item -falign-labels
8487 @itemx -falign-labels=@var{n}
8488 @opindex falign-labels
8489 Align all branch targets to a power-of-two boundary, skipping up to
8490 @var{n} bytes like @option{-falign-functions}.  This option can easily
8491 make code slower, because it must insert dummy operations for when the
8492 branch target is reached in the usual flow of the code.
8494 @option{-fno-align-labels} and @option{-falign-labels=1} are
8495 equivalent and mean that labels are not aligned.
8497 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
8498 are greater than this value, then their values are used instead.
8500 If @var{n} is not specified or is zero, use a machine-dependent default
8501 which is very likely to be @samp{1}, meaning no alignment.
8503 Enabled at levels @option{-O2}, @option{-O3}.
8505 @item -falign-loops
8506 @itemx -falign-loops=@var{n}
8507 @opindex falign-loops
8508 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
8509 like @option{-falign-functions}.  If the loops are
8510 executed many times, this makes up for any execution of the dummy
8511 operations.
8513 @option{-fno-align-loops} and @option{-falign-loops=1} are
8514 equivalent and mean that loops are not aligned.
8516 If @var{n} is not specified or is zero, use a machine-dependent default.
8518 Enabled at levels @option{-O2}, @option{-O3}.
8520 @item -falign-jumps
8521 @itemx -falign-jumps=@var{n}
8522 @opindex falign-jumps
8523 Align branch targets to a power-of-two boundary, for branch targets
8524 where the targets can only be reached by jumping, skipping up to @var{n}
8525 bytes like @option{-falign-functions}.  In this case, no dummy operations
8526 need be executed.
8528 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
8529 equivalent and mean that loops are not aligned.
8531 If @var{n} is not specified or is zero, use a machine-dependent default.
8533 Enabled at levels @option{-O2}, @option{-O3}.
8535 @item -funit-at-a-time
8536 @opindex funit-at-a-time
8537 This option is left for compatibility reasons. @option{-funit-at-a-time}
8538 has no effect, while @option{-fno-unit-at-a-time} implies
8539 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
8541 Enabled by default.
8543 @item -fno-toplevel-reorder
8544 @opindex fno-toplevel-reorder
8545 Do not reorder top-level functions, variables, and @code{asm}
8546 statements.  Output them in the same order that they appear in the
8547 input file.  When this option is used, unreferenced static variables
8548 are not removed.  This option is intended to support existing code
8549 that relies on a particular ordering.  For new code, it is better to
8550 use attributes when possible.
8552 Enabled at level @option{-O0}.  When disabled explicitly, it also implies
8553 @option{-fno-section-anchors}, which is otherwise enabled at @option{-O0} on some
8554 targets.
8556 @item -fweb
8557 @opindex fweb
8558 Constructs webs as commonly used for register allocation purposes and assign
8559 each web individual pseudo register.  This allows the register allocation pass
8560 to operate on pseudos directly, but also strengthens several other optimization
8561 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
8562 however, make debugging impossible, since variables no longer stay in a
8563 ``home register''.
8565 Enabled by default with @option{-funroll-loops}.
8567 @item -fwhole-program
8568 @opindex fwhole-program
8569 Assume that the current compilation unit represents the whole program being
8570 compiled.  All public functions and variables with the exception of @code{main}
8571 and those merged by attribute @code{externally_visible} become static functions
8572 and in effect are optimized more aggressively by interprocedural optimizers.
8574 This option should not be used in combination with @code{-flto}.
8575 Instead relying on a linker plugin should provide safer and more precise
8576 information.
8578 @item -flto[=@var{n}]
8579 @opindex flto
8580 This option runs the standard link-time optimizer.  When invoked
8581 with source code, it generates GIMPLE (one of GCC's internal
8582 representations) and writes it to special ELF sections in the object
8583 file.  When the object files are linked together, all the function
8584 bodies are read from these ELF sections and instantiated as if they
8585 had been part of the same translation unit.
8587 To use the link-time optimizer, @option{-flto} and optimization
8588 options should be specified at compile time and during the final link.
8589 For example:
8591 @smallexample
8592 gcc -c -O2 -flto foo.c
8593 gcc -c -O2 -flto bar.c
8594 gcc -o myprog -flto -O2 foo.o bar.o
8595 @end smallexample
8597 The first two invocations to GCC save a bytecode representation
8598 of GIMPLE into special ELF sections inside @file{foo.o} and
8599 @file{bar.o}.  The final invocation reads the GIMPLE bytecode from
8600 @file{foo.o} and @file{bar.o}, merges the two files into a single
8601 internal image, and compiles the result as usual.  Since both
8602 @file{foo.o} and @file{bar.o} are merged into a single image, this
8603 causes all the interprocedural analyses and optimizations in GCC to
8604 work across the two files as if they were a single one.  This means,
8605 for example, that the inliner is able to inline functions in
8606 @file{bar.o} into functions in @file{foo.o} and vice-versa.
8608 Another (simpler) way to enable link-time optimization is:
8610 @smallexample
8611 gcc -o myprog -flto -O2 foo.c bar.c
8612 @end smallexample
8614 The above generates bytecode for @file{foo.c} and @file{bar.c},
8615 merges them together into a single GIMPLE representation and optimizes
8616 them as usual to produce @file{myprog}.
8618 The only important thing to keep in mind is that to enable link-time
8619 optimizations you need to use the GCC driver to perform the link-step.
8620 GCC then automatically performs link-time optimization if any of the
8621 objects involved were compiled with the @option{-flto}.  You generally
8622 should specify the optimization options to be used for link-time
8623 optimization though GCC will try to be clever at guessing an
8624 optimization level to use from the options used at compile-time
8625 if you fail to specify one at link-time.  You can always override
8626 the automatic decision to do link-time optimization at link-time
8627 by passing @option{-fno-lto} to the link command.
8629 To make whole program optimization effective, it is necessary to make
8630 certain whole program assumptions.  The compiler needs to know
8631 what functions and variables can be accessed by libraries and runtime
8632 outside of the link-time optimized unit.  When supported by the linker,
8633 the linker plugin (see @option{-fuse-linker-plugin}) passes information
8634 to the compiler about used and externally visible symbols.  When
8635 the linker plugin is not available, @option{-fwhole-program} should be
8636 used to allow the compiler to make these assumptions, which leads
8637 to more aggressive optimization decisions.
8639 When @option{-fuse-linker-plugin} is not enabled then, when a file is
8640 compiled with @option{-flto}, the generated object file is larger than
8641 a regular object file because it contains GIMPLE bytecodes and the usual
8642 final code (see @option{-ffat-lto-objects}.  This means that
8643 object files with LTO information can be linked as normal object
8644 files; if @option{-fno-lto} is passed to the linker, no
8645 interprocedural optimizations are applied.  Note that when
8646 @option{-fno-fat-lto-objects} is enabled the compile-stage is faster
8647 but you cannot perform a regular, non-LTO link on them.
8649 Additionally, the optimization flags used to compile individual files
8650 are not necessarily related to those used at link time.  For instance,
8652 @smallexample
8653 gcc -c -O0 -ffat-lto-objects -flto foo.c
8654 gcc -c -O0 -ffat-lto-objects -flto bar.c
8655 gcc -o myprog -O3 foo.o bar.o
8656 @end smallexample
8658 This produces individual object files with unoptimized assembler
8659 code, but the resulting binary @file{myprog} is optimized at
8660 @option{-O3}.  If, instead, the final binary is generated with
8661 @option{-fno-lto}, then @file{myprog} is not optimized.
8663 When producing the final binary, GCC only
8664 applies link-time optimizations to those files that contain bytecode.
8665 Therefore, you can mix and match object files and libraries with
8666 GIMPLE bytecodes and final object code.  GCC automatically selects
8667 which files to optimize in LTO mode and which files to link without
8668 further processing.
8670 There are some code generation flags preserved by GCC when
8671 generating bytecodes, as they need to be used during the final link
8672 stage.  Generally options specified at link-time override those
8673 specified at compile-time.
8675 If you do not specify an optimization level option @option{-O} at
8676 link-time then GCC will compute one based on the optimization levels
8677 used when compiling the object files.  The highest optimization
8678 level will win here.
8680 Currently, the following options and their setting are take from
8681 the first object file that explicitely specified it: 
8682 @option{-fPIC}, @option{-fpic}, @option{-fpie}, @option{-fcommon},
8683 @option{-fexceptions}, @option{-fnon-call-exceptions}, @option{-fgnu-tm}
8684 and all the @option{-m} target flags.
8686 Certain ABI changing flags are required to match in all compilation-units
8687 and trying to override this at link-time with a conflicting value
8688 is ignored.  This includes options such as @option{-freg-struct-return}
8689 and @option{-fpcc-struct-return}. 
8691 Other options such as @option{-ffp-contract}, @option{-fno-strict-overflow},
8692 @option{-fwrapv}, @option{-fno-trapv} or @option{-fno-strict-aliasing}
8693 are passed through to the link stage and merged conservatively for
8694 conflicting translation units.  Specifically
8695 @option{-fno-strict-overflow}, @option{-fwrapv} and @option{-fno-trapv} take
8696 precedence and for example @option{-ffp-contract=off} takes precedence
8697 over @option{-ffp-contract=fast}.  You can override them at linke-time.
8699 It is recommended that you compile all the files participating in the
8700 same link with the same options and also specify those options at
8701 link time.
8703 If LTO encounters objects with C linkage declared with incompatible
8704 types in separate translation units to be linked together (undefined
8705 behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be
8706 issued.  The behavior is still undefined at run time.  Similar
8707 diagnostics may be raised for other languages.
8709 Another feature of LTO is that it is possible to apply interprocedural
8710 optimizations on files written in different languages:
8712 @smallexample
8713 gcc -c -flto foo.c
8714 g++ -c -flto bar.cc
8715 gfortran -c -flto baz.f90
8716 g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
8717 @end smallexample
8719 Notice that the final link is done with @command{g++} to get the C++
8720 runtime libraries and @option{-lgfortran} is added to get the Fortran
8721 runtime libraries.  In general, when mixing languages in LTO mode, you
8722 should use the same link command options as when mixing languages in a
8723 regular (non-LTO) compilation.
8725 If object files containing GIMPLE bytecode are stored in a library archive, say
8726 @file{libfoo.a}, it is possible to extract and use them in an LTO link if you
8727 are using a linker with plugin support.  To create static libraries suitable
8728 for LTO, use @command{gcc-ar} and @command{gcc-ranlib} instead of @command{ar}
8729 and @code{ranlib}; to show the symbols of object files with GIMPLE bytecode, use
8730 @command{gcc-nm}.  Those commands require that @command{ar}, @command{ranlib}
8731 and @command{nm} have been compiled with plugin support.  At link time, use the the
8732 flag @option{-fuse-linker-plugin} to ensure that the library participates in
8733 the LTO optimization process:
8735 @smallexample
8736 gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
8737 @end smallexample
8739 With the linker plugin enabled, the linker extracts the needed
8740 GIMPLE files from @file{libfoo.a} and passes them on to the running GCC
8741 to make them part of the aggregated GIMPLE image to be optimized.
8743 If you are not using a linker with plugin support and/or do not
8744 enable the linker plugin, then the objects inside @file{libfoo.a}
8745 are extracted and linked as usual, but they do not participate
8746 in the LTO optimization process.  In order to make a static library suitable
8747 for both LTO optimization and usual linkage, compile its object files with
8748 @option{-flto} @code{-ffat-lto-objects}.
8750 Link-time optimizations do not require the presence of the whole program to
8751 operate.  If the program does not require any symbols to be exported, it is
8752 possible to combine @option{-flto} and @option{-fwhole-program} to allow
8753 the interprocedural optimizers to use more aggressive assumptions which may
8754 lead to improved optimization opportunities.
8755 Use of @option{-fwhole-program} is not needed when linker plugin is
8756 active (see @option{-fuse-linker-plugin}).
8758 The current implementation of LTO makes no
8759 attempt to generate bytecode that is portable between different
8760 types of hosts.  The bytecode files are versioned and there is a
8761 strict version check, so bytecode files generated in one version of
8762 GCC will not work with an older or newer version of GCC.
8764 Link-time optimization does not work well with generation of debugging
8765 information.  Combining @option{-flto} with
8766 @option{-g} is currently experimental and expected to produce unexpected
8767 results.
8769 If you specify the optional @var{n}, the optimization and code
8770 generation done at link time is executed in parallel using @var{n}
8771 parallel jobs by utilizing an installed @command{make} program.  The
8772 environment variable @env{MAKE} may be used to override the program
8773 used.  The default value for @var{n} is 1.
8775 You can also specify @option{-flto=jobserver} to use GNU make's
8776 job server mode to determine the number of parallel jobs. This
8777 is useful when the Makefile calling GCC is already executing in parallel.
8778 You must prepend a @samp{+} to the command recipe in the parent Makefile
8779 for this to work.  This option likely only works if @env{MAKE} is
8780 GNU make.
8782 @item -flto-partition=@var{alg}
8783 @opindex flto-partition
8784 Specify the partitioning algorithm used by the link-time optimizer.
8785 The value is either @code{1to1} to specify a partitioning mirroring
8786 the original source files or @code{balanced} to specify partitioning
8787 into equally sized chunks (whenever possible) or @code{max} to create
8788 new partition for every symbol where possible.  Specifying @code{none}
8789 as an algorithm disables partitioning and streaming completely. 
8790 The default value is @code{balanced}. While @code{1to1} can be used
8791 as an workaround for various code ordering issues, the @code{max}
8792 partitioning is intended for internal testing only.
8794 @item -flto-compression-level=@var{n}
8795 This option specifies the level of compression used for intermediate
8796 language written to LTO object files, and is only meaningful in
8797 conjunction with LTO mode (@option{-flto}).  Valid
8798 values are 0 (no compression) to 9 (maximum compression).  Values
8799 outside this range are clamped to either 0 or 9.  If the option is not
8800 given, a default balanced compression setting is used.
8802 @item -flto-report
8803 Prints a report with internal details on the workings of the link-time
8804 optimizer.  The contents of this report vary from version to version.
8805 It is meant to be useful to GCC developers when processing object
8806 files in LTO mode (via @option{-flto}).
8808 Disabled by default.
8810 @item -flto-report-wpa
8811 Like @option{-flto-report}, but only print for the WPA phase of Link
8812 Time Optimization.
8814 @item -fuse-linker-plugin
8815 Enables the use of a linker plugin during link-time optimization.  This
8816 option relies on plugin support in the linker, which is available in gold
8817 or in GNU ld 2.21 or newer.
8819 This option enables the extraction of object files with GIMPLE bytecode out
8820 of library archives. This improves the quality of optimization by exposing
8821 more code to the link-time optimizer.  This information specifies what
8822 symbols can be accessed externally (by non-LTO object or during dynamic
8823 linking).  Resulting code quality improvements on binaries (and shared
8824 libraries that use hidden visibility) are similar to @code{-fwhole-program}.
8825 See @option{-flto} for a description of the effect of this flag and how to
8826 use it.
8828 This option is enabled by default when LTO support in GCC is enabled
8829 and GCC was configured for use with
8830 a linker supporting plugins (GNU ld 2.21 or newer or gold).
8832 @item -ffat-lto-objects
8833 @opindex ffat-lto-objects
8834 Fat LTO objects are object files that contain both the intermediate language
8835 and the object code. This makes them usable for both LTO linking and normal
8836 linking. This option is effective only when compiling with @option{-flto}
8837 and is ignored at link time.
8839 @option{-fno-fat-lto-objects} improves compilation time over plain LTO, but
8840 requires the complete toolchain to be aware of LTO. It requires a linker with
8841 linker plugin support for basic functionality.  Additionally,
8842 @command{nm}, @command{ar} and @command{ranlib}
8843 need to support linker plugins to allow a full-featured build environment
8844 (capable of building static libraries etc).  GCC provides the @command{gcc-ar},
8845 @command{gcc-nm}, @command{gcc-ranlib} wrappers to pass the right options
8846 to these tools. With non fat LTO makefiles need to be modified to use them.
8848 The default is @option{-fno-fat-lto-objects} on targets with linker plugin
8849 support.
8851 @item -fcompare-elim
8852 @opindex fcompare-elim
8853 After register allocation and post-register allocation instruction splitting,
8854 identify arithmetic instructions that compute processor flags similar to a
8855 comparison operation based on that arithmetic.  If possible, eliminate the
8856 explicit comparison operation.
8858 This pass only applies to certain targets that cannot explicitly represent
8859 the comparison operation before register allocation is complete.
8861 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8863 @item -fuse-ld=bfd
8864 @opindex fuse-ld=bfd
8865 Use the @command{bfd} linker instead of the default linker.
8867 @item -fuse-ld=gold
8868 @opindex fuse-ld=gold
8869 Use the @command{gold} linker instead of the default linker.
8871 @item -fcprop-registers
8872 @opindex fcprop-registers
8873 After register allocation and post-register allocation instruction splitting,
8874 perform a copy-propagation pass to try to reduce scheduling dependencies
8875 and occasionally eliminate the copy.
8877 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8879 @item -fprofile-correction
8880 @opindex fprofile-correction
8881 Profiles collected using an instrumented binary for multi-threaded programs may
8882 be inconsistent due to missed counter updates. When this option is specified,
8883 GCC uses heuristics to correct or smooth out such inconsistencies. By
8884 default, GCC emits an error message when an inconsistent profile is detected.
8886 @item -fprofile-dir=@var{path}
8887 @opindex fprofile-dir
8889 Set the directory to search for the profile data files in to @var{path}.
8890 This option affects only the profile data generated by
8891 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
8892 and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
8893 and its related options.  Both absolute and relative paths can be used.
8894 By default, GCC uses the current directory as @var{path}, thus the
8895 profile data file appears in the same directory as the object file.
8897 @item -fprofile-generate
8898 @itemx -fprofile-generate=@var{path}
8899 @opindex fprofile-generate
8901 Enable options usually used for instrumenting application to produce
8902 profile useful for later recompilation with profile feedback based
8903 optimization.  You must use @option{-fprofile-generate} both when
8904 compiling and when linking your program.
8906 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
8908 If @var{path} is specified, GCC looks at the @var{path} to find
8909 the profile feedback data files. See @option{-fprofile-dir}.
8911 @item -fprofile-use
8912 @itemx -fprofile-use=@var{path}
8913 @opindex fprofile-use
8914 Enable profile feedback directed optimizations, and optimizations
8915 generally profitable only with profile feedback available.
8917 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
8918 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}, @code{-ftree-vectorize},
8919 @code{ftree-loop-distribute-patterns}
8921 By default, GCC emits an error message if the feedback profiles do not
8922 match the source code.  This error can be turned into a warning by using
8923 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
8924 code.
8926 If @var{path} is specified, GCC looks at the @var{path} to find
8927 the profile feedback data files. See @option{-fprofile-dir}.
8928 @end table
8930 The following options control compiler behavior regarding floating-point 
8931 arithmetic.  These options trade off between speed and
8932 correctness.  All must be specifically enabled.
8934 @table @gcctabopt
8935 @item -ffloat-store
8936 @opindex ffloat-store
8937 Do not store floating-point variables in registers, and inhibit other
8938 options that might change whether a floating-point value is taken from a
8939 register or memory.
8941 @cindex floating-point precision
8942 This option prevents undesirable excess precision on machines such as
8943 the 68000 where the floating registers (of the 68881) keep more
8944 precision than a @code{double} is supposed to have.  Similarly for the
8945 x86 architecture.  For most programs, the excess precision does only
8946 good, but a few programs rely on the precise definition of IEEE floating
8947 point.  Use @option{-ffloat-store} for such programs, after modifying
8948 them to store all pertinent intermediate computations into variables.
8950 @item -fexcess-precision=@var{style}
8951 @opindex fexcess-precision
8952 This option allows further control over excess precision on machines
8953 where floating-point registers have more precision than the IEEE
8954 @code{float} and @code{double} types and the processor does not
8955 support operations rounding to those types.  By default,
8956 @option{-fexcess-precision=fast} is in effect; this means that
8957 operations are carried out in the precision of the registers and that
8958 it is unpredictable when rounding to the types specified in the source
8959 code takes place.  When compiling C, if
8960 @option{-fexcess-precision=standard} is specified then excess
8961 precision follows the rules specified in ISO C99; in particular,
8962 both casts and assignments cause values to be rounded to their
8963 semantic types (whereas @option{-ffloat-store} only affects
8964 assignments).  This option is enabled by default for C if a strict
8965 conformance option such as @option{-std=c99} is used.
8967 @opindex mfpmath
8968 @option{-fexcess-precision=standard} is not implemented for languages
8969 other than C, and has no effect if
8970 @option{-funsafe-math-optimizations} or @option{-ffast-math} is
8971 specified.  On the x86, it also has no effect if @option{-mfpmath=sse}
8972 or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
8973 semantics apply without excess precision, and in the latter, rounding
8974 is unpredictable.
8976 @item -ffast-math
8977 @opindex ffast-math
8978 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
8979 @option{-ffinite-math-only}, @option{-fno-rounding-math},
8980 @option{-fno-signaling-nans} and @option{-fcx-limited-range}.
8982 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
8984 This option is not turned on by any @option{-O} option besides
8985 @option{-Ofast} since it can result in incorrect output for programs
8986 that depend on an exact implementation of IEEE or ISO rules/specifications
8987 for math functions. It may, however, yield faster code for programs
8988 that do not require the guarantees of these specifications.
8990 @item -fno-math-errno
8991 @opindex fno-math-errno
8992 Do not set @code{errno} after calling math functions that are executed
8993 with a single instruction, e.g., @code{sqrt}.  A program that relies on
8994 IEEE exceptions for math error handling may want to use this flag
8995 for speed while maintaining IEEE arithmetic compatibility.
8997 This option is not turned on by any @option{-O} option since
8998 it can result in incorrect output for programs that depend on
8999 an exact implementation of IEEE or ISO rules/specifications for
9000 math functions. It may, however, yield faster code for programs
9001 that do not require the guarantees of these specifications.
9003 The default is @option{-fmath-errno}.
9005 On Darwin systems, the math library never sets @code{errno}.  There is
9006 therefore no reason for the compiler to consider the possibility that
9007 it might, and @option{-fno-math-errno} is the default.
9009 @item -funsafe-math-optimizations
9010 @opindex funsafe-math-optimizations
9012 Allow optimizations for floating-point arithmetic that (a) assume
9013 that arguments and results are valid and (b) may violate IEEE or
9014 ANSI standards.  When used at link-time, it may include libraries
9015 or startup files that change the default FPU control word or other
9016 similar optimizations.
9018 This option is not turned on by any @option{-O} option since
9019 it can result in incorrect output for programs that depend on
9020 an exact implementation of IEEE or ISO rules/specifications for
9021 math functions. It may, however, yield faster code for programs
9022 that do not require the guarantees of these specifications.
9023 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
9024 @option{-fassociative-math} and @option{-freciprocal-math}.
9026 The default is @option{-fno-unsafe-math-optimizations}.
9028 @item -fassociative-math
9029 @opindex fassociative-math
9031 Allow re-association of operands in series of floating-point operations.
9032 This violates the ISO C and C++ language standard by possibly changing
9033 computation result.  NOTE: re-ordering may change the sign of zero as
9034 well as ignore NaNs and inhibit or create underflow or overflow (and
9035 thus cannot be used on code that relies on rounding behavior like
9036 @code{(x + 2**52) - 2**52}.  May also reorder floating-point comparisons
9037 and thus may not be used when ordered comparisons are required.
9038 This option requires that both @option{-fno-signed-zeros} and
9039 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
9040 much sense with @option{-frounding-math}. For Fortran the option
9041 is automatically enabled when both @option{-fno-signed-zeros} and
9042 @option{-fno-trapping-math} are in effect.
9044 The default is @option{-fno-associative-math}.
9046 @item -freciprocal-math
9047 @opindex freciprocal-math
9049 Allow the reciprocal of a value to be used instead of dividing by
9050 the value if this enables optimizations.  For example @code{x / y}
9051 can be replaced with @code{x * (1/y)}, which is useful if @code{(1/y)}
9052 is subject to common subexpression elimination.  Note that this loses
9053 precision and increases the number of flops operating on the value.
9055 The default is @option{-fno-reciprocal-math}.
9057 @item -ffinite-math-only
9058 @opindex ffinite-math-only
9059 Allow optimizations for floating-point arithmetic that assume
9060 that arguments and results are not NaNs or +-Infs.
9062 This option is not turned on by any @option{-O} option since
9063 it can result in incorrect output for programs that depend on
9064 an exact implementation of IEEE or ISO rules/specifications for
9065 math functions. It may, however, yield faster code for programs
9066 that do not require the guarantees of these specifications.
9068 The default is @option{-fno-finite-math-only}.
9070 @item -fno-signed-zeros
9071 @opindex fno-signed-zeros
9072 Allow optimizations for floating-point arithmetic that ignore the
9073 signedness of zero.  IEEE arithmetic specifies the behavior of
9074 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
9075 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
9076 This option implies that the sign of a zero result isn't significant.
9078 The default is @option{-fsigned-zeros}.
9080 @item -fno-trapping-math
9081 @opindex fno-trapping-math
9082 Compile code assuming that floating-point operations cannot generate
9083 user-visible traps.  These traps include division by zero, overflow,
9084 underflow, inexact result and invalid operation.  This option requires
9085 that @option{-fno-signaling-nans} be in effect.  Setting this option may
9086 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
9088 This option should never be turned on by any @option{-O} option since
9089 it can result in incorrect output for programs that depend on
9090 an exact implementation of IEEE or ISO rules/specifications for
9091 math functions.
9093 The default is @option{-ftrapping-math}.
9095 @item -frounding-math
9096 @opindex frounding-math
9097 Disable transformations and optimizations that assume default floating-point
9098 rounding behavior.  This is round-to-zero for all floating point
9099 to integer conversions, and round-to-nearest for all other arithmetic
9100 truncations.  This option should be specified for programs that change
9101 the FP rounding mode dynamically, or that may be executed with a
9102 non-default rounding mode.  This option disables constant folding of
9103 floating-point expressions at compile time (which may be affected by
9104 rounding mode) and arithmetic transformations that are unsafe in the
9105 presence of sign-dependent rounding modes.
9107 The default is @option{-fno-rounding-math}.
9109 This option is experimental and does not currently guarantee to
9110 disable all GCC optimizations that are affected by rounding mode.
9111 Future versions of GCC may provide finer control of this setting
9112 using C99's @code{FENV_ACCESS} pragma.  This command-line option
9113 will be used to specify the default state for @code{FENV_ACCESS}.
9115 @item -fsignaling-nans
9116 @opindex fsignaling-nans
9117 Compile code assuming that IEEE signaling NaNs may generate user-visible
9118 traps during floating-point operations.  Setting this option disables
9119 optimizations that may change the number of exceptions visible with
9120 signaling NaNs.  This option implies @option{-ftrapping-math}.
9122 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
9123 be defined.
9125 The default is @option{-fno-signaling-nans}.
9127 This option is experimental and does not currently guarantee to
9128 disable all GCC optimizations that affect signaling NaN behavior.
9130 @item -fsingle-precision-constant
9131 @opindex fsingle-precision-constant
9132 Treat floating-point constants as single precision instead of
9133 implicitly converting them to double-precision constants.
9135 @item -fcx-limited-range
9136 @opindex fcx-limited-range
9137 When enabled, this option states that a range reduction step is not
9138 needed when performing complex division.  Also, there is no checking
9139 whether the result of a complex multiplication or division is @code{NaN
9140 + I*NaN}, with an attempt to rescue the situation in that case.  The
9141 default is @option{-fno-cx-limited-range}, but is enabled by
9142 @option{-ffast-math}.
9144 This option controls the default setting of the ISO C99
9145 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
9146 all languages.
9148 @item -fcx-fortran-rules
9149 @opindex fcx-fortran-rules
9150 Complex multiplication and division follow Fortran rules.  Range
9151 reduction is done as part of complex division, but there is no checking
9152 whether the result of a complex multiplication or division is @code{NaN
9153 + I*NaN}, with an attempt to rescue the situation in that case.
9155 The default is @option{-fno-cx-fortran-rules}.
9157 @end table
9159 The following options control optimizations that may improve
9160 performance, but are not enabled by any @option{-O} options.  This
9161 section includes experimental options that may produce broken code.
9163 @table @gcctabopt
9164 @item -fbranch-probabilities
9165 @opindex fbranch-probabilities
9166 After running a program compiled with @option{-fprofile-arcs}
9167 (@pxref{Debugging Options,, Options for Debugging Your Program or
9168 @command{gcc}}), you can compile it a second time using
9169 @option{-fbranch-probabilities}, to improve optimizations based on
9170 the number of times each branch was taken.  When a program
9171 compiled with @option{-fprofile-arcs} exits, it saves arc execution
9172 counts to a file called @file{@var{sourcename}.gcda} for each source
9173 file.  The information in this data file is very dependent on the
9174 structure of the generated code, so you must use the same source code
9175 and the same optimization options for both compilations.
9177 With @option{-fbranch-probabilities}, GCC puts a
9178 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
9179 These can be used to improve optimization.  Currently, they are only
9180 used in one place: in @file{reorg.c}, instead of guessing which path a
9181 branch is most likely to take, the @samp{REG_BR_PROB} values are used to
9182 exactly determine which path is taken more often.
9184 @item -fprofile-values
9185 @opindex fprofile-values
9186 If combined with @option{-fprofile-arcs}, it adds code so that some
9187 data about values of expressions in the program is gathered.
9189 With @option{-fbranch-probabilities}, it reads back the data gathered
9190 from profiling values of expressions for usage in optimizations.
9192 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
9194 @item -fprofile-reorder-functions
9195 @opindex fprofile-reorder-functions
9196 Function reordering based on profile instrumentation collects
9197 first time of execution of a function and orders these functions
9198 in ascending order.
9200 Enabled with @option{-fprofile-use}.
9202 @item -fvpt
9203 @opindex fvpt
9204 If combined with @option{-fprofile-arcs}, this option instructs the compiler
9205 to add code to gather information about values of expressions.
9207 With @option{-fbranch-probabilities}, it reads back the data gathered
9208 and actually performs the optimizations based on them.
9209 Currently the optimizations include specialization of division operations
9210 using the knowledge about the value of the denominator.
9212 @item -frename-registers
9213 @opindex frename-registers
9214 Attempt to avoid false dependencies in scheduled code by making use
9215 of registers left over after register allocation.  This optimization
9216 most benefits processors with lots of registers.  Depending on the
9217 debug information format adopted by the target, however, it can
9218 make debugging impossible, since variables no longer stay in
9219 a ``home register''.
9221 Enabled by default with @option{-funroll-loops} and @option{-fpeel-loops}.
9223 @item -ftracer
9224 @opindex ftracer
9225 Perform tail duplication to enlarge superblock size.  This transformation
9226 simplifies the control flow of the function allowing other optimizations to do
9227 a better job.
9229 Enabled with @option{-fprofile-use}.
9231 @item -funroll-loops
9232 @opindex funroll-loops
9233 Unroll loops whose number of iterations can be determined at compile time or
9234 upon entry to the loop.  @option{-funroll-loops} implies
9235 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
9236 It also turns on complete loop peeling (i.e.@: complete removal of loops with
9237 a small constant number of iterations).  This option makes code larger, and may
9238 or may not make it run faster.
9240 Enabled with @option{-fprofile-use}.
9242 @item -funroll-all-loops
9243 @opindex funroll-all-loops
9244 Unroll all loops, even if their number of iterations is uncertain when
9245 the loop is entered.  This usually makes programs run more slowly.
9246 @option{-funroll-all-loops} implies the same options as
9247 @option{-funroll-loops}.
9249 @item -fpeel-loops
9250 @opindex fpeel-loops
9251 Peels loops for which there is enough information that they do not
9252 roll much (from profile feedback).  It also turns on complete loop peeling
9253 (i.e.@: complete removal of loops with small constant number of iterations).
9255 Enabled with @option{-fprofile-use}.
9257 @item -fmove-loop-invariants
9258 @opindex fmove-loop-invariants
9259 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
9260 at level @option{-O1}
9262 @item -funswitch-loops
9263 @opindex funswitch-loops
9264 Move branches with loop invariant conditions out of the loop, with duplicates
9265 of the loop on both branches (modified according to result of the condition).
9267 @item -ffunction-sections
9268 @itemx -fdata-sections
9269 @opindex ffunction-sections
9270 @opindex fdata-sections
9271 Place each function or data item into its own section in the output
9272 file if the target supports arbitrary sections.  The name of the
9273 function or the name of the data item determines the section's name
9274 in the output file.
9276 Use these options on systems where the linker can perform optimizations
9277 to improve locality of reference in the instruction space.  Most systems
9278 using the ELF object format and SPARC processors running Solaris 2 have
9279 linkers with such optimizations.  AIX may have these optimizations in
9280 the future.
9282 Only use these options when there are significant benefits from doing
9283 so.  When you specify these options, the assembler and linker
9284 create larger object and executable files and are also slower.
9285 You cannot use @code{gprof} on all systems if you
9286 specify this option, and you may have problems with debugging if
9287 you specify both this option and @option{-g}.
9289 @item -fbranch-target-load-optimize
9290 @opindex fbranch-target-load-optimize
9291 Perform branch target register load optimization before prologue / epilogue
9292 threading.
9293 The use of target registers can typically be exposed only during reload,
9294 thus hoisting loads out of loops and doing inter-block scheduling needs
9295 a separate optimization pass.
9297 @item -fbranch-target-load-optimize2
9298 @opindex fbranch-target-load-optimize2
9299 Perform branch target register load optimization after prologue / epilogue
9300 threading.
9302 @item -fbtr-bb-exclusive
9303 @opindex fbtr-bb-exclusive
9304 When performing branch target register load optimization, don't reuse
9305 branch target registers within any basic block.
9307 @item -fstack-protector
9308 @opindex fstack-protector
9309 Emit extra code to check for buffer overflows, such as stack smashing
9310 attacks.  This is done by adding a guard variable to functions with
9311 vulnerable objects.  This includes functions that call @code{alloca}, and
9312 functions with buffers larger than 8 bytes.  The guards are initialized
9313 when a function is entered and then checked when the function exits.
9314 If a guard check fails, an error message is printed and the program exits.
9316 @item -fstack-protector-all
9317 @opindex fstack-protector-all
9318 Like @option{-fstack-protector} except that all functions are protected.
9320 @item -fstack-protector-strong
9321 @opindex fstack-protector-strong
9322 Like @option{-fstack-protector} but includes additional functions to
9323 be protected --- those that have local array definitions, or have
9324 references to local frame addresses.
9326 @item -fsection-anchors
9327 @opindex fsection-anchors
9328 Try to reduce the number of symbolic address calculations by using
9329 shared ``anchor'' symbols to address nearby objects.  This transformation
9330 can help to reduce the number of GOT entries and GOT accesses on some
9331 targets.
9333 For example, the implementation of the following function @code{foo}:
9335 @smallexample
9336 static int a, b, c;
9337 int foo (void) @{ return a + b + c; @}
9338 @end smallexample
9340 @noindent
9341 usually calculates the addresses of all three variables, but if you
9342 compile it with @option{-fsection-anchors}, it accesses the variables
9343 from a common anchor point instead.  The effect is similar to the
9344 following pseudocode (which isn't valid C):
9346 @smallexample
9347 int foo (void)
9349   register int *xr = &x;
9350   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
9352 @end smallexample
9354 Not all targets support this option.
9356 @item --param @var{name}=@var{value}
9357 @opindex param
9358 In some places, GCC uses various constants to control the amount of
9359 optimization that is done.  For example, GCC does not inline functions
9360 that contain more than a certain number of instructions.  You can
9361 control some of these constants on the command line using the
9362 @option{--param} option.
9364 The names of specific parameters, and the meaning of the values, are
9365 tied to the internals of the compiler, and are subject to change
9366 without notice in future releases.
9368 In each case, the @var{value} is an integer.  The allowable choices for
9369 @var{name} are:
9371 @table @gcctabopt
9372 @item predictable-branch-outcome
9373 When branch is predicted to be taken with probability lower than this threshold
9374 (in percent), then it is considered well predictable. The default is 10.
9376 @item max-crossjump-edges
9377 The maximum number of incoming edges to consider for cross-jumping.
9378 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
9379 the number of edges incoming to each block.  Increasing values mean
9380 more aggressive optimization, making the compilation time increase with
9381 probably small improvement in executable size.
9383 @item min-crossjump-insns
9384 The minimum number of instructions that must be matched at the end
9385 of two blocks before cross-jumping is performed on them.  This
9386 value is ignored in the case where all instructions in the block being
9387 cross-jumped from are matched.  The default value is 5.
9389 @item max-grow-copy-bb-insns
9390 The maximum code size expansion factor when copying basic blocks
9391 instead of jumping.  The expansion is relative to a jump instruction.
9392 The default value is 8.
9394 @item max-goto-duplication-insns
9395 The maximum number of instructions to duplicate to a block that jumps
9396 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
9397 passes, GCC factors computed gotos early in the compilation process,
9398 and unfactors them as late as possible.  Only computed jumps at the
9399 end of a basic blocks with no more than max-goto-duplication-insns are
9400 unfactored.  The default value is 8.
9402 @item max-delay-slot-insn-search
9403 The maximum number of instructions to consider when looking for an
9404 instruction to fill a delay slot.  If more than this arbitrary number of
9405 instructions are searched, the time savings from filling the delay slot
9406 are minimal, so stop searching.  Increasing values mean more
9407 aggressive optimization, making the compilation time increase with probably
9408 small improvement in execution time.
9410 @item max-delay-slot-live-search
9411 When trying to fill delay slots, the maximum number of instructions to
9412 consider when searching for a block with valid live register
9413 information.  Increasing this arbitrarily chosen value means more
9414 aggressive optimization, increasing the compilation time.  This parameter
9415 should be removed when the delay slot code is rewritten to maintain the
9416 control-flow graph.
9418 @item max-gcse-memory
9419 The approximate maximum amount of memory that can be allocated in
9420 order to perform the global common subexpression elimination
9421 optimization.  If more memory than specified is required, the
9422 optimization is not done.
9424 @item max-gcse-insertion-ratio
9425 If the ratio of expression insertions to deletions is larger than this value
9426 for any expression, then RTL PRE inserts or removes the expression and thus
9427 leaves partially redundant computations in the instruction stream.  The default value is 20.
9429 @item max-pending-list-length
9430 The maximum number of pending dependencies scheduling allows
9431 before flushing the current state and starting over.  Large functions
9432 with few branches or calls can create excessively large lists which
9433 needlessly consume memory and resources.
9435 @item max-modulo-backtrack-attempts
9436 The maximum number of backtrack attempts the scheduler should make
9437 when modulo scheduling a loop.  Larger values can exponentially increase
9438 compilation time.
9440 @item max-inline-insns-single
9441 Several parameters control the tree inliner used in GCC@.
9442 This number sets the maximum number of instructions (counted in GCC's
9443 internal representation) in a single function that the tree inliner
9444 considers for inlining.  This only affects functions declared
9445 inline and methods implemented in a class declaration (C++).
9446 The default value is 400.
9448 @item max-inline-insns-auto
9449 When you use @option{-finline-functions} (included in @option{-O3}),
9450 a lot of functions that would otherwise not be considered for inlining
9451 by the compiler are investigated.  To those functions, a different
9452 (more restrictive) limit compared to functions declared inline can
9453 be applied.
9454 The default value is 40.
9456 @item inline-min-speedup
9457 When estimated performance improvement of caller + callee runtime exceeds this
9458 threshold (in precent), the function can be inlined regardless the limit on
9459 @option{--param max-inline-insns-single} and @option{--param
9460 max-inline-insns-auto}.
9462 @item large-function-insns
9463 The limit specifying really large functions.  For functions larger than this
9464 limit after inlining, inlining is constrained by
9465 @option{--param large-function-growth}.  This parameter is useful primarily
9466 to avoid extreme compilation time caused by non-linear algorithms used by the
9467 back end.
9468 The default value is 2700.
9470 @item large-function-growth
9471 Specifies maximal growth of large function caused by inlining in percents.
9472 The default value is 100 which limits large function growth to 2.0 times
9473 the original size.
9475 @item large-unit-insns
9476 The limit specifying large translation unit.  Growth caused by inlining of
9477 units larger than this limit is limited by @option{--param inline-unit-growth}.
9478 For small units this might be too tight.
9479 For example, consider a unit consisting of function A
9480 that is inline and B that just calls A three times.  If B is small relative to
9481 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
9482 large units consisting of small inlineable functions, however, the overall unit
9483 growth limit is needed to avoid exponential explosion of code size.  Thus for
9484 smaller units, the size is increased to @option{--param large-unit-insns}
9485 before applying @option{--param inline-unit-growth}.  The default is 10000.
9487 @item inline-unit-growth
9488 Specifies maximal overall growth of the compilation unit caused by inlining.
9489 The default value is 30 which limits unit growth to 1.3 times the original
9490 size. Cold functions (either marked cold via an attribibute or by profile
9491 feedback) are not accounted into the unit size.
9493 @item ipcp-unit-growth
9494 Specifies maximal overall growth of the compilation unit caused by
9495 interprocedural constant propagation.  The default value is 10 which limits
9496 unit growth to 1.1 times the original size.
9498 @item large-stack-frame
9499 The limit specifying large stack frames.  While inlining the algorithm is trying
9500 to not grow past this limit too much.  The default value is 256 bytes.
9502 @item large-stack-frame-growth
9503 Specifies maximal growth of large stack frames caused by inlining in percents.
9504 The default value is 1000 which limits large stack frame growth to 11 times
9505 the original size.
9507 @item max-inline-insns-recursive
9508 @itemx max-inline-insns-recursive-auto
9509 Specifies the maximum number of instructions an out-of-line copy of a
9510 self-recursive inline
9511 function can grow into by performing recursive inlining.
9513 For functions declared inline, @option{--param max-inline-insns-recursive} is
9514 taken into account.  For functions not declared inline, recursive inlining
9515 happens only when @option{-finline-functions} (included in @option{-O3}) is
9516 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
9517 default value is 450.
9519 @item max-inline-recursive-depth
9520 @itemx max-inline-recursive-depth-auto
9521 Specifies the maximum recursion depth used for recursive inlining.
9523 For functions declared inline, @option{--param max-inline-recursive-depth} is
9524 taken into account.  For functions not declared inline, recursive inlining
9525 happens only when @option{-finline-functions} (included in @option{-O3}) is
9526 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
9527 default value is 8.
9529 @item min-inline-recursive-probability
9530 Recursive inlining is profitable only for function having deep recursion
9531 in average and can hurt for function having little recursion depth by
9532 increasing the prologue size or complexity of function body to other
9533 optimizers.
9535 When profile feedback is available (see @option{-fprofile-generate}) the actual
9536 recursion depth can be guessed from probability that function recurses via a
9537 given call expression.  This parameter limits inlining only to call expressions
9538 whose probability exceeds the given threshold (in percents).
9539 The default value is 10.
9541 @item early-inlining-insns
9542 Specify growth that the early inliner can make.  In effect it increases
9543 the amount of inlining for code having a large abstraction penalty.
9544 The default value is 10.
9546 @item max-early-inliner-iterations
9547 @itemx max-early-inliner-iterations
9548 Limit of iterations of the early inliner.  This basically bounds
9549 the number of nested indirect calls the early inliner can resolve.
9550 Deeper chains are still handled by late inlining.
9552 @item comdat-sharing-probability
9553 @itemx comdat-sharing-probability
9554 Probability (in percent) that C++ inline function with comdat visibility
9555 are shared across multiple compilation units.  The default value is 20.
9557 @item min-vect-loop-bound
9558 The minimum number of iterations under which loops are not vectorized
9559 when @option{-ftree-vectorize} is used.  The number of iterations after
9560 vectorization needs to be greater than the value specified by this option
9561 to allow vectorization.  The default value is 0.
9563 @item gcse-cost-distance-ratio
9564 Scaling factor in calculation of maximum distance an expression
9565 can be moved by GCSE optimizations.  This is currently supported only in the
9566 code hoisting pass.  The bigger the ratio, the more aggressive code hoisting
9567 is with simple expressions, i.e., the expressions that have cost
9568 less than @option{gcse-unrestricted-cost}.  Specifying 0 disables
9569 hoisting of simple expressions.  The default value is 10.
9571 @item gcse-unrestricted-cost
9572 Cost, roughly measured as the cost of a single typical machine
9573 instruction, at which GCSE optimizations do not constrain
9574 the distance an expression can travel.  This is currently
9575 supported only in the code hoisting pass.  The lesser the cost,
9576 the more aggressive code hoisting is.  Specifying 0 
9577 allows all expressions to travel unrestricted distances.
9578 The default value is 3.
9580 @item max-hoist-depth
9581 The depth of search in the dominator tree for expressions to hoist.
9582 This is used to avoid quadratic behavior in hoisting algorithm.
9583 The value of 0 does not limit on the search, but may slow down compilation
9584 of huge functions.  The default value is 30.
9586 @item max-tail-merge-comparisons
9587 The maximum amount of similar bbs to compare a bb with.  This is used to
9588 avoid quadratic behavior in tree tail merging.  The default value is 10.
9590 @item max-tail-merge-iterations
9591 The maximum amount of iterations of the pass over the function.  This is used to
9592 limit compilation time in tree tail merging.  The default value is 2.
9594 @item max-unrolled-insns
9595 The maximum number of instructions that a loop may have to be unrolled.
9596 If a loop is unrolled, this parameter also determines how many times
9597 the loop code is unrolled.
9599 @item max-average-unrolled-insns
9600 The maximum number of instructions biased by probabilities of their execution
9601 that a loop may have to be unrolled.  If a loop is unrolled,
9602 this parameter also determines how many times the loop code is unrolled.
9604 @item max-unroll-times
9605 The maximum number of unrollings of a single loop.
9607 @item max-peeled-insns
9608 The maximum number of instructions that a loop may have to be peeled.
9609 If a loop is peeled, this parameter also determines how many times
9610 the loop code is peeled.
9612 @item max-peel-times
9613 The maximum number of peelings of a single loop.
9615 @item max-peel-branches
9616 The maximum number of branches on the hot path through the peeled sequence.
9618 @item max-completely-peeled-insns
9619 The maximum number of insns of a completely peeled loop.
9621 @item max-completely-peel-times
9622 The maximum number of iterations of a loop to be suitable for complete peeling.
9624 @item max-completely-peel-loop-nest-depth
9625 The maximum depth of a loop nest suitable for complete peeling.
9627 @item max-unswitch-insns
9628 The maximum number of insns of an unswitched loop.
9630 @item max-unswitch-level
9631 The maximum number of branches unswitched in a single loop.
9633 @item lim-expensive
9634 The minimum cost of an expensive expression in the loop invariant motion.
9636 @item iv-consider-all-candidates-bound
9637 Bound on number of candidates for induction variables, below which
9638 all candidates are considered for each use in induction variable
9639 optimizations.  If there are more candidates than this,
9640 only the most relevant ones are considered to avoid quadratic time complexity.
9642 @item iv-max-considered-uses
9643 The induction variable optimizations give up on loops that contain more
9644 induction variable uses.
9646 @item iv-always-prune-cand-set-bound
9647 If the number of candidates in the set is smaller than this value,
9648 always try to remove unnecessary ivs from the set
9649 when adding a new one.
9651 @item scev-max-expr-size
9652 Bound on size of expressions used in the scalar evolutions analyzer.
9653 Large expressions slow the analyzer.
9655 @item scev-max-expr-complexity
9656 Bound on the complexity of the expressions in the scalar evolutions analyzer.
9657 Complex expressions slow the analyzer.
9659 @item omega-max-vars
9660 The maximum number of variables in an Omega constraint system.
9661 The default value is 128.
9663 @item omega-max-geqs
9664 The maximum number of inequalities in an Omega constraint system.
9665 The default value is 256.
9667 @item omega-max-eqs
9668 The maximum number of equalities in an Omega constraint system.
9669 The default value is 128.
9671 @item omega-max-wild-cards
9672 The maximum number of wildcard variables that the Omega solver is
9673 able to insert.  The default value is 18.
9675 @item omega-hash-table-size
9676 The size of the hash table in the Omega solver.  The default value is
9677 550.
9679 @item omega-max-keys
9680 The maximal number of keys used by the Omega solver.  The default
9681 value is 500.
9683 @item omega-eliminate-redundant-constraints
9684 When set to 1, use expensive methods to eliminate all redundant
9685 constraints.  The default value is 0.
9687 @item vect-max-version-for-alignment-checks
9688 The maximum number of run-time checks that can be performed when
9689 doing loop versioning for alignment in the vectorizer. 
9691 @item vect-max-version-for-alias-checks
9692 The maximum number of run-time checks that can be performed when
9693 doing loop versioning for alias in the vectorizer. 
9695 @item vect-max-peeling-for-alignment
9696 The maximum number of loop peels to enhance access alignment
9697 for vectorizer. Value -1 means 'no limit'.
9699 @item max-iterations-to-track
9700 The maximum number of iterations of a loop the brute-force algorithm
9701 for analysis of the number of iterations of the loop tries to evaluate.
9703 @item hot-bb-count-ws-permille
9704 A basic block profile count is considered hot if it contributes to 
9705 the given permillage (i.e. 0...1000) of the entire profiled execution.
9707 @item hot-bb-frequency-fraction
9708 Select fraction of the entry block frequency of executions of basic block in
9709 function given basic block needs to have to be considered hot.
9711 @item max-predicted-iterations
9712 The maximum number of loop iterations we predict statically.  This is useful
9713 in cases where a function contains a single loop with known bound and
9714 another loop with unknown bound.
9715 The known number of iterations is predicted correctly, while
9716 the unknown number of iterations average to roughly 10.  This means that the
9717 loop without bounds appears artificially cold relative to the other one.
9719 @item builtin-expect-probability
9720 Control the probability of the expression having the specified value. This
9721 parameter takes a percentage (i.e. 0 ... 100) as input.
9722 The default probability of 90 is obtained empirically.
9724 @item align-threshold
9726 Select fraction of the maximal frequency of executions of a basic block in
9727 a function to align the basic block.
9729 @item align-loop-iterations
9731 A loop expected to iterate at least the selected number of iterations is
9732 aligned.
9734 @item tracer-dynamic-coverage
9735 @itemx tracer-dynamic-coverage-feedback
9737 This value is used to limit superblock formation once the given percentage of
9738 executed instructions is covered.  This limits unnecessary code size
9739 expansion.
9741 The @option{tracer-dynamic-coverage-feedback} is used only when profile
9742 feedback is available.  The real profiles (as opposed to statically estimated
9743 ones) are much less balanced allowing the threshold to be larger value.
9745 @item tracer-max-code-growth
9746 Stop tail duplication once code growth has reached given percentage.  This is
9747 a rather artificial limit, as most of the duplicates are eliminated later in
9748 cross jumping, so it may be set to much higher values than is the desired code
9749 growth.
9751 @item tracer-min-branch-ratio
9753 Stop reverse growth when the reverse probability of best edge is less than this
9754 threshold (in percent).
9756 @item tracer-min-branch-ratio
9757 @itemx tracer-min-branch-ratio-feedback
9759 Stop forward growth if the best edge has probability lower than this
9760 threshold.
9762 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
9763 compilation for profile feedback and one for compilation without.  The value
9764 for compilation with profile feedback needs to be more conservative (higher) in
9765 order to make tracer effective.
9767 @item max-cse-path-length
9769 The maximum number of basic blocks on path that CSE considers.
9770 The default is 10.
9772 @item max-cse-insns
9773 The maximum number of instructions CSE processes before flushing.
9774 The default is 1000.
9776 @item ggc-min-expand
9778 GCC uses a garbage collector to manage its own memory allocation.  This
9779 parameter specifies the minimum percentage by which the garbage
9780 collector's heap should be allowed to expand between collections.
9781 Tuning this may improve compilation speed; it has no effect on code
9782 generation.
9784 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
9785 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of ``RAM'' is
9786 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
9787 GCC is not able to calculate RAM on a particular platform, the lower
9788 bound of 30% is used.  Setting this parameter and
9789 @option{ggc-min-heapsize} to zero causes a full collection to occur at
9790 every opportunity.  This is extremely slow, but can be useful for
9791 debugging.
9793 @item ggc-min-heapsize
9795 Minimum size of the garbage collector's heap before it begins bothering
9796 to collect garbage.  The first collection occurs after the heap expands
9797 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
9798 tuning this may improve compilation speed, and has no effect on code
9799 generation.
9801 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit that
9802 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
9803 with a lower bound of 4096 (four megabytes) and an upper bound of
9804 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
9805 particular platform, the lower bound is used.  Setting this parameter
9806 very large effectively disables garbage collection.  Setting this
9807 parameter and @option{ggc-min-expand} to zero causes a full collection
9808 to occur at every opportunity.
9810 @item max-reload-search-insns
9811 The maximum number of instruction reload should look backward for equivalent
9812 register.  Increasing values mean more aggressive optimization, making the
9813 compilation time increase with probably slightly better performance.
9814 The default value is 100.
9816 @item max-cselib-memory-locations
9817 The maximum number of memory locations cselib should take into account.
9818 Increasing values mean more aggressive optimization, making the compilation time
9819 increase with probably slightly better performance.  The default value is 500.
9821 @item reorder-blocks-duplicate
9822 @itemx reorder-blocks-duplicate-feedback
9824 Used by the basic block reordering pass to decide whether to use unconditional
9825 branch or duplicate the code on its destination.  Code is duplicated when its
9826 estimated size is smaller than this value multiplied by the estimated size of
9827 unconditional jump in the hot spots of the program.
9829 The @option{reorder-block-duplicate-feedback} is used only when profile
9830 feedback is available.  It may be set to higher values than
9831 @option{reorder-block-duplicate} since information about the hot spots is more
9832 accurate.
9834 @item max-sched-ready-insns
9835 The maximum number of instructions ready to be issued the scheduler should
9836 consider at any given time during the first scheduling pass.  Increasing
9837 values mean more thorough searches, making the compilation time increase
9838 with probably little benefit.  The default value is 100.
9840 @item max-sched-region-blocks
9841 The maximum number of blocks in a region to be considered for
9842 interblock scheduling.  The default value is 10.
9844 @item max-pipeline-region-blocks
9845 The maximum number of blocks in a region to be considered for
9846 pipelining in the selective scheduler.  The default value is 15.
9848 @item max-sched-region-insns
9849 The maximum number of insns in a region to be considered for
9850 interblock scheduling.  The default value is 100.
9852 @item max-pipeline-region-insns
9853 The maximum number of insns in a region to be considered for
9854 pipelining in the selective scheduler.  The default value is 200.
9856 @item min-spec-prob
9857 The minimum probability (in percents) of reaching a source block
9858 for interblock speculative scheduling.  The default value is 40.
9860 @item max-sched-extend-regions-iters
9861 The maximum number of iterations through CFG to extend regions.
9862 A value of 0 (the default) disables region extensions.
9864 @item max-sched-insn-conflict-delay
9865 The maximum conflict delay for an insn to be considered for speculative motion.
9866 The default value is 3.
9868 @item sched-spec-prob-cutoff
9869 The minimal probability of speculation success (in percents), so that
9870 speculative insns are scheduled.
9871 The default value is 40.
9873 @item sched-spec-state-edge-prob-cutoff
9874 The minimum probability an edge must have for the scheduler to save its
9875 state across it.
9876 The default value is 10.
9878 @item sched-mem-true-dep-cost
9879 Minimal distance (in CPU cycles) between store and load targeting same
9880 memory locations.  The default value is 1.
9882 @item selsched-max-lookahead
9883 The maximum size of the lookahead window of selective scheduling.  It is a
9884 depth of search for available instructions.
9885 The default value is 50.
9887 @item selsched-max-sched-times
9888 The maximum number of times that an instruction is scheduled during
9889 selective scheduling.  This is the limit on the number of iterations
9890 through which the instruction may be pipelined.  The default value is 2.
9892 @item selsched-max-insns-to-rename
9893 The maximum number of best instructions in the ready list that are considered
9894 for renaming in the selective scheduler.  The default value is 2.
9896 @item sms-min-sc
9897 The minimum value of stage count that swing modulo scheduler
9898 generates.  The default value is 2.
9900 @item max-last-value-rtl
9901 The maximum size measured as number of RTLs that can be recorded in an expression
9902 in combiner for a pseudo register as last known value of that register.  The default
9903 is 10000.
9905 @item integer-share-limit
9906 Small integer constants can use a shared data structure, reducing the
9907 compiler's memory usage and increasing its speed.  This sets the maximum
9908 value of a shared integer constant.  The default value is 256.
9910 @item ssp-buffer-size
9911 The minimum size of buffers (i.e.@: arrays) that receive stack smashing
9912 protection when @option{-fstack-protection} is used.
9914 @item min-size-for-stack-sharing
9915 The minimum size of variables taking part in stack slot sharing when not
9916 optimizing. The default value is 32.
9918 @item max-jump-thread-duplication-stmts
9919 Maximum number of statements allowed in a block that needs to be
9920 duplicated when threading jumps.
9922 @item max-fields-for-field-sensitive
9923 Maximum number of fields in a structure treated in
9924 a field sensitive manner during pointer analysis.  The default is zero
9925 for @option{-O0} and @option{-O1},
9926 and 100 for @option{-Os}, @option{-O2}, and @option{-O3}.
9928 @item prefetch-latency
9929 Estimate on average number of instructions that are executed before
9930 prefetch finishes.  The distance prefetched ahead is proportional
9931 to this constant.  Increasing this number may also lead to less
9932 streams being prefetched (see @option{simultaneous-prefetches}).
9934 @item simultaneous-prefetches
9935 Maximum number of prefetches that can run at the same time.
9937 @item l1-cache-line-size
9938 The size of cache line in L1 cache, in bytes.
9940 @item l1-cache-size
9941 The size of L1 cache, in kilobytes.
9943 @item l2-cache-size
9944 The size of L2 cache, in kilobytes.
9946 @item min-insn-to-prefetch-ratio
9947 The minimum ratio between the number of instructions and the
9948 number of prefetches to enable prefetching in a loop.
9950 @item prefetch-min-insn-to-mem-ratio
9951 The minimum ratio between the number of instructions and the
9952 number of memory references to enable prefetching in a loop.
9954 @item use-canonical-types
9955 Whether the compiler should use the ``canonical'' type system.  By
9956 default, this should always be 1, which uses a more efficient internal
9957 mechanism for comparing types in C++ and Objective-C++.  However, if
9958 bugs in the canonical type system are causing compilation failures,
9959 set this value to 0 to disable canonical types.
9961 @item switch-conversion-max-branch-ratio
9962 Switch initialization conversion refuses to create arrays that are
9963 bigger than @option{switch-conversion-max-branch-ratio} times the number of
9964 branches in the switch.
9966 @item max-partial-antic-length
9967 Maximum length of the partial antic set computed during the tree
9968 partial redundancy elimination optimization (@option{-ftree-pre}) when
9969 optimizing at @option{-O3} and above.  For some sorts of source code
9970 the enhanced partial redundancy elimination optimization can run away,
9971 consuming all of the memory available on the host machine.  This
9972 parameter sets a limit on the length of the sets that are computed,
9973 which prevents the runaway behavior.  Setting a value of 0 for
9974 this parameter allows an unlimited set length.
9976 @item sccvn-max-scc-size
9977 Maximum size of a strongly connected component (SCC) during SCCVN
9978 processing.  If this limit is hit, SCCVN processing for the whole
9979 function is not done and optimizations depending on it are
9980 disabled.  The default maximum SCC size is 10000.
9982 @item sccvn-max-alias-queries-per-access
9983 Maximum number of alias-oracle queries we perform when looking for
9984 redundancies for loads and stores.  If this limit is hit the search
9985 is aborted and the load or store is not considered redundant.  The
9986 number of queries is algorithmically limited to the number of
9987 stores on all paths from the load to the function entry.
9988 The default maxmimum number of queries is 1000.
9990 @item ira-max-loops-num
9991 IRA uses regional register allocation by default.  If a function
9992 contains more loops than the number given by this parameter, only at most
9993 the given number of the most frequently-executed loops form regions
9994 for regional register allocation.  The default value of the
9995 parameter is 100.
9997 @item ira-max-conflict-table-size 
9998 Although IRA uses a sophisticated algorithm to compress the conflict
9999 table, the table can still require excessive amounts of memory for
10000 huge functions.  If the conflict table for a function could be more
10001 than the size in MB given by this parameter, the register allocator
10002 instead uses a faster, simpler, and lower-quality
10003 algorithm that does not require building a pseudo-register conflict table.  
10004 The default value of the parameter is 2000.
10006 @item ira-loop-reserved-regs
10007 IRA can be used to evaluate more accurate register pressure in loops
10008 for decisions to move loop invariants (see @option{-O3}).  The number
10009 of available registers reserved for some other purposes is given
10010 by this parameter.  The default value of the parameter is 2, which is
10011 the minimal number of registers needed by typical instructions.
10012 This value is the best found from numerous experiments.
10014 @item loop-invariant-max-bbs-in-loop
10015 Loop invariant motion can be very expensive, both in compilation time and
10016 in amount of needed compile-time memory, with very large loops.  Loops
10017 with more basic blocks than this parameter won't have loop invariant
10018 motion optimization performed on them.  The default value of the
10019 parameter is 1000 for @option{-O1} and 10000 for @option{-O2} and above.
10021 @item loop-max-datarefs-for-datadeps
10022 Building data dapendencies is expensive for very large loops.  This
10023 parameter limits the number of data references in loops that are
10024 considered for data dependence analysis.  These large loops are no
10025 handled by the optimizations using loop data dependencies.
10026 The default value is 1000.
10028 @item max-vartrack-size
10029 Sets a maximum number of hash table slots to use during variable
10030 tracking dataflow analysis of any function.  If this limit is exceeded
10031 with variable tracking at assignments enabled, analysis for that
10032 function is retried without it, after removing all debug insns from
10033 the function.  If the limit is exceeded even without debug insns, var
10034 tracking analysis is completely disabled for the function.  Setting
10035 the parameter to zero makes it unlimited.
10037 @item max-vartrack-expr-depth
10038 Sets a maximum number of recursion levels when attempting to map
10039 variable names or debug temporaries to value expressions.  This trades
10040 compilation time for more complete debug information.  If this is set too
10041 low, value expressions that are available and could be represented in
10042 debug information may end up not being used; setting this higher may
10043 enable the compiler to find more complex debug expressions, but compile
10044 time and memory use may grow.  The default is 12.
10046 @item min-nondebug-insn-uid
10047 Use uids starting at this parameter for nondebug insns.  The range below
10048 the parameter is reserved exclusively for debug insns created by
10049 @option{-fvar-tracking-assignments}, but debug insns may get
10050 (non-overlapping) uids above it if the reserved range is exhausted.
10052 @item ipa-sra-ptr-growth-factor
10053 IPA-SRA replaces a pointer to an aggregate with one or more new
10054 parameters only when their cumulative size is less or equal to
10055 @option{ipa-sra-ptr-growth-factor} times the size of the original
10056 pointer parameter.
10058 @item tm-max-aggregate-size
10059 When making copies of thread-local variables in a transaction, this
10060 parameter specifies the size in bytes after which variables are
10061 saved with the logging functions as opposed to save/restore code
10062 sequence pairs.  This option only applies when using
10063 @option{-fgnu-tm}.
10065 @item graphite-max-nb-scop-params
10066 To avoid exponential effects in the Graphite loop transforms, the
10067 number of parameters in a Static Control Part (SCoP) is bounded.  The
10068 default value is 10 parameters.  A variable whose value is unknown at
10069 compilation time and defined outside a SCoP is a parameter of the SCoP.
10071 @item graphite-max-bbs-per-function
10072 To avoid exponential effects in the detection of SCoPs, the size of
10073 the functions analyzed by Graphite is bounded.  The default value is
10074 100 basic blocks.
10076 @item loop-block-tile-size
10077 Loop blocking or strip mining transforms, enabled with
10078 @option{-floop-block} or @option{-floop-strip-mine}, strip mine each
10079 loop in the loop nest by a given number of iterations.  The strip
10080 length can be changed using the @option{loop-block-tile-size}
10081 parameter.  The default value is 51 iterations.
10083 @item ipa-cp-value-list-size
10084 IPA-CP attempts to track all possible values and types passed to a function's
10085 parameter in order to propagate them and perform devirtualization.
10086 @option{ipa-cp-value-list-size} is the maximum number of values and types it
10087 stores per one formal parameter of a function.
10089 @item lto-partitions
10090 Specify desired number of partitions produced during WHOPR compilation.
10091 The number of partitions should exceed the number of CPUs used for compilation.
10092 The default value is 32.
10094 @item lto-minpartition
10095 Size of minimal partition for WHOPR (in estimated instructions).
10096 This prevents expenses of splitting very small programs into too many
10097 partitions.
10099 @item cxx-max-namespaces-for-diagnostic-help
10100 The maximum number of namespaces to consult for suggestions when C++
10101 name lookup fails for an identifier.  The default is 1000.
10103 @item sink-frequency-threshold
10104 The maximum relative execution frequency (in percents) of the target block
10105 relative to a statement's original block to allow statement sinking of a
10106 statement.  Larger numbers result in more aggressive statement sinking.
10107 The default value is 75.  A small positive adjustment is applied for
10108 statements with memory operands as those are even more profitable so sink.
10110 @item max-stores-to-sink
10111 The maximum number of conditional stores paires that can be sunk.  Set to 0
10112 if either vectorization (@option{-ftree-vectorize}) or if-conversion
10113 (@option{-ftree-loop-if-convert}) is disabled.  The default is 2.
10115 @item allow-load-data-races
10116 Allow optimizers to introduce new data races on loads.
10117 Set to 1 to allow, otherwise to 0.  This option is enabled by default
10118 unless implicitly set by the @option{-fmemory-model=} option.
10120 @item allow-store-data-races
10121 Allow optimizers to introduce new data races on stores.
10122 Set to 1 to allow, otherwise to 0.  This option is enabled by default
10123 unless implicitly set by the @option{-fmemory-model=} option.
10125 @item allow-packed-load-data-races
10126 Allow optimizers to introduce new data races on packed data loads.
10127 Set to 1 to allow, otherwise to 0.  This option is enabled by default
10128 unless implicitly set by the @option{-fmemory-model=} option.
10130 @item allow-packed-store-data-races
10131 Allow optimizers to introduce new data races on packed data stores.
10132 Set to 1 to allow, otherwise to 0.  This option is enabled by default
10133 unless implicitly set by the @option{-fmemory-model=} option.
10135 @item case-values-threshold
10136 The smallest number of different values for which it is best to use a
10137 jump-table instead of a tree of conditional branches.  If the value is
10138 0, use the default for the machine.  The default is 0.
10140 @item tree-reassoc-width
10141 Set the maximum number of instructions executed in parallel in
10142 reassociated tree. This parameter overrides target dependent
10143 heuristics used by default if has non zero value.
10145 @item sched-pressure-algorithm
10146 Choose between the two available implementations of
10147 @option{-fsched-pressure}.  Algorithm 1 is the original implementation
10148 and is the more likely to prevent instructions from being reordered.
10149 Algorithm 2 was designed to be a compromise between the relatively
10150 conservative approach taken by algorithm 1 and the rather aggressive
10151 approach taken by the default scheduler.  It relies more heavily on
10152 having a regular register file and accurate register pressure classes.
10153 See @file{haifa-sched.c} in the GCC sources for more details.
10155 The default choice depends on the target.
10157 @item max-slsr-cand-scan
10158 Set the maximum number of existing candidates that will be considered when
10159 seeking a basis for a new straight-line strength reduction candidate.
10161 @item asan-globals
10162 Enable buffer overflow detection for global objects.  This kind
10163 of protection is enabled by default if you are using
10164 @option{-fsanitize=address} option.
10165 To disable global objects protection use @option{--param asan-globals=0}.
10167 @item asan-stack
10168 Enable buffer overflow detection for stack objects.  This kind of
10169 protection is enabled by default when using@option{-fsanitize=address}.
10170 To disable stack protection use @option{--param asan-stack=0} option.
10172 @item asan-instrument-reads
10173 Enable buffer overflow detection for memory reads.  This kind of
10174 protection is enabled by default when using @option{-fsanitize=address}.
10175 To disable memory reads protection use
10176 @option{--param asan-instrument-reads=0}.
10178 @item asan-instrument-writes
10179 Enable buffer overflow detection for memory writes.  This kind of
10180 protection is enabled by default when using @option{-fsanitize=address}.
10181 To disable memory writes protection use
10182 @option{--param asan-instrument-writes=0} option.
10184 @item asan-memintrin
10185 Enable detection for built-in functions.  This kind of protection
10186 is enabled by default when using @option{-fsanitize=address}.
10187 To disable built-in functions protection use
10188 @option{--param asan-memintrin=0}.
10190 @item asan-use-after-return
10191 Enable detection of use-after-return.  This kind of protection
10192 is enabled by default when using @option{-fsanitize=address} option.
10193 To disable use-after-return detection use 
10194 @option{--param asan-use-after-return=0}.
10196 @end table
10197 @end table
10199 @node Preprocessor Options
10200 @section Options Controlling the Preprocessor
10201 @cindex preprocessor options
10202 @cindex options, preprocessor
10204 These options control the C preprocessor, which is run on each C source
10205 file before actual compilation.
10207 If you use the @option{-E} option, nothing is done except preprocessing.
10208 Some of these options make sense only together with @option{-E} because
10209 they cause the preprocessor output to be unsuitable for actual
10210 compilation.
10212 @table @gcctabopt
10213 @item -Wp,@var{option}
10214 @opindex Wp
10215 You can use @option{-Wp,@var{option}} to bypass the compiler driver
10216 and pass @var{option} directly through to the preprocessor.  If
10217 @var{option} contains commas, it is split into multiple options at the
10218 commas.  However, many options are modified, translated or interpreted
10219 by the compiler driver before being passed to the preprocessor, and
10220 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
10221 interface is undocumented and subject to change, so whenever possible
10222 you should avoid using @option{-Wp} and let the driver handle the
10223 options instead.
10225 @item -Xpreprocessor @var{option}
10226 @opindex Xpreprocessor
10227 Pass @var{option} as an option to the preprocessor.  You can use this to
10228 supply system-specific preprocessor options that GCC does not 
10229 recognize.
10231 If you want to pass an option that takes an argument, you must use
10232 @option{-Xpreprocessor} twice, once for the option and once for the argument.
10234 @item -no-integrated-cpp
10235 @opindex no-integrated-cpp
10236 Perform preprocessing as a separate pass before compilation.
10237 By default, GCC performs preprocessing as an integrated part of
10238 input tokenization and parsing.
10239 If this option is provided, the appropriate language front end
10240 (@command{cc1}, @command{cc1plus}, or @command{cc1obj} for C, C++,
10241 and Objective-C, respectively) is instead invoked twice,
10242 once for preprocessing only and once for actual compilation
10243 of the preprocessed input.
10244 This option may be useful in conjunction with the @option{-B} or
10245 @option{-wrapper} options to specify an alternate preprocessor or
10246 perform additional processing of the program source between
10247 normal preprocessing and compilation.
10248 @end table
10250 @include cppopts.texi
10252 @node Assembler Options
10253 @section Passing Options to the Assembler
10255 @c prevent bad page break with this line
10256 You can pass options to the assembler.
10258 @table @gcctabopt
10259 @item -Wa,@var{option}
10260 @opindex Wa
10261 Pass @var{option} as an option to the assembler.  If @var{option}
10262 contains commas, it is split into multiple options at the commas.
10264 @item -Xassembler @var{option}
10265 @opindex Xassembler
10266 Pass @var{option} as an option to the assembler.  You can use this to
10267 supply system-specific assembler options that GCC does not
10268 recognize.
10270 If you want to pass an option that takes an argument, you must use
10271 @option{-Xassembler} twice, once for the option and once for the argument.
10273 @end table
10275 @node Link Options
10276 @section Options for Linking
10277 @cindex link options
10278 @cindex options, linking
10280 These options come into play when the compiler links object files into
10281 an executable output file.  They are meaningless if the compiler is
10282 not doing a link step.
10284 @table @gcctabopt
10285 @cindex file names
10286 @item @var{object-file-name}
10287 A file name that does not end in a special recognized suffix is
10288 considered to name an object file or library.  (Object files are
10289 distinguished from libraries by the linker according to the file
10290 contents.)  If linking is done, these object files are used as input
10291 to the linker.
10293 @item -c
10294 @itemx -S
10295 @itemx -E
10296 @opindex c
10297 @opindex S
10298 @opindex E
10299 If any of these options is used, then the linker is not run, and
10300 object file names should not be used as arguments.  @xref{Overall
10301 Options}.
10303 @cindex Libraries
10304 @item -l@var{library}
10305 @itemx -l @var{library}
10306 @opindex l
10307 Search the library named @var{library} when linking.  (The second
10308 alternative with the library as a separate argument is only for
10309 POSIX compliance and is not recommended.)
10311 It makes a difference where in the command you write this option; the
10312 linker searches and processes libraries and object files in the order they
10313 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
10314 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
10315 to functions in @samp{z}, those functions may not be loaded.
10317 The linker searches a standard list of directories for the library,
10318 which is actually a file named @file{lib@var{library}.a}.  The linker
10319 then uses this file as if it had been specified precisely by name.
10321 The directories searched include several standard system directories
10322 plus any that you specify with @option{-L}.
10324 Normally the files found this way are library files---archive files
10325 whose members are object files.  The linker handles an archive file by
10326 scanning through it for members which define symbols that have so far
10327 been referenced but not defined.  But if the file that is found is an
10328 ordinary object file, it is linked in the usual fashion.  The only
10329 difference between using an @option{-l} option and specifying a file name
10330 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
10331 and searches several directories.
10333 @item -lobjc
10334 @opindex lobjc
10335 You need this special case of the @option{-l} option in order to
10336 link an Objective-C or Objective-C++ program.
10338 @item -nostartfiles
10339 @opindex nostartfiles
10340 Do not use the standard system startup files when linking.
10341 The standard system libraries are used normally, unless @option{-nostdlib}
10342 or @option{-nodefaultlibs} is used.
10344 @item -nodefaultlibs
10345 @opindex nodefaultlibs
10346 Do not use the standard system libraries when linking.
10347 Only the libraries you specify are passed to the linker, and options
10348 specifying linkage of the system libraries, such as @code{-static-libgcc}
10349 or @code{-shared-libgcc}, are ignored.  
10350 The standard startup files are used normally, unless @option{-nostartfiles}
10351 is used.  
10353 The compiler may generate calls to @code{memcmp},
10354 @code{memset}, @code{memcpy} and @code{memmove}.
10355 These entries are usually resolved by entries in
10356 libc.  These entry points should be supplied through some other
10357 mechanism when this option is specified.
10359 @item -nostdlib
10360 @opindex nostdlib
10361 Do not use the standard system startup files or libraries when linking.
10362 No startup files and only the libraries you specify are passed to
10363 the linker, and options specifying linkage of the system libraries, such as
10364 @code{-static-libgcc} or @code{-shared-libgcc}, are ignored.
10366 The compiler may generate calls to @code{memcmp}, @code{memset},
10367 @code{memcpy} and @code{memmove}.
10368 These entries are usually resolved by entries in
10369 libc.  These entry points should be supplied through some other
10370 mechanism when this option is specified.
10372 @cindex @option{-lgcc}, use with @option{-nostdlib}
10373 @cindex @option{-nostdlib} and unresolved references
10374 @cindex unresolved references and @option{-nostdlib}
10375 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
10376 @cindex @option{-nodefaultlibs} and unresolved references
10377 @cindex unresolved references and @option{-nodefaultlibs}
10378 One of the standard libraries bypassed by @option{-nostdlib} and
10379 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
10380 which GCC uses to overcome shortcomings of particular machines, or special
10381 needs for some languages.
10382 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
10383 Collection (GCC) Internals},
10384 for more discussion of @file{libgcc.a}.)
10385 In most cases, you need @file{libgcc.a} even when you want to avoid
10386 other standard libraries.  In other words, when you specify @option{-nostdlib}
10387 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
10388 This ensures that you have no unresolved references to internal GCC
10389 library subroutines.
10390 (An example of such an internal subroutine is @samp{__main}, used to ensure C++
10391 constructors are called; @pxref{Collect2,,@code{collect2}, gccint,
10392 GNU Compiler Collection (GCC) Internals}.)
10394 @item -pie
10395 @opindex pie
10396 Produce a position independent executable on targets that support it.
10397 For predictable results, you must also specify the same set of options
10398 used for compilation (@option{-fpie}, @option{-fPIE},
10399 or model suboptions) when you specify this linker option.
10401 @item -rdynamic
10402 @opindex rdynamic
10403 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
10404 that support it. This instructs the linker to add all symbols, not
10405 only used ones, to the dynamic symbol table. This option is needed
10406 for some uses of @code{dlopen} or to allow obtaining backtraces
10407 from within a program.
10409 @item -s
10410 @opindex s
10411 Remove all symbol table and relocation information from the executable.
10413 @item -static
10414 @opindex static
10415 On systems that support dynamic linking, this prevents linking with the shared
10416 libraries.  On other systems, this option has no effect.
10418 @item -shared
10419 @opindex shared
10420 Produce a shared object which can then be linked with other objects to
10421 form an executable.  Not all systems support this option.  For predictable
10422 results, you must also specify the same set of options used for compilation
10423 (@option{-fpic}, @option{-fPIC}, or model suboptions) when
10424 you specify this linker option.@footnote{On some systems, @samp{gcc -shared}
10425 needs to build supplementary stub code for constructors to work.  On
10426 multi-libbed systems, @samp{gcc -shared} must select the correct support
10427 libraries to link against.  Failing to supply the correct flags may lead
10428 to subtle defects.  Supplying them in cases where they are not necessary
10429 is innocuous.}
10431 @item -shared-libgcc
10432 @itemx -static-libgcc
10433 @opindex shared-libgcc
10434 @opindex static-libgcc
10435 On systems that provide @file{libgcc} as a shared library, these options
10436 force the use of either the shared or static version, respectively.
10437 If no shared version of @file{libgcc} was built when the compiler was
10438 configured, these options have no effect.
10440 There are several situations in which an application should use the
10441 shared @file{libgcc} instead of the static version.  The most common
10442 of these is when the application wishes to throw and catch exceptions
10443 across different shared libraries.  In that case, each of the libraries
10444 as well as the application itself should use the shared @file{libgcc}.
10446 Therefore, the G++ and GCJ drivers automatically add
10447 @option{-shared-libgcc} whenever you build a shared library or a main
10448 executable, because C++ and Java programs typically use exceptions, so
10449 this is the right thing to do.
10451 If, instead, you use the GCC driver to create shared libraries, you may
10452 find that they are not always linked with the shared @file{libgcc}.
10453 If GCC finds, at its configuration time, that you have a non-GNU linker
10454 or a GNU linker that does not support option @option{--eh-frame-hdr},
10455 it links the shared version of @file{libgcc} into shared libraries
10456 by default.  Otherwise, it takes advantage of the linker and optimizes
10457 away the linking with the shared version of @file{libgcc}, linking with
10458 the static version of libgcc by default.  This allows exceptions to
10459 propagate through such shared libraries, without incurring relocation
10460 costs at library load time.
10462 However, if a library or main executable is supposed to throw or catch
10463 exceptions, you must link it using the G++ or GCJ driver, as appropriate
10464 for the languages used in the program, or using the option
10465 @option{-shared-libgcc}, such that it is linked with the shared
10466 @file{libgcc}.
10468 @item -static-libasan
10469 @opindex static-libasan
10470 When the @option{-fsanitize=address} option is used to link a program,
10471 the GCC driver automatically links against @option{libasan}.  If
10472 @file{libasan} is available as a shared library, and the @option{-static}
10473 option is not used, then this links against the shared version of
10474 @file{libasan}.  The @option{-static-libasan} option directs the GCC
10475 driver to link @file{libasan} statically, without necessarily linking
10476 other libraries statically.
10478 @item -static-libtsan
10479 @opindex static-libtsan
10480 When the @option{-fsanitize=thread} option is used to link a program,
10481 the GCC driver automatically links against @option{libtsan}.  If
10482 @file{libtsan} is available as a shared library, and the @option{-static}
10483 option is not used, then this links against the shared version of
10484 @file{libtsan}.  The @option{-static-libtsan} option directs the GCC
10485 driver to link @file{libtsan} statically, without necessarily linking
10486 other libraries statically.
10488 @item -static-liblsan
10489 @opindex static-liblsan
10490 When the @option{-fsanitize=leak} option is used to link a program,
10491 the GCC driver automatically links against @option{liblsan}.  If
10492 @file{liblsan} is available as a shared library, and the @option{-static}
10493 option is not used, then this links against the shared version of
10494 @file{liblsan}.  The @option{-static-liblsan} option directs the GCC
10495 driver to link @file{liblsan} statically, without necessarily linking
10496 other libraries statically.
10498 @item -static-libubsan
10499 @opindex static-libubsan
10500 When the @option{-fsanitize=undefined} option is used to link a program,
10501 the GCC driver automatically links against @option{libubsan}.  If
10502 @file{libubsan} is available as a shared library, and the @option{-static}
10503 option is not used, then this links against the shared version of
10504 @file{libubsan}.  The @option{-static-libubsan} option directs the GCC
10505 driver to link @file{libubsan} statically, without necessarily linking
10506 other libraries statically.
10508 @item -static-libstdc++
10509 @opindex static-libstdc++
10510 When the @command{g++} program is used to link a C++ program, it
10511 normally automatically links against @option{libstdc++}.  If
10512 @file{libstdc++} is available as a shared library, and the
10513 @option{-static} option is not used, then this links against the
10514 shared version of @file{libstdc++}.  That is normally fine.  However, it
10515 is sometimes useful to freeze the version of @file{libstdc++} used by
10516 the program without going all the way to a fully static link.  The
10517 @option{-static-libstdc++} option directs the @command{g++} driver to
10518 link @file{libstdc++} statically, without necessarily linking other
10519 libraries statically.
10521 @item -symbolic
10522 @opindex symbolic
10523 Bind references to global symbols when building a shared object.  Warn
10524 about any unresolved references (unless overridden by the link editor
10525 option @option{-Xlinker -z -Xlinker defs}).  Only a few systems support
10526 this option.
10528 @item -T @var{script}
10529 @opindex T
10530 @cindex linker script
10531 Use @var{script} as the linker script.  This option is supported by most
10532 systems using the GNU linker.  On some targets, such as bare-board
10533 targets without an operating system, the @option{-T} option may be required
10534 when linking to avoid references to undefined symbols.
10536 @item -Xlinker @var{option}
10537 @opindex Xlinker
10538 Pass @var{option} as an option to the linker.  You can use this to
10539 supply system-specific linker options that GCC does not recognize.
10541 If you want to pass an option that takes a separate argument, you must use
10542 @option{-Xlinker} twice, once for the option and once for the argument.
10543 For example, to pass @option{-assert definitions}, you must write
10544 @option{-Xlinker -assert -Xlinker definitions}.  It does not work to write
10545 @option{-Xlinker "-assert definitions"}, because this passes the entire
10546 string as a single argument, which is not what the linker expects.
10548 When using the GNU linker, it is usually more convenient to pass
10549 arguments to linker options using the @option{@var{option}=@var{value}}
10550 syntax than as separate arguments.  For example, you can specify
10551 @option{-Xlinker -Map=output.map} rather than
10552 @option{-Xlinker -Map -Xlinker output.map}.  Other linkers may not support
10553 this syntax for command-line options.
10555 @item -Wl,@var{option}
10556 @opindex Wl
10557 Pass @var{option} as an option to the linker.  If @var{option} contains
10558 commas, it is split into multiple options at the commas.  You can use this
10559 syntax to pass an argument to the option.
10560 For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
10561 linker.  When using the GNU linker, you can also get the same effect with
10562 @option{-Wl,-Map=output.map}.
10564 @item -u @var{symbol}
10565 @opindex u
10566 Pretend the symbol @var{symbol} is undefined, to force linking of
10567 library modules to define it.  You can use @option{-u} multiple times with
10568 different symbols to force loading of additional library modules.
10569 @end table
10571 @node Directory Options
10572 @section Options for Directory Search
10573 @cindex directory options
10574 @cindex options, directory search
10575 @cindex search path
10577 These options specify directories to search for header files, for
10578 libraries and for parts of the compiler:
10580 @table @gcctabopt
10581 @item -I@var{dir}
10582 @opindex I
10583 Add the directory @var{dir} to the head of the list of directories to be
10584 searched for header files.  This can be used to override a system header
10585 file, substituting your own version, since these directories are
10586 searched before the system header file directories.  However, you should
10587 not use this option to add directories that contain vendor-supplied
10588 system header files (use @option{-isystem} for that).  If you use more than
10589 one @option{-I} option, the directories are scanned in left-to-right
10590 order; the standard system directories come after.
10592 If a standard system include directory, or a directory specified with
10593 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
10594 option is ignored.  The directory is still searched but as a
10595 system directory at its normal position in the system include chain.
10596 This is to ensure that GCC's procedure to fix buggy system headers and
10597 the ordering for the @code{include_next} directive are not inadvertently changed.
10598 If you really need to change the search order for system directories,
10599 use the @option{-nostdinc} and/or @option{-isystem} options.
10601 @item -iplugindir=@var{dir}
10602 @opindex iplugindir=
10603 Set the directory to search for plugins that are passed
10604 by @option{-fplugin=@var{name}} instead of
10605 @option{-fplugin=@var{path}/@var{name}.so}.  This option is not meant
10606 to be used by the user, but only passed by the driver.
10608 @item -iquote@var{dir}
10609 @opindex iquote
10610 Add the directory @var{dir} to the head of the list of directories to
10611 be searched for header files only for the case of @samp{#include
10612 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
10613 otherwise just like @option{-I}.
10615 @item -L@var{dir}
10616 @opindex L
10617 Add directory @var{dir} to the list of directories to be searched
10618 for @option{-l}.
10620 @item -B@var{prefix}
10621 @opindex B
10622 This option specifies where to find the executables, libraries,
10623 include files, and data files of the compiler itself.
10625 The compiler driver program runs one or more of the subprograms
10626 @command{cpp}, @command{cc1}, @command{as} and @command{ld}.  It tries
10627 @var{prefix} as a prefix for each program it tries to run, both with and
10628 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
10630 For each subprogram to be run, the compiler driver first tries the
10631 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
10632 is not specified, the driver tries two standard prefixes, 
10633 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
10634 those results in a file name that is found, the unmodified program
10635 name is searched for using the directories specified in your
10636 @env{PATH} environment variable.
10638 The compiler checks to see if the path provided by the @option{-B}
10639 refers to a directory, and if necessary it adds a directory
10640 separator character at the end of the path.
10642 @option{-B} prefixes that effectively specify directory names also apply
10643 to libraries in the linker, because the compiler translates these
10644 options into @option{-L} options for the linker.  They also apply to
10645 include files in the preprocessor, because the compiler translates these
10646 options into @option{-isystem} options for the preprocessor.  In this case,
10647 the compiler appends @samp{include} to the prefix.
10649 The runtime support file @file{libgcc.a} can also be searched for using
10650 the @option{-B} prefix, if needed.  If it is not found there, the two
10651 standard prefixes above are tried, and that is all.  The file is left
10652 out of the link if it is not found by those means.
10654 Another way to specify a prefix much like the @option{-B} prefix is to use
10655 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
10656 Variables}.
10658 As a special kludge, if the path provided by @option{-B} is
10659 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
10660 9, then it is replaced by @file{[dir/]include}.  This is to help
10661 with boot-strapping the compiler.
10663 @item -specs=@var{file}
10664 @opindex specs
10665 Process @var{file} after the compiler reads in the standard @file{specs}
10666 file, in order to override the defaults which the @command{gcc} driver
10667 program uses when determining what switches to pass to @command{cc1},
10668 @command{cc1plus}, @command{as}, @command{ld}, etc.  More than one
10669 @option{-specs=@var{file}} can be specified on the command line, and they
10670 are processed in order, from left to right.
10672 @item --sysroot=@var{dir}
10673 @opindex sysroot
10674 Use @var{dir} as the logical root directory for headers and libraries.
10675 For example, if the compiler normally searches for headers in
10676 @file{/usr/include} and libraries in @file{/usr/lib}, it instead
10677 searches @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
10679 If you use both this option and the @option{-isysroot} option, then
10680 the @option{--sysroot} option applies to libraries, but the
10681 @option{-isysroot} option applies to header files.
10683 The GNU linker (beginning with version 2.16) has the necessary support
10684 for this option.  If your linker does not support this option, the
10685 header file aspect of @option{--sysroot} still works, but the
10686 library aspect does not.
10688 @item --no-sysroot-suffix
10689 @opindex no-sysroot-suffix
10690 For some targets, a suffix is added to the root directory specified
10691 with @option{--sysroot}, depending on the other options used, so that
10692 headers may for example be found in
10693 @file{@var{dir}/@var{suffix}/usr/include} instead of
10694 @file{@var{dir}/usr/include}.  This option disables the addition of
10695 such a suffix.
10697 @item -I-
10698 @opindex I-
10699 This option has been deprecated.  Please use @option{-iquote} instead for
10700 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
10701 Any directories you specify with @option{-I} options before the @option{-I-}
10702 option are searched only for the case of @samp{#include "@var{file}"};
10703 they are not searched for @samp{#include <@var{file}>}.
10705 If additional directories are specified with @option{-I} options after
10706 the @option{-I-}, these directories are searched for all @samp{#include}
10707 directives.  (Ordinarily @emph{all} @option{-I} directories are used
10708 this way.)
10710 In addition, the @option{-I-} option inhibits the use of the current
10711 directory (where the current input file came from) as the first search
10712 directory for @samp{#include "@var{file}"}.  There is no way to
10713 override this effect of @option{-I-}.  With @option{-I.} you can specify
10714 searching the directory that is current when the compiler is
10715 invoked.  That is not exactly the same as what the preprocessor does
10716 by default, but it is often satisfactory.
10718 @option{-I-} does not inhibit the use of the standard system directories
10719 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
10720 independent.
10721 @end table
10723 @c man end
10725 @node Spec Files
10726 @section Specifying subprocesses and the switches to pass to them
10727 @cindex Spec Files
10729 @command{gcc} is a driver program.  It performs its job by invoking a
10730 sequence of other programs to do the work of compiling, assembling and
10731 linking.  GCC interprets its command-line parameters and uses these to
10732 deduce which programs it should invoke, and which command-line options
10733 it ought to place on their command lines.  This behavior is controlled
10734 by @dfn{spec strings}.  In most cases there is one spec string for each
10735 program that GCC can invoke, but a few programs have multiple spec
10736 strings to control their behavior.  The spec strings built into GCC can
10737 be overridden by using the @option{-specs=} command-line switch to specify
10738 a spec file.
10740 @dfn{Spec files} are plaintext files that are used to construct spec
10741 strings.  They consist of a sequence of directives separated by blank
10742 lines.  The type of directive is determined by the first non-whitespace
10743 character on the line, which can be one of the following:
10745 @table @code
10746 @item %@var{command}
10747 Issues a @var{command} to the spec file processor.  The commands that can
10748 appear here are:
10750 @table @code
10751 @item %include <@var{file}>
10752 @cindex @code{%include}
10753 Search for @var{file} and insert its text at the current point in the
10754 specs file.
10756 @item %include_noerr <@var{file}>
10757 @cindex @code{%include_noerr}
10758 Just like @samp{%include}, but do not generate an error message if the include
10759 file cannot be found.
10761 @item %rename @var{old_name} @var{new_name}
10762 @cindex @code{%rename}
10763 Rename the spec string @var{old_name} to @var{new_name}.
10765 @end table
10767 @item *[@var{spec_name}]:
10768 This tells the compiler to create, override or delete the named spec
10769 string.  All lines after this directive up to the next directive or
10770 blank line are considered to be the text for the spec string.  If this
10771 results in an empty string then the spec is deleted.  (Or, if the
10772 spec did not exist, then nothing happens.)  Otherwise, if the spec
10773 does not currently exist a new spec is created.  If the spec does
10774 exist then its contents are overridden by the text of this
10775 directive, unless the first character of that text is the @samp{+}
10776 character, in which case the text is appended to the spec.
10778 @item [@var{suffix}]:
10779 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
10780 and up to the next directive or blank line are considered to make up the
10781 spec string for the indicated suffix.  When the compiler encounters an
10782 input file with the named suffix, it processes the spec string in
10783 order to work out how to compile that file.  For example:
10785 @smallexample
10786 .ZZ:
10787 z-compile -input %i
10788 @end smallexample
10790 This says that any input file whose name ends in @samp{.ZZ} should be
10791 passed to the program @samp{z-compile}, which should be invoked with the
10792 command-line switch @option{-input} and with the result of performing the
10793 @samp{%i} substitution.  (See below.)
10795 As an alternative to providing a spec string, the text following a
10796 suffix directive can be one of the following:
10798 @table @code
10799 @item @@@var{language}
10800 This says that the suffix is an alias for a known @var{language}.  This is
10801 similar to using the @option{-x} command-line switch to GCC to specify a
10802 language explicitly.  For example:
10804 @smallexample
10805 .ZZ:
10806 @@c++
10807 @end smallexample
10809 Says that .ZZ files are, in fact, C++ source files.
10811 @item #@var{name}
10812 This causes an error messages saying:
10814 @smallexample
10815 @var{name} compiler not installed on this system.
10816 @end smallexample
10817 @end table
10819 GCC already has an extensive list of suffixes built into it.
10820 This directive adds an entry to the end of the list of suffixes, but
10821 since the list is searched from the end backwards, it is effectively
10822 possible to override earlier entries using this technique.
10824 @end table
10826 GCC has the following spec strings built into it.  Spec files can
10827 override these strings or create their own.  Note that individual
10828 targets can also add their own spec strings to this list.
10830 @smallexample
10831 asm          Options to pass to the assembler
10832 asm_final    Options to pass to the assembler post-processor
10833 cpp          Options to pass to the C preprocessor
10834 cc1          Options to pass to the C compiler
10835 cc1plus      Options to pass to the C++ compiler
10836 endfile      Object files to include at the end of the link
10837 link         Options to pass to the linker
10838 lib          Libraries to include on the command line to the linker
10839 libgcc       Decides which GCC support library to pass to the linker
10840 linker       Sets the name of the linker
10841 predefines   Defines to be passed to the C preprocessor
10842 signed_char  Defines to pass to CPP to say whether @code{char} is signed
10843              by default
10844 startfile    Object files to include at the start of the link
10845 @end smallexample
10847 Here is a small example of a spec file:
10849 @smallexample
10850 %rename lib                 old_lib
10852 *lib:
10853 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
10854 @end smallexample
10856 This example renames the spec called @samp{lib} to @samp{old_lib} and
10857 then overrides the previous definition of @samp{lib} with a new one.
10858 The new definition adds in some extra command-line options before
10859 including the text of the old definition.
10861 @dfn{Spec strings} are a list of command-line options to be passed to their
10862 corresponding program.  In addition, the spec strings can contain
10863 @samp{%}-prefixed sequences to substitute variable text or to
10864 conditionally insert text into the command line.  Using these constructs
10865 it is possible to generate quite complex command lines.
10867 Here is a table of all defined @samp{%}-sequences for spec
10868 strings.  Note that spaces are not generated automatically around the
10869 results of expanding these sequences.  Therefore you can concatenate them
10870 together or combine them with constant text in a single argument.
10872 @table @code
10873 @item %%
10874 Substitute one @samp{%} into the program name or argument.
10876 @item %i
10877 Substitute the name of the input file being processed.
10879 @item %b
10880 Substitute the basename of the input file being processed.
10881 This is the substring up to (and not including) the last period
10882 and not including the directory.
10884 @item %B
10885 This is the same as @samp{%b}, but include the file suffix (text after
10886 the last period).
10888 @item %d
10889 Marks the argument containing or following the @samp{%d} as a
10890 temporary file name, so that that file is deleted if GCC exits
10891 successfully.  Unlike @samp{%g}, this contributes no text to the
10892 argument.
10894 @item %g@var{suffix}
10895 Substitute a file name that has suffix @var{suffix} and is chosen
10896 once per compilation, and mark the argument in the same way as
10897 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
10898 name is now chosen in a way that is hard to predict even when previously
10899 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
10900 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
10901 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
10902 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
10903 was simply substituted with a file name chosen once per compilation,
10904 without regard to any appended suffix (which was therefore treated
10905 just like ordinary text), making such attacks more likely to succeed.
10907 @item %u@var{suffix}
10908 Like @samp{%g}, but generates a new temporary file name
10909 each time it appears instead of once per compilation.
10911 @item %U@var{suffix}
10912 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
10913 new one if there is no such last file name.  In the absence of any
10914 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
10915 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
10916 involves the generation of two distinct file names, one
10917 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
10918 simply substituted with a file name chosen for the previous @samp{%u},
10919 without regard to any appended suffix.
10921 @item %j@var{suffix}
10922 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
10923 writable, and if @option{-save-temps} is not used; 
10924 otherwise, substitute the name
10925 of a temporary file, just like @samp{%u}.  This temporary file is not
10926 meant for communication between processes, but rather as a junk
10927 disposal mechanism.
10929 @item %|@var{suffix}
10930 @itemx %m@var{suffix}
10931 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
10932 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
10933 all.  These are the two most common ways to instruct a program that it
10934 should read from standard input or write to standard output.  If you
10935 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
10936 construct: see for example @file{f/lang-specs.h}.
10938 @item %.@var{SUFFIX}
10939 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
10940 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
10941 terminated by the next space or %.
10943 @item %w
10944 Marks the argument containing or following the @samp{%w} as the
10945 designated output file of this compilation.  This puts the argument
10946 into the sequence of arguments that @samp{%o} substitutes.
10948 @item %o
10949 Substitutes the names of all the output files, with spaces
10950 automatically placed around them.  You should write spaces
10951 around the @samp{%o} as well or the results are undefined.
10952 @samp{%o} is for use in the specs for running the linker.
10953 Input files whose names have no recognized suffix are not compiled
10954 at all, but they are included among the output files, so they are
10955 linked.
10957 @item %O
10958 Substitutes the suffix for object files.  Note that this is
10959 handled specially when it immediately follows @samp{%g, %u, or %U},
10960 because of the need for those to form complete file names.  The
10961 handling is such that @samp{%O} is treated exactly as if it had already
10962 been substituted, except that @samp{%g, %u, and %U} do not currently
10963 support additional @var{suffix} characters following @samp{%O} as they do
10964 following, for example, @samp{.o}.
10966 @item %p
10967 Substitutes the standard macro predefinitions for the
10968 current target machine.  Use this when running @code{cpp}.
10970 @item %P
10971 Like @samp{%p}, but puts @samp{__} before and after the name of each
10972 predefined macro, except for macros that start with @samp{__} or with
10973 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
10976 @item %I
10977 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
10978 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
10979 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
10980 and @option{-imultilib} as necessary.
10982 @item %s
10983 Current argument is the name of a library or startup file of some sort.
10984 Search for that file in a standard list of directories and substitute
10985 the full name found.  The current working directory is included in the
10986 list of directories scanned.
10988 @item %T
10989 Current argument is the name of a linker script.  Search for that file
10990 in the current list of directories to scan for libraries. If the file
10991 is located insert a @option{--script} option into the command line
10992 followed by the full path name found.  If the file is not found then
10993 generate an error message.  Note: the current working directory is not
10994 searched.
10996 @item %e@var{str}
10997 Print @var{str} as an error message.  @var{str} is terminated by a newline.
10998 Use this when inconsistent options are detected.
11000 @item %(@var{name})
11001 Substitute the contents of spec string @var{name} at this point.
11003 @item %x@{@var{option}@}
11004 Accumulate an option for @samp{%X}.
11006 @item %X
11007 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
11008 spec string.
11010 @item %Y
11011 Output the accumulated assembler options specified by @option{-Wa}.
11013 @item %Z
11014 Output the accumulated preprocessor options specified by @option{-Wp}.
11016 @item %a
11017 Process the @code{asm} spec.  This is used to compute the
11018 switches to be passed to the assembler.
11020 @item %A
11021 Process the @code{asm_final} spec.  This is a spec string for
11022 passing switches to an assembler post-processor, if such a program is
11023 needed.
11025 @item %l
11026 Process the @code{link} spec.  This is the spec for computing the
11027 command line passed to the linker.  Typically it makes use of the
11028 @samp{%L %G %S %D and %E} sequences.
11030 @item %D
11031 Dump out a @option{-L} option for each directory that GCC believes might
11032 contain startup files.  If the target supports multilibs then the
11033 current multilib directory is prepended to each of these paths.
11035 @item %L
11036 Process the @code{lib} spec.  This is a spec string for deciding which
11037 libraries are included on the command line to the linker.
11039 @item %G
11040 Process the @code{libgcc} spec.  This is a spec string for deciding
11041 which GCC support library is included on the command line to the linker.
11043 @item %S
11044 Process the @code{startfile} spec.  This is a spec for deciding which
11045 object files are the first ones passed to the linker.  Typically
11046 this might be a file named @file{crt0.o}.
11048 @item %E
11049 Process the @code{endfile} spec.  This is a spec string that specifies
11050 the last object files that are passed to the linker.
11052 @item %C
11053 Process the @code{cpp} spec.  This is used to construct the arguments
11054 to be passed to the C preprocessor.
11056 @item %1
11057 Process the @code{cc1} spec.  This is used to construct the options to be
11058 passed to the actual C compiler (@samp{cc1}).
11060 @item %2
11061 Process the @code{cc1plus} spec.  This is used to construct the options to be
11062 passed to the actual C++ compiler (@samp{cc1plus}).
11064 @item %*
11065 Substitute the variable part of a matched option.  See below.
11066 Note that each comma in the substituted string is replaced by
11067 a single space.
11069 @item %<@code{S}
11070 Remove all occurrences of @code{-S} from the command line.  Note---this
11071 command is position dependent.  @samp{%} commands in the spec string
11072 before this one see @code{-S}, @samp{%} commands in the spec string
11073 after this one do not.
11075 @item %:@var{function}(@var{args})
11076 Call the named function @var{function}, passing it @var{args}.
11077 @var{args} is first processed as a nested spec string, then split
11078 into an argument vector in the usual fashion.  The function returns
11079 a string which is processed as if it had appeared literally as part
11080 of the current spec.
11082 The following built-in spec functions are provided:
11084 @table @code
11085 @item @code{getenv}
11086 The @code{getenv} spec function takes two arguments: an environment
11087 variable name and a string.  If the environment variable is not
11088 defined, a fatal error is issued.  Otherwise, the return value is the
11089 value of the environment variable concatenated with the string.  For
11090 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
11092 @smallexample
11093 %:getenv(TOPDIR /include)
11094 @end smallexample
11096 expands to @file{/path/to/top/include}.
11098 @item @code{if-exists}
11099 The @code{if-exists} spec function takes one argument, an absolute
11100 pathname to a file.  If the file exists, @code{if-exists} returns the
11101 pathname.  Here is a small example of its usage:
11103 @smallexample
11104 *startfile:
11105 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
11106 @end smallexample
11108 @item @code{if-exists-else}
11109 The @code{if-exists-else} spec function is similar to the @code{if-exists}
11110 spec function, except that it takes two arguments.  The first argument is
11111 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
11112 returns the pathname.  If it does not exist, it returns the second argument.
11113 This way, @code{if-exists-else} can be used to select one file or another,
11114 based on the existence of the first.  Here is a small example of its usage:
11116 @smallexample
11117 *startfile:
11118 crt0%O%s %:if-exists(crti%O%s) \
11119 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
11120 @end smallexample
11122 @item @code{replace-outfile}
11123 The @code{replace-outfile} spec function takes two arguments.  It looks for the
11124 first argument in the outfiles array and replaces it with the second argument.  Here
11125 is a small example of its usage:
11127 @smallexample
11128 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
11129 @end smallexample
11131 @item @code{remove-outfile}
11132 The @code{remove-outfile} spec function takes one argument.  It looks for the
11133 first argument in the outfiles array and removes it.  Here is a small example
11134 its usage:
11136 @smallexample
11137 %:remove-outfile(-lm)
11138 @end smallexample
11140 @item @code{pass-through-libs}
11141 The @code{pass-through-libs} spec function takes any number of arguments.  It
11142 finds any @option{-l} options and any non-options ending in @file{.a} (which it
11143 assumes are the names of linker input library archive files) and returns a
11144 result containing all the found arguments each prepended by
11145 @option{-plugin-opt=-pass-through=} and joined by spaces.  This list is
11146 intended to be passed to the LTO linker plugin.
11148 @smallexample
11149 %:pass-through-libs(%G %L %G)
11150 @end smallexample
11152 @item @code{print-asm-header}
11153 The @code{print-asm-header} function takes no arguments and simply
11154 prints a banner like:
11156 @smallexample
11157 Assembler options
11158 =================
11160 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
11161 @end smallexample
11163 It is used to separate compiler options from assembler options
11164 in the @option{--target-help} output.
11165 @end table
11167 @item %@{@code{S}@}
11168 Substitutes the @code{-S} switch, if that switch is given to GCC@.
11169 If that switch is not specified, this substitutes nothing.  Note that
11170 the leading dash is omitted when specifying this option, and it is
11171 automatically inserted if the substitution is performed.  Thus the spec
11172 string @samp{%@{foo@}} matches the command-line option @option{-foo}
11173 and outputs the command-line option @option{-foo}.
11175 @item %W@{@code{S}@}
11176 Like %@{@code{S}@} but mark last argument supplied within as a file to be
11177 deleted on failure.
11179 @item %@{@code{S}*@}
11180 Substitutes all the switches specified to GCC whose names start
11181 with @code{-S}, but which also take an argument.  This is used for
11182 switches like @option{-o}, @option{-D}, @option{-I}, etc.
11183 GCC considers @option{-o foo} as being
11184 one switch whose name starts with @samp{o}.  %@{o*@} substitutes this
11185 text, including the space.  Thus two arguments are generated.
11187 @item %@{@code{S}*&@code{T}*@}
11188 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
11189 (the order of @code{S} and @code{T} in the spec is not significant).
11190 There can be any number of ampersand-separated variables; for each the
11191 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
11193 @item %@{@code{S}:@code{X}@}
11194 Substitutes @code{X}, if the @option{-S} switch is given to GCC@.
11196 @item %@{!@code{S}:@code{X}@}
11197 Substitutes @code{X}, if the @option{-S} switch is @emph{not} given to GCC@.
11199 @item %@{@code{S}*:@code{X}@}
11200 Substitutes @code{X} if one or more switches whose names start with
11201 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
11202 once, no matter how many such switches appeared.  However, if @code{%*}
11203 appears somewhere in @code{X}, then @code{X} is substituted once
11204 for each matching switch, with the @code{%*} replaced by the part of
11205 that switch matching the @code{*}.
11207 If @code{%*} appears as the last part of a spec sequence then a space
11208 will be added after the end of the last substitution.  If there is more
11209 text in the sequence however then a space will not be generated.  This
11210 allows the @code{%*} substitution to be used as part of a larger
11211 string.  For example, a spec string like this:
11213 @smallexample
11214 %@{mcu=*:--script=%*/memory.ld@}
11215 @end smallexample
11217 when matching an option like @code{-mcu=newchip} will produce:
11219 @smallexample
11220 --script=newchip/memory.ld
11221 @end smallexample
11223 @item %@{.@code{S}:@code{X}@}
11224 Substitutes @code{X}, if processing a file with suffix @code{S}.
11226 @item %@{!.@code{S}:@code{X}@}
11227 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
11229 @item %@{,@code{S}:@code{X}@}
11230 Substitutes @code{X}, if processing a file for language @code{S}.
11232 @item %@{!,@code{S}:@code{X}@}
11233 Substitutes @code{X}, if not processing a file for language @code{S}.
11235 @item %@{@code{S}|@code{P}:@code{X}@}
11236 Substitutes @code{X} if either @code{-S} or @code{-P} is given to
11237 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
11238 @code{*} sequences as well, although they have a stronger binding than
11239 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
11240 alternatives must be starred, and only the first matching alternative
11241 is substituted.
11243 For example, a spec string like this:
11245 @smallexample
11246 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
11247 @end smallexample
11249 @noindent
11250 outputs the following command-line options from the following input
11251 command-line options:
11253 @smallexample
11254 fred.c        -foo -baz
11255 jim.d         -bar -boggle
11256 -d fred.c     -foo -baz -boggle
11257 -d jim.d      -bar -baz -boggle
11258 @end smallexample
11260 @item %@{S:X; T:Y; :D@}
11262 If @code{S} is given to GCC, substitutes @code{X}; else if @code{T} is
11263 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
11264 be as many clauses as you need.  This may be combined with @code{.},
11265 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
11268 @end table
11270 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
11271 construct may contain other nested @samp{%} constructs or spaces, or
11272 even newlines.  They are processed as usual, as described above.
11273 Trailing white space in @code{X} is ignored.  White space may also
11274 appear anywhere on the left side of the colon in these constructs,
11275 except between @code{.} or @code{*} and the corresponding word.
11277 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
11278 handled specifically in these constructs.  If another value of
11279 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
11280 @option{-W} switch is found later in the command line, the earlier
11281 switch value is ignored, except with @{@code{S}*@} where @code{S} is
11282 just one letter, which passes all matching options.
11284 The character @samp{|} at the beginning of the predicate text is used to
11285 indicate that a command should be piped to the following command, but
11286 only if @option{-pipe} is specified.
11288 It is built into GCC which switches take arguments and which do not.
11289 (You might think it would be useful to generalize this to allow each
11290 compiler's spec to say which switches take arguments.  But this cannot
11291 be done in a consistent fashion.  GCC cannot even decide which input
11292 files have been specified without knowing which switches take arguments,
11293 and it must know which input files to compile in order to tell which
11294 compilers to run).
11296 GCC also knows implicitly that arguments starting in @option{-l} are to be
11297 treated as compiler output files, and passed to the linker in their
11298 proper position among the other output files.
11300 @c man begin OPTIONS
11302 @node Target Options
11303 @section Specifying Target Machine and Compiler Version
11304 @cindex target options
11305 @cindex cross compiling
11306 @cindex specifying machine version
11307 @cindex specifying compiler version and target machine
11308 @cindex compiler version, specifying
11309 @cindex target machine, specifying
11311 The usual way to run GCC is to run the executable called @command{gcc}, or
11312 @command{@var{machine}-gcc} when cross-compiling, or
11313 @command{@var{machine}-gcc-@var{version}} to run a version other than the
11314 one that was installed last.
11316 @node Submodel Options
11317 @section Hardware Models and Configurations
11318 @cindex submodel options
11319 @cindex specifying hardware config
11320 @cindex hardware models and configurations, specifying
11321 @cindex machine dependent options
11323 Each target machine types can have its own
11324 special options, starting with @samp{-m}, to choose among various
11325 hardware models or configurations---for example, 68010 vs 68020,
11326 floating coprocessor or none.  A single installed version of the
11327 compiler can compile for any model or configuration, according to the
11328 options specified.
11330 Some configurations of the compiler also support additional special
11331 options, usually for compatibility with other compilers on the same
11332 platform.
11334 @c This list is ordered alphanumerically by subsection name.
11335 @c It should be the same order and spelling as these options are listed
11336 @c in Machine Dependent Options
11338 @menu
11339 * AArch64 Options::
11340 * Adapteva Epiphany Options::
11341 * ARC Options::
11342 * ARM Options::
11343 * AVR Options::
11344 * Blackfin Options::
11345 * C6X Options::
11346 * CRIS Options::
11347 * CR16 Options::
11348 * Darwin Options::
11349 * DEC Alpha Options::
11350 * FR30 Options::
11351 * FRV Options::
11352 * GNU/Linux Options::
11353 * H8/300 Options::
11354 * HPPA Options::
11355 * i386 and x86-64 Options::
11356 * i386 and x86-64 Windows Options::
11357 * IA-64 Options::
11358 * LM32 Options::
11359 * M32C Options::
11360 * M32R/D Options::
11361 * M680x0 Options::
11362 * MCore Options::
11363 * MeP Options::
11364 * MicroBlaze Options::
11365 * MIPS Options::
11366 * MMIX Options::
11367 * MN10300 Options::
11368 * Moxie Options::
11369 * MSP430 Options::
11370 * NDS32 Options::
11371 * Nios II Options::
11372 * PDP-11 Options::
11373 * picoChip Options::
11374 * PowerPC Options::
11375 * RL78 Options::
11376 * RS/6000 and PowerPC Options::
11377 * RX Options::
11378 * S/390 and zSeries Options::
11379 * Score Options::
11380 * SH Options::
11381 * Solaris 2 Options::
11382 * SPARC Options::
11383 * SPU Options::
11384 * System V Options::
11385 * TILE-Gx Options::
11386 * TILEPro Options::
11387 * V850 Options::
11388 * VAX Options::
11389 * VMS Options::
11390 * VxWorks Options::
11391 * x86-64 Options::
11392 * Xstormy16 Options::
11393 * Xtensa Options::
11394 * zSeries Options::
11395 @end menu
11397 @node AArch64 Options
11398 @subsection AArch64 Options
11399 @cindex AArch64 Options
11401 These options are defined for AArch64 implementations:
11403 @table @gcctabopt
11405 @item -mabi=@var{name}
11406 @opindex mabi
11407 Generate code for the specified data model.  Permissible values
11408 are @samp{ilp32} for SysV-like data model where int, long int and pointer
11409 are 32-bit, and @samp{lp64} for SysV-like data model where int is 32-bit,
11410 but long int and pointer are 64-bit.
11412 The default depends on the specific target configuration.  Note that
11413 the LP64 and ILP32 ABIs are not link-compatible; you must compile your
11414 entire program with the same ABI, and link with a compatible set of libraries.
11416 @item -mbig-endian
11417 @opindex mbig-endian
11418 Generate big-endian code.  This is the default when GCC is configured for an
11419 @samp{aarch64_be-*-*} target.
11421 @item -mgeneral-regs-only
11422 @opindex mgeneral-regs-only
11423 Generate code which uses only the general registers.
11425 @item -mlittle-endian
11426 @opindex mlittle-endian
11427 Generate little-endian code.  This is the default when GCC is configured for an
11428 @samp{aarch64-*-*} but not an @samp{aarch64_be-*-*} target.
11430 @item -mcmodel=tiny
11431 @opindex mcmodel=tiny
11432 Generate code for the tiny code model.  The program and its statically defined
11433 symbols must be within 1GB of each other.  Pointers are 64 bits.  Programs can
11434 be statically or dynamically linked.  This model is not fully implemented and
11435 mostly treated as @samp{small}.
11437 @item -mcmodel=small
11438 @opindex mcmodel=small
11439 Generate code for the small code model.  The program and its statically defined
11440 symbols must be within 4GB of each other.  Pointers are 64 bits.  Programs can
11441 be statically or dynamically linked.  This is the default code model.
11443 @item -mcmodel=large
11444 @opindex mcmodel=large
11445 Generate code for the large code model.  This makes no assumptions about
11446 addresses and sizes of sections.  Pointers are 64 bits.  Programs can be
11447 statically linked only.
11449 @item -mstrict-align
11450 @opindex mstrict-align
11451 Do not assume that unaligned memory references will be handled by the system.
11453 @item -momit-leaf-frame-pointer
11454 @itemx -mno-omit-leaf-frame-pointer
11455 @opindex momit-leaf-frame-pointer
11456 @opindex mno-omit-leaf-frame-pointer
11457 Omit or keep the frame pointer in leaf functions.  The former behaviour is the
11458 default.
11460 @item -mtls-dialect=desc
11461 @opindex mtls-dialect=desc
11462 Use TLS descriptors as the thread-local storage mechanism for dynamic accesses
11463 of TLS variables.  This is the default.
11465 @item -mtls-dialect=traditional
11466 @opindex mtls-dialect=traditional
11467 Use traditional TLS as the thread-local storage mechanism for dynamic accesses
11468 of TLS variables.
11470 @item -march=@var{name}
11471 @opindex march
11472 Specify the name of the target architecture, optionally suffixed by one or
11473 more feature modifiers.  This option has the form
11474 @option{-march=@var{arch}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}, where the
11475 only permissible value for @var{arch} is @samp{armv8-a}.  The permissible
11476 values for @var{feature} are documented in the sub-section below.
11478 Where conflicting feature modifiers are specified, the right-most feature is
11479 used.
11481 GCC uses this name to determine what kind of instructions it can emit when
11482 generating assembly code.
11484 Where @option{-march} is specified without either of @option{-mtune}
11485 or @option{-mcpu} also being specified, the code will be tuned to perform
11486 well across a range of target processors implementing the target
11487 architecture.
11489 @item -mtune=@var{name}
11490 @opindex mtune
11491 Specify the name of the target processor for which GCC should tune the
11492 performance of the code.  Permissible values for this option are:
11493 @samp{generic}, @samp{cortex-a53}, @samp{cortex-a57}.
11495 Additionally, this option can specify that GCC should tune the performance
11496 of the code for a big.LITTLE system.  The only permissible value is
11497 @samp{cortex-a57.cortex-a53}.
11499 Where none of @option{-mtune=}, @option{-mcpu=} or @option{-march=}
11500 are specified, the code will be tuned to perform well across a range
11501 of target processors.
11503 This option cannot be suffixed by feature modifiers.
11505 @item -mcpu=@var{name}
11506 @opindex mcpu
11507 Specify the name of the target processor, optionally suffixed by one or more
11508 feature modifiers.  This option has the form
11509 @option{-mcpu=@var{cpu}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}, where the
11510 permissible values for @var{cpu} are the same as those available for
11511 @option{-mtune}.
11513 The permissible values for @var{feature} are documented in the sub-section
11514 below.
11516 Where conflicting feature modifiers are specified, the right-most feature is
11517 used.
11519 GCC uses this name to determine what kind of instructions it can emit when
11520 generating assembly code (as if by @option{-march}) and to determine
11521 the target processor for which to tune for performance (as if
11522 by @option{-mtune}).  Where this option is used in conjunction
11523 with @option{-march} or @option{-mtune}, those options take precedence
11524 over the appropriate part of this option.
11525 @end table
11527 @subsubsection @option{-march} and @option{-mcpu} feature modifiers
11528 @cindex @option{-march} feature modifiers
11529 @cindex @option{-mcpu} feature modifiers
11530 Feature modifiers used with @option{-march} and @option{-mcpu} can be one
11531 the following:
11533 @table @samp
11534 @item crc
11535 Enable CRC extension.
11536 @item crypto
11537 Enable Crypto extension.  This implies Advanced SIMD is enabled.
11538 @item fp
11539 Enable floating-point instructions.
11540 @item simd
11541 Enable Advanced SIMD instructions.  This implies floating-point instructions
11542 are enabled.  This is the default for all current possible values for options
11543 @option{-march} and @option{-mcpu=}.
11544 @end table
11546 @node Adapteva Epiphany Options
11547 @subsection Adapteva Epiphany Options
11549 These @samp{-m} options are defined for Adapteva Epiphany:
11551 @table @gcctabopt
11552 @item -mhalf-reg-file
11553 @opindex mhalf-reg-file
11554 Don't allocate any register in the range @code{r32}@dots{}@code{r63}.
11555 That allows code to run on hardware variants that lack these registers.
11557 @item -mprefer-short-insn-regs
11558 @opindex mprefer-short-insn-regs
11559 Preferrentially allocate registers that allow short instruction generation.
11560 This can result in increased instruction count, so this may either reduce or
11561 increase overall code size.
11563 @item -mbranch-cost=@var{num}
11564 @opindex mbranch-cost
11565 Set the cost of branches to roughly @var{num} ``simple'' instructions.
11566 This cost is only a heuristic and is not guaranteed to produce
11567 consistent results across releases.
11569 @item -mcmove
11570 @opindex mcmove
11571 Enable the generation of conditional moves.
11573 @item -mnops=@var{num}
11574 @opindex mnops
11575 Emit @var{num} NOPs before every other generated instruction.
11577 @item -mno-soft-cmpsf
11578 @opindex mno-soft-cmpsf
11579 For single-precision floating-point comparisons, emit an @code{fsub} instruction
11580 and test the flags.  This is faster than a software comparison, but can
11581 get incorrect results in the presence of NaNs, or when two different small
11582 numbers are compared such that their difference is calculated as zero.
11583 The default is @option{-msoft-cmpsf}, which uses slower, but IEEE-compliant,
11584 software comparisons.
11586 @item -mstack-offset=@var{num}
11587 @opindex mstack-offset
11588 Set the offset between the top of the stack and the stack pointer.
11589 E.g., a value of 8 means that the eight bytes in the range @code{sp+0@dots{}sp+7}
11590 can be used by leaf functions without stack allocation.
11591 Values other than @samp{8} or @samp{16} are untested and unlikely to work.
11592 Note also that this option changes the ABI; compiling a program with a
11593 different stack offset than the libraries have been compiled with
11594 generally does not work.
11595 This option can be useful if you want to evaluate if a different stack
11596 offset would give you better code, but to actually use a different stack
11597 offset to build working programs, it is recommended to configure the
11598 toolchain with the appropriate @option{--with-stack-offset=@var{num}} option.
11600 @item -mno-round-nearest
11601 @opindex mno-round-nearest
11602 Make the scheduler assume that the rounding mode has been set to
11603 truncating.  The default is @option{-mround-nearest}.
11605 @item -mlong-calls
11606 @opindex mlong-calls
11607 If not otherwise specified by an attribute, assume all calls might be beyond
11608 the offset range of the @code{b} / @code{bl} instructions, and therefore load the
11609 function address into a register before performing a (otherwise direct) call.
11610 This is the default.
11612 @item -mshort-calls
11613 @opindex short-calls
11614 If not otherwise specified by an attribute, assume all direct calls are
11615 in the range of the @code{b} / @code{bl} instructions, so use these instructions
11616 for direct calls.  The default is @option{-mlong-calls}.
11618 @item -msmall16
11619 @opindex msmall16
11620 Assume addresses can be loaded as 16-bit unsigned values.  This does not
11621 apply to function addresses for which @option{-mlong-calls} semantics
11622 are in effect.
11624 @item -mfp-mode=@var{mode}
11625 @opindex mfp-mode
11626 Set the prevailing mode of the floating-point unit.
11627 This determines the floating-point mode that is provided and expected
11628 at function call and return time.  Making this mode match the mode you
11629 predominantly need at function start can make your programs smaller and
11630 faster by avoiding unnecessary mode switches.
11632 @var{mode} can be set to one the following values:
11634 @table @samp
11635 @item caller
11636 Any mode at function entry is valid, and retained or restored when
11637 the function returns, and when it calls other functions.
11638 This mode is useful for compiling libraries or other compilation units
11639 you might want to incorporate into different programs with different
11640 prevailing FPU modes, and the convenience of being able to use a single
11641 object file outweighs the size and speed overhead for any extra
11642 mode switching that might be needed, compared with what would be needed
11643 with a more specific choice of prevailing FPU mode.
11645 @item truncate
11646 This is the mode used for floating-point calculations with
11647 truncating (i.e.@: round towards zero) rounding mode.  That includes
11648 conversion from floating point to integer.
11650 @item round-nearest
11651 This is the mode used for floating-point calculations with
11652 round-to-nearest-or-even rounding mode.
11654 @item int
11655 This is the mode used to perform integer calculations in the FPU, e.g.@:
11656 integer multiply, or integer multiply-and-accumulate.
11657 @end table
11659 The default is @option{-mfp-mode=caller}
11661 @item -mnosplit-lohi
11662 @itemx -mno-postinc
11663 @itemx -mno-postmodify
11664 @opindex mnosplit-lohi
11665 @opindex mno-postinc
11666 @opindex mno-postmodify
11667 Code generation tweaks that disable, respectively, splitting of 32-bit
11668 loads, generation of post-increment addresses, and generation of
11669 post-modify addresses.  The defaults are @option{msplit-lohi},
11670 @option{-mpost-inc}, and @option{-mpost-modify}.
11672 @item -mnovect-double
11673 @opindex mno-vect-double
11674 Change the preferred SIMD mode to SImode.  The default is
11675 @option{-mvect-double}, which uses DImode as preferred SIMD mode.
11677 @item -max-vect-align=@var{num}
11678 @opindex max-vect-align
11679 The maximum alignment for SIMD vector mode types.
11680 @var{num} may be 4 or 8.  The default is 8.
11681 Note that this is an ABI change, even though many library function
11682 interfaces are unaffected if they don't use SIMD vector modes
11683 in places that affect size and/or alignment of relevant types.
11685 @item -msplit-vecmove-early
11686 @opindex msplit-vecmove-early
11687 Split vector moves into single word moves before reload.  In theory this
11688 can give better register allocation, but so far the reverse seems to be
11689 generally the case.
11691 @item -m1reg-@var{reg}
11692 @opindex m1reg-
11693 Specify a register to hold the constant @minus{}1, which makes loading small negative
11694 constants and certain bitmasks faster.
11695 Allowable values for @var{reg} are @samp{r43} and @samp{r63},
11696 which specify use of that register as a fixed register,
11697 and @samp{none}, which means that no register is used for this
11698 purpose.  The default is @option{-m1reg-none}.
11700 @end table
11702 @node ARC Options
11703 @subsection ARC Options
11704 @cindex ARC options
11706 The following options control the architecture variant for which code
11707 is being compiled:
11709 @c architecture variants
11710 @table @gcctabopt
11712 @item -mbarrel-shifter
11713 @opindex mbarrel-shifter
11714 Generate instructions supported by barrel shifter.  This is the default
11715 unless @samp{-mcpu=ARC601} is in effect.
11717 @item -mcpu=@var{cpu}
11718 @opindex mcpu
11719 Set architecture type, register usage, and instruction scheduling
11720 parameters for @var{cpu}.  There are also shortcut alias options
11721 available for backward compatibility and convenience.  Supported
11722 values for @var{cpu} are
11724 @table @samp
11725 @opindex mA6
11726 @opindex mARC600
11727 @item ARC600
11728 Compile for ARC600.  Aliases: @option{-mA6}, @option{-mARC600}.
11730 @item ARC601
11731 @opindex mARC601
11732 Compile for ARC601.  Alias: @option{-mARC601}.
11734 @item ARC700
11735 @opindex mA7
11736 @opindex mARC700
11737 Compile for ARC700.  Aliases: @option{-mA7}, @option{-mARC700}.
11738 This is the default when configured with @samp{--with-cpu=arc700}@.
11739 @end table
11741 @item -mdpfp
11742 @opindex mdpfp
11743 @itemx -mdpfp-compact
11744 @opindex mdpfp-compact
11745 FPX: Generate Double Precision FPX instructions, tuned for the compact
11746 implementation.
11748 @item -mdpfp-fast
11749 @opindex mdpfp-fast
11750 FPX: Generate Double Precision FPX instructions, tuned for the fast
11751 implementation.
11753 @item -mno-dpfp-lrsr
11754 @opindex mno-dpfp-lrsr
11755 Disable LR and SR instructions from using FPX extension aux registers.
11757 @item -mea
11758 @opindex mea
11759 Generate Extended arithmetic instructions.  Currently only
11760 @code{divaw}, @code{adds}, @code{subs}, and @code{sat16} are
11761 supported.  This is always enabled for @samp{-mcpu=ARC700}.
11763 @item -mno-mpy
11764 @opindex mno-mpy
11765 Do not generate mpy instructions for ARC700.
11767 @item -mmul32x16
11768 @opindex mmul32x16
11769 Generate 32x16 bit multiply and mac instructions.
11771 @item -mmul64
11772 @opindex mmul64
11773 Generate mul64 and mulu64 instructions.  Only valid for @samp{-mcpu=ARC600}.
11775 @item -mnorm
11776 @opindex mnorm
11777 Generate norm instruction.  This is the default if @samp{-mcpu=ARC700}
11778 is in effect.
11780 @item -mspfp
11781 @opindex mspfp
11782 @itemx -mspfp-compact
11783 @opindex mspfp-compact
11784 FPX: Generate Single Precision FPX instructions, tuned for the compact
11785 implementation.
11787 @item -mspfp-fast
11788 @opindex mspfp-fast
11789 FPX: Generate Single Precision FPX instructions, tuned for the fast
11790 implementation.
11792 @item -msimd
11793 @opindex msimd
11794 Enable generation of ARC SIMD instructions via target-specific
11795 builtins.  Only valid for @samp{-mcpu=ARC700}.
11797 @item -msoft-float
11798 @opindex msoft-float
11799 This option ignored; it is provided for compatibility purposes only.
11800 Software floating point code is emitted by default, and this default
11801 can overridden by FPX options; @samp{mspfp}, @samp{mspfp-compact}, or
11802 @samp{mspfp-fast} for single precision, and @samp{mdpfp},
11803 @samp{mdpfp-compact}, or @samp{mdpfp-fast} for double precision.
11805 @item -mswap
11806 @opindex mswap
11807 Generate swap instructions.
11809 @end table
11811 The following options are passed through to the assembler, and also
11812 define preprocessor macro symbols.
11814 @c Flags used by the assembler, but for which we define preprocessor
11815 @c macro symbols as well.
11816 @table @gcctabopt
11817 @item -mdsp-packa
11818 @opindex mdsp-packa
11819 Passed down to the assembler to enable the DSP Pack A extensions.
11820 Also sets the preprocessor symbol @code{__Xdsp_packa}.
11822 @item -mdvbf
11823 @opindex mdvbf
11824 Passed down to the assembler to enable the dual viterbi butterfly
11825 extension.  Also sets the preprocessor symbol @code{__Xdvbf}.
11827 @c ARC700 4.10 extension instruction
11828 @item -mlock
11829 @opindex mlock
11830 Passed down to the assembler to enable the Locked Load/Store
11831 Conditional extension.  Also sets the preprocessor symbol
11832 @code{__Xlock}.
11834 @item -mmac-d16
11835 @opindex mmac-d16
11836 Passed down to the assembler.  Also sets the preprocessor symbol
11837 @code{__Xxmac_d16}.
11839 @item -mmac-24
11840 @opindex mmac-24
11841 Passed down to the assembler.  Also sets the preprocessor symbol
11842 @code{__Xxmac_24}.
11844 @c ARC700 4.10 extension instruction
11845 @item -mrtsc
11846 @opindex mrtsc
11847 Passed down to the assembler to enable the 64-bit Time-Stamp Counter
11848 extension instruction.  Also sets the preprocessor symbol
11849 @code{__Xrtsc}.
11851 @c ARC700 4.10 extension instruction
11852 @item -mswape
11853 @opindex mswape
11854 Passed down to the assembler to enable the swap byte ordering
11855 extension instruction.  Also sets the preprocessor symbol
11856 @code{__Xswape}.
11858 @item -mtelephony
11859 @opindex mtelephony
11860 Passed down to the assembler to enable dual and single operand
11861 instructions for telephony.  Also sets the preprocessor symbol
11862 @code{__Xtelephony}.
11864 @item -mxy
11865 @opindex mxy
11866 Passed down to the assembler to enable the XY Memory extension.  Also
11867 sets the preprocessor symbol @code{__Xxy}.
11869 @end table
11871 The following options control how the assembly code is annotated:
11873 @c Assembly annotation options
11874 @table @gcctabopt
11875 @item -misize
11876 @opindex misize
11877 Annotate assembler instructions with estimated addresses.
11879 @item -mannotate-align
11880 @opindex mannotate-align
11881 Explain what alignment considerations lead to the decision to make an
11882 instruction short or long.
11884 @end table
11886 The following options are passed through to the linker:
11888 @c options passed through to the linker
11889 @table @gcctabopt
11890 @item -marclinux
11891 @opindex marclinux
11892 Passed through to the linker, to specify use of the @code{arclinux} emulation.
11893 This option is enabled by default in tool chains built for
11894 @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets
11895 when profiling is not requested.
11897 @item -marclinux_prof
11898 @opindex marclinux_prof
11899 Passed through to the linker, to specify use of the
11900 @code{arclinux_prof} emulation.  This option is enabled by default in
11901 tool chains built for @w{@code{arc-linux-uclibc}} and
11902 @w{@code{arceb-linux-uclibc}} targets when profiling is requested.
11904 @end table
11906 The following options control the semantics of generated code:
11908 @c semantically relevant code generation options
11909 @table @gcctabopt
11910 @item -mepilogue-cfi
11911 @opindex mepilogue-cfi
11912 Enable generation of call frame information for epilogues.
11914 @item -mno-epilogue-cfi
11915 @opindex mno-epilogue-cfi
11916 Disable generation of call frame information for epilogues.
11918 @item -mlong-calls
11919 @opindex mlong-calls
11920 Generate call insns as register indirect calls, thus providing access
11921 to the full 32-bit address range.
11923 @item -mmedium-calls
11924 @opindex mmedium-calls
11925 Don't use less than 25 bit addressing range for calls, which is the
11926 offset available for an unconditional branch-and-link
11927 instruction.  Conditional execution of function calls is suppressed, to
11928 allow use of the 25-bit range, rather than the 21-bit range with
11929 conditional branch-and-link.  This is the default for tool chains built
11930 for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets.
11932 @item -mno-sdata
11933 @opindex mno-sdata
11934 Do not generate sdata references.  This is the default for tool chains
11935 built for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}}
11936 targets.
11938 @item -mucb-mcount
11939 @opindex mucb-mcount
11940 Instrument with mcount calls as used in UCB code.  I.e. do the
11941 counting in the callee, not the caller.  By default ARC instrumentation
11942 counts in the caller.
11944 @item -mvolatile-cache
11945 @opindex mvolatile-cache
11946 Use ordinarily cached memory accesses for volatile references.  This is the
11947 default.
11949 @item -mno-volatile-cache
11950 @opindex mno-volatile-cache
11951 Enable cache bypass for volatile references.
11953 @end table
11955 The following options fine tune code generation:
11956 @c code generation tuning options
11957 @table @gcctabopt
11958 @item -malign-call
11959 @opindex malign-call
11960 Do alignment optimizations for call instructions.
11962 @item -mauto-modify-reg
11963 @opindex mauto-modify-reg
11964 Enable the use of pre/post modify with register displacement.
11966 @item -mbbit-peephole
11967 @opindex mbbit-peephole
11968 Enable bbit peephole2.
11970 @item -mno-brcc
11971 @opindex mno-brcc
11972 This option disables a target-specific pass in @file{arc_reorg} to
11973 generate @code{BRcc} instructions.  It has no effect on @code{BRcc}
11974 generation driven by the combiner pass.
11976 @item -mcase-vector-pcrel
11977 @opindex mcase-vector-pcrel
11978 Use pc-relative switch case tables - this enables case table shortening.
11979 This is the default for @option{-Os}.
11981 @item -mcompact-casesi
11982 @opindex mcompact-casesi
11983 Enable compact casesi pattern.
11984 This is the default for @option{-Os}.
11986 @item -mno-cond-exec
11987 @opindex mno-cond-exec
11988 Disable ARCompact specific pass to generate conditional execution instructions.
11989 Due to delay slot scheduling and interactions between operand numbers,
11990 literal sizes, instruction lengths, and the support for conditional execution,
11991 the target-independent pass to generate conditional execution is often lacking,
11992 so the ARC port has kept a special pass around that tries to find more
11993 conditional execution generating opportunities after register allocation,
11994 branch shortening, and delay slot scheduling have been done.  This pass
11995 generally, but not always, improves performance and code size, at the cost of
11996 extra compilation time, which is why there is an option to switch it off.
11997 If you have a problem with call instructions exceeding their allowable
11998 offset range because they are conditionalized, you should consider using
11999 @option{-mmedium-calls} instead.
12001 @item -mearly-cbranchsi
12002 @opindex mearly-cbranchsi
12003 Enable pre-reload use of the cbranchsi pattern.
12005 @item -mexpand-adddi
12006 @opindex mexpand-adddi
12007 Expand @code{adddi3} and @code{subdi3} at rtl generation time into
12008 @code{add.f}, @code{adc} etc.
12010 @item -mindexed-loads
12011 @opindex mindexed-loads
12012 Enable the use of indexed loads.  This can be problematic because some
12013 optimizers will then assume the that indexed stores exist, which is not
12014 the case.
12016 @item -mlra
12017 @opindex mlra
12018 Enable Local Register Allocation.  This is still experimental for ARC,
12019 so by default the compiler uses standard reload
12020 (i.e. @samp{-mno-lra}).
12022 @item -mlra-priority-none
12023 @opindex mlra-priority-none
12024 Don't indicate any priority for target registers.
12026 @item -mlra-priority-compact
12027 @opindex mlra-priority-compact
12028 Indicate target register priority for r0..r3 / r12..r15.
12030 @item -mlra-priority-noncompact
12031 @opindex mlra-priority-noncompact
12032 Reduce target regsiter priority for r0..r3 / r12..r15.
12034 @item -mno-millicode
12035 @opindex mno-millicode
12036 When optimizing for size (using @option{-Os}), prologues and epilogues
12037 that have to save or restore a large number of registers are often
12038 shortened by using call to a special function in libgcc; this is
12039 referred to as a @emph{millicode} call.  As these calls can pose
12040 performance issues, and/or cause linking issues when linking in a
12041 nonstandard way, this option is provided to turn off millicode call
12042 generation.
12044 @item -mmixed-code
12045 @opindex mmixed-code
12046 Tweak register allocation to help 16-bit instruction generation.
12047 This generally has the effect of decreasing the average instruction size
12048 while increasing the instruction count.
12050 @item -mq-class
12051 @opindex mq-class
12052 Enable 'q' instruction alternatives.
12053 This is the default for @option{-Os}.
12055 @item -mRcq
12056 @opindex mRcq
12057 Enable Rcq constraint handling - most short code generation depends on this.
12058 This is the default.
12060 @item -mRcw
12061 @opindex mRcw
12062 Enable Rcw constraint handling - ccfsm condexec mostly depends on this.
12063 This is the default.
12065 @item -msize-level=@var{level}
12066 @opindex msize-level
12067 Fine-tune size optimization with regards to instruction lengths and alignment.
12068 The recognized values for @var{level} are:
12069 @table @samp
12070 @item 0
12071 No size optimization.  This level is deprecated and treated like @samp{1}.
12073 @item 1
12074 Short instructions are used opportunistically.
12076 @item 2
12077 In addition, alignment of loops and of code after barriers are dropped.
12079 @item 3
12080 In addition, optional data alignment is dropped, and the option @option{Os} is enabled.
12082 @end table
12084 This defaults to @samp{3} when @option{-Os} is in effect.  Otherwise,
12085 the behavior when this is not set is equivalent to level @samp{1}.
12087 @item -mtune=@var{cpu}
12088 @opindex mtune
12089 Set instruction scheduling parameters for @var{cpu}, overriding any implied
12090 by @option{-mcpu=}.
12092 Supported values for @var{cpu} are
12094 @table @samp
12095 @item ARC600
12096 Tune for ARC600 cpu.
12098 @item ARC601
12099 Tune for ARC601 cpu.
12101 @item ARC700
12102 Tune for ARC700 cpu with standard multiplier block.
12104 @item ARC700-xmac
12105 Tune for ARC700 cpu with XMAC block.
12107 @item ARC725D
12108 Tune for ARC725D cpu.
12110 @item ARC750D
12111 Tune for ARC750D cpu.
12113 @end table
12115 @item -mmultcost=@var{num}
12116 @opindex mmultcost
12117 Cost to assume for a multiply instruction, with @samp{4} being equal to a
12118 normal instruction.
12120 @item -munalign-prob-threshold=@var{probability}
12121 @opindex munalign-prob-threshold
12122 Set probability threshold for unaligning branches.
12123 When tuning for @samp{ARC700} and optimizing for speed, branches without
12124 filled delay slot are preferably emitted unaligned and long, unless
12125 profiling indicates that the probability for the branch to be taken
12126 is below @var{probability}.  @xref{Cross-profiling}.
12127 The default is (REG_BR_PROB_BASE/2), i.e.@: 5000.
12129 @end table
12131 The following options are maintained for backward compatibility, but
12132 are now deprecated and will be removed in a future release:
12134 @c Deprecated options
12135 @table @gcctabopt
12137 @item -margonaut
12138 @opindex margonaut
12139 Obsolete FPX.
12141 @item -mbig-endian
12142 @opindex mbig-endian
12143 @itemx -EB
12144 @opindex EB
12145 Compile code for big endian targets.  Use of these options is now
12146 deprecated.  Users wanting big-endian code, should use the
12147 @w{@code{arceb-elf32}} and @w{@code{arceb-linux-uclibc}} targets when
12148 building the tool chain, for which big-endian is the default.
12150 @item -mlittle-endian
12151 @opindex mlittle-endian
12152 @itemx -EL
12153 @opindex EL
12154 Compile code for little endian targets.  Use of these options is now
12155 deprecated.  Users wanting little-endian code should use the
12156 @w{@code{arc-elf32}} and @w{@code{arc-linux-uclibc}} targets when
12157 building the tool chain, for which little-endian is the default.
12159 @item -mbarrel_shifter
12160 @opindex mbarrel_shifter
12161 Replaced by @samp{-mbarrel-shifter}
12163 @item -mdpfp_compact
12164 @opindex mdpfp_compact
12165 Replaced by @samp{-mdpfp-compact}
12167 @item -mdpfp_fast
12168 @opindex mdpfp_fast
12169 Replaced by @samp{-mdpfp-fast}
12171 @item -mdsp_packa
12172 @opindex mdsp_packa
12173 Replaced by @samp{-mdsp-packa}
12175 @item -mEA
12176 @opindex mEA
12177 Replaced by @samp{-mea}
12179 @item -mmac_24
12180 @opindex mmac_24
12181 Replaced by @samp{-mmac-24}
12183 @item -mmac_d16
12184 @opindex mmac_d16
12185 Replaced by @samp{-mmac-d16}
12187 @item -mspfp_compact
12188 @opindex mspfp_compact
12189 Replaced by @samp{-mspfp-compact}
12191 @item -mspfp_fast
12192 @opindex mspfp_fast
12193 Replaced by @samp{-mspfp-fast}
12195 @item -mtune=@var{cpu}
12196 @opindex mtune
12197 Values @samp{arc600}, @samp{arc601}, @samp{arc700} and
12198 @samp{arc700-xmac} for @var{cpu} are replaced by @samp{ARC600},
12199 @samp{ARC601}, @samp{ARC700} and @samp{ARC700-xmac} respectively
12201 @item -multcost=@var{num}
12202 @opindex multcost
12203 Replaced by @samp{-mmultcost}.
12205 @end table
12207 @node ARM Options
12208 @subsection ARM Options
12209 @cindex ARM options
12211 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
12212 architectures:
12214 @table @gcctabopt
12215 @item -mabi=@var{name}
12216 @opindex mabi
12217 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
12218 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
12220 @item -mapcs-frame
12221 @opindex mapcs-frame
12222 Generate a stack frame that is compliant with the ARM Procedure Call
12223 Standard for all functions, even if this is not strictly necessary for
12224 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
12225 with this option causes the stack frames not to be generated for
12226 leaf functions.  The default is @option{-mno-apcs-frame}.
12228 @item -mapcs
12229 @opindex mapcs
12230 This is a synonym for @option{-mapcs-frame}.
12232 @ignore
12233 @c not currently implemented
12234 @item -mapcs-stack-check
12235 @opindex mapcs-stack-check
12236 Generate code to check the amount of stack space available upon entry to
12237 every function (that actually uses some stack space).  If there is
12238 insufficient space available then either the function
12239 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} is
12240 called, depending upon the amount of stack space required.  The runtime
12241 system is required to provide these functions.  The default is
12242 @option{-mno-apcs-stack-check}, since this produces smaller code.
12244 @c not currently implemented
12245 @item -mapcs-float
12246 @opindex mapcs-float
12247 Pass floating-point arguments using the floating-point registers.  This is
12248 one of the variants of the APCS@.  This option is recommended if the
12249 target hardware has a floating-point unit or if a lot of floating-point
12250 arithmetic is going to be performed by the code.  The default is
12251 @option{-mno-apcs-float}, since the size of integer-only code is 
12252 slightly increased if @option{-mapcs-float} is used.
12254 @c not currently implemented
12255 @item -mapcs-reentrant
12256 @opindex mapcs-reentrant
12257 Generate reentrant, position-independent code.  The default is
12258 @option{-mno-apcs-reentrant}.
12259 @end ignore
12261 @item -mthumb-interwork
12262 @opindex mthumb-interwork
12263 Generate code that supports calling between the ARM and Thumb
12264 instruction sets.  Without this option, on pre-v5 architectures, the
12265 two instruction sets cannot be reliably used inside one program.  The
12266 default is @option{-mno-thumb-interwork}, since slightly larger code
12267 is generated when @option{-mthumb-interwork} is specified.  In AAPCS
12268 configurations this option is meaningless.
12270 @item -mno-sched-prolog
12271 @opindex mno-sched-prolog
12272 Prevent the reordering of instructions in the function prologue, or the
12273 merging of those instruction with the instructions in the function's
12274 body.  This means that all functions start with a recognizable set
12275 of instructions (or in fact one of a choice from a small set of
12276 different function prologues), and this information can be used to
12277 locate the start of functions inside an executable piece of code.  The
12278 default is @option{-msched-prolog}.
12280 @item -mfloat-abi=@var{name}
12281 @opindex mfloat-abi
12282 Specifies which floating-point ABI to use.  Permissible values
12283 are: @samp{soft}, @samp{softfp} and @samp{hard}.
12285 Specifying @samp{soft} causes GCC to generate output containing
12286 library calls for floating-point operations.
12287 @samp{softfp} allows the generation of code using hardware floating-point
12288 instructions, but still uses the soft-float calling conventions.
12289 @samp{hard} allows generation of floating-point instructions
12290 and uses FPU-specific calling conventions.
12292 The default depends on the specific target configuration.  Note that
12293 the hard-float and soft-float ABIs are not link-compatible; you must
12294 compile your entire program with the same ABI, and link with a
12295 compatible set of libraries.
12297 @item -mlittle-endian
12298 @opindex mlittle-endian
12299 Generate code for a processor running in little-endian mode.  This is
12300 the default for all standard configurations.
12302 @item -mbig-endian
12303 @opindex mbig-endian
12304 Generate code for a processor running in big-endian mode; the default is
12305 to compile code for a little-endian processor.
12307 @item -mwords-little-endian
12308 @opindex mwords-little-endian
12309 This option only applies when generating code for big-endian processors.
12310 Generate code for a little-endian word order but a big-endian byte
12311 order.  That is, a byte order of the form @samp{32107654}.  Note: this
12312 option should only be used if you require compatibility with code for
12313 big-endian ARM processors generated by versions of the compiler prior to
12314 2.8.  This option is now deprecated.
12316 @item -march=@var{name}
12317 @opindex march
12318 This specifies the name of the target ARM architecture.  GCC uses this
12319 name to determine what kind of instructions it can emit when generating
12320 assembly code.  This option can be used in conjunction with or instead
12321 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
12322 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
12323 @samp{armv5}, @samp{armv5t}, @samp{armv5e}, @samp{armv5te},
12324 @samp{armv6}, @samp{armv6j},
12325 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv6-m},
12326 @samp{armv7}, @samp{armv7-a}, @samp{armv7-r}, @samp{armv7-m}, @samp{armv7e-m},
12327 @samp{armv7ve}, @samp{armv8-a}, @samp{armv8-a+crc},
12328 @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}.
12330 @option{-march=armv7ve} is the armv7-a architecture with virtualization
12331 extensions.
12333 @option{-march=armv8-a+crc} enables code generation for the ARMv8-A
12334 architecture together with the optional CRC32 extensions.
12336 @option{-march=native} causes the compiler to auto-detect the architecture
12337 of the build computer.  At present, this feature is only supported on
12338 Linux, and not all architectures are recognized.  If the auto-detect is
12339 unsuccessful the option has no effect.
12341 @item -mtune=@var{name}
12342 @opindex mtune
12343 This option specifies the name of the target ARM processor for
12344 which GCC should tune the performance of the code.
12345 For some ARM implementations better performance can be obtained by using
12346 this option.
12347 Permissible names are: @samp{arm2}, @samp{arm250},
12348 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
12349 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
12350 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
12351 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
12352 @samp{arm720},
12353 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
12354 @samp{arm710t}, @samp{arm720t}, @samp{arm740t},
12355 @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
12356 @samp{strongarm1110},
12357 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
12358 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
12359 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
12360 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
12361 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
12362 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
12363 @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
12364 @samp{cortex-a5}, @samp{cortex-a7}, @samp{cortex-a8}, @samp{cortex-a9},
12365 @samp{cortex-a12}, @samp{cortex-a15}, @samp{cortex-a53}, @samp{cortex-a57},
12366 @samp{cortex-r4},
12367 @samp{cortex-r4f}, @samp{cortex-r5}, @samp{cortex-r7}, @samp{cortex-m4},
12368 @samp{cortex-m3},
12369 @samp{cortex-m1},
12370 @samp{cortex-m0},
12371 @samp{cortex-m0plus},
12372 @samp{marvell-pj4},
12373 @samp{xscale}, @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312},
12374 @samp{fa526}, @samp{fa626},
12375 @samp{fa606te}, @samp{fa626te}, @samp{fmp626}, @samp{fa726te}.
12377 Additionally, this option can specify that GCC should tune the performance
12378 of the code for a big.LITTLE system.  Permissible names are:
12379 @samp{cortex-a15.cortex-a7}, @samp{cortex-a57.cortex-a53}.
12381 @option{-mtune=generic-@var{arch}} specifies that GCC should tune the
12382 performance for a blend of processors within architecture @var{arch}.
12383 The aim is to generate code that run well on the current most popular
12384 processors, balancing between optimizations that benefit some CPUs in the
12385 range, and avoiding performance pitfalls of other CPUs.  The effects of
12386 this option may change in future GCC versions as CPU models come and go.
12388 @option{-mtune=native} causes the compiler to auto-detect the CPU
12389 of the build computer.  At present, this feature is only supported on
12390 Linux, and not all architectures are recognized.  If the auto-detect is
12391 unsuccessful the option has no effect.
12393 @item -mcpu=@var{name}
12394 @opindex mcpu
12395 This specifies the name of the target ARM processor.  GCC uses this name
12396 to derive the name of the target ARM architecture (as if specified
12397 by @option{-march}) and the ARM processor type for which to tune for
12398 performance (as if specified by @option{-mtune}).  Where this option
12399 is used in conjunction with @option{-march} or @option{-mtune},
12400 those options take precedence over the appropriate part of this option.
12402 Permissible names for this option are the same as those for
12403 @option{-mtune}.
12405 @option{-mcpu=generic-@var{arch}} is also permissible, and is
12406 equivalent to @option{-march=@var{arch} -mtune=generic-@var{arch}}.
12407 See @option{-mtune} for more information.
12409 @option{-mcpu=native} causes the compiler to auto-detect the CPU
12410 of the build computer.  At present, this feature is only supported on
12411 Linux, and not all architectures are recognized.  If the auto-detect is
12412 unsuccessful the option has no effect.
12414 @item -mfpu=@var{name}
12415 @opindex mfpu
12416 This specifies what floating-point hardware (or hardware emulation) is
12417 available on the target.  Permissible names are: @samp{vfp}, @samp{vfpv3},
12418 @samp{vfpv3-fp16}, @samp{vfpv3-d16}, @samp{vfpv3-d16-fp16}, @samp{vfpv3xd},
12419 @samp{vfpv3xd-fp16}, @samp{neon}, @samp{neon-fp16}, @samp{vfpv4},
12420 @samp{vfpv4-d16}, @samp{fpv4-sp-d16}, @samp{neon-vfpv4},
12421 @samp{fp-armv8}, @samp{neon-fp-armv8}, and @samp{crypto-neon-fp-armv8}.
12423 If @option{-msoft-float} is specified this specifies the format of
12424 floating-point values.
12426 If the selected floating-point hardware includes the NEON extension
12427 (e.g. @option{-mfpu}=@samp{neon}), note that floating-point
12428 operations are not generated by GCC's auto-vectorization pass unless
12429 @option{-funsafe-math-optimizations} is also specified.  This is
12430 because NEON hardware does not fully implement the IEEE 754 standard for
12431 floating-point arithmetic (in particular denormal values are treated as
12432 zero), so the use of NEON instructions may lead to a loss of precision.
12434 @item -mfp16-format=@var{name}
12435 @opindex mfp16-format
12436 Specify the format of the @code{__fp16} half-precision floating-point type.
12437 Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative};
12438 the default is @samp{none}, in which case the @code{__fp16} type is not
12439 defined.  @xref{Half-Precision}, for more information.
12441 @item -mstructure-size-boundary=@var{n}
12442 @opindex mstructure-size-boundary
12443 The sizes of all structures and unions are rounded up to a multiple
12444 of the number of bits set by this option.  Permissible values are 8, 32
12445 and 64.  The default value varies for different toolchains.  For the COFF
12446 targeted toolchain the default value is 8.  A value of 64 is only allowed
12447 if the underlying ABI supports it.
12449 Specifying a larger number can produce faster, more efficient code, but
12450 can also increase the size of the program.  Different values are potentially
12451 incompatible.  Code compiled with one value cannot necessarily expect to
12452 work with code or libraries compiled with another value, if they exchange
12453 information using structures or unions.
12455 @item -mabort-on-noreturn
12456 @opindex mabort-on-noreturn
12457 Generate a call to the function @code{abort} at the end of a
12458 @code{noreturn} function.  It is executed if the function tries to
12459 return.
12461 @item -mlong-calls
12462 @itemx -mno-long-calls
12463 @opindex mlong-calls
12464 @opindex mno-long-calls
12465 Tells the compiler to perform function calls by first loading the
12466 address of the function into a register and then performing a subroutine
12467 call on this register.  This switch is needed if the target function
12468 lies outside of the 64-megabyte addressing range of the offset-based
12469 version of subroutine call instruction.
12471 Even if this switch is enabled, not all function calls are turned
12472 into long calls.  The heuristic is that static functions, functions
12473 that have the @samp{short-call} attribute, functions that are inside
12474 the scope of a @samp{#pragma no_long_calls} directive, and functions whose
12475 definitions have already been compiled within the current compilation
12476 unit are not turned into long calls.  The exceptions to this rule are
12477 that weak function definitions, functions with the @samp{long-call}
12478 attribute or the @samp{section} attribute, and functions that are within
12479 the scope of a @samp{#pragma long_calls} directive are always
12480 turned into long calls.
12482 This feature is not enabled by default.  Specifying
12483 @option{-mno-long-calls} restores the default behavior, as does
12484 placing the function calls within the scope of a @samp{#pragma
12485 long_calls_off} directive.  Note these switches have no effect on how
12486 the compiler generates code to handle function calls via function
12487 pointers.
12489 @item -msingle-pic-base
12490 @opindex msingle-pic-base
12491 Treat the register used for PIC addressing as read-only, rather than
12492 loading it in the prologue for each function.  The runtime system is
12493 responsible for initializing this register with an appropriate value
12494 before execution begins.
12496 @item -mpic-register=@var{reg}
12497 @opindex mpic-register
12498 Specify the register to be used for PIC addressing.
12499 For standard PIC base case, the default will be any suitable register
12500 determined by compiler.  For single PIC base case, the default is
12501 @samp{R9} if target is EABI based or stack-checking is enabled,
12502 otherwise the default is @samp{R10}.
12504 @item -mpic-data-is-text-relative
12505 @opindex mpic-data-is-text-relative
12506 Assume that each data segments are relative to text segment at load time.
12507 Therefore, it permits addressing data using PC-relative operations.
12508 This option is on by default for targets other than VxWorks RTP.
12510 @item -mpoke-function-name
12511 @opindex mpoke-function-name
12512 Write the name of each function into the text section, directly
12513 preceding the function prologue.  The generated code is similar to this:
12515 @smallexample
12516      t0
12517          .ascii "arm_poke_function_name", 0
12518          .align
12519      t1
12520          .word 0xff000000 + (t1 - t0)
12521      arm_poke_function_name
12522          mov     ip, sp
12523          stmfd   sp!, @{fp, ip, lr, pc@}
12524          sub     fp, ip, #4
12525 @end smallexample
12527 When performing a stack backtrace, code can inspect the value of
12528 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
12529 location @code{pc - 12} and the top 8 bits are set, then we know that
12530 there is a function name embedded immediately preceding this location
12531 and has length @code{((pc[-3]) & 0xff000000)}.
12533 @item -mthumb
12534 @itemx -marm
12535 @opindex marm
12536 @opindex mthumb
12538 Select between generating code that executes in ARM and Thumb
12539 states.  The default for most configurations is to generate code
12540 that executes in ARM state, but the default can be changed by
12541 configuring GCC with the @option{--with-mode=}@var{state}
12542 configure option.
12544 @item -mtpcs-frame
12545 @opindex mtpcs-frame
12546 Generate a stack frame that is compliant with the Thumb Procedure Call
12547 Standard for all non-leaf functions.  (A leaf function is one that does
12548 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
12550 @item -mtpcs-leaf-frame
12551 @opindex mtpcs-leaf-frame
12552 Generate a stack frame that is compliant with the Thumb Procedure Call
12553 Standard for all leaf functions.  (A leaf function is one that does
12554 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
12556 @item -mcallee-super-interworking
12557 @opindex mcallee-super-interworking
12558 Gives all externally visible functions in the file being compiled an ARM
12559 instruction set header which switches to Thumb mode before executing the
12560 rest of the function.  This allows these functions to be called from
12561 non-interworking code.  This option is not valid in AAPCS configurations
12562 because interworking is enabled by default.
12564 @item -mcaller-super-interworking
12565 @opindex mcaller-super-interworking
12566 Allows calls via function pointers (including virtual functions) to
12567 execute correctly regardless of whether the target code has been
12568 compiled for interworking or not.  There is a small overhead in the cost
12569 of executing a function pointer if this option is enabled.  This option
12570 is not valid in AAPCS configurations because interworking is enabled
12571 by default.
12573 @item -mtp=@var{name}
12574 @opindex mtp
12575 Specify the access model for the thread local storage pointer.  The valid
12576 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
12577 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
12578 (supported in the arm6k architecture), and @option{auto}, which uses the
12579 best available method for the selected processor.  The default setting is
12580 @option{auto}.
12582 @item -mtls-dialect=@var{dialect}
12583 @opindex mtls-dialect
12584 Specify the dialect to use for accessing thread local storage.  Two
12585 @var{dialect}s are supported---@samp{gnu} and @samp{gnu2}.  The
12586 @samp{gnu} dialect selects the original GNU scheme for supporting
12587 local and global dynamic TLS models.  The @samp{gnu2} dialect
12588 selects the GNU descriptor scheme, which provides better performance
12589 for shared libraries.  The GNU descriptor scheme is compatible with
12590 the original scheme, but does require new assembler, linker and
12591 library support.  Initial and local exec TLS models are unaffected by
12592 this option and always use the original scheme.
12594 @item -mword-relocations
12595 @opindex mword-relocations
12596 Only generate absolute relocations on word-sized values (i.e. R_ARM_ABS32).
12597 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
12598 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
12599 is specified.
12601 @item -mfix-cortex-m3-ldrd
12602 @opindex mfix-cortex-m3-ldrd
12603 Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
12604 with overlapping destination and base registers are used.  This option avoids
12605 generating these instructions.  This option is enabled by default when
12606 @option{-mcpu=cortex-m3} is specified.
12608 @item -munaligned-access
12609 @itemx -mno-unaligned-access
12610 @opindex munaligned-access
12611 @opindex mno-unaligned-access
12612 Enables (or disables) reading and writing of 16- and 32- bit values
12613 from addresses that are not 16- or 32- bit aligned.  By default
12614 unaligned access is disabled for all pre-ARMv6 and all ARMv6-M
12615 architectures, and enabled for all other architectures.  If unaligned
12616 access is not enabled then words in packed data structures will be
12617 accessed a byte at a time.
12619 The ARM attribute @code{Tag_CPU_unaligned_access} will be set in the
12620 generated object file to either true or false, depending upon the
12621 setting of this option.  If unaligned access is enabled then the
12622 preprocessor symbol @code{__ARM_FEATURE_UNALIGNED} will also be
12623 defined.
12625 @item -mneon-for-64bits
12626 @opindex mneon-for-64bits
12627 Enables using Neon to handle scalar 64-bits operations. This is
12628 disabled by default since the cost of moving data from core registers
12629 to Neon is high.
12631 @item -mslow-flash-data
12632 @opindex mslow-flash-data
12633 Assume loading data from flash is slower than fetching instruction.
12634 Therefore literal load is minimized for better performance.
12635 This option is only supported when compiling for ARMv7 M-profile and
12636 off by default.
12638 @item -mrestrict-it
12639 @opindex mrestrict-it
12640 Restricts generation of IT blocks to conform to the rules of ARMv8.
12641 IT blocks can only contain a single 16-bit instruction from a select
12642 set of instructions. This option is on by default for ARMv8 Thumb mode.
12643 @end table
12645 @node AVR Options
12646 @subsection AVR Options
12647 @cindex AVR Options
12649 These options are defined for AVR implementations:
12651 @table @gcctabopt
12652 @item -mmcu=@var{mcu}
12653 @opindex mmcu
12654 Specify Atmel AVR instruction set architectures (ISA) or MCU type.
12656 The default for this option is@tie{}@code{avr2}.
12658 GCC supports the following AVR devices and ISAs:
12660 @include avr-mmcu.texi
12662 @item -maccumulate-args
12663 @opindex maccumulate-args
12664 Accumulate outgoing function arguments and acquire/release the needed
12665 stack space for outgoing function arguments once in function
12666 prologue/epilogue.  Without this option, outgoing arguments are pushed
12667 before calling a function and popped afterwards.
12669 Popping the arguments after the function call can be expensive on
12670 AVR so that accumulating the stack space might lead to smaller
12671 executables because arguments need not to be removed from the
12672 stack after such a function call.
12674 This option can lead to reduced code size for functions that perform
12675 several calls to functions that get their arguments on the stack like
12676 calls to printf-like functions.
12678 @item -mbranch-cost=@var{cost}
12679 @opindex mbranch-cost
12680 Set the branch costs for conditional branch instructions to
12681 @var{cost}.  Reasonable values for @var{cost} are small, non-negative
12682 integers. The default branch cost is 0.
12684 @item -mcall-prologues
12685 @opindex mcall-prologues
12686 Functions prologues/epilogues are expanded as calls to appropriate
12687 subroutines.  Code size is smaller.
12689 @item -mint8
12690 @opindex mint8
12691 Assume @code{int} to be 8-bit integer.  This affects the sizes of all types: a
12692 @code{char} is 1 byte, an @code{int} is 1 byte, a @code{long} is 2 bytes,
12693 and @code{long long} is 4 bytes.  Please note that this option does not
12694 conform to the C standards, but it results in smaller code
12695 size.
12697 @item -mno-interrupts
12698 @opindex mno-interrupts
12699 Generated code is not compatible with hardware interrupts.
12700 Code size is smaller.
12702 @item -mrelax
12703 @opindex mrelax
12704 Try to replace @code{CALL} resp.@: @code{JMP} instruction by the shorter
12705 @code{RCALL} resp.@: @code{RJMP} instruction if applicable.
12706 Setting @code{-mrelax} just adds the @code{--relax} option to the
12707 linker command line when the linker is called.
12709 Jump relaxing is performed by the linker because jump offsets are not
12710 known before code is located. Therefore, the assembler code generated by the
12711 compiler is the same, but the instructions in the executable may
12712 differ from instructions in the assembler code.
12714 Relaxing must be turned on if linker stubs are needed, see the
12715 section on @code{EIND} and linker stubs below.
12717 @item -msp8
12718 @opindex msp8
12719 Treat the stack pointer register as an 8-bit register,
12720 i.e.@: assume the high byte of the stack pointer is zero.
12721 In general, you don't need to set this option by hand.
12723 This option is used internally by the compiler to select and
12724 build multilibs for architectures @code{avr2} and @code{avr25}.
12725 These architectures mix devices with and without @code{SPH}.
12726 For any setting other than @code{-mmcu=avr2} or @code{-mmcu=avr25}
12727 the compiler driver will add or remove this option from the compiler
12728 proper's command line, because the compiler then knows if the device
12729 or architecture has an 8-bit stack pointer and thus no @code{SPH}
12730 register or not.
12732 @item -mstrict-X
12733 @opindex mstrict-X
12734 Use address register @code{X} in a way proposed by the hardware.  This means
12735 that @code{X} is only used in indirect, post-increment or
12736 pre-decrement addressing.
12738 Without this option, the @code{X} register may be used in the same way
12739 as @code{Y} or @code{Z} which then is emulated by additional
12740 instructions.  
12741 For example, loading a value with @code{X+const} addressing with a
12742 small non-negative @code{const < 64} to a register @var{Rn} is
12743 performed as
12745 @example
12746 adiw r26, const   ; X += const
12747 ld   @var{Rn}, X        ; @var{Rn} = *X
12748 sbiw r26, const   ; X -= const
12749 @end example
12751 @item -mtiny-stack
12752 @opindex mtiny-stack
12753 Only change the lower 8@tie{}bits of the stack pointer.
12755 @item -Waddr-space-convert
12756 @opindex Waddr-space-convert
12757 Warn about conversions between address spaces in the case where the
12758 resulting address space is not contained in the incoming address space.
12759 @end table
12761 @subsubsection @code{EIND} and Devices with more than 128 Ki Bytes of Flash
12762 @cindex @code{EIND}
12763 Pointers in the implementation are 16@tie{}bits wide.
12764 The address of a function or label is represented as word address so
12765 that indirect jumps and calls can target any code address in the
12766 range of 64@tie{}Ki words.
12768 In order to facilitate indirect jump on devices with more than 128@tie{}Ki
12769 bytes of program memory space, there is a special function register called
12770 @code{EIND} that serves as most significant part of the target address
12771 when @code{EICALL} or @code{EIJMP} instructions are used.
12773 Indirect jumps and calls on these devices are handled as follows by
12774 the compiler and are subject to some limitations:
12776 @itemize @bullet
12778 @item
12779 The compiler never sets @code{EIND}.
12781 @item
12782 The compiler uses @code{EIND} implicitely in @code{EICALL}/@code{EIJMP}
12783 instructions or might read @code{EIND} directly in order to emulate an
12784 indirect call/jump by means of a @code{RET} instruction.
12786 @item
12787 The compiler assumes that @code{EIND} never changes during the startup
12788 code or during the application. In particular, @code{EIND} is not
12789 saved/restored in function or interrupt service routine
12790 prologue/epilogue.
12792 @item
12793 For indirect calls to functions and computed goto, the linker
12794 generates @emph{stubs}. Stubs are jump pads sometimes also called
12795 @emph{trampolines}. Thus, the indirect call/jump jumps to such a stub.
12796 The stub contains a direct jump to the desired address.
12798 @item
12799 Linker relaxation must be turned on so that the linker will generate
12800 the stubs correctly an all situaltion. See the compiler option
12801 @code{-mrelax} and the linler option @code{--relax}.
12802 There are corner cases where the linker is supposed to generate stubs
12803 but aborts without relaxation and without a helpful error message.
12805 @item
12806 The default linker script is arranged for code with @code{EIND = 0}.
12807 If code is supposed to work for a setup with @code{EIND != 0}, a custom
12808 linker script has to be used in order to place the sections whose
12809 name start with @code{.trampolines} into the segment where @code{EIND}
12810 points to.
12812 @item
12813 The startup code from libgcc never sets @code{EIND}.
12814 Notice that startup code is a blend of code from libgcc and AVR-LibC.
12815 For the impact of AVR-LibC on @code{EIND}, see the
12816 @w{@uref{http://nongnu.org/avr-libc/user-manual/,AVR-LibC user manual}}.
12818 @item
12819 It is legitimate for user-specific startup code to set up @code{EIND}
12820 early, for example by means of initialization code located in
12821 section @code{.init3}. Such code runs prior to general startup code
12822 that initializes RAM and calls constructors, but after the bit
12823 of startup code from AVR-LibC that sets @code{EIND} to the segment
12824 where the vector table is located.
12825 @example
12826 #include <avr/io.h>
12828 static void
12829 __attribute__((section(".init3"),naked,used,no_instrument_function))
12830 init3_set_eind (void)
12832   __asm volatile ("ldi r24,pm_hh8(__trampolines_start)\n\t"
12833                   "out %i0,r24" :: "n" (&EIND) : "r24","memory");
12835 @end example
12837 @noindent
12838 The @code{__trampolines_start} symbol is defined in the linker script.
12840 @item
12841 Stubs are generated automatically by the linker if
12842 the following two conditions are met:
12843 @itemize @minus
12845 @item The address of a label is taken by means of the @code{gs} modifier
12846 (short for @emph{generate stubs}) like so:
12847 @example
12848 LDI r24, lo8(gs(@var{func}))
12849 LDI r25, hi8(gs(@var{func}))
12850 @end example
12851 @item The final location of that label is in a code segment
12852 @emph{outside} the segment where the stubs are located.
12853 @end itemize
12855 @item
12856 The compiler emits such @code{gs} modifiers for code labels in the
12857 following situations:
12858 @itemize @minus
12859 @item Taking address of a function or code label.
12860 @item Computed goto.
12861 @item If prologue-save function is used, see @option{-mcall-prologues}
12862 command-line option.
12863 @item Switch/case dispatch tables. If you do not want such dispatch
12864 tables you can specify the @option{-fno-jump-tables} command-line option.
12865 @item C and C++ constructors/destructors called during startup/shutdown.
12866 @item If the tools hit a @code{gs()} modifier explained above.
12867 @end itemize
12869 @item
12870 Jumping to non-symbolic addresses like so is @emph{not} supported:
12872 @example
12873 int main (void)
12875     /* Call function at word address 0x2 */
12876     return ((int(*)(void)) 0x2)();
12878 @end example
12880 Instead, a stub has to be set up, i.e.@: the function has to be called
12881 through a symbol (@code{func_4} in the example):
12883 @example
12884 int main (void)
12886     extern int func_4 (void);
12888     /* Call function at byte address 0x4 */
12889     return func_4();
12891 @end example
12893 and the application be linked with @code{-Wl,--defsym,func_4=0x4}.
12894 Alternatively, @code{func_4} can be defined in the linker script.
12895 @end itemize
12897 @subsubsection Handling of the @code{RAMPD}, @code{RAMPX}, @code{RAMPY} and @code{RAMPZ} Special Function Registers
12898 @cindex @code{RAMPD}
12899 @cindex @code{RAMPX}
12900 @cindex @code{RAMPY}
12901 @cindex @code{RAMPZ}
12902 Some AVR devices support memories larger than the 64@tie{}KiB range
12903 that can be accessed with 16-bit pointers.  To access memory locations
12904 outside this 64@tie{}KiB range, the contentent of a @code{RAMP}
12905 register is used as high part of the address:
12906 The @code{X}, @code{Y}, @code{Z} address register is concatenated
12907 with the @code{RAMPX}, @code{RAMPY}, @code{RAMPZ} special function
12908 register, respectively, to get a wide address. Similarly,
12909 @code{RAMPD} is used together with direct addressing.
12911 @itemize
12912 @item
12913 The startup code initializes the @code{RAMP} special function
12914 registers with zero.
12916 @item
12917 If a @ref{AVR Named Address Spaces,named address space} other than
12918 generic or @code{__flash} is used, then @code{RAMPZ} is set
12919 as needed before the operation.
12921 @item
12922 If the device supports RAM larger than 64@tie{}KiB and the compiler
12923 needs to change @code{RAMPZ} to accomplish an operation, @code{RAMPZ}
12924 is reset to zero after the operation.
12926 @item
12927 If the device comes with a specific @code{RAMP} register, the ISR
12928 prologue/epilogue saves/restores that SFR and initializes it with
12929 zero in case the ISR code might (implicitly) use it.
12931 @item
12932 RAM larger than 64@tie{}KiB is not supported by GCC for AVR targets.
12933 If you use inline assembler to read from locations outside the
12934 16-bit address range and change one of the @code{RAMP} registers,
12935 you must reset it to zero after the access.
12937 @end itemize
12939 @subsubsection AVR Built-in Macros
12941 GCC defines several built-in macros so that the user code can test
12942 for the presence or absence of features.  Almost any of the following
12943 built-in macros are deduced from device capabilities and thus
12944 triggered by the @code{-mmcu=} command-line option.
12946 For even more AVR-specific built-in macros see
12947 @ref{AVR Named Address Spaces} and @ref{AVR Built-in Functions}.
12949 @table @code
12951 @item __AVR_ARCH__
12952 Build-in macro that resolves to a decimal number that identifies the
12953 architecture and depends on the @code{-mmcu=@var{mcu}} option.
12954 Possible values are:
12956 @code{2}, @code{25}, @code{3}, @code{31}, @code{35},
12957 @code{4}, @code{5}, @code{51}, @code{6}, @code{102}, @code{104},
12958 @code{105}, @code{106}, @code{107}
12960 for @var{mcu}=@code{avr2}, @code{avr25}, @code{avr3},
12961 @code{avr31}, @code{avr35}, @code{avr4}, @code{avr5}, @code{avr51},
12962 @code{avr6}, @code{avrxmega2}, @code{avrxmega4}, @code{avrxmega5},
12963 @code{avrxmega6}, @code{avrxmega7}, respectively.
12964 If @var{mcu} specifies a device, this built-in macro is set
12965 accordingly. For example, with @code{-mmcu=atmega8} the macro will be
12966 defined to @code{4}.
12968 @item __AVR_@var{Device}__
12969 Setting @code{-mmcu=@var{device}} defines this built-in macro which reflects
12970 the device's name. For example, @code{-mmcu=atmega8} defines the
12971 built-in macro @code{__AVR_ATmega8__}, @code{-mmcu=attiny261a} defines
12972 @code{__AVR_ATtiny261A__}, etc.
12974 The built-in macros' names follow
12975 the scheme @code{__AVR_@var{Device}__} where @var{Device} is
12976 the device name as from the AVR user manual. The difference between
12977 @var{Device} in the built-in macro and @var{device} in
12978 @code{-mmcu=@var{device}} is that the latter is always lowercase.
12980 If @var{device} is not a device but only a core architecture like
12981 @code{avr51}, this macro will not be defined.
12983 @item __AVR_XMEGA__
12984 The device / architecture belongs to the XMEGA family of devices.
12986 @item __AVR_HAVE_ELPM__
12987 The device has the the @code{ELPM} instruction.
12989 @item __AVR_HAVE_ELPMX__
12990 The device has the @code{ELPM R@var{n},Z} and @code{ELPM
12991 R@var{n},Z+} instructions.
12993 @item __AVR_HAVE_MOVW__
12994 The device has the @code{MOVW} instruction to perform 16-bit
12995 register-register moves.
12997 @item __AVR_HAVE_LPMX__
12998 The device has the @code{LPM R@var{n},Z} and
12999 @code{LPM R@var{n},Z+} instructions.
13001 @item __AVR_HAVE_MUL__
13002 The device has a hardware multiplier. 
13004 @item __AVR_HAVE_JMP_CALL__
13005 The device has the @code{JMP} and @code{CALL} instructions.
13006 This is the case for devices with at least 16@tie{}KiB of program
13007 memory.
13009 @item __AVR_HAVE_EIJMP_EICALL__
13010 @itemx __AVR_3_BYTE_PC__
13011 The device has the @code{EIJMP} and @code{EICALL} instructions.
13012 This is the case for devices with more than 128@tie{}KiB of program memory.
13013 This also means that the program counter
13014 (PC) is 3@tie{}bytes wide.
13016 @item __AVR_2_BYTE_PC__
13017 The program counter (PC) is 2@tie{}bytes wide. This is the case for devices
13018 with up to 128@tie{}KiB of program memory.
13020 @item __AVR_HAVE_8BIT_SP__
13021 @itemx __AVR_HAVE_16BIT_SP__
13022 The stack pointer (SP) register is treated as 8-bit respectively
13023 16-bit register by the compiler.
13024 The definition of these macros is affected by @code{-mtiny-stack}.
13026 @item __AVR_HAVE_SPH__
13027 @itemx __AVR_SP8__
13028 The device has the SPH (high part of stack pointer) special function
13029 register or has an 8-bit stack pointer, respectively.
13030 The definition of these macros is affected by @code{-mmcu=} and
13031 in the cases of @code{-mmcu=avr2} and @code{-mmcu=avr25} also
13032 by @code{-msp8}.
13034 @item __AVR_HAVE_RAMPD__
13035 @itemx __AVR_HAVE_RAMPX__
13036 @itemx __AVR_HAVE_RAMPY__
13037 @itemx __AVR_HAVE_RAMPZ__
13038 The device has the @code{RAMPD}, @code{RAMPX}, @code{RAMPY},
13039 @code{RAMPZ} special function register, respectively.
13041 @item __NO_INTERRUPTS__
13042 This macro reflects the @code{-mno-interrupts} command line option.
13044 @item __AVR_ERRATA_SKIP__
13045 @itemx __AVR_ERRATA_SKIP_JMP_CALL__
13046 Some AVR devices (AT90S8515, ATmega103) must not skip 32-bit
13047 instructions because of a hardware erratum.  Skip instructions are
13048 @code{SBRS}, @code{SBRC}, @code{SBIS}, @code{SBIC} and @code{CPSE}.
13049 The second macro is only defined if @code{__AVR_HAVE_JMP_CALL__} is also
13050 set.
13052 @item __AVR_ISA_RMW__
13053 The device has Read-Modify-Write instructions (XCH, LAC, LAS and LAT).
13055 @item __AVR_SFR_OFFSET__=@var{offset}
13056 Instructions that can address I/O special function registers directly
13057 like @code{IN}, @code{OUT}, @code{SBI}, etc.@: may use a different
13058 address as if addressed by an instruction to access RAM like @code{LD}
13059 or @code{STS}. This offset depends on the device architecture and has
13060 to be subtracted from the RAM address in order to get the
13061 respective I/O@tie{}address.
13063 @item __WITH_AVRLIBC__
13064 The compiler is configured to be used together with AVR-Libc.
13065 See the @code{--with-avrlibc} configure option.
13067 @end table
13069 @node Blackfin Options
13070 @subsection Blackfin Options
13071 @cindex Blackfin Options
13073 @table @gcctabopt
13074 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
13075 @opindex mcpu=
13076 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
13077 can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
13078 @samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
13079 @samp{bf527}, @samp{bf531}, @samp{bf532}, @samp{bf533},
13080 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
13081 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
13082 @samp{bf542m}, @samp{bf544m}, @samp{bf547m}, @samp{bf548m}, @samp{bf549m},
13083 @samp{bf561}, @samp{bf592}.
13085 The optional @var{sirevision} specifies the silicon revision of the target
13086 Blackfin processor.  Any workarounds available for the targeted silicon revision
13087 are enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
13088 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
13089 are enabled.  The @code{__SILICON_REVISION__} macro is defined to two
13090 hexadecimal digits representing the major and minor numbers in the silicon
13091 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
13092 is not defined.  If @var{sirevision} is @samp{any}, the
13093 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
13094 If this optional @var{sirevision} is not used, GCC assumes the latest known
13095 silicon revision of the targeted Blackfin processor.
13097 GCC defines a preprocessor macro for the specified @var{cpu}.
13098 For the @samp{bfin-elf} toolchain, this option causes the hardware BSP
13099 provided by libgloss to be linked in if @option{-msim} is not given.
13101 Without this option, @samp{bf532} is used as the processor by default.
13103 Note that support for @samp{bf561} is incomplete.  For @samp{bf561},
13104 only the preprocessor macro is defined.
13106 @item -msim
13107 @opindex msim
13108 Specifies that the program will be run on the simulator.  This causes
13109 the simulator BSP provided by libgloss to be linked in.  This option
13110 has effect only for @samp{bfin-elf} toolchain.
13111 Certain other options, such as @option{-mid-shared-library} and
13112 @option{-mfdpic}, imply @option{-msim}.
13114 @item -momit-leaf-frame-pointer
13115 @opindex momit-leaf-frame-pointer
13116 Don't keep the frame pointer in a register for leaf functions.  This
13117 avoids the instructions to save, set up and restore frame pointers and
13118 makes an extra register available in leaf functions.  The option
13119 @option{-fomit-frame-pointer} removes the frame pointer for all functions,
13120 which might make debugging harder.
13122 @item -mspecld-anomaly
13123 @opindex mspecld-anomaly
13124 When enabled, the compiler ensures that the generated code does not
13125 contain speculative loads after jump instructions. If this option is used,
13126 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
13128 @item -mno-specld-anomaly
13129 @opindex mno-specld-anomaly
13130 Don't generate extra code to prevent speculative loads from occurring.
13132 @item -mcsync-anomaly
13133 @opindex mcsync-anomaly
13134 When enabled, the compiler ensures that the generated code does not
13135 contain CSYNC or SSYNC instructions too soon after conditional branches.
13136 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
13138 @item -mno-csync-anomaly
13139 @opindex mno-csync-anomaly
13140 Don't generate extra code to prevent CSYNC or SSYNC instructions from
13141 occurring too soon after a conditional branch.
13143 @item -mlow-64k
13144 @opindex mlow-64k
13145 When enabled, the compiler is free to take advantage of the knowledge that
13146 the entire program fits into the low 64k of memory.
13148 @item -mno-low-64k
13149 @opindex mno-low-64k
13150 Assume that the program is arbitrarily large.  This is the default.
13152 @item -mstack-check-l1
13153 @opindex mstack-check-l1
13154 Do stack checking using information placed into L1 scratchpad memory by the
13155 uClinux kernel.
13157 @item -mid-shared-library
13158 @opindex mid-shared-library
13159 Generate code that supports shared libraries via the library ID method.
13160 This allows for execute in place and shared libraries in an environment
13161 without virtual memory management.  This option implies @option{-fPIC}.
13162 With a @samp{bfin-elf} target, this option implies @option{-msim}.
13164 @item -mno-id-shared-library
13165 @opindex mno-id-shared-library
13166 Generate code that doesn't assume ID-based shared libraries are being used.
13167 This is the default.
13169 @item -mleaf-id-shared-library
13170 @opindex mleaf-id-shared-library
13171 Generate code that supports shared libraries via the library ID method,
13172 but assumes that this library or executable won't link against any other
13173 ID shared libraries.  That allows the compiler to use faster code for jumps
13174 and calls.
13176 @item -mno-leaf-id-shared-library
13177 @opindex mno-leaf-id-shared-library
13178 Do not assume that the code being compiled won't link against any ID shared
13179 libraries.  Slower code is generated for jump and call insns.
13181 @item -mshared-library-id=n
13182 @opindex mshared-library-id
13183 Specifies the identification number of the ID-based shared library being
13184 compiled.  Specifying a value of 0 generates more compact code; specifying
13185 other values forces the allocation of that number to the current
13186 library but is no more space- or time-efficient than omitting this option.
13188 @item -msep-data
13189 @opindex msep-data
13190 Generate code that allows the data segment to be located in a different
13191 area of memory from the text segment.  This allows for execute in place in
13192 an environment without virtual memory management by eliminating relocations
13193 against the text section.
13195 @item -mno-sep-data
13196 @opindex mno-sep-data
13197 Generate code that assumes that the data segment follows the text segment.
13198 This is the default.
13200 @item -mlong-calls
13201 @itemx -mno-long-calls
13202 @opindex mlong-calls
13203 @opindex mno-long-calls
13204 Tells the compiler to perform function calls by first loading the
13205 address of the function into a register and then performing a subroutine
13206 call on this register.  This switch is needed if the target function
13207 lies outside of the 24-bit addressing range of the offset-based
13208 version of subroutine call instruction.
13210 This feature is not enabled by default.  Specifying
13211 @option{-mno-long-calls} restores the default behavior.  Note these
13212 switches have no effect on how the compiler generates code to handle
13213 function calls via function pointers.
13215 @item -mfast-fp
13216 @opindex mfast-fp
13217 Link with the fast floating-point library. This library relaxes some of
13218 the IEEE floating-point standard's rules for checking inputs against
13219 Not-a-Number (NAN), in the interest of performance.
13221 @item -minline-plt
13222 @opindex minline-plt
13223 Enable inlining of PLT entries in function calls to functions that are
13224 not known to bind locally.  It has no effect without @option{-mfdpic}.
13226 @item -mmulticore
13227 @opindex mmulticore
13228 Build a standalone application for multicore Blackfin processors. 
13229 This option causes proper start files and link scripts supporting 
13230 multicore to be used, and defines the macro @code{__BFIN_MULTICORE}. 
13231 It can only be used with @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. 
13233 This option can be used with @option{-mcorea} or @option{-mcoreb}, which
13234 selects the one-application-per-core programming model.  Without
13235 @option{-mcorea} or @option{-mcoreb}, the single-application/dual-core
13236 programming model is used. In this model, the main function of Core B
13237 should be named as @code{coreb_main}.
13239 If this option is not used, the single-core application programming
13240 model is used.
13242 @item -mcorea
13243 @opindex mcorea
13244 Build a standalone application for Core A of BF561 when using
13245 the one-application-per-core programming model. Proper start files
13246 and link scripts are used to support Core A, and the macro
13247 @code{__BFIN_COREA} is defined.
13248 This option can only be used in conjunction with @option{-mmulticore}.
13250 @item -mcoreb
13251 @opindex mcoreb
13252 Build a standalone application for Core B of BF561 when using
13253 the one-application-per-core programming model. Proper start files
13254 and link scripts are used to support Core B, and the macro
13255 @code{__BFIN_COREB} is defined. When this option is used, @code{coreb_main}
13256 should be used instead of @code{main}. 
13257 This option can only be used in conjunction with @option{-mmulticore}.
13259 @item -msdram
13260 @opindex msdram
13261 Build a standalone application for SDRAM. Proper start files and
13262 link scripts are used to put the application into SDRAM, and the macro
13263 @code{__BFIN_SDRAM} is defined.
13264 The loader should initialize SDRAM before loading the application.
13266 @item -micplb
13267 @opindex micplb
13268 Assume that ICPLBs are enabled at run time.  This has an effect on certain
13269 anomaly workarounds.  For Linux targets, the default is to assume ICPLBs
13270 are enabled; for standalone applications the default is off.
13271 @end table
13273 @node C6X Options
13274 @subsection C6X Options
13275 @cindex C6X Options
13277 @table @gcctabopt
13278 @item -march=@var{name}
13279 @opindex march
13280 This specifies the name of the target architecture.  GCC uses this
13281 name to determine what kind of instructions it can emit when generating
13282 assembly code.  Permissible names are: @samp{c62x},
13283 @samp{c64x}, @samp{c64x+}, @samp{c67x}, @samp{c67x+}, @samp{c674x}.
13285 @item -mbig-endian
13286 @opindex mbig-endian
13287 Generate code for a big-endian target.
13289 @item -mlittle-endian
13290 @opindex mlittle-endian
13291 Generate code for a little-endian target.  This is the default.
13293 @item -msim
13294 @opindex msim
13295 Choose startup files and linker script suitable for the simulator.
13297 @item -msdata=default
13298 @opindex msdata=default
13299 Put small global and static data in the @samp{.neardata} section,
13300 which is pointed to by register @code{B14}.  Put small uninitialized
13301 global and static data in the @samp{.bss} section, which is adjacent
13302 to the @samp{.neardata} section.  Put small read-only data into the
13303 @samp{.rodata} section.  The corresponding sections used for large
13304 pieces of data are @samp{.fardata}, @samp{.far} and @samp{.const}.
13306 @item -msdata=all
13307 @opindex msdata=all
13308 Put all data, not just small objects, into the sections reserved for
13309 small data, and use addressing relative to the @code{B14} register to
13310 access them.
13312 @item -msdata=none
13313 @opindex msdata=none
13314 Make no use of the sections reserved for small data, and use absolute
13315 addresses to access all data.  Put all initialized global and static
13316 data in the @samp{.fardata} section, and all uninitialized data in the
13317 @samp{.far} section.  Put all constant data into the @samp{.const}
13318 section.
13319 @end table
13321 @node CRIS Options
13322 @subsection CRIS Options
13323 @cindex CRIS Options
13325 These options are defined specifically for the CRIS ports.
13327 @table @gcctabopt
13328 @item -march=@var{architecture-type}
13329 @itemx -mcpu=@var{architecture-type}
13330 @opindex march
13331 @opindex mcpu
13332 Generate code for the specified architecture.  The choices for
13333 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
13334 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
13335 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
13336 @samp{v10}.
13338 @item -mtune=@var{architecture-type}
13339 @opindex mtune
13340 Tune to @var{architecture-type} everything applicable about the generated
13341 code, except for the ABI and the set of available instructions.  The
13342 choices for @var{architecture-type} are the same as for
13343 @option{-march=@var{architecture-type}}.
13345 @item -mmax-stack-frame=@var{n}
13346 @opindex mmax-stack-frame
13347 Warn when the stack frame of a function exceeds @var{n} bytes.
13349 @item -metrax4
13350 @itemx -metrax100
13351 @opindex metrax4
13352 @opindex metrax100
13353 The options @option{-metrax4} and @option{-metrax100} are synonyms for
13354 @option{-march=v3} and @option{-march=v8} respectively.
13356 @item -mmul-bug-workaround
13357 @itemx -mno-mul-bug-workaround
13358 @opindex mmul-bug-workaround
13359 @opindex mno-mul-bug-workaround
13360 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
13361 models where it applies.  This option is active by default.
13363 @item -mpdebug
13364 @opindex mpdebug
13365 Enable CRIS-specific verbose debug-related information in the assembly
13366 code.  This option also has the effect of turning off the @samp{#NO_APP}
13367 formatted-code indicator to the assembler at the beginning of the
13368 assembly file.
13370 @item -mcc-init
13371 @opindex mcc-init
13372 Do not use condition-code results from previous instruction; always emit
13373 compare and test instructions before use of condition codes.
13375 @item -mno-side-effects
13376 @opindex mno-side-effects
13377 Do not emit instructions with side effects in addressing modes other than
13378 post-increment.
13380 @item -mstack-align
13381 @itemx -mno-stack-align
13382 @itemx -mdata-align
13383 @itemx -mno-data-align
13384 @itemx -mconst-align
13385 @itemx -mno-const-align
13386 @opindex mstack-align
13387 @opindex mno-stack-align
13388 @opindex mdata-align
13389 @opindex mno-data-align
13390 @opindex mconst-align
13391 @opindex mno-const-align
13392 These options (@samp{no-} options) arrange (eliminate arrangements) for the
13393 stack frame, individual data and constants to be aligned for the maximum
13394 single data access size for the chosen CPU model.  The default is to
13395 arrange for 32-bit alignment.  ABI details such as structure layout are
13396 not affected by these options.
13398 @item -m32-bit
13399 @itemx -m16-bit
13400 @itemx -m8-bit
13401 @opindex m32-bit
13402 @opindex m16-bit
13403 @opindex m8-bit
13404 Similar to the stack- data- and const-align options above, these options
13405 arrange for stack frame, writable data and constants to all be 32-bit,
13406 16-bit or 8-bit aligned.  The default is 32-bit alignment.
13408 @item -mno-prologue-epilogue
13409 @itemx -mprologue-epilogue
13410 @opindex mno-prologue-epilogue
13411 @opindex mprologue-epilogue
13412 With @option{-mno-prologue-epilogue}, the normal function prologue and
13413 epilogue which set up the stack frame are omitted and no return
13414 instructions or return sequences are generated in the code.  Use this
13415 option only together with visual inspection of the compiled code: no
13416 warnings or errors are generated when call-saved registers must be saved,
13417 or storage for local variables needs to be allocated.
13419 @item -mno-gotplt
13420 @itemx -mgotplt
13421 @opindex mno-gotplt
13422 @opindex mgotplt
13423 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
13424 instruction sequences that load addresses for functions from the PLT part
13425 of the GOT rather than (traditional on other architectures) calls to the
13426 PLT@.  The default is @option{-mgotplt}.
13428 @item -melf
13429 @opindex melf
13430 Legacy no-op option only recognized with the cris-axis-elf and
13431 cris-axis-linux-gnu targets.
13433 @item -mlinux
13434 @opindex mlinux
13435 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
13437 @item -sim
13438 @opindex sim
13439 This option, recognized for the cris-axis-elf, arranges
13440 to link with input-output functions from a simulator library.  Code,
13441 initialized data and zero-initialized data are allocated consecutively.
13443 @item -sim2
13444 @opindex sim2
13445 Like @option{-sim}, but pass linker options to locate initialized data at
13446 0x40000000 and zero-initialized data at 0x80000000.
13447 @end table
13449 @node CR16 Options
13450 @subsection CR16 Options
13451 @cindex CR16 Options
13453 These options are defined specifically for the CR16 ports.
13455 @table @gcctabopt
13457 @item -mmac
13458 @opindex mmac
13459 Enable the use of multiply-accumulate instructions. Disabled by default.
13461 @item -mcr16cplus
13462 @itemx -mcr16c
13463 @opindex mcr16cplus
13464 @opindex mcr16c
13465 Generate code for CR16C or CR16C+ architecture. CR16C+ architecture 
13466 is default.
13468 @item -msim
13469 @opindex msim
13470 Links the library libsim.a which is in compatible with simulator. Applicable
13471 to ELF compiler only.
13473 @item -mint32
13474 @opindex mint32
13475 Choose integer type as 32-bit wide.
13477 @item -mbit-ops
13478 @opindex mbit-ops
13479 Generates @code{sbit}/@code{cbit} instructions for bit manipulations.
13481 @item -mdata-model=@var{model}
13482 @opindex mdata-model
13483 Choose a data model. The choices for @var{model} are @samp{near},
13484 @samp{far} or @samp{medium}. @samp{medium} is default.
13485 However, @samp{far} is not valid with @option{-mcr16c}, as the
13486 CR16C architecture does not support the far data model.
13487 @end table
13489 @node Darwin Options
13490 @subsection Darwin Options
13491 @cindex Darwin options
13493 These options are defined for all architectures running the Darwin operating
13494 system.
13496 FSF GCC on Darwin does not create ``fat'' object files; it creates
13497 an object file for the single architecture that GCC was built to
13498 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
13499 @option{-arch} options are used; it does so by running the compiler or
13500 linker multiple times and joining the results together with
13501 @file{lipo}.
13503 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
13504 @samp{i686}) is determined by the flags that specify the ISA
13505 that GCC is targeting, like @option{-mcpu} or @option{-march}.  The
13506 @option{-force_cpusubtype_ALL} option can be used to override this.
13508 The Darwin tools vary in their behavior when presented with an ISA
13509 mismatch.  The assembler, @file{as}, only permits instructions to
13510 be used that are valid for the subtype of the file it is generating,
13511 so you cannot put 64-bit instructions in a @samp{ppc750} object file.
13512 The linker for shared libraries, @file{/usr/bin/libtool}, fails
13513 and prints an error if asked to create a shared library with a less
13514 restrictive subtype than its input files (for instance, trying to put
13515 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
13516 for executables, @command{ld}, quietly gives the executable the most
13517 restrictive subtype of any of its input files.
13519 @table @gcctabopt
13520 @item -F@var{dir}
13521 @opindex F
13522 Add the framework directory @var{dir} to the head of the list of
13523 directories to be searched for header files.  These directories are
13524 interleaved with those specified by @option{-I} options and are
13525 scanned in a left-to-right order.
13527 A framework directory is a directory with frameworks in it.  A
13528 framework is a directory with a @file{Headers} and/or
13529 @file{PrivateHeaders} directory contained directly in it that ends
13530 in @file{.framework}.  The name of a framework is the name of this
13531 directory excluding the @file{.framework}.  Headers associated with
13532 the framework are found in one of those two directories, with
13533 @file{Headers} being searched first.  A subframework is a framework
13534 directory that is in a framework's @file{Frameworks} directory.
13535 Includes of subframework headers can only appear in a header of a
13536 framework that contains the subframework, or in a sibling subframework
13537 header.  Two subframeworks are siblings if they occur in the same
13538 framework.  A subframework should not have the same name as a
13539 framework; a warning is issued if this is violated.  Currently a
13540 subframework cannot have subframeworks; in the future, the mechanism
13541 may be extended to support this.  The standard frameworks can be found
13542 in @file{/System/Library/Frameworks} and
13543 @file{/Library/Frameworks}.  An example include looks like
13544 @code{#include <Framework/header.h>}, where @file{Framework} denotes
13545 the name of the framework and @file{header.h} is found in the
13546 @file{PrivateHeaders} or @file{Headers} directory.
13548 @item -iframework@var{dir}
13549 @opindex iframework
13550 Like @option{-F} except the directory is a treated as a system
13551 directory.  The main difference between this @option{-iframework} and
13552 @option{-F} is that with @option{-iframework} the compiler does not
13553 warn about constructs contained within header files found via
13554 @var{dir}.  This option is valid only for the C family of languages.
13556 @item -gused
13557 @opindex gused
13558 Emit debugging information for symbols that are used.  For stabs
13559 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
13560 This is by default ON@.
13562 @item -gfull
13563 @opindex gfull
13564 Emit debugging information for all symbols and types.
13566 @item -mmacosx-version-min=@var{version}
13567 The earliest version of MacOS X that this executable will run on
13568 is @var{version}.  Typical values of @var{version} include @code{10.1},
13569 @code{10.2}, and @code{10.3.9}.
13571 If the compiler was built to use the system's headers by default,
13572 then the default for this option is the system version on which the
13573 compiler is running, otherwise the default is to make choices that
13574 are compatible with as many systems and code bases as possible.
13576 @item -mkernel
13577 @opindex mkernel
13578 Enable kernel development mode.  The @option{-mkernel} option sets
13579 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
13580 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
13581 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
13582 applicable.  This mode also sets @option{-mno-altivec},
13583 @option{-msoft-float}, @option{-fno-builtin} and
13584 @option{-mlong-branch} for PowerPC targets.
13586 @item -mone-byte-bool
13587 @opindex mone-byte-bool
13588 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
13589 By default @samp{sizeof(bool)} is @samp{4} when compiling for
13590 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
13591 option has no effect on x86.
13593 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
13594 to generate code that is not binary compatible with code generated
13595 without that switch.  Using this switch may require recompiling all
13596 other modules in a program, including system libraries.  Use this
13597 switch to conform to a non-default data model.
13599 @item -mfix-and-continue
13600 @itemx -ffix-and-continue
13601 @itemx -findirect-data
13602 @opindex mfix-and-continue
13603 @opindex ffix-and-continue
13604 @opindex findirect-data
13605 Generate code suitable for fast turnaround development, such as to
13606 allow GDB to dynamically load @code{.o} files into already-running
13607 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
13608 are provided for backwards compatibility.
13610 @item -all_load
13611 @opindex all_load
13612 Loads all members of static archive libraries.
13613 See man ld(1) for more information.
13615 @item -arch_errors_fatal
13616 @opindex arch_errors_fatal
13617 Cause the errors having to do with files that have the wrong architecture
13618 to be fatal.
13620 @item -bind_at_load
13621 @opindex bind_at_load
13622 Causes the output file to be marked such that the dynamic linker will
13623 bind all undefined references when the file is loaded or launched.
13625 @item -bundle
13626 @opindex bundle
13627 Produce a Mach-o bundle format file.
13628 See man ld(1) for more information.
13630 @item -bundle_loader @var{executable}
13631 @opindex bundle_loader
13632 This option specifies the @var{executable} that will load the build
13633 output file being linked.  See man ld(1) for more information.
13635 @item -dynamiclib
13636 @opindex dynamiclib
13637 When passed this option, GCC produces a dynamic library instead of
13638 an executable when linking, using the Darwin @file{libtool} command.
13640 @item -force_cpusubtype_ALL
13641 @opindex force_cpusubtype_ALL
13642 This causes GCC's output file to have the @var{ALL} subtype, instead of
13643 one controlled by the @option{-mcpu} or @option{-march} option.
13645 @item -allowable_client  @var{client_name}
13646 @itemx -client_name
13647 @itemx -compatibility_version
13648 @itemx -current_version
13649 @itemx -dead_strip
13650 @itemx -dependency-file
13651 @itemx -dylib_file
13652 @itemx -dylinker_install_name
13653 @itemx -dynamic
13654 @itemx -exported_symbols_list
13655 @itemx -filelist
13656 @need 800
13657 @itemx -flat_namespace
13658 @itemx -force_flat_namespace
13659 @itemx -headerpad_max_install_names
13660 @itemx -image_base
13661 @itemx -init
13662 @itemx -install_name
13663 @itemx -keep_private_externs
13664 @itemx -multi_module
13665 @itemx -multiply_defined
13666 @itemx -multiply_defined_unused
13667 @need 800
13668 @itemx -noall_load
13669 @itemx -no_dead_strip_inits_and_terms
13670 @itemx -nofixprebinding
13671 @itemx -nomultidefs
13672 @itemx -noprebind
13673 @itemx -noseglinkedit
13674 @itemx -pagezero_size
13675 @itemx -prebind
13676 @itemx -prebind_all_twolevel_modules
13677 @itemx -private_bundle
13678 @need 800
13679 @itemx -read_only_relocs
13680 @itemx -sectalign
13681 @itemx -sectobjectsymbols
13682 @itemx -whyload
13683 @itemx -seg1addr
13684 @itemx -sectcreate
13685 @itemx -sectobjectsymbols
13686 @itemx -sectorder
13687 @itemx -segaddr
13688 @itemx -segs_read_only_addr
13689 @need 800
13690 @itemx -segs_read_write_addr
13691 @itemx -seg_addr_table
13692 @itemx -seg_addr_table_filename
13693 @itemx -seglinkedit
13694 @itemx -segprot
13695 @itemx -segs_read_only_addr
13696 @itemx -segs_read_write_addr
13697 @itemx -single_module
13698 @itemx -static
13699 @itemx -sub_library
13700 @need 800
13701 @itemx -sub_umbrella
13702 @itemx -twolevel_namespace
13703 @itemx -umbrella
13704 @itemx -undefined
13705 @itemx -unexported_symbols_list
13706 @itemx -weak_reference_mismatches
13707 @itemx -whatsloaded
13708 @opindex allowable_client
13709 @opindex client_name
13710 @opindex compatibility_version
13711 @opindex current_version
13712 @opindex dead_strip
13713 @opindex dependency-file
13714 @opindex dylib_file
13715 @opindex dylinker_install_name
13716 @opindex dynamic
13717 @opindex exported_symbols_list
13718 @opindex filelist
13719 @opindex flat_namespace
13720 @opindex force_flat_namespace
13721 @opindex headerpad_max_install_names
13722 @opindex image_base
13723 @opindex init
13724 @opindex install_name
13725 @opindex keep_private_externs
13726 @opindex multi_module
13727 @opindex multiply_defined
13728 @opindex multiply_defined_unused
13729 @opindex noall_load
13730 @opindex no_dead_strip_inits_and_terms
13731 @opindex nofixprebinding
13732 @opindex nomultidefs
13733 @opindex noprebind
13734 @opindex noseglinkedit
13735 @opindex pagezero_size
13736 @opindex prebind
13737 @opindex prebind_all_twolevel_modules
13738 @opindex private_bundle
13739 @opindex read_only_relocs
13740 @opindex sectalign
13741 @opindex sectobjectsymbols
13742 @opindex whyload
13743 @opindex seg1addr
13744 @opindex sectcreate
13745 @opindex sectobjectsymbols
13746 @opindex sectorder
13747 @opindex segaddr
13748 @opindex segs_read_only_addr
13749 @opindex segs_read_write_addr
13750 @opindex seg_addr_table
13751 @opindex seg_addr_table_filename
13752 @opindex seglinkedit
13753 @opindex segprot
13754 @opindex segs_read_only_addr
13755 @opindex segs_read_write_addr
13756 @opindex single_module
13757 @opindex static
13758 @opindex sub_library
13759 @opindex sub_umbrella
13760 @opindex twolevel_namespace
13761 @opindex umbrella
13762 @opindex undefined
13763 @opindex unexported_symbols_list
13764 @opindex weak_reference_mismatches
13765 @opindex whatsloaded
13766 These options are passed to the Darwin linker.  The Darwin linker man page
13767 describes them in detail.
13768 @end table
13770 @node DEC Alpha Options
13771 @subsection DEC Alpha Options
13773 These @samp{-m} options are defined for the DEC Alpha implementations:
13775 @table @gcctabopt
13776 @item -mno-soft-float
13777 @itemx -msoft-float
13778 @opindex mno-soft-float
13779 @opindex msoft-float
13780 Use (do not use) the hardware floating-point instructions for
13781 floating-point operations.  When @option{-msoft-float} is specified,
13782 functions in @file{libgcc.a} are used to perform floating-point
13783 operations.  Unless they are replaced by routines that emulate the
13784 floating-point operations, or compiled in such a way as to call such
13785 emulations routines, these routines issue floating-point
13786 operations.   If you are compiling for an Alpha without floating-point
13787 operations, you must ensure that the library is built so as not to call
13788 them.
13790 Note that Alpha implementations without floating-point operations are
13791 required to have floating-point registers.
13793 @item -mfp-reg
13794 @itemx -mno-fp-regs
13795 @opindex mfp-reg
13796 @opindex mno-fp-regs
13797 Generate code that uses (does not use) the floating-point register set.
13798 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
13799 register set is not used, floating-point operands are passed in integer
13800 registers as if they were integers and floating-point results are passed
13801 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
13802 so any function with a floating-point argument or return value called by code
13803 compiled with @option{-mno-fp-regs} must also be compiled with that
13804 option.
13806 A typical use of this option is building a kernel that does not use,
13807 and hence need not save and restore, any floating-point registers.
13809 @item -mieee
13810 @opindex mieee
13811 The Alpha architecture implements floating-point hardware optimized for
13812 maximum performance.  It is mostly compliant with the IEEE floating-point
13813 standard.  However, for full compliance, software assistance is
13814 required.  This option generates code fully IEEE-compliant code
13815 @emph{except} that the @var{inexact-flag} is not maintained (see below).
13816 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
13817 defined during compilation.  The resulting code is less efficient but is
13818 able to correctly support denormalized numbers and exceptional IEEE
13819 values such as not-a-number and plus/minus infinity.  Other Alpha
13820 compilers call this option @option{-ieee_with_no_inexact}.
13822 @item -mieee-with-inexact
13823 @opindex mieee-with-inexact
13824 This is like @option{-mieee} except the generated code also maintains
13825 the IEEE @var{inexact-flag}.  Turning on this option causes the
13826 generated code to implement fully-compliant IEEE math.  In addition to
13827 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
13828 macro.  On some Alpha implementations the resulting code may execute
13829 significantly slower than the code generated by default.  Since there is
13830 very little code that depends on the @var{inexact-flag}, you should
13831 normally not specify this option.  Other Alpha compilers call this
13832 option @option{-ieee_with_inexact}.
13834 @item -mfp-trap-mode=@var{trap-mode}
13835 @opindex mfp-trap-mode
13836 This option controls what floating-point related traps are enabled.
13837 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
13838 The trap mode can be set to one of four values:
13840 @table @samp
13841 @item n
13842 This is the default (normal) setting.  The only traps that are enabled
13843 are the ones that cannot be disabled in software (e.g., division by zero
13844 trap).
13846 @item u
13847 In addition to the traps enabled by @samp{n}, underflow traps are enabled
13848 as well.
13850 @item su
13851 Like @samp{u}, but the instructions are marked to be safe for software
13852 completion (see Alpha architecture manual for details).
13854 @item sui
13855 Like @samp{su}, but inexact traps are enabled as well.
13856 @end table
13858 @item -mfp-rounding-mode=@var{rounding-mode}
13859 @opindex mfp-rounding-mode
13860 Selects the IEEE rounding mode.  Other Alpha compilers call this option
13861 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
13864 @table @samp
13865 @item n
13866 Normal IEEE rounding mode.  Floating-point numbers are rounded towards
13867 the nearest machine number or towards the even machine number in case
13868 of a tie.
13870 @item m
13871 Round towards minus infinity.
13873 @item c
13874 Chopped rounding mode.  Floating-point numbers are rounded towards zero.
13876 @item d
13877 Dynamic rounding mode.  A field in the floating-point control register
13878 (@var{fpcr}, see Alpha architecture reference manual) controls the
13879 rounding mode in effect.  The C library initializes this register for
13880 rounding towards plus infinity.  Thus, unless your program modifies the
13881 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
13882 @end table
13884 @item -mtrap-precision=@var{trap-precision}
13885 @opindex mtrap-precision
13886 In the Alpha architecture, floating-point traps are imprecise.  This
13887 means without software assistance it is impossible to recover from a
13888 floating trap and program execution normally needs to be terminated.
13889 GCC can generate code that can assist operating system trap handlers
13890 in determining the exact location that caused a floating-point trap.
13891 Depending on the requirements of an application, different levels of
13892 precisions can be selected:
13894 @table @samp
13895 @item p
13896 Program precision.  This option is the default and means a trap handler
13897 can only identify which program caused a floating-point exception.
13899 @item f
13900 Function precision.  The trap handler can determine the function that
13901 caused a floating-point exception.
13903 @item i
13904 Instruction precision.  The trap handler can determine the exact
13905 instruction that caused a floating-point exception.
13906 @end table
13908 Other Alpha compilers provide the equivalent options called
13909 @option{-scope_safe} and @option{-resumption_safe}.
13911 @item -mieee-conformant
13912 @opindex mieee-conformant
13913 This option marks the generated code as IEEE conformant.  You must not
13914 use this option unless you also specify @option{-mtrap-precision=i} and either
13915 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
13916 is to emit the line @samp{.eflag 48} in the function prologue of the
13917 generated assembly file.
13919 @item -mbuild-constants
13920 @opindex mbuild-constants
13921 Normally GCC examines a 32- or 64-bit integer constant to
13922 see if it can construct it from smaller constants in two or three
13923 instructions.  If it cannot, it outputs the constant as a literal and
13924 generates code to load it from the data segment at run time.
13926 Use this option to require GCC to construct @emph{all} integer constants
13927 using code, even if it takes more instructions (the maximum is six).
13929 You typically use this option to build a shared library dynamic
13930 loader.  Itself a shared library, it must relocate itself in memory
13931 before it can find the variables and constants in its own data segment.
13933 @item -mbwx
13934 @itemx -mno-bwx
13935 @itemx -mcix
13936 @itemx -mno-cix
13937 @itemx -mfix
13938 @itemx -mno-fix
13939 @itemx -mmax
13940 @itemx -mno-max
13941 @opindex mbwx
13942 @opindex mno-bwx
13943 @opindex mcix
13944 @opindex mno-cix
13945 @opindex mfix
13946 @opindex mno-fix
13947 @opindex mmax
13948 @opindex mno-max
13949 Indicate whether GCC should generate code to use the optional BWX,
13950 CIX, FIX and MAX instruction sets.  The default is to use the instruction
13951 sets supported by the CPU type specified via @option{-mcpu=} option or that
13952 of the CPU on which GCC was built if none is specified.
13954 @item -mfloat-vax
13955 @itemx -mfloat-ieee
13956 @opindex mfloat-vax
13957 @opindex mfloat-ieee
13958 Generate code that uses (does not use) VAX F and G floating-point
13959 arithmetic instead of IEEE single and double precision.
13961 @item -mexplicit-relocs
13962 @itemx -mno-explicit-relocs
13963 @opindex mexplicit-relocs
13964 @opindex mno-explicit-relocs
13965 Older Alpha assemblers provided no way to generate symbol relocations
13966 except via assembler macros.  Use of these macros does not allow
13967 optimal instruction scheduling.  GNU binutils as of version 2.12
13968 supports a new syntax that allows the compiler to explicitly mark
13969 which relocations should apply to which instructions.  This option
13970 is mostly useful for debugging, as GCC detects the capabilities of
13971 the assembler when it is built and sets the default accordingly.
13973 @item -msmall-data
13974 @itemx -mlarge-data
13975 @opindex msmall-data
13976 @opindex mlarge-data
13977 When @option{-mexplicit-relocs} is in effect, static data is
13978 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
13979 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
13980 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
13981 16-bit relocations off of the @code{$gp} register.  This limits the
13982 size of the small data area to 64KB, but allows the variables to be
13983 directly accessed via a single instruction.
13985 The default is @option{-mlarge-data}.  With this option the data area
13986 is limited to just below 2GB@.  Programs that require more than 2GB of
13987 data must use @code{malloc} or @code{mmap} to allocate the data in the
13988 heap instead of in the program's data segment.
13990 When generating code for shared libraries, @option{-fpic} implies
13991 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
13993 @item -msmall-text
13994 @itemx -mlarge-text
13995 @opindex msmall-text
13996 @opindex mlarge-text
13997 When @option{-msmall-text} is used, the compiler assumes that the
13998 code of the entire program (or shared library) fits in 4MB, and is
13999 thus reachable with a branch instruction.  When @option{-msmall-data}
14000 is used, the compiler can assume that all local symbols share the
14001 same @code{$gp} value, and thus reduce the number of instructions
14002 required for a function call from 4 to 1.
14004 The default is @option{-mlarge-text}.
14006 @item -mcpu=@var{cpu_type}
14007 @opindex mcpu
14008 Set the instruction set and instruction scheduling parameters for
14009 machine type @var{cpu_type}.  You can specify either the @samp{EV}
14010 style name or the corresponding chip number.  GCC supports scheduling
14011 parameters for the EV4, EV5 and EV6 family of processors and
14012 chooses the default values for the instruction set from the processor
14013 you specify.  If you do not specify a processor type, GCC defaults
14014 to the processor on which the compiler was built.
14016 Supported values for @var{cpu_type} are
14018 @table @samp
14019 @item ev4
14020 @itemx ev45
14021 @itemx 21064
14022 Schedules as an EV4 and has no instruction set extensions.
14024 @item ev5
14025 @itemx 21164
14026 Schedules as an EV5 and has no instruction set extensions.
14028 @item ev56
14029 @itemx 21164a
14030 Schedules as an EV5 and supports the BWX extension.
14032 @item pca56
14033 @itemx 21164pc
14034 @itemx 21164PC
14035 Schedules as an EV5 and supports the BWX and MAX extensions.
14037 @item ev6
14038 @itemx 21264
14039 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
14041 @item ev67
14042 @itemx 21264a
14043 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
14044 @end table
14046 Native toolchains also support the value @samp{native},
14047 which selects the best architecture option for the host processor.
14048 @option{-mcpu=native} has no effect if GCC does not recognize
14049 the processor.
14051 @item -mtune=@var{cpu_type}
14052 @opindex mtune
14053 Set only the instruction scheduling parameters for machine type
14054 @var{cpu_type}.  The instruction set is not changed.
14056 Native toolchains also support the value @samp{native},
14057 which selects the best architecture option for the host processor.
14058 @option{-mtune=native} has no effect if GCC does not recognize
14059 the processor.
14061 @item -mmemory-latency=@var{time}
14062 @opindex mmemory-latency
14063 Sets the latency the scheduler should assume for typical memory
14064 references as seen by the application.  This number is highly
14065 dependent on the memory access patterns used by the application
14066 and the size of the external cache on the machine.
14068 Valid options for @var{time} are
14070 @table @samp
14071 @item @var{number}
14072 A decimal number representing clock cycles.
14074 @item L1
14075 @itemx L2
14076 @itemx L3
14077 @itemx main
14078 The compiler contains estimates of the number of clock cycles for
14079 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
14080 (also called Dcache, Scache, and Bcache), as well as to main memory.
14081 Note that L3 is only valid for EV5.
14083 @end table
14084 @end table
14086 @node FR30 Options
14087 @subsection FR30 Options
14088 @cindex FR30 Options
14090 These options are defined specifically for the FR30 port.
14092 @table @gcctabopt
14094 @item -msmall-model
14095 @opindex msmall-model
14096 Use the small address space model.  This can produce smaller code, but
14097 it does assume that all symbolic values and addresses fit into a
14098 20-bit range.
14100 @item -mno-lsim
14101 @opindex mno-lsim
14102 Assume that runtime support has been provided and so there is no need
14103 to include the simulator library (@file{libsim.a}) on the linker
14104 command line.
14106 @end table
14108 @node FRV Options
14109 @subsection FRV Options
14110 @cindex FRV Options
14112 @table @gcctabopt
14113 @item -mgpr-32
14114 @opindex mgpr-32
14116 Only use the first 32 general-purpose registers.
14118 @item -mgpr-64
14119 @opindex mgpr-64
14121 Use all 64 general-purpose registers.
14123 @item -mfpr-32
14124 @opindex mfpr-32
14126 Use only the first 32 floating-point registers.
14128 @item -mfpr-64
14129 @opindex mfpr-64
14131 Use all 64 floating-point registers.
14133 @item -mhard-float
14134 @opindex mhard-float
14136 Use hardware instructions for floating-point operations.
14138 @item -msoft-float
14139 @opindex msoft-float
14141 Use library routines for floating-point operations.
14143 @item -malloc-cc
14144 @opindex malloc-cc
14146 Dynamically allocate condition code registers.
14148 @item -mfixed-cc
14149 @opindex mfixed-cc
14151 Do not try to dynamically allocate condition code registers, only
14152 use @code{icc0} and @code{fcc0}.
14154 @item -mdword
14155 @opindex mdword
14157 Change ABI to use double word insns.
14159 @item -mno-dword
14160 @opindex mno-dword
14162 Do not use double word instructions.
14164 @item -mdouble
14165 @opindex mdouble
14167 Use floating-point double instructions.
14169 @item -mno-double
14170 @opindex mno-double
14172 Do not use floating-point double instructions.
14174 @item -mmedia
14175 @opindex mmedia
14177 Use media instructions.
14179 @item -mno-media
14180 @opindex mno-media
14182 Do not use media instructions.
14184 @item -mmuladd
14185 @opindex mmuladd
14187 Use multiply and add/subtract instructions.
14189 @item -mno-muladd
14190 @opindex mno-muladd
14192 Do not use multiply and add/subtract instructions.
14194 @item -mfdpic
14195 @opindex mfdpic
14197 Select the FDPIC ABI, which uses function descriptors to represent
14198 pointers to functions.  Without any PIC/PIE-related options, it
14199 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
14200 assumes GOT entries and small data are within a 12-bit range from the
14201 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
14202 are computed with 32 bits.
14203 With a @samp{bfin-elf} target, this option implies @option{-msim}.
14205 @item -minline-plt
14206 @opindex minline-plt
14208 Enable inlining of PLT entries in function calls to functions that are
14209 not known to bind locally.  It has no effect without @option{-mfdpic}.
14210 It's enabled by default if optimizing for speed and compiling for
14211 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
14212 optimization option such as @option{-O3} or above is present in the
14213 command line.
14215 @item -mTLS
14216 @opindex mTLS
14218 Assume a large TLS segment when generating thread-local code.
14220 @item -mtls
14221 @opindex mtls
14223 Do not assume a large TLS segment when generating thread-local code.
14225 @item -mgprel-ro
14226 @opindex mgprel-ro
14228 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
14229 that is known to be in read-only sections.  It's enabled by default,
14230 except for @option{-fpic} or @option{-fpie}: even though it may help
14231 make the global offset table smaller, it trades 1 instruction for 4.
14232 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
14233 one of which may be shared by multiple symbols, and it avoids the need
14234 for a GOT entry for the referenced symbol, so it's more likely to be a
14235 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
14237 @item -multilib-library-pic
14238 @opindex multilib-library-pic
14240 Link with the (library, not FD) pic libraries.  It's implied by
14241 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
14242 @option{-fpic} without @option{-mfdpic}.  You should never have to use
14243 it explicitly.
14245 @item -mlinked-fp
14246 @opindex mlinked-fp
14248 Follow the EABI requirement of always creating a frame pointer whenever
14249 a stack frame is allocated.  This option is enabled by default and can
14250 be disabled with @option{-mno-linked-fp}.
14252 @item -mlong-calls
14253 @opindex mlong-calls
14255 Use indirect addressing to call functions outside the current
14256 compilation unit.  This allows the functions to be placed anywhere
14257 within the 32-bit address space.
14259 @item -malign-labels
14260 @opindex malign-labels
14262 Try to align labels to an 8-byte boundary by inserting NOPs into the
14263 previous packet.  This option only has an effect when VLIW packing
14264 is enabled.  It doesn't create new packets; it merely adds NOPs to
14265 existing ones.
14267 @item -mlibrary-pic
14268 @opindex mlibrary-pic
14270 Generate position-independent EABI code.
14272 @item -macc-4
14273 @opindex macc-4
14275 Use only the first four media accumulator registers.
14277 @item -macc-8
14278 @opindex macc-8
14280 Use all eight media accumulator registers.
14282 @item -mpack
14283 @opindex mpack
14285 Pack VLIW instructions.
14287 @item -mno-pack
14288 @opindex mno-pack
14290 Do not pack VLIW instructions.
14292 @item -mno-eflags
14293 @opindex mno-eflags
14295 Do not mark ABI switches in e_flags.
14297 @item -mcond-move
14298 @opindex mcond-move
14300 Enable the use of conditional-move instructions (default).
14302 This switch is mainly for debugging the compiler and will likely be removed
14303 in a future version.
14305 @item -mno-cond-move
14306 @opindex mno-cond-move
14308 Disable the use of conditional-move instructions.
14310 This switch is mainly for debugging the compiler and will likely be removed
14311 in a future version.
14313 @item -mscc
14314 @opindex mscc
14316 Enable the use of conditional set instructions (default).
14318 This switch is mainly for debugging the compiler and will likely be removed
14319 in a future version.
14321 @item -mno-scc
14322 @opindex mno-scc
14324 Disable the use of conditional set instructions.
14326 This switch is mainly for debugging the compiler and will likely be removed
14327 in a future version.
14329 @item -mcond-exec
14330 @opindex mcond-exec
14332 Enable the use of conditional execution (default).
14334 This switch is mainly for debugging the compiler and will likely be removed
14335 in a future version.
14337 @item -mno-cond-exec
14338 @opindex mno-cond-exec
14340 Disable the use of conditional execution.
14342 This switch is mainly for debugging the compiler and will likely be removed
14343 in a future version.
14345 @item -mvliw-branch
14346 @opindex mvliw-branch
14348 Run a pass to pack branches into VLIW instructions (default).
14350 This switch is mainly for debugging the compiler and will likely be removed
14351 in a future version.
14353 @item -mno-vliw-branch
14354 @opindex mno-vliw-branch
14356 Do not run a pass to pack branches into VLIW instructions.
14358 This switch is mainly for debugging the compiler and will likely be removed
14359 in a future version.
14361 @item -mmulti-cond-exec
14362 @opindex mmulti-cond-exec
14364 Enable optimization of @code{&&} and @code{||} in conditional execution
14365 (default).
14367 This switch is mainly for debugging the compiler and will likely be removed
14368 in a future version.
14370 @item -mno-multi-cond-exec
14371 @opindex mno-multi-cond-exec
14373 Disable optimization of @code{&&} and @code{||} in conditional execution.
14375 This switch is mainly for debugging the compiler and will likely be removed
14376 in a future version.
14378 @item -mnested-cond-exec
14379 @opindex mnested-cond-exec
14381 Enable nested conditional execution optimizations (default).
14383 This switch is mainly for debugging the compiler and will likely be removed
14384 in a future version.
14386 @item -mno-nested-cond-exec
14387 @opindex mno-nested-cond-exec
14389 Disable nested conditional execution optimizations.
14391 This switch is mainly for debugging the compiler and will likely be removed
14392 in a future version.
14394 @item -moptimize-membar
14395 @opindex moptimize-membar
14397 This switch removes redundant @code{membar} instructions from the
14398 compiler-generated code.  It is enabled by default.
14400 @item -mno-optimize-membar
14401 @opindex mno-optimize-membar
14403 This switch disables the automatic removal of redundant @code{membar}
14404 instructions from the generated code.
14406 @item -mtomcat-stats
14407 @opindex mtomcat-stats
14409 Cause gas to print out tomcat statistics.
14411 @item -mcpu=@var{cpu}
14412 @opindex mcpu
14414 Select the processor type for which to generate code.  Possible values are
14415 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
14416 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
14418 @end table
14420 @node GNU/Linux Options
14421 @subsection GNU/Linux Options
14423 These @samp{-m} options are defined for GNU/Linux targets:
14425 @table @gcctabopt
14426 @item -mglibc
14427 @opindex mglibc
14428 Use the GNU C library.  This is the default except
14429 on @samp{*-*-linux-*uclibc*} and @samp{*-*-linux-*android*} targets.
14431 @item -muclibc
14432 @opindex muclibc
14433 Use uClibc C library.  This is the default on
14434 @samp{*-*-linux-*uclibc*} targets.
14436 @item -mbionic
14437 @opindex mbionic
14438 Use Bionic C library.  This is the default on
14439 @samp{*-*-linux-*android*} targets.
14441 @item -mandroid
14442 @opindex mandroid
14443 Compile code compatible with Android platform.  This is the default on
14444 @samp{*-*-linux-*android*} targets.
14446 When compiling, this option enables @option{-mbionic}, @option{-fPIC},
14447 @option{-fno-exceptions} and @option{-fno-rtti} by default.  When linking,
14448 this option makes the GCC driver pass Android-specific options to the linker.
14449 Finally, this option causes the preprocessor macro @code{__ANDROID__}
14450 to be defined.
14452 @item -tno-android-cc
14453 @opindex tno-android-cc
14454 Disable compilation effects of @option{-mandroid}, i.e., do not enable
14455 @option{-mbionic}, @option{-fPIC}, @option{-fno-exceptions} and
14456 @option{-fno-rtti} by default.
14458 @item -tno-android-ld
14459 @opindex tno-android-ld
14460 Disable linking effects of @option{-mandroid}, i.e., pass standard Linux
14461 linking options to the linker.
14463 @end table
14465 @node H8/300 Options
14466 @subsection H8/300 Options
14468 These @samp{-m} options are defined for the H8/300 implementations:
14470 @table @gcctabopt
14471 @item -mrelax
14472 @opindex mrelax
14473 Shorten some address references at link time, when possible; uses the
14474 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
14475 ld, Using ld}, for a fuller description.
14477 @item -mh
14478 @opindex mh
14479 Generate code for the H8/300H@.
14481 @item -ms
14482 @opindex ms
14483 Generate code for the H8S@.
14485 @item -mn
14486 @opindex mn
14487 Generate code for the H8S and H8/300H in the normal mode.  This switch
14488 must be used either with @option{-mh} or @option{-ms}.
14490 @item -ms2600
14491 @opindex ms2600
14492 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
14494 @item -mexr
14495 @opindex mexr
14496 Extended registers are stored on stack before execution of function
14497 with monitor attribute. Default option is @option{-mexr}.
14498 This option is valid only for H8S targets.
14500 @item -mno-exr
14501 @opindex mno-exr
14502 Extended registers are not stored on stack before execution of function 
14503 with monitor attribute. Default option is @option{-mno-exr}. 
14504 This option is valid only for H8S targets.
14506 @item -mint32
14507 @opindex mint32
14508 Make @code{int} data 32 bits by default.
14510 @item -malign-300
14511 @opindex malign-300
14512 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
14513 The default for the H8/300H and H8S is to align longs and floats on
14514 4-byte boundaries.
14515 @option{-malign-300} causes them to be aligned on 2-byte boundaries.
14516 This option has no effect on the H8/300.
14517 @end table
14519 @node HPPA Options
14520 @subsection HPPA Options
14521 @cindex HPPA Options
14523 These @samp{-m} options are defined for the HPPA family of computers:
14525 @table @gcctabopt
14526 @item -march=@var{architecture-type}
14527 @opindex march
14528 Generate code for the specified architecture.  The choices for
14529 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
14530 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
14531 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
14532 architecture option for your machine.  Code compiled for lower numbered
14533 architectures runs on higher numbered architectures, but not the
14534 other way around.
14536 @item -mpa-risc-1-0
14537 @itemx -mpa-risc-1-1
14538 @itemx -mpa-risc-2-0
14539 @opindex mpa-risc-1-0
14540 @opindex mpa-risc-1-1
14541 @opindex mpa-risc-2-0
14542 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
14544 @item -mjump-in-delay
14545 @opindex mjump-in-delay
14546 Fill delay slots of function calls with unconditional jump instructions
14547 by modifying the return pointer for the function call to be the target
14548 of the conditional jump.
14550 @item -mdisable-fpregs
14551 @opindex mdisable-fpregs
14552 Prevent floating-point registers from being used in any manner.  This is
14553 necessary for compiling kernels that perform lazy context switching of
14554 floating-point registers.  If you use this option and attempt to perform
14555 floating-point operations, the compiler aborts.
14557 @item -mdisable-indexing
14558 @opindex mdisable-indexing
14559 Prevent the compiler from using indexing address modes.  This avoids some
14560 rather obscure problems when compiling MIG generated code under MACH@.
14562 @item -mno-space-regs
14563 @opindex mno-space-regs
14564 Generate code that assumes the target has no space registers.  This allows
14565 GCC to generate faster indirect calls and use unscaled index address modes.
14567 Such code is suitable for level 0 PA systems and kernels.
14569 @item -mfast-indirect-calls
14570 @opindex mfast-indirect-calls
14571 Generate code that assumes calls never cross space boundaries.  This
14572 allows GCC to emit code that performs faster indirect calls.
14574 This option does not work in the presence of shared libraries or nested
14575 functions.
14577 @item -mfixed-range=@var{register-range}
14578 @opindex mfixed-range
14579 Generate code treating the given register range as fixed registers.
14580 A fixed register is one that the register allocator cannot use.  This is
14581 useful when compiling kernel code.  A register range is specified as
14582 two registers separated by a dash.  Multiple register ranges can be
14583 specified separated by a comma.
14585 @item -mlong-load-store
14586 @opindex mlong-load-store
14587 Generate 3-instruction load and store sequences as sometimes required by
14588 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
14589 the HP compilers.
14591 @item -mportable-runtime
14592 @opindex mportable-runtime
14593 Use the portable calling conventions proposed by HP for ELF systems.
14595 @item -mgas
14596 @opindex mgas
14597 Enable the use of assembler directives only GAS understands.
14599 @item -mschedule=@var{cpu-type}
14600 @opindex mschedule
14601 Schedule code according to the constraints for the machine type
14602 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
14603 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
14604 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
14605 proper scheduling option for your machine.  The default scheduling is
14606 @samp{8000}.
14608 @item -mlinker-opt
14609 @opindex mlinker-opt
14610 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
14611 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
14612 linkers in which they give bogus error messages when linking some programs.
14614 @item -msoft-float
14615 @opindex msoft-float
14616 Generate output containing library calls for floating point.
14617 @strong{Warning:} the requisite libraries are not available for all HPPA
14618 targets.  Normally the facilities of the machine's usual C compiler are
14619 used, but this cannot be done directly in cross-compilation.  You must make
14620 your own arrangements to provide suitable library functions for
14621 cross-compilation.
14623 @option{-msoft-float} changes the calling convention in the output file;
14624 therefore, it is only useful if you compile @emph{all} of a program with
14625 this option.  In particular, you need to compile @file{libgcc.a}, the
14626 library that comes with GCC, with @option{-msoft-float} in order for
14627 this to work.
14629 @item -msio
14630 @opindex msio
14631 Generate the predefine, @code{_SIO}, for server IO@.  The default is
14632 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
14633 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
14634 options are available under HP-UX and HI-UX@.
14636 @item -mgnu-ld
14637 @opindex mgnu-ld
14638 Use options specific to GNU @command{ld}.
14639 This passes @option{-shared} to @command{ld} when
14640 building a shared library.  It is the default when GCC is configured,
14641 explicitly or implicitly, with the GNU linker.  This option does not
14642 affect which @command{ld} is called; it only changes what parameters
14643 are passed to that @command{ld}.
14644 The @command{ld} that is called is determined by the
14645 @option{--with-ld} configure option, GCC's program search path, and
14646 finally by the user's @env{PATH}.  The linker used by GCC can be printed
14647 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
14648 on the 64-bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
14650 @item -mhp-ld
14651 @opindex mhp-ld
14652 Use options specific to HP @command{ld}.
14653 This passes @option{-b} to @command{ld} when building
14654 a shared library and passes @option{+Accept TypeMismatch} to @command{ld} on all
14655 links.  It is the default when GCC is configured, explicitly or
14656 implicitly, with the HP linker.  This option does not affect
14657 which @command{ld} is called; it only changes what parameters are passed to that
14658 @command{ld}.
14659 The @command{ld} that is called is determined by the @option{--with-ld}
14660 configure option, GCC's program search path, and finally by the user's
14661 @env{PATH}.  The linker used by GCC can be printed using @samp{which
14662 `gcc -print-prog-name=ld`}.  This option is only available on the 64-bit
14663 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
14665 @item -mlong-calls
14666 @opindex mno-long-calls
14667 Generate code that uses long call sequences.  This ensures that a call
14668 is always able to reach linker generated stubs.  The default is to generate
14669 long calls only when the distance from the call site to the beginning
14670 of the function or translation unit, as the case may be, exceeds a
14671 predefined limit set by the branch type being used.  The limits for
14672 normal calls are 7,600,000 and 240,000 bytes, respectively for the
14673 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
14674 240,000 bytes.
14676 Distances are measured from the beginning of functions when using the
14677 @option{-ffunction-sections} option, or when using the @option{-mgas}
14678 and @option{-mno-portable-runtime} options together under HP-UX with
14679 the SOM linker.
14681 It is normally not desirable to use this option as it degrades
14682 performance.  However, it may be useful in large applications,
14683 particularly when partial linking is used to build the application.
14685 The types of long calls used depends on the capabilities of the
14686 assembler and linker, and the type of code being generated.  The
14687 impact on systems that support long absolute calls, and long pic
14688 symbol-difference or pc-relative calls should be relatively small.
14689 However, an indirect call is used on 32-bit ELF systems in pic code
14690 and it is quite long.
14692 @item -munix=@var{unix-std}
14693 @opindex march
14694 Generate compiler predefines and select a startfile for the specified
14695 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
14696 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
14697 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
14698 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
14699 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
14700 and later.
14702 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
14703 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
14704 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
14705 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
14706 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
14707 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
14709 It is @emph{important} to note that this option changes the interfaces
14710 for various library routines.  It also affects the operational behavior
14711 of the C library.  Thus, @emph{extreme} care is needed in using this
14712 option.
14714 Library code that is intended to operate with more than one UNIX
14715 standard must test, set and restore the variable @var{__xpg4_extended_mask}
14716 as appropriate.  Most GNU software doesn't provide this capability.
14718 @item -nolibdld
14719 @opindex nolibdld
14720 Suppress the generation of link options to search libdld.sl when the
14721 @option{-static} option is specified on HP-UX 10 and later.
14723 @item -static
14724 @opindex static
14725 The HP-UX implementation of setlocale in libc has a dependency on
14726 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
14727 when the @option{-static} option is specified, special link options
14728 are needed to resolve this dependency.
14730 On HP-UX 10 and later, the GCC driver adds the necessary options to
14731 link with libdld.sl when the @option{-static} option is specified.
14732 This causes the resulting binary to be dynamic.  On the 64-bit port,
14733 the linkers generate dynamic binaries by default in any case.  The
14734 @option{-nolibdld} option can be used to prevent the GCC driver from
14735 adding these link options.
14737 @item -threads
14738 @opindex threads
14739 Add support for multithreading with the @dfn{dce thread} library
14740 under HP-UX@.  This option sets flags for both the preprocessor and
14741 linker.
14742 @end table
14744 @node i386 and x86-64 Options
14745 @subsection Intel 386 and AMD x86-64 Options
14746 @cindex i386 Options
14747 @cindex x86-64 Options
14748 @cindex Intel 386 Options
14749 @cindex AMD x86-64 Options
14751 These @samp{-m} options are defined for the i386 and x86-64 family of
14752 computers:
14754 @table @gcctabopt
14756 @item -march=@var{cpu-type}
14757 @opindex march
14758 Generate instructions for the machine type @var{cpu-type}.  In contrast to
14759 @option{-mtune=@var{cpu-type}}, which merely tunes the generated code 
14760 for the specified @var{cpu-type}, @option{-march=@var{cpu-type}} allows GCC
14761 to generate code that may not run at all on processors other than the one
14762 indicated.  Specifying @option{-march=@var{cpu-type}} implies 
14763 @option{-mtune=@var{cpu-type}}.
14765 The choices for @var{cpu-type} are:
14767 @table @samp
14768 @item native
14769 This selects the CPU to generate code for at compilation time by determining
14770 the processor type of the compiling machine.  Using @option{-march=native}
14771 enables all instruction subsets supported by the local machine (hence
14772 the result might not run on different machines).  Using @option{-mtune=native}
14773 produces code optimized for the local machine under the constraints
14774 of the selected instruction set.  
14776 @item i386
14777 Original Intel i386 CPU@.
14779 @item i486
14780 Intel i486 CPU@.  (No scheduling is implemented for this chip.)
14782 @item i586
14783 @itemx pentium
14784 Intel Pentium CPU with no MMX support.
14786 @item pentium-mmx
14787 Intel Pentium MMX CPU, based on Pentium core with MMX instruction set support.
14789 @item pentiumpro
14790 Intel Pentium Pro CPU@.
14792 @item i686
14793 When used with @option{-march}, the Pentium Pro
14794 instruction set is used, so the code runs on all i686 family chips.
14795 When used with @option{-mtune}, it has the same meaning as @samp{generic}.
14797 @item pentium2
14798 Intel Pentium II CPU, based on Pentium Pro core with MMX instruction set
14799 support.
14801 @item pentium3
14802 @itemx pentium3m
14803 Intel Pentium III CPU, based on Pentium Pro core with MMX and SSE instruction
14804 set support.
14806 @item pentium-m
14807 Intel Pentium M; low-power version of Intel Pentium III CPU
14808 with MMX, SSE and SSE2 instruction set support.  Used by Centrino notebooks.
14810 @item pentium4
14811 @itemx pentium4m
14812 Intel Pentium 4 CPU with MMX, SSE and SSE2 instruction set support.
14814 @item prescott
14815 Improved version of Intel Pentium 4 CPU with MMX, SSE, SSE2 and SSE3 instruction
14816 set support.
14818 @item nocona
14819 Improved version of Intel Pentium 4 CPU with 64-bit extensions, MMX, SSE,
14820 SSE2 and SSE3 instruction set support.
14822 @item core2
14823 Intel Core 2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
14824 instruction set support.
14826 @item nehalem
14827 Intel Nehalem CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
14828 SSE4.1, SSE4.2 and POPCNT instruction set support.
14830 @item westmere
14831 Intel Westmere CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
14832 SSE4.1, SSE4.2, POPCNT, AES and PCLMUL instruction set support.
14834 @item sandybridge
14835 Intel Sandy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
14836 SSE4.1, SSE4.2, POPCNT, AVX, AES and PCLMUL instruction set support.
14838 @item ivybridge
14839 Intel Ivy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
14840 SSE4.1, SSE4.2, POPCNT, AVX, AES, PCLMUL, FSGSBASE, RDRND and F16C
14841 instruction set support.
14843 @item haswell
14844 Intel Haswell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
14845 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
14846 BMI, BMI2 and F16C instruction set support.
14848 @item broadwell
14849 Intel Broadwell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
14850 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
14851 BMI, BMI2, F16C, RDSEED, ADCX and PREFETCHW instruction set support.
14853 @item bonnell
14854 Intel Bonnell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3 and SSSE3
14855 instruction set support.
14857 @item silvermont
14858 Intel Silvermont CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
14859 SSE4.1, SSE4.2, POPCNT, AES, PCLMUL and RDRND instruction set support.
14861 @item k6
14862 AMD K6 CPU with MMX instruction set support.
14864 @item k6-2
14865 @itemx k6-3
14866 Improved versions of AMD K6 CPU with MMX and 3DNow!@: instruction set support.
14868 @item athlon
14869 @itemx athlon-tbird
14870 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3DNow!@: and SSE prefetch instructions
14871 support.
14873 @item athlon-4
14874 @itemx athlon-xp
14875 @itemx athlon-mp
14876 Improved AMD Athlon CPU with MMX, 3DNow!, enhanced 3DNow!@: and full SSE
14877 instruction set support.
14879 @item k8
14880 @itemx opteron
14881 @itemx athlon64
14882 @itemx athlon-fx
14883 Processors based on the AMD K8 core with x86-64 instruction set support,
14884 including the AMD Opteron, Athlon 64, and Athlon 64 FX processors.
14885 (This supersets MMX, SSE, SSE2, 3DNow!, enhanced 3DNow!@: and 64-bit
14886 instruction set extensions.)
14888 @item k8-sse3
14889 @itemx opteron-sse3
14890 @itemx athlon64-sse3
14891 Improved versions of AMD K8 cores with SSE3 instruction set support.
14893 @item amdfam10
14894 @itemx barcelona
14895 CPUs based on AMD Family 10h cores with x86-64 instruction set support.  (This
14896 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!, enhanced 3DNow!, ABM and 64-bit
14897 instruction set extensions.)
14899 @item bdver1
14900 CPUs based on AMD Family 15h cores with x86-64 instruction set support.  (This
14901 supersets FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A,
14902 SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set extensions.)
14903 @item bdver2
14904 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
14905 supersets BMI, TBM, F16C, FMA, FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX,
14906 SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set 
14907 extensions.)
14908 @item bdver3
14909 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
14910 supersets BMI, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, XOP, LWP, AES, 
14911 PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 
14912 64-bit instruction set extensions.
14913 @item bdver4
14914 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
14915 supersets BMI, BMI2, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, AVX2, XOP, LWP, 
14916 AES, PCL_MUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, 
14917 SSE4.2, ABM and 64-bit instruction set extensions.
14919 @item btver1
14920 CPUs based on AMD Family 14h cores with x86-64 instruction set support.  (This
14921 supersets MMX, SSE, SSE2, SSE3, SSSE3, SSE4A, CX16, ABM and 64-bit
14922 instruction set extensions.)
14924 @item btver2
14925 CPUs based on AMD Family 16h cores with x86-64 instruction set support. This
14926 includes MOVBE, F16C, BMI, AVX, PCL_MUL, AES, SSE4.2, SSE4.1, CX16, ABM,
14927 SSE4A, SSSE3, SSE3, SSE2, SSE, MMX and 64-bit instruction set extensions.
14929 @item winchip-c6
14930 IDT WinChip C6 CPU, dealt in same way as i486 with additional MMX instruction
14931 set support.
14933 @item winchip2
14934 IDT WinChip 2 CPU, dealt in same way as i486 with additional MMX and 3DNow!@:
14935 instruction set support.
14937 @item c3
14938 VIA C3 CPU with MMX and 3DNow!@: instruction set support.  (No scheduling is
14939 implemented for this chip.)
14941 @item c3-2
14942 VIA C3-2 (Nehemiah/C5XL) CPU with MMX and SSE instruction set support.
14943 (No scheduling is
14944 implemented for this chip.)
14946 @item geode
14947 AMD Geode embedded processor with MMX and 3DNow!@: instruction set support.
14948 @end table
14950 @item -mtune=@var{cpu-type}
14951 @opindex mtune
14952 Tune to @var{cpu-type} everything applicable about the generated code, except
14953 for the ABI and the set of available instructions.  
14954 While picking a specific @var{cpu-type} schedules things appropriately
14955 for that particular chip, the compiler does not generate any code that
14956 cannot run on the default machine type unless you use a
14957 @option{-march=@var{cpu-type}} option.
14958 For example, if GCC is configured for i686-pc-linux-gnu
14959 then @option{-mtune=pentium4} generates code that is tuned for Pentium 4
14960 but still runs on i686 machines.
14962 The choices for @var{cpu-type} are the same as for @option{-march}.
14963 In addition, @option{-mtune} supports 2 extra choices for @var{cpu-type}:
14965 @table @samp
14966 @item generic
14967 Produce code optimized for the most common IA32/@/AMD64/@/EM64T processors.
14968 If you know the CPU on which your code will run, then you should use
14969 the corresponding @option{-mtune} or @option{-march} option instead of
14970 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
14971 of your application will have, then you should use this option.
14973 As new processors are deployed in the marketplace, the behavior of this
14974 option will change.  Therefore, if you upgrade to a newer version of
14975 GCC, code generation controlled by this option will change to reflect
14976 the processors
14977 that are most common at the time that version of GCC is released.
14979 There is no @option{-march=generic} option because @option{-march}
14980 indicates the instruction set the compiler can use, and there is no
14981 generic instruction set applicable to all processors.  In contrast,
14982 @option{-mtune} indicates the processor (or, in this case, collection of
14983 processors) for which the code is optimized.
14985 @item intel
14986 Produce code optimized for the most current Intel processors, which are
14987 Haswell and Silvermont for this version of GCC.  If you know the CPU
14988 on which your code will run, then you should use the corresponding
14989 @option{-mtune} or @option{-march} option instead of @option{-mtune=intel}.
14990 But, if you want your application performs better on both Haswell and
14991 Silvermont, then you should use this option.
14993 As new Intel processors are deployed in the marketplace, the behavior of
14994 this option will change.  Therefore, if you upgrade to a newer version of
14995 GCC, code generation controlled by this option will change to reflect
14996 the most current Intel processors at the time that version of GCC is
14997 released.
14999 There is no @option{-march=intel} option because @option{-march} indicates
15000 the instruction set the compiler can use, and there is no common
15001 instruction set applicable to all processors.  In contrast,
15002 @option{-mtune} indicates the processor (or, in this case, collection of
15003 processors) for which the code is optimized.
15004 @end table
15006 @item -mcpu=@var{cpu-type}
15007 @opindex mcpu
15008 A deprecated synonym for @option{-mtune}.
15010 @item -mfpmath=@var{unit}
15011 @opindex mfpmath
15012 Generate floating-point arithmetic for selected unit @var{unit}.  The choices
15013 for @var{unit} are:
15015 @table @samp
15016 @item 387
15017 Use the standard 387 floating-point coprocessor present on the majority of chips and
15018 emulated otherwise.  Code compiled with this option runs almost everywhere.
15019 The temporary results are computed in 80-bit precision instead of the precision
15020 specified by the type, resulting in slightly different results compared to most
15021 of other chips.  See @option{-ffloat-store} for more detailed description.
15023 This is the default choice for i386 compiler.
15025 @item sse
15026 Use scalar floating-point instructions present in the SSE instruction set.
15027 This instruction set is supported by Pentium III and newer chips,
15028 and in the AMD line
15029 by Athlon-4, Athlon XP and Athlon MP chips.  The earlier version of the SSE
15030 instruction set supports only single-precision arithmetic, thus the double and
15031 extended-precision arithmetic are still done using 387.  A later version, present
15032 only in Pentium 4 and AMD x86-64 chips, supports double-precision
15033 arithmetic too.
15035 For the i386 compiler, you must use @option{-march=@var{cpu-type}}, @option{-msse}
15036 or @option{-msse2} switches to enable SSE extensions and make this option
15037 effective.  For the x86-64 compiler, these extensions are enabled by default.
15039 The resulting code should be considerably faster in the majority of cases and avoid
15040 the numerical instability problems of 387 code, but may break some existing
15041 code that expects temporaries to be 80 bits.
15043 This is the default choice for the x86-64 compiler.
15045 @item sse,387
15046 @itemx sse+387
15047 @itemx both
15048 Attempt to utilize both instruction sets at once.  This effectively doubles the
15049 amount of available registers, and on chips with separate execution units for
15050 387 and SSE the execution resources too.  Use this option with care, as it is
15051 still experimental, because the GCC register allocator does not model separate
15052 functional units well, resulting in unstable performance.
15053 @end table
15055 @item -masm=@var{dialect}
15056 @opindex masm=@var{dialect}
15057 Output assembly instructions using selected @var{dialect}.  Supported
15058 choices are @samp{intel} or @samp{att} (the default).  Darwin does
15059 not support @samp{intel}.
15061 @item -mieee-fp
15062 @itemx -mno-ieee-fp
15063 @opindex mieee-fp
15064 @opindex mno-ieee-fp
15065 Control whether or not the compiler uses IEEE floating-point
15066 comparisons.  These correctly handle the case where the result of a
15067 comparison is unordered.
15069 @item -msoft-float
15070 @opindex msoft-float
15071 Generate output containing library calls for floating point.
15073 @strong{Warning:} the requisite libraries are not part of GCC@.
15074 Normally the facilities of the machine's usual C compiler are used, but
15075 this can't be done directly in cross-compilation.  You must make your
15076 own arrangements to provide suitable library functions for
15077 cross-compilation.
15079 On machines where a function returns floating-point results in the 80387
15080 register stack, some floating-point opcodes may be emitted even if
15081 @option{-msoft-float} is used.
15083 @item -mno-fp-ret-in-387
15084 @opindex mno-fp-ret-in-387
15085 Do not use the FPU registers for return values of functions.
15087 The usual calling convention has functions return values of types
15088 @code{float} and @code{double} in an FPU register, even if there
15089 is no FPU@.  The idea is that the operating system should emulate
15090 an FPU@.
15092 The option @option{-mno-fp-ret-in-387} causes such values to be returned
15093 in ordinary CPU registers instead.
15095 @item -mno-fancy-math-387
15096 @opindex mno-fancy-math-387
15097 Some 387 emulators do not support the @code{sin}, @code{cos} and
15098 @code{sqrt} instructions for the 387.  Specify this option to avoid
15099 generating those instructions.  This option is the default on FreeBSD,
15100 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
15101 indicates that the target CPU always has an FPU and so the
15102 instruction does not need emulation.  These
15103 instructions are not generated unless you also use the
15104 @option{-funsafe-math-optimizations} switch.
15106 @item -malign-double
15107 @itemx -mno-align-double
15108 @opindex malign-double
15109 @opindex mno-align-double
15110 Control whether GCC aligns @code{double}, @code{long double}, and
15111 @code{long long} variables on a two-word boundary or a one-word
15112 boundary.  Aligning @code{double} variables on a two-word boundary
15113 produces code that runs somewhat faster on a Pentium at the
15114 expense of more memory.
15116 On x86-64, @option{-malign-double} is enabled by default.
15118 @strong{Warning:} if you use the @option{-malign-double} switch,
15119 structures containing the above types are aligned differently than
15120 the published application binary interface specifications for the 386
15121 and are not binary compatible with structures in code compiled
15122 without that switch.
15124 @item -m96bit-long-double
15125 @itemx -m128bit-long-double
15126 @opindex m96bit-long-double
15127 @opindex m128bit-long-double
15128 These switches control the size of @code{long double} type.  The i386
15129 application binary interface specifies the size to be 96 bits,
15130 so @option{-m96bit-long-double} is the default in 32-bit mode.
15132 Modern architectures (Pentium and newer) prefer @code{long double}
15133 to be aligned to an 8- or 16-byte boundary.  In arrays or structures
15134 conforming to the ABI, this is not possible.  So specifying
15135 @option{-m128bit-long-double} aligns @code{long double}
15136 to a 16-byte boundary by padding the @code{long double} with an additional
15137 32-bit zero.
15139 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
15140 its ABI specifies that @code{long double} is aligned on 16-byte boundary.
15142 Notice that neither of these options enable any extra precision over the x87
15143 standard of 80 bits for a @code{long double}.
15145 @strong{Warning:} if you override the default value for your target ABI, this
15146 changes the size of 
15147 structures and arrays containing @code{long double} variables,
15148 as well as modifying the function calling convention for functions taking
15149 @code{long double}.  Hence they are not binary-compatible
15150 with code compiled without that switch.
15152 @item -mlong-double-64
15153 @itemx -mlong-double-80
15154 @itemx -mlong-double-128
15155 @opindex mlong-double-64
15156 @opindex mlong-double-80
15157 @opindex mlong-double-128
15158 These switches control the size of @code{long double} type. A size
15159 of 64 bits makes the @code{long double} type equivalent to the @code{double}
15160 type. This is the default for 32-bit Bionic C library.  A size
15161 of 128 bits makes the @code{long double} type equivalent to the
15162 @code{__float128} type. This is the default for 64-bit Bionic C library.
15164 @strong{Warning:} if you override the default value for your target ABI, this
15165 changes the size of
15166 structures and arrays containing @code{long double} variables,
15167 as well as modifying the function calling convention for functions taking
15168 @code{long double}.  Hence they are not binary-compatible
15169 with code compiled without that switch.
15171 @item -mlarge-data-threshold=@var{threshold}
15172 @opindex mlarge-data-threshold
15173 When @option{-mcmodel=medium} is specified, data objects larger than
15174 @var{threshold} are placed in the large data section.  This value must be the
15175 same across all objects linked into the binary, and defaults to 65535.
15177 @item -mrtd
15178 @opindex mrtd
15179 Use a different function-calling convention, in which functions that
15180 take a fixed number of arguments return with the @code{ret @var{num}}
15181 instruction, which pops their arguments while returning.  This saves one
15182 instruction in the caller since there is no need to pop the arguments
15183 there.
15185 You can specify that an individual function is called with this calling
15186 sequence with the function attribute @samp{stdcall}.  You can also
15187 override the @option{-mrtd} option by using the function attribute
15188 @samp{cdecl}.  @xref{Function Attributes}.
15190 @strong{Warning:} this calling convention is incompatible with the one
15191 normally used on Unix, so you cannot use it if you need to call
15192 libraries compiled with the Unix compiler.
15194 Also, you must provide function prototypes for all functions that
15195 take variable numbers of arguments (including @code{printf});
15196 otherwise incorrect code is generated for calls to those
15197 functions.
15199 In addition, seriously incorrect code results if you call a
15200 function with too many arguments.  (Normally, extra arguments are
15201 harmlessly ignored.)
15203 @item -mregparm=@var{num}
15204 @opindex mregparm
15205 Control how many registers are used to pass integer arguments.  By
15206 default, no registers are used to pass arguments, and at most 3
15207 registers can be used.  You can control this behavior for a specific
15208 function by using the function attribute @samp{regparm}.
15209 @xref{Function Attributes}.
15211 @strong{Warning:} if you use this switch, and
15212 @var{num} is nonzero, then you must build all modules with the same
15213 value, including any libraries.  This includes the system libraries and
15214 startup modules.
15216 @item -msseregparm
15217 @opindex msseregparm
15218 Use SSE register passing conventions for float and double arguments
15219 and return values.  You can control this behavior for a specific
15220 function by using the function attribute @samp{sseregparm}.
15221 @xref{Function Attributes}.
15223 @strong{Warning:} if you use this switch then you must build all
15224 modules with the same value, including any libraries.  This includes
15225 the system libraries and startup modules.
15227 @item -mvect8-ret-in-mem
15228 @opindex mvect8-ret-in-mem
15229 Return 8-byte vectors in memory instead of MMX registers.  This is the
15230 default on Solaris@tie{}8 and 9 and VxWorks to match the ABI of the Sun
15231 Studio compilers until version 12.  Later compiler versions (starting
15232 with Studio 12 Update@tie{}1) follow the ABI used by other x86 targets, which
15233 is the default on Solaris@tie{}10 and later.  @emph{Only} use this option if
15234 you need to remain compatible with existing code produced by those
15235 previous compiler versions or older versions of GCC@.
15237 @item -mpc32
15238 @itemx -mpc64
15239 @itemx -mpc80
15240 @opindex mpc32
15241 @opindex mpc64
15242 @opindex mpc80
15244 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
15245 is specified, the significands of results of floating-point operations are
15246 rounded to 24 bits (single precision); @option{-mpc64} rounds the
15247 significands of results of floating-point operations to 53 bits (double
15248 precision) and @option{-mpc80} rounds the significands of results of
15249 floating-point operations to 64 bits (extended double precision), which is
15250 the default.  When this option is used, floating-point operations in higher
15251 precisions are not available to the programmer without setting the FPU
15252 control word explicitly.
15254 Setting the rounding of floating-point operations to less than the default
15255 80 bits can speed some programs by 2% or more.  Note that some mathematical
15256 libraries assume that extended-precision (80-bit) floating-point operations
15257 are enabled by default; routines in such libraries could suffer significant
15258 loss of accuracy, typically through so-called ``catastrophic cancellation'',
15259 when this option is used to set the precision to less than extended precision.
15261 @item -mstackrealign
15262 @opindex mstackrealign
15263 Realign the stack at entry.  On the Intel x86, the @option{-mstackrealign}
15264 option generates an alternate prologue and epilogue that realigns the
15265 run-time stack if necessary.  This supports mixing legacy codes that keep
15266 4-byte stack alignment with modern codes that keep 16-byte stack alignment for
15267 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
15268 applicable to individual functions.
15270 @item -mpreferred-stack-boundary=@var{num}
15271 @opindex mpreferred-stack-boundary
15272 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
15273 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
15274 the default is 4 (16 bytes or 128 bits).
15276 @strong{Warning:} When generating code for the x86-64 architecture with
15277 SSE extensions disabled, @option{-mpreferred-stack-boundary=3} can be
15278 used to keep the stack boundary aligned to 8 byte boundary.  Since
15279 x86-64 ABI require 16 byte stack alignment, this is ABI incompatible and
15280 intended to be used in controlled environment where stack space is
15281 important limitation.  This option will lead to wrong code when functions
15282 compiled with 16 byte stack alignment (such as functions from a standard
15283 library) are called with misaligned stack.  In this case, SSE
15284 instructions may lead to misaligned memory access traps.  In addition,
15285 variable arguments will be handled incorrectly for 16 byte aligned
15286 objects (including x87 long double and __int128), leading to wrong
15287 results.  You must build all modules with
15288 @option{-mpreferred-stack-boundary=3}, including any libraries.  This
15289 includes the system libraries and startup modules.
15291 @item -mincoming-stack-boundary=@var{num}
15292 @opindex mincoming-stack-boundary
15293 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
15294 boundary.  If @option{-mincoming-stack-boundary} is not specified,
15295 the one specified by @option{-mpreferred-stack-boundary} is used.
15297 On Pentium and Pentium Pro, @code{double} and @code{long double} values
15298 should be aligned to an 8-byte boundary (see @option{-malign-double}) or
15299 suffer significant run time performance penalties.  On Pentium III, the
15300 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
15301 properly if it is not 16-byte aligned.
15303 To ensure proper alignment of this values on the stack, the stack boundary
15304 must be as aligned as that required by any value stored on the stack.
15305 Further, every function must be generated such that it keeps the stack
15306 aligned.  Thus calling a function compiled with a higher preferred
15307 stack boundary from a function compiled with a lower preferred stack
15308 boundary most likely misaligns the stack.  It is recommended that
15309 libraries that use callbacks always use the default setting.
15311 This extra alignment does consume extra stack space, and generally
15312 increases code size.  Code that is sensitive to stack space usage, such
15313 as embedded systems and operating system kernels, may want to reduce the
15314 preferred alignment to @option{-mpreferred-stack-boundary=2}.
15316 @item -mmmx
15317 @itemx -mno-mmx
15318 @itemx -msse
15319 @itemx -mno-sse
15320 @itemx -msse2
15321 @itemx -mno-sse2
15322 @itemx -msse3
15323 @itemx -mno-sse3
15324 @itemx -mssse3
15325 @itemx -mno-ssse3
15326 @itemx -msse4.1
15327 @need 800
15328 @itemx -mno-sse4.1
15329 @itemx -msse4.2
15330 @itemx -mno-sse4.2
15331 @itemx -msse4
15332 @itemx -mno-sse4
15333 @itemx -mavx
15334 @itemx -mno-avx
15335 @itemx -mavx2
15336 @itemx -mno-avx2
15337 @itemx -mavx512f
15338 @itemx -mno-avx512f
15339 @need 800
15340 @itemx -mavx512pf
15341 @itemx -mno-avx512pf
15342 @itemx -mavx512er
15343 @itemx -mno-avx512er
15344 @itemx -mavx512cd
15345 @itemx -mno-avx512cd
15346 @itemx -msha
15347 @itemx -mno-sha
15348 @itemx -maes
15349 @itemx -mno-aes
15350 @itemx -mpclmul
15351 @itemx -mno-pclmul
15352 @itemx -mclfushopt
15353 @itemx -mno-clflsuhopt
15354 @need 800
15355 @itemx -mfsgsbase
15356 @itemx -mno-fsgsbase
15357 @itemx -mrdrnd
15358 @itemx -mno-rdrnd
15359 @itemx -mf16c
15360 @itemx -mno-f16c
15361 @itemx -mfma
15362 @itemx -mno-fma
15363 @itemx -mprefetchwt1
15364 @itemx -mno-prefetchwt1
15365 @itemx -msse4a
15366 @itemx -mno-sse4a
15367 @itemx -mfma4
15368 @itemx -mno-fma4
15369 @need 800
15370 @itemx -mxop
15371 @itemx -mno-xop
15372 @itemx -mlwp
15373 @itemx -mno-lwp
15374 @itemx -m3dnow
15375 @itemx -mno-3dnow
15376 @itemx -mpopcnt
15377 @itemx -mno-popcnt
15378 @itemx -mabm
15379 @itemx -mno-abm
15380 @itemx -mbmi
15381 @itemx -mbmi2
15382 @itemx -mno-bmi
15383 @itemx -mno-bmi2
15384 @itemx -mlzcnt
15385 @itemx -mno-lzcnt
15386 @itemx -mfxsr
15387 @itemx -mxsave
15388 @itemx -mxsaveopt
15389 @itemx -mrtm
15390 @itemx -mtbm
15391 @itemx -mno-tbm
15392 @itemx -mxsavec
15393 @itemx -mno-xsavec
15394 @itemx -mxsaves
15395 @itemx -mno-xsaves
15396 @opindex mmmx
15397 @opindex mno-mmx
15398 @opindex msse
15399 @opindex mno-sse
15400 @opindex m3dnow
15401 @opindex mno-3dnow
15402 These switches enable or disable the use of instructions in the MMX, SSE,
15403 SSE2, SSE3, SSSE3, SSE4.1, AVX, AVX2, AVX512F, AVX512PF, AVX512ER, AVX512CD,
15404 SHA, AES, PCLMUL, FSGSBASE, RDRND, F16C, FMA, SSE4A, FMA4, XOP, LWP, ABM,
15405 BMI, BMI2, FXSR, XSAVE, XSAVEOPT, LZCNT, RTM, or 3DNow!@:
15406 extended instruction sets.
15407 These extensions are also available as built-in functions: see
15408 @ref{X86 Built-in Functions}, for details of the functions enabled and
15409 disabled by these switches.
15411 To generate SSE/SSE2 instructions automatically from floating-point
15412 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
15414 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
15415 generates new AVX instructions or AVX equivalence for all SSEx instructions
15416 when needed.
15418 These options enable GCC to use these extended instructions in
15419 generated code, even without @option{-mfpmath=sse}.  Applications that
15420 perform run-time CPU detection must compile separate files for each
15421 supported architecture, using the appropriate flags.  In particular,
15422 the file containing the CPU detection code should be compiled without
15423 these options.
15425 @item -mdump-tune-features
15426 @opindex mdump-tune-features
15427 This option instructs GCC to dump the names of the x86 performance 
15428 tuning features and default settings. The names can be used in 
15429 @option{-mtune-ctrl=@var{feature-list}}.
15431 @item -mtune-ctrl=@var{feature-list}
15432 @opindex mtune-ctrl=@var{feature-list}
15433 This option is used to do fine grain control of x86 code generation features.
15434 @var{feature-list} is a comma separated list of @var{feature} names. See also
15435 @option{-mdump-tune-features}. When specified, the @var{feature} will be turned
15436 on if it is not preceded with @code{^}, otherwise, it will be turned off. 
15437 @option{-mtune-ctrl=@var{feature-list}} is intended to be used by GCC
15438 developers. Using it may lead to code paths not covered by testing and can
15439 potentially result in compiler ICEs or runtime errors.
15441 @item -mno-default
15442 @opindex mno-default
15443 This option instructs GCC to turn off all tunable features. See also 
15444 @option{-mtune-ctrl=@var{feature-list}} and @option{-mdump-tune-features}.
15446 @item -mcld
15447 @opindex mcld
15448 This option instructs GCC to emit a @code{cld} instruction in the prologue
15449 of functions that use string instructions.  String instructions depend on
15450 the DF flag to select between autoincrement or autodecrement mode.  While the
15451 ABI specifies the DF flag to be cleared on function entry, some operating
15452 systems violate this specification by not clearing the DF flag in their
15453 exception dispatchers.  The exception handler can be invoked with the DF flag
15454 set, which leads to wrong direction mode when string instructions are used.
15455 This option can be enabled by default on 32-bit x86 targets by configuring
15456 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
15457 instructions can be suppressed with the @option{-mno-cld} compiler option
15458 in this case.
15460 @item -mvzeroupper
15461 @opindex mvzeroupper
15462 This option instructs GCC to emit a @code{vzeroupper} instruction
15463 before a transfer of control flow out of the function to minimize
15464 the AVX to SSE transition penalty as well as remove unnecessary @code{zeroupper}
15465 intrinsics.
15467 @item -mprefer-avx128
15468 @opindex mprefer-avx128
15469 This option instructs GCC to use 128-bit AVX instructions instead of
15470 256-bit AVX instructions in the auto-vectorizer.
15472 @item -mcx16
15473 @opindex mcx16
15474 This option enables GCC to generate @code{CMPXCHG16B} instructions.
15475 @code{CMPXCHG16B} allows for atomic operations on 128-bit double quadword
15476 (or oword) data types.  
15477 This is useful for high-resolution counters that can be updated
15478 by multiple processors (or cores).  This instruction is generated as part of
15479 atomic built-in functions: see @ref{__sync Builtins} or
15480 @ref{__atomic Builtins} for details.
15482 @item -msahf
15483 @opindex msahf
15484 This option enables generation of @code{SAHF} instructions in 64-bit code.
15485 Early Intel Pentium 4 CPUs with Intel 64 support,
15486 prior to the introduction of Pentium 4 G1 step in December 2005,
15487 lacked the @code{LAHF} and @code{SAHF} instructions
15488 which were supported by AMD64.
15489 These are load and store instructions, respectively, for certain status flags.
15490 In 64-bit mode, the @code{SAHF} instruction is used to optimize @code{fmod},
15491 @code{drem}, and @code{remainder} built-in functions;
15492 see @ref{Other Builtins} for details.
15494 @item -mmovbe
15495 @opindex mmovbe
15496 This option enables use of the @code{movbe} instruction to implement
15497 @code{__builtin_bswap32} and @code{__builtin_bswap64}.
15499 @item -mcrc32
15500 @opindex mcrc32
15501 This option enables built-in functions @code{__builtin_ia32_crc32qi},
15502 @code{__builtin_ia32_crc32hi}, @code{__builtin_ia32_crc32si} and
15503 @code{__builtin_ia32_crc32di} to generate the @code{crc32} machine instruction.
15505 @item -mrecip
15506 @opindex mrecip
15507 This option enables use of @code{RCPSS} and @code{RSQRTSS} instructions
15508 (and their vectorized variants @code{RCPPS} and @code{RSQRTPS})
15509 with an additional Newton-Raphson step
15510 to increase precision instead of @code{DIVSS} and @code{SQRTSS}
15511 (and their vectorized
15512 variants) for single-precision floating-point arguments.  These instructions
15513 are generated only when @option{-funsafe-math-optimizations} is enabled
15514 together with @option{-finite-math-only} and @option{-fno-trapping-math}.
15515 Note that while the throughput of the sequence is higher than the throughput
15516 of the non-reciprocal instruction, the precision of the sequence can be
15517 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
15519 Note that GCC implements @code{1.0f/sqrtf(@var{x})} in terms of @code{RSQRTSS}
15520 (or @code{RSQRTPS}) already with @option{-ffast-math} (or the above option
15521 combination), and doesn't need @option{-mrecip}.
15523 Also note that GCC emits the above sequence with additional Newton-Raphson step
15524 for vectorized single-float division and vectorized @code{sqrtf(@var{x})}
15525 already with @option{-ffast-math} (or the above option combination), and
15526 doesn't need @option{-mrecip}.
15528 @item -mrecip=@var{opt}
15529 @opindex mrecip=opt
15530 This option controls which reciprocal estimate instructions
15531 may be used.  @var{opt} is a comma-separated list of options, which may
15532 be preceded by a @samp{!} to invert the option:
15534 @table @samp
15535 @item all
15536 Enable all estimate instructions.
15538 @item default
15539 Enable the default instructions, equivalent to @option{-mrecip}.
15541 @item none
15542 Disable all estimate instructions, equivalent to @option{-mno-recip}.
15544 @item div
15545 Enable the approximation for scalar division.
15547 @item vec-div
15548 Enable the approximation for vectorized division.
15550 @item sqrt
15551 Enable the approximation for scalar square root.
15553 @item vec-sqrt
15554 Enable the approximation for vectorized square root.
15555 @end table
15557 So, for example, @option{-mrecip=all,!sqrt} enables
15558 all of the reciprocal approximations, except for square root.
15560 @item -mveclibabi=@var{type}
15561 @opindex mveclibabi
15562 Specifies the ABI type to use for vectorizing intrinsics using an
15563 external library.  Supported values for @var{type} are @samp{svml} 
15564 for the Intel short
15565 vector math library and @samp{acml} for the AMD math core library.
15566 To use this option, both @option{-ftree-vectorize} and
15567 @option{-funsafe-math-optimizations} have to be enabled, and an SVML or ACML 
15568 ABI-compatible library must be specified at link time.
15570 GCC currently emits calls to @code{vmldExp2},
15571 @code{vmldLn2}, @code{vmldLog102}, @code{vmldLog102}, @code{vmldPow2},
15572 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
15573 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
15574 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
15575 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4}, @code{vmlsLog104},
15576 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
15577 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
15578 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
15579 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
15580 function type when @option{-mveclibabi=svml} is used, and @code{__vrd2_sin},
15581 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
15582 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
15583 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
15584 @code{__vrs4_log10f} and @code{__vrs4_powf} for the corresponding function type
15585 when @option{-mveclibabi=acml} is used.  
15587 @item -mabi=@var{name}
15588 @opindex mabi
15589 Generate code for the specified calling convention.  Permissible values
15590 are @samp{sysv} for the ABI used on GNU/Linux and other systems, and
15591 @samp{ms} for the Microsoft ABI.  The default is to use the Microsoft
15592 ABI when targeting Microsoft Windows and the SysV ABI on all other systems.
15593 You can control this behavior for a specific function by
15594 using the function attribute @samp{ms_abi}/@samp{sysv_abi}.
15595 @xref{Function Attributes}.
15597 @item -mtls-dialect=@var{type}
15598 @opindex mtls-dialect
15599 Generate code to access thread-local storage using the @samp{gnu} or
15600 @samp{gnu2} conventions.  @samp{gnu} is the conservative default;
15601 @samp{gnu2} is more efficient, but it may add compile- and run-time
15602 requirements that cannot be satisfied on all systems.
15604 @item -mpush-args
15605 @itemx -mno-push-args
15606 @opindex mpush-args
15607 @opindex mno-push-args
15608 Use PUSH operations to store outgoing parameters.  This method is shorter
15609 and usually equally fast as method using SUB/MOV operations and is enabled
15610 by default.  In some cases disabling it may improve performance because of
15611 improved scheduling and reduced dependencies.
15613 @item -maccumulate-outgoing-args
15614 @opindex maccumulate-outgoing-args
15615 If enabled, the maximum amount of space required for outgoing arguments is
15616 computed in the function prologue.  This is faster on most modern CPUs
15617 because of reduced dependencies, improved scheduling and reduced stack usage
15618 when the preferred stack boundary is not equal to 2.  The drawback is a notable
15619 increase in code size.  This switch implies @option{-mno-push-args}.
15621 @item -mthreads
15622 @opindex mthreads
15623 Support thread-safe exception handling on MinGW.  Programs that rely
15624 on thread-safe exception handling must compile and link all code with the
15625 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
15626 @code{-D_MT}; when linking, it links in a special thread helper library
15627 @option{-lmingwthrd} which cleans up per-thread exception-handling data.
15629 @item -mno-align-stringops
15630 @opindex mno-align-stringops
15631 Do not align the destination of inlined string operations.  This switch reduces
15632 code size and improves performance in case the destination is already aligned,
15633 but GCC doesn't know about it.
15635 @item -minline-all-stringops
15636 @opindex minline-all-stringops
15637 By default GCC inlines string operations only when the destination is 
15638 known to be aligned to least a 4-byte boundary.  
15639 This enables more inlining and increases code
15640 size, but may improve performance of code that depends on fast
15641 @code{memcpy}, @code{strlen},
15642 and @code{memset} for short lengths.
15644 @item -minline-stringops-dynamically
15645 @opindex minline-stringops-dynamically
15646 For string operations of unknown size, use run-time checks with
15647 inline code for small blocks and a library call for large blocks.
15649 @item -mstringop-strategy=@var{alg}
15650 @opindex mstringop-strategy=@var{alg}
15651 Override the internal decision heuristic for the particular algorithm to use
15652 for inlining string operations.  The allowed values for @var{alg} are:
15654 @table @samp
15655 @item rep_byte
15656 @itemx rep_4byte
15657 @itemx rep_8byte
15658 Expand using i386 @code{rep} prefix of the specified size.
15660 @item byte_loop
15661 @itemx loop
15662 @itemx unrolled_loop
15663 Expand into an inline loop.
15665 @item libcall
15666 Always use a library call.
15667 @end table
15669 @item -mmemcpy-strategy=@var{strategy}
15670 @opindex mmemcpy-strategy=@var{strategy}
15671 Override the internal decision heuristic to decide if @code{__builtin_memcpy}
15672 should be inlined and what inline algorithm to use when the expected size
15673 of the copy operation is known. @var{strategy} 
15674 is a comma-separated list of @var{alg}:@var{max_size}:@var{dest_align} triplets. 
15675 @var{alg} is specified in @option{-mstringop-strategy}, @var{max_size} specifies
15676 the max byte size with which inline algorithm @var{alg} is allowed.  For the last
15677 triplet, the @var{max_size} must be @code{-1}. The @var{max_size} of the triplets
15678 in the list must be specified in increasing order.  The minimal byte size for 
15679 @var{alg} is @code{0} for the first triplet and @code{@var{max_size} + 1} of the 
15680 preceding range.
15682 @item -mmemset-strategy=@var{strategy}
15683 @opindex mmemset-strategy=@var{strategy}
15684 The option is similar to @option{-mmemcpy-strategy=} except that it is to control
15685 @code{__builtin_memset} expansion.
15687 @item -momit-leaf-frame-pointer
15688 @opindex momit-leaf-frame-pointer
15689 Don't keep the frame pointer in a register for leaf functions.  This
15690 avoids the instructions to save, set up, and restore frame pointers and
15691 makes an extra register available in leaf functions.  The option
15692 @option{-fomit-leaf-frame-pointer} removes the frame pointer for leaf functions,
15693 which might make debugging harder.
15695 @item -mtls-direct-seg-refs
15696 @itemx -mno-tls-direct-seg-refs
15697 @opindex mtls-direct-seg-refs
15698 Controls whether TLS variables may be accessed with offsets from the
15699 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
15700 or whether the thread base pointer must be added.  Whether or not this
15701 is valid depends on the operating system, and whether it maps the
15702 segment to cover the entire TLS area.
15704 For systems that use the GNU C Library, the default is on.
15706 @item -msse2avx
15707 @itemx -mno-sse2avx
15708 @opindex msse2avx
15709 Specify that the assembler should encode SSE instructions with VEX
15710 prefix.  The option @option{-mavx} turns this on by default.
15712 @item -mfentry
15713 @itemx -mno-fentry
15714 @opindex mfentry
15715 If profiling is active (@option{-pg}), put the profiling
15716 counter call before the prologue.
15717 Note: On x86 architectures the attribute @code{ms_hook_prologue}
15718 isn't possible at the moment for @option{-mfentry} and @option{-pg}.
15720 @item -m8bit-idiv
15721 @itemx -mno-8bit-idiv
15722 @opindex 8bit-idiv
15723 On some processors, like Intel Atom, 8-bit unsigned integer divide is
15724 much faster than 32-bit/64-bit integer divide.  This option generates a
15725 run-time check.  If both dividend and divisor are within range of 0
15726 to 255, 8-bit unsigned integer divide is used instead of
15727 32-bit/64-bit integer divide.
15729 @item -mavx256-split-unaligned-load
15730 @itemx -mavx256-split-unaligned-store
15731 @opindex avx256-split-unaligned-load
15732 @opindex avx256-split-unaligned-store
15733 Split 32-byte AVX unaligned load and store.
15735 @item -mstack-protector-guard=@var{guard}
15736 @opindex mstack-protector-guard=@var{guard}
15737 Generate stack protection code using canary at @var{guard}.  Supported
15738 locations are @samp{global} for global canary or @samp{tls} for per-thread
15739 canary in the TLS block (the default).  This option has effect only when
15740 @option{-fstack-protector} or @option{-fstack-protector-all} is specified.
15742 @end table
15744 These @samp{-m} switches are supported in addition to the above
15745 on x86-64 processors in 64-bit environments.
15747 @table @gcctabopt
15748 @item -m32
15749 @itemx -m64
15750 @itemx -mx32
15751 @itemx -m16
15752 @opindex m32
15753 @opindex m64
15754 @opindex mx32
15755 @opindex m16
15756 Generate code for a 16-bit, 32-bit or 64-bit environment.
15757 The @option{-m32} option sets @code{int}, @code{long}, and pointer types
15758 to 32 bits, and
15759 generates code that runs on any i386 system.
15761 The @option{-m64} option sets @code{int} to 32 bits and @code{long} and pointer
15762 types to 64 bits, and generates code for the x86-64 architecture.
15763 For Darwin only the @option{-m64} option also turns off the @option{-fno-pic}
15764 and @option{-mdynamic-no-pic} options.
15766 The @option{-mx32} option sets @code{int}, @code{long}, and pointer types
15767 to 32 bits, and
15768 generates code for the x86-64 architecture.
15770 The @option{-m16} option is the same as @option{-m32}, except for that
15771 it outputs the @code{.code16gcc} assembly directive at the beginning of
15772 the assembly output so that the binary can run in 16-bit mode.
15774 @item -mno-red-zone
15775 @opindex mno-red-zone
15776 Do not use a so-called ``red zone'' for x86-64 code.  The red zone is mandated
15777 by the x86-64 ABI; it is a 128-byte area beyond the location of the
15778 stack pointer that is not modified by signal or interrupt handlers
15779 and therefore can be used for temporary data without adjusting the stack
15780 pointer.  The flag @option{-mno-red-zone} disables this red zone.
15782 @item -mcmodel=small
15783 @opindex mcmodel=small
15784 Generate code for the small code model: the program and its symbols must
15785 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
15786 Programs can be statically or dynamically linked.  This is the default
15787 code model.
15789 @item -mcmodel=kernel
15790 @opindex mcmodel=kernel
15791 Generate code for the kernel code model.  The kernel runs in the
15792 negative 2 GB of the address space.
15793 This model has to be used for Linux kernel code.
15795 @item -mcmodel=medium
15796 @opindex mcmodel=medium
15797 Generate code for the medium model: the program is linked in the lower 2
15798 GB of the address space.  Small symbols are also placed there.  Symbols
15799 with sizes larger than @option{-mlarge-data-threshold} are put into
15800 large data or BSS sections and can be located above 2GB.  Programs can
15801 be statically or dynamically linked.
15803 @item -mcmodel=large
15804 @opindex mcmodel=large
15805 Generate code for the large model.  This model makes no assumptions
15806 about addresses and sizes of sections.
15808 @item -maddress-mode=long
15809 @opindex maddress-mode=long
15810 Generate code for long address mode.  This is only supported for 64-bit
15811 and x32 environments.  It is the default address mode for 64-bit
15812 environments.
15814 @item -maddress-mode=short
15815 @opindex maddress-mode=short
15816 Generate code for short address mode.  This is only supported for 32-bit
15817 and x32 environments.  It is the default address mode for 32-bit and
15818 x32 environments.
15819 @end table
15821 @node i386 and x86-64 Windows Options
15822 @subsection i386 and x86-64 Windows Options
15823 @cindex i386 and x86-64 Windows Options
15825 These additional options are available for Microsoft Windows targets:
15827 @table @gcctabopt
15828 @item -mconsole
15829 @opindex mconsole
15830 This option
15831 specifies that a console application is to be generated, by
15832 instructing the linker to set the PE header subsystem type
15833 required for console applications.
15834 This option is available for Cygwin and MinGW targets and is
15835 enabled by default on those targets.
15837 @item -mdll
15838 @opindex mdll
15839 This option is available for Cygwin and MinGW targets.  It
15840 specifies that a DLL---a dynamic link library---is to be
15841 generated, enabling the selection of the required runtime
15842 startup object and entry point.
15844 @item -mnop-fun-dllimport
15845 @opindex mnop-fun-dllimport
15846 This option is available for Cygwin and MinGW targets.  It
15847 specifies that the @code{dllimport} attribute should be ignored.
15849 @item -mthread
15850 @opindex mthread
15851 This option is available for MinGW targets. It specifies
15852 that MinGW-specific thread support is to be used.
15854 @item -municode
15855 @opindex municode
15856 This option is available for MinGW-w64 targets.  It causes
15857 the @code{UNICODE} preprocessor macro to be predefined, and
15858 chooses Unicode-capable runtime startup code.
15860 @item -mwin32
15861 @opindex mwin32
15862 This option is available for Cygwin and MinGW targets.  It
15863 specifies that the typical Microsoft Windows predefined macros are to
15864 be set in the pre-processor, but does not influence the choice
15865 of runtime library/startup code.
15867 @item -mwindows
15868 @opindex mwindows
15869 This option is available for Cygwin and MinGW targets.  It
15870 specifies that a GUI application is to be generated by
15871 instructing the linker to set the PE header subsystem type
15872 appropriately.
15874 @item -fno-set-stack-executable
15875 @opindex fno-set-stack-executable
15876 This option is available for MinGW targets. It specifies that
15877 the executable flag for the stack used by nested functions isn't
15878 set. This is necessary for binaries running in kernel mode of
15879 Microsoft Windows, as there the User32 API, which is used to set executable
15880 privileges, isn't available.
15882 @item -fwritable-relocated-rdata
15883 @opindex fno-writable-relocated-rdata
15884 This option is available for MinGW and Cygwin targets.  It specifies
15885 that relocated-data in read-only section is put into .data
15886 section.  This is a necessary for older runtimes not supporting
15887 modification of .rdata sections for pseudo-relocation.
15889 @item -mpe-aligned-commons
15890 @opindex mpe-aligned-commons
15891 This option is available for Cygwin and MinGW targets.  It
15892 specifies that the GNU extension to the PE file format that
15893 permits the correct alignment of COMMON variables should be
15894 used when generating code.  It is enabled by default if
15895 GCC detects that the target assembler found during configuration
15896 supports the feature.
15897 @end table
15899 See also under @ref{i386 and x86-64 Options} for standard options.
15901 @node IA-64 Options
15902 @subsection IA-64 Options
15903 @cindex IA-64 Options
15905 These are the @samp{-m} options defined for the Intel IA-64 architecture.
15907 @table @gcctabopt
15908 @item -mbig-endian
15909 @opindex mbig-endian
15910 Generate code for a big-endian target.  This is the default for HP-UX@.
15912 @item -mlittle-endian
15913 @opindex mlittle-endian
15914 Generate code for a little-endian target.  This is the default for AIX5
15915 and GNU/Linux.
15917 @item -mgnu-as
15918 @itemx -mno-gnu-as
15919 @opindex mgnu-as
15920 @opindex mno-gnu-as
15921 Generate (or don't) code for the GNU assembler.  This is the default.
15922 @c Also, this is the default if the configure option @option{--with-gnu-as}
15923 @c is used.
15925 @item -mgnu-ld
15926 @itemx -mno-gnu-ld
15927 @opindex mgnu-ld
15928 @opindex mno-gnu-ld
15929 Generate (or don't) code for the GNU linker.  This is the default.
15930 @c Also, this is the default if the configure option @option{--with-gnu-ld}
15931 @c is used.
15933 @item -mno-pic
15934 @opindex mno-pic
15935 Generate code that does not use a global pointer register.  The result
15936 is not position independent code, and violates the IA-64 ABI@.
15938 @item -mvolatile-asm-stop
15939 @itemx -mno-volatile-asm-stop
15940 @opindex mvolatile-asm-stop
15941 @opindex mno-volatile-asm-stop
15942 Generate (or don't) a stop bit immediately before and after volatile asm
15943 statements.
15945 @item -mregister-names
15946 @itemx -mno-register-names
15947 @opindex mregister-names
15948 @opindex mno-register-names
15949 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
15950 the stacked registers.  This may make assembler output more readable.
15952 @item -mno-sdata
15953 @itemx -msdata
15954 @opindex mno-sdata
15955 @opindex msdata
15956 Disable (or enable) optimizations that use the small data section.  This may
15957 be useful for working around optimizer bugs.
15959 @item -mconstant-gp
15960 @opindex mconstant-gp
15961 Generate code that uses a single constant global pointer value.  This is
15962 useful when compiling kernel code.
15964 @item -mauto-pic
15965 @opindex mauto-pic
15966 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
15967 This is useful when compiling firmware code.
15969 @item -minline-float-divide-min-latency
15970 @opindex minline-float-divide-min-latency
15971 Generate code for inline divides of floating-point values
15972 using the minimum latency algorithm.
15974 @item -minline-float-divide-max-throughput
15975 @opindex minline-float-divide-max-throughput
15976 Generate code for inline divides of floating-point values
15977 using the maximum throughput algorithm.
15979 @item -mno-inline-float-divide
15980 @opindex mno-inline-float-divide
15981 Do not generate inline code for divides of floating-point values.
15983 @item -minline-int-divide-min-latency
15984 @opindex minline-int-divide-min-latency
15985 Generate code for inline divides of integer values
15986 using the minimum latency algorithm.
15988 @item -minline-int-divide-max-throughput
15989 @opindex minline-int-divide-max-throughput
15990 Generate code for inline divides of integer values
15991 using the maximum throughput algorithm.
15993 @item -mno-inline-int-divide
15994 @opindex mno-inline-int-divide
15995 Do not generate inline code for divides of integer values.
15997 @item -minline-sqrt-min-latency
15998 @opindex minline-sqrt-min-latency
15999 Generate code for inline square roots
16000 using the minimum latency algorithm.
16002 @item -minline-sqrt-max-throughput
16003 @opindex minline-sqrt-max-throughput
16004 Generate code for inline square roots
16005 using the maximum throughput algorithm.
16007 @item -mno-inline-sqrt
16008 @opindex mno-inline-sqrt
16009 Do not generate inline code for @code{sqrt}.
16011 @item -mfused-madd
16012 @itemx -mno-fused-madd
16013 @opindex mfused-madd
16014 @opindex mno-fused-madd
16015 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
16016 instructions.  The default is to use these instructions.
16018 @item -mno-dwarf2-asm
16019 @itemx -mdwarf2-asm
16020 @opindex mno-dwarf2-asm
16021 @opindex mdwarf2-asm
16022 Don't (or do) generate assembler code for the DWARF 2 line number debugging
16023 info.  This may be useful when not using the GNU assembler.
16025 @item -mearly-stop-bits
16026 @itemx -mno-early-stop-bits
16027 @opindex mearly-stop-bits
16028 @opindex mno-early-stop-bits
16029 Allow stop bits to be placed earlier than immediately preceding the
16030 instruction that triggered the stop bit.  This can improve instruction
16031 scheduling, but does not always do so.
16033 @item -mfixed-range=@var{register-range}
16034 @opindex mfixed-range
16035 Generate code treating the given register range as fixed registers.
16036 A fixed register is one that the register allocator cannot use.  This is
16037 useful when compiling kernel code.  A register range is specified as
16038 two registers separated by a dash.  Multiple register ranges can be
16039 specified separated by a comma.
16041 @item -mtls-size=@var{tls-size}
16042 @opindex mtls-size
16043 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
16046 @item -mtune=@var{cpu-type}
16047 @opindex mtune
16048 Tune the instruction scheduling for a particular CPU, Valid values are
16049 @samp{itanium}, @samp{itanium1}, @samp{merced}, @samp{itanium2},
16050 and @samp{mckinley}.
16052 @item -milp32
16053 @itemx -mlp64
16054 @opindex milp32
16055 @opindex mlp64
16056 Generate code for a 32-bit or 64-bit environment.
16057 The 32-bit environment sets int, long and pointer to 32 bits.
16058 The 64-bit environment sets int to 32 bits and long and pointer
16059 to 64 bits.  These are HP-UX specific flags.
16061 @item -mno-sched-br-data-spec
16062 @itemx -msched-br-data-spec
16063 @opindex mno-sched-br-data-spec
16064 @opindex msched-br-data-spec
16065 (Dis/En)able data speculative scheduling before reload.
16066 This results in generation of @code{ld.a} instructions and
16067 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
16068 The default is 'disable'.
16070 @item -msched-ar-data-spec
16071 @itemx -mno-sched-ar-data-spec
16072 @opindex msched-ar-data-spec
16073 @opindex mno-sched-ar-data-spec
16074 (En/Dis)able data speculative scheduling after reload.
16075 This results in generation of @code{ld.a} instructions and
16076 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
16077 The default is 'enable'.
16079 @item -mno-sched-control-spec
16080 @itemx -msched-control-spec
16081 @opindex mno-sched-control-spec
16082 @opindex msched-control-spec
16083 (Dis/En)able control speculative scheduling.  This feature is
16084 available only during region scheduling (i.e.@: before reload).
16085 This results in generation of the @code{ld.s} instructions and
16086 the corresponding check instructions @code{chk.s}.
16087 The default is 'disable'.
16089 @item -msched-br-in-data-spec
16090 @itemx -mno-sched-br-in-data-spec
16091 @opindex msched-br-in-data-spec
16092 @opindex mno-sched-br-in-data-spec
16093 (En/Dis)able speculative scheduling of the instructions that
16094 are dependent on the data speculative loads before reload.
16095 This is effective only with @option{-msched-br-data-spec} enabled.
16096 The default is 'enable'.
16098 @item -msched-ar-in-data-spec
16099 @itemx -mno-sched-ar-in-data-spec
16100 @opindex msched-ar-in-data-spec
16101 @opindex mno-sched-ar-in-data-spec
16102 (En/Dis)able speculative scheduling of the instructions that
16103 are dependent on the data speculative loads after reload.
16104 This is effective only with @option{-msched-ar-data-spec} enabled.
16105 The default is 'enable'.
16107 @item -msched-in-control-spec
16108 @itemx -mno-sched-in-control-spec
16109 @opindex msched-in-control-spec
16110 @opindex mno-sched-in-control-spec
16111 (En/Dis)able speculative scheduling of the instructions that
16112 are dependent on the control speculative loads.
16113 This is effective only with @option{-msched-control-spec} enabled.
16114 The default is 'enable'.
16116 @item -mno-sched-prefer-non-data-spec-insns
16117 @itemx -msched-prefer-non-data-spec-insns
16118 @opindex mno-sched-prefer-non-data-spec-insns
16119 @opindex msched-prefer-non-data-spec-insns
16120 If enabled, data-speculative instructions are chosen for schedule
16121 only if there are no other choices at the moment.  This makes
16122 the use of the data speculation much more conservative.
16123 The default is 'disable'.
16125 @item -mno-sched-prefer-non-control-spec-insns
16126 @itemx -msched-prefer-non-control-spec-insns
16127 @opindex mno-sched-prefer-non-control-spec-insns
16128 @opindex msched-prefer-non-control-spec-insns
16129 If enabled, control-speculative instructions are chosen for schedule
16130 only if there are no other choices at the moment.  This makes
16131 the use of the control speculation much more conservative.
16132 The default is 'disable'.
16134 @item -mno-sched-count-spec-in-critical-path
16135 @itemx -msched-count-spec-in-critical-path
16136 @opindex mno-sched-count-spec-in-critical-path
16137 @opindex msched-count-spec-in-critical-path
16138 If enabled, speculative dependencies are considered during
16139 computation of the instructions priorities.  This makes the use of the
16140 speculation a bit more conservative.
16141 The default is 'disable'.
16143 @item -msched-spec-ldc
16144 @opindex msched-spec-ldc
16145 Use a simple data speculation check.  This option is on by default.
16147 @item -msched-control-spec-ldc
16148 @opindex msched-spec-ldc
16149 Use a simple check for control speculation.  This option is on by default.
16151 @item -msched-stop-bits-after-every-cycle
16152 @opindex msched-stop-bits-after-every-cycle
16153 Place a stop bit after every cycle when scheduling.  This option is on
16154 by default.
16156 @item -msched-fp-mem-deps-zero-cost
16157 @opindex msched-fp-mem-deps-zero-cost
16158 Assume that floating-point stores and loads are not likely to cause a conflict
16159 when placed into the same instruction group.  This option is disabled by
16160 default.
16162 @item -msel-sched-dont-check-control-spec
16163 @opindex msel-sched-dont-check-control-spec
16164 Generate checks for control speculation in selective scheduling.
16165 This flag is disabled by default.
16167 @item -msched-max-memory-insns=@var{max-insns}
16168 @opindex msched-max-memory-insns
16169 Limit on the number of memory insns per instruction group, giving lower
16170 priority to subsequent memory insns attempting to schedule in the same
16171 instruction group. Frequently useful to prevent cache bank conflicts.
16172 The default value is 1.
16174 @item -msched-max-memory-insns-hard-limit
16175 @opindex msched-max-memory-insns-hard-limit
16176 Makes the limit specified by @option{msched-max-memory-insns} a hard limit,
16177 disallowing more than that number in an instruction group.
16178 Otherwise, the limit is ``soft'', meaning that non-memory operations
16179 are preferred when the limit is reached, but memory operations may still
16180 be scheduled.
16182 @end table
16184 @node LM32 Options
16185 @subsection LM32 Options
16186 @cindex LM32 options
16188 These @option{-m} options are defined for the LatticeMico32 architecture:
16190 @table @gcctabopt
16191 @item -mbarrel-shift-enabled
16192 @opindex mbarrel-shift-enabled
16193 Enable barrel-shift instructions.
16195 @item -mdivide-enabled
16196 @opindex mdivide-enabled
16197 Enable divide and modulus instructions.
16199 @item -mmultiply-enabled
16200 @opindex multiply-enabled
16201 Enable multiply instructions.
16203 @item -msign-extend-enabled
16204 @opindex msign-extend-enabled
16205 Enable sign extend instructions.
16207 @item -muser-enabled
16208 @opindex muser-enabled
16209 Enable user-defined instructions.
16211 @end table
16213 @node M32C Options
16214 @subsection M32C Options
16215 @cindex M32C options
16217 @table @gcctabopt
16218 @item -mcpu=@var{name}
16219 @opindex mcpu=
16220 Select the CPU for which code is generated.  @var{name} may be one of
16221 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
16222 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
16223 the M32C/80 series.
16225 @item -msim
16226 @opindex msim
16227 Specifies that the program will be run on the simulator.  This causes
16228 an alternate runtime library to be linked in which supports, for
16229 example, file I/O@.  You must not use this option when generating
16230 programs that will run on real hardware; you must provide your own
16231 runtime library for whatever I/O functions are needed.
16233 @item -memregs=@var{number}
16234 @opindex memregs=
16235 Specifies the number of memory-based pseudo-registers GCC uses
16236 during code generation.  These pseudo-registers are used like real
16237 registers, so there is a tradeoff between GCC's ability to fit the
16238 code into available registers, and the performance penalty of using
16239 memory instead of registers.  Note that all modules in a program must
16240 be compiled with the same value for this option.  Because of that, you
16241 must not use this option with GCC's default runtime libraries.
16243 @end table
16245 @node M32R/D Options
16246 @subsection M32R/D Options
16247 @cindex M32R/D options
16249 These @option{-m} options are defined for Renesas M32R/D architectures:
16251 @table @gcctabopt
16252 @item -m32r2
16253 @opindex m32r2
16254 Generate code for the M32R/2@.
16256 @item -m32rx
16257 @opindex m32rx
16258 Generate code for the M32R/X@.
16260 @item -m32r
16261 @opindex m32r
16262 Generate code for the M32R@.  This is the default.
16264 @item -mmodel=small
16265 @opindex mmodel=small
16266 Assume all objects live in the lower 16MB of memory (so that their addresses
16267 can be loaded with the @code{ld24} instruction), and assume all subroutines
16268 are reachable with the @code{bl} instruction.
16269 This is the default.
16271 The addressability of a particular object can be set with the
16272 @code{model} attribute.
16274 @item -mmodel=medium
16275 @opindex mmodel=medium
16276 Assume objects may be anywhere in the 32-bit address space (the compiler
16277 generates @code{seth/add3} instructions to load their addresses), and
16278 assume all subroutines are reachable with the @code{bl} instruction.
16280 @item -mmodel=large
16281 @opindex mmodel=large
16282 Assume objects may be anywhere in the 32-bit address space (the compiler
16283 generates @code{seth/add3} instructions to load their addresses), and
16284 assume subroutines may not be reachable with the @code{bl} instruction
16285 (the compiler generates the much slower @code{seth/add3/jl}
16286 instruction sequence).
16288 @item -msdata=none
16289 @opindex msdata=none
16290 Disable use of the small data area.  Variables are put into
16291 one of @samp{.data}, @samp{.bss}, or @samp{.rodata} (unless the
16292 @code{section} attribute has been specified).
16293 This is the default.
16295 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
16296 Objects may be explicitly put in the small data area with the
16297 @code{section} attribute using one of these sections.
16299 @item -msdata=sdata
16300 @opindex msdata=sdata
16301 Put small global and static data in the small data area, but do not
16302 generate special code to reference them.
16304 @item -msdata=use
16305 @opindex msdata=use
16306 Put small global and static data in the small data area, and generate
16307 special instructions to reference them.
16309 @item -G @var{num}
16310 @opindex G
16311 @cindex smaller data references
16312 Put global and static objects less than or equal to @var{num} bytes
16313 into the small data or BSS sections instead of the normal data or BSS
16314 sections.  The default value of @var{num} is 8.
16315 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
16316 for this option to have any effect.
16318 All modules should be compiled with the same @option{-G @var{num}} value.
16319 Compiling with different values of @var{num} may or may not work; if it
16320 doesn't the linker gives an error message---incorrect code is not
16321 generated.
16323 @item -mdebug
16324 @opindex mdebug
16325 Makes the M32R-specific code in the compiler display some statistics
16326 that might help in debugging programs.
16328 @item -malign-loops
16329 @opindex malign-loops
16330 Align all loops to a 32-byte boundary.
16332 @item -mno-align-loops
16333 @opindex mno-align-loops
16334 Do not enforce a 32-byte alignment for loops.  This is the default.
16336 @item -missue-rate=@var{number}
16337 @opindex missue-rate=@var{number}
16338 Issue @var{number} instructions per cycle.  @var{number} can only be 1
16339 or 2.
16341 @item -mbranch-cost=@var{number}
16342 @opindex mbranch-cost=@var{number}
16343 @var{number} can only be 1 or 2.  If it is 1 then branches are
16344 preferred over conditional code, if it is 2, then the opposite applies.
16346 @item -mflush-trap=@var{number}
16347 @opindex mflush-trap=@var{number}
16348 Specifies the trap number to use to flush the cache.  The default is
16349 12.  Valid numbers are between 0 and 15 inclusive.
16351 @item -mno-flush-trap
16352 @opindex mno-flush-trap
16353 Specifies that the cache cannot be flushed by using a trap.
16355 @item -mflush-func=@var{name}
16356 @opindex mflush-func=@var{name}
16357 Specifies the name of the operating system function to call to flush
16358 the cache.  The default is @emph{_flush_cache}, but a function call
16359 is only used if a trap is not available.
16361 @item -mno-flush-func
16362 @opindex mno-flush-func
16363 Indicates that there is no OS function for flushing the cache.
16365 @end table
16367 @node M680x0 Options
16368 @subsection M680x0 Options
16369 @cindex M680x0 options
16371 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
16372 The default settings depend on which architecture was selected when
16373 the compiler was configured; the defaults for the most common choices
16374 are given below.
16376 @table @gcctabopt
16377 @item -march=@var{arch}
16378 @opindex march
16379 Generate code for a specific M680x0 or ColdFire instruction set
16380 architecture.  Permissible values of @var{arch} for M680x0
16381 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
16382 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
16383 architectures are selected according to Freescale's ISA classification
16384 and the permissible values are: @samp{isaa}, @samp{isaaplus},
16385 @samp{isab} and @samp{isac}.
16387 GCC defines a macro @samp{__mcf@var{arch}__} whenever it is generating
16388 code for a ColdFire target.  The @var{arch} in this macro is one of the
16389 @option{-march} arguments given above.
16391 When used together, @option{-march} and @option{-mtune} select code
16392 that runs on a family of similar processors but that is optimized
16393 for a particular microarchitecture.
16395 @item -mcpu=@var{cpu}
16396 @opindex mcpu
16397 Generate code for a specific M680x0 or ColdFire processor.
16398 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
16399 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
16400 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
16401 below, which also classifies the CPUs into families:
16403 @multitable @columnfractions 0.20 0.80
16404 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
16405 @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}
16406 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
16407 @item @samp{5206e} @tab @samp{5206e}
16408 @item @samp{5208} @tab @samp{5207} @samp{5208}
16409 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
16410 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
16411 @item @samp{5216} @tab @samp{5214} @samp{5216}
16412 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
16413 @item @samp{5225} @tab @samp{5224} @samp{5225}
16414 @item @samp{52259} @tab @samp{52252} @samp{52254} @samp{52255} @samp{52256} @samp{52258} @samp{52259}
16415 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
16416 @item @samp{5249} @tab @samp{5249}
16417 @item @samp{5250} @tab @samp{5250}
16418 @item @samp{5271} @tab @samp{5270} @samp{5271}
16419 @item @samp{5272} @tab @samp{5272}
16420 @item @samp{5275} @tab @samp{5274} @samp{5275}
16421 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
16422 @item @samp{53017} @tab @samp{53011} @samp{53012} @samp{53013} @samp{53014} @samp{53015} @samp{53016} @samp{53017}
16423 @item @samp{5307} @tab @samp{5307}
16424 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
16425 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
16426 @item @samp{5407} @tab @samp{5407}
16427 @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}
16428 @end multitable
16430 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
16431 @var{arch} is compatible with @var{cpu}.  Other combinations of
16432 @option{-mcpu} and @option{-march} are rejected.
16434 GCC defines the macro @samp{__mcf_cpu_@var{cpu}} when ColdFire target
16435 @var{cpu} is selected.  It also defines @samp{__mcf_family_@var{family}},
16436 where the value of @var{family} is given by the table above.
16438 @item -mtune=@var{tune}
16439 @opindex mtune
16440 Tune the code for a particular microarchitecture within the
16441 constraints set by @option{-march} and @option{-mcpu}.
16442 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
16443 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
16444 and @samp{cpu32}.  The ColdFire microarchitectures
16445 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
16447 You can also use @option{-mtune=68020-40} for code that needs
16448 to run relatively well on 68020, 68030 and 68040 targets.
16449 @option{-mtune=68020-60} is similar but includes 68060 targets
16450 as well.  These two options select the same tuning decisions as
16451 @option{-m68020-40} and @option{-m68020-60} respectively.
16453 GCC defines the macros @samp{__mc@var{arch}} and @samp{__mc@var{arch}__}
16454 when tuning for 680x0 architecture @var{arch}.  It also defines
16455 @samp{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
16456 option is used.  If GCC is tuning for a range of architectures,
16457 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
16458 it defines the macros for every architecture in the range.
16460 GCC also defines the macro @samp{__m@var{uarch}__} when tuning for
16461 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
16462 of the arguments given above.
16464 @item -m68000
16465 @itemx -mc68000
16466 @opindex m68000
16467 @opindex mc68000
16468 Generate output for a 68000.  This is the default
16469 when the compiler is configured for 68000-based systems.
16470 It is equivalent to @option{-march=68000}.
16472 Use this option for microcontrollers with a 68000 or EC000 core,
16473 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
16475 @item -m68010
16476 @opindex m68010
16477 Generate output for a 68010.  This is the default
16478 when the compiler is configured for 68010-based systems.
16479 It is equivalent to @option{-march=68010}.
16481 @item -m68020
16482 @itemx -mc68020
16483 @opindex m68020
16484 @opindex mc68020
16485 Generate output for a 68020.  This is the default
16486 when the compiler is configured for 68020-based systems.
16487 It is equivalent to @option{-march=68020}.
16489 @item -m68030
16490 @opindex m68030
16491 Generate output for a 68030.  This is the default when the compiler is
16492 configured for 68030-based systems.  It is equivalent to
16493 @option{-march=68030}.
16495 @item -m68040
16496 @opindex m68040
16497 Generate output for a 68040.  This is the default when the compiler is
16498 configured for 68040-based systems.  It is equivalent to
16499 @option{-march=68040}.
16501 This option inhibits the use of 68881/68882 instructions that have to be
16502 emulated by software on the 68040.  Use this option if your 68040 does not
16503 have code to emulate those instructions.
16505 @item -m68060
16506 @opindex m68060
16507 Generate output for a 68060.  This is the default when the compiler is
16508 configured for 68060-based systems.  It is equivalent to
16509 @option{-march=68060}.
16511 This option inhibits the use of 68020 and 68881/68882 instructions that
16512 have to be emulated by software on the 68060.  Use this option if your 68060
16513 does not have code to emulate those instructions.
16515 @item -mcpu32
16516 @opindex mcpu32
16517 Generate output for a CPU32.  This is the default
16518 when the compiler is configured for CPU32-based systems.
16519 It is equivalent to @option{-march=cpu32}.
16521 Use this option for microcontrollers with a
16522 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
16523 68336, 68340, 68341, 68349 and 68360.
16525 @item -m5200
16526 @opindex m5200
16527 Generate output for a 520X ColdFire CPU@.  This is the default
16528 when the compiler is configured for 520X-based systems.
16529 It is equivalent to @option{-mcpu=5206}, and is now deprecated
16530 in favor of that option.
16532 Use this option for microcontroller with a 5200 core, including
16533 the MCF5202, MCF5203, MCF5204 and MCF5206.
16535 @item -m5206e
16536 @opindex m5206e
16537 Generate output for a 5206e ColdFire CPU@.  The option is now
16538 deprecated in favor of the equivalent @option{-mcpu=5206e}.
16540 @item -m528x
16541 @opindex m528x
16542 Generate output for a member of the ColdFire 528X family.
16543 The option is now deprecated in favor of the equivalent
16544 @option{-mcpu=528x}.
16546 @item -m5307
16547 @opindex m5307
16548 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
16549 in favor of the equivalent @option{-mcpu=5307}.
16551 @item -m5407
16552 @opindex m5407
16553 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
16554 in favor of the equivalent @option{-mcpu=5407}.
16556 @item -mcfv4e
16557 @opindex mcfv4e
16558 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
16559 This includes use of hardware floating-point instructions.
16560 The option is equivalent to @option{-mcpu=547x}, and is now
16561 deprecated in favor of that option.
16563 @item -m68020-40
16564 @opindex m68020-40
16565 Generate output for a 68040, without using any of the new instructions.
16566 This results in code that can run relatively efficiently on either a
16567 68020/68881 or a 68030 or a 68040.  The generated code does use the
16568 68881 instructions that are emulated on the 68040.
16570 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
16572 @item -m68020-60
16573 @opindex m68020-60
16574 Generate output for a 68060, without using any of the new instructions.
16575 This results in code that can run relatively efficiently on either a
16576 68020/68881 or a 68030 or a 68040.  The generated code does use the
16577 68881 instructions that are emulated on the 68060.
16579 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
16581 @item -mhard-float
16582 @itemx -m68881
16583 @opindex mhard-float
16584 @opindex m68881
16585 Generate floating-point instructions.  This is the default for 68020
16586 and above, and for ColdFire devices that have an FPU@.  It defines the
16587 macro @samp{__HAVE_68881__} on M680x0 targets and @samp{__mcffpu__}
16588 on ColdFire targets.
16590 @item -msoft-float
16591 @opindex msoft-float
16592 Do not generate floating-point instructions; use library calls instead.
16593 This is the default for 68000, 68010, and 68832 targets.  It is also
16594 the default for ColdFire devices that have no FPU.
16596 @item -mdiv
16597 @itemx -mno-div
16598 @opindex mdiv
16599 @opindex mno-div
16600 Generate (do not generate) ColdFire hardware divide and remainder
16601 instructions.  If @option{-march} is used without @option{-mcpu},
16602 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
16603 architectures.  Otherwise, the default is taken from the target CPU
16604 (either the default CPU, or the one specified by @option{-mcpu}).  For
16605 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
16606 @option{-mcpu=5206e}.
16608 GCC defines the macro @samp{__mcfhwdiv__} when this option is enabled.
16610 @item -mshort
16611 @opindex mshort
16612 Consider type @code{int} to be 16 bits wide, like @code{short int}.
16613 Additionally, parameters passed on the stack are also aligned to a
16614 16-bit boundary even on targets whose API mandates promotion to 32-bit.
16616 @item -mno-short
16617 @opindex mno-short
16618 Do not consider type @code{int} to be 16 bits wide.  This is the default.
16620 @item -mnobitfield
16621 @itemx -mno-bitfield
16622 @opindex mnobitfield
16623 @opindex mno-bitfield
16624 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
16625 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
16627 @item -mbitfield
16628 @opindex mbitfield
16629 Do use the bit-field instructions.  The @option{-m68020} option implies
16630 @option{-mbitfield}.  This is the default if you use a configuration
16631 designed for a 68020.
16633 @item -mrtd
16634 @opindex mrtd
16635 Use a different function-calling convention, in which functions
16636 that take a fixed number of arguments return with the @code{rtd}
16637 instruction, which pops their arguments while returning.  This
16638 saves one instruction in the caller since there is no need to pop
16639 the arguments there.
16641 This calling convention is incompatible with the one normally
16642 used on Unix, so you cannot use it if you need to call libraries
16643 compiled with the Unix compiler.
16645 Also, you must provide function prototypes for all functions that
16646 take variable numbers of arguments (including @code{printf});
16647 otherwise incorrect code is generated for calls to those
16648 functions.
16650 In addition, seriously incorrect code results if you call a
16651 function with too many arguments.  (Normally, extra arguments are
16652 harmlessly ignored.)
16654 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
16655 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
16657 @item -mno-rtd
16658 @opindex mno-rtd
16659 Do not use the calling conventions selected by @option{-mrtd}.
16660 This is the default.
16662 @item -malign-int
16663 @itemx -mno-align-int
16664 @opindex malign-int
16665 @opindex mno-align-int
16666 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
16667 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
16668 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
16669 Aligning variables on 32-bit boundaries produces code that runs somewhat
16670 faster on processors with 32-bit busses at the expense of more memory.
16672 @strong{Warning:} if you use the @option{-malign-int} switch, GCC
16673 aligns structures containing the above types differently than
16674 most published application binary interface specifications for the m68k.
16676 @item -mpcrel
16677 @opindex mpcrel
16678 Use the pc-relative addressing mode of the 68000 directly, instead of
16679 using a global offset table.  At present, this option implies @option{-fpic},
16680 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
16681 not presently supported with @option{-mpcrel}, though this could be supported for
16682 68020 and higher processors.
16684 @item -mno-strict-align
16685 @itemx -mstrict-align
16686 @opindex mno-strict-align
16687 @opindex mstrict-align
16688 Do not (do) assume that unaligned memory references are handled by
16689 the system.
16691 @item -msep-data
16692 Generate code that allows the data segment to be located in a different
16693 area of memory from the text segment.  This allows for execute-in-place in
16694 an environment without virtual memory management.  This option implies
16695 @option{-fPIC}.
16697 @item -mno-sep-data
16698 Generate code that assumes that the data segment follows the text segment.
16699 This is the default.
16701 @item -mid-shared-library
16702 Generate code that supports shared libraries via the library ID method.
16703 This allows for execute-in-place and shared libraries in an environment
16704 without virtual memory management.  This option implies @option{-fPIC}.
16706 @item -mno-id-shared-library
16707 Generate code that doesn't assume ID-based shared libraries are being used.
16708 This is the default.
16710 @item -mshared-library-id=n
16711 Specifies the identification number of the ID-based shared library being
16712 compiled.  Specifying a value of 0 generates more compact code; specifying
16713 other values forces the allocation of that number to the current
16714 library, but is no more space- or time-efficient than omitting this option.
16716 @item -mxgot
16717 @itemx -mno-xgot
16718 @opindex mxgot
16719 @opindex mno-xgot
16720 When generating position-independent code for ColdFire, generate code
16721 that works if the GOT has more than 8192 entries.  This code is
16722 larger and slower than code generated without this option.  On M680x0
16723 processors, this option is not needed; @option{-fPIC} suffices.
16725 GCC normally uses a single instruction to load values from the GOT@.
16726 While this is relatively efficient, it only works if the GOT
16727 is smaller than about 64k.  Anything larger causes the linker
16728 to report an error such as:
16730 @cindex relocation truncated to fit (ColdFire)
16731 @smallexample
16732 relocation truncated to fit: R_68K_GOT16O foobar
16733 @end smallexample
16735 If this happens, you should recompile your code with @option{-mxgot}.
16736 It should then work with very large GOTs.  However, code generated with
16737 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
16738 the value of a global symbol.
16740 Note that some linkers, including newer versions of the GNU linker,
16741 can create multiple GOTs and sort GOT entries.  If you have such a linker,
16742 you should only need to use @option{-mxgot} when compiling a single
16743 object file that accesses more than 8192 GOT entries.  Very few do.
16745 These options have no effect unless GCC is generating
16746 position-independent code.
16748 @end table
16750 @node MCore Options
16751 @subsection MCore Options
16752 @cindex MCore options
16754 These are the @samp{-m} options defined for the Motorola M*Core
16755 processors.
16757 @table @gcctabopt
16759 @item -mhardlit
16760 @itemx -mno-hardlit
16761 @opindex mhardlit
16762 @opindex mno-hardlit
16763 Inline constants into the code stream if it can be done in two
16764 instructions or less.
16766 @item -mdiv
16767 @itemx -mno-div
16768 @opindex mdiv
16769 @opindex mno-div
16770 Use the divide instruction.  (Enabled by default).
16772 @item -mrelax-immediate
16773 @itemx -mno-relax-immediate
16774 @opindex mrelax-immediate
16775 @opindex mno-relax-immediate
16776 Allow arbitrary-sized immediates in bit operations.
16778 @item -mwide-bitfields
16779 @itemx -mno-wide-bitfields
16780 @opindex mwide-bitfields
16781 @opindex mno-wide-bitfields
16782 Always treat bit-fields as @code{int}-sized.
16784 @item -m4byte-functions
16785 @itemx -mno-4byte-functions
16786 @opindex m4byte-functions
16787 @opindex mno-4byte-functions
16788 Force all functions to be aligned to a 4-byte boundary.
16790 @item -mcallgraph-data
16791 @itemx -mno-callgraph-data
16792 @opindex mcallgraph-data
16793 @opindex mno-callgraph-data
16794 Emit callgraph information.
16796 @item -mslow-bytes
16797 @itemx -mno-slow-bytes
16798 @opindex mslow-bytes
16799 @opindex mno-slow-bytes
16800 Prefer word access when reading byte quantities.
16802 @item -mlittle-endian
16803 @itemx -mbig-endian
16804 @opindex mlittle-endian
16805 @opindex mbig-endian
16806 Generate code for a little-endian target.
16808 @item -m210
16809 @itemx -m340
16810 @opindex m210
16811 @opindex m340
16812 Generate code for the 210 processor.
16814 @item -mno-lsim
16815 @opindex mno-lsim
16816 Assume that runtime support has been provided and so omit the
16817 simulator library (@file{libsim.a)} from the linker command line.
16819 @item -mstack-increment=@var{size}
16820 @opindex mstack-increment
16821 Set the maximum amount for a single stack increment operation.  Large
16822 values can increase the speed of programs that contain functions
16823 that need a large amount of stack space, but they can also trigger a
16824 segmentation fault if the stack is extended too much.  The default
16825 value is 0x1000.
16827 @end table
16829 @node MeP Options
16830 @subsection MeP Options
16831 @cindex MeP options
16833 @table @gcctabopt
16835 @item -mabsdiff
16836 @opindex mabsdiff
16837 Enables the @code{abs} instruction, which is the absolute difference
16838 between two registers.
16840 @item -mall-opts
16841 @opindex mall-opts
16842 Enables all the optional instructions---average, multiply, divide, bit
16843 operations, leading zero, absolute difference, min/max, clip, and
16844 saturation.
16847 @item -maverage
16848 @opindex maverage
16849 Enables the @code{ave} instruction, which computes the average of two
16850 registers.
16852 @item -mbased=@var{n}
16853 @opindex mbased=
16854 Variables of size @var{n} bytes or smaller are placed in the
16855 @code{.based} section by default.  Based variables use the @code{$tp}
16856 register as a base register, and there is a 128-byte limit to the
16857 @code{.based} section.
16859 @item -mbitops
16860 @opindex mbitops
16861 Enables the bit operation instructions---bit test (@code{btstm}), set
16862 (@code{bsetm}), clear (@code{bclrm}), invert (@code{bnotm}), and
16863 test-and-set (@code{tas}).
16865 @item -mc=@var{name}
16866 @opindex mc=
16867 Selects which section constant data is placed in.  @var{name} may
16868 be @code{tiny}, @code{near}, or @code{far}.
16870 @item -mclip
16871 @opindex mclip
16872 Enables the @code{clip} instruction.  Note that @code{-mclip} is not
16873 useful unless you also provide @code{-mminmax}.
16875 @item -mconfig=@var{name}
16876 @opindex mconfig=
16877 Selects one of the built-in core configurations.  Each MeP chip has
16878 one or more modules in it; each module has a core CPU and a variety of
16879 coprocessors, optional instructions, and peripherals.  The
16880 @code{MeP-Integrator} tool, not part of GCC, provides these
16881 configurations through this option; using this option is the same as
16882 using all the corresponding command-line options.  The default
16883 configuration is @code{default}.
16885 @item -mcop
16886 @opindex mcop
16887 Enables the coprocessor instructions.  By default, this is a 32-bit
16888 coprocessor.  Note that the coprocessor is normally enabled via the
16889 @code{-mconfig=} option.
16891 @item -mcop32
16892 @opindex mcop32
16893 Enables the 32-bit coprocessor's instructions.
16895 @item -mcop64
16896 @opindex mcop64
16897 Enables the 64-bit coprocessor's instructions.
16899 @item -mivc2
16900 @opindex mivc2
16901 Enables IVC2 scheduling.  IVC2 is a 64-bit VLIW coprocessor.
16903 @item -mdc
16904 @opindex mdc
16905 Causes constant variables to be placed in the @code{.near} section.
16907 @item -mdiv
16908 @opindex mdiv
16909 Enables the @code{div} and @code{divu} instructions.
16911 @item -meb
16912 @opindex meb
16913 Generate big-endian code.
16915 @item -mel
16916 @opindex mel
16917 Generate little-endian code.
16919 @item -mio-volatile
16920 @opindex mio-volatile
16921 Tells the compiler that any variable marked with the @code{io}
16922 attribute is to be considered volatile.
16924 @item -ml
16925 @opindex ml
16926 Causes variables to be assigned to the @code{.far} section by default.
16928 @item -mleadz
16929 @opindex mleadz
16930 Enables the @code{leadz} (leading zero) instruction.
16932 @item -mm
16933 @opindex mm
16934 Causes variables to be assigned to the @code{.near} section by default.
16936 @item -mminmax
16937 @opindex mminmax
16938 Enables the @code{min} and @code{max} instructions.
16940 @item -mmult
16941 @opindex mmult
16942 Enables the multiplication and multiply-accumulate instructions.
16944 @item -mno-opts
16945 @opindex mno-opts
16946 Disables all the optional instructions enabled by @code{-mall-opts}.
16948 @item -mrepeat
16949 @opindex mrepeat
16950 Enables the @code{repeat} and @code{erepeat} instructions, used for
16951 low-overhead looping.
16953 @item -ms
16954 @opindex ms
16955 Causes all variables to default to the @code{.tiny} section.  Note
16956 that there is a 65536-byte limit to this section.  Accesses to these
16957 variables use the @code{%gp} base register.
16959 @item -msatur
16960 @opindex msatur
16961 Enables the saturation instructions.  Note that the compiler does not
16962 currently generate these itself, but this option is included for
16963 compatibility with other tools, like @code{as}.
16965 @item -msdram
16966 @opindex msdram
16967 Link the SDRAM-based runtime instead of the default ROM-based runtime.
16969 @item -msim
16970 @opindex msim
16971 Link the simulator run-time libraries.
16973 @item -msimnovec
16974 @opindex msimnovec
16975 Link the simulator runtime libraries, excluding built-in support
16976 for reset and exception vectors and tables.
16978 @item -mtf
16979 @opindex mtf
16980 Causes all functions to default to the @code{.far} section.  Without
16981 this option, functions default to the @code{.near} section.
16983 @item -mtiny=@var{n}
16984 @opindex mtiny=
16985 Variables that are @var{n} bytes or smaller are allocated to the
16986 @code{.tiny} section.  These variables use the @code{$gp} base
16987 register.  The default for this option is 4, but note that there's a
16988 65536-byte limit to the @code{.tiny} section.
16990 @end table
16992 @node MicroBlaze Options
16993 @subsection MicroBlaze Options
16994 @cindex MicroBlaze Options
16996 @table @gcctabopt
16998 @item -msoft-float
16999 @opindex msoft-float
17000 Use software emulation for floating point (default).
17002 @item -mhard-float
17003 @opindex mhard-float
17004 Use hardware floating-point instructions.
17006 @item -mmemcpy
17007 @opindex mmemcpy
17008 Do not optimize block moves, use @code{memcpy}.
17010 @item -mno-clearbss
17011 @opindex mno-clearbss
17012 This option is deprecated.  Use @option{-fno-zero-initialized-in-bss} instead.
17014 @item -mcpu=@var{cpu-type}
17015 @opindex mcpu=
17016 Use features of, and schedule code for, the given CPU.
17017 Supported values are in the format @samp{v@var{X}.@var{YY}.@var{Z}},
17018 where @var{X} is a major version, @var{YY} is the minor version, and
17019 @var{Z} is compatibility code.  Example values are @samp{v3.00.a},
17020 @samp{v4.00.b}, @samp{v5.00.a}, @samp{v5.00.b}, @samp{v5.00.b}, @samp{v6.00.a}.
17022 @item -mxl-soft-mul
17023 @opindex mxl-soft-mul
17024 Use software multiply emulation (default).
17026 @item -mxl-soft-div
17027 @opindex mxl-soft-div
17028 Use software emulation for divides (default).
17030 @item -mxl-barrel-shift
17031 @opindex mxl-barrel-shift
17032 Use the hardware barrel shifter.
17034 @item -mxl-pattern-compare
17035 @opindex mxl-pattern-compare
17036 Use pattern compare instructions.
17038 @item -msmall-divides
17039 @opindex msmall-divides
17040 Use table lookup optimization for small signed integer divisions.
17042 @item -mxl-stack-check
17043 @opindex mxl-stack-check
17044 This option is deprecated.  Use @option{-fstack-check} instead.
17046 @item -mxl-gp-opt
17047 @opindex mxl-gp-opt
17048 Use GP-relative @code{.sdata}/@code{.sbss} sections.
17050 @item -mxl-multiply-high
17051 @opindex mxl-multiply-high
17052 Use multiply high instructions for high part of 32x32 multiply.
17054 @item -mxl-float-convert
17055 @opindex mxl-float-convert
17056 Use hardware floating-point conversion instructions.
17058 @item -mxl-float-sqrt
17059 @opindex mxl-float-sqrt
17060 Use hardware floating-point square root instruction.
17062 @item -mbig-endian
17063 @opindex mbig-endian
17064 Generate code for a big-endian target.
17066 @item -mlittle-endian
17067 @opindex mlittle-endian
17068 Generate code for a little-endian target.
17070 @item -mxl-reorder
17071 @opindex mxl-reorder
17072 Use reorder instructions (swap and byte reversed load/store).
17074 @item -mxl-mode-@var{app-model}
17075 Select application model @var{app-model}.  Valid models are
17076 @table @samp
17077 @item executable
17078 normal executable (default), uses startup code @file{crt0.o}.
17080 @item xmdstub
17081 for use with Xilinx Microprocessor Debugger (XMD) based
17082 software intrusive debug agent called xmdstub. This uses startup file
17083 @file{crt1.o} and sets the start address of the program to 0x800.
17085 @item bootstrap
17086 for applications that are loaded using a bootloader.
17087 This model uses startup file @file{crt2.o} which does not contain a processor
17088 reset vector handler. This is suitable for transferring control on a
17089 processor reset to the bootloader rather than the application.
17091 @item novectors
17092 for applications that do not require any of the
17093 MicroBlaze vectors. This option may be useful for applications running
17094 within a monitoring application. This model uses @file{crt3.o} as a startup file.
17095 @end table
17097 Option @option{-xl-mode-@var{app-model}} is a deprecated alias for
17098 @option{-mxl-mode-@var{app-model}}.
17100 @end table
17102 @node MIPS Options
17103 @subsection MIPS Options
17104 @cindex MIPS options
17106 @table @gcctabopt
17108 @item -EB
17109 @opindex EB
17110 Generate big-endian code.
17112 @item -EL
17113 @opindex EL
17114 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
17115 configurations.
17117 @item -march=@var{arch}
17118 @opindex march
17119 Generate code that runs on @var{arch}, which can be the name of a
17120 generic MIPS ISA, or the name of a particular processor.
17121 The ISA names are:
17122 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
17123 @samp{mips32}, @samp{mips32r2}, @samp{mips64} and @samp{mips64r2}.
17124 The processor names are:
17125 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
17126 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
17127 @samp{5kc}, @samp{5kf},
17128 @samp{20kc},
17129 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
17130 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
17131 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1}, @samp{34kn},
17132 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
17133 @samp{1004kc}, @samp{1004kf2_1}, @samp{1004kf1_1},
17134 @samp{loongson2e}, @samp{loongson2f}, @samp{loongson3a},
17135 @samp{m4k},
17136 @samp{m14k}, @samp{m14kc}, @samp{m14ke}, @samp{m14kec},
17137 @samp{octeon}, @samp{octeon+}, @samp{octeon2},
17138 @samp{orion},
17139 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
17140 @samp{r4600}, @samp{r4650}, @samp{r4700}, @samp{r6000}, @samp{r8000},
17141 @samp{rm7000}, @samp{rm9000},
17142 @samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
17143 @samp{sb1},
17144 @samp{sr71000},
17145 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
17146 @samp{vr5000}, @samp{vr5400}, @samp{vr5500},
17147 @samp{xlr} and @samp{xlp}.
17148 The special value @samp{from-abi} selects the
17149 most compatible architecture for the selected ABI (that is,
17150 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
17152 The native Linux/GNU toolchain also supports the value @samp{native},
17153 which selects the best architecture option for the host processor.
17154 @option{-march=native} has no effect if GCC does not recognize
17155 the processor.
17157 In processor names, a final @samp{000} can be abbreviated as @samp{k}
17158 (for example, @option{-march=r2k}).  Prefixes are optional, and
17159 @samp{vr} may be written @samp{r}.
17161 Names of the form @samp{@var{n}f2_1} refer to processors with
17162 FPUs clocked at half the rate of the core, names of the form
17163 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
17164 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
17165 processors with FPUs clocked a ratio of 3:2 with respect to the core.
17166 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
17167 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
17168 accepted as synonyms for @samp{@var{n}f1_1}.
17170 GCC defines two macros based on the value of this option.  The first
17171 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
17172 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
17173 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
17174 For example, @option{-march=r2000} sets @samp{_MIPS_ARCH}
17175 to @samp{"r2000"} and defines the macro @samp{_MIPS_ARCH_R2000}.
17177 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
17178 above.  In other words, it has the full prefix and does not
17179 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
17180 the macro names the resolved architecture (either @samp{"mips1"} or
17181 @samp{"mips3"}).  It names the default architecture when no
17182 @option{-march} option is given.
17184 @item -mtune=@var{arch}
17185 @opindex mtune
17186 Optimize for @var{arch}.  Among other things, this option controls
17187 the way instructions are scheduled, and the perceived cost of arithmetic
17188 operations.  The list of @var{arch} values is the same as for
17189 @option{-march}.
17191 When this option is not used, GCC optimizes for the processor
17192 specified by @option{-march}.  By using @option{-march} and
17193 @option{-mtune} together, it is possible to generate code that
17194 runs on a family of processors, but optimize the code for one
17195 particular member of that family.
17197 @option{-mtune} defines the macros @samp{_MIPS_TUNE} and
17198 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
17199 @option{-march} ones described above.
17201 @item -mips1
17202 @opindex mips1
17203 Equivalent to @option{-march=mips1}.
17205 @item -mips2
17206 @opindex mips2
17207 Equivalent to @option{-march=mips2}.
17209 @item -mips3
17210 @opindex mips3
17211 Equivalent to @option{-march=mips3}.
17213 @item -mips4
17214 @opindex mips4
17215 Equivalent to @option{-march=mips4}.
17217 @item -mips32
17218 @opindex mips32
17219 Equivalent to @option{-march=mips32}.
17221 @item -mips32r2
17222 @opindex mips32r2
17223 Equivalent to @option{-march=mips32r2}.
17225 @item -mips64
17226 @opindex mips64
17227 Equivalent to @option{-march=mips64}.
17229 @item -mips64r2
17230 @opindex mips64r2
17231 Equivalent to @option{-march=mips64r2}.
17233 @item -mips16
17234 @itemx -mno-mips16
17235 @opindex mips16
17236 @opindex mno-mips16
17237 Generate (do not generate) MIPS16 code.  If GCC is targeting a
17238 MIPS32 or MIPS64 architecture, it makes use of the MIPS16e ASE@.
17240 MIPS16 code generation can also be controlled on a per-function basis
17241 by means of @code{mips16} and @code{nomips16} attributes.
17242 @xref{Function Attributes}, for more information.
17244 @item -mflip-mips16
17245 @opindex mflip-mips16
17246 Generate MIPS16 code on alternating functions.  This option is provided
17247 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
17248 not intended for ordinary use in compiling user code.
17250 @item -minterlink-compressed
17251 @item -mno-interlink-compressed
17252 @opindex minterlink-compressed
17253 @opindex mno-interlink-compressed
17254 Require (do not require) that code using the standard (uncompressed) MIPS ISA
17255 be link-compatible with MIPS16 and microMIPS code, and vice versa.
17257 For example, code using the standard ISA encoding cannot jump directly
17258 to MIPS16 or microMIPS code; it must either use a call or an indirect jump.
17259 @option{-minterlink-compressed} therefore disables direct jumps unless GCC
17260 knows that the target of the jump is not compressed.
17262 @item -minterlink-mips16
17263 @itemx -mno-interlink-mips16
17264 @opindex minterlink-mips16
17265 @opindex mno-interlink-mips16
17266 Aliases of @option{-minterlink-compressed} and
17267 @option{-mno-interlink-compressed}.  These options predate the microMIPS ASE
17268 and are retained for backwards compatibility.
17270 @item -mabi=32
17271 @itemx -mabi=o64
17272 @itemx -mabi=n32
17273 @itemx -mabi=64
17274 @itemx -mabi=eabi
17275 @opindex mabi=32
17276 @opindex mabi=o64
17277 @opindex mabi=n32
17278 @opindex mabi=64
17279 @opindex mabi=eabi
17280 Generate code for the given ABI@.
17282 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
17283 generates 64-bit code when you select a 64-bit architecture, but you
17284 can use @option{-mgp32} to get 32-bit code instead.
17286 For information about the O64 ABI, see
17287 @uref{http://gcc.gnu.org/@/projects/@/mipso64-abi.html}.
17289 GCC supports a variant of the o32 ABI in which floating-point registers
17290 are 64 rather than 32 bits wide.  You can select this combination with
17291 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @code{mthc1}
17292 and @code{mfhc1} instructions and is therefore only supported for
17293 MIPS32R2 processors.
17295 The register assignments for arguments and return values remain the
17296 same, but each scalar value is passed in a single 64-bit register
17297 rather than a pair of 32-bit registers.  For example, scalar
17298 floating-point values are returned in @samp{$f0} only, not a
17299 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
17300 remains the same, but all 64 bits are saved.
17302 @item -mabicalls
17303 @itemx -mno-abicalls
17304 @opindex mabicalls
17305 @opindex mno-abicalls
17306 Generate (do not generate) code that is suitable for SVR4-style
17307 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
17308 systems.
17310 @item -mshared
17311 @itemx -mno-shared
17312 Generate (do not generate) code that is fully position-independent,
17313 and that can therefore be linked into shared libraries.  This option
17314 only affects @option{-mabicalls}.
17316 All @option{-mabicalls} code has traditionally been position-independent,
17317 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
17318 as an extension, the GNU toolchain allows executables to use absolute
17319 accesses for locally-binding symbols.  It can also use shorter GP
17320 initialization sequences and generate direct calls to locally-defined
17321 functions.  This mode is selected by @option{-mno-shared}.
17323 @option{-mno-shared} depends on binutils 2.16 or higher and generates
17324 objects that can only be linked by the GNU linker.  However, the option
17325 does not affect the ABI of the final executable; it only affects the ABI
17326 of relocatable objects.  Using @option{-mno-shared} generally makes
17327 executables both smaller and quicker.
17329 @option{-mshared} is the default.
17331 @item -mplt
17332 @itemx -mno-plt
17333 @opindex mplt
17334 @opindex mno-plt
17335 Assume (do not assume) that the static and dynamic linkers
17336 support PLTs and copy relocations.  This option only affects
17337 @option{-mno-shared -mabicalls}.  For the n64 ABI, this option
17338 has no effect without @option{-msym32}.
17340 You can make @option{-mplt} the default by configuring
17341 GCC with @option{--with-mips-plt}.  The default is
17342 @option{-mno-plt} otherwise.
17344 @item -mxgot
17345 @itemx -mno-xgot
17346 @opindex mxgot
17347 @opindex mno-xgot
17348 Lift (do not lift) the usual restrictions on the size of the global
17349 offset table.
17351 GCC normally uses a single instruction to load values from the GOT@.
17352 While this is relatively efficient, it only works if the GOT
17353 is smaller than about 64k.  Anything larger causes the linker
17354 to report an error such as:
17356 @cindex relocation truncated to fit (MIPS)
17357 @smallexample
17358 relocation truncated to fit: R_MIPS_GOT16 foobar
17359 @end smallexample
17361 If this happens, you should recompile your code with @option{-mxgot}.
17362 This works with very large GOTs, although the code is also
17363 less efficient, since it takes three instructions to fetch the
17364 value of a global symbol.
17366 Note that some linkers can create multiple GOTs.  If you have such a
17367 linker, you should only need to use @option{-mxgot} when a single object
17368 file accesses more than 64k's worth of GOT entries.  Very few do.
17370 These options have no effect unless GCC is generating position
17371 independent code.
17373 @item -mgp32
17374 @opindex mgp32
17375 Assume that general-purpose registers are 32 bits wide.
17377 @item -mgp64
17378 @opindex mgp64
17379 Assume that general-purpose registers are 64 bits wide.
17381 @item -mfp32
17382 @opindex mfp32
17383 Assume that floating-point registers are 32 bits wide.
17385 @item -mfp64
17386 @opindex mfp64
17387 Assume that floating-point registers are 64 bits wide.
17389 @item -mhard-float
17390 @opindex mhard-float
17391 Use floating-point coprocessor instructions.
17393 @item -msoft-float
17394 @opindex msoft-float
17395 Do not use floating-point coprocessor instructions.  Implement
17396 floating-point calculations using library calls instead.
17398 @item -mno-float
17399 @opindex mno-float
17400 Equivalent to @option{-msoft-float}, but additionally asserts that the
17401 program being compiled does not perform any floating-point operations.
17402 This option is presently supported only by some bare-metal MIPS
17403 configurations, where it may select a special set of libraries
17404 that lack all floating-point support (including, for example, the
17405 floating-point @code{printf} formats).  
17406 If code compiled with @code{-mno-float} accidentally contains
17407 floating-point operations, it is likely to suffer a link-time
17408 or run-time failure.
17410 @item -msingle-float
17411 @opindex msingle-float
17412 Assume that the floating-point coprocessor only supports single-precision
17413 operations.
17415 @item -mdouble-float
17416 @opindex mdouble-float
17417 Assume that the floating-point coprocessor supports double-precision
17418 operations.  This is the default.
17420 @item -mabs=2008
17421 @itemx -mabs=legacy
17422 @opindex mabs=2008
17423 @opindex mabs=legacy
17424 These options control the treatment of the special not-a-number (NaN)
17425 IEEE 754 floating-point data with the @code{abs.@i{fmt}} and
17426 @code{neg.@i{fmt}} machine instructions.
17428 By default or when the @option{-mabs=legacy} is used the legacy
17429 treatment is selected.  In this case these instructions are considered
17430 arithmetic and avoided where correct operation is required and the
17431 input operand might be a NaN.  A longer sequence of instructions that
17432 manipulate the sign bit of floating-point datum manually is used
17433 instead unless the @option{-ffinite-math-only} option has also been
17434 specified.
17436 The @option{-mabs=2008} option selects the IEEE 754-2008 treatment.  In
17437 this case these instructions are considered non-arithmetic and therefore
17438 operating correctly in all cases, including in particular where the
17439 input operand is a NaN.  These instructions are therefore always used
17440 for the respective operations.
17442 @item -mnan=2008
17443 @itemx -mnan=legacy
17444 @opindex mnan=2008
17445 @opindex mnan=legacy
17446 These options control the encoding of the special not-a-number (NaN)
17447 IEEE 754 floating-point data.
17449 The @option{-mnan=legacy} option selects the legacy encoding.  In this
17450 case quiet NaNs (qNaNs) are denoted by the first bit of their trailing
17451 significand field being 0, whereas signalling NaNs (sNaNs) are denoted
17452 by the first bit of their trailing significand field being 1.
17454 The @option{-mnan=2008} option selects the IEEE 754-2008 encoding.  In
17455 this case qNaNs are denoted by the first bit of their trailing
17456 significand field being 1, whereas sNaNs are denoted by the first bit of
17457 their trailing significand field being 0.
17459 The default is @option{-mnan=legacy} unless GCC has been configured with
17460 @option{--with-nan=2008}.
17462 @item -mllsc
17463 @itemx -mno-llsc
17464 @opindex mllsc
17465 @opindex mno-llsc
17466 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
17467 implement atomic memory built-in functions.  When neither option is
17468 specified, GCC uses the instructions if the target architecture
17469 supports them.
17471 @option{-mllsc} is useful if the runtime environment can emulate the
17472 instructions and @option{-mno-llsc} can be useful when compiling for
17473 nonstandard ISAs.  You can make either option the default by
17474 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
17475 respectively.  @option{--with-llsc} is the default for some
17476 configurations; see the installation documentation for details.
17478 @item -mdsp
17479 @itemx -mno-dsp
17480 @opindex mdsp
17481 @opindex mno-dsp
17482 Use (do not use) revision 1 of the MIPS DSP ASE@.
17483 @xref{MIPS DSP Built-in Functions}.  This option defines the
17484 preprocessor macro @samp{__mips_dsp}.  It also defines
17485 @samp{__mips_dsp_rev} to 1.
17487 @item -mdspr2
17488 @itemx -mno-dspr2
17489 @opindex mdspr2
17490 @opindex mno-dspr2
17491 Use (do not use) revision 2 of the MIPS DSP ASE@.
17492 @xref{MIPS DSP Built-in Functions}.  This option defines the
17493 preprocessor macros @samp{__mips_dsp} and @samp{__mips_dspr2}.
17494 It also defines @samp{__mips_dsp_rev} to 2.
17496 @item -msmartmips
17497 @itemx -mno-smartmips
17498 @opindex msmartmips
17499 @opindex mno-smartmips
17500 Use (do not use) the MIPS SmartMIPS ASE.
17502 @item -mpaired-single
17503 @itemx -mno-paired-single
17504 @opindex mpaired-single
17505 @opindex mno-paired-single
17506 Use (do not use) paired-single floating-point instructions.
17507 @xref{MIPS Paired-Single Support}.  This option requires
17508 hardware floating-point support to be enabled.
17510 @item -mdmx
17511 @itemx -mno-mdmx
17512 @opindex mdmx
17513 @opindex mno-mdmx
17514 Use (do not use) MIPS Digital Media Extension instructions.
17515 This option can only be used when generating 64-bit code and requires
17516 hardware floating-point support to be enabled.
17518 @item -mips3d
17519 @itemx -mno-mips3d
17520 @opindex mips3d
17521 @opindex mno-mips3d
17522 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
17523 The option @option{-mips3d} implies @option{-mpaired-single}.
17525 @item -mmicromips
17526 @itemx -mno-micromips
17527 @opindex mmicromips
17528 @opindex mno-mmicromips
17529 Generate (do not generate) microMIPS code.
17531 MicroMIPS code generation can also be controlled on a per-function basis
17532 by means of @code{micromips} and @code{nomicromips} attributes.
17533 @xref{Function Attributes}, for more information.
17535 @item -mmt
17536 @itemx -mno-mt
17537 @opindex mmt
17538 @opindex mno-mt
17539 Use (do not use) MT Multithreading instructions.
17541 @item -mmcu
17542 @itemx -mno-mcu
17543 @opindex mmcu
17544 @opindex mno-mcu
17545 Use (do not use) the MIPS MCU ASE instructions.
17547 @item -meva
17548 @itemx -mno-eva
17549 @opindex meva
17550 @opindex mno-eva
17551 Use (do not use) the MIPS Enhanced Virtual Addressing instructions.
17553 @item -mvirt
17554 @itemx -mno-virt
17555 @opindex mvirt
17556 @opindex mno-virt
17557 Use (do not use) the MIPS Virtualization Application Specific instructions.
17559 @item -mlong64
17560 @opindex mlong64
17561 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
17562 an explanation of the default and the way that the pointer size is
17563 determined.
17565 @item -mlong32
17566 @opindex mlong32
17567 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
17569 The default size of @code{int}s, @code{long}s and pointers depends on
17570 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
17571 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
17572 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
17573 or the same size as integer registers, whichever is smaller.
17575 @item -msym32
17576 @itemx -mno-sym32
17577 @opindex msym32
17578 @opindex mno-sym32
17579 Assume (do not assume) that all symbols have 32-bit values, regardless
17580 of the selected ABI@.  This option is useful in combination with
17581 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
17582 to generate shorter and faster references to symbolic addresses.
17584 @item -G @var{num}
17585 @opindex G
17586 Put definitions of externally-visible data in a small data section
17587 if that data is no bigger than @var{num} bytes.  GCC can then generate
17588 more efficient accesses to the data; see @option{-mgpopt} for details.
17590 The default @option{-G} option depends on the configuration.
17592 @item -mlocal-sdata
17593 @itemx -mno-local-sdata
17594 @opindex mlocal-sdata
17595 @opindex mno-local-sdata
17596 Extend (do not extend) the @option{-G} behavior to local data too,
17597 such as to static variables in C@.  @option{-mlocal-sdata} is the
17598 default for all configurations.
17600 If the linker complains that an application is using too much small data,
17601 you might want to try rebuilding the less performance-critical parts with
17602 @option{-mno-local-sdata}.  You might also want to build large
17603 libraries with @option{-mno-local-sdata}, so that the libraries leave
17604 more room for the main program.
17606 @item -mextern-sdata
17607 @itemx -mno-extern-sdata
17608 @opindex mextern-sdata
17609 @opindex mno-extern-sdata
17610 Assume (do not assume) that externally-defined data is in
17611 a small data section if the size of that data is within the @option{-G} limit.
17612 @option{-mextern-sdata} is the default for all configurations.
17614 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
17615 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
17616 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
17617 is placed in a small data section.  If @var{Var} is defined by another
17618 module, you must either compile that module with a high-enough
17619 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
17620 definition.  If @var{Var} is common, you must link the application
17621 with a high-enough @option{-G} setting.
17623 The easiest way of satisfying these restrictions is to compile
17624 and link every module with the same @option{-G} option.  However,
17625 you may wish to build a library that supports several different
17626 small data limits.  You can do this by compiling the library with
17627 the highest supported @option{-G} setting and additionally using
17628 @option{-mno-extern-sdata} to stop the library from making assumptions
17629 about externally-defined data.
17631 @item -mgpopt
17632 @itemx -mno-gpopt
17633 @opindex mgpopt
17634 @opindex mno-gpopt
17635 Use (do not use) GP-relative accesses for symbols that are known to be
17636 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
17637 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
17638 configurations.
17640 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
17641 might not hold the value of @code{_gp}.  For example, if the code is
17642 part of a library that might be used in a boot monitor, programs that
17643 call boot monitor routines pass an unknown value in @code{$gp}.
17644 (In such situations, the boot monitor itself is usually compiled
17645 with @option{-G0}.)
17647 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
17648 @option{-mno-extern-sdata}.
17650 @item -membedded-data
17651 @itemx -mno-embedded-data
17652 @opindex membedded-data
17653 @opindex mno-embedded-data
17654 Allocate variables to the read-only data section first if possible, then
17655 next in the small data section if possible, otherwise in data.  This gives
17656 slightly slower code than the default, but reduces the amount of RAM required
17657 when executing, and thus may be preferred for some embedded systems.
17659 @item -muninit-const-in-rodata
17660 @itemx -mno-uninit-const-in-rodata
17661 @opindex muninit-const-in-rodata
17662 @opindex mno-uninit-const-in-rodata
17663 Put uninitialized @code{const} variables in the read-only data section.
17664 This option is only meaningful in conjunction with @option{-membedded-data}.
17666 @item -mcode-readable=@var{setting}
17667 @opindex mcode-readable
17668 Specify whether GCC may generate code that reads from executable sections.
17669 There are three possible settings:
17671 @table @gcctabopt
17672 @item -mcode-readable=yes
17673 Instructions may freely access executable sections.  This is the
17674 default setting.
17676 @item -mcode-readable=pcrel
17677 MIPS16 PC-relative load instructions can access executable sections,
17678 but other instructions must not do so.  This option is useful on 4KSc
17679 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
17680 It is also useful on processors that can be configured to have a dual
17681 instruction/data SRAM interface and that, like the M4K, automatically
17682 redirect PC-relative loads to the instruction RAM.
17684 @item -mcode-readable=no
17685 Instructions must not access executable sections.  This option can be
17686 useful on targets that are configured to have a dual instruction/data
17687 SRAM interface but that (unlike the M4K) do not automatically redirect
17688 PC-relative loads to the instruction RAM.
17689 @end table
17691 @item -msplit-addresses
17692 @itemx -mno-split-addresses
17693 @opindex msplit-addresses
17694 @opindex mno-split-addresses
17695 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
17696 relocation operators.  This option has been superseded by
17697 @option{-mexplicit-relocs} but is retained for backwards compatibility.
17699 @item -mexplicit-relocs
17700 @itemx -mno-explicit-relocs
17701 @opindex mexplicit-relocs
17702 @opindex mno-explicit-relocs
17703 Use (do not use) assembler relocation operators when dealing with symbolic
17704 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
17705 is to use assembler macros instead.
17707 @option{-mexplicit-relocs} is the default if GCC was configured
17708 to use an assembler that supports relocation operators.
17710 @item -mcheck-zero-division
17711 @itemx -mno-check-zero-division
17712 @opindex mcheck-zero-division
17713 @opindex mno-check-zero-division
17714 Trap (do not trap) on integer division by zero.
17716 The default is @option{-mcheck-zero-division}.
17718 @item -mdivide-traps
17719 @itemx -mdivide-breaks
17720 @opindex mdivide-traps
17721 @opindex mdivide-breaks
17722 MIPS systems check for division by zero by generating either a
17723 conditional trap or a break instruction.  Using traps results in
17724 smaller code, but is only supported on MIPS II and later.  Also, some
17725 versions of the Linux kernel have a bug that prevents trap from
17726 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
17727 allow conditional traps on architectures that support them and
17728 @option{-mdivide-breaks} to force the use of breaks.
17730 The default is usually @option{-mdivide-traps}, but this can be
17731 overridden at configure time using @option{--with-divide=breaks}.
17732 Divide-by-zero checks can be completely disabled using
17733 @option{-mno-check-zero-division}.
17735 @item -mmemcpy
17736 @itemx -mno-memcpy
17737 @opindex mmemcpy
17738 @opindex mno-memcpy
17739 Force (do not force) the use of @code{memcpy()} for non-trivial block
17740 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
17741 most constant-sized copies.
17743 @item -mlong-calls
17744 @itemx -mno-long-calls
17745 @opindex mlong-calls
17746 @opindex mno-long-calls
17747 Disable (do not disable) use of the @code{jal} instruction.  Calling
17748 functions using @code{jal} is more efficient but requires the caller
17749 and callee to be in the same 256 megabyte segment.
17751 This option has no effect on abicalls code.  The default is
17752 @option{-mno-long-calls}.
17754 @item -mmad
17755 @itemx -mno-mad
17756 @opindex mmad
17757 @opindex mno-mad
17758 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
17759 instructions, as provided by the R4650 ISA@.
17761 @item -mimadd
17762 @itemx -mno-imadd
17763 @opindex mimadd
17764 @opindex mno-imadd
17765 Enable (disable) use of the @code{madd} and @code{msub} integer
17766 instructions.  The default is @option{-mimadd} on architectures
17767 that support @code{madd} and @code{msub} except for the 74k 
17768 architecture where it was found to generate slower code.
17770 @item -mfused-madd
17771 @itemx -mno-fused-madd
17772 @opindex mfused-madd
17773 @opindex mno-fused-madd
17774 Enable (disable) use of the floating-point multiply-accumulate
17775 instructions, when they are available.  The default is
17776 @option{-mfused-madd}.
17778 On the R8000 CPU when multiply-accumulate instructions are used,
17779 the intermediate product is calculated to infinite precision
17780 and is not subject to the FCSR Flush to Zero bit.  This may be
17781 undesirable in some circumstances.  On other processors the result
17782 is numerically identical to the equivalent computation using
17783 separate multiply, add, subtract and negate instructions.
17785 @item -nocpp
17786 @opindex nocpp
17787 Tell the MIPS assembler to not run its preprocessor over user
17788 assembler files (with a @samp{.s} suffix) when assembling them.
17790 @item -mfix-24k
17791 @item -mno-fix-24k
17792 @opindex mfix-24k
17793 @opindex mno-fix-24k
17794 Work around the 24K E48 (lost data on stores during refill) errata.
17795 The workarounds are implemented by the assembler rather than by GCC@.
17797 @item -mfix-r4000
17798 @itemx -mno-fix-r4000
17799 @opindex mfix-r4000
17800 @opindex mno-fix-r4000
17801 Work around certain R4000 CPU errata:
17802 @itemize @minus
17803 @item
17804 A double-word or a variable shift may give an incorrect result if executed
17805 immediately after starting an integer division.
17806 @item
17807 A double-word or a variable shift may give an incorrect result if executed
17808 while an integer multiplication is in progress.
17809 @item
17810 An integer division may give an incorrect result if started in a delay slot
17811 of a taken branch or a jump.
17812 @end itemize
17814 @item -mfix-r4400
17815 @itemx -mno-fix-r4400
17816 @opindex mfix-r4400
17817 @opindex mno-fix-r4400
17818 Work around certain R4400 CPU errata:
17819 @itemize @minus
17820 @item
17821 A double-word or a variable shift may give an incorrect result if executed
17822 immediately after starting an integer division.
17823 @end itemize
17825 @item -mfix-r10000
17826 @itemx -mno-fix-r10000
17827 @opindex mfix-r10000
17828 @opindex mno-fix-r10000
17829 Work around certain R10000 errata:
17830 @itemize @minus
17831 @item
17832 @code{ll}/@code{sc} sequences may not behave atomically on revisions
17833 prior to 3.0.  They may deadlock on revisions 2.6 and earlier.
17834 @end itemize
17836 This option can only be used if the target architecture supports
17837 branch-likely instructions.  @option{-mfix-r10000} is the default when
17838 @option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
17839 otherwise.
17841 @item -mfix-rm7000
17842 @itemx -mno-fix-rm7000
17843 @opindex mfix-rm7000
17844 Work around the RM7000 @code{dmult}/@code{dmultu} errata.  The
17845 workarounds are implemented by the assembler rather than by GCC@.
17847 @item -mfix-vr4120
17848 @itemx -mno-fix-vr4120
17849 @opindex mfix-vr4120
17850 Work around certain VR4120 errata:
17851 @itemize @minus
17852 @item
17853 @code{dmultu} does not always produce the correct result.
17854 @item
17855 @code{div} and @code{ddiv} do not always produce the correct result if one
17856 of the operands is negative.
17857 @end itemize
17858 The workarounds for the division errata rely on special functions in
17859 @file{libgcc.a}.  At present, these functions are only provided by
17860 the @code{mips64vr*-elf} configurations.
17862 Other VR4120 errata require a NOP to be inserted between certain pairs of
17863 instructions.  These errata are handled by the assembler, not by GCC itself.
17865 @item -mfix-vr4130
17866 @opindex mfix-vr4130
17867 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
17868 workarounds are implemented by the assembler rather than by GCC,
17869 although GCC avoids using @code{mflo} and @code{mfhi} if the
17870 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
17871 instructions are available instead.
17873 @item -mfix-sb1
17874 @itemx -mno-fix-sb1
17875 @opindex mfix-sb1
17876 Work around certain SB-1 CPU core errata.
17877 (This flag currently works around the SB-1 revision 2
17878 ``F1'' and ``F2'' floating-point errata.)
17880 @item -mr10k-cache-barrier=@var{setting}
17881 @opindex mr10k-cache-barrier
17882 Specify whether GCC should insert cache barriers to avoid the
17883 side-effects of speculation on R10K processors.
17885 In common with many processors, the R10K tries to predict the outcome
17886 of a conditional branch and speculatively executes instructions from
17887 the ``taken'' branch.  It later aborts these instructions if the
17888 predicted outcome is wrong.  However, on the R10K, even aborted
17889 instructions can have side effects.
17891 This problem only affects kernel stores and, depending on the system,
17892 kernel loads.  As an example, a speculatively-executed store may load
17893 the target memory into cache and mark the cache line as dirty, even if
17894 the store itself is later aborted.  If a DMA operation writes to the
17895 same area of memory before the ``dirty'' line is flushed, the cached
17896 data overwrites the DMA-ed data.  See the R10K processor manual
17897 for a full description, including other potential problems.
17899 One workaround is to insert cache barrier instructions before every memory
17900 access that might be speculatively executed and that might have side
17901 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
17902 controls GCC's implementation of this workaround.  It assumes that
17903 aborted accesses to any byte in the following regions does not have
17904 side effects:
17906 @enumerate
17907 @item
17908 the memory occupied by the current function's stack frame;
17910 @item
17911 the memory occupied by an incoming stack argument;
17913 @item
17914 the memory occupied by an object with a link-time-constant address.
17915 @end enumerate
17917 It is the kernel's responsibility to ensure that speculative
17918 accesses to these regions are indeed safe.
17920 If the input program contains a function declaration such as:
17922 @smallexample
17923 void foo (void);
17924 @end smallexample
17926 then the implementation of @code{foo} must allow @code{j foo} and
17927 @code{jal foo} to be executed speculatively.  GCC honors this
17928 restriction for functions it compiles itself.  It expects non-GCC
17929 functions (such as hand-written assembly code) to do the same.
17931 The option has three forms:
17933 @table @gcctabopt
17934 @item -mr10k-cache-barrier=load-store
17935 Insert a cache barrier before a load or store that might be
17936 speculatively executed and that might have side effects even
17937 if aborted.
17939 @item -mr10k-cache-barrier=store
17940 Insert a cache barrier before a store that might be speculatively
17941 executed and that might have side effects even if aborted.
17943 @item -mr10k-cache-barrier=none
17944 Disable the insertion of cache barriers.  This is the default setting.
17945 @end table
17947 @item -mflush-func=@var{func}
17948 @itemx -mno-flush-func
17949 @opindex mflush-func
17950 Specifies the function to call to flush the I and D caches, or to not
17951 call any such function.  If called, the function must take the same
17952 arguments as the common @code{_flush_func()}, that is, the address of the
17953 memory range for which the cache is being flushed, the size of the
17954 memory range, and the number 3 (to flush both caches).  The default
17955 depends on the target GCC was configured for, but commonly is either
17956 @samp{_flush_func} or @samp{__cpu_flush}.
17958 @item mbranch-cost=@var{num}
17959 @opindex mbranch-cost
17960 Set the cost of branches to roughly @var{num} ``simple'' instructions.
17961 This cost is only a heuristic and is not guaranteed to produce
17962 consistent results across releases.  A zero cost redundantly selects
17963 the default, which is based on the @option{-mtune} setting.
17965 @item -mbranch-likely
17966 @itemx -mno-branch-likely
17967 @opindex mbranch-likely
17968 @opindex mno-branch-likely
17969 Enable or disable use of Branch Likely instructions, regardless of the
17970 default for the selected architecture.  By default, Branch Likely
17971 instructions may be generated if they are supported by the selected
17972 architecture.  An exception is for the MIPS32 and MIPS64 architectures
17973 and processors that implement those architectures; for those, Branch
17974 Likely instructions are not be generated by default because the MIPS32
17975 and MIPS64 architectures specifically deprecate their use.
17977 @item -mfp-exceptions
17978 @itemx -mno-fp-exceptions
17979 @opindex mfp-exceptions
17980 Specifies whether FP exceptions are enabled.  This affects how
17981 FP instructions are scheduled for some processors.
17982 The default is that FP exceptions are
17983 enabled.
17985 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
17986 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
17987 FP pipe.
17989 @item -mvr4130-align
17990 @itemx -mno-vr4130-align
17991 @opindex mvr4130-align
17992 The VR4130 pipeline is two-way superscalar, but can only issue two
17993 instructions together if the first one is 8-byte aligned.  When this
17994 option is enabled, GCC aligns pairs of instructions that it
17995 thinks should execute in parallel.
17997 This option only has an effect when optimizing for the VR4130.
17998 It normally makes code faster, but at the expense of making it bigger.
17999 It is enabled by default at optimization level @option{-O3}.
18001 @item -msynci
18002 @itemx -mno-synci
18003 @opindex msynci
18004 Enable (disable) generation of @code{synci} instructions on
18005 architectures that support it.  The @code{synci} instructions (if
18006 enabled) are generated when @code{__builtin___clear_cache()} is
18007 compiled.
18009 This option defaults to @code{-mno-synci}, but the default can be
18010 overridden by configuring with @code{--with-synci}.
18012 When compiling code for single processor systems, it is generally safe
18013 to use @code{synci}.  However, on many multi-core (SMP) systems, it
18014 does not invalidate the instruction caches on all cores and may lead
18015 to undefined behavior.
18017 @item -mrelax-pic-calls
18018 @itemx -mno-relax-pic-calls
18019 @opindex mrelax-pic-calls
18020 Try to turn PIC calls that are normally dispatched via register
18021 @code{$25} into direct calls.  This is only possible if the linker can
18022 resolve the destination at link-time and if the destination is within
18023 range for a direct call.
18025 @option{-mrelax-pic-calls} is the default if GCC was configured to use
18026 an assembler and a linker that support the @code{.reloc} assembly
18027 directive and @code{-mexplicit-relocs} is in effect.  With
18028 @code{-mno-explicit-relocs}, this optimization can be performed by the
18029 assembler and the linker alone without help from the compiler.
18031 @item -mmcount-ra-address
18032 @itemx -mno-mcount-ra-address
18033 @opindex mmcount-ra-address
18034 @opindex mno-mcount-ra-address
18035 Emit (do not emit) code that allows @code{_mcount} to modify the
18036 calling function's return address.  When enabled, this option extends
18037 the usual @code{_mcount} interface with a new @var{ra-address}
18038 parameter, which has type @code{intptr_t *} and is passed in register
18039 @code{$12}.  @code{_mcount} can then modify the return address by
18040 doing both of the following:
18041 @itemize
18042 @item
18043 Returning the new address in register @code{$31}.
18044 @item
18045 Storing the new address in @code{*@var{ra-address}},
18046 if @var{ra-address} is nonnull.
18047 @end itemize
18049 The default is @option{-mno-mcount-ra-address}.
18051 @end table
18053 @node MMIX Options
18054 @subsection MMIX Options
18055 @cindex MMIX Options
18057 These options are defined for the MMIX:
18059 @table @gcctabopt
18060 @item -mlibfuncs
18061 @itemx -mno-libfuncs
18062 @opindex mlibfuncs
18063 @opindex mno-libfuncs
18064 Specify that intrinsic library functions are being compiled, passing all
18065 values in registers, no matter the size.
18067 @item -mepsilon
18068 @itemx -mno-epsilon
18069 @opindex mepsilon
18070 @opindex mno-epsilon
18071 Generate floating-point comparison instructions that compare with respect
18072 to the @code{rE} epsilon register.
18074 @item -mabi=mmixware
18075 @itemx -mabi=gnu
18076 @opindex mabi=mmixware
18077 @opindex mabi=gnu
18078 Generate code that passes function parameters and return values that (in
18079 the called function) are seen as registers @code{$0} and up, as opposed to
18080 the GNU ABI which uses global registers @code{$231} and up.
18082 @item -mzero-extend
18083 @itemx -mno-zero-extend
18084 @opindex mzero-extend
18085 @opindex mno-zero-extend
18086 When reading data from memory in sizes shorter than 64 bits, use (do not
18087 use) zero-extending load instructions by default, rather than
18088 sign-extending ones.
18090 @item -mknuthdiv
18091 @itemx -mno-knuthdiv
18092 @opindex mknuthdiv
18093 @opindex mno-knuthdiv
18094 Make the result of a division yielding a remainder have the same sign as
18095 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
18096 remainder follows the sign of the dividend.  Both methods are
18097 arithmetically valid, the latter being almost exclusively used.
18099 @item -mtoplevel-symbols
18100 @itemx -mno-toplevel-symbols
18101 @opindex mtoplevel-symbols
18102 @opindex mno-toplevel-symbols
18103 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
18104 code can be used with the @code{PREFIX} assembly directive.
18106 @item -melf
18107 @opindex melf
18108 Generate an executable in the ELF format, rather than the default
18109 @samp{mmo} format used by the @command{mmix} simulator.
18111 @item -mbranch-predict
18112 @itemx -mno-branch-predict
18113 @opindex mbranch-predict
18114 @opindex mno-branch-predict
18115 Use (do not use) the probable-branch instructions, when static branch
18116 prediction indicates a probable branch.
18118 @item -mbase-addresses
18119 @itemx -mno-base-addresses
18120 @opindex mbase-addresses
18121 @opindex mno-base-addresses
18122 Generate (do not generate) code that uses @emph{base addresses}.  Using a
18123 base address automatically generates a request (handled by the assembler
18124 and the linker) for a constant to be set up in a global register.  The
18125 register is used for one or more base address requests within the range 0
18126 to 255 from the value held in the register.  The generally leads to short
18127 and fast code, but the number of different data items that can be
18128 addressed is limited.  This means that a program that uses lots of static
18129 data may require @option{-mno-base-addresses}.
18131 @item -msingle-exit
18132 @itemx -mno-single-exit
18133 @opindex msingle-exit
18134 @opindex mno-single-exit
18135 Force (do not force) generated code to have a single exit point in each
18136 function.
18137 @end table
18139 @node MN10300 Options
18140 @subsection MN10300 Options
18141 @cindex MN10300 options
18143 These @option{-m} options are defined for Matsushita MN10300 architectures:
18145 @table @gcctabopt
18146 @item -mmult-bug
18147 @opindex mmult-bug
18148 Generate code to avoid bugs in the multiply instructions for the MN10300
18149 processors.  This is the default.
18151 @item -mno-mult-bug
18152 @opindex mno-mult-bug
18153 Do not generate code to avoid bugs in the multiply instructions for the
18154 MN10300 processors.
18156 @item -mam33
18157 @opindex mam33
18158 Generate code using features specific to the AM33 processor.
18160 @item -mno-am33
18161 @opindex mno-am33
18162 Do not generate code using features specific to the AM33 processor.  This
18163 is the default.
18165 @item -mam33-2
18166 @opindex mam33-2
18167 Generate code using features specific to the AM33/2.0 processor.
18169 @item -mam34
18170 @opindex mam34
18171 Generate code using features specific to the AM34 processor.
18173 @item -mtune=@var{cpu-type}
18174 @opindex mtune
18175 Use the timing characteristics of the indicated CPU type when
18176 scheduling instructions.  This does not change the targeted processor
18177 type.  The CPU type must be one of @samp{mn10300}, @samp{am33},
18178 @samp{am33-2} or @samp{am34}.
18180 @item -mreturn-pointer-on-d0
18181 @opindex mreturn-pointer-on-d0
18182 When generating a function that returns a pointer, return the pointer
18183 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
18184 only in @code{a0}, and attempts to call such functions without a prototype
18185 result in errors.  Note that this option is on by default; use
18186 @option{-mno-return-pointer-on-d0} to disable it.
18188 @item -mno-crt0
18189 @opindex mno-crt0
18190 Do not link in the C run-time initialization object file.
18192 @item -mrelax
18193 @opindex mrelax
18194 Indicate to the linker that it should perform a relaxation optimization pass
18195 to shorten branches, calls and absolute memory addresses.  This option only
18196 has an effect when used on the command line for the final link step.
18198 This option makes symbolic debugging impossible.
18200 @item -mliw
18201 @opindex mliw
18202 Allow the compiler to generate @emph{Long Instruction Word}
18203 instructions if the target is the @samp{AM33} or later.  This is the
18204 default.  This option defines the preprocessor macro @samp{__LIW__}.
18206 @item -mnoliw
18207 @opindex mnoliw
18208 Do not allow the compiler to generate @emph{Long Instruction Word}
18209 instructions.  This option defines the preprocessor macro
18210 @samp{__NO_LIW__}.
18212 @item -msetlb
18213 @opindex msetlb
18214 Allow the compiler to generate the @emph{SETLB} and @emph{Lcc}
18215 instructions if the target is the @samp{AM33} or later.  This is the
18216 default.  This option defines the preprocessor macro @samp{__SETLB__}.
18218 @item -mnosetlb
18219 @opindex mnosetlb
18220 Do not allow the compiler to generate @emph{SETLB} or @emph{Lcc}
18221 instructions.  This option defines the preprocessor macro
18222 @samp{__NO_SETLB__}.
18224 @end table
18226 @node Moxie Options
18227 @subsection Moxie Options
18228 @cindex Moxie Options
18230 @table @gcctabopt
18232 @item -meb
18233 @opindex meb
18234 Generate big-endian code.  This is the default for @samp{moxie-*-*}
18235 configurations.
18237 @item -mel
18238 @opindex mel
18239 Generate little-endian code.
18241 @item -mno-crt0
18242 @opindex mno-crt0
18243 Do not link in the C run-time initialization object file.
18245 @end table
18247 @node MSP430 Options
18248 @subsection MSP430 Options
18249 @cindex MSP430 Options
18251 These options are defined for the MSP430:
18253 @table @gcctabopt
18255 @item -masm-hex
18256 @opindex masm-hex
18257 Force assembly output to always use hex constants.  Normally such
18258 constants are signed decimals, but this option is available for
18259 testsuite and/or aesthetic purposes.
18261 @item -mmcu=
18262 @opindex mmcu=
18263 Select the MCU to target.  This is used to create a C preprocessor
18264 symbol based upon the MCU name, converted to upper case and pre- and
18265 post- fixed with @code{__}.  This in turn will be used by the
18266 @code{msp430.h} header file to select an MCU specific supplimentary
18267 header file.
18269 The option also sets the ISA to use.  If the MCU name is one that is
18270 known to only support the 430 ISA then that is selected, otherwise the
18271 430X ISA is selected.  A generic MCU name of @code{msp430} can also be
18272 used to select the 430 ISA.  Similarly the generic @code{msp430x} MCU
18273 name will select the 430X ISA.
18275 In addition an MCU specific linker script will be added to the linker
18276 command line.  The script's name is the name of the MCU with
18277 @code{.ld} appended.  Thus specifying @option{-mmcu=xxx} on the gcc
18278 command line will define the C preprocessor symbol @code{__XXX__} and
18279 cause the linker to search for a script called @file{xxx.ld}.
18281 This option is also passed on to the assembler.
18283 @item -mcpu=
18284 @opindex -mcpu=
18285 Specifies the ISA to use.  Accepted values are @code{msp430},
18286 @code{msp430x} and @code{msp430xv2}.  This option is deprecated.  The
18287 @option{-mmcu=} option should be used to select the ISA.
18289 @item -msim
18290 @opindex msim
18291 Link to the simulator runtime libraries and linker script.  Overrides
18292 any scripts that would be selected by the @option{-mmcu=} option.
18294 @item -mlarge
18295 @opindex mlarge
18296 Use large-model addressing (20-bit pointers, 32-bit @code{size_t}).
18298 @item -msmall
18299 @opindex msmall
18300 Use small-model addressing (16-bit pointers, 16-bit @code{size_t}).
18302 @item -mrelax
18303 @opindex mrelax
18304 This option is passed to the assembler and linker, and allows the
18305 linker to perform certain optimizations that cannot be done until
18306 the final link.
18308 @item mhwmult=
18309 @opindex mhwmult=
18310 Describes the type of hardware multiply supported by the target.
18311 Accepted values are @code{none} for no hardware multiply, @code{16bit}
18312 for the original 16-bit-only multiply supported by early MCUs.
18313 @code{32bit} for the 16/32-bit multiply supported by later MCUs and
18314 @code{f5series} for the 16/32-bit multiply supported by F5-series MCUs.
18315 A value of @code{auto} can also be given.  This tells GCC to deduce
18316 the hardware multiply support based upon the MCU name provided by the
18317 @option{-mmcu} option.  If no @option{-mmcu} option is specified then
18318 @code{32bit} hardware multiply support is assumed.  @code{auto} is the
18319 default setting.
18321 Hardware multiplies are normally performed by calling a library
18322 routine.  This saves space in the generated code.  When compiling at
18323 @code{-O3} or higher however the hardware multiplier is invoked
18324 inline.  This makes for bigger, but faster code.
18326 The hardware multiply routines disable interrupts whilst running and
18327 restore the previous interrupt state when they finish.  This makes
18328 them safe to use inside interrupt handlers as well as in normal code.
18330 @end table
18332 @node NDS32 Options
18333 @subsection NDS32 Options
18334 @cindex NDS32 Options
18336 These options are defined for NDS32 implementations:
18338 @table @gcctabopt
18340 @item -mbig-endian
18341 @opindex mbig-endian
18342 Generate code in big-endian mode.
18344 @item -mlittle-endian
18345 @opindex mlittle-endian
18346 Generate code in little-endian mode.
18348 @item -mreduced-regs
18349 @opindex mreduced-regs
18350 Use reduced-set registers for register allocation.
18352 @item -mfull-regs
18353 @opindex mfull-regs
18354 Use full-set registers for register allocation.
18356 @item -mcmov
18357 @opindex mcmov
18358 Generate conditional move instructions.
18360 @item -mno-cmov
18361 @opindex mno-cmov
18362 Do not generate conditional move instructions.
18364 @item -mperf-ext
18365 @opindex mperf-ext
18366 Generate performance extension instructions.
18368 @item -mno-perf-ext
18369 @opindex mno-perf-ext
18370 Do not generate performance extension instructions.
18372 @item -mv3push
18373 @opindex mv3push
18374 Generate v3 push25/pop25 instructions.
18376 @item -mno-v3push
18377 @opindex mno-v3push
18378 Do not generate v3 push25/pop25 instructions.
18380 @item -m16-bit
18381 @opindex m16-bit
18382 Generate 16-bit instructions.
18384 @item -mno-16-bit
18385 @opindex mno-16-bit
18386 Do not generate 16-bit instructions.
18388 @item -mgp-direct
18389 @opindex mgp-direct
18390 Generate GP base instructions directly.
18392 @item -mno-gp-direct
18393 @opindex mno-gp-direct
18394 Do no generate GP base instructions directly.
18396 @item -misr-vector-size=@var{num}
18397 @opindex misr-vector-size
18398 Specify the size of each interrupt vector, which must be 4 or 16.
18400 @item -mcache-block-size=@var{num}
18401 @opindex mcache-block-size
18402 Specify the size of each cache block,
18403 which must be a power of 2 between 4 and 512.
18405 @item -march=@var{arch}
18406 @opindex march
18407 Specify the name of the target architecture.
18409 @item -mforce-fp-as-gp
18410 @opindex mforce-fp-as-gp
18411 Prevent $fp being allocated during register allocation so that compiler
18412 is able to force performing fp-as-gp optimization.
18414 @item -mforbid-fp-as-gp
18415 @opindex mforbid-fp-as-gp
18416 Forbid using $fp to access static and global variables.
18417 This option strictly forbids fp-as-gp optimization
18418 regardless of @option{-mforce-fp-as-gp}.
18420 @item -mex9
18421 @opindex mex9
18422 Use special directives to guide linker doing ex9 optimization.
18424 @item -mctor-dtor
18425 @opindex mctor-dtor
18426 Enable constructor/destructor feature.
18428 @item -mrelax
18429 @opindex mrelax
18430 Guide linker to relax instructions.
18432 @end table
18434 @node Nios II Options
18435 @subsection Nios II Options
18436 @cindex Nios II options
18437 @cindex Altera Nios II options
18439 These are the options defined for the Altera Nios II processor.
18441 @table @gcctabopt
18443 @item -G @var{num}
18444 @opindex G
18445 @cindex smaller data references
18446 Put global and static objects less than or equal to @var{num} bytes
18447 into the small data or BSS sections instead of the normal data or BSS
18448 sections.  The default value of @var{num} is 8.
18450 @item -mgpopt
18451 @itemx -mno-gpopt
18452 @opindex mgpopt
18453 @opindex mno-gpopt
18454 Generate (do not generate) GP-relative accesses for objects in the
18455 small data or BSS sections.  The default is @option{-mgpopt} except
18456 when @option{-fpic} or @option{-fPIC} is specified to generate
18457 position-independent code.  Note that the Nios II ABI does not permit
18458 GP-relative accesses from shared libraries.
18460 You may need to specify @option{-mno-gpopt} explicitly when building
18461 programs that include large amounts of small data, including large
18462 GOT data sections.  In this case, the 16-bit offset for GP-relative
18463 addressing may not be large enough to allow access to the entire 
18464 small data section.
18466 @item -mel
18467 @itemx -meb
18468 @opindex mel
18469 @opindex meb
18470 Generate little-endian (default) or big-endian (experimental) code,
18471 respectively.
18473 @item -mbypass-cache
18474 @itemx -mno-bypass-cache
18475 @opindex mno-bypass-cache
18476 @opindex mbypass-cache
18477 Force all load and store instructions to always bypass cache by 
18478 using I/O variants of the instructions. The default is not to
18479 bypass the cache.
18481 @item -mno-cache-volatile 
18482 @itemx -mcache-volatile       
18483 @opindex mcache-volatile 
18484 @opindex mno-cache-volatile
18485 Volatile memory access bypass the cache using the I/O variants of 
18486 the load and store instructions. The default is not to bypass the cache.
18488 @item -mno-fast-sw-div
18489 @itemx -mfast-sw-div
18490 @opindex mno-fast-sw-div
18491 @opindex mfast-sw-div
18492 Do not use table-based fast divide for small numbers. The default 
18493 is to use the fast divide at @option{-O3} and above.
18495 @item -mno-hw-mul
18496 @itemx -mhw-mul
18497 @itemx -mno-hw-mulx
18498 @itemx -mhw-mulx
18499 @itemx -mno-hw-div
18500 @itemx -mhw-div
18501 @opindex mno-hw-mul
18502 @opindex mhw-mul
18503 @opindex mno-hw-mulx
18504 @opindex mhw-mulx
18505 @opindex mno-hw-div
18506 @opindex mhw-div
18507 Enable or disable emitting @code{mul}, @code{mulx} and @code{div} family of 
18508 instructions by the compiler. The default is to emit @code{mul}
18509 and not emit @code{div} and @code{mulx}.
18511 @item -mcustom-@var{insn}=@var{N}
18512 @itemx -mno-custom-@var{insn}
18513 @opindex mcustom-@var{insn}
18514 @opindex mno-custom-@var{insn}
18515 Each @option{-mcustom-@var{insn}=@var{N}} option enables use of a
18516 custom instruction with encoding @var{N} when generating code that uses 
18517 @var{insn}.  For example, @code{-mcustom-fadds=253} generates custom
18518 instruction 253 for single-precision floating-point add operations instead
18519 of the default behavior of using a library call.
18521 The following values of @var{insn} are supported.  Except as otherwise
18522 noted, floating-point operations are expected to be implemented with
18523 normal IEEE 754 semantics and correspond directly to the C operators or the
18524 equivalent GCC built-in functions (@pxref{Other Builtins}).
18526 Single-precision floating point:
18527 @table @asis
18529 @item @samp{fadds}, @samp{fsubs}, @samp{fdivs}, @samp{fmuls}
18530 Binary arithmetic operations.
18532 @item @samp{fnegs}
18533 Unary negation.
18535 @item @samp{fabss}
18536 Unary absolute value.
18538 @item @samp{fcmpeqs}, @samp{fcmpges}, @samp{fcmpgts}, @samp{fcmples}, @samp{fcmplts}, @samp{fcmpnes}
18539 Comparison operations.
18541 @item @samp{fmins}, @samp{fmaxs}
18542 Floating-point minimum and maximum.  These instructions are only
18543 generated if @option{-ffinite-math-only} is specified.
18545 @item @samp{fsqrts}
18546 Unary square root operation.
18548 @item @samp{fcoss}, @samp{fsins}, @samp{ftans}, @samp{fatans}, @samp{fexps}, @samp{flogs}
18549 Floating-point trigonometric and exponential functions.  These instructions
18550 are only generated if @option{-funsafe-math-optimizations} is also specified.
18552 @end table
18554 Double-precision floating point:
18555 @table @asis
18557 @item @samp{faddd}, @samp{fsubd}, @samp{fdivd}, @samp{fmuld}
18558 Binary arithmetic operations.
18560 @item @samp{fnegd}
18561 Unary negation.
18563 @item @samp{fabsd}
18564 Unary absolute value.
18566 @item @samp{fcmpeqd}, @samp{fcmpged}, @samp{fcmpgtd}, @samp{fcmpled}, @samp{fcmpltd}, @samp{fcmpned}
18567 Comparison operations.
18569 @item @samp{fmind}, @samp{fmaxd}
18570 Double-precision minimum and maximum.  These instructions are only
18571 generated if @option{-ffinite-math-only} is specified.
18573 @item @samp{fsqrtd}
18574 Unary square root operation.
18576 @item @samp{fcosd}, @samp{fsind}, @samp{ftand}, @samp{fatand}, @samp{fexpd}, @samp{flogd}
18577 Double-precision trigonometric and exponential functions.  These instructions
18578 are only generated if @option{-funsafe-math-optimizations} is also specified.
18580 @end table
18582 Conversions:
18583 @table @asis
18584 @item @samp{fextsd}
18585 Conversion from single precision to double precision.
18587 @item @samp{ftruncds}
18588 Conversion from double precision to single precision.
18590 @item @samp{fixsi}, @samp{fixsu}, @samp{fixdi}, @samp{fixdu}
18591 Conversion from floating point to signed or unsigned integer types, with
18592 truncation towards zero.
18594 @item @samp{round}
18595 Conversion from single-precision floating point to signed integer,
18596 rounding to the nearest integer and ties away from zero.
18597 This corresponds to the @code{__builtin_lroundf} function when
18598 @option{-fno-math-errno} is used.
18600 @item @samp{floatis}, @samp{floatus}, @samp{floatid}, @samp{floatud}
18601 Conversion from signed or unsigned integer types to floating-point types.
18603 @end table
18605 In addition, all of the following transfer instructions for internal
18606 registers X and Y must be provided to use any of the double-precision
18607 floating-point instructions.  Custom instructions taking two
18608 double-precision source operands expect the first operand in the
18609 64-bit register X.  The other operand (or only operand of a unary
18610 operation) is given to the custom arithmetic instruction with the
18611 least significant half in source register @var{src1} and the most
18612 significant half in @var{src2}.  A custom instruction that returns a
18613 double-precision result returns the most significant 32 bits in the
18614 destination register and the other half in 32-bit register Y.  
18615 GCC automatically generates the necessary code sequences to write
18616 register X and/or read register Y when double-precision floating-point
18617 instructions are used.
18619 @table @asis
18621 @item @samp{fwrx}
18622 Write @var{src1} into the least significant half of X and @var{src2} into
18623 the most significant half of X.
18625 @item @samp{fwry}
18626 Write @var{src1} into Y.
18628 @item @samp{frdxhi}, @samp{frdxlo}
18629 Read the most or least (respectively) significant half of X and store it in
18630 @var{dest}.
18632 @item @samp{frdy}
18633 Read the value of Y and store it into @var{dest}.
18634 @end table
18636 Note that you can gain more local control over generation of Nios II custom
18637 instructions by using the @code{target("custom-@var{insn}=@var{N}")}
18638 and @code{target("no-custom-@var{insn}")} function attributes
18639 (@pxref{Function Attributes})
18640 or pragmas (@pxref{Function Specific Option Pragmas}).
18642 @item -mcustom-fpu-cfg=@var{name}
18643 @opindex mcustom-fpu-cfg
18645 This option enables a predefined, named set of custom instruction encodings
18646 (see @option{-mcustom-@var{insn}} above).  
18647 Currently, the following sets are defined:
18649 @option{-mcustom-fpu-cfg=60-1} is equivalent to:
18650 @gccoptlist{-mcustom-fmuls=252 @gol
18651 -mcustom-fadds=253 @gol
18652 -mcustom-fsubs=254 @gol
18653 -fsingle-precision-constant}
18655 @option{-mcustom-fpu-cfg=60-2} is equivalent to:
18656 @gccoptlist{-mcustom-fmuls=252 @gol
18657 -mcustom-fadds=253 @gol
18658 -mcustom-fsubs=254 @gol
18659 -mcustom-fdivs=255 @gol
18660 -fsingle-precision-constant}
18662 @option{-mcustom-fpu-cfg=72-3} is equivalent to:
18663 @gccoptlist{-mcustom-floatus=243 @gol
18664 -mcustom-fixsi=244 @gol
18665 -mcustom-floatis=245 @gol
18666 -mcustom-fcmpgts=246 @gol
18667 -mcustom-fcmples=249 @gol
18668 -mcustom-fcmpeqs=250 @gol
18669 -mcustom-fcmpnes=251 @gol
18670 -mcustom-fmuls=252 @gol
18671 -mcustom-fadds=253 @gol
18672 -mcustom-fsubs=254 @gol
18673 -mcustom-fdivs=255 @gol
18674 -fsingle-precision-constant}
18676 Custom instruction assignments given by individual
18677 @option{-mcustom-@var{insn}=} options override those given by
18678 @option{-mcustom-fpu-cfg=}, regardless of the
18679 order of the options on the command line.
18681 Note that you can gain more local control over selection of a FPU
18682 configuration by using the @code{target("custom-fpu-cfg=@var{name}")}
18683 function attribute (@pxref{Function Attributes})
18684 or pragma (@pxref{Function Specific Option Pragmas}).
18686 @end table
18688 These additional @samp{-m} options are available for the Altera Nios II
18689 ELF (bare-metal) target:
18691 @table @gcctabopt
18693 @item -mhal
18694 @opindex mhal
18695 Link with HAL BSP.  This suppresses linking with the GCC-provided C runtime
18696 startup and termination code, and is typically used in conjunction with
18697 @option{-msys-crt0=} to specify the location of the alternate startup code
18698 provided by the HAL BSP.
18700 @item -msmallc
18701 @opindex msmallc
18702 Link with a limited version of the C library, @option{-lsmallc}, rather than
18703 Newlib.
18705 @item -msys-crt0=@var{startfile}
18706 @opindex msys-crt0
18707 @var{startfile} is the file name of the startfile (crt0) to use 
18708 when linking.  This option is only useful in conjunction with @option{-mhal}.
18710 @item -msys-lib=@var{systemlib}
18711 @opindex msys-lib
18712 @var{systemlib} is the library name of the library that provides
18713 low-level system calls required by the C library,
18714 e.g. @code{read} and @code{write}.
18715 This option is typically used to link with a library provided by a HAL BSP.
18717 @end table
18719 @node PDP-11 Options
18720 @subsection PDP-11 Options
18721 @cindex PDP-11 Options
18723 These options are defined for the PDP-11:
18725 @table @gcctabopt
18726 @item -mfpu
18727 @opindex mfpu
18728 Use hardware FPP floating point.  This is the default.  (FIS floating
18729 point on the PDP-11/40 is not supported.)
18731 @item -msoft-float
18732 @opindex msoft-float
18733 Do not use hardware floating point.
18735 @item -mac0
18736 @opindex mac0
18737 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
18739 @item -mno-ac0
18740 @opindex mno-ac0
18741 Return floating-point results in memory.  This is the default.
18743 @item -m40
18744 @opindex m40
18745 Generate code for a PDP-11/40.
18747 @item -m45
18748 @opindex m45
18749 Generate code for a PDP-11/45.  This is the default.
18751 @item -m10
18752 @opindex m10
18753 Generate code for a PDP-11/10.
18755 @item -mbcopy-builtin
18756 @opindex mbcopy-builtin
18757 Use inline @code{movmemhi} patterns for copying memory.  This is the
18758 default.
18760 @item -mbcopy
18761 @opindex mbcopy
18762 Do not use inline @code{movmemhi} patterns for copying memory.
18764 @item -mint16
18765 @itemx -mno-int32
18766 @opindex mint16
18767 @opindex mno-int32
18768 Use 16-bit @code{int}.  This is the default.
18770 @item -mint32
18771 @itemx -mno-int16
18772 @opindex mint32
18773 @opindex mno-int16
18774 Use 32-bit @code{int}.
18776 @item -mfloat64
18777 @itemx -mno-float32
18778 @opindex mfloat64
18779 @opindex mno-float32
18780 Use 64-bit @code{float}.  This is the default.
18782 @item -mfloat32
18783 @itemx -mno-float64
18784 @opindex mfloat32
18785 @opindex mno-float64
18786 Use 32-bit @code{float}.
18788 @item -mabshi
18789 @opindex mabshi
18790 Use @code{abshi2} pattern.  This is the default.
18792 @item -mno-abshi
18793 @opindex mno-abshi
18794 Do not use @code{abshi2} pattern.
18796 @item -mbranch-expensive
18797 @opindex mbranch-expensive
18798 Pretend that branches are expensive.  This is for experimenting with
18799 code generation only.
18801 @item -mbranch-cheap
18802 @opindex mbranch-cheap
18803 Do not pretend that branches are expensive.  This is the default.
18805 @item -munix-asm
18806 @opindex munix-asm
18807 Use Unix assembler syntax.  This is the default when configured for
18808 @samp{pdp11-*-bsd}.
18810 @item -mdec-asm
18811 @opindex mdec-asm
18812 Use DEC assembler syntax.  This is the default when configured for any
18813 PDP-11 target other than @samp{pdp11-*-bsd}.
18814 @end table
18816 @node picoChip Options
18817 @subsection picoChip Options
18818 @cindex picoChip options
18820 These @samp{-m} options are defined for picoChip implementations:
18822 @table @gcctabopt
18824 @item -mae=@var{ae_type}
18825 @opindex mcpu
18826 Set the instruction set, register set, and instruction scheduling
18827 parameters for array element type @var{ae_type}.  Supported values
18828 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
18830 @option{-mae=ANY} selects a completely generic AE type.  Code
18831 generated with this option runs on any of the other AE types.  The
18832 code is not as efficient as it would be if compiled for a specific
18833 AE type, and some types of operation (e.g., multiplication) do not
18834 work properly on all types of AE.
18836 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
18837 for compiled code, and is the default.
18839 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
18840 option may suffer from poor performance of byte (char) manipulation,
18841 since the DSP AE does not provide hardware support for byte load/stores.
18843 @item -msymbol-as-address
18844 Enable the compiler to directly use a symbol name as an address in a
18845 load/store instruction, without first loading it into a
18846 register.  Typically, the use of this option generates larger
18847 programs, which run faster than when the option isn't used.  However, the
18848 results vary from program to program, so it is left as a user option,
18849 rather than being permanently enabled.
18851 @item -mno-inefficient-warnings
18852 Disables warnings about the generation of inefficient code.  These
18853 warnings can be generated, for example, when compiling code that
18854 performs byte-level memory operations on the MAC AE type.  The MAC AE has
18855 no hardware support for byte-level memory operations, so all byte
18856 load/stores must be synthesized from word load/store operations.  This is
18857 inefficient and a warning is generated to indicate
18858 that you should rewrite the code to avoid byte operations, or to target
18859 an AE type that has the necessary hardware support.  This option disables
18860 these warnings.
18862 @end table
18864 @node PowerPC Options
18865 @subsection PowerPC Options
18866 @cindex PowerPC options
18868 These are listed under @xref{RS/6000 and PowerPC Options}.
18870 @node RL78 Options
18871 @subsection RL78 Options
18872 @cindex RL78 Options
18874 @table @gcctabopt
18876 @item -msim
18877 @opindex msim
18878 Links in additional target libraries to support operation within a
18879 simulator.
18881 @item -mmul=none
18882 @itemx -mmul=g13
18883 @itemx -mmul=rl78
18884 @opindex mmul
18885 Specifies the type of hardware multiplication support to be used.  The
18886 default is @code{none}, which uses software multiplication functions.
18887 The @code{g13} option is for the hardware multiply/divide peripheral
18888 only on the RL78/G13 targets.  The @code{rl78} option is for the
18889 standard hardware multiplication defined in the RL78 software manual.
18891 @end table
18893 @node RS/6000 and PowerPC Options
18894 @subsection IBM RS/6000 and PowerPC Options
18895 @cindex RS/6000 and PowerPC Options
18896 @cindex IBM RS/6000 and PowerPC Options
18898 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
18899 @table @gcctabopt
18900 @item -mpowerpc-gpopt
18901 @itemx -mno-powerpc-gpopt
18902 @itemx -mpowerpc-gfxopt
18903 @itemx -mno-powerpc-gfxopt
18904 @need 800
18905 @itemx -mpowerpc64
18906 @itemx -mno-powerpc64
18907 @itemx -mmfcrf
18908 @itemx -mno-mfcrf
18909 @itemx -mpopcntb
18910 @itemx -mno-popcntb
18911 @itemx -mpopcntd
18912 @itemx -mno-popcntd
18913 @itemx -mfprnd
18914 @itemx -mno-fprnd
18915 @need 800
18916 @itemx -mcmpb
18917 @itemx -mno-cmpb
18918 @itemx -mmfpgpr
18919 @itemx -mno-mfpgpr
18920 @itemx -mhard-dfp
18921 @itemx -mno-hard-dfp
18922 @opindex mpowerpc-gpopt
18923 @opindex mno-powerpc-gpopt
18924 @opindex mpowerpc-gfxopt
18925 @opindex mno-powerpc-gfxopt
18926 @opindex mpowerpc64
18927 @opindex mno-powerpc64
18928 @opindex mmfcrf
18929 @opindex mno-mfcrf
18930 @opindex mpopcntb
18931 @opindex mno-popcntb
18932 @opindex mpopcntd
18933 @opindex mno-popcntd
18934 @opindex mfprnd
18935 @opindex mno-fprnd
18936 @opindex mcmpb
18937 @opindex mno-cmpb
18938 @opindex mmfpgpr
18939 @opindex mno-mfpgpr
18940 @opindex mhard-dfp
18941 @opindex mno-hard-dfp
18942 You use these options to specify which instructions are available on the
18943 processor you are using.  The default value of these options is
18944 determined when configuring GCC@.  Specifying the
18945 @option{-mcpu=@var{cpu_type}} overrides the specification of these
18946 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
18947 rather than the options listed above.
18949 Specifying @option{-mpowerpc-gpopt} allows
18950 GCC to use the optional PowerPC architecture instructions in the
18951 General Purpose group, including floating-point square root.  Specifying
18952 @option{-mpowerpc-gfxopt} allows GCC to
18953 use the optional PowerPC architecture instructions in the Graphics
18954 group, including floating-point select.
18956 The @option{-mmfcrf} option allows GCC to generate the move from
18957 condition register field instruction implemented on the POWER4
18958 processor and other processors that support the PowerPC V2.01
18959 architecture.
18960 The @option{-mpopcntb} option allows GCC to generate the popcount and
18961 double-precision FP reciprocal estimate instruction implemented on the
18962 POWER5 processor and other processors that support the PowerPC V2.02
18963 architecture.
18964 The @option{-mpopcntd} option allows GCC to generate the popcount
18965 instruction implemented on the POWER7 processor and other processors
18966 that support the PowerPC V2.06 architecture.
18967 The @option{-mfprnd} option allows GCC to generate the FP round to
18968 integer instructions implemented on the POWER5+ processor and other
18969 processors that support the PowerPC V2.03 architecture.
18970 The @option{-mcmpb} option allows GCC to generate the compare bytes
18971 instruction implemented on the POWER6 processor and other processors
18972 that support the PowerPC V2.05 architecture.
18973 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
18974 general-purpose register instructions implemented on the POWER6X
18975 processor and other processors that support the extended PowerPC V2.05
18976 architecture.
18977 The @option{-mhard-dfp} option allows GCC to generate the decimal
18978 floating-point instructions implemented on some POWER processors.
18980 The @option{-mpowerpc64} option allows GCC to generate the additional
18981 64-bit instructions that are found in the full PowerPC64 architecture
18982 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
18983 @option{-mno-powerpc64}.
18985 @item -mcpu=@var{cpu_type}
18986 @opindex mcpu
18987 Set architecture type, register usage, and
18988 instruction scheduling parameters for machine type @var{cpu_type}.
18989 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
18990 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
18991 @samp{476}, @samp{476fp}, @samp{505}, @samp{601}, @samp{602}, @samp{603},
18992 @samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{630}, @samp{740},
18993 @samp{7400}, @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
18994 @samp{860}, @samp{970}, @samp{8540}, @samp{a2}, @samp{e300c2},
18995 @samp{e300c3}, @samp{e500mc}, @samp{e500mc64}, @samp{e5500},
18996 @samp{e6500}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5},
18997 @samp{titan}, @samp{power3}, @samp{power4}, @samp{power5}, @samp{power5+},
18998 @samp{power6}, @samp{power6x}, @samp{power7}, @samp{power8}, @samp{powerpc},
18999 @samp{powerpc64}, and @samp{rs64}.
19001 @option{-mcpu=powerpc}, and @option{-mcpu=powerpc64} specify pure 32-bit
19002 PowerPC and 64-bit PowerPC architecture machine
19003 types, with an appropriate, generic processor model assumed for
19004 scheduling purposes.
19006 The other options specify a specific processor.  Code generated under
19007 those options runs best on that processor, and may not run at all on
19008 others.
19010 The @option{-mcpu} options automatically enable or disable the
19011 following options:
19013 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
19014 -mpopcntb -mpopcntd  -mpowerpc64 @gol
19015 -mpowerpc-gpopt  -mpowerpc-gfxopt  -msingle-float -mdouble-float @gol
19016 -msimple-fpu -mstring  -mmulhw  -mdlmzb  -mmfpgpr -mvsx @gol
19017 -mcrypto -mdirect-move -mpower8-fusion -mpower8-vector @gol
19018 -mquad-memory -mquad-memory-atomic}
19020 The particular options set for any particular CPU varies between
19021 compiler versions, depending on what setting seems to produce optimal
19022 code for that CPU; it doesn't necessarily reflect the actual hardware's
19023 capabilities.  If you wish to set an individual option to a particular
19024 value, you may specify it after the @option{-mcpu} option, like
19025 @option{-mcpu=970 -mno-altivec}.
19027 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
19028 not enabled or disabled by the @option{-mcpu} option at present because
19029 AIX does not have full support for these options.  You may still
19030 enable or disable them individually if you're sure it'll work in your
19031 environment.
19033 @item -mtune=@var{cpu_type}
19034 @opindex mtune
19035 Set the instruction scheduling parameters for machine type
19036 @var{cpu_type}, but do not set the architecture type or register usage,
19037 as @option{-mcpu=@var{cpu_type}} does.  The same
19038 values for @var{cpu_type} are used for @option{-mtune} as for
19039 @option{-mcpu}.  If both are specified, the code generated uses the
19040 architecture and registers set by @option{-mcpu}, but the
19041 scheduling parameters set by @option{-mtune}.
19043 @item -mcmodel=small
19044 @opindex mcmodel=small
19045 Generate PowerPC64 code for the small model: The TOC is limited to
19046 64k.
19048 @item -mcmodel=medium
19049 @opindex mcmodel=medium
19050 Generate PowerPC64 code for the medium model: The TOC and other static
19051 data may be up to a total of 4G in size.
19053 @item -mcmodel=large
19054 @opindex mcmodel=large
19055 Generate PowerPC64 code for the large model: The TOC may be up to 4G
19056 in size.  Other data and code is only limited by the 64-bit address
19057 space.
19059 @item -maltivec
19060 @itemx -mno-altivec
19061 @opindex maltivec
19062 @opindex mno-altivec
19063 Generate code that uses (does not use) AltiVec instructions, and also
19064 enable the use of built-in functions that allow more direct access to
19065 the AltiVec instruction set.  You may also need to set
19066 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
19067 enhancements.
19069 When @option{-maltivec} is used, rather than @option{-maltivec=le} or
19070 @option{-maltivec=be}, the element order for Altivec intrinsics such
19071 as @code{vec_splat}, @code{vec_extract}, and @code{vec_insert} will
19072 match array element order corresponding to the endianness of the
19073 target.  That is, element zero identifies the leftmost element in a
19074 vector register when targeting a big-endian platform, and identifies
19075 the rightmost element in a vector register when targeting a
19076 little-endian platform.
19078 @item -maltivec=be
19079 @opindex maltivec=be
19080 Generate Altivec instructions using big-endian element order,
19081 regardless of whether the target is big- or little-endian.  This is
19082 the default when targeting a big-endian platform.
19084 The element order is used to interpret element numbers in Altivec
19085 intrinsics such as @code{vec_splat}, @code{vec_extract}, and
19086 @code{vec_insert}.  By default, these will match array element order
19087 corresponding to the endianness for the target.
19089 @item -maltivec=le
19090 @opindex maltivec=le
19091 Generate Altivec instructions using little-endian element order,
19092 regardless of whether the target is big- or little-endian.  This is
19093 the default when targeting a little-endian platform.  This option is
19094 currently ignored when targeting a big-endian platform.
19096 The element order is used to interpret element numbers in Altivec
19097 intrinsics such as @code{vec_splat}, @code{vec_extract}, and
19098 @code{vec_insert}.  By default, these will match array element order
19099 corresponding to the endianness for the target.
19101 @item -mvrsave
19102 @itemx -mno-vrsave
19103 @opindex mvrsave
19104 @opindex mno-vrsave
19105 Generate VRSAVE instructions when generating AltiVec code.
19107 @item -mgen-cell-microcode
19108 @opindex mgen-cell-microcode
19109 Generate Cell microcode instructions.
19111 @item -mwarn-cell-microcode
19112 @opindex mwarn-cell-microcode
19113 Warn when a Cell microcode instruction is emitted.  An example
19114 of a Cell microcode instruction is a variable shift.
19116 @item -msecure-plt
19117 @opindex msecure-plt
19118 Generate code that allows @command{ld} and @command{ld.so}
19119 to build executables and shared
19120 libraries with non-executable @code{.plt} and @code{.got} sections.
19121 This is a PowerPC
19122 32-bit SYSV ABI option.
19124 @item -mbss-plt
19125 @opindex mbss-plt
19126 Generate code that uses a BSS @code{.plt} section that @command{ld.so}
19127 fills in, and
19128 requires @code{.plt} and @code{.got}
19129 sections that are both writable and executable.
19130 This is a PowerPC 32-bit SYSV ABI option.
19132 @item -misel
19133 @itemx -mno-isel
19134 @opindex misel
19135 @opindex mno-isel
19136 This switch enables or disables the generation of ISEL instructions.
19138 @item -misel=@var{yes/no}
19139 This switch has been deprecated.  Use @option{-misel} and
19140 @option{-mno-isel} instead.
19142 @item -mspe
19143 @itemx -mno-spe
19144 @opindex mspe
19145 @opindex mno-spe
19146 This switch enables or disables the generation of SPE simd
19147 instructions.
19149 @item -mpaired
19150 @itemx -mno-paired
19151 @opindex mpaired
19152 @opindex mno-paired
19153 This switch enables or disables the generation of PAIRED simd
19154 instructions.
19156 @item -mspe=@var{yes/no}
19157 This option has been deprecated.  Use @option{-mspe} and
19158 @option{-mno-spe} instead.
19160 @item -mvsx
19161 @itemx -mno-vsx
19162 @opindex mvsx
19163 @opindex mno-vsx
19164 Generate code that uses (does not use) vector/scalar (VSX)
19165 instructions, and also enable the use of built-in functions that allow
19166 more direct access to the VSX instruction set.
19168 @item -mcrypto
19169 @itemx -mno-crypto
19170 @opindex mcrypto
19171 @opindex mno-crypto
19172 Enable the use (disable) of the built-in functions that allow direct
19173 access to the cryptographic instructions that were added in version
19174 2.07 of the PowerPC ISA.
19176 @item -mdirect-move
19177 @itemx -mno-direct-move
19178 @opindex mdirect-move
19179 @opindex mno-direct-move
19180 Generate code that uses (does not use) the instructions to move data
19181 between the general purpose registers and the vector/scalar (VSX)
19182 registers that were added in version 2.07 of the PowerPC ISA.
19184 @item -mpower8-fusion
19185 @itemx -mno-power8-fusion
19186 @opindex mpower8-fusion
19187 @opindex mno-power8-fusion
19188 Generate code that keeps (does not keeps) some integer operations
19189 adjacent so that the instructions can be fused together on power8 and
19190 later processors.
19192 @item -mpower8-vector
19193 @itemx -mno-power8-vector
19194 @opindex mpower8-vector
19195 @opindex mno-power8-vector
19196 Generate code that uses (does not use) the vector and scalar
19197 instructions that were added in version 2.07 of the PowerPC ISA.  Also
19198 enable the use of built-in functions that allow more direct access to
19199 the vector instructions.
19201 @item -mquad-memory
19202 @itemx -mno-quad-memory
19203 @opindex mquad-memory
19204 @opindex mno-quad-memory
19205 Generate code that uses (does not use) the non-atomic quad word memory
19206 instructions.  The @option{-mquad-memory} option requires use of
19207 64-bit mode.
19209 @item -mquad-memory-atomic
19210 @itemx -mno-quad-memory-atomic
19211 @opindex mquad-memory-atomic
19212 @opindex mno-quad-memory-atomic
19213 Generate code that uses (does not use) the atomic quad word memory
19214 instructions.  The @option{-mquad-memory-atomic} option requires use of
19215 64-bit mode.
19217 @item -mfloat-gprs=@var{yes/single/double/no}
19218 @itemx -mfloat-gprs
19219 @opindex mfloat-gprs
19220 This switch enables or disables the generation of floating-point
19221 operations on the general-purpose registers for architectures that
19222 support it.
19224 The argument @var{yes} or @var{single} enables the use of
19225 single-precision floating-point operations.
19227 The argument @var{double} enables the use of single and
19228 double-precision floating-point operations.
19230 The argument @var{no} disables floating-point operations on the
19231 general-purpose registers.
19233 This option is currently only available on the MPC854x.
19235 @item -m32
19236 @itemx -m64
19237 @opindex m32
19238 @opindex m64
19239 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
19240 targets (including GNU/Linux).  The 32-bit environment sets int, long
19241 and pointer to 32 bits and generates code that runs on any PowerPC
19242 variant.  The 64-bit environment sets int to 32 bits and long and
19243 pointer to 64 bits, and generates code for PowerPC64, as for
19244 @option{-mpowerpc64}.
19246 @item -mfull-toc
19247 @itemx -mno-fp-in-toc
19248 @itemx -mno-sum-in-toc
19249 @itemx -mminimal-toc
19250 @opindex mfull-toc
19251 @opindex mno-fp-in-toc
19252 @opindex mno-sum-in-toc
19253 @opindex mminimal-toc
19254 Modify generation of the TOC (Table Of Contents), which is created for
19255 every executable file.  The @option{-mfull-toc} option is selected by
19256 default.  In that case, GCC allocates at least one TOC entry for
19257 each unique non-automatic variable reference in your program.  GCC
19258 also places floating-point constants in the TOC@.  However, only
19259 16,384 entries are available in the TOC@.
19261 If you receive a linker error message that saying you have overflowed
19262 the available TOC space, you can reduce the amount of TOC space used
19263 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
19264 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
19265 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
19266 generate code to calculate the sum of an address and a constant at
19267 run time instead of putting that sum into the TOC@.  You may specify one
19268 or both of these options.  Each causes GCC to produce very slightly
19269 slower and larger code at the expense of conserving TOC space.
19271 If you still run out of space in the TOC even when you specify both of
19272 these options, specify @option{-mminimal-toc} instead.  This option causes
19273 GCC to make only one TOC entry for every file.  When you specify this
19274 option, GCC produces code that is slower and larger but which
19275 uses extremely little TOC space.  You may wish to use this option
19276 only on files that contain less frequently-executed code.
19278 @item -maix64
19279 @itemx -maix32
19280 @opindex maix64
19281 @opindex maix32
19282 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
19283 @code{long} type, and the infrastructure needed to support them.
19284 Specifying @option{-maix64} implies @option{-mpowerpc64},
19285 while @option{-maix32} disables the 64-bit ABI and
19286 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
19288 @item -mxl-compat
19289 @itemx -mno-xl-compat
19290 @opindex mxl-compat
19291 @opindex mno-xl-compat
19292 Produce code that conforms more closely to IBM XL compiler semantics
19293 when using AIX-compatible ABI@.  Pass floating-point arguments to
19294 prototyped functions beyond the register save area (RSA) on the stack
19295 in addition to argument FPRs.  Do not assume that most significant
19296 double in 128-bit long double value is properly rounded when comparing
19297 values and converting to double.  Use XL symbol names for long double
19298 support routines.
19300 The AIX calling convention was extended but not initially documented to
19301 handle an obscure K&R C case of calling a function that takes the
19302 address of its arguments with fewer arguments than declared.  IBM XL
19303 compilers access floating-point arguments that do not fit in the
19304 RSA from the stack when a subroutine is compiled without
19305 optimization.  Because always storing floating-point arguments on the
19306 stack is inefficient and rarely needed, this option is not enabled by
19307 default and only is necessary when calling subroutines compiled by IBM
19308 XL compilers without optimization.
19310 @item -mpe
19311 @opindex mpe
19312 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
19313 application written to use message passing with special startup code to
19314 enable the application to run.  The system must have PE installed in the
19315 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
19316 must be overridden with the @option{-specs=} option to specify the
19317 appropriate directory location.  The Parallel Environment does not
19318 support threads, so the @option{-mpe} option and the @option{-pthread}
19319 option are incompatible.
19321 @item -malign-natural
19322 @itemx -malign-power
19323 @opindex malign-natural
19324 @opindex malign-power
19325 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
19326 @option{-malign-natural} overrides the ABI-defined alignment of larger
19327 types, such as floating-point doubles, on their natural size-based boundary.
19328 The option @option{-malign-power} instructs GCC to follow the ABI-specified
19329 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
19331 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
19332 is not supported.
19334 @item -msoft-float
19335 @itemx -mhard-float
19336 @opindex msoft-float
19337 @opindex mhard-float
19338 Generate code that does not use (uses) the floating-point register set.
19339 Software floating-point emulation is provided if you use the
19340 @option{-msoft-float} option, and pass the option to GCC when linking.
19342 @item -msingle-float
19343 @itemx -mdouble-float
19344 @opindex msingle-float
19345 @opindex mdouble-float
19346 Generate code for single- or double-precision floating-point operations.
19347 @option{-mdouble-float} implies @option{-msingle-float}.
19349 @item -msimple-fpu
19350 @opindex msimple-fpu
19351 Do not generate @code{sqrt} and @code{div} instructions for hardware
19352 floating-point unit.
19354 @item -mfpu=@var{name}
19355 @opindex mfpu
19356 Specify type of floating-point unit.  Valid values for @var{name} are
19357 @samp{sp_lite} (equivalent to @option{-msingle-float -msimple-fpu}),
19358 @samp{dp_lite} (equivalent to @option{-mdouble-float -msimple-fpu}),
19359 @samp{sp_full} (equivalent to @option{-msingle-float}),
19360 and @samp{dp_full} (equivalent to @option{-mdouble-float}).
19362 @item -mxilinx-fpu
19363 @opindex mxilinx-fpu
19364 Perform optimizations for the floating-point unit on Xilinx PPC 405/440.
19366 @item -mmultiple
19367 @itemx -mno-multiple
19368 @opindex mmultiple
19369 @opindex mno-multiple
19370 Generate code that uses (does not use) the load multiple word
19371 instructions and the store multiple word instructions.  These
19372 instructions are generated by default on POWER systems, and not
19373 generated on PowerPC systems.  Do not use @option{-mmultiple} on little-endian
19374 PowerPC systems, since those instructions do not work when the
19375 processor is in little-endian mode.  The exceptions are PPC740 and
19376 PPC750 which permit these instructions in little-endian mode.
19378 @item -mstring
19379 @itemx -mno-string
19380 @opindex mstring
19381 @opindex mno-string
19382 Generate code that uses (does not use) the load string instructions
19383 and the store string word instructions to save multiple registers and
19384 do small block moves.  These instructions are generated by default on
19385 POWER systems, and not generated on PowerPC systems.  Do not use
19386 @option{-mstring} on little-endian PowerPC systems, since those
19387 instructions do not work when the processor is in little-endian mode.
19388 The exceptions are PPC740 and PPC750 which permit these instructions
19389 in little-endian mode.
19391 @item -mupdate
19392 @itemx -mno-update
19393 @opindex mupdate
19394 @opindex mno-update
19395 Generate code that uses (does not use) the load or store instructions
19396 that update the base register to the address of the calculated memory
19397 location.  These instructions are generated by default.  If you use
19398 @option{-mno-update}, there is a small window between the time that the
19399 stack pointer is updated and the address of the previous frame is
19400 stored, which means code that walks the stack frame across interrupts or
19401 signals may get corrupted data.
19403 @item -mavoid-indexed-addresses
19404 @itemx -mno-avoid-indexed-addresses
19405 @opindex mavoid-indexed-addresses
19406 @opindex mno-avoid-indexed-addresses
19407 Generate code that tries to avoid (not avoid) the use of indexed load
19408 or store instructions. These instructions can incur a performance
19409 penalty on Power6 processors in certain situations, such as when
19410 stepping through large arrays that cross a 16M boundary.  This option
19411 is enabled by default when targeting Power6 and disabled otherwise.
19413 @item -mfused-madd
19414 @itemx -mno-fused-madd
19415 @opindex mfused-madd
19416 @opindex mno-fused-madd
19417 Generate code that uses (does not use) the floating-point multiply and
19418 accumulate instructions.  These instructions are generated by default
19419 if hardware floating point is used.  The machine-dependent
19420 @option{-mfused-madd} option is now mapped to the machine-independent
19421 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
19422 mapped to @option{-ffp-contract=off}.
19424 @item -mmulhw
19425 @itemx -mno-mulhw
19426 @opindex mmulhw
19427 @opindex mno-mulhw
19428 Generate code that uses (does not use) the half-word multiply and
19429 multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors.
19430 These instructions are generated by default when targeting those
19431 processors.
19433 @item -mdlmzb
19434 @itemx -mno-dlmzb
19435 @opindex mdlmzb
19436 @opindex mno-dlmzb
19437 Generate code that uses (does not use) the string-search @samp{dlmzb}
19438 instruction on the IBM 405, 440, 464 and 476 processors.  This instruction is
19439 generated by default when targeting those processors.
19441 @item -mno-bit-align
19442 @itemx -mbit-align
19443 @opindex mno-bit-align
19444 @opindex mbit-align
19445 On System V.4 and embedded PowerPC systems do not (do) force structures
19446 and unions that contain bit-fields to be aligned to the base type of the
19447 bit-field.
19449 For example, by default a structure containing nothing but 8
19450 @code{unsigned} bit-fields of length 1 is aligned to a 4-byte
19451 boundary and has a size of 4 bytes.  By using @option{-mno-bit-align},
19452 the structure is aligned to a 1-byte boundary and is 1 byte in
19453 size.
19455 @item -mno-strict-align
19456 @itemx -mstrict-align
19457 @opindex mno-strict-align
19458 @opindex mstrict-align
19459 On System V.4 and embedded PowerPC systems do not (do) assume that
19460 unaligned memory references are handled by the system.
19462 @item -mrelocatable
19463 @itemx -mno-relocatable
19464 @opindex mrelocatable
19465 @opindex mno-relocatable
19466 Generate code that allows (does not allow) a static executable to be
19467 relocated to a different address at run time.  A simple embedded
19468 PowerPC system loader should relocate the entire contents of
19469 @code{.got2} and 4-byte locations listed in the @code{.fixup} section,
19470 a table of 32-bit addresses generated by this option.  For this to
19471 work, all objects linked together must be compiled with
19472 @option{-mrelocatable} or @option{-mrelocatable-lib}.
19473 @option{-mrelocatable} code aligns the stack to an 8-byte boundary.
19475 @item -mrelocatable-lib
19476 @itemx -mno-relocatable-lib
19477 @opindex mrelocatable-lib
19478 @opindex mno-relocatable-lib
19479 Like @option{-mrelocatable}, @option{-mrelocatable-lib} generates a
19480 @code{.fixup} section to allow static executables to be relocated at
19481 run time, but @option{-mrelocatable-lib} does not use the smaller stack
19482 alignment of @option{-mrelocatable}.  Objects compiled with
19483 @option{-mrelocatable-lib} may be linked with objects compiled with
19484 any combination of the @option{-mrelocatable} options.
19486 @item -mno-toc
19487 @itemx -mtoc
19488 @opindex mno-toc
19489 @opindex mtoc
19490 On System V.4 and embedded PowerPC systems do not (do) assume that
19491 register 2 contains a pointer to a global area pointing to the addresses
19492 used in the program.
19494 @item -mlittle
19495 @itemx -mlittle-endian
19496 @opindex mlittle
19497 @opindex mlittle-endian
19498 On System V.4 and embedded PowerPC systems compile code for the
19499 processor in little-endian mode.  The @option{-mlittle-endian} option is
19500 the same as @option{-mlittle}.
19502 @item -mbig
19503 @itemx -mbig-endian
19504 @opindex mbig
19505 @opindex mbig-endian
19506 On System V.4 and embedded PowerPC systems compile code for the
19507 processor in big-endian mode.  The @option{-mbig-endian} option is
19508 the same as @option{-mbig}.
19510 @item -mdynamic-no-pic
19511 @opindex mdynamic-no-pic
19512 On Darwin and Mac OS X systems, compile code so that it is not
19513 relocatable, but that its external references are relocatable.  The
19514 resulting code is suitable for applications, but not shared
19515 libraries.
19517 @item -msingle-pic-base
19518 @opindex msingle-pic-base
19519 Treat the register used for PIC addressing as read-only, rather than
19520 loading it in the prologue for each function.  The runtime system is
19521 responsible for initializing this register with an appropriate value
19522 before execution begins.
19524 @item -mprioritize-restricted-insns=@var{priority}
19525 @opindex mprioritize-restricted-insns
19526 This option controls the priority that is assigned to
19527 dispatch-slot restricted instructions during the second scheduling
19528 pass.  The argument @var{priority} takes the value @samp{0}, @samp{1},
19529 or @samp{2} to assign no, highest, or second-highest (respectively) 
19530 priority to dispatch-slot restricted
19531 instructions.
19533 @item -msched-costly-dep=@var{dependence_type}
19534 @opindex msched-costly-dep
19535 This option controls which dependences are considered costly
19536 by the target during instruction scheduling.  The argument
19537 @var{dependence_type} takes one of the following values:
19539 @table @asis
19540 @item @samp{no}
19541 No dependence is costly.
19543 @item @samp{all}
19544 All dependences are costly.
19546 @item @samp{true_store_to_load}
19547 A true dependence from store to load is costly.
19549 @item @samp{store_to_load}
19550 Any dependence from store to load is costly.
19552 @item @var{number}
19553 Any dependence for which the latency is greater than or equal to 
19554 @var{number} is costly.
19555 @end table
19557 @item -minsert-sched-nops=@var{scheme}
19558 @opindex minsert-sched-nops
19559 This option controls which NOP insertion scheme is used during
19560 the second scheduling pass.  The argument @var{scheme} takes one of the
19561 following values:
19563 @table @asis
19564 @item @samp{no}
19565 Don't insert NOPs.
19567 @item @samp{pad}
19568 Pad with NOPs any dispatch group that has vacant issue slots,
19569 according to the scheduler's grouping.
19571 @item @samp{regroup_exact}
19572 Insert NOPs to force costly dependent insns into
19573 separate groups.  Insert exactly as many NOPs as needed to force an insn
19574 to a new group, according to the estimated processor grouping.
19576 @item @var{number}
19577 Insert NOPs to force costly dependent insns into
19578 separate groups.  Insert @var{number} NOPs to force an insn to a new group.
19579 @end table
19581 @item -mcall-sysv
19582 @opindex mcall-sysv
19583 On System V.4 and embedded PowerPC systems compile code using calling
19584 conventions that adhere to the March 1995 draft of the System V
19585 Application Binary Interface, PowerPC processor supplement.  This is the
19586 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
19588 @item -mcall-sysv-eabi
19589 @itemx -mcall-eabi
19590 @opindex mcall-sysv-eabi
19591 @opindex mcall-eabi
19592 Specify both @option{-mcall-sysv} and @option{-meabi} options.
19594 @item -mcall-sysv-noeabi
19595 @opindex mcall-sysv-noeabi
19596 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
19598 @item -mcall-aixdesc
19599 @opindex m
19600 On System V.4 and embedded PowerPC systems compile code for the AIX
19601 operating system.
19603 @item -mcall-linux
19604 @opindex mcall-linux
19605 On System V.4 and embedded PowerPC systems compile code for the
19606 Linux-based GNU system.
19608 @item -mcall-freebsd
19609 @opindex mcall-freebsd
19610 On System V.4 and embedded PowerPC systems compile code for the
19611 FreeBSD operating system.
19613 @item -mcall-netbsd
19614 @opindex mcall-netbsd
19615 On System V.4 and embedded PowerPC systems compile code for the
19616 NetBSD operating system.
19618 @item -mcall-openbsd
19619 @opindex mcall-netbsd
19620 On System V.4 and embedded PowerPC systems compile code for the
19621 OpenBSD operating system.
19623 @item -maix-struct-return
19624 @opindex maix-struct-return
19625 Return all structures in memory (as specified by the AIX ABI)@.
19627 @item -msvr4-struct-return
19628 @opindex msvr4-struct-return
19629 Return structures smaller than 8 bytes in registers (as specified by the
19630 SVR4 ABI)@.
19632 @item -mabi=@var{abi-type}
19633 @opindex mabi
19634 Extend the current ABI with a particular extension, or remove such extension.
19635 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
19636 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble},
19637 @var{elfv1}, @var{elfv2}@.
19639 @item -mabi=spe
19640 @opindex mabi=spe
19641 Extend the current ABI with SPE ABI extensions.  This does not change
19642 the default ABI, instead it adds the SPE ABI extensions to the current
19643 ABI@.
19645 @item -mabi=no-spe
19646 @opindex mabi=no-spe
19647 Disable Book-E SPE ABI extensions for the current ABI@.
19649 @item -mabi=ibmlongdouble
19650 @opindex mabi=ibmlongdouble
19651 Change the current ABI to use IBM extended-precision long double.
19652 This is a PowerPC 32-bit SYSV ABI option.
19654 @item -mabi=ieeelongdouble
19655 @opindex mabi=ieeelongdouble
19656 Change the current ABI to use IEEE extended-precision long double.
19657 This is a PowerPC 32-bit Linux ABI option.
19659 @item -mabi=elfv1
19660 @opindex mabi=elfv1
19661 Change the current ABI to use the ELFv1 ABI.
19662 This is the default ABI for big-endian PowerPC 64-bit Linux.
19663 Overriding the default ABI requires special system support and is
19664 likely to fail in spectacular ways.
19666 @item -mabi=elfv2
19667 @opindex mabi=elfv2
19668 Change the current ABI to use the ELFv2 ABI.
19669 This is the default ABI for little-endian PowerPC 64-bit Linux.
19670 Overriding the default ABI requires special system support and is
19671 likely to fail in spectacular ways.
19673 @item -mprototype
19674 @itemx -mno-prototype
19675 @opindex mprototype
19676 @opindex mno-prototype
19677 On System V.4 and embedded PowerPC systems assume that all calls to
19678 variable argument functions are properly prototyped.  Otherwise, the
19679 compiler must insert an instruction before every non-prototyped call to
19680 set or clear bit 6 of the condition code register (@var{CR}) to
19681 indicate whether floating-point values are passed in the floating-point
19682 registers in case the function takes variable arguments.  With
19683 @option{-mprototype}, only calls to prototyped variable argument functions
19684 set or clear the bit.
19686 @item -msim
19687 @opindex msim
19688 On embedded PowerPC systems, assume that the startup module is called
19689 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
19690 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
19691 configurations.
19693 @item -mmvme
19694 @opindex mmvme
19695 On embedded PowerPC systems, assume that the startup module is called
19696 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
19697 @file{libc.a}.
19699 @item -mads
19700 @opindex mads
19701 On embedded PowerPC systems, assume that the startup module is called
19702 @file{crt0.o} and the standard C libraries are @file{libads.a} and
19703 @file{libc.a}.
19705 @item -myellowknife
19706 @opindex myellowknife
19707 On embedded PowerPC systems, assume that the startup module is called
19708 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
19709 @file{libc.a}.
19711 @item -mvxworks
19712 @opindex mvxworks
19713 On System V.4 and embedded PowerPC systems, specify that you are
19714 compiling for a VxWorks system.
19716 @item -memb
19717 @opindex memb
19718 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
19719 header to indicate that @samp{eabi} extended relocations are used.
19721 @item -meabi
19722 @itemx -mno-eabi
19723 @opindex meabi
19724 @opindex mno-eabi
19725 On System V.4 and embedded PowerPC systems do (do not) adhere to the
19726 Embedded Applications Binary Interface (EABI), which is a set of
19727 modifications to the System V.4 specifications.  Selecting @option{-meabi}
19728 means that the stack is aligned to an 8-byte boundary, a function
19729 @code{__eabi} is called from @code{main} to set up the EABI
19730 environment, and the @option{-msdata} option can use both @code{r2} and
19731 @code{r13} to point to two separate small data areas.  Selecting
19732 @option{-mno-eabi} means that the stack is aligned to a 16-byte boundary,
19733 no EABI initialization function is called from @code{main}, and the
19734 @option{-msdata} option only uses @code{r13} to point to a single
19735 small data area.  The @option{-meabi} option is on by default if you
19736 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
19738 @item -msdata=eabi
19739 @opindex msdata=eabi
19740 On System V.4 and embedded PowerPC systems, put small initialized
19741 @code{const} global and static data in the @samp{.sdata2} section, which
19742 is pointed to by register @code{r2}.  Put small initialized
19743 non-@code{const} global and static data in the @samp{.sdata} section,
19744 which is pointed to by register @code{r13}.  Put small uninitialized
19745 global and static data in the @samp{.sbss} section, which is adjacent to
19746 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
19747 incompatible with the @option{-mrelocatable} option.  The
19748 @option{-msdata=eabi} option also sets the @option{-memb} option.
19750 @item -msdata=sysv
19751 @opindex msdata=sysv
19752 On System V.4 and embedded PowerPC systems, put small global and static
19753 data in the @samp{.sdata} section, which is pointed to by register
19754 @code{r13}.  Put small uninitialized global and static data in the
19755 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
19756 The @option{-msdata=sysv} option is incompatible with the
19757 @option{-mrelocatable} option.
19759 @item -msdata=default
19760 @itemx -msdata
19761 @opindex msdata=default
19762 @opindex msdata
19763 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
19764 compile code the same as @option{-msdata=eabi}, otherwise compile code the
19765 same as @option{-msdata=sysv}.
19767 @item -msdata=data
19768 @opindex msdata=data
19769 On System V.4 and embedded PowerPC systems, put small global
19770 data in the @samp{.sdata} section.  Put small uninitialized global
19771 data in the @samp{.sbss} section.  Do not use register @code{r13}
19772 to address small data however.  This is the default behavior unless
19773 other @option{-msdata} options are used.
19775 @item -msdata=none
19776 @itemx -mno-sdata
19777 @opindex msdata=none
19778 @opindex mno-sdata
19779 On embedded PowerPC systems, put all initialized global and static data
19780 in the @samp{.data} section, and all uninitialized data in the
19781 @samp{.bss} section.
19783 @item -mblock-move-inline-limit=@var{num}
19784 @opindex mblock-move-inline-limit
19785 Inline all block moves (such as calls to @code{memcpy} or structure
19786 copies) less than or equal to @var{num} bytes.  The minimum value for
19787 @var{num} is 32 bytes on 32-bit targets and 64 bytes on 64-bit
19788 targets.  The default value is target-specific.
19790 @item -G @var{num}
19791 @opindex G
19792 @cindex smaller data references (PowerPC)
19793 @cindex .sdata/.sdata2 references (PowerPC)
19794 On embedded PowerPC systems, put global and static items less than or
19795 equal to @var{num} bytes into the small data or BSS sections instead of
19796 the normal data or BSS section.  By default, @var{num} is 8.  The
19797 @option{-G @var{num}} switch is also passed to the linker.
19798 All modules should be compiled with the same @option{-G @var{num}} value.
19800 @item -mregnames
19801 @itemx -mno-regnames
19802 @opindex mregnames
19803 @opindex mno-regnames
19804 On System V.4 and embedded PowerPC systems do (do not) emit register
19805 names in the assembly language output using symbolic forms.
19807 @item -mlongcall
19808 @itemx -mno-longcall
19809 @opindex mlongcall
19810 @opindex mno-longcall
19811 By default assume that all calls are far away so that a longer and more
19812 expensive calling sequence is required.  This is required for calls
19813 farther than 32 megabytes (33,554,432 bytes) from the current location.
19814 A short call is generated if the compiler knows
19815 the call cannot be that far away.  This setting can be overridden by
19816 the @code{shortcall} function attribute, or by @code{#pragma
19817 longcall(0)}.
19819 Some linkers are capable of detecting out-of-range calls and generating
19820 glue code on the fly.  On these systems, long calls are unnecessary and
19821 generate slower code.  As of this writing, the AIX linker can do this,
19822 as can the GNU linker for PowerPC/64.  It is planned to add this feature
19823 to the GNU linker for 32-bit PowerPC systems as well.
19825 On Darwin/PPC systems, @code{#pragma longcall} generates @code{jbsr
19826 callee, L42}, plus a @dfn{branch island} (glue code).  The two target
19827 addresses represent the callee and the branch island.  The
19828 Darwin/PPC linker prefers the first address and generates a @code{bl
19829 callee} if the PPC @code{bl} instruction reaches the callee directly;
19830 otherwise, the linker generates @code{bl L42} to call the branch
19831 island.  The branch island is appended to the body of the
19832 calling function; it computes the full 32-bit address of the callee
19833 and jumps to it.
19835 On Mach-O (Darwin) systems, this option directs the compiler emit to
19836 the glue for every direct call, and the Darwin linker decides whether
19837 to use or discard it.
19839 In the future, GCC may ignore all longcall specifications
19840 when the linker is known to generate glue.
19842 @item -mtls-markers
19843 @itemx -mno-tls-markers
19844 @opindex mtls-markers
19845 @opindex mno-tls-markers
19846 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
19847 specifying the function argument.  The relocation allows the linker to
19848 reliably associate function call with argument setup instructions for
19849 TLS optimization, which in turn allows GCC to better schedule the
19850 sequence.
19852 @item -pthread
19853 @opindex pthread
19854 Adds support for multithreading with the @dfn{pthreads} library.
19855 This option sets flags for both the preprocessor and linker.
19857 @item -mrecip
19858 @itemx -mno-recip
19859 @opindex mrecip
19860 This option enables use of the reciprocal estimate and
19861 reciprocal square root estimate instructions with additional
19862 Newton-Raphson steps to increase precision instead of doing a divide or
19863 square root and divide for floating-point arguments.  You should use
19864 the @option{-ffast-math} option when using @option{-mrecip} (or at
19865 least @option{-funsafe-math-optimizations},
19866 @option{-finite-math-only}, @option{-freciprocal-math} and
19867 @option{-fno-trapping-math}).  Note that while the throughput of the
19868 sequence is generally higher than the throughput of the non-reciprocal
19869 instruction, the precision of the sequence can be decreased by up to 2
19870 ulp (i.e.@: the inverse of 1.0 equals 0.99999994) for reciprocal square
19871 roots.
19873 @item -mrecip=@var{opt}
19874 @opindex mrecip=opt
19875 This option controls which reciprocal estimate instructions
19876 may be used.  @var{opt} is a comma-separated list of options, which may
19877 be preceded by a @code{!} to invert the option:
19878 @code{all}: enable all estimate instructions,
19879 @code{default}: enable the default instructions, equivalent to @option{-mrecip},
19880 @code{none}: disable all estimate instructions, equivalent to @option{-mno-recip};
19881 @code{div}: enable the reciprocal approximation instructions for both single and double precision;
19882 @code{divf}: enable the single-precision reciprocal approximation instructions;
19883 @code{divd}: enable the double-precision reciprocal approximation instructions;
19884 @code{rsqrt}: enable the reciprocal square root approximation instructions for both single and double precision;
19885 @code{rsqrtf}: enable the single-precision reciprocal square root approximation instructions;
19886 @code{rsqrtd}: enable the double-precision reciprocal square root approximation instructions;
19888 So, for example, @option{-mrecip=all,!rsqrtd} enables
19889 all of the reciprocal estimate instructions, except for the
19890 @code{FRSQRTE}, @code{XSRSQRTEDP}, and @code{XVRSQRTEDP} instructions
19891 which handle the double-precision reciprocal square root calculations.
19893 @item -mrecip-precision
19894 @itemx -mno-recip-precision
19895 @opindex mrecip-precision
19896 Assume (do not assume) that the reciprocal estimate instructions
19897 provide higher-precision estimates than is mandated by the PowerPC
19898 ABI.  Selecting @option{-mcpu=power6}, @option{-mcpu=power7} or
19899 @option{-mcpu=power8} automatically selects @option{-mrecip-precision}.
19900 The double-precision square root estimate instructions are not generated by
19901 default on low-precision machines, since they do not provide an
19902 estimate that converges after three steps.
19904 @item -mveclibabi=@var{type}
19905 @opindex mveclibabi
19906 Specifies the ABI type to use for vectorizing intrinsics using an
19907 external library.  The only type supported at present is @code{mass},
19908 which specifies to use IBM's Mathematical Acceleration Subsystem
19909 (MASS) libraries for vectorizing intrinsics using external libraries.
19910 GCC currently emits calls to @code{acosd2}, @code{acosf4},
19911 @code{acoshd2}, @code{acoshf4}, @code{asind2}, @code{asinf4},
19912 @code{asinhd2}, @code{asinhf4}, @code{atan2d2}, @code{atan2f4},
19913 @code{atand2}, @code{atanf4}, @code{atanhd2}, @code{atanhf4},
19914 @code{cbrtd2}, @code{cbrtf4}, @code{cosd2}, @code{cosf4},
19915 @code{coshd2}, @code{coshf4}, @code{erfcd2}, @code{erfcf4},
19916 @code{erfd2}, @code{erff4}, @code{exp2d2}, @code{exp2f4},
19917 @code{expd2}, @code{expf4}, @code{expm1d2}, @code{expm1f4},
19918 @code{hypotd2}, @code{hypotf4}, @code{lgammad2}, @code{lgammaf4},
19919 @code{log10d2}, @code{log10f4}, @code{log1pd2}, @code{log1pf4},
19920 @code{log2d2}, @code{log2f4}, @code{logd2}, @code{logf4},
19921 @code{powd2}, @code{powf4}, @code{sind2}, @code{sinf4}, @code{sinhd2},
19922 @code{sinhf4}, @code{sqrtd2}, @code{sqrtf4}, @code{tand2},
19923 @code{tanf4}, @code{tanhd2}, and @code{tanhf4} when generating code
19924 for power7.  Both @option{-ftree-vectorize} and
19925 @option{-funsafe-math-optimizations} must also be enabled.  The MASS
19926 libraries must be specified at link time.
19928 @item -mfriz
19929 @itemx -mno-friz
19930 @opindex mfriz
19931 Generate (do not generate) the @code{friz} instruction when the
19932 @option{-funsafe-math-optimizations} option is used to optimize
19933 rounding of floating-point values to 64-bit integer and back to floating
19934 point.  The @code{friz} instruction does not return the same value if
19935 the floating-point number is too large to fit in an integer.
19937 @item -mpointers-to-nested-functions
19938 @itemx -mno-pointers-to-nested-functions
19939 @opindex mpointers-to-nested-functions
19940 Generate (do not generate) code to load up the static chain register
19941 (@var{r11}) when calling through a pointer on AIX and 64-bit Linux
19942 systems where a function pointer points to a 3-word descriptor giving
19943 the function address, TOC value to be loaded in register @var{r2}, and
19944 static chain value to be loaded in register @var{r11}.  The
19945 @option{-mpointers-to-nested-functions} is on by default.  You cannot
19946 call through pointers to nested functions or pointers
19947 to functions compiled in other languages that use the static chain if
19948 you use the @option{-mno-pointers-to-nested-functions}.
19950 @item -msave-toc-indirect
19951 @itemx -mno-save-toc-indirect
19952 @opindex msave-toc-indirect
19953 Generate (do not generate) code to save the TOC value in the reserved
19954 stack location in the function prologue if the function calls through
19955 a pointer on AIX and 64-bit Linux systems.  If the TOC value is not
19956 saved in the prologue, it is saved just before the call through the
19957 pointer.  The @option{-mno-save-toc-indirect} option is the default.
19959 @item -mcompat-align-parm
19960 @itemx -mno-compat-align-parm
19961 @opindex mcompat-align-parm
19962 Generate (do not generate) code to pass structure parameters with a
19963 maximum alignment of 64 bits, for compatibility with older versions
19964 of GCC.
19966 Older versions of GCC (prior to 4.9.0) incorrectly did not align a
19967 structure parameter on a 128-bit boundary when that structure contained
19968 a member requiring 128-bit alignment.  This is corrected in more
19969 recent versions of GCC.  This option may be used to generate code
19970 that is compatible with functions compiled with older versions of
19971 GCC.
19973 The @option{-mno-compat-align-parm} option is the default.
19974 @end table
19976 @node RX Options
19977 @subsection RX Options
19978 @cindex RX Options
19980 These command-line options are defined for RX targets:
19982 @table @gcctabopt
19983 @item -m64bit-doubles
19984 @itemx -m32bit-doubles
19985 @opindex m64bit-doubles
19986 @opindex m32bit-doubles
19987 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
19988 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
19989 @option{-m32bit-doubles}.  @emph{Note} RX floating-point hardware only
19990 works on 32-bit values, which is why the default is
19991 @option{-m32bit-doubles}.
19993 @item -fpu
19994 @itemx -nofpu
19995 @opindex fpu
19996 @opindex nofpu
19997 Enables (@option{-fpu}) or disables (@option{-nofpu}) the use of RX
19998 floating-point hardware.  The default is enabled for the @var{RX600}
19999 series and disabled for the @var{RX200} series.
20001 Floating-point instructions are only generated for 32-bit floating-point 
20002 values, however, so the FPU hardware is not used for doubles if the
20003 @option{-m64bit-doubles} option is used.
20005 @emph{Note} If the @option{-fpu} option is enabled then
20006 @option{-funsafe-math-optimizations} is also enabled automatically.
20007 This is because the RX FPU instructions are themselves unsafe.
20009 @item -mcpu=@var{name}
20010 @opindex -mcpu
20011 Selects the type of RX CPU to be targeted.  Currently three types are
20012 supported, the generic @var{RX600} and @var{RX200} series hardware and
20013 the specific @var{RX610} CPU.  The default is @var{RX600}.
20015 The only difference between @var{RX600} and @var{RX610} is that the
20016 @var{RX610} does not support the @code{MVTIPL} instruction.
20018 The @var{RX200} series does not have a hardware floating-point unit
20019 and so @option{-nofpu} is enabled by default when this type is
20020 selected.
20022 @item -mbig-endian-data
20023 @itemx -mlittle-endian-data
20024 @opindex mbig-endian-data
20025 @opindex mlittle-endian-data
20026 Store data (but not code) in the big-endian format.  The default is
20027 @option{-mlittle-endian-data}, i.e.@: to store data in the little-endian
20028 format.
20030 @item -msmall-data-limit=@var{N}
20031 @opindex msmall-data-limit
20032 Specifies the maximum size in bytes of global and static variables
20033 which can be placed into the small data area.  Using the small data
20034 area can lead to smaller and faster code, but the size of area is
20035 limited and it is up to the programmer to ensure that the area does
20036 not overflow.  Also when the small data area is used one of the RX's
20037 registers (usually @code{r13}) is reserved for use pointing to this
20038 area, so it is no longer available for use by the compiler.  This
20039 could result in slower and/or larger code if variables are pushed onto
20040 the stack instead of being held in this register.
20042 Note, common variables (variables that have not been initialized) and
20043 constants are not placed into the small data area as they are assigned
20044 to other sections in the output executable.
20046 The default value is zero, which disables this feature.  Note, this
20047 feature is not enabled by default with higher optimization levels
20048 (@option{-O2} etc) because of the potentially detrimental effects of
20049 reserving a register.  It is up to the programmer to experiment and
20050 discover whether this feature is of benefit to their program.  See the
20051 description of the @option{-mpid} option for a description of how the
20052 actual register to hold the small data area pointer is chosen.
20054 @item -msim
20055 @itemx -mno-sim
20056 @opindex msim
20057 @opindex mno-sim
20058 Use the simulator runtime.  The default is to use the libgloss
20059 board-specific runtime.
20061 @item -mas100-syntax
20062 @itemx -mno-as100-syntax
20063 @opindex mas100-syntax
20064 @opindex mno-as100-syntax
20065 When generating assembler output use a syntax that is compatible with
20066 Renesas's AS100 assembler.  This syntax can also be handled by the GAS
20067 assembler, but it has some restrictions so it is not generated by default.
20069 @item -mmax-constant-size=@var{N}
20070 @opindex mmax-constant-size
20071 Specifies the maximum size, in bytes, of a constant that can be used as
20072 an operand in a RX instruction.  Although the RX instruction set does
20073 allow constants of up to 4 bytes in length to be used in instructions,
20074 a longer value equates to a longer instruction.  Thus in some
20075 circumstances it can be beneficial to restrict the size of constants
20076 that are used in instructions.  Constants that are too big are instead
20077 placed into a constant pool and referenced via register indirection.
20079 The value @var{N} can be between 0 and 4.  A value of 0 (the default)
20080 or 4 means that constants of any size are allowed.
20082 @item -mrelax
20083 @opindex mrelax
20084 Enable linker relaxation.  Linker relaxation is a process whereby the
20085 linker attempts to reduce the size of a program by finding shorter
20086 versions of various instructions.  Disabled by default.
20088 @item -mint-register=@var{N}
20089 @opindex mint-register
20090 Specify the number of registers to reserve for fast interrupt handler
20091 functions.  The value @var{N} can be between 0 and 4.  A value of 1
20092 means that register @code{r13} is reserved for the exclusive use
20093 of fast interrupt handlers.  A value of 2 reserves @code{r13} and
20094 @code{r12}.  A value of 3 reserves @code{r13}, @code{r12} and
20095 @code{r11}, and a value of 4 reserves @code{r13} through @code{r10}.
20096 A value of 0, the default, does not reserve any registers.
20098 @item -msave-acc-in-interrupts
20099 @opindex msave-acc-in-interrupts
20100 Specifies that interrupt handler functions should preserve the
20101 accumulator register.  This is only necessary if normal code might use
20102 the accumulator register, for example because it performs 64-bit
20103 multiplications.  The default is to ignore the accumulator as this
20104 makes the interrupt handlers faster.
20106 @item -mpid
20107 @itemx -mno-pid
20108 @opindex mpid
20109 @opindex mno-pid
20110 Enables the generation of position independent data.  When enabled any
20111 access to constant data is done via an offset from a base address
20112 held in a register.  This allows the location of constant data to be
20113 determined at run time without requiring the executable to be
20114 relocated, which is a benefit to embedded applications with tight
20115 memory constraints.  Data that can be modified is not affected by this
20116 option.
20118 Note, using this feature reserves a register, usually @code{r13}, for
20119 the constant data base address.  This can result in slower and/or
20120 larger code, especially in complicated functions.
20122 The actual register chosen to hold the constant data base address
20123 depends upon whether the @option{-msmall-data-limit} and/or the
20124 @option{-mint-register} command-line options are enabled.  Starting
20125 with register @code{r13} and proceeding downwards, registers are
20126 allocated first to satisfy the requirements of @option{-mint-register},
20127 then @option{-mpid} and finally @option{-msmall-data-limit}.  Thus it
20128 is possible for the small data area register to be @code{r8} if both
20129 @option{-mint-register=4} and @option{-mpid} are specified on the
20130 command line.
20132 By default this feature is not enabled.  The default can be restored
20133 via the @option{-mno-pid} command-line option.
20135 @item -mno-warn-multiple-fast-interrupts
20136 @itemx -mwarn-multiple-fast-interrupts
20137 @opindex mno-warn-multiple-fast-interrupts
20138 @opindex mwarn-multiple-fast-interrupts
20139 Prevents GCC from issuing a warning message if it finds more than one
20140 fast interrupt handler when it is compiling a file.  The default is to
20141 issue a warning for each extra fast interrupt handler found, as the RX
20142 only supports one such interrupt.
20144 @end table
20146 @emph{Note:} The generic GCC command-line option @option{-ffixed-@var{reg}}
20147 has special significance to the RX port when used with the
20148 @code{interrupt} function attribute.  This attribute indicates a
20149 function intended to process fast interrupts.  GCC ensures
20150 that it only uses the registers @code{r10}, @code{r11}, @code{r12}
20151 and/or @code{r13} and only provided that the normal use of the
20152 corresponding registers have been restricted via the
20153 @option{-ffixed-@var{reg}} or @option{-mint-register} command-line
20154 options.
20156 @node S/390 and zSeries Options
20157 @subsection S/390 and zSeries Options
20158 @cindex S/390 and zSeries Options
20160 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
20162 @table @gcctabopt
20163 @item -mhard-float
20164 @itemx -msoft-float
20165 @opindex mhard-float
20166 @opindex msoft-float
20167 Use (do not use) the hardware floating-point instructions and registers
20168 for floating-point operations.  When @option{-msoft-float} is specified,
20169 functions in @file{libgcc.a} are used to perform floating-point
20170 operations.  When @option{-mhard-float} is specified, the compiler
20171 generates IEEE floating-point instructions.  This is the default.
20173 @item -mhard-dfp
20174 @itemx -mno-hard-dfp
20175 @opindex mhard-dfp
20176 @opindex mno-hard-dfp
20177 Use (do not use) the hardware decimal-floating-point instructions for
20178 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
20179 specified, functions in @file{libgcc.a} are used to perform
20180 decimal-floating-point operations.  When @option{-mhard-dfp} is
20181 specified, the compiler generates decimal-floating-point hardware
20182 instructions.  This is the default for @option{-march=z9-ec} or higher.
20184 @item -mlong-double-64
20185 @itemx -mlong-double-128
20186 @opindex mlong-double-64
20187 @opindex mlong-double-128
20188 These switches control the size of @code{long double} type. A size
20189 of 64 bits makes the @code{long double} type equivalent to the @code{double}
20190 type. This is the default.
20192 @item -mbackchain
20193 @itemx -mno-backchain
20194 @opindex mbackchain
20195 @opindex mno-backchain
20196 Store (do not store) the address of the caller's frame as backchain pointer
20197 into the callee's stack frame.
20198 A backchain may be needed to allow debugging using tools that do not understand
20199 DWARF 2 call frame information.
20200 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
20201 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
20202 the backchain is placed into the topmost word of the 96/160 byte register
20203 save area.
20205 In general, code compiled with @option{-mbackchain} is call-compatible with
20206 code compiled with @option{-mmo-backchain}; however, use of the backchain
20207 for debugging purposes usually requires that the whole binary is built with
20208 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
20209 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
20210 to build a linux kernel use @option{-msoft-float}.
20212 The default is to not maintain the backchain.
20214 @item -mpacked-stack
20215 @itemx -mno-packed-stack
20216 @opindex mpacked-stack
20217 @opindex mno-packed-stack
20218 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
20219 specified, the compiler uses the all fields of the 96/160 byte register save
20220 area only for their default purpose; unused fields still take up stack space.
20221 When @option{-mpacked-stack} is specified, register save slots are densely
20222 packed at the top of the register save area; unused space is reused for other
20223 purposes, allowing for more efficient use of the available stack space.
20224 However, when @option{-mbackchain} is also in effect, the topmost word of
20225 the save area is always used to store the backchain, and the return address
20226 register is always saved two words below the backchain.
20228 As long as the stack frame backchain is not used, code generated with
20229 @option{-mpacked-stack} is call-compatible with code generated with
20230 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
20231 S/390 or zSeries generated code that uses the stack frame backchain at run
20232 time, not just for debugging purposes.  Such code is not call-compatible
20233 with code compiled with @option{-mpacked-stack}.  Also, note that the
20234 combination of @option{-mbackchain},
20235 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
20236 to build a linux kernel use @option{-msoft-float}.
20238 The default is to not use the packed stack layout.
20240 @item -msmall-exec
20241 @itemx -mno-small-exec
20242 @opindex msmall-exec
20243 @opindex mno-small-exec
20244 Generate (or do not generate) code using the @code{bras} instruction
20245 to do subroutine calls.
20246 This only works reliably if the total executable size does not
20247 exceed 64k.  The default is to use the @code{basr} instruction instead,
20248 which does not have this limitation.
20250 @item -m64
20251 @itemx -m31
20252 @opindex m64
20253 @opindex m31
20254 When @option{-m31} is specified, generate code compliant to the
20255 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
20256 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
20257 particular to generate 64-bit instructions.  For the @samp{s390}
20258 targets, the default is @option{-m31}, while the @samp{s390x}
20259 targets default to @option{-m64}.
20261 @item -mzarch
20262 @itemx -mesa
20263 @opindex mzarch
20264 @opindex mesa
20265 When @option{-mzarch} is specified, generate code using the
20266 instructions available on z/Architecture.
20267 When @option{-mesa} is specified, generate code using the
20268 instructions available on ESA/390.  Note that @option{-mesa} is
20269 not possible with @option{-m64}.
20270 When generating code compliant to the GNU/Linux for S/390 ABI,
20271 the default is @option{-mesa}.  When generating code compliant
20272 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
20274 @item -mmvcle
20275 @itemx -mno-mvcle
20276 @opindex mmvcle
20277 @opindex mno-mvcle
20278 Generate (or do not generate) code using the @code{mvcle} instruction
20279 to perform block moves.  When @option{-mno-mvcle} is specified,
20280 use a @code{mvc} loop instead.  This is the default unless optimizing for
20281 size.
20283 @item -mdebug
20284 @itemx -mno-debug
20285 @opindex mdebug
20286 @opindex mno-debug
20287 Print (or do not print) additional debug information when compiling.
20288 The default is to not print debug information.
20290 @item -march=@var{cpu-type}
20291 @opindex march
20292 Generate code that runs on @var{cpu-type}, which is the name of a system
20293 representing a certain processor type.  Possible values for
20294 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, @samp{z990},
20295 @samp{z9-109}, @samp{z9-ec} and @samp{z10}.
20296 When generating code using the instructions available on z/Architecture,
20297 the default is @option{-march=z900}.  Otherwise, the default is
20298 @option{-march=g5}.
20300 @item -mtune=@var{cpu-type}
20301 @opindex mtune
20302 Tune to @var{cpu-type} everything applicable about the generated code,
20303 except for the ABI and the set of available instructions.
20304 The list of @var{cpu-type} values is the same as for @option{-march}.
20305 The default is the value used for @option{-march}.
20307 @item -mtpf-trace
20308 @itemx -mno-tpf-trace
20309 @opindex mtpf-trace
20310 @opindex mno-tpf-trace
20311 Generate code that adds (does not add) in TPF OS specific branches to trace
20312 routines in the operating system.  This option is off by default, even
20313 when compiling for the TPF OS@.
20315 @item -mfused-madd
20316 @itemx -mno-fused-madd
20317 @opindex mfused-madd
20318 @opindex mno-fused-madd
20319 Generate code that uses (does not use) the floating-point multiply and
20320 accumulate instructions.  These instructions are generated by default if
20321 hardware floating point is used.
20323 @item -mwarn-framesize=@var{framesize}
20324 @opindex mwarn-framesize
20325 Emit a warning if the current function exceeds the given frame size.  Because
20326 this is a compile-time check it doesn't need to be a real problem when the program
20327 runs.  It is intended to identify functions that most probably cause
20328 a stack overflow.  It is useful to be used in an environment with limited stack
20329 size e.g.@: the linux kernel.
20331 @item -mwarn-dynamicstack
20332 @opindex mwarn-dynamicstack
20333 Emit a warning if the function calls @code{alloca} or uses dynamically-sized
20334 arrays.  This is generally a bad idea with a limited stack size.
20336 @item -mstack-guard=@var{stack-guard}
20337 @itemx -mstack-size=@var{stack-size}
20338 @opindex mstack-guard
20339 @opindex mstack-size
20340 If these options are provided the S/390 back end emits additional instructions in
20341 the function prologue that trigger a trap if the stack size is @var{stack-guard}
20342 bytes above the @var{stack-size} (remember that the stack on S/390 grows downward).
20343 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
20344 the frame size of the compiled function is chosen.
20345 These options are intended to be used to help debugging stack overflow problems.
20346 The additionally emitted code causes only little overhead and hence can also be
20347 used in production-like systems without greater performance degradation.  The given
20348 values have to be exact powers of 2 and @var{stack-size} has to be greater than
20349 @var{stack-guard} without exceeding 64k.
20350 In order to be efficient the extra code makes the assumption that the stack starts
20351 at an address aligned to the value given by @var{stack-size}.
20352 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
20354 @item -mhotpatch[=@var{halfwords}]
20355 @itemx -mno-hotpatch
20356 @opindex mhotpatch
20357 If the hotpatch option is enabled, a ``hot-patching'' function
20358 prologue is generated for all functions in the compilation unit.
20359 The funtion label is prepended with the given number of two-byte
20360 Nop instructions (@var{halfwords}, maximum 1000000) or 12 Nop
20361 instructions if no argument is present.  Functions with a
20362 hot-patching prologue are never inlined automatically, and a
20363 hot-patching prologue is never generated for functions functions
20364 that are explicitly inline.
20366 This option can be overridden for individual functions with the
20367 @code{hotpatch} attribute.
20368 @end table
20370 @node Score Options
20371 @subsection Score Options
20372 @cindex Score Options
20374 These options are defined for Score implementations:
20376 @table @gcctabopt
20377 @item -meb
20378 @opindex meb
20379 Compile code for big-endian mode.  This is the default.
20381 @item -mel
20382 @opindex mel
20383 Compile code for little-endian mode.
20385 @item -mnhwloop
20386 @opindex mnhwloop
20387 Disable generation of @code{bcnz} instructions.
20389 @item -muls
20390 @opindex muls
20391 Enable generation of unaligned load and store instructions.
20393 @item -mmac
20394 @opindex mmac
20395 Enable the use of multiply-accumulate instructions. Disabled by default.
20397 @item -mscore5
20398 @opindex mscore5
20399 Specify the SCORE5 as the target architecture.
20401 @item -mscore5u
20402 @opindex mscore5u
20403 Specify the SCORE5U of the target architecture.
20405 @item -mscore7
20406 @opindex mscore7
20407 Specify the SCORE7 as the target architecture. This is the default.
20409 @item -mscore7d
20410 @opindex mscore7d
20411 Specify the SCORE7D as the target architecture.
20412 @end table
20414 @node SH Options
20415 @subsection SH Options
20417 These @samp{-m} options are defined for the SH implementations:
20419 @table @gcctabopt
20420 @item -m1
20421 @opindex m1
20422 Generate code for the SH1.
20424 @item -m2
20425 @opindex m2
20426 Generate code for the SH2.
20428 @item -m2e
20429 Generate code for the SH2e.
20431 @item -m2a-nofpu
20432 @opindex m2a-nofpu
20433 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a way
20434 that the floating-point unit is not used.
20436 @item -m2a-single-only
20437 @opindex m2a-single-only
20438 Generate code for the SH2a-FPU, in such a way that no double-precision
20439 floating-point operations are used.
20441 @item -m2a-single
20442 @opindex m2a-single
20443 Generate code for the SH2a-FPU assuming the floating-point unit is in
20444 single-precision mode by default.
20446 @item -m2a
20447 @opindex m2a
20448 Generate code for the SH2a-FPU assuming the floating-point unit is in
20449 double-precision mode by default.
20451 @item -m3
20452 @opindex m3
20453 Generate code for the SH3.
20455 @item -m3e
20456 @opindex m3e
20457 Generate code for the SH3e.
20459 @item -m4-nofpu
20460 @opindex m4-nofpu
20461 Generate code for the SH4 without a floating-point unit.
20463 @item -m4-single-only
20464 @opindex m4-single-only
20465 Generate code for the SH4 with a floating-point unit that only
20466 supports single-precision arithmetic.
20468 @item -m4-single
20469 @opindex m4-single
20470 Generate code for the SH4 assuming the floating-point unit is in
20471 single-precision mode by default.
20473 @item -m4
20474 @opindex m4
20475 Generate code for the SH4.
20477 @item -m4a-nofpu
20478 @opindex m4a-nofpu
20479 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
20480 floating-point unit is not used.
20482 @item -m4a-single-only
20483 @opindex m4a-single-only
20484 Generate code for the SH4a, in such a way that no double-precision
20485 floating-point operations are used.
20487 @item -m4a-single
20488 @opindex m4a-single
20489 Generate code for the SH4a assuming the floating-point unit is in
20490 single-precision mode by default.
20492 @item -m4a
20493 @opindex m4a
20494 Generate code for the SH4a.
20496 @item -m4al
20497 @opindex m4al
20498 Same as @option{-m4a-nofpu}, except that it implicitly passes
20499 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
20500 instructions at the moment.
20502 @item -mb
20503 @opindex mb
20504 Compile code for the processor in big-endian mode.
20506 @item -ml
20507 @opindex ml
20508 Compile code for the processor in little-endian mode.
20510 @item -mdalign
20511 @opindex mdalign
20512 Align doubles at 64-bit boundaries.  Note that this changes the calling
20513 conventions, and thus some functions from the standard C library do
20514 not work unless you recompile it first with @option{-mdalign}.
20516 @item -mrelax
20517 @opindex mrelax
20518 Shorten some address references at link time, when possible; uses the
20519 linker option @option{-relax}.
20521 @item -mbigtable
20522 @opindex mbigtable
20523 Use 32-bit offsets in @code{switch} tables.  The default is to use
20524 16-bit offsets.
20526 @item -mbitops
20527 @opindex mbitops
20528 Enable the use of bit manipulation instructions on SH2A.
20530 @item -mfmovd
20531 @opindex mfmovd
20532 Enable the use of the instruction @code{fmovd}.  Check @option{-mdalign} for
20533 alignment constraints.
20535 @item -mhitachi
20536 @opindex mhitachi
20537 Comply with the calling conventions defined by Renesas.
20539 @item -mrenesas
20540 @opindex mhitachi
20541 Comply with the calling conventions defined by Renesas.
20543 @item -mno-renesas
20544 @opindex mhitachi
20545 Comply with the calling conventions defined for GCC before the Renesas
20546 conventions were available.  This option is the default for all
20547 targets of the SH toolchain.
20549 @item -mnomacsave
20550 @opindex mnomacsave
20551 Mark the @code{MAC} register as call-clobbered, even if
20552 @option{-mhitachi} is given.
20554 @item -mieee
20555 @itemx -mno-ieee
20556 @opindex mieee
20557 @opindex mnoieee
20558 Control the IEEE compliance of floating-point comparisons, which affects the
20559 handling of cases where the result of a comparison is unordered.  By default
20560 @option{-mieee} is implicitly enabled.  If @option{-ffinite-math-only} is
20561 enabled @option{-mno-ieee} is implicitly set, which results in faster
20562 floating-point greater-equal and less-equal comparisons.  The implcit settings
20563 can be overridden by specifying either @option{-mieee} or @option{-mno-ieee}.
20565 @item -minline-ic_invalidate
20566 @opindex minline-ic_invalidate
20567 Inline code to invalidate instruction cache entries after setting up
20568 nested function trampolines.
20569 This option has no effect if @option{-musermode} is in effect and the selected
20570 code generation option (e.g. @option{-m4}) does not allow the use of the @code{icbi}
20571 instruction.
20572 If the selected code generation option does not allow the use of the @code{icbi}
20573 instruction, and @option{-musermode} is not in effect, the inlined code
20574 manipulates the instruction cache address array directly with an associative
20575 write.  This not only requires privileged mode at run time, but it also
20576 fails if the cache line had been mapped via the TLB and has become unmapped.
20578 @item -misize
20579 @opindex misize
20580 Dump instruction size and location in the assembly code.
20582 @item -mpadstruct
20583 @opindex mpadstruct
20584 This option is deprecated.  It pads structures to multiple of 4 bytes,
20585 which is incompatible with the SH ABI@.
20587 @item -matomic-model=@var{model}
20588 @opindex matomic-model=@var{model}
20589 Sets the model of atomic operations and additional parameters as a comma
20590 separated list.  For details on the atomic built-in functions see
20591 @ref{__atomic Builtins}.  The following models and parameters are supported:
20593 @table @samp
20595 @item none
20596 Disable compiler generated atomic sequences and emit library calls for atomic
20597 operations.  This is the default if the target is not @code{sh-*-linux*}.
20599 @item soft-gusa
20600 Generate GNU/Linux compatible gUSA software atomic sequences for the atomic
20601 built-in functions.  The generated atomic sequences require additional support
20602 from the interrupt/exception handling code of the system and are only suitable
20603 for SH3* and SH4* single-core systems.  This option is enabled by default when
20604 the target is @code{sh-*-linux*} and SH3* or SH4*.  When the target is SH4A,
20605 this option will also partially utilize the hardware atomic instructions
20606 @code{movli.l} and @code{movco.l} to create more efficient code, unless
20607 @samp{strict} is specified.  
20609 @item soft-tcb
20610 Generate software atomic sequences that use a variable in the thread control
20611 block.  This is a variation of the gUSA sequences which can also be used on
20612 SH1* and SH2* targets.  The generated atomic sequences require additional
20613 support from the interrupt/exception handling code of the system and are only
20614 suitable for single-core systems.  When using this model, the @samp{gbr-offset=}
20615 parameter has to be specified as well.
20617 @item soft-imask
20618 Generate software atomic sequences that temporarily disable interrupts by
20619 setting @code{SR.IMASK = 1111}.  This model works only when the program runs
20620 in privileged mode and is only suitable for single-core systems.  Additional
20621 support from the interrupt/exception handling code of the system is not
20622 required.  This model is enabled by default when the target is
20623 @code{sh-*-linux*} and SH1* or SH2*.
20625 @item hard-llcs
20626 Generate hardware atomic sequences using the @code{movli.l} and @code{movco.l}
20627 instructions only.  This is only available on SH4A and is suitable for
20628 multi-core systems.  Since the hardware instructions support only 32 bit atomic
20629 variables access to 8 or 16 bit variables is emulated with 32 bit accesses.
20630 Code compiled with this option will also be compatible with other software
20631 atomic model interrupt/exception handling systems if executed on an SH4A
20632 system.  Additional support from the interrupt/exception handling code of the
20633 system is not required for this model.
20635 @item gbr-offset=
20636 This parameter specifies the offset in bytes of the variable in the thread
20637 control block structure that should be used by the generated atomic sequences
20638 when the @samp{soft-tcb} model has been selected.  For other models this
20639 parameter is ignored.  The specified value must be an integer multiple of four
20640 and in the range 0-1020.
20642 @item strict
20643 This parameter prevents mixed usage of multiple atomic models, even though they
20644 would be compatible, and will make the compiler generate atomic sequences of the
20645 specified model only.
20647 @end table
20649 @item -mtas
20650 @opindex mtas
20651 Generate the @code{tas.b} opcode for @code{__atomic_test_and_set}.
20652 Notice that depending on the particular hardware and software configuration
20653 this can degrade overall performance due to the operand cache line flushes
20654 that are implied by the @code{tas.b} instruction.  On multi-core SH4A
20655 processors the @code{tas.b} instruction must be used with caution since it
20656 can result in data corruption for certain cache configurations.
20658 @item -mspace
20659 @opindex mspace
20660 Optimize for space instead of speed.  Implied by @option{-Os}.
20662 @item -mprefergot
20663 @opindex mprefergot
20664 When generating position-independent code, emit function calls using
20665 the Global Offset Table instead of the Procedure Linkage Table.
20667 @item -musermode
20668 @opindex musermode
20669 Don't generate privileged mode only code.  This option
20670 implies @option{-mno-inline-ic_invalidate}
20671 if the inlined code would not work in user mode.
20672 This is the default when the target is @code{sh-*-linux*}.
20674 @item -multcost=@var{number}
20675 @opindex multcost=@var{number}
20676 Set the cost to assume for a multiply insn.
20678 @item -mdiv=@var{strategy}
20679 @opindex mdiv=@var{strategy}
20680 Set the division strategy to be used for integer division operations.
20681 For SHmedia @var{strategy} can be one of: 
20683 @table @samp
20685 @item fp 
20686 Performs the operation in floating point.  This has a very high latency,
20687 but needs only a few instructions, so it might be a good choice if
20688 your code has enough easily-exploitable ILP to allow the compiler to
20689 schedule the floating-point instructions together with other instructions.
20690 Division by zero causes a floating-point exception.
20692 @item inv
20693 Uses integer operations to calculate the inverse of the divisor,
20694 and then multiplies the dividend with the inverse.  This strategy allows
20695 CSE and hoisting of the inverse calculation.  Division by zero calculates
20696 an unspecified result, but does not trap.
20698 @item inv:minlat
20699 A variant of @samp{inv} where, if no CSE or hoisting opportunities
20700 have been found, or if the entire operation has been hoisted to the same
20701 place, the last stages of the inverse calculation are intertwined with the
20702 final multiply to reduce the overall latency, at the expense of using a few
20703 more instructions, and thus offering fewer scheduling opportunities with
20704 other code.
20706 @item call
20707 Calls a library function that usually implements the @samp{inv:minlat}
20708 strategy.
20709 This gives high code density for @code{m5-*media-nofpu} compilations.
20711 @item call2
20712 Uses a different entry point of the same library function, where it
20713 assumes that a pointer to a lookup table has already been set up, which
20714 exposes the pointer load to CSE and code hoisting optimizations.
20716 @item inv:call
20717 @itemx inv:call2
20718 @itemx inv:fp
20719 Use the @samp{inv} algorithm for initial
20720 code generation, but if the code stays unoptimized, revert to the @samp{call},
20721 @samp{call2}, or @samp{fp} strategies, respectively.  Note that the
20722 potentially-trapping side effect of division by zero is carried by a
20723 separate instruction, so it is possible that all the integer instructions
20724 are hoisted out, but the marker for the side effect stays where it is.
20725 A recombination to floating-point operations or a call is not possible
20726 in that case.
20728 @item inv20u
20729 @itemx inv20l
20730 Variants of the @samp{inv:minlat} strategy.  In the case
20731 that the inverse calculation is not separated from the multiply, they speed
20732 up division where the dividend fits into 20 bits (plus sign where applicable)
20733 by inserting a test to skip a number of operations in this case; this test
20734 slows down the case of larger dividends.  @samp{inv20u} assumes the case of a such
20735 a small dividend to be unlikely, and @samp{inv20l} assumes it to be likely.
20737 @end table
20739 For targets other than SHmedia @var{strategy} can be one of:
20741 @table @samp
20743 @item call-div1
20744 Calls a library function that uses the single-step division instruction
20745 @code{div1} to perform the operation.  Division by zero calculates an
20746 unspecified result and does not trap.  This is the default except for SH4,
20747 SH2A and SHcompact.
20749 @item call-fp
20750 Calls a library function that performs the operation in double precision
20751 floating point.  Division by zero causes a floating-point exception.  This is
20752 the default for SHcompact with FPU.  Specifying this for targets that do not
20753 have a double precision FPU will default to @code{call-div1}.
20755 @item call-table
20756 Calls a library function that uses a lookup table for small divisors and
20757 the @code{div1} instruction with case distinction for larger divisors.  Division
20758 by zero calculates an unspecified result and does not trap.  This is the default
20759 for SH4.  Specifying this for targets that do not have dynamic shift
20760 instructions will default to @code{call-div1}.
20762 @end table
20764 When a division strategy has not been specified the default strategy will be
20765 selected based on the current target.  For SH2A the default strategy is to
20766 use the @code{divs} and @code{divu} instructions instead of library function
20767 calls.
20769 @item -maccumulate-outgoing-args
20770 @opindex maccumulate-outgoing-args
20771 Reserve space once for outgoing arguments in the function prologue rather
20772 than around each call.  Generally beneficial for performance and size.  Also
20773 needed for unwinding to avoid changing the stack frame around conditional code.
20775 @item -mdivsi3_libfunc=@var{name}
20776 @opindex mdivsi3_libfunc=@var{name}
20777 Set the name of the library function used for 32-bit signed division to
20778 @var{name}.
20779 This only affects the name used in the @samp{call} and @samp{inv:call}
20780 division strategies, and the compiler still expects the same
20781 sets of input/output/clobbered registers as if this option were not present.
20783 @item -mfixed-range=@var{register-range}
20784 @opindex mfixed-range
20785 Generate code treating the given register range as fixed registers.
20786 A fixed register is one that the register allocator can not use.  This is
20787 useful when compiling kernel code.  A register range is specified as
20788 two registers separated by a dash.  Multiple register ranges can be
20789 specified separated by a comma.
20791 @item -mindexed-addressing
20792 @opindex mindexed-addressing
20793 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
20794 This is only safe if the hardware and/or OS implement 32-bit wrap-around
20795 semantics for the indexed addressing mode.  The architecture allows the
20796 implementation of processors with 64-bit MMU, which the OS could use to
20797 get 32-bit addressing, but since no current hardware implementation supports
20798 this or any other way to make the indexed addressing mode safe to use in
20799 the 32-bit ABI, the default is @option{-mno-indexed-addressing}.
20801 @item -mgettrcost=@var{number}
20802 @opindex mgettrcost=@var{number}
20803 Set the cost assumed for the @code{gettr} instruction to @var{number}.
20804 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
20806 @item -mpt-fixed
20807 @opindex mpt-fixed
20808 Assume @code{pt*} instructions won't trap.  This generally generates
20809 better-scheduled code, but is unsafe on current hardware.
20810 The current architecture
20811 definition says that @code{ptabs} and @code{ptrel} trap when the target 
20812 anded with 3 is 3.
20813 This has the unintentional effect of making it unsafe to schedule these
20814 instructions before a branch, or hoist them out of a loop.  For example,
20815 @code{__do_global_ctors}, a part of @file{libgcc}
20816 that runs constructors at program
20817 startup, calls functions in a list which is delimited by @minus{}1.  With the
20818 @option{-mpt-fixed} option, the @code{ptabs} is done before testing against @minus{}1.
20819 That means that all the constructors run a bit more quickly, but when
20820 the loop comes to the end of the list, the program crashes because @code{ptabs}
20821 loads @minus{}1 into a target register.  
20823 Since this option is unsafe for any
20824 hardware implementing the current architecture specification, the default
20825 is @option{-mno-pt-fixed}.  Unless specified explicitly with 
20826 @option{-mgettrcost}, @option{-mno-pt-fixed} also implies @option{-mgettrcost=100};
20827 this deters register allocation from using target registers for storing
20828 ordinary integers.
20830 @item -minvalid-symbols
20831 @opindex minvalid-symbols
20832 Assume symbols might be invalid.  Ordinary function symbols generated by
20833 the compiler are always valid to load with
20834 @code{movi}/@code{shori}/@code{ptabs} or
20835 @code{movi}/@code{shori}/@code{ptrel},
20836 but with assembler and/or linker tricks it is possible
20837 to generate symbols that cause @code{ptabs} or @code{ptrel} to trap.
20838 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
20839 It prevents cross-basic-block CSE, hoisting and most scheduling
20840 of symbol loads.  The default is @option{-mno-invalid-symbols}.
20842 @item -mbranch-cost=@var{num}
20843 @opindex mbranch-cost=@var{num}
20844 Assume @var{num} to be the cost for a branch instruction.  Higher numbers
20845 make the compiler try to generate more branch-free code if possible.  
20846 If not specified the value is selected depending on the processor type that
20847 is being compiled for.
20849 @item -mzdcbranch
20850 @itemx -mno-zdcbranch
20851 @opindex mzdcbranch
20852 @opindex mno-zdcbranch
20853 Assume (do not assume) that zero displacement conditional branch instructions
20854 @code{bt} and @code{bf} are fast.  If @option{-mzdcbranch} is specified, the
20855 compiler will try to prefer zero displacement branch code sequences.  This is
20856 enabled by default when generating code for SH4 and SH4A.  It can be explicitly
20857 disabled by specifying @option{-mno-zdcbranch}.
20859 @item -mfused-madd
20860 @itemx -mno-fused-madd
20861 @opindex mfused-madd
20862 @opindex mno-fused-madd
20863 Generate code that uses (does not use) the floating-point multiply and
20864 accumulate instructions.  These instructions are generated by default
20865 if hardware floating point is used.  The machine-dependent
20866 @option{-mfused-madd} option is now mapped to the machine-independent
20867 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
20868 mapped to @option{-ffp-contract=off}.
20870 @item -mfsca
20871 @itemx -mno-fsca
20872 @opindex mfsca
20873 @opindex mno-fsca
20874 Allow or disallow the compiler to emit the @code{fsca} instruction for sine
20875 and cosine approximations.  The option @code{-mfsca} must be used in
20876 combination with @code{-funsafe-math-optimizations}.  It is enabled by default
20877 when generating code for SH4A.  Using @code{-mno-fsca} disables sine and cosine
20878 approximations even if @code{-funsafe-math-optimizations} is in effect.
20880 @item -mfsrra
20881 @itemx -mno-fsrra
20882 @opindex mfsrra
20883 @opindex mno-fsrra
20884 Allow or disallow the compiler to emit the @code{fsrra} instruction for
20885 reciprocal square root approximations.  The option @code{-mfsrra} must be used
20886 in combination with @code{-funsafe-math-optimizations} and
20887 @code{-ffinite-math-only}.  It is enabled by default when generating code for
20888 SH4A.  Using @code{-mno-fsrra} disables reciprocal square root approximations
20889 even if @code{-funsafe-math-optimizations} and @code{-ffinite-math-only} are
20890 in effect.
20892 @item -mpretend-cmove
20893 @opindex mpretend-cmove
20894 Prefer zero-displacement conditional branches for conditional move instruction
20895 patterns.  This can result in faster code on the SH4 processor.
20897 @end table
20899 @node Solaris 2 Options
20900 @subsection Solaris 2 Options
20901 @cindex Solaris 2 options
20903 These @samp{-m} options are supported on Solaris 2:
20905 @table @gcctabopt
20906 @item -mimpure-text
20907 @opindex mimpure-text
20908 @option{-mimpure-text}, used in addition to @option{-shared}, tells
20909 the compiler to not pass @option{-z text} to the linker when linking a
20910 shared object.  Using this option, you can link position-dependent
20911 code into a shared object.
20913 @option{-mimpure-text} suppresses the ``relocations remain against
20914 allocatable but non-writable sections'' linker error message.
20915 However, the necessary relocations trigger copy-on-write, and the
20916 shared object is not actually shared across processes.  Instead of
20917 using @option{-mimpure-text}, you should compile all source code with
20918 @option{-fpic} or @option{-fPIC}.
20920 @end table
20922 These switches are supported in addition to the above on Solaris 2:
20924 @table @gcctabopt
20925 @item -pthreads
20926 @opindex pthreads
20927 Add support for multithreading using the POSIX threads library.  This
20928 option sets flags for both the preprocessor and linker.  This option does
20929 not affect the thread safety of object code produced  by the compiler or
20930 that of libraries supplied with it.
20932 @item -pthread
20933 @opindex pthread
20934 This is a synonym for @option{-pthreads}.
20935 @end table
20937 @node SPARC Options
20938 @subsection SPARC Options
20939 @cindex SPARC options
20941 These @samp{-m} options are supported on the SPARC:
20943 @table @gcctabopt
20944 @item -mno-app-regs
20945 @itemx -mapp-regs
20946 @opindex mno-app-regs
20947 @opindex mapp-regs
20948 Specify @option{-mapp-regs} to generate output using the global registers
20949 2 through 4, which the SPARC SVR4 ABI reserves for applications.  Like the
20950 global register 1, each global register 2 through 4 is then treated as an
20951 allocable register that is clobbered by function calls.  This is the default.
20953 To be fully SVR4 ABI-compliant at the cost of some performance loss,
20954 specify @option{-mno-app-regs}.  You should compile libraries and system
20955 software with this option.
20957 @item -mflat
20958 @itemx -mno-flat
20959 @opindex mflat
20960 @opindex mno-flat
20961 With @option{-mflat}, the compiler does not generate save/restore instructions
20962 and uses a ``flat'' or single register window model.  This model is compatible
20963 with the regular register window model.  The local registers and the input
20964 registers (0--5) are still treated as ``call-saved'' registers and are
20965 saved on the stack as needed.
20967 With @option{-mno-flat} (the default), the compiler generates save/restore
20968 instructions (except for leaf functions).  This is the normal operating mode.
20970 @item -mfpu
20971 @itemx -mhard-float
20972 @opindex mfpu
20973 @opindex mhard-float
20974 Generate output containing floating-point instructions.  This is the
20975 default.
20977 @item -mno-fpu
20978 @itemx -msoft-float
20979 @opindex mno-fpu
20980 @opindex msoft-float
20981 Generate output containing library calls for floating point.
20982 @strong{Warning:} the requisite libraries are not available for all SPARC
20983 targets.  Normally the facilities of the machine's usual C compiler are
20984 used, but this cannot be done directly in cross-compilation.  You must make
20985 your own arrangements to provide suitable library functions for
20986 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
20987 @samp{sparclite-*-*} do provide software floating-point support.
20989 @option{-msoft-float} changes the calling convention in the output file;
20990 therefore, it is only useful if you compile @emph{all} of a program with
20991 this option.  In particular, you need to compile @file{libgcc.a}, the
20992 library that comes with GCC, with @option{-msoft-float} in order for
20993 this to work.
20995 @item -mhard-quad-float
20996 @opindex mhard-quad-float
20997 Generate output containing quad-word (long double) floating-point
20998 instructions.
21000 @item -msoft-quad-float
21001 @opindex msoft-quad-float
21002 Generate output containing library calls for quad-word (long double)
21003 floating-point instructions.  The functions called are those specified
21004 in the SPARC ABI@.  This is the default.
21006 As of this writing, there are no SPARC implementations that have hardware
21007 support for the quad-word floating-point instructions.  They all invoke
21008 a trap handler for one of these instructions, and then the trap handler
21009 emulates the effect of the instruction.  Because of the trap handler overhead,
21010 this is much slower than calling the ABI library routines.  Thus the
21011 @option{-msoft-quad-float} option is the default.
21013 @item -mno-unaligned-doubles
21014 @itemx -munaligned-doubles
21015 @opindex mno-unaligned-doubles
21016 @opindex munaligned-doubles
21017 Assume that doubles have 8-byte alignment.  This is the default.
21019 With @option{-munaligned-doubles}, GCC assumes that doubles have 8-byte
21020 alignment only if they are contained in another type, or if they have an
21021 absolute address.  Otherwise, it assumes they have 4-byte alignment.
21022 Specifying this option avoids some rare compatibility problems with code
21023 generated by other compilers.  It is not the default because it results
21024 in a performance loss, especially for floating-point code.
21026 @item -muser-mode
21027 @itemx -mno-user-mode
21028 @opindex muser-mode
21029 @opindex mno-user-mode
21030 Do not generate code that can only run in supervisor mode.  This is relevant
21031 only for the @code{casa} instruction emitted for the LEON3 processor.  The
21032 default is @option{-mno-user-mode}.
21034 @item -mno-faster-structs
21035 @itemx -mfaster-structs
21036 @opindex mno-faster-structs
21037 @opindex mfaster-structs
21038 With @option{-mfaster-structs}, the compiler assumes that structures
21039 should have 8-byte alignment.  This enables the use of pairs of
21040 @code{ldd} and @code{std} instructions for copies in structure
21041 assignment, in place of twice as many @code{ld} and @code{st} pairs.
21042 However, the use of this changed alignment directly violates the SPARC
21043 ABI@.  Thus, it's intended only for use on targets where the developer
21044 acknowledges that their resulting code is not directly in line with
21045 the rules of the ABI@.
21047 @item -mcpu=@var{cpu_type}
21048 @opindex mcpu
21049 Set the instruction set, register set, and instruction scheduling parameters
21050 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
21051 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{hypersparc},
21052 @samp{leon}, @samp{leon3}, @samp{sparclite}, @samp{f930}, @samp{f934},
21053 @samp{sparclite86x}, @samp{sparclet}, @samp{tsc701}, @samp{v9},
21054 @samp{ultrasparc}, @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2},
21055 @samp{niagara3} and @samp{niagara4}.
21057 Native Solaris and GNU/Linux toolchains also support the value @samp{native},
21058 which selects the best architecture option for the host processor.
21059 @option{-mcpu=native} has no effect if GCC does not recognize
21060 the processor.
21062 Default instruction scheduling parameters are used for values that select
21063 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
21064 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
21066 Here is a list of each supported architecture and their supported
21067 implementations.
21069 @table @asis
21070 @item v7
21071 cypress
21073 @item v8
21074 supersparc, hypersparc, leon, leon3
21076 @item sparclite
21077 f930, f934, sparclite86x
21079 @item sparclet
21080 tsc701
21082 @item v9
21083 ultrasparc, ultrasparc3, niagara, niagara2, niagara3, niagara4
21084 @end table
21086 By default (unless configured otherwise), GCC generates code for the V7
21087 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
21088 additionally optimizes it for the Cypress CY7C602 chip, as used in the
21089 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
21090 SPARCStation 1, 2, IPX etc.
21092 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
21093 architecture.  The only difference from V7 code is that the compiler emits
21094 the integer multiply and integer divide instructions which exist in SPARC-V8
21095 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
21096 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
21097 2000 series.
21099 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
21100 the SPARC architecture.  This adds the integer multiply, integer divide step
21101 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
21102 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
21103 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
21104 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
21105 MB86934 chip, which is the more recent SPARClite with FPU@.
21107 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
21108 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
21109 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
21110 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
21111 optimizes it for the TEMIC SPARClet chip.
21113 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
21114 architecture.  This adds 64-bit integer and floating-point move instructions,
21115 3 additional floating-point condition code registers and conditional move
21116 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
21117 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
21118 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
21119 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
21120 @option{-mcpu=niagara}, the compiler additionally optimizes it for
21121 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
21122 additionally optimizes it for Sun UltraSPARC T2 chips. With
21123 @option{-mcpu=niagara3}, the compiler additionally optimizes it for Sun
21124 UltraSPARC T3 chips.  With @option{-mcpu=niagara4}, the compiler
21125 additionally optimizes it for Sun UltraSPARC T4 chips.
21127 @item -mtune=@var{cpu_type}
21128 @opindex mtune
21129 Set the instruction scheduling parameters for machine type
21130 @var{cpu_type}, but do not set the instruction set or register set that the
21131 option @option{-mcpu=@var{cpu_type}} does.
21133 The same values for @option{-mcpu=@var{cpu_type}} can be used for
21134 @option{-mtune=@var{cpu_type}}, but the only useful values are those
21135 that select a particular CPU implementation.  Those are @samp{cypress},
21136 @samp{supersparc}, @samp{hypersparc}, @samp{leon}, @samp{leon3}, @samp{f930},
21137 @samp{f934}, @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
21138 @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2}, @samp{niagara3} and
21139 @samp{niagara4}.  With native Solaris and GNU/Linux toolchains, @samp{native}
21140 can also be used.
21142 @item -mv8plus
21143 @itemx -mno-v8plus
21144 @opindex mv8plus
21145 @opindex mno-v8plus
21146 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
21147 difference from the V8 ABI is that the global and out registers are
21148 considered 64 bits wide.  This is enabled by default on Solaris in 32-bit
21149 mode for all SPARC-V9 processors.
21151 @item -mvis
21152 @itemx -mno-vis
21153 @opindex mvis
21154 @opindex mno-vis
21155 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
21156 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
21158 @item -mvis2
21159 @itemx -mno-vis2
21160 @opindex mvis2
21161 @opindex mno-vis2
21162 With @option{-mvis2}, GCC generates code that takes advantage of
21163 version 2.0 of the UltraSPARC Visual Instruction Set extensions.  The
21164 default is @option{-mvis2} when targeting a cpu that supports such
21165 instructions, such as UltraSPARC-III and later.  Setting @option{-mvis2}
21166 also sets @option{-mvis}.
21168 @item -mvis3
21169 @itemx -mno-vis3
21170 @opindex mvis3
21171 @opindex mno-vis3
21172 With @option{-mvis3}, GCC generates code that takes advantage of
21173 version 3.0 of the UltraSPARC Visual Instruction Set extensions.  The
21174 default is @option{-mvis3} when targeting a cpu that supports such
21175 instructions, such as niagara-3 and later.  Setting @option{-mvis3}
21176 also sets @option{-mvis2} and @option{-mvis}.
21178 @item -mcbcond
21179 @itemx -mno-cbcond
21180 @opindex mcbcond
21181 @opindex mno-cbcond
21182 With @option{-mcbcond}, GCC generates code that takes advantage of
21183 compare-and-branch instructions, as defined in the Sparc Architecture 2011.
21184 The default is @option{-mcbcond} when targeting a cpu that supports such
21185 instructions, such as niagara-4 and later.
21187 @item -mpopc
21188 @itemx -mno-popc
21189 @opindex mpopc
21190 @opindex mno-popc
21191 With @option{-mpopc}, GCC generates code that takes advantage of the UltraSPARC
21192 population count instruction.  The default is @option{-mpopc}
21193 when targeting a cpu that supports such instructions, such as Niagara-2 and
21194 later.
21196 @item -mfmaf
21197 @itemx -mno-fmaf
21198 @opindex mfmaf
21199 @opindex mno-fmaf
21200 With @option{-mfmaf}, GCC generates code that takes advantage of the UltraSPARC
21201 Fused Multiply-Add Floating-point extensions.  The default is @option{-mfmaf}
21202 when targeting a cpu that supports such instructions, such as Niagara-3 and
21203 later.
21205 @item -mfix-at697f
21206 @opindex mfix-at697f
21207 Enable the documented workaround for the single erratum of the Atmel AT697F
21208 processor (which corresponds to erratum #13 of the AT697E processor).
21210 @item -mfix-ut699
21211 @opindex mfix-ut699
21212 Enable the documented workarounds for the floating-point errata and the data
21213 cache nullify errata of the UT699 processor.
21214 @end table
21216 These @samp{-m} options are supported in addition to the above
21217 on SPARC-V9 processors in 64-bit environments:
21219 @table @gcctabopt
21220 @item -m32
21221 @itemx -m64
21222 @opindex m32
21223 @opindex m64
21224 Generate code for a 32-bit or 64-bit environment.
21225 The 32-bit environment sets int, long and pointer to 32 bits.
21226 The 64-bit environment sets int to 32 bits and long and pointer
21227 to 64 bits.
21229 @item -mcmodel=@var{which}
21230 @opindex mcmodel
21231 Set the code model to one of
21233 @table @samp
21234 @item medlow
21235 The Medium/Low code model: 64-bit addresses, programs
21236 must be linked in the low 32 bits of memory.  Programs can be statically
21237 or dynamically linked.
21239 @item medmid
21240 The Medium/Middle code model: 64-bit addresses, programs
21241 must be linked in the low 44 bits of memory, the text and data segments must
21242 be less than 2GB in size and the data segment must be located within 2GB of
21243 the text segment.
21245 @item medany
21246 The Medium/Anywhere code model: 64-bit addresses, programs
21247 may be linked anywhere in memory, the text and data segments must be less
21248 than 2GB in size and the data segment must be located within 2GB of the
21249 text segment.
21251 @item embmedany
21252 The Medium/Anywhere code model for embedded systems:
21253 64-bit addresses, the text and data segments must be less than 2GB in
21254 size, both starting anywhere in memory (determined at link time).  The
21255 global register %g4 points to the base of the data segment.  Programs
21256 are statically linked and PIC is not supported.
21257 @end table
21259 @item -mmemory-model=@var{mem-model}
21260 @opindex mmemory-model
21261 Set the memory model in force on the processor to one of
21263 @table @samp
21264 @item default
21265 The default memory model for the processor and operating system.
21267 @item rmo
21268 Relaxed Memory Order
21270 @item pso
21271 Partial Store Order
21273 @item tso
21274 Total Store Order
21276 @item sc
21277 Sequential Consistency
21278 @end table
21280 These memory models are formally defined in Appendix D of the Sparc V9
21281 architecture manual, as set in the processor's @code{PSTATE.MM} field.
21283 @item -mstack-bias
21284 @itemx -mno-stack-bias
21285 @opindex mstack-bias
21286 @opindex mno-stack-bias
21287 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
21288 frame pointer if present, are offset by @minus{}2047 which must be added back
21289 when making stack frame references.  This is the default in 64-bit mode.
21290 Otherwise, assume no such offset is present.
21291 @end table
21293 @node SPU Options
21294 @subsection SPU Options
21295 @cindex SPU options
21297 These @samp{-m} options are supported on the SPU:
21299 @table @gcctabopt
21300 @item -mwarn-reloc
21301 @itemx -merror-reloc
21302 @opindex mwarn-reloc
21303 @opindex merror-reloc
21305 The loader for SPU does not handle dynamic relocations.  By default, GCC
21306 gives an error when it generates code that requires a dynamic
21307 relocation.  @option{-mno-error-reloc} disables the error,
21308 @option{-mwarn-reloc} generates a warning instead.
21310 @item -msafe-dma
21311 @itemx -munsafe-dma
21312 @opindex msafe-dma
21313 @opindex munsafe-dma
21315 Instructions that initiate or test completion of DMA must not be
21316 reordered with respect to loads and stores of the memory that is being
21317 accessed.
21318 With @option{-munsafe-dma} you must use the @code{volatile} keyword to protect
21319 memory accesses, but that can lead to inefficient code in places where the
21320 memory is known to not change.  Rather than mark the memory as volatile,
21321 you can use @option{-msafe-dma} to tell the compiler to treat
21322 the DMA instructions as potentially affecting all memory.  
21324 @item -mbranch-hints
21325 @opindex mbranch-hints
21327 By default, GCC generates a branch hint instruction to avoid
21328 pipeline stalls for always-taken or probably-taken branches.  A hint
21329 is not generated closer than 8 instructions away from its branch.
21330 There is little reason to disable them, except for debugging purposes,
21331 or to make an object a little bit smaller.
21333 @item -msmall-mem
21334 @itemx -mlarge-mem
21335 @opindex msmall-mem
21336 @opindex mlarge-mem
21338 By default, GCC generates code assuming that addresses are never larger
21339 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
21340 a full 32-bit address.
21342 @item -mstdmain
21343 @opindex mstdmain
21345 By default, GCC links against startup code that assumes the SPU-style
21346 main function interface (which has an unconventional parameter list).
21347 With @option{-mstdmain}, GCC links your program against startup
21348 code that assumes a C99-style interface to @code{main}, including a
21349 local copy of @code{argv} strings.
21351 @item -mfixed-range=@var{register-range}
21352 @opindex mfixed-range
21353 Generate code treating the given register range as fixed registers.
21354 A fixed register is one that the register allocator cannot use.  This is
21355 useful when compiling kernel code.  A register range is specified as
21356 two registers separated by a dash.  Multiple register ranges can be
21357 specified separated by a comma.
21359 @item -mea32
21360 @itemx -mea64
21361 @opindex mea32
21362 @opindex mea64
21363 Compile code assuming that pointers to the PPU address space accessed
21364 via the @code{__ea} named address space qualifier are either 32 or 64
21365 bits wide.  The default is 32 bits.  As this is an ABI-changing option,
21366 all object code in an executable must be compiled with the same setting.
21368 @item -maddress-space-conversion
21369 @itemx -mno-address-space-conversion
21370 @opindex maddress-space-conversion
21371 @opindex mno-address-space-conversion
21372 Allow/disallow treating the @code{__ea} address space as superset
21373 of the generic address space.  This enables explicit type casts
21374 between @code{__ea} and generic pointer as well as implicit
21375 conversions of generic pointers to @code{__ea} pointers.  The
21376 default is to allow address space pointer conversions.
21378 @item -mcache-size=@var{cache-size}
21379 @opindex mcache-size
21380 This option controls the version of libgcc that the compiler links to an
21381 executable and selects a software-managed cache for accessing variables
21382 in the @code{__ea} address space with a particular cache size.  Possible
21383 options for @var{cache-size} are @samp{8}, @samp{16}, @samp{32}, @samp{64}
21384 and @samp{128}.  The default cache size is 64KB.
21386 @item -matomic-updates
21387 @itemx -mno-atomic-updates
21388 @opindex matomic-updates
21389 @opindex mno-atomic-updates
21390 This option controls the version of libgcc that the compiler links to an
21391 executable and selects whether atomic updates to the software-managed
21392 cache of PPU-side variables are used.  If you use atomic updates, changes
21393 to a PPU variable from SPU code using the @code{__ea} named address space
21394 qualifier do not interfere with changes to other PPU variables residing
21395 in the same cache line from PPU code.  If you do not use atomic updates,
21396 such interference may occur; however, writing back cache lines is
21397 more efficient.  The default behavior is to use atomic updates.
21399 @item -mdual-nops
21400 @itemx -mdual-nops=@var{n}
21401 @opindex mdual-nops
21402 By default, GCC inserts nops to increase dual issue when it expects
21403 it to increase performance.  @var{n} can be a value from 0 to 10.  A
21404 smaller @var{n} inserts fewer nops.  10 is the default, 0 is the
21405 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
21407 @item -mhint-max-nops=@var{n}
21408 @opindex mhint-max-nops
21409 Maximum number of nops to insert for a branch hint.  A branch hint must
21410 be at least 8 instructions away from the branch it is affecting.  GCC
21411 inserts up to @var{n} nops to enforce this, otherwise it does not
21412 generate the branch hint.
21414 @item -mhint-max-distance=@var{n}
21415 @opindex mhint-max-distance
21416 The encoding of the branch hint instruction limits the hint to be within
21417 256 instructions of the branch it is affecting.  By default, GCC makes
21418 sure it is within 125.
21420 @item -msafe-hints
21421 @opindex msafe-hints
21422 Work around a hardware bug that causes the SPU to stall indefinitely.
21423 By default, GCC inserts the @code{hbrp} instruction to make sure
21424 this stall won't happen.
21426 @end table
21428 @node System V Options
21429 @subsection Options for System V
21431 These additional options are available on System V Release 4 for
21432 compatibility with other compilers on those systems:
21434 @table @gcctabopt
21435 @item -G
21436 @opindex G
21437 Create a shared object.
21438 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
21440 @item -Qy
21441 @opindex Qy
21442 Identify the versions of each tool used by the compiler, in a
21443 @code{.ident} assembler directive in the output.
21445 @item -Qn
21446 @opindex Qn
21447 Refrain from adding @code{.ident} directives to the output file (this is
21448 the default).
21450 @item -YP,@var{dirs}
21451 @opindex YP
21452 Search the directories @var{dirs}, and no others, for libraries
21453 specified with @option{-l}.
21455 @item -Ym,@var{dir}
21456 @opindex Ym
21457 Look in the directory @var{dir} to find the M4 preprocessor.
21458 The assembler uses this option.
21459 @c This is supposed to go with a -Yd for predefined M4 macro files, but
21460 @c the generic assembler that comes with Solaris takes just -Ym.
21461 @end table
21463 @node TILE-Gx Options
21464 @subsection TILE-Gx Options
21465 @cindex TILE-Gx options
21467 These @samp{-m} options are supported on the TILE-Gx:
21469 @table @gcctabopt
21470 @item -mcmodel=small
21471 @opindex mcmodel=small
21472 Generate code for the small model.  The distance for direct calls is
21473 limited to 500M in either direction.  PC-relative addresses are 32
21474 bits.  Absolute addresses support the full address range.
21476 @item -mcmodel=large
21477 @opindex mcmodel=large
21478 Generate code for the large model.  There is no limitation on call
21479 distance, pc-relative addresses, or absolute addresses.
21481 @item -mcpu=@var{name}
21482 @opindex mcpu
21483 Selects the type of CPU to be targeted.  Currently the only supported
21484 type is @samp{tilegx}.
21486 @item -m32
21487 @itemx -m64
21488 @opindex m32
21489 @opindex m64
21490 Generate code for a 32-bit or 64-bit environment.  The 32-bit
21491 environment sets int, long, and pointer to 32 bits.  The 64-bit
21492 environment sets int to 32 bits and long and pointer to 64 bits.
21494 @item -mbig-endian
21495 @itemx -mlittle-endian
21496 @opindex mbig-endian
21497 @opindex mlittle-endian
21498 Generate code in big/little endian mode, respectively.
21499 @end table
21501 @node TILEPro Options
21502 @subsection TILEPro Options
21503 @cindex TILEPro options
21505 These @samp{-m} options are supported on the TILEPro:
21507 @table @gcctabopt
21508 @item -mcpu=@var{name}
21509 @opindex mcpu
21510 Selects the type of CPU to be targeted.  Currently the only supported
21511 type is @samp{tilepro}.
21513 @item -m32
21514 @opindex m32
21515 Generate code for a 32-bit environment, which sets int, long, and
21516 pointer to 32 bits.  This is the only supported behavior so the flag
21517 is essentially ignored.
21518 @end table
21520 @node V850 Options
21521 @subsection V850 Options
21522 @cindex V850 Options
21524 These @samp{-m} options are defined for V850 implementations:
21526 @table @gcctabopt
21527 @item -mlong-calls
21528 @itemx -mno-long-calls
21529 @opindex mlong-calls
21530 @opindex mno-long-calls
21531 Treat all calls as being far away (near).  If calls are assumed to be
21532 far away, the compiler always loads the function's address into a
21533 register, and calls indirect through the pointer.
21535 @item -mno-ep
21536 @itemx -mep
21537 @opindex mno-ep
21538 @opindex mep
21539 Do not optimize (do optimize) basic blocks that use the same index
21540 pointer 4 or more times to copy pointer into the @code{ep} register, and
21541 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
21542 option is on by default if you optimize.
21544 @item -mno-prolog-function
21545 @itemx -mprolog-function
21546 @opindex mno-prolog-function
21547 @opindex mprolog-function
21548 Do not use (do use) external functions to save and restore registers
21549 at the prologue and epilogue of a function.  The external functions
21550 are slower, but use less code space if more than one function saves
21551 the same number of registers.  The @option{-mprolog-function} option
21552 is on by default if you optimize.
21554 @item -mspace
21555 @opindex mspace
21556 Try to make the code as small as possible.  At present, this just turns
21557 on the @option{-mep} and @option{-mprolog-function} options.
21559 @item -mtda=@var{n}
21560 @opindex mtda
21561 Put static or global variables whose size is @var{n} bytes or less into
21562 the tiny data area that register @code{ep} points to.  The tiny data
21563 area can hold up to 256 bytes in total (128 bytes for byte references).
21565 @item -msda=@var{n}
21566 @opindex msda
21567 Put static or global variables whose size is @var{n} bytes or less into
21568 the small data area that register @code{gp} points to.  The small data
21569 area can hold up to 64 kilobytes.
21571 @item -mzda=@var{n}
21572 @opindex mzda
21573 Put static or global variables whose size is @var{n} bytes or less into
21574 the first 32 kilobytes of memory.
21576 @item -mv850
21577 @opindex mv850
21578 Specify that the target processor is the V850.
21580 @item -mv850e3v5
21581 @opindex mv850e3v5
21582 Specify that the target processor is the V850E3V5.  The preprocessor
21583 constant @samp{__v850e3v5__} is defined if this option is used.
21585 @item -mv850e2v4
21586 @opindex mv850e2v4
21587 Specify that the target processor is the V850E3V5.  This is an alias for
21588 the @option{-mv850e3v5} option.
21590 @item -mv850e2v3
21591 @opindex mv850e2v3
21592 Specify that the target processor is the V850E2V3.  The preprocessor
21593 constant @samp{__v850e2v3__} is defined if this option is used.
21595 @item -mv850e2
21596 @opindex mv850e2
21597 Specify that the target processor is the V850E2.  The preprocessor
21598 constant @samp{__v850e2__} is defined if this option is used.
21600 @item -mv850e1
21601 @opindex mv850e1
21602 Specify that the target processor is the V850E1.  The preprocessor
21603 constants @samp{__v850e1__} and @samp{__v850e__} are defined if
21604 this option is used.
21606 @item -mv850es
21607 @opindex mv850es
21608 Specify that the target processor is the V850ES.  This is an alias for
21609 the @option{-mv850e1} option.
21611 @item -mv850e
21612 @opindex mv850e
21613 Specify that the target processor is the V850E@.  The preprocessor
21614 constant @samp{__v850e__} is defined if this option is used.
21616 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
21617 nor @option{-mv850e2} nor @option{-mv850e2v3} nor @option{-mv850e3v5}
21618 are defined then a default target processor is chosen and the
21619 relevant @samp{__v850*__} preprocessor constant is defined.
21621 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
21622 defined, regardless of which processor variant is the target.
21624 @item -mdisable-callt
21625 @itemx -mno-disable-callt
21626 @opindex mdisable-callt
21627 @opindex mno-disable-callt
21628 This option suppresses generation of the @code{CALLT} instruction for the
21629 v850e, v850e1, v850e2, v850e2v3 and v850e3v5 flavors of the v850
21630 architecture.
21632 This option is enabled by default when the RH850 ABI is
21633 in use (see @option{-mrh850-abi}), and disabled by default when the
21634 GCC ABI is in use.  If @code{CALLT} instructions are being generated
21635 then the C preprocessor symbol @code{__V850_CALLT__} will be defined.
21637 @item -mrelax
21638 @itemx -mno-relax
21639 @opindex mrelax
21640 @opindex mno-relax
21641 Pass on (or do not pass on) the @option{-mrelax} command line option
21642 to the assembler.
21644 @item -mlong-jumps
21645 @itemx -mno-long-jumps
21646 @opindex mlong-jumps
21647 @opindex mno-long-jumps
21648 Disable (or re-enable) the generation of PC-relative jump instructions.
21650 @item -msoft-float
21651 @itemx -mhard-float
21652 @opindex msoft-float
21653 @opindex mhard-float
21654 Disable (or re-enable) the generation of hardware floating point
21655 instructions.  This option is only significant when the target
21656 architecture is @samp{V850E2V3} or higher.  If hardware floating point
21657 instructions are being generated then the C preprocessor symbol
21658 @code{__FPU_OK__} will be defined, otherwise the symbol
21659 @code{__NO_FPU__} will be defined.
21661 @item -mloop
21662 @opindex mloop
21663 Enables the use of the e3v5 LOOP instruction.  The use of this
21664 instruction is not enabled by default when the e3v5 architecture is
21665 selected because its use is still experimental.
21667 @item -mrh850-abi
21668 @itemx -mghs
21669 @opindex mrh850-abi
21670 @opindex mghs
21671 Enables support for the RH850 version of the V850 ABI.  This is the
21672 default.  With this version of the ABI the following rules apply:
21674 @itemize
21675 @item
21676 Integer sized structures and unions are returned via a memory pointer
21677 rather than a register.
21679 @item
21680 Large structures and unions (more than 8 bytes in size) are passed by
21681 value.
21683 @item
21684 Functions are aligned to 16-bit boundaries.
21686 @item
21687 The @option{-m8byte-align} command line option is supported.
21689 @item
21690 The @option{-mdisable-callt} command line option is enabled by
21691 default.  The @option{-mno-disable-callt} command line option is not
21692 supported.
21693 @end itemize
21695 When this version of the ABI is enabled the C preprocessor symbol
21696 @code{__V850_RH850_ABI__} is defined.
21698 @item -mgcc-abi
21699 @opindex mgcc-abi
21700 Enables support for the old GCC version of the V850 ABI.  With this
21701 version of the ABI the following rules apply:
21703 @itemize
21704 @item
21705 Integer sized structures and unions are returned in register @code{r10}.
21707 @item
21708 Large structures and unions (more than 8 bytes in size) are passed by
21709 reference.
21711 @item
21712 Functions are aligned to 32-bit boundaries, unless optimizing for
21713 size.
21715 @item
21716 The @option{-m8byte-align} command line option is not supported.
21718 @item
21719 The @option{-mdisable-callt} command line option is supported but not
21720 enabled by default.
21721 @end itemize
21723 When this version of the ABI is enabled the C preprocessor symbol
21724 @code{__V850_GCC_ABI__} is defined.
21726 @item -m8byte-align
21727 @itemx -mno-8byte-align
21728 @opindex m8byte-align
21729 @opindex mno-8byte-align
21730 Enables support for @code{doubles} and @code{long long} types to be
21731 aligned on 8-byte boundaries.  The default is to restrict the
21732 alignment of all objects to at most 4-bytes.  When
21733 @option{-m8byte-align} is in effect the C preprocessor symbol
21734 @code{__V850_8BYTE_ALIGN__} will be defined.
21736 @item -mbig-switch
21737 @opindex mbig-switch
21738 Generate code suitable for big switch tables.  Use this option only if
21739 the assembler/linker complain about out of range branches within a switch
21740 table.
21742 @item -mapp-regs
21743 @opindex mapp-regs
21744 This option causes r2 and r5 to be used in the code generated by
21745 the compiler.  This setting is the default.
21747 @item -mno-app-regs
21748 @opindex mno-app-regs
21749 This option causes r2 and r5 to be treated as fixed registers.
21751 @end table
21753 @node VAX Options
21754 @subsection VAX Options
21755 @cindex VAX options
21757 These @samp{-m} options are defined for the VAX:
21759 @table @gcctabopt
21760 @item -munix
21761 @opindex munix
21762 Do not output certain jump instructions (@code{aobleq} and so on)
21763 that the Unix assembler for the VAX cannot handle across long
21764 ranges.
21766 @item -mgnu
21767 @opindex mgnu
21768 Do output those jump instructions, on the assumption that the
21769 GNU assembler is being used.
21771 @item -mg
21772 @opindex mg
21773 Output code for G-format floating-point numbers instead of D-format.
21774 @end table
21776 @node VMS Options
21777 @subsection VMS Options
21779 These @samp{-m} options are defined for the VMS implementations:
21781 @table @gcctabopt
21782 @item -mvms-return-codes
21783 @opindex mvms-return-codes
21784 Return VMS condition codes from @code{main}. The default is to return POSIX-style
21785 condition (e.g.@ error) codes.
21787 @item -mdebug-main=@var{prefix}
21788 @opindex mdebug-main=@var{prefix}
21789 Flag the first routine whose name starts with @var{prefix} as the main
21790 routine for the debugger.
21792 @item -mmalloc64
21793 @opindex mmalloc64
21794 Default to 64-bit memory allocation routines.
21796 @item -mpointer-size=@var{size}
21797 @opindex -mpointer-size=@var{size}
21798 Set the default size of pointers. Possible options for @var{size} are
21799 @samp{32} or @samp{short} for 32 bit pointers, @samp{64} or @samp{long}
21800 for 64 bit pointers, and @samp{no} for supporting only 32 bit pointers.
21801 The later option disables @code{pragma pointer_size}.
21802 @end table
21804 @node VxWorks Options
21805 @subsection VxWorks Options
21806 @cindex VxWorks Options
21808 The options in this section are defined for all VxWorks targets.
21809 Options specific to the target hardware are listed with the other
21810 options for that target.
21812 @table @gcctabopt
21813 @item -mrtp
21814 @opindex mrtp
21815 GCC can generate code for both VxWorks kernels and real time processes
21816 (RTPs).  This option switches from the former to the latter.  It also
21817 defines the preprocessor macro @code{__RTP__}.
21819 @item -non-static
21820 @opindex non-static
21821 Link an RTP executable against shared libraries rather than static
21822 libraries.  The options @option{-static} and @option{-shared} can
21823 also be used for RTPs (@pxref{Link Options}); @option{-static}
21824 is the default.
21826 @item -Bstatic
21827 @itemx -Bdynamic
21828 @opindex Bstatic
21829 @opindex Bdynamic
21830 These options are passed down to the linker.  They are defined for
21831 compatibility with Diab.
21833 @item -Xbind-lazy
21834 @opindex Xbind-lazy
21835 Enable lazy binding of function calls.  This option is equivalent to
21836 @option{-Wl,-z,now} and is defined for compatibility with Diab.
21838 @item -Xbind-now
21839 @opindex Xbind-now
21840 Disable lazy binding of function calls.  This option is the default and
21841 is defined for compatibility with Diab.
21842 @end table
21844 @node x86-64 Options
21845 @subsection x86-64 Options
21846 @cindex x86-64 options
21848 These are listed under @xref{i386 and x86-64 Options}.
21850 @node Xstormy16 Options
21851 @subsection Xstormy16 Options
21852 @cindex Xstormy16 Options
21854 These options are defined for Xstormy16:
21856 @table @gcctabopt
21857 @item -msim
21858 @opindex msim
21859 Choose startup files and linker script suitable for the simulator.
21860 @end table
21862 @node Xtensa Options
21863 @subsection Xtensa Options
21864 @cindex Xtensa Options
21866 These options are supported for Xtensa targets:
21868 @table @gcctabopt
21869 @item -mconst16
21870 @itemx -mno-const16
21871 @opindex mconst16
21872 @opindex mno-const16
21873 Enable or disable use of @code{CONST16} instructions for loading
21874 constant values.  The @code{CONST16} instruction is currently not a
21875 standard option from Tensilica.  When enabled, @code{CONST16}
21876 instructions are always used in place of the standard @code{L32R}
21877 instructions.  The use of @code{CONST16} is enabled by default only if
21878 the @code{L32R} instruction is not available.
21880 @item -mfused-madd
21881 @itemx -mno-fused-madd
21882 @opindex mfused-madd
21883 @opindex mno-fused-madd
21884 Enable or disable use of fused multiply/add and multiply/subtract
21885 instructions in the floating-point option.  This has no effect if the
21886 floating-point option is not also enabled.  Disabling fused multiply/add
21887 and multiply/subtract instructions forces the compiler to use separate
21888 instructions for the multiply and add/subtract operations.  This may be
21889 desirable in some cases where strict IEEE 754-compliant results are
21890 required: the fused multiply add/subtract instructions do not round the
21891 intermediate result, thereby producing results with @emph{more} bits of
21892 precision than specified by the IEEE standard.  Disabling fused multiply
21893 add/subtract instructions also ensures that the program output is not
21894 sensitive to the compiler's ability to combine multiply and add/subtract
21895 operations.
21897 @item -mserialize-volatile
21898 @itemx -mno-serialize-volatile
21899 @opindex mserialize-volatile
21900 @opindex mno-serialize-volatile
21901 When this option is enabled, GCC inserts @code{MEMW} instructions before
21902 @code{volatile} memory references to guarantee sequential consistency.
21903 The default is @option{-mserialize-volatile}.  Use
21904 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
21906 @item -mforce-no-pic
21907 @opindex mforce-no-pic
21908 For targets, like GNU/Linux, where all user-mode Xtensa code must be
21909 position-independent code (PIC), this option disables PIC for compiling
21910 kernel code.
21912 @item -mtext-section-literals
21913 @itemx -mno-text-section-literals
21914 @opindex mtext-section-literals
21915 @opindex mno-text-section-literals
21916 Control the treatment of literal pools.  The default is
21917 @option{-mno-text-section-literals}, which places literals in a separate
21918 section in the output file.  This allows the literal pool to be placed
21919 in a data RAM/ROM, and it also allows the linker to combine literal
21920 pools from separate object files to remove redundant literals and
21921 improve code size.  With @option{-mtext-section-literals}, the literals
21922 are interspersed in the text section in order to keep them as close as
21923 possible to their references.  This may be necessary for large assembly
21924 files.
21926 @item -mtarget-align
21927 @itemx -mno-target-align
21928 @opindex mtarget-align
21929 @opindex mno-target-align
21930 When this option is enabled, GCC instructs the assembler to
21931 automatically align instructions to reduce branch penalties at the
21932 expense of some code density.  The assembler attempts to widen density
21933 instructions to align branch targets and the instructions following call
21934 instructions.  If there are not enough preceding safe density
21935 instructions to align a target, no widening is performed.  The
21936 default is @option{-mtarget-align}.  These options do not affect the
21937 treatment of auto-aligned instructions like @code{LOOP}, which the
21938 assembler always aligns, either by widening density instructions or
21939 by inserting NOP instructions.
21941 @item -mlongcalls
21942 @itemx -mno-longcalls
21943 @opindex mlongcalls
21944 @opindex mno-longcalls
21945 When this option is enabled, GCC instructs the assembler to translate
21946 direct calls to indirect calls unless it can determine that the target
21947 of a direct call is in the range allowed by the call instruction.  This
21948 translation typically occurs for calls to functions in other source
21949 files.  Specifically, the assembler translates a direct @code{CALL}
21950 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
21951 The default is @option{-mno-longcalls}.  This option should be used in
21952 programs where the call target can potentially be out of range.  This
21953 option is implemented in the assembler, not the compiler, so the
21954 assembly code generated by GCC still shows direct call
21955 instructions---look at the disassembled object code to see the actual
21956 instructions.  Note that the assembler uses an indirect call for
21957 every cross-file call, not just those that really are out of range.
21958 @end table
21960 @node zSeries Options
21961 @subsection zSeries Options
21962 @cindex zSeries options
21964 These are listed under @xref{S/390 and zSeries Options}.
21966 @node Code Gen Options
21967 @section Options for Code Generation Conventions
21968 @cindex code generation conventions
21969 @cindex options, code generation
21970 @cindex run-time options
21972 These machine-independent options control the interface conventions
21973 used in code generation.
21975 Most of them have both positive and negative forms; the negative form
21976 of @option{-ffoo} is @option{-fno-foo}.  In the table below, only
21977 one of the forms is listed---the one that is not the default.  You
21978 can figure out the other form by either removing @samp{no-} or adding
21981 @table @gcctabopt
21982 @item -fbounds-check
21983 @opindex fbounds-check
21984 For front ends that support it, generate additional code to check that
21985 indices used to access arrays are within the declared range.  This is
21986 currently only supported by the Java and Fortran front ends, where
21987 this option defaults to true and false respectively.
21989 @item -fstack-reuse=@var{reuse-level}
21990 @opindex fstack_reuse
21991 This option controls stack space reuse for user declared local/auto variables
21992 and compiler generated temporaries.  @var{reuse_level} can be @samp{all},
21993 @samp{named_vars}, or @samp{none}. @samp{all} enables stack reuse for all
21994 local variables and temporaries, @samp{named_vars} enables the reuse only for
21995 user defined local variables with names, and @samp{none} disables stack reuse
21996 completely. The default value is @samp{all}. The option is needed when the
21997 program extends the lifetime of a scoped local variable or a compiler generated
21998 temporary beyond the end point defined by the language.  When a lifetime of
21999 a variable ends, and if the variable lives in memory, the optimizing compiler
22000 has the freedom to reuse its stack space with other temporaries or scoped
22001 local variables whose live range does not overlap with it. Legacy code extending
22002 local lifetime will likely to break with the stack reuse optimization.
22004 For example,
22006 @smallexample
22007    int *p;
22008    @{
22009      int local1;
22011      p = &local1;
22012      local1 = 10;
22013      ....
22014    @}
22015    @{
22016       int local2;
22017       local2 = 20;
22018       ...
22019    @}
22021    if (*p == 10)  // out of scope use of local1
22022      @{
22024      @}
22025 @end smallexample
22027 Another example:
22028 @smallexample
22030    struct A
22031    @{
22032        A(int k) : i(k), j(k) @{ @}
22033        int i;
22034        int j;
22035    @};
22037    A *ap;
22039    void foo(const A& ar)
22040    @{
22041       ap = &ar;
22042    @}
22044    void bar()
22045    @{
22046       foo(A(10)); // temp object's lifetime ends when foo returns
22048       @{
22049         A a(20);
22050         ....
22051       @}
22052       ap->i+= 10;  // ap references out of scope temp whose space
22053                    // is reused with a. What is the value of ap->i?
22054    @}
22056 @end smallexample
22058 The lifetime of a compiler generated temporary is well defined by the C++
22059 standard. When a lifetime of a temporary ends, and if the temporary lives
22060 in memory, the optimizing compiler has the freedom to reuse its stack
22061 space with other temporaries or scoped local variables whose live range
22062 does not overlap with it. However some of the legacy code relies on
22063 the behavior of older compilers in which temporaries' stack space is
22064 not reused, the aggressive stack reuse can lead to runtime errors. This
22065 option is used to control the temporary stack reuse optimization.
22067 @item -ftrapv
22068 @opindex ftrapv
22069 This option generates traps for signed overflow on addition, subtraction,
22070 multiplication operations.
22072 @item -fwrapv
22073 @opindex fwrapv
22074 This option instructs the compiler to assume that signed arithmetic
22075 overflow of addition, subtraction and multiplication wraps around
22076 using twos-complement representation.  This flag enables some optimizations
22077 and disables others.  This option is enabled by default for the Java
22078 front end, as required by the Java language specification.
22080 @item -fexceptions
22081 @opindex fexceptions
22082 Enable exception handling.  Generates extra code needed to propagate
22083 exceptions.  For some targets, this implies GCC generates frame
22084 unwind information for all functions, which can produce significant data
22085 size overhead, although it does not affect execution.  If you do not
22086 specify this option, GCC enables it by default for languages like
22087 C++ that normally require exception handling, and disables it for
22088 languages like C that do not normally require it.  However, you may need
22089 to enable this option when compiling C code that needs to interoperate
22090 properly with exception handlers written in C++.  You may also wish to
22091 disable this option if you are compiling older C++ programs that don't
22092 use exception handling.
22094 @item -fnon-call-exceptions
22095 @opindex fnon-call-exceptions
22096 Generate code that allows trapping instructions to throw exceptions.
22097 Note that this requires platform-specific runtime support that does
22098 not exist everywhere.  Moreover, it only allows @emph{trapping}
22099 instructions to throw exceptions, i.e.@: memory references or floating-point
22100 instructions.  It does not allow exceptions to be thrown from
22101 arbitrary signal handlers such as @code{SIGALRM}.
22103 @item -fdelete-dead-exceptions
22104 @opindex fdelete-dead-exceptions
22105 Consider that instructions that may throw exceptions but don't otherwise
22106 contribute to the execution of the program can be optimized away.
22107 This option is enabled by default for the Ada front end, as permitted by
22108 the Ada language specification.
22109 Optimization passes that cause dead exceptions to be removed are enabled independently at different optimization levels.
22111 @item -funwind-tables
22112 @opindex funwind-tables
22113 Similar to @option{-fexceptions}, except that it just generates any needed
22114 static data, but does not affect the generated code in any other way.
22115 You normally do not need to enable this option; instead, a language processor
22116 that needs this handling enables it on your behalf.
22118 @item -fasynchronous-unwind-tables
22119 @opindex fasynchronous-unwind-tables
22120 Generate unwind table in DWARF 2 format, if supported by target machine.  The
22121 table is exact at each instruction boundary, so it can be used for stack
22122 unwinding from asynchronous events (such as debugger or garbage collector).
22124 @item -fno-gnu-unique
22125 @opindex fno-gnu-unique
22126 On systems with recent GNU assembler and C library, the C++ compiler
22127 uses the @code{STB_GNU_UNIQUE} binding to make sure that definitions
22128 of template static data members and static local variables in inline
22129 functions are unique even in the presence of @code{RTLD_LOCAL}; this
22130 is necessary to avoid problems with a library used by two different
22131 @code{RTLD_LOCAL} plugins depending on a definition in one of them and
22132 therefore disagreeing with the other one about the binding of the
22133 symbol.  But this causes @code{dlclose} to be ignored for affected
22134 DSOs; if your program relies on reinitialization of a DSO via
22135 @code{dlclose} and @code{dlopen}, you can use
22136 @option{-fno-gnu-unique}.
22138 @item -fpcc-struct-return
22139 @opindex fpcc-struct-return
22140 Return ``short'' @code{struct} and @code{union} values in memory like
22141 longer ones, rather than in registers.  This convention is less
22142 efficient, but it has the advantage of allowing intercallability between
22143 GCC-compiled files and files compiled with other compilers, particularly
22144 the Portable C Compiler (pcc).
22146 The precise convention for returning structures in memory depends
22147 on the target configuration macros.
22149 Short structures and unions are those whose size and alignment match
22150 that of some integer type.
22152 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
22153 switch is not binary compatible with code compiled with the
22154 @option{-freg-struct-return} switch.
22155 Use it to conform to a non-default application binary interface.
22157 @item -freg-struct-return
22158 @opindex freg-struct-return
22159 Return @code{struct} and @code{union} values in registers when possible.
22160 This is more efficient for small structures than
22161 @option{-fpcc-struct-return}.
22163 If you specify neither @option{-fpcc-struct-return} nor
22164 @option{-freg-struct-return}, GCC defaults to whichever convention is
22165 standard for the target.  If there is no standard convention, GCC
22166 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
22167 the principal compiler.  In those cases, we can choose the standard, and
22168 we chose the more efficient register return alternative.
22170 @strong{Warning:} code compiled with the @option{-freg-struct-return}
22171 switch is not binary compatible with code compiled with the
22172 @option{-fpcc-struct-return} switch.
22173 Use it to conform to a non-default application binary interface.
22175 @item -fshort-enums
22176 @opindex fshort-enums
22177 Allocate to an @code{enum} type only as many bytes as it needs for the
22178 declared range of possible values.  Specifically, the @code{enum} type
22179 is equivalent to the smallest integer type that has enough room.
22181 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
22182 code that is not binary compatible with code generated without that switch.
22183 Use it to conform to a non-default application binary interface.
22185 @item -fshort-double
22186 @opindex fshort-double
22187 Use the same size for @code{double} as for @code{float}.
22189 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
22190 code that is not binary compatible with code generated without that switch.
22191 Use it to conform to a non-default application binary interface.
22193 @item -fshort-wchar
22194 @opindex fshort-wchar
22195 Override the underlying type for @samp{wchar_t} to be @samp{short
22196 unsigned int} instead of the default for the target.  This option is
22197 useful for building programs to run under WINE@.
22199 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
22200 code that is not binary compatible with code generated without that switch.
22201 Use it to conform to a non-default application binary interface.
22203 @item -fno-common
22204 @opindex fno-common
22205 In C code, controls the placement of uninitialized global variables.
22206 Unix C compilers have traditionally permitted multiple definitions of
22207 such variables in different compilation units by placing the variables
22208 in a common block.
22209 This is the behavior specified by @option{-fcommon}, and is the default
22210 for GCC on most targets.
22211 On the other hand, this behavior is not required by ISO C, and on some
22212 targets may carry a speed or code size penalty on variable references.
22213 The @option{-fno-common} option specifies that the compiler should place
22214 uninitialized global variables in the data section of the object file,
22215 rather than generating them as common blocks.
22216 This has the effect that if the same variable is declared
22217 (without @code{extern}) in two different compilations,
22218 you get a multiple-definition error when you link them.
22219 In this case, you must compile with @option{-fcommon} instead.
22220 Compiling with @option{-fno-common} is useful on targets for which
22221 it provides better performance, or if you wish to verify that the
22222 program will work on other systems that always treat uninitialized
22223 variable declarations this way.
22225 @item -fno-ident
22226 @opindex fno-ident
22227 Ignore the @samp{#ident} directive.
22229 @item -finhibit-size-directive
22230 @opindex finhibit-size-directive
22231 Don't output a @code{.size} assembler directive, or anything else that
22232 would cause trouble if the function is split in the middle, and the
22233 two halves are placed at locations far apart in memory.  This option is
22234 used when compiling @file{crtstuff.c}; you should not need to use it
22235 for anything else.
22237 @item -fverbose-asm
22238 @opindex fverbose-asm
22239 Put extra commentary information in the generated assembly code to
22240 make it more readable.  This option is generally only of use to those
22241 who actually need to read the generated assembly code (perhaps while
22242 debugging the compiler itself).
22244 @option{-fno-verbose-asm}, the default, causes the
22245 extra information to be omitted and is useful when comparing two assembler
22246 files.
22248 @item -frecord-gcc-switches
22249 @opindex frecord-gcc-switches
22250 This switch causes the command line used to invoke the
22251 compiler to be recorded into the object file that is being created.
22252 This switch is only implemented on some targets and the exact format
22253 of the recording is target and binary file format dependent, but it
22254 usually takes the form of a section containing ASCII text.  This
22255 switch is related to the @option{-fverbose-asm} switch, but that
22256 switch only records information in the assembler output file as
22257 comments, so it never reaches the object file.
22258 See also @option{-grecord-gcc-switches} for another
22259 way of storing compiler options into the object file.
22261 @item -fpic
22262 @opindex fpic
22263 @cindex global offset table
22264 @cindex PIC
22265 Generate position-independent code (PIC) suitable for use in a shared
22266 library, if supported for the target machine.  Such code accesses all
22267 constant addresses through a global offset table (GOT)@.  The dynamic
22268 loader resolves the GOT entries when the program starts (the dynamic
22269 loader is not part of GCC; it is part of the operating system).  If
22270 the GOT size for the linked executable exceeds a machine-specific
22271 maximum size, you get an error message from the linker indicating that
22272 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
22273 instead.  (These maximums are 8k on the SPARC and 32k
22274 on the m68k and RS/6000.  The 386 has no such limit.)
22276 Position-independent code requires special support, and therefore works
22277 only on certain machines.  For the 386, GCC supports PIC for System V
22278 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
22279 position-independent.
22281 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
22282 are defined to 1.
22284 @item -fPIC
22285 @opindex fPIC
22286 If supported for the target machine, emit position-independent code,
22287 suitable for dynamic linking and avoiding any limit on the size of the
22288 global offset table.  This option makes a difference on the m68k,
22289 PowerPC and SPARC@.
22291 Position-independent code requires special support, and therefore works
22292 only on certain machines.
22294 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
22295 are defined to 2.
22297 @item -fpie
22298 @itemx -fPIE
22299 @opindex fpie
22300 @opindex fPIE
22301 These options are similar to @option{-fpic} and @option{-fPIC}, but
22302 generated position independent code can be only linked into executables.
22303 Usually these options are used when @option{-pie} GCC option is
22304 used during linking.
22306 @option{-fpie} and @option{-fPIE} both define the macros
22307 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
22308 for @option{-fpie} and 2 for @option{-fPIE}.
22310 @item -fno-jump-tables
22311 @opindex fno-jump-tables
22312 Do not use jump tables for switch statements even where it would be
22313 more efficient than other code generation strategies.  This option is
22314 of use in conjunction with @option{-fpic} or @option{-fPIC} for
22315 building code that forms part of a dynamic linker and cannot
22316 reference the address of a jump table.  On some targets, jump tables
22317 do not require a GOT and this option is not needed.
22319 @item -ffixed-@var{reg}
22320 @opindex ffixed
22321 Treat the register named @var{reg} as a fixed register; generated code
22322 should never refer to it (except perhaps as a stack pointer, frame
22323 pointer or in some other fixed role).
22325 @var{reg} must be the name of a register.  The register names accepted
22326 are machine-specific and are defined in the @code{REGISTER_NAMES}
22327 macro in the machine description macro file.
22329 This flag does not have a negative form, because it specifies a
22330 three-way choice.
22332 @item -fcall-used-@var{reg}
22333 @opindex fcall-used
22334 Treat the register named @var{reg} as an allocable register that is
22335 clobbered by function calls.  It may be allocated for temporaries or
22336 variables that do not live across a call.  Functions compiled this way
22337 do not save and restore the register @var{reg}.
22339 It is an error to use this flag with the frame pointer or stack pointer.
22340 Use of this flag for other registers that have fixed pervasive roles in
22341 the machine's execution model produces disastrous results.
22343 This flag does not have a negative form, because it specifies a
22344 three-way choice.
22346 @item -fcall-saved-@var{reg}
22347 @opindex fcall-saved
22348 Treat the register named @var{reg} as an allocable register saved by
22349 functions.  It may be allocated even for temporaries or variables that
22350 live across a call.  Functions compiled this way save and restore
22351 the register @var{reg} if they use it.
22353 It is an error to use this flag with the frame pointer or stack pointer.
22354 Use of this flag for other registers that have fixed pervasive roles in
22355 the machine's execution model produces disastrous results.
22357 A different sort of disaster results from the use of this flag for
22358 a register in which function values may be returned.
22360 This flag does not have a negative form, because it specifies a
22361 three-way choice.
22363 @item -fpack-struct[=@var{n}]
22364 @opindex fpack-struct
22365 Without a value specified, pack all structure members together without
22366 holes.  When a value is specified (which must be a small power of two), pack
22367 structure members according to this value, representing the maximum
22368 alignment (that is, objects with default alignment requirements larger than
22369 this are output potentially unaligned at the next fitting location.
22371 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
22372 code that is not binary compatible with code generated without that switch.
22373 Additionally, it makes the code suboptimal.
22374 Use it to conform to a non-default application binary interface.
22376 @item -finstrument-functions
22377 @opindex finstrument-functions
22378 Generate instrumentation calls for entry and exit to functions.  Just
22379 after function entry and just before function exit, the following
22380 profiling functions are called with the address of the current
22381 function and its call site.  (On some platforms,
22382 @code{__builtin_return_address} does not work beyond the current
22383 function, so the call site information may not be available to the
22384 profiling functions otherwise.)
22386 @smallexample
22387 void __cyg_profile_func_enter (void *this_fn,
22388                                void *call_site);
22389 void __cyg_profile_func_exit  (void *this_fn,
22390                                void *call_site);
22391 @end smallexample
22393 The first argument is the address of the start of the current function,
22394 which may be looked up exactly in the symbol table.
22396 This instrumentation is also done for functions expanded inline in other
22397 functions.  The profiling calls indicate where, conceptually, the
22398 inline function is entered and exited.  This means that addressable
22399 versions of such functions must be available.  If all your uses of a
22400 function are expanded inline, this may mean an additional expansion of
22401 code size.  If you use @samp{extern inline} in your C code, an
22402 addressable version of such functions must be provided.  (This is
22403 normally the case anyway, but if you get lucky and the optimizer always
22404 expands the functions inline, you might have gotten away without
22405 providing static copies.)
22407 A function may be given the attribute @code{no_instrument_function}, in
22408 which case this instrumentation is not done.  This can be used, for
22409 example, for the profiling functions listed above, high-priority
22410 interrupt routines, and any functions from which the profiling functions
22411 cannot safely be called (perhaps signal handlers, if the profiling
22412 routines generate output or allocate memory).
22414 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
22415 @opindex finstrument-functions-exclude-file-list
22417 Set the list of functions that are excluded from instrumentation (see
22418 the description of @code{-finstrument-functions}).  If the file that
22419 contains a function definition matches with one of @var{file}, then
22420 that function is not instrumented.  The match is done on substrings:
22421 if the @var{file} parameter is a substring of the file name, it is
22422 considered to be a match.
22424 For example:
22426 @smallexample
22427 -finstrument-functions-exclude-file-list=/bits/stl,include/sys
22428 @end smallexample
22430 @noindent
22431 excludes any inline function defined in files whose pathnames
22432 contain @code{/bits/stl} or @code{include/sys}.
22434 If, for some reason, you want to include letter @code{','} in one of
22435 @var{sym}, write @code{'\,'}. For example,
22436 @code{-finstrument-functions-exclude-file-list='\,\,tmp'}
22437 (note the single quote surrounding the option).
22439 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
22440 @opindex finstrument-functions-exclude-function-list
22442 This is similar to @code{-finstrument-functions-exclude-file-list},
22443 but this option sets the list of function names to be excluded from
22444 instrumentation.  The function name to be matched is its user-visible
22445 name, such as @code{vector<int> blah(const vector<int> &)}, not the
22446 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
22447 match is done on substrings: if the @var{sym} parameter is a substring
22448 of the function name, it is considered to be a match.  For C99 and C++
22449 extended identifiers, the function name must be given in UTF-8, not
22450 using universal character names.
22452 @item -fstack-check
22453 @opindex fstack-check
22454 Generate code to verify that you do not go beyond the boundary of the
22455 stack.  You should specify this flag if you are running in an
22456 environment with multiple threads, but you only rarely need to specify it in
22457 a single-threaded environment since stack overflow is automatically
22458 detected on nearly all systems if there is only one stack.
22460 Note that this switch does not actually cause checking to be done; the
22461 operating system or the language runtime must do that.  The switch causes
22462 generation of code to ensure that they see the stack being extended.
22464 You can additionally specify a string parameter: @code{no} means no
22465 checking, @code{generic} means force the use of old-style checking,
22466 @code{specific} means use the best checking method and is equivalent
22467 to bare @option{-fstack-check}.
22469 Old-style checking is a generic mechanism that requires no specific
22470 target support in the compiler but comes with the following drawbacks:
22472 @enumerate
22473 @item
22474 Modified allocation strategy for large objects: they are always
22475 allocated dynamically if their size exceeds a fixed threshold.
22477 @item
22478 Fixed limit on the size of the static frame of functions: when it is
22479 topped by a particular function, stack checking is not reliable and
22480 a warning is issued by the compiler.
22482 @item
22483 Inefficiency: because of both the modified allocation strategy and the
22484 generic implementation, code performance is hampered.
22485 @end enumerate
22487 Note that old-style stack checking is also the fallback method for
22488 @code{specific} if no target support has been added in the compiler.
22490 @item -fstack-limit-register=@var{reg}
22491 @itemx -fstack-limit-symbol=@var{sym}
22492 @itemx -fno-stack-limit
22493 @opindex fstack-limit-register
22494 @opindex fstack-limit-symbol
22495 @opindex fno-stack-limit
22496 Generate code to ensure that the stack does not grow beyond a certain value,
22497 either the value of a register or the address of a symbol.  If a larger
22498 stack is required, a signal is raised at run time.  For most targets,
22499 the signal is raised before the stack overruns the boundary, so
22500 it is possible to catch the signal without taking special precautions.
22502 For instance, if the stack starts at absolute address @samp{0x80000000}
22503 and grows downwards, you can use the flags
22504 @option{-fstack-limit-symbol=__stack_limit} and
22505 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
22506 of 128KB@.  Note that this may only work with the GNU linker.
22508 @item -fsplit-stack
22509 @opindex fsplit-stack
22510 Generate code to automatically split the stack before it overflows.
22511 The resulting program has a discontiguous stack which can only
22512 overflow if the program is unable to allocate any more memory.  This
22513 is most useful when running threaded programs, as it is no longer
22514 necessary to calculate a good stack size to use for each thread.  This
22515 is currently only implemented for the i386 and x86_64 back ends running
22516 GNU/Linux.
22518 When code compiled with @option{-fsplit-stack} calls code compiled
22519 without @option{-fsplit-stack}, there may not be much stack space
22520 available for the latter code to run.  If compiling all code,
22521 including library code, with @option{-fsplit-stack} is not an option,
22522 then the linker can fix up these calls so that the code compiled
22523 without @option{-fsplit-stack} always has a large stack.  Support for
22524 this is implemented in the gold linker in GNU binutils release 2.21
22525 and later.
22527 @item -fleading-underscore
22528 @opindex fleading-underscore
22529 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
22530 change the way C symbols are represented in the object file.  One use
22531 is to help link with legacy assembly code.
22533 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
22534 generate code that is not binary compatible with code generated without that
22535 switch.  Use it to conform to a non-default application binary interface.
22536 Not all targets provide complete support for this switch.
22538 @item -ftls-model=@var{model}
22539 @opindex ftls-model
22540 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
22541 The @var{model} argument should be one of @code{global-dynamic},
22542 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
22543 Note that the choice is subject to optimization: the compiler may use
22544 a more efficient model for symbols not visible outside of the translation
22545 unit, or if @option{-fpic} is not given on the command line.
22547 The default without @option{-fpic} is @code{initial-exec}; with
22548 @option{-fpic} the default is @code{global-dynamic}.
22550 @item -fvisibility=@var{default|internal|hidden|protected}
22551 @opindex fvisibility
22552 Set the default ELF image symbol visibility to the specified option---all
22553 symbols are marked with this unless overridden within the code.
22554 Using this feature can very substantially improve linking and
22555 load times of shared object libraries, produce more optimized
22556 code, provide near-perfect API export and prevent symbol clashes.
22557 It is @strong{strongly} recommended that you use this in any shared objects
22558 you distribute.
22560 Despite the nomenclature, @code{default} always means public; i.e.,
22561 available to be linked against from outside the shared object.
22562 @code{protected} and @code{internal} are pretty useless in real-world
22563 usage so the only other commonly used option is @code{hidden}.
22564 The default if @option{-fvisibility} isn't specified is
22565 @code{default}, i.e., make every
22566 symbol public---this causes the same behavior as previous versions of
22567 GCC@.
22569 A good explanation of the benefits offered by ensuring ELF
22570 symbols have the correct visibility is given by ``How To Write
22571 Shared Libraries'' by Ulrich Drepper (which can be found at
22572 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
22573 solution made possible by this option to marking things hidden when
22574 the default is public is to make the default hidden and mark things
22575 public.  This is the norm with DLLs on Windows and with @option{-fvisibility=hidden}
22576 and @code{__attribute__ ((visibility("default")))} instead of
22577 @code{__declspec(dllexport)} you get almost identical semantics with
22578 identical syntax.  This is a great boon to those working with
22579 cross-platform projects.
22581 For those adding visibility support to existing code, you may find
22582 @samp{#pragma GCC visibility} of use.  This works by you enclosing
22583 the declarations you wish to set visibility for with (for example)
22584 @samp{#pragma GCC visibility push(hidden)} and
22585 @samp{#pragma GCC visibility pop}.
22586 Bear in mind that symbol visibility should be viewed @strong{as
22587 part of the API interface contract} and thus all new code should
22588 always specify visibility when it is not the default; i.e., declarations
22589 only for use within the local DSO should @strong{always} be marked explicitly
22590 as hidden as so to avoid PLT indirection overheads---making this
22591 abundantly clear also aids readability and self-documentation of the code.
22592 Note that due to ISO C++ specification requirements, @code{operator new} and
22593 @code{operator delete} must always be of default visibility.
22595 Be aware that headers from outside your project, in particular system
22596 headers and headers from any other library you use, may not be
22597 expecting to be compiled with visibility other than the default.  You
22598 may need to explicitly say @samp{#pragma GCC visibility push(default)}
22599 before including any such headers.
22601 @samp{extern} declarations are not affected by @option{-fvisibility}, so
22602 a lot of code can be recompiled with @option{-fvisibility=hidden} with
22603 no modifications.  However, this means that calls to @code{extern}
22604 functions with no explicit visibility use the PLT, so it is more
22605 effective to use @code{__attribute ((visibility))} and/or
22606 @code{#pragma GCC visibility} to tell the compiler which @code{extern}
22607 declarations should be treated as hidden.
22609 Note that @option{-fvisibility} does affect C++ vague linkage
22610 entities. This means that, for instance, an exception class that is
22611 be thrown between DSOs must be explicitly marked with default
22612 visibility so that the @samp{type_info} nodes are unified between
22613 the DSOs.
22615 An overview of these techniques, their benefits and how to use them
22616 is at @uref{http://gcc.gnu.org/@/wiki/@/Visibility}.
22618 @item -fstrict-volatile-bitfields
22619 @opindex fstrict-volatile-bitfields
22620 This option should be used if accesses to volatile bit-fields (or other
22621 structure fields, although the compiler usually honors those types
22622 anyway) should use a single access of the width of the
22623 field's type, aligned to a natural alignment if possible.  For
22624 example, targets with memory-mapped peripheral registers might require
22625 all such accesses to be 16 bits wide; with this flag you can
22626 declare all peripheral bit-fields as @code{unsigned short} (assuming short
22627 is 16 bits on these targets) to force GCC to use 16-bit accesses
22628 instead of, perhaps, a more efficient 32-bit access.
22630 If this option is disabled, the compiler uses the most efficient
22631 instruction.  In the previous example, that might be a 32-bit load
22632 instruction, even though that accesses bytes that do not contain
22633 any portion of the bit-field, or memory-mapped registers unrelated to
22634 the one being updated.
22636 In some cases, such as when the @code{packed} attribute is applied to a 
22637 structure field, it may not be possible to access the field with a single
22638 read or write that is correctly aligned for the target machine.  In this
22639 case GCC falls back to generating multiple accesses rather than code that 
22640 will fault or truncate the result at run time.
22642 Note:  Due to restrictions of the C/C++11 memory model, write accesses are
22643 not allowed to touch non bit-field members.  It is therefore recommended
22644 to define all bits of the field's type as bit-field members.
22646 The default value of this option is determined by the application binary
22647 interface for the target processor.
22649 @item -fsync-libcalls
22650 @opindex fsync-libcalls
22651 This option controls whether any out-of-line instance of the @code{__sync}
22652 family of functions may be used to implement the C++11 @code{__atomic}
22653 family of functions.
22655 The default value of this option is enabled, thus the only useful form
22656 of the option is @option{-fno-sync-libcalls}.  This option is used in
22657 the implementation of the @file{libatomic} runtime library.
22659 @end table
22661 @c man end
22663 @node Environment Variables
22664 @section Environment Variables Affecting GCC
22665 @cindex environment variables
22667 @c man begin ENVIRONMENT
22668 This section describes several environment variables that affect how GCC
22669 operates.  Some of them work by specifying directories or prefixes to use
22670 when searching for various kinds of files.  Some are used to specify other
22671 aspects of the compilation environment.
22673 Note that you can also specify places to search using options such as
22674 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
22675 take precedence over places specified using environment variables, which
22676 in turn take precedence over those specified by the configuration of GCC@.
22677 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
22678 GNU Compiler Collection (GCC) Internals}.
22680 @table @env
22681 @item LANG
22682 @itemx LC_CTYPE
22683 @c @itemx LC_COLLATE
22684 @itemx LC_MESSAGES
22685 @c @itemx LC_MONETARY
22686 @c @itemx LC_NUMERIC
22687 @c @itemx LC_TIME
22688 @itemx LC_ALL
22689 @findex LANG
22690 @findex LC_CTYPE
22691 @c @findex LC_COLLATE
22692 @findex LC_MESSAGES
22693 @c @findex LC_MONETARY
22694 @c @findex LC_NUMERIC
22695 @c @findex LC_TIME
22696 @findex LC_ALL
22697 @cindex locale
22698 These environment variables control the way that GCC uses
22699 localization information which allows GCC to work with different
22700 national conventions.  GCC inspects the locale categories
22701 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
22702 so.  These locale categories can be set to any value supported by your
22703 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
22704 Kingdom encoded in UTF-8.
22706 The @env{LC_CTYPE} environment variable specifies character
22707 classification.  GCC uses it to determine the character boundaries in
22708 a string; this is needed for some multibyte encodings that contain quote
22709 and escape characters that are otherwise interpreted as a string
22710 end or escape.
22712 The @env{LC_MESSAGES} environment variable specifies the language to
22713 use in diagnostic messages.
22715 If the @env{LC_ALL} environment variable is set, it overrides the value
22716 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
22717 and @env{LC_MESSAGES} default to the value of the @env{LANG}
22718 environment variable.  If none of these variables are set, GCC
22719 defaults to traditional C English behavior.
22721 @item TMPDIR
22722 @findex TMPDIR
22723 If @env{TMPDIR} is set, it specifies the directory to use for temporary
22724 files.  GCC uses temporary files to hold the output of one stage of
22725 compilation which is to be used as input to the next stage: for example,
22726 the output of the preprocessor, which is the input to the compiler
22727 proper.
22729 @item GCC_COMPARE_DEBUG
22730 @findex GCC_COMPARE_DEBUG
22731 Setting @env{GCC_COMPARE_DEBUG} is nearly equivalent to passing
22732 @option{-fcompare-debug} to the compiler driver.  See the documentation
22733 of this option for more details.
22735 @item GCC_EXEC_PREFIX
22736 @findex GCC_EXEC_PREFIX
22737 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
22738 names of the subprograms executed by the compiler.  No slash is added
22739 when this prefix is combined with the name of a subprogram, but you can
22740 specify a prefix that ends with a slash if you wish.
22742 If @env{GCC_EXEC_PREFIX} is not set, GCC attempts to figure out
22743 an appropriate prefix to use based on the pathname it is invoked with.
22745 If GCC cannot find the subprogram using the specified prefix, it
22746 tries looking in the usual places for the subprogram.
22748 The default value of @env{GCC_EXEC_PREFIX} is
22749 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
22750 the installed compiler. In many cases @var{prefix} is the value
22751 of @code{prefix} when you ran the @file{configure} script.
22753 Other prefixes specified with @option{-B} take precedence over this prefix.
22755 This prefix is also used for finding files such as @file{crt0.o} that are
22756 used for linking.
22758 In addition, the prefix is used in an unusual way in finding the
22759 directories to search for header files.  For each of the standard
22760 directories whose name normally begins with @samp{/usr/local/lib/gcc}
22761 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
22762 replacing that beginning with the specified prefix to produce an
22763 alternate directory name.  Thus, with @option{-Bfoo/}, GCC searches
22764 @file{foo/bar} just before it searches the standard directory 
22765 @file{/usr/local/lib/bar}.
22766 If a standard directory begins with the configured
22767 @var{prefix} then the value of @var{prefix} is replaced by
22768 @env{GCC_EXEC_PREFIX} when looking for header files.
22770 @item COMPILER_PATH
22771 @findex COMPILER_PATH
22772 The value of @env{COMPILER_PATH} is a colon-separated list of
22773 directories, much like @env{PATH}.  GCC tries the directories thus
22774 specified when searching for subprograms, if it can't find the
22775 subprograms using @env{GCC_EXEC_PREFIX}.
22777 @item LIBRARY_PATH
22778 @findex LIBRARY_PATH
22779 The value of @env{LIBRARY_PATH} is a colon-separated list of
22780 directories, much like @env{PATH}.  When configured as a native compiler,
22781 GCC tries the directories thus specified when searching for special
22782 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
22783 using GCC also uses these directories when searching for ordinary
22784 libraries for the @option{-l} option (but directories specified with
22785 @option{-L} come first).
22787 @item LANG
22788 @findex LANG
22789 @cindex locale definition
22790 This variable is used to pass locale information to the compiler.  One way in
22791 which this information is used is to determine the character set to be used
22792 when character literals, string literals and comments are parsed in C and C++.
22793 When the compiler is configured to allow multibyte characters,
22794 the following values for @env{LANG} are recognized:
22796 @table @samp
22797 @item C-JIS
22798 Recognize JIS characters.
22799 @item C-SJIS
22800 Recognize SJIS characters.
22801 @item C-EUCJP
22802 Recognize EUCJP characters.
22803 @end table
22805 If @env{LANG} is not defined, or if it has some other value, then the
22806 compiler uses @code{mblen} and @code{mbtowc} as defined by the default locale to
22807 recognize and translate multibyte characters.
22808 @end table
22810 @noindent
22811 Some additional environment variables affect the behavior of the
22812 preprocessor.
22814 @include cppenv.texi
22816 @c man end
22818 @node Precompiled Headers
22819 @section Using Precompiled Headers
22820 @cindex precompiled headers
22821 @cindex speed of compilation
22823 Often large projects have many header files that are included in every
22824 source file.  The time the compiler takes to process these header files
22825 over and over again can account for nearly all of the time required to
22826 build the project.  To make builds faster, GCC allows you to
22827 @dfn{precompile} a header file.
22829 To create a precompiled header file, simply compile it as you would any
22830 other file, if necessary using the @option{-x} option to make the driver
22831 treat it as a C or C++ header file.  You may want to use a
22832 tool like @command{make} to keep the precompiled header up-to-date when
22833 the headers it contains change.
22835 A precompiled header file is searched for when @code{#include} is
22836 seen in the compilation.  As it searches for the included file
22837 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
22838 compiler looks for a precompiled header in each directory just before it
22839 looks for the include file in that directory.  The name searched for is
22840 the name specified in the @code{#include} with @samp{.gch} appended.  If
22841 the precompiled header file can't be used, it is ignored.
22843 For instance, if you have @code{#include "all.h"}, and you have
22844 @file{all.h.gch} in the same directory as @file{all.h}, then the
22845 precompiled header file is used if possible, and the original
22846 header is used otherwise.
22848 Alternatively, you might decide to put the precompiled header file in a
22849 directory and use @option{-I} to ensure that directory is searched
22850 before (or instead of) the directory containing the original header.
22851 Then, if you want to check that the precompiled header file is always
22852 used, you can put a file of the same name as the original header in this
22853 directory containing an @code{#error} command.
22855 This also works with @option{-include}.  So yet another way to use
22856 precompiled headers, good for projects not designed with precompiled
22857 header files in mind, is to simply take most of the header files used by
22858 a project, include them from another header file, precompile that header
22859 file, and @option{-include} the precompiled header.  If the header files
22860 have guards against multiple inclusion, they are skipped because
22861 they've already been included (in the precompiled header).
22863 If you need to precompile the same header file for different
22864 languages, targets, or compiler options, you can instead make a
22865 @emph{directory} named like @file{all.h.gch}, and put each precompiled
22866 header in the directory, perhaps using @option{-o}.  It doesn't matter
22867 what you call the files in the directory; every precompiled header in
22868 the directory is considered.  The first precompiled header
22869 encountered in the directory that is valid for this compilation is
22870 used; they're searched in no particular order.
22872 There are many other possibilities, limited only by your imagination,
22873 good sense, and the constraints of your build system.
22875 A precompiled header file can be used only when these conditions apply:
22877 @itemize
22878 @item
22879 Only one precompiled header can be used in a particular compilation.
22881 @item
22882 A precompiled header can't be used once the first C token is seen.  You
22883 can have preprocessor directives before a precompiled header; you cannot
22884 include a precompiled header from inside another header.
22886 @item
22887 The precompiled header file must be produced for the same language as
22888 the current compilation.  You can't use a C precompiled header for a C++
22889 compilation.
22891 @item
22892 The precompiled header file must have been produced by the same compiler
22893 binary as the current compilation is using.
22895 @item
22896 Any macros defined before the precompiled header is included must
22897 either be defined in the same way as when the precompiled header was
22898 generated, or must not affect the precompiled header, which usually
22899 means that they don't appear in the precompiled header at all.
22901 The @option{-D} option is one way to define a macro before a
22902 precompiled header is included; using a @code{#define} can also do it.
22903 There are also some options that define macros implicitly, like
22904 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
22905 defined this way.
22907 @item If debugging information is output when using the precompiled
22908 header, using @option{-g} or similar, the same kind of debugging information
22909 must have been output when building the precompiled header.  However,
22910 a precompiled header built using @option{-g} can be used in a compilation
22911 when no debugging information is being output.
22913 @item The same @option{-m} options must generally be used when building
22914 and using the precompiled header.  @xref{Submodel Options},
22915 for any cases where this rule is relaxed.
22917 @item Each of the following options must be the same when building and using
22918 the precompiled header:
22920 @gccoptlist{-fexceptions}
22922 @item
22923 Some other command-line options starting with @option{-f},
22924 @option{-p}, or @option{-O} must be defined in the same way as when
22925 the precompiled header was generated.  At present, it's not clear
22926 which options are safe to change and which are not; the safest choice
22927 is to use exactly the same options when generating and using the
22928 precompiled header.  The following are known to be safe:
22930 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
22931 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
22932 -fsched-verbose=@var{number}  -fschedule-insns  -fvisibility= @gol
22933 -pedantic-errors}
22935 @end itemize
22937 For all of these except the last, the compiler automatically
22938 ignores the precompiled header if the conditions aren't met.  If you
22939 find an option combination that doesn't work and doesn't cause the
22940 precompiled header to be ignored, please consider filing a bug report,
22941 see @ref{Bugs}.
22943 If you do use differing options when generating and using the
22944 precompiled header, the actual behavior is a mixture of the
22945 behavior for the options.  For instance, if you use @option{-g} to
22946 generate the precompiled header but not when using it, you may or may
22947 not get debugging information for routines in the precompiled header.