Merge aosp-toolchain/gcc/gcc-4_9 changes.
[official-gcc.git] / gcc-4_9 / gcc / doc / invoke.texi
blobf8350c4183c1d2881cc8f100928f32d050981b14
1 @c Copyright (C) 1988-2014 Free Software Foundation, Inc.
2 @c This is part of the GCC manual.
3 @c For copying conditions, see the file gcc.texi.
5 @ignore
6 @c man begin INCLUDE
7 @include gcc-vers.texi
8 @c man end
10 @c man begin COPYRIGHT
11 Copyright @copyright{} 1988-2014 Free Software Foundation, Inc.
13 Permission is granted to copy, distribute and/or modify this document
14 under the terms of the GNU Free Documentation License, Version 1.3 or
15 any later version published by the Free Software Foundation; with the
16 Invariant Sections being ``GNU General Public License'' and ``Funding
17 Free Software'', the Front-Cover texts being (a) (see below), and with
18 the Back-Cover Texts being (b) (see below).  A copy of the license is
19 included in the gfdl(7) man page.
21 (a) The FSF's Front-Cover Text is:
23      A GNU Manual
25 (b) The FSF's Back-Cover Text is:
27      You have freedom to copy and modify this GNU Manual, like GNU
28      software.  Copies published by the Free Software Foundation raise
29      funds for GNU development.
30 @c man end
31 @c Set file name and title for the man page.
32 @setfilename gcc
33 @settitle GNU project C and C++ compiler
34 @c man begin SYNOPSIS
35 gcc [@option{-c}|@option{-S}|@option{-E}] [@option{-std=}@var{standard}]
36     [@option{-g}] [@option{-pg}] [@option{-O}@var{level}]
37     [@option{-W}@var{warn}@dots{}] [@option{-Wpedantic}]
38     [@option{-I}@var{dir}@dots{}] [@option{-L}@var{dir}@dots{}]
39     [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}]
40     [@option{-f}@var{option}@dots{}] [@option{-m}@var{machine-option}@dots{}]
41     [@option{-o} @var{outfile}] [@@@var{file}] @var{infile}@dots{}
43 Only the most useful options are listed here; see below for the
44 remainder.  @samp{g++} accepts mostly the same options as @samp{gcc}.
45 @c man end
46 @c man begin SEEALSO
47 gpl(7), gfdl(7), fsf-funding(7),
48 cpp(1), gcov(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1)
49 and the Info entries for @file{gcc}, @file{cpp}, @file{as},
50 @file{ld}, @file{binutils} and @file{gdb}.
51 @c man end
52 @c man begin BUGS
53 For instructions on reporting bugs, see
54 @w{@value{BUGURL}}.
55 @c man end
56 @c man begin AUTHOR
57 See the Info entry for @command{gcc}, or
58 @w{@uref{http://gcc.gnu.org/onlinedocs/gcc/Contributors.html}},
59 for contributors to GCC@.
60 @c man end
61 @end ignore
63 @node Invoking GCC
64 @chapter GCC Command Options
65 @cindex GCC command options
66 @cindex command options
67 @cindex options, GCC command
69 @c man begin DESCRIPTION
70 When you invoke GCC, it normally does preprocessing, compilation,
71 assembly and linking.  The ``overall options'' allow you to stop this
72 process at an intermediate stage.  For example, the @option{-c} option
73 says not to run the linker.  Then the output consists of object files
74 output by the assembler.
76 Other options are passed on to one stage of processing.  Some options
77 control the preprocessor and others the compiler itself.  Yet other
78 options control the assembler and linker; most of these are not
79 documented here, since you rarely need to use any of them.
81 @cindex C compilation options
82 Most of the command-line options that you can use with GCC are useful
83 for C programs; when an option is only useful with another language
84 (usually C++), the explanation says so explicitly.  If the description
85 for a particular option does not mention a source language, you can use
86 that option with all supported languages.
88 @cindex C++ compilation options
89 @xref{Invoking G++,,Compiling C++ Programs}, for a summary of special
90 options for compiling C++ programs.
92 @cindex grouping options
93 @cindex options, grouping
94 The @command{gcc} program accepts options and file names as operands.  Many
95 options have multi-letter names; therefore multiple single-letter options
96 may @emph{not} be grouped: @option{-dv} is very different from @w{@samp{-d
97 -v}}.
99 @cindex order of options
100 @cindex options, order
101 You can mix options and other arguments.  For the most part, the order
102 you use doesn't matter.  Order does matter when you use several
103 options of the same kind; for example, if you specify @option{-L} more
104 than once, the directories are searched in the order specified.  Also,
105 the placement of the @option{-l} option is significant.
107 Many options have long names starting with @samp{-f} or with
108 @samp{-W}---for example,
109 @option{-fmove-loop-invariants}, @option{-Wformat} and so on.  Most of
110 these have both positive and negative forms; the negative form of
111 @option{-ffoo} is @option{-fno-foo}.  This manual documents
112 only one of these two forms, whichever one is not the default.
114 @c man end
116 @xref{Option Index}, for an index to GCC's options.
118 @menu
119 * Option Summary::      Brief list of all options, without explanations.
120 * Overall Options::     Controlling the kind of output:
121                         an executable, object files, assembler files,
122                         or preprocessed source.
123 * Invoking G++::        Compiling C++ programs.
124 * C Dialect Options::   Controlling the variant of C language compiled.
125 * C++ Dialect Options:: Variations on C++.
126 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
127                         and Objective-C++.
128 * Language Independent Options:: Controlling how diagnostics should be
129                         formatted.
130 * Warning Options::     How picky should the compiler be?
131 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
132 * Optimize Options::    How much optimization?
133 * Preprocessor Options:: Controlling header files and macro definitions.
134                          Also, getting dependency information for Make.
135 * Assembler Options::   Passing options to the assembler.
136 * Link Options::        Specifying libraries and so on.
137 * Directory Options::   Where to find header files and libraries.
138                         Where to find the compiler executable files.
139 * Spec Files::          How to pass switches to sub-processes.
140 * Target Options::      Running a cross-compiler, or an old version of GCC.
141 * Submodel Options::    Specifying minor hardware or convention variations,
142                         such as 68010 vs 68020.
143 * Code Gen Options::    Specifying conventions for function calls, data layout
144                         and register usage.
145 * Environment Variables:: Env vars that affect GCC.
146 * Precompiled Headers:: Compiling a header once, and using it many times.
147 @end menu
149 @c man begin OPTIONS
151 @node Option Summary
152 @section Option Summary
154 Here is a summary of all the options, grouped by type.  Explanations are
155 in the following sections.
157 @table @emph
158 @item Overall Options
159 @xref{Overall Options,,Options Controlling the Kind of Output}.
160 @gccoptlist{-c  -S  -E  -o @var{file}  -no-canonical-prefixes  @gol
161 -pipe  -pass-exit-codes  @gol
162 -x @var{language}  -v  -###  --help@r{[}=@var{class}@r{[},@dots{}@r{]]}  --target-help  @gol
163 --version -wrapper @@@var{file} -fplugin=@var{file} -fplugin-arg-@var{name}=@var{arg}  @gol
164 -fdump-ada-spec@r{[}-slim@r{]} -fada-spec-parent=@var{unit} -fdump-go-spec=@var{file}}
166 @item C Language Options
167 @xref{C Dialect Options,,Options Controlling C Dialect}.
168 @gccoptlist{-ansi  -std=@var{standard}  -fgnu89-inline @gol
169 -aux-info @var{filename} -fallow-parameterless-variadic-functions @gol
170 -fno-asm  -fno-builtin  -fno-builtin-@var{function} @gol
171 -fhosted  -ffreestanding -fopenmp -fopenmp-simd -fms-extensions @gol
172 -fplan9-extensions -trigraphs  -traditional  -traditional-cpp @gol
173 -fallow-single-precision  -fcond-mismatch -flax-vector-conversions @gol
174 -fsigned-bitfields  -fsigned-char @gol
175 -funsigned-bitfields  -funsigned-char}
177 @item C++ Language Options
178 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
179 @gccoptlist{-fabi-version=@var{n}  -fno-access-control  -fcheck-new @gol
180 -fconstexpr-depth=@var{n}  -ffriend-injection @gol
181 -fno-elide-constructors @gol
182 -fno-enforce-eh-specs @gol
183 -ffor-scope  -fno-for-scope  -fno-gnu-keywords @gol
184 -fno-implicit-templates @gol
185 -fno-implicit-inline-templates @gol
186 -fno-implement-inlines  -fms-extensions @gol
187 -fno-nonansi-builtins  -fnothrow-opt  -fno-operator-names @gol
188 -fno-optional-diags  -fpermissive @gol
189 -fno-pretty-templates @gol
190 -frepo  -fno-rtti  -fstats  -ftemplate-backtrace-limit=@var{n} @gol
191 -ftemplate-depth=@var{n} @gol
192 -fno-threadsafe-statics -fuse-cxa-atexit  -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 -freplace-objc-classes @gol
220 -fzero-link @gol
221 -gen-decls @gol
222 -Wassign-intercept @gol
223 -Wno-protocol  -Wselector @gol
224 -Wstrict-selector-match @gol
225 -Wundeclared-selector}
227 @item Language Independent Options
228 @xref{Language Independent Options,,Options to Control Diagnostic Messages Formatting}.
229 @gccoptlist{-fmessage-length=@var{n}  @gol
230 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol
231 -fdiagnostics-color=@r{[}auto@r{|}never@r{|}always@r{]}  @gol
232 -fno-diagnostics-show-option -fno-diagnostics-show-caret}
234 @item Warning Options
235 @xref{Warning Options,,Options to Request or Suppress Warnings}.
236 @gccoptlist{-fsyntax-only  -fmax-errors=@var{n}  -Wpedantic @gol
237 -pedantic-errors @gol
238 -w  -Wextra  -Wall  -Waddress  -Waggregate-return  @gol
239 -Waggressive-loop-optimizations -Warray-bounds @gol
240 -Wno-attributes -Wno-builtin-macro-redefined @gol
241 -Wc++-compat -Wc++11-compat -Wcast-align  -Wcast-qual  @gol
242 -Wchar-subscripts -Wclobbered  -Wcomment -Wconditionally-supported  @gol
243 -Wconversion -Wcoverage-mismatch -Wdate-time -Wdelete-incomplete -Wno-cpp  @gol
244 -Wno-deprecated -Wno-deprecated-declarations -Wdisabled-optimization  @gol
245 -Wno-div-by-zero -Wdouble-promotion -Wempty-body  -Wenum-compare @gol
246 -Wno-endif-labels -Werror  -Werror=* @gol
247 -Wfatal-errors  -Wfloat-equal -Wforce-warnings -Wformat  -Wformat=2 @gol
248 -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol
249 -Wformat-security  -Wformat-y2k @gol
250 -Wframe-larger-than=@var{len} -Wno-free-nonheap-object -Wjump-misses-init @gol
251 -Wignored-qualifiers @gol
252 -Wimplicit  -Wimplicit-function-declaration  -Wimplicit-int @gol
253 -Winit-self  -Winline -Wmaybe-uninitialized @gol
254 -Wno-int-to-pointer-cast -Wno-invalid-offsetof @gol
255 -Winvalid-pch -Wlarger-than=@var{len}  -Wunsafe-loop-optimizations @gol
256 -Wlogical-op -Wlong-long @gol
257 -Wmain -Wmaybe-uninitialized -Wmissing-braces  -Wmissing-field-initializers @gol
258 -Wmissing-include-dirs @gol
259 -Wno-multichar  -Wnonnull  -Wno-overflow -Wopenmp-simd @gol
260 -Woverlength-strings  -Wpacked  -Wpacked-bitfield-compat  -Wpadded @gol
261 -Wparentheses  -Wpedantic-ms-format -Wno-pedantic-ms-format @gol
262 -Wpointer-arith  -Wno-pointer-to-int-cast @gol
263 -Wredundant-decls  -Wno-return-local-addr -Wipa-opt-mismatch @gol
264 -Wreturn-type -Wself-assign -Wself-assign-non-pod -Wsequence-point  -Wshadow @gol
265 -Wshadow-compatible-local -Wshadow-local @gol
266 -Wsign-compare  -Wsign-conversion -Wfloat-conversion @gol
267 -Wsizeof-pointer-memaccess @gol
268 -Wstack-protector -Wstack-usage=@var{len} -Wstrict-aliasing @gol
269 -Wstrict-aliasing=n @gol -Wstrict-overflow -Wstrict-overflow=@var{n} @gol
270 -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{]} @gol
271 -Wmissing-format-attribute @gol
272 -Wswitch  -Wswitch-default  -Wswitch-enum -Wsync-nand @gol
273 -Wsystem-headers  -Wtrampolines  -Wtrigraphs  -Wtype-limits  -Wundef @gol
274 -Wuninitialized  -Wunknown-pragmas  -Wno-pragmas @gol
275 -Wunsuffixed-float-constants  -Wunused  -Wunused-function @gol
276 -Wunused-label  -Wunused-local-typedefs -Wunused-parameter @gol
277 -Wno-unused-result -Wunused-value @gol -Wunused-variable @gol
278 -Wunused-but-set-parameter -Wunused-but-set-variable @gol
279 -Wuseless-cast -Wvariadic-macros -Wvector-operation-performance @gol
280 -Wvla -Wvolatile-register-var  -Wwrite-strings -Wzero-as-null-pointer-constant}
282 @item C and Objective-C-only Warning Options
283 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
284 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
285 -Wold-style-declaration  -Wold-style-definition @gol
286 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
287 -Wdeclaration-after-statement -Wpointer-sign}
289 @item Debugging Options
290 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
291 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
292 -fsanitize=@var{style} @gol
293 -fdbg-cnt-list -fdbg-cnt=@var{counter-value-list} @gol
294 -fdisable-ipa-@var{pass_name} @gol
295 -fdisable-rtl-@var{pass_name} @gol
296 -fdisable-rtl-@var{pass-name}=@var{range-list} @gol
297 -fdisable-tree-@var{pass_name} @gol
298 -fdisable-tree-@var{pass-name}=@var{range-list} @gol
299 -fdump-noaddr -fdump-unnumbered -fdump-unnumbered-links @gol
300 -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
301 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
302 -fdump-ipa-all -fdump-ipa-cgraph -fdump-ipa-inline @gol
303 -fdump-passes @gol
304 -fdump-statistics @gol
305 -fdump-tree-all @gol
306 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
307 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
308 -fdump-tree-cfg -fdump-tree-alias @gol
309 -fdump-tree-ch @gol
310 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
311 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
312 -fdump-tree-gimple@r{[}-raw@r{]} @gol
313 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
314 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
315 -fdump-tree-phiprop@r{[}-@var{n}@r{]} @gol
316 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
317 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
318 -fdump-tree-copyrename@r{[}-@var{n}@r{]} @gol
319 -fdump-tree-nrv -fdump-tree-vect @gol
320 -fdump-tree-sink @gol
321 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
322 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
323 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
324 -fdump-tree-vtable-verify @gol
325 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
326 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
327 -fdump-final-insns=@var{file} @gol
328 -fcompare-debug@r{[}=@var{opts}@r{]}  -fcompare-debug-second @gol
329 -feliminate-dwarf2-dups -fno-eliminate-unused-debug-types @gol
330 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
331 -fenable-@var{kind}-@var{pass} @gol
332 -fenable-@var{kind}-@var{pass}=@var{range-list} @gol
333 -fdebug-types-section -fmem-report-wpa @gol
334 -fenable-@var{kind}-@var{pass} @gol
335 -fenable-@var{kind}-@var{pass}=@var{range-list} @gol
336 -fdebug-types-section @gol
337 -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
338 -fprofile-strip=@var{suffix} -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
339 -fopt-info @gol
340 -fopt-info-@var{options}@r{[}=@var{file}@r{]} @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 -gmlt -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-branch-annotation -fcheck-data-deps -fclone-hot-version-paths @gol
367 -fcombine-stack-adjustments -fconserve-stack @gol
368 -fcompare-elim -fcprop-registers -fcrossjumping @gol
369 -fcse-follow-jumps -fcse-skip-blocks -fcx-fortran-rules @gol
370 -fcx-limited-range @gol
371 -fdata-sections -fdce -fdelayed-branch @gol
372 -fdelete-null-pointer-checks -fdevirtualize -fdevirtualize-speculatively -fdse @gol
373 -fearly-inlining -fipa-sra -fexpensive-optimizations -ffat-lto-objects @gol
374 -ffast-math -ffinite-math-only -ffloat-store -fexcess-precision=@var{style} @gol
375 -fforward-propagate -ffp-contract=@var{style} @gol
376 -ffunction-attribute-list -ffunction-sections @gol
377 -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm -fgraphite-identity @gol
378 -fgcse-sm -fhoist-adjacent-loads -fif-conversion @gol
379 -fif-conversion2 -findirect-inlining @gol
380 -finline-functions -finline-functions-called-once -finline-limit=@var{n} @gol
381 -finline-small-functions -fipa-cp -fipa-cp-clone @gol
382 -fipa-pta -fipa-profile -fipa-pure-const -fipa-reference @gol
383 -fira-algorithm=@var{algorithm} @gol
384 -fira-region=@var{region} -fira-hoist-pressure @gol
385 -fira-loop-pressure -fno-ira-share-save-slots @gol
386 -fno-ira-share-spill-slots -fira-verbose=@var{n} @gol
387 -fisolate-erroneous-paths-dereference -fisolate-erroneous-paths-attribute
388 -fivopts -fkeep-inline-functions -fkeep-static-consts -flive-range-shrinkage @gol
389 -floop-block -floop-interchange -floop-strip-mine -floop-nest-optimize @gol
390 -floop-parallelize-all -flto -flto-compression-level @gol
391 -flto-partition=@var{alg} -flto-report -flto-report-wpa -fmerge-all-constants @gol
392 -fmerge-constants -fmodulo-sched -fmodulo-sched-allow-regmoves @gol
393 -fmove-loop-invariants -fno-branch-count-reg @gol
394 -fno-defer-pop -fno-function-cse -fno-guess-branch-probability @gol
395 -fno-inline -fno-math-errno -fno-peephole -fno-peephole2 @gol
396 -fno-sched-interblock -fno-sched-spec -fno-signed-zeros @gol
397 -fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss @gol
398 -fomit-frame-pointer -foptimize-sibling-calls @gol
399 -fpartial-inlining -fpeel-loops -fpredictive-commoning @gol
400 -fprefetch-loop-arrays -fprofile-report @gol
401 -fprofile-correction -fprofile-dir=@var{path} -fprofile-generate @gol
402 -fprofile-generate=@var{path} -fprofile-generate-sampling @gol
403 -fprofile-use -fprofile-use=@var{path} -fprofile-values -fprofile-reorder-functions @gol
404 -freciprocal-math -free -frename-registers -freorder-blocks @gol
405 -frecord-gcc-switches-in-elf@gol
406 -freorder-blocks-and-partition -freorder-functions @gol
407 -frerun-cse-after-loop -freschedule-modulo-scheduled-loops @gol
408 -fripa -fripa-disallow-asm-modules -fripa-disallow-opt-mismatch @gol
409 -fripa-inc-path-sub=@var{path_mapping} -fripa-no-promote-always-inline-func @gol
410 -fripa-verbose -frounding-math @gol
411 -fsched2-use-superblocks -fsched-pressure @gol
412 -fsched-spec-load -fsched-spec-load-dangerous @gol
413 -fsched-stalled-insns-dep[=@var{n}] -fsched-stalled-insns[=@var{n}] @gol
414 -fsched-group-heuristic -fsched-critical-path-heuristic @gol
415 -fsched-spec-insn-heuristic -fsched-rank-heuristic @gol
416 -fsched-last-insn-heuristic -fsched-dep-count-heuristic @gol
417 -fschedule-insns -fschedule-insns2 -fsection-anchors @gol
418 -fselective-scheduling -fselective-scheduling2 @gol
419 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops @gol
420 -fshrink-wrap -fsignaling-nans -fsingle-precision-constant @gol
421 -fsplit-ivs-in-unroller -fsplit-wide-types -fstack-protector @gol
422 -fstack-protector-all -fstack-protector-strong -fstrict-aliasing @gol
423 -fstrict-overflow -fthread-jumps -ftracer -ftree-bit-ccp @gol
424 -ftree-builtin-call-dce -ftree-ccp -ftree-ch @gol
425 -ftree-coalesce-inline-vars -ftree-coalesce-vars -ftree-copy-prop @gol
426 -ftree-copyrename -ftree-dce -ftree-dominator-opts -ftree-dse @gol
427 -ftree-forwprop -ftree-fre -ftree-loop-if-convert @gol
428 -ftree-loop-if-convert-stores -ftree-loop-im @gol
429 -ftree-phiprop -ftree-loop-distribution -ftree-loop-distribute-patterns @gol
430 -ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize @gol
431 -ftree-loop-vectorize @gol
432 -ftree-parallelize-loops=@var{n} -ftree-pre -ftree-partial-pre -ftree-pta @gol
433 -ftree-reassoc -ftree-sink -ftree-slsr -ftree-sra @gol
434 -ftree-switch-conversion -ftree-tail-merge -ftree-ter @gol
435 -ftree-vectorize -ftree-vrp @gol
436 -funit-at-a-time -funroll-all-loops -funroll-loops @gol
437 -funsafe-loop-optimizations -funsafe-math-optimizations -funswitch-loops @gol
438 -fvariable-expansion-in-unroller -fvect-cost-model -fvpt -fweb @gol
439 -fwhole-program -fwpa -fuse-ld=@var{linker} -fuse-linker-plugin @gol
440 --param @var{name}=@var{value}
441 -O  -O0  -O1  -O2  -O3  -Os -Ofast -Og}
443 @item Preprocessor Options
444 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
445 @gccoptlist{-A@var{question}=@var{answer} @gol
446 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
447 -C  -dD  -dI  -dM  -dN @gol
448 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
449 -idirafter @var{dir} @gol
450 -include @var{file}  -imacros @var{file} @gol
451 -iprefix @var{file}  -iwithprefix @var{dir} @gol
452 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
453 -imultilib @var{dir} -isysroot @var{dir} @gol
454 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
455 -P  -fdebug-cpp -ftrack-macro-expansion -fworking-directory @gol
456 -remap -trigraphs  -undef  -U@var{macro}  @gol
457 -Wp,@var{option} -Xpreprocessor @var{option} -no-integrated-cpp}
459 @item Assembler Option
460 @xref{Assembler Options,,Passing Options to the Assembler}.
461 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
463 @item Linker Options
464 @xref{Link Options,,Options for Linking}.
465 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
466 -nostartfiles  -nodefaultlibs -no-pie -nostdlib -pie -rdynamic @gol
467 -s  -static -static-libgcc -static-libstdc++ @gol
468 -static-libasan -static-libtsan -static-liblsan -static-libubsan @gol
469 -shared -shared-libgcc  -symbolic @gol
470 -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
471 -u @var{symbol}}
473 @item Directory Options
474 @xref{Directory Options,,Options for Directory Search}.
475 @gccoptlist{-B@var{prefix} -I@var{dir} -iplugindir=@var{dir} @gol
476 -iquote@var{dir} -L@var{dir} -specs=@var{file} -I- @gol
477 --sysroot=@var{dir} --no-sysroot-suffix}
479 @item Machine Dependent Options
480 @xref{Submodel Options,,Hardware Models and Configurations}.
481 @c This list is ordered alphanumerically by subsection name.
482 @c Try and put the significant identifier (CPU or system) first,
483 @c so users have a clue at guessing where the ones they want will be.
485 @emph{AArch64 Options}
486 @gccoptlist{-mabi=@var{name}  -mbig-endian  -mlittle-endian @gol
487 -mgeneral-regs-only @gol
488 -mcmodel=tiny  -mcmodel=small  -mcmodel=large @gol
489 -mstrict-align @gol
490 -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
491 -mtls-dialect=desc  -mtls-dialect=traditional @gol
492 -mfix-cortex-a53-835769  -mno-fix-cortex-a53-835769 @gol
493 -march=@var{name}  -mcpu=@var{name}  -mtune=@var{name}}
495 @emph{Adapteva Epiphany Options}
496 @gccoptlist{-mhalf-reg-file -mprefer-short-insn-regs @gol
497 -mbranch-cost=@var{num} -mcmove -mnops=@var{num} -msoft-cmpsf @gol
498 -msplit-lohi -mpost-inc -mpost-modify -mstack-offset=@var{num} @gol
499 -mround-nearest -mlong-calls -mshort-calls -msmall16 @gol
500 -mfp-mode=@var{mode} -mvect-double -max-vect-align=@var{num} @gol
501 -msplit-vecmove-early -m1reg-@var{reg}}
503 @emph{ARC Options}
504 @gccoptlist{-mbarrel-shifter @gol
505 -mcpu=@var{cpu} -mA6 -mARC600 -mA7 -mARC700 @gol
506 -mdpfp -mdpfp-compact -mdpfp-fast -mno-dpfp-lrsr @gol
507 -mea -mno-mpy -mmul32x16 -mmul64 @gol
508 -mnorm -mspfp -mspfp-compact -mspfp-fast -msimd -msoft-float -mswap @gol
509 -mcrc -mdsp-packa -mdvbf -mlock -mmac-d16 -mmac-24 -mrtsc -mswape @gol
510 -mtelephony -mxy -misize -mannotate-align -marclinux -marclinux_prof @gol
511 -mepilogue-cfi -mlong-calls -mmedium-calls -msdata @gol
512 -mucb-mcount -mvolatile-cache @gol
513 -malign-call -mauto-modify-reg -mbbit-peephole -mno-brcc @gol
514 -mcase-vector-pcrel -mcompact-casesi -mno-cond-exec -mearly-cbranchsi @gol
515 -mexpand-adddi -mindexed-loads -mlra -mlra-priority-none @gol
516 -mlra-priority-compact mlra-priority-noncompact -mno-millicode @gol
517 -mmixed-code -mq-class -mRcq -mRcw -msize-level=@var{level} @gol
518 -mtune=@var{cpu} -mmultcost=@var{num} -munalign-prob-threshold=@var{probability}}
520 @emph{ARM Options}
521 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
522 -mabi=@var{name} @gol
523 -mapcs-stack-check  -mno-apcs-stack-check @gol
524 -mapcs-float  -mno-apcs-float @gol
525 -mapcs-reentrant  -mno-apcs-reentrant @gol
526 -msched-prolog  -mno-sched-prolog @gol
527 -mlittle-endian  -mbig-endian  -mwords-little-endian @gol
528 -mfloat-abi=@var{name} @gol
529 -mfp16-format=@var{name}
530 -mthumb-interwork  -mno-thumb-interwork @gol
531 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
532 -mstructure-size-boundary=@var{n} @gol
533 -mabort-on-noreturn @gol
534 -mlong-calls  -mno-long-calls @gol
535 -msingle-pic-base  -mno-single-pic-base @gol
536 -mpic-register=@var{reg} @gol
537 -mnop-fun-dllimport @gol
538 -mpoke-function-name @gol
539 -mthumb  -marm @gol
540 -mtpcs-frame  -mtpcs-leaf-frame @gol
541 -mcaller-super-interworking  -mcallee-super-interworking @gol
542 -mtp=@var{name} -mtls-dialect=@var{dialect} @gol
543 -mword-relocations @gol
544 -mfix-cortex-m3-ldrd @gol
545 -munaligned-access @gol
546 -mneon-for-64bits @gol
547 -mslow-flash-data @gol
548 -mrestrict-it}
550 @emph{AVR Options}
551 @gccoptlist{-mmcu=@var{mcu} -maccumulate-args -mbranch-cost=@var{cost} @gol
552 -mcall-prologues -mint8 -mno-interrupts -mrelax @gol
553 -mstrict-X -mtiny-stack -Waddr-space-convert}
555 @emph{Blackfin Options}
556 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
557 -msim -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
558 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
559 -mlow-64k -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
560 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
561 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
562 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
563 -mfast-fp -minline-plt -mmulticore  -mcorea  -mcoreb  -msdram @gol
564 -micplb}
566 @emph{C6X Options}
567 @gccoptlist{-mbig-endian  -mlittle-endian -march=@var{cpu} @gol
568 -msim -msdata=@var{sdata-type}}
570 @emph{CRIS Options}
571 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
572 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
573 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
574 -mstack-align  -mdata-align  -mconst-align @gol
575 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
576 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
577 -mmul-bug-workaround  -mno-mul-bug-workaround}
579 @emph{CR16 Options}
580 @gccoptlist{-mmac @gol
581 -mcr16cplus -mcr16c @gol
582 -msim -mint32 -mbit-ops
583 -mdata-model=@var{model}}
585 @emph{Darwin Options}
586 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
587 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
588 -client_name  -compatibility_version  -current_version @gol
589 -dead_strip @gol
590 -dependency-file  -dylib_file  -dylinker_install_name @gol
591 -dynamic  -dynamiclib  -exported_symbols_list @gol
592 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
593 -force_flat_namespace  -headerpad_max_install_names @gol
594 -iframework @gol
595 -image_base  -init  -install_name  -keep_private_externs @gol
596 -multi_module  -multiply_defined  -multiply_defined_unused @gol
597 -noall_load   -no_dead_strip_inits_and_terms @gol
598 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
599 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
600 -private_bundle  -read_only_relocs  -sectalign @gol
601 -sectobjectsymbols  -whyload  -seg1addr @gol
602 -sectcreate  -sectobjectsymbols  -sectorder @gol
603 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
604 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
605 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
606 -single_module  -static  -sub_library  -sub_umbrella @gol
607 -twolevel_namespace  -umbrella  -undefined @gol
608 -unexported_symbols_list  -weak_reference_mismatches @gol
609 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
610 -mkernel -mone-byte-bool}
612 @emph{DEC Alpha Options}
613 @gccoptlist{-mno-fp-regs  -msoft-float @gol
614 -mieee  -mieee-with-inexact  -mieee-conformant @gol
615 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
616 -mtrap-precision=@var{mode}  -mbuild-constants @gol
617 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
618 -mbwx  -mmax  -mfix  -mcix @gol
619 -mfloat-vax  -mfloat-ieee @gol
620 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
621 -msmall-text  -mlarge-text @gol
622 -mmemory-latency=@var{time}}
624 @emph{FR30 Options}
625 @gccoptlist{-msmall-model -mno-lsim}
627 @emph{FRV Options}
628 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
629 -mhard-float  -msoft-float @gol
630 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
631 -mdouble  -mno-double @gol
632 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
633 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
634 -mlinked-fp  -mlong-calls  -malign-labels @gol
635 -mlibrary-pic  -macc-4  -macc-8 @gol
636 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
637 -moptimize-membar -mno-optimize-membar @gol
638 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
639 -mvliw-branch  -mno-vliw-branch @gol
640 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
641 -mno-nested-cond-exec  -mtomcat-stats @gol
642 -mTLS -mtls @gol
643 -mcpu=@var{cpu}}
645 @emph{GNU/Linux Options}
646 @gccoptlist{-mglibc -muclibc -mbionic -mandroid @gol
647 -tno-android-cc -tno-android-ld}
649 @emph{H8/300 Options}
650 @gccoptlist{-mrelax  -mh  -ms  -mn  -mexr -mno-exr  -mint32  -malign-300}
652 @emph{HPPA Options}
653 @gccoptlist{-march=@var{architecture-type} @gol
654 -mdisable-fpregs  -mdisable-indexing @gol
655 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
656 -mfixed-range=@var{register-range} @gol
657 -mjump-in-delay -mlinker-opt -mlong-calls @gol
658 -mlong-load-store  -mno-disable-fpregs @gol
659 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
660 -mno-jump-in-delay  -mno-long-load-store @gol
661 -mno-portable-runtime  -mno-soft-float @gol
662 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
663 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
664 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
665 -munix=@var{unix-std}  -nolibdld  -static  -threads}
667 @emph{i386 and x86-64 Options}
668 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
669 -mtune-ctrl=@var{feature-list} -mdump-tune-features -mno-default @gol
670 -mfpmath=@var{unit} @gol
671 -masm=@var{dialect}  -mno-fancy-math-387 @gol
672 -mno-fp-ret-in-387  -msoft-float @gol
673 -mno-wide-multiply  -mrtd  -malign-double @gol
674 -mpreferred-stack-boundary=@var{num} @gol
675 -mincoming-stack-boundary=@var{num} @gol
676 -mcld -mcx16 -msahf -mmovbe -mcrc32 @gol
677 -mrecip -mrecip=@var{opt} @gol
678 -mvzeroupper -mprefer-avx128 @gol
679 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx @gol
680 -mavx2 -mavx512f -mavx512pf -mavx512er -mavx512cd -msha @gol
681 -maes -mpclmul -mfsgsbase -mrdrnd -mf16c -mfma -mprefetchwt1 @gol
682 -msse4a -m3dnow -mpopcnt -mabm -mbmi -mtbm -mfma4 -mxop -mlzcnt @gol
683 -mbmi2 -mfxsr -mxsave -mxsaveopt -mrtm -mlwp -mthreads @gol
684 -mno-align-stringops  -minline-all-stringops @gol
685 -minline-stringops-dynamically -mstringop-strategy=@var{alg} @gol
686 -mmemcpy-strategy=@var{strategy} -mmemset-strategy=@var{strategy}
687 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
688 -m96bit-long-double -mlong-double-64 -mlong-double-80 -mlong-double-128 @gol
689 -mregparm=@var{num}  -msseregparm @gol
690 -mveclibabi=@var{type} -mvect8-ret-in-mem @gol
691 -mpc32 -mpc64 -mpc80 -mstackrealign @gol
692 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
693 -mcmodel=@var{code-model} -mabi=@var{name} -maddress-mode=@var{mode} @gol
694 -m32 -m64 -mx32 -m16 -mlarge-data-threshold=@var{num} @gol
695 -msse2avx -mfentry -m8bit-idiv @gol
696 -mavx256-split-unaligned-load -mavx256-split-unaligned-store @gol
697 -mstack-protector-guard=@var{guard}}
699 @emph{i386 and x86-64 Windows Options}
700 @gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll @gol
701 -mnop-fun-dllimport -mthread @gol
702 -municode -mwin32 -mwindows -fno-set-stack-executable}
704 @emph{IA-64 Options}
705 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
706 -mvolatile-asm-stop  -mregister-names  -msdata -mno-sdata @gol
707 -mconstant-gp  -mauto-pic  -mfused-madd @gol
708 -minline-float-divide-min-latency @gol
709 -minline-float-divide-max-throughput @gol
710 -mno-inline-float-divide @gol
711 -minline-int-divide-min-latency @gol
712 -minline-int-divide-max-throughput  @gol
713 -mno-inline-int-divide @gol
714 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
715 -mno-inline-sqrt @gol
716 -mdwarf2-asm -mearly-stop-bits @gol
717 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
718 -mtune=@var{cpu-type} -milp32 -mlp64 @gol
719 -msched-br-data-spec -msched-ar-data-spec -msched-control-spec @gol
720 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
721 -msched-spec-ldc -msched-spec-control-ldc @gol
722 -msched-prefer-non-data-spec-insns -msched-prefer-non-control-spec-insns @gol
723 -msched-stop-bits-after-every-cycle -msched-count-spec-in-critical-path @gol
724 -msel-sched-dont-check-control-spec -msched-fp-mem-deps-zero-cost @gol
725 -msched-max-memory-insns-hard-limit -msched-max-memory-insns=@var{max-insns}}
727 @emph{LM32 Options}
728 @gccoptlist{-mbarrel-shift-enabled -mdivide-enabled -mmultiply-enabled @gol
729 -msign-extend-enabled -muser-enabled}
731 @emph{M32R/D Options}
732 @gccoptlist{-m32r2 -m32rx -m32r @gol
733 -mdebug @gol
734 -malign-loops -mno-align-loops @gol
735 -missue-rate=@var{number} @gol
736 -mbranch-cost=@var{number} @gol
737 -mmodel=@var{code-size-model-type} @gol
738 -msdata=@var{sdata-type} @gol
739 -mno-flush-func -mflush-func=@var{name} @gol
740 -mno-flush-trap -mflush-trap=@var{number} @gol
741 -G @var{num}}
743 @emph{M32C Options}
744 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
746 @emph{M680x0 Options}
747 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune}
748 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
749 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
750 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
751 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
752 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
753 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
754 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
755 -mxgot -mno-xgot}
757 @emph{MCore Options}
758 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
759 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
760 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
761 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
762 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
764 @emph{MeP Options}
765 @gccoptlist{-mabsdiff -mall-opts -maverage -mbased=@var{n} -mbitops @gol
766 -mc=@var{n} -mclip -mconfig=@var{name} -mcop -mcop32 -mcop64 -mivc2 @gol
767 -mdc -mdiv -meb -mel -mio-volatile -ml -mleadz -mm -mminmax @gol
768 -mmult -mno-opts -mrepeat -ms -msatur -msdram -msim -msimnovec -mtf @gol
769 -mtiny=@var{n}}
771 @emph{MicroBlaze Options}
772 @gccoptlist{-msoft-float -mhard-float -msmall-divides -mcpu=@var{cpu} @gol
773 -mmemcpy -mxl-soft-mul -mxl-soft-div -mxl-barrel-shift @gol
774 -mxl-pattern-compare -mxl-stack-check -mxl-gp-opt -mno-clearbss @gol
775 -mxl-multiply-high -mxl-float-convert -mxl-float-sqrt @gol
776 -mbig-endian -mlittle-endian -mxl-reorder -mxl-mode-@var{app-model}}
778 @emph{MIPS Options}
779 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
780 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2  -mips32r3  -mips32r5 @gol
781 -mips32r6  -mips64  -mips64r2  -mips64r3  -mips64r5  -mips64r6 @gol
782 -mips16  -mno-mips16  -mflip-mips16 @gol
783 -minterlink-compressed -mno-interlink-compressed @gol
784 -minterlink-mips16  -mno-interlink-mips16 @gol
785 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
786 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
787 -mgp32  -mgp64  -mfp32  -mfpxx  -mfp64  -mhard-float  -msoft-float @gol
788 -mno-float  -msingle-float  -mdouble-float @gol
789 -modd-spreg -mno-odd-spreg @gol
790 -mabs=@var{mode}  -mnan=@var{encoding} @gol
791 -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
792 -mmcu -mmno-mcu @gol
793 -meva -mno-eva @gol
794 -mvirt -mno-virt @gol
795 -mxpa -mno-xpa @gol
796 -mmicromips -mno-micromips @gol
797 -mmsa -mno-msa @gol
798 -mfpu=@var{fpu-type} @gol
799 -msmartmips  -mno-smartmips @gol
800 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
801 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
802 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
803 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
804 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
805 -membedded-data  -mno-embedded-data @gol
806 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
807 -mcode-readable=@var{setting} @gol
808 -msplit-addresses  -mno-split-addresses @gol
809 -mexplicit-relocs  -mno-explicit-relocs @gol
810 -mcheck-zero-division  -mno-check-zero-division @gol
811 -mdivide-traps  -mdivide-breaks @gol
812 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
813 -mmad -mno-mad -mimadd -mno-imadd -mfused-madd  -mno-fused-madd  -nocpp @gol
814 -mfix-24k -mno-fix-24k @gol
815 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
816 -mfix-r10000 -mno-fix-r10000  -mfix-rm7000 -mno-fix-rm7000 @gol
817 -mfix-vr4120  -mno-fix-vr4120 @gol
818 -mfix-vr4130  -mno-fix-vr4130  -mfix-sb1  -mno-fix-sb1 @gol
819 -mflush-func=@var{func}  -mno-flush-func @gol
820 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
821 -mfp-exceptions -mno-fp-exceptions @gol
822 -mvr4130-align -mno-vr4130-align -msynci -mno-synci @gol
823 -mrelax-pic-calls -mno-relax-pic-calls -mmcount-ra-address}
825 @emph{MMIX Options}
826 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
827 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
828 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
829 -mno-base-addresses  -msingle-exit  -mno-single-exit}
831 @emph{MN10300 Options}
832 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
833 -mno-am33 -mam33 -mam33-2 -mam34 @gol
834 -mtune=@var{cpu-type} @gol
835 -mreturn-pointer-on-d0 @gol
836 -mno-crt0  -mrelax -mliw -msetlb}
838 @emph{Moxie Options}
839 @gccoptlist{-meb -mel -mno-crt0}
841 @emph{MSP430 Options}
842 @gccoptlist{-msim -masm-hex -mmcu= -mcpu= -mlarge -msmall -mrelax @gol
843 -mhwmult= -minrt}
845 @emph{NDS32 Options}
846 @gccoptlist{-mbig-endian -mlittle-endian @gol
847 -mreduced-regs -mfull-regs @gol
848 -mcmov -mno-cmov @gol
849 -mperf-ext -mno-perf-ext @gol
850 -mv3push -mno-v3push @gol
851 -m16bit -mno-16bit @gol
852 -mgp-direct -mno-gp-direct @gol
853 -misr-vector-size=@var{num} @gol
854 -mcache-block-size=@var{num} @gol
855 -march=@var{arch} @gol
856 -mforce-fp-as-gp -mforbid-fp-as-gp @gol
857 -mex9 -mctor-dtor -mrelax}
859 @emph{Nios II Options}
860 @gccoptlist{-G @var{num} -mgpopt -mno-gpopt -mel -meb @gol
861 -mno-bypass-cache -mbypass-cache @gol
862 -mno-cache-volatile -mcache-volatile @gol
863 -mno-fast-sw-div -mfast-sw-div @gol
864 -mhw-mul -mno-hw-mul -mhw-mulx -mno-hw-mulx -mno-hw-div -mhw-div @gol
865 -mcustom-@var{insn}=@var{N} -mno-custom-@var{insn} @gol
866 -mcustom-fpu-cfg=@var{name} @gol
867 -mhal -msmallc -msys-crt0=@var{name} -msys-lib=@var{name}}
869 @emph{PDP-11 Options}
870 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
871 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
872 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
873 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
874 -mbranch-expensive  -mbranch-cheap @gol
875 -munix-asm  -mdec-asm}
877 @emph{picoChip Options}
878 @gccoptlist{-mae=@var{ae_type} -mvliw-lookahead=@var{N} @gol
879 -msymbol-as-address -mno-inefficient-warnings}
881 @emph{PowerPC Options}
882 See RS/6000 and PowerPC Options.
884 @emph{RL78 Options}
885 @gccoptlist{-msim -mmul=none -mmul=g13 -mmul=rl78}
887 @emph{RS/6000 and PowerPC Options}
888 @gccoptlist{-mcpu=@var{cpu-type} @gol
889 -mtune=@var{cpu-type} @gol
890 -mcmodel=@var{code-model} @gol
891 -mpowerpc64 @gol
892 -maltivec  -mno-altivec @gol
893 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
894 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
895 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb -mpopcntd -mno-popcntd @gol
896 -mfprnd  -mno-fprnd @gol
897 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp @gol
898 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
899 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
900 -malign-power  -malign-natural @gol
901 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
902 -msingle-float -mdouble-float -msimple-fpu @gol
903 -mstring  -mno-string  -mupdate  -mno-update @gol
904 -mavoid-indexed-addresses  -mno-avoid-indexed-addresses @gol
905 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
906 -mstrict-align  -mno-strict-align  -mrelocatable @gol
907 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
908 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
909 -mdynamic-no-pic  -maltivec -mswdiv  -msingle-pic-base @gol
910 -mprioritize-restricted-insns=@var{priority} @gol
911 -msched-costly-dep=@var{dependence_type} @gol
912 -minsert-sched-nops=@var{scheme} @gol
913 -mcall-sysv  -mcall-netbsd @gol
914 -maix-struct-return  -msvr4-struct-return @gol
915 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
916 -mblock-move-inline-limit=@var{num} @gol
917 -misel -mno-isel @gol
918 -misel=yes  -misel=no @gol
919 -mspe -mno-spe @gol
920 -mspe=yes  -mspe=no @gol
921 -mpaired @gol
922 -mgen-cell-microcode -mwarn-cell-microcode @gol
923 -mvrsave -mno-vrsave @gol
924 -mmulhw -mno-mulhw @gol
925 -mdlmzb -mno-dlmzb @gol
926 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
927 -mprototype  -mno-prototype @gol
928 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
929 -msdata=@var{opt}  -mvxworks  -G @var{num}  -pthread @gol
930 -mrecip -mrecip=@var{opt} -mno-recip -mrecip-precision @gol
931 -mno-recip-precision @gol
932 -mveclibabi=@var{type} -mfriz -mno-friz @gol
933 -mpointers-to-nested-functions -mno-pointers-to-nested-functions @gol
934 -msave-toc-indirect -mno-save-toc-indirect @gol
935 -mpower8-fusion -mno-mpower8-fusion -mpower8-vector -mno-power8-vector @gol
936 -mcrypto -mno-crypto -mdirect-move -mno-direct-move @gol
937 -mquad-memory -mno-quad-memory @gol
938 -mquad-memory-atomic -mno-quad-memory-atomic @gol
939 -mcompat-align-parm -mno-compat-align-parm}
941 @emph{RX Options}
942 @gccoptlist{-m64bit-doubles  -m32bit-doubles  -fpu  -nofpu@gol
943 -mcpu=@gol
944 -mbig-endian-data -mlittle-endian-data @gol
945 -msmall-data @gol
946 -msim  -mno-sim@gol
947 -mas100-syntax -mno-as100-syntax@gol
948 -mrelax@gol
949 -mmax-constant-size=@gol
950 -mint-register=@gol
951 -mpid@gol
952 -mno-warn-multiple-fast-interrupts@gol
953 -msave-acc-in-interrupts}
955 @emph{S/390 and zSeries Options}
956 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
957 -mhard-float  -msoft-float  -mhard-dfp -mno-hard-dfp @gol
958 -mlong-double-64 -mlong-double-128 @gol
959 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
960 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
961 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
962 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
963 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard @gol
964 -mhotpatch[=@var{halfwords}] -mno-hotpatch}
966 @emph{Score Options}
967 @gccoptlist{-meb -mel @gol
968 -mnhwloop @gol
969 -muls @gol
970 -mmac @gol
971 -mscore5 -mscore5u -mscore7 -mscore7d}
973 @emph{SH Options}
974 @gccoptlist{-m1  -m2  -m2e @gol
975 -m2a-nofpu -m2a-single-only -m2a-single -m2a @gol
976 -m3  -m3e @gol
977 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
978 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
979 -m5-64media  -m5-64media-nofpu @gol
980 -m5-32media  -m5-32media-nofpu @gol
981 -m5-compact  -m5-compact-nofpu @gol
982 -mb  -ml  -mdalign  -mrelax @gol
983 -mbigtable -mfmovd -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
984 -mieee -mno-ieee -mbitops  -misize  -minline-ic_invalidate -mpadstruct @gol
985 -mspace -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
986 -mdivsi3_libfunc=@var{name} -mfixed-range=@var{register-range} @gol
987 -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
988 -maccumulate-outgoing-args -minvalid-symbols @gol
989 -matomic-model=@var{atomic-model} @gol
990 -mbranch-cost=@var{num} -mzdcbranch -mno-zdcbranch @gol
991 -mfused-madd -mno-fused-madd -mfsca -mno-fsca -mfsrra -mno-fsrra @gol
992 -mpretend-cmove -mtas}
994 @emph{Solaris 2 Options}
995 @gccoptlist{-mclear-hwcap -mno-clear-hwcap -mimpure-text  -mno-impure-text @gol
996 -pthreads -pthread}
998 @emph{SPARC Options}
999 @gccoptlist{-mcpu=@var{cpu-type} @gol
1000 -mtune=@var{cpu-type} @gol
1001 -mcmodel=@var{code-model} @gol
1002 -mmemory-model=@var{mem-model} @gol
1003 -m32  -m64  -mapp-regs  -mno-app-regs @gol
1004 -mfaster-structs  -mno-faster-structs  -mflat  -mno-flat @gol
1005 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
1006 -mhard-quad-float  -msoft-quad-float @gol
1007 -mstack-bias  -mno-stack-bias @gol
1008 -munaligned-doubles  -mno-unaligned-doubles @gol
1009 -muser-mode  -mno-user-mode @gol
1010 -mv8plus  -mno-v8plus  -mvis  -mno-vis @gol
1011 -mvis2  -mno-vis2  -mvis3  -mno-vis3 @gol
1012 -mcbcond -mno-cbcond @gol
1013 -mfmaf  -mno-fmaf  -mpopc  -mno-popc @gol
1014 -mfix-at697f -mfix-ut699}
1016 @emph{SPU Options}
1017 @gccoptlist{-mwarn-reloc -merror-reloc @gol
1018 -msafe-dma -munsafe-dma @gol
1019 -mbranch-hints @gol
1020 -msmall-mem -mlarge-mem -mstdmain @gol
1021 -mfixed-range=@var{register-range} @gol
1022 -mea32 -mea64 @gol
1023 -maddress-space-conversion -mno-address-space-conversion @gol
1024 -mcache-size=@var{cache-size} @gol
1025 -matomic-updates -mno-atomic-updates}
1027 @emph{System V Options}
1028 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
1030 @emph{TILE-Gx Options}
1031 @gccoptlist{-mcpu=CPU -m32 -m64 -mbig-endian -mlittle-endian @gol
1032 -mcmodel=@var{code-model}}
1034 @emph{TILEPro Options}
1035 @gccoptlist{-mcpu=@var{cpu} -m32}
1037 @emph{V850 Options}
1038 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
1039 -mprolog-function  -mno-prolog-function  -mspace @gol
1040 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
1041 -mapp-regs  -mno-app-regs @gol
1042 -mdisable-callt  -mno-disable-callt @gol
1043 -mv850e2v3 -mv850e2 -mv850e1 -mv850es @gol
1044 -mv850e -mv850 -mv850e3v5 @gol
1045 -mloop @gol
1046 -mrelax @gol
1047 -mlong-jumps @gol
1048 -msoft-float @gol
1049 -mhard-float @gol
1050 -mgcc-abi @gol
1051 -mrh850-abi @gol
1052 -mbig-switch}
1054 @emph{VAX Options}
1055 @gccoptlist{-mg  -mgnu  -munix}
1057 @emph{VMS Options}
1058 @gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64 @gol
1059 -mpointer-size=@var{size}}
1061 @emph{VxWorks Options}
1062 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
1063 -Xbind-lazy  -Xbind-now}
1065 @emph{x86-64 Options}
1066 See i386 and x86-64 Options.
1068 @emph{Xstormy16 Options}
1069 @gccoptlist{-msim}
1071 @emph{Xtensa Options}
1072 @gccoptlist{-mconst16 -mno-const16 @gol
1073 -mfused-madd  -mno-fused-madd @gol
1074 -mforce-no-pic @gol
1075 -mserialize-volatile  -mno-serialize-volatile @gol
1076 -mtext-section-literals  -mno-text-section-literals @gol
1077 -mtarget-align  -mno-target-align @gol
1078 -mlongcalls  -mno-longcalls}
1080 @emph{zSeries Options}
1081 See S/390 and zSeries Options.
1083 @item Code Generation Options
1084 @xref{Code Gen Options,,Options for Code Generation Conventions}.
1085 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
1086 -ffixed-@var{reg}  -fexceptions @gol
1087 -fnon-call-exceptions  -fdelete-dead-exceptions  -funwind-tables @gol
1088 -fasynchronous-unwind-tables @gol
1089 -fno-gnu-unique @gol
1090 -finhibit-size-directive  -finstrument-functions @gol
1091 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
1092 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol
1093 -fno-common  -fno-ident @gol
1094 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE -fno-plt @gol
1095 -fno-jump-tables @gol
1096 -frecord-gcc-switches @gol
1097 -freg-struct-return  -fshort-enums @gol
1098 -fshort-double  -fshort-wchar @gol
1099 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
1100 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
1101 -fno-stack-limit -fsplit-stack @gol
1102 -fleading-underscore  -ftls-model=@var{model} @gol
1103 -fstack-reuse=@var{reuse_level} @gol
1104 -ftrapv  -fwrapv  -fbounds-check @gol
1105 -fvisibility -fstrict-volatile-bitfields -fsync-libcalls}
1106 @end table
1109 @node Overall Options
1110 @section Options Controlling the Kind of Output
1112 Compilation can involve up to four stages: preprocessing, compilation
1113 proper, assembly and linking, always in that order.  GCC is capable of
1114 preprocessing and compiling several files either into several
1115 assembler input files, or into one assembler input file; then each
1116 assembler input file produces an object file, and linking combines all
1117 the object files (those newly compiled, and those specified as input)
1118 into an executable file.
1120 @cindex file name suffix
1121 For any given input file, the file name suffix determines what kind of
1122 compilation is done:
1124 @table @gcctabopt
1125 @item @var{file}.c
1126 C source code that must be preprocessed.
1128 @item @var{file}.i
1129 C source code that should not be preprocessed.
1131 @item @var{file}.ii
1132 C++ source code that should not be preprocessed.
1134 @item @var{file}.m
1135 Objective-C source code.  Note that you must link with the @file{libobjc}
1136 library to make an Objective-C program work.
1138 @item @var{file}.mi
1139 Objective-C source code that should not be preprocessed.
1141 @item @var{file}.mm
1142 @itemx @var{file}.M
1143 Objective-C++ source code.  Note that you must link with the @file{libobjc}
1144 library to make an Objective-C++ program work.  Note that @samp{.M} refers
1145 to a literal capital M@.
1147 @item @var{file}.mii
1148 Objective-C++ source code that should not be preprocessed.
1150 @item @var{file}.h
1151 C, C++, Objective-C or Objective-C++ header file to be turned into a
1152 precompiled header (default), or C, C++ header file to be turned into an
1153 Ada spec (via the @option{-fdump-ada-spec} switch).
1155 @item @var{file}.cc
1156 @itemx @var{file}.cp
1157 @itemx @var{file}.cxx
1158 @itemx @var{file}.cpp
1159 @itemx @var{file}.CPP
1160 @itemx @var{file}.c++
1161 @itemx @var{file}.C
1162 C++ source code that must be preprocessed.  Note that in @samp{.cxx},
1163 the last two letters must both be literally @samp{x}.  Likewise,
1164 @samp{.C} refers to a literal capital C@.
1166 @item @var{file}.mm
1167 @itemx @var{file}.M
1168 Objective-C++ source code that must be preprocessed.
1170 @item @var{file}.mii
1171 Objective-C++ source code that should not be preprocessed.
1173 @item @var{file}.hh
1174 @itemx @var{file}.H
1175 @itemx @var{file}.hp
1176 @itemx @var{file}.hxx
1177 @itemx @var{file}.hpp
1178 @itemx @var{file}.HPP
1179 @itemx @var{file}.h++
1180 @itemx @var{file}.tcc
1181 C++ header file to be turned into a precompiled header or Ada spec.
1183 @item @var{file}.f
1184 @itemx @var{file}.for
1185 @itemx @var{file}.ftn
1186 Fixed form Fortran source code that should not be preprocessed.
1188 @item @var{file}.F
1189 @itemx @var{file}.FOR
1190 @itemx @var{file}.fpp
1191 @itemx @var{file}.FPP
1192 @itemx @var{file}.FTN
1193 Fixed form Fortran source code that must be preprocessed (with the traditional
1194 preprocessor).
1196 @item @var{file}.f90
1197 @itemx @var{file}.f95
1198 @itemx @var{file}.f03
1199 @itemx @var{file}.f08
1200 Free form Fortran source code that should not be preprocessed.
1202 @item @var{file}.F90
1203 @itemx @var{file}.F95
1204 @itemx @var{file}.F03
1205 @itemx @var{file}.F08
1206 Free form Fortran source code that must be preprocessed (with the
1207 traditional preprocessor).
1209 @item @var{file}.go
1210 Go source code.
1212 @c FIXME: Descriptions of Java file types.
1213 @c @var{file}.java
1214 @c @var{file}.class
1215 @c @var{file}.zip
1216 @c @var{file}.jar
1218 @item @var{file}.ads
1219 Ada source code file that contains a library unit declaration (a
1220 declaration of a package, subprogram, or generic, or a generic
1221 instantiation), or a library unit renaming declaration (a package,
1222 generic, or subprogram renaming declaration).  Such files are also
1223 called @dfn{specs}.
1225 @item @var{file}.adb
1226 Ada source code file containing a library unit body (a subprogram or
1227 package body).  Such files are also called @dfn{bodies}.
1229 @c GCC also knows about some suffixes for languages not yet included:
1230 @c Pascal:
1231 @c @var{file}.p
1232 @c @var{file}.pas
1233 @c Ratfor:
1234 @c @var{file}.r
1236 @item @var{file}.s
1237 Assembler code.
1239 @item @var{file}.S
1240 @itemx @var{file}.sx
1241 Assembler code that must be preprocessed.
1243 @item @var{other}
1244 An object file to be fed straight into linking.
1245 Any file name with no recognized suffix is treated this way.
1246 @end table
1248 @opindex x
1249 You can specify the input language explicitly with the @option{-x} option:
1251 @table @gcctabopt
1252 @item -x @var{language}
1253 Specify explicitly the @var{language} for the following input files
1254 (rather than letting the compiler choose a default based on the file
1255 name suffix).  This option applies to all following input files until
1256 the next @option{-x} option.  Possible values for @var{language} are:
1257 @smallexample
1258 c  c-header  cpp-output
1259 c++  c++-header  c++-cpp-output
1260 objective-c  objective-c-header  objective-c-cpp-output
1261 objective-c++ objective-c++-header objective-c++-cpp-output
1262 assembler  assembler-with-cpp
1264 f77  f77-cpp-input f95  f95-cpp-input
1266 java
1267 @end smallexample
1269 @item -x none
1270 Turn off any specification of a language, so that subsequent files are
1271 handled according to their file name suffixes (as they are if @option{-x}
1272 has not been used at all).
1274 @item -pass-exit-codes
1275 @opindex pass-exit-codes
1276 Normally the @command{gcc} program exits with the code of 1 if any
1277 phase of the compiler returns a non-success return code.  If you specify
1278 @option{-pass-exit-codes}, the @command{gcc} program instead returns with
1279 the numerically highest error produced by any phase returning an error
1280 indication.  The C, C++, and Fortran front ends return 4 if an internal
1281 compiler error is encountered.
1282 @end table
1284 If you only want some of the stages of compilation, you can use
1285 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1286 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1287 @command{gcc} is to stop.  Note that some combinations (for example,
1288 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1290 @table @gcctabopt
1291 @item -c
1292 @opindex c
1293 Compile or assemble the source files, but do not link.  The linking
1294 stage simply is not done.  The ultimate output is in the form of an
1295 object file for each source file.
1297 By default, the object file name for a source file is made by replacing
1298 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1300 Unrecognized input files, not requiring compilation or assembly, are
1301 ignored.
1303 @item -S
1304 @opindex S
1305 Stop after the stage of compilation proper; do not assemble.  The output
1306 is in the form of an assembler code file for each non-assembler input
1307 file specified.
1309 By default, the assembler file name for a source file is made by
1310 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1312 Input files that don't require compilation are ignored.
1314 @item -E
1315 @opindex E
1316 Stop after the preprocessing stage; do not run the compiler proper.  The
1317 output is in the form of preprocessed source code, which is sent to the
1318 standard output.
1320 Input files that don't require preprocessing are ignored.
1322 @cindex output file option
1323 @item -o @var{file}
1324 @opindex o
1325 Place output in file @var{file}.  This applies to whatever
1326 sort of output is being produced, whether it be an executable file,
1327 an object file, an assembler file or preprocessed C code.
1329 If @option{-o} is not specified, the default is to put an executable
1330 file in @file{a.out}, the object file for
1331 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1332 assembler file in @file{@var{source}.s}, a precompiled header file in
1333 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1334 standard output.
1336 @item -v
1337 @opindex v
1338 Print (on standard error output) the commands executed to run the stages
1339 of compilation.  Also print the version number of the compiler driver
1340 program and of the preprocessor and the compiler proper.
1342 @item -###
1343 @opindex ###
1344 Like @option{-v} except the commands are not executed and arguments
1345 are quoted unless they contain only alphanumeric characters or @code{./-_}.
1346 This is useful for shell scripts to capture the driver-generated command lines.
1348 @item -pipe
1349 @opindex pipe
1350 Use pipes rather than temporary files for communication between the
1351 various stages of compilation.  This fails to work on some systems where
1352 the assembler is unable to read from a pipe; but the GNU assembler has
1353 no trouble.
1355 @item --help
1356 @opindex help
1357 Print (on the standard output) a description of the command-line options
1358 understood by @command{gcc}.  If the @option{-v} option is also specified
1359 then @option{--help} is also passed on to the various processes
1360 invoked by @command{gcc}, so that they can display the command-line options
1361 they accept.  If the @option{-Wextra} option has also been specified
1362 (prior to the @option{--help} option), then command-line options that
1363 have no documentation associated with them are also displayed.
1365 @item --target-help
1366 @opindex target-help
1367 Print (on the standard output) a description of target-specific command-line
1368 options for each tool.  For some targets extra target-specific
1369 information may also be printed.
1371 @item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]}
1372 Print (on the standard output) a description of the command-line
1373 options understood by the compiler that fit into all specified classes
1374 and qualifiers.  These are the supported classes:
1376 @table @asis
1377 @item @samp{optimizers}
1378 Display all of the optimization options supported by the
1379 compiler.
1381 @item @samp{warnings}
1382 Display all of the options controlling warning messages
1383 produced by the compiler.
1385 @item @samp{target}
1386 Display target-specific options.  Unlike the
1387 @option{--target-help} option however, target-specific options of the
1388 linker and assembler are not displayed.  This is because those
1389 tools do not currently support the extended @option{--help=} syntax.
1391 @item @samp{params}
1392 Display the values recognized by the @option{--param}
1393 option.
1395 @item @var{language}
1396 Display the options supported for @var{language}, where
1397 @var{language} is the name of one of the languages supported in this
1398 version of GCC@.
1400 @item @samp{common}
1401 Display the options that are common to all languages.
1402 @end table
1404 These are the supported qualifiers:
1406 @table @asis
1407 @item @samp{undocumented}
1408 Display only those options that are undocumented.
1410 @item @samp{joined}
1411 Display options taking an argument that appears after an equal
1412 sign in the same continuous piece of text, such as:
1413 @samp{--help=target}.
1415 @item @samp{separate}
1416 Display options taking an argument that appears as a separate word
1417 following the original option, such as: @samp{-o output-file}.
1418 @end table
1420 Thus for example to display all the undocumented target-specific
1421 switches supported by the compiler, use:
1423 @smallexample
1424 --help=target,undocumented
1425 @end smallexample
1427 The sense of a qualifier can be inverted by prefixing it with the
1428 @samp{^} character, so for example to display all binary warning
1429 options (i.e., ones that are either on or off and that do not take an
1430 argument) that have a description, use:
1432 @smallexample
1433 --help=warnings,^joined,^undocumented
1434 @end smallexample
1436 The argument to @option{--help=} should not consist solely of inverted
1437 qualifiers.
1439 Combining several classes is possible, although this usually
1440 restricts the output so much that there is nothing to display.  One
1441 case where it does work, however, is when one of the classes is
1442 @var{target}.  For example, to display all the target-specific
1443 optimization options, use:
1445 @smallexample
1446 --help=target,optimizers
1447 @end smallexample
1449 The @option{--help=} option can be repeated on the command line.  Each
1450 successive use displays its requested class of options, skipping
1451 those that have already been displayed.
1453 If the @option{-Q} option appears on the command line before the
1454 @option{--help=} option, then the descriptive text displayed by
1455 @option{--help=} is changed.  Instead of describing the displayed
1456 options, an indication is given as to whether the option is enabled,
1457 disabled or set to a specific value (assuming that the compiler
1458 knows this at the point where the @option{--help=} option is used).
1460 Here is a truncated example from the ARM port of @command{gcc}:
1462 @smallexample
1463   % gcc -Q -mabi=2 --help=target -c
1464   The following options are target specific:
1465   -mabi=                                2
1466   -mabort-on-noreturn                   [disabled]
1467   -mapcs                                [disabled]
1468 @end smallexample
1470 The output is sensitive to the effects of previous command-line
1471 options, so for example it is possible to find out which optimizations
1472 are enabled at @option{-O2} by using:
1474 @smallexample
1475 -Q -O2 --help=optimizers
1476 @end smallexample
1478 Alternatively you can discover which binary optimizations are enabled
1479 by @option{-O3} by using:
1481 @smallexample
1482 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1483 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1484 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1485 @end smallexample
1487 @item -canonical-prefixes
1488 @opindex canonical-prefixes
1489 Always expand any symbolic links, resolve references to @samp{/../}
1490 or @samp{/./}, and make the path absolute when generating a relative
1491 prefix.
1493 @item -no-canonical-prefixes
1494 @opindex no-canonical-prefixes
1495 Never expand any symbolic links, resolve references to @samp{/../}
1496 or @samp{/./}, or make the path absolute when generating a relative
1497 prefix. If neither @option{-canonical-prefixes} nor
1498 @option{-nocanonical-prefixes} is given, GCC tries to set an appropriate
1499 default by looking for a target-specific subdirectory alongside the
1500 directory containing the compiler driver.
1502 @item --version
1503 @opindex version
1504 Display the version number and copyrights of the invoked GCC@.
1506 @item -wrapper
1507 @opindex wrapper
1508 Invoke all subcommands under a wrapper program.  The name of the
1509 wrapper program and its parameters are passed as a comma separated
1510 list.
1512 @smallexample
1513 gcc -c t.c -wrapper gdb,--args
1514 @end smallexample
1516 @noindent
1517 This invokes all subprograms of @command{gcc} under
1518 @samp{gdb --args}, thus the invocation of @command{cc1} is
1519 @samp{gdb --args cc1 @dots{}}.
1521 @item -fplugin=@var{name}.so
1522 @opindex fplugin
1523 Load the plugin code in file @var{name}.so, assumed to be a
1524 shared object to be dlopen'd by the compiler.  The base name of
1525 the shared object file is used to identify the plugin for the
1526 purposes of argument parsing (See
1527 @option{-fplugin-arg-@var{name}-@var{key}=@var{value}} below).
1528 Each plugin should define the callback functions specified in the
1529 Plugins API.
1531 @item -fplugin-arg-@var{name}-@var{key}=@var{value}
1532 @opindex fplugin-arg
1533 Define an argument called @var{key} with a value of @var{value}
1534 for the plugin called @var{name}.
1536 @item -fdump-ada-spec@r{[}-slim@r{]}
1537 @opindex fdump-ada-spec
1538 For C and C++ source and include files, generate corresponding Ada specs.
1539 @xref{Generating Ada Bindings for C and C++ headers,,, gnat_ugn,
1540 GNAT User's Guide}, which provides detailed documentation on this feature.
1542 @item -fada-spec-parent=@var{unit}
1543 @opindex fada-spec-parent
1544 In conjunction with @option{-fdump-ada-spec@r{[}-slim@r{]}} above, generate
1545 Ada specs as child units of parent @var{unit}.
1547 @item -fdump-go-spec=@var{file}
1548 @opindex fdump-go-spec
1549 For input files in any language, generate corresponding Go
1550 declarations in @var{file}.  This generates Go @code{const},
1551 @code{type}, @code{var}, and @code{func} declarations which may be a
1552 useful way to start writing a Go interface to code written in some
1553 other language.
1555 @include @value{srcdir}/../libiberty/at-file.texi
1556 @end table
1558 @node Invoking G++
1559 @section Compiling C++ Programs
1561 @cindex suffixes for C++ source
1562 @cindex C++ source file suffixes
1563 C++ source files conventionally use one of the suffixes @samp{.C},
1564 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1565 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1566 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1567 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1568 files with these names and compiles them as C++ programs even if you
1569 call the compiler the same way as for compiling C programs (usually
1570 with the name @command{gcc}).
1572 @findex g++
1573 @findex c++
1574 However, the use of @command{gcc} does not add the C++ library.
1575 @command{g++} is a program that calls GCC and automatically specifies linking
1576 against the C++ library.  It treats @samp{.c},
1577 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1578 files unless @option{-x} is used.  This program is also useful when
1579 precompiling a C header file with a @samp{.h} extension for use in C++
1580 compilations.  On many systems, @command{g++} is also installed with
1581 the name @command{c++}.
1583 @cindex invoking @command{g++}
1584 When you compile C++ programs, you may specify many of the same
1585 command-line options that you use for compiling programs in any
1586 language; or command-line options meaningful for C and related
1587 languages; or options that are meaningful only for C++ programs.
1588 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1589 explanations of options for languages related to C@.
1590 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1591 explanations of options that are meaningful only for C++ programs.
1593 @node C Dialect Options
1594 @section Options Controlling C Dialect
1595 @cindex dialect options
1596 @cindex language dialect options
1597 @cindex options, dialect
1599 The following options control the dialect of C (or languages derived
1600 from C, such as C++, Objective-C and Objective-C++) that the compiler
1601 accepts:
1603 @table @gcctabopt
1604 @cindex ANSI support
1605 @cindex ISO support
1606 @item -ansi
1607 @opindex ansi
1608 In C mode, this is equivalent to @option{-std=c90}. In C++ mode, it is
1609 equivalent to @option{-std=c++98}.
1611 This turns off certain features of GCC that are incompatible with ISO
1612 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1613 such as the @code{asm} and @code{typeof} keywords, and
1614 predefined macros such as @code{unix} and @code{vax} that identify the
1615 type of system you are using.  It also enables the undesirable and
1616 rarely used ISO trigraph feature.  For the C compiler,
1617 it disables recognition of C++ style @samp{//} comments as well as
1618 the @code{inline} keyword.
1620 The alternate keywords @code{__asm__}, @code{__extension__},
1621 @code{__inline__} and @code{__typeof__} continue to work despite
1622 @option{-ansi}.  You would not want to use them in an ISO C program, of
1623 course, but it is useful to put them in header files that might be included
1624 in compilations done with @option{-ansi}.  Alternate predefined macros
1625 such as @code{__unix__} and @code{__vax__} are also available, with or
1626 without @option{-ansi}.
1628 The @option{-ansi} option does not cause non-ISO programs to be
1629 rejected gratuitously.  For that, @option{-Wpedantic} is required in
1630 addition to @option{-ansi}.  @xref{Warning Options}.
1632 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1633 option is used.  Some header files may notice this macro and refrain
1634 from declaring certain functions or defining certain macros that the
1635 ISO standard doesn't call for; this is to avoid interfering with any
1636 programs that might use these names for other things.
1638 Functions that are normally built in but do not have semantics
1639 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1640 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
1641 built-in functions provided by GCC}, for details of the functions
1642 affected.
1644 @item -std=
1645 @opindex std
1646 Determine the language standard. @xref{Standards,,Language Standards
1647 Supported by GCC}, for details of these standard versions.  This option
1648 is currently only supported when compiling C or C++.
1650 The compiler can accept several base standards, such as @samp{c90} or
1651 @samp{c++98}, and GNU dialects of those standards, such as
1652 @samp{gnu90} or @samp{gnu++98}.  When a base standard is specified, the
1653 compiler accepts all programs following that standard plus those
1654 using GNU extensions that do not contradict it.  For example,
1655 @option{-std=c90} turns off certain features of GCC that are
1656 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
1657 keywords, but not other GNU extensions that do not have a meaning in
1658 ISO C90, such as omitting the middle term of a @code{?:}
1659 expression. On the other hand, when a GNU dialect of a standard is
1660 specified, all features supported by the compiler are enabled, even when
1661 those features change the meaning of the base standard.  As a result, some
1662 strict-conforming programs may be rejected.  The particular standard
1663 is used by @option{-Wpedantic} to identify which features are GNU
1664 extensions given that version of the standard. For example
1665 @option{-std=gnu90 -Wpedantic} warns about C++ style @samp{//}
1666 comments, while @option{-std=gnu99 -Wpedantic} does not.
1668 A value for this option must be provided; possible values are
1670 @table @samp
1671 @item c90
1672 @itemx c89
1673 @itemx iso9899:1990
1674 Support all ISO C90 programs (certain GNU extensions that conflict
1675 with ISO C90 are disabled). Same as @option{-ansi} for C code.
1677 @item iso9899:199409
1678 ISO C90 as modified in amendment 1.
1680 @item c99
1681 @itemx c9x
1682 @itemx iso9899:1999
1683 @itemx iso9899:199x
1684 ISO C99.  This standard is substantially completely supported, modulo
1685 bugs, extended identifiers (supported except for corner cases when
1686 @option{-fextended-identifiers} is used) and floating-point issues
1687 (mainly but not entirely relating to optional C99 features from
1688 Annexes F and G).  See
1689 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1690 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1692 @item c11
1693 @itemx c1x
1694 @itemx iso9899:2011
1695 ISO C11, the 2011 revision of the ISO C standard.  This standard is
1696 substantially completely supported, modulo bugs, extended identifiers
1697 (supported except for corner cases when
1698 @option{-fextended-identifiers} is used), floating-point issues
1699 (mainly but not entirely relating to optional C11 features from
1700 Annexes F and G) and the optional Annexes K (Bounds-checking
1701 interfaces) and L (Analyzability).  The name @samp{c1x} is deprecated.
1703 @item gnu90
1704 @itemx gnu89
1705 GNU dialect of ISO C90 (including some C99 features). This
1706 is the default for C code.
1708 @item gnu99
1709 @itemx gnu9x
1710 GNU dialect of ISO C99.  The name @samp{gnu9x} is deprecated.
1712 @item gnu11
1713 @itemx gnu1x
1714 GNU dialect of ISO C11.  This is intended to become the default in a
1715 future release of GCC.  The name @samp{gnu1x} is deprecated.
1717 @item c++98
1718 @itemx c++03
1719 The 1998 ISO C++ standard plus the 2003 technical corrigendum and some
1720 additional defect reports. Same as @option{-ansi} for C++ code.
1722 @item gnu++98
1723 @itemx gnu++03
1724 GNU dialect of @option{-std=c++98}.  This is the default for
1725 C++ code.
1727 @item c++11
1728 @itemx c++0x
1729 The 2011 ISO C++ standard plus amendments.
1730 The name @samp{c++0x} is deprecated.
1732 @item gnu++11
1733 @itemx gnu++0x
1734 GNU dialect of @option{-std=c++11}.
1735 The name @samp{gnu++0x} is deprecated.
1737 @item c++1y
1738 The next revision of the ISO C++ standard, tentatively planned for
1739 2014.  Support is highly experimental, and will almost certainly
1740 change in incompatible ways in future releases.
1742 @item gnu++1y
1743 GNU dialect of @option{-std=c++1y}.  Support is highly experimental,
1744 and will almost certainly change in incompatible ways in future
1745 releases.
1746 @end table
1748 @item -fgnu89-inline
1749 @opindex fgnu89-inline
1750 The option @option{-fgnu89-inline} tells GCC to use the traditional
1751 GNU semantics for @code{inline} functions when in C99 mode.
1752 @xref{Inline,,An Inline Function is As Fast As a Macro}.  This option
1753 is accepted and ignored by GCC versions 4.1.3 up to but not including
1754 4.3.  In GCC versions 4.3 and later it changes the behavior of GCC in
1755 C99 mode.  Using this option is roughly equivalent to adding the
1756 @code{gnu_inline} function attribute to all inline functions
1757 (@pxref{Function Attributes}).
1759 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1760 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1761 specifies the default behavior).  This option was first supported in
1762 GCC 4.3.  This option is not supported in @option{-std=c90} or
1763 @option{-std=gnu90} mode.
1765 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1766 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1767 in effect for @code{inline} functions.  @xref{Common Predefined
1768 Macros,,,cpp,The C Preprocessor}.
1770 @item -aux-info @var{filename}
1771 @opindex aux-info
1772 Output to the given filename prototyped declarations for all functions
1773 declared and/or defined in a translation unit, including those in header
1774 files.  This option is silently ignored in any language other than C@.
1776 Besides declarations, the file indicates, in comments, the origin of
1777 each declaration (source file and line), whether the declaration was
1778 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1779 @samp{O} for old, respectively, in the first character after the line
1780 number and the colon), and whether it came from a declaration or a
1781 definition (@samp{C} or @samp{F}, respectively, in the following
1782 character).  In the case of function definitions, a K&R-style list of
1783 arguments followed by their declarations is also provided, inside
1784 comments, after the declaration.
1786 @item -fallow-parameterless-variadic-functions
1787 @opindex fallow-parameterless-variadic-functions
1788 Accept variadic functions without named parameters.
1790 Although it is possible to define such a function, this is not very
1791 useful as it is not possible to read the arguments.  This is only
1792 supported for C as this construct is allowed by C++.
1794 @item -fno-asm
1795 @opindex fno-asm
1796 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1797 keyword, so that code can use these words as identifiers.  You can use
1798 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1799 instead.  @option{-ansi} implies @option{-fno-asm}.
1801 In C++, this switch only affects the @code{typeof} keyword, since
1802 @code{asm} and @code{inline} are standard keywords.  You may want to
1803 use the @option{-fno-gnu-keywords} flag instead, which has the same
1804 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1805 switch only affects the @code{asm} and @code{typeof} keywords, since
1806 @code{inline} is a standard keyword in ISO C99.
1808 @item -fno-builtin
1809 @itemx -fno-builtin-@var{function}
1810 @opindex fno-builtin
1811 @cindex built-in functions
1812 Don't recognize built-in functions that do not begin with
1813 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1814 functions provided by GCC}, for details of the functions affected,
1815 including those which are not built-in functions when @option{-ansi} or
1816 @option{-std} options for strict ISO C conformance are used because they
1817 do not have an ISO standard meaning.
1819 GCC normally generates special code to handle certain built-in functions
1820 more efficiently; for instance, calls to @code{alloca} may become single
1821 instructions which adjust the stack directly, and calls to @code{memcpy}
1822 may become inline copy loops.  The resulting code is often both smaller
1823 and faster, but since the function calls no longer appear as such, you
1824 cannot set a breakpoint on those calls, nor can you change the behavior
1825 of the functions by linking with a different library.  In addition,
1826 when a function is recognized as a built-in function, GCC may use
1827 information about that function to warn about problems with calls to
1828 that function, or to generate more efficient code, even if the
1829 resulting code still contains calls to that function.  For example,
1830 warnings are given with @option{-Wformat} for bad calls to
1831 @code{printf} when @code{printf} is built in and @code{strlen} is
1832 known not to modify global memory.
1834 With the @option{-fno-builtin-@var{function}} option
1835 only the built-in function @var{function} is
1836 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1837 function is named that is not built-in in this version of GCC, this
1838 option is ignored.  There is no corresponding
1839 @option{-fbuiltin-@var{function}} option; if you wish to enable
1840 built-in functions selectively when using @option{-fno-builtin} or
1841 @option{-ffreestanding}, you may define macros such as:
1843 @smallexample
1844 #define abs(n)          __builtin_abs ((n))
1845 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1846 @end smallexample
1848 @item -fhosted
1849 @opindex fhosted
1850 @cindex hosted environment
1852 Assert that compilation targets a hosted environment.  This implies
1853 @option{-fbuiltin}.  A hosted environment is one in which the
1854 entire standard library is available, and in which @code{main} has a return
1855 type of @code{int}.  Examples are nearly everything except a kernel.
1856 This is equivalent to @option{-fno-freestanding}.
1858 @item -ffreestanding
1859 @opindex ffreestanding
1860 @cindex hosted environment
1862 Assert that compilation targets a freestanding environment.  This
1863 implies @option{-fno-builtin}.  A freestanding environment
1864 is one in which the standard library may not exist, and program startup may
1865 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1866 This is equivalent to @option{-fno-hosted}.
1868 @xref{Standards,,Language Standards Supported by GCC}, for details of
1869 freestanding and hosted environments.
1871 @item -fopenmp
1872 @opindex fopenmp
1873 @cindex OpenMP parallel
1874 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1875 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1876 compiler generates parallel code according to the OpenMP Application
1877 Program Interface v4.0 @w{@uref{http://www.openmp.org/}}.  This option
1878 implies @option{-pthread}, and thus is only supported on targets that
1879 have support for @option{-pthread}. @option{-fopenmp} implies
1880 @option{-fopenmp-simd}.
1882 @item -fopenmp-simd
1883 @opindex fopenmp-simd
1884 @cindex OpenMP SIMD
1885 @cindex SIMD
1886 Enable handling of OpenMP's SIMD directives with @code{#pragma omp}
1887 in C/C++ and @code{!$omp} in Fortran. Other OpenMP directives
1888 are ignored.
1890 @item -fcilkplus
1891 @opindex fcilkplus
1892 @cindex Enable Cilk Plus
1893 Enable the usage of Cilk Plus language extension features for C/C++.
1894 When the option @option{-fcilkplus} is specified, enable the usage of
1895 the Cilk Plus Language extension features for C/C++.  The present
1896 implementation follows ABI version 1.2.  This is an experimental
1897 feature that is only partially complete, and whose interface may
1898 change in future versions of GCC as the official specification
1899 changes.  Currently, all features but @code{_Cilk_for} have been
1900 implemented.
1902 @item -fgnu-tm
1903 @opindex fgnu-tm
1904 When the option @option{-fgnu-tm} is specified, the compiler
1905 generates code for the Linux variant of Intel's current Transactional
1906 Memory ABI specification document (Revision 1.1, May 6 2009).  This is
1907 an experimental feature whose interface may change in future versions
1908 of GCC, as the official specification changes.  Please note that not
1909 all architectures are supported for this feature.
1911 For more information on GCC's support for transactional memory,
1912 @xref{Enabling libitm,,The GNU Transactional Memory Library,libitm,GNU
1913 Transactional Memory Library}.
1915 Note that the transactional memory feature is not supported with
1916 non-call exceptions (@option{-fnon-call-exceptions}).
1918 @item -fms-extensions
1919 @opindex fms-extensions
1920 Accept some non-standard constructs used in Microsoft header files.
1922 In C++ code, this allows member names in structures to be similar
1923 to previous types declarations.
1925 @smallexample
1926 typedef int UOW;
1927 struct ABC @{
1928   UOW UOW;
1930 @end smallexample
1932 Some cases of unnamed fields in structures and unions are only
1933 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1934 fields within structs/unions}, for details.
1936 Note that this option is off for all targets but i?86 and x86_64
1937 targets using ms-abi.
1938 @item -fplan9-extensions
1939 Accept some non-standard constructs used in Plan 9 code.
1941 This enables @option{-fms-extensions}, permits passing pointers to
1942 structures with anonymous fields to functions that expect pointers to
1943 elements of the type of the field, and permits referring to anonymous
1944 fields declared using a typedef.  @xref{Unnamed Fields,,Unnamed
1945 struct/union fields within structs/unions}, for details.  This is only
1946 supported for C, not C++.
1948 @item -trigraphs
1949 @opindex trigraphs
1950 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1951 options for strict ISO C conformance) implies @option{-trigraphs}.
1953 @cindex traditional C language
1954 @cindex C language, traditional
1955 @item -traditional
1956 @itemx -traditional-cpp
1957 @opindex traditional-cpp
1958 @opindex traditional
1959 Formerly, these options caused GCC to attempt to emulate a pre-standard
1960 C compiler.  They are now only supported with the @option{-E} switch.
1961 The preprocessor continues to support a pre-standard mode.  See the GNU
1962 CPP manual for details.
1964 @item -fcond-mismatch
1965 @opindex fcond-mismatch
1966 Allow conditional expressions with mismatched types in the second and
1967 third arguments.  The value of such an expression is void.  This option
1968 is not supported for C++.
1970 @item -flax-vector-conversions
1971 @opindex flax-vector-conversions
1972 Allow implicit conversions between vectors with differing numbers of
1973 elements and/or incompatible element types.  This option should not be
1974 used for new code.
1976 @item -funsigned-char
1977 @opindex funsigned-char
1978 Let the type @code{char} be unsigned, like @code{unsigned char}.
1980 Each kind of machine has a default for what @code{char} should
1981 be.  It is either like @code{unsigned char} by default or like
1982 @code{signed char} by default.
1984 Ideally, a portable program should always use @code{signed char} or
1985 @code{unsigned char} when it depends on the signedness of an object.
1986 But many programs have been written to use plain @code{char} and
1987 expect it to be signed, or expect it to be unsigned, depending on the
1988 machines they were written for.  This option, and its inverse, let you
1989 make such a program work with the opposite default.
1991 The type @code{char} is always a distinct type from each of
1992 @code{signed char} or @code{unsigned char}, even though its behavior
1993 is always just like one of those two.
1995 @item -fsigned-char
1996 @opindex fsigned-char
1997 Let the type @code{char} be signed, like @code{signed char}.
1999 Note that this is equivalent to @option{-fno-unsigned-char}, which is
2000 the negative form of @option{-funsigned-char}.  Likewise, the option
2001 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
2003 @item -fsigned-bitfields
2004 @itemx -funsigned-bitfields
2005 @itemx -fno-signed-bitfields
2006 @itemx -fno-unsigned-bitfields
2007 @opindex fsigned-bitfields
2008 @opindex funsigned-bitfields
2009 @opindex fno-signed-bitfields
2010 @opindex fno-unsigned-bitfields
2011 These options control whether a bit-field is signed or unsigned, when the
2012 declaration does not use either @code{signed} or @code{unsigned}.  By
2013 default, such a bit-field is signed, because this is consistent: the
2014 basic integer types such as @code{int} are signed types.
2015 @end table
2017 @node C++ Dialect Options
2018 @section Options Controlling C++ Dialect
2020 @cindex compiler options, C++
2021 @cindex C++ options, command-line
2022 @cindex options, C++
2023 This section describes the command-line options that are only meaningful
2024 for C++ programs.  You can also use most of the GNU compiler options
2025 regardless of what language your program is in.  For example, you
2026 might compile a file @code{firstClass.C} like this:
2028 @smallexample
2029 g++ -g -frepo -O -c firstClass.C
2030 @end smallexample
2032 @noindent
2033 In this example, only @option{-frepo} is an option meant
2034 only for C++ programs; you can use the other options with any
2035 language supported by GCC@.
2037 Here is a list of options that are @emph{only} for compiling C++ programs:
2039 @table @gcctabopt
2041 @item -fabi-version=@var{n}
2042 @opindex fabi-version
2043 Use version @var{n} of the C++ ABI@.  The default is version 2.
2045 Version 0 refers to the version conforming most closely to
2046 the C++ ABI specification.  Therefore, the ABI obtained using version 0
2047 will change in different versions of G++ as ABI bugs are fixed.
2049 Version 1 is the version of the C++ ABI that first appeared in G++ 3.2.  
2051 Version 2 is the version of the C++ ABI that first appeared in G++ 3.4.  
2053 Version 3 corrects an error in mangling a constant address as a
2054 template argument.
2056 Version 4, which first appeared in G++ 4.5, implements a standard
2057 mangling for vector types.
2059 Version 5, which first appeared in G++ 4.6, corrects the mangling of
2060 attribute const/volatile on function pointer types, decltype of a
2061 plain decl, and use of a function parameter in the declaration of
2062 another parameter.
2064 Version 6, which first appeared in G++ 4.7, corrects the promotion
2065 behavior of C++11 scoped enums and the mangling of template argument
2066 packs, const/static_cast, prefix ++ and --, and a class scope function
2067 used as a template argument.
2069 See also @option{-Wabi}.
2071 @item -fno-access-control
2072 @opindex fno-access-control
2073 Turn off all access checking.  This switch is mainly useful for working
2074 around bugs in the access control code.
2076 @item -fcheck-new
2077 @opindex fcheck-new
2078 Check that the pointer returned by @code{operator new} is non-null
2079 before attempting to modify the storage allocated.  This check is
2080 normally unnecessary because the C++ standard specifies that
2081 @code{operator new} only returns @code{0} if it is declared
2082 @samp{throw()}, in which case the compiler always checks the
2083 return value even without this option.  In all other cases, when
2084 @code{operator new} has a non-empty exception specification, memory
2085 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
2086 @samp{new (nothrow)}.
2088 @item -fconstexpr-depth=@var{n}
2089 @opindex fconstexpr-depth
2090 Set the maximum nested evaluation depth for C++11 constexpr functions
2091 to @var{n}.  A limit is needed to detect endless recursion during
2092 constant expression evaluation.  The minimum specified by the standard
2093 is 512.
2095 @item -fdeduce-init-list
2096 @opindex fdeduce-init-list
2097 Enable deduction of a template type parameter as
2098 @code{std::initializer_list} from a brace-enclosed initializer list, i.e.@:
2100 @smallexample
2101 template <class T> auto forward(T t) -> decltype (realfn (t))
2103   return realfn (t);
2106 void f()
2108   forward(@{1,2@}); // call forward<std::initializer_list<int>>
2110 @end smallexample
2112 This deduction was implemented as a possible extension to the
2113 originally proposed semantics for the C++11 standard, but was not part
2114 of the final standard, so it is disabled by default.  This option is
2115 deprecated, and may be removed in a future version of G++.
2117 @item -ffriend-injection
2118 @opindex ffriend-injection
2119 Inject friend functions into the enclosing namespace, so that they are
2120 visible outside the scope of the class in which they are declared.
2121 Friend functions were documented to work this way in the old Annotated
2122 C++ Reference Manual, and versions of G++ before 4.1 always worked
2123 that way.  However, in ISO C++ a friend function that is not declared
2124 in an enclosing scope can only be found using argument dependent
2125 lookup.  This option causes friends to be injected as they were in
2126 earlier releases.
2128 This option is for compatibility, and may be removed in a future
2129 release of G++.
2131 @item -fno-elide-constructors
2132 @opindex fno-elide-constructors
2133 The C++ standard allows an implementation to omit creating a temporary
2134 that is only used to initialize another object of the same type.
2135 Specifying this option disables that optimization, and forces G++ to
2136 call the copy constructor in all cases.
2138 @item -fno-enforce-eh-specs
2139 @opindex fno-enforce-eh-specs
2140 Don't generate code to check for violation of exception specifications
2141 at run time.  This option violates the C++ standard, but may be useful
2142 for reducing code size in production builds, much like defining
2143 @samp{NDEBUG}.  This does not give user code permission to throw
2144 exceptions in violation of the exception specifications; the compiler
2145 still optimizes based on the specifications, so throwing an
2146 unexpected exception results in undefined behavior at run time.
2148 @item -fextern-tls-init
2149 @itemx -fno-extern-tls-init
2150 @opindex fextern-tls-init
2151 @opindex fno-extern-tls-init
2152 The C++11 and OpenMP standards allow @samp{thread_local} and
2153 @samp{threadprivate} variables to have dynamic (runtime)
2154 initialization.  To support this, any use of such a variable goes
2155 through a wrapper function that performs any necessary initialization.
2156 When the use and definition of the variable are in the same
2157 translation unit, this overhead can be optimized away, but when the
2158 use is in a different translation unit there is significant overhead
2159 even if the variable doesn't actually need dynamic initialization.  If
2160 the programmer can be sure that no use of the variable in a
2161 non-defining TU needs to trigger dynamic initialization (either
2162 because the variable is statically initialized, or a use of the
2163 variable in the defining TU will be executed before any uses in
2164 another TU), they can avoid this overhead with the
2165 @option{-fno-extern-tls-init} option.
2167 On targets that support symbol aliases, the default is
2168 @option{-fextern-tls-init}.  On targets that do not support symbol
2169 aliases, the default is @option{-fno-extern-tls-init}.
2171 @item -ffor-scope
2172 @itemx -fno-for-scope
2173 @opindex ffor-scope
2174 @opindex fno-for-scope
2175 If @option{-ffor-scope} is specified, the scope of variables declared in
2176 a @i{for-init-statement} is limited to the @samp{for} loop itself,
2177 as specified by the C++ standard.
2178 If @option{-fno-for-scope} is specified, the scope of variables declared in
2179 a @i{for-init-statement} extends to the end of the enclosing scope,
2180 as was the case in old versions of G++, and other (traditional)
2181 implementations of C++.
2183 If neither flag is given, the default is to follow the standard,
2184 but to allow and give a warning for old-style code that would
2185 otherwise be invalid, or have different behavior.
2187 @item -fno-gnu-keywords
2188 @opindex fno-gnu-keywords
2189 Do not recognize @code{typeof} as a keyword, so that code can use this
2190 word as an identifier.  You can use the keyword @code{__typeof__} instead.
2191 @option{-ansi} implies @option{-fno-gnu-keywords}.
2193 @item -fno-implicit-templates
2194 @opindex fno-implicit-templates
2195 Never emit code for non-inline templates that are instantiated
2196 implicitly (i.e.@: by use); only emit code for explicit instantiations.
2197 @xref{Template Instantiation}, for more information.
2199 @item -fno-implicit-inline-templates
2200 @opindex fno-implicit-inline-templates
2201 Don't emit code for implicit instantiations of inline templates, either.
2202 The default is to handle inlines differently so that compiles with and
2203 without optimization need the same set of explicit instantiations.
2205 @item -fno-implement-inlines
2206 @opindex fno-implement-inlines
2207 To save space, do not emit out-of-line copies of inline functions
2208 controlled by @samp{#pragma implementation}.  This causes linker
2209 errors if these functions are not inlined everywhere they are called.
2211 @item -fms-extensions
2212 @opindex fms-extensions
2213 Disable Wpedantic warnings about constructs used in MFC, such as implicit
2214 int and getting a pointer to member function via non-standard syntax.
2216 @item -fno-nonansi-builtins
2217 @opindex fno-nonansi-builtins
2218 Disable built-in declarations of functions that are not mandated by
2219 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
2220 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
2222 @item -fnothrow-opt
2223 @opindex fnothrow-opt
2224 Treat a @code{throw()} exception specification as if it were a
2225 @code{noexcept} specification to reduce or eliminate the text size
2226 overhead relative to a function with no exception specification.  If
2227 the function has local variables of types with non-trivial
2228 destructors, the exception specification actually makes the
2229 function smaller because the EH cleanups for those variables can be
2230 optimized away.  The semantic effect is that an exception thrown out of
2231 a function with such an exception specification results in a call
2232 to @code{terminate} rather than @code{unexpected}.
2234 @item -fno-operator-names
2235 @opindex fno-operator-names
2236 Do not treat the operator name keywords @code{and}, @code{bitand},
2237 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
2238 synonyms as keywords.
2240 @item -fno-optional-diags
2241 @opindex fno-optional-diags
2242 Disable diagnostics that the standard says a compiler does not need to
2243 issue.  Currently, the only such diagnostic issued by G++ is the one for
2244 a name having multiple meanings within a class.
2246 @item -fpermissive
2247 @opindex fpermissive
2248 Downgrade some diagnostics about nonconformant code from errors to
2249 warnings.  Thus, using @option{-fpermissive} allows some
2250 nonconforming code to compile.
2252 @item -fno-pretty-templates
2253 @opindex fno-pretty-templates
2254 When an error message refers to a specialization of a function
2255 template, the compiler normally prints the signature of the
2256 template followed by the template arguments and any typedefs or
2257 typenames in the signature (e.g. @code{void f(T) [with T = int]}
2258 rather than @code{void f(int)}) so that it's clear which template is
2259 involved.  When an error message refers to a specialization of a class
2260 template, the compiler omits any template arguments that match
2261 the default template arguments for that template.  If either of these
2262 behaviors make it harder to understand the error message rather than
2263 easier, you can use @option{-fno-pretty-templates} to disable them.
2265 @item -frepo
2266 @opindex frepo
2267 Enable automatic template instantiation at link time.  This option also
2268 implies @option{-fno-implicit-templates}.  @xref{Template
2269 Instantiation}, for more information.
2271 @item -fno-rtti
2272 @opindex fno-rtti
2273 Disable generation of information about every class with virtual
2274 functions for use by the C++ run-time type identification features
2275 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
2276 of the language, you can save some space by using this flag.  Note that
2277 exception handling uses the same information, but G++ generates it as
2278 needed. The @samp{dynamic_cast} operator can still be used for casts that
2279 do not require run-time type information, i.e.@: casts to @code{void *} or to
2280 unambiguous base classes.
2282 @item -fstats
2283 @opindex fstats
2284 Emit statistics about front-end processing at the end of the compilation.
2285 This information is generally only useful to the G++ development team.
2287 @item -fstrict-enums
2288 @opindex fstrict-enums
2289 Allow the compiler to optimize using the assumption that a value of
2290 enumerated type can only be one of the values of the enumeration (as
2291 defined in the C++ standard; basically, a value that can be
2292 represented in the minimum number of bits needed to represent all the
2293 enumerators).  This assumption may not be valid if the program uses a
2294 cast to convert an arbitrary integer value to the enumerated type.
2296 @item -ftemplate-backtrace-limit=@var{n}
2297 @opindex ftemplate-backtrace-limit
2298 Set the maximum number of template instantiation notes for a single
2299 warning or error to @var{n}.  The default value is 10.
2301 @item -ftemplate-depth=@var{n}
2302 @opindex ftemplate-depth
2303 Set the maximum instantiation depth for template classes to @var{n}.
2304 A limit on the template instantiation depth is needed to detect
2305 endless recursions during template class instantiation.  ANSI/ISO C++
2306 conforming programs must not rely on a maximum depth greater than 17
2307 (changed to 1024 in C++11).  The default value is 900, as the compiler
2308 can run out of stack space before hitting 1024 in some situations.
2310 @item -fno-threadsafe-statics
2311 @opindex fno-threadsafe-statics
2312 Do not emit the extra code to use the routines specified in the C++
2313 ABI for thread-safe initialization of local statics.  You can use this
2314 option to reduce code size slightly in code that doesn't need to be
2315 thread-safe.
2317 @item -fuse-cxa-atexit
2318 @opindex fuse-cxa-atexit
2319 Register destructors for objects with static storage duration with the
2320 @code{__cxa_atexit} function rather than the @code{atexit} function.
2321 This option is required for fully standards-compliant handling of static
2322 destructors, but only works if your C library supports
2323 @code{__cxa_atexit}.
2325 @item -fno-use-cxa-get-exception-ptr
2326 @opindex fno-use-cxa-get-exception-ptr
2327 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
2328 causes @code{std::uncaught_exception} to be incorrect, but is necessary
2329 if the runtime routine is not available.
2331 @item -fvisibility-inlines-hidden
2332 @opindex fvisibility-inlines-hidden
2333 This switch declares that the user does not attempt to compare
2334 pointers to inline functions or methods where the addresses of the two functions
2335 are taken in different shared objects.
2337 The effect of this is that GCC may, effectively, mark inline methods with
2338 @code{__attribute__ ((visibility ("hidden")))} so that they do not
2339 appear in the export table of a DSO and do not require a PLT indirection
2340 when used within the DSO@.  Enabling this option can have a dramatic effect
2341 on load and link times of a DSO as it massively reduces the size of the
2342 dynamic export table when the library makes heavy use of templates.
2344 The behavior of this switch is not quite the same as marking the
2345 methods as hidden directly, because it does not affect static variables
2346 local to the function or cause the compiler to deduce that
2347 the function is defined in only one shared object.
2349 You may mark a method as having a visibility explicitly to negate the
2350 effect of the switch for that method.  For example, if you do want to
2351 compare pointers to a particular inline method, you might mark it as
2352 having default visibility.  Marking the enclosing class with explicit
2353 visibility has no effect.
2355 Explicitly instantiated inline methods are unaffected by this option
2356 as their linkage might otherwise cross a shared library boundary.
2357 @xref{Template Instantiation}.
2359 @item -fvisibility-ms-compat
2360 @opindex fvisibility-ms-compat
2361 This flag attempts to use visibility settings to make GCC's C++
2362 linkage model compatible with that of Microsoft Visual Studio.
2364 The flag makes these changes to GCC's linkage model:
2366 @enumerate
2367 @item
2368 It sets the default visibility to @code{hidden}, like
2369 @option{-fvisibility=hidden}.
2371 @item
2372 Types, but not their members, are not hidden by default.
2374 @item
2375 The One Definition Rule is relaxed for types without explicit
2376 visibility specifications that are defined in more than one
2377 shared object: those declarations are permitted if they are
2378 permitted when this option is not used.
2379 @end enumerate
2381 In new code it is better to use @option{-fvisibility=hidden} and
2382 export those classes that are intended to be externally visible.
2383 Unfortunately it is possible for code to rely, perhaps accidentally,
2384 on the Visual Studio behavior.
2386 Among the consequences of these changes are that static data members
2387 of the same type with the same name but defined in different shared
2388 objects are different, so changing one does not change the other;
2389 and that pointers to function members defined in different shared
2390 objects may not compare equal.  When this flag is given, it is a
2391 violation of the ODR to define types with the same name differently.
2393 @item -fvtable-verify=@var{std|preinit|none}
2394 @opindex fvtable-verify
2395 Turn on (or off, if using @option{-fvtable-verify=none}) the security
2396 feature that verifies at runtime, for every virtual call that is made, that
2397 the vtable pointer through which the call is made is valid for the type of
2398 the object, and has not been corrupted or overwritten.  If an invalid vtable
2399 pointer is detected (at runtime), an error is reported and execution of the
2400 program is immediately halted.
2402 This option causes runtime data structures to be built, at program start up,
2403 for verifying the vtable pointers.  The options @code{std} and @code{preinit}
2404 control the timing of when these data structures are built.  In both cases the
2405 data structures are built before execution reaches 'main'.  The
2406 @option{-fvtable-verify=std} causes these data structure to be built after the
2407 shared libraries have been loaded and initialized.
2408 @option{-fvtable-verify=preinit} causes them to be built before the shared
2409 libraries have been loaded and initialized.
2411 If this option appears multiple times in the compiler line, with different
2412 values specified, 'none' will take highest priority over both 'std' and
2413 'preinit'; 'preinit' will take priority over 'std'.
2415 @item -fvtv-debug
2416 @opindex (fvtv-debug)
2417 Causes debug versions of the runtime functions for the vtable verification 
2418 feature to be called.  This assumes the @option{-fvtable-verify=std} or
2419 @option{-fvtable-verify=preinit} has been used.  This flag will also cause the
2420 compiler to keep track of which vtable pointers it found for each class, and
2421 record that information in the file ``vtv_set_ptr_data.log'', in the dump
2422 file directory on the user's machine.
2424 Note:  This feature APPENDS data to the log file. If you want a fresh log
2425 file, be sure to delete any existing one.
2427 @item -fvtv-counts
2428 @opindex fvtv-counts
2429 This is a debugging flag.  When used in conjunction with
2430 @option{-fvtable-verify=std} or @option{-fvtable-verify=preinit}, this
2431 causes the compiler to keep track of the total number of virtual calls
2432 it encountered and the number of verifications it inserted.  It also
2433 counts the number of calls to certain runtime library functions
2434 that it inserts.  This information, for each compilation unit, is written
2435 to a file named ``vtv_count_data.log'', in the dump_file directory on
2436 the user's machine.   It also counts the size of the vtable pointer sets
2437 for each class, and writes this information to ``vtv_class_set_sizes.log''
2438 in the same directory.
2440 Note:  This feature APPENDS data to the log files.  To get a fresh log
2441 files, be sure to delete any existing ones.
2443 @item -fno-weak
2444 @opindex fno-weak
2445 Do not use weak symbol support, even if it is provided by the linker.
2446 By default, G++ uses weak symbols if they are available.  This
2447 option exists only for testing, and should not be used by end-users;
2448 it results in inferior code and has no benefits.  This option may
2449 be removed in a future release of G++.
2451 @item -nostdinc++
2452 @opindex nostdinc++
2453 Do not search for header files in the standard directories specific to
2454 C++, but do still search the other standard directories.  (This option
2455 is used when building the C++ library.)
2456 @end table
2458 In addition, these optimization, warning, and code generation options
2459 have meanings only for C++ programs:
2461 @table @gcctabopt
2462 @item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)}
2463 @opindex Wabi
2464 @opindex Wno-abi
2465 Warn when G++ generates code that is probably not compatible with the
2466 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
2467 all such cases, there are probably some cases that are not warned about,
2468 even though G++ is generating incompatible code.  There may also be
2469 cases where warnings are emitted even though the code that is generated
2470 is compatible.
2472 You should rewrite your code to avoid these warnings if you are
2473 concerned about the fact that code generated by G++ may not be binary
2474 compatible with code generated by other compilers.
2476 The known incompatibilities in @option{-fabi-version=2} (the default) include:
2478 @itemize @bullet
2480 @item
2481 A template with a non-type template parameter of reference type is
2482 mangled incorrectly:
2483 @smallexample
2484 extern int N;
2485 template <int &> struct S @{@};
2486 void n (S<N>) @{2@}
2487 @end smallexample
2489 This is fixed in @option{-fabi-version=3}.
2491 @item
2492 SIMD vector types declared using @code{__attribute ((vector_size))} are
2493 mangled in a non-standard way that does not allow for overloading of
2494 functions taking vectors of different sizes.
2496 The mangling is changed in @option{-fabi-version=4}.
2497 @end itemize
2499 The known incompatibilities in @option{-fabi-version=1} include:
2501 @itemize @bullet
2503 @item
2504 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
2505 pack data into the same byte as a base class.  For example:
2507 @smallexample
2508 struct A @{ virtual void f(); int f1 : 1; @};
2509 struct B : public A @{ int f2 : 1; @};
2510 @end smallexample
2512 @noindent
2513 In this case, G++ places @code{B::f2} into the same byte
2514 as @code{A::f1}; other compilers do not.  You can avoid this problem
2515 by explicitly padding @code{A} so that its size is a multiple of the
2516 byte size on your platform; that causes G++ and other compilers to
2517 lay out @code{B} identically.
2519 @item
2520 Incorrect handling of tail-padding for virtual bases.  G++ does not use
2521 tail padding when laying out virtual bases.  For example:
2523 @smallexample
2524 struct A @{ virtual void f(); char c1; @};
2525 struct B @{ B(); char c2; @};
2526 struct C : public A, public virtual B @{@};
2527 @end smallexample
2529 @noindent
2530 In this case, G++ does not place @code{B} into the tail-padding for
2531 @code{A}; other compilers do.  You can avoid this problem by
2532 explicitly padding @code{A} so that its size is a multiple of its
2533 alignment (ignoring virtual base classes); that causes G++ and other
2534 compilers to lay out @code{C} identically.
2536 @item
2537 Incorrect handling of bit-fields with declared widths greater than that
2538 of their underlying types, when the bit-fields appear in a union.  For
2539 example:
2541 @smallexample
2542 union U @{ int i : 4096; @};
2543 @end smallexample
2545 @noindent
2546 Assuming that an @code{int} does not have 4096 bits, G++ makes the
2547 union too small by the number of bits in an @code{int}.
2549 @item
2550 Empty classes can be placed at incorrect offsets.  For example:
2552 @smallexample
2553 struct A @{@};
2555 struct B @{
2556   A a;
2557   virtual void f ();
2560 struct C : public B, public A @{@};
2561 @end smallexample
2563 @noindent
2564 G++ places the @code{A} base class of @code{C} at a nonzero offset;
2565 it should be placed at offset zero.  G++ mistakenly believes that the
2566 @code{A} data member of @code{B} is already at offset zero.
2568 @item
2569 Names of template functions whose types involve @code{typename} or
2570 template template parameters can be mangled incorrectly.
2572 @smallexample
2573 template <typename Q>
2574 void f(typename Q::X) @{@}
2576 template <template <typename> class Q>
2577 void f(typename Q<int>::X) @{@}
2578 @end smallexample
2580 @noindent
2581 Instantiations of these templates may be mangled incorrectly.
2583 @end itemize
2585 It also warns about psABI-related changes.  The known psABI changes at this
2586 point include:
2588 @itemize @bullet
2590 @item
2591 For SysV/x86-64, unions with @code{long double} members are 
2592 passed in memory as specified in psABI.  For example:
2594 @smallexample
2595 union U @{
2596   long double ld;
2597   int i;
2599 @end smallexample
2601 @noindent
2602 @code{union U} is always passed in memory.
2604 @end itemize
2606 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
2607 @opindex Wctor-dtor-privacy
2608 @opindex Wno-ctor-dtor-privacy
2609 Warn when a class seems unusable because all the constructors or
2610 destructors in that class are private, and it has neither friends nor
2611 public static member functions.  Also warn if there are no non-private
2612 methods, and there's at least one private member function that isn't
2613 a constructor or destructor.
2615 @item -Wdelete-non-virtual-dtor @r{(C++ and Objective-C++ only)}
2616 @opindex Wdelete-non-virtual-dtor
2617 @opindex Wno-delete-non-virtual-dtor
2618 Warn when @samp{delete} is used to destroy an instance of a class that
2619 has virtual functions and non-virtual destructor. It is unsafe to delete
2620 an instance of a derived class through a pointer to a base class if the
2621 base class does not have a virtual destructor.  This warning is enabled
2622 by @option{-Wall}.
2624 @item -Wliteral-suffix @r{(C++ and Objective-C++ only)}
2625 @opindex Wliteral-suffix
2626 @opindex Wno-literal-suffix
2627 Warn when a string or character literal is followed by a ud-suffix which does
2628 not begin with an underscore.  As a conforming extension, GCC treats such
2629 suffixes as separate preprocessing tokens in order to maintain backwards
2630 compatibility with code that uses formatting macros from @code{<inttypes.h>}.
2631 For example:
2633 @smallexample
2634 #define __STDC_FORMAT_MACROS
2635 #include <inttypes.h>
2636 #include <stdio.h>
2638 int main() @{
2639   int64_t i64 = 123;
2640   printf("My int64: %"PRId64"\n", i64);
2642 @end smallexample
2644 In this case, @code{PRId64} is treated as a separate preprocessing token.
2646 This warning is enabled by default.
2648 @item -Wnarrowing @r{(C++ and Objective-C++ only)}
2649 @opindex Wnarrowing
2650 @opindex Wno-narrowing
2651 Warn when a narrowing conversion prohibited by C++11 occurs within
2652 @samp{@{ @}}, e.g.
2654 @smallexample
2655 int i = @{ 2.2 @}; // error: narrowing from double to int
2656 @end smallexample
2658 This flag is included in @option{-Wall} and @option{-Wc++11-compat}.
2660 With @option{-std=c++11}, @option{-Wno-narrowing} suppresses the diagnostic
2661 required by the standard.  Note that this does not affect the meaning
2662 of well-formed code; narrowing conversions are still considered
2663 ill-formed in SFINAE context.
2665 @item -Wnoexcept @r{(C++ and Objective-C++ only)}
2666 @opindex Wnoexcept
2667 @opindex Wno-noexcept
2668 Warn when a noexcept-expression evaluates to false because of a call
2669 to a function that does not have a non-throwing exception
2670 specification (i.e. @samp{throw()} or @samp{noexcept}) but is known by
2671 the compiler to never throw an exception.
2673 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
2674 @opindex Wnon-virtual-dtor
2675 @opindex Wno-non-virtual-dtor
2676 Warn when a class has virtual functions and an accessible non-virtual
2677 destructor itself or in an accessible polymorphic base class, in which
2678 case it is possible but unsafe to delete an instance of a derived
2679 class through a pointer to the class itself or base class.  This
2680 warning is automatically enabled if @option{-Weffc++} is specified.
2682 @item -Wreorder @r{(C++ and Objective-C++ only)}
2683 @opindex Wreorder
2684 @opindex Wno-reorder
2685 @cindex reordering, warning
2686 @cindex warning for reordering of member initializers
2687 Warn when the order of member initializers given in the code does not
2688 match the order in which they must be executed.  For instance:
2690 @smallexample
2691 struct A @{
2692   int i;
2693   int j;
2694   A(): j (0), i (1) @{ @}
2696 @end smallexample
2698 @noindent
2699 The compiler rearranges the member initializers for @samp{i}
2700 and @samp{j} to match the declaration order of the members, emitting
2701 a warning to that effect.  This warning is enabled by @option{-Wall}.
2703 @item -fext-numeric-literals @r{(C++ and Objective-C++ only)}
2704 @opindex fext-numeric-literals
2705 @opindex fno-ext-numeric-literals
2706 Accept imaginary, fixed-point, or machine-defined
2707 literal number suffixes as GNU extensions.
2708 When this option is turned off these suffixes are treated
2709 as C++11 user-defined literal numeric suffixes.
2710 This is on by default for all pre-C++11 dialects and all GNU dialects:
2711 @option{-std=c++98}, @option{-std=gnu++98}, @option{-std=gnu++11},
2712 @option{-std=gnu++1y}.
2713 This option is off by default
2714 for ISO C++11 onwards (@option{-std=c++11}, ...).
2715 @end table
2717 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
2719 @table @gcctabopt
2720 @item -Weffc++ @r{(C++ and Objective-C++ only)}
2721 @opindex Weffc++
2722 @opindex Wno-effc++
2723 Warn about violations of the following style guidelines from Scott Meyers'
2724 @cite{Effective C++} series of books:
2726 @itemize @bullet
2727 @item
2728 Define a copy constructor and an assignment operator for classes
2729 with dynamically-allocated memory.
2731 @item
2732 Prefer initialization to assignment in constructors.
2734 @item
2735 Have @code{operator=} return a reference to @code{*this}.
2737 @item
2738 Don't try to return a reference when you must return an object.
2740 @item
2741 Distinguish between prefix and postfix forms of increment and
2742 decrement operators.
2744 @item
2745 Never overload @code{&&}, @code{||}, or @code{,}.
2747 @end itemize
2749 This option also enables @option{-Wnon-virtual-dtor}, which is also
2750 one of the effective C++ recommendations.  However, the check is
2751 extended to warn about the lack of virtual destructor in accessible
2752 non-polymorphic bases classes too.
2754 When selecting this option, be aware that the standard library
2755 headers do not obey all of these guidelines; use @samp{grep -v}
2756 to filter out those warnings.
2758 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
2759 @opindex Wstrict-null-sentinel
2760 @opindex Wno-strict-null-sentinel
2761 Warn about the use of an uncasted @code{NULL} as sentinel.  When
2762 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2763 to @code{__null}.  Although it is a null pointer constant rather than a
2764 null pointer, it is guaranteed to be of the same size as a pointer.
2765 But this use is not portable across different compilers.
2767 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
2768 @opindex Wno-non-template-friend
2769 @opindex Wnon-template-friend
2770 Disable warnings when non-templatized friend functions are declared
2771 within a template.  Since the advent of explicit template specification
2772 support in G++, if the name of the friend is an unqualified-id (i.e.,
2773 @samp{friend foo(int)}), the C++ language specification demands that the
2774 friend declare or define an ordinary, nontemplate function.  (Section
2775 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2776 could be interpreted as a particular specialization of a templatized
2777 function.  Because this non-conforming behavior is no longer the default
2778 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2779 check existing code for potential trouble spots and is on by default.
2780 This new compiler behavior can be turned off with
2781 @option{-Wno-non-template-friend}, which keeps the conformant compiler code
2782 but disables the helpful warning.
2784 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
2785 @opindex Wold-style-cast
2786 @opindex Wno-old-style-cast
2787 Warn if an old-style (C-style) cast to a non-void type is used within
2788 a C++ program.  The new-style casts (@samp{dynamic_cast},
2789 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
2790 less vulnerable to unintended effects and much easier to search for.
2792 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
2793 @opindex Woverloaded-virtual
2794 @opindex Wno-overloaded-virtual
2795 @cindex overloaded virtual function, warning
2796 @cindex warning for overloaded virtual function
2797 Warn when a function declaration hides virtual functions from a
2798 base class.  For example, in:
2800 @smallexample
2801 struct A @{
2802   virtual void f();
2805 struct B: public A @{
2806   void f(int);
2808 @end smallexample
2810 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2811 like:
2813 @smallexample
2814 B* b;
2815 b->f();
2816 @end smallexample
2818 @noindent
2819 fails to compile.
2821 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
2822 @opindex Wno-pmf-conversions
2823 @opindex Wpmf-conversions
2824 Disable the diagnostic for converting a bound pointer to member function
2825 to a plain pointer.
2827 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
2828 @opindex Wsign-promo
2829 @opindex Wno-sign-promo
2830 Warn when overload resolution chooses a promotion from unsigned or
2831 enumerated type to a signed type, over a conversion to an unsigned type of
2832 the same size.  Previous versions of G++ tried to preserve
2833 unsignedness, but the standard mandates the current behavior.
2834 @end table
2836 @node Objective-C and Objective-C++ Dialect Options
2837 @section Options Controlling Objective-C and Objective-C++ Dialects
2839 @cindex compiler options, Objective-C and Objective-C++
2840 @cindex Objective-C and Objective-C++ options, command-line
2841 @cindex options, Objective-C and Objective-C++
2842 (NOTE: This manual does not describe the Objective-C and Objective-C++
2843 languages themselves.  @xref{Standards,,Language Standards
2844 Supported by GCC}, for references.)
2846 This section describes the command-line options that are only meaningful
2847 for Objective-C and Objective-C++ programs.  You can also use most of
2848 the language-independent GNU compiler options.
2849 For example, you might compile a file @code{some_class.m} like this:
2851 @smallexample
2852 gcc -g -fgnu-runtime -O -c some_class.m
2853 @end smallexample
2855 @noindent
2856 In this example, @option{-fgnu-runtime} is an option meant only for
2857 Objective-C and Objective-C++ programs; you can use the other options with
2858 any language supported by GCC@.
2860 Note that since Objective-C is an extension of the C language, Objective-C
2861 compilations may also use options specific to the C front-end (e.g.,
2862 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2863 C++-specific options (e.g., @option{-Wabi}).
2865 Here is a list of options that are @emph{only} for compiling Objective-C
2866 and Objective-C++ programs:
2868 @table @gcctabopt
2869 @item -fconstant-string-class=@var{class-name}
2870 @opindex fconstant-string-class
2871 Use @var{class-name} as the name of the class to instantiate for each
2872 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2873 class name is @code{NXConstantString} if the GNU runtime is being used, and
2874 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2875 @option{-fconstant-cfstrings} option, if also present, overrides the
2876 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2877 to be laid out as constant CoreFoundation strings.
2879 @item -fgnu-runtime
2880 @opindex fgnu-runtime
2881 Generate object code compatible with the standard GNU Objective-C
2882 runtime.  This is the default for most types of systems.
2884 @item -fnext-runtime
2885 @opindex fnext-runtime
2886 Generate output compatible with the NeXT runtime.  This is the default
2887 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2888 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2889 used.
2891 @item -fno-nil-receivers
2892 @opindex fno-nil-receivers
2893 Assume that all Objective-C message dispatches (@code{[receiver
2894 message:arg]}) in this translation unit ensure that the receiver is
2895 not @code{nil}.  This allows for more efficient entry points in the
2896 runtime to be used.  This option is only available in conjunction with
2897 the NeXT runtime and ABI version 0 or 1.
2899 @item -fobjc-abi-version=@var{n}
2900 @opindex fobjc-abi-version
2901 Use version @var{n} of the Objective-C ABI for the selected runtime.
2902 This option is currently supported only for the NeXT runtime.  In that
2903 case, Version 0 is the traditional (32-bit) ABI without support for
2904 properties and other Objective-C 2.0 additions.  Version 1 is the
2905 traditional (32-bit) ABI with support for properties and other
2906 Objective-C 2.0 additions.  Version 2 is the modern (64-bit) ABI.  If
2907 nothing is specified, the default is Version 0 on 32-bit target
2908 machines, and Version 2 on 64-bit target machines.
2910 @item -fobjc-call-cxx-cdtors
2911 @opindex fobjc-call-cxx-cdtors
2912 For each Objective-C class, check if any of its instance variables is a
2913 C++ object with a non-trivial default constructor.  If so, synthesize a
2914 special @code{- (id) .cxx_construct} instance method which runs
2915 non-trivial default constructors on any such instance variables, in order,
2916 and then return @code{self}.  Similarly, check if any instance variable
2917 is a C++ object with a non-trivial destructor, and if so, synthesize a
2918 special @code{- (void) .cxx_destruct} method which runs
2919 all such default destructors, in reverse order.
2921 The @code{- (id) .cxx_construct} and @code{- (void) .cxx_destruct}
2922 methods thusly generated only operate on instance variables
2923 declared in the current Objective-C class, and not those inherited
2924 from superclasses.  It is the responsibility of the Objective-C
2925 runtime to invoke all such methods in an object's inheritance
2926 hierarchy.  The @code{- (id) .cxx_construct} methods are invoked
2927 by the runtime immediately after a new object instance is allocated;
2928 the @code{- (void) .cxx_destruct} methods are invoked immediately
2929 before the runtime deallocates an object instance.
2931 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2932 support for invoking the @code{- (id) .cxx_construct} and
2933 @code{- (void) .cxx_destruct} methods.
2935 @item -fobjc-direct-dispatch
2936 @opindex fobjc-direct-dispatch
2937 Allow fast jumps to the message dispatcher.  On Darwin this is
2938 accomplished via the comm page.
2940 @item -fobjc-exceptions
2941 @opindex fobjc-exceptions
2942 Enable syntactic support for structured exception handling in
2943 Objective-C, similar to what is offered by C++ and Java.  This option
2944 is required to use the Objective-C keywords @code{@@try},
2945 @code{@@throw}, @code{@@catch}, @code{@@finally} and
2946 @code{@@synchronized}.  This option is available with both the GNU
2947 runtime and the NeXT runtime (but not available in conjunction with
2948 the NeXT runtime on Mac OS X 10.2 and earlier).
2950 @item -fobjc-gc
2951 @opindex fobjc-gc
2952 Enable garbage collection (GC) in Objective-C and Objective-C++
2953 programs.  This option is only available with the NeXT runtime; the
2954 GNU runtime has a different garbage collection implementation that
2955 does not require special compiler flags.
2957 @item -fobjc-nilcheck
2958 @opindex fobjc-nilcheck
2959 For the NeXT runtime with version 2 of the ABI, check for a nil
2960 receiver in method invocations before doing the actual method call.
2961 This is the default and can be disabled using
2962 @option{-fno-objc-nilcheck}.  Class methods and super calls are never
2963 checked for nil in this way no matter what this flag is set to.
2964 Currently this flag does nothing when the GNU runtime, or an older
2965 version of the NeXT runtime ABI, is used.
2967 @item -fobjc-std=objc1
2968 @opindex fobjc-std
2969 Conform to the language syntax of Objective-C 1.0, the language
2970 recognized by GCC 4.0.  This only affects the Objective-C additions to
2971 the C/C++ language; it does not affect conformance to C/C++ standards,
2972 which is controlled by the separate C/C++ dialect option flags.  When
2973 this option is used with the Objective-C or Objective-C++ compiler,
2974 any Objective-C syntax that is not recognized by GCC 4.0 is rejected.
2975 This is useful if you need to make sure that your Objective-C code can
2976 be compiled with older versions of GCC@.
2978 @item -freplace-objc-classes
2979 @opindex freplace-objc-classes
2980 Emit a special marker instructing @command{ld(1)} not to statically link in
2981 the resulting object file, and allow @command{dyld(1)} to load it in at
2982 run time instead.  This is used in conjunction with the Fix-and-Continue
2983 debugging mode, where the object file in question may be recompiled and
2984 dynamically reloaded in the course of program execution, without the need
2985 to restart the program itself.  Currently, Fix-and-Continue functionality
2986 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2987 and later.
2989 @item -fzero-link
2990 @opindex fzero-link
2991 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2992 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2993 compile time) with static class references that get initialized at load time,
2994 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2995 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2996 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2997 for individual class implementations to be modified during program execution.
2998 The GNU runtime currently always retains calls to @code{objc_get_class("@dots{}")}
2999 regardless of command-line options.
3001 @item -gen-decls
3002 @opindex gen-decls
3003 Dump interface declarations for all classes seen in the source file to a
3004 file named @file{@var{sourcename}.decl}.
3006 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
3007 @opindex Wassign-intercept
3008 @opindex Wno-assign-intercept
3009 Warn whenever an Objective-C assignment is being intercepted by the
3010 garbage collector.
3012 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
3013 @opindex Wno-protocol
3014 @opindex Wprotocol
3015 If a class is declared to implement a protocol, a warning is issued for
3016 every method in the protocol that is not implemented by the class.  The
3017 default behavior is to issue a warning for every method not explicitly
3018 implemented in the class, even if a method implementation is inherited
3019 from the superclass.  If you use the @option{-Wno-protocol} option, then
3020 methods inherited from the superclass are considered to be implemented,
3021 and no warning is issued for them.
3023 @item -Wselector @r{(Objective-C and Objective-C++ only)}
3024 @opindex Wselector
3025 @opindex Wno-selector
3026 Warn if multiple methods of different types for the same selector are
3027 found during compilation.  The check is performed on the list of methods
3028 in the final stage of compilation.  Additionally, a check is performed
3029 for each selector appearing in a @code{@@selector(@dots{})}
3030 expression, and a corresponding method for that selector has been found
3031 during compilation.  Because these checks scan the method table only at
3032 the end of compilation, these warnings are not produced if the final
3033 stage of compilation is not reached, for example because an error is
3034 found during compilation, or because the @option{-fsyntax-only} option is
3035 being used.
3037 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
3038 @opindex Wstrict-selector-match
3039 @opindex Wno-strict-selector-match
3040 Warn if multiple methods with differing argument and/or return types are
3041 found for a given selector when attempting to send a message using this
3042 selector to a receiver of type @code{id} or @code{Class}.  When this flag
3043 is off (which is the default behavior), the compiler omits such warnings
3044 if any differences found are confined to types that share the same size
3045 and alignment.
3047 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
3048 @opindex Wundeclared-selector
3049 @opindex Wno-undeclared-selector
3050 Warn if a @code{@@selector(@dots{})} expression referring to an
3051 undeclared selector is found.  A selector is considered undeclared if no
3052 method with that name has been declared before the
3053 @code{@@selector(@dots{})} expression, either explicitly in an
3054 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
3055 an @code{@@implementation} section.  This option always performs its
3056 checks as soon as a @code{@@selector(@dots{})} expression is found,
3057 while @option{-Wselector} only performs its checks in the final stage of
3058 compilation.  This also enforces the coding style convention
3059 that methods and selectors must be declared before being used.
3061 @item -print-objc-runtime-info
3062 @opindex print-objc-runtime-info
3063 Generate C header describing the largest structure that is passed by
3064 value, if any.
3066 @end table
3068 @node Language Independent Options
3069 @section Options to Control Diagnostic Messages Formatting
3070 @cindex options to control diagnostics formatting
3071 @cindex diagnostic messages
3072 @cindex message formatting
3074 Traditionally, diagnostic messages have been formatted irrespective of
3075 the output device's aspect (e.g.@: its width, @dots{}).  You can use the
3076 options described below
3077 to control the formatting algorithm for diagnostic messages, 
3078 e.g.@: how many characters per line, how often source location
3079 information should be reported.  Note that some language front ends may not
3080 honor these options.
3082 @table @gcctabopt
3083 @item -fmessage-length=@var{n}
3084 @opindex fmessage-length
3085 Try to format error messages so that they fit on lines of about @var{n}
3086 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
3087 the front ends supported by GCC@.  If @var{n} is zero, then no
3088 line-wrapping is done; each error message appears on a single
3089 line.
3091 @item -fdiagnostics-show-location=once
3092 @opindex fdiagnostics-show-location
3093 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
3094 reporter to emit source location information @emph{once}; that is, in
3095 case the message is too long to fit on a single physical line and has to
3096 be wrapped, the source location won't be emitted (as prefix) again,
3097 over and over, in subsequent continuation lines.  This is the default
3098 behavior.
3100 @item -fdiagnostics-show-location=every-line
3101 Only meaningful in line-wrapping mode.  Instructs the diagnostic
3102 messages reporter to emit the same source location information (as
3103 prefix) for physical lines that result from the process of breaking
3104 a message which is too long to fit on a single line.
3106 @item -fdiagnostics-color[=@var{WHEN}]
3107 @itemx -fno-diagnostics-color
3108 @opindex fdiagnostics-color
3109 @cindex highlight, color, colour
3110 @vindex GCC_COLORS @r{environment variable}
3111 Use color in diagnostics.  @var{WHEN} is @samp{never}, @samp{always},
3112 or @samp{auto}.  The default is @samp{never} if @env{GCC_COLORS} environment
3113 variable isn't present in the environment, and @samp{auto} otherwise.
3114 @samp{auto} means to use color only when the standard error is a terminal.
3115 The forms @option{-fdiagnostics-color} and @option{-fno-diagnostics-color} are
3116 aliases for @option{-fdiagnostics-color=always} and
3117 @option{-fdiagnostics-color=never}, respectively.
3119 The colors are defined by the environment variable @env{GCC_COLORS}.
3120 Its value is a colon-separated list of capabilities and Select Graphic
3121 Rendition (SGR) substrings. SGR commands are interpreted by the
3122 terminal or terminal emulator.  (See the section in the documentation
3123 of your text terminal for permitted values and their meanings as
3124 character attributes.)  These substring values are integers in decimal
3125 representation and can be concatenated with semicolons.
3126 Common values to concatenate include
3127 @samp{1} for bold,
3128 @samp{4} for underline,
3129 @samp{5} for blink,
3130 @samp{7} for inverse,
3131 @samp{39} for default foreground color,
3132 @samp{30} to @samp{37} for foreground colors,
3133 @samp{90} to @samp{97} for 16-color mode foreground colors,
3134 @samp{38;5;0} to @samp{38;5;255}
3135 for 88-color and 256-color modes foreground colors,
3136 @samp{49} for default background color,
3137 @samp{40} to @samp{47} for background colors,
3138 @samp{100} to @samp{107} for 16-color mode background colors,
3139 and @samp{48;5;0} to @samp{48;5;255}
3140 for 88-color and 256-color modes background colors.
3142 The default @env{GCC_COLORS} is
3143 @samp{error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01}
3144 where @samp{01;31} is bold red, @samp{01;35} is bold magenta,
3145 @samp{01;36} is bold cyan, @samp{01;32} is bold green and
3146 @samp{01} is bold. Setting @env{GCC_COLORS} to the empty
3147 string disables colors.
3148 Supported capabilities are as follows.
3150 @table @code
3151 @item error=
3152 @vindex error GCC_COLORS @r{capability}
3153 SGR substring for error: markers.
3155 @item warning=
3156 @vindex warning GCC_COLORS @r{capability}
3157 SGR substring for warning: markers.
3159 @item note=
3160 @vindex note GCC_COLORS @r{capability}
3161 SGR substring for note: markers.
3163 @item caret=
3164 @vindex caret GCC_COLORS @r{capability}
3165 SGR substring for caret line.
3167 @item locus=
3168 @vindex locus GCC_COLORS @r{capability}
3169 SGR substring for location information, @samp{file:line} or
3170 @samp{file:line:column} etc.
3172 @item quote=
3173 @vindex quote GCC_COLORS @r{capability}
3174 SGR substring for information printed within quotes.
3175 @end table
3177 @item -fno-diagnostics-show-option
3178 @opindex fno-diagnostics-show-option
3179 @opindex fdiagnostics-show-option
3180 By default, each diagnostic emitted includes text indicating the
3181 command-line option that directly controls the diagnostic (if such an
3182 option is known to the diagnostic machinery).  Specifying the
3183 @option{-fno-diagnostics-show-option} flag suppresses that behavior.
3185 @item -fno-diagnostics-show-caret
3186 @opindex fno-diagnostics-show-caret
3187 @opindex fdiagnostics-show-caret
3188 By default, each diagnostic emitted includes the original source line
3189 and a caret '^' indicating the column.  This option suppresses this
3190 information.
3192 @end table
3194 @node Warning Options
3195 @section Options to Request or Suppress Warnings
3196 @cindex options to control warnings
3197 @cindex warning messages
3198 @cindex messages, warning
3199 @cindex suppressing warnings
3201 Warnings are diagnostic messages that report constructions that
3202 are not inherently erroneous but that are risky or suggest there
3203 may have been an error.
3205 The following language-independent options do not enable specific
3206 warnings but control the kinds of diagnostics produced by GCC@.
3208 @table @gcctabopt
3209 @cindex syntax checking
3210 @item -fsyntax-only
3211 @opindex fsyntax-only
3212 Check the code for syntax errors, but don't do anything beyond that.
3214 @item -fmax-errors=@var{n}
3215 @opindex fmax-errors
3216 Limits the maximum number of error messages to @var{n}, at which point
3217 GCC bails out rather than attempting to continue processing the source
3218 code.  If @var{n} is 0 (the default), there is no limit on the number
3219 of error messages produced.  If @option{-Wfatal-errors} is also
3220 specified, then @option{-Wfatal-errors} takes precedence over this
3221 option.
3223 @item -w
3224 @opindex w
3225 Inhibit all warning messages.
3227 @item -Werror
3228 @opindex Werror
3229 @opindex Wno-error
3230 Make all warnings into errors.
3232 @item -Werror=
3233 @opindex Werror=
3234 @opindex Wno-error=
3235 Make the specified warning into an error.  The specifier for a warning
3236 is appended; for example @option{-Werror=switch} turns the warnings
3237 controlled by @option{-Wswitch} into errors.  This switch takes a
3238 negative form, to be used to negate @option{-Werror} for specific
3239 warnings; for example @option{-Wno-error=switch} makes
3240 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
3241 is in effect.
3243 The warning message for each controllable warning includes the
3244 option that controls the warning.  That option can then be used with
3245 @option{-Werror=} and @option{-Wno-error=} as described above.
3246 (Printing of the option in the warning message can be disabled using the
3247 @option{-fno-diagnostics-show-option} flag.)
3249 Note that specifying @option{-Werror=}@var{foo} automatically implies
3250 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
3251 imply anything.
3253 @item -Wfatal-errors
3254 @opindex Wfatal-errors
3255 @opindex Wno-fatal-errors
3256 This option causes the compiler to abort compilation on the first error
3257 occurred rather than trying to keep going and printing further error
3258 messages.
3260 @item -Wforce-warnings
3261 @opindex Wforce-warnings
3262 This option causes the compiler to ignore @option{-Werror} and
3263 @option{-Werror=} and suppress promotion of warnings to errors.
3265 @end table
3267 You can request many specific warnings with options beginning with
3268 @samp{-W}, for example @option{-Wimplicit} to request warnings on
3269 implicit declarations.  Each of these specific warning options also
3270 has a negative form beginning @samp{-Wno-} to turn off warnings; for
3271 example, @option{-Wno-implicit}.  This manual lists only one of the
3272 two forms, whichever is not the default.  For further
3273 language-specific options also refer to @ref{C++ Dialect Options} and
3274 @ref{Objective-C and Objective-C++ Dialect Options}.
3276 When an unrecognized warning option is requested (e.g.,
3277 @option{-Wunknown-warning}), GCC emits a diagnostic stating
3278 that the option is not recognized.  However, if the @option{-Wno-} form
3279 is used, the behavior is slightly different: no diagnostic is
3280 produced for @option{-Wno-unknown-warning} unless other diagnostics
3281 are being produced.  This allows the use of new @option{-Wno-} options
3282 with old compilers, but if something goes wrong, the compiler
3283 warns that an unrecognized option is present.
3285 @table @gcctabopt
3286 @item -Wpedantic
3287 @itemx -pedantic
3288 @opindex pedantic
3289 @opindex Wpedantic
3290 Issue all the warnings demanded by strict ISO C and ISO C++;
3291 reject all programs that use forbidden extensions, and some other
3292 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
3293 version of the ISO C standard specified by any @option{-std} option used.
3295 Valid ISO C and ISO C++ programs should compile properly with or without
3296 this option (though a rare few require @option{-ansi} or a
3297 @option{-std} option specifying the required version of ISO C)@.  However,
3298 without this option, certain GNU extensions and traditional C and C++
3299 features are supported as well.  With this option, they are rejected.
3301 @option{-Wpedantic} does not cause warning messages for use of the
3302 alternate keywords whose names begin and end with @samp{__}.  Pedantic
3303 warnings are also disabled in the expression that follows
3304 @code{__extension__}.  However, only system header files should use
3305 these escape routes; application programs should avoid them.
3306 @xref{Alternate Keywords}.
3308 Some users try to use @option{-Wpedantic} to check programs for strict ISO
3309 C conformance.  They soon find that it does not do quite what they want:
3310 it finds some non-ISO practices, but not all---only those for which
3311 ISO C @emph{requires} a diagnostic, and some others for which
3312 diagnostics have been added.
3314 A feature to report any failure to conform to ISO C might be useful in
3315 some instances, but would require considerable additional work and would
3316 be quite different from @option{-Wpedantic}.  We don't have plans to
3317 support such a feature in the near future.
3319 Where the standard specified with @option{-std} represents a GNU
3320 extended dialect of C, such as @samp{gnu90} or @samp{gnu99}, there is a
3321 corresponding @dfn{base standard}, the version of ISO C on which the GNU
3322 extended dialect is based.  Warnings from @option{-Wpedantic} are given
3323 where they are required by the base standard.  (It does not make sense
3324 for such warnings to be given only for features not in the specified GNU
3325 C dialect, since by definition the GNU dialects of C include all
3326 features the compiler supports with the given option, and there would be
3327 nothing to warn about.)
3329 @item -pedantic-errors
3330 @opindex pedantic-errors
3331 Like @option{-Wpedantic}, except that errors are produced rather than
3332 warnings.
3334 @item -Wall
3335 @opindex Wall
3336 @opindex Wno-all
3337 This enables all the warnings about constructions that some users
3338 consider questionable, and that are easy to avoid (or modify to
3339 prevent the warning), even in conjunction with macros.  This also
3340 enables some language-specific warnings described in @ref{C++ Dialect
3341 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
3343 @option{-Wall} turns on the following warning flags:
3345 @gccoptlist{-Waddress   @gol
3346 -Warray-bounds @r{(only with} @option{-O2}@r{)}  @gol
3347 -Wc++11-compat  @gol
3348 -Wchar-subscripts  @gol
3349 -Wenum-compare @r{(in C/ObjC; this is on by default in C++)} @gol
3350 -Wimplicit-int @r{(C and Objective-C only)} @gol
3351 -Wimplicit-function-declaration @r{(C and Objective-C only)} @gol
3352 -Wcomment  @gol
3353 -Wformat   @gol
3354 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
3355 -Wmaybe-uninitialized @gol
3356 -Wmissing-braces @r{(only for C/ObjC)} @gol
3357 -Wnonnull  @gol
3358 -Wopenmp-simd @gol
3359 -Wparentheses  @gol
3360 -Wpointer-sign  @gol
3361 -Wreorder   @gol
3362 -Wreturn-type  @gol
3363 -Wripa-opt-mismatch @gol
3364 -Wsequence-point  @gol
3365 -Wsign-compare @r{(only in C++)}  @gol
3366 -Wstrict-aliasing  @gol
3367 -Wstrict-overflow=1  @gol
3368 -Wswitch  @gol
3369 -Wtrigraphs  @gol
3370 -Wuninitialized  @gol
3371 -Wunknown-pragmas  @gol
3372 -Wunused-function  @gol
3373 -Wunused-label     @gol
3374 -Wunused-value     @gol
3375 -Wunused-variable  @gol
3376 -Wvolatile-register-var @gol
3379 Note that some warning flags are not implied by @option{-Wall}.  Some of
3380 them warn about constructions that users generally do not consider
3381 questionable, but which occasionally you might wish to check for;
3382 others warn about constructions that are necessary or hard to avoid in
3383 some cases, and there is no simple way to modify the code to suppress
3384 the warning. Some of them are enabled by @option{-Wextra} but many of
3385 them must be enabled individually.
3387 @item -Wextra
3388 @opindex W
3389 @opindex Wextra
3390 @opindex Wno-extra
3391 This enables some extra warning flags that are not enabled by
3392 @option{-Wall}. (This option used to be called @option{-W}.  The older
3393 name is still supported, but the newer name is more descriptive.)
3395 @gccoptlist{-Wclobbered  @gol
3396 -Wempty-body  @gol
3397 -Wignored-qualifiers @gol
3398 -Wmissing-field-initializers  @gol
3399 -Wmissing-parameter-type @r{(C only)}  @gol
3400 -Wold-style-declaration @r{(C only)}  @gol
3401 -Woverride-init  @gol
3402 -Wsign-compare  @gol
3403 -Wtype-limits  @gol
3404 -Wuninitialized  @gol
3405 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)} @gol
3406 -Wunused-but-set-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}  @gol
3409 The option @option{-Wextra} also prints warning messages for the
3410 following cases:
3412 @itemize @bullet
3414 @item
3415 A pointer is compared against integer zero with @samp{<}, @samp{<=},
3416 @samp{>}, or @samp{>=}.
3418 @item
3419 (C++ only) An enumerator and a non-enumerator both appear in a
3420 conditional expression.
3422 @item
3423 (C++ only) Ambiguous virtual bases.
3425 @item
3426 (C++ only) Subscripting an array that has been declared @samp{register}.
3428 @item
3429 (C++ only) Taking the address of a variable that has been declared
3430 @samp{register}.
3432 @item
3433 (C++ only) A base class is not initialized in a derived class's copy
3434 constructor.
3436 @end itemize
3438 @item -Wchar-subscripts
3439 @opindex Wchar-subscripts
3440 @opindex Wno-char-subscripts
3441 Warn if an array subscript has type @code{char}.  This is a common cause
3442 of error, as programmers often forget that this type is signed on some
3443 machines.
3444 This warning is enabled by @option{-Wall}.
3446 @item -Wcomment
3447 @opindex Wcomment
3448 @opindex Wno-comment
3449 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
3450 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
3451 This warning is enabled by @option{-Wall}.
3453 @item -Wno-coverage-mismatch
3454 @opindex Wno-coverage-mismatch
3455 Warn if feedback profiles do not match when using the
3456 @option{-fprofile-use} option.
3457 If a source file is changed between compiling with @option{-fprofile-gen} and
3458 with @option{-fprofile-use}, the files with the profile feedback can fail
3459 to match the source file and GCC cannot use the profile feedback
3460 information.  By default, this warning is enabled and is treated as an
3461 error.  @option{-Wno-coverage-mismatch} can be used to disable the
3462 warning or @option{-Wno-error=coverage-mismatch} can be used to
3463 disable the error.  Disabling the error for this warning can result in
3464 poorly optimized code and is useful only in the
3465 case of very minor changes such as bug fixes to an existing code-base.
3466 Completely disabling the warning is not recommended.
3468 @item -Wno-cpp
3469 @r{(C, Objective-C, C++, Objective-C++ and Fortran only)}
3471 Suppress warning messages emitted by @code{#warning} directives.
3473 @item -Wdouble-promotion @r{(C, C++, Objective-C and Objective-C++ only)}
3474 @opindex Wdouble-promotion
3475 @opindex Wno-double-promotion
3476 Give a warning when a value of type @code{float} is implicitly
3477 promoted to @code{double}.  CPUs with a 32-bit ``single-precision''
3478 floating-point unit implement @code{float} in hardware, but emulate
3479 @code{double} in software.  On such a machine, doing computations
3480 using @code{double} values is much more expensive because of the
3481 overhead required for software emulation.
3483 It is easy to accidentally do computations with @code{double} because
3484 floating-point literals are implicitly of type @code{double}.  For
3485 example, in:
3486 @smallexample
3487 @group
3488 float area(float radius)
3490    return 3.14159 * radius * radius;
3492 @end group
3493 @end smallexample
3494 the compiler performs the entire computation with @code{double}
3495 because the floating-point literal is a @code{double}.
3497 @item -Wformat
3498 @itemx -Wformat=@var{n}
3499 @opindex Wformat
3500 @opindex Wno-format
3501 @opindex ffreestanding
3502 @opindex fno-builtin
3503 @opindex Wformat=
3504 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
3505 the arguments supplied have types appropriate to the format string
3506 specified, and that the conversions specified in the format string make
3507 sense.  This includes standard functions, and others specified by format
3508 attributes (@pxref{Function Attributes}), in the @code{printf},
3509 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
3510 not in the C standard) families (or other target-specific families).
3511 Which functions are checked without format attributes having been
3512 specified depends on the standard version selected, and such checks of
3513 functions without the attribute specified are disabled by
3514 @option{-ffreestanding} or @option{-fno-builtin}.
3516 The formats are checked against the format features supported by GNU
3517 libc version 2.2.  These include all ISO C90 and C99 features, as well
3518 as features from the Single Unix Specification and some BSD and GNU
3519 extensions.  Other library implementations may not support all these
3520 features; GCC does not support warning about features that go beyond a
3521 particular library's limitations.  However, if @option{-Wpedantic} is used
3522 with @option{-Wformat}, warnings are given about format features not
3523 in the selected standard version (but not for @code{strfmon} formats,
3524 since those are not in any version of the C standard).  @xref{C Dialect
3525 Options,,Options Controlling C Dialect}.
3527 @table @gcctabopt
3528 @item -Wformat=1
3529 @itemx -Wformat
3530 @opindex Wformat
3531 @opindex Wformat=1
3532 Option @option{-Wformat} is equivalent to @option{-Wformat=1}, and
3533 @option{-Wno-format} is equivalent to @option{-Wformat=0}.  Since
3534 @option{-Wformat} also checks for null format arguments for several
3535 functions, @option{-Wformat} also implies @option{-Wnonnull}.  Some
3536 aspects of this level of format checking can be disabled by the
3537 options: @option{-Wno-format-contains-nul},
3538 @option{-Wno-format-extra-args}, and @option{-Wno-format-zero-length}.
3539 @option{-Wformat} is enabled by @option{-Wall}.
3541 @item -Wno-format-contains-nul
3542 @opindex Wno-format-contains-nul
3543 @opindex Wformat-contains-nul
3544 If @option{-Wformat} is specified, do not warn about format strings that
3545 contain NUL bytes.
3547 @item -Wno-format-extra-args
3548 @opindex Wno-format-extra-args
3549 @opindex Wformat-extra-args
3550 If @option{-Wformat} is specified, do not warn about excess arguments to a
3551 @code{printf} or @code{scanf} format function.  The C standard specifies
3552 that such arguments are ignored.
3554 Where the unused arguments lie between used arguments that are
3555 specified with @samp{$} operand number specifications, normally
3556 warnings are still given, since the implementation could not know what
3557 type to pass to @code{va_arg} to skip the unused arguments.  However,
3558 in the case of @code{scanf} formats, this option suppresses the
3559 warning if the unused arguments are all pointers, since the Single
3560 Unix Specification says that such unused arguments are allowed.
3562 @item -Wno-format-zero-length
3563 @opindex Wno-format-zero-length
3564 @opindex Wformat-zero-length
3565 If @option{-Wformat} is specified, do not warn about zero-length formats.
3566 The C standard specifies that zero-length formats are allowed.
3569 @item -Wformat=2
3570 @opindex Wformat=2
3571 Enable @option{-Wformat} plus additional format checks.  Currently
3572 equivalent to @option{-Wformat -Wformat-nonliteral -Wformat-security
3573 -Wformat-y2k}.
3575 @item -Wformat-nonliteral
3576 @opindex Wformat-nonliteral
3577 @opindex Wno-format-nonliteral
3578 If @option{-Wformat} is specified, also warn if the format string is not a
3579 string literal and so cannot be checked, unless the format function
3580 takes its format arguments as a @code{va_list}.
3582 @item -Wformat-security
3583 @opindex Wformat-security
3584 @opindex Wno-format-security
3585 If @option{-Wformat} is specified, also warn about uses of format
3586 functions that represent possible security problems.  At present, this
3587 warns about calls to @code{printf} and @code{scanf} functions where the
3588 format string is not a string literal and there are no format arguments,
3589 as in @code{printf (foo);}.  This may be a security hole if the format
3590 string came from untrusted input and contains @samp{%n}.  (This is
3591 currently a subset of what @option{-Wformat-nonliteral} warns about, but
3592 in future warnings may be added to @option{-Wformat-security} that are not
3593 included in @option{-Wformat-nonliteral}.)
3595 @item -Wformat-y2k
3596 @opindex Wformat-y2k
3597 @opindex Wno-format-y2k
3598 If @option{-Wformat} is specified, also warn about @code{strftime}
3599 formats that may yield only a two-digit year.
3600 @end table
3602 @item -Wnonnull @r{(C and Objective-C only)}
3603 @opindex Wnonnull
3604 @opindex Wno-nonnull
3605 Warn about passing a null pointer for arguments marked as
3606 requiring a non-null value by the @code{nonnull} function attribute.
3608 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
3609 can be disabled with the @option{-Wno-nonnull} option.
3611 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
3612 @opindex Winit-self
3613 @opindex Wno-init-self
3614 Warn about uninitialized variables that are initialized with themselves.
3615 Note this option can only be used with the @option{-Wuninitialized} option.
3617 For example, GCC warns about @code{i} being uninitialized in the
3618 following snippet only when @option{-Winit-self} has been specified:
3619 @smallexample
3620 @group
3621 int f()
3623   int i = i;
3624   return i;
3626 @end group
3627 @end smallexample
3629 This warning is enabled by @option{-Wall} in C++.
3631 @item -Wimplicit-int @r{(C and Objective-C only)}
3632 @opindex Wimplicit-int
3633 @opindex Wno-implicit-int
3634 Warn when a declaration does not specify a type.
3635 This warning is enabled by @option{-Wall}.
3637 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
3638 @opindex Wimplicit-function-declaration
3639 @opindex Wno-implicit-function-declaration
3640 Give a warning whenever a function is used before being declared. In
3641 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
3642 enabled by default and it is made into an error by
3643 @option{-pedantic-errors}. This warning is also enabled by
3644 @option{-Wall}.
3646 @item -Wimplicit @r{(C and Objective-C only)}
3647 @opindex Wimplicit
3648 @opindex Wno-implicit
3649 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
3650 This warning is enabled by @option{-Wall}.
3652 @item -Wignored-qualifiers @r{(C and C++ only)}
3653 @opindex Wignored-qualifiers
3654 @opindex Wno-ignored-qualifiers
3655 Warn if the return type of a function has a type qualifier
3656 such as @code{const}.  For ISO C such a type qualifier has no effect,
3657 since the value returned by a function is not an lvalue.
3658 For C++, the warning is only emitted for scalar types or @code{void}.
3659 ISO C prohibits qualified @code{void} return types on function
3660 definitions, so such return types always receive a warning
3661 even without this option.
3663 This warning is also enabled by @option{-Wextra}.
3665 @item -Wmain
3666 @opindex Wmain
3667 @opindex Wno-main
3668 Warn if the type of @samp{main} is suspicious.  @samp{main} should be
3669 a function with external linkage, returning int, taking either zero
3670 arguments, two, or three arguments of appropriate types.  This warning
3671 is enabled by default in C++ and is enabled by either @option{-Wall}
3672 or @option{-Wpedantic}.
3674 @item -Wmissing-braces
3675 @opindex Wmissing-braces
3676 @opindex Wno-missing-braces
3677 Warn if an aggregate or union initializer is not fully bracketed.  In
3678 the following example, the initializer for @samp{a} is not fully
3679 bracketed, but that for @samp{b} is fully bracketed.  This warning is
3680 enabled by @option{-Wall} in C.
3682 @smallexample
3683 int a[2][2] = @{ 0, 1, 2, 3 @};
3684 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
3685 @end smallexample
3687 This warning is enabled by @option{-Wall}.
3689 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
3690 @opindex Wmissing-include-dirs
3691 @opindex Wno-missing-include-dirs
3692 Warn if a user-supplied include directory does not exist.
3694 @item -Wparentheses
3695 @opindex Wparentheses
3696 @opindex Wno-parentheses
3697 Warn if parentheses are omitted in certain contexts, such
3698 as when there is an assignment in a context where a truth value
3699 is expected, or when operators are nested whose precedence people
3700 often get confused about.
3702 Also warn if a comparison like @samp{x<=y<=z} appears; this is
3703 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
3704 interpretation from that of ordinary mathematical notation.
3706 Also warn about constructions where there may be confusion to which
3707 @code{if} statement an @code{else} branch belongs.  Here is an example of
3708 such a case:
3710 @smallexample
3711 @group
3713   if (a)
3714     if (b)
3715       foo ();
3716   else
3717     bar ();
3719 @end group
3720 @end smallexample
3722 In C/C++, every @code{else} branch belongs to the innermost possible
3723 @code{if} statement, which in this example is @code{if (b)}.  This is
3724 often not what the programmer expected, as illustrated in the above
3725 example by indentation the programmer chose.  When there is the
3726 potential for this confusion, GCC issues a warning when this flag
3727 is specified.  To eliminate the warning, add explicit braces around
3728 the innermost @code{if} statement so there is no way the @code{else}
3729 can belong to the enclosing @code{if}.  The resulting code
3730 looks like this:
3732 @smallexample
3733 @group
3735   if (a)
3736     @{
3737       if (b)
3738         foo ();
3739       else
3740         bar ();
3741     @}
3743 @end group
3744 @end smallexample
3746 Also warn for dangerous uses of the GNU extension to
3747 @code{?:} with omitted middle operand. When the condition
3748 in the @code{?}: operator is a boolean expression, the omitted value is
3749 always 1.  Often programmers expect it to be a value computed
3750 inside the conditional expression instead.
3752 This warning is enabled by @option{-Wall}.
3754 @item -Wsequence-point
3755 @opindex Wsequence-point
3756 @opindex Wno-sequence-point
3757 Warn about code that may have undefined semantics because of violations
3758 of sequence point rules in the C and C++ standards.
3760 The C and C++ standards define the order in which expressions in a C/C++
3761 program are evaluated in terms of @dfn{sequence points}, which represent
3762 a partial ordering between the execution of parts of the program: those
3763 executed before the sequence point, and those executed after it.  These
3764 occur after the evaluation of a full expression (one which is not part
3765 of a larger expression), after the evaluation of the first operand of a
3766 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
3767 function is called (but after the evaluation of its arguments and the
3768 expression denoting the called function), and in certain other places.
3769 Other than as expressed by the sequence point rules, the order of
3770 evaluation of subexpressions of an expression is not specified.  All
3771 these rules describe only a partial order rather than a total order,
3772 since, for example, if two functions are called within one expression
3773 with no sequence point between them, the order in which the functions
3774 are called is not specified.  However, the standards committee have
3775 ruled that function calls do not overlap.
3777 It is not specified when between sequence points modifications to the
3778 values of objects take effect.  Programs whose behavior depends on this
3779 have undefined behavior; the C and C++ standards specify that ``Between
3780 the previous and next sequence point an object shall have its stored
3781 value modified at most once by the evaluation of an expression.
3782 Furthermore, the prior value shall be read only to determine the value
3783 to be stored.''.  If a program breaks these rules, the results on any
3784 particular implementation are entirely unpredictable.
3786 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
3787 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
3788 diagnosed by this option, and it may give an occasional false positive
3789 result, but in general it has been found fairly effective at detecting
3790 this sort of problem in programs.
3792 The standard is worded confusingly, therefore there is some debate
3793 over the precise meaning of the sequence point rules in subtle cases.
3794 Links to discussions of the problem, including proposed formal
3795 definitions, may be found on the GCC readings page, at
3796 @uref{http://gcc.gnu.org/@/readings.html}.
3798 This warning is enabled by @option{-Wall} for C and C++.
3800 @item -Wself-assign
3801 @opindex Wself-assign
3802 @opindex Wno-self-assign
3803 Warn about self-assignment and self-initialization. This warning is intended
3804 for detecting accidental self-assignment due to typos, and therefore does
3805 not warn on a statement that is semantically a self-assignment after
3806 constant folding. Here is an example of what will trigger a self-assign
3807 warning and what will not:
3809 @smallexample
3810 @group
3811 void func()
3813    int i = 2;
3814    int x = x;   /* warn */
3815    float f = 5.0;
3816    double a[3];
3818    i = i + 0;   /* not warn */
3819    f = f / 1;   /* not warn */
3820    a[1] = a[1]; /* warn */
3821    i += 0;      /* not warn */
3823 @end group
3824 @end smallexample
3826 In C++ it will not warn on self-assignment of non-POD variables unless
3827 @option{-Wself-assign-non-pod} is also enabled.
3829 @item -Wself-assign-non-pod
3830 @opindex Wself-assign-non-pod
3831 @opindex Wno-self-assign-non-pod
3832 Warn about self-assignment of non-POD variables. This is a C++-specific
3833 warning and only effective when @option{-Wself-assign} is enabled.
3835 There are cases where self-assignment might be intentional. For example,
3836 a C++ programmer might write code to test whether an overloaded
3837 @code{operator=} works when the same object is assigned to itself.
3838 One way to work around the self-assign warning in such cases when this flag
3839 is enabled is using the functional form @code{object.operator=(object)}
3840 instead of the assignment form @code{object = object}, as shown in the
3841 following example.
3843 @smallexample
3844 @group
3845 void test_func()
3847    MyType t;
3849    t.operator=(t);  // not warn
3850    t = t;           // warn
3852 @end group
3853 @end smallexample
3855 @item -Wno-return-local-addr
3856 @opindex Wno-return-local-addr
3857 @opindex Wreturn-local-addr
3858 Do not warn about returning a pointer (or in C++, a reference) to a
3859 variable that goes out of scope after the function returns.
3861 @item -Wreturn-type
3862 @opindex Wreturn-type
3863 @opindex Wno-return-type
3864 Warn whenever a function is defined with a return type that defaults
3865 to @code{int}.  Also warn about any @code{return} statement with no
3866 return value in a function whose return type is not @code{void}
3867 (falling off the end of the function body is considered returning
3868 without a value), and about a @code{return} statement with an
3869 expression in a function whose return type is @code{void}.
3871 For C++, a function without return type always produces a diagnostic
3872 message, even when @option{-Wno-return-type} is specified.  The only
3873 exceptions are @samp{main} and functions defined in system headers.
3875 This warning is enabled by @option{-Wall}.
3877 @item -Wripa-opt-mismatch
3878 @opindex Wripa-opt-mismatch
3879 @opindex Wno-ripa-opt-mismatch
3880 When doing an FDO build with @option{-fprofile-use} and @option{-fripa},
3881 warn if importing an axuiliary module that was built with a different
3882 GCC command line during the profile-generate phase than the primary
3883 module.
3885 This warning is enabled by @option{-Wall}.
3887 @item -Wswitch
3888 @opindex Wswitch
3889 @opindex Wno-switch
3890 Warn whenever a @code{switch} statement has an index of enumerated type
3891 and lacks a @code{case} for one or more of the named codes of that
3892 enumeration.  (The presence of a @code{default} label prevents this
3893 warning.)  @code{case} labels outside the enumeration range also
3894 provoke warnings when this option is used (even if there is a
3895 @code{default} label).
3896 This warning is enabled by @option{-Wall}.
3898 @item -Wswitch-default
3899 @opindex Wswitch-default
3900 @opindex Wno-switch-default
3901 Warn whenever a @code{switch} statement does not have a @code{default}
3902 case.
3904 @item -Wswitch-enum
3905 @opindex Wswitch-enum
3906 @opindex Wno-switch-enum
3907 Warn whenever a @code{switch} statement has an index of enumerated type
3908 and lacks a @code{case} for one or more of the named codes of that
3909 enumeration.  @code{case} labels outside the enumeration range also
3910 provoke warnings when this option is used.  The only difference
3911 between @option{-Wswitch} and this option is that this option gives a
3912 warning about an omitted enumeration code even if there is a
3913 @code{default} label.
3915 @item -Wsync-nand @r{(C and C++ only)}
3916 @opindex Wsync-nand
3917 @opindex Wno-sync-nand
3918 Warn when @code{__sync_fetch_and_nand} and @code{__sync_nand_and_fetch}
3919 built-in functions are used.  These functions changed semantics in GCC 4.4.
3921 @item -Wtrigraphs
3922 @opindex Wtrigraphs
3923 @opindex Wno-trigraphs
3924 Warn if any trigraphs are encountered that might change the meaning of
3925 the program (trigraphs within comments are not warned about).
3926 This warning is enabled by @option{-Wall}.
3928 @item -Wunused-but-set-parameter
3929 @opindex Wunused-but-set-parameter
3930 @opindex Wno-unused-but-set-parameter
3931 Warn whenever a function parameter is assigned to, but otherwise unused
3932 (aside from its declaration).
3934 To suppress this warning use the @samp{unused} attribute
3935 (@pxref{Variable Attributes}).
3937 This warning is also enabled by @option{-Wunused} together with
3938 @option{-Wextra}.
3940 @item -Wunused-but-set-variable
3941 @opindex Wunused-but-set-variable
3942 @opindex Wno-unused-but-set-variable
3943 Warn whenever a local variable is assigned to, but otherwise unused
3944 (aside from its declaration).
3945 This warning is enabled by @option{-Wall}.
3947 To suppress this warning use the @samp{unused} attribute
3948 (@pxref{Variable Attributes}).
3950 This warning is also enabled by @option{-Wunused}, which is enabled
3951 by @option{-Wall}.
3953 @item -Wunused-function
3954 @opindex Wunused-function
3955 @opindex Wno-unused-function
3956 Warn whenever a static function is declared but not defined or a
3957 non-inline static function is unused.
3958 This warning is enabled by @option{-Wall}.
3960 @item -Wunused-label
3961 @opindex Wunused-label
3962 @opindex Wno-unused-label
3963 Warn whenever a label is declared but not used.
3964 This warning is enabled by @option{-Wall}.
3966 To suppress this warning use the @samp{unused} attribute
3967 (@pxref{Variable Attributes}).
3969 @item -Wunused-local-typedefs @r{(C, Objective-C, C++ and Objective-C++ only)}
3970 @opindex Wunused-local-typedefs
3971 Warn when a typedef locally defined in a function is not used.
3972 This warning is enabled by @option{-Wall}.
3974 @item -Wunused-parameter
3975 @opindex Wunused-parameter
3976 @opindex Wno-unused-parameter
3977 Warn whenever a function parameter is unused aside from its declaration.
3979 To suppress this warning use the @samp{unused} attribute
3980 (@pxref{Variable Attributes}).
3982 @item -Wno-unused-result
3983 @opindex Wunused-result
3984 @opindex Wno-unused-result
3985 Do not warn if a caller of a function marked with attribute
3986 @code{warn_unused_result} (@pxref{Function Attributes}) does not use
3987 its return value. The default is @option{-Wunused-result}.
3989 @item -Wunused-variable
3990 @opindex Wunused-variable
3991 @opindex Wno-unused-variable
3992 Warn whenever a local variable or non-constant static variable is unused
3993 aside from its declaration.
3994 This warning is enabled by @option{-Wall}.
3996 To suppress this warning use the @samp{unused} attribute
3997 (@pxref{Variable Attributes}).
3999 Note that a classic way to avoid @option{-Wunused-variable} warning is
4000 using @code{x = x}, but that does not work with @option{-Wself-assign}.
4001 Use @code{(void) x} or @code{static_cast<void>(x)} instead.
4003 @item -Wunused-value
4004 @opindex Wunused-value
4005 @opindex Wno-unused-value
4006 Warn whenever a statement computes a result that is explicitly not
4007 used. To suppress this warning cast the unused expression to
4008 @samp{void}. This includes an expression-statement or the left-hand
4009 side of a comma expression that contains no side effects. For example,
4010 an expression such as @samp{x[i,j]} causes a warning, while
4011 @samp{x[(void)i,j]} does not.
4013 This warning is enabled by @option{-Wall}.
4015 @item -Wunused
4016 @opindex Wunused
4017 @opindex Wno-unused
4018 All the above @option{-Wunused} options combined.
4020 In order to get a warning about an unused function parameter, you must
4021 either specify @option{-Wextra -Wunused} (note that @option{-Wall} implies
4022 @option{-Wunused}), or separately specify @option{-Wunused-parameter}.
4024 @item -Wuninitialized
4025 @opindex Wuninitialized
4026 @opindex Wno-uninitialized
4027 Warn if an automatic variable is used without first being initialized
4028 or if a variable may be clobbered by a @code{setjmp} call. In C++,
4029 warn if a non-static reference or non-static @samp{const} member
4030 appears in a class without constructors.
4032 If you want to warn about code that uses the uninitialized value of the
4033 variable in its own initializer, use the @option{-Winit-self} option.
4035 These warnings occur for individual uninitialized or clobbered
4036 elements of structure, union or array variables as well as for
4037 variables that are uninitialized or clobbered as a whole.  They do
4038 not occur for variables or elements declared @code{volatile}.  Because
4039 these warnings depend on optimization, the exact variables or elements
4040 for which there are warnings depends on the precise optimization
4041 options and version of GCC used.
4043 Note that there may be no warning about a variable that is used only
4044 to compute a value that itself is never used, because such
4045 computations may be deleted by data flow analysis before the warnings
4046 are printed.
4048 @item -Wmaybe-uninitialized
4049 @opindex Wmaybe-uninitialized
4050 @opindex Wno-maybe-uninitialized
4051 For an automatic variable, if there exists a path from the function
4052 entry to a use of the variable that is initialized, but there exist
4053 some other paths for which the variable is not initialized, the compiler
4054 emits a warning if it cannot prove the uninitialized paths are not
4055 executed at run time. These warnings are made optional because GCC is
4056 not smart enough to see all the reasons why the code might be correct
4057 in spite of appearing to have an error.  Here is one example of how
4058 this can happen:
4060 @smallexample
4061 @group
4063   int x;
4064   switch (y)
4065     @{
4066     case 1: x = 1;
4067       break;
4068     case 2: x = 4;
4069       break;
4070     case 3: x = 5;
4071     @}
4072   foo (x);
4074 @end group
4075 @end smallexample
4077 @noindent
4078 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
4079 always initialized, but GCC doesn't know this. To suppress the
4080 warning, you need to provide a default case with assert(0) or
4081 similar code.
4083 @cindex @code{longjmp} warnings
4084 This option also warns when a non-volatile automatic variable might be
4085 changed by a call to @code{longjmp}.  These warnings as well are possible
4086 only in optimizing compilation.
4088 The compiler sees only the calls to @code{setjmp}.  It cannot know
4089 where @code{longjmp} will be called; in fact, a signal handler could
4090 call it at any point in the code.  As a result, you may get a warning
4091 even when there is in fact no problem because @code{longjmp} cannot
4092 in fact be called at the place that would cause a problem.
4094 Some spurious warnings can be avoided if you declare all the functions
4095 you use that never return as @code{noreturn}.  @xref{Function
4096 Attributes}.
4098 This warning is enabled by @option{-Wall} or @option{-Wextra}.
4100 @item -Wunknown-pragmas
4101 @opindex Wunknown-pragmas
4102 @opindex Wno-unknown-pragmas
4103 @cindex warning for unknown pragmas
4104 @cindex unknown pragmas, warning
4105 @cindex pragmas, warning of unknown
4106 Warn when a @code{#pragma} directive is encountered that is not understood by 
4107 GCC@.  If this command-line option is used, warnings are even issued
4108 for unknown pragmas in system header files.  This is not the case if
4109 the warnings are only enabled by the @option{-Wall} command-line option.
4111 @item -Wno-pragmas
4112 @opindex Wno-pragmas
4113 @opindex Wpragmas
4114 Do not warn about misuses of pragmas, such as incorrect parameters,
4115 invalid syntax, or conflicts between pragmas.  See also
4116 @option{-Wunknown-pragmas}.
4118 @item -Wstrict-aliasing
4119 @opindex Wstrict-aliasing
4120 @opindex Wno-strict-aliasing
4121 This option is only active when @option{-fstrict-aliasing} is active.
4122 It warns about code that might break the strict aliasing rules that the
4123 compiler is using for optimization.  The warning does not catch all
4124 cases, but does attempt to catch the more common pitfalls.  It is
4125 included in @option{-Wall}.
4126 It is equivalent to @option{-Wstrict-aliasing=3}
4128 @item -Wstrict-aliasing=n
4129 @opindex Wstrict-aliasing=n
4130 This option is only active when @option{-fstrict-aliasing} is active.
4131 It warns about code that might break the strict aliasing rules that the
4132 compiler is using for optimization.
4133 Higher levels correspond to higher accuracy (fewer false positives).
4134 Higher levels also correspond to more effort, similar to the way @option{-O} 
4135 works.
4136 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=3}.
4138 Level 1: Most aggressive, quick, least accurate.
4139 Possibly useful when higher levels
4140 do not warn but @option{-fstrict-aliasing} still breaks the code, as it has very few
4141 false negatives.  However, it has many false positives.
4142 Warns for all pointer conversions between possibly incompatible types,
4143 even if never dereferenced.  Runs in the front end only.
4145 Level 2: Aggressive, quick, not too precise.
4146 May still have many false positives (not as many as level 1 though),
4147 and few false negatives (but possibly more than level 1).
4148 Unlike level 1, it only warns when an address is taken.  Warns about
4149 incomplete types.  Runs in the front end only.
4151 Level 3 (default for @option{-Wstrict-aliasing}):
4152 Should have very few false positives and few false
4153 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
4154 Takes care of the common pun+dereference pattern in the front end:
4155 @code{*(int*)&some_float}.
4156 If optimization is enabled, it also runs in the back end, where it deals
4157 with multiple statement cases using flow-sensitive points-to information.
4158 Only warns when the converted pointer is dereferenced.
4159 Does not warn about incomplete types.
4161 @item -Wstrict-overflow
4162 @itemx -Wstrict-overflow=@var{n}
4163 @opindex Wstrict-overflow
4164 @opindex Wno-strict-overflow
4165 This option is only active when @option{-fstrict-overflow} is active.
4166 It warns about cases where the compiler optimizes based on the
4167 assumption that signed overflow does not occur.  Note that it does not
4168 warn about all cases where the code might overflow: it only warns
4169 about cases where the compiler implements some optimization.  Thus
4170 this warning depends on the optimization level.
4172 An optimization that assumes that signed overflow does not occur is
4173 perfectly safe if the values of the variables involved are such that
4174 overflow never does, in fact, occur.  Therefore this warning can
4175 easily give a false positive: a warning about code that is not
4176 actually a problem.  To help focus on important issues, several
4177 warning levels are defined.  No warnings are issued for the use of
4178 undefined signed overflow when estimating how many iterations a loop
4179 requires, in particular when determining whether a loop will be
4180 executed at all.
4182 @table @gcctabopt
4183 @item -Wstrict-overflow=1
4184 Warn about cases that are both questionable and easy to avoid.  For
4185 example,  with @option{-fstrict-overflow}, the compiler simplifies
4186 @code{x + 1 > x} to @code{1}.  This level of
4187 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
4188 are not, and must be explicitly requested.
4190 @item -Wstrict-overflow=2
4191 Also warn about other cases where a comparison is simplified to a
4192 constant.  For example: @code{abs (x) >= 0}.  This can only be
4193 simplified when @option{-fstrict-overflow} is in effect, because
4194 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
4195 zero.  @option{-Wstrict-overflow} (with no level) is the same as
4196 @option{-Wstrict-overflow=2}.
4198 @item -Wstrict-overflow=3
4199 Also warn about other cases where a comparison is simplified.  For
4200 example: @code{x + 1 > 1} is simplified to @code{x > 0}.
4202 @item -Wstrict-overflow=4
4203 Also warn about other simplifications not covered by the above cases.
4204 For example: @code{(x * 10) / 5} is simplified to @code{x * 2}.
4206 @item -Wstrict-overflow=5
4207 Also warn about cases where the compiler reduces the magnitude of a
4208 constant involved in a comparison.  For example: @code{x + 2 > y} is
4209 simplified to @code{x + 1 >= y}.  This is reported only at the
4210 highest warning level because this simplification applies to many
4211 comparisons, so this warning level gives a very large number of
4212 false positives.
4213 @end table
4215 @item -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{]}
4216 @opindex Wsuggest-attribute=
4217 @opindex Wno-suggest-attribute=
4218 Warn for cases where adding an attribute may be beneficial. The
4219 attributes currently supported are listed below.
4221 @table @gcctabopt
4222 @item -Wsuggest-attribute=pure
4223 @itemx -Wsuggest-attribute=const
4224 @itemx -Wsuggest-attribute=noreturn
4225 @opindex Wsuggest-attribute=pure
4226 @opindex Wno-suggest-attribute=pure
4227 @opindex Wsuggest-attribute=const
4228 @opindex Wno-suggest-attribute=const
4229 @opindex Wsuggest-attribute=noreturn
4230 @opindex Wno-suggest-attribute=noreturn
4232 Warn about functions that might be candidates for attributes
4233 @code{pure}, @code{const} or @code{noreturn}.  The compiler only warns for
4234 functions visible in other compilation units or (in the case of @code{pure} and
4235 @code{const}) if it cannot prove that the function returns normally. A function
4236 returns normally if it doesn't contain an infinite loop or return abnormally
4237 by throwing, calling @code{abort()} or trapping.  This analysis requires option
4238 @option{-fipa-pure-const}, which is enabled by default at @option{-O} and
4239 higher.  Higher optimization levels improve the accuracy of the analysis.
4241 @item -Wsuggest-attribute=format
4242 @itemx -Wmissing-format-attribute
4243 @opindex Wsuggest-attribute=format
4244 @opindex Wmissing-format-attribute
4245 @opindex Wno-suggest-attribute=format
4246 @opindex Wno-missing-format-attribute
4247 @opindex Wformat
4248 @opindex Wno-format
4250 Warn about function pointers that might be candidates for @code{format}
4251 attributes.  Note these are only possible candidates, not absolute ones.
4252 GCC guesses that function pointers with @code{format} attributes that
4253 are used in assignment, initialization, parameter passing or return
4254 statements should have a corresponding @code{format} attribute in the
4255 resulting type.  I.e.@: the left-hand side of the assignment or
4256 initialization, the type of the parameter variable, or the return type
4257 of the containing function respectively should also have a @code{format}
4258 attribute to avoid the warning.
4260 GCC also warns about function definitions that might be
4261 candidates for @code{format} attributes.  Again, these are only
4262 possible candidates.  GCC guesses that @code{format} attributes
4263 might be appropriate for any function that calls a function like
4264 @code{vprintf} or @code{vscanf}, but this might not always be the
4265 case, and some functions for which @code{format} attributes are
4266 appropriate may not be detected.
4267 @end table
4269 @item -Warray-bounds
4270 @opindex Wno-array-bounds
4271 @opindex Warray-bounds
4272 This option is only active when @option{-ftree-vrp} is active
4273 (default for @option{-O2} and above). It warns about subscripts to arrays
4274 that are always out of bounds. This warning is enabled by @option{-Wall}.
4276 @item -Wno-div-by-zero
4277 @opindex Wno-div-by-zero
4278 @opindex Wdiv-by-zero
4279 Do not warn about compile-time integer division by zero.  Floating-point
4280 division by zero is not warned about, as it can be a legitimate way of
4281 obtaining infinities and NaNs.
4283 @item -Wsystem-headers
4284 @opindex Wsystem-headers
4285 @opindex Wno-system-headers
4286 @cindex warnings from system headers
4287 @cindex system headers, warnings from
4288 Print warning messages for constructs found in system header files.
4289 Warnings from system headers are normally suppressed, on the assumption
4290 that they usually do not indicate real problems and would only make the
4291 compiler output harder to read.  Using this command-line option tells
4292 GCC to emit warnings from system headers as if they occurred in user
4293 code.  However, note that using @option{-Wall} in conjunction with this
4294 option does @emph{not} warn about unknown pragmas in system
4295 headers---for that, @option{-Wunknown-pragmas} must also be used.
4297 @item -Wtrampolines
4298 @opindex Wtrampolines
4299 @opindex Wno-trampolines
4300  Warn about trampolines generated for pointers to nested functions.
4302  A trampoline is a small piece of data or code that is created at run
4303  time on the stack when the address of a nested function is taken, and
4304  is used to call the nested function indirectly.  For some targets, it
4305  is made up of data only and thus requires no special treatment.  But,
4306  for most targets, it is made up of code and thus requires the stack
4307  to be made executable in order for the program to work properly.
4309 @item -Wfloat-equal
4310 @opindex Wfloat-equal
4311 @opindex Wno-float-equal
4312 Warn if floating-point values are used in equality comparisons.
4314 The idea behind this is that sometimes it is convenient (for the
4315 programmer) to consider floating-point values as approximations to
4316 infinitely precise real numbers.  If you are doing this, then you need
4317 to compute (by analyzing the code, or in some other way) the maximum or
4318 likely maximum error that the computation introduces, and allow for it
4319 when performing comparisons (and when producing output, but that's a
4320 different problem).  In particular, instead of testing for equality, you
4321 should check to see whether the two values have ranges that overlap; and
4322 this is done with the relational operators, so equality comparisons are
4323 probably mistaken.
4325 @item -Wtraditional @r{(C and Objective-C only)}
4326 @opindex Wtraditional
4327 @opindex Wno-traditional
4328 Warn about certain constructs that behave differently in traditional and
4329 ISO C@.  Also warn about ISO C constructs that have no traditional C
4330 equivalent, and/or problematic constructs that should be avoided.
4332 @itemize @bullet
4333 @item
4334 Macro parameters that appear within string literals in the macro body.
4335 In traditional C macro replacement takes place within string literals,
4336 but in ISO C it does not.
4338 @item
4339 In traditional C, some preprocessor directives did not exist.
4340 Traditional preprocessors only considered a line to be a directive
4341 if the @samp{#} appeared in column 1 on the line.  Therefore
4342 @option{-Wtraditional} warns about directives that traditional C
4343 understands but ignores because the @samp{#} does not appear as the
4344 first character on the line.  It also suggests you hide directives like
4345 @samp{#pragma} not understood by traditional C by indenting them.  Some
4346 traditional implementations do not recognize @samp{#elif}, so this option
4347 suggests avoiding it altogether.
4349 @item
4350 A function-like macro that appears without arguments.
4352 @item
4353 The unary plus operator.
4355 @item
4356 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating-point
4357 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
4358 constants.)  Note, these suffixes appear in macros defined in the system
4359 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
4360 Use of these macros in user code might normally lead to spurious
4361 warnings, however GCC's integrated preprocessor has enough context to
4362 avoid warning in these cases.
4364 @item
4365 A function declared external in one block and then used after the end of
4366 the block.
4368 @item
4369 A @code{switch} statement has an operand of type @code{long}.
4371 @item
4372 A non-@code{static} function declaration follows a @code{static} one.
4373 This construct is not accepted by some traditional C compilers.
4375 @item
4376 The ISO type of an integer constant has a different width or
4377 signedness from its traditional type.  This warning is only issued if
4378 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
4379 typically represent bit patterns, are not warned about.
4381 @item
4382 Usage of ISO string concatenation is detected.
4384 @item
4385 Initialization of automatic aggregates.
4387 @item
4388 Identifier conflicts with labels.  Traditional C lacks a separate
4389 namespace for labels.
4391 @item
4392 Initialization of unions.  If the initializer is zero, the warning is
4393 omitted.  This is done under the assumption that the zero initializer in
4394 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
4395 initializer warnings and relies on default initialization to zero in the
4396 traditional C case.
4398 @item
4399 Conversions by prototypes between fixed/floating-point values and vice
4400 versa.  The absence of these prototypes when compiling with traditional
4401 C causes serious problems.  This is a subset of the possible
4402 conversion warnings; for the full set use @option{-Wtraditional-conversion}.
4404 @item
4405 Use of ISO C style function definitions.  This warning intentionally is
4406 @emph{not} issued for prototype declarations or variadic functions
4407 because these ISO C features appear in your code when using
4408 libiberty's traditional C compatibility macros, @code{PARAMS} and
4409 @code{VPARAMS}.  This warning is also bypassed for nested functions
4410 because that feature is already a GCC extension and thus not relevant to
4411 traditional C compatibility.
4412 @end itemize
4414 @item -Wtraditional-conversion @r{(C and Objective-C only)}
4415 @opindex Wtraditional-conversion
4416 @opindex Wno-traditional-conversion
4417 Warn if a prototype causes a type conversion that is different from what
4418 would happen to the same argument in the absence of a prototype.  This
4419 includes conversions of fixed point to floating and vice versa, and
4420 conversions changing the width or signedness of a fixed-point argument
4421 except when the same as the default promotion.
4423 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
4424 @opindex Wdeclaration-after-statement
4425 @opindex Wno-declaration-after-statement
4426 Warn when a declaration is found after a statement in a block.  This
4427 construct, known from C++, was introduced with ISO C99 and is by default
4428 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
4429 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
4431 @item -Wundef
4432 @opindex Wundef
4433 @opindex Wno-undef
4434 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
4436 @item -Wno-endif-labels
4437 @opindex Wno-endif-labels
4438 @opindex Wendif-labels
4439 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
4441 @item -Wshadow
4442 @opindex Wshadow
4443 @opindex Wno-shadow
4444 Warn whenever a local variable or type declaration shadows another variable,
4445 parameter, type, or class member (in C++), or whenever a built-in function
4446 is shadowed. Note that in C++, the compiler warns if a local variable
4447 shadows an explicit typedef, but not if it shadows a struct/class/enum.
4449 @item -Wshadow-local
4450 @opindex Wshadow-local
4451 @opindex Wno-shadow-local
4452 Warn when a local variable shadows another local variable or parameter.
4454 @item -Wshadow-compatible-local
4455 @opindex Wshadow-compatible-local
4456 @opindex Wno-shadow-compatible-local
4457 Warn when a local variable shadows another local variable or parameter
4458 whose type is compatible with that of the shadowing variable. In C++,
4459 type compatibility here means the type of the shadowing variable can be
4460 converted to that of the shadowed variable. The creation of this flag
4461 (in addition to @option{-Wshadow-local}) is based on the idea that when
4462 a local variable shadows another one of incompatible type, it is most
4463 likely intentional, not a bug or typo, as shown in the following example:
4465 @smallexample
4466 @group
4467 for (SomeIterator i = SomeObj.begin(); i != SomeObj.end(); ++i)
4469   for (int i = 0; i < N; ++i)
4470   @{
4471     ...
4472   @}
4473   ...
4475 @end group
4476 @end smallexample
4478 Since the two variable @code{i} in the example above have incompatible types, 
4479 enabling only @option{-Wshadow-compatible-local} will not emit a warning.
4480 Because their types are incompatible, if a programmer accidentally uses one
4481 in place of the other, type checking will catch that and emit an error or
4482 warning. So not warning (about shadowing) in this case will not lead to
4483 undetected bugs. Use of this flag instead of @option{-Wshadow-local} can
4484 possibly reduce the number of warnings triggered by intentional shadowing.
4486 @item -Wlarger-than=@var{len}
4487 @opindex Wlarger-than=@var{len}
4488 @opindex Wlarger-than-@var{len}
4489 Warn whenever an object of larger than @var{len} bytes is defined.
4491 @item -Wframe-larger-than=@var{len}
4492 @opindex Wframe-larger-than
4493 Warn if the size of a function frame is larger than @var{len} bytes.
4494 The computation done to determine the stack frame size is approximate
4495 and not conservative.
4496 The actual requirements may be somewhat greater than @var{len}
4497 even if you do not get a warning.  In addition, any space allocated
4498 via @code{alloca}, variable-length arrays, or related constructs
4499 is not included by the compiler when determining
4500 whether or not to issue a warning.
4502 @item -Wno-free-nonheap-object
4503 @opindex Wno-free-nonheap-object
4504 @opindex Wfree-nonheap-object
4505 Do not warn when attempting to free an object that was not allocated
4506 on the heap.
4508 @item -Wstack-usage=@var{len}
4509 @opindex Wstack-usage
4510 Warn if the stack usage of a function might be larger than @var{len} bytes.
4511 The computation done to determine the stack usage is conservative.
4512 Any space allocated via @code{alloca}, variable-length arrays, or related
4513 constructs is included by the compiler when determining whether or not to
4514 issue a warning.
4516 The message is in keeping with the output of @option{-fstack-usage}.
4518 @itemize
4519 @item
4520 If the stack usage is fully static but exceeds the specified amount, it's:
4522 @smallexample
4523   warning: stack usage is 1120 bytes
4524 @end smallexample
4525 @item
4526 If the stack usage is (partly) dynamic but bounded, it's:
4528 @smallexample
4529   warning: stack usage might be 1648 bytes
4530 @end smallexample
4531 @item
4532 If the stack usage is (partly) dynamic and not bounded, it's:
4534 @smallexample
4535   warning: stack usage might be unbounded
4536 @end smallexample
4537 @end itemize
4539 @item -Wunsafe-loop-optimizations
4540 @opindex Wunsafe-loop-optimizations
4541 @opindex Wno-unsafe-loop-optimizations
4542 Warn if the loop cannot be optimized because the compiler cannot
4543 assume anything on the bounds of the loop indices.  With
4544 @option{-funsafe-loop-optimizations} warn if the compiler makes
4545 such assumptions.
4547 @item -Wno-pedantic-ms-format @r{(MinGW targets only)}
4548 @opindex Wno-pedantic-ms-format
4549 @opindex Wpedantic-ms-format
4550 When used in combination with @option{-Wformat}
4551 and @option{-pedantic} without GNU extensions, this option
4552 disables the warnings about non-ISO @code{printf} / @code{scanf} format
4553 width specifiers @code{I32}, @code{I64}, and @code{I} used on Windows targets,
4554 which depend on the MS runtime.
4556 @item -Wpointer-arith
4557 @opindex Wpointer-arith
4558 @opindex Wno-pointer-arith
4559 Warn about anything that depends on the ``size of'' a function type or
4560 of @code{void}.  GNU C assigns these types a size of 1, for
4561 convenience in calculations with @code{void *} pointers and pointers
4562 to functions.  In C++, warn also when an arithmetic operation involves
4563 @code{NULL}.  This warning is also enabled by @option{-Wpedantic}.
4565 @item -Wtype-limits
4566 @opindex Wtype-limits
4567 @opindex Wno-type-limits
4568 Warn if a comparison is always true or always false due to the limited
4569 range of the data type, but do not warn for constant expressions.  For
4570 example, warn if an unsigned variable is compared against zero with
4571 @samp{<} or @samp{>=}.  This warning is also enabled by
4572 @option{-Wextra}.
4574 @item -Wbad-function-cast @r{(C and Objective-C only)}
4575 @opindex Wbad-function-cast
4576 @opindex Wno-bad-function-cast
4577 Warn whenever a function call is cast to a non-matching type.
4578 For example, warn if @code{int malloc()} is cast to @code{anything *}.
4580 @item -Wc++-compat @r{(C and Objective-C only)}
4581 Warn about ISO C constructs that are outside of the common subset of
4582 ISO C and ISO C++, e.g.@: request for implicit conversion from
4583 @code{void *} to a pointer to non-@code{void} type.
4585 @item -Wc++11-compat @r{(C++ and Objective-C++ only)}
4586 Warn about C++ constructs whose meaning differs between ISO C++ 1998
4587 and ISO C++ 2011, e.g., identifiers in ISO C++ 1998 that are keywords
4588 in ISO C++ 2011.  This warning turns on @option{-Wnarrowing} and is
4589 enabled by @option{-Wall}.
4591 @item -Wcast-qual
4592 @opindex Wcast-qual
4593 @opindex Wno-cast-qual
4594 Warn whenever a pointer is cast so as to remove a type qualifier from
4595 the target type.  For example, warn if a @code{const char *} is cast
4596 to an ordinary @code{char *}.
4598 Also warn when making a cast that introduces a type qualifier in an
4599 unsafe way.  For example, casting @code{char **} to @code{const char **}
4600 is unsafe, as in this example:
4602 @smallexample
4603   /* p is char ** value.  */
4604   const char **q = (const char **) p;
4605   /* Assignment of readonly string to const char * is OK.  */
4606   *q = "string";
4607   /* Now char** pointer points to read-only memory.  */
4608   **p = 'b';
4609 @end smallexample
4611 @item -Wcast-align
4612 @opindex Wcast-align
4613 @opindex Wno-cast-align
4614 Warn whenever a pointer is cast such that the required alignment of the
4615 target is increased.  For example, warn if a @code{char *} is cast to
4616 an @code{int *} on machines where integers can only be accessed at
4617 two- or four-byte boundaries.
4619 @item -Wwrite-strings
4620 @opindex Wwrite-strings
4621 @opindex Wno-write-strings
4622 When compiling C, give string constants the type @code{const
4623 char[@var{length}]} so that copying the address of one into a
4624 non-@code{const} @code{char *} pointer produces a warning.  These
4625 warnings help you find at compile time code that can try to write
4626 into a string constant, but only if you have been very careful about
4627 using @code{const} in declarations and prototypes.  Otherwise, it is
4628 just a nuisance. This is why we did not make @option{-Wall} request
4629 these warnings.
4631 When compiling C++, warn about the deprecated conversion from string
4632 literals to @code{char *}.  This warning is enabled by default for C++
4633 programs.
4635 @item -Wclobbered
4636 @opindex Wclobbered
4637 @opindex Wno-clobbered
4638 Warn for variables that might be changed by @samp{longjmp} or
4639 @samp{vfork}.  This warning is also enabled by @option{-Wextra}.
4641 @item -Wconditionally-supported @r{(C++ and Objective-C++ only)}
4642 @opindex Wconditionally-supported
4643 @opindex Wno-conditionally-supported
4644 Warn for conditionally-supported (C++11 [intro.defs]) constructs.
4646 @item -Wconversion
4647 @opindex Wconversion
4648 @opindex Wno-conversion
4649 Warn for implicit conversions that may alter a value. This includes
4650 conversions between real and integer, like @code{abs (x)} when
4651 @code{x} is @code{double}; conversions between signed and unsigned,
4652 like @code{unsigned ui = -1}; and conversions to smaller types, like
4653 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
4654 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
4655 changed by the conversion like in @code{abs (2.0)}.  Warnings about
4656 conversions between signed and unsigned integers can be disabled by
4657 using @option{-Wno-sign-conversion}.
4659 For C++, also warn for confusing overload resolution for user-defined
4660 conversions; and conversions that never use a type conversion
4661 operator: conversions to @code{void}, the same type, a base class or a
4662 reference to them. Warnings about conversions between signed and
4663 unsigned integers are disabled by default in C++ unless
4664 @option{-Wsign-conversion} is explicitly enabled.
4666 @item -Wno-conversion-null @r{(C++ and Objective-C++ only)}
4667 @opindex Wconversion-null
4668 @opindex Wno-conversion-null
4669 Do not warn for conversions between @code{NULL} and non-pointer
4670 types. @option{-Wconversion-null} is enabled by default.
4672 @item -Wzero-as-null-pointer-constant @r{(C++ and Objective-C++ only)}
4673 @opindex Wzero-as-null-pointer-constant
4674 @opindex Wno-zero-as-null-pointer-constant
4675 Warn when a literal '0' is used as null pointer constant.  This can
4676 be useful to facilitate the conversion to @code{nullptr} in C++11.
4678 @item -Wdate-time
4679 @opindex Wdate-time
4680 @opindex Wno-date-time
4681 Warn when macros @code{__TIME__}, @code{__DATE__} or @code{__TIMESTAMP__}
4682 are encountered as they might prevent bit-wise-identical reproducible
4683 compilations.
4685 @item -Wdelete-incomplete @r{(C++ and Objective-C++ only)}
4686 @opindex Wdelete-incomplete
4687 @opindex Wno-delete-incomplete
4688 Warn when deleting a pointer to incomplete type, which may cause
4689 undefined behavior at runtime.  This warning is enabled by default.
4691 @item -Wuseless-cast @r{(C++ and Objective-C++ only)}
4692 @opindex Wuseless-cast
4693 @opindex Wno-useless-cast
4694 Warn when an expression is casted to its own type.
4696 @item -Wempty-body
4697 @opindex Wempty-body
4698 @opindex Wno-empty-body
4699 Warn if an empty body occurs in an @samp{if}, @samp{else} or @samp{do
4700 while} statement.  This warning is also enabled by @option{-Wextra}.
4702 @item -Wenum-compare
4703 @opindex Wenum-compare
4704 @opindex Wno-enum-compare
4705 Warn about a comparison between values of different enumerated types.
4706 In C++ enumeral mismatches in conditional expressions are also
4707 diagnosed and the warning is enabled by default.  In C this warning is 
4708 enabled by @option{-Wall}.
4710 @item -Wjump-misses-init @r{(C, Objective-C only)}
4711 @opindex Wjump-misses-init
4712 @opindex Wno-jump-misses-init
4713 Warn if a @code{goto} statement or a @code{switch} statement jumps
4714 forward across the initialization of a variable, or jumps backward to a
4715 label after the variable has been initialized.  This only warns about
4716 variables that are initialized when they are declared.  This warning is
4717 only supported for C and Objective-C; in C++ this sort of branch is an
4718 error in any case.
4720 @option{-Wjump-misses-init} is included in @option{-Wc++-compat}.  It
4721 can be disabled with the @option{-Wno-jump-misses-init} option.
4723 @item -Wsign-compare
4724 @opindex Wsign-compare
4725 @opindex Wno-sign-compare
4726 @cindex warning for comparison of signed and unsigned values
4727 @cindex comparison of signed and unsigned values, warning
4728 @cindex signed and unsigned values, comparison warning
4729 Warn when a comparison between signed and unsigned values could produce
4730 an incorrect result when the signed value is converted to unsigned.
4731 This warning is also enabled by @option{-Wextra}; to get the other warnings
4732 of @option{-Wextra} without this warning, use @option{-Wextra -Wno-sign-compare}.
4734 @item -Wsign-conversion
4735 @opindex Wsign-conversion
4736 @opindex Wno-sign-conversion
4737 Warn for implicit conversions that may change the sign of an integer
4738 value, like assigning a signed integer expression to an unsigned
4739 integer variable. An explicit cast silences the warning. In C, this
4740 option is enabled also by @option{-Wconversion}.
4742 @item -Wfloat-conversion
4743 @opindex Wfloat-conversion
4744 @opindex Wno-float-conversion
4745 Warn for implicit conversions that reduce the precision of a real value.
4746 This includes conversions from real to integer, and from higher precision
4747 real to lower precision real values.  This option is also enabled by
4748 @option{-Wconversion}.
4750 @item -Wsizeof-pointer-memaccess
4751 @opindex Wsizeof-pointer-memaccess
4752 @opindex Wno-sizeof-pointer-memaccess
4753 Warn for suspicious length parameters to certain string and memory built-in
4754 functions if the argument uses @code{sizeof}.  This warning warns e.g.@:
4755 about @code{memset (ptr, 0, sizeof (ptr));} if @code{ptr} is not an array,
4756 but a pointer, and suggests a possible fix, or about
4757 @code{memcpy (&foo, ptr, sizeof (&foo));}.  This warning is enabled by
4758 @option{-Wall}.
4760 @item -Waddress
4761 @opindex Waddress
4762 @opindex Wno-address
4763 Warn about suspicious uses of memory addresses. These include using
4764 the address of a function in a conditional expression, such as
4765 @code{void func(void); if (func)}, and comparisons against the memory
4766 address of a string literal, such as @code{if (x == "abc")}.  Such
4767 uses typically indicate a programmer error: the address of a function
4768 always evaluates to true, so their use in a conditional usually
4769 indicate that the programmer forgot the parentheses in a function
4770 call; and comparisons against string literals result in unspecified
4771 behavior and are not portable in C, so they usually indicate that the
4772 programmer intended to use @code{strcmp}.  This warning is enabled by
4773 @option{-Wall}.
4775 @item -Wlogical-op
4776 @opindex Wlogical-op
4777 @opindex Wno-logical-op
4778 Warn about suspicious uses of logical operators in expressions.
4779 This includes using logical operators in contexts where a
4780 bit-wise operator is likely to be expected.
4782 @item -Waggregate-return
4783 @opindex Waggregate-return
4784 @opindex Wno-aggregate-return
4785 Warn if any functions that return structures or unions are defined or
4786 called.  (In languages where you can return an array, this also elicits
4787 a warning.)
4789 @item -Wno-aggressive-loop-optimizations
4790 @opindex Wno-aggressive-loop-optimizations
4791 @opindex Waggressive-loop-optimizations
4792 Warn if in a loop with constant number of iterations the compiler detects
4793 undefined behavior in some statement during one or more of the iterations.
4795 @item -Wno-attributes
4796 @opindex Wno-attributes
4797 @opindex Wattributes
4798 Do not warn if an unexpected @code{__attribute__} is used, such as
4799 unrecognized attributes, function attributes applied to variables,
4800 etc.  This does not stop errors for incorrect use of supported
4801 attributes.
4803 @item -Wno-builtin-macro-redefined
4804 @opindex Wno-builtin-macro-redefined
4805 @opindex Wbuiltin-macro-redefined
4806 Do not warn if certain built-in macros are redefined.  This suppresses
4807 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
4808 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
4810 @item -Wstrict-prototypes @r{(C and Objective-C only)}
4811 @opindex Wstrict-prototypes
4812 @opindex Wno-strict-prototypes
4813 Warn if a function is declared or defined without specifying the
4814 argument types.  (An old-style function definition is permitted without
4815 a warning if preceded by a declaration that specifies the argument
4816 types.)
4818 @item -Wold-style-declaration @r{(C and Objective-C only)}
4819 @opindex Wold-style-declaration
4820 @opindex Wno-old-style-declaration
4821 Warn for obsolescent usages, according to the C Standard, in a
4822 declaration. For example, warn if storage-class specifiers like
4823 @code{static} are not the first things in a declaration.  This warning
4824 is also enabled by @option{-Wextra}.
4826 @item -Wold-style-definition @r{(C and Objective-C only)}
4827 @opindex Wold-style-definition
4828 @opindex Wno-old-style-definition
4829 Warn if an old-style function definition is used.  A warning is given
4830 even if there is a previous prototype.
4832 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
4833 @opindex Wmissing-parameter-type
4834 @opindex Wno-missing-parameter-type
4835 A function parameter is declared without a type specifier in K&R-style
4836 functions:
4838 @smallexample
4839 void foo(bar) @{ @}
4840 @end smallexample
4842 This warning is also enabled by @option{-Wextra}.
4844 @item -Wmissing-prototypes @r{(C and Objective-C only)}
4845 @opindex Wmissing-prototypes
4846 @opindex Wno-missing-prototypes
4847 Warn if a global function is defined without a previous prototype
4848 declaration.  This warning is issued even if the definition itself
4849 provides a prototype.  Use this option to detect global functions
4850 that do not have a matching prototype declaration in a header file.
4851 This option is not valid for C++ because all function declarations
4852 provide prototypes and a non-matching declaration will declare an
4853 overload rather than conflict with an earlier declaration.
4854 Use @option{-Wmissing-declarations} to detect missing declarations in C++.
4856 @item -Wmissing-declarations
4857 @opindex Wmissing-declarations
4858 @opindex Wno-missing-declarations
4859 Warn if a global function is defined without a previous declaration.
4860 Do so even if the definition itself provides a prototype.
4861 Use this option to detect global functions that are not declared in
4862 header files.  In C, no warnings are issued for functions with previous
4863 non-prototype declarations; use @option{-Wmissing-prototype} to detect
4864 missing prototypes.  In C++, no warnings are issued for function templates,
4865 or for inline functions, or for functions in anonymous namespaces.
4867 @item -Wmissing-field-initializers
4868 @opindex Wmissing-field-initializers
4869 @opindex Wno-missing-field-initializers
4870 @opindex W
4871 @opindex Wextra
4872 @opindex Wno-extra
4873 Warn if a structure's initializer has some fields missing.  For
4874 example, the following code causes such a warning, because
4875 @code{x.h} is implicitly zero:
4877 @smallexample
4878 struct s @{ int f, g, h; @};
4879 struct s x = @{ 3, 4 @};
4880 @end smallexample
4882 This option does not warn about designated initializers, so the following
4883 modification does not trigger a warning:
4885 @smallexample
4886 struct s @{ int f, g, h; @};
4887 struct s x = @{ .f = 3, .g = 4 @};
4888 @end smallexample
4890 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
4891 warnings without this one, use @option{-Wextra -Wno-missing-field-initializers}.
4893 @item -Wno-multichar
4894 @opindex Wno-multichar
4895 @opindex Wmultichar
4896 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
4897 Usually they indicate a typo in the user's code, as they have
4898 implementation-defined values, and should not be used in portable code.
4900 @item -Wnormalized=<none|id|nfc|nfkc>
4901 @opindex Wnormalized=
4902 @cindex NFC
4903 @cindex NFKC
4904 @cindex character set, input normalization
4905 In ISO C and ISO C++, two identifiers are different if they are
4906 different sequences of characters.  However, sometimes when characters
4907 outside the basic ASCII character set are used, you can have two
4908 different character sequences that look the same.  To avoid confusion,
4909 the ISO 10646 standard sets out some @dfn{normalization rules} which
4910 when applied ensure that two sequences that look the same are turned into
4911 the same sequence.  GCC can warn you if you are using identifiers that
4912 have not been normalized; this option controls that warning.
4914 There are four levels of warning supported by GCC@.  The default is
4915 @option{-Wnormalized=nfc}, which warns about any identifier that is
4916 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
4917 recommended form for most uses.
4919 Unfortunately, there are some characters allowed in identifiers by
4920 ISO C and ISO C++ that, when turned into NFC, are not allowed in 
4921 identifiers.  That is, there's no way to use these symbols in portable
4922 ISO C or C++ and have all your identifiers in NFC@.
4923 @option{-Wnormalized=id} suppresses the warning for these characters.
4924 It is hoped that future versions of the standards involved will correct
4925 this, which is why this option is not the default.
4927 You can switch the warning off for all characters by writing
4928 @option{-Wnormalized=none}.  You should only do this if you
4929 are using some other normalization scheme (like ``D''), because
4930 otherwise you can easily create bugs that are literally impossible to see.
4932 Some characters in ISO 10646 have distinct meanings but look identical
4933 in some fonts or display methodologies, especially once formatting has
4934 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
4935 LETTER N'', displays just like a regular @code{n} that has been
4936 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
4937 normalization scheme to convert all these into a standard form as
4938 well, and GCC warns if your code is not in NFKC if you use
4939 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
4940 about every identifier that contains the letter O because it might be
4941 confused with the digit 0, and so is not the default, but may be
4942 useful as a local coding convention if the programming environment 
4943 cannot be fixed to display these characters distinctly.
4945 @item -Wno-deprecated
4946 @opindex Wno-deprecated
4947 @opindex Wdeprecated
4948 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
4950 @item -Wno-deprecated-declarations
4951 @opindex Wno-deprecated-declarations
4952 @opindex Wdeprecated-declarations
4953 Do not warn about uses of functions (@pxref{Function Attributes}),
4954 variables (@pxref{Variable Attributes}), and types (@pxref{Type
4955 Attributes}) marked as deprecated by using the @code{deprecated}
4956 attribute.
4958 @item -Wno-overflow
4959 @opindex Wno-overflow
4960 @opindex Woverflow
4961 Do not warn about compile-time overflow in constant expressions.
4963 @item -Wopenmp-simd
4964 @opindex Wopenm-simd
4965 Warn if the vectorizer cost model overrides the OpenMP or the Cilk Plus
4966 simd directive set by user.  The @option{-fsimd-cost-model=unlimited} can
4967 be used to relax the cost model.
4969 @item -Woverride-init @r{(C and Objective-C only)}
4970 @opindex Woverride-init
4971 @opindex Wno-override-init
4972 @opindex W
4973 @opindex Wextra
4974 @opindex Wno-extra
4975 Warn if an initialized field without side effects is overridden when
4976 using designated initializers (@pxref{Designated Inits, , Designated
4977 Initializers}).
4979 This warning is included in @option{-Wextra}.  To get other
4980 @option{-Wextra} warnings without this one, use @option{-Wextra
4981 -Wno-override-init}.
4983 @item -Wpacked
4984 @opindex Wpacked
4985 @opindex Wno-packed
4986 Warn if a structure is given the packed attribute, but the packed
4987 attribute has no effect on the layout or size of the structure.
4988 Such structures may be mis-aligned for little benefit.  For
4989 instance, in this code, the variable @code{f.x} in @code{struct bar}
4990 is misaligned even though @code{struct bar} does not itself
4991 have the packed attribute:
4993 @smallexample
4994 @group
4995 struct foo @{
4996   int x;
4997   char a, b, c, d;
4998 @} __attribute__((packed));
4999 struct bar @{
5000   char z;
5001   struct foo f;
5003 @end group
5004 @end smallexample
5006 @item -Wpacked-bitfield-compat
5007 @opindex Wpacked-bitfield-compat
5008 @opindex Wno-packed-bitfield-compat
5009 The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
5010 on bit-fields of type @code{char}.  This has been fixed in GCC 4.4 but
5011 the change can lead to differences in the structure layout.  GCC
5012 informs you when the offset of such a field has changed in GCC 4.4.
5013 For example there is no longer a 4-bit padding between field @code{a}
5014 and @code{b} in this structure:
5016 @smallexample
5017 struct foo
5019   char a:4;
5020   char b:8;
5021 @} __attribute__ ((packed));
5022 @end smallexample
5024 This warning is enabled by default.  Use
5025 @option{-Wno-packed-bitfield-compat} to disable this warning.
5027 @item -Wpadded
5028 @opindex Wpadded
5029 @opindex Wno-padded
5030 Warn if padding is included in a structure, either to align an element
5031 of the structure or to align the whole structure.  Sometimes when this
5032 happens it is possible to rearrange the fields of the structure to
5033 reduce the padding and so make the structure smaller.
5035 @item -Wredundant-decls
5036 @opindex Wredundant-decls
5037 @opindex Wno-redundant-decls
5038 Warn if anything is declared more than once in the same scope, even in
5039 cases where multiple declaration is valid and changes nothing.
5041 @item -Wnested-externs @r{(C and Objective-C only)}
5042 @opindex Wnested-externs
5043 @opindex Wno-nested-externs
5044 Warn if an @code{extern} declaration is encountered within a function.
5046 @item -Wno-inherited-variadic-ctor
5047 @opindex Winherited-variadic-ctor
5048 @opindex Wno-inherited-variadic-ctor
5049 Suppress warnings about use of C++11 inheriting constructors when the
5050 base class inherited from has a C variadic constructor; the warning is
5051 on by default because the ellipsis is not inherited.
5053 @item -Winline
5054 @opindex Winline
5055 @opindex Wno-inline
5056 Warn if a function that is declared as inline cannot be inlined.
5057 Even with this option, the compiler does not warn about failures to
5058 inline functions declared in system headers.
5060 The compiler uses a variety of heuristics to determine whether or not
5061 to inline a function.  For example, the compiler takes into account
5062 the size of the function being inlined and the amount of inlining
5063 that has already been done in the current function.  Therefore,
5064 seemingly insignificant changes in the source program can cause the
5065 warnings produced by @option{-Winline} to appear or disappear.
5067 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
5068 @opindex Wno-invalid-offsetof
5069 @opindex Winvalid-offsetof
5070 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
5071 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
5072 to a non-POD type is undefined.  In existing C++ implementations,
5073 however, @samp{offsetof} typically gives meaningful results even when
5074 applied to certain kinds of non-POD types (such as a simple
5075 @samp{struct} that fails to be a POD type only by virtue of having a
5076 constructor).  This flag is for users who are aware that they are
5077 writing nonportable code and who have deliberately chosen to ignore the
5078 warning about it.
5080 The restrictions on @samp{offsetof} may be relaxed in a future version
5081 of the C++ standard.
5083 @item -Wno-int-to-pointer-cast
5084 @opindex Wno-int-to-pointer-cast
5085 @opindex Wint-to-pointer-cast
5086 Suppress warnings from casts to pointer type of an integer of a
5087 different size. In C++, casting to a pointer type of smaller size is
5088 an error. @option{Wint-to-pointer-cast} is enabled by default.
5090 @item max-lipo-mem
5091 When importing auxiliary modules during profile-use, check current
5092 memory consumption after parsing each auxiliary module. If it exceeds
5093 this limit (specified in kb), don't import any more auxiliary modules.
5094 Specifying a value of 0 means don't enforce this limit. This parameter
5095 is only useful when using @option{-fprofile-use} and @option{-fripa}.
5097 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
5098 @opindex Wno-pointer-to-int-cast
5099 @opindex Wpointer-to-int-cast
5100 Suppress warnings from casts from a pointer to an integer type of a
5101 different size.
5103 @item -Winvalid-pch
5104 @opindex Winvalid-pch
5105 @opindex Wno-invalid-pch
5106 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
5107 the search path but can't be used.
5109 @item -Wlong-long
5110 @opindex Wlong-long
5111 @opindex Wno-long-long
5112 Warn if @samp{long long} type is used.  This is enabled by either
5113 @option{-Wpedantic} or @option{-Wtraditional} in ISO C90 and C++98
5114 modes.  To inhibit the warning messages, use @option{-Wno-long-long}.
5116 @item -Wvariadic-macros
5117 @opindex Wvariadic-macros
5118 @opindex Wno-variadic-macros
5119 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
5120 alternate syntax when in pedantic ISO C99 mode.  This is default.
5121 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
5123 @item -Wvarargs
5124 @opindex Wvarargs
5125 @opindex Wno-varargs
5126 Warn upon questionable usage of the macros used to handle variable
5127 arguments like @samp{va_start}.  This is default.  To inhibit the
5128 warning messages, use @option{-Wno-varargs}.
5130 @item -Wvector-operation-performance
5131 @opindex Wvector-operation-performance
5132 @opindex Wno-vector-operation-performance
5133 Warn if vector operation is not implemented via SIMD capabilities of the
5134 architecture.  Mainly useful for the performance tuning.
5135 Vector operation can be implemented @code{piecewise}, which means that the
5136 scalar operation is performed on every vector element; 
5137 @code{in parallel}, which means that the vector operation is implemented
5138 using scalars of wider type, which normally is more performance efficient;
5139 and @code{as a single scalar}, which means that vector fits into a
5140 scalar type.
5142 @item -Wno-virtual-move-assign
5143 @opindex Wvirtual-move-assign
5144 @opindex Wno-virtual-move-assign
5145 Suppress warnings about inheriting from a virtual base with a
5146 non-trivial C++11 move assignment operator.  This is dangerous because
5147 if the virtual base is reachable along more than one path, it will be
5148 moved multiple times, which can mean both objects end up in the
5149 moved-from state.  If the move assignment operator is written to avoid
5150 moving from a moved-from object, this warning can be disabled.
5152 @item -Wvla
5153 @opindex Wvla
5154 @opindex Wno-vla
5155 Warn if variable length array is used in the code.
5156 @option{-Wno-vla} prevents the @option{-Wpedantic} warning of
5157 the variable length array.
5159 @item -Wvolatile-register-var
5160 @opindex Wvolatile-register-var
5161 @opindex Wno-volatile-register-var
5162 Warn if a register variable is declared volatile.  The volatile
5163 modifier does not inhibit all optimizations that may eliminate reads
5164 and/or writes to register variables.  This warning is enabled by
5165 @option{-Wall}.
5167 @item -Wdisabled-optimization
5168 @opindex Wdisabled-optimization
5169 @opindex Wno-disabled-optimization
5170 Warn if a requested optimization pass is disabled.  This warning does
5171 not generally indicate that there is anything wrong with your code; it
5172 merely indicates that GCC's optimizers are unable to handle the code
5173 effectively.  Often, the problem is that your code is too big or too
5174 complex; GCC refuses to optimize programs when the optimization
5175 itself is likely to take inordinate amounts of time.
5177 @item -Wpointer-sign @r{(C and Objective-C only)}
5178 @opindex Wpointer-sign
5179 @opindex Wno-pointer-sign
5180 Warn for pointer argument passing or assignment with different signedness.
5181 This option is only supported for C and Objective-C@.  It is implied by
5182 @option{-Wall} and by @option{-Wpedantic}, which can be disabled with
5183 @option{-Wno-pointer-sign}.
5185 @item -Wstack-protector
5186 @opindex Wstack-protector
5187 @opindex Wno-stack-protector
5188 This option is only active when @option{-fstack-protector} is active.  It
5189 warns about functions that are not protected against stack smashing.
5191 @item -Woverlength-strings
5192 @opindex Woverlength-strings
5193 @opindex Wno-overlength-strings
5194 Warn about string constants that are longer than the ``minimum
5195 maximum'' length specified in the C standard.  Modern compilers
5196 generally allow string constants that are much longer than the
5197 standard's minimum limit, but very portable programs should avoid
5198 using longer strings.
5200 The limit applies @emph{after} string constant concatenation, and does
5201 not count the trailing NUL@.  In C90, the limit was 509 characters; in
5202 C99, it was raised to 4095.  C++98 does not specify a normative
5203 minimum maximum, so we do not diagnose overlength strings in C++@.
5205 This option is implied by @option{-Wpedantic}, and can be disabled with
5206 @option{-Wno-overlength-strings}.
5208 @item -Wunsuffixed-float-constants @r{(C and Objective-C only)}
5209 @opindex Wunsuffixed-float-constants
5211 Issue a warning for any floating constant that does not have
5212 a suffix.  When used together with @option{-Wsystem-headers} it
5213 warns about such constants in system header files.  This can be useful
5214 when preparing code to use with the @code{FLOAT_CONST_DECIMAL64} pragma
5215 from the decimal floating-point extension to C99.
5216 @end table
5218 @node Debugging Options
5219 @section Options for Debugging Your Program or GCC
5220 @cindex options, debugging
5221 @cindex debugging information options
5223 GCC has various special options that are used for debugging
5224 either your program or GCC:
5226 @table @gcctabopt
5227 @item -g
5228 @opindex g
5229 Produce debugging information in the operating system's native format
5230 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
5231 information.
5233 On most systems that use stabs format, @option{-g} enables use of extra
5234 debugging information that only GDB can use; this extra information
5235 makes debugging work better in GDB but probably makes other debuggers
5236 crash or
5237 refuse to read the program.  If you want to control for certain whether
5238 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
5239 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
5241 GCC allows you to use @option{-g} with
5242 @option{-O}.  The shortcuts taken by optimized code may occasionally
5243 produce surprising results: some variables you declared may not exist
5244 at all; flow of control may briefly move where you did not expect it;
5245 some statements may not be executed because they compute constant
5246 results or their values are already at hand; some statements may
5247 execute in different places because they have been moved out of loops.
5249 Nevertheless it proves possible to debug optimized output.  This makes
5250 it reasonable to use the optimizer for programs that might have bugs.
5252 The following options are useful when GCC is generated with the
5253 capability for more than one debugging format.
5255 @item -gsplit-dwarf
5256 @opindex gsplit-dwarf
5257 Separate as much dwarf debugging information as possible into a
5258 separate output file with the extension .dwo.  This option allows
5259 the build system to avoid linking files with debug information.  To
5260 be useful, this option requires a debugger capable of reading .dwo
5261 files.
5263 @item -ggdb
5264 @opindex ggdb
5265 Produce debugging information for use by GDB@.  This means to use the
5266 most expressive format available (DWARF 2, stabs, or the native format
5267 if neither of those are supported), including GDB extensions if at all
5268 possible.
5270 @item -gpubnames
5271 @opindex gpubnames
5272 Generate dwarf .debug_pubnames and .debug_pubtypes sections.
5274 @item -ggnu-pubnames
5275 @opindex ggnu-pubnames
5276 Generate .debug_pubnames and .debug_pubtypes sections in a format
5277 suitable for conversion into a GDB@ index.  This option is only useful
5278 with a linker that can produce GDB@ index version 7.
5280 @item -gstabs
5281 @opindex gstabs
5282 Produce debugging information in stabs format (if that is supported),
5283 without GDB extensions.  This is the format used by DBX on most BSD
5284 systems.  On MIPS, Alpha and System V Release 4 systems this option
5285 produces stabs debugging output that is not understood by DBX or SDB@.
5286 On System V Release 4 systems this option requires the GNU assembler.
5288 @item -feliminate-unused-debug-symbols
5289 @opindex feliminate-unused-debug-symbols
5290 Produce debugging information in stabs format (if that is supported),
5291 for only symbols that are actually used.
5293 @item -femit-class-debug-always
5294 Instead of emitting debugging information for a C++ class in only one
5295 object file, emit it in all object files using the class.  This option
5296 should be used only with debuggers that are unable to handle the way GCC
5297 normally emits debugging information for classes because using this
5298 option increases the size of debugging information by as much as a
5299 factor of two.
5301 @item -fdebug-types-section
5302 @opindex fdebug-types-section
5303 @opindex fno-debug-types-section
5304 When using DWARF Version 4 or higher, type DIEs can be put into
5305 their own @code{.debug_types} section instead of making them part of the
5306 @code{.debug_info} section.  It is more efficient to put them in a separate
5307 comdat sections since the linker can then remove duplicates.
5308 But not all DWARF consumers support @code{.debug_types} sections yet
5309 and on some objects @code{.debug_types} produces larger instead of smaller
5310 debugging information.
5312 @item -gstabs+
5313 @opindex gstabs+
5314 Produce debugging information in stabs format (if that is supported),
5315 using GNU extensions understood only by the GNU debugger (GDB)@.  The
5316 use of these extensions is likely to make other debuggers crash or
5317 refuse to read the program.
5319 @item -gcoff
5320 @opindex gcoff
5321 Produce debugging information in COFF format (if that is supported).
5322 This is the format used by SDB on most System V systems prior to
5323 System V Release 4.
5325 @item -gxcoff
5326 @opindex gxcoff
5327 Produce debugging information in XCOFF format (if that is supported).
5328 This is the format used by the DBX debugger on IBM RS/6000 systems.
5330 @item -gxcoff+
5331 @opindex gxcoff+
5332 Produce debugging information in XCOFF format (if that is supported),
5333 using GNU extensions understood only by the GNU debugger (GDB)@.  The
5334 use of these extensions is likely to make other debuggers crash or
5335 refuse to read the program, and may cause assemblers other than the GNU
5336 assembler (GAS) to fail with an error.
5338 @item -gdwarf-@var{version}
5339 @opindex gdwarf-@var{version}
5340 Produce debugging information in DWARF format (if that is supported).
5341 The value of @var{version} may be either 2, 3 or 4; the default version
5342 for most targets is 4.
5344 Note that with DWARF Version 2, some ports require and always
5345 use some non-conflicting DWARF 3 extensions in the unwind tables.
5347 Version 4 may require GDB 7.0 and @option{-fvar-tracking-assignments}
5348 for maximum benefit.
5350 @item -grecord-gcc-switches
5351 @opindex grecord-gcc-switches
5352 This switch causes the command-line options used to invoke the
5353 compiler that may affect code generation to be appended to the
5354 DW_AT_producer attribute in DWARF debugging information.  The options
5355 are concatenated with spaces separating them from each other and from
5356 the compiler version.  See also @option{-frecord-gcc-switches} for another
5357 way of storing compiler options into the object file.  This is the default.
5359 @item -gno-record-gcc-switches
5360 @opindex gno-record-gcc-switches
5361 Disallow appending command-line options to the DW_AT_producer attribute
5362 in DWARF debugging information.
5364 @item -gstrict-dwarf
5365 @opindex gstrict-dwarf
5366 Disallow using extensions of later DWARF standard version than selected
5367 with @option{-gdwarf-@var{version}}.  On most targets using non-conflicting
5368 DWARF extensions from later standard versions is allowed.
5370 @item -gno-strict-dwarf
5371 @opindex gno-strict-dwarf
5372 Allow using extensions of later DWARF standard version than selected with
5373 @option{-gdwarf-@var{version}}.
5375 @item -gvms
5376 @opindex gvms
5377 Produce debugging information in Alpha/VMS debug format (if that is
5378 supported).  This is the format used by DEBUG on Alpha/VMS systems.
5380 @item -g@var{level}
5381 @itemx -ggdb@var{level}
5382 @itemx -gstabs@var{level}
5383 @itemx -gcoff@var{level}
5384 @itemx -gxcoff@var{level}
5385 @itemx -gvms@var{level}
5386 Request debugging information and also use @var{level} to specify how
5387 much information.  The default level is 2.
5389 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
5390 @option{-g}.
5392 Level 1 produces minimal information, enough for making backtraces in
5393 parts of the program that you don't plan to debug.  This includes
5394 descriptions of functions and external variables, and line number
5395 tables, but no information about local variables.
5397 Level 3 includes extra information, such as all the macro definitions
5398 present in the program.  Some debuggers support macro expansion when
5399 you use @option{-g3}.
5401 @option{-gdwarf-2} does not accept a concatenated debug level, because
5402 GCC used to support an option @option{-gdwarf} that meant to generate
5403 debug information in version 1 of the DWARF format (which is very
5404 different from version 2), and it would have been too confusing.  That
5405 debug format is long obsolete, but the option cannot be changed now.
5406 Instead use an additional @option{-g@var{level}} option to change the
5407 debug level for DWARF.
5409 @item -gtoggle
5410 @opindex gtoggle
5411 Turn off generation of debug info, if leaving out this option
5412 generates it, or turn it on at level 2 otherwise.  The position of this
5413 argument in the command line does not matter; it takes effect after all
5414 other options are processed, and it does so only once, no matter how
5415 many times it is given.  This is mainly intended to be used with
5416 @option{-fcompare-debug}.
5418 @item -fsanitize=address
5419 @opindex fsanitize=address
5420 Enable AddressSanitizer, a fast memory error detector.
5421 Memory access instructions will be instrumented to detect
5422 out-of-bounds and use-after-free bugs.
5423 See @uref{http://code.google.com/p/address-sanitizer/} for
5424 more details.  The run-time behavior can be influenced using the
5425 @env{ASAN_OPTIONS} environment variable; see
5426 @url{https://code.google.com/p/address-sanitizer/wiki/Flags#Run-time_flags} for
5427 a list of supported options.
5429 @item -fsanitize=kernel-address
5430 @opindex fsanitize=kernel-address
5431 Enable AddressSanitizer for Linux kernel.
5432 See @uref{http://code.google.com/p/address-sanitizer/wiki/AddressSanitizerForKernel} for more details.
5434 @item -fsanitize=thread
5435 @opindex fsanitize=thread
5436 Enable ThreadSanitizer, a fast data race detector.
5437 Memory access instructions will be instrumented to detect
5438 data race bugs.  See @uref{http://code.google.com/p/thread-sanitizer/} for more
5439 details. The run-time behavior can be influenced using the @env{TSAN_OPTIONS}
5440 environment variable; see
5441 @url{https://code.google.com/p/thread-sanitizer/wiki/Flags} for a list of
5442 supported options.
5444 @item -fsanitize=leak
5445 @opindex fsanitize=leak
5446 Enable LeakSanitizer, a memory leak detector.
5447 This option only matters for linking of executables and if neither
5448 @option{-fsanitize=address} nor @option{-fsanitize=thread} is used.  In that
5449 case it will link the executable against a library that overrides @code{malloc}
5450 and other allocator functions.  See
5451 @uref{https://code.google.com/p/address-sanitizer/wiki/LeakSanitizer} for more
5452 details.  The run-time behavior can be influenced using the
5453 @env{LSAN_OPTIONS} environment variable.
5455 @item -fsanitize=undefined
5456 @opindex fsanitize=undefined
5457 Enable UndefinedBehaviorSanitizer, a fast undefined behavior detector.
5458 Various computations will be instrumented to detect undefined behavior
5459 at runtime.  Current suboptions are:
5461 @table @gcctabopt
5463 @item -fsanitize=shift
5464 @opindex fsanitize=shift
5466 This option enables checking that the result of a shift operation is
5467 not undefined.  Note that what exactly is considered undefined differs
5468 slightly between C and C++, as well as between ISO C90 and C99, etc.
5470 @item -fsanitize=integer-divide-by-zero
5471 @opindex fsanitize=integer-divide-by-zero
5473 Detect integer division by zero as well as @code{INT_MIN / -1} division.
5475 @item -fsanitize=unreachable
5476 @opindex fsanitize=unreachable
5478 With this option, the compiler will turn the @code{__builtin_unreachable}
5479 call into a diagnostics message call instead.  When reaching the
5480 @code{__builtin_unreachable} call, the behavior is undefined.
5482 @item -fsanitize=vla-bound
5483 @opindex fsanitize=vla-bound
5485 This option instructs the compiler to check that the size of a variable
5486 length array is positive.  This option does not have any effect in
5487 @option{-std=c++1y} mode, as the standard requires the exception be thrown
5488 instead.
5490 @item -fsanitize=null
5491 @opindex fsanitize=null
5493 This option enables pointer checking.  Particularly, the application
5494 built with this option turned on will issue an error message when it
5495 tries to dereference a NULL pointer, or if a reference (possibly an
5496 rvalue reference) is bound to a NULL pointer.
5498 @item -fsanitize=return
5499 @opindex fsanitize=return
5501 This option enables return statement checking.  Programs
5502 built with this option turned on will issue an error message
5503 when the end of a non-void function is reached without actually
5504 returning a value.  This option works in C++ only.
5506 @item -fsanitize=signed-integer-overflow
5507 @opindex fsanitize=signed-integer-overflow
5509 This option enables signed integer overflow checking.  We check that
5510 the result of @code{+}, @code{*}, and both unary and binary @code{-}
5511 does not overflow in the signed arithmetics.  Note, integer promotion
5512 rules must be taken into account.  That is, the following is not an
5513 overflow:
5514 @smallexample
5515 signed char a = SCHAR_MAX;
5516 a++;
5517 @end smallexample
5519 @end table
5521 While @option{-ftrapv} causes traps for signed overflows to be emitted,
5522 @option{-fsanitize=undefined} gives a diagnostic message.
5523 This currently works only for the C family of languages.
5525 @item -fdump-final-insns@r{[}=@var{file}@r{]}
5526 @opindex fdump-final-insns
5527 Dump the final internal representation (RTL) to @var{file}.  If the
5528 optional argument is omitted (or if @var{file} is @code{.}), the name
5529 of the dump file is determined by appending @code{.gkd} to the
5530 compilation output file name.
5532 @item -fcompare-debug@r{[}=@var{opts}@r{]}
5533 @opindex fcompare-debug
5534 @opindex fno-compare-debug
5535 If no error occurs during compilation, run the compiler a second time,
5536 adding @var{opts} and @option{-fcompare-debug-second} to the arguments
5537 passed to the second compilation.  Dump the final internal
5538 representation in both compilations, and print an error if they differ.
5540 If the equal sign is omitted, the default @option{-gtoggle} is used.
5542 The environment variable @env{GCC_COMPARE_DEBUG}, if defined, non-empty
5543 and nonzero, implicitly enables @option{-fcompare-debug}.  If
5544 @env{GCC_COMPARE_DEBUG} is defined to a string starting with a dash,
5545 then it is used for @var{opts}, otherwise the default @option{-gtoggle}
5546 is used.
5548 @option{-fcompare-debug=}, with the equal sign but without @var{opts},
5549 is equivalent to @option{-fno-compare-debug}, which disables the dumping
5550 of the final representation and the second compilation, preventing even
5551 @env{GCC_COMPARE_DEBUG} from taking effect.
5553 To verify full coverage during @option{-fcompare-debug} testing, set
5554 @env{GCC_COMPARE_DEBUG} to say @samp{-fcompare-debug-not-overridden},
5555 which GCC rejects as an invalid option in any actual compilation
5556 (rather than preprocessing, assembly or linking).  To get just a
5557 warning, setting @env{GCC_COMPARE_DEBUG} to @samp{-w%n-fcompare-debug
5558 not overridden} will do.
5560 @item -fcompare-debug-second
5561 @opindex fcompare-debug-second
5562 This option is implicitly passed to the compiler for the second
5563 compilation requested by @option{-fcompare-debug}, along with options to
5564 silence warnings, and omitting other options that would cause
5565 side-effect compiler outputs to files or to the standard output.  Dump
5566 files and preserved temporary files are renamed so as to contain the
5567 @code{.gk} additional extension during the second compilation, to avoid
5568 overwriting those generated by the first.
5570 When this option is passed to the compiler driver, it causes the
5571 @emph{first} compilation to be skipped, which makes it useful for little
5572 other than debugging the compiler proper.
5574 @item -feliminate-dwarf2-dups
5575 @opindex feliminate-dwarf2-dups
5576 Compress DWARF 2 debugging information by eliminating duplicated
5577 information about each symbol.  This option only makes sense when
5578 generating DWARF 2 debugging information with @option{-gdwarf-2}.
5580 @item -femit-struct-debug-baseonly
5581 @opindex femit-struct-debug-baseonly
5582 Emit debug information for struct-like types
5583 only when the base name of the compilation source file
5584 matches the base name of file in which the struct is defined.
5586 This option substantially reduces the size of debugging information,
5587 but at significant potential loss in type information to the debugger.
5588 See @option{-femit-struct-debug-reduced} for a less aggressive option.
5589 See @option{-femit-struct-debug-detailed} for more detailed control.
5591 This option works only with DWARF 2.
5593 @item -femit-struct-debug-reduced
5594 @opindex femit-struct-debug-reduced
5595 Emit debug information for struct-like types
5596 only when the base name of the compilation source file
5597 matches the base name of file in which the type is defined,
5598 unless the struct is a template or defined in a system header.
5600 This option significantly reduces the size of debugging information,
5601 with some potential loss in type information to the debugger.
5602 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
5603 See @option{-femit-struct-debug-detailed} for more detailed control.
5605 This option works only with DWARF 2.
5607 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
5608 Specify the struct-like types
5609 for which the compiler generates debug information.
5610 The intent is to reduce duplicate struct debug information
5611 between different object files within the same program.
5613 This option is a detailed version of
5614 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
5615 which serves for most needs.
5617 A specification has the syntax@*
5618 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
5620 The optional first word limits the specification to
5621 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
5622 A struct type is used directly when it is the type of a variable, member.
5623 Indirect uses arise through pointers to structs.
5624 That is, when use of an incomplete struct is valid, the use is indirect.
5625 An example is
5626 @samp{struct one direct; struct two * indirect;}.
5628 The optional second word limits the specification to
5629 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
5630 Generic structs are a bit complicated to explain.
5631 For C++, these are non-explicit specializations of template classes,
5632 or non-template classes within the above.
5633 Other programming languages have generics,
5634 but @option{-femit-struct-debug-detailed} does not yet implement them.
5636 The third word specifies the source files for those
5637 structs for which the compiler should emit debug information.
5638 The values @samp{none} and @samp{any} have the normal meaning.
5639 The value @samp{base} means that
5640 the base of name of the file in which the type declaration appears
5641 must match the base of the name of the main compilation file.
5642 In practice, this means that when compiling @file{foo.c}, debug information
5643 is generated for types declared in that file and @file{foo.h},
5644 but not other header files.
5645 The value @samp{sys} means those types satisfying @samp{base}
5646 or declared in system or compiler headers.
5648 You may need to experiment to determine the best settings for your application.
5650 The default is @option{-femit-struct-debug-detailed=all}.
5652 This option works only with DWARF 2.
5654 @item -fno-merge-debug-strings
5655 @opindex fmerge-debug-strings
5656 @opindex fno-merge-debug-strings
5657 Direct the linker to not merge together strings in the debugging
5658 information that are identical in different object files.  Merging is
5659 not supported by all assemblers or linkers.  Merging decreases the size
5660 of the debug information in the output file at the cost of increasing
5661 link processing time.  Merging is enabled by default.
5663 @item -fdebug-prefix-map=@var{old}=@var{new}
5664 @opindex fdebug-prefix-map
5665 When compiling files in directory @file{@var{old}}, record debugging
5666 information describing them as in @file{@var{new}} instead.
5668 @item -fno-dwarf2-cfi-asm
5669 @opindex fdwarf2-cfi-asm
5670 @opindex fno-dwarf2-cfi-asm
5671 Emit DWARF 2 unwind info as compiler generated @code{.eh_frame} section
5672 instead of using GAS @code{.cfi_*} directives.
5674 @cindex @command{prof}
5675 @item -p
5676 @opindex p
5677 Generate extra code to write profile information suitable for the
5678 analysis program @command{prof}.  You must use this option when compiling
5679 the source files you want data about, and you must also use it when
5680 linking.
5682 @cindex @command{gprof}
5683 @item -pg
5684 @opindex pg
5685 Generate extra code to write profile information suitable for the
5686 analysis program @command{gprof}.  You must use this option when compiling
5687 the source files you want data about, and you must also use it when
5688 linking.
5690 @item -Q
5691 @opindex Q
5692 Makes the compiler print out each function name as it is compiled, and
5693 print some statistics about each pass when it finishes.
5695 @item -ftime-report
5696 @opindex ftime-report
5697 Makes the compiler print some statistics about the time consumed by each
5698 pass when it finishes.
5700 @item -fmem-report
5701 @opindex fmem-report
5702 Makes the compiler print some statistics about permanent memory
5703 allocation when it finishes.
5705 @item -fmem-report-wpa
5706 @opindex fmem-report-wpa
5707 Makes the compiler print some statistics about permanent memory
5708 allocation for the WPA phase only.
5710 @item -fpre-ipa-mem-report
5711 @opindex fpre-ipa-mem-report
5712 @item -fpost-ipa-mem-report
5713 @opindex fpost-ipa-mem-report
5714 Makes the compiler print some statistics about permanent memory
5715 allocation before or after interprocedural optimization.
5717 @item -fprofile-report
5718 @opindex fprofile-report
5719 Makes the compiler print some statistics about consistency of the
5720 (estimated) profile and effect of individual passes.
5722 @item -fstack-usage
5723 @opindex fstack-usage
5724 Makes the compiler output stack usage information for the program, on a
5725 per-function basis.  The filename for the dump is made by appending
5726 @file{.su} to the @var{auxname}.  @var{auxname} is generated from the name of
5727 the output file, if explicitly specified and it is not an executable,
5728 otherwise it is the basename of the source file.  An entry is made up
5729 of three fields:
5731 @itemize
5732 @item
5733 The name of the function.
5734 @item
5735 A number of bytes.
5736 @item
5737 One or more qualifiers: @code{static}, @code{dynamic}, @code{bounded}.
5738 @end itemize
5740 The qualifier @code{static} means that the function manipulates the stack
5741 statically: a fixed number of bytes are allocated for the frame on function
5742 entry and released on function exit; no stack adjustments are otherwise made
5743 in the function.  The second field is this fixed number of bytes.
5745 The qualifier @code{dynamic} means that the function manipulates the stack
5746 dynamically: in addition to the static allocation described above, stack
5747 adjustments are made in the body of the function, for example to push/pop
5748 arguments around function calls.  If the qualifier @code{bounded} is also
5749 present, the amount of these adjustments is bounded at compile time and
5750 the second field is an upper bound of the total amount of stack used by
5751 the function.  If it is not present, the amount of these adjustments is
5752 not bounded at compile time and the second field only represents the
5753 bounded part.
5755 @item -fprofile-arcs
5756 @opindex fprofile-arcs
5757 Add code so that program flow @dfn{arcs} are instrumented.  During
5758 execution the program records how many times each branch and call is
5759 executed and how many times it is taken or returns.  When the compiled
5760 program exits it saves this data to a file called
5761 @file{@var{auxname}.gcda} for each source file.  The data may be used for
5762 profile-directed optimizations (@option{-fbranch-probabilities}), or for
5763 test coverage analysis (@option{-ftest-coverage}).  Each object file's
5764 @var{auxname} is generated from the name of the output file, if
5765 explicitly specified and it is not the final executable, otherwise it is
5766 the basename of the source file.  In both cases any suffix is removed
5767 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
5768 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
5769 @xref{Cross-profiling}.
5771 @cindex @command{gcov}
5772 @item --coverage
5773 @opindex coverage
5775 This option is used to compile and link code instrumented for coverage
5776 analysis.  The option is a synonym for @option{-fprofile-arcs}
5777 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
5778 linking).  See the documentation for those options for more details.
5780 @itemize
5782 @item
5783 Compile the source files with @option{-fprofile-arcs} plus optimization
5784 and code generation options.  For test coverage analysis, use the
5785 additional @option{-ftest-coverage} option.  You do not need to profile
5786 every source file in a program.
5788 @item
5789 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
5790 (the latter implies the former).
5792 @item
5793 Run the program on a representative workload to generate the arc profile
5794 information.  This may be repeated any number of times.  You can run
5795 concurrent instances of your program, and provided that the file system
5796 supports locking, the data files will be correctly updated.  Also
5797 @code{fork} calls are detected and correctly handled (double counting
5798 will not happen).
5800 @item
5801 For profile-directed optimizations, compile the source files again with
5802 the same optimization and code generation options plus
5803 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
5804 Control Optimization}).
5806 @item
5807 For test coverage analysis, use @command{gcov} to produce human readable
5808 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
5809 @command{gcov} documentation for further information.
5811 @end itemize
5813 With @option{-fprofile-arcs}, for each function of your program GCC
5814 creates a program flow graph, then finds a spanning tree for the graph.
5815 Only arcs that are not on the spanning tree have to be instrumented: the
5816 compiler adds code to count the number of times that these arcs are
5817 executed.  When an arc is the only exit or only entrance to a block, the
5818 instrumentation code can be added to the block; otherwise, a new basic
5819 block must be created to hold the instrumentation code.
5821 @need 2000
5822 @item -ftest-coverage
5823 @opindex ftest-coverage
5824 Produce a notes file that the @command{gcov} code-coverage utility
5825 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
5826 show program coverage.  Each source file's note file is called
5827 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
5828 above for a description of @var{auxname} and instructions on how to
5829 generate test coverage data.  Coverage data matches the source files
5830 more closely if you do not optimize.
5832 @item -fdbg-cnt-list
5833 @opindex fdbg-cnt-list
5834 Print the name and the counter upper bound for all debug counters.
5837 @item -fdbg-cnt=@var{counter-value-list}
5838 @opindex fdbg-cnt
5839 Set the internal debug counter upper bound.  @var{counter-value-list}
5840 is a comma-separated list of @var{name}:@var{value} pairs
5841 which sets the upper bound of each debug counter @var{name} to @var{value}.
5842 All debug counters have the initial upper bound of @code{UINT_MAX};
5843 thus @code{dbg_cnt()} returns true always unless the upper bound
5844 is set by this option.
5845 For example, with @option{-fdbg-cnt=dce:10,tail_call:0},
5846 @code{dbg_cnt(dce)} returns true only for first 10 invocations.
5848 @item -fenable-@var{kind}-@var{pass}
5849 @itemx -fdisable-@var{kind}-@var{pass}=@var{range-list}
5850 @opindex fdisable-
5851 @opindex fenable-
5853 This is a set of options that are used to explicitly disable/enable
5854 optimization passes.  These options are intended for use for debugging GCC.
5855 Compiler users should use regular options for enabling/disabling
5856 passes instead.
5858 @table @gcctabopt
5860 @item -fdisable-ipa-@var{pass}
5861 Disable IPA pass @var{pass}. @var{pass} is the pass name.  If the same pass is
5862 statically invoked in the compiler multiple times, the pass name should be
5863 appended with a sequential number starting from 1.
5865 @item -fdisable-rtl-@var{pass}
5866 @itemx -fdisable-rtl-@var{pass}=@var{range-list}
5867 Disable RTL pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
5868 statically invoked in the compiler multiple times, the pass name should be
5869 appended with a sequential number starting from 1.  @var{range-list} is a 
5870 comma-separated list of function ranges or assembler names.  Each range is a number
5871 pair separated by a colon.  The range is inclusive in both ends.  If the range
5872 is trivial, the number pair can be simplified as a single number.  If the
5873 function's call graph node's @var{uid} falls within one of the specified ranges,
5874 the @var{pass} is disabled for that function.  The @var{uid} is shown in the
5875 function header of a dump file, and the pass names can be dumped by using
5876 option @option{-fdump-passes}.
5878 @item -fdisable-tree-@var{pass}
5879 @itemx -fdisable-tree-@var{pass}=@var{range-list}
5880 Disable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description of
5881 option arguments.
5883 @item -fenable-ipa-@var{pass}
5884 Enable IPA pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
5885 statically invoked in the compiler multiple times, the pass name should be
5886 appended with a sequential number starting from 1.
5888 @item -fenable-rtl-@var{pass}
5889 @itemx -fenable-rtl-@var{pass}=@var{range-list}
5890 Enable RTL pass @var{pass}.  See @option{-fdisable-rtl} for option argument
5891 description and examples.
5893 @item -fenable-tree-@var{pass}
5894 @itemx -fenable-tree-@var{pass}=@var{range-list}
5895 Enable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description
5896 of option arguments.
5898 @end table
5900 Here are some examples showing uses of these options.
5902 @smallexample
5904 # disable ccp1 for all functions
5905    -fdisable-tree-ccp1
5906 # disable complete unroll for function whose cgraph node uid is 1
5907    -fenable-tree-cunroll=1
5908 # disable gcse2 for functions at the following ranges [1,1],
5909 # [300,400], and [400,1000]
5910 # disable gcse2 for functions foo and foo2
5911    -fdisable-rtl-gcse2=foo,foo2
5912 # disable early inlining
5913    -fdisable-tree-einline
5914 # disable ipa inlining
5915    -fdisable-ipa-inline
5916 # enable tree full unroll
5917    -fenable-tree-unroll
5919 @end smallexample
5921 @item -d@var{letters}
5922 @itemx -fdump-rtl-@var{pass}
5923 @itemx -fdump-rtl-@var{pass}=@var{filename}
5924 @opindex d
5925 @opindex fdump-rtl-@var{pass}
5926 Says to make debugging dumps during compilation at times specified by
5927 @var{letters}.  This is used for debugging the RTL-based passes of the
5928 compiler.  The file names for most of the dumps are made by appending
5929 a pass number and a word to the @var{dumpname}, and the files are
5930 created in the directory of the output file. In case of
5931 @option{=@var{filename}} option, the dump is output on the given file
5932 instead of the pass numbered dump files. Note that the pass number is
5933 computed statically as passes get registered into the pass manager.
5934 Thus the numbering is not related to the dynamic order of execution of
5935 passes.  In particular, a pass installed by a plugin could have a
5936 number over 200 even if it executed quite early.  @var{dumpname} is
5937 generated from the name of the output file, if explicitly specified
5938 and it is not an executable, otherwise it is the basename of the
5939 source file. These switches may have different effects when
5940 @option{-E} is used for preprocessing.
5942 Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
5943 @option{-d} option @var{letters}.  Here are the possible
5944 letters for use in @var{pass} and @var{letters}, and their meanings:
5946 @table @gcctabopt
5948 @item -fdump-rtl-alignments
5949 @opindex fdump-rtl-alignments
5950 Dump after branch alignments have been computed.
5952 @item -fdump-rtl-asmcons
5953 @opindex fdump-rtl-asmcons
5954 Dump after fixing rtl statements that have unsatisfied in/out constraints.
5956 @item -fdump-rtl-auto_inc_dec
5957 @opindex fdump-rtl-auto_inc_dec
5958 Dump after auto-inc-dec discovery.  This pass is only run on
5959 architectures that have auto inc or auto dec instructions.
5961 @item -fdump-rtl-barriers
5962 @opindex fdump-rtl-barriers
5963 Dump after cleaning up the barrier instructions.
5965 @item -fdump-rtl-bbpart
5966 @opindex fdump-rtl-bbpart
5967 Dump after partitioning hot and cold basic blocks.
5969 @item -fdump-rtl-bbro
5970 @opindex fdump-rtl-bbro
5971 Dump after block reordering.
5973 @item -fdump-rtl-btl1
5974 @itemx -fdump-rtl-btl2
5975 @opindex fdump-rtl-btl2
5976 @opindex fdump-rtl-btl2
5977 @option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
5978 after the two branch
5979 target load optimization passes.
5981 @item -fdump-rtl-bypass
5982 @opindex fdump-rtl-bypass
5983 Dump after jump bypassing and control flow optimizations.
5985 @item -fdump-rtl-combine
5986 @opindex fdump-rtl-combine
5987 Dump after the RTL instruction combination pass.
5989 @item -fdump-rtl-compgotos
5990 @opindex fdump-rtl-compgotos
5991 Dump after duplicating the computed gotos.
5993 @item -fdump-rtl-ce1
5994 @itemx -fdump-rtl-ce2
5995 @itemx -fdump-rtl-ce3
5996 @opindex fdump-rtl-ce1
5997 @opindex fdump-rtl-ce2
5998 @opindex fdump-rtl-ce3
5999 @option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
6000 @option{-fdump-rtl-ce3} enable dumping after the three
6001 if conversion passes.
6003 @item -fdump-rtl-cprop_hardreg
6004 @opindex fdump-rtl-cprop_hardreg
6005 Dump after hard register copy propagation.
6007 @item -fdump-rtl-csa
6008 @opindex fdump-rtl-csa
6009 Dump after combining stack adjustments.
6011 @item -fdump-rtl-cse1
6012 @itemx -fdump-rtl-cse2
6013 @opindex fdump-rtl-cse1
6014 @opindex fdump-rtl-cse2
6015 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
6016 the two common subexpression elimination passes.
6018 @item -fdump-rtl-dce
6019 @opindex fdump-rtl-dce
6020 Dump after the standalone dead code elimination passes.
6022 @item -fdump-rtl-dbr
6023 @opindex fdump-rtl-dbr
6024 Dump after delayed branch scheduling.
6026 @item -fdump-rtl-dce1
6027 @itemx -fdump-rtl-dce2
6028 @opindex fdump-rtl-dce1
6029 @opindex fdump-rtl-dce2
6030 @option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
6031 the two dead store elimination passes.
6033 @item -fdump-rtl-eh
6034 @opindex fdump-rtl-eh
6035 Dump after finalization of EH handling code.
6037 @item -fdump-rtl-eh_ranges
6038 @opindex fdump-rtl-eh_ranges
6039 Dump after conversion of EH handling range regions.
6041 @item -fdump-rtl-expand
6042 @opindex fdump-rtl-expand
6043 Dump after RTL generation.
6045 @item -fdump-rtl-fwprop1
6046 @itemx -fdump-rtl-fwprop2
6047 @opindex fdump-rtl-fwprop1
6048 @opindex fdump-rtl-fwprop2
6049 @option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
6050 dumping after the two forward propagation passes.
6052 @item -fdump-rtl-gcse1
6053 @itemx -fdump-rtl-gcse2
6054 @opindex fdump-rtl-gcse1
6055 @opindex fdump-rtl-gcse2
6056 @option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
6057 after global common subexpression elimination.
6059 @item -fdump-rtl-init-regs
6060 @opindex fdump-rtl-init-regs
6061 Dump after the initialization of the registers.
6063 @item -fdump-rtl-initvals
6064 @opindex fdump-rtl-initvals
6065 Dump after the computation of the initial value sets.
6067 @item -fdump-rtl-into_cfglayout
6068 @opindex fdump-rtl-into_cfglayout
6069 Dump after converting to cfglayout mode.
6071 @item -fdump-rtl-ira
6072 @opindex fdump-rtl-ira
6073 Dump after iterated register allocation.
6075 @item -fdump-rtl-jump
6076 @opindex fdump-rtl-jump
6077 Dump after the second jump optimization.
6079 @item -fdump-rtl-loop2
6080 @opindex fdump-rtl-loop2
6081 @option{-fdump-rtl-loop2} enables dumping after the rtl
6082 loop optimization passes.
6084 @item -fdump-rtl-mach
6085 @opindex fdump-rtl-mach
6086 Dump after performing the machine dependent reorganization pass, if that
6087 pass exists.
6089 @item -fdump-rtl-mode_sw
6090 @opindex fdump-rtl-mode_sw
6091 Dump after removing redundant mode switches.
6093 @item -fdump-rtl-rnreg
6094 @opindex fdump-rtl-rnreg
6095 Dump after register renumbering.
6097 @item -fdump-rtl-outof_cfglayout
6098 @opindex fdump-rtl-outof_cfglayout
6099 Dump after converting from cfglayout mode.
6101 @item -fdump-rtl-peephole2
6102 @opindex fdump-rtl-peephole2
6103 Dump after the peephole pass.
6105 @item -fdump-rtl-postreload
6106 @opindex fdump-rtl-postreload
6107 Dump after post-reload optimizations.
6109 @item -fdump-rtl-pro_and_epilogue
6110 @opindex fdump-rtl-pro_and_epilogue
6111 Dump after generating the function prologues and epilogues.
6113 @item -fdump-rtl-sched1
6114 @itemx -fdump-rtl-sched2
6115 @opindex fdump-rtl-sched1
6116 @opindex fdump-rtl-sched2
6117 @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
6118 after the basic block scheduling passes.
6120 @item -fdump-rtl-ree
6121 @opindex fdump-rtl-ree
6122 Dump after sign/zero extension elimination.
6124 @item -fdump-rtl-seqabstr
6125 @opindex fdump-rtl-seqabstr
6126 Dump after common sequence discovery.
6128 @item -fdump-rtl-shorten
6129 @opindex fdump-rtl-shorten
6130 Dump after shortening branches.
6132 @item -fdump-rtl-sibling
6133 @opindex fdump-rtl-sibling
6134 Dump after sibling call optimizations.
6136 @item -fdump-rtl-split1
6137 @itemx -fdump-rtl-split2
6138 @itemx -fdump-rtl-split3
6139 @itemx -fdump-rtl-split4
6140 @itemx -fdump-rtl-split5
6141 @opindex fdump-rtl-split1
6142 @opindex fdump-rtl-split2
6143 @opindex fdump-rtl-split3
6144 @opindex fdump-rtl-split4
6145 @opindex fdump-rtl-split5
6146 @option{-fdump-rtl-split1}, @option{-fdump-rtl-split2},
6147 @option{-fdump-rtl-split3}, @option{-fdump-rtl-split4} and
6148 @option{-fdump-rtl-split5} enable dumping after five rounds of
6149 instruction splitting.
6151 @item -fdump-rtl-sms
6152 @opindex fdump-rtl-sms
6153 Dump after modulo scheduling.  This pass is only run on some
6154 architectures.
6156 @item -fdump-rtl-stack
6157 @opindex fdump-rtl-stack
6158 Dump after conversion from GCC's ``flat register file'' registers to the
6159 x87's stack-like registers.  This pass is only run on x86 variants.
6161 @item -fdump-rtl-subreg1
6162 @itemx -fdump-rtl-subreg2
6163 @opindex fdump-rtl-subreg1
6164 @opindex fdump-rtl-subreg2
6165 @option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
6166 the two subreg expansion passes.
6168 @item -fdump-rtl-unshare
6169 @opindex fdump-rtl-unshare
6170 Dump after all rtl has been unshared.
6172 @item -fdump-rtl-vartrack
6173 @opindex fdump-rtl-vartrack
6174 Dump after variable tracking.
6176 @item -fdump-rtl-vregs
6177 @opindex fdump-rtl-vregs
6178 Dump after converting virtual registers to hard registers.
6180 @item -fdump-rtl-web
6181 @opindex fdump-rtl-web
6182 Dump after live range splitting.
6184 @item -fdump-rtl-regclass
6185 @itemx -fdump-rtl-subregs_of_mode_init
6186 @itemx -fdump-rtl-subregs_of_mode_finish
6187 @itemx -fdump-rtl-dfinit
6188 @itemx -fdump-rtl-dfinish
6189 @opindex fdump-rtl-regclass
6190 @opindex fdump-rtl-subregs_of_mode_init
6191 @opindex fdump-rtl-subregs_of_mode_finish
6192 @opindex fdump-rtl-dfinit
6193 @opindex fdump-rtl-dfinish
6194 These dumps are defined but always produce empty files.
6196 @item -da
6197 @itemx -fdump-rtl-all
6198 @opindex da
6199 @opindex fdump-rtl-all
6200 Produce all the dumps listed above.
6202 @item -dA
6203 @opindex dA
6204 Annotate the assembler output with miscellaneous debugging information.
6206 @item -dD
6207 @opindex dD
6208 Dump all macro definitions, at the end of preprocessing, in addition to
6209 normal output.
6211 @item -dH
6212 @opindex dH
6213 Produce a core dump whenever an error occurs.
6215 @item -dp
6216 @opindex dp
6217 Annotate the assembler output with a comment indicating which
6218 pattern and alternative is used.  The length of each instruction is
6219 also printed.
6221 @item -dP
6222 @opindex dP
6223 Dump the RTL in the assembler output as a comment before each instruction.
6224 Also turns on @option{-dp} annotation.
6226 @item -dx
6227 @opindex dx
6228 Just generate RTL for a function instead of compiling it.  Usually used
6229 with @option{-fdump-rtl-expand}.
6230 @end table
6232 @item -fdump-noaddr
6233 @opindex fdump-noaddr
6234 When doing debugging dumps, suppress address output.  This makes it more
6235 feasible to use diff on debugging dumps for compiler invocations with
6236 different compiler binaries and/or different
6237 text / bss / data / heap / stack / dso start locations.
6239 @item -fdump-unnumbered
6240 @opindex fdump-unnumbered
6241 When doing debugging dumps, suppress instruction numbers and address output.
6242 This makes it more feasible to use diff on debugging dumps for compiler
6243 invocations with different options, in particular with and without
6244 @option{-g}.
6246 @item -fdump-unnumbered-links
6247 @opindex fdump-unnumbered-links
6248 When doing debugging dumps (see @option{-d} option above), suppress
6249 instruction numbers for the links to the previous and next instructions
6250 in a sequence.
6252 @item -fdump-translation-unit @r{(C++ only)}
6253 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
6254 @opindex fdump-translation-unit
6255 Dump a representation of the tree structure for the entire translation
6256 unit to a file.  The file name is made by appending @file{.tu} to the
6257 source file name, and the file is created in the same directory as the
6258 output file.  If the @samp{-@var{options}} form is used, @var{options}
6259 controls the details of the dump as described for the
6260 @option{-fdump-tree} options.
6262 @item -fdump-class-hierarchy @r{(C++ only)}
6263 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
6264 @opindex fdump-class-hierarchy
6265 Dump a representation of each class's hierarchy and virtual function
6266 table layout to a file.  The file name is made by appending
6267 @file{.class} to the source file name, and the file is created in the
6268 same directory as the output file.  If the @samp{-@var{options}} form
6269 is used, @var{options} controls the details of the dump as described
6270 for the @option{-fdump-tree} options.
6272 @item -fdump-ipa-@var{switch}
6273 @opindex fdump-ipa
6274 Control the dumping at various stages of inter-procedural analysis
6275 language tree to a file.  The file name is generated by appending a
6276 switch specific suffix to the source file name, and the file is created
6277 in the same directory as the output file.  The following dumps are
6278 possible:
6280 @table @samp
6281 @item all
6282 Enables all inter-procedural analysis dumps.
6284 @item cgraph
6285 Dumps information about call-graph optimization, unused function removal,
6286 and inlining decisions.
6288 @item inline
6289 Dump after function inlining.
6291 @end table
6293 @item -fdump-passes
6294 @opindex fdump-passes
6295 Dump the list of optimization passes that are turned on and off by
6296 the current command-line options.
6298 @item -fdump-statistics-@var{option}
6299 @opindex fdump-statistics
6300 Enable and control dumping of pass statistics in a separate file.  The
6301 file name is generated by appending a suffix ending in
6302 @samp{.statistics} to the source file name, and the file is created in
6303 the same directory as the output file.  If the @samp{-@var{option}}
6304 form is used, @samp{-stats} causes counters to be summed over the
6305 whole compilation unit while @samp{-details} dumps every event as
6306 the passes generate them.  The default with no option is to sum
6307 counters for each function compiled.
6309 @item -fdump-tree-@var{switch}
6310 @itemx -fdump-tree-@var{switch}-@var{options}
6311 @itemx -fdump-tree-@var{switch}-@var{options}=@var{filename}
6312 @opindex fdump-tree
6313 Control the dumping at various stages of processing the intermediate
6314 language tree to a file.  The file name is generated by appending a
6315 switch-specific suffix to the source file name, and the file is
6316 created in the same directory as the output file. In case of
6317 @option{=@var{filename}} option, the dump is output on the given file
6318 instead of the auto named dump files.  If the @samp{-@var{options}}
6319 form is used, @var{options} is a list of @samp{-} separated options
6320 which control the details of the dump.  Not all options are applicable
6321 to all dumps; those that are not meaningful are ignored.  The
6322 following options are available
6324 @table @samp
6325 @item address
6326 Print the address of each node.  Usually this is not meaningful as it
6327 changes according to the environment and source file.  Its primary use
6328 is for tying up a dump file with a debug environment.
6329 @item asmname
6330 If @code{DECL_ASSEMBLER_NAME} has been set for a given decl, use that
6331 in the dump instead of @code{DECL_NAME}.  Its primary use is ease of
6332 use working backward from mangled names in the assembly file.
6333 @item slim
6334 When dumping front-end intermediate representations, inhibit dumping
6335 of members of a scope or body of a function merely because that scope
6336 has been reached.  Only dump such items when they are directly reachable
6337 by some other path.
6339 When dumping pretty-printed trees, this option inhibits dumping the
6340 bodies of control structures.
6342 When dumping RTL, print the RTL in slim (condensed) form instead of
6343 the default LISP-like representation.
6344 @item raw
6345 Print a raw representation of the tree.  By default, trees are
6346 pretty-printed into a C-like representation.
6347 @item details
6348 Enable more detailed dumps (not honored by every dump option). Also
6349 include information from the optimization passes.
6350 @item stats
6351 Enable dumping various statistics about the pass (not honored by every dump
6352 option).
6353 @item blocks
6354 Enable showing basic block boundaries (disabled in raw dumps).
6355 @item graph
6356 For each of the other indicated dump files (@option{-fdump-rtl-@var{pass}}),
6357 dump a representation of the control flow graph suitable for viewing with
6358 GraphViz to @file{@var{file}.@var{passid}.@var{pass}.dot}.  Each function in
6359 the file is pretty-printed as a subgraph, so that GraphViz can render them
6360 all in a single plot.
6362 This option currently only works for RTL dumps, and the RTL is always
6363 dumped in slim form.
6364 @item vops
6365 Enable showing virtual operands for every statement.
6366 @item lineno
6367 Enable showing line numbers for statements.
6368 @item uid
6369 Enable showing the unique ID (@code{DECL_UID}) for each variable.
6370 @item verbose
6371 Enable showing the tree dump for each statement.
6372 @item eh
6373 Enable showing the EH region number holding each statement.
6374 @item scev
6375 Enable showing scalar evolution analysis details.
6376 @item optimized
6377 Enable showing optimization information (only available in certain
6378 passes).
6379 @item missed
6380 Enable showing missed optimization information (only available in certain
6381 passes).
6382 @item note
6383 Enable other detailed optimization information (only available in
6384 certain passes).
6385 @item =@var{filename}
6386 Instead of an auto named dump file, output into the given file
6387 name. The file names @file{stdout} and @file{stderr} are treated
6388 specially and are considered already open standard streams. For
6389 example,
6391 @smallexample
6392 gcc -O2 -ftree-vectorize -fdump-tree-vect-blocks=foo.dump
6393      -fdump-tree-pre=stderr file.c
6394 @end smallexample
6396 outputs vectorizer dump into @file{foo.dump}, while the PRE dump is
6397 output on to @file{stderr}. If two conflicting dump filenames are
6398 given for the same pass, then the latter option overrides the earlier
6399 one.
6401 @item all
6402 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
6403 and @option{lineno}.
6405 @item optall
6406 Turn on all optimization options, i.e., @option{optimized},
6407 @option{missed}, and @option{note}.
6408 @end table
6410 The following tree dumps are possible:
6411 @table @samp
6413 @item original
6414 @opindex fdump-tree-original
6415 Dump before any tree based optimization, to @file{@var{file}.original}.
6417 @item optimized
6418 @opindex fdump-tree-optimized
6419 Dump after all tree based optimization, to @file{@var{file}.optimized}.
6421 @item gimple
6422 @opindex fdump-tree-gimple
6423 Dump each function before and after the gimplification pass to a file.  The
6424 file name is made by appending @file{.gimple} to the source file name.
6426 @item cfg
6427 @opindex fdump-tree-cfg
6428 Dump the control flow graph of each function to a file.  The file name is
6429 made by appending @file{.cfg} to the source file name.
6431 @item ch
6432 @opindex fdump-tree-ch
6433 Dump each function after copying loop headers.  The file name is made by
6434 appending @file{.ch} to the source file name.
6436 @item ssa
6437 @opindex fdump-tree-ssa
6438 Dump SSA related information to a file.  The file name is made by appending
6439 @file{.ssa} to the source file name.
6441 @item alias
6442 @opindex fdump-tree-alias
6443 Dump aliasing information for each function.  The file name is made by
6444 appending @file{.alias} to the source file name.
6446 @item ccp
6447 @opindex fdump-tree-ccp
6448 Dump each function after CCP@.  The file name is made by appending
6449 @file{.ccp} to the source file name.
6451 @item storeccp
6452 @opindex fdump-tree-storeccp
6453 Dump each function after STORE-CCP@.  The file name is made by appending
6454 @file{.storeccp} to the source file name.
6456 @item pre
6457 @opindex fdump-tree-pre
6458 Dump trees after partial redundancy elimination.  The file name is made
6459 by appending @file{.pre} to the source file name.
6461 @item fre
6462 @opindex fdump-tree-fre
6463 Dump trees after full redundancy elimination.  The file name is made
6464 by appending @file{.fre} to the source file name.
6466 @item copyprop
6467 @opindex fdump-tree-copyprop
6468 Dump trees after copy propagation.  The file name is made
6469 by appending @file{.copyprop} to the source file name.
6471 @item store_copyprop
6472 @opindex fdump-tree-store_copyprop
6473 Dump trees after store copy-propagation.  The file name is made
6474 by appending @file{.store_copyprop} to the source file name.
6476 @item dce
6477 @opindex fdump-tree-dce
6478 Dump each function after dead code elimination.  The file name is made by
6479 appending @file{.dce} to the source file name.
6481 @item sra
6482 @opindex fdump-tree-sra
6483 Dump each function after performing scalar replacement of aggregates.  The
6484 file name is made by appending @file{.sra} to the source file name.
6486 @item sink
6487 @opindex fdump-tree-sink
6488 Dump each function after performing code sinking.  The file name is made
6489 by appending @file{.sink} to the source file name.
6491 @item dom
6492 @opindex fdump-tree-dom
6493 Dump each function after applying dominator tree optimizations.  The file
6494 name is made by appending @file{.dom} to the source file name.
6496 @item dse
6497 @opindex fdump-tree-dse
6498 Dump each function after applying dead store elimination.  The file
6499 name is made by appending @file{.dse} to the source file name.
6501 @item phiopt
6502 @opindex fdump-tree-phiopt
6503 Dump each function after optimizing PHI nodes into straightline code.  The file
6504 name is made by appending @file{.phiopt} to the source file name.
6506 @item forwprop
6507 @opindex fdump-tree-forwprop
6508 Dump each function after forward propagating single use variables.  The file
6509 name is made by appending @file{.forwprop} to the source file name.
6511 @item copyrename
6512 @opindex fdump-tree-copyrename
6513 Dump each function after applying the copy rename optimization.  The file
6514 name is made by appending @file{.copyrename} to the source file name.
6516 @item nrv
6517 @opindex fdump-tree-nrv
6518 Dump each function after applying the named return value optimization on
6519 generic trees.  The file name is made by appending @file{.nrv} to the source
6520 file name.
6522 @item vect
6523 @opindex fdump-tree-vect
6524 Dump each function after applying vectorization of loops.  The file name is
6525 made by appending @file{.vect} to the source file name.
6527 @item slp
6528 @opindex fdump-tree-slp
6529 Dump each function after applying vectorization of basic blocks.  The file name
6530 is made by appending @file{.slp} to the source file name.
6532 @item vrp
6533 @opindex fdump-tree-vrp
6534 Dump each function after Value Range Propagation (VRP).  The file name
6535 is made by appending @file{.vrp} to the source file name.
6537 @item all
6538 @opindex fdump-tree-all
6539 Enable all the available tree dumps with the flags provided in this option.
6540 @end table
6542 @item -fopt-info
6543 @itemx -fopt-info-@var{options}
6544 @itemx -fopt-info-@var{options}=@var{filename}
6545 @opindex fopt-info
6546 Controls optimization dumps from various optimization passes. If the
6547 @samp{-@var{options}} form is used, @var{options} is a list of
6548 @samp{-} separated options to select the dump details and
6549 optimizations.  If @var{options} is not specified, it defaults to
6550 @option{optimized} for details and @option{optall} for optimization
6551 groups. If the @var{filename} is not specified, it defaults to
6552 @file{stderr}. Note that the output @var{filename} will be overwritten
6553 in case of multiple translation units. If a combined output from
6554 multiple translation units is desired, @file{stderr} should be used
6555 instead.
6557 The options can be divided into two groups, 1) options describing the
6558 verbosity of the dump, and 2) options describing which optimizations
6559 should be included. The options from both the groups can be freely
6560 mixed as they are non-overlapping. However, in case of any conflicts,
6561 the latter options override the earlier options on the command
6562 line. Though multiple -fopt-info options are accepted, only one of
6563 them can have @option{=filename}. If other filenames are provided then
6564 all but the first one are ignored.
6566 The dump verbosity has the following options
6568 @table @samp
6569 @item optimized
6570 Print information when an optimization is successfully applied. It is
6571 up to a pass to decide which information is relevant. For example, the
6572 vectorizer passes print the source location of loops which got
6573 successfully vectorized.
6574 @item missed
6575 Print information about missed optimizations. Individual passes
6576 control which information to include in the output. For example,
6578 @smallexample
6579 gcc -O2 -ftree-vectorize -fopt-info-vec-missed
6580 @end smallexample
6582 will print information about missed optimization opportunities from
6583 vectorization passes on stderr.
6584 @item note
6585 Print verbose information about optimizations, such as certain
6586 transformations, more detailed messages about decisions etc.
6587 @item all
6588 Print detailed optimization information. This includes
6589 @var{optimized}, @var{missed}, and @var{note}.
6590 @end table
6592 The second set of options describes a group of optimizations and may
6593 include one or more of the following.
6595 @table @samp
6596 @item ipa
6597 Enable dumps from all interprocedural optimizations.
6598 @item loop
6599 Enable dumps from all loop optimizations.
6600 @item inline
6601 Enable dumps from all inlining optimizations.
6602 @item vec
6603 Enable dumps from all vectorization optimizations.
6604 @item optall
6605 Enable dumps from all optimizations. This is a superset of
6606 the optimization groups listed above.
6607 @end table
6609 For example,
6610 @smallexample
6611 gcc -O3 -fopt-info-missed=missed.all
6612 @end smallexample
6614 outputs missed optimization report from all the passes into
6615 @file{missed.all}.
6617 As another example,
6618 @smallexample
6619 gcc -O3 -fopt-info-inline-optimized-missed=inline.txt
6620 @end smallexample
6622 will output information about missed optimizations as well as
6623 optimized locations from all the inlining passes into
6624 @file{inline.txt}.
6626 If the @var{filename} is provided, then the dumps from all the
6627 applicable optimizations are concatenated into the @file{filename}.
6628 Otherwise the dump is output onto @file{stderr}. If @var{options} is
6629 omitted, it defaults to @option{all-optall}, which means dump all
6630 available optimization info from all the passes. In the following
6631 example, all optimization info is output on to @file{stderr}.
6633 @smallexample
6634 gcc -O3 -fopt-info
6635 @end smallexample
6637 Note that @option{-fopt-info-vec-missed} behaves the same as
6638 @option{-fopt-info-missed-vec}.
6640 As another example, consider
6642 @smallexample
6643 gcc -fopt-info-vec-missed=vec.miss -fopt-info-loop-optimized=loop.opt
6644 @end smallexample
6646 Here the two output filenames @file{vec.miss} and @file{loop.opt} are
6647 in conflict since only one output file is allowed. In this case, only
6648 the first option takes effect and the subsequent options are
6649 ignored. Thus only the @file{vec.miss} is produced which contains
6650 dumps from the vectorizer about missed opportunities.
6652 @item -frandom-seed=@var{string}
6653 @opindex frandom-seed
6654 This option provides a seed that GCC uses in place of
6655 random numbers in generating certain symbol names
6656 that have to be different in every compiled file.  It is also used to
6657 place unique stamps in coverage data files and the object files that
6658 produce them.  You can use the @option{-frandom-seed} option to produce
6659 reproducibly identical object files.
6661 The @var{string} should be different for every file you compile.
6663 @item -fsched-verbose=@var{n}
6664 @opindex fsched-verbose
6665 On targets that use instruction scheduling, this option controls the
6666 amount of debugging output the scheduler prints.  This information is
6667 written to standard error, unless @option{-fdump-rtl-sched1} or
6668 @option{-fdump-rtl-sched2} is specified, in which case it is output
6669 to the usual dump listing file, @file{.sched1} or @file{.sched2}
6670 respectively.  However for @var{n} greater than nine, the output is
6671 always printed to standard error.
6673 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
6674 same information as @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2}.
6675 For @var{n} greater than one, it also output basic block probabilities,
6676 detailed ready list information and unit/insn info.  For @var{n} greater
6677 than two, it includes RTL at abort point, control-flow and regions info.
6678 And for @var{n} over four, @option{-fsched-verbose} also includes
6679 dependence info.
6681 @item -save-temps
6682 @itemx -save-temps=cwd
6683 @opindex save-temps
6684 Store the usual ``temporary'' intermediate files permanently; place them
6685 in the current directory and name them based on the source file.  Thus,
6686 compiling @file{foo.c} with @option{-c -save-temps} produces files
6687 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
6688 preprocessed @file{foo.i} output file even though the compiler now
6689 normally uses an integrated preprocessor.
6691 When used in combination with the @option{-x} command-line option,
6692 @option{-save-temps} is sensible enough to avoid over writing an
6693 input source file with the same extension as an intermediate file.
6694 The corresponding intermediate file may be obtained by renaming the
6695 source file before using @option{-save-temps}.
6697 If you invoke GCC in parallel, compiling several different source
6698 files that share a common base name in different subdirectories or the
6699 same source file compiled for multiple output destinations, it is
6700 likely that the different parallel compilers will interfere with each
6701 other, and overwrite the temporary files.  For instance:
6703 @smallexample
6704 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
6705 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
6706 @end smallexample
6708 may result in @file{foo.i} and @file{foo.o} being written to
6709 simultaneously by both compilers.
6711 @item -save-temps=obj
6712 @opindex save-temps=obj
6713 Store the usual ``temporary'' intermediate files permanently.  If the
6714 @option{-o} option is used, the temporary files are based on the
6715 object file.  If the @option{-o} option is not used, the
6716 @option{-save-temps=obj} switch behaves like @option{-save-temps}.
6718 For example:
6720 @smallexample
6721 gcc -save-temps=obj -c foo.c
6722 gcc -save-temps=obj -c bar.c -o dir/xbar.o
6723 gcc -save-temps=obj foobar.c -o dir2/yfoobar
6724 @end smallexample
6726 @noindent
6727 creates @file{foo.i}, @file{foo.s}, @file{dir/xbar.i},
6728 @file{dir/xbar.s}, @file{dir2/yfoobar.i}, @file{dir2/yfoobar.s}, and
6729 @file{dir2/yfoobar.o}.
6731 @item -time@r{[}=@var{file}@r{]}
6732 @opindex time
6733 Report the CPU time taken by each subprocess in the compilation
6734 sequence.  For C source files, this is the compiler proper and assembler
6735 (plus the linker if linking is done).
6737 Without the specification of an output file, the output looks like this:
6739 @smallexample
6740 # cc1 0.12 0.01
6741 # as 0.00 0.01
6742 @end smallexample
6744 The first number on each line is the ``user time'', that is time spent
6745 executing the program itself.  The second number is ``system time'',
6746 time spent executing operating system routines on behalf of the program.
6747 Both numbers are in seconds.
6749 With the specification of an output file, the output is appended to the
6750 named file, and it looks like this:
6752 @smallexample
6753 0.12 0.01 cc1 @var{options}
6754 0.00 0.01 as @var{options}
6755 @end smallexample
6757 The ``user time'' and the ``system time'' are moved before the program
6758 name, and the options passed to the program are displayed, so that one
6759 can later tell what file was being compiled, and with which options.
6761 @item -fvar-tracking
6762 @opindex fvar-tracking
6763 Run variable tracking pass.  It computes where variables are stored at each
6764 position in code.  Better debugging information is then generated
6765 (if the debugging information format supports this information).
6767 It is enabled by default when compiling with optimization (@option{-Os},
6768 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
6769 the debug info format supports it.
6771 @item -fvar-tracking-assignments
6772 @opindex fvar-tracking-assignments
6773 @opindex fno-var-tracking-assignments
6774 Annotate assignments to user variables early in the compilation and
6775 attempt to carry the annotations over throughout the compilation all the
6776 way to the end, in an attempt to improve debug information while
6777 optimizing.  Use of @option{-gdwarf-4} is recommended along with it.
6779 It can be enabled even if var-tracking is disabled, in which case
6780 annotations are created and maintained, but discarded at the end.
6782 @item -fvar-tracking-assignments-toggle
6783 @opindex fvar-tracking-assignments-toggle
6784 @opindex fno-var-tracking-assignments-toggle
6785 Toggle @option{-fvar-tracking-assignments}, in the same way that
6786 @option{-gtoggle} toggles @option{-g}.
6788 @item -print-file-name=@var{library}
6789 @opindex print-file-name
6790 Print the full absolute name of the library file @var{library} that
6791 would be used when linking---and don't do anything else.  With this
6792 option, GCC does not compile or link anything; it just prints the
6793 file name.
6795 @item -print-multi-directory
6796 @opindex print-multi-directory
6797 Print the directory name corresponding to the multilib selected by any
6798 other switches present in the command line.  This directory is supposed
6799 to exist in @env{GCC_EXEC_PREFIX}.
6801 @item -print-multi-lib
6802 @opindex print-multi-lib
6803 Print the mapping from multilib directory names to compiler switches
6804 that enable them.  The directory name is separated from the switches by
6805 @samp{;}, and each switch starts with an @samp{@@} instead of the
6806 @samp{-}, without spaces between multiple switches.  This is supposed to
6807 ease shell processing.
6809 @item -print-multi-os-directory
6810 @opindex print-multi-os-directory
6811 Print the path to OS libraries for the selected
6812 multilib, relative to some @file{lib} subdirectory.  If OS libraries are
6813 present in the @file{lib} subdirectory and no multilibs are used, this is
6814 usually just @file{.}, if OS libraries are present in @file{lib@var{suffix}}
6815 sibling directories this prints e.g.@: @file{../lib64}, @file{../lib} or
6816 @file{../lib32}, or if OS libraries are present in @file{lib/@var{subdir}}
6817 subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}.
6819 @item -print-multiarch
6820 @opindex print-multiarch
6821 Print the path to OS libraries for the selected multiarch,
6822 relative to some @file{lib} subdirectory.
6824 @item -print-prog-name=@var{program}
6825 @opindex print-prog-name
6826 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
6828 @item -print-libgcc-file-name
6829 @opindex print-libgcc-file-name
6830 Same as @option{-print-file-name=libgcc.a}.
6832 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
6833 but you do want to link with @file{libgcc.a}.  You can do:
6835 @smallexample
6836 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
6837 @end smallexample
6839 @item -print-search-dirs
6840 @opindex print-search-dirs
6841 Print the name of the configured installation directory and a list of
6842 program and library directories @command{gcc} searches---and don't do anything else.
6844 This is useful when @command{gcc} prints the error message
6845 @samp{installation problem, cannot exec cpp0: No such file or directory}.
6846 To resolve this you either need to put @file{cpp0} and the other compiler
6847 components where @command{gcc} expects to find them, or you can set the environment
6848 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
6849 Don't forget the trailing @samp{/}.
6850 @xref{Environment Variables}.
6852 @item -print-sysroot
6853 @opindex print-sysroot
6854 Print the target sysroot directory that is used during
6855 compilation.  This is the target sysroot specified either at configure
6856 time or using the @option{--sysroot} option, possibly with an extra
6857 suffix that depends on compilation options.  If no target sysroot is
6858 specified, the option prints nothing.
6860 @item -print-sysroot-headers-suffix
6861 @opindex print-sysroot-headers-suffix
6862 Print the suffix added to the target sysroot when searching for
6863 headers, or give an error if the compiler is not configured with such
6864 a suffix---and don't do anything else.
6866 @item -dumpmachine
6867 @opindex dumpmachine
6868 Print the compiler's target machine (for example,
6869 @samp{i686-pc-linux-gnu})---and don't do anything else.
6871 @item -dumpversion
6872 @opindex dumpversion
6873 Print the compiler version (for example, @samp{3.0})---and don't do
6874 anything else.
6876 @item -dumpspecs
6877 @opindex dumpspecs
6878 Print the compiler's built-in specs---and don't do anything else.  (This
6879 is used when GCC itself is being built.)  @xref{Spec Files}.
6881 @item -fno-eliminate-unused-debug-types
6882 @opindex feliminate-unused-debug-types
6883 @opindex fno-eliminate-unused-debug-types
6884 Normally, when producing DWARF 2 output, GCC avoids producing debug symbol 
6885 output for types that are nowhere used in the source file being compiled.
6886 Sometimes it is useful to have GCC emit debugging
6887 information for all types declared in a compilation
6888 unit, regardless of whether or not they are actually used
6889 in that compilation unit, for example 
6890 if, in the debugger, you want to cast a value to a type that is
6891 not actually used in your program (but is declared).  More often,
6892 however, this results in a significant amount of wasted space.
6893 @end table
6895 @node Optimize Options
6896 @section Options That Control Optimization
6897 @cindex optimize options
6898 @cindex options, optimization
6900 These options control various sorts of optimizations.
6902 Without any optimization option, the compiler's goal is to reduce the
6903 cost of compilation and to make debugging produce the expected
6904 results.  Statements are independent: if you stop the program with a
6905 breakpoint between statements, you can then assign a new value to any
6906 variable or change the program counter to any other statement in the
6907 function and get exactly the results you expect from the source
6908 code.
6910 Turning on optimization flags makes the compiler attempt to improve
6911 the performance and/or code size at the expense of compilation time
6912 and possibly the ability to debug the program.
6914 The compiler performs optimization based on the knowledge it has of the
6915 program.  Compiling multiple files at once to a single output file mode allows
6916 the compiler to use information gained from all of the files when compiling
6917 each of them.
6919 Not all optimizations are controlled directly by a flag.  Only
6920 optimizations that have a flag are listed in this section.
6922 Most optimizations are only enabled if an @option{-O} level is set on
6923 the command line.  Otherwise they are disabled, even if individual
6924 optimization flags are specified.
6926 Depending on the target and how GCC was configured, a slightly different
6927 set of optimizations may be enabled at each @option{-O} level than
6928 those listed here.  You can invoke GCC with @option{-Q --help=optimizers}
6929 to find out the exact set of optimizations that are enabled at each level.
6930 @xref{Overall Options}, for examples.
6932 @table @gcctabopt
6933 @item -O
6934 @itemx -O1
6935 @opindex O
6936 @opindex O1
6937 Optimize.  Optimizing compilation takes somewhat more time, and a lot
6938 more memory for a large function.
6940 With @option{-O}, the compiler tries to reduce code size and execution
6941 time, without performing any optimizations that take a great deal of
6942 compilation time.
6944 @option{-O} turns on the following optimization flags:
6945 @gccoptlist{
6946 -fauto-inc-dec @gol
6947 -fcompare-elim @gol
6948 -fcprop-registers @gol
6949 -fdce @gol
6950 -fdefer-pop @gol
6951 -fdelayed-branch @gol
6952 -fdse @gol
6953 -fguess-branch-probability @gol
6954 -fif-conversion2 @gol
6955 -fif-conversion @gol
6956 -fipa-pure-const @gol
6957 -fipa-profile @gol
6958 -fipa-reference @gol
6959 -fmerge-constants
6960 -fsplit-wide-types @gol
6961 -ftree-bit-ccp @gol
6962 -ftree-builtin-call-dce @gol
6963 -ftree-ccp @gol
6964 -ftree-ch @gol
6965 -ftree-copyrename @gol
6966 -ftree-dce @gol
6967 -ftree-dominator-opts @gol
6968 -ftree-dse @gol
6969 -ftree-forwprop @gol
6970 -ftree-fre @gol
6971 -ftree-phiprop @gol
6972 -ftree-slsr @gol
6973 -ftree-sra @gol
6974 -ftree-pta @gol
6975 -ftree-ter @gol
6976 -funit-at-a-time}
6978 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
6979 where doing so does not interfere with debugging.
6981 @item -O2
6982 @opindex O2
6983 Optimize even more.  GCC performs nearly all supported optimizations
6984 that do not involve a space-speed tradeoff.
6985 As compared to @option{-O}, this option increases both compilation time
6986 and the performance of the generated code.
6988 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
6989 also turns on the following optimization flags:
6990 @gccoptlist{-fthread-jumps @gol
6991 -falign-functions  -falign-jumps @gol
6992 -falign-loops  -falign-labels @gol
6993 -fcaller-saves @gol
6994 -fcrossjumping @gol
6995 -fcse-follow-jumps  -fcse-skip-blocks @gol
6996 -fdelete-null-pointer-checks @gol
6997 -fdevirtualize -fdevirtualize-speculatively @gol
6998 -fexpensive-optimizations @gol
6999 -fgcse  -fgcse-lm  @gol
7000 -fhoist-adjacent-loads @gol
7001 -finline-small-functions @gol
7002 -findirect-inlining @gol
7003 -fipa-sra @gol
7004 -fisolate-erroneous-paths-dereference @gol
7005 -foptimize-sibling-calls @gol
7006 -fpartial-inlining @gol
7007 -fpeephole2 @gol
7008 -freorder-blocks  -freorder-functions @gol
7009 -frerun-cse-after-loop  @gol
7010 -fsched-interblock  -fsched-spec @gol
7011 -fschedule-insns  -fschedule-insns2 @gol
7012 -fstrict-aliasing -fstrict-overflow @gol
7013 -ftree-switch-conversion -ftree-tail-merge @gol
7014 -ftree-pre @gol
7015 -ftree-vrp}
7017 Please note the warning under @option{-fgcse} about
7018 invoking @option{-O2} on programs that use computed gotos.
7020 @item -O3
7021 @opindex O3
7022 Optimize yet more.  @option{-O3} turns on all optimizations specified
7023 by @option{-O2} and also turns on the @option{-finline-functions},
7024 @option{-funswitch-loops}, @option{-fpredictive-commoning},
7025 @option{-fgcse-after-reload}, @option{-ftree-loop-vectorize},
7026 @option{-ftree-slp-vectorize}, @option{-fvect-cost-model},
7027 @option{-ftree-partial-pre} and @option{-fipa-cp-clone} options.
7029 @item -O0
7030 @opindex O0
7031 Reduce compilation time and make debugging produce the expected
7032 results.  This is the default.
7034 @item -Os
7035 @opindex Os
7036 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
7037 do not typically increase code size.  It also performs further
7038 optimizations designed to reduce code size.
7040 @option{-Os} disables the following optimization flags:
7041 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
7042 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
7043 -fprefetch-loop-arrays}
7045 @item -Ofast
7046 @opindex Ofast
7047 Disregard strict standards compliance.  @option{-Ofast} enables all
7048 @option{-O3} optimizations.  It also enables optimizations that are not
7049 valid for all standard-compliant programs.
7050 It turns on @option{-ffast-math} and the Fortran-specific
7051 @option{-fno-protect-parens} and @option{-fstack-arrays}.
7053 @item -Og
7054 @opindex Og
7055 Optimize debugging experience.  @option{-Og} enables optimizations
7056 that do not interfere with debugging. It should be the optimization
7057 level of choice for the standard edit-compile-debug cycle, offering
7058 a reasonable level of optimization while maintaining fast compilation
7059 and a good debugging experience.
7061 If you use multiple @option{-O} options, with or without level numbers,
7062 the last such option is the one that is effective.
7063 @end table
7065 Options of the form @option{-f@var{flag}} specify machine-independent
7066 flags.  Most flags have both positive and negative forms; the negative
7067 form of @option{-ffoo} is @option{-fno-foo}.  In the table
7068 below, only one of the forms is listed---the one you typically 
7069 use.  You can figure out the other form by either removing @samp{no-}
7070 or adding it.
7072 The following options control specific optimizations.  They are either
7073 activated by @option{-O} options or are related to ones that are.  You
7074 can use the following flags in the rare cases when ``fine-tuning'' of
7075 optimizations to be performed is desired.
7077 @table @gcctabopt
7078 @item -fno-defer-pop
7079 @opindex fno-defer-pop
7080 Always pop the arguments to each function call as soon as that function
7081 returns.  For machines that must pop arguments after a function call,
7082 the compiler normally lets arguments accumulate on the stack for several
7083 function calls and pops them all at once.
7085 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7087 @item -fforward-propagate
7088 @opindex fforward-propagate
7089 Perform a forward propagation pass on RTL@.  The pass tries to combine two
7090 instructions and checks if the result can be simplified.  If loop unrolling
7091 is active, two passes are performed and the second is scheduled after
7092 loop unrolling.
7094 This option is enabled by default at optimization levels @option{-O},
7095 @option{-O2}, @option{-O3}, @option{-Os}.
7097 @item -ffp-contract=@var{style}
7098 @opindex ffp-contract
7099 @option{-ffp-contract=off} disables floating-point expression contraction.
7100 @option{-ffp-contract=fast} enables floating-point expression contraction
7101 such as forming of fused multiply-add operations if the target has
7102 native support for them.
7103 @option{-ffp-contract=on} enables floating-point expression contraction
7104 if allowed by the language standard.  This is currently not implemented
7105 and treated equal to @option{-ffp-contract=off}.
7107 The default is @option{-ffp-contract=fast}.
7109 @item -fomit-frame-pointer
7110 @opindex fomit-frame-pointer
7111 Don't keep the frame pointer in a register for functions that
7112 don't need one.  This avoids the instructions to save, set up and
7113 restore frame pointers; it also makes an extra register available
7114 in many functions.  @strong{It also makes debugging impossible on
7115 some machines.}
7117 On some machines, such as the VAX, this flag has no effect, because
7118 the standard calling sequence automatically handles the frame pointer
7119 and nothing is saved by pretending it doesn't exist.  The
7120 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
7121 whether a target machine supports this flag.  @xref{Registers,,Register
7122 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
7124 Starting with GCC version 4.6, the default setting (when not optimizing for
7125 size) for 32-bit GNU/Linux x86 and 32-bit Darwin x86 targets has been changed to
7126 @option{-fomit-frame-pointer}.  The default can be reverted to
7127 @option{-fno-omit-frame-pointer} by configuring GCC with the
7128 @option{--enable-frame-pointer} configure option.
7130 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7132 @item -foptimize-sibling-calls
7133 @opindex foptimize-sibling-calls
7134 Optimize sibling and tail recursive calls.
7136 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7138 @item -fno-inline
7139 @opindex fno-inline
7140 Do not expand any functions inline apart from those marked with
7141 the @code{always_inline} attribute.  This is the default when not
7142 optimizing.
7144 Single functions can be exempted from inlining by marking them
7145 with the @code{noinline} attribute.
7147 @item -finline-small-functions
7148 @opindex finline-small-functions
7149 Integrate functions into their callers when their body is smaller than expected
7150 function call code (so overall size of program gets smaller).  The compiler
7151 heuristically decides which functions are simple enough to be worth integrating
7152 in this way.  This inlining applies to all functions, even those not declared
7153 inline.
7155 Enabled at level @option{-O2}.
7157 @item -findirect-inlining
7158 @opindex findirect-inlining
7159 Inline also indirect calls that are discovered to be known at compile
7160 time thanks to previous inlining.  This option has any effect only
7161 when inlining itself is turned on by the @option{-finline-functions}
7162 or @option{-finline-small-functions} options.
7164 Enabled at level @option{-O2}.
7166 @item -finline-functions
7167 @opindex finline-functions
7168 Consider all functions for inlining, even if they are not declared inline.
7169 The compiler heuristically decides which functions are worth integrating
7170 in this way.
7172 If all calls to a given function are integrated, and the function is
7173 declared @code{static}, then the function is normally not output as
7174 assembler code in its own right.
7176 Enabled at level @option{-O3}.
7178 @item -finline-functions-called-once
7179 @opindex finline-functions-called-once
7180 Consider all @code{static} functions called once for inlining into their
7181 caller even if they are not marked @code{inline}.  If a call to a given
7182 function is integrated, then the function is not output as assembler code
7183 in its own right.
7185 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
7187 @item -fearly-inlining
7188 @opindex fearly-inlining
7189 Inline functions marked by @code{always_inline} and functions whose body seems
7190 smaller than the function call overhead early before doing
7191 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
7192 makes profiling significantly cheaper and usually inlining faster on programs
7193 having large chains of nested wrapper functions.
7195 Enabled by default.
7197 @item -fipa-sra
7198 @opindex fipa-sra
7199 Perform interprocedural scalar replacement of aggregates, removal of
7200 unused parameters and replacement of parameters passed by reference
7201 by parameters passed by value.
7203 Enabled at levels @option{-O2}, @option{-O3} and @option{-Os}.
7205 @item -finline-limit=@var{n}
7206 @opindex finline-limit
7207 By default, GCC limits the size of functions that can be inlined.  This flag
7208 allows coarse control of this limit.  @var{n} is the size of functions that
7209 can be inlined in number of pseudo instructions.
7211 Inlining is actually controlled by a number of parameters, which may be
7212 specified individually by using @option{--param @var{name}=@var{value}}.
7213 The @option{-finline-limit=@var{n}} option sets some of these parameters
7214 as follows:
7216 @table @gcctabopt
7217 @item max-inline-insns-single
7218 is set to @var{n}/2.
7219 @item max-inline-insns-auto
7220 is set to @var{n}/2.
7221 @end table
7223 See below for a documentation of the individual
7224 parameters controlling inlining and for the defaults of these parameters.
7226 @emph{Note:} there may be no value to @option{-finline-limit} that results
7227 in default behavior.
7229 @emph{Note:} pseudo instruction represents, in this particular context, an
7230 abstract measurement of function's size.  In no way does it represent a count
7231 of assembly instructions and as such its exact meaning might change from one
7232 release to an another.
7234 @item -fno-keep-inline-dllexport
7235 @opindex -fno-keep-inline-dllexport
7236 This is a more fine-grained version of @option{-fkeep-inline-functions},
7237 which applies only to functions that are declared using the @code{dllexport}
7238 attribute or declspec (@xref{Function Attributes,,Declaring Attributes of
7239 Functions}.)
7241 @item -fkeep-inline-functions
7242 @opindex fkeep-inline-functions
7243 In C, emit @code{static} functions that are declared @code{inline}
7244 into the object file, even if the function has been inlined into all
7245 of its callers.  This switch does not affect functions using the
7246 @code{extern inline} extension in GNU C90@.  In C++, emit any and all
7247 inline functions into the object file.
7249 @item -fkeep-static-consts
7250 @opindex fkeep-static-consts
7251 Emit variables declared @code{static const} when optimization isn't turned
7252 on, even if the variables aren't referenced.
7254 GCC enables this option by default.  If you want to force the compiler to
7255 check if a variable is referenced, regardless of whether or not
7256 optimization is turned on, use the @option{-fno-keep-static-consts} option.
7258 @item -fmerge-constants
7259 @opindex fmerge-constants
7260 Attempt to merge identical constants (string constants and floating-point
7261 constants) across compilation units.
7263 This option is the default for optimized compilation if the assembler and
7264 linker support it.  Use @option{-fno-merge-constants} to inhibit this
7265 behavior.
7267 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7269 @item -fmerge-all-constants
7270 @opindex fmerge-all-constants
7271 Attempt to merge identical constants and identical variables.
7273 This option implies @option{-fmerge-constants}.  In addition to
7274 @option{-fmerge-constants} this considers e.g.@: even constant initialized
7275 arrays or initialized constant variables with integral or floating-point
7276 types.  Languages like C or C++ require each variable, including multiple
7277 instances of the same variable in recursive calls, to have distinct locations,
7278 so using this option results in non-conforming
7279 behavior.
7281 @item -fmodulo-sched
7282 @opindex fmodulo-sched
7283 Perform swing modulo scheduling immediately before the first scheduling
7284 pass.  This pass looks at innermost loops and reorders their
7285 instructions by overlapping different iterations.
7287 @item -fmodulo-sched-allow-regmoves
7288 @opindex fmodulo-sched-allow-regmoves
7289 Perform more aggressive SMS-based modulo scheduling with register moves
7290 allowed.  By setting this flag certain anti-dependences edges are
7291 deleted, which triggers the generation of reg-moves based on the
7292 life-range analysis.  This option is effective only with
7293 @option{-fmodulo-sched} enabled.
7295 @item -fno-branch-count-reg
7296 @opindex fno-branch-count-reg
7297 Do not use ``decrement and branch'' instructions on a count register,
7298 but instead generate a sequence of instructions that decrement a
7299 register, compare it against zero, then branch based upon the result.
7300 This option is only meaningful on architectures that support such
7301 instructions, which include x86, PowerPC, IA-64 and S/390.
7303 The default is @option{-fbranch-count-reg}.
7305 @item -fno-function-cse
7306 @opindex fno-function-cse
7307 Do not put function addresses in registers; make each instruction that
7308 calls a constant function contain the function's address explicitly.
7310 This option results in less efficient code, but some strange hacks
7311 that alter the assembler output may be confused by the optimizations
7312 performed when this option is not used.
7314 The default is @option{-ffunction-cse}
7316 @item -fno-zero-initialized-in-bss
7317 @opindex fno-zero-initialized-in-bss
7318 If the target supports a BSS section, GCC by default puts variables that
7319 are initialized to zero into BSS@.  This can save space in the resulting
7320 code.
7322 This option turns off this behavior because some programs explicitly
7323 rely on variables going to the data section---e.g., so that the
7324 resulting executable can find the beginning of that section and/or make
7325 assumptions based on that.
7327 The default is @option{-fzero-initialized-in-bss}.
7329 @item -fthread-jumps
7330 @opindex fthread-jumps
7331 Perform optimizations that check to see if a jump branches to a
7332 location where another comparison subsumed by the first is found.  If
7333 so, the first branch is redirected to either the destination of the
7334 second branch or a point immediately following it, depending on whether
7335 the condition is known to be true or false.
7337 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7339 @item -fsplit-wide-types
7340 @opindex fsplit-wide-types
7341 When using a type that occupies multiple registers, such as @code{long
7342 long} on a 32-bit system, split the registers apart and allocate them
7343 independently.  This normally generates better code for those types,
7344 but may make debugging more difficult.
7346 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
7347 @option{-Os}.
7349 @item -fcse-follow-jumps
7350 @opindex fcse-follow-jumps
7351 In common subexpression elimination (CSE), scan through jump instructions
7352 when the target of the jump is not reached by any other path.  For
7353 example, when CSE encounters an @code{if} statement with an
7354 @code{else} clause, CSE follows the jump when the condition
7355 tested is false.
7357 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7359 @item -fcse-skip-blocks
7360 @opindex fcse-skip-blocks
7361 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
7362 follow jumps that conditionally skip over blocks.  When CSE
7363 encounters a simple @code{if} statement with no else clause,
7364 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
7365 body of the @code{if}.
7367 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7369 @item -frerun-cse-after-loop
7370 @opindex frerun-cse-after-loop
7371 Re-run common subexpression elimination after loop optimizations are
7372 performed.
7374 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7376 @item -fgcse
7377 @opindex fgcse
7378 Perform a global common subexpression elimination pass.
7379 This pass also performs global constant and copy propagation.
7381 @emph{Note:} When compiling a program using computed gotos, a GCC
7382 extension, you may get better run-time performance if you disable
7383 the global common subexpression elimination pass by adding
7384 @option{-fno-gcse} to the command line.
7386 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7388 @item -fgcse-lm
7389 @opindex fgcse-lm
7390 When @option{-fgcse-lm} is enabled, global common subexpression elimination
7391 attempts to move loads that are only killed by stores into themselves.  This
7392 allows a loop containing a load/store sequence to be changed to a load outside
7393 the loop, and a copy/store within the loop.
7395 Enabled by default when @option{-fgcse} is enabled.
7397 @item -fgcse-sm
7398 @opindex fgcse-sm
7399 When @option{-fgcse-sm} is enabled, a store motion pass is run after
7400 global common subexpression elimination.  This pass attempts to move
7401 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
7402 loops containing a load/store sequence can be changed to a load before
7403 the loop and a store after the loop.
7405 Not enabled at any optimization level.
7407 @item -fgcse-las
7408 @opindex fgcse-las
7409 When @option{-fgcse-las} is enabled, the global common subexpression
7410 elimination pass eliminates redundant loads that come after stores to the
7411 same memory location (both partial and full redundancies).
7413 Not enabled at any optimization level.
7415 @item -fgcse-after-reload
7416 @opindex fgcse-after-reload
7417 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
7418 pass is performed after reload.  The purpose of this pass is to clean up
7419 redundant spilling.
7421 @item -faggressive-loop-optimizations
7422 @opindex faggressive-loop-optimizations
7423 This option tells the loop optimizer to use language constraints to
7424 derive bounds for the number of iterations of a loop.  This assumes that
7425 loop code does not invoke undefined behavior by for example causing signed
7426 integer overflows or out-of-bound array accesses.  The bounds for the
7427 number of iterations of a loop are used to guide loop unrolling and peeling
7428 and loop exit test optimizations.
7429 This option is enabled by default.
7431 @item -funsafe-loop-optimizations
7432 @opindex funsafe-loop-optimizations
7433 This option tells the loop optimizer to assume that loop indices do not
7434 overflow, and that loops with nontrivial exit condition are not
7435 infinite.  This enables a wider range of loop optimizations even if
7436 the loop optimizer itself cannot prove that these assumptions are valid.
7437 If you use @option{-Wunsafe-loop-optimizations}, the compiler warns you
7438 if it finds this kind of loop.
7440 @item -fcrossjumping
7441 @opindex fcrossjumping
7442 Perform cross-jumping transformation.
7443 This transformation unifies equivalent code and saves code size.  The
7444 resulting code may or may not perform better than without cross-jumping.
7446 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7448 @item -fauto-inc-dec
7449 @opindex fauto-inc-dec
7450 Combine increments or decrements of addresses with memory accesses.
7451 This pass is always skipped on architectures that do not have
7452 instructions to support this.  Enabled by default at @option{-O} and
7453 higher on architectures that support this.
7455 @item -fdce
7456 @opindex fdce
7457 Perform dead code elimination (DCE) on RTL@.
7458 Enabled by default at @option{-O} and higher.
7460 @item -fdse
7461 @opindex fdse
7462 Perform dead store elimination (DSE) on RTL@.
7463 Enabled by default at @option{-O} and higher.
7465 @item -fif-conversion
7466 @opindex fif-conversion
7467 Attempt to transform conditional jumps into branch-less equivalents.  This
7468 includes use of conditional moves, min, max, set flags and abs instructions, and
7469 some tricks doable by standard arithmetics.  The use of conditional execution
7470 on chips where it is available is controlled by @code{if-conversion2}.
7472 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7474 @item -fif-conversion2
7475 @opindex fif-conversion2
7476 Use conditional execution (where available) to transform conditional jumps into
7477 branch-less equivalents.
7479 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7481 @item -fdeclone-ctor-dtor
7482 @opindex fdeclone-ctor-dtor
7483 The C++ ABI requires multiple entry points for constructors and
7484 destructors: one for a base subobject, one for a complete object, and
7485 one for a virtual destructor that calls operator delete afterwards.
7486 For a hierarchy with virtual bases, the base and complete variants are
7487 clones, which means two copies of the function.  With this option, the
7488 base and complete variants are changed to be thunks that call a common
7489 implementation.
7491 Enabled by @option{-Os}.
7493 @item -fdelete-null-pointer-checks
7494 @opindex fdelete-null-pointer-checks
7495 Assume that programs cannot safely dereference null pointers, and that
7496 no code or data element resides there.  This enables simple constant
7497 folding optimizations at all optimization levels.  In addition, other
7498 optimization passes in GCC use this flag to control global dataflow
7499 analyses that eliminate useless checks for null pointers; these assume
7500 that if a pointer is checked after it has already been dereferenced,
7501 it cannot be null.
7503 Note however that in some environments this assumption is not true.
7504 Use @option{-fno-delete-null-pointer-checks} to disable this optimization
7505 for programs that depend on that behavior.
7507 Some targets, especially embedded ones, disable this option at all levels.
7508 Otherwise it is enabled at all levels: @option{-O0}, @option{-O1},
7509 @option{-O2}, @option{-O3}, @option{-Os}.  Passes that use the information
7510 are enabled independently at different optimization levels.
7512 @item -fdevirtualize
7513 @opindex fdevirtualize
7514 Attempt to convert calls to virtual functions to direct calls.  This
7515 is done both within a procedure and interprocedurally as part of
7516 indirect inlining (@code{-findirect-inlining}) and interprocedural constant
7517 propagation (@option{-fipa-cp}).
7518 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7520 @item -fdevirtualize-speculatively
7521 @opindex fdevirtualize-speculatively
7522 Attempt to convert calls to virtual functions to speculative direct calls.
7523 Based on the analysis of the type inheritance graph, determine for a given call
7524 the set of likely targets. If the set is small, preferably of size 1, change
7525 the call into an conditional deciding on direct and indirect call.  The
7526 speculative calls enable more optimizations, such as inlining.  When they seem
7527 useless after further optimization, they are converted back into original form.
7529 @item -fexpensive-optimizations
7530 @opindex fexpensive-optimizations
7531 Perform a number of minor optimizations that are relatively expensive.
7533 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7535 @item -free
7536 @opindex free
7537 Attempt to remove redundant extension instructions.  This is especially
7538 helpful for the x86-64 architecture, which implicitly zero-extends in 64-bit
7539 registers after writing to their lower 32-bit half.
7541 Enabled for Alpha, AArch64 and x86 at levels @option{-O2},
7542 @option{-O3}, @option{-Os}.
7544 @item -fno-lifetime-dse
7545 @opindex fno-lifetime-dse
7546 In C++ the value of an object is only affected by changes within its
7547 lifetime: when the constructor begins, the object has an indeterminate
7548 value, and any changes during the lifetime of the object are dead when
7549 the object is destroyed.  Normally dead store elimination will take
7550 advantage of this; if your code relies on the value of the object
7551 storage persisting beyond the lifetime of the object, you can use this
7552 flag to disable this optimization.
7554 @item -flive-range-shrinkage
7555 @opindex flive-range-shrinkage
7556 Attempt to decrease register pressure through register live range
7557 shrinkage.  This is helpful for fast processors with small or moderate
7558 size register sets.
7560 @item -fira-algorithm=@var{algorithm}
7561 Use the specified coloring algorithm for the integrated register
7562 allocator.  The @var{algorithm} argument can be @samp{priority}, which
7563 specifies Chow's priority coloring, or @samp{CB}, which specifies
7564 Chaitin-Briggs coloring.  Chaitin-Briggs coloring is not implemented
7565 for all architectures, but for those targets that do support it, it is
7566 the default because it generates better code.
7568 @item -fira-region=@var{region}
7569 Use specified regions for the integrated register allocator.  The
7570 @var{region} argument should be one of the following:
7572 @table @samp
7574 @item all
7575 Use all loops as register allocation regions.
7576 This can give the best results for machines with a small and/or
7577 irregular register set.
7579 @item mixed
7580 Use all loops except for loops with small register pressure 
7581 as the regions.  This value usually gives
7582 the best results in most cases and for most architectures,
7583 and is enabled by default when compiling with optimization for speed
7584 (@option{-O}, @option{-O2}, @dots{}).
7586 @item one
7587 Use all functions as a single region.  
7588 This typically results in the smallest code size, and is enabled by default for
7589 @option{-Os} or @option{-O0}.
7591 @end table
7593 @item -fira-hoist-pressure
7594 @opindex fira-hoist-pressure
7595 Use IRA to evaluate register pressure in the code hoisting pass for
7596 decisions to hoist expressions.  This option usually results in smaller
7597 code, but it can slow the compiler down.
7599 This option is enabled at level @option{-Os} for all targets.
7601 @item -fira-loop-pressure
7602 @opindex fira-loop-pressure
7603 Use IRA to evaluate register pressure in loops for decisions to move
7604 loop invariants.  This option usually results in generation
7605 of faster and smaller code on machines with large register files (>= 32
7606 registers), but it can slow the compiler down.
7608 This option is enabled at level @option{-O3} for some targets.
7610 @item -fno-ira-share-save-slots
7611 @opindex fno-ira-share-save-slots
7612 Disable sharing of stack slots used for saving call-used hard
7613 registers living through a call.  Each hard register gets a
7614 separate stack slot, and as a result function stack frames are
7615 larger.
7617 @item -fno-ira-share-spill-slots
7618 @opindex fno-ira-share-spill-slots
7619 Disable sharing of stack slots allocated for pseudo-registers.  Each
7620 pseudo-register that does not get a hard register gets a separate
7621 stack slot, and as a result function stack frames are larger.
7623 @item -fira-verbose=@var{n}
7624 @opindex fira-verbose
7625 Control the verbosity of the dump file for the integrated register allocator.
7626 The default value is 5.  If the value @var{n} is greater or equal to 10,
7627 the dump output is sent to stderr using the same format as @var{n} minus 10.
7629 @item -fdelayed-branch
7630 @opindex fdelayed-branch
7631 If supported for the target machine, attempt to reorder instructions
7632 to exploit instruction slots available after delayed branch
7633 instructions.
7635 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7637 @item -fschedule-insns
7638 @opindex fschedule-insns
7639 If supported for the target machine, attempt to reorder instructions to
7640 eliminate execution stalls due to required data being unavailable.  This
7641 helps machines that have slow floating point or memory load instructions
7642 by allowing other instructions to be issued until the result of the load
7643 or floating-point instruction is required.
7645 Enabled at levels @option{-O2}, @option{-O3}.
7647 @item -fschedule-insns2
7648 @opindex fschedule-insns2
7649 Similar to @option{-fschedule-insns}, but requests an additional pass of
7650 instruction scheduling after register allocation has been done.  This is
7651 especially useful on machines with a relatively small number of
7652 registers and where memory load instructions take more than one cycle.
7654 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7656 @item -fno-sched-interblock
7657 @opindex fno-sched-interblock
7658 Don't schedule instructions across basic blocks.  This is normally
7659 enabled by default when scheduling before register allocation, i.e.@:
7660 with @option{-fschedule-insns} or at @option{-O2} or higher.
7662 @item -fno-sched-spec
7663 @opindex fno-sched-spec
7664 Don't allow speculative motion of non-load instructions.  This is normally
7665 enabled by default when scheduling before register allocation, i.e.@:
7666 with @option{-fschedule-insns} or at @option{-O2} or higher.
7668 @item -fsched-pressure
7669 @opindex fsched-pressure
7670 Enable register pressure sensitive insn scheduling before register
7671 allocation.  This only makes sense when scheduling before register
7672 allocation is enabled, i.e.@: with @option{-fschedule-insns} or at
7673 @option{-O2} or higher.  Usage of this option can improve the
7674 generated code and decrease its size by preventing register pressure
7675 increase above the number of available hard registers and subsequent
7676 spills in register allocation.
7678 @item -fsched-spec-load
7679 @opindex fsched-spec-load
7680 Allow speculative motion of some load instructions.  This only makes
7681 sense when scheduling before register allocation, i.e.@: with
7682 @option{-fschedule-insns} or at @option{-O2} or higher.
7684 @item -fsched-spec-load-dangerous
7685 @opindex fsched-spec-load-dangerous
7686 Allow speculative motion of more load instructions.  This only makes
7687 sense when scheduling before register allocation, i.e.@: with
7688 @option{-fschedule-insns} or at @option{-O2} or higher.
7690 @item -fsched-stalled-insns
7691 @itemx -fsched-stalled-insns=@var{n}
7692 @opindex fsched-stalled-insns
7693 Define how many insns (if any) can be moved prematurely from the queue
7694 of stalled insns into the ready list during the second scheduling pass.
7695 @option{-fno-sched-stalled-insns} means that no insns are moved
7696 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
7697 on how many queued insns can be moved prematurely.
7698 @option{-fsched-stalled-insns} without a value is equivalent to
7699 @option{-fsched-stalled-insns=1}.
7701 @item -fsched-stalled-insns-dep
7702 @itemx -fsched-stalled-insns-dep=@var{n}
7703 @opindex fsched-stalled-insns-dep
7704 Define how many insn groups (cycles) are examined for a dependency
7705 on a stalled insn that is a candidate for premature removal from the queue
7706 of stalled insns.  This has an effect only during the second scheduling pass,
7707 and only if @option{-fsched-stalled-insns} is used.
7708 @option{-fno-sched-stalled-insns-dep} is equivalent to
7709 @option{-fsched-stalled-insns-dep=0}.
7710 @option{-fsched-stalled-insns-dep} without a value is equivalent to
7711 @option{-fsched-stalled-insns-dep=1}.
7713 @item -fsched2-use-superblocks
7714 @opindex fsched2-use-superblocks
7715 When scheduling after register allocation, use superblock scheduling.
7716 This allows motion across basic block boundaries,
7717 resulting in faster schedules.  This option is experimental, as not all machine
7718 descriptions used by GCC model the CPU closely enough to avoid unreliable
7719 results from the algorithm.
7721 This only makes sense when scheduling after register allocation, i.e.@: with
7722 @option{-fschedule-insns2} or at @option{-O2} or higher.
7724 @item -fsched-group-heuristic
7725 @opindex fsched-group-heuristic
7726 Enable the group heuristic in the scheduler.  This heuristic favors
7727 the instruction that belongs to a schedule group.  This is enabled
7728 by default when scheduling is enabled, i.e.@: with @option{-fschedule-insns}
7729 or @option{-fschedule-insns2} or at @option{-O2} or higher.
7731 @item -fsched-critical-path-heuristic
7732 @opindex fsched-critical-path-heuristic
7733 Enable the critical-path heuristic in the scheduler.  This heuristic favors
7734 instructions on the critical path.  This is enabled by default when
7735 scheduling is enabled, i.e.@: with @option{-fschedule-insns}
7736 or @option{-fschedule-insns2} or at @option{-O2} or higher.
7738 @item -fsched-spec-insn-heuristic
7739 @opindex fsched-spec-insn-heuristic
7740 Enable the speculative instruction heuristic in the scheduler.  This
7741 heuristic favors speculative instructions with greater dependency weakness.
7742 This is enabled by default when scheduling is enabled, i.e.@:
7743 with @option{-fschedule-insns} or @option{-fschedule-insns2}
7744 or at @option{-O2} or higher.
7746 @item -fsched-rank-heuristic
7747 @opindex fsched-rank-heuristic
7748 Enable the rank heuristic in the scheduler.  This heuristic favors
7749 the instruction belonging to a basic block with greater size or frequency.
7750 This is enabled by default when scheduling is enabled, i.e.@:
7751 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7752 at @option{-O2} or higher.
7754 @item -fsched-last-insn-heuristic
7755 @opindex fsched-last-insn-heuristic
7756 Enable the last-instruction heuristic in the scheduler.  This heuristic
7757 favors the instruction that is less dependent on the last instruction
7758 scheduled.  This is enabled by default when scheduling is enabled,
7759 i.e.@: with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7760 at @option{-O2} or higher.
7762 @item -fsched-dep-count-heuristic
7763 @opindex fsched-dep-count-heuristic
7764 Enable the dependent-count heuristic in the scheduler.  This heuristic
7765 favors the instruction that has more instructions depending on it.
7766 This is enabled by default when scheduling is enabled, i.e.@:
7767 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7768 at @option{-O2} or higher.
7770 @item -freschedule-modulo-scheduled-loops
7771 @opindex freschedule-modulo-scheduled-loops
7772 Modulo scheduling is performed before traditional scheduling.  If a loop
7773 is modulo scheduled, later scheduling passes may change its schedule.  
7774 Use this option to control that behavior.
7776 @item -fselective-scheduling
7777 @opindex fselective-scheduling
7778 Schedule instructions using selective scheduling algorithm.  Selective
7779 scheduling runs instead of the first scheduler pass.
7781 @item -fselective-scheduling2
7782 @opindex fselective-scheduling2
7783 Schedule instructions using selective scheduling algorithm.  Selective
7784 scheduling runs instead of the second scheduler pass.
7786 @item -fsel-sched-pipelining
7787 @opindex fsel-sched-pipelining
7788 Enable software pipelining of innermost loops during selective scheduling.
7789 This option has no effect unless one of @option{-fselective-scheduling} or
7790 @option{-fselective-scheduling2} is turned on.
7792 @item -fsel-sched-pipelining-outer-loops
7793 @opindex fsel-sched-pipelining-outer-loops
7794 When pipelining loops during selective scheduling, also pipeline outer loops.
7795 This option has no effect unless @option{-fsel-sched-pipelining} is turned on.
7797 @item -fshrink-wrap
7798 @opindex fshrink-wrap
7799 Emit function prologues only before parts of the function that need it,
7800 rather than at the top of the function.  This flag is enabled by default at
7801 @option{-O} and higher.
7803 @item -fcaller-saves
7804 @opindex fcaller-saves
7805 Enable allocation of values to registers that are clobbered by
7806 function calls, by emitting extra instructions to save and restore the
7807 registers around such calls.  Such allocation is done only when it
7808 seems to result in better code.
7810 This option is always enabled by default on certain machines, usually
7811 those which have no call-preserved registers to use instead.
7813 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7815 @item -fcombine-stack-adjustments
7816 @opindex fcombine-stack-adjustments
7817 Tracks stack adjustments (pushes and pops) and stack memory references
7818 and then tries to find ways to combine them.
7820 Enabled by default at @option{-O1} and higher.
7822 @item -fconserve-stack
7823 @opindex fconserve-stack
7824 Attempt to minimize stack usage.  The compiler attempts to use less
7825 stack space, even if that makes the program slower.  This option
7826 implies setting the @option{large-stack-frame} parameter to 100
7827 and the @option{large-stack-frame-growth} parameter to 400.
7829 @item -ftree-reassoc
7830 @opindex ftree-reassoc
7831 Perform reassociation on trees.  This flag is enabled by default
7832 at @option{-O} and higher.
7834 @item -ftree-pre
7835 @opindex ftree-pre
7836 Perform partial redundancy elimination (PRE) on trees.  This flag is
7837 enabled by default at @option{-O2} and @option{-O3}.
7839 @item -ftree-partial-pre
7840 @opindex ftree-partial-pre
7841 Make partial redundancy elimination (PRE) more aggressive.  This flag is
7842 enabled by default at @option{-O3}.
7844 @item -ftree-forwprop
7845 @opindex ftree-forwprop
7846 Perform forward propagation on trees.  This flag is enabled by default
7847 at @option{-O} and higher.
7849 @item -ftree-fre
7850 @opindex ftree-fre
7851 Perform full redundancy elimination (FRE) on trees.  The difference
7852 between FRE and PRE is that FRE only considers expressions
7853 that are computed on all paths leading to the redundant computation.
7854 This analysis is faster than PRE, though it exposes fewer redundancies.
7855 This flag is enabled by default at @option{-O} and higher.
7857 @item -ftree-phiprop
7858 @opindex ftree-phiprop
7859 Perform hoisting of loads from conditional pointers on trees.  This
7860 pass is enabled by default at @option{-O} and higher.
7862 @item -fhoist-adjacent-loads
7863 @opindex hoist-adjacent-loads
7864 Speculatively hoist loads from both branches of an if-then-else if the
7865 loads are from adjacent locations in the same structure and the target
7866 architecture has a conditional move instruction.  This flag is enabled
7867 by default at @option{-O2} and higher.
7869 @item -ftree-copy-prop
7870 @opindex ftree-copy-prop
7871 Perform copy propagation on trees.  This pass eliminates unnecessary
7872 copy operations.  This flag is enabled by default at @option{-O} and
7873 higher.
7875 @item -fipa-pure-const
7876 @opindex fipa-pure-const
7877 Discover which functions are pure or constant.
7878 Enabled by default at @option{-O} and higher.
7880 @item -fipa-reference
7881 @opindex fipa-reference
7882 Discover which static variables do not escape the
7883 compilation unit.
7884 Enabled by default at @option{-O} and higher.
7886 @item -fipa-pta
7887 @opindex fipa-pta
7888 Perform interprocedural pointer analysis and interprocedural modification
7889 and reference analysis.  This option can cause excessive memory and
7890 compile-time usage on large compilation units.  It is not enabled by
7891 default at any optimization level.
7893 @item -fipa-profile
7894 @opindex fipa-profile
7895 Perform interprocedural profile propagation.  The functions called only from
7896 cold functions are marked as cold. Also functions executed once (such as
7897 @code{cold}, @code{noreturn}, static constructors or destructors) are identified. Cold
7898 functions and loop less parts of functions executed once are then optimized for
7899 size.
7900 Enabled by default at @option{-O} and higher.
7902 @item -fipa-cp
7903 @opindex fipa-cp
7904 Perform interprocedural constant propagation.
7905 This optimization analyzes the program to determine when values passed
7906 to functions are constants and then optimizes accordingly.
7907 This optimization can substantially increase performance
7908 if the application has constants passed to functions.
7909 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
7911 @item -fipa-cp-clone
7912 @opindex fipa-cp-clone
7913 Perform function cloning to make interprocedural constant propagation stronger.
7914 When enabled, interprocedural constant propagation performs function cloning
7915 when externally visible function can be called with constant arguments.
7916 Because this optimization can create multiple copies of functions,
7917 it may significantly increase code size
7918 (see @option{--param ipcp-unit-growth=@var{value}}).
7919 This flag is enabled by default at @option{-O3}.
7921 @item -fisolate-erroneous-paths-dereference
7922 Detect paths which trigger erroneous or undefined behaviour due to
7923 dereferencing a NULL pointer.  Isolate those paths from the main control
7924 flow and turn the statement with erroneous or undefined behaviour into a trap.
7926 @item -fisolate-erroneous-paths-attribute
7927 Detect paths which trigger erroneous or undefined behaviour due a NULL value
7928 being used in a way which is forbidden by a @code{returns_nonnull} or @code{nonnull}
7929 attribute.  Isolate those paths from the main control flow and turn the
7930 statement with erroneous or undefined behaviour into a trap.  This is not
7931 currently enabled, but may be enabled by @code{-O2} in the future.
7933 @item -ftree-sink
7934 @opindex ftree-sink
7935 Perform forward store motion  on trees.  This flag is
7936 enabled by default at @option{-O} and higher.
7938 @item -ftree-bit-ccp
7939 @opindex ftree-bit-ccp
7940 Perform sparse conditional bit constant propagation on trees and propagate
7941 pointer alignment information.
7942 This pass only operates on local scalar variables and is enabled by default
7943 at @option{-O} and higher.  It requires that @option{-ftree-ccp} is enabled.
7945 @item -ftree-ccp
7946 @opindex ftree-ccp
7947 Perform sparse conditional constant propagation (CCP) on trees.  This
7948 pass only operates on local scalar variables and is enabled by default
7949 at @option{-O} and higher.
7951 @item -ftree-switch-conversion
7952 Perform conversion of simple initializations in a switch to
7953 initializations from a scalar array.  This flag is enabled by default
7954 at @option{-O2} and higher.
7956 @item -ftree-tail-merge
7957 Look for identical code sequences.  When found, replace one with a jump to the
7958 other.  This optimization is known as tail merging or cross jumping.  This flag
7959 is enabled by default at @option{-O2} and higher.  The compilation time
7960 in this pass can
7961 be limited using @option{max-tail-merge-comparisons} parameter and
7962 @option{max-tail-merge-iterations} parameter.
7964 @item -ftree-dce
7965 @opindex ftree-dce
7966 Perform dead code elimination (DCE) on trees.  This flag is enabled by
7967 default at @option{-O} and higher.
7969 @item -ftree-builtin-call-dce
7970 @opindex ftree-builtin-call-dce
7971 Perform conditional dead code elimination (DCE) for calls to built-in functions
7972 that may set @code{errno} but are otherwise side-effect free.  This flag is
7973 enabled by default at @option{-O2} and higher if @option{-Os} is not also
7974 specified.
7976 @item -ftree-dominator-opts
7977 @opindex ftree-dominator-opts
7978 Perform a variety of simple scalar cleanups (constant/copy
7979 propagation, redundancy elimination, range propagation and expression
7980 simplification) based on a dominator tree traversal.  This also
7981 performs jump threading (to reduce jumps to jumps). This flag is
7982 enabled by default at @option{-O} and higher.
7984 @item -ftree-dse
7985 @opindex ftree-dse
7986 Perform dead store elimination (DSE) on trees.  A dead store is a store into
7987 a memory location that is later overwritten by another store without
7988 any intervening loads.  In this case the earlier store can be deleted.  This
7989 flag is enabled by default at @option{-O} and higher.
7991 @item -ftree-ch
7992 @opindex ftree-ch
7993 Perform loop header copying on trees.  This is beneficial since it increases
7994 effectiveness of code motion optimizations.  It also saves one jump.  This flag
7995 is enabled by default at @option{-O} and higher.  It is not enabled
7996 for @option{-Os}, since it usually increases code size.
7998 @item -ftree-loop-optimize
7999 @opindex ftree-loop-optimize
8000 Perform loop optimizations on trees.  This flag is enabled by default
8001 at @option{-O} and higher.
8003 @item -ftree-loop-linear
8004 @opindex ftree-loop-linear
8005 Perform loop interchange transformations on tree.  Same as
8006 @option{-floop-interchange}.  To use this code transformation, GCC has
8007 to be configured with @option{--with-ppl} and @option{--with-cloog} to
8008 enable the Graphite loop transformation infrastructure.
8010 @item -floop-interchange
8011 @opindex floop-interchange
8012 Perform loop interchange transformations on loops.  Interchanging two
8013 nested loops switches the inner and outer loops.  For example, given a
8014 loop like:
8015 @smallexample
8016 DO J = 1, M
8017   DO I = 1, N
8018     A(J, I) = A(J, I) * C
8019   ENDDO
8020 ENDDO
8021 @end smallexample
8022 loop interchange transforms the loop as if it were written:
8023 @smallexample
8024 DO I = 1, N
8025   DO J = 1, M
8026     A(J, I) = A(J, I) * C
8027   ENDDO
8028 ENDDO
8029 @end smallexample
8030 which can be beneficial when @code{N} is larger than the caches,
8031 because in Fortran, the elements of an array are stored in memory
8032 contiguously by column, and the original loop iterates over rows,
8033 potentially creating at each access a cache miss.  This optimization
8034 applies to all the languages supported by GCC and is not limited to
8035 Fortran.  To use this code transformation, GCC has to be configured
8036 with @option{--with-ppl} and @option{--with-cloog} to enable the
8037 Graphite loop transformation infrastructure.
8039 @item -floop-strip-mine
8040 @opindex floop-strip-mine
8041 Perform loop strip mining transformations on loops.  Strip mining
8042 splits a loop into two nested loops.  The outer loop has strides
8043 equal to the strip size and the inner loop has strides of the
8044 original loop within a strip.  The strip length can be changed
8045 using the @option{loop-block-tile-size} parameter.  For example,
8046 given a loop like:
8047 @smallexample
8048 DO I = 1, N
8049   A(I) = A(I) + C
8050 ENDDO
8051 @end smallexample
8052 loop strip mining transforms the loop as if it were written:
8053 @smallexample
8054 DO II = 1, N, 51
8055   DO I = II, min (II + 50, N)
8056     A(I) = A(I) + C
8057   ENDDO
8058 ENDDO
8059 @end smallexample
8060 This optimization applies to all the languages supported by GCC and is
8061 not limited to Fortran.  To use this code transformation, GCC has to
8062 be configured with @option{--with-ppl} and @option{--with-cloog} to
8063 enable the Graphite loop transformation infrastructure.
8065 @item -floop-block
8066 @opindex floop-block
8067 Perform loop blocking transformations on loops.  Blocking strip mines
8068 each loop in the loop nest such that the memory accesses of the
8069 element loops fit inside caches.  The strip length can be changed
8070 using the @option{loop-block-tile-size} parameter.  For example, given
8071 a loop like:
8072 @smallexample
8073 DO I = 1, N
8074   DO J = 1, M
8075     A(J, I) = B(I) + C(J)
8076   ENDDO
8077 ENDDO
8078 @end smallexample
8079 loop blocking transforms the loop as if it were written:
8080 @smallexample
8081 DO II = 1, N, 51
8082   DO JJ = 1, M, 51
8083     DO I = II, min (II + 50, N)
8084       DO J = JJ, min (JJ + 50, M)
8085         A(J, I) = B(I) + C(J)
8086       ENDDO
8087     ENDDO
8088   ENDDO
8089 ENDDO
8090 @end smallexample
8091 which can be beneficial when @code{M} is larger than the caches,
8092 because the innermost loop iterates over a smaller amount of data
8093 which can be kept in the caches.  This optimization applies to all the
8094 languages supported by GCC and is not limited to Fortran.  To use this
8095 code transformation, GCC has to be configured with @option{--with-ppl}
8096 and @option{--with-cloog} to enable the Graphite loop transformation
8097 infrastructure.
8099 @item -fgraphite-identity
8100 @opindex fgraphite-identity
8101 Enable the identity transformation for graphite.  For every SCoP we generate
8102 the polyhedral representation and transform it back to gimple.  Using
8103 @option{-fgraphite-identity} we can check the costs or benefits of the
8104 GIMPLE -> GRAPHITE -> GIMPLE transformation.  Some minimal optimizations
8105 are also performed by the code generator CLooG, like index splitting and
8106 dead code elimination in loops.
8108 @item -floop-nest-optimize
8109 @opindex floop-nest-optimize
8110 Enable the ISL based loop nest optimizer.  This is a generic loop nest
8111 optimizer based on the Pluto optimization algorithms.  It calculates a loop
8112 structure optimized for data-locality and parallelism.  This option
8113 is experimental.
8115 @item -floop-parallelize-all
8116 @opindex floop-parallelize-all
8117 Use the Graphite data dependence analysis to identify loops that can
8118 be parallelized.  Parallelize all the loops that can be analyzed to
8119 not contain loop carried dependences without checking that it is
8120 profitable to parallelize the loops.
8122 @item -fcheck-data-deps
8123 @opindex fcheck-data-deps
8124 Compare the results of several data dependence analyzers.  This option
8125 is used for debugging the data dependence analyzers.
8127 @item -ftree-loop-if-convert
8128 Attempt to transform conditional jumps in the innermost loops to
8129 branch-less equivalents.  The intent is to remove control-flow from
8130 the innermost loops in order to improve the ability of the
8131 vectorization pass to handle these loops.  This is enabled by default
8132 if vectorization is enabled.
8134 @item -ftree-loop-if-convert-stores
8135 Attempt to also if-convert conditional jumps containing memory writes.
8136 This transformation can be unsafe for multi-threaded programs as it
8137 transforms conditional memory writes into unconditional memory writes.
8138 For example,
8139 @smallexample
8140 for (i = 0; i < N; i++)
8141   if (cond)
8142     A[i] = expr;
8143 @end smallexample
8144 is transformed to
8145 @smallexample
8146 for (i = 0; i < N; i++)
8147   A[i] = cond ? expr : A[i];
8148 @end smallexample
8149 potentially producing data races.
8151 @item -ftree-loop-distribution
8152 Perform loop distribution.  This flag can improve cache performance on
8153 big loop bodies and allow further loop optimizations, like
8154 parallelization or vectorization, to take place.  For example, the loop
8155 @smallexample
8156 DO I = 1, N
8157   A(I) = B(I) + C
8158   D(I) = E(I) * F
8159 ENDDO
8160 @end smallexample
8161 is transformed to
8162 @smallexample
8163 DO I = 1, N
8164    A(I) = B(I) + C
8165 ENDDO
8166 DO I = 1, N
8167    D(I) = E(I) * F
8168 ENDDO
8169 @end smallexample
8171 @item -ftree-loop-distribute-patterns
8172 Perform loop distribution of patterns that can be code generated with
8173 calls to a library.  This flag is enabled by default at @option{-O3}.
8175 This pass distributes the initialization loops and generates a call to
8176 memset zero.  For example, the loop
8177 @smallexample
8178 DO I = 1, N
8179   A(I) = 0
8180   B(I) = A(I) + I
8181 ENDDO
8182 @end smallexample
8183 is transformed to
8184 @smallexample
8185 DO I = 1, N
8186    A(I) = 0
8187 ENDDO
8188 DO I = 1, N
8189    B(I) = A(I) + I
8190 ENDDO
8191 @end smallexample
8192 and the initialization loop is transformed into a call to memset zero.
8194 @item -ftree-loop-im
8195 @opindex ftree-loop-im
8196 Perform loop invariant motion on trees.  This pass moves only invariants that
8197 are hard to handle at RTL level (function calls, operations that expand to
8198 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
8199 operands of conditions that are invariant out of the loop, so that we can use
8200 just trivial invariantness analysis in loop unswitching.  The pass also includes
8201 store motion.
8203 @item -ftree-loop-ivcanon
8204 @opindex ftree-loop-ivcanon
8205 Create a canonical counter for number of iterations in loops for which
8206 determining number of iterations requires complicated analysis.  Later
8207 optimizations then may determine the number easily.  Useful especially
8208 in connection with unrolling.
8210 @item -fivopts
8211 @opindex fivopts
8212 Perform induction variable optimizations (strength reduction, induction
8213 variable merging and induction variable elimination) on trees.
8215 @item -ftree-parallelize-loops=n
8216 @opindex ftree-parallelize-loops
8217 Parallelize loops, i.e., split their iteration space to run in n threads.
8218 This is only possible for loops whose iterations are independent
8219 and can be arbitrarily reordered.  The optimization is only
8220 profitable on multiprocessor machines, for loops that are CPU-intensive,
8221 rather than constrained e.g.@: by memory bandwidth.  This option
8222 implies @option{-pthread}, and thus is only supported on targets
8223 that have support for @option{-pthread}.
8225 @item -ftree-pta
8226 @opindex ftree-pta
8227 Perform function-local points-to analysis on trees.  This flag is
8228 enabled by default at @option{-O} and higher.
8230 @item -ftree-sra
8231 @opindex ftree-sra
8232 Perform scalar replacement of aggregates.  This pass replaces structure
8233 references with scalars to prevent committing structures to memory too
8234 early.  This flag is enabled by default at @option{-O} and higher.
8236 @item -ftree-copyrename
8237 @opindex ftree-copyrename
8238 Perform copy renaming on trees.  This pass attempts to rename compiler
8239 temporaries to other variables at copy locations, usually resulting in
8240 variable names which more closely resemble the original variables.  This flag
8241 is enabled by default at @option{-O} and higher.
8243 @item -ftree-coalesce-inlined-vars
8244 @opindex ftree-coalesce-inlined-vars
8245 Tell the copyrename pass (see @option{-ftree-copyrename}) to attempt to
8246 combine small user-defined variables too, but only if they were inlined
8247 from other functions.  It is a more limited form of
8248 @option{-ftree-coalesce-vars}.  This may harm debug information of such
8249 inlined variables, but it will keep variables of the inlined-into
8250 function apart from each other, such that they are more likely to
8251 contain the expected values in a debugging session.  This was the
8252 default in GCC versions older than 4.7.
8254 @item -ftree-coalesce-vars
8255 @opindex ftree-coalesce-vars
8256 Tell the copyrename pass (see @option{-ftree-copyrename}) to attempt to
8257 combine small user-defined variables too, instead of just compiler
8258 temporaries.  This may severely limit the ability to debug an optimized
8259 program compiled with @option{-fno-var-tracking-assignments}.  In the
8260 negated form, this flag prevents SSA coalescing of user variables,
8261 including inlined ones.  This option is enabled by default.
8263 @item -ftree-ter
8264 @opindex ftree-ter
8265 Perform temporary expression replacement during the SSA->normal phase.  Single
8266 use/single def temporaries are replaced at their use location with their
8267 defining expression.  This results in non-GIMPLE code, but gives the expanders
8268 much more complex trees to work on resulting in better RTL generation.  This is
8269 enabled by default at @option{-O} and higher.
8271 @item -ftree-slsr
8272 @opindex ftree-slsr
8273 Perform straight-line strength reduction on trees.  This recognizes related
8274 expressions involving multiplications and replaces them by less expensive
8275 calculations when possible.  This is enabled by default at @option{-O} and
8276 higher.
8278 @item -ftree-vectorize
8279 @opindex ftree-vectorize
8280 Perform vectorization on trees. This flag enables @option{-ftree-loop-vectorize}
8281 and @option{-ftree-slp-vectorize} if not explicitly specified.
8283 @item -ftree-loop-vectorize
8284 @opindex ftree-loop-vectorize
8285 Perform loop vectorization on trees. This flag is enabled by default at
8286 @option{-O3} and when @option{-ftree-vectorize} is enabled.
8288 @item -ftree-slp-vectorize
8289 @opindex ftree-slp-vectorize
8290 Perform basic block vectorization on trees. This flag is enabled by default at
8291 @option{-O3} and when @option{-ftree-vectorize} is enabled.
8293 @item -fvect-cost-model=@var{model}
8294 @opindex fvect-cost-model
8295 Alter the cost model used for vectorization.  The @var{model} argument
8296 should be one of @code{unlimited}, @code{dynamic} or @code{cheap}.
8297 With the @code{unlimited} model the vectorized code-path is assumed
8298 to be profitable while with the @code{dynamic} model a runtime check
8299 will guard the vectorized code-path to enable it only for iteration
8300 counts that will likely execute faster than when executing the original
8301 scalar loop.  The @code{cheap} model will disable vectorization of
8302 loops where doing so would be cost prohibitive for example due to
8303 required runtime checks for data dependence or alignment but otherwise
8304 is equal to the @code{dynamic} model.
8305 The default cost model depends on other optimization flags and is
8306 either @code{dynamic} or @code{cheap}.
8308 @item -fsimd-cost-model=@var{model}
8309 @opindex fsimd-cost-model
8310 Alter the cost model used for vectorization of loops marked with the OpenMP
8311 or Cilk Plus simd directive.  The @var{model} argument should be one of
8312 @code{unlimited}, @code{dynamic}, @code{cheap}.  All values of @var{model}
8313 have the same meaning as described in @option{-fvect-cost-model} and by
8314 default a cost model defined with @option{-fvect-cost-model} is used.
8316 @item -ftree-vrp
8317 @opindex ftree-vrp
8318 Perform Value Range Propagation on trees.  This is similar to the
8319 constant propagation pass, but instead of values, ranges of values are
8320 propagated.  This allows the optimizers to remove unnecessary range
8321 checks like array bound checks and null pointer checks.  This is
8322 enabled by default at @option{-O2} and higher.  Null pointer check
8323 elimination is only done if @option{-fdelete-null-pointer-checks} is
8324 enabled.
8326 @item -ftracer
8327 @opindex ftracer
8328 Perform tail duplication to enlarge superblock size.  This transformation
8329 simplifies the control flow of the function allowing other optimizations to do
8330 a better job.
8332 @item -funroll-loops
8333 @opindex funroll-loops
8334 Unroll loops whose number of iterations can be determined at compile
8335 time or upon entry to the loop.  @option{-funroll-loops} implies
8336 @option{-frerun-cse-after-loop}.  This option makes code larger,
8337 and may or may not make it run faster.
8339 @item -funroll-all-loops
8340 @opindex funroll-all-loops
8341 Unroll all loops, even if their number of iterations is uncertain when
8342 the loop is entered.  This usually makes programs run more slowly.
8343 @option{-funroll-all-loops} implies the same options as
8344 @option{-funroll-loops},
8346 @item -fsplit-ivs-in-unroller
8347 @opindex fsplit-ivs-in-unroller
8348 Enables expression of values of induction variables in later iterations
8349 of the unrolled loop using the value in the first iteration.  This breaks
8350 long dependency chains, thus improving efficiency of the scheduling passes.
8352 A combination of @option{-fweb} and CSE is often sufficient to obtain the
8353 same effect.  However, that is not reliable in cases where the loop body
8354 is more complicated than a single basic block.  It also does not work at all
8355 on some architectures due to restrictions in the CSE pass.
8357 This optimization is enabled by default.
8359 @item -fvariable-expansion-in-unroller
8360 @opindex fvariable-expansion-in-unroller
8361 With this option, the compiler creates multiple copies of some
8362 local variables when unrolling a loop, which can result in superior code.
8364 @item -fpartial-inlining
8365 @opindex fpartial-inlining
8366 Inline parts of functions.  This option has any effect only
8367 when inlining itself is turned on by the @option{-finline-functions}
8368 or @option{-finline-small-functions} options.
8370 Enabled at level @option{-O2}.
8372 @item -fpredictive-commoning
8373 @opindex fpredictive-commoning
8374 Perform predictive commoning optimization, i.e., reusing computations
8375 (especially memory loads and stores) performed in previous
8376 iterations of loops.
8378 This option is enabled at level @option{-O3}.
8380 @item -fprefetch-loop-arrays
8381 @opindex fprefetch-loop-arrays
8382 If supported by the target machine, generate instructions to prefetch
8383 memory to improve the performance of loops that access large arrays.
8385 This option may generate better or worse code; results are highly
8386 dependent on the structure of loops within the source code.
8388 Disabled at level @option{-Os}.
8390 @item -fno-peephole
8391 @itemx -fno-peephole2
8392 @opindex fno-peephole
8393 @opindex fno-peephole2
8394 Disable any machine-specific peephole optimizations.  The difference
8395 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
8396 are implemented in the compiler; some targets use one, some use the
8397 other, a few use both.
8399 @option{-fpeephole} is enabled by default.
8400 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8402 @item -fno-guess-branch-probability
8403 @opindex fno-guess-branch-probability
8404 Do not guess branch probabilities using heuristics.
8406 GCC uses heuristics to guess branch probabilities if they are
8407 not provided by profiling feedback (@option{-fprofile-arcs}).  These
8408 heuristics are based on the control flow graph.  If some branch probabilities
8409 are specified by @samp{__builtin_expect}, then the heuristics are
8410 used to guess branch probabilities for the rest of the control flow graph,
8411 taking the @samp{__builtin_expect} info into account.  The interactions
8412 between the heuristics and @samp{__builtin_expect} can be complex, and in
8413 some cases, it may be useful to disable the heuristics so that the effects
8414 of @samp{__builtin_expect} are easier to understand.
8416 The default is @option{-fguess-branch-probability} at levels
8417 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8419 @item -freorder-blocks
8420 @opindex freorder-blocks
8421 Reorder basic blocks in the compiled function in order to reduce number of
8422 taken branches and improve code locality.
8424 Enabled at levels @option{-O2}, @option{-O3}.
8426 @item -freorder-blocks-and-partition
8427 @opindex freorder-blocks-and-partition
8428 In addition to reordering basic blocks in the compiled function, in order
8429 to reduce number of taken branches, partitions hot and cold basic blocks
8430 into separate sections of the assembly and .o files, to improve
8431 paging and cache locality performance.
8433 This optimization is automatically turned off in the presence of
8434 exception handling, for linkonce sections, for functions with a user-defined
8435 section attribute and on any architecture that does not support named
8436 sections.
8438 Enabled for x86 at levels @option{-O2}, @option{-O3}.
8440 @item -freorder-functions
8441 @opindex freorder-functions
8442 Reorder functions in the object file in order to
8443 improve code locality.  This is implemented by using special
8444 subsections @code{.text.hot} for most frequently executed functions and
8445 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
8446 the linker so object file format must support named sections and linker must
8447 place them in a reasonable way.
8449 Also profile feedback must be available to make this option effective.  See
8450 @option{-fprofile-arcs} for details.
8452 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8454 @item -freorder-functions=@var{alg}
8455 @opindex freorder-functions
8456 This invokes a linker plugin that globally reorders functions in the final binary according to the algorithm specified. Currently, only one type of reordering is supported, @code{callgraph}.  This algorithm places functions that are connected by hot callgraph edges closer.  This option also enables @option{-ffunction-sections}.  Also, profile feedback must be available to makes this option effective.  This option emits callgraph edge profile information in special sections named .gnu.callgraph.text. The params variable "gnu-cgraph-section-edge-threshold" can be used to only list edges above a certain threshold.
8458 @item -fstrict-aliasing
8459 @opindex fstrict-aliasing
8460 Allow the compiler to assume the strictest aliasing rules applicable to
8461 the language being compiled.  For C (and C++), this activates
8462 optimizations based on the type of expressions.  In particular, an
8463 object of one type is assumed never to reside at the same address as an
8464 object of a different type, unless the types are almost the same.  For
8465 example, an @code{unsigned int} can alias an @code{int}, but not a
8466 @code{void*} or a @code{double}.  A character type may alias any other
8467 type.
8469 @anchor{Type-punning}Pay special attention to code like this:
8470 @smallexample
8471 union a_union @{
8472   int i;
8473   double d;
8476 int f() @{
8477   union a_union t;
8478   t.d = 3.0;
8479   return t.i;
8481 @end smallexample
8482 The practice of reading from a different union member than the one most
8483 recently written to (called ``type-punning'') is common.  Even with
8484 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
8485 is accessed through the union type.  So, the code above works as
8486 expected.  @xref{Structures unions enumerations and bit-fields
8487 implementation}.  However, this code might not:
8488 @smallexample
8489 int f() @{
8490   union a_union t;
8491   int* ip;
8492   t.d = 3.0;
8493   ip = &t.i;
8494   return *ip;
8496 @end smallexample
8498 Similarly, access by taking the address, casting the resulting pointer
8499 and dereferencing the result has undefined behavior, even if the cast
8500 uses a union type, e.g.:
8501 @smallexample
8502 int f() @{
8503   double d = 3.0;
8504   return ((union a_union *) &d)->i;
8506 @end smallexample
8508 The @option{-fstrict-aliasing} option is enabled at levels
8509 @option{-O2}, @option{-O3}, @option{-Os}.
8511 @item -fstrict-overflow
8512 @opindex fstrict-overflow
8513 Allow the compiler to assume strict signed overflow rules, depending
8514 on the language being compiled.  For C (and C++) this means that
8515 overflow when doing arithmetic with signed numbers is undefined, which
8516 means that the compiler may assume that it does not happen.  This
8517 permits various optimizations.  For example, the compiler assumes
8518 that an expression like @code{i + 10 > i} is always true for
8519 signed @code{i}.  This assumption is only valid if signed overflow is
8520 undefined, as the expression is false if @code{i + 10} overflows when
8521 using twos complement arithmetic.  When this option is in effect any
8522 attempt to determine whether an operation on signed numbers 
8523 overflows must be written carefully to not actually involve overflow.
8525 This option also allows the compiler to assume strict pointer
8526 semantics: given a pointer to an object, if adding an offset to that
8527 pointer does not produce a pointer to the same object, the addition is
8528 undefined.  This permits the compiler to conclude that @code{p + u >
8529 p} is always true for a pointer @code{p} and unsigned integer
8530 @code{u}.  This assumption is only valid because pointer wraparound is
8531 undefined, as the expression is false if @code{p + u} overflows using
8532 twos complement arithmetic.
8534 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
8535 that integer signed overflow is fully defined: it wraps.  When
8536 @option{-fwrapv} is used, there is no difference between
8537 @option{-fstrict-overflow} and @option{-fno-strict-overflow} for
8538 integers.  With @option{-fwrapv} certain types of overflow are
8539 permitted.  For example, if the compiler gets an overflow when doing
8540 arithmetic on constants, the overflowed value can still be used with
8541 @option{-fwrapv}, but not otherwise.
8543 The @option{-fstrict-overflow} option is enabled at levels
8544 @option{-O2}, @option{-O3}, @option{-Os}.
8546 @item -falign-functions
8547 @itemx -falign-functions=@var{n}
8548 @opindex falign-functions
8549 Align the start of functions to the next power-of-two greater than
8550 @var{n}, skipping up to @var{n} bytes.  For instance,
8551 @option{-falign-functions=32} aligns functions to the next 32-byte
8552 boundary, but @option{-falign-functions=24} aligns to the next
8553 32-byte boundary only if this can be done by skipping 23 bytes or less.
8555 @option{-fno-align-functions} and @option{-falign-functions=1} are
8556 equivalent and mean that functions are not aligned.
8558 Some assemblers only support this flag when @var{n} is a power of two;
8559 in that case, it is rounded up.
8561 If @var{n} is not specified or is zero, use a machine-dependent default.
8563 Enabled at levels @option{-O2}, @option{-O3}.
8565 @item -falign-labels
8566 @itemx -falign-labels=@var{n}
8567 @opindex falign-labels
8568 Align all branch targets to a power-of-two boundary, skipping up to
8569 @var{n} bytes like @option{-falign-functions}.  This option can easily
8570 make code slower, because it must insert dummy operations for when the
8571 branch target is reached in the usual flow of the code.
8573 @option{-fno-align-labels} and @option{-falign-labels=1} are
8574 equivalent and mean that labels are not aligned.
8576 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
8577 are greater than this value, then their values are used instead.
8579 If @var{n} is not specified or is zero, use a machine-dependent default
8580 which is very likely to be @samp{1}, meaning no alignment.
8582 Enabled at levels @option{-O2}, @option{-O3}.
8584 @item -falign-loops
8585 @itemx -falign-loops=@var{n}
8586 @opindex falign-loops
8587 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
8588 like @option{-falign-functions}.  If the loops are
8589 executed many times, this makes up for any execution of the dummy
8590 operations.
8592 @option{-fno-align-loops} and @option{-falign-loops=1} are
8593 equivalent and mean that loops are not aligned.
8595 If @var{n} is not specified or is zero, use a machine-dependent default.
8597 Enabled at levels @option{-O2}, @option{-O3}.
8599 @item -falign-jumps
8600 @itemx -falign-jumps=@var{n}
8601 @opindex falign-jumps
8602 Align branch targets to a power-of-two boundary, for branch targets
8603 where the targets can only be reached by jumping, skipping up to @var{n}
8604 bytes like @option{-falign-functions}.  In this case, no dummy operations
8605 need be executed.
8607 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
8608 equivalent and mean that loops are not aligned.
8610 If @var{n} is not specified or is zero, use a machine-dependent default.
8612 Enabled at levels @option{-O2}, @option{-O3}.
8614 @item -funit-at-a-time
8615 @opindex funit-at-a-time
8616 This option is left for compatibility reasons. @option{-funit-at-a-time}
8617 has no effect, while @option{-fno-unit-at-a-time} implies
8618 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
8620 Enabled by default.
8622 @item -fno-toplevel-reorder
8623 @opindex fno-toplevel-reorder
8624 Do not reorder top-level functions, variables, and @code{asm}
8625 statements.  Output them in the same order that they appear in the
8626 input file.  When this option is used, unreferenced static variables
8627 are not removed.  This option is intended to support existing code
8628 that relies on a particular ordering.  For new code, it is better to
8629 use attributes when possible.
8631 Enabled at level @option{-O0}.  When disabled explicitly, it also implies
8632 @option{-fno-section-anchors}, which is otherwise enabled at @option{-O0} on some
8633 targets.
8635 @item -fweb
8636 @opindex fweb
8637 Constructs webs as commonly used for register allocation purposes and assign
8638 each web individual pseudo register.  This allows the register allocation pass
8639 to operate on pseudos directly, but also strengthens several other optimization
8640 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
8641 however, make debugging impossible, since variables no longer stay in a
8642 ``home register''.
8644 Enabled by default with @option{-funroll-loops}.
8646 @item -fwhole-program
8647 @opindex fwhole-program
8648 Assume that the current compilation unit represents the whole program being
8649 compiled.  All public functions and variables with the exception of @code{main}
8650 and those merged by attribute @code{externally_visible} become static functions
8651 and in effect are optimized more aggressively by interprocedural optimizers.
8653 This option should not be used in combination with @code{-flto}.
8654 Instead relying on a linker plugin should provide safer and more precise
8655 information.
8657 @item -flto[=@var{n}]
8658 @opindex flto
8659 This option runs the standard link-time optimizer.  When invoked
8660 with source code, it generates GIMPLE (one of GCC's internal
8661 representations) and writes it to special ELF sections in the object
8662 file.  When the object files are linked together, all the function
8663 bodies are read from these ELF sections and instantiated as if they
8664 had been part of the same translation unit.
8666 To use the link-time optimizer, @option{-flto} and optimization
8667 options should be specified at compile time and during the final link.
8668 For example:
8670 @smallexample
8671 gcc -c -O2 -flto foo.c
8672 gcc -c -O2 -flto bar.c
8673 gcc -o myprog -flto -O2 foo.o bar.o
8674 @end smallexample
8676 The first two invocations to GCC save a bytecode representation
8677 of GIMPLE into special ELF sections inside @file{foo.o} and
8678 @file{bar.o}.  The final invocation reads the GIMPLE bytecode from
8679 @file{foo.o} and @file{bar.o}, merges the two files into a single
8680 internal image, and compiles the result as usual.  Since both
8681 @file{foo.o} and @file{bar.o} are merged into a single image, this
8682 causes all the interprocedural analyses and optimizations in GCC to
8683 work across the two files as if they were a single one.  This means,
8684 for example, that the inliner is able to inline functions in
8685 @file{bar.o} into functions in @file{foo.o} and vice-versa.
8687 Another (simpler) way to enable link-time optimization is:
8689 @smallexample
8690 gcc -o myprog -flto -O2 foo.c bar.c
8691 @end smallexample
8693 The above generates bytecode for @file{foo.c} and @file{bar.c},
8694 merges them together into a single GIMPLE representation and optimizes
8695 them as usual to produce @file{myprog}.
8697 The only important thing to keep in mind is that to enable link-time
8698 optimizations you need to use the GCC driver to perform the link-step.
8699 GCC then automatically performs link-time optimization if any of the
8700 objects involved were compiled with the @option{-flto}.  You generally
8701 should specify the optimization options to be used for link-time
8702 optimization though GCC will try to be clever at guessing an
8703 optimization level to use from the options used at compile-time
8704 if you fail to specify one at link-time.  You can always override
8705 the automatic decision to do link-time optimization at link-time
8706 by passing @option{-fno-lto} to the link command.
8708 To make whole program optimization effective, it is necessary to make
8709 certain whole program assumptions.  The compiler needs to know
8710 what functions and variables can be accessed by libraries and runtime
8711 outside of the link-time optimized unit.  When supported by the linker,
8712 the linker plugin (see @option{-fuse-linker-plugin}) passes information
8713 to the compiler about used and externally visible symbols.  When
8714 the linker plugin is not available, @option{-fwhole-program} should be
8715 used to allow the compiler to make these assumptions, which leads
8716 to more aggressive optimization decisions.
8718 When @option{-fuse-linker-plugin} is not enabled then, when a file is
8719 compiled with @option{-flto}, the generated object file is larger than
8720 a regular object file because it contains GIMPLE bytecodes and the usual
8721 final code (see @option{-ffat-lto-objects}.  This means that
8722 object files with LTO information can be linked as normal object
8723 files; if @option{-fno-lto} is passed to the linker, no
8724 interprocedural optimizations are applied.  Note that when
8725 @option{-fno-fat-lto-objects} is enabled the compile-stage is faster
8726 but you cannot perform a regular, non-LTO link on them.
8728 Additionally, the optimization flags used to compile individual files
8729 are not necessarily related to those used at link time.  For instance,
8731 @smallexample
8732 gcc -c -O0 -ffat-lto-objects -flto foo.c
8733 gcc -c -O0 -ffat-lto-objects -flto bar.c
8734 gcc -o myprog -O3 foo.o bar.o
8735 @end smallexample
8737 This produces individual object files with unoptimized assembler
8738 code, but the resulting binary @file{myprog} is optimized at
8739 @option{-O3}.  If, instead, the final binary is generated with
8740 @option{-fno-lto}, then @file{myprog} is not optimized.
8742 When producing the final binary, GCC only
8743 applies link-time optimizations to those files that contain bytecode.
8744 Therefore, you can mix and match object files and libraries with
8745 GIMPLE bytecodes and final object code.  GCC automatically selects
8746 which files to optimize in LTO mode and which files to link without
8747 further processing.
8749 There are some code generation flags preserved by GCC when
8750 generating bytecodes, as they need to be used during the final link
8751 stage.  Generally options specified at link-time override those
8752 specified at compile-time.
8754 If you do not specify an optimization level option @option{-O} at
8755 link-time then GCC will compute one based on the optimization levels
8756 used when compiling the object files.  The highest optimization
8757 level will win here.
8759 Currently, the following options and their setting are take from
8760 the first object file that explicitely specified it: 
8761 @option{-fPIC}, @option{-fpic}, @option{-fpie}, @option{-fcommon},
8762 @option{-fexceptions}, @option{-fnon-call-exceptions}, @option{-fgnu-tm}
8763 and all the @option{-m} target flags.
8765 Certain ABI changing flags are required to match in all compilation-units
8766 and trying to override this at link-time with a conflicting value
8767 is ignored.  This includes options such as @option{-freg-struct-return}
8768 and @option{-fpcc-struct-return}. 
8770 Other options such as @option{-ffp-contract}, @option{-fno-strict-overflow},
8771 @option{-fwrapv}, @option{-fno-trapv} or @option{-fno-strict-aliasing}
8772 are passed through to the link stage and merged conservatively for
8773 conflicting translation units.  Specifically
8774 @option{-fno-strict-overflow}, @option{-fwrapv} and @option{-fno-trapv} take
8775 precedence and for example @option{-ffp-contract=off} takes precedence
8776 over @option{-ffp-contract=fast}.  You can override them at linke-time.
8778 It is recommended that you compile all the files participating in the
8779 same link with the same options and also specify those options at
8780 link time.
8782 If LTO encounters objects with C linkage declared with incompatible
8783 types in separate translation units to be linked together (undefined
8784 behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be
8785 issued.  The behavior is still undefined at run time.  Similar
8786 diagnostics may be raised for other languages.
8788 Another feature of LTO is that it is possible to apply interprocedural
8789 optimizations on files written in different languages:
8791 @smallexample
8792 gcc -c -flto foo.c
8793 g++ -c -flto bar.cc
8794 gfortran -c -flto baz.f90
8795 g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
8796 @end smallexample
8798 Notice that the final link is done with @command{g++} to get the C++
8799 runtime libraries and @option{-lgfortran} is added to get the Fortran
8800 runtime libraries.  In general, when mixing languages in LTO mode, you
8801 should use the same link command options as when mixing languages in a
8802 regular (non-LTO) compilation.
8804 If object files containing GIMPLE bytecode are stored in a library archive, say
8805 @file{libfoo.a}, it is possible to extract and use them in an LTO link if you
8806 are using a linker with plugin support.  To create static libraries suitable
8807 for LTO, use @command{gcc-ar} and @command{gcc-ranlib} instead of @command{ar}
8808 and @code{ranlib}; to show the symbols of object files with GIMPLE bytecode, use
8809 @command{gcc-nm}.  Those commands require that @command{ar}, @command{ranlib}
8810 and @command{nm} have been compiled with plugin support.  At link time, use the the
8811 flag @option{-fuse-linker-plugin} to ensure that the library participates in
8812 the LTO optimization process:
8814 @smallexample
8815 gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
8816 @end smallexample
8818 With the linker plugin enabled, the linker extracts the needed
8819 GIMPLE files from @file{libfoo.a} and passes them on to the running GCC
8820 to make them part of the aggregated GIMPLE image to be optimized.
8822 If you are not using a linker with plugin support and/or do not
8823 enable the linker plugin, then the objects inside @file{libfoo.a}
8824 are extracted and linked as usual, but they do not participate
8825 in the LTO optimization process.  In order to make a static library suitable
8826 for both LTO optimization and usual linkage, compile its object files with
8827 @option{-flto} @code{-ffat-lto-objects}.
8829 Link-time optimizations do not require the presence of the whole program to
8830 operate.  If the program does not require any symbols to be exported, it is
8831 possible to combine @option{-flto} and @option{-fwhole-program} to allow
8832 the interprocedural optimizers to use more aggressive assumptions which may
8833 lead to improved optimization opportunities.
8834 Use of @option{-fwhole-program} is not needed when linker plugin is
8835 active (see @option{-fuse-linker-plugin}).
8837 The current implementation of LTO makes no
8838 attempt to generate bytecode that is portable between different
8839 types of hosts.  The bytecode files are versioned and there is a
8840 strict version check, so bytecode files generated in one version of
8841 GCC will not work with an older or newer version of GCC.
8843 Link-time optimization does not work well with generation of debugging
8844 information.  Combining @option{-flto} with
8845 @option{-g} is currently experimental and expected to produce unexpected
8846 results.
8848 If you specify the optional @var{n}, the optimization and code
8849 generation done at link time is executed in parallel using @var{n}
8850 parallel jobs by utilizing an installed @command{make} program.  The
8851 environment variable @env{MAKE} may be used to override the program
8852 used.  The default value for @var{n} is 1.
8854 You can also specify @option{-flto=jobserver} to use GNU make's
8855 job server mode to determine the number of parallel jobs. This
8856 is useful when the Makefile calling GCC is already executing in parallel.
8857 You must prepend a @samp{+} to the command recipe in the parent Makefile
8858 for this to work.  This option likely only works if @env{MAKE} is
8859 GNU make.
8861 @item -flto-partition=@var{alg}
8862 @opindex flto-partition
8863 Specify the partitioning algorithm used by the link-time optimizer.
8864 The value is either @code{1to1} to specify a partitioning mirroring
8865 the original source files or @code{balanced} to specify partitioning
8866 into equally sized chunks (whenever possible) or @code{max} to create
8867 new partition for every symbol where possible.  Specifying @code{none}
8868 as an algorithm disables partitioning and streaming completely. 
8869 The default value is @code{balanced}. While @code{1to1} can be used
8870 as an workaround for various code ordering issues, the @code{max}
8871 partitioning is intended for internal testing only.
8873 @item -flto-compression-level=@var{n}
8874 This option specifies the level of compression used for intermediate
8875 language written to LTO object files, and is only meaningful in
8876 conjunction with LTO mode (@option{-flto}).  Valid
8877 values are 0 (no compression) to 9 (maximum compression).  Values
8878 outside this range are clamped to either 0 or 9.  If the option is not
8879 given, a default balanced compression setting is used.
8881 @item -flto-report
8882 Prints a report with internal details on the workings of the link-time
8883 optimizer.  The contents of this report vary from version to version.
8884 It is meant to be useful to GCC developers when processing object
8885 files in LTO mode (via @option{-flto}).
8887 Disabled by default.
8889 @item -flto-report-wpa
8890 Like @option{-flto-report}, but only print for the WPA phase of Link
8891 Time Optimization.
8893 @item -fuse-linker-plugin
8894 Enables the use of a linker plugin during link-time optimization.  This
8895 option relies on plugin support in the linker, which is available in gold
8896 or in GNU ld 2.21 or newer.
8898 This option enables the extraction of object files with GIMPLE bytecode out
8899 of library archives. This improves the quality of optimization by exposing
8900 more code to the link-time optimizer.  This information specifies what
8901 symbols can be accessed externally (by non-LTO object or during dynamic
8902 linking).  Resulting code quality improvements on binaries (and shared
8903 libraries that use hidden visibility) are similar to @code{-fwhole-program}.
8904 See @option{-flto} for a description of the effect of this flag and how to
8905 use it.
8907 This option is enabled by default when LTO support in GCC is enabled
8908 and GCC was configured for use with
8909 a linker supporting plugins (GNU ld 2.21 or newer or gold).
8911 @item -ffat-lto-objects
8912 @opindex ffat-lto-objects
8913 Fat LTO objects are object files that contain both the intermediate language
8914 and the object code. This makes them usable for both LTO linking and normal
8915 linking. This option is effective only when compiling with @option{-flto}
8916 and is ignored at link time.
8918 @option{-fno-fat-lto-objects} improves compilation time over plain LTO, but
8919 requires the complete toolchain to be aware of LTO. It requires a linker with
8920 linker plugin support for basic functionality.  Additionally,
8921 @command{nm}, @command{ar} and @command{ranlib}
8922 need to support linker plugins to allow a full-featured build environment
8923 (capable of building static libraries etc).  GCC provides the @command{gcc-ar},
8924 @command{gcc-nm}, @command{gcc-ranlib} wrappers to pass the right options
8925 to these tools. With non fat LTO makefiles need to be modified to use them.
8927 The default is @option{-fno-fat-lto-objects} on targets with linker plugin
8928 support.
8930 @item -fcompare-elim
8931 @opindex fcompare-elim
8932 After register allocation and post-register allocation instruction splitting,
8933 identify arithmetic instructions that compute processor flags similar to a
8934 comparison operation based on that arithmetic.  If possible, eliminate the
8935 explicit comparison operation.
8937 This pass only applies to certain targets that cannot explicitly represent
8938 the comparison operation before register allocation is complete.
8940 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8942 @item -fuse-ld=bfd
8943 @opindex fuse-ld=bfd
8944 Use the @command{bfd} linker instead of the default linker.
8946 @item -fuse-ld=gold
8947 @opindex fuse-ld=gold
8948 Use the @command{gold} linker instead of the default linker.
8950 @item -fuse-ld=mcld
8951 @opindex fuse-ld=mcld
8952 Use the @command{mcld} linker instead of the default linker.
8954 @item -fcprop-registers
8955 @opindex fcprop-registers
8956 After register allocation and post-register allocation instruction splitting,
8957 perform a copy-propagation pass to try to reduce scheduling dependencies
8958 and occasionally eliminate the copy.
8960 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8962 @item -fauto-profile
8963 @itemx -fauto-profile=@var{path}
8964 @opindex fauto-profile
8965 Enable auto-profile feedback directed optimizations, and optimizations
8966 generally profitable only with profile feedback available.
8968 The following options are enabled: @code{-fbranch-probabilities},
8969 @code{-funroll-loops}, @code{-fpeel-loops}.
8971 If @var{path} is specified, GCC will look at the @var{path} to find
8972 the profile feedback data files. Otherwise, GCC will find fbdata.afdo
8973 in the current directory.
8975 @item -fcheck-branch-annotation
8976 @opindex -fcheck-branch-annotation
8977 Compare branch prediction result and autofdo profile information, store the
8978 result in a section in the generated elf file.
8980 @item -fprofile-correction
8981 @opindex fprofile-correction
8982 Profiles collected using an instrumented binary for multi-threaded programs may
8983 be inconsistent due to missed counter updates. When this option is specified,
8984 GCC uses heuristics to correct or smooth out such inconsistencies. By
8985 default, GCC emits an error message when an inconsistent profile is detected.
8987 @item -fprofile-dir=@var{path}
8988 @opindex fprofile-dir
8990 Set the directory to search for the profile data files in to @var{path}.
8991 This option affects only the profile data generated by
8992 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
8993 and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
8994 and its related options.  Both absolute and relative paths can be used.
8995 By default, GCC uses the current directory as @var{path}, thus the
8996 profile data file appears in the same directory as the object file.
8998 @item -fprofile-generate
8999 @itemx -fprofile-generate=@var{path}
9000 @opindex fprofile-generate
9002 Enable options usually used for instrumenting application to produce
9003 profile useful for later recompilation with profile feedback based
9004 optimization.  You must use @option{-fprofile-generate} both when
9005 compiling and when linking your program.
9007 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
9009 If @var{path} is specified, GCC looks at the @var{path} to find
9010 the profile feedback data files. See @option{-fprofile-dir}.
9012 @item -fprofile-generate-sampling
9013 @opindex -fprofile-generate-sampling
9015 Enable sampling for instrumented binaries.  Instead of recording every event,
9016 record only every N-th event, where N (the sampling period) can be set either
9017 at compile time using
9018 @option{--param profile-generate-sampling-period=@var{value}}, or at
9019 execution start time through environment variable @samp{GCOV_SAMPLING_PERIOD}.
9021 At this time sampling applies only to branch counters.  A sampling period of 100
9022 decreases instrumentated binary slowdown from up to 20x for heavily threaded
9023 applications down to around 2x.  @option{-fprofile-correction} is always
9024 needed with sampling.
9026 @item -fprofile-use
9027 @itemx -fprofile-use=@var{path}
9028 @opindex fprofile-use
9029 Enable profile feedback directed optimizations, and optimizations
9030 generally profitable only with profile feedback available.
9032 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
9033 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}, @code{-ftree-vectorize},
9034 @code{ftree-loop-distribute-patterns}
9036 By default, GCC emits an error message if the feedback profiles do not
9037 match the source code.  This error can be turned into a warning by using
9038 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
9039 code.
9041 If @var{path} is specified, GCC looks at the @var{path} to find
9042 the profile feedback data files. See @option{-fprofile-dir}.
9044 @item -fprofile-strip=@var{base_suffix}
9045 @opindex fprofile-strip
9047 The option causes the compiler to strip @var{base_suffix} from the
9048 base file name and use that to find the gcda file.
9050 @item -fripa
9051 @opindex fripa
9052 Perform dynamic inter-procedural analysis. This is used in conjunction with
9053 the @option{-fprofile-generate} and @option{-fprofile-use} options.
9054 During the @option{-fprofile-generate} phase, this flag turns on some additional
9055 instrumentation code that enables dynamic call-graph analysis.
9056 During the @option{-fprofile-use} phase, this flag enables cross-module
9057 optimizations such as inlining.
9059 @item -fripa-disallow-asm-modules
9060 @opindex fripa-disallow-asm-modules
9061 During profile-gen, if this flag is enabled, and the module has asm statements,
9062 arrange so that a bit recording this information will be set in the profile
9063 feedback data file.
9064 During profile-use, if this flag is enabled, and the same bit in auxiliary
9065 module's profile feedback data is set, don't import this auxiliary module.
9066 If this is the primary module, don't export it.
9068 @item -fripa-disallow-opt-mismatch
9069 @opindex fripa-disallow-opt-mismatch
9070 Don't import an auxiliary module, if the GCC command line options used for this
9071 auxiliary module during the profile-generate stage were different from those used
9072 for the primary module. Note that any mismatches in warning-related options are
9073 ignored for this comparison.
9075 @item -fripa-inc-path-sub=@var{path_mapping}
9076 @opindex fripa-inc-path-sub
9077 This option allows LIPO profile data associated with one compiler to be usable
9078 by another compiler at different installation path. A user can use this option
9079 to specify an include search path mapping so that the compiler can convert include
9080 search paths stored in gcda files into exisiting paths. The mapping is specified
9081 as a comma separated sub path pairs in the form: OLD_SUBPATH:NEW_SUBPATH.
9083 @item -fripa-no-promote-always-inline-func
9084 @opindex fripa-no-promote-always-inline-func
9085 Do not promote static functions with always inline attribute in LIPO compilation.
9087 @item -fripa-verbose
9088 @opindex fripa-verbose
9089 Enable printing of verbose information about dynamic inter-procedural optimizations.
9090 This is used in conjunction with the @option{-fripa}.
9092 @item -frecord-gcc-switches-in-elf
9093 @opindex frecord-gcc-switches-in-elf
9094 Record the command line options in the .gnu.switches.text elf section for sample
9095 based LIPO to do module grouping.
9096 @end table
9098 The following options control compiler behavior regarding floating-point 
9099 arithmetic.  These options trade off between speed and
9100 correctness.  All must be specifically enabled.
9102 @table @gcctabopt
9103 @item -ffloat-store
9104 @opindex ffloat-store
9105 Do not store floating-point variables in registers, and inhibit other
9106 options that might change whether a floating-point value is taken from a
9107 register or memory.
9109 @cindex floating-point precision
9110 This option prevents undesirable excess precision on machines such as
9111 the 68000 where the floating registers (of the 68881) keep more
9112 precision than a @code{double} is supposed to have.  Similarly for the
9113 x86 architecture.  For most programs, the excess precision does only
9114 good, but a few programs rely on the precise definition of IEEE floating
9115 point.  Use @option{-ffloat-store} for such programs, after modifying
9116 them to store all pertinent intermediate computations into variables.
9118 @item -fexcess-precision=@var{style}
9119 @opindex fexcess-precision
9120 This option allows further control over excess precision on machines
9121 where floating-point registers have more precision than the IEEE
9122 @code{float} and @code{double} types and the processor does not
9123 support operations rounding to those types.  By default,
9124 @option{-fexcess-precision=fast} is in effect; this means that
9125 operations are carried out in the precision of the registers and that
9126 it is unpredictable when rounding to the types specified in the source
9127 code takes place.  When compiling C, if
9128 @option{-fexcess-precision=standard} is specified then excess
9129 precision follows the rules specified in ISO C99; in particular,
9130 both casts and assignments cause values to be rounded to their
9131 semantic types (whereas @option{-ffloat-store} only affects
9132 assignments).  This option is enabled by default for C if a strict
9133 conformance option such as @option{-std=c99} is used.
9135 @opindex mfpmath
9136 @option{-fexcess-precision=standard} is not implemented for languages
9137 other than C, and has no effect if
9138 @option{-funsafe-math-optimizations} or @option{-ffast-math} is
9139 specified.  On the x86, it also has no effect if @option{-mfpmath=sse}
9140 or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
9141 semantics apply without excess precision, and in the latter, rounding
9142 is unpredictable.
9144 @item -ffast-math
9145 @opindex ffast-math
9146 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
9147 @option{-ffinite-math-only}, @option{-fno-rounding-math},
9148 @option{-fno-signaling-nans} and @option{-fcx-limited-range}.
9150 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
9152 This option is not turned on by any @option{-O} option besides
9153 @option{-Ofast} since it can result in incorrect output for programs
9154 that depend on an exact implementation of IEEE or ISO rules/specifications
9155 for math functions. It may, however, yield faster code for programs
9156 that do not require the guarantees of these specifications.
9158 @item -fno-math-errno
9159 @opindex fno-math-errno
9160 Do not set @code{errno} after calling math functions that are executed
9161 with a single instruction, e.g., @code{sqrt}.  A program that relies on
9162 IEEE exceptions for math error handling may want to use this flag
9163 for speed while maintaining IEEE arithmetic compatibility.
9165 This option is not turned on by any @option{-O} option since
9166 it can result in incorrect output for programs that depend on
9167 an exact implementation of IEEE or ISO rules/specifications for
9168 math functions. It may, however, yield faster code for programs
9169 that do not require the guarantees of these specifications.
9171 The default is @option{-fmath-errno}.
9173 On Darwin systems, the math library never sets @code{errno}.  There is
9174 therefore no reason for the compiler to consider the possibility that
9175 it might, and @option{-fno-math-errno} is the default.
9177 @item -funsafe-math-optimizations
9178 @opindex funsafe-math-optimizations
9180 Allow optimizations for floating-point arithmetic that (a) assume
9181 that arguments and results are valid and (b) may violate IEEE or
9182 ANSI standards.  When used at link-time, it may include libraries
9183 or startup files that change the default FPU control word or other
9184 similar optimizations.
9186 This option is not turned on by any @option{-O} option since
9187 it can result in incorrect output for programs that depend on
9188 an exact implementation of IEEE or ISO rules/specifications for
9189 math functions. It may, however, yield faster code for programs
9190 that do not require the guarantees of these specifications.
9191 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
9192 @option{-fassociative-math} and @option{-freciprocal-math}.
9194 The default is @option{-fno-unsafe-math-optimizations}.
9196 @item -fassociative-math
9197 @opindex fassociative-math
9199 Allow re-association of operands in series of floating-point operations.
9200 This violates the ISO C and C++ language standard by possibly changing
9201 computation result.  NOTE: re-ordering may change the sign of zero as
9202 well as ignore NaNs and inhibit or create underflow or overflow (and
9203 thus cannot be used on code that relies on rounding behavior like
9204 @code{(x + 2**52) - 2**52}.  May also reorder floating-point comparisons
9205 and thus may not be used when ordered comparisons are required.
9206 This option requires that both @option{-fno-signed-zeros} and
9207 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
9208 much sense with @option{-frounding-math}. For Fortran the option
9209 is automatically enabled when both @option{-fno-signed-zeros} and
9210 @option{-fno-trapping-math} are in effect.
9212 The default is @option{-fno-associative-math}.
9214 @item -freciprocal-math
9215 @opindex freciprocal-math
9217 Allow the reciprocal of a value to be used instead of dividing by
9218 the value if this enables optimizations.  For example @code{x / y}
9219 can be replaced with @code{x * (1/y)}, which is useful if @code{(1/y)}
9220 is subject to common subexpression elimination.  Note that this loses
9221 precision and increases the number of flops operating on the value.
9223 The default is @option{-fno-reciprocal-math}.
9225 @item -ffinite-math-only
9226 @opindex ffinite-math-only
9227 Allow optimizations for floating-point arithmetic that assume
9228 that arguments and results are not NaNs or +-Infs.
9230 This option is not turned on by any @option{-O} option since
9231 it can result in incorrect output for programs that depend on
9232 an exact implementation of IEEE or ISO rules/specifications for
9233 math functions. It may, however, yield faster code for programs
9234 that do not require the guarantees of these specifications.
9236 The default is @option{-fno-finite-math-only}.
9238 @item -fno-signed-zeros
9239 @opindex fno-signed-zeros
9240 Allow optimizations for floating-point arithmetic that ignore the
9241 signedness of zero.  IEEE arithmetic specifies the behavior of
9242 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
9243 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
9244 This option implies that the sign of a zero result isn't significant.
9246 The default is @option{-fsigned-zeros}.
9248 @item -fno-trapping-math
9249 @opindex fno-trapping-math
9250 Compile code assuming that floating-point operations cannot generate
9251 user-visible traps.  These traps include division by zero, overflow,
9252 underflow, inexact result and invalid operation.  This option requires
9253 that @option{-fno-signaling-nans} be in effect.  Setting this option may
9254 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
9256 This option should never be turned on by any @option{-O} option since
9257 it can result in incorrect output for programs that depend on
9258 an exact implementation of IEEE or ISO rules/specifications for
9259 math functions.
9261 The default is @option{-ftrapping-math}.
9263 @item -frounding-math
9264 @opindex frounding-math
9265 Disable transformations and optimizations that assume default floating-point
9266 rounding behavior.  This is round-to-zero for all floating point
9267 to integer conversions, and round-to-nearest for all other arithmetic
9268 truncations.  This option should be specified for programs that change
9269 the FP rounding mode dynamically, or that may be executed with a
9270 non-default rounding mode.  This option disables constant folding of
9271 floating-point expressions at compile time (which may be affected by
9272 rounding mode) and arithmetic transformations that are unsafe in the
9273 presence of sign-dependent rounding modes.
9275 The default is @option{-fno-rounding-math}.
9277 This option is experimental and does not currently guarantee to
9278 disable all GCC optimizations that are affected by rounding mode.
9279 Future versions of GCC may provide finer control of this setting
9280 using C99's @code{FENV_ACCESS} pragma.  This command-line option
9281 will be used to specify the default state for @code{FENV_ACCESS}.
9283 @item -fsignaling-nans
9284 @opindex fsignaling-nans
9285 Compile code assuming that IEEE signaling NaNs may generate user-visible
9286 traps during floating-point operations.  Setting this option disables
9287 optimizations that may change the number of exceptions visible with
9288 signaling NaNs.  This option implies @option{-ftrapping-math}.
9290 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
9291 be defined.
9293 The default is @option{-fno-signaling-nans}.
9295 This option is experimental and does not currently guarantee to
9296 disable all GCC optimizations that affect signaling NaN behavior.
9298 @item -fsingle-precision-constant
9299 @opindex fsingle-precision-constant
9300 Treat floating-point constants as single precision instead of
9301 implicitly converting them to double-precision constants.
9303 @item -fcx-limited-range
9304 @opindex fcx-limited-range
9305 When enabled, this option states that a range reduction step is not
9306 needed when performing complex division.  Also, there is no checking
9307 whether the result of a complex multiplication or division is @code{NaN
9308 + I*NaN}, with an attempt to rescue the situation in that case.  The
9309 default is @option{-fno-cx-limited-range}, but is enabled by
9310 @option{-ffast-math}.
9312 This option controls the default setting of the ISO C99
9313 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
9314 all languages.
9316 @item -fcx-fortran-rules
9317 @opindex fcx-fortran-rules
9318 Complex multiplication and division follow Fortran rules.  Range
9319 reduction is done as part of complex division, but there is no checking
9320 whether the result of a complex multiplication or division is @code{NaN
9321 + I*NaN}, with an attempt to rescue the situation in that case.
9323 The default is @option{-fno-cx-fortran-rules}.
9325 @item min-mcf-cancel-iters
9326 The minimum number of iterations of negative cycle cancellation during
9327 MCF profile correction before early termination.  This parameter is
9328 only useful when using @option{-fprofile-correction}.
9331 @end table
9333 The following options control optimizations that may improve
9334 performance, but are not enabled by any @option{-O} options.  This
9335 section includes experimental options that may produce broken code.
9337 @table @gcctabopt
9338 @item -fbranch-probabilities
9339 @opindex fbranch-probabilities
9340 After running a program compiled with @option{-fprofile-arcs}
9341 (@pxref{Debugging Options,, Options for Debugging Your Program or
9342 @command{gcc}}), you can compile it a second time using
9343 @option{-fbranch-probabilities}, to improve optimizations based on
9344 the number of times each branch was taken.  When a program
9345 compiled with @option{-fprofile-arcs} exits, it saves arc execution
9346 counts to a file called @file{@var{sourcename}.gcda} for each source
9347 file.  The information in this data file is very dependent on the
9348 structure of the generated code, so you must use the same source code
9349 and the same optimization options for both compilations.
9351 With @option{-fbranch-probabilities}, GCC puts a
9352 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
9353 These can be used to improve optimization.  Currently, they are only
9354 used in one place: in @file{reorg.c}, instead of guessing which path a
9355 branch is most likely to take, the @samp{REG_BR_PROB} values are used to
9356 exactly determine which path is taken more often.
9358 @item -fprofile-values
9359 @opindex fprofile-values
9360 If combined with @option{-fprofile-arcs}, it adds code so that some
9361 data about values of expressions in the program is gathered.
9363 With @option{-fbranch-probabilities}, it reads back the data gathered
9364 from profiling values of expressions for usage in optimizations.
9366 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
9368 @item -fprofile-reorder-functions
9369 @opindex fprofile-reorder-functions
9370 Function reordering based on profile instrumentation collects
9371 first time of execution of a function and orders these functions
9372 in ascending order.
9374 Enabled with @option{-fprofile-use}.
9376 @item -fvpt
9377 @opindex fvpt
9378 If combined with @option{-fprofile-arcs}, this option instructs the compiler
9379 to add code to gather information about values of expressions.
9381 With @option{-fbranch-probabilities}, it reads back the data gathered
9382 and actually performs the optimizations based on them.
9383 Currently the optimizations include specialization of division operations
9384 using the knowledge about the value of the denominator.
9386 @item -frename-registers
9387 @opindex frename-registers
9388 Attempt to avoid false dependencies in scheduled code by making use
9389 of registers left over after register allocation.  This optimization
9390 most benefits processors with lots of registers.  Depending on the
9391 debug information format adopted by the target, however, it can
9392 make debugging impossible, since variables no longer stay in
9393 a ``home register''.
9395 Enabled by default with @option{-funroll-loops} and @option{-fpeel-loops}.
9397 @item -ftracer
9398 @opindex ftracer
9399 Perform tail duplication to enlarge superblock size.  This transformation
9400 simplifies the control flow of the function allowing other optimizations to do
9401 a better job.
9403 Enabled with @option{-fprofile-use}.
9405 @item -funroll-loops
9406 @opindex funroll-loops
9407 Unroll loops whose number of iterations can be determined at compile time or
9408 upon entry to the loop.  @option{-funroll-loops} implies
9409 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
9410 It also turns on complete loop peeling (i.e.@: complete removal of loops with
9411 a small constant number of iterations).  This option makes code larger, and may
9412 or may not make it run faster.
9414 Enabled with @option{-fprofile-use}.
9416 @item -funroll-all-loops
9417 @opindex funroll-all-loops
9418 Unroll all loops, even if their number of iterations is uncertain when
9419 the loop is entered.  This usually makes programs run more slowly.
9420 @option{-funroll-all-loops} implies the same options as
9421 @option{-funroll-loops}.
9423 @item -funroll-codesize-limit
9424 @opindex funroll-codesize-limit
9425 Limit loop unrolling of non-const non-FP loops in a profile feedback compilation
9426 under estimates of a large code footprint. Enabled by default with
9427 @option{-fprofile-use}. Code size and execution weight thresholds are controlled
9428 by the @option{unrollpeel-codesize-threshold} and
9429 @option{unrollpeel-hotness-threshold} parameters.
9431 @item -fpeel-loops
9432 @opindex fpeel-loops
9433 Peels loops for which there is enough information that they do not
9434 roll much (from profile feedback).  It also turns on complete loop peeling
9435 (i.e.@: complete removal of loops with small constant number of iterations).
9437 Enabled with @option{-fprofile-use}.
9439 @item -fpeel-codesize-limit
9440 @opindex fpeel-codesize-limit
9441 Limit loop peeling of non-const non-FP loops in a profile feedback compilation
9442 under estimates of a large code footprint. Enabled by default with
9443 @option{-fprofile-use}. Code size and execution weight thresholds are controlled
9444 by the @option{unrollpeel-codesize-threshold} and
9445 @option{unrollpeel-hotness-threshold} parameters.
9447 @item -fmove-loop-invariants
9448 @opindex fmove-loop-invariants
9449 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
9450 at level @option{-O1}
9452 @item -funswitch-loops
9453 @opindex funswitch-loops
9454 Move branches with loop invariant conditions out of the loop, with duplicates
9455 of the loop on both branches (modified according to result of the condition).
9457 @item -ffunction-sections
9458 @itemx -fdata-sections
9459 @opindex ffunction-sections
9460 @opindex fdata-sections
9461 Place each function or data item into its own section in the output
9462 file if the target supports arbitrary sections.  The name of the
9463 function or the name of the data item determines the section's name
9464 in the output file.
9466 Use these options on systems where the linker can perform optimizations
9467 to improve locality of reference in the instruction space.  Most systems
9468 using the ELF object format and SPARC processors running Solaris 2 have
9469 linkers with such optimizations.  AIX may have these optimizations in
9470 the future.
9472 Only use these options when there are significant benefits from doing
9473 so.  When you specify these options, the assembler and linker
9474 create larger object and executable files and are also slower.
9475 You cannot use @code{gprof} on all systems if you
9476 specify this option, and you may have problems with debugging if
9477 you specify both this option and @option{-g}.
9479 @item -ffunction-attribute-list
9480 @opindex ffunction-attribute-list
9481 List of function name patterns that will be applied specified attribute.
9482 For example, the following command line will add "cold" attribute to
9483 functions that has "ErrorMessage" in its name.
9484 @smallexample
9485 gcc -ffunction-atribute-list=cold:ErrorMessage -c foo.c
9486 @end smallexample
9488 @item -fbranch-target-load-optimize
9489 @opindex fbranch-target-load-optimize
9490 Perform branch target register load optimization before prologue / epilogue
9491 threading.
9492 The use of target registers can typically be exposed only during reload,
9493 thus hoisting loads out of loops and doing inter-block scheduling needs
9494 a separate optimization pass.
9496 @item -fbranch-target-load-optimize2
9497 @opindex fbranch-target-load-optimize2
9498 Perform branch target register load optimization after prologue / epilogue
9499 threading.
9501 @item -fbtr-bb-exclusive
9502 @opindex fbtr-bb-exclusive
9503 When performing branch target register load optimization, don't reuse
9504 branch target registers within any basic block.
9506 @item -fstack-protector
9507 @opindex fstack-protector
9508 Emit extra code to check for buffer overflows, such as stack smashing
9509 attacks.  This is done by adding a guard variable to functions with
9510 vulnerable objects.  This includes functions that call @code{alloca}, and
9511 functions with buffers larger than 8 bytes.  The guards are initialized
9512 when a function is entered and then checked when the function exits.
9513 If a guard check fails, an error message is printed and the program exits.
9515 @item -fstack-protector-all
9516 @opindex fstack-protector-all
9517 Like @option{-fstack-protector} except that all functions are protected.
9519 @item -fstack-protector-strong
9520 @opindex fstack-protector-strong
9521 Like @option{-fstack-protector} but includes additional functions to
9522 be protected --- those that have local array definitions, or have
9523 references to local frame addresses.
9525 @item -fsection-anchors
9526 @opindex fsection-anchors
9527 Try to reduce the number of symbolic address calculations by using
9528 shared ``anchor'' symbols to address nearby objects.  This transformation
9529 can help to reduce the number of GOT entries and GOT accesses on some
9530 targets.
9532 For example, the implementation of the following function @code{foo}:
9534 @smallexample
9535 static int a, b, c;
9536 int foo (void) @{ return a + b + c; @}
9537 @end smallexample
9539 @noindent
9540 usually calculates the addresses of all three variables, but if you
9541 compile it with @option{-fsection-anchors}, it accesses the variables
9542 from a common anchor point instead.  The effect is similar to the
9543 following pseudocode (which isn't valid C):
9545 @smallexample
9546 int foo (void)
9548   register int *xr = &x;
9549   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
9551 @end smallexample
9553 Not all targets support this option.
9555 @item --param @var{name}=@var{value}
9556 @opindex param
9557 In some places, GCC uses various constants to control the amount of
9558 optimization that is done.  For example, GCC does not inline functions
9559 that contain more than a certain number of instructions.  You can
9560 control some of these constants on the command line using the
9561 @option{--param} option.
9563 The names of specific parameters, and the meaning of the values, are
9564 tied to the internals of the compiler, and are subject to change
9565 without notice in future releases.
9567 In each case, the @var{value} is an integer.  The allowable choices for
9568 @var{name} are:
9570 @table @gcctabopt
9571 @item predictable-branch-outcome
9572 When branch is predicted to be taken with probability lower than this threshold
9573 (in percent), then it is considered well predictable. The default is 10.
9575 @item max-crossjump-edges
9576 The maximum number of incoming edges to consider for cross-jumping.
9577 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
9578 the number of edges incoming to each block.  Increasing values mean
9579 more aggressive optimization, making the compilation time increase with
9580 probably small improvement in executable size.
9582 @item min-crossjump-insns
9583 The minimum number of instructions that must be matched at the end
9584 of two blocks before cross-jumping is performed on them.  This
9585 value is ignored in the case where all instructions in the block being
9586 cross-jumped from are matched.  The default value is 5.
9588 @item max-grow-copy-bb-insns
9589 The maximum code size expansion factor when copying basic blocks
9590 instead of jumping.  The expansion is relative to a jump instruction.
9591 The default value is 8.
9593 @item max-goto-duplication-insns
9594 The maximum number of instructions to duplicate to a block that jumps
9595 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
9596 passes, GCC factors computed gotos early in the compilation process,
9597 and unfactors them as late as possible.  Only computed jumps at the
9598 end of a basic blocks with no more than max-goto-duplication-insns are
9599 unfactored.  The default value is 8.
9601 @item max-delay-slot-insn-search
9602 The maximum number of instructions to consider when looking for an
9603 instruction to fill a delay slot.  If more than this arbitrary number of
9604 instructions are searched, the time savings from filling the delay slot
9605 are minimal, so stop searching.  Increasing values mean more
9606 aggressive optimization, making the compilation time increase with probably
9607 small improvement in execution time.
9609 @item max-delay-slot-live-search
9610 When trying to fill delay slots, the maximum number of instructions to
9611 consider when searching for a block with valid live register
9612 information.  Increasing this arbitrarily chosen value means more
9613 aggressive optimization, increasing the compilation time.  This parameter
9614 should be removed when the delay slot code is rewritten to maintain the
9615 control-flow graph.
9617 @item max-gcse-memory
9618 The approximate maximum amount of memory that can be allocated in
9619 order to perform the global common subexpression elimination
9620 optimization.  If more memory than specified is required, the
9621 optimization is not done.
9623 @item max-gcse-insertion-ratio
9624 If the ratio of expression insertions to deletions is larger than this value
9625 for any expression, then RTL PRE inserts or removes the expression and thus
9626 leaves partially redundant computations in the instruction stream.  The default value is 20.
9628 @item max-pending-list-length
9629 The maximum number of pending dependencies scheduling allows
9630 before flushing the current state and starting over.  Large functions
9631 with few branches or calls can create excessively large lists which
9632 needlessly consume memory and resources.
9634 @item max-modulo-backtrack-attempts
9635 The maximum number of backtrack attempts the scheduler should make
9636 when modulo scheduling a loop.  Larger values can exponentially increase
9637 compilation time.
9639 @item max-inline-insns-single
9640 Several parameters control the tree inliner used in GCC@.
9641 This number sets the maximum number of instructions (counted in GCC's
9642 internal representation) in a single function that the tree inliner
9643 considers for inlining.  This only affects functions declared
9644 inline and methods implemented in a class declaration (C++).
9645 The default value is 400.
9647 @item max-inline-insns-auto
9648 When you use @option{-finline-functions} (included in @option{-O3}),
9649 a lot of functions that would otherwise not be considered for inlining
9650 by the compiler are investigated.  To those functions, a different
9651 (more restrictive) limit compared to functions declared inline can
9652 be applied.
9653 The default value is 40.
9655 @item inline-min-speedup
9656 When estimated performance improvement of caller + callee runtime exceeds this
9657 threshold (in precent), the function can be inlined regardless the limit on
9658 @option{--param max-inline-insns-single} and @option{--param
9659 max-inline-insns-auto}.
9661 @item large-function-insns
9662 The limit specifying really large functions.  For functions larger than this
9663 limit after inlining, inlining is constrained by
9664 @option{--param large-function-growth}.  This parameter is useful primarily
9665 to avoid extreme compilation time caused by non-linear algorithms used by the
9666 back end.
9667 The default value is 2700.
9669 @item large-function-growth
9670 Specifies maximal growth of large function caused by inlining in percents.
9671 The default value is 100 which limits large function growth to 2.0 times
9672 the original size.
9674 @item large-unit-insns
9675 The limit specifying large translation unit.  Growth caused by inlining of
9676 units larger than this limit is limited by @option{--param inline-unit-growth}.
9677 For small units this might be too tight.
9678 For example, consider a unit consisting of function A
9679 that is inline and B that just calls A three times.  If B is small relative to
9680 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
9681 large units consisting of small inlineable functions, however, the overall unit
9682 growth limit is needed to avoid exponential explosion of code size.  Thus for
9683 smaller units, the size is increased to @option{--param large-unit-insns}
9684 before applying @option{--param inline-unit-growth}.  The default is 10000.
9686 @item inline-unit-growth
9687 Specifies maximal overall growth of the compilation unit caused by inlining.
9688 The default value is 30 which limits unit growth to 1.3 times the original
9689 size.
9691 @item ipcp-unit-growth
9692 Specifies maximal overall growth of the compilation unit caused by
9693 interprocedural constant propagation.  The default value is 10 which limits
9694 unit growth to 1.1 times the original size.
9696 @item large-stack-frame
9697 The limit specifying large stack frames.  While inlining the algorithm is trying
9698 to not grow past this limit too much.  The default value is 256 bytes.
9700 @item large-stack-frame-growth
9701 Specifies maximal growth of large stack frames caused by inlining in percents.
9702 The default value is 1000 which limits large stack frame growth to 11 times
9703 the original size.
9705 @item max-inline-insns-recursive
9706 @itemx max-inline-insns-recursive-auto
9707 Specifies the maximum number of instructions an out-of-line copy of a
9708 self-recursive inline
9709 function can grow into by performing recursive inlining.
9711 For functions declared inline, @option{--param max-inline-insns-recursive} is
9712 taken into account.  For functions not declared inline, recursive inlining
9713 happens only when @option{-finline-functions} (included in @option{-O3}) is
9714 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
9715 default value is 450.
9717 @item max-inline-recursive-depth
9718 @itemx max-inline-recursive-depth-auto
9719 Specifies the maximum recursion depth used for recursive inlining.
9721 For functions declared inline, @option{--param max-inline-recursive-depth} is
9722 taken into account.  For functions not declared inline, recursive inlining
9723 happens only when @option{-finline-functions} (included in @option{-O3}) is
9724 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
9725 default value is 8.
9727 @item min-inline-recursive-probability
9728 Recursive inlining is profitable only for function having deep recursion
9729 in average and can hurt for function having little recursion depth by
9730 increasing the prologue size or complexity of function body to other
9731 optimizers.
9733 When profile feedback is available (see @option{-fprofile-generate}) the actual
9734 recursion depth can be guessed from probability that function recurses via a
9735 given call expression.  This parameter limits inlining only to call expressions
9736 whose probability exceeds the given threshold (in percents).
9737 The default value is 10.
9739 @item early-inlining-insns
9740 Specify growth that the early inliner can make.  In effect it increases
9741 the amount of inlining for code having a large abstraction penalty.
9742 The default value is 10.
9744 @item max-early-inliner-iterations
9745 @itemx max-early-inliner-iterations
9746 Limit of iterations of the early inliner.  This basically bounds
9747 the number of nested indirect calls the early inliner can resolve.
9748 Deeper chains are still handled by late inlining.
9750 @item comdat-sharing-probability
9751 @itemx comdat-sharing-probability
9752 Probability (in percent) that C++ inline function with comdat visibility
9753 are shared across multiple compilation units.  The default value is 20.
9755 @item min-vect-loop-bound
9756 The minimum number of iterations under which loops are not vectorized
9757 when @option{-ftree-vectorize} is used.  The number of iterations after
9758 vectorization needs to be greater than the value specified by this option
9759 to allow vectorization.  The default value is 0.
9761 @item gcse-cost-distance-ratio
9762 Scaling factor in calculation of maximum distance an expression
9763 can be moved by GCSE optimizations.  This is currently supported only in the
9764 code hoisting pass.  The bigger the ratio, the more aggressive code hoisting
9765 is with simple expressions, i.e., the expressions that have cost
9766 less than @option{gcse-unrestricted-cost}.  Specifying 0 disables
9767 hoisting of simple expressions.  The default value is 10.
9769 @item gcse-unrestricted-cost
9770 Cost, roughly measured as the cost of a single typical machine
9771 instruction, at which GCSE optimizations do not constrain
9772 the distance an expression can travel.  This is currently
9773 supported only in the code hoisting pass.  The lesser the cost,
9774 the more aggressive code hoisting is.  Specifying 0 
9775 allows all expressions to travel unrestricted distances.
9776 The default value is 3.
9778 @item max-hoist-depth
9779 The depth of search in the dominator tree for expressions to hoist.
9780 This is used to avoid quadratic behavior in hoisting algorithm.
9781 The value of 0 does not limit on the search, but may slow down compilation
9782 of huge functions.  The default value is 30.
9784 @item max-tail-merge-comparisons
9785 The maximum amount of similar bbs to compare a bb with.  This is used to
9786 avoid quadratic behavior in tree tail merging.  The default value is 10.
9788 @item max-tail-merge-iterations
9789 The maximum amount of iterations of the pass over the function.  This is used to
9790 limit compilation time in tree tail merging.  The default value is 2.
9792 @item max-unrolled-insns
9793 The maximum number of instructions that a loop may have to be unrolled.
9794 If a loop is unrolled, this parameter also determines how many times
9795 the loop code is unrolled.
9797 @item max-average-unrolled-insns
9798 The maximum number of instructions biased by probabilities of their execution
9799 that a loop may have to be unrolled.  If a loop is unrolled,
9800 this parameter also determines how many times the loop code is unrolled.
9802 @item max-unroll-times
9803 The maximum number of unrollings of a single loop.
9805 @item max-peeled-insns
9806 The maximum number of instructions that a loop may have to be peeled.
9807 If a loop is peeled, this parameter also determines how many times
9808 the loop code is peeled.
9810 @item max-peel-times
9811 The maximum number of peelings of a single loop.
9813 @item max-peel-branches
9814 The maximum number of branches on the hot path through the peeled sequence.
9816 @item max-completely-peeled-insns
9817 The maximum number of insns of a completely peeled loop.
9819 @item max-completely-peel-times
9820 The maximum number of iterations of a loop to be suitable for complete peeling.
9822 @item max-completely-peel-loop-nest-depth
9823 The maximum depth of a loop nest suitable for complete peeling.
9825 @item unrollpeel-codesize-threshold
9826 Maximum profile-based code size footprint estimate for loop unrolling and
9827 peeling.
9829 @item unrollpeel-hotness-threshold
9830 Maximum ratio of total execution count to loop entry block count under which
9831 most profile-based code size estimates will be ignored for loop unrolling and
9832 peeling.
9834 @item max-unswitch-insns
9835 The maximum number of insns of an unswitched loop.
9837 @item max-unswitch-level
9838 The maximum number of branches unswitched in a single loop.
9840 @item min-iter-unroll-with-branches
9841 Minimum iteration count to ignore branch effects when unrolling.
9843 @item unroll-outer-loop-branch-budget
9844 Maximum number of branches allowed in hot outer loop region after unroll.
9846 @item lim-expensive
9847 The minimum cost of an expensive expression in the loop invariant motion.
9849 @item iv-consider-all-candidates-bound
9850 Bound on number of candidates for induction variables, below which
9851 all candidates are considered for each use in induction variable
9852 optimizations.  If there are more candidates than this,
9853 only the most relevant ones are considered to avoid quadratic time complexity.
9855 @item iv-max-considered-uses
9856 The induction variable optimizations give up on loops that contain more
9857 induction variable uses.
9859 @item iv-always-prune-cand-set-bound
9860 If the number of candidates in the set is smaller than this value,
9861 always try to remove unnecessary ivs from the set
9862 when adding a new one.
9864 @item scev-max-expr-size
9865 Bound on size of expressions used in the scalar evolutions analyzer.
9866 Large expressions slow the analyzer.
9868 @item scev-max-expr-complexity
9869 Bound on the complexity of the expressions in the scalar evolutions analyzer.
9870 Complex expressions slow the analyzer.
9872 @item omega-max-vars
9873 The maximum number of variables in an Omega constraint system.
9874 The default value is 128.
9876 @item omega-max-geqs
9877 The maximum number of inequalities in an Omega constraint system.
9878 The default value is 256.
9880 @item omega-max-eqs
9881 The maximum number of equalities in an Omega constraint system.
9882 The default value is 128.
9884 @item omega-max-wild-cards
9885 The maximum number of wildcard variables that the Omega solver is
9886 able to insert.  The default value is 18.
9888 @item omega-hash-table-size
9889 The size of the hash table in the Omega solver.  The default value is
9890 550.
9892 @item omega-max-keys
9893 The maximal number of keys used by the Omega solver.  The default
9894 value is 500.
9896 @item omega-eliminate-redundant-constraints
9897 When set to 1, use expensive methods to eliminate all redundant
9898 constraints.  The default value is 0.
9900 @item vect-max-version-for-alignment-checks
9901 The maximum number of run-time checks that can be performed when
9902 doing loop versioning for alignment in the vectorizer. 
9904 @item vect-max-version-for-alias-checks
9905 The maximum number of run-time checks that can be performed when
9906 doing loop versioning for alias in the vectorizer. 
9908 @item vect-max-peeling-for-alignment
9909 The maximum number of loop peels to enhance access alignment
9910 for vectorizer. Value -1 means 'no limit'.
9912 @item max-iterations-to-track
9913 The maximum number of iterations of a loop the brute-force algorithm
9914 for analysis of the number of iterations of the loop tries to evaluate.
9916 @item hot-bb-count-ws-permille
9917 A basic block profile count is considered hot if it contributes to 
9918 the given permillage (i.e. 0...1000) of the entire profiled execution.
9920 @item hot-bb-frequency-fraction
9921 Select fraction of the entry block frequency of executions of basic block in
9922 function given basic block needs to have to be considered hot.
9924 @item max-predicted-iterations
9925 The maximum number of loop iterations we predict statically.  This is useful
9926 in cases where a function contains a single loop with known bound and
9927 another loop with unknown bound.
9928 The known number of iterations is predicted correctly, while
9929 the unknown number of iterations average to roughly 10.  This means that the
9930 loop without bounds appears artificially cold relative to the other one.
9932 @item builtin-expect-probability
9933 Control the probability of the expression having the specified value. This
9934 parameter takes a percentage (i.e. 0 ... 100) as input.
9935 The default probability of 90 is obtained empirically.
9937 @item align-threshold
9939 Select fraction of the maximal frequency of executions of a basic block in
9940 a function to align the basic block.
9942 @item align-loop-iterations
9944 A loop expected to iterate at least the selected number of iterations is
9945 aligned.
9947 @item tracer-dynamic-coverage
9948 @itemx tracer-dynamic-coverage-feedback
9950 This value is used to limit superblock formation once the given percentage of
9951 executed instructions is covered.  This limits unnecessary code size
9952 expansion.
9954 The @option{tracer-dynamic-coverage-feedback} is used only when profile
9955 feedback is available.  The real profiles (as opposed to statically estimated
9956 ones) are much less balanced allowing the threshold to be larger value.
9958 @item tracer-max-code-growth
9959 Stop tail duplication once code growth has reached given percentage.  This is
9960 a rather artificial limit, as most of the duplicates are eliminated later in
9961 cross jumping, so it may be set to much higher values than is the desired code
9962 growth.
9964 @item tracer-min-branch-ratio
9966 Stop reverse growth when the reverse probability of best edge is less than this
9967 threshold (in percent).
9969 @item tracer-min-branch-ratio
9970 @itemx tracer-min-branch-ratio-feedback
9972 Stop forward growth if the best edge has probability lower than this
9973 threshold.
9975 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
9976 compilation for profile feedback and one for compilation without.  The value
9977 for compilation with profile feedback needs to be more conservative (higher) in
9978 order to make tracer effective.
9980 @item max-cse-path-length
9982 The maximum number of basic blocks on path that CSE considers.
9983 The default is 10.
9985 @item max-cse-insns
9986 The maximum number of instructions CSE processes before flushing.
9987 The default is 1000.
9989 @item ggc-min-expand
9991 GCC uses a garbage collector to manage its own memory allocation.  This
9992 parameter specifies the minimum percentage by which the garbage
9993 collector's heap should be allowed to expand between collections.
9994 Tuning this may improve compilation speed; it has no effect on code
9995 generation.
9997 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
9998 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of ``RAM'' is
9999 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
10000 GCC is not able to calculate RAM on a particular platform, the lower
10001 bound of 30% is used.  Setting this parameter and
10002 @option{ggc-min-heapsize} to zero causes a full collection to occur at
10003 every opportunity.  This is extremely slow, but can be useful for
10004 debugging.
10006 @item ggc-min-heapsize
10008 Minimum size of the garbage collector's heap before it begins bothering
10009 to collect garbage.  The first collection occurs after the heap expands
10010 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
10011 tuning this may improve compilation speed, and has no effect on code
10012 generation.
10014 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit that
10015 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
10016 with a lower bound of 4096 (four megabytes) and an upper bound of
10017 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
10018 particular platform, the lower bound is used.  Setting this parameter
10019 very large effectively disables garbage collection.  Setting this
10020 parameter and @option{ggc-min-expand} to zero causes a full collection
10021 to occur at every opportunity.
10023 @item max-reload-search-insns
10024 The maximum number of instruction reload should look backward for equivalent
10025 register.  Increasing values mean more aggressive optimization, making the
10026 compilation time increase with probably slightly better performance.
10027 The default value is 100.
10029 @item max-cselib-memory-locations
10030 The maximum number of memory locations cselib should take into account.
10031 Increasing values mean more aggressive optimization, making the compilation time
10032 increase with probably slightly better performance.  The default value is 500.
10034 @item reorder-blocks-duplicate
10035 @itemx reorder-blocks-duplicate-feedback
10037 Used by the basic block reordering pass to decide whether to use unconditional
10038 branch or duplicate the code on its destination.  Code is duplicated when its
10039 estimated size is smaller than this value multiplied by the estimated size of
10040 unconditional jump in the hot spots of the program.
10042 The @option{reorder-block-duplicate-feedback} is used only when profile
10043 feedback is available.  It may be set to higher values than
10044 @option{reorder-block-duplicate} since information about the hot spots is more
10045 accurate.
10047 @item max-sched-ready-insns
10048 The maximum number of instructions ready to be issued the scheduler should
10049 consider at any given time during the first scheduling pass.  Increasing
10050 values mean more thorough searches, making the compilation time increase
10051 with probably little benefit.  The default value is 100.
10053 @item max-sched-region-blocks
10054 The maximum number of blocks in a region to be considered for
10055 interblock scheduling.  The default value is 10.
10057 @item max-pipeline-region-blocks
10058 The maximum number of blocks in a region to be considered for
10059 pipelining in the selective scheduler.  The default value is 15.
10061 @item max-sched-region-insns
10062 The maximum number of insns in a region to be considered for
10063 interblock scheduling.  The default value is 100.
10065 @item max-pipeline-region-insns
10066 The maximum number of insns in a region to be considered for
10067 pipelining in the selective scheduler.  The default value is 200.
10069 @item min-spec-prob
10070 The minimum probability (in percents) of reaching a source block
10071 for interblock speculative scheduling.  The default value is 40.
10073 @item max-sched-extend-regions-iters
10074 The maximum number of iterations through CFG to extend regions.
10075 A value of 0 (the default) disables region extensions.
10077 @item max-sched-insn-conflict-delay
10078 The maximum conflict delay for an insn to be considered for speculative motion.
10079 The default value is 3.
10081 @item sched-spec-prob-cutoff
10082 The minimal probability of speculation success (in percents), so that
10083 speculative insns are scheduled.
10084 The default value is 40.
10086 @item sched-spec-state-edge-prob-cutoff
10087 The minimum probability an edge must have for the scheduler to save its
10088 state across it.
10089 The default value is 10.
10091 @item sched-mem-true-dep-cost
10092 Minimal distance (in CPU cycles) between store and load targeting same
10093 memory locations.  The default value is 1.
10095 @item selsched-max-lookahead
10096 The maximum size of the lookahead window of selective scheduling.  It is a
10097 depth of search for available instructions.
10098 The default value is 50.
10100 @item selsched-max-sched-times
10101 The maximum number of times that an instruction is scheduled during
10102 selective scheduling.  This is the limit on the number of iterations
10103 through which the instruction may be pipelined.  The default value is 2.
10105 @item selsched-max-insns-to-rename
10106 The maximum number of best instructions in the ready list that are considered
10107 for renaming in the selective scheduler.  The default value is 2.
10109 @item sms-min-sc
10110 The minimum value of stage count that swing modulo scheduler
10111 generates.  The default value is 2.
10113 @item max-last-value-rtl
10114 The maximum size measured as number of RTLs that can be recorded in an expression
10115 in combiner for a pseudo register as last known value of that register.  The default
10116 is 10000.
10118 @item integer-share-limit
10119 Small integer constants can use a shared data structure, reducing the
10120 compiler's memory usage and increasing its speed.  This sets the maximum
10121 value of a shared integer constant.  The default value is 256.
10123 @item ssp-buffer-size
10124 The minimum size of buffers (i.e.@: arrays) that receive stack smashing
10125 protection when @option{-fstack-protection} is used.
10127 @item min-size-for-stack-sharing
10128 The minimum size of variables taking part in stack slot sharing when not
10129 optimizing. The default value is 32.
10131 @item max-jump-thread-duplication-stmts
10132 Maximum number of statements allowed in a block that needs to be
10133 duplicated when threading jumps.
10135 @item max-fields-for-field-sensitive
10136 Maximum number of fields in a structure treated in
10137 a field sensitive manner during pointer analysis.  The default is zero
10138 for @option{-O0} and @option{-O1},
10139 and 100 for @option{-Os}, @option{-O2}, and @option{-O3}.
10141 @item prefetch-latency
10142 Estimate on average number of instructions that are executed before
10143 prefetch finishes.  The distance prefetched ahead is proportional
10144 to this constant.  Increasing this number may also lead to less
10145 streams being prefetched (see @option{simultaneous-prefetches}).
10147 @item simultaneous-prefetches
10148 Maximum number of prefetches that can run at the same time.
10150 @item l1-cache-line-size
10151 The size of cache line in L1 cache, in bytes.
10153 @item l1-cache-size
10154 The size of L1 cache, in kilobytes.
10156 @item l2-cache-size
10157 The size of L2 cache, in kilobytes.
10159 @item min-insn-to-prefetch-ratio
10160 The minimum ratio between the number of instructions and the
10161 number of prefetches to enable prefetching in a loop.
10163 @item prefetch-min-insn-to-mem-ratio
10164 The minimum ratio between the number of instructions and the
10165 number of memory references to enable prefetching in a loop.
10167 @item use-canonical-types
10168 Whether the compiler should use the ``canonical'' type system.  By
10169 default, this should always be 1, which uses a more efficient internal
10170 mechanism for comparing types in C++ and Objective-C++.  However, if
10171 bugs in the canonical type system are causing compilation failures,
10172 set this value to 0 to disable canonical types.
10174 @item switch-conversion-max-branch-ratio
10175 Switch initialization conversion refuses to create arrays that are
10176 bigger than @option{switch-conversion-max-branch-ratio} times the number of
10177 branches in the switch.
10179 @item max-partial-antic-length
10180 Maximum length of the partial antic set computed during the tree
10181 partial redundancy elimination optimization (@option{-ftree-pre}) when
10182 optimizing at @option{-O3} and above.  For some sorts of source code
10183 the enhanced partial redundancy elimination optimization can run away,
10184 consuming all of the memory available on the host machine.  This
10185 parameter sets a limit on the length of the sets that are computed,
10186 which prevents the runaway behavior.  Setting a value of 0 for
10187 this parameter allows an unlimited set length.
10189 @item sccvn-max-scc-size
10190 Maximum size of a strongly connected component (SCC) during SCCVN
10191 processing.  If this limit is hit, SCCVN processing for the whole
10192 function is not done and optimizations depending on it are
10193 disabled.  The default maximum SCC size is 10000.
10195 @item sccvn-max-alias-queries-per-access
10196 Maximum number of alias-oracle queries we perform when looking for
10197 redundancies for loads and stores.  If this limit is hit the search
10198 is aborted and the load or store is not considered redundant.  The
10199 number of queries is algorithmically limited to the number of
10200 stores on all paths from the load to the function entry.
10201 The default maxmimum number of queries is 1000.
10203 @item ira-max-loops-num
10204 IRA uses regional register allocation by default.  If a function
10205 contains more loops than the number given by this parameter, only at most
10206 the given number of the most frequently-executed loops form regions
10207 for regional register allocation.  The default value of the
10208 parameter is 100.
10210 @item ira-max-conflict-table-size 
10211 Although IRA uses a sophisticated algorithm to compress the conflict
10212 table, the table can still require excessive amounts of memory for
10213 huge functions.  If the conflict table for a function could be more
10214 than the size in MB given by this parameter, the register allocator
10215 instead uses a faster, simpler, and lower-quality
10216 algorithm that does not require building a pseudo-register conflict table.  
10217 The default value of the parameter is 2000.
10219 @item ira-loop-reserved-regs
10220 IRA can be used to evaluate more accurate register pressure in loops
10221 for decisions to move loop invariants (see @option{-O3}).  The number
10222 of available registers reserved for some other purposes is given
10223 by this parameter.  The default value of the parameter is 2, which is
10224 the minimal number of registers needed by typical instructions.
10225 This value is the best found from numerous experiments.
10227 @item loop-invariant-max-bbs-in-loop
10228 Loop invariant motion can be very expensive, both in compilation time and
10229 in amount of needed compile-time memory, with very large loops.  Loops
10230 with more basic blocks than this parameter won't have loop invariant
10231 motion optimization performed on them.  The default value of the
10232 parameter is 1000 for @option{-O1} and 10000 for @option{-O2} and above.
10234 @item loop-max-datarefs-for-datadeps
10235 Building data dapendencies is expensive for very large loops.  This
10236 parameter limits the number of data references in loops that are
10237 considered for data dependence analysis.  These large loops are no
10238 handled by the optimizations using loop data dependencies.
10239 The default value is 1000.
10241 @item max-vartrack-size
10242 Sets a maximum number of hash table slots to use during variable
10243 tracking dataflow analysis of any function.  If this limit is exceeded
10244 with variable tracking at assignments enabled, analysis for that
10245 function is retried without it, after removing all debug insns from
10246 the function.  If the limit is exceeded even without debug insns, var
10247 tracking analysis is completely disabled for the function.  Setting
10248 the parameter to zero makes it unlimited.
10250 @item max-vartrack-expr-depth
10251 Sets a maximum number of recursion levels when attempting to map
10252 variable names or debug temporaries to value expressions.  This trades
10253 compilation time for more complete debug information.  If this is set too
10254 low, value expressions that are available and could be represented in
10255 debug information may end up not being used; setting this higher may
10256 enable the compiler to find more complex debug expressions, but compile
10257 time and memory use may grow.  The default is 12.
10259 @item min-nondebug-insn-uid
10260 Use uids starting at this parameter for nondebug insns.  The range below
10261 the parameter is reserved exclusively for debug insns created by
10262 @option{-fvar-tracking-assignments}, but debug insns may get
10263 (non-overlapping) uids above it if the reserved range is exhausted.
10265 @item ipa-sra-ptr-growth-factor
10266 IPA-SRA replaces a pointer to an aggregate with one or more new
10267 parameters only when their cumulative size is less or equal to
10268 @option{ipa-sra-ptr-growth-factor} times the size of the original
10269 pointer parameter.
10271 @item tm-max-aggregate-size
10272 When making copies of thread-local variables in a transaction, this
10273 parameter specifies the size in bytes after which variables are
10274 saved with the logging functions as opposed to save/restore code
10275 sequence pairs.  This option only applies when using
10276 @option{-fgnu-tm}.
10278 @item graphite-max-nb-scop-params
10279 To avoid exponential effects in the Graphite loop transforms, the
10280 number of parameters in a Static Control Part (SCoP) is bounded.  The
10281 default value is 10 parameters.  A variable whose value is unknown at
10282 compilation time and defined outside a SCoP is a parameter of the SCoP.
10284 @item graphite-max-bbs-per-function
10285 To avoid exponential effects in the detection of SCoPs, the size of
10286 the functions analyzed by Graphite is bounded.  The default value is
10287 100 basic blocks.
10289 @item loop-block-tile-size
10290 Loop blocking or strip mining transforms, enabled with
10291 @option{-floop-block} or @option{-floop-strip-mine}, strip mine each
10292 loop in the loop nest by a given number of iterations.  The strip
10293 length can be changed using the @option{loop-block-tile-size}
10294 parameter.  The default value is 51 iterations.
10296 @item ipa-cp-value-list-size
10297 IPA-CP attempts to track all possible values and types passed to a function's
10298 parameter in order to propagate them and perform devirtualization.
10299 @option{ipa-cp-value-list-size} is the maximum number of values and types it
10300 stores per one formal parameter of a function.
10302 @item ipa-cp-eval-threshold
10303 IPA-CP calculates its own score of cloning profitability heuristics
10304 and performs those cloning opportunities with scores that exceed
10305 @option{ipa-cp-eval-threshold}.
10307 @item ipa-max-agg-items
10308 IPA-CP is also capable to propagate a number of scalar values passed
10309 in an aggregate. @option{ipa-max-agg-items} controls the maximum
10310 number of such values per one parameter.
10312 @item ipa-cp-loop-hint-bonus
10313 When IPA-CP determines that a cloning candidate would make the number
10314 of iterations of a loop known, it adds a bonus of
10315 @option{ipa-cp-loop-hint-bonus} bonus to the profitability score of
10316 the candidate.
10318 @item ipa-cp-array-index-hint-bonus
10319 When IPA-CP determines that a cloning candidate would make the index of
10320 an array access known, it adds a bonus of
10321 @option{ipa-cp-array-index-hint-bonus} bonus to the profitability
10322 score of the candidate.
10324 @item lto-partitions
10325 Specify desired number of partitions produced during WHOPR compilation.
10326 The number of partitions should exceed the number of CPUs used for compilation.
10327 The default value is 32.
10329 @item lto-minpartition
10330 Size of minimal partition for WHOPR (in estimated instructions).
10331 This prevents expenses of splitting very small programs into too many
10332 partitions.
10334 @item cxx-max-namespaces-for-diagnostic-help
10335 The maximum number of namespaces to consult for suggestions when C++
10336 name lookup fails for an identifier.  The default is 1000.
10338 @item sink-frequency-threshold
10339 The maximum relative execution frequency (in percents) of the target block
10340 relative to a statement's original block to allow statement sinking of a
10341 statement.  Larger numbers result in more aggressive statement sinking.
10342 The default value is 75.  A small positive adjustment is applied for
10343 statements with memory operands as those are even more profitable so sink.
10345 @item max-stores-to-sink
10346 The maximum number of conditional stores paires that can be sunk.  Set to 0
10347 if either vectorization (@option{-ftree-vectorize}) or if-conversion
10348 (@option{-ftree-loop-if-convert}) is disabled.  The default is 2.
10350 @item allow-load-data-races
10351 Allow optimizers to introduce new data races on loads.
10352 Set to 1 to allow, otherwise to 0.  This option is enabled by default
10353 unless implicitly set by the @option{-fmemory-model=} option.
10355 @item allow-store-data-races
10356 Allow optimizers to introduce new data races on stores.
10357 Set to 1 to allow, otherwise to 0.  This option is enabled by default
10358 unless implicitly set by the @option{-fmemory-model=} option.
10360 @item allow-packed-load-data-races
10361 Allow optimizers to introduce new data races on packed data loads.
10362 Set to 1 to allow, otherwise to 0.  This option is enabled by default
10363 unless implicitly set by the @option{-fmemory-model=} option.
10365 @item allow-packed-store-data-races
10366 Allow optimizers to introduce new data races on packed data stores.
10367 Set to 1 to allow, otherwise to 0.  This option is enabled by default
10368 unless implicitly set by the @option{-fmemory-model=} option.
10370 @item case-values-threshold
10371 The smallest number of different values for which it is best to use a
10372 jump-table instead of a tree of conditional branches.  If the value is
10373 0, use the default for the machine.  The default is 0.
10375 @item tree-reassoc-width
10376 Set the maximum number of instructions executed in parallel in
10377 reassociated tree. This parameter overrides target dependent
10378 heuristics used by default if has non zero value.
10380 @item sched-pressure-algorithm
10381 Choose between the two available implementations of
10382 @option{-fsched-pressure}.  Algorithm 1 is the original implementation
10383 and is the more likely to prevent instructions from being reordered.
10384 Algorithm 2 was designed to be a compromise between the relatively
10385 conservative approach taken by algorithm 1 and the rather aggressive
10386 approach taken by the default scheduler.  It relies more heavily on
10387 having a regular register file and accurate register pressure classes.
10388 See @file{haifa-sched.c} in the GCC sources for more details.
10390 The default choice depends on the target.
10392 @item max-slsr-cand-scan
10393 Set the maximum number of existing candidates that will be considered when
10394 seeking a basis for a new straight-line strength reduction candidate.
10396 @item coverage-callback
10397 Set to 1 to instrument a callback function together with
10398 arc counter update. The name of the callback function
10399 is "__coverage_callback".
10401 @item coverage-exec_once
10402 Set to 1 to update each arc counter only once.
10404 @item asan-globals
10405 Enable buffer overflow detection for global objects.  This kind
10406 of protection is enabled by default if you are using
10407 @option{-fsanitize=address} option.
10408 To disable global objects protection use @option{--param asan-globals=0}.
10410 @item asan-stack
10411 Enable buffer overflow detection for stack objects.  This kind of
10412 protection is enabled by default when using@option{-fsanitize=address}.
10413 To disable stack protection use @option{--param asan-stack=0} option.
10415 @item asan-instrument-reads
10416 Enable buffer overflow detection for memory reads.  This kind of
10417 protection is enabled by default when using @option{-fsanitize=address}.
10418 To disable memory reads protection use
10419 @option{--param asan-instrument-reads=0}.
10421 @item asan-instrument-writes
10422 Enable buffer overflow detection for memory writes.  This kind of
10423 protection is enabled by default when using @option{-fsanitize=address}.
10424 To disable memory writes protection use
10425 @option{--param asan-instrument-writes=0} option.
10427 @item asan-memintrin
10428 Enable detection for built-in functions.  This kind of protection
10429 is enabled by default when using @option{-fsanitize=address}.
10430 To disable built-in functions protection use
10431 @option{--param asan-memintrin=0}.
10433 @item asan-use-after-return
10434 Enable detection of use-after-return.  This kind of protection
10435 is enabled by default when using @option{-fsanitize=address} option.
10436 To disable use-after-return detection use 
10437 @option{--param asan-use-after-return=0}.
10439 @item asan-instrumentation-with-call-threshold
10440 If number of memory accesses in function being instrumented
10441 is greater or equal to this number, use callbacks instead of inline checks.
10442 E.g. to disable inline code use
10443 @option{--param asan-instrumentation-with-call-threshold=0}.
10445 @end table
10446 @end table
10448 @node Preprocessor Options
10449 @section Options Controlling the Preprocessor
10450 @cindex preprocessor options
10451 @cindex options, preprocessor
10453 These options control the C preprocessor, which is run on each C source
10454 file before actual compilation.
10456 If you use the @option{-E} option, nothing is done except preprocessing.
10457 Some of these options make sense only together with @option{-E} because
10458 they cause the preprocessor output to be unsuitable for actual
10459 compilation.
10461 @table @gcctabopt
10462 @item -Wp,@var{option}
10463 @opindex Wp
10464 You can use @option{-Wp,@var{option}} to bypass the compiler driver
10465 and pass @var{option} directly through to the preprocessor.  If
10466 @var{option} contains commas, it is split into multiple options at the
10467 commas.  However, many options are modified, translated or interpreted
10468 by the compiler driver before being passed to the preprocessor, and
10469 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
10470 interface is undocumented and subject to change, so whenever possible
10471 you should avoid using @option{-Wp} and let the driver handle the
10472 options instead.
10474 @item -Xpreprocessor @var{option}
10475 @opindex Xpreprocessor
10476 Pass @var{option} as an option to the preprocessor.  You can use this to
10477 supply system-specific preprocessor options that GCC does not 
10478 recognize.
10480 If you want to pass an option that takes an argument, you must use
10481 @option{-Xpreprocessor} twice, once for the option and once for the argument.
10483 @item -no-integrated-cpp
10484 @opindex no-integrated-cpp
10485 Perform preprocessing as a separate pass before compilation.
10486 By default, GCC performs preprocessing as an integrated part of
10487 input tokenization and parsing.
10488 If this option is provided, the appropriate language front end
10489 (@command{cc1}, @command{cc1plus}, or @command{cc1obj} for C, C++,
10490 and Objective-C, respectively) is instead invoked twice,
10491 once for preprocessing only and once for actual compilation
10492 of the preprocessed input.
10493 This option may be useful in conjunction with the @option{-B} or
10494 @option{-wrapper} options to specify an alternate preprocessor or
10495 perform additional processing of the program source between
10496 normal preprocessing and compilation.
10497 @end table
10499 @include cppopts.texi
10501 @node Assembler Options
10502 @section Passing Options to the Assembler
10504 @c prevent bad page break with this line
10505 You can pass options to the assembler.
10507 @table @gcctabopt
10508 @item -Wa,@var{option}
10509 @opindex Wa
10510 Pass @var{option} as an option to the assembler.  If @var{option}
10511 contains commas, it is split into multiple options at the commas.
10513 @item -Xassembler @var{option}
10514 @opindex Xassembler
10515 Pass @var{option} as an option to the assembler.  You can use this to
10516 supply system-specific assembler options that GCC does not
10517 recognize.
10519 If you want to pass an option that takes an argument, you must use
10520 @option{-Xassembler} twice, once for the option and once for the argument.
10522 @item profile-generate-sampling-rate
10523 Set the sampling rate with @option{-fprofile-generate-sampling}.
10525 @end table
10527 @node Link Options
10528 @section Options for Linking
10529 @cindex link options
10530 @cindex options, linking
10532 These options come into play when the compiler links object files into
10533 an executable output file.  They are meaningless if the compiler is
10534 not doing a link step.
10536 @table @gcctabopt
10537 @cindex file names
10538 @item @var{object-file-name}
10539 A file name that does not end in a special recognized suffix is
10540 considered to name an object file or library.  (Object files are
10541 distinguished from libraries by the linker according to the file
10542 contents.)  If linking is done, these object files are used as input
10543 to the linker.
10545 @item -c
10546 @itemx -S
10547 @itemx -E
10548 @opindex c
10549 @opindex S
10550 @opindex E
10551 If any of these options is used, then the linker is not run, and
10552 object file names should not be used as arguments.  @xref{Overall
10553 Options}.
10555 @cindex Libraries
10556 @item -l@var{library}
10557 @itemx -l @var{library}
10558 @opindex l
10559 Search the library named @var{library} when linking.  (The second
10560 alternative with the library as a separate argument is only for
10561 POSIX compliance and is not recommended.)
10563 It makes a difference where in the command you write this option; the
10564 linker searches and processes libraries and object files in the order they
10565 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
10566 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
10567 to functions in @samp{z}, those functions may not be loaded.
10569 The linker searches a standard list of directories for the library,
10570 which is actually a file named @file{lib@var{library}.a}.  The linker
10571 then uses this file as if it had been specified precisely by name.
10573 The directories searched include several standard system directories
10574 plus any that you specify with @option{-L}.
10576 Normally the files found this way are library files---archive files
10577 whose members are object files.  The linker handles an archive file by
10578 scanning through it for members which define symbols that have so far
10579 been referenced but not defined.  But if the file that is found is an
10580 ordinary object file, it is linked in the usual fashion.  The only
10581 difference between using an @option{-l} option and specifying a file name
10582 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
10583 and searches several directories.
10585 @item -lobjc
10586 @opindex lobjc
10587 You need this special case of the @option{-l} option in order to
10588 link an Objective-C or Objective-C++ program.
10590 @item -nostartfiles
10591 @opindex nostartfiles
10592 Do not use the standard system startup files when linking.
10593 The standard system libraries are used normally, unless @option{-nostdlib}
10594 or @option{-nodefaultlibs} is used.
10596 @item -nodefaultlibs
10597 @opindex nodefaultlibs
10598 Do not use the standard system libraries when linking.
10599 Only the libraries you specify are passed to the linker, and options
10600 specifying linkage of the system libraries, such as @code{-static-libgcc}
10601 or @code{-shared-libgcc}, are ignored.  
10602 The standard startup files are used normally, unless @option{-nostartfiles}
10603 is used.  
10605 The compiler may generate calls to @code{memcmp},
10606 @code{memset}, @code{memcpy} and @code{memmove}.
10607 These entries are usually resolved by entries in
10608 libc.  These entry points should be supplied through some other
10609 mechanism when this option is specified.
10611 @item -no-pie
10612 @opindex no-pie
10613 Produce a position dependent executable.  This is the negative of option
10614 @option{-pie} which produces a position independent executable.
10616 @item -nostdlib
10617 @opindex nostdlib
10618 Do not use the standard system startup files or libraries when linking.
10619 No startup files and only the libraries you specify are passed to
10620 the linker, and options specifying linkage of the system libraries, such as
10621 @code{-static-libgcc} or @code{-shared-libgcc}, are ignored.
10623 The compiler may generate calls to @code{memcmp}, @code{memset},
10624 @code{memcpy} and @code{memmove}.
10625 These entries are usually resolved by entries in
10626 libc.  These entry points should be supplied through some other
10627 mechanism when this option is specified.
10629 @cindex @option{-lgcc}, use with @option{-nostdlib}
10630 @cindex @option{-nostdlib} and unresolved references
10631 @cindex unresolved references and @option{-nostdlib}
10632 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
10633 @cindex @option{-nodefaultlibs} and unresolved references
10634 @cindex unresolved references and @option{-nodefaultlibs}
10635 One of the standard libraries bypassed by @option{-nostdlib} and
10636 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
10637 which GCC uses to overcome shortcomings of particular machines, or special
10638 needs for some languages.
10639 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
10640 Collection (GCC) Internals},
10641 for more discussion of @file{libgcc.a}.)
10642 In most cases, you need @file{libgcc.a} even when you want to avoid
10643 other standard libraries.  In other words, when you specify @option{-nostdlib}
10644 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
10645 This ensures that you have no unresolved references to internal GCC
10646 library subroutines.
10647 (An example of such an internal subroutine is @samp{__main}, used to ensure C++
10648 constructors are called; @pxref{Collect2,,@code{collect2}, gccint,
10649 GNU Compiler Collection (GCC) Internals}.)
10651 @item -pie
10652 @opindex pie
10653 Produce a position independent executable on targets that support it.
10654 For predictable results, you must also specify the same set of options
10655 used for compilation (@option{-fpie}, @option{-fPIE},
10656 or model suboptions) when you specify this linker option.
10658 @item -rdynamic
10659 @opindex rdynamic
10660 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
10661 that support it. This instructs the linker to add all symbols, not
10662 only used ones, to the dynamic symbol table. This option is needed
10663 for some uses of @code{dlopen} or to allow obtaining backtraces
10664 from within a program.
10666 @item -s
10667 @opindex s
10668 Remove all symbol table and relocation information from the executable.
10670 @item -static
10671 @opindex static
10672 On systems that support dynamic linking, this prevents linking with the shared
10673 libraries.  On other systems, this option has no effect.
10675 @item -shared
10676 @opindex shared
10677 Produce a shared object which can then be linked with other objects to
10678 form an executable.  Not all systems support this option.  For predictable
10679 results, you must also specify the same set of options used for compilation
10680 (@option{-fpic}, @option{-fPIC}, or model suboptions) when
10681 you specify this linker option.@footnote{On some systems, @samp{gcc -shared}
10682 needs to build supplementary stub code for constructors to work.  On
10683 multi-libbed systems, @samp{gcc -shared} must select the correct support
10684 libraries to link against.  Failing to supply the correct flags may lead
10685 to subtle defects.  Supplying them in cases where they are not necessary
10686 is innocuous.}
10688 @item -shared-libgcc
10689 @itemx -static-libgcc
10690 @opindex shared-libgcc
10691 @opindex static-libgcc
10692 On systems that provide @file{libgcc} as a shared library, these options
10693 force the use of either the shared or static version, respectively.
10694 If no shared version of @file{libgcc} was built when the compiler was
10695 configured, these options have no effect.
10697 There are several situations in which an application should use the
10698 shared @file{libgcc} instead of the static version.  The most common
10699 of these is when the application wishes to throw and catch exceptions
10700 across different shared libraries.  In that case, each of the libraries
10701 as well as the application itself should use the shared @file{libgcc}.
10703 Therefore, the G++ and GCJ drivers automatically add
10704 @option{-shared-libgcc} whenever you build a shared library or a main
10705 executable, because C++ and Java programs typically use exceptions, so
10706 this is the right thing to do.
10708 If, instead, you use the GCC driver to create shared libraries, you may
10709 find that they are not always linked with the shared @file{libgcc}.
10710 If GCC finds, at its configuration time, that you have a non-GNU linker
10711 or a GNU linker that does not support option @option{--eh-frame-hdr},
10712 it links the shared version of @file{libgcc} into shared libraries
10713 by default.  Otherwise, it takes advantage of the linker and optimizes
10714 away the linking with the shared version of @file{libgcc}, linking with
10715 the static version of libgcc by default.  This allows exceptions to
10716 propagate through such shared libraries, without incurring relocation
10717 costs at library load time.
10719 However, if a library or main executable is supposed to throw or catch
10720 exceptions, you must link it using the G++ or GCJ driver, as appropriate
10721 for the languages used in the program, or using the option
10722 @option{-shared-libgcc}, such that it is linked with the shared
10723 @file{libgcc}.
10725 @item -static-libasan
10726 @opindex static-libasan
10727 When the @option{-fsanitize=address} option is used to link a program,
10728 the GCC driver automatically links against @option{libasan}.  If
10729 @file{libasan} is available as a shared library, and the @option{-static}
10730 option is not used, then this links against the shared version of
10731 @file{libasan}.  The @option{-static-libasan} option directs the GCC
10732 driver to link @file{libasan} statically, without necessarily linking
10733 other libraries statically.
10735 @item -static-libtsan
10736 @opindex static-libtsan
10737 When the @option{-fsanitize=thread} option is used to link a program,
10738 the GCC driver automatically links against @option{libtsan}.  If
10739 @file{libtsan} is available as a shared library, and the @option{-static}
10740 option is not used, then this links against the shared version of
10741 @file{libtsan}.  The @option{-static-libtsan} option directs the GCC
10742 driver to link @file{libtsan} statically, without necessarily linking
10743 other libraries statically.
10745 @item -static-liblsan
10746 @opindex static-liblsan
10747 When the @option{-fsanitize=leak} option is used to link a program,
10748 the GCC driver automatically links against @option{liblsan}.  If
10749 @file{liblsan} is available as a shared library, and the @option{-static}
10750 option is not used, then this links against the shared version of
10751 @file{liblsan}.  The @option{-static-liblsan} option directs the GCC
10752 driver to link @file{liblsan} statically, without necessarily linking
10753 other libraries statically.
10755 @item -static-libubsan
10756 @opindex static-libubsan
10757 When the @option{-fsanitize=undefined} option is used to link a program,
10758 the GCC driver automatically links against @option{libubsan}.  If
10759 @file{libubsan} is available as a shared library, and the @option{-static}
10760 option is not used, then this links against the shared version of
10761 @file{libubsan}.  The @option{-static-libubsan} option directs the GCC
10762 driver to link @file{libubsan} statically, without necessarily linking
10763 other libraries statically.
10765 @item -static-libstdc++
10766 @opindex static-libstdc++
10767 When the @command{g++} program is used to link a C++ program, it
10768 normally automatically links against @option{libstdc++}.  If
10769 @file{libstdc++} is available as a shared library, and the
10770 @option{-static} option is not used, then this links against the
10771 shared version of @file{libstdc++}.  That is normally fine.  However, it
10772 is sometimes useful to freeze the version of @file{libstdc++} used by
10773 the program without going all the way to a fully static link.  The
10774 @option{-static-libstdc++} option directs the @command{g++} driver to
10775 link @file{libstdc++} statically, without necessarily linking other
10776 libraries statically.
10778 @item -symbolic
10779 @opindex symbolic
10780 Bind references to global symbols when building a shared object.  Warn
10781 about any unresolved references (unless overridden by the link editor
10782 option @option{-Xlinker -z -Xlinker defs}).  Only a few systems support
10783 this option.
10785 @item -T @var{script}
10786 @opindex T
10787 @cindex linker script
10788 Use @var{script} as the linker script.  This option is supported by most
10789 systems using the GNU linker.  On some targets, such as bare-board
10790 targets without an operating system, the @option{-T} option may be required
10791 when linking to avoid references to undefined symbols.
10793 @item -Xclang-only @var{option}
10794 @opindex Xclang-only
10795 Ignore @var{option}.  This is used by some custom drivers to pass options
10796 to Clang but not GCC.
10798 @item -Xlinker @var{option}
10799 @opindex Xlinker
10800 Pass @var{option} as an option to the linker.  You can use this to
10801 supply system-specific linker options that GCC does not recognize.
10803 If you want to pass an option that takes a separate argument, you must use
10804 @option{-Xlinker} twice, once for the option and once for the argument.
10805 For example, to pass @option{-assert definitions}, you must write
10806 @option{-Xlinker -assert -Xlinker definitions}.  It does not work to write
10807 @option{-Xlinker "-assert definitions"}, because this passes the entire
10808 string as a single argument, which is not what the linker expects.
10810 When using the GNU linker, it is usually more convenient to pass
10811 arguments to linker options using the @option{@var{option}=@var{value}}
10812 syntax than as separate arguments.  For example, you can specify
10813 @option{-Xlinker -Map=output.map} rather than
10814 @option{-Xlinker -Map -Xlinker output.map}.  Other linkers may not support
10815 this syntax for command-line options.
10817 @item -Wl,@var{option}
10818 @opindex Wl
10819 Pass @var{option} as an option to the linker.  If @var{option} contains
10820 commas, it is split into multiple options at the commas.  You can use this
10821 syntax to pass an argument to the option.
10822 For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
10823 linker.  When using the GNU linker, you can also get the same effect with
10824 @option{-Wl,-Map=output.map}.
10826 @item -u @var{symbol}
10827 @opindex u
10828 Pretend the symbol @var{symbol} is undefined, to force linking of
10829 library modules to define it.  You can use @option{-u} multiple times with
10830 different symbols to force loading of additional library modules.
10831 @end table
10833 @node Directory Options
10834 @section Options for Directory Search
10835 @cindex directory options
10836 @cindex options, directory search
10837 @cindex search path
10839 These options specify directories to search for header files, for
10840 libraries and for parts of the compiler:
10842 @table @gcctabopt
10843 @item -I@var{dir}
10844 @opindex I
10845 Add the directory @var{dir} to the head of the list of directories to be
10846 searched for header files.  This can be used to override a system header
10847 file, substituting your own version, since these directories are
10848 searched before the system header file directories.  However, you should
10849 not use this option to add directories that contain vendor-supplied
10850 system header files (use @option{-isystem} for that).  If you use more than
10851 one @option{-I} option, the directories are scanned in left-to-right
10852 order; the standard system directories come after.
10854 If a standard system include directory, or a directory specified with
10855 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
10856 option is ignored.  The directory is still searched but as a
10857 system directory at its normal position in the system include chain.
10858 This is to ensure that GCC's procedure to fix buggy system headers and
10859 the ordering for the @code{include_next} directive are not inadvertently changed.
10860 If you really need to change the search order for system directories,
10861 use the @option{-nostdinc} and/or @option{-isystem} options.
10863 @item -iplugindir=@var{dir}
10864 @opindex iplugindir=
10865 Set the directory to search for plugins that are passed
10866 by @option{-fplugin=@var{name}} instead of
10867 @option{-fplugin=@var{path}/@var{name}.so}.  This option is not meant
10868 to be used by the user, but only passed by the driver.
10870 @item -iquote@var{dir}
10871 @opindex iquote
10872 Add the directory @var{dir} to the head of the list of directories to
10873 be searched for header files only for the case of @samp{#include
10874 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
10875 otherwise just like @option{-I}.
10877 @item -L@var{dir}
10878 @opindex L
10879 Add directory @var{dir} to the list of directories to be searched
10880 for @option{-l}.
10882 @item -B@var{prefix}
10883 @opindex B
10884 This option specifies where to find the executables, libraries,
10885 include files, and data files of the compiler itself.
10887 The compiler driver program runs one or more of the subprograms
10888 @command{cpp}, @command{cc1}, @command{as} and @command{ld}.  It tries
10889 @var{prefix} as a prefix for each program it tries to run, both with and
10890 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
10892 For each subprogram to be run, the compiler driver first tries the
10893 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
10894 is not specified, the driver tries two standard prefixes, 
10895 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
10896 those results in a file name that is found, the unmodified program
10897 name is searched for using the directories specified in your
10898 @env{PATH} environment variable.
10900 The compiler checks to see if the path provided by the @option{-B}
10901 refers to a directory, and if necessary it adds a directory
10902 separator character at the end of the path.
10904 @option{-B} prefixes that effectively specify directory names also apply
10905 to libraries in the linker, because the compiler translates these
10906 options into @option{-L} options for the linker.  They also apply to
10907 include files in the preprocessor, because the compiler translates these
10908 options into @option{-isystem} options for the preprocessor.  In this case,
10909 the compiler appends @samp{include} to the prefix.
10911 The runtime support file @file{libgcc.a} can also be searched for using
10912 the @option{-B} prefix, if needed.  If it is not found there, the two
10913 standard prefixes above are tried, and that is all.  The file is left
10914 out of the link if it is not found by those means.
10916 Another way to specify a prefix much like the @option{-B} prefix is to use
10917 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
10918 Variables}.
10920 As a special kludge, if the path provided by @option{-B} is
10921 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
10922 9, then it is replaced by @file{[dir/]include}.  This is to help
10923 with boot-strapping the compiler.
10925 @item -specs=@var{file}
10926 @opindex specs
10927 Process @var{file} after the compiler reads in the standard @file{specs}
10928 file, in order to override the defaults which the @command{gcc} driver
10929 program uses when determining what switches to pass to @command{cc1},
10930 @command{cc1plus}, @command{as}, @command{ld}, etc.  More than one
10931 @option{-specs=@var{file}} can be specified on the command line, and they
10932 are processed in order, from left to right.
10934 @item --sysroot=@var{dir}
10935 @opindex sysroot
10936 Use @var{dir} as the logical root directory for headers and libraries.
10937 For example, if the compiler normally searches for headers in
10938 @file{/usr/include} and libraries in @file{/usr/lib}, it instead
10939 searches @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
10941 If you use both this option and the @option{-isysroot} option, then
10942 the @option{--sysroot} option applies to libraries, but the
10943 @option{-isysroot} option applies to header files.
10945 The GNU linker (beginning with version 2.16) has the necessary support
10946 for this option.  If your linker does not support this option, the
10947 header file aspect of @option{--sysroot} still works, but the
10948 library aspect does not.
10950 @item --no-sysroot-suffix
10951 @opindex no-sysroot-suffix
10952 For some targets, a suffix is added to the root directory specified
10953 with @option{--sysroot}, depending on the other options used, so that
10954 headers may for example be found in
10955 @file{@var{dir}/@var{suffix}/usr/include} instead of
10956 @file{@var{dir}/usr/include}.  This option disables the addition of
10957 such a suffix.
10959 @item -I-
10960 @opindex I-
10961 This option has been deprecated.  Please use @option{-iquote} instead for
10962 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
10963 Any directories you specify with @option{-I} options before the @option{-I-}
10964 option are searched only for the case of @samp{#include "@var{file}"};
10965 they are not searched for @samp{#include <@var{file}>}.
10967 If additional directories are specified with @option{-I} options after
10968 the @option{-I-}, these directories are searched for all @samp{#include}
10969 directives.  (Ordinarily @emph{all} @option{-I} directories are used
10970 this way.)
10972 In addition, the @option{-I-} option inhibits the use of the current
10973 directory (where the current input file came from) as the first search
10974 directory for @samp{#include "@var{file}"}.  There is no way to
10975 override this effect of @option{-I-}.  With @option{-I.} you can specify
10976 searching the directory that is current when the compiler is
10977 invoked.  That is not exactly the same as what the preprocessor does
10978 by default, but it is often satisfactory.
10980 @option{-I-} does not inhibit the use of the standard system directories
10981 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
10982 independent.
10983 @end table
10985 @c man end
10987 @node Spec Files
10988 @section Specifying subprocesses and the switches to pass to them
10989 @cindex Spec Files
10991 @command{gcc} is a driver program.  It performs its job by invoking a
10992 sequence of other programs to do the work of compiling, assembling and
10993 linking.  GCC interprets its command-line parameters and uses these to
10994 deduce which programs it should invoke, and which command-line options
10995 it ought to place on their command lines.  This behavior is controlled
10996 by @dfn{spec strings}.  In most cases there is one spec string for each
10997 program that GCC can invoke, but a few programs have multiple spec
10998 strings to control their behavior.  The spec strings built into GCC can
10999 be overridden by using the @option{-specs=} command-line switch to specify
11000 a spec file.
11002 @dfn{Spec files} are plaintext files that are used to construct spec
11003 strings.  They consist of a sequence of directives separated by blank
11004 lines.  The type of directive is determined by the first non-whitespace
11005 character on the line, which can be one of the following:
11007 @table @code
11008 @item %@var{command}
11009 Issues a @var{command} to the spec file processor.  The commands that can
11010 appear here are:
11012 @table @code
11013 @item %include <@var{file}>
11014 @cindex @code{%include}
11015 Search for @var{file} and insert its text at the current point in the
11016 specs file.
11018 @item %include_noerr <@var{file}>
11019 @cindex @code{%include_noerr}
11020 Just like @samp{%include}, but do not generate an error message if the include
11021 file cannot be found.
11023 @item %rename @var{old_name} @var{new_name}
11024 @cindex @code{%rename}
11025 Rename the spec string @var{old_name} to @var{new_name}.
11027 @end table
11029 @item *[@var{spec_name}]:
11030 This tells the compiler to create, override or delete the named spec
11031 string.  All lines after this directive up to the next directive or
11032 blank line are considered to be the text for the spec string.  If this
11033 results in an empty string then the spec is deleted.  (Or, if the
11034 spec did not exist, then nothing happens.)  Otherwise, if the spec
11035 does not currently exist a new spec is created.  If the spec does
11036 exist then its contents are overridden by the text of this
11037 directive, unless the first character of that text is the @samp{+}
11038 character, in which case the text is appended to the spec.
11040 @item [@var{suffix}]:
11041 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
11042 and up to the next directive or blank line are considered to make up the
11043 spec string for the indicated suffix.  When the compiler encounters an
11044 input file with the named suffix, it processes the spec string in
11045 order to work out how to compile that file.  For example:
11047 @smallexample
11048 .ZZ:
11049 z-compile -input %i
11050 @end smallexample
11052 This says that any input file whose name ends in @samp{.ZZ} should be
11053 passed to the program @samp{z-compile}, which should be invoked with the
11054 command-line switch @option{-input} and with the result of performing the
11055 @samp{%i} substitution.  (See below.)
11057 As an alternative to providing a spec string, the text following a
11058 suffix directive can be one of the following:
11060 @table @code
11061 @item @@@var{language}
11062 This says that the suffix is an alias for a known @var{language}.  This is
11063 similar to using the @option{-x} command-line switch to GCC to specify a
11064 language explicitly.  For example:
11066 @smallexample
11067 .ZZ:
11068 @@c++
11069 @end smallexample
11071 Says that .ZZ files are, in fact, C++ source files.
11073 @item #@var{name}
11074 This causes an error messages saying:
11076 @smallexample
11077 @var{name} compiler not installed on this system.
11078 @end smallexample
11079 @end table
11081 GCC already has an extensive list of suffixes built into it.
11082 This directive adds an entry to the end of the list of suffixes, but
11083 since the list is searched from the end backwards, it is effectively
11084 possible to override earlier entries using this technique.
11086 @end table
11088 GCC has the following spec strings built into it.  Spec files can
11089 override these strings or create their own.  Note that individual
11090 targets can also add their own spec strings to this list.
11092 @smallexample
11093 asm          Options to pass to the assembler
11094 asm_final    Options to pass to the assembler post-processor
11095 cpp          Options to pass to the C preprocessor
11096 cc1          Options to pass to the C compiler
11097 cc1plus      Options to pass to the C++ compiler
11098 endfile      Object files to include at the end of the link
11099 link         Options to pass to the linker
11100 lib          Libraries to include on the command line to the linker
11101 libgcc       Decides which GCC support library to pass to the linker
11102 linker       Sets the name of the linker
11103 predefines   Defines to be passed to the C preprocessor
11104 signed_char  Defines to pass to CPP to say whether @code{char} is signed
11105              by default
11106 startfile    Object files to include at the start of the link
11107 @end smallexample
11109 Here is a small example of a spec file:
11111 @smallexample
11112 %rename lib                 old_lib
11114 *lib:
11115 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
11116 @end smallexample
11118 This example renames the spec called @samp{lib} to @samp{old_lib} and
11119 then overrides the previous definition of @samp{lib} with a new one.
11120 The new definition adds in some extra command-line options before
11121 including the text of the old definition.
11123 @dfn{Spec strings} are a list of command-line options to be passed to their
11124 corresponding program.  In addition, the spec strings can contain
11125 @samp{%}-prefixed sequences to substitute variable text or to
11126 conditionally insert text into the command line.  Using these constructs
11127 it is possible to generate quite complex command lines.
11129 Here is a table of all defined @samp{%}-sequences for spec
11130 strings.  Note that spaces are not generated automatically around the
11131 results of expanding these sequences.  Therefore you can concatenate them
11132 together or combine them with constant text in a single argument.
11134 @table @code
11135 @item %%
11136 Substitute one @samp{%} into the program name or argument.
11138 @item %i
11139 Substitute the name of the input file being processed.
11141 @item %b
11142 Substitute the basename of the input file being processed.
11143 This is the substring up to (and not including) the last period
11144 and not including the directory.
11146 @item %B
11147 This is the same as @samp{%b}, but include the file suffix (text after
11148 the last period).
11150 @item %d
11151 Marks the argument containing or following the @samp{%d} as a
11152 temporary file name, so that that file is deleted if GCC exits
11153 successfully.  Unlike @samp{%g}, this contributes no text to the
11154 argument.
11156 @item %g@var{suffix}
11157 Substitute a file name that has suffix @var{suffix} and is chosen
11158 once per compilation, and mark the argument in the same way as
11159 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
11160 name is now chosen in a way that is hard to predict even when previously
11161 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
11162 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
11163 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
11164 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
11165 was simply substituted with a file name chosen once per compilation,
11166 without regard to any appended suffix (which was therefore treated
11167 just like ordinary text), making such attacks more likely to succeed.
11169 @item %u@var{suffix}
11170 Like @samp{%g}, but generates a new temporary file name
11171 each time it appears instead of once per compilation.
11173 @item %U@var{suffix}
11174 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
11175 new one if there is no such last file name.  In the absence of any
11176 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
11177 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
11178 involves the generation of two distinct file names, one
11179 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
11180 simply substituted with a file name chosen for the previous @samp{%u},
11181 without regard to any appended suffix.
11183 @item %j@var{suffix}
11184 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
11185 writable, and if @option{-save-temps} is not used; 
11186 otherwise, substitute the name
11187 of a temporary file, just like @samp{%u}.  This temporary file is not
11188 meant for communication between processes, but rather as a junk
11189 disposal mechanism.
11191 @item %|@var{suffix}
11192 @itemx %m@var{suffix}
11193 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
11194 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
11195 all.  These are the two most common ways to instruct a program that it
11196 should read from standard input or write to standard output.  If you
11197 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
11198 construct: see for example @file{f/lang-specs.h}.
11200 @item %.@var{SUFFIX}
11201 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
11202 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
11203 terminated by the next space or %.
11205 @item %w
11206 Marks the argument containing or following the @samp{%w} as the
11207 designated output file of this compilation.  This puts the argument
11208 into the sequence of arguments that @samp{%o} substitutes.
11210 @item %o
11211 Substitutes the names of all the output files, with spaces
11212 automatically placed around them.  You should write spaces
11213 around the @samp{%o} as well or the results are undefined.
11214 @samp{%o} is for use in the specs for running the linker.
11215 Input files whose names have no recognized suffix are not compiled
11216 at all, but they are included among the output files, so they are
11217 linked.
11219 @item %O
11220 Substitutes the suffix for object files.  Note that this is
11221 handled specially when it immediately follows @samp{%g, %u, or %U},
11222 because of the need for those to form complete file names.  The
11223 handling is such that @samp{%O} is treated exactly as if it had already
11224 been substituted, except that @samp{%g, %u, and %U} do not currently
11225 support additional @var{suffix} characters following @samp{%O} as they do
11226 following, for example, @samp{.o}.
11228 @item %p
11229 Substitutes the standard macro predefinitions for the
11230 current target machine.  Use this when running @code{cpp}.
11232 @item %P
11233 Like @samp{%p}, but puts @samp{__} before and after the name of each
11234 predefined macro, except for macros that start with @samp{__} or with
11235 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
11238 @item %I
11239 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
11240 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
11241 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
11242 and @option{-imultilib} as necessary.
11244 @item %s
11245 Current argument is the name of a library or startup file of some sort.
11246 Search for that file in a standard list of directories and substitute
11247 the full name found.  The current working directory is included in the
11248 list of directories scanned.
11250 @item %T
11251 Current argument is the name of a linker script.  Search for that file
11252 in the current list of directories to scan for libraries. If the file
11253 is located insert a @option{--script} option into the command line
11254 followed by the full path name found.  If the file is not found then
11255 generate an error message.  Note: the current working directory is not
11256 searched.
11258 @item %e@var{str}
11259 Print @var{str} as an error message.  @var{str} is terminated by a newline.
11260 Use this when inconsistent options are detected.
11262 @item %(@var{name})
11263 Substitute the contents of spec string @var{name} at this point.
11265 @item %x@{@var{option}@}
11266 Accumulate an option for @samp{%X}.
11268 @item %X
11269 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
11270 spec string.
11272 @item %Y
11273 Output the accumulated assembler options specified by @option{-Wa}.
11275 @item %Z
11276 Output the accumulated preprocessor options specified by @option{-Wp}.
11278 @item %a
11279 Process the @code{asm} spec.  This is used to compute the
11280 switches to be passed to the assembler.
11282 @item %A
11283 Process the @code{asm_final} spec.  This is a spec string for
11284 passing switches to an assembler post-processor, if such a program is
11285 needed.
11287 @item %l
11288 Process the @code{link} spec.  This is the spec for computing the
11289 command line passed to the linker.  Typically it makes use of the
11290 @samp{%L %G %S %D and %E} sequences.
11292 @item %D
11293 Dump out a @option{-L} option for each directory that GCC believes might
11294 contain startup files.  If the target supports multilibs then the
11295 current multilib directory is prepended to each of these paths.
11297 @item %L
11298 Process the @code{lib} spec.  This is a spec string for deciding which
11299 libraries are included on the command line to the linker.
11301 @item %G
11302 Process the @code{libgcc} spec.  This is a spec string for deciding
11303 which GCC support library is included on the command line to the linker.
11305 @item %S
11306 Process the @code{startfile} spec.  This is a spec for deciding which
11307 object files are the first ones passed to the linker.  Typically
11308 this might be a file named @file{crt0.o}.
11310 @item %E
11311 Process the @code{endfile} spec.  This is a spec string that specifies
11312 the last object files that are passed to the linker.
11314 @item %C
11315 Process the @code{cpp} spec.  This is used to construct the arguments
11316 to be passed to the C preprocessor.
11318 @item %1
11319 Process the @code{cc1} spec.  This is used to construct the options to be
11320 passed to the actual C compiler (@samp{cc1}).
11322 @item %2
11323 Process the @code{cc1plus} spec.  This is used to construct the options to be
11324 passed to the actual C++ compiler (@samp{cc1plus}).
11326 @item %*
11327 Substitute the variable part of a matched option.  See below.
11328 Note that each comma in the substituted string is replaced by
11329 a single space.
11331 @item %<@code{S}
11332 Remove all occurrences of @code{-S} from the command line.  Note---this
11333 command is position dependent.  @samp{%} commands in the spec string
11334 before this one see @code{-S}, @samp{%} commands in the spec string
11335 after this one do not.
11337 @item %:@var{function}(@var{args})
11338 Call the named function @var{function}, passing it @var{args}.
11339 @var{args} is first processed as a nested spec string, then split
11340 into an argument vector in the usual fashion.  The function returns
11341 a string which is processed as if it had appeared literally as part
11342 of the current spec.
11344 The following built-in spec functions are provided:
11346 @table @code
11347 @item @code{getenv}
11348 The @code{getenv} spec function takes two arguments: an environment
11349 variable name and a string.  If the environment variable is not
11350 defined, a fatal error is issued.  Otherwise, the return value is the
11351 value of the environment variable concatenated with the string.  For
11352 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
11354 @smallexample
11355 %:getenv(TOPDIR /include)
11356 @end smallexample
11358 expands to @file{/path/to/top/include}.
11360 @item @code{if-exists}
11361 The @code{if-exists} spec function takes one argument, an absolute
11362 pathname to a file.  If the file exists, @code{if-exists} returns the
11363 pathname.  Here is a small example of its usage:
11365 @smallexample
11366 *startfile:
11367 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
11368 @end smallexample
11370 @item @code{if-exists-else}
11371 The @code{if-exists-else} spec function is similar to the @code{if-exists}
11372 spec function, except that it takes two arguments.  The first argument is
11373 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
11374 returns the pathname.  If it does not exist, it returns the second argument.
11375 This way, @code{if-exists-else} can be used to select one file or another,
11376 based on the existence of the first.  Here is a small example of its usage:
11378 @smallexample
11379 *startfile:
11380 crt0%O%s %:if-exists(crti%O%s) \
11381 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
11382 @end smallexample
11384 @item @code{replace-outfile}
11385 The @code{replace-outfile} spec function takes two arguments.  It looks for the
11386 first argument in the outfiles array and replaces it with the second argument.  Here
11387 is a small example of its usage:
11389 @smallexample
11390 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
11391 @end smallexample
11393 @item @code{remove-outfile}
11394 The @code{remove-outfile} spec function takes one argument.  It looks for the
11395 first argument in the outfiles array and removes it.  Here is a small example
11396 its usage:
11398 @smallexample
11399 %:remove-outfile(-lm)
11400 @end smallexample
11402 @item @code{pass-through-libs}
11403 The @code{pass-through-libs} spec function takes any number of arguments.  It
11404 finds any @option{-l} options and any non-options ending in @file{.a} (which it
11405 assumes are the names of linker input library archive files) and returns a
11406 result containing all the found arguments each prepended by
11407 @option{-plugin-opt=-pass-through=} and joined by spaces.  This list is
11408 intended to be passed to the LTO linker plugin.
11410 @smallexample
11411 %:pass-through-libs(%G %L %G)
11412 @end smallexample
11414 @item @code{print-asm-header}
11415 The @code{print-asm-header} function takes no arguments and simply
11416 prints a banner like:
11418 @smallexample
11419 Assembler options
11420 =================
11422 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
11423 @end smallexample
11425 It is used to separate compiler options from assembler options
11426 in the @option{--target-help} output.
11427 @end table
11429 @item %@{@code{S}@}
11430 Substitutes the @code{-S} switch, if that switch is given to GCC@.
11431 If that switch is not specified, this substitutes nothing.  Note that
11432 the leading dash is omitted when specifying this option, and it is
11433 automatically inserted if the substitution is performed.  Thus the spec
11434 string @samp{%@{foo@}} matches the command-line option @option{-foo}
11435 and outputs the command-line option @option{-foo}.
11437 @item %W@{@code{S}@}
11438 Like %@{@code{S}@} but mark last argument supplied within as a file to be
11439 deleted on failure.
11441 @item %@{@code{S}*@}
11442 Substitutes all the switches specified to GCC whose names start
11443 with @code{-S}, but which also take an argument.  This is used for
11444 switches like @option{-o}, @option{-D}, @option{-I}, etc.
11445 GCC considers @option{-o foo} as being
11446 one switch whose name starts with @samp{o}.  %@{o*@} substitutes this
11447 text, including the space.  Thus two arguments are generated.
11449 @item %@{@code{S}*&@code{T}*@}
11450 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
11451 (the order of @code{S} and @code{T} in the spec is not significant).
11452 There can be any number of ampersand-separated variables; for each the
11453 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
11455 @item %@{@code{S}:@code{X}@}
11456 Substitutes @code{X}, if the @option{-S} switch is given to GCC@.
11458 @item %@{!@code{S}:@code{X}@}
11459 Substitutes @code{X}, if the @option{-S} switch is @emph{not} given to GCC@.
11461 @item %@{@code{S}*:@code{X}@}
11462 Substitutes @code{X} if one or more switches whose names start with
11463 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
11464 once, no matter how many such switches appeared.  However, if @code{%*}
11465 appears somewhere in @code{X}, then @code{X} is substituted once
11466 for each matching switch, with the @code{%*} replaced by the part of
11467 that switch matching the @code{*}.
11469 If @code{%*} appears as the last part of a spec sequence then a space
11470 will be added after the end of the last substitution.  If there is more
11471 text in the sequence however then a space will not be generated.  This
11472 allows the @code{%*} substitution to be used as part of a larger
11473 string.  For example, a spec string like this:
11475 @smallexample
11476 %@{mcu=*:--script=%*/memory.ld@}
11477 @end smallexample
11479 when matching an option like @code{-mcu=newchip} will produce:
11481 @smallexample
11482 --script=newchip/memory.ld
11483 @end smallexample
11485 @item %@{.@code{S}:@code{X}@}
11486 Substitutes @code{X}, if processing a file with suffix @code{S}.
11488 @item %@{!.@code{S}:@code{X}@}
11489 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
11491 @item %@{,@code{S}:@code{X}@}
11492 Substitutes @code{X}, if processing a file for language @code{S}.
11494 @item %@{!,@code{S}:@code{X}@}
11495 Substitutes @code{X}, if not processing a file for language @code{S}.
11497 @item %@{@code{S}|@code{P}:@code{X}@}
11498 Substitutes @code{X} if either @code{-S} or @code{-P} is given to
11499 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
11500 @code{*} sequences as well, although they have a stronger binding than
11501 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
11502 alternatives must be starred, and only the first matching alternative
11503 is substituted.
11505 For example, a spec string like this:
11507 @smallexample
11508 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
11509 @end smallexample
11511 @noindent
11512 outputs the following command-line options from the following input
11513 command-line options:
11515 @smallexample
11516 fred.c        -foo -baz
11517 jim.d         -bar -boggle
11518 -d fred.c     -foo -baz -boggle
11519 -d jim.d      -bar -baz -boggle
11520 @end smallexample
11522 @item %@{S:X; T:Y; :D@}
11524 If @code{S} is given to GCC, substitutes @code{X}; else if @code{T} is
11525 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
11526 be as many clauses as you need.  This may be combined with @code{.},
11527 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
11529 @item max-lipo-mem
11530 When importing auxiliary modules during profile-use, check current
11531 memory consumption after parsing each auxiliary module. If it exceeds
11532 this limit (specified in kb), don't import any more auxiliary modules.
11533 Specifying a value of 0 means don't enforce this limit. This parameter
11534 is only useful when using @option{-fprofile-use} and @option{-fripa}.
11536 @end table
11538 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
11539 construct may contain other nested @samp{%} constructs or spaces, or
11540 even newlines.  They are processed as usual, as described above.
11541 Trailing white space in @code{X} is ignored.  White space may also
11542 appear anywhere on the left side of the colon in these constructs,
11543 except between @code{.} or @code{*} and the corresponding word.
11545 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
11546 handled specifically in these constructs.  If another value of
11547 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
11548 @option{-W} switch is found later in the command line, the earlier
11549 switch value is ignored, except with @{@code{S}*@} where @code{S} is
11550 just one letter, which passes all matching options.
11552 The character @samp{|} at the beginning of the predicate text is used to
11553 indicate that a command should be piped to the following command, but
11554 only if @option{-pipe} is specified.
11556 It is built into GCC which switches take arguments and which do not.
11557 (You might think it would be useful to generalize this to allow each
11558 compiler's spec to say which switches take arguments.  But this cannot
11559 be done in a consistent fashion.  GCC cannot even decide which input
11560 files have been specified without knowing which switches take arguments,
11561 and it must know which input files to compile in order to tell which
11562 compilers to run).
11564 GCC also knows implicitly that arguments starting in @option{-l} are to be
11565 treated as compiler output files, and passed to the linker in their
11566 proper position among the other output files.
11568 @c man begin OPTIONS
11570 @node Target Options
11571 @section Specifying Target Machine and Compiler Version
11572 @cindex target options
11573 @cindex cross compiling
11574 @cindex specifying machine version
11575 @cindex specifying compiler version and target machine
11576 @cindex compiler version, specifying
11577 @cindex target machine, specifying
11579 The usual way to run GCC is to run the executable called @command{gcc}, or
11580 @command{@var{machine}-gcc} when cross-compiling, or
11581 @command{@var{machine}-gcc-@var{version}} to run a version other than the
11582 one that was installed last.
11584 @node Submodel Options
11585 @section Hardware Models and Configurations
11586 @cindex submodel options
11587 @cindex specifying hardware config
11588 @cindex hardware models and configurations, specifying
11589 @cindex machine dependent options
11591 Each target machine types can have its own
11592 special options, starting with @samp{-m}, to choose among various
11593 hardware models or configurations---for example, 68010 vs 68020,
11594 floating coprocessor or none.  A single installed version of the
11595 compiler can compile for any model or configuration, according to the
11596 options specified.
11598 Some configurations of the compiler also support additional special
11599 options, usually for compatibility with other compilers on the same
11600 platform.
11602 @c This list is ordered alphanumerically by subsection name.
11603 @c It should be the same order and spelling as these options are listed
11604 @c in Machine Dependent Options
11606 @menu
11607 * AArch64 Options::
11608 * Adapteva Epiphany Options::
11609 * ARC Options::
11610 * ARM Options::
11611 * AVR Options::
11612 * Blackfin Options::
11613 * C6X Options::
11614 * CRIS Options::
11615 * CR16 Options::
11616 * Darwin Options::
11617 * DEC Alpha Options::
11618 * FR30 Options::
11619 * FRV Options::
11620 * GNU/Linux Options::
11621 * H8/300 Options::
11622 * HPPA Options::
11623 * i386 and x86-64 Options::
11624 * i386 and x86-64 Windows Options::
11625 * IA-64 Options::
11626 * LM32 Options::
11627 * M32C Options::
11628 * M32R/D Options::
11629 * M680x0 Options::
11630 * MCore Options::
11631 * MeP Options::
11632 * MicroBlaze Options::
11633 * MIPS Options::
11634 * MMIX Options::
11635 * MN10300 Options::
11636 * Moxie Options::
11637 * MSP430 Options::
11638 * NDS32 Options::
11639 * Nios II Options::
11640 * PDP-11 Options::
11641 * picoChip Options::
11642 * PowerPC Options::
11643 * RL78 Options::
11644 * RS/6000 and PowerPC Options::
11645 * RX Options::
11646 * S/390 and zSeries Options::
11647 * Score Options::
11648 * SH Options::
11649 * Solaris 2 Options::
11650 * SPARC Options::
11651 * SPU Options::
11652 * System V Options::
11653 * TILE-Gx Options::
11654 * TILEPro Options::
11655 * V850 Options::
11656 * VAX Options::
11657 * VMS Options::
11658 * VxWorks Options::
11659 * x86-64 Options::
11660 * Xstormy16 Options::
11661 * Xtensa Options::
11662 * zSeries Options::
11663 @end menu
11665 @node AArch64 Options
11666 @subsection AArch64 Options
11667 @cindex AArch64 Options
11669 These options are defined for AArch64 implementations:
11671 @table @gcctabopt
11673 @item -mabi=@var{name}
11674 @opindex mabi
11675 Generate code for the specified data model.  Permissible values
11676 are @samp{ilp32} for SysV-like data model where int, long int and pointer
11677 are 32-bit, and @samp{lp64} for SysV-like data model where int is 32-bit,
11678 but long int and pointer are 64-bit.
11680 The default depends on the specific target configuration.  Note that
11681 the LP64 and ILP32 ABIs are not link-compatible; you must compile your
11682 entire program with the same ABI, and link with a compatible set of libraries.
11684 @item -mbig-endian
11685 @opindex mbig-endian
11686 Generate big-endian code.  This is the default when GCC is configured for an
11687 @samp{aarch64_be-*-*} target.
11689 @item -mgeneral-regs-only
11690 @opindex mgeneral-regs-only
11691 Generate code which uses only the general registers.
11693 @item -mlittle-endian
11694 @opindex mlittle-endian
11695 Generate little-endian code.  This is the default when GCC is configured for an
11696 @samp{aarch64-*-*} but not an @samp{aarch64_be-*-*} target.
11698 @item -mcmodel=tiny
11699 @opindex mcmodel=tiny
11700 Generate code for the tiny code model.  The program and its statically defined
11701 symbols must be within 1GB of each other.  Pointers are 64 bits.  Programs can
11702 be statically or dynamically linked.  This model is not fully implemented and
11703 mostly treated as @samp{small}.
11705 @item -mcmodel=small
11706 @opindex mcmodel=small
11707 Generate code for the small code model.  The program and its statically defined
11708 symbols must be within 4GB of each other.  Pointers are 64 bits.  Programs can
11709 be statically or dynamically linked.  This is the default code model.
11711 @item -mcmodel=large
11712 @opindex mcmodel=large
11713 Generate code for the large code model.  This makes no assumptions about
11714 addresses and sizes of sections.  Pointers are 64 bits.  Programs can be
11715 statically linked only.
11717 @item -mstrict-align
11718 @opindex mstrict-align
11719 Do not assume that unaligned memory references will be handled by the system.
11721 @item -momit-leaf-frame-pointer
11722 @itemx -mno-omit-leaf-frame-pointer
11723 @opindex momit-leaf-frame-pointer
11724 @opindex mno-omit-leaf-frame-pointer
11725 Omit or keep the frame pointer in leaf functions.  The former behaviour is the
11726 default.
11728 @item -mtls-dialect=desc
11729 @opindex mtls-dialect=desc
11730 Use TLS descriptors as the thread-local storage mechanism for dynamic accesses
11731 of TLS variables.  This is the default.
11733 @item -mtls-dialect=traditional
11734 @opindex mtls-dialect=traditional
11735 Use traditional TLS as the thread-local storage mechanism for dynamic accesses
11736 of TLS variables.
11738 @item -mfix-cortex-a53-835769
11739 @itemx -mno-fix-cortex-a53-835769
11740 @opindex -mfix-cortex-a53-835769
11741 @opindex -mno-fix-cortex-a53-835769
11742 Enable or disable the workaround for the ARM Cortex-A53 erratum number 835769.
11743 This will involve inserting a NOP instruction between memory instructions and
11744 64-bit integer multiply-accumulate instructions.
11746 @item -march=@var{name}
11747 @opindex march
11748 Specify the name of the target architecture, optionally suffixed by one or
11749 more feature modifiers.  This option has the form
11750 @option{-march=@var{arch}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}, where the
11751 only permissible value for @var{arch} is @samp{armv8-a}.  The permissible
11752 values for @var{feature} are documented in the sub-section below.
11754 Where conflicting feature modifiers are specified, the right-most feature is
11755 used.
11757 GCC uses this name to determine what kind of instructions it can emit when
11758 generating assembly code.
11760 Where @option{-march} is specified without either of @option{-mtune}
11761 or @option{-mcpu} also being specified, the code will be tuned to perform
11762 well across a range of target processors implementing the target
11763 architecture.
11765 @item -mtune=@var{name}
11766 @opindex mtune
11767 Specify the name of the target processor for which GCC should tune the
11768 performance of the code.  Permissible values for this option are:
11769 @samp{generic}, @samp{cortex-a53}, @samp{cortex-a57}.
11771 Additionally, this option can specify that GCC should tune the performance
11772 of the code for a big.LITTLE system.  The only permissible value is
11773 @samp{cortex-a57.cortex-a53}.
11775 Where none of @option{-mtune=}, @option{-mcpu=} or @option{-march=}
11776 are specified, the code will be tuned to perform well across a range
11777 of target processors.
11779 This option cannot be suffixed by feature modifiers.
11781 @item -mcpu=@var{name}
11782 @opindex mcpu
11783 Specify the name of the target processor, optionally suffixed by one or more
11784 feature modifiers.  This option has the form
11785 @option{-mcpu=@var{cpu}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}, where the
11786 permissible values for @var{cpu} are the same as those available for
11787 @option{-mtune}.
11789 The permissible values for @var{feature} are documented in the sub-section
11790 below.
11792 Where conflicting feature modifiers are specified, the right-most feature is
11793 used.
11795 GCC uses this name to determine what kind of instructions it can emit when
11796 generating assembly code (as if by @option{-march}) and to determine
11797 the target processor for which to tune for performance (as if
11798 by @option{-mtune}).  Where this option is used in conjunction
11799 with @option{-march} or @option{-mtune}, those options take precedence
11800 over the appropriate part of this option.
11801 @end table
11803 @subsubsection @option{-march} and @option{-mcpu} feature modifiers
11804 @cindex @option{-march} feature modifiers
11805 @cindex @option{-mcpu} feature modifiers
11806 Feature modifiers used with @option{-march} and @option{-mcpu} can be one
11807 the following:
11809 @table @samp
11810 @item crc
11811 Enable CRC extension.
11812 @item crypto
11813 Enable Crypto extension.  This implies Advanced SIMD is enabled.
11814 @item fp
11815 Enable floating-point instructions.
11816 @item simd
11817 Enable Advanced SIMD instructions.  This implies floating-point instructions
11818 are enabled.  This is the default for all current possible values for options
11819 @option{-march} and @option{-mcpu=}.
11820 @end table
11822 @node Adapteva Epiphany Options
11823 @subsection Adapteva Epiphany Options
11825 These @samp{-m} options are defined for Adapteva Epiphany:
11827 @table @gcctabopt
11828 @item -mhalf-reg-file
11829 @opindex mhalf-reg-file
11830 Don't allocate any register in the range @code{r32}@dots{}@code{r63}.
11831 That allows code to run on hardware variants that lack these registers.
11833 @item -mprefer-short-insn-regs
11834 @opindex mprefer-short-insn-regs
11835 Preferrentially allocate registers that allow short instruction generation.
11836 This can result in increased instruction count, so this may either reduce or
11837 increase overall code size.
11839 @item -mbranch-cost=@var{num}
11840 @opindex mbranch-cost
11841 Set the cost of branches to roughly @var{num} ``simple'' instructions.
11842 This cost is only a heuristic and is not guaranteed to produce
11843 consistent results across releases.
11845 @item -mcmove
11846 @opindex mcmove
11847 Enable the generation of conditional moves.
11849 @item -mnops=@var{num}
11850 @opindex mnops
11851 Emit @var{num} NOPs before every other generated instruction.
11853 @item -mno-soft-cmpsf
11854 @opindex mno-soft-cmpsf
11855 For single-precision floating-point comparisons, emit an @code{fsub} instruction
11856 and test the flags.  This is faster than a software comparison, but can
11857 get incorrect results in the presence of NaNs, or when two different small
11858 numbers are compared such that their difference is calculated as zero.
11859 The default is @option{-msoft-cmpsf}, which uses slower, but IEEE-compliant,
11860 software comparisons.
11862 @item -mstack-offset=@var{num}
11863 @opindex mstack-offset
11864 Set the offset between the top of the stack and the stack pointer.
11865 E.g., a value of 8 means that the eight bytes in the range @code{sp+0@dots{}sp+7}
11866 can be used by leaf functions without stack allocation.
11867 Values other than @samp{8} or @samp{16} are untested and unlikely to work.
11868 Note also that this option changes the ABI; compiling a program with a
11869 different stack offset than the libraries have been compiled with
11870 generally does not work.
11871 This option can be useful if you want to evaluate if a different stack
11872 offset would give you better code, but to actually use a different stack
11873 offset to build working programs, it is recommended to configure the
11874 toolchain with the appropriate @option{--with-stack-offset=@var{num}} option.
11876 @item -mno-round-nearest
11877 @opindex mno-round-nearest
11878 Make the scheduler assume that the rounding mode has been set to
11879 truncating.  The default is @option{-mround-nearest}.
11881 @item -mlong-calls
11882 @opindex mlong-calls
11883 If not otherwise specified by an attribute, assume all calls might be beyond
11884 the offset range of the @code{b} / @code{bl} instructions, and therefore load the
11885 function address into a register before performing a (otherwise direct) call.
11886 This is the default.
11888 @item -mshort-calls
11889 @opindex short-calls
11890 If not otherwise specified by an attribute, assume all direct calls are
11891 in the range of the @code{b} / @code{bl} instructions, so use these instructions
11892 for direct calls.  The default is @option{-mlong-calls}.
11894 @item -msmall16
11895 @opindex msmall16
11896 Assume addresses can be loaded as 16-bit unsigned values.  This does not
11897 apply to function addresses for which @option{-mlong-calls} semantics
11898 are in effect.
11900 @item -mfp-mode=@var{mode}
11901 @opindex mfp-mode
11902 Set the prevailing mode of the floating-point unit.
11903 This determines the floating-point mode that is provided and expected
11904 at function call and return time.  Making this mode match the mode you
11905 predominantly need at function start can make your programs smaller and
11906 faster by avoiding unnecessary mode switches.
11908 @var{mode} can be set to one the following values:
11910 @table @samp
11911 @item caller
11912 Any mode at function entry is valid, and retained or restored when
11913 the function returns, and when it calls other functions.
11914 This mode is useful for compiling libraries or other compilation units
11915 you might want to incorporate into different programs with different
11916 prevailing FPU modes, and the convenience of being able to use a single
11917 object file outweighs the size and speed overhead for any extra
11918 mode switching that might be needed, compared with what would be needed
11919 with a more specific choice of prevailing FPU mode.
11921 @item truncate
11922 This is the mode used for floating-point calculations with
11923 truncating (i.e.@: round towards zero) rounding mode.  That includes
11924 conversion from floating point to integer.
11926 @item round-nearest
11927 This is the mode used for floating-point calculations with
11928 round-to-nearest-or-even rounding mode.
11930 @item int
11931 This is the mode used to perform integer calculations in the FPU, e.g.@:
11932 integer multiply, or integer multiply-and-accumulate.
11933 @end table
11935 The default is @option{-mfp-mode=caller}
11937 @item -mnosplit-lohi
11938 @itemx -mno-postinc
11939 @itemx -mno-postmodify
11940 @opindex mnosplit-lohi
11941 @opindex mno-postinc
11942 @opindex mno-postmodify
11943 Code generation tweaks that disable, respectively, splitting of 32-bit
11944 loads, generation of post-increment addresses, and generation of
11945 post-modify addresses.  The defaults are @option{msplit-lohi},
11946 @option{-mpost-inc}, and @option{-mpost-modify}.
11948 @item -mnovect-double
11949 @opindex mno-vect-double
11950 Change the preferred SIMD mode to SImode.  The default is
11951 @option{-mvect-double}, which uses DImode as preferred SIMD mode.
11953 @item -max-vect-align=@var{num}
11954 @opindex max-vect-align
11955 The maximum alignment for SIMD vector mode types.
11956 @var{num} may be 4 or 8.  The default is 8.
11957 Note that this is an ABI change, even though many library function
11958 interfaces are unaffected if they don't use SIMD vector modes
11959 in places that affect size and/or alignment of relevant types.
11961 @item -msplit-vecmove-early
11962 @opindex msplit-vecmove-early
11963 Split vector moves into single word moves before reload.  In theory this
11964 can give better register allocation, but so far the reverse seems to be
11965 generally the case.
11967 @item -m1reg-@var{reg}
11968 @opindex m1reg-
11969 Specify a register to hold the constant @minus{}1, which makes loading small negative
11970 constants and certain bitmasks faster.
11971 Allowable values for @var{reg} are @samp{r43} and @samp{r63},
11972 which specify use of that register as a fixed register,
11973 and @samp{none}, which means that no register is used for this
11974 purpose.  The default is @option{-m1reg-none}.
11976 @end table
11978 @node ARC Options
11979 @subsection ARC Options
11980 @cindex ARC options
11982 The following options control the architecture variant for which code
11983 is being compiled:
11985 @c architecture variants
11986 @table @gcctabopt
11988 @item -mbarrel-shifter
11989 @opindex mbarrel-shifter
11990 Generate instructions supported by barrel shifter.  This is the default
11991 unless @samp{-mcpu=ARC601} is in effect.
11993 @item -mcpu=@var{cpu}
11994 @opindex mcpu
11995 Set architecture type, register usage, and instruction scheduling
11996 parameters for @var{cpu}.  There are also shortcut alias options
11997 available for backward compatibility and convenience.  Supported
11998 values for @var{cpu} are
12000 @table @samp
12001 @opindex mA6
12002 @opindex mARC600
12003 @item ARC600
12004 Compile for ARC600.  Aliases: @option{-mA6}, @option{-mARC600}.
12006 @item ARC601
12007 @opindex mARC601
12008 Compile for ARC601.  Alias: @option{-mARC601}.
12010 @item ARC700
12011 @opindex mA7
12012 @opindex mARC700
12013 Compile for ARC700.  Aliases: @option{-mA7}, @option{-mARC700}.
12014 This is the default when configured with @samp{--with-cpu=arc700}@.
12015 @end table
12017 @item -mdpfp
12018 @opindex mdpfp
12019 @itemx -mdpfp-compact
12020 @opindex mdpfp-compact
12021 FPX: Generate Double Precision FPX instructions, tuned for the compact
12022 implementation.
12024 @item -mdpfp-fast
12025 @opindex mdpfp-fast
12026 FPX: Generate Double Precision FPX instructions, tuned for the fast
12027 implementation.
12029 @item -mno-dpfp-lrsr
12030 @opindex mno-dpfp-lrsr
12031 Disable LR and SR instructions from using FPX extension aux registers.
12033 @item -mea
12034 @opindex mea
12035 Generate Extended arithmetic instructions.  Currently only
12036 @code{divaw}, @code{adds}, @code{subs}, and @code{sat16} are
12037 supported.  This is always enabled for @samp{-mcpu=ARC700}.
12039 @item -mno-mpy
12040 @opindex mno-mpy
12041 Do not generate mpy instructions for ARC700.
12043 @item -mmul32x16
12044 @opindex mmul32x16
12045 Generate 32x16 bit multiply and mac instructions.
12047 @item -mmul64
12048 @opindex mmul64
12049 Generate mul64 and mulu64 instructions.  Only valid for @samp{-mcpu=ARC600}.
12051 @item -mnorm
12052 @opindex mnorm
12053 Generate norm instruction.  This is the default if @samp{-mcpu=ARC700}
12054 is in effect.
12056 @item -mspfp
12057 @opindex mspfp
12058 @itemx -mspfp-compact
12059 @opindex mspfp-compact
12060 FPX: Generate Single Precision FPX instructions, tuned for the compact
12061 implementation.
12063 @item -mspfp-fast
12064 @opindex mspfp-fast
12065 FPX: Generate Single Precision FPX instructions, tuned for the fast
12066 implementation.
12068 @item -msimd
12069 @opindex msimd
12070 Enable generation of ARC SIMD instructions via target-specific
12071 builtins.  Only valid for @samp{-mcpu=ARC700}.
12073 @item -msoft-float
12074 @opindex msoft-float
12075 This option ignored; it is provided for compatibility purposes only.
12076 Software floating point code is emitted by default, and this default
12077 can overridden by FPX options; @samp{mspfp}, @samp{mspfp-compact}, or
12078 @samp{mspfp-fast} for single precision, and @samp{mdpfp},
12079 @samp{mdpfp-compact}, or @samp{mdpfp-fast} for double precision.
12081 @item -mswap
12082 @opindex mswap
12083 Generate swap instructions.
12085 @end table
12087 The following options are passed through to the assembler, and also
12088 define preprocessor macro symbols.
12090 @c Flags used by the assembler, but for which we define preprocessor
12091 @c macro symbols as well.
12092 @table @gcctabopt
12093 @item -mdsp-packa
12094 @opindex mdsp-packa
12095 Passed down to the assembler to enable the DSP Pack A extensions.
12096 Also sets the preprocessor symbol @code{__Xdsp_packa}.
12098 @item -mdvbf
12099 @opindex mdvbf
12100 Passed down to the assembler to enable the dual viterbi butterfly
12101 extension.  Also sets the preprocessor symbol @code{__Xdvbf}.
12103 @c ARC700 4.10 extension instruction
12104 @item -mlock
12105 @opindex mlock
12106 Passed down to the assembler to enable the Locked Load/Store
12107 Conditional extension.  Also sets the preprocessor symbol
12108 @code{__Xlock}.
12110 @item -mmac-d16
12111 @opindex mmac-d16
12112 Passed down to the assembler.  Also sets the preprocessor symbol
12113 @code{__Xxmac_d16}.
12115 @item -mmac-24
12116 @opindex mmac-24
12117 Passed down to the assembler.  Also sets the preprocessor symbol
12118 @code{__Xxmac_24}.
12120 @c ARC700 4.10 extension instruction
12121 @item -mrtsc
12122 @opindex mrtsc
12123 Passed down to the assembler to enable the 64-bit Time-Stamp Counter
12124 extension instruction.  Also sets the preprocessor symbol
12125 @code{__Xrtsc}.
12127 @c ARC700 4.10 extension instruction
12128 @item -mswape
12129 @opindex mswape
12130 Passed down to the assembler to enable the swap byte ordering
12131 extension instruction.  Also sets the preprocessor symbol
12132 @code{__Xswape}.
12134 @item -mtelephony
12135 @opindex mtelephony
12136 Passed down to the assembler to enable dual and single operand
12137 instructions for telephony.  Also sets the preprocessor symbol
12138 @code{__Xtelephony}.
12140 @item -mxy
12141 @opindex mxy
12142 Passed down to the assembler to enable the XY Memory extension.  Also
12143 sets the preprocessor symbol @code{__Xxy}.
12145 @end table
12147 The following options control how the assembly code is annotated:
12149 @c Assembly annotation options
12150 @table @gcctabopt
12151 @item -misize
12152 @opindex misize
12153 Annotate assembler instructions with estimated addresses.
12155 @item -mannotate-align
12156 @opindex mannotate-align
12157 Explain what alignment considerations lead to the decision to make an
12158 instruction short or long.
12160 @end table
12162 The following options are passed through to the linker:
12164 @c options passed through to the linker
12165 @table @gcctabopt
12166 @item -marclinux
12167 @opindex marclinux
12168 Passed through to the linker, to specify use of the @code{arclinux} emulation.
12169 This option is enabled by default in tool chains built for
12170 @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets
12171 when profiling is not requested.
12173 @item -marclinux_prof
12174 @opindex marclinux_prof
12175 Passed through to the linker, to specify use of the
12176 @code{arclinux_prof} emulation.  This option is enabled by default in
12177 tool chains built for @w{@code{arc-linux-uclibc}} and
12178 @w{@code{arceb-linux-uclibc}} targets when profiling is requested.
12180 @end table
12182 The following options control the semantics of generated code:
12184 @c semantically relevant code generation options
12185 @table @gcctabopt
12186 @item -mepilogue-cfi
12187 @opindex mepilogue-cfi
12188 Enable generation of call frame information for epilogues.
12190 @item -mno-epilogue-cfi
12191 @opindex mno-epilogue-cfi
12192 Disable generation of call frame information for epilogues.
12194 @item -mlong-calls
12195 @opindex mlong-calls
12196 Generate call insns as register indirect calls, thus providing access
12197 to the full 32-bit address range.
12199 @item -mmedium-calls
12200 @opindex mmedium-calls
12201 Don't use less than 25 bit addressing range for calls, which is the
12202 offset available for an unconditional branch-and-link
12203 instruction.  Conditional execution of function calls is suppressed, to
12204 allow use of the 25-bit range, rather than the 21-bit range with
12205 conditional branch-and-link.  This is the default for tool chains built
12206 for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets.
12208 @item -mno-sdata
12209 @opindex mno-sdata
12210 Do not generate sdata references.  This is the default for tool chains
12211 built for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}}
12212 targets.
12214 @item -mucb-mcount
12215 @opindex mucb-mcount
12216 Instrument with mcount calls as used in UCB code.  I.e. do the
12217 counting in the callee, not the caller.  By default ARC instrumentation
12218 counts in the caller.
12220 @item -mvolatile-cache
12221 @opindex mvolatile-cache
12222 Use ordinarily cached memory accesses for volatile references.  This is the
12223 default.
12225 @item -mno-volatile-cache
12226 @opindex mno-volatile-cache
12227 Enable cache bypass for volatile references.
12229 @end table
12231 The following options fine tune code generation:
12232 @c code generation tuning options
12233 @table @gcctabopt
12234 @item -malign-call
12235 @opindex malign-call
12236 Do alignment optimizations for call instructions.
12238 @item -mauto-modify-reg
12239 @opindex mauto-modify-reg
12240 Enable the use of pre/post modify with register displacement.
12242 @item -mbbit-peephole
12243 @opindex mbbit-peephole
12244 Enable bbit peephole2.
12246 @item -mno-brcc
12247 @opindex mno-brcc
12248 This option disables a target-specific pass in @file{arc_reorg} to
12249 generate @code{BRcc} instructions.  It has no effect on @code{BRcc}
12250 generation driven by the combiner pass.
12252 @item -mcase-vector-pcrel
12253 @opindex mcase-vector-pcrel
12254 Use pc-relative switch case tables - this enables case table shortening.
12255 This is the default for @option{-Os}.
12257 @item -mcompact-casesi
12258 @opindex mcompact-casesi
12259 Enable compact casesi pattern.
12260 This is the default for @option{-Os}.
12262 @item -mno-cond-exec
12263 @opindex mno-cond-exec
12264 Disable ARCompact specific pass to generate conditional execution instructions.
12265 Due to delay slot scheduling and interactions between operand numbers,
12266 literal sizes, instruction lengths, and the support for conditional execution,
12267 the target-independent pass to generate conditional execution is often lacking,
12268 so the ARC port has kept a special pass around that tries to find more
12269 conditional execution generating opportunities after register allocation,
12270 branch shortening, and delay slot scheduling have been done.  This pass
12271 generally, but not always, improves performance and code size, at the cost of
12272 extra compilation time, which is why there is an option to switch it off.
12273 If you have a problem with call instructions exceeding their allowable
12274 offset range because they are conditionalized, you should consider using
12275 @option{-mmedium-calls} instead.
12277 @item -mearly-cbranchsi
12278 @opindex mearly-cbranchsi
12279 Enable pre-reload use of the cbranchsi pattern.
12281 @item -mexpand-adddi
12282 @opindex mexpand-adddi
12283 Expand @code{adddi3} and @code{subdi3} at rtl generation time into
12284 @code{add.f}, @code{adc} etc.
12286 @item -mindexed-loads
12287 @opindex mindexed-loads
12288 Enable the use of indexed loads.  This can be problematic because some
12289 optimizers will then assume the that indexed stores exist, which is not
12290 the case.
12292 @item -mlra
12293 @opindex mlra
12294 Enable Local Register Allocation.  This is still experimental for ARC,
12295 so by default the compiler uses standard reload
12296 (i.e. @samp{-mno-lra}).
12298 @item -mlra-priority-none
12299 @opindex mlra-priority-none
12300 Don't indicate any priority for target registers.
12302 @item -mlra-priority-compact
12303 @opindex mlra-priority-compact
12304 Indicate target register priority for r0..r3 / r12..r15.
12306 @item -mlra-priority-noncompact
12307 @opindex mlra-priority-noncompact
12308 Reduce target regsiter priority for r0..r3 / r12..r15.
12310 @item -mno-millicode
12311 @opindex mno-millicode
12312 When optimizing for size (using @option{-Os}), prologues and epilogues
12313 that have to save or restore a large number of registers are often
12314 shortened by using call to a special function in libgcc; this is
12315 referred to as a @emph{millicode} call.  As these calls can pose
12316 performance issues, and/or cause linking issues when linking in a
12317 nonstandard way, this option is provided to turn off millicode call
12318 generation.
12320 @item -mmixed-code
12321 @opindex mmixed-code
12322 Tweak register allocation to help 16-bit instruction generation.
12323 This generally has the effect of decreasing the average instruction size
12324 while increasing the instruction count.
12326 @item -mq-class
12327 @opindex mq-class
12328 Enable 'q' instruction alternatives.
12329 This is the default for @option{-Os}.
12331 @item -mRcq
12332 @opindex mRcq
12333 Enable Rcq constraint handling - most short code generation depends on this.
12334 This is the default.
12336 @item -mRcw
12337 @opindex mRcw
12338 Enable Rcw constraint handling - ccfsm condexec mostly depends on this.
12339 This is the default.
12341 @item -msize-level=@var{level}
12342 @opindex msize-level
12343 Fine-tune size optimization with regards to instruction lengths and alignment.
12344 The recognized values for @var{level} are:
12345 @table @samp
12346 @item 0
12347 No size optimization.  This level is deprecated and treated like @samp{1}.
12349 @item 1
12350 Short instructions are used opportunistically.
12352 @item 2
12353 In addition, alignment of loops and of code after barriers are dropped.
12355 @item 3
12356 In addition, optional data alignment is dropped, and the option @option{Os} is enabled.
12358 @end table
12360 This defaults to @samp{3} when @option{-Os} is in effect.  Otherwise,
12361 the behavior when this is not set is equivalent to level @samp{1}.
12363 @item -mtune=@var{cpu}
12364 @opindex mtune
12365 Set instruction scheduling parameters for @var{cpu}, overriding any implied
12366 by @option{-mcpu=}.
12368 Supported values for @var{cpu} are
12370 @table @samp
12371 @item ARC600
12372 Tune for ARC600 cpu.
12374 @item ARC601
12375 Tune for ARC601 cpu.
12377 @item ARC700
12378 Tune for ARC700 cpu with standard multiplier block.
12380 @item ARC700-xmac
12381 Tune for ARC700 cpu with XMAC block.
12383 @item ARC725D
12384 Tune for ARC725D cpu.
12386 @item ARC750D
12387 Tune for ARC750D cpu.
12389 @end table
12391 @item -mmultcost=@var{num}
12392 @opindex mmultcost
12393 Cost to assume for a multiply instruction, with @samp{4} being equal to a
12394 normal instruction.
12396 @item -munalign-prob-threshold=@var{probability}
12397 @opindex munalign-prob-threshold
12398 Set probability threshold for unaligning branches.
12399 When tuning for @samp{ARC700} and optimizing for speed, branches without
12400 filled delay slot are preferably emitted unaligned and long, unless
12401 profiling indicates that the probability for the branch to be taken
12402 is below @var{probability}.  @xref{Cross-profiling}.
12403 The default is (REG_BR_PROB_BASE/2), i.e.@: 5000.
12405 @end table
12407 The following options are maintained for backward compatibility, but
12408 are now deprecated and will be removed in a future release:
12410 @c Deprecated options
12411 @table @gcctabopt
12413 @item -margonaut
12414 @opindex margonaut
12415 Obsolete FPX.
12417 @item -mbig-endian
12418 @opindex mbig-endian
12419 @itemx -EB
12420 @opindex EB
12421 Compile code for big endian targets.  Use of these options is now
12422 deprecated.  Users wanting big-endian code, should use the
12423 @w{@code{arceb-elf32}} and @w{@code{arceb-linux-uclibc}} targets when
12424 building the tool chain, for which big-endian is the default.
12426 @item -mlittle-endian
12427 @opindex mlittle-endian
12428 @itemx -EL
12429 @opindex EL
12430 Compile code for little endian targets.  Use of these options is now
12431 deprecated.  Users wanting little-endian code should use the
12432 @w{@code{arc-elf32}} and @w{@code{arc-linux-uclibc}} targets when
12433 building the tool chain, for which little-endian is the default.
12435 @item -mbarrel_shifter
12436 @opindex mbarrel_shifter
12437 Replaced by @samp{-mbarrel-shifter}
12439 @item -mdpfp_compact
12440 @opindex mdpfp_compact
12441 Replaced by @samp{-mdpfp-compact}
12443 @item -mdpfp_fast
12444 @opindex mdpfp_fast
12445 Replaced by @samp{-mdpfp-fast}
12447 @item -mdsp_packa
12448 @opindex mdsp_packa
12449 Replaced by @samp{-mdsp-packa}
12451 @item -mEA
12452 @opindex mEA
12453 Replaced by @samp{-mea}
12455 @item -mmac_24
12456 @opindex mmac_24
12457 Replaced by @samp{-mmac-24}
12459 @item -mmac_d16
12460 @opindex mmac_d16
12461 Replaced by @samp{-mmac-d16}
12463 @item -mspfp_compact
12464 @opindex mspfp_compact
12465 Replaced by @samp{-mspfp-compact}
12467 @item -mspfp_fast
12468 @opindex mspfp_fast
12469 Replaced by @samp{-mspfp-fast}
12471 @item -mtune=@var{cpu}
12472 @opindex mtune
12473 Values @samp{arc600}, @samp{arc601}, @samp{arc700} and
12474 @samp{arc700-xmac} for @var{cpu} are replaced by @samp{ARC600},
12475 @samp{ARC601}, @samp{ARC700} and @samp{ARC700-xmac} respectively
12477 @item -multcost=@var{num}
12478 @opindex multcost
12479 Replaced by @samp{-mmultcost}.
12481 @end table
12483 @node ARM Options
12484 @subsection ARM Options
12485 @cindex ARM options
12487 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
12488 architectures:
12490 @table @gcctabopt
12491 @item -mabi=@var{name}
12492 @opindex mabi
12493 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
12494 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
12496 @item -mapcs-frame
12497 @opindex mapcs-frame
12498 Generate a stack frame that is compliant with the ARM Procedure Call
12499 Standard for all functions, even if this is not strictly necessary for
12500 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
12501 with this option causes the stack frames not to be generated for
12502 leaf functions.  The default is @option{-mno-apcs-frame}.
12504 @item -mapcs
12505 @opindex mapcs
12506 This is a synonym for @option{-mapcs-frame}.
12508 @ignore
12509 @c not currently implemented
12510 @item -mapcs-stack-check
12511 @opindex mapcs-stack-check
12512 Generate code to check the amount of stack space available upon entry to
12513 every function (that actually uses some stack space).  If there is
12514 insufficient space available then either the function
12515 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} is
12516 called, depending upon the amount of stack space required.  The runtime
12517 system is required to provide these functions.  The default is
12518 @option{-mno-apcs-stack-check}, since this produces smaller code.
12520 @c not currently implemented
12521 @item -mapcs-float
12522 @opindex mapcs-float
12523 Pass floating-point arguments using the floating-point registers.  This is
12524 one of the variants of the APCS@.  This option is recommended if the
12525 target hardware has a floating-point unit or if a lot of floating-point
12526 arithmetic is going to be performed by the code.  The default is
12527 @option{-mno-apcs-float}, since the size of integer-only code is 
12528 slightly increased if @option{-mapcs-float} is used.
12530 @c not currently implemented
12531 @item -mapcs-reentrant
12532 @opindex mapcs-reentrant
12533 Generate reentrant, position-independent code.  The default is
12534 @option{-mno-apcs-reentrant}.
12535 @end ignore
12537 @item -mthumb-interwork
12538 @opindex mthumb-interwork
12539 Generate code that supports calling between the ARM and Thumb
12540 instruction sets.  Without this option, on pre-v5 architectures, the
12541 two instruction sets cannot be reliably used inside one program.  The
12542 default is @option{-mno-thumb-interwork}, since slightly larger code
12543 is generated when @option{-mthumb-interwork} is specified.  In AAPCS
12544 configurations this option is meaningless.
12546 @item -mno-sched-prolog
12547 @opindex mno-sched-prolog
12548 Prevent the reordering of instructions in the function prologue, or the
12549 merging of those instruction with the instructions in the function's
12550 body.  This means that all functions start with a recognizable set
12551 of instructions (or in fact one of a choice from a small set of
12552 different function prologues), and this information can be used to
12553 locate the start of functions inside an executable piece of code.  The
12554 default is @option{-msched-prolog}.
12556 @item -mfloat-abi=@var{name}
12557 @opindex mfloat-abi
12558 Specifies which floating-point ABI to use.  Permissible values
12559 are: @samp{soft}, @samp{softfp} and @samp{hard}.
12561 Specifying @samp{soft} causes GCC to generate output containing
12562 library calls for floating-point operations.
12563 @samp{softfp} allows the generation of code using hardware floating-point
12564 instructions, but still uses the soft-float calling conventions.
12565 @samp{hard} allows generation of floating-point instructions
12566 and uses FPU-specific calling conventions.
12568 The default depends on the specific target configuration.  Note that
12569 the hard-float and soft-float ABIs are not link-compatible; you must
12570 compile your entire program with the same ABI, and link with a
12571 compatible set of libraries.
12573 @item -mlittle-endian
12574 @opindex mlittle-endian
12575 Generate code for a processor running in little-endian mode.  This is
12576 the default for all standard configurations.
12578 @item -mbig-endian
12579 @opindex mbig-endian
12580 Generate code for a processor running in big-endian mode; the default is
12581 to compile code for a little-endian processor.
12583 @item -mwords-little-endian
12584 @opindex mwords-little-endian
12585 This option only applies when generating code for big-endian processors.
12586 Generate code for a little-endian word order but a big-endian byte
12587 order.  That is, a byte order of the form @samp{32107654}.  Note: this
12588 option should only be used if you require compatibility with code for
12589 big-endian ARM processors generated by versions of the compiler prior to
12590 2.8.  This option is now deprecated.
12592 @item -march=@var{name}
12593 @opindex march
12594 This specifies the name of the target ARM architecture.  GCC uses this
12595 name to determine what kind of instructions it can emit when generating
12596 assembly code.  This option can be used in conjunction with or instead
12597 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
12598 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
12599 @samp{armv5}, @samp{armv5t}, @samp{armv5e}, @samp{armv5te},
12600 @samp{armv6}, @samp{armv6j},
12601 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv6-m},
12602 @samp{armv7}, @samp{armv7-a}, @samp{armv7-r}, @samp{armv7-m}, @samp{armv7e-m},
12603 @samp{armv7ve}, @samp{armv8-a}, @samp{armv8-a+crc},
12604 @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}.
12606 @option{-march=armv7ve} is the armv7-a architecture with virtualization
12607 extensions.
12609 @option{-march=armv8-a+crc} enables code generation for the ARMv8-A
12610 architecture together with the optional CRC32 extensions.
12612 @option{-march=native} causes the compiler to auto-detect the architecture
12613 of the build computer.  At present, this feature is only supported on
12614 GNU/Linux, and not all architectures are recognized.  If the auto-detect
12615 is unsuccessful the option has no effect.
12617 @item -mtune=@var{name}
12618 @opindex mtune
12619 This option specifies the name of the target ARM processor for
12620 which GCC should tune the performance of the code.
12621 For some ARM implementations better performance can be obtained by using
12622 this option.
12623 Permissible names are: @samp{arm2}, @samp{arm250},
12624 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
12625 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
12626 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
12627 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
12628 @samp{arm720},
12629 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
12630 @samp{arm710t}, @samp{arm720t}, @samp{arm740t},
12631 @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
12632 @samp{strongarm1110},
12633 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
12634 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
12635 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
12636 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
12637 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
12638 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
12639 @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
12640 @samp{cortex-a5}, @samp{cortex-a7}, @samp{cortex-a8}, @samp{cortex-a9},
12641 @samp{cortex-a12}, @samp{cortex-a15}, @samp{cortex-a53}, @samp{cortex-a57},
12642 @samp{cortex-r4},
12643 @samp{cortex-r4f}, @samp{cortex-r5}, @samp{cortex-r7}, @samp{cortex-m4},
12644 @samp{cortex-m3},
12645 @samp{cortex-m1},
12646 @samp{cortex-m0},
12647 @samp{cortex-m0plus},
12648 @samp{marvell-pj4},
12649 @samp{xscale}, @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312},
12650 @samp{fa526}, @samp{fa626},
12651 @samp{fa606te}, @samp{fa626te}, @samp{fmp626}, @samp{fa726te}.
12653 Additionally, this option can specify that GCC should tune the performance
12654 of the code for a big.LITTLE system.  Permissible names are:
12655 @samp{cortex-a15.cortex-a7}, @samp{cortex-a57.cortex-a53}.
12657 @option{-mtune=generic-@var{arch}} specifies that GCC should tune the
12658 performance for a blend of processors within architecture @var{arch}.
12659 The aim is to generate code that run well on the current most popular
12660 processors, balancing between optimizations that benefit some CPUs in the
12661 range, and avoiding performance pitfalls of other CPUs.  The effects of
12662 this option may change in future GCC versions as CPU models come and go.
12664 @option{-mtune=native} causes the compiler to auto-detect the CPU
12665 of the build computer.  At present, this feature is only supported on
12666 GNU/Linux, and not all architectures are recognized.  If the auto-detect is
12667 unsuccessful the option has no effect.
12669 @item -mcpu=@var{name}
12670 @opindex mcpu
12671 This specifies the name of the target ARM processor.  GCC uses this name
12672 to derive the name of the target ARM architecture (as if specified
12673 by @option{-march}) and the ARM processor type for which to tune for
12674 performance (as if specified by @option{-mtune}).  Where this option
12675 is used in conjunction with @option{-march} or @option{-mtune},
12676 those options take precedence over the appropriate part of this option.
12678 Permissible names for this option are the same as those for
12679 @option{-mtune}.
12681 @option{-mcpu=generic-@var{arch}} is also permissible, and is
12682 equivalent to @option{-march=@var{arch} -mtune=generic-@var{arch}}.
12683 See @option{-mtune} for more information.
12685 @option{-mcpu=native} causes the compiler to auto-detect the CPU
12686 of the build computer.  At present, this feature is only supported on
12687 GNU/Linux, and not all architectures are recognized.  If the auto-detect
12688 is unsuccessful the option has no effect.
12690 @item -mfpu=@var{name}
12691 @opindex mfpu
12692 This specifies what floating-point hardware (or hardware emulation) is
12693 available on the target.  Permissible names are: @samp{vfp}, @samp{vfpv3},
12694 @samp{vfpv3-fp16}, @samp{vfpv3-d16}, @samp{vfpv3-d16-fp16}, @samp{vfpv3xd},
12695 @samp{vfpv3xd-fp16}, @samp{neon}, @samp{neon-fp16}, @samp{vfpv4},
12696 @samp{vfpv4-d16}, @samp{fpv4-sp-d16}, @samp{neon-vfpv4},
12697 @samp{fp-armv8}, @samp{neon-fp-armv8}, and @samp{crypto-neon-fp-armv8}.
12699 If @option{-msoft-float} is specified this specifies the format of
12700 floating-point values.
12702 If the selected floating-point hardware includes the NEON extension
12703 (e.g. @option{-mfpu}=@samp{neon}), note that floating-point
12704 operations are not generated by GCC's auto-vectorization pass unless
12705 @option{-funsafe-math-optimizations} is also specified.  This is
12706 because NEON hardware does not fully implement the IEEE 754 standard for
12707 floating-point arithmetic (in particular denormal values are treated as
12708 zero), so the use of NEON instructions may lead to a loss of precision.
12710 @item -mfp16-format=@var{name}
12711 @opindex mfp16-format
12712 Specify the format of the @code{__fp16} half-precision floating-point type.
12713 Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative};
12714 the default is @samp{none}, in which case the @code{__fp16} type is not
12715 defined.  @xref{Half-Precision}, for more information.
12717 @item -mstructure-size-boundary=@var{n}
12718 @opindex mstructure-size-boundary
12719 The sizes of all structures and unions are rounded up to a multiple
12720 of the number of bits set by this option.  Permissible values are 8, 32
12721 and 64.  The default value varies for different toolchains.  For the COFF
12722 targeted toolchain the default value is 8.  A value of 64 is only allowed
12723 if the underlying ABI supports it.
12725 Specifying a larger number can produce faster, more efficient code, but
12726 can also increase the size of the program.  Different values are potentially
12727 incompatible.  Code compiled with one value cannot necessarily expect to
12728 work with code or libraries compiled with another value, if they exchange
12729 information using structures or unions.
12731 @item -mabort-on-noreturn
12732 @opindex mabort-on-noreturn
12733 Generate a call to the function @code{abort} at the end of a
12734 @code{noreturn} function.  It is executed if the function tries to
12735 return.
12737 @item -mlong-calls
12738 @itemx -mno-long-calls
12739 @opindex mlong-calls
12740 @opindex mno-long-calls
12741 Tells the compiler to perform function calls by first loading the
12742 address of the function into a register and then performing a subroutine
12743 call on this register.  This switch is needed if the target function
12744 lies outside of the 64-megabyte addressing range of the offset-based
12745 version of subroutine call instruction.
12747 Even if this switch is enabled, not all function calls are turned
12748 into long calls.  The heuristic is that static functions, functions
12749 that have the @samp{short-call} attribute, functions that are inside
12750 the scope of a @samp{#pragma no_long_calls} directive, and functions whose
12751 definitions have already been compiled within the current compilation
12752 unit are not turned into long calls.  The exceptions to this rule are
12753 that weak function definitions, functions with the @samp{long-call}
12754 attribute or the @samp{section} attribute, and functions that are within
12755 the scope of a @samp{#pragma long_calls} directive are always
12756 turned into long calls.
12758 This feature is not enabled by default.  Specifying
12759 @option{-mno-long-calls} restores the default behavior, as does
12760 placing the function calls within the scope of a @samp{#pragma
12761 long_calls_off} directive.  Note these switches have no effect on how
12762 the compiler generates code to handle function calls via function
12763 pointers.
12765 @item -msingle-pic-base
12766 @opindex msingle-pic-base
12767 Treat the register used for PIC addressing as read-only, rather than
12768 loading it in the prologue for each function.  The runtime system is
12769 responsible for initializing this register with an appropriate value
12770 before execution begins.
12772 @item -mpic-register=@var{reg}
12773 @opindex mpic-register
12774 Specify the register to be used for PIC addressing.
12775 For standard PIC base case, the default will be any suitable register
12776 determined by compiler.  For single PIC base case, the default is
12777 @samp{R9} if target is EABI based or stack-checking is enabled,
12778 otherwise the default is @samp{R10}.
12780 @item -mpic-data-is-text-relative
12781 @opindex mpic-data-is-text-relative
12782 Assume that each data segments are relative to text segment at load time.
12783 Therefore, it permits addressing data using PC-relative operations.
12784 This option is on by default for targets other than VxWorks RTP.
12786 @item -mpoke-function-name
12787 @opindex mpoke-function-name
12788 Write the name of each function into the text section, directly
12789 preceding the function prologue.  The generated code is similar to this:
12791 @smallexample
12792      t0
12793          .ascii "arm_poke_function_name", 0
12794          .align
12795      t1
12796          .word 0xff000000 + (t1 - t0)
12797      arm_poke_function_name
12798          mov     ip, sp
12799          stmfd   sp!, @{fp, ip, lr, pc@}
12800          sub     fp, ip, #4
12801 @end smallexample
12803 When performing a stack backtrace, code can inspect the value of
12804 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
12805 location @code{pc - 12} and the top 8 bits are set, then we know that
12806 there is a function name embedded immediately preceding this location
12807 and has length @code{((pc[-3]) & 0xff000000)}.
12809 @item -mthumb
12810 @itemx -marm
12811 @opindex marm
12812 @opindex mthumb
12814 Select between generating code that executes in ARM and Thumb
12815 states.  The default for most configurations is to generate code
12816 that executes in ARM state, but the default can be changed by
12817 configuring GCC with the @option{--with-mode=}@var{state}
12818 configure option.
12820 @item -mtpcs-frame
12821 @opindex mtpcs-frame
12822 Generate a stack frame that is compliant with the Thumb Procedure Call
12823 Standard for all non-leaf functions.  (A leaf function is one that does
12824 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
12826 @item -mtpcs-leaf-frame
12827 @opindex mtpcs-leaf-frame
12828 Generate a stack frame that is compliant with the Thumb Procedure Call
12829 Standard for all leaf functions.  (A leaf function is one that does
12830 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
12832 @item -mcallee-super-interworking
12833 @opindex mcallee-super-interworking
12834 Gives all externally visible functions in the file being compiled an ARM
12835 instruction set header which switches to Thumb mode before executing the
12836 rest of the function.  This allows these functions to be called from
12837 non-interworking code.  This option is not valid in AAPCS configurations
12838 because interworking is enabled by default.
12840 @item -mcaller-super-interworking
12841 @opindex mcaller-super-interworking
12842 Allows calls via function pointers (including virtual functions) to
12843 execute correctly regardless of whether the target code has been
12844 compiled for interworking or not.  There is a small overhead in the cost
12845 of executing a function pointer if this option is enabled.  This option
12846 is not valid in AAPCS configurations because interworking is enabled
12847 by default.
12849 @item -mtp=@var{name}
12850 @opindex mtp
12851 Specify the access model for the thread local storage pointer.  The valid
12852 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
12853 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
12854 (supported in the arm6k architecture), and @option{auto}, which uses the
12855 best available method for the selected processor.  The default setting is
12856 @option{auto}.
12858 @item -mtls-dialect=@var{dialect}
12859 @opindex mtls-dialect
12860 Specify the dialect to use for accessing thread local storage.  Two
12861 @var{dialect}s are supported---@samp{gnu} and @samp{gnu2}.  The
12862 @samp{gnu} dialect selects the original GNU scheme for supporting
12863 local and global dynamic TLS models.  The @samp{gnu2} dialect
12864 selects the GNU descriptor scheme, which provides better performance
12865 for shared libraries.  The GNU descriptor scheme is compatible with
12866 the original scheme, but does require new assembler, linker and
12867 library support.  Initial and local exec TLS models are unaffected by
12868 this option and always use the original scheme.
12870 @item -mword-relocations
12871 @opindex mword-relocations
12872 Only generate absolute relocations on word-sized values (i.e. R_ARM_ABS32).
12873 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
12874 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
12875 is specified.
12877 @item -mfix-cortex-m3-ldrd
12878 @opindex mfix-cortex-m3-ldrd
12879 Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
12880 with overlapping destination and base registers are used.  This option avoids
12881 generating these instructions.  This option is enabled by default when
12882 @option{-mcpu=cortex-m3} is specified.
12884 @item -munaligned-access
12885 @itemx -mno-unaligned-access
12886 @opindex munaligned-access
12887 @opindex mno-unaligned-access
12888 Enables (or disables) reading and writing of 16- and 32- bit values
12889 from addresses that are not 16- or 32- bit aligned.  By default
12890 unaligned access is disabled for all pre-ARMv6 and all ARMv6-M
12891 architectures, and enabled for all other architectures.  If unaligned
12892 access is not enabled then words in packed data structures will be
12893 accessed a byte at a time.
12895 The ARM attribute @code{Tag_CPU_unaligned_access} will be set in the
12896 generated object file to either true or false, depending upon the
12897 setting of this option.  If unaligned access is enabled then the
12898 preprocessor symbol @code{__ARM_FEATURE_UNALIGNED} will also be
12899 defined.
12901 @item -mneon-for-64bits
12902 @opindex mneon-for-64bits
12903 Enables using Neon to handle scalar 64-bits operations. This is
12904 disabled by default since the cost of moving data from core registers
12905 to Neon is high.
12907 @item -mslow-flash-data
12908 @opindex mslow-flash-data
12909 Assume loading data from flash is slower than fetching instruction.
12910 Therefore literal load is minimized for better performance.
12911 This option is only supported when compiling for ARMv7 M-profile and
12912 off by default.
12914 @item -mrestrict-it
12915 @opindex mrestrict-it
12916 Restricts generation of IT blocks to conform to the rules of ARMv8.
12917 IT blocks can only contain a single 16-bit instruction from a select
12918 set of instructions. This option is on by default for ARMv8 Thumb mode.
12919 @end table
12921 @node AVR Options
12922 @subsection AVR Options
12923 @cindex AVR Options
12925 These options are defined for AVR implementations:
12927 @table @gcctabopt
12928 @item -mmcu=@var{mcu}
12929 @opindex mmcu
12930 Specify Atmel AVR instruction set architectures (ISA) or MCU type.
12932 The default for this option is@tie{}@code{avr2}.
12934 GCC supports the following AVR devices and ISAs:
12936 @include avr-mmcu.texi
12938 @item -maccumulate-args
12939 @opindex maccumulate-args
12940 Accumulate outgoing function arguments and acquire/release the needed
12941 stack space for outgoing function arguments once in function
12942 prologue/epilogue.  Without this option, outgoing arguments are pushed
12943 before calling a function and popped afterwards.
12945 Popping the arguments after the function call can be expensive on
12946 AVR so that accumulating the stack space might lead to smaller
12947 executables because arguments need not to be removed from the
12948 stack after such a function call.
12950 This option can lead to reduced code size for functions that perform
12951 several calls to functions that get their arguments on the stack like
12952 calls to printf-like functions.
12954 @item -mbranch-cost=@var{cost}
12955 @opindex mbranch-cost
12956 Set the branch costs for conditional branch instructions to
12957 @var{cost}.  Reasonable values for @var{cost} are small, non-negative
12958 integers. The default branch cost is 0.
12960 @item -mcall-prologues
12961 @opindex mcall-prologues
12962 Functions prologues/epilogues are expanded as calls to appropriate
12963 subroutines.  Code size is smaller.
12965 @item -mint8
12966 @opindex mint8
12967 Assume @code{int} to be 8-bit integer.  This affects the sizes of all types: a
12968 @code{char} is 1 byte, an @code{int} is 1 byte, a @code{long} is 2 bytes,
12969 and @code{long long} is 4 bytes.  Please note that this option does not
12970 conform to the C standards, but it results in smaller code
12971 size.
12973 @item -mno-interrupts
12974 @opindex mno-interrupts
12975 Generated code is not compatible with hardware interrupts.
12976 Code size is smaller.
12978 @item -mrelax
12979 @opindex mrelax
12980 Try to replace @code{CALL} resp.@: @code{JMP} instruction by the shorter
12981 @code{RCALL} resp.@: @code{RJMP} instruction if applicable.
12982 Setting @code{-mrelax} just adds the @code{--relax} option to the
12983 linker command line when the linker is called.
12985 Jump relaxing is performed by the linker because jump offsets are not
12986 known before code is located. Therefore, the assembler code generated by the
12987 compiler is the same, but the instructions in the executable may
12988 differ from instructions in the assembler code.
12990 Relaxing must be turned on if linker stubs are needed, see the
12991 section on @code{EIND} and linker stubs below.
12993 @item -msp8
12994 @opindex msp8
12995 Treat the stack pointer register as an 8-bit register,
12996 i.e.@: assume the high byte of the stack pointer is zero.
12997 In general, you don't need to set this option by hand.
12999 This option is used internally by the compiler to select and
13000 build multilibs for architectures @code{avr2} and @code{avr25}.
13001 These architectures mix devices with and without @code{SPH}.
13002 For any setting other than @code{-mmcu=avr2} or @code{-mmcu=avr25}
13003 the compiler driver will add or remove this option from the compiler
13004 proper's command line, because the compiler then knows if the device
13005 or architecture has an 8-bit stack pointer and thus no @code{SPH}
13006 register or not.
13008 @item -mstrict-X
13009 @opindex mstrict-X
13010 Use address register @code{X} in a way proposed by the hardware.  This means
13011 that @code{X} is only used in indirect, post-increment or
13012 pre-decrement addressing.
13014 Without this option, the @code{X} register may be used in the same way
13015 as @code{Y} or @code{Z} which then is emulated by additional
13016 instructions.  
13017 For example, loading a value with @code{X+const} addressing with a
13018 small non-negative @code{const < 64} to a register @var{Rn} is
13019 performed as
13021 @example
13022 adiw r26, const   ; X += const
13023 ld   @var{Rn}, X        ; @var{Rn} = *X
13024 sbiw r26, const   ; X -= const
13025 @end example
13027 @item -mtiny-stack
13028 @opindex mtiny-stack
13029 Only change the lower 8@tie{}bits of the stack pointer.
13031 @item -Waddr-space-convert
13032 @opindex Waddr-space-convert
13033 Warn about conversions between address spaces in the case where the
13034 resulting address space is not contained in the incoming address space.
13035 @end table
13037 @subsubsection @code{EIND} and Devices with more than 128 Ki Bytes of Flash
13038 @cindex @code{EIND}
13039 Pointers in the implementation are 16@tie{}bits wide.
13040 The address of a function or label is represented as word address so
13041 that indirect jumps and calls can target any code address in the
13042 range of 64@tie{}Ki words.
13044 In order to facilitate indirect jump on devices with more than 128@tie{}Ki
13045 bytes of program memory space, there is a special function register called
13046 @code{EIND} that serves as most significant part of the target address
13047 when @code{EICALL} or @code{EIJMP} instructions are used.
13049 Indirect jumps and calls on these devices are handled as follows by
13050 the compiler and are subject to some limitations:
13052 @itemize @bullet
13054 @item
13055 The compiler never sets @code{EIND}.
13057 @item
13058 The compiler uses @code{EIND} implicitely in @code{EICALL}/@code{EIJMP}
13059 instructions or might read @code{EIND} directly in order to emulate an
13060 indirect call/jump by means of a @code{RET} instruction.
13062 @item
13063 The compiler assumes that @code{EIND} never changes during the startup
13064 code or during the application. In particular, @code{EIND} is not
13065 saved/restored in function or interrupt service routine
13066 prologue/epilogue.
13068 @item
13069 For indirect calls to functions and computed goto, the linker
13070 generates @emph{stubs}. Stubs are jump pads sometimes also called
13071 @emph{trampolines}. Thus, the indirect call/jump jumps to such a stub.
13072 The stub contains a direct jump to the desired address.
13074 @item
13075 Linker relaxation must be turned on so that the linker will generate
13076 the stubs correctly an all situaltion. See the compiler option
13077 @code{-mrelax} and the linler option @code{--relax}.
13078 There are corner cases where the linker is supposed to generate stubs
13079 but aborts without relaxation and without a helpful error message.
13081 @item
13082 The default linker script is arranged for code with @code{EIND = 0}.
13083 If code is supposed to work for a setup with @code{EIND != 0}, a custom
13084 linker script has to be used in order to place the sections whose
13085 name start with @code{.trampolines} into the segment where @code{EIND}
13086 points to.
13088 @item
13089 The startup code from libgcc never sets @code{EIND}.
13090 Notice that startup code is a blend of code from libgcc and AVR-LibC.
13091 For the impact of AVR-LibC on @code{EIND}, see the
13092 @w{@uref{http://nongnu.org/avr-libc/user-manual/,AVR-LibC user manual}}.
13094 @item
13095 It is legitimate for user-specific startup code to set up @code{EIND}
13096 early, for example by means of initialization code located in
13097 section @code{.init3}. Such code runs prior to general startup code
13098 that initializes RAM and calls constructors, but after the bit
13099 of startup code from AVR-LibC that sets @code{EIND} to the segment
13100 where the vector table is located.
13101 @example
13102 #include <avr/io.h>
13104 static void
13105 __attribute__((section(".init3"),naked,used,no_instrument_function))
13106 init3_set_eind (void)
13108   __asm volatile ("ldi r24,pm_hh8(__trampolines_start)\n\t"
13109                   "out %i0,r24" :: "n" (&EIND) : "r24","memory");
13111 @end example
13113 @noindent
13114 The @code{__trampolines_start} symbol is defined in the linker script.
13116 @item
13117 Stubs are generated automatically by the linker if
13118 the following two conditions are met:
13119 @itemize @minus
13121 @item The address of a label is taken by means of the @code{gs} modifier
13122 (short for @emph{generate stubs}) like so:
13123 @example
13124 LDI r24, lo8(gs(@var{func}))
13125 LDI r25, hi8(gs(@var{func}))
13126 @end example
13127 @item The final location of that label is in a code segment
13128 @emph{outside} the segment where the stubs are located.
13129 @end itemize
13131 @item
13132 The compiler emits such @code{gs} modifiers for code labels in the
13133 following situations:
13134 @itemize @minus
13135 @item Taking address of a function or code label.
13136 @item Computed goto.
13137 @item If prologue-save function is used, see @option{-mcall-prologues}
13138 command-line option.
13139 @item Switch/case dispatch tables. If you do not want such dispatch
13140 tables you can specify the @option{-fno-jump-tables} command-line option.
13141 @item C and C++ constructors/destructors called during startup/shutdown.
13142 @item If the tools hit a @code{gs()} modifier explained above.
13143 @end itemize
13145 @item
13146 Jumping to non-symbolic addresses like so is @emph{not} supported:
13148 @example
13149 int main (void)
13151     /* Call function at word address 0x2 */
13152     return ((int(*)(void)) 0x2)();
13154 @end example
13156 Instead, a stub has to be set up, i.e.@: the function has to be called
13157 through a symbol (@code{func_4} in the example):
13159 @example
13160 int main (void)
13162     extern int func_4 (void);
13164     /* Call function at byte address 0x4 */
13165     return func_4();
13167 @end example
13169 and the application be linked with @code{-Wl,--defsym,func_4=0x4}.
13170 Alternatively, @code{func_4} can be defined in the linker script.
13171 @end itemize
13173 @subsubsection Handling of the @code{RAMPD}, @code{RAMPX}, @code{RAMPY} and @code{RAMPZ} Special Function Registers
13174 @cindex @code{RAMPD}
13175 @cindex @code{RAMPX}
13176 @cindex @code{RAMPY}
13177 @cindex @code{RAMPZ}
13178 Some AVR devices support memories larger than the 64@tie{}KiB range
13179 that can be accessed with 16-bit pointers.  To access memory locations
13180 outside this 64@tie{}KiB range, the contentent of a @code{RAMP}
13181 register is used as high part of the address:
13182 The @code{X}, @code{Y}, @code{Z} address register is concatenated
13183 with the @code{RAMPX}, @code{RAMPY}, @code{RAMPZ} special function
13184 register, respectively, to get a wide address. Similarly,
13185 @code{RAMPD} is used together with direct addressing.
13187 @itemize
13188 @item
13189 The startup code initializes the @code{RAMP} special function
13190 registers with zero.
13192 @item
13193 If a @ref{AVR Named Address Spaces,named address space} other than
13194 generic or @code{__flash} is used, then @code{RAMPZ} is set
13195 as needed before the operation.
13197 @item
13198 If the device supports RAM larger than 64@tie{}KiB and the compiler
13199 needs to change @code{RAMPZ} to accomplish an operation, @code{RAMPZ}
13200 is reset to zero after the operation.
13202 @item
13203 If the device comes with a specific @code{RAMP} register, the ISR
13204 prologue/epilogue saves/restores that SFR and initializes it with
13205 zero in case the ISR code might (implicitly) use it.
13207 @item
13208 RAM larger than 64@tie{}KiB is not supported by GCC for AVR targets.
13209 If you use inline assembler to read from locations outside the
13210 16-bit address range and change one of the @code{RAMP} registers,
13211 you must reset it to zero after the access.
13213 @end itemize
13215 @subsubsection AVR Built-in Macros
13217 GCC defines several built-in macros so that the user code can test
13218 for the presence or absence of features.  Almost any of the following
13219 built-in macros are deduced from device capabilities and thus
13220 triggered by the @code{-mmcu=} command-line option.
13222 For even more AVR-specific built-in macros see
13223 @ref{AVR Named Address Spaces} and @ref{AVR Built-in Functions}.
13225 @table @code
13227 @item __AVR_ARCH__
13228 Build-in macro that resolves to a decimal number that identifies the
13229 architecture and depends on the @code{-mmcu=@var{mcu}} option.
13230 Possible values are:
13232 @code{2}, @code{25}, @code{3}, @code{31}, @code{35},
13233 @code{4}, @code{5}, @code{51}, @code{6}, @code{102}, @code{104},
13234 @code{105}, @code{106}, @code{107}
13236 for @var{mcu}=@code{avr2}, @code{avr25}, @code{avr3},
13237 @code{avr31}, @code{avr35}, @code{avr4}, @code{avr5}, @code{avr51},
13238 @code{avr6}, @code{avrxmega2}, @code{avrxmega4}, @code{avrxmega5},
13239 @code{avrxmega6}, @code{avrxmega7}, respectively.
13240 If @var{mcu} specifies a device, this built-in macro is set
13241 accordingly. For example, with @code{-mmcu=atmega8} the macro will be
13242 defined to @code{4}.
13244 @item __AVR_@var{Device}__
13245 Setting @code{-mmcu=@var{device}} defines this built-in macro which reflects
13246 the device's name. For example, @code{-mmcu=atmega8} defines the
13247 built-in macro @code{__AVR_ATmega8__}, @code{-mmcu=attiny261a} defines
13248 @code{__AVR_ATtiny261A__}, etc.
13250 The built-in macros' names follow
13251 the scheme @code{__AVR_@var{Device}__} where @var{Device} is
13252 the device name as from the AVR user manual. The difference between
13253 @var{Device} in the built-in macro and @var{device} in
13254 @code{-mmcu=@var{device}} is that the latter is always lowercase.
13256 If @var{device} is not a device but only a core architecture like
13257 @code{avr51}, this macro will not be defined.
13259 @item __AVR_XMEGA__
13260 The device / architecture belongs to the XMEGA family of devices.
13262 @item __AVR_HAVE_ELPM__
13263 The device has the the @code{ELPM} instruction.
13265 @item __AVR_HAVE_ELPMX__
13266 The device has the @code{ELPM R@var{n},Z} and @code{ELPM
13267 R@var{n},Z+} instructions.
13269 @item __AVR_HAVE_MOVW__
13270 The device has the @code{MOVW} instruction to perform 16-bit
13271 register-register moves.
13273 @item __AVR_HAVE_LPMX__
13274 The device has the @code{LPM R@var{n},Z} and
13275 @code{LPM R@var{n},Z+} instructions.
13277 @item __AVR_HAVE_MUL__
13278 The device has a hardware multiplier. 
13280 @item __AVR_HAVE_JMP_CALL__
13281 The device has the @code{JMP} and @code{CALL} instructions.
13282 This is the case for devices with at least 16@tie{}KiB of program
13283 memory.
13285 @item __AVR_HAVE_EIJMP_EICALL__
13286 @itemx __AVR_3_BYTE_PC__
13287 The device has the @code{EIJMP} and @code{EICALL} instructions.
13288 This is the case for devices with more than 128@tie{}KiB of program memory.
13289 This also means that the program counter
13290 (PC) is 3@tie{}bytes wide.
13292 @item __AVR_2_BYTE_PC__
13293 The program counter (PC) is 2@tie{}bytes wide. This is the case for devices
13294 with up to 128@tie{}KiB of program memory.
13296 @item __AVR_HAVE_8BIT_SP__
13297 @itemx __AVR_HAVE_16BIT_SP__
13298 The stack pointer (SP) register is treated as 8-bit respectively
13299 16-bit register by the compiler.
13300 The definition of these macros is affected by @code{-mtiny-stack}.
13302 @item __AVR_HAVE_SPH__
13303 @itemx __AVR_SP8__
13304 The device has the SPH (high part of stack pointer) special function
13305 register or has an 8-bit stack pointer, respectively.
13306 The definition of these macros is affected by @code{-mmcu=} and
13307 in the cases of @code{-mmcu=avr2} and @code{-mmcu=avr25} also
13308 by @code{-msp8}.
13310 @item __AVR_HAVE_RAMPD__
13311 @itemx __AVR_HAVE_RAMPX__
13312 @itemx __AVR_HAVE_RAMPY__
13313 @itemx __AVR_HAVE_RAMPZ__
13314 The device has the @code{RAMPD}, @code{RAMPX}, @code{RAMPY},
13315 @code{RAMPZ} special function register, respectively.
13317 @item __NO_INTERRUPTS__
13318 This macro reflects the @code{-mno-interrupts} command line option.
13320 @item __AVR_ERRATA_SKIP__
13321 @itemx __AVR_ERRATA_SKIP_JMP_CALL__
13322 Some AVR devices (AT90S8515, ATmega103) must not skip 32-bit
13323 instructions because of a hardware erratum.  Skip instructions are
13324 @code{SBRS}, @code{SBRC}, @code{SBIS}, @code{SBIC} and @code{CPSE}.
13325 The second macro is only defined if @code{__AVR_HAVE_JMP_CALL__} is also
13326 set.
13328 @item __AVR_ISA_RMW__
13329 The device has Read-Modify-Write instructions (XCH, LAC, LAS and LAT).
13331 @item __AVR_SFR_OFFSET__=@var{offset}
13332 Instructions that can address I/O special function registers directly
13333 like @code{IN}, @code{OUT}, @code{SBI}, etc.@: may use a different
13334 address as if addressed by an instruction to access RAM like @code{LD}
13335 or @code{STS}. This offset depends on the device architecture and has
13336 to be subtracted from the RAM address in order to get the
13337 respective I/O@tie{}address.
13339 @item __WITH_AVRLIBC__
13340 The compiler is configured to be used together with AVR-Libc.
13341 See the @code{--with-avrlibc} configure option.
13343 @end table
13345 @node Blackfin Options
13346 @subsection Blackfin Options
13347 @cindex Blackfin Options
13349 @table @gcctabopt
13350 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
13351 @opindex mcpu=
13352 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
13353 can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
13354 @samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
13355 @samp{bf527}, @samp{bf531}, @samp{bf532}, @samp{bf533},
13356 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
13357 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
13358 @samp{bf542m}, @samp{bf544m}, @samp{bf547m}, @samp{bf548m}, @samp{bf549m},
13359 @samp{bf561}, @samp{bf592}.
13361 The optional @var{sirevision} specifies the silicon revision of the target
13362 Blackfin processor.  Any workarounds available for the targeted silicon revision
13363 are enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
13364 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
13365 are enabled.  The @code{__SILICON_REVISION__} macro is defined to two
13366 hexadecimal digits representing the major and minor numbers in the silicon
13367 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
13368 is not defined.  If @var{sirevision} is @samp{any}, the
13369 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
13370 If this optional @var{sirevision} is not used, GCC assumes the latest known
13371 silicon revision of the targeted Blackfin processor.
13373 GCC defines a preprocessor macro for the specified @var{cpu}.
13374 For the @samp{bfin-elf} toolchain, this option causes the hardware BSP
13375 provided by libgloss to be linked in if @option{-msim} is not given.
13377 Without this option, @samp{bf532} is used as the processor by default.
13379 Note that support for @samp{bf561} is incomplete.  For @samp{bf561},
13380 only the preprocessor macro is defined.
13382 @item -msim
13383 @opindex msim
13384 Specifies that the program will be run on the simulator.  This causes
13385 the simulator BSP provided by libgloss to be linked in.  This option
13386 has effect only for @samp{bfin-elf} toolchain.
13387 Certain other options, such as @option{-mid-shared-library} and
13388 @option{-mfdpic}, imply @option{-msim}.
13390 @item -momit-leaf-frame-pointer
13391 @opindex momit-leaf-frame-pointer
13392 Don't keep the frame pointer in a register for leaf functions.  This
13393 avoids the instructions to save, set up and restore frame pointers and
13394 makes an extra register available in leaf functions.  The option
13395 @option{-fomit-frame-pointer} removes the frame pointer for all functions,
13396 which might make debugging harder.
13398 @item -mspecld-anomaly
13399 @opindex mspecld-anomaly
13400 When enabled, the compiler ensures that the generated code does not
13401 contain speculative loads after jump instructions. If this option is used,
13402 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
13404 @item -mno-specld-anomaly
13405 @opindex mno-specld-anomaly
13406 Don't generate extra code to prevent speculative loads from occurring.
13408 @item -mcsync-anomaly
13409 @opindex mcsync-anomaly
13410 When enabled, the compiler ensures that the generated code does not
13411 contain CSYNC or SSYNC instructions too soon after conditional branches.
13412 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
13414 @item -mno-csync-anomaly
13415 @opindex mno-csync-anomaly
13416 Don't generate extra code to prevent CSYNC or SSYNC instructions from
13417 occurring too soon after a conditional branch.
13419 @item -mlow-64k
13420 @opindex mlow-64k
13421 When enabled, the compiler is free to take advantage of the knowledge that
13422 the entire program fits into the low 64k of memory.
13424 @item -mno-low-64k
13425 @opindex mno-low-64k
13426 Assume that the program is arbitrarily large.  This is the default.
13428 @item -mstack-check-l1
13429 @opindex mstack-check-l1
13430 Do stack checking using information placed into L1 scratchpad memory by the
13431 uClinux kernel.
13433 @item -mid-shared-library
13434 @opindex mid-shared-library
13435 Generate code that supports shared libraries via the library ID method.
13436 This allows for execute in place and shared libraries in an environment
13437 without virtual memory management.  This option implies @option{-fPIC}.
13438 With a @samp{bfin-elf} target, this option implies @option{-msim}.
13440 @item -mno-id-shared-library
13441 @opindex mno-id-shared-library
13442 Generate code that doesn't assume ID-based shared libraries are being used.
13443 This is the default.
13445 @item -mleaf-id-shared-library
13446 @opindex mleaf-id-shared-library
13447 Generate code that supports shared libraries via the library ID method,
13448 but assumes that this library or executable won't link against any other
13449 ID shared libraries.  That allows the compiler to use faster code for jumps
13450 and calls.
13452 @item -mno-leaf-id-shared-library
13453 @opindex mno-leaf-id-shared-library
13454 Do not assume that the code being compiled won't link against any ID shared
13455 libraries.  Slower code is generated for jump and call insns.
13457 @item -mshared-library-id=n
13458 @opindex mshared-library-id
13459 Specifies the identification number of the ID-based shared library being
13460 compiled.  Specifying a value of 0 generates more compact code; specifying
13461 other values forces the allocation of that number to the current
13462 library but is no more space- or time-efficient than omitting this option.
13464 @item -msep-data
13465 @opindex msep-data
13466 Generate code that allows the data segment to be located in a different
13467 area of memory from the text segment.  This allows for execute in place in
13468 an environment without virtual memory management by eliminating relocations
13469 against the text section.
13471 @item -mno-sep-data
13472 @opindex mno-sep-data
13473 Generate code that assumes that the data segment follows the text segment.
13474 This is the default.
13476 @item -mlong-calls
13477 @itemx -mno-long-calls
13478 @opindex mlong-calls
13479 @opindex mno-long-calls
13480 Tells the compiler to perform function calls by first loading the
13481 address of the function into a register and then performing a subroutine
13482 call on this register.  This switch is needed if the target function
13483 lies outside of the 24-bit addressing range of the offset-based
13484 version of subroutine call instruction.
13486 This feature is not enabled by default.  Specifying
13487 @option{-mno-long-calls} restores the default behavior.  Note these
13488 switches have no effect on how the compiler generates code to handle
13489 function calls via function pointers.
13491 @item -mfast-fp
13492 @opindex mfast-fp
13493 Link with the fast floating-point library. This library relaxes some of
13494 the IEEE floating-point standard's rules for checking inputs against
13495 Not-a-Number (NAN), in the interest of performance.
13497 @item -minline-plt
13498 @opindex minline-plt
13499 Enable inlining of PLT entries in function calls to functions that are
13500 not known to bind locally.  It has no effect without @option{-mfdpic}.
13502 @item -mmulticore
13503 @opindex mmulticore
13504 Build a standalone application for multicore Blackfin processors. 
13505 This option causes proper start files and link scripts supporting 
13506 multicore to be used, and defines the macro @code{__BFIN_MULTICORE}. 
13507 It can only be used with @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. 
13509 This option can be used with @option{-mcorea} or @option{-mcoreb}, which
13510 selects the one-application-per-core programming model.  Without
13511 @option{-mcorea} or @option{-mcoreb}, the single-application/dual-core
13512 programming model is used. In this model, the main function of Core B
13513 should be named as @code{coreb_main}.
13515 If this option is not used, the single-core application programming
13516 model is used.
13518 @item -mcorea
13519 @opindex mcorea
13520 Build a standalone application for Core A of BF561 when using
13521 the one-application-per-core programming model. Proper start files
13522 and link scripts are used to support Core A, and the macro
13523 @code{__BFIN_COREA} is defined.
13524 This option can only be used in conjunction with @option{-mmulticore}.
13526 @item -mcoreb
13527 @opindex mcoreb
13528 Build a standalone application for Core B of BF561 when using
13529 the one-application-per-core programming model. Proper start files
13530 and link scripts are used to support Core B, and the macro
13531 @code{__BFIN_COREB} is defined. When this option is used, @code{coreb_main}
13532 should be used instead of @code{main}. 
13533 This option can only be used in conjunction with @option{-mmulticore}.
13535 @item -msdram
13536 @opindex msdram
13537 Build a standalone application for SDRAM. Proper start files and
13538 link scripts are used to put the application into SDRAM, and the macro
13539 @code{__BFIN_SDRAM} is defined.
13540 The loader should initialize SDRAM before loading the application.
13542 @item -micplb
13543 @opindex micplb
13544 Assume that ICPLBs are enabled at run time.  This has an effect on certain
13545 anomaly workarounds.  For Linux targets, the default is to assume ICPLBs
13546 are enabled; for standalone applications the default is off.
13547 @end table
13549 @node C6X Options
13550 @subsection C6X Options
13551 @cindex C6X Options
13553 @table @gcctabopt
13554 @item -march=@var{name}
13555 @opindex march
13556 This specifies the name of the target architecture.  GCC uses this
13557 name to determine what kind of instructions it can emit when generating
13558 assembly code.  Permissible names are: @samp{c62x},
13559 @samp{c64x}, @samp{c64x+}, @samp{c67x}, @samp{c67x+}, @samp{c674x}.
13561 @item -mbig-endian
13562 @opindex mbig-endian
13563 Generate code for a big-endian target.
13565 @item -mlittle-endian
13566 @opindex mlittle-endian
13567 Generate code for a little-endian target.  This is the default.
13569 @item -msim
13570 @opindex msim
13571 Choose startup files and linker script suitable for the simulator.
13573 @item -msdata=default
13574 @opindex msdata=default
13575 Put small global and static data in the @samp{.neardata} section,
13576 which is pointed to by register @code{B14}.  Put small uninitialized
13577 global and static data in the @samp{.bss} section, which is adjacent
13578 to the @samp{.neardata} section.  Put small read-only data into the
13579 @samp{.rodata} section.  The corresponding sections used for large
13580 pieces of data are @samp{.fardata}, @samp{.far} and @samp{.const}.
13582 @item -msdata=all
13583 @opindex msdata=all
13584 Put all data, not just small objects, into the sections reserved for
13585 small data, and use addressing relative to the @code{B14} register to
13586 access them.
13588 @item -msdata=none
13589 @opindex msdata=none
13590 Make no use of the sections reserved for small data, and use absolute
13591 addresses to access all data.  Put all initialized global and static
13592 data in the @samp{.fardata} section, and all uninitialized data in the
13593 @samp{.far} section.  Put all constant data into the @samp{.const}
13594 section.
13595 @end table
13597 @node CRIS Options
13598 @subsection CRIS Options
13599 @cindex CRIS Options
13601 These options are defined specifically for the CRIS ports.
13603 @table @gcctabopt
13604 @item -march=@var{architecture-type}
13605 @itemx -mcpu=@var{architecture-type}
13606 @opindex march
13607 @opindex mcpu
13608 Generate code for the specified architecture.  The choices for
13609 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
13610 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
13611 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
13612 @samp{v10}.
13614 @item -mtune=@var{architecture-type}
13615 @opindex mtune
13616 Tune to @var{architecture-type} everything applicable about the generated
13617 code, except for the ABI and the set of available instructions.  The
13618 choices for @var{architecture-type} are the same as for
13619 @option{-march=@var{architecture-type}}.
13621 @item -mmax-stack-frame=@var{n}
13622 @opindex mmax-stack-frame
13623 Warn when the stack frame of a function exceeds @var{n} bytes.
13625 @item -metrax4
13626 @itemx -metrax100
13627 @opindex metrax4
13628 @opindex metrax100
13629 The options @option{-metrax4} and @option{-metrax100} are synonyms for
13630 @option{-march=v3} and @option{-march=v8} respectively.
13632 @item -mmul-bug-workaround
13633 @itemx -mno-mul-bug-workaround
13634 @opindex mmul-bug-workaround
13635 @opindex mno-mul-bug-workaround
13636 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
13637 models where it applies.  This option is active by default.
13639 @item -mpdebug
13640 @opindex mpdebug
13641 Enable CRIS-specific verbose debug-related information in the assembly
13642 code.  This option also has the effect of turning off the @samp{#NO_APP}
13643 formatted-code indicator to the assembler at the beginning of the
13644 assembly file.
13646 @item -mcc-init
13647 @opindex mcc-init
13648 Do not use condition-code results from previous instruction; always emit
13649 compare and test instructions before use of condition codes.
13651 @item -mno-side-effects
13652 @opindex mno-side-effects
13653 Do not emit instructions with side effects in addressing modes other than
13654 post-increment.
13656 @item -mstack-align
13657 @itemx -mno-stack-align
13658 @itemx -mdata-align
13659 @itemx -mno-data-align
13660 @itemx -mconst-align
13661 @itemx -mno-const-align
13662 @opindex mstack-align
13663 @opindex mno-stack-align
13664 @opindex mdata-align
13665 @opindex mno-data-align
13666 @opindex mconst-align
13667 @opindex mno-const-align
13668 These options (@samp{no-} options) arrange (eliminate arrangements) for the
13669 stack frame, individual data and constants to be aligned for the maximum
13670 single data access size for the chosen CPU model.  The default is to
13671 arrange for 32-bit alignment.  ABI details such as structure layout are
13672 not affected by these options.
13674 @item -m32-bit
13675 @itemx -m16-bit
13676 @itemx -m8-bit
13677 @opindex m32-bit
13678 @opindex m16-bit
13679 @opindex m8-bit
13680 Similar to the stack- data- and const-align options above, these options
13681 arrange for stack frame, writable data and constants to all be 32-bit,
13682 16-bit or 8-bit aligned.  The default is 32-bit alignment.
13684 @item -mno-prologue-epilogue
13685 @itemx -mprologue-epilogue
13686 @opindex mno-prologue-epilogue
13687 @opindex mprologue-epilogue
13688 With @option{-mno-prologue-epilogue}, the normal function prologue and
13689 epilogue which set up the stack frame are omitted and no return
13690 instructions or return sequences are generated in the code.  Use this
13691 option only together with visual inspection of the compiled code: no
13692 warnings or errors are generated when call-saved registers must be saved,
13693 or storage for local variables needs to be allocated.
13695 @item -mno-gotplt
13696 @itemx -mgotplt
13697 @opindex mno-gotplt
13698 @opindex mgotplt
13699 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
13700 instruction sequences that load addresses for functions from the PLT part
13701 of the GOT rather than (traditional on other architectures) calls to the
13702 PLT@.  The default is @option{-mgotplt}.
13704 @item -melf
13705 @opindex melf
13706 Legacy no-op option only recognized with the cris-axis-elf and
13707 cris-axis-linux-gnu targets.
13709 @item -mlinux
13710 @opindex mlinux
13711 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
13713 @item -sim
13714 @opindex sim
13715 This option, recognized for the cris-axis-elf, arranges
13716 to link with input-output functions from a simulator library.  Code,
13717 initialized data and zero-initialized data are allocated consecutively.
13719 @item -sim2
13720 @opindex sim2
13721 Like @option{-sim}, but pass linker options to locate initialized data at
13722 0x40000000 and zero-initialized data at 0x80000000.
13723 @end table
13725 @node CR16 Options
13726 @subsection CR16 Options
13727 @cindex CR16 Options
13729 These options are defined specifically for the CR16 ports.
13731 @table @gcctabopt
13733 @item -mmac
13734 @opindex mmac
13735 Enable the use of multiply-accumulate instructions. Disabled by default.
13737 @item -mcr16cplus
13738 @itemx -mcr16c
13739 @opindex mcr16cplus
13740 @opindex mcr16c
13741 Generate code for CR16C or CR16C+ architecture. CR16C+ architecture 
13742 is default.
13744 @item -msim
13745 @opindex msim
13746 Links the library libsim.a which is in compatible with simulator. Applicable
13747 to ELF compiler only.
13749 @item -mint32
13750 @opindex mint32
13751 Choose integer type as 32-bit wide.
13753 @item -mbit-ops
13754 @opindex mbit-ops
13755 Generates @code{sbit}/@code{cbit} instructions for bit manipulations.
13757 @item -mdata-model=@var{model}
13758 @opindex mdata-model
13759 Choose a data model. The choices for @var{model} are @samp{near},
13760 @samp{far} or @samp{medium}. @samp{medium} is default.
13761 However, @samp{far} is not valid with @option{-mcr16c}, as the
13762 CR16C architecture does not support the far data model.
13763 @end table
13765 @node Darwin Options
13766 @subsection Darwin Options
13767 @cindex Darwin options
13769 These options are defined for all architectures running the Darwin operating
13770 system.
13772 FSF GCC on Darwin does not create ``fat'' object files; it creates
13773 an object file for the single architecture that GCC was built to
13774 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
13775 @option{-arch} options are used; it does so by running the compiler or
13776 linker multiple times and joining the results together with
13777 @file{lipo}.
13779 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
13780 @samp{i686}) is determined by the flags that specify the ISA
13781 that GCC is targeting, like @option{-mcpu} or @option{-march}.  The
13782 @option{-force_cpusubtype_ALL} option can be used to override this.
13784 The Darwin tools vary in their behavior when presented with an ISA
13785 mismatch.  The assembler, @file{as}, only permits instructions to
13786 be used that are valid for the subtype of the file it is generating,
13787 so you cannot put 64-bit instructions in a @samp{ppc750} object file.
13788 The linker for shared libraries, @file{/usr/bin/libtool}, fails
13789 and prints an error if asked to create a shared library with a less
13790 restrictive subtype than its input files (for instance, trying to put
13791 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
13792 for executables, @command{ld}, quietly gives the executable the most
13793 restrictive subtype of any of its input files.
13795 @table @gcctabopt
13796 @item -F@var{dir}
13797 @opindex F
13798 Add the framework directory @var{dir} to the head of the list of
13799 directories to be searched for header files.  These directories are
13800 interleaved with those specified by @option{-I} options and are
13801 scanned in a left-to-right order.
13803 A framework directory is a directory with frameworks in it.  A
13804 framework is a directory with a @file{Headers} and/or
13805 @file{PrivateHeaders} directory contained directly in it that ends
13806 in @file{.framework}.  The name of a framework is the name of this
13807 directory excluding the @file{.framework}.  Headers associated with
13808 the framework are found in one of those two directories, with
13809 @file{Headers} being searched first.  A subframework is a framework
13810 directory that is in a framework's @file{Frameworks} directory.
13811 Includes of subframework headers can only appear in a header of a
13812 framework that contains the subframework, or in a sibling subframework
13813 header.  Two subframeworks are siblings if they occur in the same
13814 framework.  A subframework should not have the same name as a
13815 framework; a warning is issued if this is violated.  Currently a
13816 subframework cannot have subframeworks; in the future, the mechanism
13817 may be extended to support this.  The standard frameworks can be found
13818 in @file{/System/Library/Frameworks} and
13819 @file{/Library/Frameworks}.  An example include looks like
13820 @code{#include <Framework/header.h>}, where @file{Framework} denotes
13821 the name of the framework and @file{header.h} is found in the
13822 @file{PrivateHeaders} or @file{Headers} directory.
13824 @item -iframework@var{dir}
13825 @opindex iframework
13826 Like @option{-F} except the directory is a treated as a system
13827 directory.  The main difference between this @option{-iframework} and
13828 @option{-F} is that with @option{-iframework} the compiler does not
13829 warn about constructs contained within header files found via
13830 @var{dir}.  This option is valid only for the C family of languages.
13832 @item -gused
13833 @opindex gused
13834 Emit debugging information for symbols that are used.  For stabs
13835 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
13836 This is by default ON@.
13838 @item -gfull
13839 @opindex gfull
13840 Emit debugging information for all symbols and types.
13842 @item -mmacosx-version-min=@var{version}
13843 The earliest version of MacOS X that this executable will run on
13844 is @var{version}.  Typical values of @var{version} include @code{10.1},
13845 @code{10.2}, and @code{10.3.9}.
13847 If the compiler was built to use the system's headers by default,
13848 then the default for this option is the system version on which the
13849 compiler is running, otherwise the default is to make choices that
13850 are compatible with as many systems and code bases as possible.
13852 @item -mkernel
13853 @opindex mkernel
13854 Enable kernel development mode.  The @option{-mkernel} option sets
13855 @option{-static}, @option{-fno-common}, @option{-fno-use-cxa-atexit},
13856 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
13857 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
13858 applicable.  This mode also sets @option{-mno-altivec},
13859 @option{-msoft-float}, @option{-fno-builtin} and
13860 @option{-mlong-branch} for PowerPC targets.
13862 @item -mone-byte-bool
13863 @opindex mone-byte-bool
13864 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
13865 By default @samp{sizeof(bool)} is @samp{4} when compiling for
13866 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
13867 option has no effect on x86.
13869 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
13870 to generate code that is not binary compatible with code generated
13871 without that switch.  Using this switch may require recompiling all
13872 other modules in a program, including system libraries.  Use this
13873 switch to conform to a non-default data model.
13875 @item -mfix-and-continue
13876 @itemx -ffix-and-continue
13877 @itemx -findirect-data
13878 @opindex mfix-and-continue
13879 @opindex ffix-and-continue
13880 @opindex findirect-data
13881 Generate code suitable for fast turnaround development, such as to
13882 allow GDB to dynamically load @code{.o} files into already-running
13883 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
13884 are provided for backwards compatibility.
13886 @item -all_load
13887 @opindex all_load
13888 Loads all members of static archive libraries.
13889 See man ld(1) for more information.
13891 @item -arch_errors_fatal
13892 @opindex arch_errors_fatal
13893 Cause the errors having to do with files that have the wrong architecture
13894 to be fatal.
13896 @item -bind_at_load
13897 @opindex bind_at_load
13898 Causes the output file to be marked such that the dynamic linker will
13899 bind all undefined references when the file is loaded or launched.
13901 @item -bundle
13902 @opindex bundle
13903 Produce a Mach-o bundle format file.
13904 See man ld(1) for more information.
13906 @item -bundle_loader @var{executable}
13907 @opindex bundle_loader
13908 This option specifies the @var{executable} that will load the build
13909 output file being linked.  See man ld(1) for more information.
13911 @item -dynamiclib
13912 @opindex dynamiclib
13913 When passed this option, GCC produces a dynamic library instead of
13914 an executable when linking, using the Darwin @file{libtool} command.
13916 @item -force_cpusubtype_ALL
13917 @opindex force_cpusubtype_ALL
13918 This causes GCC's output file to have the @var{ALL} subtype, instead of
13919 one controlled by the @option{-mcpu} or @option{-march} option.
13921 @item -allowable_client  @var{client_name}
13922 @itemx -client_name
13923 @itemx -compatibility_version
13924 @itemx -current_version
13925 @itemx -dead_strip
13926 @itemx -dependency-file
13927 @itemx -dylib_file
13928 @itemx -dylinker_install_name
13929 @itemx -dynamic
13930 @itemx -exported_symbols_list
13931 @itemx -filelist
13932 @need 800
13933 @itemx -flat_namespace
13934 @itemx -force_flat_namespace
13935 @itemx -headerpad_max_install_names
13936 @itemx -image_base
13937 @itemx -init
13938 @itemx -install_name
13939 @itemx -keep_private_externs
13940 @itemx -multi_module
13941 @itemx -multiply_defined
13942 @itemx -multiply_defined_unused
13943 @need 800
13944 @itemx -noall_load
13945 @itemx -no_dead_strip_inits_and_terms
13946 @itemx -nofixprebinding
13947 @itemx -nomultidefs
13948 @itemx -noprebind
13949 @itemx -noseglinkedit
13950 @itemx -pagezero_size
13951 @itemx -prebind
13952 @itemx -prebind_all_twolevel_modules
13953 @itemx -private_bundle
13954 @need 800
13955 @itemx -read_only_relocs
13956 @itemx -sectalign
13957 @itemx -sectobjectsymbols
13958 @itemx -whyload
13959 @itemx -seg1addr
13960 @itemx -sectcreate
13961 @itemx -sectobjectsymbols
13962 @itemx -sectorder
13963 @itemx -segaddr
13964 @itemx -segs_read_only_addr
13965 @need 800
13966 @itemx -segs_read_write_addr
13967 @itemx -seg_addr_table
13968 @itemx -seg_addr_table_filename
13969 @itemx -seglinkedit
13970 @itemx -segprot
13971 @itemx -segs_read_only_addr
13972 @itemx -segs_read_write_addr
13973 @itemx -single_module
13974 @itemx -static
13975 @itemx -sub_library
13976 @need 800
13977 @itemx -sub_umbrella
13978 @itemx -twolevel_namespace
13979 @itemx -umbrella
13980 @itemx -undefined
13981 @itemx -unexported_symbols_list
13982 @itemx -weak_reference_mismatches
13983 @itemx -whatsloaded
13984 @opindex allowable_client
13985 @opindex client_name
13986 @opindex compatibility_version
13987 @opindex current_version
13988 @opindex dead_strip
13989 @opindex dependency-file
13990 @opindex dylib_file
13991 @opindex dylinker_install_name
13992 @opindex dynamic
13993 @opindex exported_symbols_list
13994 @opindex filelist
13995 @opindex flat_namespace
13996 @opindex force_flat_namespace
13997 @opindex headerpad_max_install_names
13998 @opindex image_base
13999 @opindex init
14000 @opindex install_name
14001 @opindex keep_private_externs
14002 @opindex multi_module
14003 @opindex multiply_defined
14004 @opindex multiply_defined_unused
14005 @opindex noall_load
14006 @opindex no_dead_strip_inits_and_terms
14007 @opindex nofixprebinding
14008 @opindex nomultidefs
14009 @opindex noprebind
14010 @opindex noseglinkedit
14011 @opindex pagezero_size
14012 @opindex prebind
14013 @opindex prebind_all_twolevel_modules
14014 @opindex private_bundle
14015 @opindex read_only_relocs
14016 @opindex sectalign
14017 @opindex sectobjectsymbols
14018 @opindex whyload
14019 @opindex seg1addr
14020 @opindex sectcreate
14021 @opindex sectobjectsymbols
14022 @opindex sectorder
14023 @opindex segaddr
14024 @opindex segs_read_only_addr
14025 @opindex segs_read_write_addr
14026 @opindex seg_addr_table
14027 @opindex seg_addr_table_filename
14028 @opindex seglinkedit
14029 @opindex segprot
14030 @opindex segs_read_only_addr
14031 @opindex segs_read_write_addr
14032 @opindex single_module
14033 @opindex static
14034 @opindex sub_library
14035 @opindex sub_umbrella
14036 @opindex twolevel_namespace
14037 @opindex umbrella
14038 @opindex undefined
14039 @opindex unexported_symbols_list
14040 @opindex weak_reference_mismatches
14041 @opindex whatsloaded
14042 These options are passed to the Darwin linker.  The Darwin linker man page
14043 describes them in detail.
14044 @end table
14046 @node DEC Alpha Options
14047 @subsection DEC Alpha Options
14049 These @samp{-m} options are defined for the DEC Alpha implementations:
14051 @table @gcctabopt
14052 @item -mno-soft-float
14053 @itemx -msoft-float
14054 @opindex mno-soft-float
14055 @opindex msoft-float
14056 Use (do not use) the hardware floating-point instructions for
14057 floating-point operations.  When @option{-msoft-float} is specified,
14058 functions in @file{libgcc.a} are used to perform floating-point
14059 operations.  Unless they are replaced by routines that emulate the
14060 floating-point operations, or compiled in such a way as to call such
14061 emulations routines, these routines issue floating-point
14062 operations.   If you are compiling for an Alpha without floating-point
14063 operations, you must ensure that the library is built so as not to call
14064 them.
14066 Note that Alpha implementations without floating-point operations are
14067 required to have floating-point registers.
14069 @item -mfp-reg
14070 @itemx -mno-fp-regs
14071 @opindex mfp-reg
14072 @opindex mno-fp-regs
14073 Generate code that uses (does not use) the floating-point register set.
14074 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
14075 register set is not used, floating-point operands are passed in integer
14076 registers as if they were integers and floating-point results are passed
14077 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
14078 so any function with a floating-point argument or return value called by code
14079 compiled with @option{-mno-fp-regs} must also be compiled with that
14080 option.
14082 A typical use of this option is building a kernel that does not use,
14083 and hence need not save and restore, any floating-point registers.
14085 @item -mieee
14086 @opindex mieee
14087 The Alpha architecture implements floating-point hardware optimized for
14088 maximum performance.  It is mostly compliant with the IEEE floating-point
14089 standard.  However, for full compliance, software assistance is
14090 required.  This option generates code fully IEEE-compliant code
14091 @emph{except} that the @var{inexact-flag} is not maintained (see below).
14092 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
14093 defined during compilation.  The resulting code is less efficient but is
14094 able to correctly support denormalized numbers and exceptional IEEE
14095 values such as not-a-number and plus/minus infinity.  Other Alpha
14096 compilers call this option @option{-ieee_with_no_inexact}.
14098 @item -mieee-with-inexact
14099 @opindex mieee-with-inexact
14100 This is like @option{-mieee} except the generated code also maintains
14101 the IEEE @var{inexact-flag}.  Turning on this option causes the
14102 generated code to implement fully-compliant IEEE math.  In addition to
14103 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
14104 macro.  On some Alpha implementations the resulting code may execute
14105 significantly slower than the code generated by default.  Since there is
14106 very little code that depends on the @var{inexact-flag}, you should
14107 normally not specify this option.  Other Alpha compilers call this
14108 option @option{-ieee_with_inexact}.
14110 @item -mfp-trap-mode=@var{trap-mode}
14111 @opindex mfp-trap-mode
14112 This option controls what floating-point related traps are enabled.
14113 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
14114 The trap mode can be set to one of four values:
14116 @table @samp
14117 @item n
14118 This is the default (normal) setting.  The only traps that are enabled
14119 are the ones that cannot be disabled in software (e.g., division by zero
14120 trap).
14122 @item u
14123 In addition to the traps enabled by @samp{n}, underflow traps are enabled
14124 as well.
14126 @item su
14127 Like @samp{u}, but the instructions are marked to be safe for software
14128 completion (see Alpha architecture manual for details).
14130 @item sui
14131 Like @samp{su}, but inexact traps are enabled as well.
14132 @end table
14134 @item -mfp-rounding-mode=@var{rounding-mode}
14135 @opindex mfp-rounding-mode
14136 Selects the IEEE rounding mode.  Other Alpha compilers call this option
14137 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
14140 @table @samp
14141 @item n
14142 Normal IEEE rounding mode.  Floating-point numbers are rounded towards
14143 the nearest machine number or towards the even machine number in case
14144 of a tie.
14146 @item m
14147 Round towards minus infinity.
14149 @item c
14150 Chopped rounding mode.  Floating-point numbers are rounded towards zero.
14152 @item d
14153 Dynamic rounding mode.  A field in the floating-point control register
14154 (@var{fpcr}, see Alpha architecture reference manual) controls the
14155 rounding mode in effect.  The C library initializes this register for
14156 rounding towards plus infinity.  Thus, unless your program modifies the
14157 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
14158 @end table
14160 @item -mtrap-precision=@var{trap-precision}
14161 @opindex mtrap-precision
14162 In the Alpha architecture, floating-point traps are imprecise.  This
14163 means without software assistance it is impossible to recover from a
14164 floating trap and program execution normally needs to be terminated.
14165 GCC can generate code that can assist operating system trap handlers
14166 in determining the exact location that caused a floating-point trap.
14167 Depending on the requirements of an application, different levels of
14168 precisions can be selected:
14170 @table @samp
14171 @item p
14172 Program precision.  This option is the default and means a trap handler
14173 can only identify which program caused a floating-point exception.
14175 @item f
14176 Function precision.  The trap handler can determine the function that
14177 caused a floating-point exception.
14179 @item i
14180 Instruction precision.  The trap handler can determine the exact
14181 instruction that caused a floating-point exception.
14182 @end table
14184 Other Alpha compilers provide the equivalent options called
14185 @option{-scope_safe} and @option{-resumption_safe}.
14187 @item -mieee-conformant
14188 @opindex mieee-conformant
14189 This option marks the generated code as IEEE conformant.  You must not
14190 use this option unless you also specify @option{-mtrap-precision=i} and either
14191 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
14192 is to emit the line @samp{.eflag 48} in the function prologue of the
14193 generated assembly file.
14195 @item -mbuild-constants
14196 @opindex mbuild-constants
14197 Normally GCC examines a 32- or 64-bit integer constant to
14198 see if it can construct it from smaller constants in two or three
14199 instructions.  If it cannot, it outputs the constant as a literal and
14200 generates code to load it from the data segment at run time.
14202 Use this option to require GCC to construct @emph{all} integer constants
14203 using code, even if it takes more instructions (the maximum is six).
14205 You typically use this option to build a shared library dynamic
14206 loader.  Itself a shared library, it must relocate itself in memory
14207 before it can find the variables and constants in its own data segment.
14209 @item -mbwx
14210 @itemx -mno-bwx
14211 @itemx -mcix
14212 @itemx -mno-cix
14213 @itemx -mfix
14214 @itemx -mno-fix
14215 @itemx -mmax
14216 @itemx -mno-max
14217 @opindex mbwx
14218 @opindex mno-bwx
14219 @opindex mcix
14220 @opindex mno-cix
14221 @opindex mfix
14222 @opindex mno-fix
14223 @opindex mmax
14224 @opindex mno-max
14225 Indicate whether GCC should generate code to use the optional BWX,
14226 CIX, FIX and MAX instruction sets.  The default is to use the instruction
14227 sets supported by the CPU type specified via @option{-mcpu=} option or that
14228 of the CPU on which GCC was built if none is specified.
14230 @item -mfloat-vax
14231 @itemx -mfloat-ieee
14232 @opindex mfloat-vax
14233 @opindex mfloat-ieee
14234 Generate code that uses (does not use) VAX F and G floating-point
14235 arithmetic instead of IEEE single and double precision.
14237 @item -mexplicit-relocs
14238 @itemx -mno-explicit-relocs
14239 @opindex mexplicit-relocs
14240 @opindex mno-explicit-relocs
14241 Older Alpha assemblers provided no way to generate symbol relocations
14242 except via assembler macros.  Use of these macros does not allow
14243 optimal instruction scheduling.  GNU binutils as of version 2.12
14244 supports a new syntax that allows the compiler to explicitly mark
14245 which relocations should apply to which instructions.  This option
14246 is mostly useful for debugging, as GCC detects the capabilities of
14247 the assembler when it is built and sets the default accordingly.
14249 @item -msmall-data
14250 @itemx -mlarge-data
14251 @opindex msmall-data
14252 @opindex mlarge-data
14253 When @option{-mexplicit-relocs} is in effect, static data is
14254 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
14255 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
14256 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
14257 16-bit relocations off of the @code{$gp} register.  This limits the
14258 size of the small data area to 64KB, but allows the variables to be
14259 directly accessed via a single instruction.
14261 The default is @option{-mlarge-data}.  With this option the data area
14262 is limited to just below 2GB@.  Programs that require more than 2GB of
14263 data must use @code{malloc} or @code{mmap} to allocate the data in the
14264 heap instead of in the program's data segment.
14266 When generating code for shared libraries, @option{-fpic} implies
14267 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
14269 @item -msmall-text
14270 @itemx -mlarge-text
14271 @opindex msmall-text
14272 @opindex mlarge-text
14273 When @option{-msmall-text} is used, the compiler assumes that the
14274 code of the entire program (or shared library) fits in 4MB, and is
14275 thus reachable with a branch instruction.  When @option{-msmall-data}
14276 is used, the compiler can assume that all local symbols share the
14277 same @code{$gp} value, and thus reduce the number of instructions
14278 required for a function call from 4 to 1.
14280 The default is @option{-mlarge-text}.
14282 @item -mcpu=@var{cpu_type}
14283 @opindex mcpu
14284 Set the instruction set and instruction scheduling parameters for
14285 machine type @var{cpu_type}.  You can specify either the @samp{EV}
14286 style name or the corresponding chip number.  GCC supports scheduling
14287 parameters for the EV4, EV5 and EV6 family of processors and
14288 chooses the default values for the instruction set from the processor
14289 you specify.  If you do not specify a processor type, GCC defaults
14290 to the processor on which the compiler was built.
14292 Supported values for @var{cpu_type} are
14294 @table @samp
14295 @item ev4
14296 @itemx ev45
14297 @itemx 21064
14298 Schedules as an EV4 and has no instruction set extensions.
14300 @item ev5
14301 @itemx 21164
14302 Schedules as an EV5 and has no instruction set extensions.
14304 @item ev56
14305 @itemx 21164a
14306 Schedules as an EV5 and supports the BWX extension.
14308 @item pca56
14309 @itemx 21164pc
14310 @itemx 21164PC
14311 Schedules as an EV5 and supports the BWX and MAX extensions.
14313 @item ev6
14314 @itemx 21264
14315 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
14317 @item ev67
14318 @itemx 21264a
14319 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
14320 @end table
14322 Native toolchains also support the value @samp{native},
14323 which selects the best architecture option for the host processor.
14324 @option{-mcpu=native} has no effect if GCC does not recognize
14325 the processor.
14327 @item -mtune=@var{cpu_type}
14328 @opindex mtune
14329 Set only the instruction scheduling parameters for machine type
14330 @var{cpu_type}.  The instruction set is not changed.
14332 Native toolchains also support the value @samp{native},
14333 which selects the best architecture option for the host processor.
14334 @option{-mtune=native} has no effect if GCC does not recognize
14335 the processor.
14337 @item -mmemory-latency=@var{time}
14338 @opindex mmemory-latency
14339 Sets the latency the scheduler should assume for typical memory
14340 references as seen by the application.  This number is highly
14341 dependent on the memory access patterns used by the application
14342 and the size of the external cache on the machine.
14344 Valid options for @var{time} are
14346 @table @samp
14347 @item @var{number}
14348 A decimal number representing clock cycles.
14350 @item L1
14351 @itemx L2
14352 @itemx L3
14353 @itemx main
14354 The compiler contains estimates of the number of clock cycles for
14355 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
14356 (also called Dcache, Scache, and Bcache), as well as to main memory.
14357 Note that L3 is only valid for EV5.
14359 @end table
14360 @end table
14362 @node FR30 Options
14363 @subsection FR30 Options
14364 @cindex FR30 Options
14366 These options are defined specifically for the FR30 port.
14368 @table @gcctabopt
14370 @item -msmall-model
14371 @opindex msmall-model
14372 Use the small address space model.  This can produce smaller code, but
14373 it does assume that all symbolic values and addresses fit into a
14374 20-bit range.
14376 @item -mno-lsim
14377 @opindex mno-lsim
14378 Assume that runtime support has been provided and so there is no need
14379 to include the simulator library (@file{libsim.a}) on the linker
14380 command line.
14382 @end table
14384 @node FRV Options
14385 @subsection FRV Options
14386 @cindex FRV Options
14388 @table @gcctabopt
14389 @item -mgpr-32
14390 @opindex mgpr-32
14392 Only use the first 32 general-purpose registers.
14394 @item -mgpr-64
14395 @opindex mgpr-64
14397 Use all 64 general-purpose registers.
14399 @item -mfpr-32
14400 @opindex mfpr-32
14402 Use only the first 32 floating-point registers.
14404 @item -mfpr-64
14405 @opindex mfpr-64
14407 Use all 64 floating-point registers.
14409 @item -mhard-float
14410 @opindex mhard-float
14412 Use hardware instructions for floating-point operations.
14414 @item -msoft-float
14415 @opindex msoft-float
14417 Use library routines for floating-point operations.
14419 @item -malloc-cc
14420 @opindex malloc-cc
14422 Dynamically allocate condition code registers.
14424 @item -mfixed-cc
14425 @opindex mfixed-cc
14427 Do not try to dynamically allocate condition code registers, only
14428 use @code{icc0} and @code{fcc0}.
14430 @item -mdword
14431 @opindex mdword
14433 Change ABI to use double word insns.
14435 @item -mno-dword
14436 @opindex mno-dword
14438 Do not use double word instructions.
14440 @item -mdouble
14441 @opindex mdouble
14443 Use floating-point double instructions.
14445 @item -mno-double
14446 @opindex mno-double
14448 Do not use floating-point double instructions.
14450 @item -mmedia
14451 @opindex mmedia
14453 Use media instructions.
14455 @item -mno-media
14456 @opindex mno-media
14458 Do not use media instructions.
14460 @item -mmuladd
14461 @opindex mmuladd
14463 Use multiply and add/subtract instructions.
14465 @item -mno-muladd
14466 @opindex mno-muladd
14468 Do not use multiply and add/subtract instructions.
14470 @item -mfdpic
14471 @opindex mfdpic
14473 Select the FDPIC ABI, which uses function descriptors to represent
14474 pointers to functions.  Without any PIC/PIE-related options, it
14475 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
14476 assumes GOT entries and small data are within a 12-bit range from the
14477 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
14478 are computed with 32 bits.
14479 With a @samp{bfin-elf} target, this option implies @option{-msim}.
14481 @item -minline-plt
14482 @opindex minline-plt
14484 Enable inlining of PLT entries in function calls to functions that are
14485 not known to bind locally.  It has no effect without @option{-mfdpic}.
14486 It's enabled by default if optimizing for speed and compiling for
14487 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
14488 optimization option such as @option{-O3} or above is present in the
14489 command line.
14491 @item -mTLS
14492 @opindex mTLS
14494 Assume a large TLS segment when generating thread-local code.
14496 @item -mtls
14497 @opindex mtls
14499 Do not assume a large TLS segment when generating thread-local code.
14501 @item -mgprel-ro
14502 @opindex mgprel-ro
14504 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
14505 that is known to be in read-only sections.  It's enabled by default,
14506 except for @option{-fpic} or @option{-fpie}: even though it may help
14507 make the global offset table smaller, it trades 1 instruction for 4.
14508 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
14509 one of which may be shared by multiple symbols, and it avoids the need
14510 for a GOT entry for the referenced symbol, so it's more likely to be a
14511 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
14513 @item -multilib-library-pic
14514 @opindex multilib-library-pic
14516 Link with the (library, not FD) pic libraries.  It's implied by
14517 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
14518 @option{-fpic} without @option{-mfdpic}.  You should never have to use
14519 it explicitly.
14521 @item -mlinked-fp
14522 @opindex mlinked-fp
14524 Follow the EABI requirement of always creating a frame pointer whenever
14525 a stack frame is allocated.  This option is enabled by default and can
14526 be disabled with @option{-mno-linked-fp}.
14528 @item -mlong-calls
14529 @opindex mlong-calls
14531 Use indirect addressing to call functions outside the current
14532 compilation unit.  This allows the functions to be placed anywhere
14533 within the 32-bit address space.
14535 @item -malign-labels
14536 @opindex malign-labels
14538 Try to align labels to an 8-byte boundary by inserting NOPs into the
14539 previous packet.  This option only has an effect when VLIW packing
14540 is enabled.  It doesn't create new packets; it merely adds NOPs to
14541 existing ones.
14543 @item -mlibrary-pic
14544 @opindex mlibrary-pic
14546 Generate position-independent EABI code.
14548 @item -macc-4
14549 @opindex macc-4
14551 Use only the first four media accumulator registers.
14553 @item -macc-8
14554 @opindex macc-8
14556 Use all eight media accumulator registers.
14558 @item -mpack
14559 @opindex mpack
14561 Pack VLIW instructions.
14563 @item -mno-pack
14564 @opindex mno-pack
14566 Do not pack VLIW instructions.
14568 @item -mno-eflags
14569 @opindex mno-eflags
14571 Do not mark ABI switches in e_flags.
14573 @item -mcond-move
14574 @opindex mcond-move
14576 Enable the use of conditional-move instructions (default).
14578 This switch is mainly for debugging the compiler and will likely be removed
14579 in a future version.
14581 @item -mno-cond-move
14582 @opindex mno-cond-move
14584 Disable the use of conditional-move instructions.
14586 This switch is mainly for debugging the compiler and will likely be removed
14587 in a future version.
14589 @item -mscc
14590 @opindex mscc
14592 Enable the use of conditional set instructions (default).
14594 This switch is mainly for debugging the compiler and will likely be removed
14595 in a future version.
14597 @item -mno-scc
14598 @opindex mno-scc
14600 Disable the use of conditional set instructions.
14602 This switch is mainly for debugging the compiler and will likely be removed
14603 in a future version.
14605 @item -mcond-exec
14606 @opindex mcond-exec
14608 Enable the use of conditional execution (default).
14610 This switch is mainly for debugging the compiler and will likely be removed
14611 in a future version.
14613 @item -mno-cond-exec
14614 @opindex mno-cond-exec
14616 Disable the use of conditional execution.
14618 This switch is mainly for debugging the compiler and will likely be removed
14619 in a future version.
14621 @item -mvliw-branch
14622 @opindex mvliw-branch
14624 Run a pass to pack branches into VLIW instructions (default).
14626 This switch is mainly for debugging the compiler and will likely be removed
14627 in a future version.
14629 @item -mno-vliw-branch
14630 @opindex mno-vliw-branch
14632 Do not run a pass to pack branches into VLIW instructions.
14634 This switch is mainly for debugging the compiler and will likely be removed
14635 in a future version.
14637 @item -mmulti-cond-exec
14638 @opindex mmulti-cond-exec
14640 Enable optimization of @code{&&} and @code{||} in conditional execution
14641 (default).
14643 This switch is mainly for debugging the compiler and will likely be removed
14644 in a future version.
14646 @item -mno-multi-cond-exec
14647 @opindex mno-multi-cond-exec
14649 Disable optimization of @code{&&} and @code{||} in conditional execution.
14651 This switch is mainly for debugging the compiler and will likely be removed
14652 in a future version.
14654 @item -mnested-cond-exec
14655 @opindex mnested-cond-exec
14657 Enable nested conditional execution optimizations (default).
14659 This switch is mainly for debugging the compiler and will likely be removed
14660 in a future version.
14662 @item -mno-nested-cond-exec
14663 @opindex mno-nested-cond-exec
14665 Disable nested conditional execution optimizations.
14667 This switch is mainly for debugging the compiler and will likely be removed
14668 in a future version.
14670 @item -moptimize-membar
14671 @opindex moptimize-membar
14673 This switch removes redundant @code{membar} instructions from the
14674 compiler-generated code.  It is enabled by default.
14676 @item -mno-optimize-membar
14677 @opindex mno-optimize-membar
14679 This switch disables the automatic removal of redundant @code{membar}
14680 instructions from the generated code.
14682 @item -mtomcat-stats
14683 @opindex mtomcat-stats
14685 Cause gas to print out tomcat statistics.
14687 @item -mcpu=@var{cpu}
14688 @opindex mcpu
14690 Select the processor type for which to generate code.  Possible values are
14691 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
14692 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
14694 @end table
14696 @node GNU/Linux Options
14697 @subsection GNU/Linux Options
14699 These @samp{-m} options are defined for GNU/Linux targets:
14701 @table @gcctabopt
14702 @item -mglibc
14703 @opindex mglibc
14704 Use the GNU C library.  This is the default except
14705 on @samp{*-*-linux-*uclibc*} and @samp{*-*-linux-*android*} targets.
14707 @item -muclibc
14708 @opindex muclibc
14709 Use uClibc C library.  This is the default on
14710 @samp{*-*-linux-*uclibc*} targets.
14712 @item -mbionic
14713 @opindex mbionic
14714 Use Bionic C library.  This is the default on
14715 @samp{*-*-linux-*android*} targets.
14717 @item -mandroid
14718 @opindex mandroid
14719 Compile code compatible with Android platform.  This is the default on
14720 @samp{*-*-linux-*android*} targets.
14722 When compiling, this option enables @option{-mbionic}, @option{-fPIC},
14723 @option{-fno-exceptions} and @option{-fno-rtti} by default.  When linking,
14724 this option makes the GCC driver pass Android-specific options to the linker.
14725 Finally, this option causes the preprocessor macro @code{__ANDROID__}
14726 to be defined.
14728 @item -tno-android-cc
14729 @opindex tno-android-cc
14730 Disable compilation effects of @option{-mandroid}, i.e., do not enable
14731 @option{-mbionic}, @option{-fPIC}, @option{-fno-exceptions} and
14732 @option{-fno-rtti} by default.
14734 @item -tno-android-ld
14735 @opindex tno-android-ld
14736 Disable linking effects of @option{-mandroid}, i.e., pass standard Linux
14737 linking options to the linker.
14739 @end table
14741 @node H8/300 Options
14742 @subsection H8/300 Options
14744 These @samp{-m} options are defined for the H8/300 implementations:
14746 @table @gcctabopt
14747 @item -mrelax
14748 @opindex mrelax
14749 Shorten some address references at link time, when possible; uses the
14750 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
14751 ld, Using ld}, for a fuller description.
14753 @item -mh
14754 @opindex mh
14755 Generate code for the H8/300H@.
14757 @item -ms
14758 @opindex ms
14759 Generate code for the H8S@.
14761 @item -mn
14762 @opindex mn
14763 Generate code for the H8S and H8/300H in the normal mode.  This switch
14764 must be used either with @option{-mh} or @option{-ms}.
14766 @item -ms2600
14767 @opindex ms2600
14768 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
14770 @item -mexr
14771 @opindex mexr
14772 Extended registers are stored on stack before execution of function
14773 with monitor attribute. Default option is @option{-mexr}.
14774 This option is valid only for H8S targets.
14776 @item -mno-exr
14777 @opindex mno-exr
14778 Extended registers are not stored on stack before execution of function 
14779 with monitor attribute. Default option is @option{-mno-exr}. 
14780 This option is valid only for H8S targets.
14782 @item -mint32
14783 @opindex mint32
14784 Make @code{int} data 32 bits by default.
14786 @item -malign-300
14787 @opindex malign-300
14788 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
14789 The default for the H8/300H and H8S is to align longs and floats on
14790 4-byte boundaries.
14791 @option{-malign-300} causes them to be aligned on 2-byte boundaries.
14792 This option has no effect on the H8/300.
14793 @end table
14795 @node HPPA Options
14796 @subsection HPPA Options
14797 @cindex HPPA Options
14799 These @samp{-m} options are defined for the HPPA family of computers:
14801 @table @gcctabopt
14802 @item -march=@var{architecture-type}
14803 @opindex march
14804 Generate code for the specified architecture.  The choices for
14805 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
14806 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
14807 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
14808 architecture option for your machine.  Code compiled for lower numbered
14809 architectures runs on higher numbered architectures, but not the
14810 other way around.
14812 @item -mpa-risc-1-0
14813 @itemx -mpa-risc-1-1
14814 @itemx -mpa-risc-2-0
14815 @opindex mpa-risc-1-0
14816 @opindex mpa-risc-1-1
14817 @opindex mpa-risc-2-0
14818 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
14820 @item -mjump-in-delay
14821 @opindex mjump-in-delay
14822 Fill delay slots of function calls with unconditional jump instructions
14823 by modifying the return pointer for the function call to be the target
14824 of the conditional jump.
14826 @item -mdisable-fpregs
14827 @opindex mdisable-fpregs
14828 Prevent floating-point registers from being used in any manner.  This is
14829 necessary for compiling kernels that perform lazy context switching of
14830 floating-point registers.  If you use this option and attempt to perform
14831 floating-point operations, the compiler aborts.
14833 @item -mdisable-indexing
14834 @opindex mdisable-indexing
14835 Prevent the compiler from using indexing address modes.  This avoids some
14836 rather obscure problems when compiling MIG generated code under MACH@.
14838 @item -mno-space-regs
14839 @opindex mno-space-regs
14840 Generate code that assumes the target has no space registers.  This allows
14841 GCC to generate faster indirect calls and use unscaled index address modes.
14843 Such code is suitable for level 0 PA systems and kernels.
14845 @item -mfast-indirect-calls
14846 @opindex mfast-indirect-calls
14847 Generate code that assumes calls never cross space boundaries.  This
14848 allows GCC to emit code that performs faster indirect calls.
14850 This option does not work in the presence of shared libraries or nested
14851 functions.
14853 @item -mfixed-range=@var{register-range}
14854 @opindex mfixed-range
14855 Generate code treating the given register range as fixed registers.
14856 A fixed register is one that the register allocator cannot use.  This is
14857 useful when compiling kernel code.  A register range is specified as
14858 two registers separated by a dash.  Multiple register ranges can be
14859 specified separated by a comma.
14861 @item -mlong-load-store
14862 @opindex mlong-load-store
14863 Generate 3-instruction load and store sequences as sometimes required by
14864 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
14865 the HP compilers.
14867 @item -mportable-runtime
14868 @opindex mportable-runtime
14869 Use the portable calling conventions proposed by HP for ELF systems.
14871 @item -mgas
14872 @opindex mgas
14873 Enable the use of assembler directives only GAS understands.
14875 @item -mschedule=@var{cpu-type}
14876 @opindex mschedule
14877 Schedule code according to the constraints for the machine type
14878 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
14879 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
14880 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
14881 proper scheduling option for your machine.  The default scheduling is
14882 @samp{8000}.
14884 @item -mlinker-opt
14885 @opindex mlinker-opt
14886 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
14887 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
14888 linkers in which they give bogus error messages when linking some programs.
14890 @item -msoft-float
14891 @opindex msoft-float
14892 Generate output containing library calls for floating point.
14893 @strong{Warning:} the requisite libraries are not available for all HPPA
14894 targets.  Normally the facilities of the machine's usual C compiler are
14895 used, but this cannot be done directly in cross-compilation.  You must make
14896 your own arrangements to provide suitable library functions for
14897 cross-compilation.
14899 @option{-msoft-float} changes the calling convention in the output file;
14900 therefore, it is only useful if you compile @emph{all} of a program with
14901 this option.  In particular, you need to compile @file{libgcc.a}, the
14902 library that comes with GCC, with @option{-msoft-float} in order for
14903 this to work.
14905 @item -msio
14906 @opindex msio
14907 Generate the predefine, @code{_SIO}, for server IO@.  The default is
14908 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
14909 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
14910 options are available under HP-UX and HI-UX@.
14912 @item -mgnu-ld
14913 @opindex mgnu-ld
14914 Use options specific to GNU @command{ld}.
14915 This passes @option{-shared} to @command{ld} when
14916 building a shared library.  It is the default when GCC is configured,
14917 explicitly or implicitly, with the GNU linker.  This option does not
14918 affect which @command{ld} is called; it only changes what parameters
14919 are passed to that @command{ld}.
14920 The @command{ld} that is called is determined by the
14921 @option{--with-ld} configure option, GCC's program search path, and
14922 finally by the user's @env{PATH}.  The linker used by GCC can be printed
14923 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
14924 on the 64-bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
14926 @item -mhp-ld
14927 @opindex mhp-ld
14928 Use options specific to HP @command{ld}.
14929 This passes @option{-b} to @command{ld} when building
14930 a shared library and passes @option{+Accept TypeMismatch} to @command{ld} on all
14931 links.  It is the default when GCC is configured, explicitly or
14932 implicitly, with the HP linker.  This option does not affect
14933 which @command{ld} is called; it only changes what parameters are passed to that
14934 @command{ld}.
14935 The @command{ld} that is called is determined by the @option{--with-ld}
14936 configure option, GCC's program search path, and finally by the user's
14937 @env{PATH}.  The linker used by GCC can be printed using @samp{which
14938 `gcc -print-prog-name=ld`}.  This option is only available on the 64-bit
14939 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
14941 @item -mlong-calls
14942 @opindex mno-long-calls
14943 Generate code that uses long call sequences.  This ensures that a call
14944 is always able to reach linker generated stubs.  The default is to generate
14945 long calls only when the distance from the call site to the beginning
14946 of the function or translation unit, as the case may be, exceeds a
14947 predefined limit set by the branch type being used.  The limits for
14948 normal calls are 7,600,000 and 240,000 bytes, respectively for the
14949 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
14950 240,000 bytes.
14952 Distances are measured from the beginning of functions when using the
14953 @option{-ffunction-sections} option, or when using the @option{-mgas}
14954 and @option{-mno-portable-runtime} options together under HP-UX with
14955 the SOM linker.
14957 It is normally not desirable to use this option as it degrades
14958 performance.  However, it may be useful in large applications,
14959 particularly when partial linking is used to build the application.
14961 The types of long calls used depends on the capabilities of the
14962 assembler and linker, and the type of code being generated.  The
14963 impact on systems that support long absolute calls, and long pic
14964 symbol-difference or pc-relative calls should be relatively small.
14965 However, an indirect call is used on 32-bit ELF systems in pic code
14966 and it is quite long.
14968 @item -munix=@var{unix-std}
14969 @opindex march
14970 Generate compiler predefines and select a startfile for the specified
14971 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
14972 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
14973 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
14974 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
14975 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
14976 and later.
14978 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
14979 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
14980 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
14981 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
14982 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
14983 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
14985 It is @emph{important} to note that this option changes the interfaces
14986 for various library routines.  It also affects the operational behavior
14987 of the C library.  Thus, @emph{extreme} care is needed in using this
14988 option.
14990 Library code that is intended to operate with more than one UNIX
14991 standard must test, set and restore the variable @var{__xpg4_extended_mask}
14992 as appropriate.  Most GNU software doesn't provide this capability.
14994 @item -nolibdld
14995 @opindex nolibdld
14996 Suppress the generation of link options to search libdld.sl when the
14997 @option{-static} option is specified on HP-UX 10 and later.
14999 @item -static
15000 @opindex static
15001 The HP-UX implementation of setlocale in libc has a dependency on
15002 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
15003 when the @option{-static} option is specified, special link options
15004 are needed to resolve this dependency.
15006 On HP-UX 10 and later, the GCC driver adds the necessary options to
15007 link with libdld.sl when the @option{-static} option is specified.
15008 This causes the resulting binary to be dynamic.  On the 64-bit port,
15009 the linkers generate dynamic binaries by default in any case.  The
15010 @option{-nolibdld} option can be used to prevent the GCC driver from
15011 adding these link options.
15013 @item -threads
15014 @opindex threads
15015 Add support for multithreading with the @dfn{dce thread} library
15016 under HP-UX@.  This option sets flags for both the preprocessor and
15017 linker.
15018 @end table
15020 @node i386 and x86-64 Options
15021 @subsection Intel 386 and AMD x86-64 Options
15022 @cindex i386 Options
15023 @cindex x86-64 Options
15024 @cindex Intel 386 Options
15025 @cindex AMD x86-64 Options
15027 These @samp{-m} options are defined for the i386 and x86-64 family of
15028 computers:
15030 @table @gcctabopt
15032 @item -march=@var{cpu-type}
15033 @opindex march
15034 Generate instructions for the machine type @var{cpu-type}.  In contrast to
15035 @option{-mtune=@var{cpu-type}}, which merely tunes the generated code 
15036 for the specified @var{cpu-type}, @option{-march=@var{cpu-type}} allows GCC
15037 to generate code that may not run at all on processors other than the one
15038 indicated.  Specifying @option{-march=@var{cpu-type}} implies 
15039 @option{-mtune=@var{cpu-type}}.
15041 The choices for @var{cpu-type} are:
15043 @table @samp
15044 @item native
15045 This selects the CPU to generate code for at compilation time by determining
15046 the processor type of the compiling machine.  Using @option{-march=native}
15047 enables all instruction subsets supported by the local machine (hence
15048 the result might not run on different machines).  Using @option{-mtune=native}
15049 produces code optimized for the local machine under the constraints
15050 of the selected instruction set.  
15052 @item i386
15053 Original Intel i386 CPU@.
15055 @item i486
15056 Intel i486 CPU@.  (No scheduling is implemented for this chip.)
15058 @item i586
15059 @itemx pentium
15060 Intel Pentium CPU with no MMX support.
15062 @item pentium-mmx
15063 Intel Pentium MMX CPU, based on Pentium core with MMX instruction set support.
15065 @item pentiumpro
15066 Intel Pentium Pro CPU@.
15068 @item i686
15069 When used with @option{-march}, the Pentium Pro
15070 instruction set is used, so the code runs on all i686 family chips.
15071 When used with @option{-mtune}, it has the same meaning as @samp{generic}.
15073 @item pentium2
15074 Intel Pentium II CPU, based on Pentium Pro core with MMX instruction set
15075 support.
15077 @item pentium3
15078 @itemx pentium3m
15079 Intel Pentium III CPU, based on Pentium Pro core with MMX and SSE instruction
15080 set support.
15082 @item pentium-m
15083 Intel Pentium M; low-power version of Intel Pentium III CPU
15084 with MMX, SSE and SSE2 instruction set support.  Used by Centrino notebooks.
15086 @item pentium4
15087 @itemx pentium4m
15088 Intel Pentium 4 CPU with MMX, SSE and SSE2 instruction set support.
15090 @item prescott
15091 Improved version of Intel Pentium 4 CPU with MMX, SSE, SSE2 and SSE3 instruction
15092 set support.
15094 @item nocona
15095 Improved version of Intel Pentium 4 CPU with 64-bit extensions, MMX, SSE,
15096 SSE2 and SSE3 instruction set support.
15098 @item core2
15099 Intel Core 2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
15100 instruction set support.
15102 @item nehalem
15103 Intel Nehalem CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
15104 SSE4.1, SSE4.2 and POPCNT instruction set support.
15106 @item westmere
15107 Intel Westmere CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
15108 SSE4.1, SSE4.2, POPCNT, AES and PCLMUL instruction set support.
15110 @item sandybridge
15111 Intel Sandy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
15112 SSE4.1, SSE4.2, POPCNT, AVX, AES and PCLMUL instruction set support.
15114 @item ivybridge
15115 Intel Ivy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
15116 SSE4.1, SSE4.2, POPCNT, AVX, AES, PCLMUL, FSGSBASE, RDRND and F16C
15117 instruction set support.
15119 @item haswell
15120 Intel Haswell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
15121 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
15122 BMI, BMI2 and F16C instruction set support.
15124 @item broadwell
15125 Intel Broadwell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
15126 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
15127 BMI, BMI2, F16C, RDSEED, ADCX and PREFETCHW instruction set support.
15129 @item bonnell
15130 Intel Bonnell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3 and SSSE3
15131 instruction set support.
15133 @item silvermont
15134 Intel Silvermont CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
15135 SSE4.1, SSE4.2, POPCNT, AES, PCLMUL and RDRND instruction set support.
15137 @item k6
15138 AMD K6 CPU with MMX instruction set support.
15140 @item k6-2
15141 @itemx k6-3
15142 Improved versions of AMD K6 CPU with MMX and 3DNow!@: instruction set support.
15144 @item athlon
15145 @itemx athlon-tbird
15146 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3DNow!@: and SSE prefetch instructions
15147 support.
15149 @item athlon-4
15150 @itemx athlon-xp
15151 @itemx athlon-mp
15152 Improved AMD Athlon CPU with MMX, 3DNow!, enhanced 3DNow!@: and full SSE
15153 instruction set support.
15155 @item k8
15156 @itemx opteron
15157 @itemx athlon64
15158 @itemx athlon-fx
15159 Processors based on the AMD K8 core with x86-64 instruction set support,
15160 including the AMD Opteron, Athlon 64, and Athlon 64 FX processors.
15161 (This supersets MMX, SSE, SSE2, 3DNow!, enhanced 3DNow!@: and 64-bit
15162 instruction set extensions.)
15164 @item k8-sse3
15165 @itemx opteron-sse3
15166 @itemx athlon64-sse3
15167 Improved versions of AMD K8 cores with SSE3 instruction set support.
15169 @item amdfam10
15170 @itemx barcelona
15171 CPUs based on AMD Family 10h cores with x86-64 instruction set support.  (This
15172 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!, enhanced 3DNow!, ABM and 64-bit
15173 instruction set extensions.)
15175 @item bdver1
15176 CPUs based on AMD Family 15h cores with x86-64 instruction set support.  (This
15177 supersets FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A,
15178 SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set extensions.)
15179 @item bdver2
15180 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
15181 supersets BMI, TBM, F16C, FMA, FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX,
15182 SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set 
15183 extensions.)
15184 @item bdver3
15185 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
15186 supersets BMI, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, XOP, LWP, AES, 
15187 PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 
15188 64-bit instruction set extensions.
15189 @item bdver4
15190 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
15191 supersets BMI, BMI2, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, AVX2, XOP, LWP, 
15192 AES, PCL_MUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, 
15193 SSE4.2, ABM and 64-bit instruction set extensions.
15195 @item btver1
15196 CPUs based on AMD Family 14h cores with x86-64 instruction set support.  (This
15197 supersets MMX, SSE, SSE2, SSE3, SSSE3, SSE4A, CX16, ABM and 64-bit
15198 instruction set extensions.)
15200 @item btver2
15201 CPUs based on AMD Family 16h cores with x86-64 instruction set support. This
15202 includes MOVBE, F16C, BMI, AVX, PCL_MUL, AES, SSE4.2, SSE4.1, CX16, ABM,
15203 SSE4A, SSSE3, SSE3, SSE2, SSE, MMX and 64-bit instruction set extensions.
15205 @item winchip-c6
15206 IDT WinChip C6 CPU, dealt in same way as i486 with additional MMX instruction
15207 set support.
15209 @item winchip2
15210 IDT WinChip 2 CPU, dealt in same way as i486 with additional MMX and 3DNow!@:
15211 instruction set support.
15213 @item c3
15214 VIA C3 CPU with MMX and 3DNow!@: instruction set support.  (No scheduling is
15215 implemented for this chip.)
15217 @item c3-2
15218 VIA C3-2 (Nehemiah/C5XL) CPU with MMX and SSE instruction set support.
15219 (No scheduling is
15220 implemented for this chip.)
15222 @item geode
15223 AMD Geode embedded processor with MMX and 3DNow!@: instruction set support.
15224 @end table
15226 @item -mtune=@var{cpu-type}
15227 @opindex mtune
15228 Tune to @var{cpu-type} everything applicable about the generated code, except
15229 for the ABI and the set of available instructions.  
15230 While picking a specific @var{cpu-type} schedules things appropriately
15231 for that particular chip, the compiler does not generate any code that
15232 cannot run on the default machine type unless you use a
15233 @option{-march=@var{cpu-type}} option.
15234 For example, if GCC is configured for i686-pc-linux-gnu
15235 then @option{-mtune=pentium4} generates code that is tuned for Pentium 4
15236 but still runs on i686 machines.
15238 The choices for @var{cpu-type} are the same as for @option{-march}.
15239 In addition, @option{-mtune} supports 2 extra choices for @var{cpu-type}:
15241 @table @samp
15242 @item generic
15243 Produce code optimized for the most common IA32/@/AMD64/@/EM64T processors.
15244 If you know the CPU on which your code will run, then you should use
15245 the corresponding @option{-mtune} or @option{-march} option instead of
15246 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
15247 of your application will have, then you should use this option.
15249 As new processors are deployed in the marketplace, the behavior of this
15250 option will change.  Therefore, if you upgrade to a newer version of
15251 GCC, code generation controlled by this option will change to reflect
15252 the processors
15253 that are most common at the time that version of GCC is released.
15255 There is no @option{-march=generic} option because @option{-march}
15256 indicates the instruction set the compiler can use, and there is no
15257 generic instruction set applicable to all processors.  In contrast,
15258 @option{-mtune} indicates the processor (or, in this case, collection of
15259 processors) for which the code is optimized.
15261 @item intel
15262 Produce code optimized for the most current Intel processors, which are
15263 Haswell and Silvermont for this version of GCC.  If you know the CPU
15264 on which your code will run, then you should use the corresponding
15265 @option{-mtune} or @option{-march} option instead of @option{-mtune=intel}.
15266 But, if you want your application performs better on both Haswell and
15267 Silvermont, then you should use this option.
15269 As new Intel processors are deployed in the marketplace, the behavior of
15270 this option will change.  Therefore, if you upgrade to a newer version of
15271 GCC, code generation controlled by this option will change to reflect
15272 the most current Intel processors at the time that version of GCC is
15273 released.
15275 There is no @option{-march=intel} option because @option{-march} indicates
15276 the instruction set the compiler can use, and there is no common
15277 instruction set applicable to all processors.  In contrast,
15278 @option{-mtune} indicates the processor (or, in this case, collection of
15279 processors) for which the code is optimized.
15280 @end table
15282 @item -mcpu=@var{cpu-type}
15283 @opindex mcpu
15284 A deprecated synonym for @option{-mtune}.
15286 @item -mfpmath=@var{unit}
15287 @opindex mfpmath
15288 Generate floating-point arithmetic for selected unit @var{unit}.  The choices
15289 for @var{unit} are:
15291 @table @samp
15292 @item 387
15293 Use the standard 387 floating-point coprocessor present on the majority of chips and
15294 emulated otherwise.  Code compiled with this option runs almost everywhere.
15295 The temporary results are computed in 80-bit precision instead of the precision
15296 specified by the type, resulting in slightly different results compared to most
15297 of other chips.  See @option{-ffloat-store} for more detailed description.
15299 This is the default choice for i386 compiler.
15301 @item sse
15302 Use scalar floating-point instructions present in the SSE instruction set.
15303 This instruction set is supported by Pentium III and newer chips,
15304 and in the AMD line
15305 by Athlon-4, Athlon XP and Athlon MP chips.  The earlier version of the SSE
15306 instruction set supports only single-precision arithmetic, thus the double and
15307 extended-precision arithmetic are still done using 387.  A later version, present
15308 only in Pentium 4 and AMD x86-64 chips, supports double-precision
15309 arithmetic too.
15311 For the i386 compiler, you must use @option{-march=@var{cpu-type}}, @option{-msse}
15312 or @option{-msse2} switches to enable SSE extensions and make this option
15313 effective.  For the x86-64 compiler, these extensions are enabled by default.
15315 The resulting code should be considerably faster in the majority of cases and avoid
15316 the numerical instability problems of 387 code, but may break some existing
15317 code that expects temporaries to be 80 bits.
15319 This is the default choice for the x86-64 compiler.
15321 @item sse,387
15322 @itemx sse+387
15323 @itemx both
15324 Attempt to utilize both instruction sets at once.  This effectively doubles the
15325 amount of available registers, and on chips with separate execution units for
15326 387 and SSE the execution resources too.  Use this option with care, as it is
15327 still experimental, because the GCC register allocator does not model separate
15328 functional units well, resulting in unstable performance.
15329 @end table
15331 @item -masm=@var{dialect}
15332 @opindex masm=@var{dialect}
15333 Output assembly instructions using selected @var{dialect}.  Supported
15334 choices are @samp{intel} or @samp{att} (the default).  Darwin does
15335 not support @samp{intel}.
15337 @item -mieee-fp
15338 @itemx -mno-ieee-fp
15339 @opindex mieee-fp
15340 @opindex mno-ieee-fp
15341 Control whether or not the compiler uses IEEE floating-point
15342 comparisons.  These correctly handle the case where the result of a
15343 comparison is unordered.
15345 @item -msoft-float
15346 @opindex msoft-float
15347 Generate output containing library calls for floating point.
15349 @strong{Warning:} the requisite libraries are not part of GCC@.
15350 Normally the facilities of the machine's usual C compiler are used, but
15351 this can't be done directly in cross-compilation.  You must make your
15352 own arrangements to provide suitable library functions for
15353 cross-compilation.
15355 On machines where a function returns floating-point results in the 80387
15356 register stack, some floating-point opcodes may be emitted even if
15357 @option{-msoft-float} is used.
15359 @item -mno-fp-ret-in-387
15360 @opindex mno-fp-ret-in-387
15361 Do not use the FPU registers for return values of functions.
15363 The usual calling convention has functions return values of types
15364 @code{float} and @code{double} in an FPU register, even if there
15365 is no FPU@.  The idea is that the operating system should emulate
15366 an FPU@.
15368 The option @option{-mno-fp-ret-in-387} causes such values to be returned
15369 in ordinary CPU registers instead.
15371 @item -mno-fancy-math-387
15372 @opindex mno-fancy-math-387
15373 Some 387 emulators do not support the @code{sin}, @code{cos} and
15374 @code{sqrt} instructions for the 387.  Specify this option to avoid
15375 generating those instructions.  This option is the default on FreeBSD,
15376 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
15377 indicates that the target CPU always has an FPU and so the
15378 instruction does not need emulation.  These
15379 instructions are not generated unless you also use the
15380 @option{-funsafe-math-optimizations} switch.
15382 @item -malign-double
15383 @itemx -mno-align-double
15384 @opindex malign-double
15385 @opindex mno-align-double
15386 Control whether GCC aligns @code{double}, @code{long double}, and
15387 @code{long long} variables on a two-word boundary or a one-word
15388 boundary.  Aligning @code{double} variables on a two-word boundary
15389 produces code that runs somewhat faster on a Pentium at the
15390 expense of more memory.
15392 On x86-64, @option{-malign-double} is enabled by default.
15394 @strong{Warning:} if you use the @option{-malign-double} switch,
15395 structures containing the above types are aligned differently than
15396 the published application binary interface specifications for the 386
15397 and are not binary compatible with structures in code compiled
15398 without that switch.
15400 @item -m96bit-long-double
15401 @itemx -m128bit-long-double
15402 @opindex m96bit-long-double
15403 @opindex m128bit-long-double
15404 These switches control the size of @code{long double} type.  The i386
15405 application binary interface specifies the size to be 96 bits,
15406 so @option{-m96bit-long-double} is the default in 32-bit mode.
15408 Modern architectures (Pentium and newer) prefer @code{long double}
15409 to be aligned to an 8- or 16-byte boundary.  In arrays or structures
15410 conforming to the ABI, this is not possible.  So specifying
15411 @option{-m128bit-long-double} aligns @code{long double}
15412 to a 16-byte boundary by padding the @code{long double} with an additional
15413 32-bit zero.
15415 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
15416 its ABI specifies that @code{long double} is aligned on 16-byte boundary.
15418 Notice that neither of these options enable any extra precision over the x87
15419 standard of 80 bits for a @code{long double}.
15421 @strong{Warning:} if you override the default value for your target ABI, this
15422 changes the size of 
15423 structures and arrays containing @code{long double} variables,
15424 as well as modifying the function calling convention for functions taking
15425 @code{long double}.  Hence they are not binary-compatible
15426 with code compiled without that switch.
15428 @item -mlong-double-64
15429 @itemx -mlong-double-80
15430 @itemx -mlong-double-128
15431 @opindex mlong-double-64
15432 @opindex mlong-double-80
15433 @opindex mlong-double-128
15434 These switches control the size of @code{long double} type. A size
15435 of 64 bits makes the @code{long double} type equivalent to the @code{double}
15436 type. This is the default for 32-bit Bionic C library.  A size
15437 of 128 bits makes the @code{long double} type equivalent to the
15438 @code{__float128} type. This is the default for 64-bit Bionic C library.
15440 @strong{Warning:} if you override the default value for your target ABI, this
15441 changes the size of
15442 structures and arrays containing @code{long double} variables,
15443 as well as modifying the function calling convention for functions taking
15444 @code{long double}.  Hence they are not binary-compatible
15445 with code compiled without that switch.
15447 @item -mlarge-data-threshold=@var{threshold}
15448 @opindex mlarge-data-threshold
15449 When @option{-mcmodel=medium} is specified, data objects larger than
15450 @var{threshold} are placed in the large data section.  This value must be the
15451 same across all objects linked into the binary, and defaults to 65535.
15453 @item -mrtd
15454 @opindex mrtd
15455 Use a different function-calling convention, in which functions that
15456 take a fixed number of arguments return with the @code{ret @var{num}}
15457 instruction, which pops their arguments while returning.  This saves one
15458 instruction in the caller since there is no need to pop the arguments
15459 there.
15461 You can specify that an individual function is called with this calling
15462 sequence with the function attribute @samp{stdcall}.  You can also
15463 override the @option{-mrtd} option by using the function attribute
15464 @samp{cdecl}.  @xref{Function Attributes}.
15466 @strong{Warning:} this calling convention is incompatible with the one
15467 normally used on Unix, so you cannot use it if you need to call
15468 libraries compiled with the Unix compiler.
15470 Also, you must provide function prototypes for all functions that
15471 take variable numbers of arguments (including @code{printf});
15472 otherwise incorrect code is generated for calls to those
15473 functions.
15475 In addition, seriously incorrect code results if you call a
15476 function with too many arguments.  (Normally, extra arguments are
15477 harmlessly ignored.)
15479 @item -mregparm=@var{num}
15480 @opindex mregparm
15481 Control how many registers are used to pass integer arguments.  By
15482 default, no registers are used to pass arguments, and at most 3
15483 registers can be used.  You can control this behavior for a specific
15484 function by using the function attribute @samp{regparm}.
15485 @xref{Function Attributes}.
15487 @strong{Warning:} if you use this switch, and
15488 @var{num} is nonzero, then you must build all modules with the same
15489 value, including any libraries.  This includes the system libraries and
15490 startup modules.
15492 @item -msseregparm
15493 @opindex msseregparm
15494 Use SSE register passing conventions for float and double arguments
15495 and return values.  You can control this behavior for a specific
15496 function by using the function attribute @samp{sseregparm}.
15497 @xref{Function Attributes}.
15499 @strong{Warning:} if you use this switch then you must build all
15500 modules with the same value, including any libraries.  This includes
15501 the system libraries and startup modules.
15503 @item -mvect8-ret-in-mem
15504 @opindex mvect8-ret-in-mem
15505 Return 8-byte vectors in memory instead of MMX registers.  This is the
15506 default on Solaris@tie{}8 and 9 and VxWorks to match the ABI of the Sun
15507 Studio compilers until version 12.  Later compiler versions (starting
15508 with Studio 12 Update@tie{}1) follow the ABI used by other x86 targets, which
15509 is the default on Solaris@tie{}10 and later.  @emph{Only} use this option if
15510 you need to remain compatible with existing code produced by those
15511 previous compiler versions or older versions of GCC@.
15513 @item -mpc32
15514 @itemx -mpc64
15515 @itemx -mpc80
15516 @opindex mpc32
15517 @opindex mpc64
15518 @opindex mpc80
15520 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
15521 is specified, the significands of results of floating-point operations are
15522 rounded to 24 bits (single precision); @option{-mpc64} rounds the
15523 significands of results of floating-point operations to 53 bits (double
15524 precision) and @option{-mpc80} rounds the significands of results of
15525 floating-point operations to 64 bits (extended double precision), which is
15526 the default.  When this option is used, floating-point operations in higher
15527 precisions are not available to the programmer without setting the FPU
15528 control word explicitly.
15530 Setting the rounding of floating-point operations to less than the default
15531 80 bits can speed some programs by 2% or more.  Note that some mathematical
15532 libraries assume that extended-precision (80-bit) floating-point operations
15533 are enabled by default; routines in such libraries could suffer significant
15534 loss of accuracy, typically through so-called ``catastrophic cancellation'',
15535 when this option is used to set the precision to less than extended precision.
15537 @item -mstackrealign
15538 @opindex mstackrealign
15539 Realign the stack at entry.  On the Intel x86, the @option{-mstackrealign}
15540 option generates an alternate prologue and epilogue that realigns the
15541 run-time stack if necessary.  This supports mixing legacy codes that keep
15542 4-byte stack alignment with modern codes that keep 16-byte stack alignment for
15543 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
15544 applicable to individual functions.
15546 @item -mpreferred-stack-boundary=@var{num}
15547 @opindex mpreferred-stack-boundary
15548 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
15549 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
15550 the default is 4 (16 bytes or 128 bits).
15552 @strong{Warning:} When generating code for the x86-64 architecture with
15553 SSE extensions disabled, @option{-mpreferred-stack-boundary=3} can be
15554 used to keep the stack boundary aligned to 8 byte boundary.  Since
15555 x86-64 ABI require 16 byte stack alignment, this is ABI incompatible and
15556 intended to be used in controlled environment where stack space is
15557 important limitation.  This option will lead to wrong code when functions
15558 compiled with 16 byte stack alignment (such as functions from a standard
15559 library) are called with misaligned stack.  In this case, SSE
15560 instructions may lead to misaligned memory access traps.  In addition,
15561 variable arguments will be handled incorrectly for 16 byte aligned
15562 objects (including x87 long double and __int128), leading to wrong
15563 results.  You must build all modules with
15564 @option{-mpreferred-stack-boundary=3}, including any libraries.  This
15565 includes the system libraries and startup modules.
15567 @item -mincoming-stack-boundary=@var{num}
15568 @opindex mincoming-stack-boundary
15569 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
15570 boundary.  If @option{-mincoming-stack-boundary} is not specified,
15571 the one specified by @option{-mpreferred-stack-boundary} is used.
15573 On Pentium and Pentium Pro, @code{double} and @code{long double} values
15574 should be aligned to an 8-byte boundary (see @option{-malign-double}) or
15575 suffer significant run time performance penalties.  On Pentium III, the
15576 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
15577 properly if it is not 16-byte aligned.
15579 To ensure proper alignment of this values on the stack, the stack boundary
15580 must be as aligned as that required by any value stored on the stack.
15581 Further, every function must be generated such that it keeps the stack
15582 aligned.  Thus calling a function compiled with a higher preferred
15583 stack boundary from a function compiled with a lower preferred stack
15584 boundary most likely misaligns the stack.  It is recommended that
15585 libraries that use callbacks always use the default setting.
15587 This extra alignment does consume extra stack space, and generally
15588 increases code size.  Code that is sensitive to stack space usage, such
15589 as embedded systems and operating system kernels, may want to reduce the
15590 preferred alignment to @option{-mpreferred-stack-boundary=2}.
15592 @item -mmmx
15593 @itemx -mno-mmx
15594 @itemx -msse
15595 @itemx -mno-sse
15596 @itemx -msse2
15597 @itemx -mno-sse2
15598 @itemx -msse3
15599 @itemx -mno-sse3
15600 @itemx -mssse3
15601 @itemx -mno-ssse3
15602 @itemx -msse4.1
15603 @need 800
15604 @itemx -mno-sse4.1
15605 @itemx -msse4.2
15606 @itemx -mno-sse4.2
15607 @itemx -msse4
15608 @itemx -mno-sse4
15609 @itemx -mavx
15610 @itemx -mno-avx
15611 @itemx -mavx2
15612 @itemx -mno-avx2
15613 @itemx -mavx512f
15614 @itemx -mno-avx512f
15615 @need 800
15616 @itemx -mavx512pf
15617 @itemx -mno-avx512pf
15618 @itemx -mavx512er
15619 @itemx -mno-avx512er
15620 @itemx -mavx512cd
15621 @itemx -mno-avx512cd
15622 @itemx -msha
15623 @itemx -mno-sha
15624 @itemx -maes
15625 @itemx -mno-aes
15626 @itemx -mpclmul
15627 @itemx -mno-pclmul
15628 @need 800
15629 @itemx -mfsgsbase
15630 @itemx -mno-fsgsbase
15631 @itemx -mrdrnd
15632 @itemx -mno-rdrnd
15633 @itemx -mf16c
15634 @itemx -mno-f16c
15635 @itemx -mfma
15636 @itemx -mno-fma
15637 @itemx -mprefetchwt1
15638 @itemx -mno-prefetchwt1
15639 @itemx -msse4a
15640 @itemx -mno-sse4a
15641 @itemx -mfma4
15642 @itemx -mno-fma4
15643 @need 800
15644 @itemx -mxop
15645 @itemx -mno-xop
15646 @itemx -mlwp
15647 @itemx -mno-lwp
15648 @itemx -m3dnow
15649 @itemx -mno-3dnow
15650 @itemx -mpopcnt
15651 @itemx -mno-popcnt
15652 @itemx -mabm
15653 @itemx -mno-abm
15654 @itemx -mbmi
15655 @itemx -mbmi2
15656 @itemx -mno-bmi
15657 @itemx -mno-bmi2
15658 @itemx -mlzcnt
15659 @itemx -mno-lzcnt
15660 @itemx -mfxsr
15661 @itemx -mxsave
15662 @itemx -mxsaveopt
15663 @itemx -mrtm
15664 @itemx -mtbm
15665 @itemx -mno-tbm
15666 @opindex mmmx
15667 @opindex mno-mmx
15668 @opindex msse
15669 @opindex mno-sse
15670 @opindex m3dnow
15671 @opindex mno-3dnow
15672 These switches enable or disable the use of instructions in the MMX, SSE,
15673 SSE2, SSE3, SSSE3, SSE4.1, AVX, AVX2, AVX512F, AVX512PF, AVX512ER, AVX512CD,
15674 SHA, AES, PCLMUL, FSGSBASE, RDRND, F16C, FMA, SSE4A, FMA4, XOP, LWP, ABM,
15675 BMI, BMI2, FXSR, XSAVE, XSAVEOPT, LZCNT, RTM, or 3DNow!@:
15676 extended instruction sets.
15677 These extensions are also available as built-in functions: see
15678 @ref{X86 Built-in Functions}, for details of the functions enabled and
15679 disabled by these switches.
15681 To generate SSE/SSE2 instructions automatically from floating-point
15682 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
15684 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
15685 generates new AVX instructions or AVX equivalence for all SSEx instructions
15686 when needed.
15688 These options enable GCC to use these extended instructions in
15689 generated code, even without @option{-mfpmath=sse}.  Applications that
15690 perform run-time CPU detection must compile separate files for each
15691 supported architecture, using the appropriate flags.  In particular,
15692 the file containing the CPU detection code should be compiled without
15693 these options.
15695 @item -mdump-tune-features
15696 @opindex mdump-tune-features
15697 This option instructs GCC to dump the names of the x86 performance 
15698 tuning features and default settings. The names can be used in 
15699 @option{-mtune-ctrl=@var{feature-list}}.
15701 @item -mtune-ctrl=@var{feature-list}
15702 @opindex mtune-ctrl=@var{feature-list}
15703 This option is used to do fine grain control of x86 code generation features.
15704 @var{feature-list} is a comma separated list of @var{feature} names. See also
15705 @option{-mdump-tune-features}. When specified, the @var{feature} will be turned
15706 on if it is not preceded with @code{^}, otherwise, it will be turned off. 
15707 @option{-mtune-ctrl=@var{feature-list}} is intended to be used by GCC
15708 developers. Using it may lead to code paths not covered by testing and can
15709 potentially result in compiler ICEs or runtime errors.
15711 @item -mno-default
15712 @opindex mno-default
15713 This option instructs GCC to turn off all tunable features. See also 
15714 @option{-mtune-ctrl=@var{feature-list}} and @option{-mdump-tune-features}.
15716 @item -mcld
15717 @opindex mcld
15718 This option instructs GCC to emit a @code{cld} instruction in the prologue
15719 of functions that use string instructions.  String instructions depend on
15720 the DF flag to select between autoincrement or autodecrement mode.  While the
15721 ABI specifies the DF flag to be cleared on function entry, some operating
15722 systems violate this specification by not clearing the DF flag in their
15723 exception dispatchers.  The exception handler can be invoked with the DF flag
15724 set, which leads to wrong direction mode when string instructions are used.
15725 This option can be enabled by default on 32-bit x86 targets by configuring
15726 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
15727 instructions can be suppressed with the @option{-mno-cld} compiler option
15728 in this case.
15730 @item -mvzeroupper
15731 @opindex mvzeroupper
15732 This option instructs GCC to emit a @code{vzeroupper} instruction
15733 before a transfer of control flow out of the function to minimize
15734 the AVX to SSE transition penalty as well as remove unnecessary @code{zeroupper}
15735 intrinsics.
15737 @item -mprefer-avx128
15738 @opindex mprefer-avx128
15739 This option instructs GCC to use 128-bit AVX instructions instead of
15740 256-bit AVX instructions in the auto-vectorizer.
15742 @item -mcx16
15743 @opindex mcx16
15744 This option enables GCC to generate @code{CMPXCHG16B} instructions.
15745 @code{CMPXCHG16B} allows for atomic operations on 128-bit double quadword
15746 (or oword) data types.  
15747 This is useful for high-resolution counters that can be updated
15748 by multiple processors (or cores).  This instruction is generated as part of
15749 atomic built-in functions: see @ref{__sync Builtins} or
15750 @ref{__atomic Builtins} for details.
15752 @item -msahf
15753 @opindex msahf
15754 This option enables generation of @code{SAHF} instructions in 64-bit code.
15755 Early Intel Pentium 4 CPUs with Intel 64 support,
15756 prior to the introduction of Pentium 4 G1 step in December 2005,
15757 lacked the @code{LAHF} and @code{SAHF} instructions
15758 which were supported by AMD64.
15759 These are load and store instructions, respectively, for certain status flags.
15760 In 64-bit mode, the @code{SAHF} instruction is used to optimize @code{fmod},
15761 @code{drem}, and @code{remainder} built-in functions;
15762 see @ref{Other Builtins} for details.
15764 @item -mmovbe
15765 @opindex mmovbe
15766 This option enables use of the @code{movbe} instruction to implement
15767 @code{__builtin_bswap32} and @code{__builtin_bswap64}.
15769 @item -mcrc32
15770 @opindex mcrc32
15771 This option enables built-in functions @code{__builtin_ia32_crc32qi},
15772 @code{__builtin_ia32_crc32hi}, @code{__builtin_ia32_crc32si} and
15773 @code{__builtin_ia32_crc32di} to generate the @code{crc32} machine instruction.
15775 @item -mrecip
15776 @opindex mrecip
15777 This option enables use of @code{RCPSS} and @code{RSQRTSS} instructions
15778 (and their vectorized variants @code{RCPPS} and @code{RSQRTPS})
15779 with an additional Newton-Raphson step
15780 to increase precision instead of @code{DIVSS} and @code{SQRTSS}
15781 (and their vectorized
15782 variants) for single-precision floating-point arguments.  These instructions
15783 are generated only when @option{-funsafe-math-optimizations} is enabled
15784 together with @option{-finite-math-only} and @option{-fno-trapping-math}.
15785 Note that while the throughput of the sequence is higher than the throughput
15786 of the non-reciprocal instruction, the precision of the sequence can be
15787 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
15789 Note that GCC implements @code{1.0f/sqrtf(@var{x})} in terms of @code{RSQRTSS}
15790 (or @code{RSQRTPS}) already with @option{-ffast-math} (or the above option
15791 combination), and doesn't need @option{-mrecip}.
15793 Also note that GCC emits the above sequence with additional Newton-Raphson step
15794 for vectorized single-float division and vectorized @code{sqrtf(@var{x})}
15795 already with @option{-ffast-math} (or the above option combination), and
15796 doesn't need @option{-mrecip}.
15798 @item -mrecip=@var{opt}
15799 @opindex mrecip=opt
15800 This option controls which reciprocal estimate instructions
15801 may be used.  @var{opt} is a comma-separated list of options, which may
15802 be preceded by a @samp{!} to invert the option:
15804 @table @samp
15805 @item all
15806 Enable all estimate instructions.
15808 @item default
15809 Enable the default instructions, equivalent to @option{-mrecip}.
15811 @item none
15812 Disable all estimate instructions, equivalent to @option{-mno-recip}.
15814 @item div
15815 Enable the approximation for scalar division.
15817 @item vec-div
15818 Enable the approximation for vectorized division.
15820 @item sqrt
15821 Enable the approximation for scalar square root.
15823 @item vec-sqrt
15824 Enable the approximation for vectorized square root.
15825 @end table
15827 So, for example, @option{-mrecip=all,!sqrt} enables
15828 all of the reciprocal approximations, except for square root.
15830 @item -mveclibabi=@var{type}
15831 @opindex mveclibabi
15832 Specifies the ABI type to use for vectorizing intrinsics using an
15833 external library.  Supported values for @var{type} are @samp{svml} 
15834 for the Intel short
15835 vector math library and @samp{acml} for the AMD math core library.
15836 To use this option, both @option{-ftree-vectorize} and
15837 @option{-funsafe-math-optimizations} have to be enabled, and an SVML or ACML 
15838 ABI-compatible library must be specified at link time.
15840 GCC currently emits calls to @code{vmldExp2},
15841 @code{vmldLn2}, @code{vmldLog102}, @code{vmldLog102}, @code{vmldPow2},
15842 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
15843 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
15844 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
15845 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4}, @code{vmlsLog104},
15846 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
15847 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
15848 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
15849 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
15850 function type when @option{-mveclibabi=svml} is used, and @code{__vrd2_sin},
15851 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
15852 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
15853 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
15854 @code{__vrs4_log10f} and @code{__vrs4_powf} for the corresponding function type
15855 when @option{-mveclibabi=acml} is used.  
15857 @item -mabi=@var{name}
15858 @opindex mabi
15859 Generate code for the specified calling convention.  Permissible values
15860 are @samp{sysv} for the ABI used on GNU/Linux and other systems, and
15861 @samp{ms} for the Microsoft ABI.  The default is to use the Microsoft
15862 ABI when targeting Microsoft Windows and the SysV ABI on all other systems.
15863 You can control this behavior for a specific function by
15864 using the function attribute @samp{ms_abi}/@samp{sysv_abi}.
15865 @xref{Function Attributes}.
15867 @item -mtls-dialect=@var{type}
15868 @opindex mtls-dialect
15869 Generate code to access thread-local storage using the @samp{gnu} or
15870 @samp{gnu2} conventions.  @samp{gnu} is the conservative default;
15871 @samp{gnu2} is more efficient, but it may add compile- and run-time
15872 requirements that cannot be satisfied on all systems.
15874 @item -mpush-args
15875 @itemx -mno-push-args
15876 @opindex mpush-args
15877 @opindex mno-push-args
15878 Use PUSH operations to store outgoing parameters.  This method is shorter
15879 and usually equally fast as method using SUB/MOV operations and is enabled
15880 by default.  In some cases disabling it may improve performance because of
15881 improved scheduling and reduced dependencies.
15883 @item -maccumulate-outgoing-args
15884 @opindex maccumulate-outgoing-args
15885 If enabled, the maximum amount of space required for outgoing arguments is
15886 computed in the function prologue.  This is faster on most modern CPUs
15887 because of reduced dependencies, improved scheduling and reduced stack usage
15888 when the preferred stack boundary is not equal to 2.  The drawback is a notable
15889 increase in code size.  This switch implies @option{-mno-push-args}.
15891 @item -mthreads
15892 @opindex mthreads
15893 Support thread-safe exception handling on MinGW.  Programs that rely
15894 on thread-safe exception handling must compile and link all code with the
15895 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
15896 @code{-D_MT}; when linking, it links in a special thread helper library
15897 @option{-lmingwthrd} which cleans up per-thread exception-handling data.
15899 @item -mno-align-stringops
15900 @opindex mno-align-stringops
15901 Do not align the destination of inlined string operations.  This switch reduces
15902 code size and improves performance in case the destination is already aligned,
15903 but GCC doesn't know about it.
15905 @item -minline-all-stringops
15906 @opindex minline-all-stringops
15907 By default GCC inlines string operations only when the destination is 
15908 known to be aligned to least a 4-byte boundary.  
15909 This enables more inlining and increases code
15910 size, but may improve performance of code that depends on fast
15911 @code{memcpy}, @code{strlen},
15912 and @code{memset} for short lengths.
15914 @item -minline-stringops-dynamically
15915 @opindex minline-stringops-dynamically
15916 For string operations of unknown size, use run-time checks with
15917 inline code for small blocks and a library call for large blocks.
15919 @item -mstringop-strategy=@var{alg}
15920 @opindex mstringop-strategy=@var{alg}
15921 Override the internal decision heuristic for the particular algorithm to use
15922 for inlining string operations.  The allowed values for @var{alg} are:
15924 @table @samp
15925 @item rep_byte
15926 @itemx rep_4byte
15927 @itemx rep_8byte
15928 Expand using i386 @code{rep} prefix of the specified size.
15930 @item byte_loop
15931 @itemx loop
15932 @itemx unrolled_loop
15933 Expand into an inline loop.
15935 @item libcall
15936 Always use a library call.
15937 @end table
15939 @item -mmemcpy-strategy=@var{strategy}
15940 @opindex mmemcpy-strategy=@var{strategy}
15941 Override the internal decision heuristic to decide if @code{__builtin_memcpy}
15942 should be inlined and what inline algorithm to use when the expected size
15943 of the copy operation is known. @var{strategy} 
15944 is a comma-separated list of @var{alg}:@var{max_size}:@var{dest_align} triplets. 
15945 @var{alg} is specified in @option{-mstringop-strategy}, @var{max_size} specifies
15946 the max byte size with which inline algorithm @var{alg} is allowed.  For the last
15947 triplet, the @var{max_size} must be @code{-1}. The @var{max_size} of the triplets
15948 in the list must be specified in increasing order.  The minimal byte size for 
15949 @var{alg} is @code{0} for the first triplet and @code{@var{max_size} + 1} of the 
15950 preceding range.
15952 @item -mmemset-strategy=@var{strategy}
15953 @opindex mmemset-strategy=@var{strategy}
15954 The option is similar to @option{-mmemcpy-strategy=} except that it is to control
15955 @code{__builtin_memset} expansion.
15957 @item -momit-leaf-frame-pointer
15958 @opindex momit-leaf-frame-pointer
15959 Don't keep the frame pointer in a register for leaf functions.  This
15960 avoids the instructions to save, set up, and restore frame pointers and
15961 makes an extra register available in leaf functions.  The option
15962 @option{-fomit-leaf-frame-pointer} removes the frame pointer for leaf functions,
15963 which might make debugging harder.
15965 @item -mtls-direct-seg-refs
15966 @itemx -mno-tls-direct-seg-refs
15967 @opindex mtls-direct-seg-refs
15968 Controls whether TLS variables may be accessed with offsets from the
15969 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
15970 or whether the thread base pointer must be added.  Whether or not this
15971 is valid depends on the operating system, and whether it maps the
15972 segment to cover the entire TLS area.
15974 For systems that use the GNU C Library, the default is on.
15976 @item -msse2avx
15977 @itemx -mno-sse2avx
15978 @opindex msse2avx
15979 Specify that the assembler should encode SSE instructions with VEX
15980 prefix.  The option @option{-mavx} turns this on by default.
15982 @item -mfentry
15983 @itemx -mno-fentry
15984 @opindex mfentry
15985 If profiling is active (@option{-pg}), put the profiling
15986 counter call before the prologue.
15987 Note: On x86 architectures the attribute @code{ms_hook_prologue}
15988 isn't possible at the moment for @option{-mfentry} and @option{-pg}.
15990 @item -m8bit-idiv
15991 @itemx -mno-8bit-idiv
15992 @opindex 8bit-idiv
15993 On some processors, like Intel Atom, 8-bit unsigned integer divide is
15994 much faster than 32-bit/64-bit integer divide.  This option generates a
15995 run-time check.  If both dividend and divisor are within range of 0
15996 to 255, 8-bit unsigned integer divide is used instead of
15997 32-bit/64-bit integer divide.
15999 @item -mavx256-split-unaligned-load
16000 @itemx -mavx256-split-unaligned-store
16001 @opindex avx256-split-unaligned-load
16002 @opindex avx256-split-unaligned-store
16003 Split 32-byte AVX unaligned load and store.
16005 @item -mstack-protector-guard=@var{guard}
16006 @opindex mstack-protector-guard=@var{guard}
16007 Generate stack protection code using canary at @var{guard}.  Supported
16008 locations are @samp{global} for global canary or @samp{tls} for per-thread
16009 canary in the TLS block (the default).  This option has effect only when
16010 @option{-fstack-protector} or @option{-fstack-protector-all} is specified.
16012 @end table
16014 These @samp{-m} switches are supported in addition to the above
16015 on x86-64 processors in 64-bit environments.
16017 @table @gcctabopt
16018 @item -m32
16019 @itemx -m64
16020 @itemx -mx32
16021 @itemx -m16
16022 @opindex m32
16023 @opindex m64
16024 @opindex mx32
16025 @opindex m16
16026 Generate code for a 16-bit, 32-bit or 64-bit environment.
16027 The @option{-m32} option sets @code{int}, @code{long}, and pointer types
16028 to 32 bits, and
16029 generates code that runs on any i386 system.
16031 The @option{-m64} option sets @code{int} to 32 bits and @code{long} and pointer
16032 types to 64 bits, and generates code for the x86-64 architecture.
16033 For Darwin only the @option{-m64} option also turns off the @option{-fno-pic}
16034 and @option{-mdynamic-no-pic} options.
16036 The @option{-mx32} option sets @code{int}, @code{long}, and pointer types
16037 to 32 bits, and
16038 generates code for the x86-64 architecture.
16040 The @option{-m16} option is the same as @option{-m32}, except for that
16041 it outputs the @code{.code16gcc} assembly directive at the beginning of
16042 the assembly output so that the binary can run in 16-bit mode.
16044 @item -mno-red-zone
16045 @opindex mno-red-zone
16046 Do not use a so-called ``red zone'' for x86-64 code.  The red zone is mandated
16047 by the x86-64 ABI; it is a 128-byte area beyond the location of the
16048 stack pointer that is not modified by signal or interrupt handlers
16049 and therefore can be used for temporary data without adjusting the stack
16050 pointer.  The flag @option{-mno-red-zone} disables this red zone.
16052 @item -mcmodel=small
16053 @opindex mcmodel=small
16054 Generate code for the small code model: the program and its symbols must
16055 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
16056 Programs can be statically or dynamically linked.  This is the default
16057 code model.
16059 @item -mcmodel=kernel
16060 @opindex mcmodel=kernel
16061 Generate code for the kernel code model.  The kernel runs in the
16062 negative 2 GB of the address space.
16063 This model has to be used for Linux kernel code.
16065 @item -mcmodel=medium
16066 @opindex mcmodel=medium
16067 Generate code for the medium model: the program is linked in the lower 2
16068 GB of the address space.  Small symbols are also placed there.  Symbols
16069 with sizes larger than @option{-mlarge-data-threshold} are put into
16070 large data or BSS sections and can be located above 2GB.  Programs can
16071 be statically or dynamically linked.
16073 @item -mcmodel=large
16074 @opindex mcmodel=large
16075 Generate code for the large model.  This model makes no assumptions
16076 about addresses and sizes of sections.
16078 @item -maddress-mode=long
16079 @opindex maddress-mode=long
16080 Generate code for long address mode.  This is only supported for 64-bit
16081 and x32 environments.  It is the default address mode for 64-bit
16082 environments.
16084 @item -maddress-mode=short
16085 @opindex maddress-mode=short
16086 Generate code for short address mode.  This is only supported for 32-bit
16087 and x32 environments.  It is the default address mode for 32-bit and
16088 x32 environments.
16089 @end table
16091 @node i386 and x86-64 Windows Options
16092 @subsection i386 and x86-64 Windows Options
16093 @cindex i386 and x86-64 Windows Options
16095 These additional options are available for Microsoft Windows targets:
16097 @table @gcctabopt
16098 @item -mconsole
16099 @opindex mconsole
16100 This option
16101 specifies that a console application is to be generated, by
16102 instructing the linker to set the PE header subsystem type
16103 required for console applications.
16104 This option is available for Cygwin and MinGW targets and is
16105 enabled by default on those targets.
16107 @item -mdll
16108 @opindex mdll
16109 This option is available for Cygwin and MinGW targets.  It
16110 specifies that a DLL---a dynamic link library---is to be
16111 generated, enabling the selection of the required runtime
16112 startup object and entry point.
16114 @item -mnop-fun-dllimport
16115 @opindex mnop-fun-dllimport
16116 This option is available for Cygwin and MinGW targets.  It
16117 specifies that the @code{dllimport} attribute should be ignored.
16119 @item -mthread
16120 @opindex mthread
16121 This option is available for MinGW targets. It specifies
16122 that MinGW-specific thread support is to be used.
16124 @item -municode
16125 @opindex municode
16126 This option is available for MinGW-w64 targets.  It causes
16127 the @code{UNICODE} preprocessor macro to be predefined, and
16128 chooses Unicode-capable runtime startup code.
16130 @item -mwin32
16131 @opindex mwin32
16132 This option is available for Cygwin and MinGW targets.  It
16133 specifies that the typical Microsoft Windows predefined macros are to
16134 be set in the pre-processor, but does not influence the choice
16135 of runtime library/startup code.
16137 @item -mwindows
16138 @opindex mwindows
16139 This option is available for Cygwin and MinGW targets.  It
16140 specifies that a GUI application is to be generated by
16141 instructing the linker to set the PE header subsystem type
16142 appropriately.
16144 @item -fno-set-stack-executable
16145 @opindex fno-set-stack-executable
16146 This option is available for MinGW targets. It specifies that
16147 the executable flag for the stack used by nested functions isn't
16148 set. This is necessary for binaries running in kernel mode of
16149 Microsoft Windows, as there the User32 API, which is used to set executable
16150 privileges, isn't available.
16152 @item -fwritable-relocated-rdata
16153 @opindex fno-writable-relocated-rdata
16154 This option is available for MinGW and Cygwin targets.  It specifies
16155 that relocated-data in read-only section is put into .data
16156 section.  This is a necessary for older runtimes not supporting
16157 modification of .rdata sections for pseudo-relocation.
16159 @item -mpe-aligned-commons
16160 @opindex mpe-aligned-commons
16161 This option is available for Cygwin and MinGW targets.  It
16162 specifies that the GNU extension to the PE file format that
16163 permits the correct alignment of COMMON variables should be
16164 used when generating code.  It is enabled by default if
16165 GCC detects that the target assembler found during configuration
16166 supports the feature.
16167 @end table
16169 See also under @ref{i386 and x86-64 Options} for standard options.
16171 @node IA-64 Options
16172 @subsection IA-64 Options
16173 @cindex IA-64 Options
16175 These are the @samp{-m} options defined for the Intel IA-64 architecture.
16177 @table @gcctabopt
16178 @item -mbig-endian
16179 @opindex mbig-endian
16180 Generate code for a big-endian target.  This is the default for HP-UX@.
16182 @item -mlittle-endian
16183 @opindex mlittle-endian
16184 Generate code for a little-endian target.  This is the default for AIX5
16185 and GNU/Linux.
16187 @item -mgnu-as
16188 @itemx -mno-gnu-as
16189 @opindex mgnu-as
16190 @opindex mno-gnu-as
16191 Generate (or don't) code for the GNU assembler.  This is the default.
16192 @c Also, this is the default if the configure option @option{--with-gnu-as}
16193 @c is used.
16195 @item -mgnu-ld
16196 @itemx -mno-gnu-ld
16197 @opindex mgnu-ld
16198 @opindex mno-gnu-ld
16199 Generate (or don't) code for the GNU linker.  This is the default.
16200 @c Also, this is the default if the configure option @option{--with-gnu-ld}
16201 @c is used.
16203 @item -mno-pic
16204 @opindex mno-pic
16205 Generate code that does not use a global pointer register.  The result
16206 is not position independent code, and violates the IA-64 ABI@.
16208 @item -mvolatile-asm-stop
16209 @itemx -mno-volatile-asm-stop
16210 @opindex mvolatile-asm-stop
16211 @opindex mno-volatile-asm-stop
16212 Generate (or don't) a stop bit immediately before and after volatile asm
16213 statements.
16215 @item -mregister-names
16216 @itemx -mno-register-names
16217 @opindex mregister-names
16218 @opindex mno-register-names
16219 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
16220 the stacked registers.  This may make assembler output more readable.
16222 @item -mno-sdata
16223 @itemx -msdata
16224 @opindex mno-sdata
16225 @opindex msdata
16226 Disable (or enable) optimizations that use the small data section.  This may
16227 be useful for working around optimizer bugs.
16229 @item -mconstant-gp
16230 @opindex mconstant-gp
16231 Generate code that uses a single constant global pointer value.  This is
16232 useful when compiling kernel code.
16234 @item -mauto-pic
16235 @opindex mauto-pic
16236 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
16237 This is useful when compiling firmware code.
16239 @item -minline-float-divide-min-latency
16240 @opindex minline-float-divide-min-latency
16241 Generate code for inline divides of floating-point values
16242 using the minimum latency algorithm.
16244 @item -minline-float-divide-max-throughput
16245 @opindex minline-float-divide-max-throughput
16246 Generate code for inline divides of floating-point values
16247 using the maximum throughput algorithm.
16249 @item -mno-inline-float-divide
16250 @opindex mno-inline-float-divide
16251 Do not generate inline code for divides of floating-point values.
16253 @item -minline-int-divide-min-latency
16254 @opindex minline-int-divide-min-latency
16255 Generate code for inline divides of integer values
16256 using the minimum latency algorithm.
16258 @item -minline-int-divide-max-throughput
16259 @opindex minline-int-divide-max-throughput
16260 Generate code for inline divides of integer values
16261 using the maximum throughput algorithm.
16263 @item -mno-inline-int-divide
16264 @opindex mno-inline-int-divide
16265 Do not generate inline code for divides of integer values.
16267 @item -minline-sqrt-min-latency
16268 @opindex minline-sqrt-min-latency
16269 Generate code for inline square roots
16270 using the minimum latency algorithm.
16272 @item -minline-sqrt-max-throughput
16273 @opindex minline-sqrt-max-throughput
16274 Generate code for inline square roots
16275 using the maximum throughput algorithm.
16277 @item -mno-inline-sqrt
16278 @opindex mno-inline-sqrt
16279 Do not generate inline code for @code{sqrt}.
16281 @item -mfused-madd
16282 @itemx -mno-fused-madd
16283 @opindex mfused-madd
16284 @opindex mno-fused-madd
16285 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
16286 instructions.  The default is to use these instructions.
16288 @item -mno-dwarf2-asm
16289 @itemx -mdwarf2-asm
16290 @opindex mno-dwarf2-asm
16291 @opindex mdwarf2-asm
16292 Don't (or do) generate assembler code for the DWARF 2 line number debugging
16293 info.  This may be useful when not using the GNU assembler.
16295 @item -mearly-stop-bits
16296 @itemx -mno-early-stop-bits
16297 @opindex mearly-stop-bits
16298 @opindex mno-early-stop-bits
16299 Allow stop bits to be placed earlier than immediately preceding the
16300 instruction that triggered the stop bit.  This can improve instruction
16301 scheduling, but does not always do so.
16303 @item -mfixed-range=@var{register-range}
16304 @opindex mfixed-range
16305 Generate code treating the given register range as fixed registers.
16306 A fixed register is one that the register allocator cannot use.  This is
16307 useful when compiling kernel code.  A register range is specified as
16308 two registers separated by a dash.  Multiple register ranges can be
16309 specified separated by a comma.
16311 @item -mtls-size=@var{tls-size}
16312 @opindex mtls-size
16313 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
16316 @item -mtune=@var{cpu-type}
16317 @opindex mtune
16318 Tune the instruction scheduling for a particular CPU, Valid values are
16319 @samp{itanium}, @samp{itanium1}, @samp{merced}, @samp{itanium2},
16320 and @samp{mckinley}.
16322 @item -milp32
16323 @itemx -mlp64
16324 @opindex milp32
16325 @opindex mlp64
16326 Generate code for a 32-bit or 64-bit environment.
16327 The 32-bit environment sets int, long and pointer to 32 bits.
16328 The 64-bit environment sets int to 32 bits and long and pointer
16329 to 64 bits.  These are HP-UX specific flags.
16331 @item -mno-sched-br-data-spec
16332 @itemx -msched-br-data-spec
16333 @opindex mno-sched-br-data-spec
16334 @opindex msched-br-data-spec
16335 (Dis/En)able data speculative scheduling before reload.
16336 This results in generation of @code{ld.a} instructions and
16337 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
16338 The default is 'disable'.
16340 @item -msched-ar-data-spec
16341 @itemx -mno-sched-ar-data-spec
16342 @opindex msched-ar-data-spec
16343 @opindex mno-sched-ar-data-spec
16344 (En/Dis)able data speculative scheduling after reload.
16345 This results in generation of @code{ld.a} instructions and
16346 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
16347 The default is 'enable'.
16349 @item -mno-sched-control-spec
16350 @itemx -msched-control-spec
16351 @opindex mno-sched-control-spec
16352 @opindex msched-control-spec
16353 (Dis/En)able control speculative scheduling.  This feature is
16354 available only during region scheduling (i.e.@: before reload).
16355 This results in generation of the @code{ld.s} instructions and
16356 the corresponding check instructions @code{chk.s}.
16357 The default is 'disable'.
16359 @item -msched-br-in-data-spec
16360 @itemx -mno-sched-br-in-data-spec
16361 @opindex msched-br-in-data-spec
16362 @opindex mno-sched-br-in-data-spec
16363 (En/Dis)able speculative scheduling of the instructions that
16364 are dependent on the data speculative loads before reload.
16365 This is effective only with @option{-msched-br-data-spec} enabled.
16366 The default is 'enable'.
16368 @item -msched-ar-in-data-spec
16369 @itemx -mno-sched-ar-in-data-spec
16370 @opindex msched-ar-in-data-spec
16371 @opindex mno-sched-ar-in-data-spec
16372 (En/Dis)able speculative scheduling of the instructions that
16373 are dependent on the data speculative loads after reload.
16374 This is effective only with @option{-msched-ar-data-spec} enabled.
16375 The default is 'enable'.
16377 @item -msched-in-control-spec
16378 @itemx -mno-sched-in-control-spec
16379 @opindex msched-in-control-spec
16380 @opindex mno-sched-in-control-spec
16381 (En/Dis)able speculative scheduling of the instructions that
16382 are dependent on the control speculative loads.
16383 This is effective only with @option{-msched-control-spec} enabled.
16384 The default is 'enable'.
16386 @item -mno-sched-prefer-non-data-spec-insns
16387 @itemx -msched-prefer-non-data-spec-insns
16388 @opindex mno-sched-prefer-non-data-spec-insns
16389 @opindex msched-prefer-non-data-spec-insns
16390 If enabled, data-speculative instructions are chosen for schedule
16391 only if there are no other choices at the moment.  This makes
16392 the use of the data speculation much more conservative.
16393 The default is 'disable'.
16395 @item -mno-sched-prefer-non-control-spec-insns
16396 @itemx -msched-prefer-non-control-spec-insns
16397 @opindex mno-sched-prefer-non-control-spec-insns
16398 @opindex msched-prefer-non-control-spec-insns
16399 If enabled, control-speculative instructions are chosen for schedule
16400 only if there are no other choices at the moment.  This makes
16401 the use of the control speculation much more conservative.
16402 The default is 'disable'.
16404 @item -mno-sched-count-spec-in-critical-path
16405 @itemx -msched-count-spec-in-critical-path
16406 @opindex mno-sched-count-spec-in-critical-path
16407 @opindex msched-count-spec-in-critical-path
16408 If enabled, speculative dependencies are considered during
16409 computation of the instructions priorities.  This makes the use of the
16410 speculation a bit more conservative.
16411 The default is 'disable'.
16413 @item -msched-spec-ldc
16414 @opindex msched-spec-ldc
16415 Use a simple data speculation check.  This option is on by default.
16417 @item -msched-control-spec-ldc
16418 @opindex msched-spec-ldc
16419 Use a simple check for control speculation.  This option is on by default.
16421 @item -msched-stop-bits-after-every-cycle
16422 @opindex msched-stop-bits-after-every-cycle
16423 Place a stop bit after every cycle when scheduling.  This option is on
16424 by default.
16426 @item -msched-fp-mem-deps-zero-cost
16427 @opindex msched-fp-mem-deps-zero-cost
16428 Assume that floating-point stores and loads are not likely to cause a conflict
16429 when placed into the same instruction group.  This option is disabled by
16430 default.
16432 @item -msel-sched-dont-check-control-spec
16433 @opindex msel-sched-dont-check-control-spec
16434 Generate checks for control speculation in selective scheduling.
16435 This flag is disabled by default.
16437 @item -msched-max-memory-insns=@var{max-insns}
16438 @opindex msched-max-memory-insns
16439 Limit on the number of memory insns per instruction group, giving lower
16440 priority to subsequent memory insns attempting to schedule in the same
16441 instruction group. Frequently useful to prevent cache bank conflicts.
16442 The default value is 1.
16444 @item -msched-max-memory-insns-hard-limit
16445 @opindex msched-max-memory-insns-hard-limit
16446 Makes the limit specified by @option{msched-max-memory-insns} a hard limit,
16447 disallowing more than that number in an instruction group.
16448 Otherwise, the limit is ``soft'', meaning that non-memory operations
16449 are preferred when the limit is reached, but memory operations may still
16450 be scheduled.
16452 @end table
16454 @node LM32 Options
16455 @subsection LM32 Options
16456 @cindex LM32 options
16458 These @option{-m} options are defined for the LatticeMico32 architecture:
16460 @table @gcctabopt
16461 @item -mbarrel-shift-enabled
16462 @opindex mbarrel-shift-enabled
16463 Enable barrel-shift instructions.
16465 @item -mdivide-enabled
16466 @opindex mdivide-enabled
16467 Enable divide and modulus instructions.
16469 @item -mmultiply-enabled
16470 @opindex multiply-enabled
16471 Enable multiply instructions.
16473 @item -msign-extend-enabled
16474 @opindex msign-extend-enabled
16475 Enable sign extend instructions.
16477 @item -muser-enabled
16478 @opindex muser-enabled
16479 Enable user-defined instructions.
16481 @end table
16483 @node M32C Options
16484 @subsection M32C Options
16485 @cindex M32C options
16487 @table @gcctabopt
16488 @item -mcpu=@var{name}
16489 @opindex mcpu=
16490 Select the CPU for which code is generated.  @var{name} may be one of
16491 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
16492 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
16493 the M32C/80 series.
16495 @item -msim
16496 @opindex msim
16497 Specifies that the program will be run on the simulator.  This causes
16498 an alternate runtime library to be linked in which supports, for
16499 example, file I/O@.  You must not use this option when generating
16500 programs that will run on real hardware; you must provide your own
16501 runtime library for whatever I/O functions are needed.
16503 @item -memregs=@var{number}
16504 @opindex memregs=
16505 Specifies the number of memory-based pseudo-registers GCC uses
16506 during code generation.  These pseudo-registers are used like real
16507 registers, so there is a tradeoff between GCC's ability to fit the
16508 code into available registers, and the performance penalty of using
16509 memory instead of registers.  Note that all modules in a program must
16510 be compiled with the same value for this option.  Because of that, you
16511 must not use this option with GCC's default runtime libraries.
16513 @end table
16515 @node M32R/D Options
16516 @subsection M32R/D Options
16517 @cindex M32R/D options
16519 These @option{-m} options are defined for Renesas M32R/D architectures:
16521 @table @gcctabopt
16522 @item -m32r2
16523 @opindex m32r2
16524 Generate code for the M32R/2@.
16526 @item -m32rx
16527 @opindex m32rx
16528 Generate code for the M32R/X@.
16530 @item -m32r
16531 @opindex m32r
16532 Generate code for the M32R@.  This is the default.
16534 @item -mmodel=small
16535 @opindex mmodel=small
16536 Assume all objects live in the lower 16MB of memory (so that their addresses
16537 can be loaded with the @code{ld24} instruction), and assume all subroutines
16538 are reachable with the @code{bl} instruction.
16539 This is the default.
16541 The addressability of a particular object can be set with the
16542 @code{model} attribute.
16544 @item -mmodel=medium
16545 @opindex mmodel=medium
16546 Assume objects may be anywhere in the 32-bit address space (the compiler
16547 generates @code{seth/add3} instructions to load their addresses), and
16548 assume all subroutines are reachable with the @code{bl} instruction.
16550 @item -mmodel=large
16551 @opindex mmodel=large
16552 Assume objects may be anywhere in the 32-bit address space (the compiler
16553 generates @code{seth/add3} instructions to load their addresses), and
16554 assume subroutines may not be reachable with the @code{bl} instruction
16555 (the compiler generates the much slower @code{seth/add3/jl}
16556 instruction sequence).
16558 @item -msdata=none
16559 @opindex msdata=none
16560 Disable use of the small data area.  Variables are put into
16561 one of @samp{.data}, @samp{.bss}, or @samp{.rodata} (unless the
16562 @code{section} attribute has been specified).
16563 This is the default.
16565 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
16566 Objects may be explicitly put in the small data area with the
16567 @code{section} attribute using one of these sections.
16569 @item -msdata=sdata
16570 @opindex msdata=sdata
16571 Put small global and static data in the small data area, but do not
16572 generate special code to reference them.
16574 @item -msdata=use
16575 @opindex msdata=use
16576 Put small global and static data in the small data area, and generate
16577 special instructions to reference them.
16579 @item -G @var{num}
16580 @opindex G
16581 @cindex smaller data references
16582 Put global and static objects less than or equal to @var{num} bytes
16583 into the small data or BSS sections instead of the normal data or BSS
16584 sections.  The default value of @var{num} is 8.
16585 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
16586 for this option to have any effect.
16588 All modules should be compiled with the same @option{-G @var{num}} value.
16589 Compiling with different values of @var{num} may or may not work; if it
16590 doesn't the linker gives an error message---incorrect code is not
16591 generated.
16593 @item -mdebug
16594 @opindex mdebug
16595 Makes the M32R-specific code in the compiler display some statistics
16596 that might help in debugging programs.
16598 @item -malign-loops
16599 @opindex malign-loops
16600 Align all loops to a 32-byte boundary.
16602 @item -mno-align-loops
16603 @opindex mno-align-loops
16604 Do not enforce a 32-byte alignment for loops.  This is the default.
16606 @item -missue-rate=@var{number}
16607 @opindex missue-rate=@var{number}
16608 Issue @var{number} instructions per cycle.  @var{number} can only be 1
16609 or 2.
16611 @item -mbranch-cost=@var{number}
16612 @opindex mbranch-cost=@var{number}
16613 @var{number} can only be 1 or 2.  If it is 1 then branches are
16614 preferred over conditional code, if it is 2, then the opposite applies.
16616 @item -mflush-trap=@var{number}
16617 @opindex mflush-trap=@var{number}
16618 Specifies the trap number to use to flush the cache.  The default is
16619 12.  Valid numbers are between 0 and 15 inclusive.
16621 @item -mno-flush-trap
16622 @opindex mno-flush-trap
16623 Specifies that the cache cannot be flushed by using a trap.
16625 @item -mflush-func=@var{name}
16626 @opindex mflush-func=@var{name}
16627 Specifies the name of the operating system function to call to flush
16628 the cache.  The default is @emph{_flush_cache}, but a function call
16629 is only used if a trap is not available.
16631 @item -mno-flush-func
16632 @opindex mno-flush-func
16633 Indicates that there is no OS function for flushing the cache.
16635 @end table
16637 @node M680x0 Options
16638 @subsection M680x0 Options
16639 @cindex M680x0 options
16641 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
16642 The default settings depend on which architecture was selected when
16643 the compiler was configured; the defaults for the most common choices
16644 are given below.
16646 @table @gcctabopt
16647 @item -march=@var{arch}
16648 @opindex march
16649 Generate code for a specific M680x0 or ColdFire instruction set
16650 architecture.  Permissible values of @var{arch} for M680x0
16651 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
16652 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
16653 architectures are selected according to Freescale's ISA classification
16654 and the permissible values are: @samp{isaa}, @samp{isaaplus},
16655 @samp{isab} and @samp{isac}.
16657 GCC defines a macro @samp{__mcf@var{arch}__} whenever it is generating
16658 code for a ColdFire target.  The @var{arch} in this macro is one of the
16659 @option{-march} arguments given above.
16661 When used together, @option{-march} and @option{-mtune} select code
16662 that runs on a family of similar processors but that is optimized
16663 for a particular microarchitecture.
16665 @item -mcpu=@var{cpu}
16666 @opindex mcpu
16667 Generate code for a specific M680x0 or ColdFire processor.
16668 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
16669 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
16670 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
16671 below, which also classifies the CPUs into families:
16673 @multitable @columnfractions 0.20 0.80
16674 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
16675 @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}
16676 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
16677 @item @samp{5206e} @tab @samp{5206e}
16678 @item @samp{5208} @tab @samp{5207} @samp{5208}
16679 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
16680 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
16681 @item @samp{5216} @tab @samp{5214} @samp{5216}
16682 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
16683 @item @samp{5225} @tab @samp{5224} @samp{5225}
16684 @item @samp{52259} @tab @samp{52252} @samp{52254} @samp{52255} @samp{52256} @samp{52258} @samp{52259}
16685 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
16686 @item @samp{5249} @tab @samp{5249}
16687 @item @samp{5250} @tab @samp{5250}
16688 @item @samp{5271} @tab @samp{5270} @samp{5271}
16689 @item @samp{5272} @tab @samp{5272}
16690 @item @samp{5275} @tab @samp{5274} @samp{5275}
16691 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
16692 @item @samp{53017} @tab @samp{53011} @samp{53012} @samp{53013} @samp{53014} @samp{53015} @samp{53016} @samp{53017}
16693 @item @samp{5307} @tab @samp{5307}
16694 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
16695 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
16696 @item @samp{5407} @tab @samp{5407}
16697 @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}
16698 @end multitable
16700 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
16701 @var{arch} is compatible with @var{cpu}.  Other combinations of
16702 @option{-mcpu} and @option{-march} are rejected.
16704 GCC defines the macro @samp{__mcf_cpu_@var{cpu}} when ColdFire target
16705 @var{cpu} is selected.  It also defines @samp{__mcf_family_@var{family}},
16706 where the value of @var{family} is given by the table above.
16708 @item -mtune=@var{tune}
16709 @opindex mtune
16710 Tune the code for a particular microarchitecture within the
16711 constraints set by @option{-march} and @option{-mcpu}.
16712 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
16713 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
16714 and @samp{cpu32}.  The ColdFire microarchitectures
16715 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
16717 You can also use @option{-mtune=68020-40} for code that needs
16718 to run relatively well on 68020, 68030 and 68040 targets.
16719 @option{-mtune=68020-60} is similar but includes 68060 targets
16720 as well.  These two options select the same tuning decisions as
16721 @option{-m68020-40} and @option{-m68020-60} respectively.
16723 GCC defines the macros @samp{__mc@var{arch}} and @samp{__mc@var{arch}__}
16724 when tuning for 680x0 architecture @var{arch}.  It also defines
16725 @samp{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
16726 option is used.  If GCC is tuning for a range of architectures,
16727 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
16728 it defines the macros for every architecture in the range.
16730 GCC also defines the macro @samp{__m@var{uarch}__} when tuning for
16731 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
16732 of the arguments given above.
16734 @item -m68000
16735 @itemx -mc68000
16736 @opindex m68000
16737 @opindex mc68000
16738 Generate output for a 68000.  This is the default
16739 when the compiler is configured for 68000-based systems.
16740 It is equivalent to @option{-march=68000}.
16742 Use this option for microcontrollers with a 68000 or EC000 core,
16743 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
16745 @item -m68010
16746 @opindex m68010
16747 Generate output for a 68010.  This is the default
16748 when the compiler is configured for 68010-based systems.
16749 It is equivalent to @option{-march=68010}.
16751 @item -m68020
16752 @itemx -mc68020
16753 @opindex m68020
16754 @opindex mc68020
16755 Generate output for a 68020.  This is the default
16756 when the compiler is configured for 68020-based systems.
16757 It is equivalent to @option{-march=68020}.
16759 @item -m68030
16760 @opindex m68030
16761 Generate output for a 68030.  This is the default when the compiler is
16762 configured for 68030-based systems.  It is equivalent to
16763 @option{-march=68030}.
16765 @item -m68040
16766 @opindex m68040
16767 Generate output for a 68040.  This is the default when the compiler is
16768 configured for 68040-based systems.  It is equivalent to
16769 @option{-march=68040}.
16771 This option inhibits the use of 68881/68882 instructions that have to be
16772 emulated by software on the 68040.  Use this option if your 68040 does not
16773 have code to emulate those instructions.
16775 @item -m68060
16776 @opindex m68060
16777 Generate output for a 68060.  This is the default when the compiler is
16778 configured for 68060-based systems.  It is equivalent to
16779 @option{-march=68060}.
16781 This option inhibits the use of 68020 and 68881/68882 instructions that
16782 have to be emulated by software on the 68060.  Use this option if your 68060
16783 does not have code to emulate those instructions.
16785 @item -mcpu32
16786 @opindex mcpu32
16787 Generate output for a CPU32.  This is the default
16788 when the compiler is configured for CPU32-based systems.
16789 It is equivalent to @option{-march=cpu32}.
16791 Use this option for microcontrollers with a
16792 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
16793 68336, 68340, 68341, 68349 and 68360.
16795 @item -m5200
16796 @opindex m5200
16797 Generate output for a 520X ColdFire CPU@.  This is the default
16798 when the compiler is configured for 520X-based systems.
16799 It is equivalent to @option{-mcpu=5206}, and is now deprecated
16800 in favor of that option.
16802 Use this option for microcontroller with a 5200 core, including
16803 the MCF5202, MCF5203, MCF5204 and MCF5206.
16805 @item -m5206e
16806 @opindex m5206e
16807 Generate output for a 5206e ColdFire CPU@.  The option is now
16808 deprecated in favor of the equivalent @option{-mcpu=5206e}.
16810 @item -m528x
16811 @opindex m528x
16812 Generate output for a member of the ColdFire 528X family.
16813 The option is now deprecated in favor of the equivalent
16814 @option{-mcpu=528x}.
16816 @item -m5307
16817 @opindex m5307
16818 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
16819 in favor of the equivalent @option{-mcpu=5307}.
16821 @item -m5407
16822 @opindex m5407
16823 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
16824 in favor of the equivalent @option{-mcpu=5407}.
16826 @item -mcfv4e
16827 @opindex mcfv4e
16828 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
16829 This includes use of hardware floating-point instructions.
16830 The option is equivalent to @option{-mcpu=547x}, and is now
16831 deprecated in favor of that option.
16833 @item -m68020-40
16834 @opindex m68020-40
16835 Generate output for a 68040, without using any of the new instructions.
16836 This results in code that can run relatively efficiently on either a
16837 68020/68881 or a 68030 or a 68040.  The generated code does use the
16838 68881 instructions that are emulated on the 68040.
16840 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
16842 @item -m68020-60
16843 @opindex m68020-60
16844 Generate output for a 68060, without using any of the new instructions.
16845 This results in code that can run relatively efficiently on either a
16846 68020/68881 or a 68030 or a 68040.  The generated code does use the
16847 68881 instructions that are emulated on the 68060.
16849 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
16851 @item -mhard-float
16852 @itemx -m68881
16853 @opindex mhard-float
16854 @opindex m68881
16855 Generate floating-point instructions.  This is the default for 68020
16856 and above, and for ColdFire devices that have an FPU@.  It defines the
16857 macro @samp{__HAVE_68881__} on M680x0 targets and @samp{__mcffpu__}
16858 on ColdFire targets.
16860 @item -msoft-float
16861 @opindex msoft-float
16862 Do not generate floating-point instructions; use library calls instead.
16863 This is the default for 68000, 68010, and 68832 targets.  It is also
16864 the default for ColdFire devices that have no FPU.
16866 @item -mdiv
16867 @itemx -mno-div
16868 @opindex mdiv
16869 @opindex mno-div
16870 Generate (do not generate) ColdFire hardware divide and remainder
16871 instructions.  If @option{-march} is used without @option{-mcpu},
16872 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
16873 architectures.  Otherwise, the default is taken from the target CPU
16874 (either the default CPU, or the one specified by @option{-mcpu}).  For
16875 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
16876 @option{-mcpu=5206e}.
16878 GCC defines the macro @samp{__mcfhwdiv__} when this option is enabled.
16880 @item -mshort
16881 @opindex mshort
16882 Consider type @code{int} to be 16 bits wide, like @code{short int}.
16883 Additionally, parameters passed on the stack are also aligned to a
16884 16-bit boundary even on targets whose API mandates promotion to 32-bit.
16886 @item -mno-short
16887 @opindex mno-short
16888 Do not consider type @code{int} to be 16 bits wide.  This is the default.
16890 @item -mnobitfield
16891 @itemx -mno-bitfield
16892 @opindex mnobitfield
16893 @opindex mno-bitfield
16894 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
16895 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
16897 @item -mbitfield
16898 @opindex mbitfield
16899 Do use the bit-field instructions.  The @option{-m68020} option implies
16900 @option{-mbitfield}.  This is the default if you use a configuration
16901 designed for a 68020.
16903 @item -mrtd
16904 @opindex mrtd
16905 Use a different function-calling convention, in which functions
16906 that take a fixed number of arguments return with the @code{rtd}
16907 instruction, which pops their arguments while returning.  This
16908 saves one instruction in the caller since there is no need to pop
16909 the arguments there.
16911 This calling convention is incompatible with the one normally
16912 used on Unix, so you cannot use it if you need to call libraries
16913 compiled with the Unix compiler.
16915 Also, you must provide function prototypes for all functions that
16916 take variable numbers of arguments (including @code{printf});
16917 otherwise incorrect code is generated for calls to those
16918 functions.
16920 In addition, seriously incorrect code results if you call a
16921 function with too many arguments.  (Normally, extra arguments are
16922 harmlessly ignored.)
16924 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
16925 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
16927 @item -mno-rtd
16928 @opindex mno-rtd
16929 Do not use the calling conventions selected by @option{-mrtd}.
16930 This is the default.
16932 @item -malign-int
16933 @itemx -mno-align-int
16934 @opindex malign-int
16935 @opindex mno-align-int
16936 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
16937 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
16938 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
16939 Aligning variables on 32-bit boundaries produces code that runs somewhat
16940 faster on processors with 32-bit busses at the expense of more memory.
16942 @strong{Warning:} if you use the @option{-malign-int} switch, GCC
16943 aligns structures containing the above types differently than
16944 most published application binary interface specifications for the m68k.
16946 @item -mpcrel
16947 @opindex mpcrel
16948 Use the pc-relative addressing mode of the 68000 directly, instead of
16949 using a global offset table.  At present, this option implies @option{-fpic},
16950 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
16951 not presently supported with @option{-mpcrel}, though this could be supported for
16952 68020 and higher processors.
16954 @item -mno-strict-align
16955 @itemx -mstrict-align
16956 @opindex mno-strict-align
16957 @opindex mstrict-align
16958 Do not (do) assume that unaligned memory references are handled by
16959 the system.
16961 @item -msep-data
16962 Generate code that allows the data segment to be located in a different
16963 area of memory from the text segment.  This allows for execute-in-place in
16964 an environment without virtual memory management.  This option implies
16965 @option{-fPIC}.
16967 @item -mno-sep-data
16968 Generate code that assumes that the data segment follows the text segment.
16969 This is the default.
16971 @item -mid-shared-library
16972 Generate code that supports shared libraries via the library ID method.
16973 This allows for execute-in-place and shared libraries in an environment
16974 without virtual memory management.  This option implies @option{-fPIC}.
16976 @item -mno-id-shared-library
16977 Generate code that doesn't assume ID-based shared libraries are being used.
16978 This is the default.
16980 @item -mshared-library-id=n
16981 Specifies the identification number of the ID-based shared library being
16982 compiled.  Specifying a value of 0 generates more compact code; specifying
16983 other values forces the allocation of that number to the current
16984 library, but is no more space- or time-efficient than omitting this option.
16986 @item -mxgot
16987 @itemx -mno-xgot
16988 @opindex mxgot
16989 @opindex mno-xgot
16990 When generating position-independent code for ColdFire, generate code
16991 that works if the GOT has more than 8192 entries.  This code is
16992 larger and slower than code generated without this option.  On M680x0
16993 processors, this option is not needed; @option{-fPIC} suffices.
16995 GCC normally uses a single instruction to load values from the GOT@.
16996 While this is relatively efficient, it only works if the GOT
16997 is smaller than about 64k.  Anything larger causes the linker
16998 to report an error such as:
17000 @cindex relocation truncated to fit (ColdFire)
17001 @smallexample
17002 relocation truncated to fit: R_68K_GOT16O foobar
17003 @end smallexample
17005 If this happens, you should recompile your code with @option{-mxgot}.
17006 It should then work with very large GOTs.  However, code generated with
17007 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
17008 the value of a global symbol.
17010 Note that some linkers, including newer versions of the GNU linker,
17011 can create multiple GOTs and sort GOT entries.  If you have such a linker,
17012 you should only need to use @option{-mxgot} when compiling a single
17013 object file that accesses more than 8192 GOT entries.  Very few do.
17015 These options have no effect unless GCC is generating
17016 position-independent code.
17018 @end table
17020 @node MCore Options
17021 @subsection MCore Options
17022 @cindex MCore options
17024 These are the @samp{-m} options defined for the Motorola M*Core
17025 processors.
17027 @table @gcctabopt
17029 @item -mhardlit
17030 @itemx -mno-hardlit
17031 @opindex mhardlit
17032 @opindex mno-hardlit
17033 Inline constants into the code stream if it can be done in two
17034 instructions or less.
17036 @item -mdiv
17037 @itemx -mno-div
17038 @opindex mdiv
17039 @opindex mno-div
17040 Use the divide instruction.  (Enabled by default).
17042 @item -mrelax-immediate
17043 @itemx -mno-relax-immediate
17044 @opindex mrelax-immediate
17045 @opindex mno-relax-immediate
17046 Allow arbitrary-sized immediates in bit operations.
17048 @item -mwide-bitfields
17049 @itemx -mno-wide-bitfields
17050 @opindex mwide-bitfields
17051 @opindex mno-wide-bitfields
17052 Always treat bit-fields as @code{int}-sized.
17054 @item -m4byte-functions
17055 @itemx -mno-4byte-functions
17056 @opindex m4byte-functions
17057 @opindex mno-4byte-functions
17058 Force all functions to be aligned to a 4-byte boundary.
17060 @item -mcallgraph-data
17061 @itemx -mno-callgraph-data
17062 @opindex mcallgraph-data
17063 @opindex mno-callgraph-data
17064 Emit callgraph information.
17066 @item -mslow-bytes
17067 @itemx -mno-slow-bytes
17068 @opindex mslow-bytes
17069 @opindex mno-slow-bytes
17070 Prefer word access when reading byte quantities.
17072 @item -mlittle-endian
17073 @itemx -mbig-endian
17074 @opindex mlittle-endian
17075 @opindex mbig-endian
17076 Generate code for a little-endian target.
17078 @item -m210
17079 @itemx -m340
17080 @opindex m210
17081 @opindex m340
17082 Generate code for the 210 processor.
17084 @item -mno-lsim
17085 @opindex mno-lsim
17086 Assume that runtime support has been provided and so omit the
17087 simulator library (@file{libsim.a)} from the linker command line.
17089 @item -mstack-increment=@var{size}
17090 @opindex mstack-increment
17091 Set the maximum amount for a single stack increment operation.  Large
17092 values can increase the speed of programs that contain functions
17093 that need a large amount of stack space, but they can also trigger a
17094 segmentation fault if the stack is extended too much.  The default
17095 value is 0x1000.
17097 @end table
17099 @node MeP Options
17100 @subsection MeP Options
17101 @cindex MeP options
17103 @table @gcctabopt
17105 @item -mabsdiff
17106 @opindex mabsdiff
17107 Enables the @code{abs} instruction, which is the absolute difference
17108 between two registers.
17110 @item -mall-opts
17111 @opindex mall-opts
17112 Enables all the optional instructions---average, multiply, divide, bit
17113 operations, leading zero, absolute difference, min/max, clip, and
17114 saturation.
17117 @item -maverage
17118 @opindex maverage
17119 Enables the @code{ave} instruction, which computes the average of two
17120 registers.
17122 @item -mbased=@var{n}
17123 @opindex mbased=
17124 Variables of size @var{n} bytes or smaller are placed in the
17125 @code{.based} section by default.  Based variables use the @code{$tp}
17126 register as a base register, and there is a 128-byte limit to the
17127 @code{.based} section.
17129 @item -mbitops
17130 @opindex mbitops
17131 Enables the bit operation instructions---bit test (@code{btstm}), set
17132 (@code{bsetm}), clear (@code{bclrm}), invert (@code{bnotm}), and
17133 test-and-set (@code{tas}).
17135 @item -mc=@var{name}
17136 @opindex mc=
17137 Selects which section constant data is placed in.  @var{name} may
17138 be @code{tiny}, @code{near}, or @code{far}.
17140 @item -mclip
17141 @opindex mclip
17142 Enables the @code{clip} instruction.  Note that @code{-mclip} is not
17143 useful unless you also provide @code{-mminmax}.
17145 @item -mconfig=@var{name}
17146 @opindex mconfig=
17147 Selects one of the built-in core configurations.  Each MeP chip has
17148 one or more modules in it; each module has a core CPU and a variety of
17149 coprocessors, optional instructions, and peripherals.  The
17150 @code{MeP-Integrator} tool, not part of GCC, provides these
17151 configurations through this option; using this option is the same as
17152 using all the corresponding command-line options.  The default
17153 configuration is @code{default}.
17155 @item -mcop
17156 @opindex mcop
17157 Enables the coprocessor instructions.  By default, this is a 32-bit
17158 coprocessor.  Note that the coprocessor is normally enabled via the
17159 @code{-mconfig=} option.
17161 @item -mcop32
17162 @opindex mcop32
17163 Enables the 32-bit coprocessor's instructions.
17165 @item -mcop64
17166 @opindex mcop64
17167 Enables the 64-bit coprocessor's instructions.
17169 @item -mivc2
17170 @opindex mivc2
17171 Enables IVC2 scheduling.  IVC2 is a 64-bit VLIW coprocessor.
17173 @item -mdc
17174 @opindex mdc
17175 Causes constant variables to be placed in the @code{.near} section.
17177 @item -mdiv
17178 @opindex mdiv
17179 Enables the @code{div} and @code{divu} instructions.
17181 @item -meb
17182 @opindex meb
17183 Generate big-endian code.
17185 @item -mel
17186 @opindex mel
17187 Generate little-endian code.
17189 @item -mio-volatile
17190 @opindex mio-volatile
17191 Tells the compiler that any variable marked with the @code{io}
17192 attribute is to be considered volatile.
17194 @item -ml
17195 @opindex ml
17196 Causes variables to be assigned to the @code{.far} section by default.
17198 @item -mleadz
17199 @opindex mleadz
17200 Enables the @code{leadz} (leading zero) instruction.
17202 @item -mm
17203 @opindex mm
17204 Causes variables to be assigned to the @code{.near} section by default.
17206 @item -mminmax
17207 @opindex mminmax
17208 Enables the @code{min} and @code{max} instructions.
17210 @item -mmult
17211 @opindex mmult
17212 Enables the multiplication and multiply-accumulate instructions.
17214 @item -mno-opts
17215 @opindex mno-opts
17216 Disables all the optional instructions enabled by @code{-mall-opts}.
17218 @item -mrepeat
17219 @opindex mrepeat
17220 Enables the @code{repeat} and @code{erepeat} instructions, used for
17221 low-overhead looping.
17223 @item -ms
17224 @opindex ms
17225 Causes all variables to default to the @code{.tiny} section.  Note
17226 that there is a 65536-byte limit to this section.  Accesses to these
17227 variables use the @code{%gp} base register.
17229 @item -msatur
17230 @opindex msatur
17231 Enables the saturation instructions.  Note that the compiler does not
17232 currently generate these itself, but this option is included for
17233 compatibility with other tools, like @code{as}.
17235 @item -msdram
17236 @opindex msdram
17237 Link the SDRAM-based runtime instead of the default ROM-based runtime.
17239 @item -msim
17240 @opindex msim
17241 Link the simulator run-time libraries.
17243 @item -msimnovec
17244 @opindex msimnovec
17245 Link the simulator runtime libraries, excluding built-in support
17246 for reset and exception vectors and tables.
17248 @item -mtf
17249 @opindex mtf
17250 Causes all functions to default to the @code{.far} section.  Without
17251 this option, functions default to the @code{.near} section.
17253 @item -mtiny=@var{n}
17254 @opindex mtiny=
17255 Variables that are @var{n} bytes or smaller are allocated to the
17256 @code{.tiny} section.  These variables use the @code{$gp} base
17257 register.  The default for this option is 4, but note that there's a
17258 65536-byte limit to the @code{.tiny} section.
17260 @end table
17262 @node MicroBlaze Options
17263 @subsection MicroBlaze Options
17264 @cindex MicroBlaze Options
17266 @table @gcctabopt
17268 @item -msoft-float
17269 @opindex msoft-float
17270 Use software emulation for floating point (default).
17272 @item -mhard-float
17273 @opindex mhard-float
17274 Use hardware floating-point instructions.
17276 @item -mmemcpy
17277 @opindex mmemcpy
17278 Do not optimize block moves, use @code{memcpy}.
17280 @item -mno-clearbss
17281 @opindex mno-clearbss
17282 This option is deprecated.  Use @option{-fno-zero-initialized-in-bss} instead.
17284 @item -mcpu=@var{cpu-type}
17285 @opindex mcpu=
17286 Use features of, and schedule code for, the given CPU.
17287 Supported values are in the format @samp{v@var{X}.@var{YY}.@var{Z}},
17288 where @var{X} is a major version, @var{YY} is the minor version, and
17289 @var{Z} is compatibility code.  Example values are @samp{v3.00.a},
17290 @samp{v4.00.b}, @samp{v5.00.a}, @samp{v5.00.b}, @samp{v5.00.b}, @samp{v6.00.a}.
17292 @item -mxl-soft-mul
17293 @opindex mxl-soft-mul
17294 Use software multiply emulation (default).
17296 @item -mxl-soft-div
17297 @opindex mxl-soft-div
17298 Use software emulation for divides (default).
17300 @item -mxl-barrel-shift
17301 @opindex mxl-barrel-shift
17302 Use the hardware barrel shifter.
17304 @item -mxl-pattern-compare
17305 @opindex mxl-pattern-compare
17306 Use pattern compare instructions.
17308 @item -msmall-divides
17309 @opindex msmall-divides
17310 Use table lookup optimization for small signed integer divisions.
17312 @item -mxl-stack-check
17313 @opindex mxl-stack-check
17314 This option is deprecated.  Use @option{-fstack-check} instead.
17316 @item -mxl-gp-opt
17317 @opindex mxl-gp-opt
17318 Use GP-relative @code{.sdata}/@code{.sbss} sections.
17320 @item -mxl-multiply-high
17321 @opindex mxl-multiply-high
17322 Use multiply high instructions for high part of 32x32 multiply.
17324 @item -mxl-float-convert
17325 @opindex mxl-float-convert
17326 Use hardware floating-point conversion instructions.
17328 @item -mxl-float-sqrt
17329 @opindex mxl-float-sqrt
17330 Use hardware floating-point square root instruction.
17332 @item -mbig-endian
17333 @opindex mbig-endian
17334 Generate code for a big-endian target.
17336 @item -mlittle-endian
17337 @opindex mlittle-endian
17338 Generate code for a little-endian target.
17340 @item -mxl-reorder
17341 @opindex mxl-reorder
17342 Use reorder instructions (swap and byte reversed load/store).
17344 @item -mxl-mode-@var{app-model}
17345 Select application model @var{app-model}.  Valid models are
17346 @table @samp
17347 @item executable
17348 normal executable (default), uses startup code @file{crt0.o}.
17350 @item xmdstub
17351 for use with Xilinx Microprocessor Debugger (XMD) based
17352 software intrusive debug agent called xmdstub. This uses startup file
17353 @file{crt1.o} and sets the start address of the program to 0x800.
17355 @item bootstrap
17356 for applications that are loaded using a bootloader.
17357 This model uses startup file @file{crt2.o} which does not contain a processor
17358 reset vector handler. This is suitable for transferring control on a
17359 processor reset to the bootloader rather than the application.
17361 @item novectors
17362 for applications that do not require any of the
17363 MicroBlaze vectors. This option may be useful for applications running
17364 within a monitoring application. This model uses @file{crt3.o} as a startup file.
17365 @end table
17367 Option @option{-xl-mode-@var{app-model}} is a deprecated alias for
17368 @option{-mxl-mode-@var{app-model}}.
17370 @end table
17372 @node MIPS Options
17373 @subsection MIPS Options
17374 @cindex MIPS options
17376 @table @gcctabopt
17378 @item -EB
17379 @opindex EB
17380 Generate big-endian code.
17382 @item -EL
17383 @opindex EL
17384 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
17385 configurations.
17387 @item -march=@var{arch}
17388 @opindex march
17389 Generate code that runs on @var{arch}, which can be the name of a
17390 generic MIPS ISA, or the name of a particular processor.
17391 The ISA names are:
17392 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
17393 @samp{mips32}, @samp{mips32r2}, @samp{mips32r3}, @samp{mips32r5},
17394 @samp{mips32r6}, @samp{mips64}, @samp{mips64r2}, @samp{mips64r3},
17395 @samp{mips64r5} and @samp{mips64r6}.
17396 The processor names are:
17397 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
17398 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
17399 @samp{5kc}, @samp{5kf},
17400 @samp{20kc},
17401 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
17402 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
17403 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1}, @samp{34kn},
17404 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
17405 @samp{1004kc}, @samp{1004kf2_1}, @samp{1004kf1_1},
17406 @samp{loongson2e}, @samp{loongson2f}, @samp{loongson3a},
17407 @samp{m4k},
17408 @samp{m14k}, @samp{m14kc}, @samp{m14ke}, @samp{m14kec},
17409 @samp{octeon}, @samp{octeon+}, @samp{octeon2}, @samp{octeon3},
17410 @samp{orion},
17411 @samp{p5600},
17412 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
17413 @samp{r4600}, @samp{r4650}, @samp{r4700}, @samp{r6000}, @samp{r8000},
17414 @samp{rm7000}, @samp{rm9000},
17415 @samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
17416 @samp{sb1},
17417 @samp{sr71000},
17418 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
17419 @samp{vr5000}, @samp{vr5400}, @samp{vr5500},
17420 @samp{xlr} and @samp{xlp}.
17421 The special value @samp{from-abi} selects the
17422 most compatible architecture for the selected ABI (that is,
17423 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
17425 The native Linux/GNU toolchain also supports the value @samp{native},
17426 which selects the best architecture option for the host processor.
17427 @option{-march=native} has no effect if GCC does not recognize
17428 the processor.
17430 In processor names, a final @samp{000} can be abbreviated as @samp{k}
17431 (for example, @option{-march=r2k}).  Prefixes are optional, and
17432 @samp{vr} may be written @samp{r}.
17434 Names of the form @samp{@var{n}f2_1} refer to processors with
17435 FPUs clocked at half the rate of the core, names of the form
17436 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
17437 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
17438 processors with FPUs clocked a ratio of 3:2 with respect to the core.
17439 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
17440 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
17441 accepted as synonyms for @samp{@var{n}f1_1}.
17443 GCC defines two macros based on the value of this option.  The first
17444 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
17445 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
17446 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
17447 For example, @option{-march=r2000} sets @samp{_MIPS_ARCH}
17448 to @samp{"r2000"} and defines the macro @samp{_MIPS_ARCH_R2000}.
17450 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
17451 above.  In other words, it has the full prefix and does not
17452 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
17453 the macro names the resolved architecture (either @samp{"mips1"} or
17454 @samp{"mips3"}).  It names the default architecture when no
17455 @option{-march} option is given.
17457 @item -mtune=@var{arch}
17458 @opindex mtune
17459 Optimize for @var{arch}.  Among other things, this option controls
17460 the way instructions are scheduled, and the perceived cost of arithmetic
17461 operations.  The list of @var{arch} values is the same as for
17462 @option{-march}.
17464 When this option is not used, GCC optimizes for the processor
17465 specified by @option{-march}.  By using @option{-march} and
17466 @option{-mtune} together, it is possible to generate code that
17467 runs on a family of processors, but optimize the code for one
17468 particular member of that family.
17470 @option{-mtune} defines the macros @samp{_MIPS_TUNE} and
17471 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
17472 @option{-march} ones described above.
17474 @item -mips1
17475 @opindex mips1
17476 Equivalent to @option{-march=mips1}.
17478 @item -mips2
17479 @opindex mips2
17480 Equivalent to @option{-march=mips2}.
17482 @item -mips3
17483 @opindex mips3
17484 Equivalent to @option{-march=mips3}.
17486 @item -mips4
17487 @opindex mips4
17488 Equivalent to @option{-march=mips4}.
17490 @item -mips32
17491 @opindex mips32
17492 Equivalent to @option{-march=mips32}.
17494 @item -mips32r3
17495 @opindex mips32r3
17496 Equivalent to @option{-march=mips32r3}.
17498 @item -mips32r5
17499 @opindex mips32r5
17500 Equivalent to @option{-march=mips32r5}.
17502 @item -mips32r6
17503 @opindex mips32r6
17504 Equivalent to @option{-march=mips32r6}.
17506 @item -mips64
17507 @opindex mips64
17508 Equivalent to @option{-march=mips64}.
17510 @item -mips64r2
17511 @opindex mips64r2
17512 Equivalent to @option{-march=mips64r2}.
17514 @item -mips64r3
17515 @opindex mips64r3
17516 Equivalent to @option{-march=mips64r3}.
17518 @item -mips64r5
17519 @opindex mips64r5
17520 Equivalent to @option{-march=mips64r5}.
17522 @item -mips64r6
17523 @opindex mips64r6
17524 Equivalent to @option{-march=mips64r6}.
17526 @item -mips16
17527 @itemx -mno-mips16
17528 @opindex mips16
17529 @opindex mno-mips16
17530 Generate (do not generate) MIPS16 code.  If GCC is targeting a
17531 MIPS32 or MIPS64 architecture, it makes use of the MIPS16e ASE@.
17533 MIPS16 code generation can also be controlled on a per-function basis
17534 by means of @code{mips16} and @code{nomips16} attributes.
17535 @xref{Function Attributes}, for more information.
17537 @item -mflip-mips16
17538 @opindex mflip-mips16
17539 Generate MIPS16 code on alternating functions.  This option is provided
17540 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
17541 not intended for ordinary use in compiling user code.
17543 @item -minterlink-compressed
17544 @item -mno-interlink-compressed
17545 @opindex minterlink-compressed
17546 @opindex mno-interlink-compressed
17547 Require (do not require) that code using the standard (uncompressed) MIPS ISA
17548 be link-compatible with MIPS16 and microMIPS code, and vice versa.
17550 For example, code using the standard ISA encoding cannot jump directly
17551 to MIPS16 or microMIPS code; it must either use a call or an indirect jump.
17552 @option{-minterlink-compressed} therefore disables direct jumps unless GCC
17553 knows that the target of the jump is not compressed.
17555 @item -minterlink-mips16
17556 @itemx -mno-interlink-mips16
17557 @opindex minterlink-mips16
17558 @opindex mno-interlink-mips16
17559 Aliases of @option{-minterlink-compressed} and
17560 @option{-mno-interlink-compressed}.  These options predate the microMIPS ASE
17561 and are retained for backwards compatibility.
17563 @item -mabi=32
17564 @itemx -mabi=o64
17565 @itemx -mabi=n32
17566 @itemx -mabi=64
17567 @itemx -mabi=eabi
17568 @opindex mabi=32
17569 @opindex mabi=o64
17570 @opindex mabi=n32
17571 @opindex mabi=64
17572 @opindex mabi=eabi
17573 Generate code for the given ABI@.
17575 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
17576 generates 64-bit code when you select a 64-bit architecture, but you
17577 can use @option{-mgp32} to get 32-bit code instead.
17579 For information about the O64 ABI, see
17580 @uref{http://gcc.gnu.org/@/projects/@/mipso64-abi.html}.
17582 GCC supports a variant of the o32 ABI in which floating-point registers
17583 are 64 rather than 32 bits wide.  You can select this combination with
17584 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @code{mthc1}
17585 and @code{mfhc1} instructions and is therefore only supported for
17586 MIPS32R2, MIPS32R3 and MIPS32R5 processors.
17588 The register assignments for arguments and return values remain the
17589 same, but each scalar value is passed in a single 64-bit register
17590 rather than a pair of 32-bit registers.  For example, scalar
17591 floating-point values are returned in @samp{$f0} only, not a
17592 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
17593 remains the same in that the even-numbered double-precision registers
17594 are saved.
17596 Two additional variants of the o32 ABI are supported to enable
17597 a transition from 32-bit to 64-bit registers.  These are FPXX
17598 (@option{-mfpxx}) and FP64A (@option{-mfp64} @option{-mno-odd-spreg}).
17599 The FPXX extension mandates that all code must execute correctly
17600 when run using 32-bit or 64-bit registers.  The code can be interlinked
17601 with either FP32 or FP64, but not both.
17602 The FP64A extension is similar to the FP64 extension but forbids the
17603 use of odd-numbered single-precision registers.  This can be used
17604 in conjunction with the @code{FRE} mode of FPUs in MIPS32R5
17605 processors and allows both FP32 and FP64A code to interlink and
17606 run in the same process without changing FPU modes.
17608 @item -mabicalls
17609 @itemx -mno-abicalls
17610 @opindex mabicalls
17611 @opindex mno-abicalls
17612 Generate (do not generate) code that is suitable for SVR4-style
17613 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
17614 systems.
17616 @item -mshared
17617 @itemx -mno-shared
17618 Generate (do not generate) code that is fully position-independent,
17619 and that can therefore be linked into shared libraries.  This option
17620 only affects @option{-mabicalls}.
17622 All @option{-mabicalls} code has traditionally been position-independent,
17623 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
17624 as an extension, the GNU toolchain allows executables to use absolute
17625 accesses for locally-binding symbols.  It can also use shorter GP
17626 initialization sequences and generate direct calls to locally-defined
17627 functions.  This mode is selected by @option{-mno-shared}.
17629 @option{-mno-shared} depends on binutils 2.16 or higher and generates
17630 objects that can only be linked by the GNU linker.  However, the option
17631 does not affect the ABI of the final executable; it only affects the ABI
17632 of relocatable objects.  Using @option{-mno-shared} generally makes
17633 executables both smaller and quicker.
17635 @option{-mshared} is the default.
17637 @item -mplt
17638 @itemx -mno-plt
17639 @opindex mplt
17640 @opindex mno-plt
17641 Assume (do not assume) that the static and dynamic linkers
17642 support PLTs and copy relocations.  This option only affects
17643 @option{-mno-shared -mabicalls}.  For the n64 ABI, this option
17644 has no effect without @option{-msym32}.
17646 You can make @option{-mplt} the default by configuring
17647 GCC with @option{--with-mips-plt}.  The default is
17648 @option{-mno-plt} otherwise.
17650 @item -mxgot
17651 @itemx -mno-xgot
17652 @opindex mxgot
17653 @opindex mno-xgot
17654 Lift (do not lift) the usual restrictions on the size of the global
17655 offset table.
17657 GCC normally uses a single instruction to load values from the GOT@.
17658 While this is relatively efficient, it only works if the GOT
17659 is smaller than about 64k.  Anything larger causes the linker
17660 to report an error such as:
17662 @cindex relocation truncated to fit (MIPS)
17663 @smallexample
17664 relocation truncated to fit: R_MIPS_GOT16 foobar
17665 @end smallexample
17667 If this happens, you should recompile your code with @option{-mxgot}.
17668 This works with very large GOTs, although the code is also
17669 less efficient, since it takes three instructions to fetch the
17670 value of a global symbol.
17672 Note that some linkers can create multiple GOTs.  If you have such a
17673 linker, you should only need to use @option{-mxgot} when a single object
17674 file accesses more than 64k's worth of GOT entries.  Very few do.
17676 These options have no effect unless GCC is generating position
17677 independent code.
17679 @item -mgp32
17680 @opindex mgp32
17681 Assume that general-purpose registers are 32 bits wide.
17683 @item -mgp64
17684 @opindex mgp64
17685 Assume that general-purpose registers are 64 bits wide.
17687 @item -mfp32
17688 @opindex mfp32
17689 Assume that floating-point registers are 32 bits wide.
17691 @item -mfp64
17692 @opindex mfp64
17693 Assume that floating-point registers are 64 bits wide.
17695 @item -mfpxx
17696 @opindex mfpxx
17697 Do not assume the width of floating-point registers.
17699 @item -mhard-float
17700 @opindex mhard-float
17701 Use floating-point coprocessor instructions.
17703 @item -msoft-float
17704 @opindex msoft-float
17705 Do not use floating-point coprocessor instructions.  Implement
17706 floating-point calculations using library calls instead.
17708 @item -mno-float
17709 @opindex mno-float
17710 Equivalent to @option{-msoft-float}, but additionally asserts that the
17711 program being compiled does not perform any floating-point operations.
17712 This option is presently supported only by some bare-metal MIPS
17713 configurations, where it may select a special set of libraries
17714 that lack all floating-point support (including, for example, the
17715 floating-point @code{printf} formats).  
17716 If code compiled with @code{-mno-float} accidentally contains
17717 floating-point operations, it is likely to suffer a link-time
17718 or run-time failure.
17720 @item -msingle-float
17721 @opindex msingle-float
17722 Assume that the floating-point coprocessor only supports single-precision
17723 operations.
17725 @item -mdouble-float
17726 @opindex mdouble-float
17727 Assume that the floating-point coprocessor supports double-precision
17728 operations.  This is the default.
17730 @item -modd-spreg
17731 @itemx -mno-odd-spreg
17732 @opindex modd-spreg
17733 @opindex mno-odd-spreg
17734 Enable the use of odd-numbered single-precision floating-point registers
17735 for the o32 ABI.  This is the default for processors that are known to
17736 support these registers.  When using the o32 FPXX ABI, @code{-mno-odd-spreg}
17737 is set by default.
17739 @item -mabs=2008
17740 @itemx -mabs=legacy
17741 @opindex mabs=2008
17742 @opindex mabs=legacy
17743 These options control the treatment of the special not-a-number (NaN)
17744 IEEE 754 floating-point data with the @code{abs.@i{fmt}} and
17745 @code{neg.@i{fmt}} machine instructions.
17747 By default or when the @option{-mabs=legacy} is used the legacy
17748 treatment is selected.  In this case these instructions are considered
17749 arithmetic and avoided where correct operation is required and the
17750 input operand might be a NaN.  A longer sequence of instructions that
17751 manipulate the sign bit of floating-point datum manually is used
17752 instead unless the @option{-ffinite-math-only} option has also been
17753 specified.
17755 The @option{-mabs=2008} option selects the IEEE 754-2008 treatment.  In
17756 this case these instructions are considered non-arithmetic and therefore
17757 operating correctly in all cases, including in particular where the
17758 input operand is a NaN.  These instructions are therefore always used
17759 for the respective operations.
17761 @item -mnan=2008
17762 @itemx -mnan=legacy
17763 @opindex mnan=2008
17764 @opindex mnan=legacy
17765 These options control the encoding of the special not-a-number (NaN)
17766 IEEE 754 floating-point data.
17768 The @option{-mnan=legacy} option selects the legacy encoding.  In this
17769 case quiet NaNs (qNaNs) are denoted by the first bit of their trailing
17770 significand field being 0, whereas signalling NaNs (sNaNs) are denoted
17771 by the first bit of their trailing significand field being 1.
17773 The @option{-mnan=2008} option selects the IEEE 754-2008 encoding.  In
17774 this case qNaNs are denoted by the first bit of their trailing
17775 significand field being 1, whereas sNaNs are denoted by the first bit of
17776 their trailing significand field being 0.
17778 The default is @option{-mnan=legacy} unless GCC has been configured with
17779 @option{--with-nan=2008}.
17781 @item -mllsc
17782 @itemx -mno-llsc
17783 @opindex mllsc
17784 @opindex mno-llsc
17785 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
17786 implement atomic memory built-in functions.  When neither option is
17787 specified, GCC uses the instructions if the target architecture
17788 supports them.
17790 @option{-mllsc} is useful if the runtime environment can emulate the
17791 instructions and @option{-mno-llsc} can be useful when compiling for
17792 nonstandard ISAs.  You can make either option the default by
17793 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
17794 respectively.  @option{--with-llsc} is the default for some
17795 configurations; see the installation documentation for details.
17797 @item -mdsp
17798 @itemx -mno-dsp
17799 @opindex mdsp
17800 @opindex mno-dsp
17801 Use (do not use) revision 1 of the MIPS DSP ASE@.
17802 @xref{MIPS DSP Built-in Functions}.  This option defines the
17803 preprocessor macro @samp{__mips_dsp}.  It also defines
17804 @samp{__mips_dsp_rev} to 1.
17806 @item -mdspr2
17807 @itemx -mno-dspr2
17808 @opindex mdspr2
17809 @opindex mno-dspr2
17810 Use (do not use) revision 2 of the MIPS DSP ASE@.
17811 @xref{MIPS DSP Built-in Functions}.  This option defines the
17812 preprocessor macros @samp{__mips_dsp} and @samp{__mips_dspr2}.
17813 It also defines @samp{__mips_dsp_rev} to 2.
17815 @item -msmartmips
17816 @itemx -mno-smartmips
17817 @opindex msmartmips
17818 @opindex mno-smartmips
17819 Use (do not use) the MIPS SmartMIPS ASE.
17821 @item -mpaired-single
17822 @itemx -mno-paired-single
17823 @opindex mpaired-single
17824 @opindex mno-paired-single
17825 Use (do not use) paired-single floating-point instructions.
17826 @xref{MIPS Paired-Single Support}.  This option requires
17827 hardware floating-point support to be enabled.
17829 @item -mdmx
17830 @itemx -mno-mdmx
17831 @opindex mdmx
17832 @opindex mno-mdmx
17833 Use (do not use) MIPS Digital Media Extension instructions.
17834 This option can only be used when generating 64-bit code and requires
17835 hardware floating-point support to be enabled.
17837 @item -mips3d
17838 @itemx -mno-mips3d
17839 @opindex mips3d
17840 @opindex mno-mips3d
17841 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
17842 The option @option{-mips3d} implies @option{-mpaired-single}.
17844 @item -mmicromips
17845 @itemx -mno-micromips
17846 @opindex mmicromips
17847 @opindex mno-mmicromips
17848 Generate (do not generate) microMIPS code.
17850 MicroMIPS code generation can also be controlled on a per-function basis
17851 by means of @code{micromips} and @code{nomicromips} attributes.
17852 @xref{Function Attributes}, for more information.
17854 @item -mmt
17855 @itemx -mno-mt
17856 @opindex mmt
17857 @opindex mno-mt
17858 Use (do not use) MT Multithreading instructions.
17860 @item -mmcu
17861 @itemx -mno-mcu
17862 @opindex mmcu
17863 @opindex mno-mcu
17864 Use (do not use) the MIPS MCU ASE instructions.
17866 @item -meva
17867 @itemx -mno-eva
17868 @opindex meva
17869 @opindex mno-eva
17870 Use (do not use) the MIPS Enhanced Virtual Addressing instructions.
17872 @item -mvirt
17873 @itemx -mno-virt
17874 @opindex mvirt
17875 @opindex mno-virt
17876 Use (do not use) the MIPS Virtualization Application Specific instructions.
17878 @item -mxpa
17879 @itemx -mno-xpa
17880 @opindex mxpa
17881 @opindex mno-xpa
17882 Use (do not use) the MIPS eXtended Physical Address (XPA) instructions.
17884 @item -mlong64
17885 @opindex mlong64
17886 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
17887 an explanation of the default and the way that the pointer size is
17888 determined.
17890 @item -mlong32
17891 @opindex mlong32
17892 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
17894 The default size of @code{int}s, @code{long}s and pointers depends on
17895 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
17896 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
17897 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
17898 or the same size as integer registers, whichever is smaller.
17900 @item -msym32
17901 @itemx -mno-sym32
17902 @opindex msym32
17903 @opindex mno-sym32
17904 Assume (do not assume) that all symbols have 32-bit values, regardless
17905 of the selected ABI@.  This option is useful in combination with
17906 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
17907 to generate shorter and faster references to symbolic addresses.
17909 @item -G @var{num}
17910 @opindex G
17911 Put definitions of externally-visible data in a small data section
17912 if that data is no bigger than @var{num} bytes.  GCC can then generate
17913 more efficient accesses to the data; see @option{-mgpopt} for details.
17915 The default @option{-G} option depends on the configuration.
17917 @item -mlocal-sdata
17918 @itemx -mno-local-sdata
17919 @opindex mlocal-sdata
17920 @opindex mno-local-sdata
17921 Extend (do not extend) the @option{-G} behavior to local data too,
17922 such as to static variables in C@.  @option{-mlocal-sdata} is the
17923 default for all configurations.
17925 If the linker complains that an application is using too much small data,
17926 you might want to try rebuilding the less performance-critical parts with
17927 @option{-mno-local-sdata}.  You might also want to build large
17928 libraries with @option{-mno-local-sdata}, so that the libraries leave
17929 more room for the main program.
17931 @item -mextern-sdata
17932 @itemx -mno-extern-sdata
17933 @opindex mextern-sdata
17934 @opindex mno-extern-sdata
17935 Assume (do not assume) that externally-defined data is in
17936 a small data section if the size of that data is within the @option{-G} limit.
17937 @option{-mextern-sdata} is the default for all configurations.
17939 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
17940 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
17941 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
17942 is placed in a small data section.  If @var{Var} is defined by another
17943 module, you must either compile that module with a high-enough
17944 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
17945 definition.  If @var{Var} is common, you must link the application
17946 with a high-enough @option{-G} setting.
17948 The easiest way of satisfying these restrictions is to compile
17949 and link every module with the same @option{-G} option.  However,
17950 you may wish to build a library that supports several different
17951 small data limits.  You can do this by compiling the library with
17952 the highest supported @option{-G} setting and additionally using
17953 @option{-mno-extern-sdata} to stop the library from making assumptions
17954 about externally-defined data.
17956 @item -mgpopt
17957 @itemx -mno-gpopt
17958 @opindex mgpopt
17959 @opindex mno-gpopt
17960 Use (do not use) GP-relative accesses for symbols that are known to be
17961 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
17962 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
17963 configurations.
17965 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
17966 might not hold the value of @code{_gp}.  For example, if the code is
17967 part of a library that might be used in a boot monitor, programs that
17968 call boot monitor routines pass an unknown value in @code{$gp}.
17969 (In such situations, the boot monitor itself is usually compiled
17970 with @option{-G0}.)
17972 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
17973 @option{-mno-extern-sdata}.
17975 @item -membedded-data
17976 @itemx -mno-embedded-data
17977 @opindex membedded-data
17978 @opindex mno-embedded-data
17979 Allocate variables to the read-only data section first if possible, then
17980 next in the small data section if possible, otherwise in data.  This gives
17981 slightly slower code than the default, but reduces the amount of RAM required
17982 when executing, and thus may be preferred for some embedded systems.
17984 @item -muninit-const-in-rodata
17985 @itemx -mno-uninit-const-in-rodata
17986 @opindex muninit-const-in-rodata
17987 @opindex mno-uninit-const-in-rodata
17988 Put uninitialized @code{const} variables in the read-only data section.
17989 This option is only meaningful in conjunction with @option{-membedded-data}.
17991 @item -mcode-readable=@var{setting}
17992 @opindex mcode-readable
17993 Specify whether GCC may generate code that reads from executable sections.
17994 There are three possible settings:
17996 @table @gcctabopt
17997 @item -mcode-readable=yes
17998 Instructions may freely access executable sections.  This is the
17999 default setting.
18001 @item -mcode-readable=pcrel
18002 MIPS16 PC-relative load instructions can access executable sections,
18003 but other instructions must not do so.  This option is useful on 4KSc
18004 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
18005 It is also useful on processors that can be configured to have a dual
18006 instruction/data SRAM interface and that, like the M4K, automatically
18007 redirect PC-relative loads to the instruction RAM.
18009 @item -mcode-readable=no
18010 Instructions must not access executable sections.  This option can be
18011 useful on targets that are configured to have a dual instruction/data
18012 SRAM interface but that (unlike the M4K) do not automatically redirect
18013 PC-relative loads to the instruction RAM.
18014 @end table
18016 @item -msplit-addresses
18017 @itemx -mno-split-addresses
18018 @opindex msplit-addresses
18019 @opindex mno-split-addresses
18020 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
18021 relocation operators.  This option has been superseded by
18022 @option{-mexplicit-relocs} but is retained for backwards compatibility.
18024 @item -mexplicit-relocs
18025 @itemx -mno-explicit-relocs
18026 @opindex mexplicit-relocs
18027 @opindex mno-explicit-relocs
18028 Use (do not use) assembler relocation operators when dealing with symbolic
18029 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
18030 is to use assembler macros instead.
18032 @option{-mexplicit-relocs} is the default if GCC was configured
18033 to use an assembler that supports relocation operators.
18035 @item -mcheck-zero-division
18036 @itemx -mno-check-zero-division
18037 @opindex mcheck-zero-division
18038 @opindex mno-check-zero-division
18039 Trap (do not trap) on integer division by zero.
18041 The default is @option{-mcheck-zero-division}.
18043 @item -mdivide-traps
18044 @itemx -mdivide-breaks
18045 @opindex mdivide-traps
18046 @opindex mdivide-breaks
18047 MIPS systems check for division by zero by generating either a
18048 conditional trap or a break instruction.  Using traps results in
18049 smaller code, but is only supported on MIPS II and later.  Also, some
18050 versions of the Linux kernel have a bug that prevents trap from
18051 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
18052 allow conditional traps on architectures that support them and
18053 @option{-mdivide-breaks} to force the use of breaks.
18055 The default is usually @option{-mdivide-traps}, but this can be
18056 overridden at configure time using @option{--with-divide=breaks}.
18057 Divide-by-zero checks can be completely disabled using
18058 @option{-mno-check-zero-division}.
18060 @item -mmemcpy
18061 @itemx -mno-memcpy
18062 @opindex mmemcpy
18063 @opindex mno-memcpy
18064 Force (do not force) the use of @code{memcpy()} for non-trivial block
18065 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
18066 most constant-sized copies.
18068 @item -mlong-calls
18069 @itemx -mno-long-calls
18070 @opindex mlong-calls
18071 @opindex mno-long-calls
18072 Disable (do not disable) use of the @code{jal} instruction.  Calling
18073 functions using @code{jal} is more efficient but requires the caller
18074 and callee to be in the same 256 megabyte segment.
18076 This option has no effect on abicalls code.  The default is
18077 @option{-mno-long-calls}.
18079 @item -mmad
18080 @itemx -mno-mad
18081 @opindex mmad
18082 @opindex mno-mad
18083 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
18084 instructions, as provided by the R4650 ISA@.
18086 @item -mimadd
18087 @itemx -mno-imadd
18088 @opindex mimadd
18089 @opindex mno-imadd
18090 Enable (disable) use of the @code{madd} and @code{msub} integer
18091 instructions.  The default is @option{-mimadd} on architectures
18092 that support @code{madd} and @code{msub} except for the 74k 
18093 architecture where it was found to generate slower code.
18095 @item -mfused-madd
18096 @itemx -mno-fused-madd
18097 @opindex mfused-madd
18098 @opindex mno-fused-madd
18099 Enable (disable) use of the floating-point multiply-accumulate
18100 instructions, when they are available.  The default is
18101 @option{-mfused-madd}.
18103 On the R8000 CPU when multiply-accumulate instructions are used,
18104 the intermediate product is calculated to infinite precision
18105 and is not subject to the FCSR Flush to Zero bit.  This may be
18106 undesirable in some circumstances.  On other processors the result
18107 is numerically identical to the equivalent computation using
18108 separate multiply, add, subtract and negate instructions.
18110 @item -nocpp
18111 @opindex nocpp
18112 Tell the MIPS assembler to not run its preprocessor over user
18113 assembler files (with a @samp{.s} suffix) when assembling them.
18115 @item -mfix-24k
18116 @item -mno-fix-24k
18117 @opindex mfix-24k
18118 @opindex mno-fix-24k
18119 Work around the 24K E48 (lost data on stores during refill) errata.
18120 The workarounds are implemented by the assembler rather than by GCC@.
18122 @item -mfix-r4000
18123 @itemx -mno-fix-r4000
18124 @opindex mfix-r4000
18125 @opindex mno-fix-r4000
18126 Work around certain R4000 CPU errata:
18127 @itemize @minus
18128 @item
18129 A double-word or a variable shift may give an incorrect result if executed
18130 immediately after starting an integer division.
18131 @item
18132 A double-word or a variable shift may give an incorrect result if executed
18133 while an integer multiplication is in progress.
18134 @item
18135 An integer division may give an incorrect result if started in a delay slot
18136 of a taken branch or a jump.
18137 @end itemize
18139 @item -mfix-r4400
18140 @itemx -mno-fix-r4400
18141 @opindex mfix-r4400
18142 @opindex mno-fix-r4400
18143 Work around certain R4400 CPU errata:
18144 @itemize @minus
18145 @item
18146 A double-word or a variable shift may give an incorrect result if executed
18147 immediately after starting an integer division.
18148 @end itemize
18150 @item -mfix-r10000
18151 @itemx -mno-fix-r10000
18152 @opindex mfix-r10000
18153 @opindex mno-fix-r10000
18154 Work around certain R10000 errata:
18155 @itemize @minus
18156 @item
18157 @code{ll}/@code{sc} sequences may not behave atomically on revisions
18158 prior to 3.0.  They may deadlock on revisions 2.6 and earlier.
18159 @end itemize
18161 This option can only be used if the target architecture supports
18162 branch-likely instructions.  @option{-mfix-r10000} is the default when
18163 @option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
18164 otherwise.
18166 @item -mfix-rm7000
18167 @itemx -mno-fix-rm7000
18168 @opindex mfix-rm7000
18169 Work around the RM7000 @code{dmult}/@code{dmultu} errata.  The
18170 workarounds are implemented by the assembler rather than by GCC@.
18172 @item -mfix-vr4120
18173 @itemx -mno-fix-vr4120
18174 @opindex mfix-vr4120
18175 Work around certain VR4120 errata:
18176 @itemize @minus
18177 @item
18178 @code{dmultu} does not always produce the correct result.
18179 @item
18180 @code{div} and @code{ddiv} do not always produce the correct result if one
18181 of the operands is negative.
18182 @end itemize
18183 The workarounds for the division errata rely on special functions in
18184 @file{libgcc.a}.  At present, these functions are only provided by
18185 the @code{mips64vr*-elf} configurations.
18187 Other VR4120 errata require a NOP to be inserted between certain pairs of
18188 instructions.  These errata are handled by the assembler, not by GCC itself.
18190 @item -mfix-vr4130
18191 @opindex mfix-vr4130
18192 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
18193 workarounds are implemented by the assembler rather than by GCC,
18194 although GCC avoids using @code{mflo} and @code{mfhi} if the
18195 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
18196 instructions are available instead.
18198 @item -mfix-sb1
18199 @itemx -mno-fix-sb1
18200 @opindex mfix-sb1
18201 Work around certain SB-1 CPU core errata.
18202 (This flag currently works around the SB-1 revision 2
18203 ``F1'' and ``F2'' floating-point errata.)
18205 @item -mr10k-cache-barrier=@var{setting}
18206 @opindex mr10k-cache-barrier
18207 Specify whether GCC should insert cache barriers to avoid the
18208 side-effects of speculation on R10K processors.
18210 In common with many processors, the R10K tries to predict the outcome
18211 of a conditional branch and speculatively executes instructions from
18212 the ``taken'' branch.  It later aborts these instructions if the
18213 predicted outcome is wrong.  However, on the R10K, even aborted
18214 instructions can have side effects.
18216 This problem only affects kernel stores and, depending on the system,
18217 kernel loads.  As an example, a speculatively-executed store may load
18218 the target memory into cache and mark the cache line as dirty, even if
18219 the store itself is later aborted.  If a DMA operation writes to the
18220 same area of memory before the ``dirty'' line is flushed, the cached
18221 data overwrites the DMA-ed data.  See the R10K processor manual
18222 for a full description, including other potential problems.
18224 One workaround is to insert cache barrier instructions before every memory
18225 access that might be speculatively executed and that might have side
18226 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
18227 controls GCC's implementation of this workaround.  It assumes that
18228 aborted accesses to any byte in the following regions does not have
18229 side effects:
18231 @enumerate
18232 @item
18233 the memory occupied by the current function's stack frame;
18235 @item
18236 the memory occupied by an incoming stack argument;
18238 @item
18239 the memory occupied by an object with a link-time-constant address.
18240 @end enumerate
18242 It is the kernel's responsibility to ensure that speculative
18243 accesses to these regions are indeed safe.
18245 If the input program contains a function declaration such as:
18247 @smallexample
18248 void foo (void);
18249 @end smallexample
18251 then the implementation of @code{foo} must allow @code{j foo} and
18252 @code{jal foo} to be executed speculatively.  GCC honors this
18253 restriction for functions it compiles itself.  It expects non-GCC
18254 functions (such as hand-written assembly code) to do the same.
18256 The option has three forms:
18258 @table @gcctabopt
18259 @item -mr10k-cache-barrier=load-store
18260 Insert a cache barrier before a load or store that might be
18261 speculatively executed and that might have side effects even
18262 if aborted.
18264 @item -mr10k-cache-barrier=store
18265 Insert a cache barrier before a store that might be speculatively
18266 executed and that might have side effects even if aborted.
18268 @item -mr10k-cache-barrier=none
18269 Disable the insertion of cache barriers.  This is the default setting.
18270 @end table
18272 @item -mflush-func=@var{func}
18273 @itemx -mno-flush-func
18274 @opindex mflush-func
18275 Specifies the function to call to flush the I and D caches, or to not
18276 call any such function.  If called, the function must take the same
18277 arguments as the common @code{_flush_func()}, that is, the address of the
18278 memory range for which the cache is being flushed, the size of the
18279 memory range, and the number 3 (to flush both caches).  The default
18280 depends on the target GCC was configured for, but commonly is either
18281 @samp{_flush_func} or @samp{__cpu_flush}.
18283 @item mbranch-cost=@var{num}
18284 @opindex mbranch-cost
18285 Set the cost of branches to roughly @var{num} ``simple'' instructions.
18286 This cost is only a heuristic and is not guaranteed to produce
18287 consistent results across releases.  A zero cost redundantly selects
18288 the default, which is based on the @option{-mtune} setting.
18290 @item -mbranch-likely
18291 @itemx -mno-branch-likely
18292 @opindex mbranch-likely
18293 @opindex mno-branch-likely
18294 Enable or disable use of Branch Likely instructions, regardless of the
18295 default for the selected architecture.  By default, Branch Likely
18296 instructions may be generated if they are supported by the selected
18297 architecture.  An exception is for the MIPS32 and MIPS64 architectures
18298 and processors that implement those architectures; for those, Branch
18299 Likely instructions are not be generated by default because the MIPS32
18300 and MIPS64 architectures specifically deprecate their use.
18302 @item -mfp-exceptions
18303 @itemx -mno-fp-exceptions
18304 @opindex mfp-exceptions
18305 Specifies whether FP exceptions are enabled.  This affects how
18306 FP instructions are scheduled for some processors.
18307 The default is that FP exceptions are
18308 enabled.
18310 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
18311 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
18312 FP pipe.
18314 @item -mvr4130-align
18315 @itemx -mno-vr4130-align
18316 @opindex mvr4130-align
18317 The VR4130 pipeline is two-way superscalar, but can only issue two
18318 instructions together if the first one is 8-byte aligned.  When this
18319 option is enabled, GCC aligns pairs of instructions that it
18320 thinks should execute in parallel.
18322 This option only has an effect when optimizing for the VR4130.
18323 It normally makes code faster, but at the expense of making it bigger.
18324 It is enabled by default at optimization level @option{-O3}.
18326 @item -msynci
18327 @itemx -mno-synci
18328 @opindex msynci
18329 Enable (disable) generation of @code{synci} instructions on
18330 architectures that support it.  The @code{synci} instructions (if
18331 enabled) are generated when @code{__builtin___clear_cache()} is
18332 compiled.
18334 This option defaults to @code{-mno-synci}, but the default can be
18335 overridden by configuring with @code{--with-synci}.
18337 When compiling code for single processor systems, it is generally safe
18338 to use @code{synci}.  However, on many multi-core (SMP) systems, it
18339 does not invalidate the instruction caches on all cores and may lead
18340 to undefined behavior.
18342 @item -mrelax-pic-calls
18343 @itemx -mno-relax-pic-calls
18344 @opindex mrelax-pic-calls
18345 Try to turn PIC calls that are normally dispatched via register
18346 @code{$25} into direct calls.  This is only possible if the linker can
18347 resolve the destination at link-time and if the destination is within
18348 range for a direct call.
18350 @option{-mrelax-pic-calls} is the default if GCC was configured to use
18351 an assembler and a linker that support the @code{.reloc} assembly
18352 directive and @code{-mexplicit-relocs} is in effect.  With
18353 @code{-mno-explicit-relocs}, this optimization can be performed by the
18354 assembler and the linker alone without help from the compiler.
18356 @item -mmcount-ra-address
18357 @itemx -mno-mcount-ra-address
18358 @opindex mmcount-ra-address
18359 @opindex mno-mcount-ra-address
18360 Emit (do not emit) code that allows @code{_mcount} to modify the
18361 calling function's return address.  When enabled, this option extends
18362 the usual @code{_mcount} interface with a new @var{ra-address}
18363 parameter, which has type @code{intptr_t *} and is passed in register
18364 @code{$12}.  @code{_mcount} can then modify the return address by
18365 doing both of the following:
18366 @itemize
18367 @item
18368 Returning the new address in register @code{$31}.
18369 @item
18370 Storing the new address in @code{*@var{ra-address}},
18371 if @var{ra-address} is nonnull.
18372 @end itemize
18374 The default is @option{-mno-mcount-ra-address}.
18376 @end table
18378 @node MMIX Options
18379 @subsection MMIX Options
18380 @cindex MMIX Options
18382 These options are defined for the MMIX:
18384 @table @gcctabopt
18385 @item -mlibfuncs
18386 @itemx -mno-libfuncs
18387 @opindex mlibfuncs
18388 @opindex mno-libfuncs
18389 Specify that intrinsic library functions are being compiled, passing all
18390 values in registers, no matter the size.
18392 @item -mepsilon
18393 @itemx -mno-epsilon
18394 @opindex mepsilon
18395 @opindex mno-epsilon
18396 Generate floating-point comparison instructions that compare with respect
18397 to the @code{rE} epsilon register.
18399 @item -mabi=mmixware
18400 @itemx -mabi=gnu
18401 @opindex mabi=mmixware
18402 @opindex mabi=gnu
18403 Generate code that passes function parameters and return values that (in
18404 the called function) are seen as registers @code{$0} and up, as opposed to
18405 the GNU ABI which uses global registers @code{$231} and up.
18407 @item -mzero-extend
18408 @itemx -mno-zero-extend
18409 @opindex mzero-extend
18410 @opindex mno-zero-extend
18411 When reading data from memory in sizes shorter than 64 bits, use (do not
18412 use) zero-extending load instructions by default, rather than
18413 sign-extending ones.
18415 @item -mknuthdiv
18416 @itemx -mno-knuthdiv
18417 @opindex mknuthdiv
18418 @opindex mno-knuthdiv
18419 Make the result of a division yielding a remainder have the same sign as
18420 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
18421 remainder follows the sign of the dividend.  Both methods are
18422 arithmetically valid, the latter being almost exclusively used.
18424 @item -mtoplevel-symbols
18425 @itemx -mno-toplevel-symbols
18426 @opindex mtoplevel-symbols
18427 @opindex mno-toplevel-symbols
18428 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
18429 code can be used with the @code{PREFIX} assembly directive.
18431 @item -melf
18432 @opindex melf
18433 Generate an executable in the ELF format, rather than the default
18434 @samp{mmo} format used by the @command{mmix} simulator.
18436 @item -mbranch-predict
18437 @itemx -mno-branch-predict
18438 @opindex mbranch-predict
18439 @opindex mno-branch-predict
18440 Use (do not use) the probable-branch instructions, when static branch
18441 prediction indicates a probable branch.
18443 @item -mbase-addresses
18444 @itemx -mno-base-addresses
18445 @opindex mbase-addresses
18446 @opindex mno-base-addresses
18447 Generate (do not generate) code that uses @emph{base addresses}.  Using a
18448 base address automatically generates a request (handled by the assembler
18449 and the linker) for a constant to be set up in a global register.  The
18450 register is used for one or more base address requests within the range 0
18451 to 255 from the value held in the register.  The generally leads to short
18452 and fast code, but the number of different data items that can be
18453 addressed is limited.  This means that a program that uses lots of static
18454 data may require @option{-mno-base-addresses}.
18456 @item -msingle-exit
18457 @itemx -mno-single-exit
18458 @opindex msingle-exit
18459 @opindex mno-single-exit
18460 Force (do not force) generated code to have a single exit point in each
18461 function.
18462 @end table
18464 @node MN10300 Options
18465 @subsection MN10300 Options
18466 @cindex MN10300 options
18468 These @option{-m} options are defined for Matsushita MN10300 architectures:
18470 @table @gcctabopt
18471 @item -mmult-bug
18472 @opindex mmult-bug
18473 Generate code to avoid bugs in the multiply instructions for the MN10300
18474 processors.  This is the default.
18476 @item -mno-mult-bug
18477 @opindex mno-mult-bug
18478 Do not generate code to avoid bugs in the multiply instructions for the
18479 MN10300 processors.
18481 @item -mam33
18482 @opindex mam33
18483 Generate code using features specific to the AM33 processor.
18485 @item -mno-am33
18486 @opindex mno-am33
18487 Do not generate code using features specific to the AM33 processor.  This
18488 is the default.
18490 @item -mam33-2
18491 @opindex mam33-2
18492 Generate code using features specific to the AM33/2.0 processor.
18494 @item -mam34
18495 @opindex mam34
18496 Generate code using features specific to the AM34 processor.
18498 @item -mtune=@var{cpu-type}
18499 @opindex mtune
18500 Use the timing characteristics of the indicated CPU type when
18501 scheduling instructions.  This does not change the targeted processor
18502 type.  The CPU type must be one of @samp{mn10300}, @samp{am33},
18503 @samp{am33-2} or @samp{am34}.
18505 @item -mreturn-pointer-on-d0
18506 @opindex mreturn-pointer-on-d0
18507 When generating a function that returns a pointer, return the pointer
18508 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
18509 only in @code{a0}, and attempts to call such functions without a prototype
18510 result in errors.  Note that this option is on by default; use
18511 @option{-mno-return-pointer-on-d0} to disable it.
18513 @item -mno-crt0
18514 @opindex mno-crt0
18515 Do not link in the C run-time initialization object file.
18517 @item -mrelax
18518 @opindex mrelax
18519 Indicate to the linker that it should perform a relaxation optimization pass
18520 to shorten branches, calls and absolute memory addresses.  This option only
18521 has an effect when used on the command line for the final link step.
18523 This option makes symbolic debugging impossible.
18525 @item -mliw
18526 @opindex mliw
18527 Allow the compiler to generate @emph{Long Instruction Word}
18528 instructions if the target is the @samp{AM33} or later.  This is the
18529 default.  This option defines the preprocessor macro @samp{__LIW__}.
18531 @item -mnoliw
18532 @opindex mnoliw
18533 Do not allow the compiler to generate @emph{Long Instruction Word}
18534 instructions.  This option defines the preprocessor macro
18535 @samp{__NO_LIW__}.
18537 @item -msetlb
18538 @opindex msetlb
18539 Allow the compiler to generate the @emph{SETLB} and @emph{Lcc}
18540 instructions if the target is the @samp{AM33} or later.  This is the
18541 default.  This option defines the preprocessor macro @samp{__SETLB__}.
18543 @item -mnosetlb
18544 @opindex mnosetlb
18545 Do not allow the compiler to generate @emph{SETLB} or @emph{Lcc}
18546 instructions.  This option defines the preprocessor macro
18547 @samp{__NO_SETLB__}.
18549 @end table
18551 @node Moxie Options
18552 @subsection Moxie Options
18553 @cindex Moxie Options
18555 @table @gcctabopt
18557 @item -meb
18558 @opindex meb
18559 Generate big-endian code.  This is the default for @samp{moxie-*-*}
18560 configurations.
18562 @item -mel
18563 @opindex mel
18564 Generate little-endian code.
18566 @item -mno-crt0
18567 @opindex mno-crt0
18568 Do not link in the C run-time initialization object file.
18570 @end table
18572 @node MSP430 Options
18573 @subsection MSP430 Options
18574 @cindex MSP430 Options
18576 These options are defined for the MSP430:
18578 @table @gcctabopt
18580 @item -masm-hex
18581 @opindex masm-hex
18582 Force assembly output to always use hex constants.  Normally such
18583 constants are signed decimals, but this option is available for
18584 testsuite and/or aesthetic purposes.
18586 @item -mmcu=
18587 @opindex mmcu=
18588 Select the MCU to target.  This is used to create a C preprocessor
18589 symbol based upon the MCU name, converted to upper case and pre- and
18590 post- fixed with @code{__}.  This in turn will be used by the
18591 @code{msp430.h} header file to select an MCU specific supplimentary
18592 header file.
18594 The option also sets the ISA to use.  If the MCU name is one that is
18595 known to only support the 430 ISA then that is selected, otherwise the
18596 430X ISA is selected.  A generic MCU name of @code{msp430} can also be
18597 used to select the 430 ISA.  Similarly the generic @code{msp430x} MCU
18598 name will select the 430X ISA.
18600 In addition an MCU specific linker script will be added to the linker
18601 command line.  The script's name is the name of the MCU with
18602 @code{.ld} appended.  Thus specifying @option{-mmcu=xxx} on the gcc
18603 command line will define the C preprocessor symbol @code{__XXX__} and
18604 cause the linker to search for a script called @file{xxx.ld}.
18606 This option is also passed on to the assembler.
18608 @item -mcpu=
18609 @opindex -mcpu=
18610 Specifies the ISA to use.  Accepted values are @code{msp430},
18611 @code{msp430x} and @code{msp430xv2}.  This option is deprecated.  The
18612 @option{-mmcu=} option should be used to select the ISA.
18614 @item -msim
18615 @opindex msim
18616 Link to the simulator runtime libraries and linker script.  Overrides
18617 any scripts that would be selected by the @option{-mmcu=} option.
18619 @item -mlarge
18620 @opindex mlarge
18621 Use large-model addressing (20-bit pointers, 32-bit @code{size_t}).
18623 @item -msmall
18624 @opindex msmall
18625 Use small-model addressing (16-bit pointers, 16-bit @code{size_t}).
18627 @item -mrelax
18628 @opindex mrelax
18629 This option is passed to the assembler and linker, and allows the
18630 linker to perform certain optimizations that cannot be done until
18631 the final link.
18633 @item mhwmult=
18634 @opindex mhwmult=
18635 Describes the type of hardware multiply supported by the target.
18636 Accepted values are @code{none} for no hardware multiply, @code{16bit}
18637 for the original 16-bit-only multiply supported by early MCUs.
18638 @code{32bit} for the 16/32-bit multiply supported by later MCUs and
18639 @code{f5series} for the 16/32-bit multiply supported by F5-series MCUs.
18640 A value of @code{auto} can also be given.  This tells GCC to deduce
18641 the hardware multiply support based upon the MCU name provided by the
18642 @option{-mmcu} option.  If no @option{-mmcu} option is specified then
18643 @code{32bit} hardware multiply support is assumed.  @code{auto} is the
18644 default setting.
18646 Hardware multiplies are normally performed by calling a library
18647 routine.  This saves space in the generated code.  When compiling at
18648 @code{-O3} or higher however the hardware multiplier is invoked
18649 inline.  This makes for bigger, but faster code.
18651 The hardware multiply routines disable interrupts whilst running and
18652 restore the previous interrupt state when they finish.  This makes
18653 them safe to use inside interrupt handlers as well as in normal code.
18655 @item -minrt
18656 @opindex minrt
18657 Enable the use of a minimum runtime environment - no static
18658 initializers or constructors.  This is intended for memory-constrained
18659 devices.  The compiler will include special symbols in some objects
18660 that tell the linker and runtime which code fragments are required.
18662 @end table
18664 @node NDS32 Options
18665 @subsection NDS32 Options
18666 @cindex NDS32 Options
18668 These options are defined for NDS32 implementations:
18670 @table @gcctabopt
18672 @item -mbig-endian
18673 @opindex mbig-endian
18674 Generate code in big-endian mode.
18676 @item -mlittle-endian
18677 @opindex mlittle-endian
18678 Generate code in little-endian mode.
18680 @item -mreduced-regs
18681 @opindex mreduced-regs
18682 Use reduced-set registers for register allocation.
18684 @item -mfull-regs
18685 @opindex mfull-regs
18686 Use full-set registers for register allocation.
18688 @item -mcmov
18689 @opindex mcmov
18690 Generate conditional move instructions.
18692 @item -mno-cmov
18693 @opindex mno-cmov
18694 Do not generate conditional move instructions.
18696 @item -mperf-ext
18697 @opindex mperf-ext
18698 Generate performance extension instructions.
18700 @item -mno-perf-ext
18701 @opindex mno-perf-ext
18702 Do not generate performance extension instructions.
18704 @item -mv3push
18705 @opindex mv3push
18706 Generate v3 push25/pop25 instructions.
18708 @item -mno-v3push
18709 @opindex mno-v3push
18710 Do not generate v3 push25/pop25 instructions.
18712 @item -m16-bit
18713 @opindex m16-bit
18714 Generate 16-bit instructions.
18716 @item -mno-16-bit
18717 @opindex mno-16-bit
18718 Do not generate 16-bit instructions.
18720 @item -mgp-direct
18721 @opindex mgp-direct
18722 Generate GP base instructions directly.
18724 @item -mno-gp-direct
18725 @opindex mno-gp-direct
18726 Do no generate GP base instructions directly.
18728 @item -misr-vector-size=@var{num}
18729 @opindex misr-vector-size
18730 Specify the size of each interrupt vector, which must be 4 or 16.
18732 @item -mcache-block-size=@var{num}
18733 @opindex mcache-block-size
18734 Specify the size of each cache block,
18735 which must be a power of 2 between 4 and 512.
18737 @item -march=@var{arch}
18738 @opindex march
18739 Specify the name of the target architecture.
18741 @item -mforce-fp-as-gp
18742 @opindex mforce-fp-as-gp
18743 Prevent $fp being allocated during register allocation so that compiler
18744 is able to force performing fp-as-gp optimization.
18746 @item -mforbid-fp-as-gp
18747 @opindex mforbid-fp-as-gp
18748 Forbid using $fp to access static and global variables.
18749 This option strictly forbids fp-as-gp optimization
18750 regardless of @option{-mforce-fp-as-gp}.
18752 @item -mex9
18753 @opindex mex9
18754 Use special directives to guide linker doing ex9 optimization.
18756 @item -mctor-dtor
18757 @opindex mctor-dtor
18758 Enable constructor/destructor feature.
18760 @item -mrelax
18761 @opindex mrelax
18762 Guide linker to relax instructions.
18764 @end table
18766 @node Nios II Options
18767 @subsection Nios II Options
18768 @cindex Nios II options
18769 @cindex Altera Nios II options
18771 These are the options defined for the Altera Nios II processor.
18773 @table @gcctabopt
18775 @item -G @var{num}
18776 @opindex G
18777 @cindex smaller data references
18778 Put global and static objects less than or equal to @var{num} bytes
18779 into the small data or BSS sections instead of the normal data or BSS
18780 sections.  The default value of @var{num} is 8.
18782 @item -mgpopt
18783 @itemx -mno-gpopt
18784 @opindex mgpopt
18785 @opindex mno-gpopt
18786 Generate (do not generate) GP-relative accesses for objects in the
18787 small data or BSS sections.  The default is @option{-mgpopt} except
18788 when @option{-fpic} or @option{-fPIC} is specified to generate
18789 position-independent code.  Note that the Nios II ABI does not permit
18790 GP-relative accesses from shared libraries.
18792 You may need to specify @option{-mno-gpopt} explicitly when building
18793 programs that include large amounts of small data, including large
18794 GOT data sections.  In this case, the 16-bit offset for GP-relative
18795 addressing may not be large enough to allow access to the entire 
18796 small data section.
18798 @item -mel
18799 @itemx -meb
18800 @opindex mel
18801 @opindex meb
18802 Generate little-endian (default) or big-endian (experimental) code,
18803 respectively.
18805 @item -mbypass-cache
18806 @itemx -mno-bypass-cache
18807 @opindex mno-bypass-cache
18808 @opindex mbypass-cache
18809 Force all load and store instructions to always bypass cache by 
18810 using I/O variants of the instructions. The default is not to
18811 bypass the cache.
18813 @item -mno-cache-volatile 
18814 @itemx -mcache-volatile       
18815 @opindex mcache-volatile 
18816 @opindex mno-cache-volatile
18817 Volatile memory access bypass the cache using the I/O variants of 
18818 the load and store instructions. The default is not to bypass the cache.
18820 @item -mno-fast-sw-div
18821 @itemx -mfast-sw-div
18822 @opindex mno-fast-sw-div
18823 @opindex mfast-sw-div
18824 Do not use table-based fast divide for small numbers. The default 
18825 is to use the fast divide at @option{-O3} and above.
18827 @item -mno-hw-mul
18828 @itemx -mhw-mul
18829 @itemx -mno-hw-mulx
18830 @itemx -mhw-mulx
18831 @itemx -mno-hw-div
18832 @itemx -mhw-div
18833 @opindex mno-hw-mul
18834 @opindex mhw-mul
18835 @opindex mno-hw-mulx
18836 @opindex mhw-mulx
18837 @opindex mno-hw-div
18838 @opindex mhw-div
18839 Enable or disable emitting @code{mul}, @code{mulx} and @code{div} family of 
18840 instructions by the compiler. The default is to emit @code{mul}
18841 and not emit @code{div} and @code{mulx}.
18843 @item -mcustom-@var{insn}=@var{N}
18844 @itemx -mno-custom-@var{insn}
18845 @opindex mcustom-@var{insn}
18846 @opindex mno-custom-@var{insn}
18847 Each @option{-mcustom-@var{insn}=@var{N}} option enables use of a
18848 custom instruction with encoding @var{N} when generating code that uses 
18849 @var{insn}.  For example, @code{-mcustom-fadds=253} generates custom
18850 instruction 253 for single-precision floating-point add operations instead
18851 of the default behavior of using a library call.
18853 The following values of @var{insn} are supported.  Except as otherwise
18854 noted, floating-point operations are expected to be implemented with
18855 normal IEEE 754 semantics and correspond directly to the C operators or the
18856 equivalent GCC built-in functions (@pxref{Other Builtins}).
18858 Single-precision floating point:
18859 @table @asis
18861 @item @samp{fadds}, @samp{fsubs}, @samp{fdivs}, @samp{fmuls}
18862 Binary arithmetic operations.
18864 @item @samp{fnegs}
18865 Unary negation.
18867 @item @samp{fabss}
18868 Unary absolute value.
18870 @item @samp{fcmpeqs}, @samp{fcmpges}, @samp{fcmpgts}, @samp{fcmples}, @samp{fcmplts}, @samp{fcmpnes}
18871 Comparison operations.
18873 @item @samp{fmins}, @samp{fmaxs}
18874 Floating-point minimum and maximum.  These instructions are only
18875 generated if @option{-ffinite-math-only} is specified.
18877 @item @samp{fsqrts}
18878 Unary square root operation.
18880 @item @samp{fcoss}, @samp{fsins}, @samp{ftans}, @samp{fatans}, @samp{fexps}, @samp{flogs}
18881 Floating-point trigonometric and exponential functions.  These instructions
18882 are only generated if @option{-funsafe-math-optimizations} is also specified.
18884 @end table
18886 Double-precision floating point:
18887 @table @asis
18889 @item @samp{faddd}, @samp{fsubd}, @samp{fdivd}, @samp{fmuld}
18890 Binary arithmetic operations.
18892 @item @samp{fnegd}
18893 Unary negation.
18895 @item @samp{fabsd}
18896 Unary absolute value.
18898 @item @samp{fcmpeqd}, @samp{fcmpged}, @samp{fcmpgtd}, @samp{fcmpled}, @samp{fcmpltd}, @samp{fcmpned}
18899 Comparison operations.
18901 @item @samp{fmind}, @samp{fmaxd}
18902 Double-precision minimum and maximum.  These instructions are only
18903 generated if @option{-ffinite-math-only} is specified.
18905 @item @samp{fsqrtd}
18906 Unary square root operation.
18908 @item @samp{fcosd}, @samp{fsind}, @samp{ftand}, @samp{fatand}, @samp{fexpd}, @samp{flogd}
18909 Double-precision trigonometric and exponential functions.  These instructions
18910 are only generated if @option{-funsafe-math-optimizations} is also specified.
18912 @end table
18914 Conversions:
18915 @table @asis
18916 @item @samp{fextsd}
18917 Conversion from single precision to double precision.
18919 @item @samp{ftruncds}
18920 Conversion from double precision to single precision.
18922 @item @samp{fixsi}, @samp{fixsu}, @samp{fixdi}, @samp{fixdu}
18923 Conversion from floating point to signed or unsigned integer types, with
18924 truncation towards zero.
18926 @item @samp{floatis}, @samp{floatus}, @samp{floatid}, @samp{floatud}
18927 Conversion from signed or unsigned integer types to floating-point types.
18929 @end table
18931 In addition, all of the following transfer instructions for internal
18932 registers X and Y must be provided to use any of the double-precision
18933 floating-point instructions.  Custom instructions taking two
18934 double-precision source operands expect the first operand in the
18935 64-bit register X.  The other operand (or only operand of a unary
18936 operation) is given to the custom arithmetic instruction with the
18937 least significant half in source register @var{src1} and the most
18938 significant half in @var{src2}.  A custom instruction that returns a
18939 double-precision result returns the most significant 32 bits in the
18940 destination register and the other half in 32-bit register Y.  
18941 GCC automatically generates the necessary code sequences to write
18942 register X and/or read register Y when double-precision floating-point
18943 instructions are used.
18945 @table @asis
18947 @item @samp{fwrx}
18948 Write @var{src1} into the least significant half of X and @var{src2} into
18949 the most significant half of X.
18951 @item @samp{fwry}
18952 Write @var{src1} into Y.
18954 @item @samp{frdxhi}, @samp{frdxlo}
18955 Read the most or least (respectively) significant half of X and store it in
18956 @var{dest}.
18958 @item @samp{frdy}
18959 Read the value of Y and store it into @var{dest}.
18960 @end table
18962 Note that you can gain more local control over generation of Nios II custom
18963 instructions by using the @code{target("custom-@var{insn}=@var{N}")}
18964 and @code{target("no-custom-@var{insn}")} function attributes
18965 (@pxref{Function Attributes})
18966 or pragmas (@pxref{Function Specific Option Pragmas}).
18968 @item -mcustom-fpu-cfg=@var{name}
18969 @opindex mcustom-fpu-cfg
18971 This option enables a predefined, named set of custom instruction encodings
18972 (see @option{-mcustom-@var{insn}} above).  
18973 Currently, the following sets are defined:
18975 @option{-mcustom-fpu-cfg=60-1} is equivalent to:
18976 @gccoptlist{-mcustom-fmuls=252 @gol
18977 -mcustom-fadds=253 @gol
18978 -mcustom-fsubs=254 @gol
18979 -fsingle-precision-constant}
18981 @option{-mcustom-fpu-cfg=60-2} is equivalent to:
18982 @gccoptlist{-mcustom-fmuls=252 @gol
18983 -mcustom-fadds=253 @gol
18984 -mcustom-fsubs=254 @gol
18985 -mcustom-fdivs=255 @gol
18986 -fsingle-precision-constant}
18988 @option{-mcustom-fpu-cfg=72-3} is equivalent to:
18989 @gccoptlist{-mcustom-floatus=243 @gol
18990 -mcustom-fixsi=244 @gol
18991 -mcustom-floatis=245 @gol
18992 -mcustom-fcmpgts=246 @gol
18993 -mcustom-fcmples=249 @gol
18994 -mcustom-fcmpeqs=250 @gol
18995 -mcustom-fcmpnes=251 @gol
18996 -mcustom-fmuls=252 @gol
18997 -mcustom-fadds=253 @gol
18998 -mcustom-fsubs=254 @gol
18999 -mcustom-fdivs=255 @gol
19000 -fsingle-precision-constant}
19002 Custom instruction assignments given by individual
19003 @option{-mcustom-@var{insn}=} options override those given by
19004 @option{-mcustom-fpu-cfg=}, regardless of the
19005 order of the options on the command line.
19007 Note that you can gain more local control over selection of a FPU
19008 configuration by using the @code{target("custom-fpu-cfg=@var{name}")}
19009 function attribute (@pxref{Function Attributes})
19010 or pragma (@pxref{Function Specific Option Pragmas}).
19012 @end table
19014 These additional @samp{-m} options are available for the Altera Nios II
19015 ELF (bare-metal) target:
19017 @table @gcctabopt
19019 @item -mhal
19020 @opindex mhal
19021 Link with HAL BSP.  This suppresses linking with the GCC-provided C runtime
19022 startup and termination code, and is typically used in conjunction with
19023 @option{-msys-crt0=} to specify the location of the alternate startup code
19024 provided by the HAL BSP.
19026 @item -msmallc
19027 @opindex msmallc
19028 Link with a limited version of the C library, @option{-lsmallc}, rather than
19029 Newlib.
19031 @item -msys-crt0=@var{startfile}
19032 @opindex msys-crt0
19033 @var{startfile} is the file name of the startfile (crt0) to use 
19034 when linking.  This option is only useful in conjunction with @option{-mhal}.
19036 @item -msys-lib=@var{systemlib}
19037 @opindex msys-lib
19038 @var{systemlib} is the library name of the library that provides
19039 low-level system calls required by the C library,
19040 e.g. @code{read} and @code{write}.
19041 This option is typically used to link with a library provided by a HAL BSP.
19043 @end table
19045 @node PDP-11 Options
19046 @subsection PDP-11 Options
19047 @cindex PDP-11 Options
19049 These options are defined for the PDP-11:
19051 @table @gcctabopt
19052 @item -mfpu
19053 @opindex mfpu
19054 Use hardware FPP floating point.  This is the default.  (FIS floating
19055 point on the PDP-11/40 is not supported.)
19057 @item -msoft-float
19058 @opindex msoft-float
19059 Do not use hardware floating point.
19061 @item -mac0
19062 @opindex mac0
19063 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
19065 @item -mno-ac0
19066 @opindex mno-ac0
19067 Return floating-point results in memory.  This is the default.
19069 @item -m40
19070 @opindex m40
19071 Generate code for a PDP-11/40.
19073 @item -m45
19074 @opindex m45
19075 Generate code for a PDP-11/45.  This is the default.
19077 @item -m10
19078 @opindex m10
19079 Generate code for a PDP-11/10.
19081 @item -mbcopy-builtin
19082 @opindex mbcopy-builtin
19083 Use inline @code{movmemhi} patterns for copying memory.  This is the
19084 default.
19086 @item -mbcopy
19087 @opindex mbcopy
19088 Do not use inline @code{movmemhi} patterns for copying memory.
19090 @item -mint16
19091 @itemx -mno-int32
19092 @opindex mint16
19093 @opindex mno-int32
19094 Use 16-bit @code{int}.  This is the default.
19096 @item -mint32
19097 @itemx -mno-int16
19098 @opindex mint32
19099 @opindex mno-int16
19100 Use 32-bit @code{int}.
19102 @item -mfloat64
19103 @itemx -mno-float32
19104 @opindex mfloat64
19105 @opindex mno-float32
19106 Use 64-bit @code{float}.  This is the default.
19108 @item -mfloat32
19109 @itemx -mno-float64
19110 @opindex mfloat32
19111 @opindex mno-float64
19112 Use 32-bit @code{float}.
19114 @item -mabshi
19115 @opindex mabshi
19116 Use @code{abshi2} pattern.  This is the default.
19118 @item -mno-abshi
19119 @opindex mno-abshi
19120 Do not use @code{abshi2} pattern.
19122 @item -mbranch-expensive
19123 @opindex mbranch-expensive
19124 Pretend that branches are expensive.  This is for experimenting with
19125 code generation only.
19127 @item -mbranch-cheap
19128 @opindex mbranch-cheap
19129 Do not pretend that branches are expensive.  This is the default.
19131 @item -munix-asm
19132 @opindex munix-asm
19133 Use Unix assembler syntax.  This is the default when configured for
19134 @samp{pdp11-*-bsd}.
19136 @item -mdec-asm
19137 @opindex mdec-asm
19138 Use DEC assembler syntax.  This is the default when configured for any
19139 PDP-11 target other than @samp{pdp11-*-bsd}.
19140 @end table
19142 @node picoChip Options
19143 @subsection picoChip Options
19144 @cindex picoChip options
19146 These @samp{-m} options are defined for picoChip implementations:
19148 @table @gcctabopt
19150 @item -mae=@var{ae_type}
19151 @opindex mcpu
19152 Set the instruction set, register set, and instruction scheduling
19153 parameters for array element type @var{ae_type}.  Supported values
19154 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
19156 @option{-mae=ANY} selects a completely generic AE type.  Code
19157 generated with this option runs on any of the other AE types.  The
19158 code is not as efficient as it would be if compiled for a specific
19159 AE type, and some types of operation (e.g., multiplication) do not
19160 work properly on all types of AE.
19162 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
19163 for compiled code, and is the default.
19165 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
19166 option may suffer from poor performance of byte (char) manipulation,
19167 since the DSP AE does not provide hardware support for byte load/stores.
19169 @item -msymbol-as-address
19170 Enable the compiler to directly use a symbol name as an address in a
19171 load/store instruction, without first loading it into a
19172 register.  Typically, the use of this option generates larger
19173 programs, which run faster than when the option isn't used.  However, the
19174 results vary from program to program, so it is left as a user option,
19175 rather than being permanently enabled.
19177 @item -mno-inefficient-warnings
19178 Disables warnings about the generation of inefficient code.  These
19179 warnings can be generated, for example, when compiling code that
19180 performs byte-level memory operations on the MAC AE type.  The MAC AE has
19181 no hardware support for byte-level memory operations, so all byte
19182 load/stores must be synthesized from word load/store operations.  This is
19183 inefficient and a warning is generated to indicate
19184 that you should rewrite the code to avoid byte operations, or to target
19185 an AE type that has the necessary hardware support.  This option disables
19186 these warnings.
19188 @end table
19190 @node PowerPC Options
19191 @subsection PowerPC Options
19192 @cindex PowerPC options
19194 These are listed under @xref{RS/6000 and PowerPC Options}.
19196 @node RL78 Options
19197 @subsection RL78 Options
19198 @cindex RL78 Options
19200 @table @gcctabopt
19202 @item -msim
19203 @opindex msim
19204 Links in additional target libraries to support operation within a
19205 simulator.
19207 @item -mmul=none
19208 @itemx -mmul=g13
19209 @itemx -mmul=rl78
19210 @opindex mmul
19211 Specifies the type of hardware multiplication support to be used.  The
19212 default is @code{none}, which uses software multiplication functions.
19213 The @code{g13} option is for the hardware multiply/divide peripheral
19214 only on the RL78/G13 targets.  The @code{rl78} option is for the
19215 standard hardware multiplication defined in the RL78 software manual.
19217 @end table
19219 @node RS/6000 and PowerPC Options
19220 @subsection IBM RS/6000 and PowerPC Options
19221 @cindex RS/6000 and PowerPC Options
19222 @cindex IBM RS/6000 and PowerPC Options
19224 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
19225 @table @gcctabopt
19226 @item -mpowerpc-gpopt
19227 @itemx -mno-powerpc-gpopt
19228 @itemx -mpowerpc-gfxopt
19229 @itemx -mno-powerpc-gfxopt
19230 @need 800
19231 @itemx -mpowerpc64
19232 @itemx -mno-powerpc64
19233 @itemx -mmfcrf
19234 @itemx -mno-mfcrf
19235 @itemx -mpopcntb
19236 @itemx -mno-popcntb
19237 @itemx -mpopcntd
19238 @itemx -mno-popcntd
19239 @itemx -mfprnd
19240 @itemx -mno-fprnd
19241 @need 800
19242 @itemx -mcmpb
19243 @itemx -mno-cmpb
19244 @itemx -mmfpgpr
19245 @itemx -mno-mfpgpr
19246 @itemx -mhard-dfp
19247 @itemx -mno-hard-dfp
19248 @opindex mpowerpc-gpopt
19249 @opindex mno-powerpc-gpopt
19250 @opindex mpowerpc-gfxopt
19251 @opindex mno-powerpc-gfxopt
19252 @opindex mpowerpc64
19253 @opindex mno-powerpc64
19254 @opindex mmfcrf
19255 @opindex mno-mfcrf
19256 @opindex mpopcntb
19257 @opindex mno-popcntb
19258 @opindex mpopcntd
19259 @opindex mno-popcntd
19260 @opindex mfprnd
19261 @opindex mno-fprnd
19262 @opindex mcmpb
19263 @opindex mno-cmpb
19264 @opindex mmfpgpr
19265 @opindex mno-mfpgpr
19266 @opindex mhard-dfp
19267 @opindex mno-hard-dfp
19268 You use these options to specify which instructions are available on the
19269 processor you are using.  The default value of these options is
19270 determined when configuring GCC@.  Specifying the
19271 @option{-mcpu=@var{cpu_type}} overrides the specification of these
19272 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
19273 rather than the options listed above.
19275 Specifying @option{-mpowerpc-gpopt} allows
19276 GCC to use the optional PowerPC architecture instructions in the
19277 General Purpose group, including floating-point square root.  Specifying
19278 @option{-mpowerpc-gfxopt} allows GCC to
19279 use the optional PowerPC architecture instructions in the Graphics
19280 group, including floating-point select.
19282 The @option{-mmfcrf} option allows GCC to generate the move from
19283 condition register field instruction implemented on the POWER4
19284 processor and other processors that support the PowerPC V2.01
19285 architecture.
19286 The @option{-mpopcntb} option allows GCC to generate the popcount and
19287 double-precision FP reciprocal estimate instruction implemented on the
19288 POWER5 processor and other processors that support the PowerPC V2.02
19289 architecture.
19290 The @option{-mpopcntd} option allows GCC to generate the popcount
19291 instruction implemented on the POWER7 processor and other processors
19292 that support the PowerPC V2.06 architecture.
19293 The @option{-mfprnd} option allows GCC to generate the FP round to
19294 integer instructions implemented on the POWER5+ processor and other
19295 processors that support the PowerPC V2.03 architecture.
19296 The @option{-mcmpb} option allows GCC to generate the compare bytes
19297 instruction implemented on the POWER6 processor and other processors
19298 that support the PowerPC V2.05 architecture.
19299 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
19300 general-purpose register instructions implemented on the POWER6X
19301 processor and other processors that support the extended PowerPC V2.05
19302 architecture.
19303 The @option{-mhard-dfp} option allows GCC to generate the decimal
19304 floating-point instructions implemented on some POWER processors.
19306 The @option{-mpowerpc64} option allows GCC to generate the additional
19307 64-bit instructions that are found in the full PowerPC64 architecture
19308 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
19309 @option{-mno-powerpc64}.
19311 @item -mcpu=@var{cpu_type}
19312 @opindex mcpu
19313 Set architecture type, register usage, and
19314 instruction scheduling parameters for machine type @var{cpu_type}.
19315 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
19316 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
19317 @samp{476}, @samp{476fp}, @samp{505}, @samp{601}, @samp{602}, @samp{603},
19318 @samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{630}, @samp{740},
19319 @samp{7400}, @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
19320 @samp{860}, @samp{970}, @samp{8540}, @samp{a2}, @samp{e300c2},
19321 @samp{e300c3}, @samp{e500mc}, @samp{e500mc64}, @samp{e5500},
19322 @samp{e6500}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5},
19323 @samp{titan}, @samp{power3}, @samp{power4}, @samp{power5}, @samp{power5+},
19324 @samp{power6}, @samp{power6x}, @samp{power7}, @samp{power8}, @samp{powerpc},
19325 @samp{powerpc64}, and @samp{rs64}.
19327 @option{-mcpu=powerpc}, and @option{-mcpu=powerpc64} specify pure 32-bit
19328 PowerPC and 64-bit PowerPC architecture machine
19329 types, with an appropriate, generic processor model assumed for
19330 scheduling purposes.
19332 The other options specify a specific processor.  Code generated under
19333 those options runs best on that processor, and may not run at all on
19334 others.
19336 The @option{-mcpu} options automatically enable or disable the
19337 following options:
19339 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
19340 -mpopcntb -mpopcntd  -mpowerpc64 @gol
19341 -mpowerpc-gpopt  -mpowerpc-gfxopt  -msingle-float -mdouble-float @gol
19342 -msimple-fpu -mstring  -mmulhw  -mdlmzb  -mmfpgpr -mvsx @gol
19343 -mcrypto -mdirect-move -mpower8-fusion -mpower8-vector @gol
19344 -mquad-memory -mquad-memory-atomic}
19346 The particular options set for any particular CPU varies between
19347 compiler versions, depending on what setting seems to produce optimal
19348 code for that CPU; it doesn't necessarily reflect the actual hardware's
19349 capabilities.  If you wish to set an individual option to a particular
19350 value, you may specify it after the @option{-mcpu} option, like
19351 @option{-mcpu=970 -mno-altivec}.
19353 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
19354 not enabled or disabled by the @option{-mcpu} option at present because
19355 AIX does not have full support for these options.  You may still
19356 enable or disable them individually if you're sure it'll work in your
19357 environment.
19359 @item -mtune=@var{cpu_type}
19360 @opindex mtune
19361 Set the instruction scheduling parameters for machine type
19362 @var{cpu_type}, but do not set the architecture type or register usage,
19363 as @option{-mcpu=@var{cpu_type}} does.  The same
19364 values for @var{cpu_type} are used for @option{-mtune} as for
19365 @option{-mcpu}.  If both are specified, the code generated uses the
19366 architecture and registers set by @option{-mcpu}, but the
19367 scheduling parameters set by @option{-mtune}.
19369 @item -mcmodel=small
19370 @opindex mcmodel=small
19371 Generate PowerPC64 code for the small model: The TOC is limited to
19372 64k.
19374 @item -mcmodel=medium
19375 @opindex mcmodel=medium
19376 Generate PowerPC64 code for the medium model: The TOC and other static
19377 data may be up to a total of 4G in size.
19379 @item -mcmodel=large
19380 @opindex mcmodel=large
19381 Generate PowerPC64 code for the large model: The TOC may be up to 4G
19382 in size.  Other data and code is only limited by the 64-bit address
19383 space.
19385 @item -maltivec
19386 @itemx -mno-altivec
19387 @opindex maltivec
19388 @opindex mno-altivec
19389 Generate code that uses (does not use) AltiVec instructions, and also
19390 enable the use of built-in functions that allow more direct access to
19391 the AltiVec instruction set.  You may also need to set
19392 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
19393 enhancements.
19395 When @option{-maltivec} is used, rather than @option{-maltivec=le} or
19396 @option{-maltivec=be}, the element order for Altivec intrinsics such
19397 as @code{vec_splat}, @code{vec_extract}, and @code{vec_insert} will
19398 match array element order corresponding to the endianness of the
19399 target.  That is, element zero identifies the leftmost element in a
19400 vector register when targeting a big-endian platform, and identifies
19401 the rightmost element in a vector register when targeting a
19402 little-endian platform.
19404 @item -maltivec=be
19405 @opindex maltivec=be
19406 Generate Altivec instructions using big-endian element order,
19407 regardless of whether the target is big- or little-endian.  This is
19408 the default when targeting a big-endian platform.
19410 The element order is used to interpret element numbers in Altivec
19411 intrinsics such as @code{vec_splat}, @code{vec_extract}, and
19412 @code{vec_insert}.  By default, these will match array element order
19413 corresponding to the endianness for the target.
19415 @item -maltivec=le
19416 @opindex maltivec=le
19417 Generate Altivec instructions using little-endian element order,
19418 regardless of whether the target is big- or little-endian.  This is
19419 the default when targeting a little-endian platform.  This option is
19420 currently ignored when targeting a big-endian platform.
19422 The element order is used to interpret element numbers in Altivec
19423 intrinsics such as @code{vec_splat}, @code{vec_extract}, and
19424 @code{vec_insert}.  By default, these will match array element order
19425 corresponding to the endianness for the target.
19427 @item -mvrsave
19428 @itemx -mno-vrsave
19429 @opindex mvrsave
19430 @opindex mno-vrsave
19431 Generate VRSAVE instructions when generating AltiVec code.
19433 @item -mgen-cell-microcode
19434 @opindex mgen-cell-microcode
19435 Generate Cell microcode instructions.
19437 @item -mwarn-cell-microcode
19438 @opindex mwarn-cell-microcode
19439 Warn when a Cell microcode instruction is emitted.  An example
19440 of a Cell microcode instruction is a variable shift.
19442 @item -msecure-plt
19443 @opindex msecure-plt
19444 Generate code that allows @command{ld} and @command{ld.so}
19445 to build executables and shared
19446 libraries with non-executable @code{.plt} and @code{.got} sections.
19447 This is a PowerPC
19448 32-bit SYSV ABI option.
19450 @item -mbss-plt
19451 @opindex mbss-plt
19452 Generate code that uses a BSS @code{.plt} section that @command{ld.so}
19453 fills in, and
19454 requires @code{.plt} and @code{.got}
19455 sections that are both writable and executable.
19456 This is a PowerPC 32-bit SYSV ABI option.
19458 @item -misel
19459 @itemx -mno-isel
19460 @opindex misel
19461 @opindex mno-isel
19462 This switch enables or disables the generation of ISEL instructions.
19464 @item -misel=@var{yes/no}
19465 This switch has been deprecated.  Use @option{-misel} and
19466 @option{-mno-isel} instead.
19468 @item -mspe
19469 @itemx -mno-spe
19470 @opindex mspe
19471 @opindex mno-spe
19472 This switch enables or disables the generation of SPE simd
19473 instructions.
19475 @item -mpaired
19476 @itemx -mno-paired
19477 @opindex mpaired
19478 @opindex mno-paired
19479 This switch enables or disables the generation of PAIRED simd
19480 instructions.
19482 @item -mspe=@var{yes/no}
19483 This option has been deprecated.  Use @option{-mspe} and
19484 @option{-mno-spe} instead.
19486 @item -mvsx
19487 @itemx -mno-vsx
19488 @opindex mvsx
19489 @opindex mno-vsx
19490 Generate code that uses (does not use) vector/scalar (VSX)
19491 instructions, and also enable the use of built-in functions that allow
19492 more direct access to the VSX instruction set.
19494 @item -mcrypto
19495 @itemx -mno-crypto
19496 @opindex mcrypto
19497 @opindex mno-crypto
19498 Enable the use (disable) of the built-in functions that allow direct
19499 access to the cryptographic instructions that were added in version
19500 2.07 of the PowerPC ISA.
19502 @item -mdirect-move
19503 @itemx -mno-direct-move
19504 @opindex mdirect-move
19505 @opindex mno-direct-move
19506 Generate code that uses (does not use) the instructions to move data
19507 between the general purpose registers and the vector/scalar (VSX)
19508 registers that were added in version 2.07 of the PowerPC ISA.
19510 @item -mpower8-fusion
19511 @itemx -mno-power8-fusion
19512 @opindex mpower8-fusion
19513 @opindex mno-power8-fusion
19514 Generate code that keeps (does not keeps) some integer operations
19515 adjacent so that the instructions can be fused together on power8 and
19516 later processors.
19518 @item -mpower8-vector
19519 @itemx -mno-power8-vector
19520 @opindex mpower8-vector
19521 @opindex mno-power8-vector
19522 Generate code that uses (does not use) the vector and scalar
19523 instructions that were added in version 2.07 of the PowerPC ISA.  Also
19524 enable the use of built-in functions that allow more direct access to
19525 the vector instructions.
19527 @item -mquad-memory
19528 @itemx -mno-quad-memory
19529 @opindex mquad-memory
19530 @opindex mno-quad-memory
19531 Generate code that uses (does not use) the non-atomic quad word memory
19532 instructions.  The @option{-mquad-memory} option requires use of
19533 64-bit mode.
19535 @item -mquad-memory-atomic
19536 @itemx -mno-quad-memory-atomic
19537 @opindex mquad-memory-atomic
19538 @opindex mno-quad-memory-atomic
19539 Generate code that uses (does not use) the atomic quad word memory
19540 instructions.  The @option{-mquad-memory-atomic} option requires use of
19541 64-bit mode.
19543 @item -mfloat-gprs=@var{yes/single/double/no}
19544 @itemx -mfloat-gprs
19545 @opindex mfloat-gprs
19546 This switch enables or disables the generation of floating-point
19547 operations on the general-purpose registers for architectures that
19548 support it.
19550 The argument @var{yes} or @var{single} enables the use of
19551 single-precision floating-point operations.
19553 The argument @var{double} enables the use of single and
19554 double-precision floating-point operations.
19556 The argument @var{no} disables floating-point operations on the
19557 general-purpose registers.
19559 This option is currently only available on the MPC854x.
19561 @item -m32
19562 @itemx -m64
19563 @opindex m32
19564 @opindex m64
19565 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
19566 targets (including GNU/Linux).  The 32-bit environment sets int, long
19567 and pointer to 32 bits and generates code that runs on any PowerPC
19568 variant.  The 64-bit environment sets int to 32 bits and long and
19569 pointer to 64 bits, and generates code for PowerPC64, as for
19570 @option{-mpowerpc64}.
19572 @item -mfull-toc
19573 @itemx -mno-fp-in-toc
19574 @itemx -mno-sum-in-toc
19575 @itemx -mminimal-toc
19576 @opindex mfull-toc
19577 @opindex mno-fp-in-toc
19578 @opindex mno-sum-in-toc
19579 @opindex mminimal-toc
19580 Modify generation of the TOC (Table Of Contents), which is created for
19581 every executable file.  The @option{-mfull-toc} option is selected by
19582 default.  In that case, GCC allocates at least one TOC entry for
19583 each unique non-automatic variable reference in your program.  GCC
19584 also places floating-point constants in the TOC@.  However, only
19585 16,384 entries are available in the TOC@.
19587 If you receive a linker error message that saying you have overflowed
19588 the available TOC space, you can reduce the amount of TOC space used
19589 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
19590 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
19591 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
19592 generate code to calculate the sum of an address and a constant at
19593 run time instead of putting that sum into the TOC@.  You may specify one
19594 or both of these options.  Each causes GCC to produce very slightly
19595 slower and larger code at the expense of conserving TOC space.
19597 If you still run out of space in the TOC even when you specify both of
19598 these options, specify @option{-mminimal-toc} instead.  This option causes
19599 GCC to make only one TOC entry for every file.  When you specify this
19600 option, GCC produces code that is slower and larger but which
19601 uses extremely little TOC space.  You may wish to use this option
19602 only on files that contain less frequently-executed code.
19604 @item -maix64
19605 @itemx -maix32
19606 @opindex maix64
19607 @opindex maix32
19608 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
19609 @code{long} type, and the infrastructure needed to support them.
19610 Specifying @option{-maix64} implies @option{-mpowerpc64},
19611 while @option{-maix32} disables the 64-bit ABI and
19612 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
19614 @item -mxl-compat
19615 @itemx -mno-xl-compat
19616 @opindex mxl-compat
19617 @opindex mno-xl-compat
19618 Produce code that conforms more closely to IBM XL compiler semantics
19619 when using AIX-compatible ABI@.  Pass floating-point arguments to
19620 prototyped functions beyond the register save area (RSA) on the stack
19621 in addition to argument FPRs.  Do not assume that most significant
19622 double in 128-bit long double value is properly rounded when comparing
19623 values and converting to double.  Use XL symbol names for long double
19624 support routines.
19626 The AIX calling convention was extended but not initially documented to
19627 handle an obscure K&R C case of calling a function that takes the
19628 address of its arguments with fewer arguments than declared.  IBM XL
19629 compilers access floating-point arguments that do not fit in the
19630 RSA from the stack when a subroutine is compiled without
19631 optimization.  Because always storing floating-point arguments on the
19632 stack is inefficient and rarely needed, this option is not enabled by
19633 default and only is necessary when calling subroutines compiled by IBM
19634 XL compilers without optimization.
19636 @item -mpe
19637 @opindex mpe
19638 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
19639 application written to use message passing with special startup code to
19640 enable the application to run.  The system must have PE installed in the
19641 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
19642 must be overridden with the @option{-specs=} option to specify the
19643 appropriate directory location.  The Parallel Environment does not
19644 support threads, so the @option{-mpe} option and the @option{-pthread}
19645 option are incompatible.
19647 @item -malign-natural
19648 @itemx -malign-power
19649 @opindex malign-natural
19650 @opindex malign-power
19651 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
19652 @option{-malign-natural} overrides the ABI-defined alignment of larger
19653 types, such as floating-point doubles, on their natural size-based boundary.
19654 The option @option{-malign-power} instructs GCC to follow the ABI-specified
19655 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
19657 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
19658 is not supported.
19660 @item -msoft-float
19661 @itemx -mhard-float
19662 @opindex msoft-float
19663 @opindex mhard-float
19664 Generate code that does not use (uses) the floating-point register set.
19665 Software floating-point emulation is provided if you use the
19666 @option{-msoft-float} option, and pass the option to GCC when linking.
19668 @item -msingle-float
19669 @itemx -mdouble-float
19670 @opindex msingle-float
19671 @opindex mdouble-float
19672 Generate code for single- or double-precision floating-point operations.
19673 @option{-mdouble-float} implies @option{-msingle-float}.
19675 @item -msimple-fpu
19676 @opindex msimple-fpu
19677 Do not generate @code{sqrt} and @code{div} instructions for hardware
19678 floating-point unit.
19680 @item -mfpu=@var{name}
19681 @opindex mfpu
19682 Specify type of floating-point unit.  Valid values for @var{name} are
19683 @samp{sp_lite} (equivalent to @option{-msingle-float -msimple-fpu}),
19684 @samp{dp_lite} (equivalent to @option{-mdouble-float -msimple-fpu}),
19685 @samp{sp_full} (equivalent to @option{-msingle-float}),
19686 and @samp{dp_full} (equivalent to @option{-mdouble-float}).
19688 @item -mxilinx-fpu
19689 @opindex mxilinx-fpu
19690 Perform optimizations for the floating-point unit on Xilinx PPC 405/440.
19692 @item -mmultiple
19693 @itemx -mno-multiple
19694 @opindex mmultiple
19695 @opindex mno-multiple
19696 Generate code that uses (does not use) the load multiple word
19697 instructions and the store multiple word instructions.  These
19698 instructions are generated by default on POWER systems, and not
19699 generated on PowerPC systems.  Do not use @option{-mmultiple} on little-endian
19700 PowerPC systems, since those instructions do not work when the
19701 processor is in little-endian mode.  The exceptions are PPC740 and
19702 PPC750 which permit these instructions in little-endian mode.
19704 @item -mstring
19705 @itemx -mno-string
19706 @opindex mstring
19707 @opindex mno-string
19708 Generate code that uses (does not use) the load string instructions
19709 and the store string word instructions to save multiple registers and
19710 do small block moves.  These instructions are generated by default on
19711 POWER systems, and not generated on PowerPC systems.  Do not use
19712 @option{-mstring} on little-endian PowerPC systems, since those
19713 instructions do not work when the processor is in little-endian mode.
19714 The exceptions are PPC740 and PPC750 which permit these instructions
19715 in little-endian mode.
19717 @item -mupdate
19718 @itemx -mno-update
19719 @opindex mupdate
19720 @opindex mno-update
19721 Generate code that uses (does not use) the load or store instructions
19722 that update the base register to the address of the calculated memory
19723 location.  These instructions are generated by default.  If you use
19724 @option{-mno-update}, there is a small window between the time that the
19725 stack pointer is updated and the address of the previous frame is
19726 stored, which means code that walks the stack frame across interrupts or
19727 signals may get corrupted data.
19729 @item -mavoid-indexed-addresses
19730 @itemx -mno-avoid-indexed-addresses
19731 @opindex mavoid-indexed-addresses
19732 @opindex mno-avoid-indexed-addresses
19733 Generate code that tries to avoid (not avoid) the use of indexed load
19734 or store instructions. These instructions can incur a performance
19735 penalty on Power6 processors in certain situations, such as when
19736 stepping through large arrays that cross a 16M boundary.  This option
19737 is enabled by default when targeting Power6 and disabled otherwise.
19739 @item -mfused-madd
19740 @itemx -mno-fused-madd
19741 @opindex mfused-madd
19742 @opindex mno-fused-madd
19743 Generate code that uses (does not use) the floating-point multiply and
19744 accumulate instructions.  These instructions are generated by default
19745 if hardware floating point is used.  The machine-dependent
19746 @option{-mfused-madd} option is now mapped to the machine-independent
19747 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
19748 mapped to @option{-ffp-contract=off}.
19750 @item -mmulhw
19751 @itemx -mno-mulhw
19752 @opindex mmulhw
19753 @opindex mno-mulhw
19754 Generate code that uses (does not use) the half-word multiply and
19755 multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors.
19756 These instructions are generated by default when targeting those
19757 processors.
19759 @item -mdlmzb
19760 @itemx -mno-dlmzb
19761 @opindex mdlmzb
19762 @opindex mno-dlmzb
19763 Generate code that uses (does not use) the string-search @samp{dlmzb}
19764 instruction on the IBM 405, 440, 464 and 476 processors.  This instruction is
19765 generated by default when targeting those processors.
19767 @item -mno-bit-align
19768 @itemx -mbit-align
19769 @opindex mno-bit-align
19770 @opindex mbit-align
19771 On System V.4 and embedded PowerPC systems do not (do) force structures
19772 and unions that contain bit-fields to be aligned to the base type of the
19773 bit-field.
19775 For example, by default a structure containing nothing but 8
19776 @code{unsigned} bit-fields of length 1 is aligned to a 4-byte
19777 boundary and has a size of 4 bytes.  By using @option{-mno-bit-align},
19778 the structure is aligned to a 1-byte boundary and is 1 byte in
19779 size.
19781 @item -mno-strict-align
19782 @itemx -mstrict-align
19783 @opindex mno-strict-align
19784 @opindex mstrict-align
19785 On System V.4 and embedded PowerPC systems do not (do) assume that
19786 unaligned memory references are handled by the system.
19788 @item -mrelocatable
19789 @itemx -mno-relocatable
19790 @opindex mrelocatable
19791 @opindex mno-relocatable
19792 Generate code that allows (does not allow) a static executable to be
19793 relocated to a different address at run time.  A simple embedded
19794 PowerPC system loader should relocate the entire contents of
19795 @code{.got2} and 4-byte locations listed in the @code{.fixup} section,
19796 a table of 32-bit addresses generated by this option.  For this to
19797 work, all objects linked together must be compiled with
19798 @option{-mrelocatable} or @option{-mrelocatable-lib}.
19799 @option{-mrelocatable} code aligns the stack to an 8-byte boundary.
19801 @item -mrelocatable-lib
19802 @itemx -mno-relocatable-lib
19803 @opindex mrelocatable-lib
19804 @opindex mno-relocatable-lib
19805 Like @option{-mrelocatable}, @option{-mrelocatable-lib} generates a
19806 @code{.fixup} section to allow static executables to be relocated at
19807 run time, but @option{-mrelocatable-lib} does not use the smaller stack
19808 alignment of @option{-mrelocatable}.  Objects compiled with
19809 @option{-mrelocatable-lib} may be linked with objects compiled with
19810 any combination of the @option{-mrelocatable} options.
19812 @item -mno-toc
19813 @itemx -mtoc
19814 @opindex mno-toc
19815 @opindex mtoc
19816 On System V.4 and embedded PowerPC systems do not (do) assume that
19817 register 2 contains a pointer to a global area pointing to the addresses
19818 used in the program.
19820 @item -mlittle
19821 @itemx -mlittle-endian
19822 @opindex mlittle
19823 @opindex mlittle-endian
19824 On System V.4 and embedded PowerPC systems compile code for the
19825 processor in little-endian mode.  The @option{-mlittle-endian} option is
19826 the same as @option{-mlittle}.
19828 @item -mbig
19829 @itemx -mbig-endian
19830 @opindex mbig
19831 @opindex mbig-endian
19832 On System V.4 and embedded PowerPC systems compile code for the
19833 processor in big-endian mode.  The @option{-mbig-endian} option is
19834 the same as @option{-mbig}.
19836 @item -mdynamic-no-pic
19837 @opindex mdynamic-no-pic
19838 On Darwin and Mac OS X systems, compile code so that it is not
19839 relocatable, but that its external references are relocatable.  The
19840 resulting code is suitable for applications, but not shared
19841 libraries.
19843 @item -msingle-pic-base
19844 @opindex msingle-pic-base
19845 Treat the register used for PIC addressing as read-only, rather than
19846 loading it in the prologue for each function.  The runtime system is
19847 responsible for initializing this register with an appropriate value
19848 before execution begins.
19850 @item -mprioritize-restricted-insns=@var{priority}
19851 @opindex mprioritize-restricted-insns
19852 This option controls the priority that is assigned to
19853 dispatch-slot restricted instructions during the second scheduling
19854 pass.  The argument @var{priority} takes the value @samp{0}, @samp{1},
19855 or @samp{2} to assign no, highest, or second-highest (respectively) 
19856 priority to dispatch-slot restricted
19857 instructions.
19859 @item -msched-costly-dep=@var{dependence_type}
19860 @opindex msched-costly-dep
19861 This option controls which dependences are considered costly
19862 by the target during instruction scheduling.  The argument
19863 @var{dependence_type} takes one of the following values:
19865 @table @asis
19866 @item @samp{no}
19867 No dependence is costly.
19869 @item @samp{all}
19870 All dependences are costly.
19872 @item @samp{true_store_to_load}
19873 A true dependence from store to load is costly.
19875 @item @samp{store_to_load}
19876 Any dependence from store to load is costly.
19878 @item @var{number}
19879 Any dependence for which the latency is greater than or equal to 
19880 @var{number} is costly.
19881 @end table
19883 @item -minsert-sched-nops=@var{scheme}
19884 @opindex minsert-sched-nops
19885 This option controls which NOP insertion scheme is used during
19886 the second scheduling pass.  The argument @var{scheme} takes one of the
19887 following values:
19889 @table @asis
19890 @item @samp{no}
19891 Don't insert NOPs.
19893 @item @samp{pad}
19894 Pad with NOPs any dispatch group that has vacant issue slots,
19895 according to the scheduler's grouping.
19897 @item @samp{regroup_exact}
19898 Insert NOPs to force costly dependent insns into
19899 separate groups.  Insert exactly as many NOPs as needed to force an insn
19900 to a new group, according to the estimated processor grouping.
19902 @item @var{number}
19903 Insert NOPs to force costly dependent insns into
19904 separate groups.  Insert @var{number} NOPs to force an insn to a new group.
19905 @end table
19907 @item -mcall-sysv
19908 @opindex mcall-sysv
19909 On System V.4 and embedded PowerPC systems compile code using calling
19910 conventions that adhere to the March 1995 draft of the System V
19911 Application Binary Interface, PowerPC processor supplement.  This is the
19912 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
19914 @item -mcall-sysv-eabi
19915 @itemx -mcall-eabi
19916 @opindex mcall-sysv-eabi
19917 @opindex mcall-eabi
19918 Specify both @option{-mcall-sysv} and @option{-meabi} options.
19920 @item -mcall-sysv-noeabi
19921 @opindex mcall-sysv-noeabi
19922 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
19924 @item -mcall-aixdesc
19925 @opindex m
19926 On System V.4 and embedded PowerPC systems compile code for the AIX
19927 operating system.
19929 @item -mcall-linux
19930 @opindex mcall-linux
19931 On System V.4 and embedded PowerPC systems compile code for the
19932 Linux-based GNU system.
19934 @item -mcall-freebsd
19935 @opindex mcall-freebsd
19936 On System V.4 and embedded PowerPC systems compile code for the
19937 FreeBSD operating system.
19939 @item -mcall-netbsd
19940 @opindex mcall-netbsd
19941 On System V.4 and embedded PowerPC systems compile code for the
19942 NetBSD operating system.
19944 @item -mcall-openbsd
19945 @opindex mcall-netbsd
19946 On System V.4 and embedded PowerPC systems compile code for the
19947 OpenBSD operating system.
19949 @item -maix-struct-return
19950 @opindex maix-struct-return
19951 Return all structures in memory (as specified by the AIX ABI)@.
19953 @item -msvr4-struct-return
19954 @opindex msvr4-struct-return
19955 Return structures smaller than 8 bytes in registers (as specified by the
19956 SVR4 ABI)@.
19958 @item -mabi=@var{abi-type}
19959 @opindex mabi
19960 Extend the current ABI with a particular extension, or remove such extension.
19961 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
19962 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble},
19963 @var{elfv1}, @var{elfv2}@.
19965 @item -mabi=spe
19966 @opindex mabi=spe
19967 Extend the current ABI with SPE ABI extensions.  This does not change
19968 the default ABI, instead it adds the SPE ABI extensions to the current
19969 ABI@.
19971 @item -mabi=no-spe
19972 @opindex mabi=no-spe
19973 Disable Book-E SPE ABI extensions for the current ABI@.
19975 @item -mabi=ibmlongdouble
19976 @opindex mabi=ibmlongdouble
19977 Change the current ABI to use IBM extended-precision long double.
19978 This is a PowerPC 32-bit SYSV ABI option.
19980 @item -mabi=ieeelongdouble
19981 @opindex mabi=ieeelongdouble
19982 Change the current ABI to use IEEE extended-precision long double.
19983 This is a PowerPC 32-bit Linux ABI option.
19985 @item -mabi=elfv1
19986 @opindex mabi=elfv1
19987 Change the current ABI to use the ELFv1 ABI.
19988 This is the default ABI for big-endian PowerPC 64-bit Linux.
19989 Overriding the default ABI requires special system support and is
19990 likely to fail in spectacular ways.
19992 @item -mabi=elfv2
19993 @opindex mabi=elfv2
19994 Change the current ABI to use the ELFv2 ABI.
19995 This is the default ABI for little-endian PowerPC 64-bit Linux.
19996 Overriding the default ABI requires special system support and is
19997 likely to fail in spectacular ways.
19999 @item -mprototype
20000 @itemx -mno-prototype
20001 @opindex mprototype
20002 @opindex mno-prototype
20003 On System V.4 and embedded PowerPC systems assume that all calls to
20004 variable argument functions are properly prototyped.  Otherwise, the
20005 compiler must insert an instruction before every non-prototyped call to
20006 set or clear bit 6 of the condition code register (@var{CR}) to
20007 indicate whether floating-point values are passed in the floating-point
20008 registers in case the function takes variable arguments.  With
20009 @option{-mprototype}, only calls to prototyped variable argument functions
20010 set or clear the bit.
20012 @item -msim
20013 @opindex msim
20014 On embedded PowerPC systems, assume that the startup module is called
20015 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
20016 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
20017 configurations.
20019 @item -mmvme
20020 @opindex mmvme
20021 On embedded PowerPC systems, assume that the startup module is called
20022 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
20023 @file{libc.a}.
20025 @item -mads
20026 @opindex mads
20027 On embedded PowerPC systems, assume that the startup module is called
20028 @file{crt0.o} and the standard C libraries are @file{libads.a} and
20029 @file{libc.a}.
20031 @item -myellowknife
20032 @opindex myellowknife
20033 On embedded PowerPC systems, assume that the startup module is called
20034 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
20035 @file{libc.a}.
20037 @item -mvxworks
20038 @opindex mvxworks
20039 On System V.4 and embedded PowerPC systems, specify that you are
20040 compiling for a VxWorks system.
20042 @item -memb
20043 @opindex memb
20044 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
20045 header to indicate that @samp{eabi} extended relocations are used.
20047 @item -meabi
20048 @itemx -mno-eabi
20049 @opindex meabi
20050 @opindex mno-eabi
20051 On System V.4 and embedded PowerPC systems do (do not) adhere to the
20052 Embedded Applications Binary Interface (EABI), which is a set of
20053 modifications to the System V.4 specifications.  Selecting @option{-meabi}
20054 means that the stack is aligned to an 8-byte boundary, a function
20055 @code{__eabi} is called from @code{main} to set up the EABI
20056 environment, and the @option{-msdata} option can use both @code{r2} and
20057 @code{r13} to point to two separate small data areas.  Selecting
20058 @option{-mno-eabi} means that the stack is aligned to a 16-byte boundary,
20059 no EABI initialization function is called from @code{main}, and the
20060 @option{-msdata} option only uses @code{r13} to point to a single
20061 small data area.  The @option{-meabi} option is on by default if you
20062 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
20064 @item -msdata=eabi
20065 @opindex msdata=eabi
20066 On System V.4 and embedded PowerPC systems, put small initialized
20067 @code{const} global and static data in the @samp{.sdata2} section, which
20068 is pointed to by register @code{r2}.  Put small initialized
20069 non-@code{const} global and static data in the @samp{.sdata} section,
20070 which is pointed to by register @code{r13}.  Put small uninitialized
20071 global and static data in the @samp{.sbss} section, which is adjacent to
20072 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
20073 incompatible with the @option{-mrelocatable} option.  The
20074 @option{-msdata=eabi} option also sets the @option{-memb} option.
20076 @item -msdata=sysv
20077 @opindex msdata=sysv
20078 On System V.4 and embedded PowerPC systems, put small global and static
20079 data in the @samp{.sdata} section, which is pointed to by register
20080 @code{r13}.  Put small uninitialized global and static data in the
20081 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
20082 The @option{-msdata=sysv} option is incompatible with the
20083 @option{-mrelocatable} option.
20085 @item -msdata=default
20086 @itemx -msdata
20087 @opindex msdata=default
20088 @opindex msdata
20089 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
20090 compile code the same as @option{-msdata=eabi}, otherwise compile code the
20091 same as @option{-msdata=sysv}.
20093 @item -msdata=data
20094 @opindex msdata=data
20095 On System V.4 and embedded PowerPC systems, put small global
20096 data in the @samp{.sdata} section.  Put small uninitialized global
20097 data in the @samp{.sbss} section.  Do not use register @code{r13}
20098 to address small data however.  This is the default behavior unless
20099 other @option{-msdata} options are used.
20101 @item -msdata=none
20102 @itemx -mno-sdata
20103 @opindex msdata=none
20104 @opindex mno-sdata
20105 On embedded PowerPC systems, put all initialized global and static data
20106 in the @samp{.data} section, and all uninitialized data in the
20107 @samp{.bss} section.
20109 @item -mblock-move-inline-limit=@var{num}
20110 @opindex mblock-move-inline-limit
20111 Inline all block moves (such as calls to @code{memcpy} or structure
20112 copies) less than or equal to @var{num} bytes.  The minimum value for
20113 @var{num} is 32 bytes on 32-bit targets and 64 bytes on 64-bit
20114 targets.  The default value is target-specific.
20116 @item -G @var{num}
20117 @opindex G
20118 @cindex smaller data references (PowerPC)
20119 @cindex .sdata/.sdata2 references (PowerPC)
20120 On embedded PowerPC systems, put global and static items less than or
20121 equal to @var{num} bytes into the small data or BSS sections instead of
20122 the normal data or BSS section.  By default, @var{num} is 8.  The
20123 @option{-G @var{num}} switch is also passed to the linker.
20124 All modules should be compiled with the same @option{-G @var{num}} value.
20126 @item -mregnames
20127 @itemx -mno-regnames
20128 @opindex mregnames
20129 @opindex mno-regnames
20130 On System V.4 and embedded PowerPC systems do (do not) emit register
20131 names in the assembly language output using symbolic forms.
20133 @item -mlongcall
20134 @itemx -mno-longcall
20135 @opindex mlongcall
20136 @opindex mno-longcall
20137 By default assume that all calls are far away so that a longer and more
20138 expensive calling sequence is required.  This is required for calls
20139 farther than 32 megabytes (33,554,432 bytes) from the current location.
20140 A short call is generated if the compiler knows
20141 the call cannot be that far away.  This setting can be overridden by
20142 the @code{shortcall} function attribute, or by @code{#pragma
20143 longcall(0)}.
20145 Some linkers are capable of detecting out-of-range calls and generating
20146 glue code on the fly.  On these systems, long calls are unnecessary and
20147 generate slower code.  As of this writing, the AIX linker can do this,
20148 as can the GNU linker for PowerPC/64.  It is planned to add this feature
20149 to the GNU linker for 32-bit PowerPC systems as well.
20151 On Darwin/PPC systems, @code{#pragma longcall} generates @code{jbsr
20152 callee, L42}, plus a @dfn{branch island} (glue code).  The two target
20153 addresses represent the callee and the branch island.  The
20154 Darwin/PPC linker prefers the first address and generates a @code{bl
20155 callee} if the PPC @code{bl} instruction reaches the callee directly;
20156 otherwise, the linker generates @code{bl L42} to call the branch
20157 island.  The branch island is appended to the body of the
20158 calling function; it computes the full 32-bit address of the callee
20159 and jumps to it.
20161 On Mach-O (Darwin) systems, this option directs the compiler emit to
20162 the glue for every direct call, and the Darwin linker decides whether
20163 to use or discard it.
20165 In the future, GCC may ignore all longcall specifications
20166 when the linker is known to generate glue.
20168 @item -mtls-markers
20169 @itemx -mno-tls-markers
20170 @opindex mtls-markers
20171 @opindex mno-tls-markers
20172 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
20173 specifying the function argument.  The relocation allows the linker to
20174 reliably associate function call with argument setup instructions for
20175 TLS optimization, which in turn allows GCC to better schedule the
20176 sequence.
20178 @item -pthread
20179 @opindex pthread
20180 Adds support for multithreading with the @dfn{pthreads} library.
20181 This option sets flags for both the preprocessor and linker.
20183 @item -mrecip
20184 @itemx -mno-recip
20185 @opindex mrecip
20186 This option enables use of the reciprocal estimate and
20187 reciprocal square root estimate instructions with additional
20188 Newton-Raphson steps to increase precision instead of doing a divide or
20189 square root and divide for floating-point arguments.  You should use
20190 the @option{-ffast-math} option when using @option{-mrecip} (or at
20191 least @option{-funsafe-math-optimizations},
20192 @option{-finite-math-only}, @option{-freciprocal-math} and
20193 @option{-fno-trapping-math}).  Note that while the throughput of the
20194 sequence is generally higher than the throughput of the non-reciprocal
20195 instruction, the precision of the sequence can be decreased by up to 2
20196 ulp (i.e.@: the inverse of 1.0 equals 0.99999994) for reciprocal square
20197 roots.
20199 @item -mrecip=@var{opt}
20200 @opindex mrecip=opt
20201 This option controls which reciprocal estimate instructions
20202 may be used.  @var{opt} is a comma-separated list of options, which may
20203 be preceded by a @code{!} to invert the option:
20204 @code{all}: enable all estimate instructions,
20205 @code{default}: enable the default instructions, equivalent to @option{-mrecip},
20206 @code{none}: disable all estimate instructions, equivalent to @option{-mno-recip};
20207 @code{div}: enable the reciprocal approximation instructions for both single and double precision;
20208 @code{divf}: enable the single-precision reciprocal approximation instructions;
20209 @code{divd}: enable the double-precision reciprocal approximation instructions;
20210 @code{rsqrt}: enable the reciprocal square root approximation instructions for both single and double precision;
20211 @code{rsqrtf}: enable the single-precision reciprocal square root approximation instructions;
20212 @code{rsqrtd}: enable the double-precision reciprocal square root approximation instructions;
20214 So, for example, @option{-mrecip=all,!rsqrtd} enables
20215 all of the reciprocal estimate instructions, except for the
20216 @code{FRSQRTE}, @code{XSRSQRTEDP}, and @code{XVRSQRTEDP} instructions
20217 which handle the double-precision reciprocal square root calculations.
20219 @item -mrecip-precision
20220 @itemx -mno-recip-precision
20221 @opindex mrecip-precision
20222 Assume (do not assume) that the reciprocal estimate instructions
20223 provide higher-precision estimates than is mandated by the PowerPC
20224 ABI.  Selecting @option{-mcpu=power6}, @option{-mcpu=power7} or
20225 @option{-mcpu=power8} automatically selects @option{-mrecip-precision}.
20226 The double-precision square root estimate instructions are not generated by
20227 default on low-precision machines, since they do not provide an
20228 estimate that converges after three steps.
20230 @item -mveclibabi=@var{type}
20231 @opindex mveclibabi
20232 Specifies the ABI type to use for vectorizing intrinsics using an
20233 external library.  The only type supported at present is @code{mass},
20234 which specifies to use IBM's Mathematical Acceleration Subsystem
20235 (MASS) libraries for vectorizing intrinsics using external libraries.
20236 GCC currently emits calls to @code{acosd2}, @code{acosf4},
20237 @code{acoshd2}, @code{acoshf4}, @code{asind2}, @code{asinf4},
20238 @code{asinhd2}, @code{asinhf4}, @code{atan2d2}, @code{atan2f4},
20239 @code{atand2}, @code{atanf4}, @code{atanhd2}, @code{atanhf4},
20240 @code{cbrtd2}, @code{cbrtf4}, @code{cosd2}, @code{cosf4},
20241 @code{coshd2}, @code{coshf4}, @code{erfcd2}, @code{erfcf4},
20242 @code{erfd2}, @code{erff4}, @code{exp2d2}, @code{exp2f4},
20243 @code{expd2}, @code{expf4}, @code{expm1d2}, @code{expm1f4},
20244 @code{hypotd2}, @code{hypotf4}, @code{lgammad2}, @code{lgammaf4},
20245 @code{log10d2}, @code{log10f4}, @code{log1pd2}, @code{log1pf4},
20246 @code{log2d2}, @code{log2f4}, @code{logd2}, @code{logf4},
20247 @code{powd2}, @code{powf4}, @code{sind2}, @code{sinf4}, @code{sinhd2},
20248 @code{sinhf4}, @code{sqrtd2}, @code{sqrtf4}, @code{tand2},
20249 @code{tanf4}, @code{tanhd2}, and @code{tanhf4} when generating code
20250 for power7.  Both @option{-ftree-vectorize} and
20251 @option{-funsafe-math-optimizations} must also be enabled.  The MASS
20252 libraries must be specified at link time.
20254 @item -mfriz
20255 @itemx -mno-friz
20256 @opindex mfriz
20257 Generate (do not generate) the @code{friz} instruction when the
20258 @option{-funsafe-math-optimizations} option is used to optimize
20259 rounding of floating-point values to 64-bit integer and back to floating
20260 point.  The @code{friz} instruction does not return the same value if
20261 the floating-point number is too large to fit in an integer.
20263 @item -mpointers-to-nested-functions
20264 @itemx -mno-pointers-to-nested-functions
20265 @opindex mpointers-to-nested-functions
20266 Generate (do not generate) code to load up the static chain register
20267 (@var{r11}) when calling through a pointer on AIX and 64-bit Linux
20268 systems where a function pointer points to a 3-word descriptor giving
20269 the function address, TOC value to be loaded in register @var{r2}, and
20270 static chain value to be loaded in register @var{r11}.  The
20271 @option{-mpointers-to-nested-functions} is on by default.  You cannot
20272 call through pointers to nested functions or pointers
20273 to functions compiled in other languages that use the static chain if
20274 you use the @option{-mno-pointers-to-nested-functions}.
20276 @item -msave-toc-indirect
20277 @itemx -mno-save-toc-indirect
20278 @opindex msave-toc-indirect
20279 Generate (do not generate) code to save the TOC value in the reserved
20280 stack location in the function prologue if the function calls through
20281 a pointer on AIX and 64-bit Linux systems.  If the TOC value is not
20282 saved in the prologue, it is saved just before the call through the
20283 pointer.  The @option{-mno-save-toc-indirect} option is the default.
20285 @item -mcompat-align-parm
20286 @itemx -mno-compat-align-parm
20287 @opindex mcompat-align-parm
20288 Generate (do not generate) code to pass structure parameters with a
20289 maximum alignment of 64 bits, for compatibility with older versions
20290 of GCC.
20292 Older versions of GCC (prior to 4.9.0) incorrectly did not align a
20293 structure parameter on a 128-bit boundary when that structure contained
20294 a member requiring 128-bit alignment.  This is corrected in more
20295 recent versions of GCC.  This option may be used to generate code
20296 that is compatible with functions compiled with older versions of
20297 GCC.
20299 The @option{-mno-compat-align-parm} option is the default.
20300 @end table
20302 @node RX Options
20303 @subsection RX Options
20304 @cindex RX Options
20306 These command-line options are defined for RX targets:
20308 @table @gcctabopt
20309 @item -m64bit-doubles
20310 @itemx -m32bit-doubles
20311 @opindex m64bit-doubles
20312 @opindex m32bit-doubles
20313 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
20314 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
20315 @option{-m32bit-doubles}.  @emph{Note} RX floating-point hardware only
20316 works on 32-bit values, which is why the default is
20317 @option{-m32bit-doubles}.
20319 @item -fpu
20320 @itemx -nofpu
20321 @opindex fpu
20322 @opindex nofpu
20323 Enables (@option{-fpu}) or disables (@option{-nofpu}) the use of RX
20324 floating-point hardware.  The default is enabled for the @var{RX600}
20325 series and disabled for the @var{RX200} series.
20327 Floating-point instructions are only generated for 32-bit floating-point 
20328 values, however, so the FPU hardware is not used for doubles if the
20329 @option{-m64bit-doubles} option is used.
20331 @emph{Note} If the @option{-fpu} option is enabled then
20332 @option{-funsafe-math-optimizations} is also enabled automatically.
20333 This is because the RX FPU instructions are themselves unsafe.
20335 @item -mcpu=@var{name}
20336 @opindex -mcpu
20337 Selects the type of RX CPU to be targeted.  Currently three types are
20338 supported, the generic @var{RX600} and @var{RX200} series hardware and
20339 the specific @var{RX610} CPU.  The default is @var{RX600}.
20341 The only difference between @var{RX600} and @var{RX610} is that the
20342 @var{RX610} does not support the @code{MVTIPL} instruction.
20344 The @var{RX200} series does not have a hardware floating-point unit
20345 and so @option{-nofpu} is enabled by default when this type is
20346 selected.
20348 @item -mbig-endian-data
20349 @itemx -mlittle-endian-data
20350 @opindex mbig-endian-data
20351 @opindex mlittle-endian-data
20352 Store data (but not code) in the big-endian format.  The default is
20353 @option{-mlittle-endian-data}, i.e.@: to store data in the little-endian
20354 format.
20356 @item -msmall-data-limit=@var{N}
20357 @opindex msmall-data-limit
20358 Specifies the maximum size in bytes of global and static variables
20359 which can be placed into the small data area.  Using the small data
20360 area can lead to smaller and faster code, but the size of area is
20361 limited and it is up to the programmer to ensure that the area does
20362 not overflow.  Also when the small data area is used one of the RX's
20363 registers (usually @code{r13}) is reserved for use pointing to this
20364 area, so it is no longer available for use by the compiler.  This
20365 could result in slower and/or larger code if variables are pushed onto
20366 the stack instead of being held in this register.
20368 Note, common variables (variables that have not been initialized) and
20369 constants are not placed into the small data area as they are assigned
20370 to other sections in the output executable.
20372 The default value is zero, which disables this feature.  Note, this
20373 feature is not enabled by default with higher optimization levels
20374 (@option{-O2} etc) because of the potentially detrimental effects of
20375 reserving a register.  It is up to the programmer to experiment and
20376 discover whether this feature is of benefit to their program.  See the
20377 description of the @option{-mpid} option for a description of how the
20378 actual register to hold the small data area pointer is chosen.
20380 @item -msim
20381 @itemx -mno-sim
20382 @opindex msim
20383 @opindex mno-sim
20384 Use the simulator runtime.  The default is to use the libgloss
20385 board-specific runtime.
20387 @item -mas100-syntax
20388 @itemx -mno-as100-syntax
20389 @opindex mas100-syntax
20390 @opindex mno-as100-syntax
20391 When generating assembler output use a syntax that is compatible with
20392 Renesas's AS100 assembler.  This syntax can also be handled by the GAS
20393 assembler, but it has some restrictions so it is not generated by default.
20395 @item -mmax-constant-size=@var{N}
20396 @opindex mmax-constant-size
20397 Specifies the maximum size, in bytes, of a constant that can be used as
20398 an operand in a RX instruction.  Although the RX instruction set does
20399 allow constants of up to 4 bytes in length to be used in instructions,
20400 a longer value equates to a longer instruction.  Thus in some
20401 circumstances it can be beneficial to restrict the size of constants
20402 that are used in instructions.  Constants that are too big are instead
20403 placed into a constant pool and referenced via register indirection.
20405 The value @var{N} can be between 0 and 4.  A value of 0 (the default)
20406 or 4 means that constants of any size are allowed.
20408 @item -mrelax
20409 @opindex mrelax
20410 Enable linker relaxation.  Linker relaxation is a process whereby the
20411 linker attempts to reduce the size of a program by finding shorter
20412 versions of various instructions.  Disabled by default.
20414 @item -mint-register=@var{N}
20415 @opindex mint-register
20416 Specify the number of registers to reserve for fast interrupt handler
20417 functions.  The value @var{N} can be between 0 and 4.  A value of 1
20418 means that register @code{r13} is reserved for the exclusive use
20419 of fast interrupt handlers.  A value of 2 reserves @code{r13} and
20420 @code{r12}.  A value of 3 reserves @code{r13}, @code{r12} and
20421 @code{r11}, and a value of 4 reserves @code{r13} through @code{r10}.
20422 A value of 0, the default, does not reserve any registers.
20424 @item -msave-acc-in-interrupts
20425 @opindex msave-acc-in-interrupts
20426 Specifies that interrupt handler functions should preserve the
20427 accumulator register.  This is only necessary if normal code might use
20428 the accumulator register, for example because it performs 64-bit
20429 multiplications.  The default is to ignore the accumulator as this
20430 makes the interrupt handlers faster.
20432 @item -mpid
20433 @itemx -mno-pid
20434 @opindex mpid
20435 @opindex mno-pid
20436 Enables the generation of position independent data.  When enabled any
20437 access to constant data is done via an offset from a base address
20438 held in a register.  This allows the location of constant data to be
20439 determined at run time without requiring the executable to be
20440 relocated, which is a benefit to embedded applications with tight
20441 memory constraints.  Data that can be modified is not affected by this
20442 option.
20444 Note, using this feature reserves a register, usually @code{r13}, for
20445 the constant data base address.  This can result in slower and/or
20446 larger code, especially in complicated functions.
20448 The actual register chosen to hold the constant data base address
20449 depends upon whether the @option{-msmall-data-limit} and/or the
20450 @option{-mint-register} command-line options are enabled.  Starting
20451 with register @code{r13} and proceeding downwards, registers are
20452 allocated first to satisfy the requirements of @option{-mint-register},
20453 then @option{-mpid} and finally @option{-msmall-data-limit}.  Thus it
20454 is possible for the small data area register to be @code{r8} if both
20455 @option{-mint-register=4} and @option{-mpid} are specified on the
20456 command line.
20458 By default this feature is not enabled.  The default can be restored
20459 via the @option{-mno-pid} command-line option.
20461 @item -mno-warn-multiple-fast-interrupts
20462 @itemx -mwarn-multiple-fast-interrupts
20463 @opindex mno-warn-multiple-fast-interrupts
20464 @opindex mwarn-multiple-fast-interrupts
20465 Prevents GCC from issuing a warning message if it finds more than one
20466 fast interrupt handler when it is compiling a file.  The default is to
20467 issue a warning for each extra fast interrupt handler found, as the RX
20468 only supports one such interrupt.
20470 @end table
20472 @emph{Note:} The generic GCC command-line option @option{-ffixed-@var{reg}}
20473 has special significance to the RX port when used with the
20474 @code{interrupt} function attribute.  This attribute indicates a
20475 function intended to process fast interrupts.  GCC ensures
20476 that it only uses the registers @code{r10}, @code{r11}, @code{r12}
20477 and/or @code{r13} and only provided that the normal use of the
20478 corresponding registers have been restricted via the
20479 @option{-ffixed-@var{reg}} or @option{-mint-register} command-line
20480 options.
20482 @node S/390 and zSeries Options
20483 @subsection S/390 and zSeries Options
20484 @cindex S/390 and zSeries Options
20486 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
20488 @table @gcctabopt
20489 @item -mhard-float
20490 @itemx -msoft-float
20491 @opindex mhard-float
20492 @opindex msoft-float
20493 Use (do not use) the hardware floating-point instructions and registers
20494 for floating-point operations.  When @option{-msoft-float} is specified,
20495 functions in @file{libgcc.a} are used to perform floating-point
20496 operations.  When @option{-mhard-float} is specified, the compiler
20497 generates IEEE floating-point instructions.  This is the default.
20499 @item -mhard-dfp
20500 @itemx -mno-hard-dfp
20501 @opindex mhard-dfp
20502 @opindex mno-hard-dfp
20503 Use (do not use) the hardware decimal-floating-point instructions for
20504 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
20505 specified, functions in @file{libgcc.a} are used to perform
20506 decimal-floating-point operations.  When @option{-mhard-dfp} is
20507 specified, the compiler generates decimal-floating-point hardware
20508 instructions.  This is the default for @option{-march=z9-ec} or higher.
20510 @item -mlong-double-64
20511 @itemx -mlong-double-128
20512 @opindex mlong-double-64
20513 @opindex mlong-double-128
20514 These switches control the size of @code{long double} type. A size
20515 of 64 bits makes the @code{long double} type equivalent to the @code{double}
20516 type. This is the default.
20518 @item -mbackchain
20519 @itemx -mno-backchain
20520 @opindex mbackchain
20521 @opindex mno-backchain
20522 Store (do not store) the address of the caller's frame as backchain pointer
20523 into the callee's stack frame.
20524 A backchain may be needed to allow debugging using tools that do not understand
20525 DWARF 2 call frame information.
20526 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
20527 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
20528 the backchain is placed into the topmost word of the 96/160 byte register
20529 save area.
20531 In general, code compiled with @option{-mbackchain} is call-compatible with
20532 code compiled with @option{-mmo-backchain}; however, use of the backchain
20533 for debugging purposes usually requires that the whole binary is built with
20534 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
20535 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
20536 to build a linux kernel use @option{-msoft-float}.
20538 The default is to not maintain the backchain.
20540 @item -mpacked-stack
20541 @itemx -mno-packed-stack
20542 @opindex mpacked-stack
20543 @opindex mno-packed-stack
20544 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
20545 specified, the compiler uses the all fields of the 96/160 byte register save
20546 area only for their default purpose; unused fields still take up stack space.
20547 When @option{-mpacked-stack} is specified, register save slots are densely
20548 packed at the top of the register save area; unused space is reused for other
20549 purposes, allowing for more efficient use of the available stack space.
20550 However, when @option{-mbackchain} is also in effect, the topmost word of
20551 the save area is always used to store the backchain, and the return address
20552 register is always saved two words below the backchain.
20554 As long as the stack frame backchain is not used, code generated with
20555 @option{-mpacked-stack} is call-compatible with code generated with
20556 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
20557 S/390 or zSeries generated code that uses the stack frame backchain at run
20558 time, not just for debugging purposes.  Such code is not call-compatible
20559 with code compiled with @option{-mpacked-stack}.  Also, note that the
20560 combination of @option{-mbackchain},
20561 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
20562 to build a linux kernel use @option{-msoft-float}.
20564 The default is to not use the packed stack layout.
20566 @item -msmall-exec
20567 @itemx -mno-small-exec
20568 @opindex msmall-exec
20569 @opindex mno-small-exec
20570 Generate (or do not generate) code using the @code{bras} instruction
20571 to do subroutine calls.
20572 This only works reliably if the total executable size does not
20573 exceed 64k.  The default is to use the @code{basr} instruction instead,
20574 which does not have this limitation.
20576 @item -m64
20577 @itemx -m31
20578 @opindex m64
20579 @opindex m31
20580 When @option{-m31} is specified, generate code compliant to the
20581 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
20582 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
20583 particular to generate 64-bit instructions.  For the @samp{s390}
20584 targets, the default is @option{-m31}, while the @samp{s390x}
20585 targets default to @option{-m64}.
20587 @item -mzarch
20588 @itemx -mesa
20589 @opindex mzarch
20590 @opindex mesa
20591 When @option{-mzarch} is specified, generate code using the
20592 instructions available on z/Architecture.
20593 When @option{-mesa} is specified, generate code using the
20594 instructions available on ESA/390.  Note that @option{-mesa} is
20595 not possible with @option{-m64}.
20596 When generating code compliant to the GNU/Linux for S/390 ABI,
20597 the default is @option{-mesa}.  When generating code compliant
20598 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
20600 @item -mmvcle
20601 @itemx -mno-mvcle
20602 @opindex mmvcle
20603 @opindex mno-mvcle
20604 Generate (or do not generate) code using the @code{mvcle} instruction
20605 to perform block moves.  When @option{-mno-mvcle} is specified,
20606 use a @code{mvc} loop instead.  This is the default unless optimizing for
20607 size.
20609 @item -mdebug
20610 @itemx -mno-debug
20611 @opindex mdebug
20612 @opindex mno-debug
20613 Print (or do not print) additional debug information when compiling.
20614 The default is to not print debug information.
20616 @item -march=@var{cpu-type}
20617 @opindex march
20618 Generate code that runs on @var{cpu-type}, which is the name of a system
20619 representing a certain processor type.  Possible values for
20620 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, @samp{z990},
20621 @samp{z9-109}, @samp{z9-ec} and @samp{z10}.
20622 When generating code using the instructions available on z/Architecture,
20623 the default is @option{-march=z900}.  Otherwise, the default is
20624 @option{-march=g5}.
20626 @item -mtune=@var{cpu-type}
20627 @opindex mtune
20628 Tune to @var{cpu-type} everything applicable about the generated code,
20629 except for the ABI and the set of available instructions.
20630 The list of @var{cpu-type} values is the same as for @option{-march}.
20631 The default is the value used for @option{-march}.
20633 @item -mtpf-trace
20634 @itemx -mno-tpf-trace
20635 @opindex mtpf-trace
20636 @opindex mno-tpf-trace
20637 Generate code that adds (does not add) in TPF OS specific branches to trace
20638 routines in the operating system.  This option is off by default, even
20639 when compiling for the TPF OS@.
20641 @item -mfused-madd
20642 @itemx -mno-fused-madd
20643 @opindex mfused-madd
20644 @opindex mno-fused-madd
20645 Generate code that uses (does not use) the floating-point multiply and
20646 accumulate instructions.  These instructions are generated by default if
20647 hardware floating point is used.
20649 @item -mwarn-framesize=@var{framesize}
20650 @opindex mwarn-framesize
20651 Emit a warning if the current function exceeds the given frame size.  Because
20652 this is a compile-time check it doesn't need to be a real problem when the program
20653 runs.  It is intended to identify functions that most probably cause
20654 a stack overflow.  It is useful to be used in an environment with limited stack
20655 size e.g.@: the linux kernel.
20657 @item -mwarn-dynamicstack
20658 @opindex mwarn-dynamicstack
20659 Emit a warning if the function calls @code{alloca} or uses dynamically-sized
20660 arrays.  This is generally a bad idea with a limited stack size.
20662 @item -mstack-guard=@var{stack-guard}
20663 @itemx -mstack-size=@var{stack-size}
20664 @opindex mstack-guard
20665 @opindex mstack-size
20666 If these options are provided the S/390 back end emits additional instructions in
20667 the function prologue that trigger a trap if the stack size is @var{stack-guard}
20668 bytes above the @var{stack-size} (remember that the stack on S/390 grows downward).
20669 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
20670 the frame size of the compiled function is chosen.
20671 These options are intended to be used to help debugging stack overflow problems.
20672 The additionally emitted code causes only little overhead and hence can also be
20673 used in production-like systems without greater performance degradation.  The given
20674 values have to be exact powers of 2 and @var{stack-size} has to be greater than
20675 @var{stack-guard} without exceeding 64k.
20676 In order to be efficient the extra code makes the assumption that the stack starts
20677 at an address aligned to the value given by @var{stack-size}.
20678 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
20680 @item -mhotpatch[=@var{halfwords}]
20681 @itemx -mno-hotpatch
20682 @opindex mhotpatch
20683 If the hotpatch option is enabled, a ``hot-patching'' function
20684 prologue is generated for all functions in the compilation unit.
20685 The funtion label is prepended with the given number of two-byte
20686 Nop instructions (@var{halfwords}, maximum 1000000) or 12 Nop
20687 instructions if no argument is present.  Functions with a
20688 hot-patching prologue are never inlined automatically, and a
20689 hot-patching prologue is never generated for functions functions
20690 that are explicitly inline.
20692 This option can be overridden for individual functions with the
20693 @code{hotpatch} attribute.
20694 @end table
20696 @node Score Options
20697 @subsection Score Options
20698 @cindex Score Options
20700 These options are defined for Score implementations:
20702 @table @gcctabopt
20703 @item -meb
20704 @opindex meb
20705 Compile code for big-endian mode.  This is the default.
20707 @item -mel
20708 @opindex mel
20709 Compile code for little-endian mode.
20711 @item -mnhwloop
20712 @opindex mnhwloop
20713 Disable generation of @code{bcnz} instructions.
20715 @item -muls
20716 @opindex muls
20717 Enable generation of unaligned load and store instructions.
20719 @item -mmac
20720 @opindex mmac
20721 Enable the use of multiply-accumulate instructions. Disabled by default.
20723 @item -mscore5
20724 @opindex mscore5
20725 Specify the SCORE5 as the target architecture.
20727 @item -mscore5u
20728 @opindex mscore5u
20729 Specify the SCORE5U of the target architecture.
20731 @item -mscore7
20732 @opindex mscore7
20733 Specify the SCORE7 as the target architecture. This is the default.
20735 @item -mscore7d
20736 @opindex mscore7d
20737 Specify the SCORE7D as the target architecture.
20738 @end table
20740 @node SH Options
20741 @subsection SH Options
20743 These @samp{-m} options are defined for the SH implementations:
20745 @table @gcctabopt
20746 @item -m1
20747 @opindex m1
20748 Generate code for the SH1.
20750 @item -m2
20751 @opindex m2
20752 Generate code for the SH2.
20754 @item -m2e
20755 Generate code for the SH2e.
20757 @item -m2a-nofpu
20758 @opindex m2a-nofpu
20759 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a way
20760 that the floating-point unit is not used.
20762 @item -m2a-single-only
20763 @opindex m2a-single-only
20764 Generate code for the SH2a-FPU, in such a way that no double-precision
20765 floating-point operations are used.
20767 @item -m2a-single
20768 @opindex m2a-single
20769 Generate code for the SH2a-FPU assuming the floating-point unit is in
20770 single-precision mode by default.
20772 @item -m2a
20773 @opindex m2a
20774 Generate code for the SH2a-FPU assuming the floating-point unit is in
20775 double-precision mode by default.
20777 @item -m3
20778 @opindex m3
20779 Generate code for the SH3.
20781 @item -m3e
20782 @opindex m3e
20783 Generate code for the SH3e.
20785 @item -m4-nofpu
20786 @opindex m4-nofpu
20787 Generate code for the SH4 without a floating-point unit.
20789 @item -m4-single-only
20790 @opindex m4-single-only
20791 Generate code for the SH4 with a floating-point unit that only
20792 supports single-precision arithmetic.
20794 @item -m4-single
20795 @opindex m4-single
20796 Generate code for the SH4 assuming the floating-point unit is in
20797 single-precision mode by default.
20799 @item -m4
20800 @opindex m4
20801 Generate code for the SH4.
20803 @item -m4-100
20804 @opindex m4-100
20805 Generate code for SH4-100.
20807 @item -m4-100-nofpu
20808 @opindex m4-100-nofpu
20809 Generate code for SH4-100 in such a way that the
20810 floating-point unit is not used.
20812 @item -m4-100-single
20813 @opindex m4-100-single
20814 Generate code for SH4-100 assuming the floating-point unit is in
20815 single-precision mode by default.
20817 @item -m4-100-single-only
20818 @opindex m4-100-single-only
20819 Generate code for SH4-100 in such a way that no double-precision
20820 floating-point operations are used.
20822 @item -m4-200
20823 @opindex m4-200
20824 Generate code for SH4-200.
20826 @item -m4-200-nofpu
20827 @opindex m4-200-nofpu
20828 Generate code for SH4-200 without in such a way that the
20829 floating-point unit is not used.
20831 @item -m4-200-single
20832 @opindex m4-200-single
20833 Generate code for SH4-200 assuming the floating-point unit is in
20834 single-precision mode by default.
20836 @item -m4-200-single-only
20837 @opindex m4-200-single-only
20838 Generate code for SH4-200 in such a way that no double-precision
20839 floating-point operations are used.
20841 @item -m4-300
20842 @opindex m4-300
20843 Generate code for SH4-300.
20845 @item -m4-300-nofpu
20846 @opindex m4-300-nofpu
20847 Generate code for SH4-300 without in such a way that the
20848 floating-point unit is not used.
20850 @item -m4-300-single
20851 @opindex m4-300-single
20852 Generate code for SH4-300 in such a way that no double-precision
20853 floating-point operations are used.
20855 @item -m4-300-single-only
20856 @opindex m4-300-single-only
20857 Generate code for SH4-300 in such a way that no double-precision
20858 floating-point operations are used.
20860 @item -m4-340
20861 @opindex m4-340
20862 Generate code for SH4-340 (no MMU, no FPU).
20864 @item -m4-500
20865 @opindex m4-500
20866 Generate code for SH4-500 (no FPU).  Passes @option{-isa=sh4-nofpu} to the
20867 assembler.
20869 @item -m4a-nofpu
20870 @opindex m4a-nofpu
20871 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
20872 floating-point unit is not used.
20874 @item -m4a-single-only
20875 @opindex m4a-single-only
20876 Generate code for the SH4a, in such a way that no double-precision
20877 floating-point operations are used.
20879 @item -m4a-single
20880 @opindex m4a-single
20881 Generate code for the SH4a assuming the floating-point unit is in
20882 single-precision mode by default.
20884 @item -m4a
20885 @opindex m4a
20886 Generate code for the SH4a.
20888 @item -m4al
20889 @opindex m4al
20890 Same as @option{-m4a-nofpu}, except that it implicitly passes
20891 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
20892 instructions at the moment.
20894 @item -m5-32media
20895 @opindex m5-32media
20896 Generate 32-bit code for SHmedia.
20898 @item -m5-32media-nofpu
20899 @opindex m5-32media-nofpu
20900 Generate 32-bit code for SHmedia in such a way that the
20901 floating-point unit is not used.
20903 @item -m5-64media
20904 @opindex m5-64media
20905 Generate 64-bit code for SHmedia.
20907 @item -m5-64media-nofpu
20908 @opindex m5-64media-nofpu
20909 Generate 64-bit code for SHmedia in such a way that the
20910 floating-point unit is not used.
20912 @item -m5-compact
20913 @opindex m5-compact
20914 Generate code for SHcompact.
20916 @item -m5-compact-nofpu
20917 @opindex m5-compact-nofpu
20918 Generate code for SHcompact in such a way that the
20919 floating-point unit is not used.
20921 @item -mb
20922 @opindex mb
20923 Compile code for the processor in big-endian mode.
20925 @item -ml
20926 @opindex ml
20927 Compile code for the processor in little-endian mode.
20929 @item -mdalign
20930 @opindex mdalign
20931 Align doubles at 64-bit boundaries.  Note that this changes the calling
20932 conventions, and thus some functions from the standard C library do
20933 not work unless you recompile it first with @option{-mdalign}.
20935 @item -mrelax
20936 @opindex mrelax
20937 Shorten some address references at link time, when possible; uses the
20938 linker option @option{-relax}.
20940 @item -mbigtable
20941 @opindex mbigtable
20942 Use 32-bit offsets in @code{switch} tables.  The default is to use
20943 16-bit offsets.
20945 @item -mbitops
20946 @opindex mbitops
20947 Enable the use of bit manipulation instructions on SH2A.
20949 @item -mfmovd
20950 @opindex mfmovd
20951 Enable the use of the instruction @code{fmovd}.  Check @option{-mdalign} for
20952 alignment constraints.
20954 @item -mrenesas
20955 @opindex mrenesas
20956 Comply with the calling conventions defined by Renesas.
20958 @item -mno-renesas
20959 @opindex mno-renesas
20960 Comply with the calling conventions defined for GCC before the Renesas
20961 conventions were available.  This option is the default for all
20962 targets of the SH toolchain.
20964 @item -mnomacsave
20965 @opindex mnomacsave
20966 Mark the @code{MAC} register as call-clobbered, even if
20967 @option{-mrenesas} is given.
20969 @item -mieee
20970 @itemx -mno-ieee
20971 @opindex mieee
20972 @opindex mno-ieee
20973 Control the IEEE compliance of floating-point comparisons, which affects the
20974 handling of cases where the result of a comparison is unordered.  By default
20975 @option{-mieee} is implicitly enabled.  If @option{-ffinite-math-only} is
20976 enabled @option{-mno-ieee} is implicitly set, which results in faster
20977 floating-point greater-equal and less-equal comparisons.  The implcit settings
20978 can be overridden by specifying either @option{-mieee} or @option{-mno-ieee}.
20980 @item -minline-ic_invalidate
20981 @opindex minline-ic_invalidate
20982 Inline code to invalidate instruction cache entries after setting up
20983 nested function trampolines.
20984 This option has no effect if @option{-musermode} is in effect and the selected
20985 code generation option (e.g. @option{-m4}) does not allow the use of the @code{icbi}
20986 instruction.
20987 If the selected code generation option does not allow the use of the @code{icbi}
20988 instruction, and @option{-musermode} is not in effect, the inlined code
20989 manipulates the instruction cache address array directly with an associative
20990 write.  This not only requires privileged mode at run time, but it also
20991 fails if the cache line had been mapped via the TLB and has become unmapped.
20993 @item -misize
20994 @opindex misize
20995 Dump instruction size and location in the assembly code.
20997 @item -mpadstruct
20998 @opindex mpadstruct
20999 This option is deprecated.  It pads structures to multiple of 4 bytes,
21000 which is incompatible with the SH ABI@.
21002 @item -matomic-model=@var{model}
21003 @opindex matomic-model=@var{model}
21004 Sets the model of atomic operations and additional parameters as a comma
21005 separated list.  For details on the atomic built-in functions see
21006 @ref{__atomic Builtins}.  The following models and parameters are supported:
21008 @table @samp
21010 @item none
21011 Disable compiler generated atomic sequences and emit library calls for atomic
21012 operations.  This is the default if the target is not @code{sh*-*-linux*}.
21014 @item soft-gusa
21015 Generate GNU/Linux compatible gUSA software atomic sequences for the atomic
21016 built-in functions.  The generated atomic sequences require additional support
21017 from the interrupt/exception handling code of the system and are only suitable
21018 for SH3* and SH4* single-core systems.  This option is enabled by default when
21019 the target is @code{sh*-*-linux*} and SH3* or SH4*.  When the target is SH4A,
21020 this option will also partially utilize the hardware atomic instructions
21021 @code{movli.l} and @code{movco.l} to create more efficient code, unless
21022 @samp{strict} is specified.  
21024 @item soft-tcb
21025 Generate software atomic sequences that use a variable in the thread control
21026 block.  This is a variation of the gUSA sequences which can also be used on
21027 SH1* and SH2* targets.  The generated atomic sequences require additional
21028 support from the interrupt/exception handling code of the system and are only
21029 suitable for single-core systems.  When using this model, the @samp{gbr-offset=}
21030 parameter has to be specified as well.
21032 @item soft-imask
21033 Generate software atomic sequences that temporarily disable interrupts by
21034 setting @code{SR.IMASK = 1111}.  This model works only when the program runs
21035 in privileged mode and is only suitable for single-core systems.  Additional
21036 support from the interrupt/exception handling code of the system is not
21037 required.  This model is enabled by default when the target is
21038 @code{sh*-*-linux*} and SH1* or SH2*.
21040 @item hard-llcs
21041 Generate hardware atomic sequences using the @code{movli.l} and @code{movco.l}
21042 instructions only.  This is only available on SH4A and is suitable for
21043 multi-core systems.  Since the hardware instructions support only 32 bit atomic
21044 variables access to 8 or 16 bit variables is emulated with 32 bit accesses.
21045 Code compiled with this option will also be compatible with other software
21046 atomic model interrupt/exception handling systems if executed on an SH4A
21047 system.  Additional support from the interrupt/exception handling code of the
21048 system is not required for this model.
21050 @item gbr-offset=
21051 This parameter specifies the offset in bytes of the variable in the thread
21052 control block structure that should be used by the generated atomic sequences
21053 when the @samp{soft-tcb} model has been selected.  For other models this
21054 parameter is ignored.  The specified value must be an integer multiple of four
21055 and in the range 0-1020.
21057 @item strict
21058 This parameter prevents mixed usage of multiple atomic models, even though they
21059 would be compatible, and will make the compiler generate atomic sequences of the
21060 specified model only.
21062 @end table
21064 @item -mtas
21065 @opindex mtas
21066 Generate the @code{tas.b} opcode for @code{__atomic_test_and_set}.
21067 Notice that depending on the particular hardware and software configuration
21068 this can degrade overall performance due to the operand cache line flushes
21069 that are implied by the @code{tas.b} instruction.  On multi-core SH4A
21070 processors the @code{tas.b} instruction must be used with caution since it
21071 can result in data corruption for certain cache configurations.
21073 @item -mprefergot
21074 @opindex mprefergot
21075 When generating position-independent code, emit function calls using
21076 the Global Offset Table instead of the Procedure Linkage Table.
21078 @item -musermode
21079 @itemx -mno-usermode
21080 @opindex musermode
21081 @opindex mno-usermode
21082 Don't allow (allow) the compiler generating privileged mode code.  Specifying
21083 @option{-musermode} also implies @option{-mno-inline-ic_invalidate} if the
21084 inlined code would not work in user mode.  @option{-musermode} is the default
21085 when the target is @code{sh*-*-linux*}.  If the target is SH1* or SH2*
21086 @option{-musermode} has no effect, since there is no user mode.
21088 @item -multcost=@var{number}
21089 @opindex multcost=@var{number}
21090 Set the cost to assume for a multiply insn.
21092 @item -mdiv=@var{strategy}
21093 @opindex mdiv=@var{strategy}
21094 Set the division strategy to be used for integer division operations.
21095 For SHmedia @var{strategy} can be one of: 
21097 @table @samp
21099 @item fp 
21100 Performs the operation in floating point.  This has a very high latency,
21101 but needs only a few instructions, so it might be a good choice if
21102 your code has enough easily-exploitable ILP to allow the compiler to
21103 schedule the floating-point instructions together with other instructions.
21104 Division by zero causes a floating-point exception.
21106 @item inv
21107 Uses integer operations to calculate the inverse of the divisor,
21108 and then multiplies the dividend with the inverse.  This strategy allows
21109 CSE and hoisting of the inverse calculation.  Division by zero calculates
21110 an unspecified result, but does not trap.
21112 @item inv:minlat
21113 A variant of @samp{inv} where, if no CSE or hoisting opportunities
21114 have been found, or if the entire operation has been hoisted to the same
21115 place, the last stages of the inverse calculation are intertwined with the
21116 final multiply to reduce the overall latency, at the expense of using a few
21117 more instructions, and thus offering fewer scheduling opportunities with
21118 other code.
21120 @item call
21121 Calls a library function that usually implements the @samp{inv:minlat}
21122 strategy.
21123 This gives high code density for @code{m5-*media-nofpu} compilations.
21125 @item call2
21126 Uses a different entry point of the same library function, where it
21127 assumes that a pointer to a lookup table has already been set up, which
21128 exposes the pointer load to CSE and code hoisting optimizations.
21130 @item inv:call
21131 @itemx inv:call2
21132 @itemx inv:fp
21133 Use the @samp{inv} algorithm for initial
21134 code generation, but if the code stays unoptimized, revert to the @samp{call},
21135 @samp{call2}, or @samp{fp} strategies, respectively.  Note that the
21136 potentially-trapping side effect of division by zero is carried by a
21137 separate instruction, so it is possible that all the integer instructions
21138 are hoisted out, but the marker for the side effect stays where it is.
21139 A recombination to floating-point operations or a call is not possible
21140 in that case.
21142 @item inv20u
21143 @itemx inv20l
21144 Variants of the @samp{inv:minlat} strategy.  In the case
21145 that the inverse calculation is not separated from the multiply, they speed
21146 up division where the dividend fits into 20 bits (plus sign where applicable)
21147 by inserting a test to skip a number of operations in this case; this test
21148 slows down the case of larger dividends.  @samp{inv20u} assumes the case of a such
21149 a small dividend to be unlikely, and @samp{inv20l} assumes it to be likely.
21151 @end table
21153 For targets other than SHmedia @var{strategy} can be one of:
21155 @table @samp
21157 @item call-div1
21158 Calls a library function that uses the single-step division instruction
21159 @code{div1} to perform the operation.  Division by zero calculates an
21160 unspecified result and does not trap.  This is the default except for SH4,
21161 SH2A and SHcompact.
21163 @item call-fp
21164 Calls a library function that performs the operation in double precision
21165 floating point.  Division by zero causes a floating-point exception.  This is
21166 the default for SHcompact with FPU.  Specifying this for targets that do not
21167 have a double precision FPU will default to @code{call-div1}.
21169 @item call-table
21170 Calls a library function that uses a lookup table for small divisors and
21171 the @code{div1} instruction with case distinction for larger divisors.  Division
21172 by zero calculates an unspecified result and does not trap.  This is the default
21173 for SH4.  Specifying this for targets that do not have dynamic shift
21174 instructions will default to @code{call-div1}.
21176 @end table
21178 When a division strategy has not been specified the default strategy will be
21179 selected based on the current target.  For SH2A the default strategy is to
21180 use the @code{divs} and @code{divu} instructions instead of library function
21181 calls.
21183 @item -maccumulate-outgoing-args
21184 @opindex maccumulate-outgoing-args
21185 Reserve space once for outgoing arguments in the function prologue rather
21186 than around each call.  Generally beneficial for performance and size.  Also
21187 needed for unwinding to avoid changing the stack frame around conditional code.
21189 @item -mdivsi3_libfunc=@var{name}
21190 @opindex mdivsi3_libfunc=@var{name}
21191 Set the name of the library function used for 32-bit signed division to
21192 @var{name}.
21193 This only affects the name used in the @samp{call} and @samp{inv:call}
21194 division strategies, and the compiler still expects the same
21195 sets of input/output/clobbered registers as if this option were not present.
21197 @item -mfixed-range=@var{register-range}
21198 @opindex mfixed-range
21199 Generate code treating the given register range as fixed registers.
21200 A fixed register is one that the register allocator can not use.  This is
21201 useful when compiling kernel code.  A register range is specified as
21202 two registers separated by a dash.  Multiple register ranges can be
21203 specified separated by a comma.
21205 @item -mindexed-addressing
21206 @opindex mindexed-addressing
21207 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
21208 This is only safe if the hardware and/or OS implement 32-bit wrap-around
21209 semantics for the indexed addressing mode.  The architecture allows the
21210 implementation of processors with 64-bit MMU, which the OS could use to
21211 get 32-bit addressing, but since no current hardware implementation supports
21212 this or any other way to make the indexed addressing mode safe to use in
21213 the 32-bit ABI, the default is @option{-mno-indexed-addressing}.
21215 @item -mgettrcost=@var{number}
21216 @opindex mgettrcost=@var{number}
21217 Set the cost assumed for the @code{gettr} instruction to @var{number}.
21218 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
21220 @item -mpt-fixed
21221 @opindex mpt-fixed
21222 Assume @code{pt*} instructions won't trap.  This generally generates
21223 better-scheduled code, but is unsafe on current hardware.
21224 The current architecture
21225 definition says that @code{ptabs} and @code{ptrel} trap when the target 
21226 anded with 3 is 3.
21227 This has the unintentional effect of making it unsafe to schedule these
21228 instructions before a branch, or hoist them out of a loop.  For example,
21229 @code{__do_global_ctors}, a part of @file{libgcc}
21230 that runs constructors at program
21231 startup, calls functions in a list which is delimited by @minus{}1.  With the
21232 @option{-mpt-fixed} option, the @code{ptabs} is done before testing against @minus{}1.
21233 That means that all the constructors run a bit more quickly, but when
21234 the loop comes to the end of the list, the program crashes because @code{ptabs}
21235 loads @minus{}1 into a target register.  
21237 Since this option is unsafe for any
21238 hardware implementing the current architecture specification, the default
21239 is @option{-mno-pt-fixed}.  Unless specified explicitly with 
21240 @option{-mgettrcost}, @option{-mno-pt-fixed} also implies @option{-mgettrcost=100};
21241 this deters register allocation from using target registers for storing
21242 ordinary integers.
21244 @item -minvalid-symbols
21245 @opindex minvalid-symbols
21246 Assume symbols might be invalid.  Ordinary function symbols generated by
21247 the compiler are always valid to load with
21248 @code{movi}/@code{shori}/@code{ptabs} or
21249 @code{movi}/@code{shori}/@code{ptrel},
21250 but with assembler and/or linker tricks it is possible
21251 to generate symbols that cause @code{ptabs} or @code{ptrel} to trap.
21252 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
21253 It prevents cross-basic-block CSE, hoisting and most scheduling
21254 of symbol loads.  The default is @option{-mno-invalid-symbols}.
21256 @item -mbranch-cost=@var{num}
21257 @opindex mbranch-cost=@var{num}
21258 Assume @var{num} to be the cost for a branch instruction.  Higher numbers
21259 make the compiler try to generate more branch-free code if possible.  
21260 If not specified the value is selected depending on the processor type that
21261 is being compiled for.
21263 @item -mzdcbranch
21264 @itemx -mno-zdcbranch
21265 @opindex mzdcbranch
21266 @opindex mno-zdcbranch
21267 Assume (do not assume) that zero displacement conditional branch instructions
21268 @code{bt} and @code{bf} are fast.  If @option{-mzdcbranch} is specified, the
21269 compiler will try to prefer zero displacement branch code sequences.  This is
21270 enabled by default when generating code for SH4 and SH4A.  It can be explicitly
21271 disabled by specifying @option{-mno-zdcbranch}.
21273 @item -mfused-madd
21274 @itemx -mno-fused-madd
21275 @opindex mfused-madd
21276 @opindex mno-fused-madd
21277 Generate code that uses (does not use) the floating-point multiply and
21278 accumulate instructions.  These instructions are generated by default
21279 if hardware floating point is used.  The machine-dependent
21280 @option{-mfused-madd} option is now mapped to the machine-independent
21281 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
21282 mapped to @option{-ffp-contract=off}.
21284 @item -mfsca
21285 @itemx -mno-fsca
21286 @opindex mfsca
21287 @opindex mno-fsca
21288 Allow or disallow the compiler to emit the @code{fsca} instruction for sine
21289 and cosine approximations.  The option @code{-mfsca} must be used in
21290 combination with @code{-funsafe-math-optimizations}.  It is enabled by default
21291 when generating code for SH4A.  Using @code{-mno-fsca} disables sine and cosine
21292 approximations even if @code{-funsafe-math-optimizations} is in effect.
21294 @item -mfsrra
21295 @itemx -mno-fsrra
21296 @opindex mfsrra
21297 @opindex mno-fsrra
21298 Allow or disallow the compiler to emit the @code{fsrra} instruction for
21299 reciprocal square root approximations.  The option @code{-mfsrra} must be used
21300 in combination with @code{-funsafe-math-optimizations} and
21301 @code{-ffinite-math-only}.  It is enabled by default when generating code for
21302 SH4A.  Using @code{-mno-fsrra} disables reciprocal square root approximations
21303 even if @code{-funsafe-math-optimizations} and @code{-ffinite-math-only} are
21304 in effect.
21306 @item -mpretend-cmove
21307 @opindex mpretend-cmove
21308 Prefer zero-displacement conditional branches for conditional move instruction
21309 patterns.  This can result in faster code on the SH4 processor.
21311 @end table
21313 @node Solaris 2 Options
21314 @subsection Solaris 2 Options
21315 @cindex Solaris 2 options
21317 These @samp{-m} options are supported on Solaris 2:
21319 @table @gcctabopt
21320 @item -mclear-hwcap
21321 @opindex mclear-hwcap
21322 @option{-mclear-hwcap} tells the compiler to remove the hardware
21323 capabilities generated by the Solaris assembler.  This is only necessary
21324 when object files use ISA extensions not supported by the current
21325 machine, but check at runtime whether or not to use them.
21327 @item -mimpure-text
21328 @opindex mimpure-text
21329 @option{-mimpure-text}, used in addition to @option{-shared}, tells
21330 the compiler to not pass @option{-z text} to the linker when linking a
21331 shared object.  Using this option, you can link position-dependent
21332 code into a shared object.
21334 @option{-mimpure-text} suppresses the ``relocations remain against
21335 allocatable but non-writable sections'' linker error message.
21336 However, the necessary relocations trigger copy-on-write, and the
21337 shared object is not actually shared across processes.  Instead of
21338 using @option{-mimpure-text}, you should compile all source code with
21339 @option{-fpic} or @option{-fPIC}.
21341 @end table
21343 These switches are supported in addition to the above on Solaris 2:
21345 @table @gcctabopt
21346 @item -pthreads
21347 @opindex pthreads
21348 Add support for multithreading using the POSIX threads library.  This
21349 option sets flags for both the preprocessor and linker.  This option does
21350 not affect the thread safety of object code produced  by the compiler or
21351 that of libraries supplied with it.
21353 @item -pthread
21354 @opindex pthread
21355 This is a synonym for @option{-pthreads}.
21356 @end table
21358 @node SPARC Options
21359 @subsection SPARC Options
21360 @cindex SPARC options
21362 These @samp{-m} options are supported on the SPARC:
21364 @table @gcctabopt
21365 @item -mno-app-regs
21366 @itemx -mapp-regs
21367 @opindex mno-app-regs
21368 @opindex mapp-regs
21369 Specify @option{-mapp-regs} to generate output using the global registers
21370 2 through 4, which the SPARC SVR4 ABI reserves for applications.  Like the
21371 global register 1, each global register 2 through 4 is then treated as an
21372 allocable register that is clobbered by function calls.  This is the default.
21374 To be fully SVR4 ABI-compliant at the cost of some performance loss,
21375 specify @option{-mno-app-regs}.  You should compile libraries and system
21376 software with this option.
21378 @item -mflat
21379 @itemx -mno-flat
21380 @opindex mflat
21381 @opindex mno-flat
21382 With @option{-mflat}, the compiler does not generate save/restore instructions
21383 and uses a ``flat'' or single register window model.  This model is compatible
21384 with the regular register window model.  The local registers and the input
21385 registers (0--5) are still treated as ``call-saved'' registers and are
21386 saved on the stack as needed.
21388 With @option{-mno-flat} (the default), the compiler generates save/restore
21389 instructions (except for leaf functions).  This is the normal operating mode.
21391 @item -mfpu
21392 @itemx -mhard-float
21393 @opindex mfpu
21394 @opindex mhard-float
21395 Generate output containing floating-point instructions.  This is the
21396 default.
21398 @item -mno-fpu
21399 @itemx -msoft-float
21400 @opindex mno-fpu
21401 @opindex msoft-float
21402 Generate output containing library calls for floating point.
21403 @strong{Warning:} the requisite libraries are not available for all SPARC
21404 targets.  Normally the facilities of the machine's usual C compiler are
21405 used, but this cannot be done directly in cross-compilation.  You must make
21406 your own arrangements to provide suitable library functions for
21407 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
21408 @samp{sparclite-*-*} do provide software floating-point support.
21410 @option{-msoft-float} changes the calling convention in the output file;
21411 therefore, it is only useful if you compile @emph{all} of a program with
21412 this option.  In particular, you need to compile @file{libgcc.a}, the
21413 library that comes with GCC, with @option{-msoft-float} in order for
21414 this to work.
21416 @item -mhard-quad-float
21417 @opindex mhard-quad-float
21418 Generate output containing quad-word (long double) floating-point
21419 instructions.
21421 @item -msoft-quad-float
21422 @opindex msoft-quad-float
21423 Generate output containing library calls for quad-word (long double)
21424 floating-point instructions.  The functions called are those specified
21425 in the SPARC ABI@.  This is the default.
21427 As of this writing, there are no SPARC implementations that have hardware
21428 support for the quad-word floating-point instructions.  They all invoke
21429 a trap handler for one of these instructions, and then the trap handler
21430 emulates the effect of the instruction.  Because of the trap handler overhead,
21431 this is much slower than calling the ABI library routines.  Thus the
21432 @option{-msoft-quad-float} option is the default.
21434 @item -mno-unaligned-doubles
21435 @itemx -munaligned-doubles
21436 @opindex mno-unaligned-doubles
21437 @opindex munaligned-doubles
21438 Assume that doubles have 8-byte alignment.  This is the default.
21440 With @option{-munaligned-doubles}, GCC assumes that doubles have 8-byte
21441 alignment only if they are contained in another type, or if they have an
21442 absolute address.  Otherwise, it assumes they have 4-byte alignment.
21443 Specifying this option avoids some rare compatibility problems with code
21444 generated by other compilers.  It is not the default because it results
21445 in a performance loss, especially for floating-point code.
21447 @item -muser-mode
21448 @itemx -mno-user-mode
21449 @opindex muser-mode
21450 @opindex mno-user-mode
21451 Do not generate code that can only run in supervisor mode.  This is relevant
21452 only for the @code{casa} instruction emitted for the LEON3 processor.  The
21453 default is @option{-mno-user-mode}.
21455 @item -mno-faster-structs
21456 @itemx -mfaster-structs
21457 @opindex mno-faster-structs
21458 @opindex mfaster-structs
21459 With @option{-mfaster-structs}, the compiler assumes that structures
21460 should have 8-byte alignment.  This enables the use of pairs of
21461 @code{ldd} and @code{std} instructions for copies in structure
21462 assignment, in place of twice as many @code{ld} and @code{st} pairs.
21463 However, the use of this changed alignment directly violates the SPARC
21464 ABI@.  Thus, it's intended only for use on targets where the developer
21465 acknowledges that their resulting code is not directly in line with
21466 the rules of the ABI@.
21468 @item -mcpu=@var{cpu_type}
21469 @opindex mcpu
21470 Set the instruction set, register set, and instruction scheduling parameters
21471 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
21472 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{hypersparc},
21473 @samp{leon}, @samp{leon3}, @samp{leon3v7}, @samp{sparclite}, @samp{f930},
21474 @samp{f934}, @samp{sparclite86x}, @samp{sparclet}, @samp{tsc701}, @samp{v9},
21475 @samp{ultrasparc}, @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2},
21476 @samp{niagara3} and @samp{niagara4}.
21478 Native Solaris and GNU/Linux toolchains also support the value @samp{native},
21479 which selects the best architecture option for the host processor.
21480 @option{-mcpu=native} has no effect if GCC does not recognize
21481 the processor.
21483 Default instruction scheduling parameters are used for values that select
21484 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
21485 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
21487 Here is a list of each supported architecture and their supported
21488 implementations.
21490 @table @asis
21491 @item v7
21492 cypress, leon3v7
21494 @item v8
21495 supersparc, hypersparc, leon, leon3
21497 @item sparclite
21498 f930, f934, sparclite86x
21500 @item sparclet
21501 tsc701
21503 @item v9
21504 ultrasparc, ultrasparc3, niagara, niagara2, niagara3, niagara4
21505 @end table
21507 By default (unless configured otherwise), GCC generates code for the V7
21508 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
21509 additionally optimizes it for the Cypress CY7C602 chip, as used in the
21510 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
21511 SPARCStation 1, 2, IPX etc.
21513 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
21514 architecture.  The only difference from V7 code is that the compiler emits
21515 the integer multiply and integer divide instructions which exist in SPARC-V8
21516 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
21517 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
21518 2000 series.
21520 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
21521 the SPARC architecture.  This adds the integer multiply, integer divide step
21522 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
21523 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
21524 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
21525 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
21526 MB86934 chip, which is the more recent SPARClite with FPU@.
21528 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
21529 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
21530 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
21531 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
21532 optimizes it for the TEMIC SPARClet chip.
21534 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
21535 architecture.  This adds 64-bit integer and floating-point move instructions,
21536 3 additional floating-point condition code registers and conditional move
21537 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
21538 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
21539 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
21540 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
21541 @option{-mcpu=niagara}, the compiler additionally optimizes it for
21542 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
21543 additionally optimizes it for Sun UltraSPARC T2 chips. With
21544 @option{-mcpu=niagara3}, the compiler additionally optimizes it for Sun
21545 UltraSPARC T3 chips.  With @option{-mcpu=niagara4}, the compiler
21546 additionally optimizes it for Sun UltraSPARC T4 chips.
21548 @item -mtune=@var{cpu_type}
21549 @opindex mtune
21550 Set the instruction scheduling parameters for machine type
21551 @var{cpu_type}, but do not set the instruction set or register set that the
21552 option @option{-mcpu=@var{cpu_type}} does.
21554 The same values for @option{-mcpu=@var{cpu_type}} can be used for
21555 @option{-mtune=@var{cpu_type}}, but the only useful values are those
21556 that select a particular CPU implementation.  Those are @samp{cypress},
21557 @samp{supersparc}, @samp{hypersparc}, @samp{leon}, @samp{leon3},
21558 @samp{leon3v7}, @samp{f930}, @samp{f934}, @samp{sparclite86x}, @samp{tsc701},
21559 @samp{ultrasparc}, @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2},
21560 @samp{niagara3} and @samp{niagara4}.  With native Solaris and GNU/Linux
21561 toolchains, @samp{native} can also be used.
21563 @item -mv8plus
21564 @itemx -mno-v8plus
21565 @opindex mv8plus
21566 @opindex mno-v8plus
21567 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
21568 difference from the V8 ABI is that the global and out registers are
21569 considered 64 bits wide.  This is enabled by default on Solaris in 32-bit
21570 mode for all SPARC-V9 processors.
21572 @item -mvis
21573 @itemx -mno-vis
21574 @opindex mvis
21575 @opindex mno-vis
21576 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
21577 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
21579 @item -mvis2
21580 @itemx -mno-vis2
21581 @opindex mvis2
21582 @opindex mno-vis2
21583 With @option{-mvis2}, GCC generates code that takes advantage of
21584 version 2.0 of the UltraSPARC Visual Instruction Set extensions.  The
21585 default is @option{-mvis2} when targeting a cpu that supports such
21586 instructions, such as UltraSPARC-III and later.  Setting @option{-mvis2}
21587 also sets @option{-mvis}.
21589 @item -mvis3
21590 @itemx -mno-vis3
21591 @opindex mvis3
21592 @opindex mno-vis3
21593 With @option{-mvis3}, GCC generates code that takes advantage of
21594 version 3.0 of the UltraSPARC Visual Instruction Set extensions.  The
21595 default is @option{-mvis3} when targeting a cpu that supports such
21596 instructions, such as niagara-3 and later.  Setting @option{-mvis3}
21597 also sets @option{-mvis2} and @option{-mvis}.
21599 @item -mcbcond
21600 @itemx -mno-cbcond
21601 @opindex mcbcond
21602 @opindex mno-cbcond
21603 With @option{-mcbcond}, GCC generates code that takes advantage of
21604 compare-and-branch instructions, as defined in the Sparc Architecture 2011.
21605 The default is @option{-mcbcond} when targeting a cpu that supports such
21606 instructions, such as niagara-4 and later.
21608 @item -mpopc
21609 @itemx -mno-popc
21610 @opindex mpopc
21611 @opindex mno-popc
21612 With @option{-mpopc}, GCC generates code that takes advantage of the UltraSPARC
21613 population count instruction.  The default is @option{-mpopc}
21614 when targeting a cpu that supports such instructions, such as Niagara-2 and
21615 later.
21617 @item -mfmaf
21618 @itemx -mno-fmaf
21619 @opindex mfmaf
21620 @opindex mno-fmaf
21621 With @option{-mfmaf}, GCC generates code that takes advantage of the UltraSPARC
21622 Fused Multiply-Add Floating-point extensions.  The default is @option{-mfmaf}
21623 when targeting a cpu that supports such instructions, such as Niagara-3 and
21624 later.
21626 @item -mfix-at697f
21627 @opindex mfix-at697f
21628 Enable the documented workaround for the single erratum of the Atmel AT697F
21629 processor (which corresponds to erratum #13 of the AT697E processor).
21631 @item -mfix-ut699
21632 @opindex mfix-ut699
21633 Enable the documented workarounds for the floating-point errata and the data
21634 cache nullify errata of the UT699 processor.
21635 @end table
21637 These @samp{-m} options are supported in addition to the above
21638 on SPARC-V9 processors in 64-bit environments:
21640 @table @gcctabopt
21641 @item -m32
21642 @itemx -m64
21643 @opindex m32
21644 @opindex m64
21645 Generate code for a 32-bit or 64-bit environment.
21646 The 32-bit environment sets int, long and pointer to 32 bits.
21647 The 64-bit environment sets int to 32 bits and long and pointer
21648 to 64 bits.
21650 @item -mcmodel=@var{which}
21651 @opindex mcmodel
21652 Set the code model to one of
21654 @table @samp
21655 @item medlow
21656 The Medium/Low code model: 64-bit addresses, programs
21657 must be linked in the low 32 bits of memory.  Programs can be statically
21658 or dynamically linked.
21660 @item medmid
21661 The Medium/Middle code model: 64-bit addresses, programs
21662 must be linked in the low 44 bits of memory, the text and data segments must
21663 be less than 2GB in size and the data segment must be located within 2GB of
21664 the text segment.
21666 @item medany
21667 The Medium/Anywhere code model: 64-bit addresses, programs
21668 may be linked anywhere in memory, the text and data segments must be less
21669 than 2GB in size and the data segment must be located within 2GB of the
21670 text segment.
21672 @item embmedany
21673 The Medium/Anywhere code model for embedded systems:
21674 64-bit addresses, the text and data segments must be less than 2GB in
21675 size, both starting anywhere in memory (determined at link time).  The
21676 global register %g4 points to the base of the data segment.  Programs
21677 are statically linked and PIC is not supported.
21678 @end table
21680 @item -mmemory-model=@var{mem-model}
21681 @opindex mmemory-model
21682 Set the memory model in force on the processor to one of
21684 @table @samp
21685 @item default
21686 The default memory model for the processor and operating system.
21688 @item rmo
21689 Relaxed Memory Order
21691 @item pso
21692 Partial Store Order
21694 @item tso
21695 Total Store Order
21697 @item sc
21698 Sequential Consistency
21699 @end table
21701 These memory models are formally defined in Appendix D of the Sparc V9
21702 architecture manual, as set in the processor's @code{PSTATE.MM} field.
21704 @item -mstack-bias
21705 @itemx -mno-stack-bias
21706 @opindex mstack-bias
21707 @opindex mno-stack-bias
21708 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
21709 frame pointer if present, are offset by @minus{}2047 which must be added back
21710 when making stack frame references.  This is the default in 64-bit mode.
21711 Otherwise, assume no such offset is present.
21712 @end table
21714 @node SPU Options
21715 @subsection SPU Options
21716 @cindex SPU options
21718 These @samp{-m} options are supported on the SPU:
21720 @table @gcctabopt
21721 @item -mwarn-reloc
21722 @itemx -merror-reloc
21723 @opindex mwarn-reloc
21724 @opindex merror-reloc
21726 The loader for SPU does not handle dynamic relocations.  By default, GCC
21727 gives an error when it generates code that requires a dynamic
21728 relocation.  @option{-mno-error-reloc} disables the error,
21729 @option{-mwarn-reloc} generates a warning instead.
21731 @item -msafe-dma
21732 @itemx -munsafe-dma
21733 @opindex msafe-dma
21734 @opindex munsafe-dma
21736 Instructions that initiate or test completion of DMA must not be
21737 reordered with respect to loads and stores of the memory that is being
21738 accessed.
21739 With @option{-munsafe-dma} you must use the @code{volatile} keyword to protect
21740 memory accesses, but that can lead to inefficient code in places where the
21741 memory is known to not change.  Rather than mark the memory as volatile,
21742 you can use @option{-msafe-dma} to tell the compiler to treat
21743 the DMA instructions as potentially affecting all memory.  
21745 @item -mbranch-hints
21746 @opindex mbranch-hints
21748 By default, GCC generates a branch hint instruction to avoid
21749 pipeline stalls for always-taken or probably-taken branches.  A hint
21750 is not generated closer than 8 instructions away from its branch.
21751 There is little reason to disable them, except for debugging purposes,
21752 or to make an object a little bit smaller.
21754 @item -msmall-mem
21755 @itemx -mlarge-mem
21756 @opindex msmall-mem
21757 @opindex mlarge-mem
21759 By default, GCC generates code assuming that addresses are never larger
21760 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
21761 a full 32-bit address.
21763 @item -mstdmain
21764 @opindex mstdmain
21766 By default, GCC links against startup code that assumes the SPU-style
21767 main function interface (which has an unconventional parameter list).
21768 With @option{-mstdmain}, GCC links your program against startup
21769 code that assumes a C99-style interface to @code{main}, including a
21770 local copy of @code{argv} strings.
21772 @item -mfixed-range=@var{register-range}
21773 @opindex mfixed-range
21774 Generate code treating the given register range as fixed registers.
21775 A fixed register is one that the register allocator cannot use.  This is
21776 useful when compiling kernel code.  A register range is specified as
21777 two registers separated by a dash.  Multiple register ranges can be
21778 specified separated by a comma.
21780 @item -mea32
21781 @itemx -mea64
21782 @opindex mea32
21783 @opindex mea64
21784 Compile code assuming that pointers to the PPU address space accessed
21785 via the @code{__ea} named address space qualifier are either 32 or 64
21786 bits wide.  The default is 32 bits.  As this is an ABI-changing option,
21787 all object code in an executable must be compiled with the same setting.
21789 @item -maddress-space-conversion
21790 @itemx -mno-address-space-conversion
21791 @opindex maddress-space-conversion
21792 @opindex mno-address-space-conversion
21793 Allow/disallow treating the @code{__ea} address space as superset
21794 of the generic address space.  This enables explicit type casts
21795 between @code{__ea} and generic pointer as well as implicit
21796 conversions of generic pointers to @code{__ea} pointers.  The
21797 default is to allow address space pointer conversions.
21799 @item -mcache-size=@var{cache-size}
21800 @opindex mcache-size
21801 This option controls the version of libgcc that the compiler links to an
21802 executable and selects a software-managed cache for accessing variables
21803 in the @code{__ea} address space with a particular cache size.  Possible
21804 options for @var{cache-size} are @samp{8}, @samp{16}, @samp{32}, @samp{64}
21805 and @samp{128}.  The default cache size is 64KB.
21807 @item -matomic-updates
21808 @itemx -mno-atomic-updates
21809 @opindex matomic-updates
21810 @opindex mno-atomic-updates
21811 This option controls the version of libgcc that the compiler links to an
21812 executable and selects whether atomic updates to the software-managed
21813 cache of PPU-side variables are used.  If you use atomic updates, changes
21814 to a PPU variable from SPU code using the @code{__ea} named address space
21815 qualifier do not interfere with changes to other PPU variables residing
21816 in the same cache line from PPU code.  If you do not use atomic updates,
21817 such interference may occur; however, writing back cache lines is
21818 more efficient.  The default behavior is to use atomic updates.
21820 @item -mdual-nops
21821 @itemx -mdual-nops=@var{n}
21822 @opindex mdual-nops
21823 By default, GCC inserts nops to increase dual issue when it expects
21824 it to increase performance.  @var{n} can be a value from 0 to 10.  A
21825 smaller @var{n} inserts fewer nops.  10 is the default, 0 is the
21826 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
21828 @item -mhint-max-nops=@var{n}
21829 @opindex mhint-max-nops
21830 Maximum number of nops to insert for a branch hint.  A branch hint must
21831 be at least 8 instructions away from the branch it is affecting.  GCC
21832 inserts up to @var{n} nops to enforce this, otherwise it does not
21833 generate the branch hint.
21835 @item -mhint-max-distance=@var{n}
21836 @opindex mhint-max-distance
21837 The encoding of the branch hint instruction limits the hint to be within
21838 256 instructions of the branch it is affecting.  By default, GCC makes
21839 sure it is within 125.
21841 @item -msafe-hints
21842 @opindex msafe-hints
21843 Work around a hardware bug that causes the SPU to stall indefinitely.
21844 By default, GCC inserts the @code{hbrp} instruction to make sure
21845 this stall won't happen.
21847 @end table
21849 @node System V Options
21850 @subsection Options for System V
21852 These additional options are available on System V Release 4 for
21853 compatibility with other compilers on those systems:
21855 @table @gcctabopt
21856 @item -G
21857 @opindex G
21858 Create a shared object.
21859 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
21861 @item -Qy
21862 @opindex Qy
21863 Identify the versions of each tool used by the compiler, in a
21864 @code{.ident} assembler directive in the output.
21866 @item -Qn
21867 @opindex Qn
21868 Refrain from adding @code{.ident} directives to the output file (this is
21869 the default).
21871 @item -YP,@var{dirs}
21872 @opindex YP
21873 Search the directories @var{dirs}, and no others, for libraries
21874 specified with @option{-l}.
21876 @item -Ym,@var{dir}
21877 @opindex Ym
21878 Look in the directory @var{dir} to find the M4 preprocessor.
21879 The assembler uses this option.
21880 @c This is supposed to go with a -Yd for predefined M4 macro files, but
21881 @c the generic assembler that comes with Solaris takes just -Ym.
21882 @end table
21884 @node TILE-Gx Options
21885 @subsection TILE-Gx Options
21886 @cindex TILE-Gx options
21888 These @samp{-m} options are supported on the TILE-Gx:
21890 @table @gcctabopt
21891 @item -mcmodel=small
21892 @opindex mcmodel=small
21893 Generate code for the small model.  The distance for direct calls is
21894 limited to 500M in either direction.  PC-relative addresses are 32
21895 bits.  Absolute addresses support the full address range.
21897 @item -mcmodel=large
21898 @opindex mcmodel=large
21899 Generate code for the large model.  There is no limitation on call
21900 distance, pc-relative addresses, or absolute addresses.
21902 @item -mcpu=@var{name}
21903 @opindex mcpu
21904 Selects the type of CPU to be targeted.  Currently the only supported
21905 type is @samp{tilegx}.
21907 @item -m32
21908 @itemx -m64
21909 @opindex m32
21910 @opindex m64
21911 Generate code for a 32-bit or 64-bit environment.  The 32-bit
21912 environment sets int, long, and pointer to 32 bits.  The 64-bit
21913 environment sets int to 32 bits and long and pointer to 64 bits.
21915 @item -mbig-endian
21916 @itemx -mlittle-endian
21917 @opindex mbig-endian
21918 @opindex mlittle-endian
21919 Generate code in big/little endian mode, respectively.
21920 @end table
21922 @node TILEPro Options
21923 @subsection TILEPro Options
21924 @cindex TILEPro options
21926 These @samp{-m} options are supported on the TILEPro:
21928 @table @gcctabopt
21929 @item -mcpu=@var{name}
21930 @opindex mcpu
21931 Selects the type of CPU to be targeted.  Currently the only supported
21932 type is @samp{tilepro}.
21934 @item -m32
21935 @opindex m32
21936 Generate code for a 32-bit environment, which sets int, long, and
21937 pointer to 32 bits.  This is the only supported behavior so the flag
21938 is essentially ignored.
21939 @end table
21941 @node V850 Options
21942 @subsection V850 Options
21943 @cindex V850 Options
21945 These @samp{-m} options are defined for V850 implementations:
21947 @table @gcctabopt
21948 @item -mlong-calls
21949 @itemx -mno-long-calls
21950 @opindex mlong-calls
21951 @opindex mno-long-calls
21952 Treat all calls as being far away (near).  If calls are assumed to be
21953 far away, the compiler always loads the function's address into a
21954 register, and calls indirect through the pointer.
21956 @item -mno-ep
21957 @itemx -mep
21958 @opindex mno-ep
21959 @opindex mep
21960 Do not optimize (do optimize) basic blocks that use the same index
21961 pointer 4 or more times to copy pointer into the @code{ep} register, and
21962 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
21963 option is on by default if you optimize.
21965 @item -mno-prolog-function
21966 @itemx -mprolog-function
21967 @opindex mno-prolog-function
21968 @opindex mprolog-function
21969 Do not use (do use) external functions to save and restore registers
21970 at the prologue and epilogue of a function.  The external functions
21971 are slower, but use less code space if more than one function saves
21972 the same number of registers.  The @option{-mprolog-function} option
21973 is on by default if you optimize.
21975 @item -mspace
21976 @opindex mspace
21977 Try to make the code as small as possible.  At present, this just turns
21978 on the @option{-mep} and @option{-mprolog-function} options.
21980 @item -mtda=@var{n}
21981 @opindex mtda
21982 Put static or global variables whose size is @var{n} bytes or less into
21983 the tiny data area that register @code{ep} points to.  The tiny data
21984 area can hold up to 256 bytes in total (128 bytes for byte references).
21986 @item -msda=@var{n}
21987 @opindex msda
21988 Put static or global variables whose size is @var{n} bytes or less into
21989 the small data area that register @code{gp} points to.  The small data
21990 area can hold up to 64 kilobytes.
21992 @item -mzda=@var{n}
21993 @opindex mzda
21994 Put static or global variables whose size is @var{n} bytes or less into
21995 the first 32 kilobytes of memory.
21997 @item -mv850
21998 @opindex mv850
21999 Specify that the target processor is the V850.
22001 @item -mv850e3v5
22002 @opindex mv850e3v5
22003 Specify that the target processor is the V850E3V5.  The preprocessor
22004 constant @samp{__v850e3v5__} is defined if this option is used.
22006 @item -mv850e2v4
22007 @opindex mv850e2v4
22008 Specify that the target processor is the V850E3V5.  This is an alias for
22009 the @option{-mv850e3v5} option.
22011 @item -mv850e2v3
22012 @opindex mv850e2v3
22013 Specify that the target processor is the V850E2V3.  The preprocessor
22014 constant @samp{__v850e2v3__} is defined if this option is used.
22016 @item -mv850e2
22017 @opindex mv850e2
22018 Specify that the target processor is the V850E2.  The preprocessor
22019 constant @samp{__v850e2__} is defined if this option is used.
22021 @item -mv850e1
22022 @opindex mv850e1
22023 Specify that the target processor is the V850E1.  The preprocessor
22024 constants @samp{__v850e1__} and @samp{__v850e__} are defined if
22025 this option is used.
22027 @item -mv850es
22028 @opindex mv850es
22029 Specify that the target processor is the V850ES.  This is an alias for
22030 the @option{-mv850e1} option.
22032 @item -mv850e
22033 @opindex mv850e
22034 Specify that the target processor is the V850E@.  The preprocessor
22035 constant @samp{__v850e__} is defined if this option is used.
22037 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
22038 nor @option{-mv850e2} nor @option{-mv850e2v3} nor @option{-mv850e3v5}
22039 are defined then a default target processor is chosen and the
22040 relevant @samp{__v850*__} preprocessor constant is defined.
22042 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
22043 defined, regardless of which processor variant is the target.
22045 @item -mdisable-callt
22046 @itemx -mno-disable-callt
22047 @opindex mdisable-callt
22048 @opindex mno-disable-callt
22049 This option suppresses generation of the @code{CALLT} instruction for the
22050 v850e, v850e1, v850e2, v850e2v3 and v850e3v5 flavors of the v850
22051 architecture.
22053 This option is enabled by default when the RH850 ABI is
22054 in use (see @option{-mrh850-abi}), and disabled by default when the
22055 GCC ABI is in use.  If @code{CALLT} instructions are being generated
22056 then the C preprocessor symbol @code{__V850_CALLT__} will be defined.
22058 @item -mrelax
22059 @itemx -mno-relax
22060 @opindex mrelax
22061 @opindex mno-relax
22062 Pass on (or do not pass on) the @option{-mrelax} command line option
22063 to the assembler.
22065 @item -mlong-jumps
22066 @itemx -mno-long-jumps
22067 @opindex mlong-jumps
22068 @opindex mno-long-jumps
22069 Disable (or re-enable) the generation of PC-relative jump instructions.
22071 @item -msoft-float
22072 @itemx -mhard-float
22073 @opindex msoft-float
22074 @opindex mhard-float
22075 Disable (or re-enable) the generation of hardware floating point
22076 instructions.  This option is only significant when the target
22077 architecture is @samp{V850E2V3} or higher.  If hardware floating point
22078 instructions are being generated then the C preprocessor symbol
22079 @code{__FPU_OK__} will be defined, otherwise the symbol
22080 @code{__NO_FPU__} will be defined.
22082 @item -mloop
22083 @opindex mloop
22084 Enables the use of the e3v5 LOOP instruction.  The use of this
22085 instruction is not enabled by default when the e3v5 architecture is
22086 selected because its use is still experimental.
22088 @item -mrh850-abi
22089 @itemx -mghs
22090 @opindex mrh850-abi
22091 @opindex mghs
22092 Enables support for the RH850 version of the V850 ABI.  This is the
22093 default.  With this version of the ABI the following rules apply:
22095 @itemize
22096 @item
22097 Integer sized structures and unions are returned via a memory pointer
22098 rather than a register.
22100 @item
22101 Large structures and unions (more than 8 bytes in size) are passed by
22102 value.
22104 @item
22105 Functions are aligned to 16-bit boundaries.
22107 @item
22108 The @option{-m8byte-align} command line option is supported.
22110 @item
22111 The @option{-mdisable-callt} command line option is enabled by
22112 default.  The @option{-mno-disable-callt} command line option is not
22113 supported.
22114 @end itemize
22116 When this version of the ABI is enabled the C preprocessor symbol
22117 @code{__V850_RH850_ABI__} is defined.
22119 @item -mgcc-abi
22120 @opindex mgcc-abi
22121 Enables support for the old GCC version of the V850 ABI.  With this
22122 version of the ABI the following rules apply:
22124 @itemize
22125 @item
22126 Integer sized structures and unions are returned in register @code{r10}.
22128 @item
22129 Large structures and unions (more than 8 bytes in size) are passed by
22130 reference.
22132 @item
22133 Functions are aligned to 32-bit boundaries, unless optimizing for
22134 size.
22136 @item
22137 The @option{-m8byte-align} command line option is not supported.
22139 @item
22140 The @option{-mdisable-callt} command line option is supported but not
22141 enabled by default.
22142 @end itemize
22144 When this version of the ABI is enabled the C preprocessor symbol
22145 @code{__V850_GCC_ABI__} is defined.
22147 @item -m8byte-align
22148 @itemx -mno-8byte-align
22149 @opindex m8byte-align
22150 @opindex mno-8byte-align
22151 Enables support for @code{doubles} and @code{long long} types to be
22152 aligned on 8-byte boundaries.  The default is to restrict the
22153 alignment of all objects to at most 4-bytes.  When
22154 @option{-m8byte-align} is in effect the C preprocessor symbol
22155 @code{__V850_8BYTE_ALIGN__} will be defined.
22157 @item -mbig-switch
22158 @opindex mbig-switch
22159 Generate code suitable for big switch tables.  Use this option only if
22160 the assembler/linker complain about out of range branches within a switch
22161 table.
22163 @item -mapp-regs
22164 @opindex mapp-regs
22165 This option causes r2 and r5 to be used in the code generated by
22166 the compiler.  This setting is the default.
22168 @item -mno-app-regs
22169 @opindex mno-app-regs
22170 This option causes r2 and r5 to be treated as fixed registers.
22172 @end table
22174 @node VAX Options
22175 @subsection VAX Options
22176 @cindex VAX options
22178 These @samp{-m} options are defined for the VAX:
22180 @table @gcctabopt
22181 @item -munix
22182 @opindex munix
22183 Do not output certain jump instructions (@code{aobleq} and so on)
22184 that the Unix assembler for the VAX cannot handle across long
22185 ranges.
22187 @item -mgnu
22188 @opindex mgnu
22189 Do output those jump instructions, on the assumption that the
22190 GNU assembler is being used.
22192 @item -mg
22193 @opindex mg
22194 Output code for G-format floating-point numbers instead of D-format.
22195 @end table
22197 @node VMS Options
22198 @subsection VMS Options
22200 These @samp{-m} options are defined for the VMS implementations:
22202 @table @gcctabopt
22203 @item -mvms-return-codes
22204 @opindex mvms-return-codes
22205 Return VMS condition codes from @code{main}. The default is to return POSIX-style
22206 condition (e.g.@ error) codes.
22208 @item -mdebug-main=@var{prefix}
22209 @opindex mdebug-main=@var{prefix}
22210 Flag the first routine whose name starts with @var{prefix} as the main
22211 routine for the debugger.
22213 @item -mmalloc64
22214 @opindex mmalloc64
22215 Default to 64-bit memory allocation routines.
22217 @item -mpointer-size=@var{size}
22218 @opindex -mpointer-size=@var{size}
22219 Set the default size of pointers. Possible options for @var{size} are
22220 @samp{32} or @samp{short} for 32 bit pointers, @samp{64} or @samp{long}
22221 for 64 bit pointers, and @samp{no} for supporting only 32 bit pointers.
22222 The later option disables @code{pragma pointer_size}.
22223 @end table
22225 @node VxWorks Options
22226 @subsection VxWorks Options
22227 @cindex VxWorks Options
22229 The options in this section are defined for all VxWorks targets.
22230 Options specific to the target hardware are listed with the other
22231 options for that target.
22233 @table @gcctabopt
22234 @item -mrtp
22235 @opindex mrtp
22236 GCC can generate code for both VxWorks kernels and real time processes
22237 (RTPs).  This option switches from the former to the latter.  It also
22238 defines the preprocessor macro @code{__RTP__}.
22240 @item -non-static
22241 @opindex non-static
22242 Link an RTP executable against shared libraries rather than static
22243 libraries.  The options @option{-static} and @option{-shared} can
22244 also be used for RTPs (@pxref{Link Options}); @option{-static}
22245 is the default.
22247 @item -Bstatic
22248 @itemx -Bdynamic
22249 @opindex Bstatic
22250 @opindex Bdynamic
22251 These options are passed down to the linker.  They are defined for
22252 compatibility with Diab.
22254 @item -Xbind-lazy
22255 @opindex Xbind-lazy
22256 Enable lazy binding of function calls.  This option is equivalent to
22257 @option{-Wl,-z,now} and is defined for compatibility with Diab.
22259 @item -Xbind-now
22260 @opindex Xbind-now
22261 Disable lazy binding of function calls.  This option is the default and
22262 is defined for compatibility with Diab.
22263 @end table
22265 @node x86-64 Options
22266 @subsection x86-64 Options
22267 @cindex x86-64 options
22269 These are listed under @xref{i386 and x86-64 Options}.
22271 @node Xstormy16 Options
22272 @subsection Xstormy16 Options
22273 @cindex Xstormy16 Options
22275 These options are defined for Xstormy16:
22277 @table @gcctabopt
22278 @item -msim
22279 @opindex msim
22280 Choose startup files and linker script suitable for the simulator.
22281 @end table
22283 @node Xtensa Options
22284 @subsection Xtensa Options
22285 @cindex Xtensa Options
22287 These options are supported for Xtensa targets:
22289 @table @gcctabopt
22290 @item -mconst16
22291 @itemx -mno-const16
22292 @opindex mconst16
22293 @opindex mno-const16
22294 Enable or disable use of @code{CONST16} instructions for loading
22295 constant values.  The @code{CONST16} instruction is currently not a
22296 standard option from Tensilica.  When enabled, @code{CONST16}
22297 instructions are always used in place of the standard @code{L32R}
22298 instructions.  The use of @code{CONST16} is enabled by default only if
22299 the @code{L32R} instruction is not available.
22301 @item -mfused-madd
22302 @itemx -mno-fused-madd
22303 @opindex mfused-madd
22304 @opindex mno-fused-madd
22305 Enable or disable use of fused multiply/add and multiply/subtract
22306 instructions in the floating-point option.  This has no effect if the
22307 floating-point option is not also enabled.  Disabling fused multiply/add
22308 and multiply/subtract instructions forces the compiler to use separate
22309 instructions for the multiply and add/subtract operations.  This may be
22310 desirable in some cases where strict IEEE 754-compliant results are
22311 required: the fused multiply add/subtract instructions do not round the
22312 intermediate result, thereby producing results with @emph{more} bits of
22313 precision than specified by the IEEE standard.  Disabling fused multiply
22314 add/subtract instructions also ensures that the program output is not
22315 sensitive to the compiler's ability to combine multiply and add/subtract
22316 operations.
22318 @item -mserialize-volatile
22319 @itemx -mno-serialize-volatile
22320 @opindex mserialize-volatile
22321 @opindex mno-serialize-volatile
22322 When this option is enabled, GCC inserts @code{MEMW} instructions before
22323 @code{volatile} memory references to guarantee sequential consistency.
22324 The default is @option{-mserialize-volatile}.  Use
22325 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
22327 @item -mforce-no-pic
22328 @opindex mforce-no-pic
22329 For targets, like GNU/Linux, where all user-mode Xtensa code must be
22330 position-independent code (PIC), this option disables PIC for compiling
22331 kernel code.
22333 @item -mtext-section-literals
22334 @itemx -mno-text-section-literals
22335 @opindex mtext-section-literals
22336 @opindex mno-text-section-literals
22337 Control the treatment of literal pools.  The default is
22338 @option{-mno-text-section-literals}, which places literals in a separate
22339 section in the output file.  This allows the literal pool to be placed
22340 in a data RAM/ROM, and it also allows the linker to combine literal
22341 pools from separate object files to remove redundant literals and
22342 improve code size.  With @option{-mtext-section-literals}, the literals
22343 are interspersed in the text section in order to keep them as close as
22344 possible to their references.  This may be necessary for large assembly
22345 files.
22347 @item -mtarget-align
22348 @itemx -mno-target-align
22349 @opindex mtarget-align
22350 @opindex mno-target-align
22351 When this option is enabled, GCC instructs the assembler to
22352 automatically align instructions to reduce branch penalties at the
22353 expense of some code density.  The assembler attempts to widen density
22354 instructions to align branch targets and the instructions following call
22355 instructions.  If there are not enough preceding safe density
22356 instructions to align a target, no widening is performed.  The
22357 default is @option{-mtarget-align}.  These options do not affect the
22358 treatment of auto-aligned instructions like @code{LOOP}, which the
22359 assembler always aligns, either by widening density instructions or
22360 by inserting NOP instructions.
22362 @item -mlongcalls
22363 @itemx -mno-longcalls
22364 @opindex mlongcalls
22365 @opindex mno-longcalls
22366 When this option is enabled, GCC instructs the assembler to translate
22367 direct calls to indirect calls unless it can determine that the target
22368 of a direct call is in the range allowed by the call instruction.  This
22369 translation typically occurs for calls to functions in other source
22370 files.  Specifically, the assembler translates a direct @code{CALL}
22371 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
22372 The default is @option{-mno-longcalls}.  This option should be used in
22373 programs where the call target can potentially be out of range.  This
22374 option is implemented in the assembler, not the compiler, so the
22375 assembly code generated by GCC still shows direct call
22376 instructions---look at the disassembled object code to see the actual
22377 instructions.  Note that the assembler uses an indirect call for
22378 every cross-file call, not just those that really are out of range.
22379 @end table
22381 @node zSeries Options
22382 @subsection zSeries Options
22383 @cindex zSeries options
22385 These are listed under @xref{S/390 and zSeries Options}.
22387 @node Code Gen Options
22388 @section Options for Code Generation Conventions
22389 @cindex code generation conventions
22390 @cindex options, code generation
22391 @cindex run-time options
22393 These machine-independent options control the interface conventions
22394 used in code generation.
22396 Most of them have both positive and negative forms; the negative form
22397 of @option{-ffoo} is @option{-fno-foo}.  In the table below, only
22398 one of the forms is listed---the one that is not the default.  You
22399 can figure out the other form by either removing @samp{no-} or adding
22402 @table @gcctabopt
22403 @item -fbounds-check
22404 @opindex fbounds-check
22405 For front ends that support it, generate additional code to check that
22406 indices used to access arrays are within the declared range.  This is
22407 currently only supported by the Java and Fortran front ends, where
22408 this option defaults to true and false respectively.
22410 @item -fstack-reuse=@var{reuse-level}
22411 @opindex fstack_reuse
22412 This option controls stack space reuse for user declared local/auto variables
22413 and compiler generated temporaries.  @var{reuse_level} can be @samp{all},
22414 @samp{named_vars}, or @samp{none}. @samp{all} enables stack reuse for all
22415 local variables and temporaries, @samp{named_vars} enables the reuse only for
22416 user defined local variables with names, and @samp{none} disables stack reuse
22417 completely. The default value is @samp{all}. The option is needed when the
22418 program extends the lifetime of a scoped local variable or a compiler generated
22419 temporary beyond the end point defined by the language.  When a lifetime of
22420 a variable ends, and if the variable lives in memory, the optimizing compiler
22421 has the freedom to reuse its stack space with other temporaries or scoped
22422 local variables whose live range does not overlap with it. Legacy code extending
22423 local lifetime will likely to break with the stack reuse optimization.
22425 For example,
22427 @smallexample
22428    int *p;
22429    @{
22430      int local1;
22432      p = &local1;
22433      local1 = 10;
22434      ....
22435    @}
22436    @{
22437       int local2;
22438       local2 = 20;
22439       ...
22440    @}
22442    if (*p == 10)  // out of scope use of local1
22443      @{
22445      @}
22446 @end smallexample
22448 Another example:
22449 @smallexample
22451    struct A
22452    @{
22453        A(int k) : i(k), j(k) @{ @}
22454        int i;
22455        int j;
22456    @};
22458    A *ap;
22460    void foo(const A& ar)
22461    @{
22462       ap = &ar;
22463    @}
22465    void bar()
22466    @{
22467       foo(A(10)); // temp object's lifetime ends when foo returns
22469       @{
22470         A a(20);
22471         ....
22472       @}
22473       ap->i+= 10;  // ap references out of scope temp whose space
22474                    // is reused with a. What is the value of ap->i?
22475    @}
22477 @end smallexample
22479 The lifetime of a compiler generated temporary is well defined by the C++
22480 standard. When a lifetime of a temporary ends, and if the temporary lives
22481 in memory, the optimizing compiler has the freedom to reuse its stack
22482 space with other temporaries or scoped local variables whose live range
22483 does not overlap with it. However some of the legacy code relies on
22484 the behavior of older compilers in which temporaries' stack space is
22485 not reused, the aggressive stack reuse can lead to runtime errors. This
22486 option is used to control the temporary stack reuse optimization.
22488 @item -ftrapv
22489 @opindex ftrapv
22490 This option generates traps for signed overflow on addition, subtraction,
22491 multiplication operations.
22493 @item -fwrapv
22494 @opindex fwrapv
22495 This option instructs the compiler to assume that signed arithmetic
22496 overflow of addition, subtraction and multiplication wraps around
22497 using twos-complement representation.  This flag enables some optimizations
22498 and disables others.  This option is enabled by default for the Java
22499 front end, as required by the Java language specification.
22501 @item -fexceptions
22502 @opindex fexceptions
22503 Enable exception handling.  Generates extra code needed to propagate
22504 exceptions.  For some targets, this implies GCC generates frame
22505 unwind information for all functions, which can produce significant data
22506 size overhead, although it does not affect execution.  If you do not
22507 specify this option, GCC enables it by default for languages like
22508 C++ that normally require exception handling, and disables it for
22509 languages like C that do not normally require it.  However, you may need
22510 to enable this option when compiling C code that needs to interoperate
22511 properly with exception handlers written in C++.  You may also wish to
22512 disable this option if you are compiling older C++ programs that don't
22513 use exception handling.
22515 @item -fnon-call-exceptions
22516 @opindex fnon-call-exceptions
22517 Generate code that allows trapping instructions to throw exceptions.
22518 Note that this requires platform-specific runtime support that does
22519 not exist everywhere.  Moreover, it only allows @emph{trapping}
22520 instructions to throw exceptions, i.e.@: memory references or floating-point
22521 instructions.  It does not allow exceptions to be thrown from
22522 arbitrary signal handlers such as @code{SIGALRM}.
22524 @item -fdelete-dead-exceptions
22525 @opindex fdelete-dead-exceptions
22526 Consider that instructions that may throw exceptions but don't otherwise
22527 contribute to the execution of the program can be optimized away.
22528 This option is enabled by default for the Ada front end, as permitted by
22529 the Ada language specification.
22530 Optimization passes that cause dead exceptions to be removed are enabled independently at different optimization levels.
22532 @item -funwind-tables
22533 @opindex funwind-tables
22534 Similar to @option{-fexceptions}, except that it just generates any needed
22535 static data, but does not affect the generated code in any other way.
22536 You normally do not need to enable this option; instead, a language processor
22537 that needs this handling enables it on your behalf.
22539 @item -fasynchronous-unwind-tables
22540 @opindex fasynchronous-unwind-tables
22541 Generate unwind table in DWARF 2 format, if supported by target machine.  The
22542 table is exact at each instruction boundary, so it can be used for stack
22543 unwinding from asynchronous events (such as debugger or garbage collector).
22545 @item -fno-gnu-unique
22546 @opindex fno-gnu-unique
22547 On systems with recent GNU assembler and C library, the C++ compiler
22548 uses the @code{STB_GNU_UNIQUE} binding to make sure that definitions
22549 of template static data members and static local variables in inline
22550 functions are unique even in the presence of @code{RTLD_LOCAL}; this
22551 is necessary to avoid problems with a library used by two different
22552 @code{RTLD_LOCAL} plugins depending on a definition in one of them and
22553 therefore disagreeing with the other one about the binding of the
22554 symbol.  But this causes @code{dlclose} to be ignored for affected
22555 DSOs; if your program relies on reinitialization of a DSO via
22556 @code{dlclose} and @code{dlopen}, you can use
22557 @option{-fno-gnu-unique}.
22559 @item -fpcc-struct-return
22560 @opindex fpcc-struct-return
22561 Return ``short'' @code{struct} and @code{union} values in memory like
22562 longer ones, rather than in registers.  This convention is less
22563 efficient, but it has the advantage of allowing intercallability between
22564 GCC-compiled files and files compiled with other compilers, particularly
22565 the Portable C Compiler (pcc).
22567 The precise convention for returning structures in memory depends
22568 on the target configuration macros.
22570 Short structures and unions are those whose size and alignment match
22571 that of some integer type.
22573 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
22574 switch is not binary compatible with code compiled with the
22575 @option{-freg-struct-return} switch.
22576 Use it to conform to a non-default application binary interface.
22578 @item -freg-struct-return
22579 @opindex freg-struct-return
22580 Return @code{struct} and @code{union} values in registers when possible.
22581 This is more efficient for small structures than
22582 @option{-fpcc-struct-return}.
22584 If you specify neither @option{-fpcc-struct-return} nor
22585 @option{-freg-struct-return}, GCC defaults to whichever convention is
22586 standard for the target.  If there is no standard convention, GCC
22587 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
22588 the principal compiler.  In those cases, we can choose the standard, and
22589 we chose the more efficient register return alternative.
22591 @strong{Warning:} code compiled with the @option{-freg-struct-return}
22592 switch is not binary compatible with code compiled with the
22593 @option{-fpcc-struct-return} switch.
22594 Use it to conform to a non-default application binary interface.
22596 @item -fshort-enums
22597 @opindex fshort-enums
22598 Allocate to an @code{enum} type only as many bytes as it needs for the
22599 declared range of possible values.  Specifically, the @code{enum} type
22600 is equivalent to the smallest integer type that has enough room.
22602 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
22603 code that is not binary compatible with code generated without that switch.
22604 Use it to conform to a non-default application binary interface.
22606 @item -fshort-double
22607 @opindex fshort-double
22608 Use the same size for @code{double} as for @code{float}.
22610 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
22611 code that is not binary compatible with code generated without that switch.
22612 Use it to conform to a non-default application binary interface.
22614 @item -fshort-wchar
22615 @opindex fshort-wchar
22616 Override the underlying type for @samp{wchar_t} to be @samp{short
22617 unsigned int} instead of the default for the target.  This option is
22618 useful for building programs to run under WINE@.
22620 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
22621 code that is not binary compatible with code generated without that switch.
22622 Use it to conform to a non-default application binary interface.
22624 @item -fno-common
22625 @opindex fno-common
22626 In C code, controls the placement of uninitialized global variables.
22627 Unix C compilers have traditionally permitted multiple definitions of
22628 such variables in different compilation units by placing the variables
22629 in a common block.
22630 This is the behavior specified by @option{-fcommon}, and is the default
22631 for GCC on most targets.
22632 On the other hand, this behavior is not required by ISO C, and on some
22633 targets may carry a speed or code size penalty on variable references.
22634 The @option{-fno-common} option specifies that the compiler should place
22635 uninitialized global variables in the data section of the object file,
22636 rather than generating them as common blocks.
22637 This has the effect that if the same variable is declared
22638 (without @code{extern}) in two different compilations,
22639 you get a multiple-definition error when you link them.
22640 In this case, you must compile with @option{-fcommon} instead.
22641 Compiling with @option{-fno-common} is useful on targets for which
22642 it provides better performance, or if you wish to verify that the
22643 program will work on other systems that always treat uninitialized
22644 variable declarations this way.
22646 @item -fno-ident
22647 @opindex fno-ident
22648 Ignore the @samp{#ident} directive.
22650 @item -finhibit-size-directive
22651 @opindex finhibit-size-directive
22652 Don't output a @code{.size} assembler directive, or anything else that
22653 would cause trouble if the function is split in the middle, and the
22654 two halves are placed at locations far apart in memory.  This option is
22655 used when compiling @file{crtstuff.c}; you should not need to use it
22656 for anything else.
22658 @item -fverbose-asm
22659 @opindex fverbose-asm
22660 Put extra commentary information in the generated assembly code to
22661 make it more readable.  This option is generally only of use to those
22662 who actually need to read the generated assembly code (perhaps while
22663 debugging the compiler itself).
22665 @option{-fno-verbose-asm}, the default, causes the
22666 extra information to be omitted and is useful when comparing two assembler
22667 files.
22669 @item -frecord-gcc-switches
22670 @opindex frecord-gcc-switches
22671 This switch causes the command line used to invoke the
22672 compiler to be recorded into the object file that is being created.
22673 This switch is only implemented on some targets and the exact format
22674 of the recording is target and binary file format dependent, but it
22675 usually takes the form of a section containing ASCII text.  This
22676 switch is related to the @option{-fverbose-asm} switch, but that
22677 switch only records information in the assembler output file as
22678 comments, so it never reaches the object file.
22679 See also @option{-grecord-gcc-switches} for another
22680 way of storing compiler options into the object file.
22682 @item -fpic
22683 @opindex fpic
22684 @cindex global offset table
22685 @cindex PIC
22686 Generate position-independent code (PIC) suitable for use in a shared
22687 library, if supported for the target machine.  Such code accesses all
22688 constant addresses through a global offset table (GOT)@.  The dynamic
22689 loader resolves the GOT entries when the program starts (the dynamic
22690 loader is not part of GCC; it is part of the operating system).  If
22691 the GOT size for the linked executable exceeds a machine-specific
22692 maximum size, you get an error message from the linker indicating that
22693 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
22694 instead.  (These maximums are 8k on the SPARC and 32k
22695 on the m68k and RS/6000.  The 386 has no such limit.)
22697 Position-independent code requires special support, and therefore works
22698 only on certain machines.  For the 386, GCC supports PIC for System V
22699 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
22700 position-independent.
22702 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
22703 are defined to 1.
22705 @item -fPIC
22706 @opindex fPIC
22707 If supported for the target machine, emit position-independent code,
22708 suitable for dynamic linking and avoiding any limit on the size of the
22709 global offset table.  This option makes a difference on the m68k,
22710 PowerPC and SPARC@.
22712 Position-independent code requires special support, and therefore works
22713 only on certain machines.
22715 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
22716 are defined to 2.
22718 @item -fpie
22719 @itemx -fPIE
22720 @opindex fpie
22721 @opindex fPIE
22722 These options are similar to @option{-fpic} and @option{-fPIC}, but
22723 generated position independent code can be only linked into executables.
22724 Usually these options are used when @option{-pie} GCC option is
22725 used during linking.
22727 @option{-fpie} and @option{-fPIE} both define the macros
22728 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
22729 for @option{-fpie} and 2 for @option{-fPIE}.
22731 @item -fno-plt
22732 @opindex fno-plt
22733 Do not use PLT for external function calls in position-independent code.
22734 Instead, load callee address at call site from GOT and branch to it.
22735 This leads to more efficient code by eliminating PLT stubs and exposing
22736 GOT load to optimizations.  On architectures such as 32-bit x86 where
22737 PLT stubs expect GOT pointer in a specific register, this gives more
22738 register allocation freedom to the compiler.  Lazy binding requires PLT:
22739 with @option{-fno-plt} all external symbols are resolved at load time.
22741 Alternatively, function attribute @code{noplt} can be used to avoid PLT
22742 for calls to specific external functions by marking those functions with
22743 this attribute.
22745 Additionally, a few targets also convert calls to those functions that are
22746 marked to not use the PLT to use the GOT instead for non-position independent
22747 code.
22749 @item -fno-jump-tables
22750 @opindex fno-jump-tables
22751 Do not use jump tables for switch statements even where it would be
22752 more efficient than other code generation strategies.  This option is
22753 of use in conjunction with @option{-fpic} or @option{-fPIC} for
22754 building code that forms part of a dynamic linker and cannot
22755 reference the address of a jump table.  On some targets, jump tables
22756 do not require a GOT and this option is not needed.
22758 @item -ffixed-@var{reg}
22759 @opindex ffixed
22760 Treat the register named @var{reg} as a fixed register; generated code
22761 should never refer to it (except perhaps as a stack pointer, frame
22762 pointer or in some other fixed role).
22764 @var{reg} must be the name of a register.  The register names accepted
22765 are machine-specific and are defined in the @code{REGISTER_NAMES}
22766 macro in the machine description macro file.
22768 This flag does not have a negative form, because it specifies a
22769 three-way choice.
22771 @item -fcall-used-@var{reg}
22772 @opindex fcall-used
22773 Treat the register named @var{reg} as an allocable register that is
22774 clobbered by function calls.  It may be allocated for temporaries or
22775 variables that do not live across a call.  Functions compiled this way
22776 do not save and restore the register @var{reg}.
22778 It is an error to use this flag with the frame pointer or stack pointer.
22779 Use of this flag for other registers that have fixed pervasive roles in
22780 the machine's execution model produces disastrous results.
22782 This flag does not have a negative form, because it specifies a
22783 three-way choice.
22785 @item -fcall-saved-@var{reg}
22786 @opindex fcall-saved
22787 Treat the register named @var{reg} as an allocable register saved by
22788 functions.  It may be allocated even for temporaries or variables that
22789 live across a call.  Functions compiled this way save and restore
22790 the register @var{reg} if they use it.
22792 It is an error to use this flag with the frame pointer or stack pointer.
22793 Use of this flag for other registers that have fixed pervasive roles in
22794 the machine's execution model produces disastrous results.
22796 A different sort of disaster results from the use of this flag for
22797 a register in which function values may be returned.
22799 This flag does not have a negative form, because it specifies a
22800 three-way choice.
22802 @item -fpack-struct[=@var{n}]
22803 @opindex fpack-struct
22804 Without a value specified, pack all structure members together without
22805 holes.  When a value is specified (which must be a small power of two), pack
22806 structure members according to this value, representing the maximum
22807 alignment (that is, objects with default alignment requirements larger than
22808 this are output potentially unaligned at the next fitting location.
22810 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
22811 code that is not binary compatible with code generated without that switch.
22812 Additionally, it makes the code suboptimal.
22813 Use it to conform to a non-default application binary interface.
22815 @item -finstrument-functions
22816 @opindex finstrument-functions
22817 Generate instrumentation calls for entry and exit to functions.  Just
22818 after function entry and just before function exit, the following
22819 profiling functions are called with the address of the current
22820 function and its call site.  (On some platforms,
22821 @code{__builtin_return_address} does not work beyond the current
22822 function, so the call site information may not be available to the
22823 profiling functions otherwise.)
22825 @smallexample
22826 void __cyg_profile_func_enter (void *this_fn,
22827                                void *call_site);
22828 void __cyg_profile_func_exit  (void *this_fn,
22829                                void *call_site);
22830 @end smallexample
22832 The first argument is the address of the start of the current function,
22833 which may be looked up exactly in the symbol table.
22835 This instrumentation is also done for functions expanded inline in other
22836 functions.  The profiling calls indicate where, conceptually, the
22837 inline function is entered and exited.  This means that addressable
22838 versions of such functions must be available.  If all your uses of a
22839 function are expanded inline, this may mean an additional expansion of
22840 code size.  If you use @samp{extern inline} in your C code, an
22841 addressable version of such functions must be provided.  (This is
22842 normally the case anyway, but if you get lucky and the optimizer always
22843 expands the functions inline, you might have gotten away without
22844 providing static copies.)
22846 A function may be given the attribute @code{no_instrument_function}, in
22847 which case this instrumentation is not done.  This can be used, for
22848 example, for the profiling functions listed above, high-priority
22849 interrupt routines, and any functions from which the profiling functions
22850 cannot safely be called (perhaps signal handlers, if the profiling
22851 routines generate output or allocate memory).
22853 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
22854 @opindex finstrument-functions-exclude-file-list
22856 Set the list of functions that are excluded from instrumentation (see
22857 the description of @code{-finstrument-functions}).  If the file that
22858 contains a function definition matches with one of @var{file}, then
22859 that function is not instrumented.  The match is done on substrings:
22860 if the @var{file} parameter is a substring of the file name, it is
22861 considered to be a match.
22863 For example:
22865 @smallexample
22866 -finstrument-functions-exclude-file-list=/bits/stl,include/sys
22867 @end smallexample
22869 @noindent
22870 excludes any inline function defined in files whose pathnames
22871 contain @code{/bits/stl} or @code{include/sys}.
22873 If, for some reason, you want to include letter @code{','} in one of
22874 @var{sym}, write @code{'\,'}. For example,
22875 @code{-finstrument-functions-exclude-file-list='\,\,tmp'}
22876 (note the single quote surrounding the option).
22878 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
22879 @opindex finstrument-functions-exclude-function-list
22881 This is similar to @code{-finstrument-functions-exclude-file-list},
22882 but this option sets the list of function names to be excluded from
22883 instrumentation.  The function name to be matched is its user-visible
22884 name, such as @code{vector<int> blah(const vector<int> &)}, not the
22885 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
22886 match is done on substrings: if the @var{sym} parameter is a substring
22887 of the function name, it is considered to be a match.  For C99 and C++
22888 extended identifiers, the function name must be given in UTF-8, not
22889 using universal character names.
22891 @item -fstack-check
22892 @opindex fstack-check
22893 Generate code to verify that you do not go beyond the boundary of the
22894 stack.  You should specify this flag if you are running in an
22895 environment with multiple threads, but you only rarely need to specify it in
22896 a single-threaded environment since stack overflow is automatically
22897 detected on nearly all systems if there is only one stack.
22899 Note that this switch does not actually cause checking to be done; the
22900 operating system or the language runtime must do that.  The switch causes
22901 generation of code to ensure that they see the stack being extended.
22903 You can additionally specify a string parameter: @code{no} means no
22904 checking, @code{generic} means force the use of old-style checking,
22905 @code{specific} means use the best checking method and is equivalent
22906 to bare @option{-fstack-check}.
22908 Old-style checking is a generic mechanism that requires no specific
22909 target support in the compiler but comes with the following drawbacks:
22911 @enumerate
22912 @item
22913 Modified allocation strategy for large objects: they are always
22914 allocated dynamically if their size exceeds a fixed threshold.
22916 @item
22917 Fixed limit on the size of the static frame of functions: when it is
22918 topped by a particular function, stack checking is not reliable and
22919 a warning is issued by the compiler.
22921 @item
22922 Inefficiency: because of both the modified allocation strategy and the
22923 generic implementation, code performance is hampered.
22924 @end enumerate
22926 Note that old-style stack checking is also the fallback method for
22927 @code{specific} if no target support has been added in the compiler.
22929 @item -fstack-limit-register=@var{reg}
22930 @itemx -fstack-limit-symbol=@var{sym}
22931 @itemx -fno-stack-limit
22932 @opindex fstack-limit-register
22933 @opindex fstack-limit-symbol
22934 @opindex fno-stack-limit
22935 Generate code to ensure that the stack does not grow beyond a certain value,
22936 either the value of a register or the address of a symbol.  If a larger
22937 stack is required, a signal is raised at run time.  For most targets,
22938 the signal is raised before the stack overruns the boundary, so
22939 it is possible to catch the signal without taking special precautions.
22941 For instance, if the stack starts at absolute address @samp{0x80000000}
22942 and grows downwards, you can use the flags
22943 @option{-fstack-limit-symbol=__stack_limit} and
22944 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
22945 of 128KB@.  Note that this may only work with the GNU linker.
22947 @item -fsplit-stack
22948 @opindex fsplit-stack
22949 Generate code to automatically split the stack before it overflows.
22950 The resulting program has a discontiguous stack which can only
22951 overflow if the program is unable to allocate any more memory.  This
22952 is most useful when running threaded programs, as it is no longer
22953 necessary to calculate a good stack size to use for each thread.  This
22954 is currently only implemented for the i386 and x86_64 back ends running
22955 GNU/Linux.
22957 When code compiled with @option{-fsplit-stack} calls code compiled
22958 without @option{-fsplit-stack}, there may not be much stack space
22959 available for the latter code to run.  If compiling all code,
22960 including library code, with @option{-fsplit-stack} is not an option,
22961 then the linker can fix up these calls so that the code compiled
22962 without @option{-fsplit-stack} always has a large stack.  Support for
22963 this is implemented in the gold linker in GNU binutils release 2.21
22964 and later.
22966 @item -fleading-underscore
22967 @opindex fleading-underscore
22968 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
22969 change the way C symbols are represented in the object file.  One use
22970 is to help link with legacy assembly code.
22972 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
22973 generate code that is not binary compatible with code generated without that
22974 switch.  Use it to conform to a non-default application binary interface.
22975 Not all targets provide complete support for this switch.
22977 @item -ftls-model=@var{model}
22978 @opindex ftls-model
22979 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
22980 The @var{model} argument should be one of @code{global-dynamic},
22981 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
22982 Note that the choice is subject to optimization: the compiler may use
22983 a more efficient model for symbols not visible outside of the translation
22984 unit, or if @option{-fpic} is not given on the command line.
22986 The default without @option{-fpic} is @code{initial-exec}; with
22987 @option{-fpic} the default is @code{global-dynamic}.
22989 @item -fvisibility=@var{default|internal|hidden|protected}
22990 @opindex fvisibility
22991 Set the default ELF image symbol visibility to the specified option---all
22992 symbols are marked with this unless overridden within the code.
22993 Using this feature can very substantially improve linking and
22994 load times of shared object libraries, produce more optimized
22995 code, provide near-perfect API export and prevent symbol clashes.
22996 It is @strong{strongly} recommended that you use this in any shared objects
22997 you distribute.
22999 Despite the nomenclature, @code{default} always means public; i.e.,
23000 available to be linked against from outside the shared object.
23001 @code{protected} and @code{internal} are pretty useless in real-world
23002 usage so the only other commonly used option is @code{hidden}.
23003 The default if @option{-fvisibility} isn't specified is
23004 @code{default}, i.e., make every
23005 symbol public---this causes the same behavior as previous versions of
23006 GCC@.
23008 A good explanation of the benefits offered by ensuring ELF
23009 symbols have the correct visibility is given by ``How To Write
23010 Shared Libraries'' by Ulrich Drepper (which can be found at
23011 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
23012 solution made possible by this option to marking things hidden when
23013 the default is public is to make the default hidden and mark things
23014 public.  This is the norm with DLLs on Windows and with @option{-fvisibility=hidden}
23015 and @code{__attribute__ ((visibility("default")))} instead of
23016 @code{__declspec(dllexport)} you get almost identical semantics with
23017 identical syntax.  This is a great boon to those working with
23018 cross-platform projects.
23020 For those adding visibility support to existing code, you may find
23021 @samp{#pragma GCC visibility} of use.  This works by you enclosing
23022 the declarations you wish to set visibility for with (for example)
23023 @samp{#pragma GCC visibility push(hidden)} and
23024 @samp{#pragma GCC visibility pop}.
23025 Bear in mind that symbol visibility should be viewed @strong{as
23026 part of the API interface contract} and thus all new code should
23027 always specify visibility when it is not the default; i.e., declarations
23028 only for use within the local DSO should @strong{always} be marked explicitly
23029 as hidden as so to avoid PLT indirection overheads---making this
23030 abundantly clear also aids readability and self-documentation of the code.
23031 Note that due to ISO C++ specification requirements, @code{operator new} and
23032 @code{operator delete} must always be of default visibility.
23034 Be aware that headers from outside your project, in particular system
23035 headers and headers from any other library you use, may not be
23036 expecting to be compiled with visibility other than the default.  You
23037 may need to explicitly say @samp{#pragma GCC visibility push(default)}
23038 before including any such headers.
23040 @samp{extern} declarations are not affected by @option{-fvisibility}, so
23041 a lot of code can be recompiled with @option{-fvisibility=hidden} with
23042 no modifications.  However, this means that calls to @code{extern}
23043 functions with no explicit visibility use the PLT, so it is more
23044 effective to use @code{__attribute ((visibility))} and/or
23045 @code{#pragma GCC visibility} to tell the compiler which @code{extern}
23046 declarations should be treated as hidden.
23048 Note that @option{-fvisibility} does affect C++ vague linkage
23049 entities. This means that, for instance, an exception class that is
23050 be thrown between DSOs must be explicitly marked with default
23051 visibility so that the @samp{type_info} nodes are unified between
23052 the DSOs.
23054 An overview of these techniques, their benefits and how to use them
23055 is at @uref{http://gcc.gnu.org/@/wiki/@/Visibility}.
23057 @item -fstrict-volatile-bitfields
23058 @opindex fstrict-volatile-bitfields
23059 This option should be used if accesses to volatile bit-fields (or other
23060 structure fields, although the compiler usually honors those types
23061 anyway) should use a single access of the width of the
23062 field's type, aligned to a natural alignment if possible.  For
23063 example, targets with memory-mapped peripheral registers might require
23064 all such accesses to be 16 bits wide; with this flag you can
23065 declare all peripheral bit-fields as @code{unsigned short} (assuming short
23066 is 16 bits on these targets) to force GCC to use 16-bit accesses
23067 instead of, perhaps, a more efficient 32-bit access.
23069 If this option is disabled, the compiler uses the most efficient
23070 instruction.  In the previous example, that might be a 32-bit load
23071 instruction, even though that accesses bytes that do not contain
23072 any portion of the bit-field, or memory-mapped registers unrelated to
23073 the one being updated.
23075 In some cases, such as when the @code{packed} attribute is applied to a 
23076 structure field, it may not be possible to access the field with a single
23077 read or write that is correctly aligned for the target machine.  In this
23078 case GCC falls back to generating multiple accesses rather than code that 
23079 will fault or truncate the result at run time.
23081 Note:  Due to restrictions of the C/C++11 memory model, write accesses are
23082 not allowed to touch non bit-field members.  It is therefore recommended
23083 to define all bits of the field's type as bit-field members.
23085 The default value of this option is determined by the application binary
23086 interface for the target processor.
23088 @item -fsync-libcalls
23089 @opindex fsync-libcalls
23090 This option controls whether any out-of-line instance of the @code{__sync}
23091 family of functions may be used to implement the C++11 @code{__atomic}
23092 family of functions.
23094 The default value of this option is enabled, thus the only useful form
23095 of the option is @option{-fno-sync-libcalls}.  This option is used in
23096 the implementation of the @file{libatomic} runtime library.
23098 @end table
23100 @c man end
23102 @node Environment Variables
23103 @section Environment Variables Affecting GCC
23104 @cindex environment variables
23106 @c man begin ENVIRONMENT
23107 This section describes several environment variables that affect how GCC
23108 operates.  Some of them work by specifying directories or prefixes to use
23109 when searching for various kinds of files.  Some are used to specify other
23110 aspects of the compilation environment.
23112 Note that you can also specify places to search using options such as
23113 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
23114 take precedence over places specified using environment variables, which
23115 in turn take precedence over those specified by the configuration of GCC@.
23116 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
23117 GNU Compiler Collection (GCC) Internals}.
23119 @table @env
23120 @item LANG
23121 @itemx LC_CTYPE
23122 @c @itemx LC_COLLATE
23123 @itemx LC_MESSAGES
23124 @c @itemx LC_MONETARY
23125 @c @itemx LC_NUMERIC
23126 @c @itemx LC_TIME
23127 @itemx LC_ALL
23128 @findex LANG
23129 @findex LC_CTYPE
23130 @c @findex LC_COLLATE
23131 @findex LC_MESSAGES
23132 @c @findex LC_MONETARY
23133 @c @findex LC_NUMERIC
23134 @c @findex LC_TIME
23135 @findex LC_ALL
23136 @cindex locale
23137 These environment variables control the way that GCC uses
23138 localization information which allows GCC to work with different
23139 national conventions.  GCC inspects the locale categories
23140 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
23141 so.  These locale categories can be set to any value supported by your
23142 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
23143 Kingdom encoded in UTF-8.
23145 The @env{LC_CTYPE} environment variable specifies character
23146 classification.  GCC uses it to determine the character boundaries in
23147 a string; this is needed for some multibyte encodings that contain quote
23148 and escape characters that are otherwise interpreted as a string
23149 end or escape.
23151 The @env{LC_MESSAGES} environment variable specifies the language to
23152 use in diagnostic messages.
23154 If the @env{LC_ALL} environment variable is set, it overrides the value
23155 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
23156 and @env{LC_MESSAGES} default to the value of the @env{LANG}
23157 environment variable.  If none of these variables are set, GCC
23158 defaults to traditional C English behavior.
23160 @item TMPDIR
23161 @findex TMPDIR
23162 If @env{TMPDIR} is set, it specifies the directory to use for temporary
23163 files.  GCC uses temporary files to hold the output of one stage of
23164 compilation which is to be used as input to the next stage: for example,
23165 the output of the preprocessor, which is the input to the compiler
23166 proper.
23168 @item GCC_COMPARE_DEBUG
23169 @findex GCC_COMPARE_DEBUG
23170 Setting @env{GCC_COMPARE_DEBUG} is nearly equivalent to passing
23171 @option{-fcompare-debug} to the compiler driver.  See the documentation
23172 of this option for more details.
23174 @item GCC_EXEC_PREFIX
23175 @findex GCC_EXEC_PREFIX
23176 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
23177 names of the subprograms executed by the compiler.  No slash is added
23178 when this prefix is combined with the name of a subprogram, but you can
23179 specify a prefix that ends with a slash if you wish.
23181 If @env{GCC_EXEC_PREFIX} is not set, GCC attempts to figure out
23182 an appropriate prefix to use based on the pathname it is invoked with.
23184 If GCC cannot find the subprogram using the specified prefix, it
23185 tries looking in the usual places for the subprogram.
23187 The default value of @env{GCC_EXEC_PREFIX} is
23188 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
23189 the installed compiler. In many cases @var{prefix} is the value
23190 of @code{prefix} when you ran the @file{configure} script.
23192 Other prefixes specified with @option{-B} take precedence over this prefix.
23194 This prefix is also used for finding files such as @file{crt0.o} that are
23195 used for linking.
23197 In addition, the prefix is used in an unusual way in finding the
23198 directories to search for header files.  For each of the standard
23199 directories whose name normally begins with @samp{/usr/local/lib/gcc}
23200 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
23201 replacing that beginning with the specified prefix to produce an
23202 alternate directory name.  Thus, with @option{-Bfoo/}, GCC searches
23203 @file{foo/bar} just before it searches the standard directory 
23204 @file{/usr/local/lib/bar}.
23205 If a standard directory begins with the configured
23206 @var{prefix} then the value of @var{prefix} is replaced by
23207 @env{GCC_EXEC_PREFIX} when looking for header files.
23209 @item COMPILER_PATH
23210 @findex COMPILER_PATH
23211 The value of @env{COMPILER_PATH} is a colon-separated list of
23212 directories, much like @env{PATH}.  GCC tries the directories thus
23213 specified when searching for subprograms, if it can't find the
23214 subprograms using @env{GCC_EXEC_PREFIX}.
23216 @item LIBRARY_PATH
23217 @findex LIBRARY_PATH
23218 The value of @env{LIBRARY_PATH} is a colon-separated list of
23219 directories, much like @env{PATH}.  When configured as a native compiler,
23220 GCC tries the directories thus specified when searching for special
23221 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
23222 using GCC also uses these directories when searching for ordinary
23223 libraries for the @option{-l} option (but directories specified with
23224 @option{-L} come first).
23226 @item LANG
23227 @findex LANG
23228 @cindex locale definition
23229 This variable is used to pass locale information to the compiler.  One way in
23230 which this information is used is to determine the character set to be used
23231 when character literals, string literals and comments are parsed in C and C++.
23232 When the compiler is configured to allow multibyte characters,
23233 the following values for @env{LANG} are recognized:
23235 @table @samp
23236 @item C-JIS
23237 Recognize JIS characters.
23238 @item C-SJIS
23239 Recognize SJIS characters.
23240 @item C-EUCJP
23241 Recognize EUCJP characters.
23242 @end table
23244 If @env{LANG} is not defined, or if it has some other value, then the
23245 compiler uses @code{mblen} and @code{mbtowc} as defined by the default locale to
23246 recognize and translate multibyte characters.
23247 @end table
23249 @noindent
23250 Some additional environment variables affect the behavior of the
23251 preprocessor.
23253 @include cppenv.texi
23255 @c man end
23257 @node Precompiled Headers
23258 @section Using Precompiled Headers
23259 @cindex precompiled headers
23260 @cindex speed of compilation
23262 Often large projects have many header files that are included in every
23263 source file.  The time the compiler takes to process these header files
23264 over and over again can account for nearly all of the time required to
23265 build the project.  To make builds faster, GCC allows you to
23266 @dfn{precompile} a header file.
23268 To create a precompiled header file, simply compile it as you would any
23269 other file, if necessary using the @option{-x} option to make the driver
23270 treat it as a C or C++ header file.  You may want to use a
23271 tool like @command{make} to keep the precompiled header up-to-date when
23272 the headers it contains change.
23274 A precompiled header file is searched for when @code{#include} is
23275 seen in the compilation.  As it searches for the included file
23276 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
23277 compiler looks for a precompiled header in each directory just before it
23278 looks for the include file in that directory.  The name searched for is
23279 the name specified in the @code{#include} with @samp{.gch} appended.  If
23280 the precompiled header file can't be used, it is ignored.
23282 For instance, if you have @code{#include "all.h"}, and you have
23283 @file{all.h.gch} in the same directory as @file{all.h}, then the
23284 precompiled header file is used if possible, and the original
23285 header is used otherwise.
23287 Alternatively, you might decide to put the precompiled header file in a
23288 directory and use @option{-I} to ensure that directory is searched
23289 before (or instead of) the directory containing the original header.
23290 Then, if you want to check that the precompiled header file is always
23291 used, you can put a file of the same name as the original header in this
23292 directory containing an @code{#error} command.
23294 This also works with @option{-include}.  So yet another way to use
23295 precompiled headers, good for projects not designed with precompiled
23296 header files in mind, is to simply take most of the header files used by
23297 a project, include them from another header file, precompile that header
23298 file, and @option{-include} the precompiled header.  If the header files
23299 have guards against multiple inclusion, they are skipped because
23300 they've already been included (in the precompiled header).
23302 If you need to precompile the same header file for different
23303 languages, targets, or compiler options, you can instead make a
23304 @emph{directory} named like @file{all.h.gch}, and put each precompiled
23305 header in the directory, perhaps using @option{-o}.  It doesn't matter
23306 what you call the files in the directory; every precompiled header in
23307 the directory is considered.  The first precompiled header
23308 encountered in the directory that is valid for this compilation is
23309 used; they're searched in no particular order.
23311 There are many other possibilities, limited only by your imagination,
23312 good sense, and the constraints of your build system.
23314 A precompiled header file can be used only when these conditions apply:
23316 @itemize
23317 @item
23318 Only one precompiled header can be used in a particular compilation.
23320 @item
23321 A precompiled header can't be used once the first C token is seen.  You
23322 can have preprocessor directives before a precompiled header; you cannot
23323 include a precompiled header from inside another header.
23325 @item
23326 The precompiled header file must be produced for the same language as
23327 the current compilation.  You can't use a C precompiled header for a C++
23328 compilation.
23330 @item
23331 The precompiled header file must have been produced by the same compiler
23332 binary as the current compilation is using.
23334 @item
23335 Any macros defined before the precompiled header is included must
23336 either be defined in the same way as when the precompiled header was
23337 generated, or must not affect the precompiled header, which usually
23338 means that they don't appear in the precompiled header at all.
23340 The @option{-D} option is one way to define a macro before a
23341 precompiled header is included; using a @code{#define} can also do it.
23342 There are also some options that define macros implicitly, like
23343 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
23344 defined this way.
23346 @item If debugging information is output when using the precompiled
23347 header, using @option{-g} or similar, the same kind of debugging information
23348 must have been output when building the precompiled header.  However,
23349 a precompiled header built using @option{-g} can be used in a compilation
23350 when no debugging information is being output.
23352 @item The same @option{-m} options must generally be used when building
23353 and using the precompiled header.  @xref{Submodel Options},
23354 for any cases where this rule is relaxed.
23356 @item Each of the following options must be the same when building and using
23357 the precompiled header:
23359 @gccoptlist{-fexceptions}
23361 @item
23362 Some other command-line options starting with @option{-f},
23363 @option{-p}, or @option{-O} must be defined in the same way as when
23364 the precompiled header was generated.  At present, it's not clear
23365 which options are safe to change and which are not; the safest choice
23366 is to use exactly the same options when generating and using the
23367 precompiled header.  The following are known to be safe:
23369 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
23370 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
23371 -fsched-verbose=@var{number}  -fschedule-insns  -fvisibility= @gol
23372 -pedantic-errors}
23374 @end itemize
23376 For all of these except the last, the compiler automatically
23377 ignores the precompiled header if the conditions aren't met.  If you
23378 find an option combination that doesn't work and doesn't cause the
23379 precompiled header to be ignored, please consider filing a bug report,
23380 see @ref{Bugs}.
23382 If you do use differing options when generating and using the
23383 precompiled header, the actual behavior is a mixture of the
23384 behavior for the options.  For instance, if you use @option{-g} to
23385 generate the precompiled header but not when using it, you may or may
23386 not get debugging information for routines in the precompiled header.