2010-07-06 Tobias Burnus <burnus@net-b.de>
[official-gcc.git] / gcc / doc / invoke.texi
blobd70f130537c5c6903d6ef3499004257eaabb205e
1 @c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2 @c 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
3 @c Free Software Foundation, Inc.
4 @c This is part of the GCC manual.
5 @c For copying conditions, see the file gcc.texi.
7 @ignore
8 @c man begin INCLUDE
9 @include gcc-vers.texi
10 @c man end
12 @c man begin COPYRIGHT
13 Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
14 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
15 Free Software Foundation, Inc.
17 Permission is granted to copy, distribute and/or modify this document
18 under the terms of the GNU Free Documentation License, Version 1.3 or
19 any later version published by the Free Software Foundation; with the
20 Invariant Sections being ``GNU General Public License'' and ``Funding
21 Free Software'', the Front-Cover texts being (a) (see below), and with
22 the Back-Cover Texts being (b) (see below).  A copy of the license is
23 included in the gfdl(7) man page.
25 (a) The FSF's Front-Cover Text is:
27      A GNU Manual
29 (b) The FSF's Back-Cover Text is:
31      You have freedom to copy and modify this GNU Manual, like GNU
32      software.  Copies published by the Free Software Foundation raise
33      funds for GNU development.
34 @c man end
35 @c Set file name and title for the man page.
36 @setfilename gcc
37 @settitle GNU project C and C++ compiler
38 @c man begin SYNOPSIS
39 gcc [@option{-c}|@option{-S}|@option{-E}] [@option{-std=}@var{standard}]
40     [@option{-g}] [@option{-pg}] [@option{-O}@var{level}]
41     [@option{-W}@var{warn}@dots{}] [@option{-pedantic}]
42     [@option{-I}@var{dir}@dots{}] [@option{-L}@var{dir}@dots{}]
43     [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}]
44     [@option{-f}@var{option}@dots{}] [@option{-m}@var{machine-option}@dots{}]
45     [@option{-o} @var{outfile}] [@@@var{file}] @var{infile}@dots{}
47 Only the most useful options are listed here; see below for the
48 remainder.  @samp{g++} accepts mostly the same options as @samp{gcc}.
49 @c man end
50 @c man begin SEEALSO
51 gpl(7), gfdl(7), fsf-funding(7),
52 cpp(1), gcov(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1)
53 and the Info entries for @file{gcc}, @file{cpp}, @file{as},
54 @file{ld}, @file{binutils} and @file{gdb}.
55 @c man end
56 @c man begin BUGS
57 For instructions on reporting bugs, see
58 @w{@value{BUGURL}}.
59 @c man end
60 @c man begin AUTHOR
61 See the Info entry for @command{gcc}, or
62 @w{@uref{http://gcc.gnu.org/onlinedocs/gcc/Contributors.html}},
63 for contributors to GCC@.
64 @c man end
65 @end ignore
67 @node Invoking GCC
68 @chapter GCC Command Options
69 @cindex GCC command options
70 @cindex command options
71 @cindex options, GCC command
73 @c man begin DESCRIPTION
74 When you invoke GCC, it normally does preprocessing, compilation,
75 assembly and linking.  The ``overall options'' allow you to stop this
76 process at an intermediate stage.  For example, the @option{-c} option
77 says not to run the linker.  Then the output consists of object files
78 output by the assembler.
80 Other options are passed on to one stage of processing.  Some options
81 control the preprocessor and others the compiler itself.  Yet other
82 options control the assembler and linker; most of these are not
83 documented here, since you rarely need to use any of them.
85 @cindex C compilation options
86 Most of the command line options that you can use with GCC are useful
87 for C programs; when an option is only useful with another language
88 (usually C++), the explanation says so explicitly.  If the description
89 for a particular option does not mention a source language, you can use
90 that option with all supported languages.
92 @cindex C++ compilation options
93 @xref{Invoking G++,,Compiling C++ Programs}, for a summary of special
94 options for compiling C++ programs.
96 @cindex grouping options
97 @cindex options, grouping
98 The @command{gcc} program accepts options and file names as operands.  Many
99 options have multi-letter names; therefore multiple single-letter options
100 may @emph{not} be grouped: @option{-dv} is very different from @w{@samp{-d
101 -v}}.
103 @cindex order of options
104 @cindex options, order
105 You can mix options and other arguments.  For the most part, the order
106 you use doesn't matter.  Order does matter when you use several
107 options of the same kind; for example, if you specify @option{-L} more
108 than once, the directories are searched in the order specified.  Also,
109 the placement of the @option{-l} option is significant.
111 Many options have long names starting with @samp{-f} or with
112 @samp{-W}---for example,
113 @option{-fmove-loop-invariants}, @option{-Wformat} and so on.  Most of
114 these have both positive and negative forms; the negative form of
115 @option{-ffoo} would be @option{-fno-foo}.  This manual documents
116 only one of these two forms, whichever one is not the default.
118 @c man end
120 @xref{Option Index}, for an index to GCC's options.
122 @menu
123 * Option Summary::      Brief list of all options, without explanations.
124 * Overall Options::     Controlling the kind of output:
125                         an executable, object files, assembler files,
126                         or preprocessed source.
127 * Invoking G++::        Compiling C++ programs.
128 * C Dialect Options::   Controlling the variant of C language compiled.
129 * C++ Dialect Options:: Variations on C++.
130 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
131                         and Objective-C++.
132 * Language Independent Options:: Controlling how diagnostics should be
133                         formatted.
134 * Warning Options::     How picky should the compiler be?
135 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
136 * Optimize Options::    How much optimization?
137 * Preprocessor Options:: Controlling header files and macro definitions.
138                          Also, getting dependency information for Make.
139 * Assembler Options::   Passing options to the assembler.
140 * Link Options::        Specifying libraries and so on.
141 * Directory Options::   Where to find header files and libraries.
142                         Where to find the compiler executable files.
143 * Spec Files::          How to pass switches to sub-processes.
144 * Target Options::      Running a cross-compiler, or an old version of GCC.
145 * Submodel Options::    Specifying minor hardware or convention variations,
146                         such as 68010 vs 68020.
147 * Code Gen Options::    Specifying conventions for function calls, data layout
148                         and register usage.
149 * Environment Variables:: Env vars that affect GCC.
150 * Precompiled Headers:: Compiling a header once, and using it many times.
151 @end menu
153 @c man begin OPTIONS
155 @node Option Summary
156 @section Option Summary
158 Here is a summary of all the options, grouped by type.  Explanations are
159 in the following sections.
161 @table @emph
162 @item Overall Options
163 @xref{Overall Options,,Options Controlling the Kind of Output}.
164 @gccoptlist{-c  -S  -E  -o @var{file}  -combine  -no-canonical-prefixes  @gol
165 -pipe  -pass-exit-codes  @gol
166 -x @var{language}  -v  -###  --help@r{[}=@var{class}@r{[},@dots{}@r{]]}  --target-help  @gol
167 --version -wrapper@@@var{file} -fplugin=@var{file} -fplugin-arg-@var{name}=@var{arg}  @gol
168 -fdump-ada-spec@r{[}-slim@r{]}}
170 @item C Language Options
171 @xref{C Dialect Options,,Options Controlling C Dialect}.
172 @gccoptlist{-ansi  -std=@var{standard}  -fgnu89-inline @gol
173 -aux-info @var{filename} @gol
174 -fno-asm  -fno-builtin  -fno-builtin-@var{function} @gol
175 -fhosted  -ffreestanding -fopenmp -fms-extensions @gol
176 -trigraphs  -no-integrated-cpp  -traditional  -traditional-cpp @gol
177 -fallow-single-precision  -fcond-mismatch -flax-vector-conversions @gol
178 -fsigned-bitfields  -fsigned-char @gol
179 -funsigned-bitfields  -funsigned-char}
181 @item C++ Language Options
182 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
183 @gccoptlist{-fabi-version=@var{n}  -fno-access-control  -fcheck-new @gol
184 -fconserve-space  -ffriend-injection @gol
185 -fno-elide-constructors @gol
186 -fno-enforce-eh-specs @gol
187 -ffor-scope  -fno-for-scope  -fno-gnu-keywords @gol
188 -fno-implicit-templates @gol
189 -fno-implicit-inline-templates @gol
190 -fno-implement-inlines  -fms-extensions @gol
191 -fno-nonansi-builtins  -fnothrow-opt  -fno-operator-names @gol
192 -fno-optional-diags  -fpermissive @gol
193 -fno-pretty-templates @gol
194 -frepo  -fno-rtti  -fstats  -ftemplate-depth=@var{n} @gol
195 -fno-threadsafe-statics -fuse-cxa-atexit  -fno-weak  -nostdinc++ @gol
196 -fno-default-inline  -fvisibility-inlines-hidden @gol
197 -fvisibility-ms-compat @gol
198 -Wabi  -Wconversion-null  -Wctor-dtor-privacy @gol
199 -Wnoexcept -Wnon-virtual-dtor  -Wreorder @gol
200 -Weffc++  -Wstrict-null-sentinel @gol
201 -Wno-non-template-friend  -Wold-style-cast @gol
202 -Woverloaded-virtual  -Wno-pmf-conversions @gol
203 -Wsign-promo}
205 @item Objective-C and Objective-C++ Language Options
206 @xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling
207 Objective-C and Objective-C++ Dialects}.
208 @gccoptlist{-fconstant-string-class=@var{class-name} @gol
209 -fgnu-runtime  -fnext-runtime @gol
210 -fno-nil-receivers @gol
211 -fobjc-call-cxx-cdtors @gol
212 -fobjc-direct-dispatch @gol
213 -fobjc-exceptions @gol
214 -fobjc-gc @gol
215 -freplace-objc-classes @gol
216 -fzero-link @gol
217 -gen-decls @gol
218 -Wassign-intercept @gol
219 -Wno-protocol  -Wselector @gol
220 -Wstrict-selector-match @gol
221 -Wundeclared-selector}
223 @item Language Independent Options
224 @xref{Language Independent Options,,Options to Control Diagnostic Messages Formatting}.
225 @gccoptlist{-fmessage-length=@var{n}  @gol
226 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol
227 -fdiagnostics-show-option}
229 @item Warning Options
230 @xref{Warning Options,,Options to Request or Suppress Warnings}.
231 @gccoptlist{-fsyntax-only  -pedantic  -pedantic-errors @gol
232 -w  -Wextra  -Wall  -Waddress  -Waggregate-return  -Warray-bounds @gol
233 -Wno-attributes -Wno-builtin-macro-redefined @gol
234 -Wc++-compat -Wc++0x-compat -Wcast-align  -Wcast-qual  @gol
235 -Wchar-subscripts -Wclobbered  -Wcomment @gol
236 -Wconversion  -Wcoverage-mismatch  -Wcpp  -Wno-deprecated  @gol
237 -Wno-deprecated-declarations -Wdisabled-optimization  @gol
238 -Wno-div-by-zero -Wempty-body  -Wenum-compare -Wno-endif-labels @gol
239 -Werror  -Werror=* @gol
240 -Wfatal-errors  -Wfloat-equal  -Wformat  -Wformat=2 @gol
241 -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol
242 -Wformat-security  -Wformat-y2k @gol
243 -Wframe-larger-than=@var{len} -Wjump-misses-init -Wignored-qualifiers @gol
244 -Wimplicit  -Wimplicit-function-declaration  -Wimplicit-int @gol
245 -Winit-self  -Winline @gol
246 -Wno-int-to-pointer-cast -Wno-invalid-offsetof @gol
247 -Winvalid-pch -Wlarger-than=@var{len}  -Wunsafe-loop-optimizations @gol
248 -Wlogical-op -Wlong-long @gol
249 -Wmain  -Wmissing-braces  -Wmissing-field-initializers @gol
250 -Wmissing-format-attribute  -Wmissing-include-dirs @gol
251 -Wno-mudflap @gol
252 -Wno-multichar  -Wnonnull  -Wno-overflow @gol
253 -Woverlength-strings  -Wpacked  -Wpacked-bitfield-compat  -Wpadded @gol
254 -Wparentheses  -Wpedantic-ms-format -Wno-pedantic-ms-format @gol
255 -Wpointer-arith  -Wno-pointer-to-int-cast @gol
256 -Wredundant-decls @gol
257 -Wreturn-type  -Wsequence-point  -Wshadow @gol
258 -Wsign-compare  -Wsign-conversion  -Wstack-protector @gol
259 -Wstrict-aliasing -Wstrict-aliasing=n @gol
260 -Wstrict-overflow -Wstrict-overflow=@var{n} @gol
261 -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{]} @gol
262 -Wswitch  -Wswitch-default  -Wswitch-enum -Wsync-nand @gol
263 -Wsystem-headers  -Wtrigraphs  -Wtype-limits  -Wundef  -Wuninitialized @gol
264 -Wunknown-pragmas  -Wno-pragmas @gol
265 -Wunsuffixed-float-constants  -Wunused  -Wunused-function @gol
266 -Wunused-label  -Wunused-parameter -Wno-unused-result -Wunused-value  -Wunused-variable @gol
267 -Wunused-but-set-parameter -Wunused-but-set-variable -Wvariadic-macros -Wvla @gol
268 -Wvolatile-register-var  -Wwrite-strings}
270 @item C and Objective-C-only Warning Options
271 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
272 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
273 -Wold-style-declaration  -Wold-style-definition @gol
274 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
275 -Wdeclaration-after-statement -Wpointer-sign}
277 @item Debugging Options
278 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
279 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
280 -fdbg-cnt-list -fdbg-cnt=@var{counter-value-list} @gol
281 -fdump-noaddr -fdump-unnumbered -fdump-unnumbered-links @gol
282 -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
283 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
284 -fdump-ipa-all -fdump-ipa-cgraph -fdump-ipa-inline @gol
285 -fdump-statistics @gol
286 -fdump-tree-all @gol
287 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
288 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
289 -fdump-tree-cfg -fdump-tree-vcg -fdump-tree-alias @gol
290 -fdump-tree-ch @gol
291 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
292 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
293 -fdump-tree-gimple@r{[}-raw@r{]} -fdump-tree-mudflap@r{[}-@var{n}@r{]} @gol
294 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
295 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
296 -fdump-tree-phiprop@r{[}-@var{n}@r{]} @gol
297 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
298 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
299 -fdump-tree-copyrename@r{[}-@var{n}@r{]} @gol
300 -fdump-tree-nrv -fdump-tree-vect @gol
301 -fdump-tree-sink @gol
302 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
303 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
304 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
305 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
306 -ftree-vectorizer-verbose=@var{n} @gol
307 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
308 -fdump-final-insns=@var{file} @gol
309 -fcompare-debug@r{[}=@var{opts}@r{]}  -fcompare-debug-second @gol
310 -feliminate-dwarf2-dups -feliminate-unused-debug-types @gol
311 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
312 -fenable-icf-debug @gol
313 -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
314 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
315 -fsel-sched-verbose -fsel-sched-dump-cfg -fsel-sched-pipelining-verbose @gol
316 -ftest-coverage  -ftime-report -fvar-tracking @gol
317 -fvar-tracking-assignments  -fvar-tracking-assignments-toggle @gol
318 -g  -g@var{level}  -gtoggle  -gcoff  -gdwarf-@var{version} @gol
319 -ggdb  -gstabs  -gstabs+  -gstrict-dwarf  -gno-strict-dwarf @gol
320 -gvms  -gxcoff  -gxcoff+ @gol
321 -fno-merge-debug-strings -fno-dwarf2-cfi-asm @gol
322 -fdebug-prefix-map=@var{old}=@var{new} @gol
323 -femit-struct-debug-baseonly -femit-struct-debug-reduced @gol
324 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
325 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
326 -print-multi-directory  -print-multi-lib  -print-multi-os-directory @gol
327 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
328 -print-sysroot -print-sysroot-headers-suffix @gol
329 -save-temps -save-temps=cwd -save-temps=obj -time@r{[}=@var{file}@r{]}}
331 @item Optimization Options
332 @xref{Optimize Options,,Options that Control Optimization}.
333 @gccoptlist{
334 -falign-functions[=@var{n}] -falign-jumps[=@var{n}] @gol
335 -falign-labels[=@var{n}] -falign-loops[=@var{n}] -fassociative-math @gol
336 -fauto-inc-dec -fbranch-probabilities -fbranch-target-load-optimize @gol
337 -fbranch-target-load-optimize2 -fbtr-bb-exclusive -fcaller-saves @gol
338 -fcheck-data-deps -fconserve-stack -fcprop-registers -fcrossjumping @gol
339 -fcse-follow-jumps -fcse-skip-blocks -fcx-fortran-rules -fcx-limited-range @gol
340 -fdata-sections -fdce -fdce @gol
341 -fdelayed-branch -fdelete-null-pointer-checks -fdse -fdse @gol
342 -fearly-inlining -fipa-sra -fexpensive-optimizations -ffast-math @gol
343 -ffinite-math-only -ffloat-store -fexcess-precision=@var{style} @gol
344 -fforward-propagate -ffunction-sections @gol
345 -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm @gol
346 -fgcse-sm -fif-conversion -fif-conversion2 -findirect-inlining @gol
347 -finline-functions -finline-functions-called-once -finline-limit=@var{n} @gol
348 -finline-small-functions -fipa-cp -fipa-cp-clone -fipa-matrix-reorg -fipa-pta @gol
349 -fipa-profile -fipa-pure-const -fipa-reference -fipa-struct-reorg @gol
350 -fira-algorithm=@var{algorithm} @gol
351 -fira-region=@var{region} -fira-coalesce @gol
352 -fira-loop-pressure -fno-ira-share-save-slots @gol
353 -fno-ira-share-spill-slots -fira-verbose=@var{n} @gol
354 -fivopts -fkeep-inline-functions -fkeep-static-consts @gol
355 -floop-block -floop-interchange -floop-strip-mine -fgraphite-identity @gol
356 -floop-parallelize-all -flto -flto-compression-level -flto-report -fltrans @gol
357 -fltrans-output-list -fmerge-all-constants -fmerge-constants -fmodulo-sched @gol
358 -fmodulo-sched-allow-regmoves -fmove-loop-invariants -fmudflap @gol
359 -fmudflapir -fmudflapth -fno-branch-count-reg -fno-default-inline @gol
360 -fno-defer-pop -fno-function-cse -fno-guess-branch-probability @gol
361 -fno-inline -fno-math-errno -fno-peephole -fno-peephole2 @gol
362 -fno-sched-interblock -fno-sched-spec -fno-signed-zeros @gol
363 -fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss @gol
364 -fomit-frame-pointer -foptimize-register-move -foptimize-sibling-calls @gol
365 -fpartial-inlining -fpeel-loops -fpredictive-commoning -fprefetch-loop-arrays @gol
366 -fprofile-correction -fprofile-dir=@var{path} -fprofile-generate @gol
367 -fprofile-generate=@var{path} @gol
368 -fprofile-use -fprofile-use=@var{path} -fprofile-values @gol
369 -freciprocal-math -fregmove -frename-registers -freorder-blocks @gol
370 -freorder-blocks-and-partition -freorder-functions @gol
371 -frerun-cse-after-loop -freschedule-modulo-scheduled-loops @gol
372 -frounding-math -fsched2-use-superblocks -fsched-pressure @gol
373 -fsched-spec-load -fsched-spec-load-dangerous @gol
374 -fsched-stalled-insns-dep[=@var{n}] -fsched-stalled-insns[=@var{n}] @gol
375 -fsched-group-heuristic -fsched-critical-path-heuristic @gol
376 -fsched-spec-insn-heuristic -fsched-rank-heuristic @gol
377 -fsched-last-insn-heuristic -fsched-dep-count-heuristic @gol
378 -fschedule-insns -fschedule-insns2 -fsection-anchors @gol
379 -fselective-scheduling -fselective-scheduling2 @gol
380 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops @gol
381 -fsignaling-nans -fsingle-precision-constant -fsplit-ivs-in-unroller @gol
382 -fsplit-wide-types -fstack-protector -fstack-protector-all @gol
383 -fstrict-aliasing -fstrict-overflow -fthread-jumps -ftracer @gol
384 -ftree-builtin-call-dce -ftree-ccp -ftree-ch -ftree-copy-prop @gol
385 -ftree-copyrename -ftree-dce @gol
386 -ftree-dominator-opts -ftree-dse -ftree-forwprop -ftree-fre -ftree-loop-im @gol
387 -ftree-phiprop -ftree-loop-distribution @gol
388 -ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize @gol
389 -ftree-parallelize-loops=@var{n} -ftree-pre -ftree-pta -ftree-reassoc @gol
390 -ftree-sink -ftree-sra -ftree-switch-conversion @gol
391 -ftree-ter -ftree-vect-loop-version -ftree-vectorize -ftree-vrp @gol
392 -funit-at-a-time -funroll-all-loops -funroll-loops @gol
393 -funsafe-loop-optimizations -funsafe-math-optimizations -funswitch-loops @gol
394 -fvariable-expansion-in-unroller -fvect-cost-model -fvpt -fweb @gol
395 -fwhole-program -fwhopr[=@var{n}] -fwpa -fuse-linker-plugin @gol
396 --param @var{name}=@var{value}
397 -O  -O0  -O1  -O2  -O3  -Os -Ofast}
399 @item Preprocessor Options
400 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
401 @gccoptlist{-A@var{question}=@var{answer} @gol
402 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
403 -C  -dD  -dI  -dM  -dN @gol
404 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
405 -idirafter @var{dir} @gol
406 -include @var{file}  -imacros @var{file} @gol
407 -iprefix @var{file}  -iwithprefix @var{dir} @gol
408 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
409 -imultilib @var{dir} -isysroot @var{dir} @gol
410 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
411 -P  -fworking-directory  -remap @gol
412 -trigraphs  -undef  -U@var{macro}  -Wp,@var{option} @gol
413 -Xpreprocessor @var{option}}
415 @item Assembler Option
416 @xref{Assembler Options,,Passing Options to the Assembler}.
417 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
419 @item Linker Options
420 @xref{Link Options,,Options for Linking}.
421 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
422 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
423 -s  -static  -static-libgcc  -static-libstdc++ -shared  @gol
424 -shared-libgcc  -symbolic @gol
425 -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
426 -u @var{symbol}}
428 @item Directory Options
429 @xref{Directory Options,,Options for Directory Search}.
430 @gccoptlist{-B@var{prefix} -I@var{dir} -iplugindir=@var{dir}}
431 -iquote@var{dir} -L@var{dir} -specs=@var{file} -I-
432 --sysroot=@var{dir}
434 @item Machine Dependent Options
435 @xref{Submodel Options,,Hardware Models and Configurations}.
436 @c This list is ordered alphanumerically by subsection name.
437 @c Try and put the significant identifier (CPU or system) first,
438 @c so users have a clue at guessing where the ones they want will be.
440 @emph{ARC Options}
441 @gccoptlist{-EB  -EL @gol
442 -mmangle-cpu  -mcpu=@var{cpu}  -mtext=@var{text-section} @gol
443 -mdata=@var{data-section}  -mrodata=@var{readonly-data-section}}
445 @emph{ARM Options}
446 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
447 -mabi=@var{name} @gol
448 -mapcs-stack-check  -mno-apcs-stack-check @gol
449 -mapcs-float  -mno-apcs-float @gol
450 -mapcs-reentrant  -mno-apcs-reentrant @gol
451 -msched-prolog  -mno-sched-prolog @gol
452 -mlittle-endian  -mbig-endian  -mwords-little-endian @gol
453 -mfloat-abi=@var{name}  -msoft-float  -mhard-float  -mfpe @gol
454 -mfp16-format=@var{name}
455 -mthumb-interwork  -mno-thumb-interwork @gol
456 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
457 -mstructure-size-boundary=@var{n} @gol
458 -mabort-on-noreturn @gol
459 -mlong-calls  -mno-long-calls @gol
460 -msingle-pic-base  -mno-single-pic-base @gol
461 -mpic-register=@var{reg} @gol
462 -mnop-fun-dllimport @gol
463 -mcirrus-fix-invalid-insns -mno-cirrus-fix-invalid-insns @gol
464 -mpoke-function-name @gol
465 -mthumb  -marm @gol
466 -mtpcs-frame  -mtpcs-leaf-frame @gol
467 -mcaller-super-interworking  -mcallee-super-interworking @gol
468 -mtp=@var{name} @gol
469 -mword-relocations @gol
470 -mfix-cortex-m3-ldrd}
472 @emph{AVR Options}
473 @gccoptlist{-mmcu=@var{mcu}  -mno-interrupts @gol
474 -mcall-prologues  -mtiny-stack  -mint8}
476 @emph{Blackfin Options}
477 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
478 -msim -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
479 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
480 -mlow-64k -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
481 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
482 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
483 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
484 -mfast-fp -minline-plt -mmulticore  -mcorea  -mcoreb  -msdram @gol
485 -micplb}
487 @emph{CRIS Options}
488 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
489 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
490 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
491 -mstack-align  -mdata-align  -mconst-align @gol
492 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
493 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
494 -mmul-bug-workaround  -mno-mul-bug-workaround}
496 @emph{CRX Options}
497 @gccoptlist{-mmac -mpush-args}
499 @emph{Darwin Options}
500 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
501 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
502 -client_name  -compatibility_version  -current_version @gol
503 -dead_strip @gol
504 -dependency-file  -dylib_file  -dylinker_install_name @gol
505 -dynamic  -dynamiclib  -exported_symbols_list @gol
506 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
507 -force_flat_namespace  -headerpad_max_install_names @gol
508 -iframework @gol
509 -image_base  -init  -install_name  -keep_private_externs @gol
510 -multi_module  -multiply_defined  -multiply_defined_unused @gol
511 -noall_load   -no_dead_strip_inits_and_terms @gol
512 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
513 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
514 -private_bundle  -read_only_relocs  -sectalign @gol
515 -sectobjectsymbols  -whyload  -seg1addr @gol
516 -sectcreate  -sectobjectsymbols  -sectorder @gol
517 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
518 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
519 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
520 -single_module  -static  -sub_library  -sub_umbrella @gol
521 -twolevel_namespace  -umbrella  -undefined @gol
522 -unexported_symbols_list  -weak_reference_mismatches @gol
523 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
524 -mkernel -mone-byte-bool}
526 @emph{DEC Alpha Options}
527 @gccoptlist{-mno-fp-regs  -msoft-float  -malpha-as  -mgas @gol
528 -mieee  -mieee-with-inexact  -mieee-conformant @gol
529 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
530 -mtrap-precision=@var{mode}  -mbuild-constants @gol
531 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
532 -mbwx  -mmax  -mfix  -mcix @gol
533 -mfloat-vax  -mfloat-ieee @gol
534 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
535 -msmall-text  -mlarge-text @gol
536 -mmemory-latency=@var{time}}
538 @emph{DEC Alpha/VMS Options}
539 @gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64}
541 @emph{FR30 Options}
542 @gccoptlist{-msmall-model -mno-lsim}
544 @emph{FRV Options}
545 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
546 -mhard-float  -msoft-float @gol
547 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
548 -mdouble  -mno-double @gol
549 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
550 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
551 -mlinked-fp  -mlong-calls  -malign-labels @gol
552 -mlibrary-pic  -macc-4  -macc-8 @gol
553 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
554 -moptimize-membar -mno-optimize-membar @gol
555 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
556 -mvliw-branch  -mno-vliw-branch @gol
557 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
558 -mno-nested-cond-exec  -mtomcat-stats @gol
559 -mTLS -mtls @gol
560 -mcpu=@var{cpu}}
562 @emph{GNU/Linux Options}
563 @gccoptlist{-mglibc -muclibc -mbionic -mandroid @gol
564 -tno-android-cc -tno-android-ld}
566 @emph{H8/300 Options}
567 @gccoptlist{-mrelax  -mh  -ms  -mn  -mint32  -malign-300}
569 @emph{HPPA Options}
570 @gccoptlist{-march=@var{architecture-type} @gol
571 -mbig-switch  -mdisable-fpregs  -mdisable-indexing @gol
572 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
573 -mfixed-range=@var{register-range} @gol
574 -mjump-in-delay -mlinker-opt -mlong-calls @gol
575 -mlong-load-store  -mno-big-switch  -mno-disable-fpregs @gol
576 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
577 -mno-jump-in-delay  -mno-long-load-store @gol
578 -mno-portable-runtime  -mno-soft-float @gol
579 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
580 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
581 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
582 -munix=@var{unix-std}  -nolibdld  -static  -threads}
584 @emph{i386 and x86-64 Options}
585 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
586 -mfpmath=@var{unit} @gol
587 -masm=@var{dialect}  -mno-fancy-math-387 @gol
588 -mno-fp-ret-in-387  -msoft-float @gol
589 -mno-wide-multiply  -mrtd  -malign-double @gol
590 -mpreferred-stack-boundary=@var{num}
591 -mincoming-stack-boundary=@var{num}
592 -mcld -mcx16 -msahf -mmovbe -mcrc32 -mrecip @gol
593 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx @gol
594 -maes -mpclmul -mfsgsbase -mrdrnd -mf16c -mfused-madd @gol
595 -msse4a -m3dnow -mpopcnt -mabm -mfma4 -mxop -mlwp @gol
596 -mthreads  -mno-align-stringops  -minline-all-stringops @gol
597 -minline-stringops-dynamically -mstringop-strategy=@var{alg} @gol
598 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
599 -m96bit-long-double  -mregparm=@var{num}  -msseregparm @gol
600 -mveclibabi=@var{type} -mpc32 -mpc64 -mpc80 -mstackrealign @gol
601 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
602 -mcmodel=@var{code-model} -mabi=@var{name} @gol
603 -m32  -m64 -mlarge-data-threshold=@var{num} @gol
604 -msse2avx}
606 @emph{IA-64 Options}
607 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
608 -mvolatile-asm-stop  -mregister-names  -msdata -mno-sdata @gol
609 -mconstant-gp  -mauto-pic  -mfused-madd @gol
610 -minline-float-divide-min-latency @gol
611 -minline-float-divide-max-throughput @gol
612 -mno-inline-float-divide @gol
613 -minline-int-divide-min-latency @gol
614 -minline-int-divide-max-throughput  @gol
615 -mno-inline-int-divide @gol
616 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
617 -mno-inline-sqrt @gol
618 -mdwarf2-asm -mearly-stop-bits @gol
619 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
620 -mtune=@var{cpu-type} -milp32 -mlp64 @gol
621 -msched-br-data-spec -msched-ar-data-spec -msched-control-spec @gol
622 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
623 -msched-spec-ldc -msched-spec-control-ldc @gol
624 -msched-prefer-non-data-spec-insns -msched-prefer-non-control-spec-insns @gol
625 -msched-stop-bits-after-every-cycle -msched-count-spec-in-critical-path @gol
626 -msel-sched-dont-check-control-spec -msched-fp-mem-deps-zero-cost @gol
627 -msched-max-memory-insns-hard-limit -msched-max-memory-insns=@var{max-insns}}
629 @emph{IA-64/VMS Options}
630 @gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64}
632 @emph{LM32 Options}
633 @gccoptlist{-mbarrel-shift-enabled -mdivide-enabled -mmultiply-enabled @gol
634 -msign-extend-enabled -muser-enabled}
636 @emph{M32R/D Options}
637 @gccoptlist{-m32r2 -m32rx -m32r @gol
638 -mdebug @gol
639 -malign-loops -mno-align-loops @gol
640 -missue-rate=@var{number} @gol
641 -mbranch-cost=@var{number} @gol
642 -mmodel=@var{code-size-model-type} @gol
643 -msdata=@var{sdata-type} @gol
644 -mno-flush-func -mflush-func=@var{name} @gol
645 -mno-flush-trap -mflush-trap=@var{number} @gol
646 -G @var{num}}
648 @emph{M32C Options}
649 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
651 @emph{M680x0 Options}
652 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune}
653 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
654 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
655 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
656 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
657 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
658 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
659 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
660 -mxgot -mno-xgot}
662 @emph{M68hc1x Options}
663 @gccoptlist{-m6811  -m6812  -m68hc11  -m68hc12   -m68hcs12 @gol
664 -mauto-incdec  -minmax  -mlong-calls  -mshort @gol
665 -msoft-reg-count=@var{count}}
667 @emph{MCore Options}
668 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
669 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
670 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
671 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
672 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
674 @emph{MeP Options}
675 @gccoptlist{-mabsdiff -mall-opts -maverage -mbased=@var{n} -mbitops @gol
676 -mc=@var{n} -mclip -mconfig=@var{name} -mcop -mcop32 -mcop64 -mivc2 @gol
677 -mdc -mdiv -meb -mel -mio-volatile -ml -mleadz -mm -mminmax @gol
678 -mmult -mno-opts -mrepeat -ms -msatur -msdram -msim -msimnovec -mtf @gol
679 -mtiny=@var{n}}
681 @emph{MIPS Options}
682 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
683 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2 @gol
684 -mips64  -mips64r2 @gol
685 -mips16  -mno-mips16  -mflip-mips16 @gol
686 -minterlink-mips16  -mno-interlink-mips16 @gol
687 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
688 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
689 -mgp32  -mgp64  -mfp32  -mfp64  -mhard-float  -msoft-float @gol
690 -msingle-float  -mdouble-float  -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
691 -mfpu=@var{fpu-type} @gol
692 -msmartmips  -mno-smartmips @gol
693 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
694 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
695 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
696 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
697 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
698 -membedded-data  -mno-embedded-data @gol
699 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
700 -mcode-readable=@var{setting} @gol
701 -msplit-addresses  -mno-split-addresses @gol
702 -mexplicit-relocs  -mno-explicit-relocs @gol
703 -mcheck-zero-division  -mno-check-zero-division @gol
704 -mdivide-traps  -mdivide-breaks @gol
705 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
706 -mmad  -mno-mad  -mfused-madd  -mno-fused-madd  -nocpp @gol
707 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
708 -mfix-r10000 -mno-fix-r10000  -mfix-vr4120  -mno-fix-vr4120 @gol
709 -mfix-vr4130  -mno-fix-vr4130  -mfix-sb1  -mno-fix-sb1 @gol
710 -mflush-func=@var{func}  -mno-flush-func @gol
711 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
712 -mfp-exceptions -mno-fp-exceptions @gol
713 -mvr4130-align -mno-vr4130-align -msynci -mno-synci @gol
714 -mrelax-pic-calls -mno-relax-pic-calls -mmcount-ra-address}
716 @emph{MMIX Options}
717 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
718 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
719 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
720 -mno-base-addresses  -msingle-exit  -mno-single-exit}
722 @emph{MN10300 Options}
723 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
724 -mam33  -mno-am33 @gol
725 -mam33-2  -mno-am33-2 @gol
726 -mreturn-pointer-on-d0 @gol
727 -mno-crt0  -mrelax}
729 @emph{PDP-11 Options}
730 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
731 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
732 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
733 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
734 -mbranch-expensive  -mbranch-cheap @gol
735 -msplit  -mno-split  -munix-asm  -mdec-asm}
737 @emph{picoChip Options}
738 @gccoptlist{-mae=@var{ae_type} -mvliw-lookahead=@var{N}
739 -msymbol-as-address -mno-inefficient-warnings}
741 @emph{PowerPC Options}
742 See RS/6000 and PowerPC Options.
744 @emph{RS/6000 and PowerPC Options}
745 @gccoptlist{-mcpu=@var{cpu-type} @gol
746 -mtune=@var{cpu-type} @gol
747 -mcmodel=@var{code-model} @gol
748 -mpower  -mno-power  -mpower2  -mno-power2 @gol
749 -mpowerpc  -mpowerpc64  -mno-powerpc @gol
750 -maltivec  -mno-altivec @gol
751 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
752 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
753 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb -mpopcntd -mno-popcntd @gol
754 -mfprnd  -mno-fprnd @gol
755 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp @gol
756 -mnew-mnemonics  -mold-mnemonics @gol
757 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
758 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
759 -malign-power  -malign-natural @gol
760 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
761 -msingle-float -mdouble-float -msimple-fpu @gol
762 -mstring  -mno-string  -mupdate  -mno-update @gol
763 -mavoid-indexed-addresses  -mno-avoid-indexed-addresses @gol
764 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
765 -mstrict-align  -mno-strict-align  -mrelocatable @gol
766 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
767 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
768 -mdynamic-no-pic  -maltivec -mswdiv @gol
769 -mprioritize-restricted-insns=@var{priority} @gol
770 -msched-costly-dep=@var{dependence_type} @gol
771 -minsert-sched-nops=@var{scheme} @gol
772 -mcall-sysv  -mcall-netbsd @gol
773 -maix-struct-return  -msvr4-struct-return @gol
774 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
775 -misel -mno-isel @gol
776 -misel=yes  -misel=no @gol
777 -mspe -mno-spe @gol
778 -mspe=yes  -mspe=no @gol
779 -mpaired @gol
780 -mgen-cell-microcode -mwarn-cell-microcode @gol
781 -mvrsave -mno-vrsave @gol
782 -mmulhw -mno-mulhw @gol
783 -mdlmzb -mno-dlmzb @gol
784 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
785 -mprototype  -mno-prototype @gol
786 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
787 -msdata=@var{opt}  -mvxworks  -G @var{num}  -pthread @gol
788 -mrecip -mrecip=@var{opt} -mno-recip -mrecip-precision -mno-recip-precision}
790 @emph{RX Options}
791 @gccoptlist{-m64bit-doubles  -m32bit-doubles  -fpu  -nofpu@gol
792 -mcpu= -patch=@gol
793 -mbig-endian-data -mlittle-endian-data @gol
794 -msmall-data @gol
795 -msim  -mno-sim@gol
796 -mas100-syntax -mno-as100-syntax@gol
797 -mrelax@gol
798 -mmax-constant-size=@gol
799 -mint-register=@gol
800 -msave-acc-in-interrupts}
802 @emph{S/390 and zSeries Options}
803 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
804 -mhard-float  -msoft-float  -mhard-dfp -mno-hard-dfp @gol
805 -mlong-double-64 -mlong-double-128 @gol
806 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
807 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
808 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
809 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
810 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard}
812 @emph{Score Options}
813 @gccoptlist{-meb -mel @gol
814 -mnhwloop @gol
815 -muls @gol
816 -mmac @gol
817 -mscore5 -mscore5u -mscore7 -mscore7d}
819 @emph{SH Options}
820 @gccoptlist{-m1  -m2  -m2e @gol
821 -m2a-nofpu -m2a-single-only -m2a-single -m2a @gol
822 -m3  -m3e @gol
823 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
824 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
825 -m5-64media  -m5-64media-nofpu @gol
826 -m5-32media  -m5-32media-nofpu @gol
827 -m5-compact  -m5-compact-nofpu @gol
828 -mb  -ml  -mdalign  -mrelax @gol
829 -mbigtable -mfmovd -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
830 -mieee  -mbitops  -misize  -minline-ic_invalidate -mpadstruct  -mspace @gol
831 -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
832 -mdivsi3_libfunc=@var{name} -mfixed-range=@var{register-range} @gol
833 -madjust-unroll -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
834 -maccumulate-outgoing-args -minvalid-symbols}
836 @emph{SPARC Options}
837 @gccoptlist{-mcpu=@var{cpu-type} @gol
838 -mtune=@var{cpu-type} @gol
839 -mcmodel=@var{code-model} @gol
840 -m32  -m64  -mapp-regs  -mno-app-regs @gol
841 -mfaster-structs  -mno-faster-structs @gol
842 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
843 -mhard-quad-float  -msoft-quad-float @gol
844 -mimpure-text  -mno-impure-text  -mlittle-endian @gol
845 -mstack-bias  -mno-stack-bias @gol
846 -munaligned-doubles  -mno-unaligned-doubles @gol
847 -mv8plus  -mno-v8plus  -mvis  -mno-vis
848 -threads -pthreads -pthread}
850 @emph{SPU Options}
851 @gccoptlist{-mwarn-reloc -merror-reloc @gol
852 -msafe-dma -munsafe-dma @gol
853 -mbranch-hints @gol
854 -msmall-mem -mlarge-mem -mstdmain @gol
855 -mfixed-range=@var{register-range} @gol
856 -mea32 -mea64 @gol
857 -maddress-space-conversion -mno-address-space-conversion @gol
858 -mcache-size=@var{cache-size} @gol
859 -matomic-updates -mno-atomic-updates}
861 @emph{System V Options}
862 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
864 @emph{V850 Options}
865 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
866 -mprolog-function  -mno-prolog-function  -mspace @gol
867 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
868 -mapp-regs  -mno-app-regs @gol
869 -mdisable-callt  -mno-disable-callt @gol
870 -mv850e1 @gol
871 -mv850e @gol
872 -mv850  -mbig-switch}
874 @emph{VAX Options}
875 @gccoptlist{-mg  -mgnu  -munix}
877 @emph{VxWorks Options}
878 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
879 -Xbind-lazy  -Xbind-now}
881 @emph{x86-64 Options}
882 See i386 and x86-64 Options.
884 @emph{i386 and x86-64 Windows Options}
885 @gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll
886 -mnop-fun-dllimport -mthread -municode -mwin32 -mwindows
887 -fno-set-stack-executable}
889 @emph{Xstormy16 Options}
890 @gccoptlist{-msim}
892 @emph{Xtensa Options}
893 @gccoptlist{-mconst16 -mno-const16 @gol
894 -mfused-madd  -mno-fused-madd @gol
895 -mforce-no-pic @gol
896 -mserialize-volatile  -mno-serialize-volatile @gol
897 -mtext-section-literals  -mno-text-section-literals @gol
898 -mtarget-align  -mno-target-align @gol
899 -mlongcalls  -mno-longcalls}
901 @emph{zSeries Options}
902 See S/390 and zSeries Options.
904 @item Code Generation Options
905 @xref{Code Gen Options,,Options for Code Generation Conventions}.
906 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
907 -ffixed-@var{reg}  -fexceptions @gol
908 -fnon-call-exceptions  -funwind-tables @gol
909 -fasynchronous-unwind-tables @gol
910 -finhibit-size-directive  -finstrument-functions @gol
911 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
912 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol
913 -fno-common  -fno-ident @gol
914 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
915 -fno-jump-tables @gol
916 -frecord-gcc-switches @gol
917 -freg-struct-return  -fshort-enums @gol
918 -fshort-double  -fshort-wchar @gol
919 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
920 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
921 -fno-stack-limit @gol
922 -fleading-underscore  -ftls-model=@var{model} @gol
923 -ftrapv  -fwrapv  -fbounds-check @gol
924 -fvisibility}
925 @end table
927 @menu
928 * Overall Options::     Controlling the kind of output:
929                         an executable, object files, assembler files,
930                         or preprocessed source.
931 * C Dialect Options::   Controlling the variant of C language compiled.
932 * C++ Dialect Options:: Variations on C++.
933 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
934                         and Objective-C++.
935 * Language Independent Options:: Controlling how diagnostics should be
936                         formatted.
937 * Warning Options::     How picky should the compiler be?
938 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
939 * Optimize Options::    How much optimization?
940 * Preprocessor Options:: Controlling header files and macro definitions.
941                          Also, getting dependency information for Make.
942 * Assembler Options::   Passing options to the assembler.
943 * Link Options::        Specifying libraries and so on.
944 * Directory Options::   Where to find header files and libraries.
945                         Where to find the compiler executable files.
946 * Spec Files::          How to pass switches to sub-processes.
947 * Target Options::      Running a cross-compiler, or an old version of GCC.
948 @end menu
950 @node Overall Options
951 @section Options Controlling the Kind of Output
953 Compilation can involve up to four stages: preprocessing, compilation
954 proper, assembly and linking, always in that order.  GCC is capable of
955 preprocessing and compiling several files either into several
956 assembler input files, or into one assembler input file; then each
957 assembler input file produces an object file, and linking combines all
958 the object files (those newly compiled, and those specified as input)
959 into an executable file.
961 @cindex file name suffix
962 For any given input file, the file name suffix determines what kind of
963 compilation is done:
965 @table @gcctabopt
966 @item @var{file}.c
967 C source code which must be preprocessed.
969 @item @var{file}.i
970 C source code which should not be preprocessed.
972 @item @var{file}.ii
973 C++ source code which should not be preprocessed.
975 @item @var{file}.m
976 Objective-C source code.  Note that you must link with the @file{libobjc}
977 library to make an Objective-C program work.
979 @item @var{file}.mi
980 Objective-C source code which should not be preprocessed.
982 @item @var{file}.mm
983 @itemx @var{file}.M
984 Objective-C++ source code.  Note that you must link with the @file{libobjc}
985 library to make an Objective-C++ program work.  Note that @samp{.M} refers
986 to a literal capital M@.
988 @item @var{file}.mii
989 Objective-C++ source code which should not be preprocessed.
991 @item @var{file}.h
992 C, C++, Objective-C or Objective-C++ header file to be turned into a
993 precompiled header (default), or C, C++ header file to be turned into an
994 Ada spec (via the @option{-fdump-ada-spec} switch).
996 @item @var{file}.cc
997 @itemx @var{file}.cp
998 @itemx @var{file}.cxx
999 @itemx @var{file}.cpp
1000 @itemx @var{file}.CPP
1001 @itemx @var{file}.c++
1002 @itemx @var{file}.C
1003 C++ source code which must be preprocessed.  Note that in @samp{.cxx},
1004 the last two letters must both be literally @samp{x}.  Likewise,
1005 @samp{.C} refers to a literal capital C@.
1007 @item @var{file}.mm
1008 @itemx @var{file}.M
1009 Objective-C++ source code which must be preprocessed.
1011 @item @var{file}.mii
1012 Objective-C++ source code which should not be preprocessed.
1014 @item @var{file}.hh
1015 @itemx @var{file}.H
1016 @itemx @var{file}.hp
1017 @itemx @var{file}.hxx
1018 @itemx @var{file}.hpp
1019 @itemx @var{file}.HPP
1020 @itemx @var{file}.h++
1021 @itemx @var{file}.tcc
1022 C++ header file to be turned into a precompiled header or Ada spec.
1024 @item @var{file}.f
1025 @itemx @var{file}.for
1026 @itemx @var{file}.ftn
1027 Fixed form Fortran source code which should not be preprocessed.
1029 @item @var{file}.F
1030 @itemx @var{file}.FOR
1031 @itemx @var{file}.fpp
1032 @itemx @var{file}.FPP
1033 @itemx @var{file}.FTN
1034 Fixed form Fortran source code which must be preprocessed (with the traditional
1035 preprocessor).
1037 @item @var{file}.f90
1038 @itemx @var{file}.f95
1039 @itemx @var{file}.f03
1040 @itemx @var{file}.f08
1041 Free form Fortran source code which should not be preprocessed.
1043 @item @var{file}.F90
1044 @itemx @var{file}.F95
1045 @itemx @var{file}.F03
1046 @itemx @var{file}.F08
1047 Free form Fortran source code which must be preprocessed (with the
1048 traditional preprocessor).
1050 @c FIXME: Descriptions of Java file types.
1051 @c @var{file}.java
1052 @c @var{file}.class
1053 @c @var{file}.zip
1054 @c @var{file}.jar
1056 @item @var{file}.ads
1057 Ada source code file which contains a library unit declaration (a
1058 declaration of a package, subprogram, or generic, or a generic
1059 instantiation), or a library unit renaming declaration (a package,
1060 generic, or subprogram renaming declaration).  Such files are also
1061 called @dfn{specs}.
1063 @item @var{file}.adb
1064 Ada source code file containing a library unit body (a subprogram or
1065 package body).  Such files are also called @dfn{bodies}.
1067 @c GCC also knows about some suffixes for languages not yet included:
1068 @c Pascal:
1069 @c @var{file}.p
1070 @c @var{file}.pas
1071 @c Ratfor:
1072 @c @var{file}.r
1074 @item @var{file}.s
1075 Assembler code.
1077 @item @var{file}.S
1078 @itemx @var{file}.sx
1079 Assembler code which must be preprocessed.
1081 @item @var{other}
1082 An object file to be fed straight into linking.
1083 Any file name with no recognized suffix is treated this way.
1084 @end table
1086 @opindex x
1087 You can specify the input language explicitly with the @option{-x} option:
1089 @table @gcctabopt
1090 @item -x @var{language}
1091 Specify explicitly the @var{language} for the following input files
1092 (rather than letting the compiler choose a default based on the file
1093 name suffix).  This option applies to all following input files until
1094 the next @option{-x} option.  Possible values for @var{language} are:
1095 @smallexample
1096 c  c-header  c-cpp-output
1097 c++  c++-header  c++-cpp-output
1098 objective-c  objective-c-header  objective-c-cpp-output
1099 objective-c++ objective-c++-header objective-c++-cpp-output
1100 assembler  assembler-with-cpp
1102 f77  f77-cpp-input f95  f95-cpp-input
1103 java
1104 @end smallexample
1106 @item -x none
1107 Turn off any specification of a language, so that subsequent files are
1108 handled according to their file name suffixes (as they are if @option{-x}
1109 has not been used at all).
1111 @item -pass-exit-codes
1112 @opindex pass-exit-codes
1113 Normally the @command{gcc} program will exit with the code of 1 if any
1114 phase of the compiler returns a non-success return code.  If you specify
1115 @option{-pass-exit-codes}, the @command{gcc} program will instead return with
1116 numerically highest error produced by any phase that returned an error
1117 indication.  The C, C++, and Fortran frontends return 4, if an internal
1118 compiler error is encountered.
1119 @end table
1121 If you only want some of the stages of compilation, you can use
1122 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1123 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1124 @command{gcc} is to stop.  Note that some combinations (for example,
1125 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1127 @table @gcctabopt
1128 @item -c
1129 @opindex c
1130 Compile or assemble the source files, but do not link.  The linking
1131 stage simply is not done.  The ultimate output is in the form of an
1132 object file for each source file.
1134 By default, the object file name for a source file is made by replacing
1135 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1137 Unrecognized input files, not requiring compilation or assembly, are
1138 ignored.
1140 @item -S
1141 @opindex S
1142 Stop after the stage of compilation proper; do not assemble.  The output
1143 is in the form of an assembler code file for each non-assembler input
1144 file specified.
1146 By default, the assembler file name for a source file is made by
1147 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1149 Input files that don't require compilation are ignored.
1151 @item -E
1152 @opindex E
1153 Stop after the preprocessing stage; do not run the compiler proper.  The
1154 output is in the form of preprocessed source code, which is sent to the
1155 standard output.
1157 Input files which don't require preprocessing are ignored.
1159 @cindex output file option
1160 @item -o @var{file}
1161 @opindex o
1162 Place output in file @var{file}.  This applies regardless to whatever
1163 sort of output is being produced, whether it be an executable file,
1164 an object file, an assembler file or preprocessed C code.
1166 If @option{-o} is not specified, the default is to put an executable
1167 file in @file{a.out}, the object file for
1168 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1169 assembler file in @file{@var{source}.s}, a precompiled header file in
1170 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1171 standard output.
1173 @item -v
1174 @opindex v
1175 Print (on standard error output) the commands executed to run the stages
1176 of compilation.  Also print the version number of the compiler driver
1177 program and of the preprocessor and the compiler proper.
1179 @item -###
1180 @opindex ###
1181 Like @option{-v} except the commands are not executed and arguments
1182 are quoted unless they contain only alphanumeric characters or @code{./-_}.
1183 This is useful for shell scripts to capture the driver-generated command lines.
1185 @item -pipe
1186 @opindex pipe
1187 Use pipes rather than temporary files for communication between the
1188 various stages of compilation.  This fails to work on some systems where
1189 the assembler is unable to read from a pipe; but the GNU assembler has
1190 no trouble.
1192 @item -combine
1193 @opindex combine
1194 If you are compiling multiple source files, this option tells the driver
1195 to pass all the source files to the compiler at once (for those
1196 languages for which the compiler can handle this).  This will allow
1197 intermodule analysis (IMA) to be performed by the compiler.  Currently the only
1198 language for which this is supported is C@.  If you pass source files for
1199 multiple languages to the driver, using this option, the driver will invoke
1200 the compiler(s) that support IMA once each, passing each compiler all the
1201 source files appropriate for it.  For those languages that do not support
1202 IMA this option will be ignored, and the compiler will be invoked once for
1203 each source file in that language.  If you use this option in conjunction
1204 with @option{-save-temps}, the compiler will generate multiple
1205 pre-processed files
1206 (one for each source file), but only one (combined) @file{.o} or
1207 @file{.s} file.
1209 @item --help
1210 @opindex help
1211 Print (on the standard output) a description of the command line options
1212 understood by @command{gcc}.  If the @option{-v} option is also specified
1213 then @option{--help} will also be passed on to the various processes
1214 invoked by @command{gcc}, so that they can display the command line options
1215 they accept.  If the @option{-Wextra} option has also been specified
1216 (prior to the @option{--help} option), then command line options which
1217 have no documentation associated with them will also be displayed.
1219 @item --target-help
1220 @opindex target-help
1221 Print (on the standard output) a description of target-specific command
1222 line options for each tool.  For some targets extra target-specific
1223 information may also be printed.
1225 @item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]}
1226 Print (on the standard output) a description of the command line
1227 options understood by the compiler that fit into all specified classes
1228 and qualifiers.  These are the supported classes:
1230 @table @asis
1231 @item @samp{optimizers}
1232 This will display all of the optimization options supported by the
1233 compiler.
1235 @item @samp{warnings}
1236 This will display all of the options controlling warning messages
1237 produced by the compiler.
1239 @item @samp{target}
1240 This will display target-specific options.  Unlike the
1241 @option{--target-help} option however, target-specific options of the
1242 linker and assembler will not be displayed.  This is because those
1243 tools do not currently support the extended @option{--help=} syntax.
1245 @item @samp{params}
1246 This will display the values recognized by the @option{--param}
1247 option.
1249 @item @var{language}
1250 This will display the options supported for @var{language}, where
1251 @var{language} is the name of one of the languages supported in this
1252 version of GCC.
1254 @item @samp{common}
1255 This will display the options that are common to all languages.
1256 @end table
1258 These are the supported qualifiers:
1260 @table @asis
1261 @item @samp{undocumented}
1262 Display only those options which are undocumented.
1264 @item @samp{joined}
1265 Display options which take an argument that appears after an equal
1266 sign in the same continuous piece of text, such as:
1267 @samp{--help=target}.
1269 @item @samp{separate}
1270 Display options which take an argument that appears as a separate word
1271 following the original option, such as: @samp{-o output-file}.
1272 @end table
1274 Thus for example to display all the undocumented target-specific
1275 switches supported by the compiler the following can be used:
1277 @smallexample
1278 --help=target,undocumented
1279 @end smallexample
1281 The sense of a qualifier can be inverted by prefixing it with the
1282 @samp{^} character, so for example to display all binary warning
1283 options (i.e., ones that are either on or off and that do not take an
1284 argument), which have a description the following can be used:
1286 @smallexample
1287 --help=warnings,^joined,^undocumented
1288 @end smallexample
1290 The argument to @option{--help=} should not consist solely of inverted
1291 qualifiers.
1293 Combining several classes is possible, although this usually
1294 restricts the output by so much that there is nothing to display.  One
1295 case where it does work however is when one of the classes is
1296 @var{target}.  So for example to display all the target-specific
1297 optimization options the following can be used:
1299 @smallexample
1300 --help=target,optimizers
1301 @end smallexample
1303 The @option{--help=} option can be repeated on the command line.  Each
1304 successive use will display its requested class of options, skipping
1305 those that have already been displayed.
1307 If the @option{-Q} option appears on the command line before the
1308 @option{--help=} option, then the descriptive text displayed by
1309 @option{--help=} is changed.  Instead of describing the displayed
1310 options, an indication is given as to whether the option is enabled,
1311 disabled or set to a specific value (assuming that the compiler
1312 knows this at the point where the @option{--help=} option is used).
1314 Here is a truncated example from the ARM port of @command{gcc}:
1316 @smallexample
1317   % gcc -Q -mabi=2 --help=target -c
1318   The following options are target specific:
1319   -mabi=                                2
1320   -mabort-on-noreturn                   [disabled]
1321   -mapcs                                [disabled]
1322 @end smallexample
1324 The output is sensitive to the effects of previous command line
1325 options, so for example it is possible to find out which optimizations
1326 are enabled at @option{-O2} by using:
1328 @smallexample
1329 -Q -O2 --help=optimizers
1330 @end smallexample
1332 Alternatively you can discover which binary optimizations are enabled
1333 by @option{-O3} by using:
1335 @smallexample
1336 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1337 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1338 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1339 @end smallexample
1341 @item -no-canonical-prefixes
1342 @opindex no-canonical-prefixes
1343 Do not expand any symbolic links, resolve references to @samp{/../}
1344 or @samp{/./}, or make the path absolute when generating a relative
1345 prefix.
1347 @item --version
1348 @opindex version
1349 Display the version number and copyrights of the invoked GCC@.
1351 @item -wrapper
1352 @opindex wrapper
1353 Invoke all subcommands under a wrapper program. It takes a single
1354 comma separated list as an argument, which will be used to invoke
1355 the wrapper:
1357 @smallexample
1358 gcc -c t.c -wrapper gdb,--args
1359 @end smallexample
1361 This will invoke all subprograms of gcc under "gdb --args",
1362 thus cc1 invocation will be "gdb --args cc1 ...".
1364 @item -fplugin=@var{name}.so
1365 Load the plugin code in file @var{name}.so, assumed to be a
1366 shared object to be dlopen'd by the compiler.  The base name of
1367 the shared object file is used to identify the plugin for the
1368 purposes of argument parsing (See
1369 @option{-fplugin-arg-@var{name}-@var{key}=@var{value}} below).
1370 Each plugin should define the callback functions specified in the
1371 Plugins API.
1373 @item -fplugin-arg-@var{name}-@var{key}=@var{value}
1374 Define an argument called @var{key} with a value of @var{value}
1375 for the plugin called @var{name}.
1377 @item -fdump-ada-spec@r{[}-slim@r{]}
1378 For C and C++ source and include files, generate corresponding Ada
1379 specs. @xref{Generating Ada Bindings for C and C++ headers,,, gnat_ugn,
1380 GNAT User's Guide}, which provides detailed documentation on this feature.
1382 @include @value{srcdir}/../libiberty/at-file.texi
1383 @end table
1385 @node Invoking G++
1386 @section Compiling C++ Programs
1388 @cindex suffixes for C++ source
1389 @cindex C++ source file suffixes
1390 C++ source files conventionally use one of the suffixes @samp{.C},
1391 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1392 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1393 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1394 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1395 files with these names and compiles them as C++ programs even if you
1396 call the compiler the same way as for compiling C programs (usually
1397 with the name @command{gcc}).
1399 @findex g++
1400 @findex c++
1401 However, the use of @command{gcc} does not add the C++ library.
1402 @command{g++} is a program that calls GCC and treats @samp{.c},
1403 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1404 files unless @option{-x} is used, and automatically specifies linking
1405 against the C++ library.  This program is also useful when
1406 precompiling a C header file with a @samp{.h} extension for use in C++
1407 compilations.  On many systems, @command{g++} is also installed with
1408 the name @command{c++}.
1410 @cindex invoking @command{g++}
1411 When you compile C++ programs, you may specify many of the same
1412 command-line options that you use for compiling programs in any
1413 language; or command-line options meaningful for C and related
1414 languages; or options that are meaningful only for C++ programs.
1415 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1416 explanations of options for languages related to C@.
1417 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1418 explanations of options that are meaningful only for C++ programs.
1420 @node C Dialect Options
1421 @section Options Controlling C Dialect
1422 @cindex dialect options
1423 @cindex language dialect options
1424 @cindex options, dialect
1426 The following options control the dialect of C (or languages derived
1427 from C, such as C++, Objective-C and Objective-C++) that the compiler
1428 accepts:
1430 @table @gcctabopt
1431 @cindex ANSI support
1432 @cindex ISO support
1433 @item -ansi
1434 @opindex ansi
1435 In C mode, this is equivalent to @samp{-std=c90}. In C++ mode, it is
1436 equivalent to @samp{-std=c++98}.
1438 This turns off certain features of GCC that are incompatible with ISO
1439 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1440 such as the @code{asm} and @code{typeof} keywords, and
1441 predefined macros such as @code{unix} and @code{vax} that identify the
1442 type of system you are using.  It also enables the undesirable and
1443 rarely used ISO trigraph feature.  For the C compiler,
1444 it disables recognition of C++ style @samp{//} comments as well as
1445 the @code{inline} keyword.
1447 The alternate keywords @code{__asm__}, @code{__extension__},
1448 @code{__inline__} and @code{__typeof__} continue to work despite
1449 @option{-ansi}.  You would not want to use them in an ISO C program, of
1450 course, but it is useful to put them in header files that might be included
1451 in compilations done with @option{-ansi}.  Alternate predefined macros
1452 such as @code{__unix__} and @code{__vax__} are also available, with or
1453 without @option{-ansi}.
1455 The @option{-ansi} option does not cause non-ISO programs to be
1456 rejected gratuitously.  For that, @option{-pedantic} is required in
1457 addition to @option{-ansi}.  @xref{Warning Options}.
1459 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1460 option is used.  Some header files may notice this macro and refrain
1461 from declaring certain functions or defining certain macros that the
1462 ISO standard doesn't call for; this is to avoid interfering with any
1463 programs that might use these names for other things.
1465 Functions that would normally be built in but do not have semantics
1466 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1467 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
1468 built-in functions provided by GCC}, for details of the functions
1469 affected.
1471 @item -std=
1472 @opindex std
1473 Determine the language standard. @xref{Standards,,Language Standards
1474 Supported by GCC}, for details of these standard versions.  This option
1475 is currently only supported when compiling C or C++.
1477 The compiler can accept several base standards, such as @samp{c90} or
1478 @samp{c++98}, and GNU dialects of those standards, such as
1479 @samp{gnu90} or @samp{gnu++98}.  By specifying a base standard, the
1480 compiler will accept all programs following that standard and those
1481 using GNU extensions that do not contradict it.  For example,
1482 @samp{-std=c90} turns off certain features of GCC that are
1483 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
1484 keywords, but not other GNU extensions that do not have a meaning in
1485 ISO C90, such as omitting the middle term of a @code{?:}
1486 expression. On the other hand, by specifying a GNU dialect of a
1487 standard, all features the compiler support are enabled, even when
1488 those features change the meaning of the base standard and some
1489 strict-conforming programs may be rejected.  The particular standard
1490 is used by @option{-pedantic} to identify which features are GNU
1491 extensions given that version of the standard. For example
1492 @samp{-std=gnu90 -pedantic} would warn about C++ style @samp{//}
1493 comments, while @samp{-std=gnu99 -pedantic} would not.
1495 A value for this option must be provided; possible values are
1497 @table @samp
1498 @item c90
1499 @itemx c89
1500 @itemx iso9899:1990
1501 Support all ISO C90 programs (certain GNU extensions that conflict
1502 with ISO C90 are disabled). Same as @option{-ansi} for C code.
1504 @item iso9899:199409
1505 ISO C90 as modified in amendment 1.
1507 @item c99
1508 @itemx c9x
1509 @itemx iso9899:1999
1510 @itemx iso9899:199x
1511 ISO C99.  Note that this standard is not yet fully supported; see
1512 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1513 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1515 @item c1x
1516 ISO C1X, the draft of the next revision of the ISO C standard.
1517 Support is limited and experimental and features enabled by this
1518 option may be changed or removed if changed in or removed from the
1519 standard draft.
1521 @item gnu90
1522 @itemx gnu89
1523 GNU dialect of ISO C90 (including some C99 features). This
1524 is the default for C code.
1526 @item gnu99
1527 @itemx gnu9x
1528 GNU dialect of ISO C99.  When ISO C99 is fully implemented in GCC,
1529 this will become the default.  The name @samp{gnu9x} is deprecated.
1531 @item gnu1x
1532 GNU dialect of ISO C1X.  Support is limited and experimental and
1533 features enabled by this option may be changed or removed if changed
1534 in or removed from the standard draft.
1536 @item c++98
1537 The 1998 ISO C++ standard plus amendments. Same as @option{-ansi} for
1538 C++ code.
1540 @item gnu++98
1541 GNU dialect of @option{-std=c++98}.  This is the default for
1542 C++ code.
1544 @item c++0x
1545 The working draft of the upcoming ISO C++0x standard. This option
1546 enables experimental features that are likely to be included in
1547 C++0x. The working draft is constantly changing, and any feature that is
1548 enabled by this flag may be removed from future versions of GCC if it is
1549 not part of the C++0x standard.
1551 @item gnu++0x
1552 GNU dialect of @option{-std=c++0x}. This option enables
1553 experimental features that may be removed in future versions of GCC.
1554 @end table
1556 @item -fgnu89-inline
1557 @opindex fgnu89-inline
1558 The option @option{-fgnu89-inline} tells GCC to use the traditional
1559 GNU semantics for @code{inline} functions when in C99 mode.
1560 @xref{Inline,,An Inline Function is As Fast As a Macro}.  This option
1561 is accepted and ignored by GCC versions 4.1.3 up to but not including
1562 4.3.  In GCC versions 4.3 and later it changes the behavior of GCC in
1563 C99 mode.  Using this option is roughly equivalent to adding the
1564 @code{gnu_inline} function attribute to all inline functions
1565 (@pxref{Function Attributes}).
1567 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1568 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1569 specifies the default behavior).  This option was first supported in
1570 GCC 4.3.  This option is not supported in @option{-std=c90} or
1571 @option{-std=gnu90} mode.
1573 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1574 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1575 in effect for @code{inline} functions.  @xref{Common Predefined
1576 Macros,,,cpp,The C Preprocessor}.
1578 @item -aux-info @var{filename}
1579 @opindex aux-info
1580 Output to the given filename prototyped declarations for all functions
1581 declared and/or defined in a translation unit, including those in header
1582 files.  This option is silently ignored in any language other than C@.
1584 Besides declarations, the file indicates, in comments, the origin of
1585 each declaration (source file and line), whether the declaration was
1586 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1587 @samp{O} for old, respectively, in the first character after the line
1588 number and the colon), and whether it came from a declaration or a
1589 definition (@samp{C} or @samp{F}, respectively, in the following
1590 character).  In the case of function definitions, a K&R-style list of
1591 arguments followed by their declarations is also provided, inside
1592 comments, after the declaration.
1594 @item -fno-asm
1595 @opindex fno-asm
1596 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1597 keyword, so that code can use these words as identifiers.  You can use
1598 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1599 instead.  @option{-ansi} implies @option{-fno-asm}.
1601 In C++, this switch only affects the @code{typeof} keyword, since
1602 @code{asm} and @code{inline} are standard keywords.  You may want to
1603 use the @option{-fno-gnu-keywords} flag instead, which has the same
1604 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1605 switch only affects the @code{asm} and @code{typeof} keywords, since
1606 @code{inline} is a standard keyword in ISO C99.
1608 @item -fno-builtin
1609 @itemx -fno-builtin-@var{function}
1610 @opindex fno-builtin
1611 @cindex built-in functions
1612 Don't recognize built-in functions that do not begin with
1613 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1614 functions provided by GCC}, for details of the functions affected,
1615 including those which are not built-in functions when @option{-ansi} or
1616 @option{-std} options for strict ISO C conformance are used because they
1617 do not have an ISO standard meaning.
1619 GCC normally generates special code to handle certain built-in functions
1620 more efficiently; for instance, calls to @code{alloca} may become single
1621 instructions that adjust the stack directly, and calls to @code{memcpy}
1622 may become inline copy loops.  The resulting code is often both smaller
1623 and faster, but since the function calls no longer appear as such, you
1624 cannot set a breakpoint on those calls, nor can you change the behavior
1625 of the functions by linking with a different library.  In addition,
1626 when a function is recognized as a built-in function, GCC may use
1627 information about that function to warn about problems with calls to
1628 that function, or to generate more efficient code, even if the
1629 resulting code still contains calls to that function.  For example,
1630 warnings are given with @option{-Wformat} for bad calls to
1631 @code{printf}, when @code{printf} is built in, and @code{strlen} is
1632 known not to modify global memory.
1634 With the @option{-fno-builtin-@var{function}} option
1635 only the built-in function @var{function} is
1636 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1637 function is named that is not built-in in this version of GCC, this
1638 option is ignored.  There is no corresponding
1639 @option{-fbuiltin-@var{function}} option; if you wish to enable
1640 built-in functions selectively when using @option{-fno-builtin} or
1641 @option{-ffreestanding}, you may define macros such as:
1643 @smallexample
1644 #define abs(n)          __builtin_abs ((n))
1645 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1646 @end smallexample
1648 @item -fhosted
1649 @opindex fhosted
1650 @cindex hosted environment
1652 Assert that compilation takes place in a hosted environment.  This implies
1653 @option{-fbuiltin}.  A hosted environment is one in which the
1654 entire standard library is available, and in which @code{main} has a return
1655 type of @code{int}.  Examples are nearly everything except a kernel.
1656 This is equivalent to @option{-fno-freestanding}.
1658 @item -ffreestanding
1659 @opindex ffreestanding
1660 @cindex hosted environment
1662 Assert that compilation takes place in a freestanding environment.  This
1663 implies @option{-fno-builtin}.  A freestanding environment
1664 is one in which the standard library may not exist, and program startup may
1665 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1666 This is equivalent to @option{-fno-hosted}.
1668 @xref{Standards,,Language Standards Supported by GCC}, for details of
1669 freestanding and hosted environments.
1671 @item -fopenmp
1672 @opindex fopenmp
1673 @cindex openmp parallel
1674 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1675 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1676 compiler generates parallel code according to the OpenMP Application
1677 Program Interface v3.0 @w{@uref{http://www.openmp.org/}}.  This option
1678 implies @option{-pthread}, and thus is only supported on targets that
1679 have support for @option{-pthread}.
1681 @item -fms-extensions
1682 @opindex fms-extensions
1683 Accept some non-standard constructs used in Microsoft header files.
1685 Some cases of unnamed fields in structures and unions are only
1686 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1687 fields within structs/unions}, for details.
1689 @item -trigraphs
1690 @opindex trigraphs
1691 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1692 options for strict ISO C conformance) implies @option{-trigraphs}.
1694 @item -no-integrated-cpp
1695 @opindex no-integrated-cpp
1696 Performs a compilation in two passes: preprocessing and compiling.  This
1697 option allows a user supplied "cc1", "cc1plus", or "cc1obj" via the
1698 @option{-B} option.  The user supplied compilation step can then add in
1699 an additional preprocessing step after normal preprocessing but before
1700 compiling.  The default is to use the integrated cpp (internal cpp)
1702 The semantics of this option will change if "cc1", "cc1plus", and
1703 "cc1obj" are merged.
1705 @cindex traditional C language
1706 @cindex C language, traditional
1707 @item -traditional
1708 @itemx -traditional-cpp
1709 @opindex traditional-cpp
1710 @opindex traditional
1711 Formerly, these options caused GCC to attempt to emulate a pre-standard
1712 C compiler.  They are now only supported with the @option{-E} switch.
1713 The preprocessor continues to support a pre-standard mode.  See the GNU
1714 CPP manual for details.
1716 @item -fcond-mismatch
1717 @opindex fcond-mismatch
1718 Allow conditional expressions with mismatched types in the second and
1719 third arguments.  The value of such an expression is void.  This option
1720 is not supported for C++.
1722 @item -flax-vector-conversions
1723 @opindex flax-vector-conversions
1724 Allow implicit conversions between vectors with differing numbers of
1725 elements and/or incompatible element types.  This option should not be
1726 used for new code.
1728 @item -funsigned-char
1729 @opindex funsigned-char
1730 Let the type @code{char} be unsigned, like @code{unsigned char}.
1732 Each kind of machine has a default for what @code{char} should
1733 be.  It is either like @code{unsigned char} by default or like
1734 @code{signed char} by default.
1736 Ideally, a portable program should always use @code{signed char} or
1737 @code{unsigned char} when it depends on the signedness of an object.
1738 But many programs have been written to use plain @code{char} and
1739 expect it to be signed, or expect it to be unsigned, depending on the
1740 machines they were written for.  This option, and its inverse, let you
1741 make such a program work with the opposite default.
1743 The type @code{char} is always a distinct type from each of
1744 @code{signed char} or @code{unsigned char}, even though its behavior
1745 is always just like one of those two.
1747 @item -fsigned-char
1748 @opindex fsigned-char
1749 Let the type @code{char} be signed, like @code{signed char}.
1751 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1752 the negative form of @option{-funsigned-char}.  Likewise, the option
1753 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1755 @item -fsigned-bitfields
1756 @itemx -funsigned-bitfields
1757 @itemx -fno-signed-bitfields
1758 @itemx -fno-unsigned-bitfields
1759 @opindex fsigned-bitfields
1760 @opindex funsigned-bitfields
1761 @opindex fno-signed-bitfields
1762 @opindex fno-unsigned-bitfields
1763 These options control whether a bit-field is signed or unsigned, when the
1764 declaration does not use either @code{signed} or @code{unsigned}.  By
1765 default, such a bit-field is signed, because this is consistent: the
1766 basic integer types such as @code{int} are signed types.
1767 @end table
1769 @node C++ Dialect Options
1770 @section Options Controlling C++ Dialect
1772 @cindex compiler options, C++
1773 @cindex C++ options, command line
1774 @cindex options, C++
1775 This section describes the command-line options that are only meaningful
1776 for C++ programs; but you can also use most of the GNU compiler options
1777 regardless of what language your program is in.  For example, you
1778 might compile a file @code{firstClass.C} like this:
1780 @smallexample
1781 g++ -g -frepo -O -c firstClass.C
1782 @end smallexample
1784 @noindent
1785 In this example, only @option{-frepo} is an option meant
1786 only for C++ programs; you can use the other options with any
1787 language supported by GCC@.
1789 Here is a list of options that are @emph{only} for compiling C++ programs:
1791 @table @gcctabopt
1793 @item -fabi-version=@var{n}
1794 @opindex fabi-version
1795 Use version @var{n} of the C++ ABI@.  Version 2 is the version of the
1796 C++ ABI that first appeared in G++ 3.4.  Version 1 is the version of
1797 the C++ ABI that first appeared in G++ 3.2.  Version 0 will always be
1798 the version that conforms most closely to the C++ ABI specification.
1799 Therefore, the ABI obtained using version 0 will change as ABI bugs
1800 are fixed.
1802 The default is version 2.
1804 Version 3 corrects an error in mangling a constant address as a
1805 template argument.
1807 Version 4 implements a standard mangling for vector types.
1809 See also @option{-Wabi}.
1811 @item -fno-access-control
1812 @opindex fno-access-control
1813 Turn off all access checking.  This switch is mainly useful for working
1814 around bugs in the access control code.
1816 @item -fcheck-new
1817 @opindex fcheck-new
1818 Check that the pointer returned by @code{operator new} is non-null
1819 before attempting to modify the storage allocated.  This check is
1820 normally unnecessary because the C++ standard specifies that
1821 @code{operator new} will only return @code{0} if it is declared
1822 @samp{throw()}, in which case the compiler will always check the
1823 return value even without this option.  In all other cases, when
1824 @code{operator new} has a non-empty exception specification, memory
1825 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
1826 @samp{new (nothrow)}.
1828 @item -fconserve-space
1829 @opindex fconserve-space
1830 Put uninitialized or runtime-initialized global variables into the
1831 common segment, as C does.  This saves space in the executable at the
1832 cost of not diagnosing duplicate definitions.  If you compile with this
1833 flag and your program mysteriously crashes after @code{main()} has
1834 completed, you may have an object that is being destroyed twice because
1835 two definitions were merged.
1837 This option is no longer useful on most targets, now that support has
1838 been added for putting variables into BSS without making them common.
1840 @item -fno-deduce-init-list
1841 @opindex fno-deduce-init-list
1842 Disable deduction of a template type parameter as
1843 std::initializer_list from a brace-enclosed initializer list, i.e.
1845 @smallexample
1846 template <class T> auto forward(T t) -> decltype (realfn (t))
1848   return realfn (t);
1851 void f()
1853   forward(@{1,2@}); // call forward<std::initializer_list<int>>
1855 @end smallexample
1857 This option is present because this deduction is an extension to the
1858 current specification in the C++0x working draft, and there was
1859 some concern about potential overload resolution problems.
1861 @item -ffriend-injection
1862 @opindex ffriend-injection
1863 Inject friend functions into the enclosing namespace, so that they are
1864 visible outside the scope of the class in which they are declared.
1865 Friend functions were documented to work this way in the old Annotated
1866 C++ Reference Manual, and versions of G++ before 4.1 always worked
1867 that way.  However, in ISO C++ a friend function which is not declared
1868 in an enclosing scope can only be found using argument dependent
1869 lookup.  This option causes friends to be injected as they were in
1870 earlier releases.
1872 This option is for compatibility, and may be removed in a future
1873 release of G++.
1875 @item -fno-elide-constructors
1876 @opindex fno-elide-constructors
1877 The C++ standard allows an implementation to omit creating a temporary
1878 which is only used to initialize another object of the same type.
1879 Specifying this option disables that optimization, and forces G++ to
1880 call the copy constructor in all cases.
1882 @item -fno-enforce-eh-specs
1883 @opindex fno-enforce-eh-specs
1884 Don't generate code to check for violation of exception specifications
1885 at runtime.  This option violates the C++ standard, but may be useful
1886 for reducing code size in production builds, much like defining
1887 @samp{NDEBUG}.  This does not give user code permission to throw
1888 exceptions in violation of the exception specifications; the compiler
1889 will still optimize based on the specifications, so throwing an
1890 unexpected exception will result in undefined behavior.
1892 @item -ffor-scope
1893 @itemx -fno-for-scope
1894 @opindex ffor-scope
1895 @opindex fno-for-scope
1896 If @option{-ffor-scope} is specified, the scope of variables declared in
1897 a @i{for-init-statement} is limited to the @samp{for} loop itself,
1898 as specified by the C++ standard.
1899 If @option{-fno-for-scope} is specified, the scope of variables declared in
1900 a @i{for-init-statement} extends to the end of the enclosing scope,
1901 as was the case in old versions of G++, and other (traditional)
1902 implementations of C++.
1904 The default if neither flag is given to follow the standard,
1905 but to allow and give a warning for old-style code that would
1906 otherwise be invalid, or have different behavior.
1908 @item -fno-gnu-keywords
1909 @opindex fno-gnu-keywords
1910 Do not recognize @code{typeof} as a keyword, so that code can use this
1911 word as an identifier.  You can use the keyword @code{__typeof__} instead.
1912 @option{-ansi} implies @option{-fno-gnu-keywords}.
1914 @item -fno-implicit-templates
1915 @opindex fno-implicit-templates
1916 Never emit code for non-inline templates which are instantiated
1917 implicitly (i.e.@: by use); only emit code for explicit instantiations.
1918 @xref{Template Instantiation}, for more information.
1920 @item -fno-implicit-inline-templates
1921 @opindex fno-implicit-inline-templates
1922 Don't emit code for implicit instantiations of inline templates, either.
1923 The default is to handle inlines differently so that compiles with and
1924 without optimization will need the same set of explicit instantiations.
1926 @item -fno-implement-inlines
1927 @opindex fno-implement-inlines
1928 To save space, do not emit out-of-line copies of inline functions
1929 controlled by @samp{#pragma implementation}.  This will cause linker
1930 errors if these functions are not inlined everywhere they are called.
1932 @item -fms-extensions
1933 @opindex fms-extensions
1934 Disable pedantic warnings about constructs used in MFC, such as implicit
1935 int and getting a pointer to member function via non-standard syntax.
1937 @item -fno-nonansi-builtins
1938 @opindex fno-nonansi-builtins
1939 Disable built-in declarations of functions that are not mandated by
1940 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
1941 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
1943 @item -fnothrow-opt
1944 @opindex fnothrow-opt
1945 Treat a @code{throw()} exception specification as though it were a
1946 @code{noexcept} specification to reduce or eliminate the text size
1947 overhead relative to a function with no exception specification.  If
1948 the function has local variables of types with non-trivial
1949 destructors, the exception specification will actually make the
1950 function smaller because the EH cleanups for those variables can be
1951 optimized away.  The semantic effect is that an exception thrown out of
1952 a function with such an exception specification will result in a call
1953 to @code{terminate} rather than @code{unexpected}.
1955 @item -fno-operator-names
1956 @opindex fno-operator-names
1957 Do not treat the operator name keywords @code{and}, @code{bitand},
1958 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
1959 synonyms as keywords.
1961 @item -fno-optional-diags
1962 @opindex fno-optional-diags
1963 Disable diagnostics that the standard says a compiler does not need to
1964 issue.  Currently, the only such diagnostic issued by G++ is the one for
1965 a name having multiple meanings within a class.
1967 @item -fpermissive
1968 @opindex fpermissive
1969 Downgrade some diagnostics about nonconformant code from errors to
1970 warnings.  Thus, using @option{-fpermissive} will allow some
1971 nonconforming code to compile.
1973 @item -fno-pretty-templates
1974 @opindex fno-pretty-templates
1975 When an error message refers to a specialization of a function
1976 template, the compiler will normally print the signature of the
1977 template followed by the template arguments and any typedefs or
1978 typenames in the signature (e.g. @code{void f(T) [with T = int]}
1979 rather than @code{void f(int)}) so that it's clear which template is
1980 involved.  When an error message refers to a specialization of a class
1981 template, the compiler will omit any template arguments which match
1982 the default template arguments for that template.  If either of these
1983 behaviors make it harder to understand the error message rather than
1984 easier, using @option{-fno-pretty-templates} will disable them.
1986 @item -frepo
1987 @opindex frepo
1988 Enable automatic template instantiation at link time.  This option also
1989 implies @option{-fno-implicit-templates}.  @xref{Template
1990 Instantiation}, for more information.
1992 @item -fno-rtti
1993 @opindex fno-rtti
1994 Disable generation of information about every class with virtual
1995 functions for use by the C++ runtime type identification features
1996 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
1997 of the language, you can save some space by using this flag.  Note that
1998 exception handling uses the same information, but it will generate it as
1999 needed. The @samp{dynamic_cast} operator can still be used for casts that
2000 do not require runtime type information, i.e.@: casts to @code{void *} or to
2001 unambiguous base classes.
2003 @item -fstats
2004 @opindex fstats
2005 Emit statistics about front-end processing at the end of the compilation.
2006 This information is generally only useful to the G++ development team.
2008 @item -fstrict-enums
2009 @opindex fstrict-enums
2010 Allow the compiler to optimize using the assumption that a value of
2011 enumeration type can only be one of the values of the enumeration (as
2012 defined in the C++ standard; basically, a value which can be
2013 represented in the minimum number of bits needed to represent all the
2014 enumerators).  This assumption may not be valid if the program uses a
2015 cast to convert an arbitrary integer value to the enumeration type.
2017 @item -ftemplate-depth=@var{n}
2018 @opindex ftemplate-depth
2019 Set the maximum instantiation depth for template classes to @var{n}.
2020 A limit on the template instantiation depth is needed to detect
2021 endless recursions during template class instantiation.  ANSI/ISO C++
2022 conforming programs must not rely on a maximum depth greater than 17
2023 (changed to 1024 in C++0x).
2025 @item -fno-threadsafe-statics
2026 @opindex fno-threadsafe-statics
2027 Do not emit the extra code to use the routines specified in the C++
2028 ABI for thread-safe initialization of local statics.  You can use this
2029 option to reduce code size slightly in code that doesn't need to be
2030 thread-safe.
2032 @item -fuse-cxa-atexit
2033 @opindex fuse-cxa-atexit
2034 Register destructors for objects with static storage duration with the
2035 @code{__cxa_atexit} function rather than the @code{atexit} function.
2036 This option is required for fully standards-compliant handling of static
2037 destructors, but will only work if your C library supports
2038 @code{__cxa_atexit}.
2040 @item -fno-use-cxa-get-exception-ptr
2041 @opindex fno-use-cxa-get-exception-ptr
2042 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
2043 will cause @code{std::uncaught_exception} to be incorrect, but is necessary
2044 if the runtime routine is not available.
2046 @item -fvisibility-inlines-hidden
2047 @opindex fvisibility-inlines-hidden
2048 This switch declares that the user does not attempt to compare
2049 pointers to inline methods where the addresses of the two functions
2050 were taken in different shared objects.
2052 The effect of this is that GCC may, effectively, mark inline methods with
2053 @code{__attribute__ ((visibility ("hidden")))} so that they do not
2054 appear in the export table of a DSO and do not require a PLT indirection
2055 when used within the DSO@.  Enabling this option can have a dramatic effect
2056 on load and link times of a DSO as it massively reduces the size of the
2057 dynamic export table when the library makes heavy use of templates.
2059 The behavior of this switch is not quite the same as marking the
2060 methods as hidden directly, because it does not affect static variables
2061 local to the function or cause the compiler to deduce that
2062 the function is defined in only one shared object.
2064 You may mark a method as having a visibility explicitly to negate the
2065 effect of the switch for that method.  For example, if you do want to
2066 compare pointers to a particular inline method, you might mark it as
2067 having default visibility.  Marking the enclosing class with explicit
2068 visibility will have no effect.
2070 Explicitly instantiated inline methods are unaffected by this option
2071 as their linkage might otherwise cross a shared library boundary.
2072 @xref{Template Instantiation}.
2074 @item -fvisibility-ms-compat
2075 @opindex fvisibility-ms-compat
2076 This flag attempts to use visibility settings to make GCC's C++
2077 linkage model compatible with that of Microsoft Visual Studio.
2079 The flag makes these changes to GCC's linkage model:
2081 @enumerate
2082 @item
2083 It sets the default visibility to @code{hidden}, like
2084 @option{-fvisibility=hidden}.
2086 @item
2087 Types, but not their members, are not hidden by default.
2089 @item
2090 The One Definition Rule is relaxed for types without explicit
2091 visibility specifications which are defined in more than one different
2092 shared object: those declarations are permitted if they would have
2093 been permitted when this option was not used.
2094 @end enumerate
2096 In new code it is better to use @option{-fvisibility=hidden} and
2097 export those classes which are intended to be externally visible.
2098 Unfortunately it is possible for code to rely, perhaps accidentally,
2099 on the Visual Studio behavior.
2101 Among the consequences of these changes are that static data members
2102 of the same type with the same name but defined in different shared
2103 objects will be different, so changing one will not change the other;
2104 and that pointers to function members defined in different shared
2105 objects may not compare equal.  When this flag is given, it is a
2106 violation of the ODR to define types with the same name differently.
2108 @item -fno-weak
2109 @opindex fno-weak
2110 Do not use weak symbol support, even if it is provided by the linker.
2111 By default, G++ will use weak symbols if they are available.  This
2112 option exists only for testing, and should not be used by end-users;
2113 it will result in inferior code and has no benefits.  This option may
2114 be removed in a future release of G++.
2116 @item -nostdinc++
2117 @opindex nostdinc++
2118 Do not search for header files in the standard directories specific to
2119 C++, but do still search the other standard directories.  (This option
2120 is used when building the C++ library.)
2121 @end table
2123 In addition, these optimization, warning, and code generation options
2124 have meanings only for C++ programs:
2126 @table @gcctabopt
2127 @item -fno-default-inline
2128 @opindex fno-default-inline
2129 Do not assume @samp{inline} for functions defined inside a class scope.
2130 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
2131 functions will have linkage like inline functions; they just won't be
2132 inlined by default.
2134 @item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)}
2135 @opindex Wabi
2136 @opindex Wno-abi
2137 Warn when G++ generates code that is probably not compatible with the
2138 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
2139 all such cases, there are probably some cases that are not warned about,
2140 even though G++ is generating incompatible code.  There may also be
2141 cases where warnings are emitted even though the code that is generated
2142 will be compatible.
2144 You should rewrite your code to avoid these warnings if you are
2145 concerned about the fact that code generated by G++ may not be binary
2146 compatible with code generated by other compilers.
2148 The known incompatibilities in @option{-fabi-version=2} (the default) include:
2150 @itemize @bullet
2152 @item
2153 A template with a non-type template parameter of reference type is
2154 mangled incorrectly:
2155 @smallexample
2156 extern int N;
2157 template <int &> struct S @{@};
2158 void n (S<N>) @{2@}
2159 @end smallexample
2161 This is fixed in @option{-fabi-version=3}.
2163 @item
2164 SIMD vector types declared using @code{__attribute ((vector_size))} are
2165 mangled in a non-standard way that does not allow for overloading of
2166 functions taking vectors of different sizes.
2168 The mangling is changed in @option{-fabi-version=4}.
2169 @end itemize
2171 The known incompatibilities in @option{-fabi-version=1} include:
2173 @itemize @bullet
2175 @item
2176 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
2177 pack data into the same byte as a base class.  For example:
2179 @smallexample
2180 struct A @{ virtual void f(); int f1 : 1; @};
2181 struct B : public A @{ int f2 : 1; @};
2182 @end smallexample
2184 @noindent
2185 In this case, G++ will place @code{B::f2} into the same byte
2186 as@code{A::f1}; other compilers will not.  You can avoid this problem
2187 by explicitly padding @code{A} so that its size is a multiple of the
2188 byte size on your platform; that will cause G++ and other compilers to
2189 layout @code{B} identically.
2191 @item
2192 Incorrect handling of tail-padding for virtual bases.  G++ does not use
2193 tail padding when laying out virtual bases.  For example:
2195 @smallexample
2196 struct A @{ virtual void f(); char c1; @};
2197 struct B @{ B(); char c2; @};
2198 struct C : public A, public virtual B @{@};
2199 @end smallexample
2201 @noindent
2202 In this case, G++ will not place @code{B} into the tail-padding for
2203 @code{A}; other compilers will.  You can avoid this problem by
2204 explicitly padding @code{A} so that its size is a multiple of its
2205 alignment (ignoring virtual base classes); that will cause G++ and other
2206 compilers to layout @code{C} identically.
2208 @item
2209 Incorrect handling of bit-fields with declared widths greater than that
2210 of their underlying types, when the bit-fields appear in a union.  For
2211 example:
2213 @smallexample
2214 union U @{ int i : 4096; @};
2215 @end smallexample
2217 @noindent
2218 Assuming that an @code{int} does not have 4096 bits, G++ will make the
2219 union too small by the number of bits in an @code{int}.
2221 @item
2222 Empty classes can be placed at incorrect offsets.  For example:
2224 @smallexample
2225 struct A @{@};
2227 struct B @{
2228   A a;
2229   virtual void f ();
2232 struct C : public B, public A @{@};
2233 @end smallexample
2235 @noindent
2236 G++ will place the @code{A} base class of @code{C} at a nonzero offset;
2237 it should be placed at offset zero.  G++ mistakenly believes that the
2238 @code{A} data member of @code{B} is already at offset zero.
2240 @item
2241 Names of template functions whose types involve @code{typename} or
2242 template template parameters can be mangled incorrectly.
2244 @smallexample
2245 template <typename Q>
2246 void f(typename Q::X) @{@}
2248 template <template <typename> class Q>
2249 void f(typename Q<int>::X) @{@}
2250 @end smallexample
2252 @noindent
2253 Instantiations of these templates may be mangled incorrectly.
2255 @end itemize
2257 It also warns psABI related changes.  The known psABI changes at this
2258 point include:
2260 @itemize @bullet
2262 @item
2263 For SYSV/x86-64, when passing union with long double, it is changed to
2264 pass in memory as specified in psABI.  For example:
2266 @smallexample
2267 union U @{
2268   long double ld;
2269   int i;
2271 @end smallexample
2273 @noindent
2274 @code{union U} will always be passed in memory.
2276 @end itemize
2278 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
2279 @opindex Wctor-dtor-privacy
2280 @opindex Wno-ctor-dtor-privacy
2281 Warn when a class seems unusable because all the constructors or
2282 destructors in that class are private, and it has neither friends nor
2283 public static member functions.
2285 @item -Wnoexcept @r{(C++ and Objective-C++ only)}
2286 @opindex Wnoexcept
2287 @opindex Wno-noexcept
2288 Warn when a noexcept-expression evaluates to false because of a call
2289 to a function that does not have a non-throwing exception
2290 specification (i.e. @samp{throw()} or @samp{noexcept}) but is known by
2291 the compiler to never throw an exception.
2293 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
2294 @opindex Wnon-virtual-dtor
2295 @opindex Wno-non-virtual-dtor
2296 Warn when a class has virtual functions and accessible non-virtual
2297 destructor, in which case it would be possible but unsafe to delete
2298 an instance of a derived class through a pointer to the base class.
2299 This warning is also enabled if -Weffc++ is specified.
2301 @item -Wreorder @r{(C++ and Objective-C++ only)}
2302 @opindex Wreorder
2303 @opindex Wno-reorder
2304 @cindex reordering, warning
2305 @cindex warning for reordering of member initializers
2306 Warn when the order of member initializers given in the code does not
2307 match the order in which they must be executed.  For instance:
2309 @smallexample
2310 struct A @{
2311   int i;
2312   int j;
2313   A(): j (0), i (1) @{ @}
2315 @end smallexample
2317 The compiler will rearrange the member initializers for @samp{i}
2318 and @samp{j} to match the declaration order of the members, emitting
2319 a warning to that effect.  This warning is enabled by @option{-Wall}.
2320 @end table
2322 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
2324 @table @gcctabopt
2325 @item -Weffc++ @r{(C++ and Objective-C++ only)}
2326 @opindex Weffc++
2327 @opindex Wno-effc++
2328 Warn about violations of the following style guidelines from Scott Meyers'
2329 @cite{Effective C++} book:
2331 @itemize @bullet
2332 @item
2333 Item 11:  Define a copy constructor and an assignment operator for classes
2334 with dynamically allocated memory.
2336 @item
2337 Item 12:  Prefer initialization to assignment in constructors.
2339 @item
2340 Item 14:  Make destructors virtual in base classes.
2342 @item
2343 Item 15:  Have @code{operator=} return a reference to @code{*this}.
2345 @item
2346 Item 23:  Don't try to return a reference when you must return an object.
2348 @end itemize
2350 Also warn about violations of the following style guidelines from
2351 Scott Meyers' @cite{More Effective C++} book:
2353 @itemize @bullet
2354 @item
2355 Item 6:  Distinguish between prefix and postfix forms of increment and
2356 decrement operators.
2358 @item
2359 Item 7:  Never overload @code{&&}, @code{||}, or @code{,}.
2361 @end itemize
2363 When selecting this option, be aware that the standard library
2364 headers do not obey all of these guidelines; use @samp{grep -v}
2365 to filter out those warnings.
2367 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
2368 @opindex Wstrict-null-sentinel
2369 @opindex Wno-strict-null-sentinel
2370 Warn also about the use of an uncasted @code{NULL} as sentinel.  When
2371 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2372 to @code{__null}.  Although it is a null pointer constant not a null pointer,
2373 it is guaranteed to be of the same size as a pointer.  But this use is
2374 not portable across different compilers.
2376 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
2377 @opindex Wno-non-template-friend
2378 @opindex Wnon-template-friend
2379 Disable warnings when non-templatized friend functions are declared
2380 within a template.  Since the advent of explicit template specification
2381 support in G++, if the name of the friend is an unqualified-id (i.e.,
2382 @samp{friend foo(int)}), the C++ language specification demands that the
2383 friend declare or define an ordinary, nontemplate function.  (Section
2384 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2385 could be interpreted as a particular specialization of a templatized
2386 function.  Because this non-conforming behavior is no longer the default
2387 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2388 check existing code for potential trouble spots and is on by default.
2389 This new compiler behavior can be turned off with
2390 @option{-Wno-non-template-friend} which keeps the conformant compiler code
2391 but disables the helpful warning.
2393 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
2394 @opindex Wold-style-cast
2395 @opindex Wno-old-style-cast
2396 Warn if an old-style (C-style) cast to a non-void type is used within
2397 a C++ program.  The new-style casts (@samp{dynamic_cast},
2398 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
2399 less vulnerable to unintended effects and much easier to search for.
2401 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
2402 @opindex Woverloaded-virtual
2403 @opindex Wno-overloaded-virtual
2404 @cindex overloaded virtual fn, warning
2405 @cindex warning for overloaded virtual fn
2406 Warn when a function declaration hides virtual functions from a
2407 base class.  For example, in:
2409 @smallexample
2410 struct A @{
2411   virtual void f();
2414 struct B: public A @{
2415   void f(int);
2417 @end smallexample
2419 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2420 like:
2422 @smallexample
2423 B* b;
2424 b->f();
2425 @end smallexample
2427 will fail to compile.
2429 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
2430 @opindex Wno-pmf-conversions
2431 @opindex Wpmf-conversions
2432 Disable the diagnostic for converting a bound pointer to member function
2433 to a plain pointer.
2435 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
2436 @opindex Wsign-promo
2437 @opindex Wno-sign-promo
2438 Warn when overload resolution chooses a promotion from unsigned or
2439 enumerated type to a signed type, over a conversion to an unsigned type of
2440 the same size.  Previous versions of G++ would try to preserve
2441 unsignedness, but the standard mandates the current behavior.
2443 @smallexample
2444 struct A @{
2445   operator int ();
2446   A& operator = (int);
2449 main ()
2451   A a,b;
2452   a = b;
2454 @end smallexample
2456 In this example, G++ will synthesize a default @samp{A& operator =
2457 (const A&);}, while cfront will use the user-defined @samp{operator =}.
2458 @end table
2460 @node Objective-C and Objective-C++ Dialect Options
2461 @section Options Controlling Objective-C and Objective-C++ Dialects
2463 @cindex compiler options, Objective-C and Objective-C++
2464 @cindex Objective-C and Objective-C++ options, command line
2465 @cindex options, Objective-C and Objective-C++
2466 (NOTE: This manual does not describe the Objective-C and Objective-C++
2467 languages themselves.  See @xref{Standards,,Language Standards
2468 Supported by GCC}, for references.)
2470 This section describes the command-line options that are only meaningful
2471 for Objective-C and Objective-C++ programs, but you can also use most of
2472 the language-independent GNU compiler options.
2473 For example, you might compile a file @code{some_class.m} like this:
2475 @smallexample
2476 gcc -g -fgnu-runtime -O -c some_class.m
2477 @end smallexample
2479 @noindent
2480 In this example, @option{-fgnu-runtime} is an option meant only for
2481 Objective-C and Objective-C++ programs; you can use the other options with
2482 any language supported by GCC@.
2484 Note that since Objective-C is an extension of the C language, Objective-C
2485 compilations may also use options specific to the C front-end (e.g.,
2486 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2487 C++-specific options (e.g., @option{-Wabi}).
2489 Here is a list of options that are @emph{only} for compiling Objective-C
2490 and Objective-C++ programs:
2492 @table @gcctabopt
2493 @item -fconstant-string-class=@var{class-name}
2494 @opindex fconstant-string-class
2495 Use @var{class-name} as the name of the class to instantiate for each
2496 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2497 class name is @code{NXConstantString} if the GNU runtime is being used, and
2498 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2499 @option{-fconstant-cfstrings} option, if also present, will override the
2500 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2501 to be laid out as constant CoreFoundation strings.
2503 @item -fgnu-runtime
2504 @opindex fgnu-runtime
2505 Generate object code compatible with the standard GNU Objective-C
2506 runtime.  This is the default for most types of systems.
2508 @item -fnext-runtime
2509 @opindex fnext-runtime
2510 Generate output compatible with the NeXT runtime.  This is the default
2511 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2512 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2513 used.
2515 @item -fno-nil-receivers
2516 @opindex fno-nil-receivers
2517 Assume that all Objective-C message dispatches (e.g.,
2518 @code{[receiver message:arg]}) in this translation unit ensure that the receiver
2519 is not @code{nil}.  This allows for more efficient entry points in the runtime
2520 to be used.  Currently, this option is only available in conjunction with
2521 the NeXT runtime on Mac OS X 10.3 and later.
2523 @item -fobjc-call-cxx-cdtors
2524 @opindex fobjc-call-cxx-cdtors
2525 For each Objective-C class, check if any of its instance variables is a
2526 C++ object with a non-trivial default constructor.  If so, synthesize a
2527 special @code{- (id) .cxx_construct} instance method that will run
2528 non-trivial default constructors on any such instance variables, in order,
2529 and then return @code{self}.  Similarly, check if any instance variable
2530 is a C++ object with a non-trivial destructor, and if so, synthesize a
2531 special @code{- (void) .cxx_destruct} method that will run
2532 all such default destructors, in reverse order.
2534 The @code{- (id) .cxx_construct} and/or @code{- (void) .cxx_destruct} methods
2535 thusly generated will only operate on instance variables declared in the
2536 current Objective-C class, and not those inherited from superclasses.  It
2537 is the responsibility of the Objective-C runtime to invoke all such methods
2538 in an object's inheritance hierarchy.  The @code{- (id) .cxx_construct} methods
2539 will be invoked by the runtime immediately after a new object
2540 instance is allocated; the @code{- (void) .cxx_destruct} methods will
2541 be invoked immediately before the runtime deallocates an object instance.
2543 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2544 support for invoking the @code{- (id) .cxx_construct} and
2545 @code{- (void) .cxx_destruct} methods.
2547 @item -fobjc-direct-dispatch
2548 @opindex fobjc-direct-dispatch
2549 Allow fast jumps to the message dispatcher.  On Darwin this is
2550 accomplished via the comm page.
2552 @item -fobjc-exceptions
2553 @opindex fobjc-exceptions
2554 Enable syntactic support for structured exception handling in Objective-C,
2555 similar to what is offered by C++ and Java.  This option is
2556 unavailable in conjunction with the NeXT runtime on Mac OS X 10.2 and
2557 earlier.
2559 @smallexample
2560   @@try @{
2561     @dots{}
2562        @@throw expr;
2563     @dots{}
2564   @}
2565   @@catch (AnObjCClass *exc) @{
2566     @dots{}
2567       @@throw expr;
2568     @dots{}
2569       @@throw;
2570     @dots{}
2571   @}
2572   @@catch (AnotherClass *exc) @{
2573     @dots{}
2574   @}
2575   @@catch (id allOthers) @{
2576     @dots{}
2577   @}
2578   @@finally @{
2579     @dots{}
2580       @@throw expr;
2581     @dots{}
2582   @}
2583 @end smallexample
2585 The @code{@@throw} statement may appear anywhere in an Objective-C or
2586 Objective-C++ program; when used inside of a @code{@@catch} block, the
2587 @code{@@throw} may appear without an argument (as shown above), in which case
2588 the object caught by the @code{@@catch} will be rethrown.
2590 Note that only (pointers to) Objective-C objects may be thrown and
2591 caught using this scheme.  When an object is thrown, it will be caught
2592 by the nearest @code{@@catch} clause capable of handling objects of that type,
2593 analogously to how @code{catch} blocks work in C++ and Java.  A
2594 @code{@@catch(id @dots{})} clause (as shown above) may also be provided to catch
2595 any and all Objective-C exceptions not caught by previous @code{@@catch}
2596 clauses (if any).
2598 The @code{@@finally} clause, if present, will be executed upon exit from the
2599 immediately preceding @code{@@try @dots{} @@catch} section.  This will happen
2600 regardless of whether any exceptions are thrown, caught or rethrown
2601 inside the @code{@@try @dots{} @@catch} section, analogously to the behavior
2602 of the @code{finally} clause in Java.
2604 There are several caveats to using the new exception mechanism:
2606 @itemize @bullet
2607 @item
2608 Although currently designed to be binary compatible with @code{NS_HANDLER}-style
2609 idioms provided by the @code{NSException} class, the new
2610 exceptions can only be used on Mac OS X 10.3 (Panther) and later
2611 systems, due to additional functionality needed in the (NeXT) Objective-C
2612 runtime.
2614 @item
2615 As mentioned above, the new exceptions do not support handling
2616 types other than Objective-C objects.   Furthermore, when used from
2617 Objective-C++, the Objective-C exception model does not interoperate with C++
2618 exceptions at this time.  This means you cannot @code{@@throw} an exception
2619 from Objective-C and @code{catch} it in C++, or vice versa
2620 (i.e., @code{throw @dots{} @@catch}).
2621 @end itemize
2623 The @option{-fobjc-exceptions} switch also enables the use of synchronization
2624 blocks for thread-safe execution:
2626 @smallexample
2627   @@synchronized (ObjCClass *guard) @{
2628     @dots{}
2629   @}
2630 @end smallexample
2632 Upon entering the @code{@@synchronized} block, a thread of execution shall
2633 first check whether a lock has been placed on the corresponding @code{guard}
2634 object by another thread.  If it has, the current thread shall wait until
2635 the other thread relinquishes its lock.  Once @code{guard} becomes available,
2636 the current thread will place its own lock on it, execute the code contained in
2637 the @code{@@synchronized} block, and finally relinquish the lock (thereby
2638 making @code{guard} available to other threads).
2640 Unlike Java, Objective-C does not allow for entire methods to be marked
2641 @code{@@synchronized}.  Note that throwing exceptions out of
2642 @code{@@synchronized} blocks is allowed, and will cause the guarding object
2643 to be unlocked properly.
2645 @item -fobjc-gc
2646 @opindex fobjc-gc
2647 Enable garbage collection (GC) in Objective-C and Objective-C++ programs.
2649 @item -freplace-objc-classes
2650 @opindex freplace-objc-classes
2651 Emit a special marker instructing @command{ld(1)} not to statically link in
2652 the resulting object file, and allow @command{dyld(1)} to load it in at
2653 run time instead.  This is used in conjunction with the Fix-and-Continue
2654 debugging mode, where the object file in question may be recompiled and
2655 dynamically reloaded in the course of program execution, without the need
2656 to restart the program itself.  Currently, Fix-and-Continue functionality
2657 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2658 and later.
2660 @item -fzero-link
2661 @opindex fzero-link
2662 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2663 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2664 compile time) with static class references that get initialized at load time,
2665 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2666 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2667 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2668 for individual class implementations to be modified during program execution.
2670 @item -gen-decls
2671 @opindex gen-decls
2672 Dump interface declarations for all classes seen in the source file to a
2673 file named @file{@var{sourcename}.decl}.
2675 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
2676 @opindex Wassign-intercept
2677 @opindex Wno-assign-intercept
2678 Warn whenever an Objective-C assignment is being intercepted by the
2679 garbage collector.
2681 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
2682 @opindex Wno-protocol
2683 @opindex Wprotocol
2684 If a class is declared to implement a protocol, a warning is issued for
2685 every method in the protocol that is not implemented by the class.  The
2686 default behavior is to issue a warning for every method not explicitly
2687 implemented in the class, even if a method implementation is inherited
2688 from the superclass.  If you use the @option{-Wno-protocol} option, then
2689 methods inherited from the superclass are considered to be implemented,
2690 and no warning is issued for them.
2692 @item -Wselector @r{(Objective-C and Objective-C++ only)}
2693 @opindex Wselector
2694 @opindex Wno-selector
2695 Warn if multiple methods of different types for the same selector are
2696 found during compilation.  The check is performed on the list of methods
2697 in the final stage of compilation.  Additionally, a check is performed
2698 for each selector appearing in a @code{@@selector(@dots{})}
2699 expression, and a corresponding method for that selector has been found
2700 during compilation.  Because these checks scan the method table only at
2701 the end of compilation, these warnings are not produced if the final
2702 stage of compilation is not reached, for example because an error is
2703 found during compilation, or because the @option{-fsyntax-only} option is
2704 being used.
2706 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
2707 @opindex Wstrict-selector-match
2708 @opindex Wno-strict-selector-match
2709 Warn if multiple methods with differing argument and/or return types are
2710 found for a given selector when attempting to send a message using this
2711 selector to a receiver of type @code{id} or @code{Class}.  When this flag
2712 is off (which is the default behavior), the compiler will omit such warnings
2713 if any differences found are confined to types which share the same size
2714 and alignment.
2716 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
2717 @opindex Wundeclared-selector
2718 @opindex Wno-undeclared-selector
2719 Warn if a @code{@@selector(@dots{})} expression referring to an
2720 undeclared selector is found.  A selector is considered undeclared if no
2721 method with that name has been declared before the
2722 @code{@@selector(@dots{})} expression, either explicitly in an
2723 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
2724 an @code{@@implementation} section.  This option always performs its
2725 checks as soon as a @code{@@selector(@dots{})} expression is found,
2726 while @option{-Wselector} only performs its checks in the final stage of
2727 compilation.  This also enforces the coding style convention
2728 that methods and selectors must be declared before being used.
2730 @item -print-objc-runtime-info
2731 @opindex print-objc-runtime-info
2732 Generate C header describing the largest structure that is passed by
2733 value, if any.
2735 @end table
2737 @node Language Independent Options
2738 @section Options to Control Diagnostic Messages Formatting
2739 @cindex options to control diagnostics formatting
2740 @cindex diagnostic messages
2741 @cindex message formatting
2743 Traditionally, diagnostic messages have been formatted irrespective of
2744 the output device's aspect (e.g.@: its width, @dots{}).  The options described
2745 below can be used to control the diagnostic messages formatting
2746 algorithm, e.g.@: how many characters per line, how often source location
2747 information should be reported.  Right now, only the C++ front end can
2748 honor these options.  However it is expected, in the near future, that
2749 the remaining front ends would be able to digest them correctly.
2751 @table @gcctabopt
2752 @item -fmessage-length=@var{n}
2753 @opindex fmessage-length
2754 Try to format error messages so that they fit on lines of about @var{n}
2755 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
2756 the front ends supported by GCC@.  If @var{n} is zero, then no
2757 line-wrapping will be done; each error message will appear on a single
2758 line.
2760 @opindex fdiagnostics-show-location
2761 @item -fdiagnostics-show-location=once
2762 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
2763 reporter to emit @emph{once} source location information; that is, in
2764 case the message is too long to fit on a single physical line and has to
2765 be wrapped, the source location won't be emitted (as prefix) again,
2766 over and over, in subsequent continuation lines.  This is the default
2767 behavior.
2769 @item -fdiagnostics-show-location=every-line
2770 Only meaningful in line-wrapping mode.  Instructs the diagnostic
2771 messages reporter to emit the same source location information (as
2772 prefix) for physical lines that result from the process of breaking
2773 a message which is too long to fit on a single line.
2775 @item -fdiagnostics-show-option
2776 @opindex fdiagnostics-show-option
2777 This option instructs the diagnostic machinery to add text to each
2778 diagnostic emitted, which indicates which command line option directly
2779 controls that diagnostic, when such an option is known to the
2780 diagnostic machinery.
2782 @item -Wcoverage-mismatch
2783 @opindex Wcoverage-mismatch
2784 Warn if feedback profiles do not match when using the
2785 @option{-fprofile-use} option.
2786 If a source file was changed between @option{-fprofile-gen} and
2787 @option{-fprofile-use}, the files with the profile feedback can fail
2788 to match the source file and GCC can not use the profile feedback
2789 information.  By default, this warning is enabled and is treated as an
2790 error.  @option{-Wno-coverage-mismatch} can be used to disable the
2791 warning or @option{-Wno-error=coverage-mismatch} can be used to
2792 disable the error.  Disable the error for this warning can result in
2793 poorly optimized code, so disabling the error is useful only in the
2794 case of very minor changes such as bug fixes to an existing code-base.
2795 Completely disabling the warning is not recommended.
2797 @end table
2799 @node Warning Options
2800 @section Options to Request or Suppress Warnings
2801 @cindex options to control warnings
2802 @cindex warning messages
2803 @cindex messages, warning
2804 @cindex suppressing warnings
2806 Warnings are diagnostic messages that report constructions which
2807 are not inherently erroneous but which are risky or suggest there
2808 may have been an error.
2810 The following language-independent options do not enable specific
2811 warnings but control the kinds of diagnostics produced by GCC.
2813 @table @gcctabopt
2814 @cindex syntax checking
2815 @item -fsyntax-only
2816 @opindex fsyntax-only
2817 Check the code for syntax errors, but don't do anything beyond that.
2819 @item -w
2820 @opindex w
2821 Inhibit all warning messages.
2823 @item -Werror
2824 @opindex Werror
2825 @opindex Wno-error
2826 Make all warnings into errors.
2828 @item -Werror=
2829 @opindex Werror=
2830 @opindex Wno-error=
2831 Make the specified warning into an error.  The specifier for a warning
2832 is appended, for example @option{-Werror=switch} turns the warnings
2833 controlled by @option{-Wswitch} into errors.  This switch takes a
2834 negative form, to be used to negate @option{-Werror} for specific
2835 warnings, for example @option{-Wno-error=switch} makes
2836 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
2837 is in effect.  You can use the @option{-fdiagnostics-show-option}
2838 option to have each controllable warning amended with the option which
2839 controls it, to determine what to use with this option.
2841 Note that specifying @option{-Werror=}@var{foo} automatically implies
2842 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
2843 imply anything.
2845 @item -Wfatal-errors
2846 @opindex Wfatal-errors
2847 @opindex Wno-fatal-errors
2848 This option causes the compiler to abort compilation on the first error
2849 occurred rather than trying to keep going and printing further error
2850 messages.
2852 @end table
2854 You can request many specific warnings with options beginning
2855 @samp{-W}, for example @option{-Wimplicit} to request warnings on
2856 implicit declarations.  Each of these specific warning options also
2857 has a negative form beginning @samp{-Wno-} to turn off warnings; for
2858 example, @option{-Wno-implicit}.  This manual lists only one of the
2859 two forms, whichever is not the default.  For further,
2860 language-specific options also refer to @ref{C++ Dialect Options} and
2861 @ref{Objective-C and Objective-C++ Dialect Options}.
2863 When an unrecognized warning label is requested (e.g.,
2864 @option{-Wunknown-warning}), GCC will emit a diagnostic stating
2865 that the option is not recognized.  However, if the @samp{-Wno-} form
2866 is used, the behavior is slightly different: No diagnostic will be
2867 produced for @option{-Wno-unknown-warning} unless other diagnostics
2868 are being produced.  This allows the use of new @option{-Wno-} options
2869 with old compilers, but if something goes wrong, the compiler will
2870 warn that an unrecognized option was used.
2872 @table @gcctabopt
2873 @item -pedantic
2874 @opindex pedantic
2875 Issue all the warnings demanded by strict ISO C and ISO C++;
2876 reject all programs that use forbidden extensions, and some other
2877 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
2878 version of the ISO C standard specified by any @option{-std} option used.
2880 Valid ISO C and ISO C++ programs should compile properly with or without
2881 this option (though a rare few will require @option{-ansi} or a
2882 @option{-std} option specifying the required version of ISO C)@.  However,
2883 without this option, certain GNU extensions and traditional C and C++
2884 features are supported as well.  With this option, they are rejected.
2886 @option{-pedantic} does not cause warning messages for use of the
2887 alternate keywords whose names begin and end with @samp{__}.  Pedantic
2888 warnings are also disabled in the expression that follows
2889 @code{__extension__}.  However, only system header files should use
2890 these escape routes; application programs should avoid them.
2891 @xref{Alternate Keywords}.
2893 Some users try to use @option{-pedantic} to check programs for strict ISO
2894 C conformance.  They soon find that it does not do quite what they want:
2895 it finds some non-ISO practices, but not all---only those for which
2896 ISO C @emph{requires} a diagnostic, and some others for which
2897 diagnostics have been added.
2899 A feature to report any failure to conform to ISO C might be useful in
2900 some instances, but would require considerable additional work and would
2901 be quite different from @option{-pedantic}.  We don't have plans to
2902 support such a feature in the near future.
2904 Where the standard specified with @option{-std} represents a GNU
2905 extended dialect of C, such as @samp{gnu90} or @samp{gnu99}, there is a
2906 corresponding @dfn{base standard}, the version of ISO C on which the GNU
2907 extended dialect is based.  Warnings from @option{-pedantic} are given
2908 where they are required by the base standard.  (It would not make sense
2909 for such warnings to be given only for features not in the specified GNU
2910 C dialect, since by definition the GNU dialects of C include all
2911 features the compiler supports with the given option, and there would be
2912 nothing to warn about.)
2914 @item -pedantic-errors
2915 @opindex pedantic-errors
2916 Like @option{-pedantic}, except that errors are produced rather than
2917 warnings.
2919 @item -Wall
2920 @opindex Wall
2921 @opindex Wno-all
2922 This enables all the warnings about constructions that some users
2923 consider questionable, and that are easy to avoid (or modify to
2924 prevent the warning), even in conjunction with macros.  This also
2925 enables some language-specific warnings described in @ref{C++ Dialect
2926 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
2928 @option{-Wall} turns on the following warning flags:
2930 @gccoptlist{-Waddress   @gol
2931 -Warray-bounds @r{(only with} @option{-O2}@r{)}  @gol
2932 -Wc++0x-compat  @gol
2933 -Wchar-subscripts  @gol
2934 -Wenum-compare @r{(in C/Objc; this is on by default in C++)} @gol
2935 -Wimplicit-int @r{(C and Objective-C only)} @gol
2936 -Wimplicit-function-declaration @r{(C and Objective-C only)} @gol
2937 -Wcomment  @gol
2938 -Wformat   @gol
2939 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
2940 -Wmissing-braces  @gol
2941 -Wnonnull  @gol
2942 -Wparentheses  @gol
2943 -Wpointer-sign  @gol
2944 -Wreorder   @gol
2945 -Wreturn-type  @gol
2946 -Wsequence-point  @gol
2947 -Wsign-compare @r{(only in C++)}  @gol
2948 -Wstrict-aliasing  @gol
2949 -Wstrict-overflow=1  @gol
2950 -Wswitch  @gol
2951 -Wtrigraphs  @gol
2952 -Wuninitialized  @gol
2953 -Wunknown-pragmas  @gol
2954 -Wunused-function  @gol
2955 -Wunused-label     @gol
2956 -Wunused-value     @gol
2957 -Wunused-variable  @gol
2958 -Wvolatile-register-var @gol
2961 Note that some warning flags are not implied by @option{-Wall}.  Some of
2962 them warn about constructions that users generally do not consider
2963 questionable, but which occasionally you might wish to check for;
2964 others warn about constructions that are necessary or hard to avoid in
2965 some cases, and there is no simple way to modify the code to suppress
2966 the warning. Some of them are enabled by @option{-Wextra} but many of
2967 them must be enabled individually.
2969 @item -Wextra
2970 @opindex W
2971 @opindex Wextra
2972 @opindex Wno-extra
2973 This enables some extra warning flags that are not enabled by
2974 @option{-Wall}. (This option used to be called @option{-W}.  The older
2975 name is still supported, but the newer name is more descriptive.)
2977 @gccoptlist{-Wclobbered  @gol
2978 -Wempty-body  @gol
2979 -Wignored-qualifiers @gol
2980 -Wmissing-field-initializers  @gol
2981 -Wmissing-parameter-type @r{(C only)}  @gol
2982 -Wold-style-declaration @r{(C only)}  @gol
2983 -Woverride-init  @gol
2984 -Wsign-compare  @gol
2985 -Wtype-limits  @gol
2986 -Wuninitialized  @gol
2987 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)} @gol
2988 -Wunused-but-set-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}  @gol
2991 The option @option{-Wextra} also prints warning messages for the
2992 following cases:
2994 @itemize @bullet
2996 @item
2997 A pointer is compared against integer zero with @samp{<}, @samp{<=},
2998 @samp{>}, or @samp{>=}.
3000 @item
3001 (C++ only) An enumerator and a non-enumerator both appear in a
3002 conditional expression.
3004 @item
3005 (C++ only) Ambiguous virtual bases.
3007 @item
3008 (C++ only) Subscripting an array which has been declared @samp{register}.
3010 @item
3011 (C++ only) Taking the address of a variable which has been declared
3012 @samp{register}.
3014 @item
3015 (C++ only) A base class is not initialized in a derived class' copy
3016 constructor.
3018 @end itemize
3020 @item -Wchar-subscripts
3021 @opindex Wchar-subscripts
3022 @opindex Wno-char-subscripts
3023 Warn if an array subscript has type @code{char}.  This is a common cause
3024 of error, as programmers often forget that this type is signed on some
3025 machines.
3026 This warning is enabled by @option{-Wall}.
3028 @item -Wcomment
3029 @opindex Wcomment
3030 @opindex Wno-comment
3031 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
3032 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
3033 This warning is enabled by @option{-Wall}.
3035 @item -Wno-cpp \
3036 @r{(C, Objective-C, C++, Objective-C++ and Fortran only)}
3038 Suppress warning messages emitted by @code{#warning} directives.
3040 @item -Wformat
3041 @opindex Wformat
3042 @opindex Wno-format
3043 @opindex ffreestanding
3044 @opindex fno-builtin
3045 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
3046 the arguments supplied have types appropriate to the format string
3047 specified, and that the conversions specified in the format string make
3048 sense.  This includes standard functions, and others specified by format
3049 attributes (@pxref{Function Attributes}), in the @code{printf},
3050 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
3051 not in the C standard) families (or other target-specific families).
3052 Which functions are checked without format attributes having been
3053 specified depends on the standard version selected, and such checks of
3054 functions without the attribute specified are disabled by
3055 @option{-ffreestanding} or @option{-fno-builtin}.
3057 The formats are checked against the format features supported by GNU
3058 libc version 2.2.  These include all ISO C90 and C99 features, as well
3059 as features from the Single Unix Specification and some BSD and GNU
3060 extensions.  Other library implementations may not support all these
3061 features; GCC does not support warning about features that go beyond a
3062 particular library's limitations.  However, if @option{-pedantic} is used
3063 with @option{-Wformat}, warnings will be given about format features not
3064 in the selected standard version (but not for @code{strfmon} formats,
3065 since those are not in any version of the C standard).  @xref{C Dialect
3066 Options,,Options Controlling C Dialect}.
3068 Since @option{-Wformat} also checks for null format arguments for
3069 several functions, @option{-Wformat} also implies @option{-Wnonnull}.
3071 @option{-Wformat} is included in @option{-Wall}.  For more control over some
3072 aspects of format checking, the options @option{-Wformat-y2k},
3073 @option{-Wno-format-extra-args}, @option{-Wno-format-zero-length},
3074 @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
3075 @option{-Wformat=2} are available, but are not included in @option{-Wall}.
3077 @item -Wformat-y2k
3078 @opindex Wformat-y2k
3079 @opindex Wno-format-y2k
3080 If @option{-Wformat} is specified, also warn about @code{strftime}
3081 formats which may yield only a two-digit year.
3083 @item -Wno-format-contains-nul
3084 @opindex Wno-format-contains-nul
3085 @opindex Wformat-contains-nul
3086 If @option{-Wformat} is specified, do not warn about format strings that
3087 contain NUL bytes.
3089 @item -Wno-format-extra-args
3090 @opindex Wno-format-extra-args
3091 @opindex Wformat-extra-args
3092 If @option{-Wformat} is specified, do not warn about excess arguments to a
3093 @code{printf} or @code{scanf} format function.  The C standard specifies
3094 that such arguments are ignored.
3096 Where the unused arguments lie between used arguments that are
3097 specified with @samp{$} operand number specifications, normally
3098 warnings are still given, since the implementation could not know what
3099 type to pass to @code{va_arg} to skip the unused arguments.  However,
3100 in the case of @code{scanf} formats, this option will suppress the
3101 warning if the unused arguments are all pointers, since the Single
3102 Unix Specification says that such unused arguments are allowed.
3104 @item -Wno-format-zero-length @r{(C and Objective-C only)}
3105 @opindex Wno-format-zero-length
3106 @opindex Wformat-zero-length
3107 If @option{-Wformat} is specified, do not warn about zero-length formats.
3108 The C standard specifies that zero-length formats are allowed.
3110 @item -Wformat-nonliteral
3111 @opindex Wformat-nonliteral
3112 @opindex Wno-format-nonliteral
3113 If @option{-Wformat} is specified, also warn if the format string is not a
3114 string literal and so cannot be checked, unless the format function
3115 takes its format arguments as a @code{va_list}.
3117 @item -Wformat-security
3118 @opindex Wformat-security
3119 @opindex Wno-format-security
3120 If @option{-Wformat} is specified, also warn about uses of format
3121 functions that represent possible security problems.  At present, this
3122 warns about calls to @code{printf} and @code{scanf} functions where the
3123 format string is not a string literal and there are no format arguments,
3124 as in @code{printf (foo);}.  This may be a security hole if the format
3125 string came from untrusted input and contains @samp{%n}.  (This is
3126 currently a subset of what @option{-Wformat-nonliteral} warns about, but
3127 in future warnings may be added to @option{-Wformat-security} that are not
3128 included in @option{-Wformat-nonliteral}.)
3130 @item -Wformat=2
3131 @opindex Wformat=2
3132 @opindex Wno-format=2
3133 Enable @option{-Wformat} plus format checks not included in
3134 @option{-Wformat}.  Currently equivalent to @samp{-Wformat
3135 -Wformat-nonliteral -Wformat-security -Wformat-y2k}.
3137 @item -Wnonnull @r{(C and Objective-C only)}
3138 @opindex Wnonnull
3139 @opindex Wno-nonnull
3140 Warn about passing a null pointer for arguments marked as
3141 requiring a non-null value by the @code{nonnull} function attribute.
3143 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
3144 can be disabled with the @option{-Wno-nonnull} option.
3146 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
3147 @opindex Winit-self
3148 @opindex Wno-init-self
3149 Warn about uninitialized variables which are initialized with themselves.
3150 Note this option can only be used with the @option{-Wuninitialized} option.
3152 For example, GCC will warn about @code{i} being uninitialized in the
3153 following snippet only when @option{-Winit-self} has been specified:
3154 @smallexample
3155 @group
3156 int f()
3158   int i = i;
3159   return i;
3161 @end group
3162 @end smallexample
3164 @item -Wimplicit-int @r{(C and Objective-C only)}
3165 @opindex Wimplicit-int
3166 @opindex Wno-implicit-int
3167 Warn when a declaration does not specify a type.
3168 This warning is enabled by @option{-Wall}.
3170 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
3171 @opindex Wimplicit-function-declaration
3172 @opindex Wno-implicit-function-declaration
3173 Give a warning whenever a function is used before being declared. In
3174 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
3175 enabled by default and it is made into an error by
3176 @option{-pedantic-errors}. This warning is also enabled by
3177 @option{-Wall}.
3179 @item -Wimplicit @r{(C and Objective-C only)}
3180 @opindex Wimplicit
3181 @opindex Wno-implicit
3182 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
3183 This warning is enabled by @option{-Wall}.
3185 @item -Wignored-qualifiers @r{(C and C++ only)}
3186 @opindex Wignored-qualifiers
3187 @opindex Wno-ignored-qualifiers
3188 Warn if the return type of a function has a type qualifier
3189 such as @code{const}.  For ISO C such a type qualifier has no effect,
3190 since the value returned by a function is not an lvalue.
3191 For C++, the warning is only emitted for scalar types or @code{void}.
3192 ISO C prohibits qualified @code{void} return types on function
3193 definitions, so such return types always receive a warning
3194 even without this option.
3196 This warning is also enabled by @option{-Wextra}.
3198 @item -Wmain
3199 @opindex Wmain
3200 @opindex Wno-main
3201 Warn if the type of @samp{main} is suspicious.  @samp{main} should be
3202 a function with external linkage, returning int, taking either zero
3203 arguments, two, or three arguments of appropriate types.  This warning
3204 is enabled by default in C++ and is enabled by either @option{-Wall}
3205 or @option{-pedantic}.
3207 @item -Wmissing-braces
3208 @opindex Wmissing-braces
3209 @opindex Wno-missing-braces
3210 Warn if an aggregate or union initializer is not fully bracketed.  In
3211 the following example, the initializer for @samp{a} is not fully
3212 bracketed, but that for @samp{b} is fully bracketed.
3214 @smallexample
3215 int a[2][2] = @{ 0, 1, 2, 3 @};
3216 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
3217 @end smallexample
3219 This warning is enabled by @option{-Wall}.
3221 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
3222 @opindex Wmissing-include-dirs
3223 @opindex Wno-missing-include-dirs
3224 Warn if a user-supplied include directory does not exist.
3226 @item -Wparentheses
3227 @opindex Wparentheses
3228 @opindex Wno-parentheses
3229 Warn if parentheses are omitted in certain contexts, such
3230 as when there is an assignment in a context where a truth value
3231 is expected, or when operators are nested whose precedence people
3232 often get confused about.
3234 Also warn if a comparison like @samp{x<=y<=z} appears; this is
3235 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
3236 interpretation from that of ordinary mathematical notation.
3238 Also warn about constructions where there may be confusion to which
3239 @code{if} statement an @code{else} branch belongs.  Here is an example of
3240 such a case:
3242 @smallexample
3243 @group
3245   if (a)
3246     if (b)
3247       foo ();
3248   else
3249     bar ();
3251 @end group
3252 @end smallexample
3254 In C/C++, every @code{else} branch belongs to the innermost possible
3255 @code{if} statement, which in this example is @code{if (b)}.  This is
3256 often not what the programmer expected, as illustrated in the above
3257 example by indentation the programmer chose.  When there is the
3258 potential for this confusion, GCC will issue a warning when this flag
3259 is specified.  To eliminate the warning, add explicit braces around
3260 the innermost @code{if} statement so there is no way the @code{else}
3261 could belong to the enclosing @code{if}.  The resulting code would
3262 look like this:
3264 @smallexample
3265 @group
3267   if (a)
3268     @{
3269       if (b)
3270         foo ();
3271       else
3272         bar ();
3273     @}
3275 @end group
3276 @end smallexample
3278 Also warn for dangerous uses of the 
3279 ?: with omitted middle operand GNU extension. When the condition
3280 in the ?: operator is a boolean expression the omitted value will
3281 be always 1. Often the user expects it to be a value computed
3282 inside the conditional expression instead. 
3284 This warning is enabled by @option{-Wall}.
3286 @item -Wsequence-point
3287 @opindex Wsequence-point
3288 @opindex Wno-sequence-point
3289 Warn about code that may have undefined semantics because of violations
3290 of sequence point rules in the C and C++ standards.
3292 The C and C++ standards defines the order in which expressions in a C/C++
3293 program are evaluated in terms of @dfn{sequence points}, which represent
3294 a partial ordering between the execution of parts of the program: those
3295 executed before the sequence point, and those executed after it.  These
3296 occur after the evaluation of a full expression (one which is not part
3297 of a larger expression), after the evaluation of the first operand of a
3298 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
3299 function is called (but after the evaluation of its arguments and the
3300 expression denoting the called function), and in certain other places.
3301 Other than as expressed by the sequence point rules, the order of
3302 evaluation of subexpressions of an expression is not specified.  All
3303 these rules describe only a partial order rather than a total order,
3304 since, for example, if two functions are called within one expression
3305 with no sequence point between them, the order in which the functions
3306 are called is not specified.  However, the standards committee have
3307 ruled that function calls do not overlap.
3309 It is not specified when between sequence points modifications to the
3310 values of objects take effect.  Programs whose behavior depends on this
3311 have undefined behavior; the C and C++ standards specify that ``Between
3312 the previous and next sequence point an object shall have its stored
3313 value modified at most once by the evaluation of an expression.
3314 Furthermore, the prior value shall be read only to determine the value
3315 to be stored.''.  If a program breaks these rules, the results on any
3316 particular implementation are entirely unpredictable.
3318 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
3319 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
3320 diagnosed by this option, and it may give an occasional false positive
3321 result, but in general it has been found fairly effective at detecting
3322 this sort of problem in programs.
3324 The standard is worded confusingly, therefore there is some debate
3325 over the precise meaning of the sequence point rules in subtle cases.
3326 Links to discussions of the problem, including proposed formal
3327 definitions, may be found on the GCC readings page, at
3328 @w{@uref{http://gcc.gnu.org/readings.html}}.
3330 This warning is enabled by @option{-Wall} for C and C++.
3332 @item -Wreturn-type
3333 @opindex Wreturn-type
3334 @opindex Wno-return-type
3335 Warn whenever a function is defined with a return-type that defaults
3336 to @code{int}.  Also warn about any @code{return} statement with no
3337 return-value in a function whose return-type is not @code{void}
3338 (falling off the end of the function body is considered returning
3339 without a value), and about a @code{return} statement with an
3340 expression in a function whose return-type is @code{void}.
3342 For C++, a function without return type always produces a diagnostic
3343 message, even when @option{-Wno-return-type} is specified.  The only
3344 exceptions are @samp{main} and functions defined in system headers.
3346 This warning is enabled by @option{-Wall}.
3348 @item -Wswitch
3349 @opindex Wswitch
3350 @opindex Wno-switch
3351 Warn whenever a @code{switch} statement has an index of enumerated type
3352 and lacks a @code{case} for one or more of the named codes of that
3353 enumeration.  (The presence of a @code{default} label prevents this
3354 warning.)  @code{case} labels outside the enumeration range also
3355 provoke warnings when this option is used (even if there is a
3356 @code{default} label).
3357 This warning is enabled by @option{-Wall}.
3359 @item -Wswitch-default
3360 @opindex Wswitch-default
3361 @opindex Wno-switch-default
3362 Warn whenever a @code{switch} statement does not have a @code{default}
3363 case.
3365 @item -Wswitch-enum
3366 @opindex Wswitch-enum
3367 @opindex Wno-switch-enum
3368 Warn whenever a @code{switch} statement has an index of enumerated type
3369 and lacks a @code{case} for one or more of the named codes of that
3370 enumeration.  @code{case} labels outside the enumeration range also
3371 provoke warnings when this option is used.  The only difference
3372 between @option{-Wswitch} and this option is that this option gives a
3373 warning about an omitted enumeration code even if there is a
3374 @code{default} label.
3376 @item -Wsync-nand @r{(C and C++ only)}
3377 @opindex Wsync-nand
3378 @opindex Wno-sync-nand
3379 Warn when @code{__sync_fetch_and_nand} and @code{__sync_nand_and_fetch}
3380 built-in functions are used.  These functions changed semantics in GCC 4.4.
3382 @item -Wtrigraphs
3383 @opindex Wtrigraphs
3384 @opindex Wno-trigraphs
3385 Warn if any trigraphs are encountered that might change the meaning of
3386 the program (trigraphs within comments are not warned about).
3387 This warning is enabled by @option{-Wall}.
3389 @item -Wunused-but-set-parameter
3390 @opindex Wunused-but-set-parameter
3391 @opindex Wno-unused-but-set-parameter
3392 Warn whenever a function parameter is assigned to, but otherwise unused
3393 (aside from its declaration).
3395 To suppress this warning use the @samp{unused} attribute
3396 (@pxref{Variable Attributes}).
3398 This warning is also enabled by @option{-Wunused} together with
3399 @option{-Wextra}.
3401 @item -Wunused-but-set-variable
3402 @opindex Wunused-but-set-variable
3403 @opindex Wno-unused-but-set-variable
3404 Warn whenever a local variable is assigned to, but otherwise unused
3405 (aside from its declaration).
3406 This warning is enabled by @option{-Wall}.
3408 To suppress this warning use the @samp{unused} attribute
3409 (@pxref{Variable Attributes}).
3411 This warning is also enabled by @option{-Wunused}, which is enabled
3412 by @option{-Wall}.
3414 @item -Wunused-function
3415 @opindex Wunused-function
3416 @opindex Wno-unused-function
3417 Warn whenever a static function is declared but not defined or a
3418 non-inline static function is unused.
3419 This warning is enabled by @option{-Wall}.
3421 @item -Wunused-label
3422 @opindex Wunused-label
3423 @opindex Wno-unused-label
3424 Warn whenever a label is declared but not used.
3425 This warning is enabled by @option{-Wall}.
3427 To suppress this warning use the @samp{unused} attribute
3428 (@pxref{Variable Attributes}).
3430 @item -Wunused-parameter
3431 @opindex Wunused-parameter
3432 @opindex Wno-unused-parameter
3433 Warn whenever a function parameter is unused aside from its declaration.
3435 To suppress this warning use the @samp{unused} attribute
3436 (@pxref{Variable Attributes}).
3438 @item -Wno-unused-result
3439 @opindex Wunused-result
3440 @opindex Wno-unused-result
3441 Do not warn if a caller of a function marked with attribute
3442 @code{warn_unused_result} (@pxref{Variable Attributes}) does not use
3443 its return value. The default is @option{-Wunused-result}.
3445 @item -Wunused-variable
3446 @opindex Wunused-variable
3447 @opindex Wno-unused-variable
3448 Warn whenever a local variable or non-constant static variable is unused
3449 aside from its declaration.
3450 This warning is enabled by @option{-Wall}.
3452 To suppress this warning use the @samp{unused} attribute
3453 (@pxref{Variable Attributes}).
3455 @item -Wunused-value
3456 @opindex Wunused-value
3457 @opindex Wno-unused-value
3458 Warn whenever a statement computes a result that is explicitly not
3459 used. To suppress this warning cast the unused expression to
3460 @samp{void}. This includes an expression-statement or the left-hand
3461 side of a comma expression that contains no side effects. For example,
3462 an expression such as @samp{x[i,j]} will cause a warning, while
3463 @samp{x[(void)i,j]} will not.
3465 This warning is enabled by @option{-Wall}.
3467 @item -Wunused
3468 @opindex Wunused
3469 @opindex Wno-unused
3470 All the above @option{-Wunused} options combined.
3472 In order to get a warning about an unused function parameter, you must
3473 either specify @samp{-Wextra -Wunused} (note that @samp{-Wall} implies
3474 @samp{-Wunused}), or separately specify @option{-Wunused-parameter}.
3476 @item -Wuninitialized
3477 @opindex Wuninitialized
3478 @opindex Wno-uninitialized
3479 Warn if an automatic variable is used without first being initialized
3480 or if a variable may be clobbered by a @code{setjmp} call. In C++,
3481 warn if a non-static reference or non-static @samp{const} member
3482 appears in a class without constructors.
3484 If you want to warn about code which uses the uninitialized value of the
3485 variable in its own initializer, use the @option{-Winit-self} option.
3487 These warnings occur for individual uninitialized or clobbered
3488 elements of structure, union or array variables as well as for
3489 variables which are uninitialized or clobbered as a whole.  They do
3490 not occur for variables or elements declared @code{volatile}.  Because
3491 these warnings depend on optimization, the exact variables or elements
3492 for which there are warnings will depend on the precise optimization
3493 options and version of GCC used.
3495 Note that there may be no warning about a variable that is used only
3496 to compute a value that itself is never used, because such
3497 computations may be deleted by data flow analysis before the warnings
3498 are printed.
3500 These warnings are made optional because GCC is not smart
3501 enough to see all the reasons why the code might be correct
3502 despite appearing to have an error.  Here is one example of how
3503 this can happen:
3505 @smallexample
3506 @group
3508   int x;
3509   switch (y)
3510     @{
3511     case 1: x = 1;
3512       break;
3513     case 2: x = 4;
3514       break;
3515     case 3: x = 5;
3516     @}
3517   foo (x);
3519 @end group
3520 @end smallexample
3522 @noindent
3523 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
3524 always initialized, but GCC doesn't know this.  Here is
3525 another common case:
3527 @smallexample
3529   int save_y;
3530   if (change_y) save_y = y, y = new_y;
3531   @dots{}
3532   if (change_y) y = save_y;
3534 @end smallexample
3536 @noindent
3537 This has no bug because @code{save_y} is used only if it is set.
3539 @cindex @code{longjmp} warnings
3540 This option also warns when a non-volatile automatic variable might be
3541 changed by a call to @code{longjmp}.  These warnings as well are possible
3542 only in optimizing compilation.
3544 The compiler sees only the calls to @code{setjmp}.  It cannot know
3545 where @code{longjmp} will be called; in fact, a signal handler could
3546 call it at any point in the code.  As a result, you may get a warning
3547 even when there is in fact no problem because @code{longjmp} cannot
3548 in fact be called at the place which would cause a problem.
3550 Some spurious warnings can be avoided if you declare all the functions
3551 you use that never return as @code{noreturn}.  @xref{Function
3552 Attributes}.
3554 This warning is enabled by @option{-Wall} or @option{-Wextra}.
3556 @item -Wunknown-pragmas
3557 @opindex Wunknown-pragmas
3558 @opindex Wno-unknown-pragmas
3559 @cindex warning for unknown pragmas
3560 @cindex unknown pragmas, warning
3561 @cindex pragmas, warning of unknown
3562 Warn when a #pragma directive is encountered which is not understood by
3563 GCC@.  If this command line option is used, warnings will even be issued
3564 for unknown pragmas in system header files.  This is not the case if
3565 the warnings were only enabled by the @option{-Wall} command line option.
3567 @item -Wno-pragmas
3568 @opindex Wno-pragmas
3569 @opindex Wpragmas
3570 Do not warn about misuses of pragmas, such as incorrect parameters,
3571 invalid syntax, or conflicts between pragmas.  See also
3572 @samp{-Wunknown-pragmas}.
3574 @item -Wstrict-aliasing
3575 @opindex Wstrict-aliasing
3576 @opindex Wno-strict-aliasing
3577 This option is only active when @option{-fstrict-aliasing} is active.
3578 It warns about code which might break the strict aliasing rules that the
3579 compiler is using for optimization.  The warning does not catch all
3580 cases, but does attempt to catch the more common pitfalls.  It is
3581 included in @option{-Wall}.
3582 It is equivalent to @option{-Wstrict-aliasing=3}
3584 @item -Wstrict-aliasing=n
3585 @opindex Wstrict-aliasing=n
3586 @opindex Wno-strict-aliasing=n
3587 This option is only active when @option{-fstrict-aliasing} is active.
3588 It warns about code which might break the strict aliasing rules that the
3589 compiler is using for optimization.
3590 Higher levels correspond to higher accuracy (fewer false positives).
3591 Higher levels also correspond to more effort, similar to the way -O works.
3592 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=n},
3593 with n=3.
3595 Level 1: Most aggressive, quick, least accurate.
3596 Possibly useful when higher levels
3597 do not warn but -fstrict-aliasing still breaks the code, as it has very few
3598 false negatives.  However, it has many false positives.
3599 Warns for all pointer conversions between possibly incompatible types,
3600 even if never dereferenced.  Runs in the frontend only.
3602 Level 2: Aggressive, quick, not too precise.
3603 May still have many false positives (not as many as level 1 though),
3604 and few false negatives (but possibly more than level 1).
3605 Unlike level 1, it only warns when an address is taken.  Warns about
3606 incomplete types.  Runs in the frontend only.
3608 Level 3 (default for @option{-Wstrict-aliasing}):
3609 Should have very few false positives and few false
3610 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
3611 Takes care of the common pun+dereference pattern in the frontend:
3612 @code{*(int*)&some_float}.
3613 If optimization is enabled, it also runs in the backend, where it deals
3614 with multiple statement cases using flow-sensitive points-to information.
3615 Only warns when the converted pointer is dereferenced.
3616 Does not warn about incomplete types.
3618 @item -Wstrict-overflow
3619 @itemx -Wstrict-overflow=@var{n}
3620 @opindex Wstrict-overflow
3621 @opindex Wno-strict-overflow
3622 This option is only active when @option{-fstrict-overflow} is active.
3623 It warns about cases where the compiler optimizes based on the
3624 assumption that signed overflow does not occur.  Note that it does not
3625 warn about all cases where the code might overflow: it only warns
3626 about cases where the compiler implements some optimization.  Thus
3627 this warning depends on the optimization level.
3629 An optimization which assumes that signed overflow does not occur is
3630 perfectly safe if the values of the variables involved are such that
3631 overflow never does, in fact, occur.  Therefore this warning can
3632 easily give a false positive: a warning about code which is not
3633 actually a problem.  To help focus on important issues, several
3634 warning levels are defined.  No warnings are issued for the use of
3635 undefined signed overflow when estimating how many iterations a loop
3636 will require, in particular when determining whether a loop will be
3637 executed at all.
3639 @table @gcctabopt
3640 @item -Wstrict-overflow=1
3641 Warn about cases which are both questionable and easy to avoid.  For
3642 example: @code{x + 1 > x}; with @option{-fstrict-overflow}, the
3643 compiler will simplify this to @code{1}.  This level of
3644 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
3645 are not, and must be explicitly requested.
3647 @item -Wstrict-overflow=2
3648 Also warn about other cases where a comparison is simplified to a
3649 constant.  For example: @code{abs (x) >= 0}.  This can only be
3650 simplified when @option{-fstrict-overflow} is in effect, because
3651 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
3652 zero.  @option{-Wstrict-overflow} (with no level) is the same as
3653 @option{-Wstrict-overflow=2}.
3655 @item -Wstrict-overflow=3
3656 Also warn about other cases where a comparison is simplified.  For
3657 example: @code{x + 1 > 1} will be simplified to @code{x > 0}.
3659 @item -Wstrict-overflow=4
3660 Also warn about other simplifications not covered by the above cases.
3661 For example: @code{(x * 10) / 5} will be simplified to @code{x * 2}.
3663 @item -Wstrict-overflow=5
3664 Also warn about cases where the compiler reduces the magnitude of a
3665 constant involved in a comparison.  For example: @code{x + 2 > y} will
3666 be simplified to @code{x + 1 >= y}.  This is reported only at the
3667 highest warning level because this simplification applies to many
3668 comparisons, so this warning level will give a very large number of
3669 false positives.
3670 @end table
3672 @item -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{]}
3673 @opindex Wsuggest-attribute=
3674 @opindex Wno-suggest-attribute=
3675 Warn for cases where adding an attribute may be beneficial. The
3676 attributes currently supported are listed below.
3678 @table @gcctabopt
3679 @item -Wsuggest-attribute=pure
3680 @itemx -Wsuggest-attribute=const
3681 @itemx -Wsuggest-attribute=noreturn
3682 @opindex Wsuggest-attribute=pure
3683 @opindex Wno-suggest-attribute=pure
3684 @opindex Wsuggest-attribute=const
3685 @opindex Wno-suggest-attribute=const
3686 @opindex Wsuggest-attribute=noreturn
3687 @opindex Wno-suggest-attribute=noreturn
3689 Warn about functions which might be candidates for attributes
3690 @code{pure}, @code{const} or @code{noreturn}.  The compiler only warns for
3691 functions visible in other compilation units or (in the case of @code{pure} and
3692 @code{const}) if it cannot prove that the function returns normally. A function
3693 returns normally if it doesn't contain an infinite loop nor returns abnormally
3694 by throwing, calling @code{abort()} or trapping.  This analysis requires option
3695 @option{-fipa-pure-const}, which is enabled by default at @option{-O} and
3696 higher.  Higher optimization levels improve the accuracy of the analysis.
3697 @end table
3699 @item -Warray-bounds
3700 @opindex Wno-array-bounds
3701 @opindex Warray-bounds
3702 This option is only active when @option{-ftree-vrp} is active
3703 (default for @option{-O2} and above). It warns about subscripts to arrays
3704 that are always out of bounds. This warning is enabled by @option{-Wall}.
3706 @item -Wno-div-by-zero
3707 @opindex Wno-div-by-zero
3708 @opindex Wdiv-by-zero
3709 Do not warn about compile-time integer division by zero.  Floating point
3710 division by zero is not warned about, as it can be a legitimate way of
3711 obtaining infinities and NaNs.
3713 @item -Wsystem-headers
3714 @opindex Wsystem-headers
3715 @opindex Wno-system-headers
3716 @cindex warnings from system headers
3717 @cindex system headers, warnings from
3718 Print warning messages for constructs found in system header files.
3719 Warnings from system headers are normally suppressed, on the assumption
3720 that they usually do not indicate real problems and would only make the
3721 compiler output harder to read.  Using this command line option tells
3722 GCC to emit warnings from system headers as if they occurred in user
3723 code.  However, note that using @option{-Wall} in conjunction with this
3724 option will @emph{not} warn about unknown pragmas in system
3725 headers---for that, @option{-Wunknown-pragmas} must also be used.
3727 @item -Wfloat-equal
3728 @opindex Wfloat-equal
3729 @opindex Wno-float-equal
3730 Warn if floating point values are used in equality comparisons.
3732 The idea behind this is that sometimes it is convenient (for the
3733 programmer) to consider floating-point values as approximations to
3734 infinitely precise real numbers.  If you are doing this, then you need
3735 to compute (by analyzing the code, or in some other way) the maximum or
3736 likely maximum error that the computation introduces, and allow for it
3737 when performing comparisons (and when producing output, but that's a
3738 different problem).  In particular, instead of testing for equality, you
3739 would check to see whether the two values have ranges that overlap; and
3740 this is done with the relational operators, so equality comparisons are
3741 probably mistaken.
3743 @item -Wtraditional @r{(C and Objective-C only)}
3744 @opindex Wtraditional
3745 @opindex Wno-traditional
3746 Warn about certain constructs that behave differently in traditional and
3747 ISO C@.  Also warn about ISO C constructs that have no traditional C
3748 equivalent, and/or problematic constructs which should be avoided.
3750 @itemize @bullet
3751 @item
3752 Macro parameters that appear within string literals in the macro body.
3753 In traditional C macro replacement takes place within string literals,
3754 but does not in ISO C@.
3756 @item
3757 In traditional C, some preprocessor directives did not exist.
3758 Traditional preprocessors would only consider a line to be a directive
3759 if the @samp{#} appeared in column 1 on the line.  Therefore
3760 @option{-Wtraditional} warns about directives that traditional C
3761 understands but would ignore because the @samp{#} does not appear as the
3762 first character on the line.  It also suggests you hide directives like
3763 @samp{#pragma} not understood by traditional C by indenting them.  Some
3764 traditional implementations would not recognize @samp{#elif}, so it
3765 suggests avoiding it altogether.
3767 @item
3768 A function-like macro that appears without arguments.
3770 @item
3771 The unary plus operator.
3773 @item
3774 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating point
3775 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
3776 constants.)  Note, these suffixes appear in macros defined in the system
3777 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
3778 Use of these macros in user code might normally lead to spurious
3779 warnings, however GCC's integrated preprocessor has enough context to
3780 avoid warning in these cases.
3782 @item
3783 A function declared external in one block and then used after the end of
3784 the block.
3786 @item
3787 A @code{switch} statement has an operand of type @code{long}.
3789 @item
3790 A non-@code{static} function declaration follows a @code{static} one.
3791 This construct is not accepted by some traditional C compilers.
3793 @item
3794 The ISO type of an integer constant has a different width or
3795 signedness from its traditional type.  This warning is only issued if
3796 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
3797 typically represent bit patterns, are not warned about.
3799 @item
3800 Usage of ISO string concatenation is detected.
3802 @item
3803 Initialization of automatic aggregates.
3805 @item
3806 Identifier conflicts with labels.  Traditional C lacks a separate
3807 namespace for labels.
3809 @item
3810 Initialization of unions.  If the initializer is zero, the warning is
3811 omitted.  This is done under the assumption that the zero initializer in
3812 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
3813 initializer warnings and relies on default initialization to zero in the
3814 traditional C case.
3816 @item
3817 Conversions by prototypes between fixed/floating point values and vice
3818 versa.  The absence of these prototypes when compiling with traditional
3819 C would cause serious problems.  This is a subset of the possible
3820 conversion warnings, for the full set use @option{-Wtraditional-conversion}.
3822 @item
3823 Use of ISO C style function definitions.  This warning intentionally is
3824 @emph{not} issued for prototype declarations or variadic functions
3825 because these ISO C features will appear in your code when using
3826 libiberty's traditional C compatibility macros, @code{PARAMS} and
3827 @code{VPARAMS}.  This warning is also bypassed for nested functions
3828 because that feature is already a GCC extension and thus not relevant to
3829 traditional C compatibility.
3830 @end itemize
3832 @item -Wtraditional-conversion @r{(C and Objective-C only)}
3833 @opindex Wtraditional-conversion
3834 @opindex Wno-traditional-conversion
3835 Warn if a prototype causes a type conversion that is different from what
3836 would happen to the same argument in the absence of a prototype.  This
3837 includes conversions of fixed point to floating and vice versa, and
3838 conversions changing the width or signedness of a fixed point argument
3839 except when the same as the default promotion.
3841 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
3842 @opindex Wdeclaration-after-statement
3843 @opindex Wno-declaration-after-statement
3844 Warn when a declaration is found after a statement in a block.  This
3845 construct, known from C++, was introduced with ISO C99 and is by default
3846 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
3847 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
3849 @item -Wundef
3850 @opindex Wundef
3851 @opindex Wno-undef
3852 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
3854 @item -Wno-endif-labels
3855 @opindex Wno-endif-labels
3856 @opindex Wendif-labels
3857 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
3859 @item -Wshadow
3860 @opindex Wshadow
3861 @opindex Wno-shadow
3862 Warn whenever a local variable or type declaration shadows another variable,
3863 parameter, type, or class member (in C++), or whenever a built-in function
3864 is shadowed. Note that in C++, the compiler will not warn if a local variable
3865 shadows a struct/class/enum, but will warn if it shadows an explicit typedef.
3867 @item -Wlarger-than=@var{len}
3868 @opindex Wlarger-than=@var{len}
3869 @opindex Wlarger-than-@var{len}
3870 Warn whenever an object of larger than @var{len} bytes is defined.
3872 @item -Wframe-larger-than=@var{len}
3873 @opindex Wframe-larger-than
3874 Warn if the size of a function frame is larger than @var{len} bytes.
3875 The computation done to determine the stack frame size is approximate
3876 and not conservative.
3877 The actual requirements may be somewhat greater than @var{len}
3878 even if you do not get a warning.  In addition, any space allocated
3879 via @code{alloca}, variable-length arrays, or related constructs
3880 is not included by the compiler when determining
3881 whether or not to issue a warning.
3883 @item -Wunsafe-loop-optimizations
3884 @opindex Wunsafe-loop-optimizations
3885 @opindex Wno-unsafe-loop-optimizations
3886 Warn if the loop cannot be optimized because the compiler could not
3887 assume anything on the bounds of the loop indices.  With
3888 @option{-funsafe-loop-optimizations} warn if the compiler made
3889 such assumptions.
3891 @item -Wno-pedantic-ms-format @r{(MinGW targets only)}
3892 @opindex Wno-pedantic-ms-format
3893 @opindex Wpedantic-ms-format
3894 Disables the warnings about non-ISO @code{printf} / @code{scanf} format
3895 width specifiers @code{I32}, @code{I64}, and @code{I} used on Windows targets
3896 depending on the MS runtime, when you are using the options @option{-Wformat}
3897 and @option{-pedantic} without gnu-extensions.
3899 @item -Wpointer-arith
3900 @opindex Wpointer-arith
3901 @opindex Wno-pointer-arith
3902 Warn about anything that depends on the ``size of'' a function type or
3903 of @code{void}.  GNU C assigns these types a size of 1, for
3904 convenience in calculations with @code{void *} pointers and pointers
3905 to functions.  In C++, warn also when an arithmetic operation involves
3906 @code{NULL}.  This warning is also enabled by @option{-pedantic}.
3908 @item -Wtype-limits
3909 @opindex Wtype-limits
3910 @opindex Wno-type-limits
3911 Warn if a comparison is always true or always false due to the limited
3912 range of the data type, but do not warn for constant expressions.  For
3913 example, warn if an unsigned variable is compared against zero with
3914 @samp{<} or @samp{>=}.  This warning is also enabled by
3915 @option{-Wextra}.
3917 @item -Wbad-function-cast @r{(C and Objective-C only)}
3918 @opindex Wbad-function-cast
3919 @opindex Wno-bad-function-cast
3920 Warn whenever a function call is cast to a non-matching type.
3921 For example, warn if @code{int malloc()} is cast to @code{anything *}.
3923 @item -Wc++-compat @r{(C and Objective-C only)}
3924 Warn about ISO C constructs that are outside of the common subset of
3925 ISO C and ISO C++, e.g.@: request for implicit conversion from
3926 @code{void *} to a pointer to non-@code{void} type.
3928 @item -Wc++0x-compat @r{(C++ and Objective-C++ only)}
3929 Warn about C++ constructs whose meaning differs between ISO C++ 1998 and
3930 ISO C++ 200x, e.g., identifiers in ISO C++ 1998 that will become keywords
3931 in ISO C++ 200x.  This warning is enabled by @option{-Wall}.
3933 @item -Wcast-qual
3934 @opindex Wcast-qual
3935 @opindex Wno-cast-qual
3936 Warn whenever a pointer is cast so as to remove a type qualifier from
3937 the target type.  For example, warn if a @code{const char *} is cast
3938 to an ordinary @code{char *}.
3940 Also warn when making a cast which introduces a type qualifier in an
3941 unsafe way.  For example, casting @code{char **} to @code{const char **}
3942 is unsafe, as in this example:
3944 @smallexample
3945   /* p is char ** value.  */
3946   const char **q = (const char **) p;
3947   /* Assignment of readonly string to const char * is OK.  */
3948   *q = "string";
3949   /* Now char** pointer points to read-only memory.  */
3950   **p = 'b';
3951 @end smallexample
3953 @item -Wcast-align
3954 @opindex Wcast-align
3955 @opindex Wno-cast-align
3956 Warn whenever a pointer is cast such that the required alignment of the
3957 target is increased.  For example, warn if a @code{char *} is cast to
3958 an @code{int *} on machines where integers can only be accessed at
3959 two- or four-byte boundaries.
3961 @item -Wwrite-strings
3962 @opindex Wwrite-strings
3963 @opindex Wno-write-strings
3964 When compiling C, give string constants the type @code{const
3965 char[@var{length}]} so that copying the address of one into a
3966 non-@code{const} @code{char *} pointer will get a warning.  These
3967 warnings will help you find at compile time code that can try to write
3968 into a string constant, but only if you have been very careful about
3969 using @code{const} in declarations and prototypes.  Otherwise, it will
3970 just be a nuisance. This is why we did not make @option{-Wall} request
3971 these warnings.
3973 When compiling C++, warn about the deprecated conversion from string
3974 literals to @code{char *}.  This warning is enabled by default for C++
3975 programs.
3977 @item -Wclobbered
3978 @opindex Wclobbered
3979 @opindex Wno-clobbered
3980 Warn for variables that might be changed by @samp{longjmp} or
3981 @samp{vfork}.  This warning is also enabled by @option{-Wextra}.
3983 @item -Wconversion
3984 @opindex Wconversion
3985 @opindex Wno-conversion
3986 Warn for implicit conversions that may alter a value. This includes
3987 conversions between real and integer, like @code{abs (x)} when
3988 @code{x} is @code{double}; conversions between signed and unsigned,
3989 like @code{unsigned ui = -1}; and conversions to smaller types, like
3990 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
3991 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
3992 changed by the conversion like in @code{abs (2.0)}.  Warnings about
3993 conversions between signed and unsigned integers can be disabled by
3994 using @option{-Wno-sign-conversion}.
3996 For C++, also warn for confusing overload resolution for user-defined
3997 conversions; and conversions that will never use a type conversion
3998 operator: conversions to @code{void}, the same type, a base class or a
3999 reference to them. Warnings about conversions between signed and
4000 unsigned integers are disabled by default in C++ unless
4001 @option{-Wsign-conversion} is explicitly enabled.
4003 @item -Wno-conversion-null @r{(C++ and Objective-C++ only)}
4004 @opindex Wconversion-null
4005 @opindex Wno-conversion-null
4006 Do not warn for conversions between @code{NULL} and non-pointer
4007 types. @option{-Wconversion-null} is enabled by default.
4009 @item -Wempty-body
4010 @opindex Wempty-body
4011 @opindex Wno-empty-body
4012 Warn if an empty body occurs in an @samp{if}, @samp{else} or @samp{do
4013 while} statement.  This warning is also enabled by @option{-Wextra}.
4015 @item -Wenum-compare
4016 @opindex Wenum-compare
4017 @opindex Wno-enum-compare
4018 Warn about a comparison between values of different enum types. In C++
4019 this warning is enabled by default.  In C this warning is enabled by
4020 @option{-Wall}.
4022 @item -Wjump-misses-init @r{(C, Objective-C only)}
4023 @opindex Wjump-misses-init
4024 @opindex Wno-jump-misses-init
4025 Warn if a @code{goto} statement or a @code{switch} statement jumps
4026 forward across the initialization of a variable, or jumps backward to a
4027 label after the variable has been initialized.  This only warns about
4028 variables which are initialized when they are declared.  This warning is
4029 only supported for C and Objective C; in C++ this sort of branch is an
4030 error in any case.
4032 @option{-Wjump-misses-init} is included in @option{-Wc++-compat}.  It
4033 can be disabled with the @option{-Wno-jump-misses-init} option.
4035 @item -Wsign-compare
4036 @opindex Wsign-compare
4037 @opindex Wno-sign-compare
4038 @cindex warning for comparison of signed and unsigned values
4039 @cindex comparison of signed and unsigned values, warning
4040 @cindex signed and unsigned values, comparison warning
4041 Warn when a comparison between signed and unsigned values could produce
4042 an incorrect result when the signed value is converted to unsigned.
4043 This warning is also enabled by @option{-Wextra}; to get the other warnings
4044 of @option{-Wextra} without this warning, use @samp{-Wextra -Wno-sign-compare}.
4046 @item -Wsign-conversion
4047 @opindex Wsign-conversion
4048 @opindex Wno-sign-conversion
4049 Warn for implicit conversions that may change the sign of an integer
4050 value, like assigning a signed integer expression to an unsigned
4051 integer variable. An explicit cast silences the warning. In C, this
4052 option is enabled also by @option{-Wconversion}.
4054 @item -Waddress
4055 @opindex Waddress
4056 @opindex Wno-address
4057 Warn about suspicious uses of memory addresses. These include using
4058 the address of a function in a conditional expression, such as
4059 @code{void func(void); if (func)}, and comparisons against the memory
4060 address of a string literal, such as @code{if (x == "abc")}.  Such
4061 uses typically indicate a programmer error: the address of a function
4062 always evaluates to true, so their use in a conditional usually
4063 indicate that the programmer forgot the parentheses in a function
4064 call; and comparisons against string literals result in unspecified
4065 behavior and are not portable in C, so they usually indicate that the
4066 programmer intended to use @code{strcmp}.  This warning is enabled by
4067 @option{-Wall}.
4069 @item -Wlogical-op
4070 @opindex Wlogical-op
4071 @opindex Wno-logical-op
4072 Warn about suspicious uses of logical operators in expressions.
4073 This includes using logical operators in contexts where a
4074 bit-wise operator is likely to be expected.
4076 @item -Waggregate-return
4077 @opindex Waggregate-return
4078 @opindex Wno-aggregate-return
4079 Warn if any functions that return structures or unions are defined or
4080 called.  (In languages where you can return an array, this also elicits
4081 a warning.)
4083 @item -Wno-attributes
4084 @opindex Wno-attributes
4085 @opindex Wattributes
4086 Do not warn if an unexpected @code{__attribute__} is used, such as
4087 unrecognized attributes, function attributes applied to variables,
4088 etc.  This will not stop errors for incorrect use of supported
4089 attributes.
4091 @item -Wno-builtin-macro-redefined
4092 @opindex Wno-builtin-macro-redefined
4093 @opindex Wbuiltin-macro-redefined
4094 Do not warn if certain built-in macros are redefined.  This suppresses
4095 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
4096 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
4098 @item -Wstrict-prototypes @r{(C and Objective-C only)}
4099 @opindex Wstrict-prototypes
4100 @opindex Wno-strict-prototypes
4101 Warn if a function is declared or defined without specifying the
4102 argument types.  (An old-style function definition is permitted without
4103 a warning if preceded by a declaration which specifies the argument
4104 types.)
4106 @item -Wold-style-declaration @r{(C and Objective-C only)}
4107 @opindex Wold-style-declaration
4108 @opindex Wno-old-style-declaration
4109 Warn for obsolescent usages, according to the C Standard, in a
4110 declaration. For example, warn if storage-class specifiers like
4111 @code{static} are not the first things in a declaration.  This warning
4112 is also enabled by @option{-Wextra}.
4114 @item -Wold-style-definition @r{(C and Objective-C only)}
4115 @opindex Wold-style-definition
4116 @opindex Wno-old-style-definition
4117 Warn if an old-style function definition is used.  A warning is given
4118 even if there is a previous prototype.
4120 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
4121 @opindex Wmissing-parameter-type
4122 @opindex Wno-missing-parameter-type
4123 A function parameter is declared without a type specifier in K&R-style
4124 functions:
4126 @smallexample
4127 void foo(bar) @{ @}
4128 @end smallexample
4130 This warning is also enabled by @option{-Wextra}.
4132 @item -Wmissing-prototypes @r{(C and Objective-C only)}
4133 @opindex Wmissing-prototypes
4134 @opindex Wno-missing-prototypes
4135 Warn if a global function is defined without a previous prototype
4136 declaration.  This warning is issued even if the definition itself
4137 provides a prototype.  The aim is to detect global functions that fail
4138 to be declared in header files.
4140 @item -Wmissing-declarations
4141 @opindex Wmissing-declarations
4142 @opindex Wno-missing-declarations
4143 Warn if a global function is defined without a previous declaration.
4144 Do so even if the definition itself provides a prototype.
4145 Use this option to detect global functions that are not declared in
4146 header files.  In C++, no warnings are issued for function templates,
4147 or for inline functions, or for functions in anonymous namespaces.
4149 @item -Wmissing-field-initializers
4150 @opindex Wmissing-field-initializers
4151 @opindex Wno-missing-field-initializers
4152 @opindex W
4153 @opindex Wextra
4154 @opindex Wno-extra
4155 Warn if a structure's initializer has some fields missing.  For
4156 example, the following code would cause such a warning, because
4157 @code{x.h} is implicitly zero:
4159 @smallexample
4160 struct s @{ int f, g, h; @};
4161 struct s x = @{ 3, 4 @};
4162 @end smallexample
4164 This option does not warn about designated initializers, so the following
4165 modification would not trigger a warning:
4167 @smallexample
4168 struct s @{ int f, g, h; @};
4169 struct s x = @{ .f = 3, .g = 4 @};
4170 @end smallexample
4172 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
4173 warnings without this one, use @samp{-Wextra -Wno-missing-field-initializers}.
4175 @item -Wmissing-format-attribute
4176 @opindex Wmissing-format-attribute
4177 @opindex Wno-missing-format-attribute
4178 @opindex Wformat
4179 @opindex Wno-format
4180 Warn about function pointers which might be candidates for @code{format}
4181 attributes.  Note these are only possible candidates, not absolute ones.
4182 GCC will guess that function pointers with @code{format} attributes that
4183 are used in assignment, initialization, parameter passing or return
4184 statements should have a corresponding @code{format} attribute in the
4185 resulting type.  I.e.@: the left-hand side of the assignment or
4186 initialization, the type of the parameter variable, or the return type
4187 of the containing function respectively should also have a @code{format}
4188 attribute to avoid the warning.
4190 GCC will also warn about function definitions which might be
4191 candidates for @code{format} attributes.  Again, these are only
4192 possible candidates.  GCC will guess that @code{format} attributes
4193 might be appropriate for any function that calls a function like
4194 @code{vprintf} or @code{vscanf}, but this might not always be the
4195 case, and some functions for which @code{format} attributes are
4196 appropriate may not be detected.
4198 @item -Wno-multichar
4199 @opindex Wno-multichar
4200 @opindex Wmultichar
4201 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
4202 Usually they indicate a typo in the user's code, as they have
4203 implementation-defined values, and should not be used in portable code.
4205 @item -Wnormalized=<none|id|nfc|nfkc>
4206 @opindex Wnormalized=
4207 @cindex NFC
4208 @cindex NFKC
4209 @cindex character set, input normalization
4210 In ISO C and ISO C++, two identifiers are different if they are
4211 different sequences of characters.  However, sometimes when characters
4212 outside the basic ASCII character set are used, you can have two
4213 different character sequences that look the same.  To avoid confusion,
4214 the ISO 10646 standard sets out some @dfn{normalization rules} which
4215 when applied ensure that two sequences that look the same are turned into
4216 the same sequence.  GCC can warn you if you are using identifiers which
4217 have not been normalized; this option controls that warning.
4219 There are four levels of warning that GCC supports.  The default is
4220 @option{-Wnormalized=nfc}, which warns about any identifier which is
4221 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
4222 recommended form for most uses.
4224 Unfortunately, there are some characters which ISO C and ISO C++ allow
4225 in identifiers that when turned into NFC aren't allowable as
4226 identifiers.  That is, there's no way to use these symbols in portable
4227 ISO C or C++ and have all your identifiers in NFC@.
4228 @option{-Wnormalized=id} suppresses the warning for these characters.
4229 It is hoped that future versions of the standards involved will correct
4230 this, which is why this option is not the default.
4232 You can switch the warning off for all characters by writing
4233 @option{-Wnormalized=none}.  You would only want to do this if you
4234 were using some other normalization scheme (like ``D''), because
4235 otherwise you can easily create bugs that are literally impossible to see.
4237 Some characters in ISO 10646 have distinct meanings but look identical
4238 in some fonts or display methodologies, especially once formatting has
4239 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
4240 LETTER N'', will display just like a regular @code{n} which has been
4241 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
4242 normalization scheme to convert all these into a standard form as
4243 well, and GCC will warn if your code is not in NFKC if you use
4244 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
4245 about every identifier that contains the letter O because it might be
4246 confused with the digit 0, and so is not the default, but may be
4247 useful as a local coding convention if the programming environment is
4248 unable to be fixed to display these characters distinctly.
4250 @item -Wno-deprecated
4251 @opindex Wno-deprecated
4252 @opindex Wdeprecated
4253 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
4255 @item -Wno-deprecated-declarations
4256 @opindex Wno-deprecated-declarations
4257 @opindex Wdeprecated-declarations
4258 Do not warn about uses of functions (@pxref{Function Attributes}),
4259 variables (@pxref{Variable Attributes}), and types (@pxref{Type
4260 Attributes}) marked as deprecated by using the @code{deprecated}
4261 attribute.
4263 @item -Wno-overflow
4264 @opindex Wno-overflow
4265 @opindex Woverflow
4266 Do not warn about compile-time overflow in constant expressions.
4268 @item -Woverride-init @r{(C and Objective-C only)}
4269 @opindex Woverride-init
4270 @opindex Wno-override-init
4271 @opindex W
4272 @opindex Wextra
4273 @opindex Wno-extra
4274 Warn if an initialized field without side effects is overridden when
4275 using designated initializers (@pxref{Designated Inits, , Designated
4276 Initializers}).
4278 This warning is included in @option{-Wextra}.  To get other
4279 @option{-Wextra} warnings without this one, use @samp{-Wextra
4280 -Wno-override-init}.
4282 @item -Wpacked
4283 @opindex Wpacked
4284 @opindex Wno-packed
4285 Warn if a structure is given the packed attribute, but the packed
4286 attribute has no effect on the layout or size of the structure.
4287 Such structures may be mis-aligned for little benefit.  For
4288 instance, in this code, the variable @code{f.x} in @code{struct bar}
4289 will be misaligned even though @code{struct bar} does not itself
4290 have the packed attribute:
4292 @smallexample
4293 @group
4294 struct foo @{
4295   int x;
4296   char a, b, c, d;
4297 @} __attribute__((packed));
4298 struct bar @{
4299   char z;
4300   struct foo f;
4302 @end group
4303 @end smallexample
4305 @item -Wpacked-bitfield-compat
4306 @opindex Wpacked-bitfield-compat
4307 @opindex Wno-packed-bitfield-compat
4308 The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
4309 on bit-fields of type @code{char}.  This has been fixed in GCC 4.4 but
4310 the change can lead to differences in the structure layout.  GCC
4311 informs you when the offset of such a field has changed in GCC 4.4.
4312 For example there is no longer a 4-bit padding between field @code{a}
4313 and @code{b} in this structure:
4315 @smallexample
4316 struct foo
4318   char a:4;
4319   char b:8;
4320 @} __attribute__ ((packed));
4321 @end smallexample
4323 This warning is enabled by default.  Use
4324 @option{-Wno-packed-bitfield-compat} to disable this warning.
4326 @item -Wpadded
4327 @opindex Wpadded
4328 @opindex Wno-padded
4329 Warn if padding is included in a structure, either to align an element
4330 of the structure or to align the whole structure.  Sometimes when this
4331 happens it is possible to rearrange the fields of the structure to
4332 reduce the padding and so make the structure smaller.
4334 @item -Wredundant-decls
4335 @opindex Wredundant-decls
4336 @opindex Wno-redundant-decls
4337 Warn if anything is declared more than once in the same scope, even in
4338 cases where multiple declaration is valid and changes nothing.
4340 @item -Wnested-externs @r{(C and Objective-C only)}
4341 @opindex Wnested-externs
4342 @opindex Wno-nested-externs
4343 Warn if an @code{extern} declaration is encountered within a function.
4345 @item -Winline
4346 @opindex Winline
4347 @opindex Wno-inline
4348 Warn if a function can not be inlined and it was declared as inline.
4349 Even with this option, the compiler will not warn about failures to
4350 inline functions declared in system headers.
4352 The compiler uses a variety of heuristics to determine whether or not
4353 to inline a function.  For example, the compiler takes into account
4354 the size of the function being inlined and the amount of inlining
4355 that has already been done in the current function.  Therefore,
4356 seemingly insignificant changes in the source program can cause the
4357 warnings produced by @option{-Winline} to appear or disappear.
4359 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
4360 @opindex Wno-invalid-offsetof
4361 @opindex Winvalid-offsetof
4362 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
4363 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
4364 to a non-POD type is undefined.  In existing C++ implementations,
4365 however, @samp{offsetof} typically gives meaningful results even when
4366 applied to certain kinds of non-POD types. (Such as a simple
4367 @samp{struct} that fails to be a POD type only by virtue of having a
4368 constructor.)  This flag is for users who are aware that they are
4369 writing nonportable code and who have deliberately chosen to ignore the
4370 warning about it.
4372 The restrictions on @samp{offsetof} may be relaxed in a future version
4373 of the C++ standard.
4375 @item -Wno-int-to-pointer-cast
4376 @opindex Wno-int-to-pointer-cast
4377 @opindex Wint-to-pointer-cast
4378 Suppress warnings from casts to pointer type of an integer of a
4379 different size. In C++, casting to a pointer type of smaller size is
4380 an error. @option{Wint-to-pointer-cast} is enabled by default.
4383 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
4384 @opindex Wno-pointer-to-int-cast
4385 @opindex Wpointer-to-int-cast
4386 Suppress warnings from casts from a pointer to an integer type of a
4387 different size.
4389 @item -Winvalid-pch
4390 @opindex Winvalid-pch
4391 @opindex Wno-invalid-pch
4392 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
4393 the search path but can't be used.
4395 @item -Wlong-long
4396 @opindex Wlong-long
4397 @opindex Wno-long-long
4398 Warn if @samp{long long} type is used.  This is enabled by either
4399 @option{-pedantic} or @option{-Wtraditional} in ISO C90 and C++98
4400 modes.  To inhibit the warning messages, use @option{-Wno-long-long}.
4402 @item -Wvariadic-macros
4403 @opindex Wvariadic-macros
4404 @opindex Wno-variadic-macros
4405 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
4406 alternate syntax when in pedantic ISO C99 mode.  This is default.
4407 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
4409 @item -Wvla
4410 @opindex Wvla
4411 @opindex Wno-vla
4412 Warn if variable length array is used in the code.
4413 @option{-Wno-vla} will prevent the @option{-pedantic} warning of
4414 the variable length array.
4416 @item -Wvolatile-register-var
4417 @opindex Wvolatile-register-var
4418 @opindex Wno-volatile-register-var
4419 Warn if a register variable is declared volatile.  The volatile
4420 modifier does not inhibit all optimizations that may eliminate reads
4421 and/or writes to register variables.  This warning is enabled by
4422 @option{-Wall}.
4424 @item -Wdisabled-optimization
4425 @opindex Wdisabled-optimization
4426 @opindex Wno-disabled-optimization
4427 Warn if a requested optimization pass is disabled.  This warning does
4428 not generally indicate that there is anything wrong with your code; it
4429 merely indicates that GCC's optimizers were unable to handle the code
4430 effectively.  Often, the problem is that your code is too big or too
4431 complex; GCC will refuse to optimize programs when the optimization
4432 itself is likely to take inordinate amounts of time.
4434 @item -Wpointer-sign @r{(C and Objective-C only)}
4435 @opindex Wpointer-sign
4436 @opindex Wno-pointer-sign
4437 Warn for pointer argument passing or assignment with different signedness.
4438 This option is only supported for C and Objective-C@.  It is implied by
4439 @option{-Wall} and by @option{-pedantic}, which can be disabled with
4440 @option{-Wno-pointer-sign}.
4442 @item -Wstack-protector
4443 @opindex Wstack-protector
4444 @opindex Wno-stack-protector
4445 This option is only active when @option{-fstack-protector} is active.  It
4446 warns about functions that will not be protected against stack smashing.
4448 @item -Wno-mudflap
4449 @opindex Wno-mudflap
4450 Suppress warnings about constructs that cannot be instrumented by
4451 @option{-fmudflap}.
4453 @item -Woverlength-strings
4454 @opindex Woverlength-strings
4455 @opindex Wno-overlength-strings
4456 Warn about string constants which are longer than the ``minimum
4457 maximum'' length specified in the C standard.  Modern compilers
4458 generally allow string constants which are much longer than the
4459 standard's minimum limit, but very portable programs should avoid
4460 using longer strings.
4462 The limit applies @emph{after} string constant concatenation, and does
4463 not count the trailing NUL@.  In C90, the limit was 509 characters; in
4464 C99, it was raised to 4095.  C++98 does not specify a normative
4465 minimum maximum, so we do not diagnose overlength strings in C++@.
4467 This option is implied by @option{-pedantic}, and can be disabled with
4468 @option{-Wno-overlength-strings}.
4470 @item -Wunsuffixed-float-constants @r{(C and Objective-C only)}
4471 @opindex Wunsuffixed-float-constants
4473 GCC will issue a warning for any floating constant that does not have
4474 a suffix.  When used together with @option{-Wsystem-headers} it will
4475 warn about such constants in system header files.  This can be useful
4476 when preparing code to use with the @code{FLOAT_CONST_DECIMAL64} pragma
4477 from the decimal floating-point extension to C99.
4478 @end table
4480 @node Debugging Options
4481 @section Options for Debugging Your Program or GCC
4482 @cindex options, debugging
4483 @cindex debugging information options
4485 GCC has various special options that are used for debugging
4486 either your program or GCC:
4488 @table @gcctabopt
4489 @item -g
4490 @opindex g
4491 Produce debugging information in the operating system's native format
4492 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
4493 information.
4495 On most systems that use stabs format, @option{-g} enables use of extra
4496 debugging information that only GDB can use; this extra information
4497 makes debugging work better in GDB but will probably make other debuggers
4498 crash or
4499 refuse to read the program.  If you want to control for certain whether
4500 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
4501 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
4503 GCC allows you to use @option{-g} with
4504 @option{-O}.  The shortcuts taken by optimized code may occasionally
4505 produce surprising results: some variables you declared may not exist
4506 at all; flow of control may briefly move where you did not expect it;
4507 some statements may not be executed because they compute constant
4508 results or their values were already at hand; some statements may
4509 execute in different places because they were moved out of loops.
4511 Nevertheless it proves possible to debug optimized output.  This makes
4512 it reasonable to use the optimizer for programs that might have bugs.
4514 The following options are useful when GCC is generated with the
4515 capability for more than one debugging format.
4517 @item -ggdb
4518 @opindex ggdb
4519 Produce debugging information for use by GDB@.  This means to use the
4520 most expressive format available (DWARF 2, stabs, or the native format
4521 if neither of those are supported), including GDB extensions if at all
4522 possible.
4524 @item -gstabs
4525 @opindex gstabs
4526 Produce debugging information in stabs format (if that is supported),
4527 without GDB extensions.  This is the format used by DBX on most BSD
4528 systems.  On MIPS, Alpha and System V Release 4 systems this option
4529 produces stabs debugging output which is not understood by DBX or SDB@.
4530 On System V Release 4 systems this option requires the GNU assembler.
4532 @item -feliminate-unused-debug-symbols
4533 @opindex feliminate-unused-debug-symbols
4534 Produce debugging information in stabs format (if that is supported),
4535 for only symbols that are actually used.
4537 @item -femit-class-debug-always
4538 Instead of emitting debugging information for a C++ class in only one
4539 object file, emit it in all object files using the class.  This option
4540 should be used only with debuggers that are unable to handle the way GCC
4541 normally emits debugging information for classes because using this
4542 option will increase the size of debugging information by as much as a
4543 factor of two.
4545 @item -gstabs+
4546 @opindex gstabs+
4547 Produce debugging information in stabs format (if that is supported),
4548 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4549 use of these extensions is likely to make other debuggers crash or
4550 refuse to read the program.
4552 @item -gcoff
4553 @opindex gcoff
4554 Produce debugging information in COFF format (if that is supported).
4555 This is the format used by SDB on most System V systems prior to
4556 System V Release 4.
4558 @item -gxcoff
4559 @opindex gxcoff
4560 Produce debugging information in XCOFF format (if that is supported).
4561 This is the format used by the DBX debugger on IBM RS/6000 systems.
4563 @item -gxcoff+
4564 @opindex gxcoff+
4565 Produce debugging information in XCOFF format (if that is supported),
4566 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4567 use of these extensions is likely to make other debuggers crash or
4568 refuse to read the program, and may cause assemblers other than the GNU
4569 assembler (GAS) to fail with an error.
4571 @item -gdwarf-@var{version}
4572 @opindex gdwarf-@var{version}
4573 Produce debugging information in DWARF format (if that is
4574 supported).  This is the format used by DBX on IRIX 6.  The value
4575 of @var{version} may be either 2, 3 or 4; the default version is 2.
4577 Note that with DWARF version 2 some ports require, and will always
4578 use, some non-conflicting DWARF 3 extensions in the unwind tables.
4580 Version 4 may require GDB 7.0 and @option{-fvar-tracking-assignments}
4581 for maximum benefit.
4583 @item -gstrict-dwarf
4584 @opindex gstrict-dwarf
4585 Disallow using extensions of later DWARF standard version than selected
4586 with @option{-gdwarf-@var{version}}.  On most targets using non-conflicting
4587 DWARF extensions from later standard versions is allowed.
4589 @item -gno-strict-dwarf
4590 @opindex gno-strict-dwarf
4591 Allow using extensions of later DWARF standard version than selected with
4592 @option{-gdwarf-@var{version}}.
4594 @item -gvms
4595 @opindex gvms
4596 Produce debugging information in VMS debug format (if that is
4597 supported).  This is the format used by DEBUG on VMS systems.
4599 @item -g@var{level}
4600 @itemx -ggdb@var{level}
4601 @itemx -gstabs@var{level}
4602 @itemx -gcoff@var{level}
4603 @itemx -gxcoff@var{level}
4604 @itemx -gvms@var{level}
4605 Request debugging information and also use @var{level} to specify how
4606 much information.  The default level is 2.
4608 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
4609 @option{-g}.
4611 Level 1 produces minimal information, enough for making backtraces in
4612 parts of the program that you don't plan to debug.  This includes
4613 descriptions of functions and external variables, but no information
4614 about local variables and no line numbers.
4616 Level 3 includes extra information, such as all the macro definitions
4617 present in the program.  Some debuggers support macro expansion when
4618 you use @option{-g3}.
4620 @option{-gdwarf-2} does not accept a concatenated debug level, because
4621 GCC used to support an option @option{-gdwarf} that meant to generate
4622 debug information in version 1 of the DWARF format (which is very
4623 different from version 2), and it would have been too confusing.  That
4624 debug format is long obsolete, but the option cannot be changed now.
4625 Instead use an additional @option{-g@var{level}} option to change the
4626 debug level for DWARF.
4628 @item -gtoggle
4629 @opindex gtoggle
4630 Turn off generation of debug info, if leaving out this option would have
4631 generated it, or turn it on at level 2 otherwise.  The position of this
4632 argument in the command line does not matter, it takes effect after all
4633 other options are processed, and it does so only once, no matter how
4634 many times it is given.  This is mainly intended to be used with
4635 @option{-fcompare-debug}.
4637 @item -fdump-final-insns@r{[}=@var{file}@r{]}
4638 @opindex fdump-final-insns
4639 Dump the final internal representation (RTL) to @var{file}.  If the
4640 optional argument is omitted (or if @var{file} is @code{.}), the name
4641 of the dump file will be determined by appending @code{.gkd} to the
4642 compilation output file name.
4644 @item -fcompare-debug@r{[}=@var{opts}@r{]}
4645 @opindex fcompare-debug
4646 @opindex fno-compare-debug
4647 If no error occurs during compilation, run the compiler a second time,
4648 adding @var{opts} and @option{-fcompare-debug-second} to the arguments
4649 passed to the second compilation.  Dump the final internal
4650 representation in both compilations, and print an error if they differ.
4652 If the equal sign is omitted, the default @option{-gtoggle} is used.
4654 The environment variable @env{GCC_COMPARE_DEBUG}, if defined, non-empty
4655 and nonzero, implicitly enables @option{-fcompare-debug}.  If
4656 @env{GCC_COMPARE_DEBUG} is defined to a string starting with a dash,
4657 then it is used for @var{opts}, otherwise the default @option{-gtoggle}
4658 is used.
4660 @option{-fcompare-debug=}, with the equal sign but without @var{opts},
4661 is equivalent to @option{-fno-compare-debug}, which disables the dumping
4662 of the final representation and the second compilation, preventing even
4663 @env{GCC_COMPARE_DEBUG} from taking effect.
4665 To verify full coverage during @option{-fcompare-debug} testing, set
4666 @env{GCC_COMPARE_DEBUG} to say @samp{-fcompare-debug-not-overridden},
4667 which GCC will reject as an invalid option in any actual compilation
4668 (rather than preprocessing, assembly or linking).  To get just a
4669 warning, setting @env{GCC_COMPARE_DEBUG} to @samp{-w%n-fcompare-debug
4670 not overridden} will do.
4672 @item -fcompare-debug-second
4673 @opindex fcompare-debug-second
4674 This option is implicitly passed to the compiler for the second
4675 compilation requested by @option{-fcompare-debug}, along with options to
4676 silence warnings, and omitting other options that would cause
4677 side-effect compiler outputs to files or to the standard output.  Dump
4678 files and preserved temporary files are renamed so as to contain the
4679 @code{.gk} additional extension during the second compilation, to avoid
4680 overwriting those generated by the first.
4682 When this option is passed to the compiler driver, it causes the
4683 @emph{first} compilation to be skipped, which makes it useful for little
4684 other than debugging the compiler proper.
4686 @item -feliminate-dwarf2-dups
4687 @opindex feliminate-dwarf2-dups
4688 Compress DWARF2 debugging information by eliminating duplicated
4689 information about each symbol.  This option only makes sense when
4690 generating DWARF2 debugging information with @option{-gdwarf-2}.
4692 @item -femit-struct-debug-baseonly
4693 Emit debug information for struct-like types
4694 only when the base name of the compilation source file
4695 matches the base name of file in which the struct was defined.
4697 This option substantially reduces the size of debugging information,
4698 but at significant potential loss in type information to the debugger.
4699 See @option{-femit-struct-debug-reduced} for a less aggressive option.
4700 See @option{-femit-struct-debug-detailed} for more detailed control.
4702 This option works only with DWARF 2.
4704 @item -femit-struct-debug-reduced
4705 Emit debug information for struct-like types
4706 only when the base name of the compilation source file
4707 matches the base name of file in which the type was defined,
4708 unless the struct is a template or defined in a system header.
4710 This option significantly reduces the size of debugging information,
4711 with some potential loss in type information to the debugger.
4712 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
4713 See @option{-femit-struct-debug-detailed} for more detailed control.
4715 This option works only with DWARF 2.
4717 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
4718 Specify the struct-like types
4719 for which the compiler will generate debug information.
4720 The intent is to reduce duplicate struct debug information
4721 between different object files within the same program.
4723 This option is a detailed version of
4724 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
4725 which will serve for most needs.
4727 A specification has the syntax
4728 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
4730 The optional first word limits the specification to
4731 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
4732 A struct type is used directly when it is the type of a variable, member.
4733 Indirect uses arise through pointers to structs.
4734 That is, when use of an incomplete struct would be legal, the use is indirect.
4735 An example is
4736 @samp{struct one direct; struct two * indirect;}.
4738 The optional second word limits the specification to
4739 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
4740 Generic structs are a bit complicated to explain.
4741 For C++, these are non-explicit specializations of template classes,
4742 or non-template classes within the above.
4743 Other programming languages have generics,
4744 but @samp{-femit-struct-debug-detailed} does not yet implement them.
4746 The third word specifies the source files for those
4747 structs for which the compiler will emit debug information.
4748 The values @samp{none} and @samp{any} have the normal meaning.
4749 The value @samp{base} means that
4750 the base of name of the file in which the type declaration appears
4751 must match the base of the name of the main compilation file.
4752 In practice, this means that
4753 types declared in @file{foo.c} and @file{foo.h} will have debug information,
4754 but types declared in other header will not.
4755 The value @samp{sys} means those types satisfying @samp{base}
4756 or declared in system or compiler headers.
4758 You may need to experiment to determine the best settings for your application.
4760 The default is @samp{-femit-struct-debug-detailed=all}.
4762 This option works only with DWARF 2.
4764 @item -fenable-icf-debug
4765 @opindex fenable-icf-debug
4766 Generate additional debug information to support identical code folding (ICF).
4767 This option only works with DWARF version 2 or higher.
4769 @item -fno-merge-debug-strings
4770 @opindex fmerge-debug-strings
4771 @opindex fno-merge-debug-strings
4772 Direct the linker to not merge together strings in the debugging
4773 information which are identical in different object files.  Merging is
4774 not supported by all assemblers or linkers.  Merging decreases the size
4775 of the debug information in the output file at the cost of increasing
4776 link processing time.  Merging is enabled by default.
4778 @item -fdebug-prefix-map=@var{old}=@var{new}
4779 @opindex fdebug-prefix-map
4780 When compiling files in directory @file{@var{old}}, record debugging
4781 information describing them as in @file{@var{new}} instead.
4783 @item -fno-dwarf2-cfi-asm
4784 @opindex fdwarf2-cfi-asm
4785 @opindex fno-dwarf2-cfi-asm
4786 Emit DWARF 2 unwind info as compiler generated @code{.eh_frame} section
4787 instead of using GAS @code{.cfi_*} directives.
4789 @cindex @command{prof}
4790 @item -p
4791 @opindex p
4792 Generate extra code to write profile information suitable for the
4793 analysis program @command{prof}.  You must use this option when compiling
4794 the source files you want data about, and you must also use it when
4795 linking.
4797 @cindex @command{gprof}
4798 @item -pg
4799 @opindex pg
4800 Generate extra code to write profile information suitable for the
4801 analysis program @command{gprof}.  You must use this option when compiling
4802 the source files you want data about, and you must also use it when
4803 linking.
4805 @item -Q
4806 @opindex Q
4807 Makes the compiler print out each function name as it is compiled, and
4808 print some statistics about each pass when it finishes.
4810 @item -ftime-report
4811 @opindex ftime-report
4812 Makes the compiler print some statistics about the time consumed by each
4813 pass when it finishes.
4815 @item -fmem-report
4816 @opindex fmem-report
4817 Makes the compiler print some statistics about permanent memory
4818 allocation when it finishes.
4820 @item -fpre-ipa-mem-report
4821 @opindex fpre-ipa-mem-report
4822 @item -fpost-ipa-mem-report
4823 @opindex fpost-ipa-mem-report
4824 Makes the compiler print some statistics about permanent memory
4825 allocation before or after interprocedural optimization.
4827 @item -fprofile-arcs
4828 @opindex fprofile-arcs
4829 Add code so that program flow @dfn{arcs} are instrumented.  During
4830 execution the program records how many times each branch and call is
4831 executed and how many times it is taken or returns.  When the compiled
4832 program exits it saves this data to a file called
4833 @file{@var{auxname}.gcda} for each source file.  The data may be used for
4834 profile-directed optimizations (@option{-fbranch-probabilities}), or for
4835 test coverage analysis (@option{-ftest-coverage}).  Each object file's
4836 @var{auxname} is generated from the name of the output file, if
4837 explicitly specified and it is not the final executable, otherwise it is
4838 the basename of the source file.  In both cases any suffix is removed
4839 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
4840 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
4841 @xref{Cross-profiling}.
4843 @cindex @command{gcov}
4844 @item --coverage
4845 @opindex coverage
4847 This option is used to compile and link code instrumented for coverage
4848 analysis.  The option is a synonym for @option{-fprofile-arcs}
4849 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
4850 linking).  See the documentation for those options for more details.
4852 @itemize
4854 @item
4855 Compile the source files with @option{-fprofile-arcs} plus optimization
4856 and code generation options.  For test coverage analysis, use the
4857 additional @option{-ftest-coverage} option.  You do not need to profile
4858 every source file in a program.
4860 @item
4861 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
4862 (the latter implies the former).
4864 @item
4865 Run the program on a representative workload to generate the arc profile
4866 information.  This may be repeated any number of times.  You can run
4867 concurrent instances of your program, and provided that the file system
4868 supports locking, the data files will be correctly updated.  Also
4869 @code{fork} calls are detected and correctly handled (double counting
4870 will not happen).
4872 @item
4873 For profile-directed optimizations, compile the source files again with
4874 the same optimization and code generation options plus
4875 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
4876 Control Optimization}).
4878 @item
4879 For test coverage analysis, use @command{gcov} to produce human readable
4880 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
4881 @command{gcov} documentation for further information.
4883 @end itemize
4885 With @option{-fprofile-arcs}, for each function of your program GCC
4886 creates a program flow graph, then finds a spanning tree for the graph.
4887 Only arcs that are not on the spanning tree have to be instrumented: the
4888 compiler adds code to count the number of times that these arcs are
4889 executed.  When an arc is the only exit or only entrance to a block, the
4890 instrumentation code can be added to the block; otherwise, a new basic
4891 block must be created to hold the instrumentation code.
4893 @need 2000
4894 @item -ftest-coverage
4895 @opindex ftest-coverage
4896 Produce a notes file that the @command{gcov} code-coverage utility
4897 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
4898 show program coverage.  Each source file's note file is called
4899 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
4900 above for a description of @var{auxname} and instructions on how to
4901 generate test coverage data.  Coverage data will match the source files
4902 more closely, if you do not optimize.
4904 @item -fdbg-cnt-list
4905 @opindex fdbg-cnt-list
4906 Print the name and the counter upperbound for all debug counters.
4908 @item -fdbg-cnt=@var{counter-value-list}
4909 @opindex fdbg-cnt
4910 Set the internal debug counter upperbound. @var{counter-value-list}
4911 is a comma-separated list of @var{name}:@var{value} pairs
4912 which sets the upperbound of each debug counter @var{name} to @var{value}.
4913 All debug counters have the initial upperbound of @var{UINT_MAX},
4914 thus dbg_cnt() returns true always unless the upperbound is set by this option.
4915 e.g. With -fdbg-cnt=dce:10,tail_call:0
4916 dbg_cnt(dce) will return true only for first 10 invocations
4917 and dbg_cnt(tail_call) will return false always.
4919 @item -d@var{letters}
4920 @itemx -fdump-rtl-@var{pass}
4921 @opindex d
4922 Says to make debugging dumps during compilation at times specified by
4923 @var{letters}.  This is used for debugging the RTL-based passes of the
4924 compiler.  The file names for most of the dumps are made by appending
4925 a pass number and a word to the @var{dumpname}, and the files are
4926 created in the directory of the output file.  @var{dumpname} is
4927 generated from the name of the output file, if explicitly specified
4928 and it is not an executable, otherwise it is the basename of the
4929 source file. These switches may have different effects when
4930 @option{-E} is used for preprocessing.
4932 Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
4933 @option{-d} option @var{letters}.  Here are the possible
4934 letters for use in @var{pass} and @var{letters}, and their meanings:
4936 @table @gcctabopt
4938 @item -fdump-rtl-alignments
4939 @opindex fdump-rtl-alignments
4940 Dump after branch alignments have been computed.
4942 @item -fdump-rtl-asmcons
4943 @opindex fdump-rtl-asmcons
4944 Dump after fixing rtl statements that have unsatisfied in/out constraints.
4946 @item -fdump-rtl-auto_inc_dec
4947 @opindex fdump-rtl-auto_inc_dec
4948 Dump after auto-inc-dec discovery.  This pass is only run on
4949 architectures that have auto inc or auto dec instructions.
4951 @item -fdump-rtl-barriers
4952 @opindex fdump-rtl-barriers
4953 Dump after cleaning up the barrier instructions.
4955 @item -fdump-rtl-bbpart
4956 @opindex fdump-rtl-bbpart
4957 Dump after partitioning hot and cold basic blocks.
4959 @item -fdump-rtl-bbro
4960 @opindex fdump-rtl-bbro
4961 Dump after block reordering.
4963 @item -fdump-rtl-btl1
4964 @itemx -fdump-rtl-btl2
4965 @opindex fdump-rtl-btl2
4966 @opindex fdump-rtl-btl2
4967 @option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
4968 after the two branch
4969 target load optimization passes.
4971 @item -fdump-rtl-bypass
4972 @opindex fdump-rtl-bypass
4973 Dump after jump bypassing and control flow optimizations.
4975 @item -fdump-rtl-combine
4976 @opindex fdump-rtl-combine
4977 Dump after the RTL instruction combination pass.
4979 @item -fdump-rtl-compgotos
4980 @opindex fdump-rtl-compgotos
4981 Dump after duplicating the computed gotos.
4983 @item -fdump-rtl-ce1
4984 @itemx -fdump-rtl-ce2
4985 @itemx -fdump-rtl-ce3
4986 @opindex fdump-rtl-ce1
4987 @opindex fdump-rtl-ce2
4988 @opindex fdump-rtl-ce3
4989 @option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
4990 @option{-fdump-rtl-ce3} enable dumping after the three
4991 if conversion passes.
4993 @itemx -fdump-rtl-cprop_hardreg
4994 @opindex fdump-rtl-cprop_hardreg
4995 Dump after hard register copy propagation.
4997 @itemx -fdump-rtl-csa
4998 @opindex fdump-rtl-csa
4999 Dump after combining stack adjustments.
5001 @item -fdump-rtl-cse1
5002 @itemx -fdump-rtl-cse2
5003 @opindex fdump-rtl-cse1
5004 @opindex fdump-rtl-cse2
5005 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
5006 the two common sub-expression elimination passes.
5008 @itemx -fdump-rtl-dce
5009 @opindex fdump-rtl-dce
5010 Dump after the standalone dead code elimination passes.
5012 @itemx -fdump-rtl-dbr
5013 @opindex fdump-rtl-dbr
5014 Dump after delayed branch scheduling.
5016 @item -fdump-rtl-dce1
5017 @itemx -fdump-rtl-dce2
5018 @opindex fdump-rtl-dce1
5019 @opindex fdump-rtl-dce2
5020 @option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
5021 the two dead store elimination passes.
5023 @item -fdump-rtl-eh
5024 @opindex fdump-rtl-eh
5025 Dump after finalization of EH handling code.
5027 @item -fdump-rtl-eh_ranges
5028 @opindex fdump-rtl-eh_ranges
5029 Dump after conversion of EH handling range regions.
5031 @item -fdump-rtl-expand
5032 @opindex fdump-rtl-expand
5033 Dump after RTL generation.
5035 @item -fdump-rtl-fwprop1
5036 @itemx -fdump-rtl-fwprop2
5037 @opindex fdump-rtl-fwprop1
5038 @opindex fdump-rtl-fwprop2
5039 @option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
5040 dumping after the two forward propagation passes.
5042 @item -fdump-rtl-gcse1
5043 @itemx -fdump-rtl-gcse2
5044 @opindex fdump-rtl-gcse1
5045 @opindex fdump-rtl-gcse2
5046 @option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
5047 after global common subexpression elimination.
5049 @item -fdump-rtl-init-regs
5050 @opindex fdump-rtl-init-regs
5051 Dump after the initialization of the registers.
5053 @item -fdump-rtl-initvals
5054 @opindex fdump-rtl-initvals
5055 Dump after the computation of the initial value sets.
5057 @itemx -fdump-rtl-into_cfglayout
5058 @opindex fdump-rtl-into_cfglayout
5059 Dump after converting to cfglayout mode.
5061 @item -fdump-rtl-ira
5062 @opindex fdump-rtl-ira
5063 Dump after iterated register allocation.
5065 @item -fdump-rtl-jump
5066 @opindex fdump-rtl-jump
5067 Dump after the second jump optimization.
5069 @item -fdump-rtl-loop2
5070 @opindex fdump-rtl-loop2
5071 @option{-fdump-rtl-loop2} enables dumping after the rtl
5072 loop optimization passes.
5074 @item -fdump-rtl-mach
5075 @opindex fdump-rtl-mach
5076 Dump after performing the machine dependent reorganization pass, if that
5077 pass exists.
5079 @item -fdump-rtl-mode_sw
5080 @opindex fdump-rtl-mode_sw
5081 Dump after removing redundant mode switches.
5083 @item -fdump-rtl-rnreg
5084 @opindex fdump-rtl-rnreg
5085 Dump after register renumbering.
5087 @itemx -fdump-rtl-outof_cfglayout
5088 @opindex fdump-rtl-outof_cfglayout
5089 Dump after converting from cfglayout mode.
5091 @item -fdump-rtl-peephole2
5092 @opindex fdump-rtl-peephole2
5093 Dump after the peephole pass.
5095 @item -fdump-rtl-postreload
5096 @opindex fdump-rtl-postreload
5097 Dump after post-reload optimizations.
5099 @itemx -fdump-rtl-pro_and_epilogue
5100 @opindex fdump-rtl-pro_and_epilogue
5101 Dump after generating the function pro and epilogues.
5103 @item -fdump-rtl-regmove
5104 @opindex fdump-rtl-regmove
5105 Dump after the register move pass.
5107 @item -fdump-rtl-sched1
5108 @itemx -fdump-rtl-sched2
5109 @opindex fdump-rtl-sched1
5110 @opindex fdump-rtl-sched2
5111 @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
5112 after the basic block scheduling passes.
5114 @item -fdump-rtl-see
5115 @opindex fdump-rtl-see
5116 Dump after sign extension elimination.
5118 @item -fdump-rtl-seqabstr
5119 @opindex fdump-rtl-seqabstr
5120 Dump after common sequence discovery.
5122 @item -fdump-rtl-shorten
5123 @opindex fdump-rtl-shorten
5124 Dump after shortening branches.
5126 @item -fdump-rtl-sibling
5127 @opindex fdump-rtl-sibling
5128 Dump after sibling call optimizations.
5130 @item -fdump-rtl-split1
5131 @itemx -fdump-rtl-split2
5132 @itemx -fdump-rtl-split3
5133 @itemx -fdump-rtl-split4
5134 @itemx -fdump-rtl-split5
5135 @opindex fdump-rtl-split1
5136 @opindex fdump-rtl-split2
5137 @opindex fdump-rtl-split3
5138 @opindex fdump-rtl-split4
5139 @opindex fdump-rtl-split5
5140 @option{-fdump-rtl-split1}, @option{-fdump-rtl-split2},
5141 @option{-fdump-rtl-split3}, @option{-fdump-rtl-split4} and
5142 @option{-fdump-rtl-split5} enable dumping after five rounds of
5143 instruction splitting.
5145 @item -fdump-rtl-sms
5146 @opindex fdump-rtl-sms
5147 Dump after modulo scheduling.  This pass is only run on some
5148 architectures.
5150 @item -fdump-rtl-stack
5151 @opindex fdump-rtl-stack
5152 Dump after conversion from GCC's "flat register file" registers to the
5153 x87's stack-like registers.  This pass is only run on x86 variants.
5155 @item -fdump-rtl-subreg1
5156 @itemx -fdump-rtl-subreg2
5157 @opindex fdump-rtl-subreg1
5158 @opindex fdump-rtl-subreg2
5159 @option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
5160 the two subreg expansion passes.
5162 @item -fdump-rtl-unshare
5163 @opindex fdump-rtl-unshare
5164 Dump after all rtl has been unshared.
5166 @item -fdump-rtl-vartrack
5167 @opindex fdump-rtl-vartrack
5168 Dump after variable tracking.
5170 @item -fdump-rtl-vregs
5171 @opindex fdump-rtl-vregs
5172 Dump after converting virtual registers to hard registers.
5174 @item -fdump-rtl-web
5175 @opindex fdump-rtl-web
5176 Dump after live range splitting.
5178 @item -fdump-rtl-regclass
5179 @itemx -fdump-rtl-subregs_of_mode_init
5180 @itemx -fdump-rtl-subregs_of_mode_finish
5181 @itemx -fdump-rtl-dfinit
5182 @itemx -fdump-rtl-dfinish
5183 @opindex fdump-rtl-regclass
5184 @opindex fdump-rtl-subregs_of_mode_init
5185 @opindex fdump-rtl-subregs_of_mode_finish
5186 @opindex fdump-rtl-dfinit
5187 @opindex fdump-rtl-dfinish
5188 These dumps are defined but always produce empty files.
5190 @item -fdump-rtl-all
5191 @opindex fdump-rtl-all
5192 Produce all the dumps listed above.
5194 @item -dA
5195 @opindex dA
5196 Annotate the assembler output with miscellaneous debugging information.
5198 @item -dD
5199 @opindex dD
5200 Dump all macro definitions, at the end of preprocessing, in addition to
5201 normal output.
5203 @item -dH
5204 @opindex dH
5205 Produce a core dump whenever an error occurs.
5207 @item -dm
5208 @opindex dm
5209 Print statistics on memory usage, at the end of the run, to
5210 standard error.
5212 @item -dp
5213 @opindex dp
5214 Annotate the assembler output with a comment indicating which
5215 pattern and alternative was used.  The length of each instruction is
5216 also printed.
5218 @item -dP
5219 @opindex dP
5220 Dump the RTL in the assembler output as a comment before each instruction.
5221 Also turns on @option{-dp} annotation.
5223 @item -dv
5224 @opindex dv
5225 For each of the other indicated dump files (@option{-fdump-rtl-@var{pass}}),
5226 dump a representation of the control flow graph suitable for viewing with VCG
5227 to @file{@var{file}.@var{pass}.vcg}.
5229 @item -dx
5230 @opindex dx
5231 Just generate RTL for a function instead of compiling it.  Usually used
5232 with @option{-fdump-rtl-expand}.
5234 @item -dy
5235 @opindex dy
5236 Dump debugging information during parsing, to standard error.
5237 @end table
5239 @item -fdump-noaddr
5240 @opindex fdump-noaddr
5241 When doing debugging dumps, suppress address output.  This makes it more
5242 feasible to use diff on debugging dumps for compiler invocations with
5243 different compiler binaries and/or different
5244 text / bss / data / heap / stack / dso start locations.
5246 @item -fdump-unnumbered
5247 @opindex fdump-unnumbered
5248 When doing debugging dumps, suppress instruction numbers and address output.
5249 This makes it more feasible to use diff on debugging dumps for compiler
5250 invocations with different options, in particular with and without
5251 @option{-g}.
5253 @item -fdump-unnumbered-links
5254 @opindex fdump-unnumbered-links
5255 When doing debugging dumps (see @option{-d} option above), suppress
5256 instruction numbers for the links to the previous and next instructions
5257 in a sequence.
5259 @item -fdump-translation-unit @r{(C++ only)}
5260 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
5261 @opindex fdump-translation-unit
5262 Dump a representation of the tree structure for the entire translation
5263 unit to a file.  The file name is made by appending @file{.tu} to the
5264 source file name, and the file is created in the same directory as the
5265 output file.  If the @samp{-@var{options}} form is used, @var{options}
5266 controls the details of the dump as described for the
5267 @option{-fdump-tree} options.
5269 @item -fdump-class-hierarchy @r{(C++ only)}
5270 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
5271 @opindex fdump-class-hierarchy
5272 Dump a representation of each class's hierarchy and virtual function
5273 table layout to a file.  The file name is made by appending
5274 @file{.class} to the source file name, and the file is created in the
5275 same directory as the output file.  If the @samp{-@var{options}} form
5276 is used, @var{options} controls the details of the dump as described
5277 for the @option{-fdump-tree} options.
5279 @item -fdump-ipa-@var{switch}
5280 @opindex fdump-ipa
5281 Control the dumping at various stages of inter-procedural analysis
5282 language tree to a file.  The file name is generated by appending a
5283 switch specific suffix to the source file name, and the file is created
5284 in the same directory as the output file.  The following dumps are
5285 possible:
5287 @table @samp
5288 @item all
5289 Enables all inter-procedural analysis dumps.
5291 @item cgraph
5292 Dumps information about call-graph optimization, unused function removal,
5293 and inlining decisions.
5295 @item inline
5296 Dump after function inlining.
5298 @end table
5300 @item -fdump-statistics-@var{option}
5301 @opindex fdump-statistics
5302 Enable and control dumping of pass statistics in a separate file.  The
5303 file name is generated by appending a suffix ending in
5304 @samp{.statistics} to the source file name, and the file is created in
5305 the same directory as the output file.  If the @samp{-@var{option}}
5306 form is used, @samp{-stats} will cause counters to be summed over the
5307 whole compilation unit while @samp{-details} will dump every event as
5308 the passes generate them.  The default with no option is to sum
5309 counters for each function compiled.
5311 @item -fdump-tree-@var{switch}
5312 @itemx -fdump-tree-@var{switch}-@var{options}
5313 @opindex fdump-tree
5314 Control the dumping at various stages of processing the intermediate
5315 language tree to a file.  The file name is generated by appending a
5316 switch specific suffix to the source file name, and the file is
5317 created in the same directory as the output file.  If the
5318 @samp{-@var{options}} form is used, @var{options} is a list of
5319 @samp{-} separated options that control the details of the dump.  Not
5320 all options are applicable to all dumps, those which are not
5321 meaningful will be ignored.  The following options are available
5323 @table @samp
5324 @item address
5325 Print the address of each node.  Usually this is not meaningful as it
5326 changes according to the environment and source file.  Its primary use
5327 is for tying up a dump file with a debug environment.
5328 @item asmname
5329 If @code{DECL_ASSEMBLER_NAME} has been set for a given decl, use that
5330 in the dump instead of @code{DECL_NAME}.  Its primary use is ease of
5331 use working backward from mangled names in the assembly file.
5332 @item slim
5333 Inhibit dumping of members of a scope or body of a function merely
5334 because that scope has been reached.  Only dump such items when they
5335 are directly reachable by some other path.  When dumping pretty-printed
5336 trees, this option inhibits dumping the bodies of control structures.
5337 @item raw
5338 Print a raw representation of the tree.  By default, trees are
5339 pretty-printed into a C-like representation.
5340 @item details
5341 Enable more detailed dumps (not honored by every dump option).
5342 @item stats
5343 Enable dumping various statistics about the pass (not honored by every dump
5344 option).
5345 @item blocks
5346 Enable showing basic block boundaries (disabled in raw dumps).
5347 @item vops
5348 Enable showing virtual operands for every statement.
5349 @item lineno
5350 Enable showing line numbers for statements.
5351 @item uid
5352 Enable showing the unique ID (@code{DECL_UID}) for each variable.
5353 @item verbose
5354 Enable showing the tree dump for each statement.
5355 @item eh
5356 Enable showing the EH region number holding each statement.
5357 @item all
5358 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
5359 and @option{lineno}.
5360 @end table
5362 The following tree dumps are possible:
5363 @table @samp
5365 @item original
5366 @opindex fdump-tree-original
5367 Dump before any tree based optimization, to @file{@var{file}.original}.
5369 @item optimized
5370 @opindex fdump-tree-optimized
5371 Dump after all tree based optimization, to @file{@var{file}.optimized}.
5373 @item gimple
5374 @opindex fdump-tree-gimple
5375 Dump each function before and after the gimplification pass to a file.  The
5376 file name is made by appending @file{.gimple} to the source file name.
5378 @item cfg
5379 @opindex fdump-tree-cfg
5380 Dump the control flow graph of each function to a file.  The file name is
5381 made by appending @file{.cfg} to the source file name.
5383 @item vcg
5384 @opindex fdump-tree-vcg
5385 Dump the control flow graph of each function to a file in VCG format.  The
5386 file name is made by appending @file{.vcg} to the source file name.  Note
5387 that if the file contains more than one function, the generated file cannot
5388 be used directly by VCG@.  You will need to cut and paste each function's
5389 graph into its own separate file first.
5391 @item ch
5392 @opindex fdump-tree-ch
5393 Dump each function after copying loop headers.  The file name is made by
5394 appending @file{.ch} to the source file name.
5396 @item ssa
5397 @opindex fdump-tree-ssa
5398 Dump SSA related information to a file.  The file name is made by appending
5399 @file{.ssa} to the source file name.
5401 @item alias
5402 @opindex fdump-tree-alias
5403 Dump aliasing information for each function.  The file name is made by
5404 appending @file{.alias} to the source file name.
5406 @item ccp
5407 @opindex fdump-tree-ccp
5408 Dump each function after CCP@.  The file name is made by appending
5409 @file{.ccp} to the source file name.
5411 @item storeccp
5412 @opindex fdump-tree-storeccp
5413 Dump each function after STORE-CCP@.  The file name is made by appending
5414 @file{.storeccp} to the source file name.
5416 @item pre
5417 @opindex fdump-tree-pre
5418 Dump trees after partial redundancy elimination.  The file name is made
5419 by appending @file{.pre} to the source file name.
5421 @item fre
5422 @opindex fdump-tree-fre
5423 Dump trees after full redundancy elimination.  The file name is made
5424 by appending @file{.fre} to the source file name.
5426 @item copyprop
5427 @opindex fdump-tree-copyprop
5428 Dump trees after copy propagation.  The file name is made
5429 by appending @file{.copyprop} to the source file name.
5431 @item store_copyprop
5432 @opindex fdump-tree-store_copyprop
5433 Dump trees after store copy-propagation.  The file name is made
5434 by appending @file{.store_copyprop} to the source file name.
5436 @item dce
5437 @opindex fdump-tree-dce
5438 Dump each function after dead code elimination.  The file name is made by
5439 appending @file{.dce} to the source file name.
5441 @item mudflap
5442 @opindex fdump-tree-mudflap
5443 Dump each function after adding mudflap instrumentation.  The file name is
5444 made by appending @file{.mudflap} to the source file name.
5446 @item sra
5447 @opindex fdump-tree-sra
5448 Dump each function after performing scalar replacement of aggregates.  The
5449 file name is made by appending @file{.sra} to the source file name.
5451 @item sink
5452 @opindex fdump-tree-sink
5453 Dump each function after performing code sinking.  The file name is made
5454 by appending @file{.sink} to the source file name.
5456 @item dom
5457 @opindex fdump-tree-dom
5458 Dump each function after applying dominator tree optimizations.  The file
5459 name is made by appending @file{.dom} to the source file name.
5461 @item dse
5462 @opindex fdump-tree-dse
5463 Dump each function after applying dead store elimination.  The file
5464 name is made by appending @file{.dse} to the source file name.
5466 @item phiopt
5467 @opindex fdump-tree-phiopt
5468 Dump each function after optimizing PHI nodes into straightline code.  The file
5469 name is made by appending @file{.phiopt} to the source file name.
5471 @item forwprop
5472 @opindex fdump-tree-forwprop
5473 Dump each function after forward propagating single use variables.  The file
5474 name is made by appending @file{.forwprop} to the source file name.
5476 @item copyrename
5477 @opindex fdump-tree-copyrename
5478 Dump each function after applying the copy rename optimization.  The file
5479 name is made by appending @file{.copyrename} to the source file name.
5481 @item nrv
5482 @opindex fdump-tree-nrv
5483 Dump each function after applying the named return value optimization on
5484 generic trees.  The file name is made by appending @file{.nrv} to the source
5485 file name.
5487 @item vect
5488 @opindex fdump-tree-vect
5489 Dump each function after applying vectorization of loops.  The file name is
5490 made by appending @file{.vect} to the source file name.
5492 @item slp
5493 @opindex fdump-tree-slp
5494 Dump each function after applying vectorization of basic blocks.  The file name
5495 is made by appending @file{.slp} to the source file name.
5497 @item vrp
5498 @opindex fdump-tree-vrp
5499 Dump each function after Value Range Propagation (VRP).  The file name
5500 is made by appending @file{.vrp} to the source file name.
5502 @item all
5503 @opindex fdump-tree-all
5504 Enable all the available tree dumps with the flags provided in this option.
5505 @end table
5507 @item -ftree-vectorizer-verbose=@var{n}
5508 @opindex ftree-vectorizer-verbose
5509 This option controls the amount of debugging output the vectorizer prints.
5510 This information is written to standard error, unless
5511 @option{-fdump-tree-all} or @option{-fdump-tree-vect} is specified,
5512 in which case it is output to the usual dump listing file, @file{.vect}.
5513 For @var{n}=0 no diagnostic information is reported.
5514 If @var{n}=1 the vectorizer reports each loop that got vectorized,
5515 and the total number of loops that got vectorized.
5516 If @var{n}=2 the vectorizer also reports non-vectorized loops that passed
5517 the first analysis phase (vect_analyze_loop_form) - i.e.@: countable,
5518 inner-most, single-bb, single-entry/exit loops.  This is the same verbosity
5519 level that @option{-fdump-tree-vect-stats} uses.
5520 Higher verbosity levels mean either more information dumped for each
5521 reported loop, or same amount of information reported for more loops:
5522 if @var{n}=3, vectorizer cost model information is reported.
5523 If @var{n}=4, alignment related information is added to the reports.
5524 If @var{n}=5, data-references related information (e.g.@: memory dependences,
5525 memory access-patterns) is added to the reports.
5526 If @var{n}=6, the vectorizer reports also non-vectorized inner-most loops
5527 that did not pass the first analysis phase (i.e., may not be countable, or
5528 may have complicated control-flow).
5529 If @var{n}=7, the vectorizer reports also non-vectorized nested loops.
5530 If @var{n}=8, SLP related information is added to the reports.
5531 For @var{n}=9, all the information the vectorizer generates during its
5532 analysis and transformation is reported.  This is the same verbosity level
5533 that @option{-fdump-tree-vect-details} uses.
5535 @item -frandom-seed=@var{string}
5536 @opindex frandom-seed
5537 This option provides a seed that GCC uses when it would otherwise use
5538 random numbers.  It is used to generate certain symbol names
5539 that have to be different in every compiled file.  It is also used to
5540 place unique stamps in coverage data files and the object files that
5541 produce them.  You can use the @option{-frandom-seed} option to produce
5542 reproducibly identical object files.
5544 The @var{string} should be different for every file you compile.
5546 @item -fsched-verbose=@var{n}
5547 @opindex fsched-verbose
5548 On targets that use instruction scheduling, this option controls the
5549 amount of debugging output the scheduler prints.  This information is
5550 written to standard error, unless @option{-fdump-rtl-sched1} or
5551 @option{-fdump-rtl-sched2} is specified, in which case it is output
5552 to the usual dump listing file, @file{.sched1} or @file{.sched2}
5553 respectively.  However for @var{n} greater than nine, the output is
5554 always printed to standard error.
5556 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
5557 same information as @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2}.
5558 For @var{n} greater than one, it also output basic block probabilities,
5559 detailed ready list information and unit/insn info.  For @var{n} greater
5560 than two, it includes RTL at abort point, control-flow and regions info.
5561 And for @var{n} over four, @option{-fsched-verbose} also includes
5562 dependence info.
5564 @item -save-temps
5565 @itemx -save-temps=cwd
5566 @opindex save-temps
5567 Store the usual ``temporary'' intermediate files permanently; place them
5568 in the current directory and name them based on the source file.  Thus,
5569 compiling @file{foo.c} with @samp{-c -save-temps} would produce files
5570 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
5571 preprocessed @file{foo.i} output file even though the compiler now
5572 normally uses an integrated preprocessor.
5574 When used in combination with the @option{-x} command line option,
5575 @option{-save-temps} is sensible enough to avoid over writing an
5576 input source file with the same extension as an intermediate file.
5577 The corresponding intermediate file may be obtained by renaming the
5578 source file before using @option{-save-temps}.
5580 If you invoke GCC in parallel, compiling several different source
5581 files that share a common base name in different subdirectories or the
5582 same source file compiled for multiple output destinations, it is
5583 likely that the different parallel compilers will interfere with each
5584 other, and overwrite the temporary files.  For instance:
5586 @smallexample
5587 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
5588 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
5589 @end smallexample
5591 may result in @file{foo.i} and @file{foo.o} being written to
5592 simultaneously by both compilers.
5594 @item -save-temps=obj
5595 @opindex save-temps=obj
5596 Store the usual ``temporary'' intermediate files permanently.  If the
5597 @option{-o} option is used, the temporary files are based on the
5598 object file.  If the @option{-o} option is not used, the
5599 @option{-save-temps=obj} switch behaves like @option{-save-temps}.
5601 For example:
5603 @smallexample
5604 gcc -save-temps=obj -c foo.c
5605 gcc -save-temps=obj -c bar.c -o dir/xbar.o
5606 gcc -save-temps=obj foobar.c -o dir2/yfoobar
5607 @end smallexample
5609 would create @file{foo.i}, @file{foo.s}, @file{dir/xbar.i},
5610 @file{dir/xbar.s}, @file{dir2/yfoobar.i}, @file{dir2/yfoobar.s}, and
5611 @file{dir2/yfoobar.o}.
5613 @item -time@r{[}=@var{file}@r{]}
5614 @opindex time
5615 Report the CPU time taken by each subprocess in the compilation
5616 sequence.  For C source files, this is the compiler proper and assembler
5617 (plus the linker if linking is done).
5619 Without the specification of an output file, the output looks like this:
5621 @smallexample
5622 # cc1 0.12 0.01
5623 # as 0.00 0.01
5624 @end smallexample
5626 The first number on each line is the ``user time'', that is time spent
5627 executing the program itself.  The second number is ``system time'',
5628 time spent executing operating system routines on behalf of the program.
5629 Both numbers are in seconds.
5631 With the specification of an output file, the output is appended to the
5632 named file, and it looks like this:
5634 @smallexample
5635 0.12 0.01 cc1 @var{options}
5636 0.00 0.01 as @var{options}
5637 @end smallexample
5639 The ``user time'' and the ``system time'' are moved before the program
5640 name, and the options passed to the program are displayed, so that one
5641 can later tell what file was being compiled, and with which options.
5643 @item -fvar-tracking
5644 @opindex fvar-tracking
5645 Run variable tracking pass.  It computes where variables are stored at each
5646 position in code.  Better debugging information is then generated
5647 (if the debugging information format supports this information).
5649 It is enabled by default when compiling with optimization (@option{-Os},
5650 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
5651 the debug info format supports it.
5653 @item -fvar-tracking-assignments
5654 @opindex fvar-tracking-assignments
5655 @opindex fno-var-tracking-assignments
5656 Annotate assignments to user variables early in the compilation and
5657 attempt to carry the annotations over throughout the compilation all the
5658 way to the end, in an attempt to improve debug information while
5659 optimizing.  Use of @option{-gdwarf-4} is recommended along with it.
5661 It can be enabled even if var-tracking is disabled, in which case
5662 annotations will be created and maintained, but discarded at the end.
5664 @item -fvar-tracking-assignments-toggle
5665 @opindex fvar-tracking-assignments-toggle
5666 @opindex fno-var-tracking-assignments-toggle
5667 Toggle @option{-fvar-tracking-assignments}, in the same way that
5668 @option{-gtoggle} toggles @option{-g}.
5670 @item -print-file-name=@var{library}
5671 @opindex print-file-name
5672 Print the full absolute name of the library file @var{library} that
5673 would be used when linking---and don't do anything else.  With this
5674 option, GCC does not compile or link anything; it just prints the
5675 file name.
5677 @item -print-multi-directory
5678 @opindex print-multi-directory
5679 Print the directory name corresponding to the multilib selected by any
5680 other switches present in the command line.  This directory is supposed
5681 to exist in @env{GCC_EXEC_PREFIX}.
5683 @item -print-multi-lib
5684 @opindex print-multi-lib
5685 Print the mapping from multilib directory names to compiler switches
5686 that enable them.  The directory name is separated from the switches by
5687 @samp{;}, and each switch starts with an @samp{@@} instead of the
5688 @samp{-}, without spaces between multiple switches.  This is supposed to
5689 ease shell-processing.
5691 @item -print-multi-os-directory
5692 @opindex print-multi-os-directory
5693 Print the path to OS libraries for the selected
5694 multilib, relative to some @file{lib} subdirectory.  If OS libraries are
5695 present in the @file{lib} subdirectory and no multilibs are used, this is
5696 usually just @file{.}, if OS libraries are present in @file{lib@var{suffix}}
5697 sibling directories this prints e.g.@: @file{../lib64}, @file{../lib} or
5698 @file{../lib32}, or if OS libraries are present in @file{lib/@var{subdir}}
5699 subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}.
5701 @item -print-prog-name=@var{program}
5702 @opindex print-prog-name
5703 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
5705 @item -print-libgcc-file-name
5706 @opindex print-libgcc-file-name
5707 Same as @option{-print-file-name=libgcc.a}.
5709 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
5710 but you do want to link with @file{libgcc.a}.  You can do
5712 @smallexample
5713 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
5714 @end smallexample
5716 @item -print-search-dirs
5717 @opindex print-search-dirs
5718 Print the name of the configured installation directory and a list of
5719 program and library directories @command{gcc} will search---and don't do anything else.
5721 This is useful when @command{gcc} prints the error message
5722 @samp{installation problem, cannot exec cpp0: No such file or directory}.
5723 To resolve this you either need to put @file{cpp0} and the other compiler
5724 components where @command{gcc} expects to find them, or you can set the environment
5725 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
5726 Don't forget the trailing @samp{/}.
5727 @xref{Environment Variables}.
5729 @item -print-sysroot
5730 @opindex print-sysroot
5731 Print the target sysroot directory that will be used during
5732 compilation.  This is the target sysroot specified either at configure
5733 time or using the @option{--sysroot} option, possibly with an extra
5734 suffix that depends on compilation options.  If no target sysroot is
5735 specified, the option prints nothing.
5737 @item -print-sysroot-headers-suffix
5738 @opindex print-sysroot-headers-suffix
5739 Print the suffix added to the target sysroot when searching for
5740 headers, or give an error if the compiler is not configured with such
5741 a suffix---and don't do anything else.
5743 @item -dumpmachine
5744 @opindex dumpmachine
5745 Print the compiler's target machine (for example,
5746 @samp{i686-pc-linux-gnu})---and don't do anything else.
5748 @item -dumpversion
5749 @opindex dumpversion
5750 Print the compiler version (for example, @samp{3.0})---and don't do
5751 anything else.
5753 @item -dumpspecs
5754 @opindex dumpspecs
5755 Print the compiler's built-in specs---and don't do anything else.  (This
5756 is used when GCC itself is being built.)  @xref{Spec Files}.
5758 @item -feliminate-unused-debug-types
5759 @opindex feliminate-unused-debug-types
5760 Normally, when producing DWARF2 output, GCC will emit debugging
5761 information for all types declared in a compilation
5762 unit, regardless of whether or not they are actually used
5763 in that compilation unit.  Sometimes this is useful, such as
5764 if, in the debugger, you want to cast a value to a type that is
5765 not actually used in your program (but is declared).  More often,
5766 however, this results in a significant amount of wasted space.
5767 With this option, GCC will avoid producing debug symbol output
5768 for types that are nowhere used in the source file being compiled.
5769 @end table
5771 @node Optimize Options
5772 @section Options That Control Optimization
5773 @cindex optimize options
5774 @cindex options, optimization
5776 These options control various sorts of optimizations.
5778 Without any optimization option, the compiler's goal is to reduce the
5779 cost of compilation and to make debugging produce the expected
5780 results.  Statements are independent: if you stop the program with a
5781 breakpoint between statements, you can then assign a new value to any
5782 variable or change the program counter to any other statement in the
5783 function and get exactly the results you would expect from the source
5784 code.
5786 Turning on optimization flags makes the compiler attempt to improve
5787 the performance and/or code size at the expense of compilation time
5788 and possibly the ability to debug the program.
5790 The compiler performs optimization based on the knowledge it has of the
5791 program.  Compiling multiple files at once to a single output file mode allows
5792 the compiler to use information gained from all of the files when compiling
5793 each of them.
5795 Not all optimizations are controlled directly by a flag.  Only
5796 optimizations that have a flag are listed in this section.
5798 Most optimizations are only enabled if an @option{-O} level is set on
5799 the command line.  Otherwise they are disabled, even if individual             
5800 optimization flags are specified.
5802 Depending on the target and how GCC was configured, a slightly different
5803 set of optimizations may be enabled at each @option{-O} level than
5804 those listed here.  You can invoke GCC with @samp{-Q --help=optimizers}
5805 to find out the exact set of optimizations that are enabled at each level.
5806 @xref{Overall Options}, for examples.
5808 @table @gcctabopt
5809 @item -O
5810 @itemx -O1
5811 @opindex O
5812 @opindex O1
5813 Optimize.  Optimizing compilation takes somewhat more time, and a lot
5814 more memory for a large function.
5816 With @option{-O}, the compiler tries to reduce code size and execution
5817 time, without performing any optimizations that take a great deal of
5818 compilation time.
5820 @option{-O} turns on the following optimization flags:
5821 @gccoptlist{
5822 -fauto-inc-dec @gol
5823 -fcprop-registers @gol
5824 -fdce @gol
5825 -fdefer-pop @gol
5826 -fdelayed-branch @gol
5827 -fdse @gol
5828 -fguess-branch-probability @gol
5829 -fif-conversion2 @gol
5830 -fif-conversion @gol
5831 -fipa-pure-const @gol
5832 -fipa-profile @gol
5833 -fipa-reference @gol
5834 -fmerge-constants
5835 -fsplit-wide-types @gol
5836 -ftree-builtin-call-dce @gol
5837 -ftree-ccp @gol
5838 -ftree-ch @gol
5839 -ftree-copyrename @gol
5840 -ftree-dce @gol
5841 -ftree-dominator-opts @gol
5842 -ftree-dse @gol
5843 -ftree-forwprop @gol
5844 -ftree-fre @gol
5845 -ftree-phiprop @gol
5846 -ftree-sra @gol
5847 -ftree-pta @gol
5848 -ftree-ter @gol
5849 -funit-at-a-time}
5851 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
5852 where doing so does not interfere with debugging.
5854 @item -O2
5855 @opindex O2
5856 Optimize even more.  GCC performs nearly all supported optimizations
5857 that do not involve a space-speed tradeoff.
5858 As compared to @option{-O}, this option increases both compilation time
5859 and the performance of the generated code.
5861 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
5862 also turns on the following optimization flags:
5863 @gccoptlist{-fthread-jumps @gol
5864 -falign-functions  -falign-jumps @gol
5865 -falign-loops  -falign-labels @gol
5866 -fcaller-saves @gol
5867 -fcrossjumping @gol
5868 -fcse-follow-jumps  -fcse-skip-blocks @gol
5869 -fdelete-null-pointer-checks @gol
5870 -fexpensive-optimizations @gol
5871 -fgcse  -fgcse-lm  @gol
5872 -finline-small-functions @gol
5873 -findirect-inlining @gol
5874 -fipa-sra @gol
5875 -foptimize-sibling-calls @gol
5876 -fpartial-inlining @gol
5877 -fpeephole2 @gol
5878 -fregmove @gol
5879 -freorder-blocks  -freorder-functions @gol
5880 -frerun-cse-after-loop  @gol
5881 -fsched-interblock  -fsched-spec @gol
5882 -fschedule-insns  -fschedule-insns2 @gol
5883 -fstrict-aliasing -fstrict-overflow @gol
5884 -ftree-switch-conversion @gol
5885 -ftree-pre @gol
5886 -ftree-vrp}
5888 Please note the warning under @option{-fgcse} about
5889 invoking @option{-O2} on programs that use computed gotos.
5891 @item -O3
5892 @opindex O3
5893 Optimize yet more.  @option{-O3} turns on all optimizations specified
5894 by @option{-O2} and also turns on the @option{-finline-functions},
5895 @option{-funswitch-loops}, @option{-fpredictive-commoning},
5896 @option{-fgcse-after-reload} and @option{-ftree-vectorize} options.
5898 @item -O0
5899 @opindex O0
5900 Reduce compilation time and make debugging produce the expected
5901 results.  This is the default.
5903 @item -Os
5904 @opindex Os
5905 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
5906 do not typically increase code size.  It also performs further
5907 optimizations designed to reduce code size.
5909 @option{-Os} disables the following optimization flags:
5910 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
5911 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
5912 -fprefetch-loop-arrays  -ftree-vect-loop-version}
5914 @item -Ofast
5915 @opindex Ofast
5916 Disregard strict standards compliance.  @option{-Ofast} enables all
5917 @option{-O3} optimizations.  It also enables optimizations that are not
5918 valid for all standard compliant programs.
5919 It turns on @option{-ffast-math}.
5921 If you use multiple @option{-O} options, with or without level numbers,
5922 the last such option is the one that is effective.
5923 @end table
5925 Options of the form @option{-f@var{flag}} specify machine-independent
5926 flags.  Most flags have both positive and negative forms; the negative
5927 form of @option{-ffoo} would be @option{-fno-foo}.  In the table
5928 below, only one of the forms is listed---the one you typically will
5929 use.  You can figure out the other form by either removing @samp{no-}
5930 or adding it.
5932 The following options control specific optimizations.  They are either
5933 activated by @option{-O} options or are related to ones that are.  You
5934 can use the following flags in the rare cases when ``fine-tuning'' of
5935 optimizations to be performed is desired.
5937 @table @gcctabopt
5938 @item -fno-default-inline
5939 @opindex fno-default-inline
5940 Do not make member functions inline by default merely because they are
5941 defined inside the class scope (C++ only).  Otherwise, when you specify
5942 @w{@option{-O}}, member functions defined inside class scope are compiled
5943 inline by default; i.e., you don't need to add @samp{inline} in front of
5944 the member function name.
5946 @item -fno-defer-pop
5947 @opindex fno-defer-pop
5948 Always pop the arguments to each function call as soon as that function
5949 returns.  For machines which must pop arguments after a function call,
5950 the compiler normally lets arguments accumulate on the stack for several
5951 function calls and pops them all at once.
5953 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5955 @item -fforward-propagate
5956 @opindex fforward-propagate
5957 Perform a forward propagation pass on RTL@.  The pass tries to combine two
5958 instructions and checks if the result can be simplified.  If loop unrolling
5959 is active, two passes are performed and the second is scheduled after
5960 loop unrolling.
5962 This option is enabled by default at optimization levels @option{-O},
5963 @option{-O2}, @option{-O3}, @option{-Os}.
5965 @item -fomit-frame-pointer
5966 @opindex fomit-frame-pointer
5967 Don't keep the frame pointer in a register for functions that
5968 don't need one.  This avoids the instructions to save, set up and
5969 restore frame pointers; it also makes an extra register available
5970 in many functions.  @strong{It also makes debugging impossible on
5971 some machines.}
5973 On some machines, such as the VAX, this flag has no effect, because
5974 the standard calling sequence automatically handles the frame pointer
5975 and nothing is saved by pretending it doesn't exist.  The
5976 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
5977 whether a target machine supports this flag.  @xref{Registers,,Register
5978 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
5980 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5982 @item -foptimize-sibling-calls
5983 @opindex foptimize-sibling-calls
5984 Optimize sibling and tail recursive calls.
5986 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5988 @item -fno-inline
5989 @opindex fno-inline
5990 Don't pay attention to the @code{inline} keyword.  Normally this option
5991 is used to keep the compiler from expanding any functions inline.
5992 Note that if you are not optimizing, no functions can be expanded inline.
5994 @item -finline-small-functions
5995 @opindex finline-small-functions
5996 Integrate functions into their callers when their body is smaller than expected
5997 function call code (so overall size of program gets smaller).  The compiler
5998 heuristically decides which functions are simple enough to be worth integrating
5999 in this way.
6001 Enabled at level @option{-O2}.
6003 @item -findirect-inlining
6004 @opindex findirect-inlining
6005 Inline also indirect calls that are discovered to be known at compile
6006 time thanks to previous inlining.  This option has any effect only
6007 when inlining itself is turned on by the @option{-finline-functions}
6008 or @option{-finline-small-functions} options.
6010 Enabled at level @option{-O2}.
6012 @item -finline-functions
6013 @opindex finline-functions
6014 Integrate all simple functions into their callers.  The compiler
6015 heuristically decides which functions are simple enough to be worth
6016 integrating in this way.
6018 If all calls to a given function are integrated, and the function is
6019 declared @code{static}, then the function is normally not output as
6020 assembler code in its own right.
6022 Enabled at level @option{-O3}.
6024 @item -finline-functions-called-once
6025 @opindex finline-functions-called-once
6026 Consider all @code{static} functions called once for inlining into their
6027 caller even if they are not marked @code{inline}.  If a call to a given
6028 function is integrated, then the function is not output as assembler code
6029 in its own right.
6031 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
6033 @item -fearly-inlining
6034 @opindex fearly-inlining
6035 Inline functions marked by @code{always_inline} and functions whose body seems
6036 smaller than the function call overhead early before doing
6037 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
6038 makes profiling significantly cheaper and usually inlining faster on programs
6039 having large chains of nested wrapper functions.
6041 Enabled by default.
6043 @item -fipa-sra
6044 @opindex fipa-sra
6045 Perform interprocedural scalar replacement of aggregates, removal of
6046 unused parameters and replacement of parameters passed by reference
6047 by parameters passed by value.
6049 Enabled at levels @option{-O2}, @option{-O3} and @option{-Os}.
6051 @item -finline-limit=@var{n}
6052 @opindex finline-limit
6053 By default, GCC limits the size of functions that can be inlined.  This flag
6054 allows coarse control of this limit.  @var{n} is the size of functions that
6055 can be inlined in number of pseudo instructions.
6057 Inlining is actually controlled by a number of parameters, which may be
6058 specified individually by using @option{--param @var{name}=@var{value}}.
6059 The @option{-finline-limit=@var{n}} option sets some of these parameters
6060 as follows:
6062 @table @gcctabopt
6063 @item max-inline-insns-single
6064 is set to @var{n}/2.
6065 @item max-inline-insns-auto
6066 is set to @var{n}/2.
6067 @end table
6069 See below for a documentation of the individual
6070 parameters controlling inlining and for the defaults of these parameters.
6072 @emph{Note:} there may be no value to @option{-finline-limit} that results
6073 in default behavior.
6075 @emph{Note:} pseudo instruction represents, in this particular context, an
6076 abstract measurement of function's size.  In no way does it represent a count
6077 of assembly instructions and as such its exact meaning might change from one
6078 release to an another.
6080 @item -fkeep-inline-functions
6081 @opindex fkeep-inline-functions
6082 In C, emit @code{static} functions that are declared @code{inline}
6083 into the object file, even if the function has been inlined into all
6084 of its callers.  This switch does not affect functions using the
6085 @code{extern inline} extension in GNU C90@.  In C++, emit any and all
6086 inline functions into the object file.
6088 @item -fkeep-static-consts
6089 @opindex fkeep-static-consts
6090 Emit variables declared @code{static const} when optimization isn't turned
6091 on, even if the variables aren't referenced.
6093 GCC enables this option by default.  If you want to force the compiler to
6094 check if the variable was referenced, regardless of whether or not
6095 optimization is turned on, use the @option{-fno-keep-static-consts} option.
6097 @item -fmerge-constants
6098 @opindex fmerge-constants
6099 Attempt to merge identical constants (string constants and floating point
6100 constants) across compilation units.
6102 This option is the default for optimized compilation if the assembler and
6103 linker support it.  Use @option{-fno-merge-constants} to inhibit this
6104 behavior.
6106 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6108 @item -fmerge-all-constants
6109 @opindex fmerge-all-constants
6110 Attempt to merge identical constants and identical variables.
6112 This option implies @option{-fmerge-constants}.  In addition to
6113 @option{-fmerge-constants} this considers e.g.@: even constant initialized
6114 arrays or initialized constant variables with integral or floating point
6115 types.  Languages like C or C++ require each variable, including multiple
6116 instances of the same variable in recursive calls, to have distinct locations,
6117 so using this option will result in non-conforming
6118 behavior.
6120 @item -fmodulo-sched
6121 @opindex fmodulo-sched
6122 Perform swing modulo scheduling immediately before the first scheduling
6123 pass.  This pass looks at innermost loops and reorders their
6124 instructions by overlapping different iterations.
6126 @item -fmodulo-sched-allow-regmoves
6127 @opindex fmodulo-sched-allow-regmoves
6128 Perform more aggressive SMS based modulo scheduling with register moves
6129 allowed.  By setting this flag certain anti-dependences edges will be
6130 deleted which will trigger the generation of reg-moves based on the
6131 life-range analysis.  This option is effective only with
6132 @option{-fmodulo-sched} enabled.
6134 @item -fno-branch-count-reg
6135 @opindex fno-branch-count-reg
6136 Do not use ``decrement and branch'' instructions on a count register,
6137 but instead generate a sequence of instructions that decrement a
6138 register, compare it against zero, then branch based upon the result.
6139 This option is only meaningful on architectures that support such
6140 instructions, which include x86, PowerPC, IA-64 and S/390.
6142 The default is @option{-fbranch-count-reg}.
6144 @item -fno-function-cse
6145 @opindex fno-function-cse
6146 Do not put function addresses in registers; make each instruction that
6147 calls a constant function contain the function's address explicitly.
6149 This option results in less efficient code, but some strange hacks
6150 that alter the assembler output may be confused by the optimizations
6151 performed when this option is not used.
6153 The default is @option{-ffunction-cse}
6155 @item -fno-zero-initialized-in-bss
6156 @opindex fno-zero-initialized-in-bss
6157 If the target supports a BSS section, GCC by default puts variables that
6158 are initialized to zero into BSS@.  This can save space in the resulting
6159 code.
6161 This option turns off this behavior because some programs explicitly
6162 rely on variables going to the data section.  E.g., so that the
6163 resulting executable can find the beginning of that section and/or make
6164 assumptions based on that.
6166 The default is @option{-fzero-initialized-in-bss}.
6168 @item -fmudflap -fmudflapth -fmudflapir
6169 @opindex fmudflap
6170 @opindex fmudflapth
6171 @opindex fmudflapir
6172 @cindex bounds checking
6173 @cindex mudflap
6174 For front-ends that support it (C and C++), instrument all risky
6175 pointer/array dereferencing operations, some standard library
6176 string/heap functions, and some other associated constructs with
6177 range/validity tests.  Modules so instrumented should be immune to
6178 buffer overflows, invalid heap use, and some other classes of C/C++
6179 programming errors.  The instrumentation relies on a separate runtime
6180 library (@file{libmudflap}), which will be linked into a program if
6181 @option{-fmudflap} is given at link time.  Run-time behavior of the
6182 instrumented program is controlled by the @env{MUDFLAP_OPTIONS}
6183 environment variable.  See @code{env MUDFLAP_OPTIONS=-help a.out}
6184 for its options.
6186 Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to
6187 link if your program is multi-threaded.  Use @option{-fmudflapir}, in
6188 addition to @option{-fmudflap} or @option{-fmudflapth}, if
6189 instrumentation should ignore pointer reads.  This produces less
6190 instrumentation (and therefore faster execution) and still provides
6191 some protection against outright memory corrupting writes, but allows
6192 erroneously read data to propagate within a program.
6194 @item -fthread-jumps
6195 @opindex fthread-jumps
6196 Perform optimizations where we check to see if a jump branches to a
6197 location where another comparison subsumed by the first is found.  If
6198 so, the first branch is redirected to either the destination of the
6199 second branch or a point immediately following it, depending on whether
6200 the condition is known to be true or false.
6202 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6204 @item -fsplit-wide-types
6205 @opindex fsplit-wide-types
6206 When using a type that occupies multiple registers, such as @code{long
6207 long} on a 32-bit system, split the registers apart and allocate them
6208 independently.  This normally generates better code for those types,
6209 but may make debugging more difficult.
6211 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
6212 @option{-Os}.
6214 @item -fcse-follow-jumps
6215 @opindex fcse-follow-jumps
6216 In common subexpression elimination (CSE), scan through jump instructions
6217 when the target of the jump is not reached by any other path.  For
6218 example, when CSE encounters an @code{if} statement with an
6219 @code{else} clause, CSE will follow the jump when the condition
6220 tested is false.
6222 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6224 @item -fcse-skip-blocks
6225 @opindex fcse-skip-blocks
6226 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
6227 follow jumps which conditionally skip over blocks.  When CSE
6228 encounters a simple @code{if} statement with no else clause,
6229 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
6230 body of the @code{if}.
6232 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6234 @item -frerun-cse-after-loop
6235 @opindex frerun-cse-after-loop
6236 Re-run common subexpression elimination after loop optimizations has been
6237 performed.
6239 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6241 @item -fgcse
6242 @opindex fgcse
6243 Perform a global common subexpression elimination pass.
6244 This pass also performs global constant and copy propagation.
6246 @emph{Note:} When compiling a program using computed gotos, a GCC
6247 extension, you may get better runtime performance if you disable
6248 the global common subexpression elimination pass by adding
6249 @option{-fno-gcse} to the command line.
6251 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6253 @item -fgcse-lm
6254 @opindex fgcse-lm
6255 When @option{-fgcse-lm} is enabled, global common subexpression elimination will
6256 attempt to move loads which are only killed by stores into themselves.  This
6257 allows a loop containing a load/store sequence to be changed to a load outside
6258 the loop, and a copy/store within the loop.
6260 Enabled by default when gcse is enabled.
6262 @item -fgcse-sm
6263 @opindex fgcse-sm
6264 When @option{-fgcse-sm} is enabled, a store motion pass is run after
6265 global common subexpression elimination.  This pass will attempt to move
6266 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
6267 loops containing a load/store sequence can be changed to a load before
6268 the loop and a store after the loop.
6270 Not enabled at any optimization level.
6272 @item -fgcse-las
6273 @opindex fgcse-las
6274 When @option{-fgcse-las} is enabled, the global common subexpression
6275 elimination pass eliminates redundant loads that come after stores to the
6276 same memory location (both partial and full redundancies).
6278 Not enabled at any optimization level.
6280 @item -fgcse-after-reload
6281 @opindex fgcse-after-reload
6282 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
6283 pass is performed after reload.  The purpose of this pass is to cleanup
6284 redundant spilling.
6286 @item -funsafe-loop-optimizations
6287 @opindex funsafe-loop-optimizations
6288 If given, the loop optimizer will assume that loop indices do not
6289 overflow, and that the loops with nontrivial exit condition are not
6290 infinite.  This enables a wider range of loop optimizations even if
6291 the loop optimizer itself cannot prove that these assumptions are valid.
6292 Using @option{-Wunsafe-loop-optimizations}, the compiler will warn you
6293 if it finds this kind of loop.
6295 @item -fcrossjumping
6296 @opindex fcrossjumping
6297 Perform cross-jumping transformation.  This transformation unifies equivalent code and save code size.  The
6298 resulting code may or may not perform better than without cross-jumping.
6300 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6302 @item -fauto-inc-dec
6303 @opindex fauto-inc-dec
6304 Combine increments or decrements of addresses with memory accesses.
6305 This pass is always skipped on architectures that do not have
6306 instructions to support this.  Enabled by default at @option{-O} and
6307 higher on architectures that support this.
6309 @item -fdce
6310 @opindex fdce
6311 Perform dead code elimination (DCE) on RTL@.
6312 Enabled by default at @option{-O} and higher.
6314 @item -fdse
6315 @opindex fdse
6316 Perform dead store elimination (DSE) on RTL@.
6317 Enabled by default at @option{-O} and higher.
6319 @item -fif-conversion
6320 @opindex fif-conversion
6321 Attempt to transform conditional jumps into branch-less equivalents.  This
6322 include use of conditional moves, min, max, set flags and abs instructions, and
6323 some tricks doable by standard arithmetics.  The use of conditional execution
6324 on chips where it is available is controlled by @code{if-conversion2}.
6326 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6328 @item -fif-conversion2
6329 @opindex fif-conversion2
6330 Use conditional execution (where available) to transform conditional jumps into
6331 branch-less equivalents.
6333 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6335 @item -fdelete-null-pointer-checks
6336 @opindex fdelete-null-pointer-checks
6337 Assume that programs cannot safely dereference null pointers, and that
6338 no code or data element resides there.  This enables simple constant
6339 folding optimizations at all optimization levels.  In addition, other
6340 optimization passes in GCC use this flag to control global dataflow
6341 analyses that eliminate useless checks for null pointers; these assume
6342 that if a pointer is checked after it has already been dereferenced,
6343 it cannot be null.
6345 Note however that in some environments this assumption is not true.
6346 Use @option{-fno-delete-null-pointer-checks} to disable this optimization
6347 for programs which depend on that behavior.
6349 Some targets, especially embedded ones, disable this option at all levels.
6350 Otherwise it is enabled at all levels: @option{-O0}, @option{-O1},
6351 @option{-O2}, @option{-O3}, @option{-Os}.  Passes that use the information
6352 are enabled independently at different optimization levels.
6354 @item -fexpensive-optimizations
6355 @opindex fexpensive-optimizations
6356 Perform a number of minor optimizations that are relatively expensive.
6358 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6360 @item -foptimize-register-move
6361 @itemx -fregmove
6362 @opindex foptimize-register-move
6363 @opindex fregmove
6364 Attempt to reassign register numbers in move instructions and as
6365 operands of other simple instructions in order to maximize the amount of
6366 register tying.  This is especially helpful on machines with two-operand
6367 instructions.
6369 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
6370 optimization.
6372 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6374 @item -fira-algorithm=@var{algorithm}
6375 Use specified coloring algorithm for the integrated register
6376 allocator.  The @var{algorithm} argument should be @code{priority} or
6377 @code{CB}.  The first algorithm specifies Chow's priority coloring,
6378 the second one specifies Chaitin-Briggs coloring.  The second
6379 algorithm can be unimplemented for some architectures.  If it is
6380 implemented, it is the default because Chaitin-Briggs coloring as a
6381 rule generates a better code.
6383 @item -fira-region=@var{region}
6384 Use specified regions for the integrated register allocator.  The
6385 @var{region} argument should be one of @code{all}, @code{mixed}, or
6386 @code{one}.  The first value means using all loops as register
6387 allocation regions, the second value which is the default means using
6388 all loops except for loops with small register pressure as the
6389 regions, and third one means using all function as a single region.
6390 The first value can give best result for machines with small size and
6391 irregular register set, the third one results in faster and generates
6392 decent code and the smallest size code, and the default value usually
6393 give the best results in most cases and for most architectures.
6395 @item -fira-coalesce
6396 @opindex fira-coalesce
6397 Do optimistic register coalescing.  This option might be profitable for
6398 architectures with big regular register files.
6400 @item -fira-loop-pressure
6401 @opindex fira-loop-pressure
6402 Use IRA to evaluate register pressure in loops for decision to move
6403 loop invariants.  Usage of this option usually results in generation
6404 of faster and smaller code on machines with big register files (>= 32
6405 registers) but it can slow compiler down.
6407 This option is enabled at level @option{-O3} for some targets.
6409 @item -fno-ira-share-save-slots
6410 @opindex fno-ira-share-save-slots
6411 Switch off sharing stack slots used for saving call used hard
6412 registers living through a call.  Each hard register will get a
6413 separate stack slot and as a result function stack frame will be
6414 bigger.
6416 @item -fno-ira-share-spill-slots
6417 @opindex fno-ira-share-spill-slots
6418 Switch off sharing stack slots allocated for pseudo-registers.  Each
6419 pseudo-register which did not get a hard register will get a separate
6420 stack slot and as a result function stack frame will be bigger.
6422 @item -fira-verbose=@var{n}
6423 @opindex fira-verbose
6424 Set up how verbose dump file for the integrated register allocator
6425 will be.  Default value is 5.  If the value is greater or equal to 10,
6426 the dump file will be stderr as if the value were @var{n} minus 10.
6428 @item -fdelayed-branch
6429 @opindex fdelayed-branch
6430 If supported for the target machine, attempt to reorder instructions
6431 to exploit instruction slots available after delayed branch
6432 instructions.
6434 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6436 @item -fschedule-insns
6437 @opindex fschedule-insns
6438 If supported for the target machine, attempt to reorder instructions to
6439 eliminate execution stalls due to required data being unavailable.  This
6440 helps machines that have slow floating point or memory load instructions
6441 by allowing other instructions to be issued until the result of the load
6442 or floating point instruction is required.
6444 Enabled at levels @option{-O2}, @option{-O3}.
6446 @item -fschedule-insns2
6447 @opindex fschedule-insns2
6448 Similar to @option{-fschedule-insns}, but requests an additional pass of
6449 instruction scheduling after register allocation has been done.  This is
6450 especially useful on machines with a relatively small number of
6451 registers and where memory load instructions take more than one cycle.
6453 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6455 @item -fno-sched-interblock
6456 @opindex fno-sched-interblock
6457 Don't schedule instructions across basic blocks.  This is normally
6458 enabled by default when scheduling before register allocation, i.e.@:
6459 with @option{-fschedule-insns} or at @option{-O2} or higher.
6461 @item -fno-sched-spec
6462 @opindex fno-sched-spec
6463 Don't allow speculative motion of non-load instructions.  This is normally
6464 enabled by default when scheduling before register allocation, i.e.@:
6465 with @option{-fschedule-insns} or at @option{-O2} or higher.
6467 @item -fsched-pressure
6468 @opindex fsched-pressure
6469 Enable register pressure sensitive insn scheduling before the register
6470 allocation.  This only makes sense when scheduling before register
6471 allocation is enabled, i.e.@: with @option{-fschedule-insns} or at
6472 @option{-O2} or higher.  Usage of this option can improve the
6473 generated code and decrease its size by preventing register pressure
6474 increase above the number of available hard registers and as a
6475 consequence register spills in the register allocation.
6477 @item -fsched-spec-load
6478 @opindex fsched-spec-load
6479 Allow speculative motion of some load instructions.  This only makes
6480 sense when scheduling before register allocation, i.e.@: with
6481 @option{-fschedule-insns} or at @option{-O2} or higher.
6483 @item -fsched-spec-load-dangerous
6484 @opindex fsched-spec-load-dangerous
6485 Allow speculative motion of more load instructions.  This only makes
6486 sense when scheduling before register allocation, i.e.@: with
6487 @option{-fschedule-insns} or at @option{-O2} or higher.
6489 @item -fsched-stalled-insns
6490 @itemx -fsched-stalled-insns=@var{n}
6491 @opindex fsched-stalled-insns
6492 Define how many insns (if any) can be moved prematurely from the queue
6493 of stalled insns into the ready list, during the second scheduling pass.
6494 @option{-fno-sched-stalled-insns} means that no insns will be moved
6495 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
6496 on how many queued insns can be moved prematurely.
6497 @option{-fsched-stalled-insns} without a value is equivalent to
6498 @option{-fsched-stalled-insns=1}.
6500 @item -fsched-stalled-insns-dep
6501 @itemx -fsched-stalled-insns-dep=@var{n}
6502 @opindex fsched-stalled-insns-dep
6503 Define how many insn groups (cycles) will be examined for a dependency
6504 on a stalled insn that is candidate for premature removal from the queue
6505 of stalled insns.  This has an effect only during the second scheduling pass,
6506 and only if @option{-fsched-stalled-insns} is used.
6507 @option{-fno-sched-stalled-insns-dep} is equivalent to
6508 @option{-fsched-stalled-insns-dep=0}.
6509 @option{-fsched-stalled-insns-dep} without a value is equivalent to
6510 @option{-fsched-stalled-insns-dep=1}.
6512 @item -fsched2-use-superblocks
6513 @opindex fsched2-use-superblocks
6514 When scheduling after register allocation, do use superblock scheduling
6515 algorithm.  Superblock scheduling allows motion across basic block boundaries
6516 resulting on faster schedules.  This option is experimental, as not all machine
6517 descriptions used by GCC model the CPU closely enough to avoid unreliable
6518 results from the algorithm.
6520 This only makes sense when scheduling after register allocation, i.e.@: with
6521 @option{-fschedule-insns2} or at @option{-O2} or higher.
6523 @item -fsched-group-heuristic
6524 @opindex fsched-group-heuristic
6525 Enable the group heuristic in the scheduler.  This heuristic favors 
6526 the instruction that belongs to a schedule group.  This is enabled 
6527 by default when scheduling is enabled, i.e.@: with @option{-fschedule-insns} 
6528 or @option{-fschedule-insns2} or at @option{-O2} or higher.
6530 @item -fsched-critical-path-heuristic
6531 @opindex fsched-critical-path-heuristic
6532 Enable the critical-path heuristic in the scheduler.  This heuristic favors 
6533 instructions on the critical path.  This is enabled by default when 
6534 scheduling is enabled, i.e.@: with @option{-fschedule-insns} 
6535 or @option{-fschedule-insns2} or at @option{-O2} or higher.
6537 @item -fsched-spec-insn-heuristic
6538 @opindex fsched-spec-insn-heuristic
6539 Enable the speculative instruction heuristic in the scheduler.  This 
6540 heuristic favors speculative instructions with greater dependency weakness.  
6541 This is enabled by default when scheduling is enabled, i.e.@: 
6542 with @option{-fschedule-insns} or @option{-fschedule-insns2} 
6543 or at @option{-O2} or higher.
6545 @item -fsched-rank-heuristic
6546 @opindex fsched-rank-heuristic
6547 Enable the rank heuristic in the scheduler.  This heuristic favors 
6548 the instruction belonging to a basic block with greater size or frequency.  
6549 This is enabled by default when scheduling is enabled, i.e.@: 
6550 with @option{-fschedule-insns} or @option{-fschedule-insns2} or 
6551 at @option{-O2} or higher.
6553 @item -fsched-last-insn-heuristic
6554 @opindex fsched-last-insn-heuristic
6555 Enable the last-instruction heuristic in the scheduler.  This heuristic 
6556 favors the instruction that is less dependent on the last instruction
6557 scheduled.  This is enabled by default when scheduling is enabled, 
6558 i.e.@: with @option{-fschedule-insns} or @option{-fschedule-insns2} or 
6559 at @option{-O2} or higher.
6561 @item -fsched-dep-count-heuristic
6562 @opindex fsched-dep-count-heuristic
6563 Enable the dependent-count heuristic in the scheduler.  This heuristic 
6564 favors the instruction that has more instructions depending on it.  
6565 This is enabled by default when scheduling is enabled, i.e.@: 
6566 with @option{-fschedule-insns} or @option{-fschedule-insns2} or 
6567 at @option{-O2} or higher.
6569 @item -freschedule-modulo-scheduled-loops
6570 @opindex freschedule-modulo-scheduled-loops
6571 The modulo scheduling comes before the traditional scheduling, if a loop
6572 was modulo scheduled we may want to prevent the later scheduling passes
6573 from changing its schedule, we use this option to control that.
6575 @item -fselective-scheduling
6576 @opindex fselective-scheduling
6577 Schedule instructions using selective scheduling algorithm.  Selective
6578 scheduling runs instead of the first scheduler pass.
6580 @item -fselective-scheduling2
6581 @opindex fselective-scheduling2
6582 Schedule instructions using selective scheduling algorithm.  Selective
6583 scheduling runs instead of the second scheduler pass.
6585 @item -fsel-sched-pipelining
6586 @opindex fsel-sched-pipelining
6587 Enable software pipelining of innermost loops during selective scheduling.
6588 This option has no effect until one of @option{-fselective-scheduling} or
6589 @option{-fselective-scheduling2} is turned on.
6591 @item -fsel-sched-pipelining-outer-loops
6592 @opindex fsel-sched-pipelining-outer-loops
6593 When pipelining loops during selective scheduling, also pipeline outer loops.
6594 This option has no effect until @option{-fsel-sched-pipelining} is turned on.
6596 @item -fcaller-saves
6597 @opindex fcaller-saves
6598 Enable values to be allocated in registers that will be clobbered by
6599 function calls, by emitting extra instructions to save and restore the
6600 registers around such calls.  Such allocation is done only when it
6601 seems to result in better code than would otherwise be produced.
6603 This option is always enabled by default on certain machines, usually
6604 those which have no call-preserved registers to use instead.
6606 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6608 @item -fconserve-stack
6609 @opindex fconserve-stack
6610 Attempt to minimize stack usage.  The compiler will attempt to use less
6611 stack space, even if that makes the program slower.  This option
6612 implies setting the @option{large-stack-frame} parameter to 100
6613 and the @option{large-stack-frame-growth} parameter to 400.
6615 @item -ftree-reassoc
6616 @opindex ftree-reassoc
6617 Perform reassociation on trees.  This flag is enabled by default
6618 at @option{-O} and higher.
6620 @item -ftree-pre
6621 @opindex ftree-pre
6622 Perform partial redundancy elimination (PRE) on trees.  This flag is
6623 enabled by default at @option{-O2} and @option{-O3}.
6625 @item -ftree-forwprop
6626 @opindex ftree-forwprop
6627 Perform forward propagation on trees.  This flag is enabled by default
6628 at @option{-O} and higher.
6630 @item -ftree-fre
6631 @opindex ftree-fre
6632 Perform full redundancy elimination (FRE) on trees.  The difference
6633 between FRE and PRE is that FRE only considers expressions
6634 that are computed on all paths leading to the redundant computation.
6635 This analysis is faster than PRE, though it exposes fewer redundancies.
6636 This flag is enabled by default at @option{-O} and higher.
6638 @item -ftree-phiprop
6639 @opindex ftree-phiprop
6640 Perform hoisting of loads from conditional pointers on trees.  This
6641 pass is enabled by default at @option{-O} and higher.
6643 @item -ftree-copy-prop
6644 @opindex ftree-copy-prop
6645 Perform copy propagation on trees.  This pass eliminates unnecessary
6646 copy operations.  This flag is enabled by default at @option{-O} and
6647 higher.
6649 @item -fipa-pure-const
6650 @opindex fipa-pure-const
6651 Discover which functions are pure or constant.
6652 Enabled by default at @option{-O} and higher.
6654 @item -fipa-reference
6655 @opindex fipa-reference
6656 Discover which static variables do not escape cannot escape the
6657 compilation unit.
6658 Enabled by default at @option{-O} and higher.
6660 @item -fipa-struct-reorg
6661 @opindex fipa-struct-reorg
6662 Perform structure reorganization optimization, that change C-like structures
6663 layout in order to better utilize spatial locality.  This transformation is
6664 affective for programs containing arrays of structures.  Available in two
6665 compilation modes: profile-based (enabled with @option{-fprofile-generate})
6666 or static (which uses built-in heuristics).  It works only in whole program
6667 mode, so it requires @option{-fwhole-program} and @option{-combine} to be
6668 enabled.  Structures considered @samp{cold} by this transformation are not
6669 affected (see @option{--param struct-reorg-cold-struct-ratio=@var{value}}).
6671 With this flag, the program debug info reflects a new structure layout.
6673 @item -fipa-pta
6674 @opindex fipa-pta
6675 Perform interprocedural pointer analysis and interprocedural modification
6676 and reference analysis.  This option can cause excessive memory and
6677 compile-time usage on large compilation units.  It is not enabled by
6678 default at any optimization level.
6680 @item -fipa-profile
6681 @opindex fipa-profile
6682 Perform interprocedural profile propagation.  The functions called only from
6683 cold functions are marked as cold. Also functions executed once (such as
6684 @code{cold}, @code{noreturn}, static constructors or destructors) are identified. Cold
6685 functions and loop less parts of functions executed once are then optimized for
6686 size.
6687 Enabled by default at @option{-O} and higher.
6689 @item -fipa-cp
6690 @opindex fipa-cp
6691 Perform interprocedural constant propagation.
6692 This optimization analyzes the program to determine when values passed
6693 to functions are constants and then optimizes accordingly.
6694 This optimization can substantially increase performance
6695 if the application has constants passed to functions.
6696 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
6698 @item -fipa-cp-clone
6699 @opindex fipa-cp-clone
6700 Perform function cloning to make interprocedural constant propagation stronger.
6701 When enabled, interprocedural constant propagation will perform function cloning
6702 when externally visible function can be called with constant arguments.
6703 Because this optimization can create multiple copies of functions,
6704 it may significantly increase code size
6705 (see @option{--param ipcp-unit-growth=@var{value}}).
6706 This flag is enabled by default at @option{-O3}.
6708 @item -fipa-matrix-reorg
6709 @opindex fipa-matrix-reorg
6710 Perform matrix flattening and transposing.
6711 Matrix flattening tries to replace an @math{m}-dimensional matrix
6712 with its equivalent @math{n}-dimensional matrix, where @math{n < m}.
6713 This reduces the level of indirection needed for accessing the elements
6714 of the matrix. The second optimization is matrix transposing that
6715 attempts to change the order of the matrix's dimensions in order to
6716 improve cache locality.
6717 Both optimizations need the @option{-fwhole-program} flag.
6718 Transposing is enabled only if profiling information is available.
6720 @item -ftree-sink
6721 @opindex ftree-sink
6722 Perform forward store motion  on trees.  This flag is
6723 enabled by default at @option{-O} and higher.
6725 @item -ftree-ccp
6726 @opindex ftree-ccp
6727 Perform sparse conditional constant propagation (CCP) on trees.  This
6728 pass only operates on local scalar variables and is enabled by default
6729 at @option{-O} and higher.
6731 @item -ftree-switch-conversion
6732 Perform conversion of simple initializations in a switch to
6733 initializations from a scalar array.  This flag is enabled by default
6734 at @option{-O2} and higher.
6736 @item -ftree-dce
6737 @opindex ftree-dce
6738 Perform dead code elimination (DCE) on trees.  This flag is enabled by
6739 default at @option{-O} and higher.
6741 @item -ftree-builtin-call-dce
6742 @opindex ftree-builtin-call-dce
6743 Perform conditional dead code elimination (DCE) for calls to builtin functions
6744 that may set @code{errno} but are otherwise side-effect free.  This flag is
6745 enabled by default at @option{-O2} and higher if @option{-Os} is not also
6746 specified.
6748 @item -ftree-dominator-opts
6749 @opindex ftree-dominator-opts
6750 Perform a variety of simple scalar cleanups (constant/copy
6751 propagation, redundancy elimination, range propagation and expression
6752 simplification) based on a dominator tree traversal.  This also
6753 performs jump threading (to reduce jumps to jumps). This flag is
6754 enabled by default at @option{-O} and higher.
6756 @item -ftree-dse
6757 @opindex ftree-dse
6758 Perform dead store elimination (DSE) on trees.  A dead store is a store into
6759 a memory location which will later be overwritten by another store without
6760 any intervening loads.  In this case the earlier store can be deleted.  This
6761 flag is enabled by default at @option{-O} and higher.
6763 @item -ftree-ch
6764 @opindex ftree-ch
6765 Perform loop header copying on trees.  This is beneficial since it increases
6766 effectiveness of code motion optimizations.  It also saves one jump.  This flag
6767 is enabled by default at @option{-O} and higher.  It is not enabled
6768 for @option{-Os}, since it usually increases code size.
6770 @item -ftree-loop-optimize
6771 @opindex ftree-loop-optimize
6772 Perform loop optimizations on trees.  This flag is enabled by default
6773 at @option{-O} and higher.
6775 @item -ftree-loop-linear
6776 @opindex ftree-loop-linear
6777 Perform linear loop transformations on tree.  This flag can improve cache
6778 performance and allow further loop optimizations to take place.
6780 @item -floop-interchange
6781 Perform loop interchange transformations on loops.  Interchanging two
6782 nested loops switches the inner and outer loops.  For example, given a
6783 loop like:
6784 @smallexample
6785 DO J = 1, M
6786   DO I = 1, N
6787     A(J, I) = A(J, I) * C
6788   ENDDO
6789 ENDDO
6790 @end smallexample
6791 loop interchange will transform the loop as if the user had written:
6792 @smallexample
6793 DO I = 1, N
6794   DO J = 1, M
6795     A(J, I) = A(J, I) * C
6796   ENDDO
6797 ENDDO
6798 @end smallexample
6799 which can be beneficial when @code{N} is larger than the caches,
6800 because in Fortran, the elements of an array are stored in memory
6801 contiguously by column, and the original loop iterates over rows,
6802 potentially creating at each access a cache miss.  This optimization
6803 applies to all the languages supported by GCC and is not limited to
6804 Fortran.  To use this code transformation, GCC has to be configured
6805 with @option{--with-ppl} and @option{--with-cloog} to enable the
6806 Graphite loop transformation infrastructure.
6808 @item -floop-strip-mine
6809 Perform loop strip mining transformations on loops.  Strip mining
6810 splits a loop into two nested loops.  The outer loop has strides
6811 equal to the strip size and the inner loop has strides of the
6812 original loop within a strip.  The strip length can be changed
6813 using the @option{loop-block-tile-size} parameter.  For example,
6814 given a loop like:
6815 @smallexample
6816 DO I = 1, N
6817   A(I) = A(I) + C
6818 ENDDO
6819 @end smallexample
6820 loop strip mining will transform the loop as if the user had written:
6821 @smallexample
6822 DO II = 1, N, 51
6823   DO I = II, min (II + 50, N)
6824     A(I) = A(I) + C
6825   ENDDO
6826 ENDDO
6827 @end smallexample
6828 This optimization applies to all the languages supported by GCC and is
6829 not limited to Fortran.  To use this code transformation, GCC has to
6830 be configured with @option{--with-ppl} and @option{--with-cloog} to
6831 enable the Graphite loop transformation infrastructure.
6833 @item -floop-block
6834 Perform loop blocking transformations on loops.  Blocking strip mines
6835 each loop in the loop nest such that the memory accesses of the
6836 element loops fit inside caches.  The strip length can be changed
6837 using the @option{loop-block-tile-size} parameter.  For example, given
6838 a loop like:
6839 @smallexample
6840 DO I = 1, N
6841   DO J = 1, M
6842     A(J, I) = B(I) + C(J)
6843   ENDDO
6844 ENDDO
6845 @end smallexample
6846 loop blocking will transform the loop as if the user had written:
6847 @smallexample
6848 DO II = 1, N, 51
6849   DO JJ = 1, M, 51
6850     DO I = II, min (II + 50, N)
6851       DO J = JJ, min (JJ + 50, M)
6852         A(J, I) = B(I) + C(J)
6853       ENDDO
6854     ENDDO
6855   ENDDO
6856 ENDDO
6857 @end smallexample
6858 which can be beneficial when @code{M} is larger than the caches,
6859 because the innermost loop will iterate over a smaller amount of data
6860 that can be kept in the caches.  This optimization applies to all the
6861 languages supported by GCC and is not limited to Fortran.  To use this
6862 code transformation, GCC has to be configured with @option{--with-ppl}
6863 and @option{--with-cloog} to enable the Graphite loop transformation
6864 infrastructure.
6866 @item -fgraphite-identity
6867 @opindex fgraphite-identity
6868 Enable the identity transformation for graphite.  For every SCoP we generate
6869 the polyhedral representation and transform it back to gimple.  Using
6870 @option{-fgraphite-identity} we can check the costs or benefits of the
6871 GIMPLE -> GRAPHITE -> GIMPLE transformation.  Some minimal optimizations
6872 are also performed by the code generator CLooG, like index splitting and
6873 dead code elimination in loops.
6875 @item -floop-parallelize-all
6876 Use the Graphite data dependence analysis to identify loops that can
6877 be parallelized.  Parallelize all the loops that can be analyzed to
6878 not contain loop carried dependences without checking that it is
6879 profitable to parallelize the loops.
6881 @item -fcheck-data-deps
6882 @opindex fcheck-data-deps
6883 Compare the results of several data dependence analyzers.  This option
6884 is used for debugging the data dependence analyzers.
6886 @item -ftree-loop-distribution
6887 Perform loop distribution.  This flag can improve cache performance on
6888 big loop bodies and allow further loop optimizations, like
6889 parallelization or vectorization, to take place.  For example, the loop
6890 @smallexample
6891 DO I = 1, N
6892   A(I) = B(I) + C
6893   D(I) = E(I) * F
6894 ENDDO
6895 @end smallexample
6896 is transformed to
6897 @smallexample
6898 DO I = 1, N
6899    A(I) = B(I) + C
6900 ENDDO
6901 DO I = 1, N
6902    D(I) = E(I) * F
6903 ENDDO
6904 @end smallexample
6906 @item -ftree-loop-im
6907 @opindex ftree-loop-im
6908 Perform loop invariant motion on trees.  This pass moves only invariants that
6909 would be hard to handle at RTL level (function calls, operations that expand to
6910 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
6911 operands of conditions that are invariant out of the loop, so that we can use
6912 just trivial invariantness analysis in loop unswitching.  The pass also includes
6913 store motion.
6915 @item -ftree-loop-ivcanon
6916 @opindex ftree-loop-ivcanon
6917 Create a canonical counter for number of iterations in the loop for that
6918 determining number of iterations requires complicated analysis.  Later
6919 optimizations then may determine the number easily.  Useful especially
6920 in connection with unrolling.
6922 @item -fivopts
6923 @opindex fivopts
6924 Perform induction variable optimizations (strength reduction, induction
6925 variable merging and induction variable elimination) on trees.
6927 @item -ftree-parallelize-loops=n
6928 @opindex ftree-parallelize-loops
6929 Parallelize loops, i.e., split their iteration space to run in n threads.
6930 This is only possible for loops whose iterations are independent
6931 and can be arbitrarily reordered.  The optimization is only
6932 profitable on multiprocessor machines, for loops that are CPU-intensive,
6933 rather than constrained e.g.@: by memory bandwidth.  This option
6934 implies @option{-pthread}, and thus is only supported on targets
6935 that have support for @option{-pthread}.
6937 @item -ftree-pta
6938 @opindex ftree-pta
6939 Perform function-local points-to analysis on trees.  This flag is
6940 enabled by default at @option{-O} and higher.
6942 @item -ftree-sra
6943 @opindex ftree-sra
6944 Perform scalar replacement of aggregates.  This pass replaces structure
6945 references with scalars to prevent committing structures to memory too
6946 early.  This flag is enabled by default at @option{-O} and higher.
6948 @item -ftree-copyrename
6949 @opindex ftree-copyrename
6950 Perform copy renaming on trees.  This pass attempts to rename compiler
6951 temporaries to other variables at copy locations, usually resulting in
6952 variable names which more closely resemble the original variables.  This flag
6953 is enabled by default at @option{-O} and higher.
6955 @item -ftree-ter
6956 @opindex ftree-ter
6957 Perform temporary expression replacement during the SSA->normal phase.  Single
6958 use/single def temporaries are replaced at their use location with their
6959 defining expression.  This results in non-GIMPLE code, but gives the expanders
6960 much more complex trees to work on resulting in better RTL generation.  This is
6961 enabled by default at @option{-O} and higher.
6963 @item -ftree-vectorize
6964 @opindex ftree-vectorize
6965 Perform loop vectorization on trees. This flag is enabled by default at
6966 @option{-O3}.
6968 @item -ftree-slp-vectorize
6969 @opindex ftree-slp-vectorize
6970 Perform basic block vectorization on trees. This flag is enabled by default at
6971 @option{-O3} and when @option{-ftree-vectorize} is enabled.
6973 @item -ftree-vect-loop-version
6974 @opindex ftree-vect-loop-version
6975 Perform loop versioning when doing loop vectorization on trees.  When a loop
6976 appears to be vectorizable except that data alignment or data dependence cannot
6977 be determined at compile time then vectorized and non-vectorized versions of
6978 the loop are generated along with runtime checks for alignment or dependence
6979 to control which version is executed.  This option is enabled by default
6980 except at level @option{-Os} where it is disabled.
6982 @item -fvect-cost-model
6983 @opindex fvect-cost-model
6984 Enable cost model for vectorization.
6986 @item -ftree-vrp
6987 @opindex ftree-vrp
6988 Perform Value Range Propagation on trees.  This is similar to the
6989 constant propagation pass, but instead of values, ranges of values are
6990 propagated.  This allows the optimizers to remove unnecessary range
6991 checks like array bound checks and null pointer checks.  This is
6992 enabled by default at @option{-O2} and higher.  Null pointer check
6993 elimination is only done if @option{-fdelete-null-pointer-checks} is
6994 enabled.
6996 @item -ftracer
6997 @opindex ftracer
6998 Perform tail duplication to enlarge superblock size.  This transformation
6999 simplifies the control flow of the function allowing other optimizations to do
7000 better job.
7002 @item -funroll-loops
7003 @opindex funroll-loops
7004 Unroll loops whose number of iterations can be determined at compile
7005 time or upon entry to the loop.  @option{-funroll-loops} implies
7006 @option{-frerun-cse-after-loop}.  This option makes code larger,
7007 and may or may not make it run faster.
7009 @item -funroll-all-loops
7010 @opindex funroll-all-loops
7011 Unroll all loops, even if their number of iterations is uncertain when
7012 the loop is entered.  This usually makes programs run more slowly.
7013 @option{-funroll-all-loops} implies the same options as
7014 @option{-funroll-loops},
7016 @item -fsplit-ivs-in-unroller
7017 @opindex fsplit-ivs-in-unroller
7018 Enables expressing of values of induction variables in later iterations
7019 of the unrolled loop using the value in the first iteration.  This breaks
7020 long dependency chains, thus improving efficiency of the scheduling passes.
7022 Combination of @option{-fweb} and CSE is often sufficient to obtain the
7023 same effect.  However in cases the loop body is more complicated than
7024 a single basic block, this is not reliable.  It also does not work at all
7025 on some of the architectures due to restrictions in the CSE pass.
7027 This optimization is enabled by default.
7029 @item -fvariable-expansion-in-unroller
7030 @opindex fvariable-expansion-in-unroller
7031 With this option, the compiler will create multiple copies of some
7032 local variables when unrolling a loop which can result in superior code.
7034 @item -fpartial-inlining
7035 @opindex fpartial-inlining
7036 Inline parts of functions.  This option has any effect only
7037 when inlining itself is turned on by the @option{-finline-functions}
7038 or @option{-finline-small-functions} options.
7040 Enabled at level @option{-O2}.
7042 @item -fpredictive-commoning
7043 @opindex fpredictive-commoning
7044 Perform predictive commoning optimization, i.e., reusing computations
7045 (especially memory loads and stores) performed in previous
7046 iterations of loops.
7048 This option is enabled at level @option{-O3}.
7050 @item -fprefetch-loop-arrays
7051 @opindex fprefetch-loop-arrays
7052 If supported by the target machine, generate instructions to prefetch
7053 memory to improve the performance of loops that access large arrays.
7055 This option may generate better or worse code; results are highly
7056 dependent on the structure of loops within the source code.
7058 Disabled at level @option{-Os}.
7060 @item -fno-peephole
7061 @itemx -fno-peephole2
7062 @opindex fno-peephole
7063 @opindex fno-peephole2
7064 Disable any machine-specific peephole optimizations.  The difference
7065 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
7066 are implemented in the compiler; some targets use one, some use the
7067 other, a few use both.
7069 @option{-fpeephole} is enabled by default.
7070 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7072 @item -fno-guess-branch-probability
7073 @opindex fno-guess-branch-probability
7074 Do not guess branch probabilities using heuristics.
7076 GCC will use heuristics to guess branch probabilities if they are
7077 not provided by profiling feedback (@option{-fprofile-arcs}).  These
7078 heuristics are based on the control flow graph.  If some branch probabilities
7079 are specified by @samp{__builtin_expect}, then the heuristics will be
7080 used to guess branch probabilities for the rest of the control flow graph,
7081 taking the @samp{__builtin_expect} info into account.  The interactions
7082 between the heuristics and @samp{__builtin_expect} can be complex, and in
7083 some cases, it may be useful to disable the heuristics so that the effects
7084 of @samp{__builtin_expect} are easier to understand.
7086 The default is @option{-fguess-branch-probability} at levels
7087 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7089 @item -freorder-blocks
7090 @opindex freorder-blocks
7091 Reorder basic blocks in the compiled function in order to reduce number of
7092 taken branches and improve code locality.
7094 Enabled at levels @option{-O2}, @option{-O3}.
7096 @item -freorder-blocks-and-partition
7097 @opindex freorder-blocks-and-partition
7098 In addition to reordering basic blocks in the compiled function, in order
7099 to reduce number of taken branches, partitions hot and cold basic blocks
7100 into separate sections of the assembly and .o files, to improve
7101 paging and cache locality performance.
7103 This optimization is automatically turned off in the presence of
7104 exception handling, for linkonce sections, for functions with a user-defined
7105 section attribute and on any architecture that does not support named
7106 sections.
7108 @item -freorder-functions
7109 @opindex freorder-functions
7110 Reorder functions in the object file in order to
7111 improve code locality.  This is implemented by using special
7112 subsections @code{.text.hot} for most frequently executed functions and
7113 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
7114 the linker so object file format must support named sections and linker must
7115 place them in a reasonable way.
7117 Also profile feedback must be available in to make this option effective.  See
7118 @option{-fprofile-arcs} for details.
7120 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7122 @item -fstrict-aliasing
7123 @opindex fstrict-aliasing
7124 Allow the compiler to assume the strictest aliasing rules applicable to
7125 the language being compiled.  For C (and C++), this activates
7126 optimizations based on the type of expressions.  In particular, an
7127 object of one type is assumed never to reside at the same address as an
7128 object of a different type, unless the types are almost the same.  For
7129 example, an @code{unsigned int} can alias an @code{int}, but not a
7130 @code{void*} or a @code{double}.  A character type may alias any other
7131 type.
7133 @anchor{Type-punning}Pay special attention to code like this:
7134 @smallexample
7135 union a_union @{
7136   int i;
7137   double d;
7140 int f() @{
7141   union a_union t;
7142   t.d = 3.0;
7143   return t.i;
7145 @end smallexample
7146 The practice of reading from a different union member than the one most
7147 recently written to (called ``type-punning'') is common.  Even with
7148 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
7149 is accessed through the union type.  So, the code above will work as
7150 expected.  @xref{Structures unions enumerations and bit-fields
7151 implementation}.  However, this code might not:
7152 @smallexample
7153 int f() @{
7154   union a_union t;
7155   int* ip;
7156   t.d = 3.0;
7157   ip = &t.i;
7158   return *ip;
7160 @end smallexample
7162 Similarly, access by taking the address, casting the resulting pointer
7163 and dereferencing the result has undefined behavior, even if the cast
7164 uses a union type, e.g.:
7165 @smallexample
7166 int f() @{
7167   double d = 3.0;
7168   return ((union a_union *) &d)->i;
7170 @end smallexample
7172 The @option{-fstrict-aliasing} option is enabled at levels
7173 @option{-O2}, @option{-O3}, @option{-Os}.
7175 @item -fstrict-overflow
7176 @opindex fstrict-overflow
7177 Allow the compiler to assume strict signed overflow rules, depending
7178 on the language being compiled.  For C (and C++) this means that
7179 overflow when doing arithmetic with signed numbers is undefined, which
7180 means that the compiler may assume that it will not happen.  This
7181 permits various optimizations.  For example, the compiler will assume
7182 that an expression like @code{i + 10 > i} will always be true for
7183 signed @code{i}.  This assumption is only valid if signed overflow is
7184 undefined, as the expression is false if @code{i + 10} overflows when
7185 using twos complement arithmetic.  When this option is in effect any
7186 attempt to determine whether an operation on signed numbers will
7187 overflow must be written carefully to not actually involve overflow.
7189 This option also allows the compiler to assume strict pointer
7190 semantics: given a pointer to an object, if adding an offset to that
7191 pointer does not produce a pointer to the same object, the addition is
7192 undefined.  This permits the compiler to conclude that @code{p + u >
7193 p} is always true for a pointer @code{p} and unsigned integer
7194 @code{u}.  This assumption is only valid because pointer wraparound is
7195 undefined, as the expression is false if @code{p + u} overflows using
7196 twos complement arithmetic.
7198 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
7199 that integer signed overflow is fully defined: it wraps.  When
7200 @option{-fwrapv} is used, there is no difference between
7201 @option{-fstrict-overflow} and @option{-fno-strict-overflow} for
7202 integers.  With @option{-fwrapv} certain types of overflow are
7203 permitted.  For example, if the compiler gets an overflow when doing
7204 arithmetic on constants, the overflowed value can still be used with
7205 @option{-fwrapv}, but not otherwise.
7207 The @option{-fstrict-overflow} option is enabled at levels
7208 @option{-O2}, @option{-O3}, @option{-Os}.
7210 @item -falign-functions
7211 @itemx -falign-functions=@var{n}
7212 @opindex falign-functions
7213 Align the start of functions to the next power-of-two greater than
7214 @var{n}, skipping up to @var{n} bytes.  For instance,
7215 @option{-falign-functions=32} aligns functions to the next 32-byte
7216 boundary, but @option{-falign-functions=24} would align to the next
7217 32-byte boundary only if this can be done by skipping 23 bytes or less.
7219 @option{-fno-align-functions} and @option{-falign-functions=1} are
7220 equivalent and mean that functions will not be aligned.
7222 Some assemblers only support this flag when @var{n} is a power of two;
7223 in that case, it is rounded up.
7225 If @var{n} is not specified or is zero, use a machine-dependent default.
7227 Enabled at levels @option{-O2}, @option{-O3}.
7229 @item -falign-labels
7230 @itemx -falign-labels=@var{n}
7231 @opindex falign-labels
7232 Align all branch targets to a power-of-two boundary, skipping up to
7233 @var{n} bytes like @option{-falign-functions}.  This option can easily
7234 make code slower, because it must insert dummy operations for when the
7235 branch target is reached in the usual flow of the code.
7237 @option{-fno-align-labels} and @option{-falign-labels=1} are
7238 equivalent and mean that labels will not be aligned.
7240 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
7241 are greater than this value, then their values are used instead.
7243 If @var{n} is not specified or is zero, use a machine-dependent default
7244 which is very likely to be @samp{1}, meaning no alignment.
7246 Enabled at levels @option{-O2}, @option{-O3}.
7248 @item -falign-loops
7249 @itemx -falign-loops=@var{n}
7250 @opindex falign-loops
7251 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
7252 like @option{-falign-functions}.  The hope is that the loop will be
7253 executed many times, which will make up for any execution of the dummy
7254 operations.
7256 @option{-fno-align-loops} and @option{-falign-loops=1} are
7257 equivalent and mean that loops will not be aligned.
7259 If @var{n} is not specified or is zero, use a machine-dependent default.
7261 Enabled at levels @option{-O2}, @option{-O3}.
7263 @item -falign-jumps
7264 @itemx -falign-jumps=@var{n}
7265 @opindex falign-jumps
7266 Align branch targets to a power-of-two boundary, for branch targets
7267 where the targets can only be reached by jumping, skipping up to @var{n}
7268 bytes like @option{-falign-functions}.  In this case, no dummy operations
7269 need be executed.
7271 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
7272 equivalent and mean that loops will not be aligned.
7274 If @var{n} is not specified or is zero, use a machine-dependent default.
7276 Enabled at levels @option{-O2}, @option{-O3}.
7278 @item -funit-at-a-time
7279 @opindex funit-at-a-time
7280 This option is left for compatibility reasons. @option{-funit-at-a-time}
7281 has no effect, while @option{-fno-unit-at-a-time} implies
7282 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
7284 Enabled by default.
7286 @item -fno-toplevel-reorder
7287 @opindex fno-toplevel-reorder
7288 Do not reorder top-level functions, variables, and @code{asm}
7289 statements.  Output them in the same order that they appear in the
7290 input file.  When this option is used, unreferenced static variables
7291 will not be removed.  This option is intended to support existing code
7292 which relies on a particular ordering.  For new code, it is better to
7293 use attributes.
7295 Enabled at level @option{-O0}.  When disabled explicitly, it also imply
7296 @option{-fno-section-anchors} that is otherwise enabled at @option{-O0} on some
7297 targets.
7299 @item -fweb
7300 @opindex fweb
7301 Constructs webs as commonly used for register allocation purposes and assign
7302 each web individual pseudo register.  This allows the register allocation pass
7303 to operate on pseudos directly, but also strengthens several other optimization
7304 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
7305 however, make debugging impossible, since variables will no longer stay in a
7306 ``home register''.
7308 Enabled by default with @option{-funroll-loops}.
7310 @item -fwhole-program
7311 @opindex fwhole-program
7312 Assume that the current compilation unit represents the whole program being
7313 compiled.  All public functions and variables with the exception of @code{main}
7314 and those merged by attribute @code{externally_visible} become static functions
7315 and in effect are optimized more aggressively by interprocedural optimizers. If @command{gold} is used as the linker plugin, @code{externally_visible} attributes are automatically added to functions (not variable yet due to a current @command{gold} issue) that are accessed outside of LTO objects according to resolution file produced by @command{gold}.  For other linkers that cannot generate resolution file, explicit @code{externally_visible} attributes are still necessary.
7316 While this option is equivalent to proper use of the @code{static} keyword for
7317 programs consisting of a single file, in combination with option
7318 @option{-combine}, @option{-flto} or @option{-fwhopr} this flag can be used to
7319 compile many smaller scale programs since the functions and variables become
7320 local for the whole combined compilation unit, not for the single source file
7321 itself.
7323 This option implies @option{-fwhole-file} for Fortran programs.
7325 @item -flto
7326 @opindex flto
7327 This option runs the standard link-time optimizer.  When invoked
7328 with source code, it generates GIMPLE (one of GCC's internal
7329 representations) and writes it to special ELF sections in the object
7330 file.  When the object files are linked together, all the function
7331 bodies are read from these ELF sections and instantiated as if they
7332 had been part of the same translation unit.
7334 To use the link-timer optimizer, @option{-flto} needs to be specified at
7335 compile time and during the final link.  For example,
7337 @smallexample
7338 gcc -c -O2 -flto foo.c
7339 gcc -c -O2 -flto bar.c
7340 gcc -o myprog -flto -O2 foo.o bar.o
7341 @end smallexample
7343 The first two invocations to GCC will save a bytecode representation
7344 of GIMPLE into special ELF sections inside @file{foo.o} and
7345 @file{bar.o}.  The final invocation will read the GIMPLE bytecode from
7346 @file{foo.o} and @file{bar.o}, merge the two files into a single
7347 internal image, and compile the result as usual.  Since both
7348 @file{foo.o} and @file{bar.o} are merged into a single image, this
7349 causes all the inter-procedural analyses and optimizations in GCC to
7350 work across the two files as if they were a single one.  This means,
7351 for example, that the inliner will be able to inline functions in
7352 @file{bar.o} into functions in @file{foo.o} and vice-versa.
7354 Another (simpler) way to enable link-time optimization is,
7356 @smallexample
7357 gcc -o myprog -flto -O2 foo.c bar.c
7358 @end smallexample
7360 The above will generate bytecode for @file{foo.c} and @file{bar.c},
7361 merge them together into a single GIMPLE representation and optimize
7362 them as usual to produce @file{myprog}.
7364 The only important thing to keep in mind is that to enable link-time
7365 optimizations the @option{-flto} flag needs to be passed to both the
7366 compile and the link commands.
7368 Note that when a file is compiled with @option{-flto}, the generated
7369 object file will be larger than a regular object file because it will
7370 contain GIMPLE bytecodes and the usual final code.  This means that
7371 object files with LTO information can be linked as a normal object
7372 file.  So, in the previous example, if the final link is done with
7374 @smallexample
7375 gcc -o myprog foo.o bar.o
7376 @end smallexample
7378 The only difference will be that no inter-procedural optimizations
7379 will be applied to produce @file{myprog}.  The two object files
7380 @file{foo.o} and @file{bar.o} will be simply sent to the regular
7381 linker.
7383 Additionally, the optimization flags used to compile individual files
7384 are not necessarily related to those used at link-time.  For instance,
7386 @smallexample
7387 gcc -c -O0 -flto foo.c
7388 gcc -c -O0 -flto bar.c
7389 gcc -o myprog -flto -O3 foo.o bar.o
7390 @end smallexample
7392 This will produce individual object files with unoptimized assembler
7393 code, but the resulting binary @file{myprog} will be optimized at
7394 @option{-O3}.  Now, if the final binary is generated without
7395 @option{-flto}, then @file{myprog} will not be optimized.
7397 When producing the final binary with @option{-flto}, GCC will only
7398 apply link-time optimizations to those files that contain bytecode.
7399 Therefore, you can mix and match object files and libraries with
7400 GIMPLE bytecodes and final object code.  GCC will automatically select
7401 which files to optimize in LTO mode and which files to link without
7402 further processing.
7404 There are some code generation flags that GCC will preserve when
7405 generating bytecodes, as they need to be used during the final link
7406 stage.  Currently, the following options are saved into the GIMPLE
7407 bytecode files: @option{-fPIC}, @option{-fcommon} and all the
7408 @option{-m} target flags.
7410 At link time, these options are read-in and reapplied.  Note that the
7411 current implementation makes no attempt at recognizing conflicting
7412 values for these options.  If two or more files have a conflicting
7413 value (e.g., one file is compiled with @option{-fPIC} and another
7414 isn't), the compiler will simply use the last value read from the
7415 bytecode files.  It is recommended, then, that all the files
7416 participating in the same link be compiled with the same options.
7418 Another feature of LTO is that it is possible to apply interprocedural
7419 optimizations on files written in different languages.  This requires
7420 some support in the language front end.  Currently, the C, C++ and
7421 Fortran front ends are capable of emitting GIMPLE bytecodes, so
7422 something like this should work
7424 @smallexample
7425 gcc -c -flto foo.c
7426 g++ -c -flto bar.cc
7427 gfortran -c -flto baz.f90
7428 g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
7429 @end smallexample
7431 Notice that the final link is done with @command{g++} to get the C++
7432 runtime libraries and @option{-lgfortran} is added to get the Fortran
7433 runtime libraries.  In general, when mixing languages in LTO mode, you
7434 should use the same link command used when mixing languages in a
7435 regular (non-LTO) compilation.  This means that if your build process
7436 was mixing languages before, all you need to add is @option{-flto} to
7437 all the compile and link commands.
7439 If LTO encounters objects with C linkage declared with incompatible
7440 types in separate translation units to be linked together (undefined
7441 behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be
7442 issued.  The behavior is still undefined at runtime.
7444 If object files containing GIMPLE bytecode are stored in a library
7445 archive, say @file{libfoo.a}, it is possible to extract and use them
7446 in an LTO link if you are using @command{gold} as the linker (which,
7447 in turn requires GCC to be configured with @option{--enable-gold}).
7448 To enable this feature, use the flag @option{-fuse-linker-plugin} at
7449 link-time:
7451 @smallexample
7452 gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
7453 @end smallexample
7455 With the linker plugin enabled, @command{gold} will extract the needed
7456 GIMPLE files from @file{libfoo.a} and pass them on to the running GCC
7457 to make them part of the aggregated GIMPLE image to be optimized.
7459 If you are not using @command{gold} and/or do not specify
7460 @option{-fuse-linker-plugin} then the objects inside @file{libfoo.a}
7461 will be extracted and linked as usual, but they will not participate
7462 in the LTO optimization process.
7464 Link time optimizations do not require the presence of the whole
7465 program to operate.  If the program does not require any symbols to
7466 be exported, it is possible to combine @option{-flto} and
7467 @option{-fwhopr} with @option{-fwhole-program} to allow the
7468 interprocedural optimizers to use more aggressive assumptions which
7469 may lead to improved optimization opportunities.
7471 Regarding portability: the current implementation of LTO makes no
7472 attempt at generating bytecode that can be ported between different
7473 types of hosts.  The bytecode files are versioned and there is a
7474 strict version check, so bytecode files generated in one version of
7475 GCC will not work with an older/newer version of GCC.
7477 Link time optimization does not play well with generating debugging
7478 information.  Combining @option{-flto} or @option{-fwhopr} with
7479 @option{-g} is experimental.
7481 This option is disabled by default.
7483 @item -fwhopr[=@var{n}]
7484 @opindex fwhopr
7485 This option is identical in functionality to @option{-flto} but it
7486 differs in how the final link stage is executed.  Instead of loading
7487 all the function bodies in memory, the callgraph is analyzed and
7488 optimization decisions are made (whole program analysis or WPA). Once
7489 optimization decisions are made, the callgraph is partitioned and the
7490 different sections are compiled separately (local transformations or
7491 LTRANS)@.  This process allows optimizations on very large programs
7492 that otherwise would not fit in memory.  This option enables
7493 @option{-fwpa} and @option{-fltrans} automatically.
7495 If you specify the optional @var{n} the link stage is executed in
7496 parallel using @var{n} parallel jobs by utilizing an installed
7497 @command{make} program.  The environment variable @env{MAKE} may be
7498 used to override the program used.
7500 Disabled by default.
7502 @item -fwpa
7503 @opindex fwpa
7504 This is an internal option used by GCC when compiling with
7505 @option{-fwhopr}.  You should never need to use it.
7507 This option runs the link-time optimizer in the whole-program-analysis
7508 (WPA) mode, which reads in summary information from all inputs and
7509 performs a whole-program analysis based on summary information only.
7510 It generates object files for subsequent runs of the link-time
7511 optimizer where individual object files are optimized using both
7512 summary information from the WPA mode and the actual function bodies.
7513 It then drives the LTRANS phase.
7515 Disabled by default.
7517 @item -fltrans
7518 @opindex fltrans
7519 This is an internal option used by GCC when compiling with
7520 @option{-fwhopr}.  You should never need to use it.
7522 This option runs the link-time optimizer in the local-transformation (LTRANS)
7523 mode, which reads in output from a previous run of the LTO in WPA mode.
7524 In the LTRANS mode, LTO optimizes an object and produces the final assembly.
7526 Disabled by default.
7528 @item -fltrans-output-list=@var{file}
7529 @opindex fltrans-output-list
7530 This is an internal option used by GCC when compiling with
7531 @option{-fwhopr}.  You should never need to use it.
7533 This option specifies a file to which the names of LTRANS output files are
7534 written.  This option is only meaningful in conjunction with @option{-fwpa}.
7536 Disabled by default.
7538 @item -flto-compression-level=@var{n}
7539 This option specifies the level of compression used for intermediate
7540 language written to LTO object files, and is only meaningful in
7541 conjunction with LTO mode (@option{-fwhopr}, @option{-flto}).  Valid
7542 values are 0 (no compression) to 9 (maximum compression).  Values
7543 outside this range are clamped to either 0 or 9.  If the option is not
7544 given, a default balanced compression setting is used.
7546 @item -flto-report
7547 Prints a report with internal details on the workings of the link-time
7548 optimizer.  The contents of this report vary from version to version,
7549 it is meant to be useful to GCC developers when processing object
7550 files in LTO mode (via @option{-fwhopr} or @option{-flto}).
7552 Disabled by default.
7554 @item -fuse-linker-plugin
7555 Enables the extraction of objects with GIMPLE bytecode information
7556 from library archives.  This option relies on features available only
7557 in @command{gold}, so to use this you must configure GCC with
7558 @option{--enable-gold}.  See @option{-flto} for a description on the
7559 effect of this flag and how to use it.
7561 Disabled by default.
7563 @item -fcprop-registers
7564 @opindex fcprop-registers
7565 After register allocation and post-register allocation instruction splitting,
7566 we perform a copy-propagation pass to try to reduce scheduling dependencies
7567 and occasionally eliminate the copy.
7569 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7571 @item -fprofile-correction
7572 @opindex fprofile-correction
7573 Profiles collected using an instrumented binary for multi-threaded programs may
7574 be inconsistent due to missed counter updates. When this option is specified,
7575 GCC will use heuristics to correct or smooth out such inconsistencies. By
7576 default, GCC will emit an error message when an inconsistent profile is detected.
7578 @item -fprofile-dir=@var{path}
7579 @opindex fprofile-dir
7581 Set the directory to search the profile data files in to @var{path}.
7582 This option affects only the profile data generated by
7583 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
7584 and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
7585 and its related options.
7586 By default, GCC will use the current directory as @var{path}
7587 thus the profile data file will appear in the same directory as the object file.
7589 @item -fprofile-generate
7590 @itemx -fprofile-generate=@var{path}
7591 @opindex fprofile-generate
7593 Enable options usually used for instrumenting application to produce
7594 profile useful for later recompilation with profile feedback based
7595 optimization.  You must use @option{-fprofile-generate} both when
7596 compiling and when linking your program.
7598 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
7600 If @var{path} is specified, GCC will look at the @var{path} to find
7601 the profile feedback data files. See @option{-fprofile-dir}.
7603 @item -fprofile-use
7604 @itemx -fprofile-use=@var{path}
7605 @opindex fprofile-use
7606 Enable profile feedback directed optimizations, and optimizations
7607 generally profitable only with profile feedback available.
7609 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
7610 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}
7612 By default, GCC emits an error message if the feedback profiles do not
7613 match the source code.  This error can be turned into a warning by using
7614 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
7615 code.
7617 If @var{path} is specified, GCC will look at the @var{path} to find
7618 the profile feedback data files. See @option{-fprofile-dir}.
7619 @end table
7621 The following options control compiler behavior regarding floating
7622 point arithmetic.  These options trade off between speed and
7623 correctness.  All must be specifically enabled.
7625 @table @gcctabopt
7626 @item -ffloat-store
7627 @opindex ffloat-store
7628 Do not store floating point variables in registers, and inhibit other
7629 options that might change whether a floating point value is taken from a
7630 register or memory.
7632 @cindex floating point precision
7633 This option prevents undesirable excess precision on machines such as
7634 the 68000 where the floating registers (of the 68881) keep more
7635 precision than a @code{double} is supposed to have.  Similarly for the
7636 x86 architecture.  For most programs, the excess precision does only
7637 good, but a few programs rely on the precise definition of IEEE floating
7638 point.  Use @option{-ffloat-store} for such programs, after modifying
7639 them to store all pertinent intermediate computations into variables.
7641 @item -fexcess-precision=@var{style}
7642 @opindex fexcess-precision
7643 This option allows further control over excess precision on machines
7644 where floating-point registers have more precision than the IEEE
7645 @code{float} and @code{double} types and the processor does not
7646 support operations rounding to those types.  By default,
7647 @option{-fexcess-precision=fast} is in effect; this means that
7648 operations are carried out in the precision of the registers and that
7649 it is unpredictable when rounding to the types specified in the source
7650 code takes place.  When compiling C, if
7651 @option{-fexcess-precision=standard} is specified then excess
7652 precision will follow the rules specified in ISO C99; in particular,
7653 both casts and assignments cause values to be rounded to their
7654 semantic types (whereas @option{-ffloat-store} only affects
7655 assignments).  This option is enabled by default for C if a strict
7656 conformance option such as @option{-std=c99} is used.
7658 @opindex mfpmath
7659 @option{-fexcess-precision=standard} is not implemented for languages
7660 other than C, and has no effect if
7661 @option{-funsafe-math-optimizations} or @option{-ffast-math} is
7662 specified.  On the x86, it also has no effect if @option{-mfpmath=sse}
7663 or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
7664 semantics apply without excess precision, and in the latter, rounding
7665 is unpredictable.
7667 @item -ffast-math
7668 @opindex ffast-math
7669 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
7670 @option{-ffinite-math-only}, @option{-fno-rounding-math},
7671 @option{-fno-signaling-nans} and @option{-fcx-limited-range}.
7673 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
7675 This option is not turned on by any @option{-O} option since
7676 it can result in incorrect output for programs which depend on
7677 an exact implementation of IEEE or ISO rules/specifications for
7678 math functions. It may, however, yield faster code for programs
7679 that do not require the guarantees of these specifications.
7681 @item -fno-math-errno
7682 @opindex fno-math-errno
7683 Do not set ERRNO after calling math functions that are executed
7684 with a single instruction, e.g., sqrt.  A program that relies on
7685 IEEE exceptions for math error handling may want to use this flag
7686 for speed while maintaining IEEE arithmetic compatibility.
7688 This option is not turned on by any @option{-O} option since
7689 it can result in incorrect output for programs which depend on
7690 an exact implementation of IEEE or ISO rules/specifications for
7691 math functions. It may, however, yield faster code for programs
7692 that do not require the guarantees of these specifications.
7694 The default is @option{-fmath-errno}.
7696 On Darwin systems, the math library never sets @code{errno}.  There is
7697 therefore no reason for the compiler to consider the possibility that
7698 it might, and @option{-fno-math-errno} is the default.
7700 @item -funsafe-math-optimizations
7701 @opindex funsafe-math-optimizations
7703 Allow optimizations for floating-point arithmetic that (a) assume
7704 that arguments and results are valid and (b) may violate IEEE or
7705 ANSI standards.  When used at link-time, it may include libraries
7706 or startup files that change the default FPU control word or other
7707 similar optimizations.
7709 This option is not turned on by any @option{-O} option since
7710 it can result in incorrect output for programs which depend on
7711 an exact implementation of IEEE or ISO rules/specifications for
7712 math functions. It may, however, yield faster code for programs
7713 that do not require the guarantees of these specifications.
7714 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
7715 @option{-fassociative-math} and @option{-freciprocal-math}.
7717 The default is @option{-fno-unsafe-math-optimizations}.
7719 @item -fassociative-math
7720 @opindex fassociative-math
7722 Allow re-association of operands in series of floating-point operations.
7723 This violates the ISO C and C++ language standard by possibly changing
7724 computation result.  NOTE: re-ordering may change the sign of zero as
7725 well as ignore NaNs and inhibit or create underflow or overflow (and
7726 thus cannot be used on a code which relies on rounding behavior like
7727 @code{(x + 2**52) - 2**52)}.  May also reorder floating-point comparisons
7728 and thus may not be used when ordered comparisons are required.
7729 This option requires that both @option{-fno-signed-zeros} and
7730 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
7731 much sense with @option{-frounding-math}. For Fortran the option
7732 is automatically enabled when both @option{-fno-signed-zeros} and
7733 @option{-fno-trapping-math} are in effect.
7735 The default is @option{-fno-associative-math}.
7737 @item -freciprocal-math
7738 @opindex freciprocal-math
7740 Allow the reciprocal of a value to be used instead of dividing by
7741 the value if this enables optimizations.  For example @code{x / y}
7742 can be replaced with @code{x * (1/y)} which is useful if @code{(1/y)}
7743 is subject to common subexpression elimination.  Note that this loses
7744 precision and increases the number of flops operating on the value.
7746 The default is @option{-fno-reciprocal-math}.
7748 @item -ffinite-math-only
7749 @opindex ffinite-math-only
7750 Allow optimizations for floating-point arithmetic that assume
7751 that arguments and results are not NaNs or +-Infs.
7753 This option is not turned on by any @option{-O} option since
7754 it can result in incorrect output for programs which depend on
7755 an exact implementation of IEEE or ISO rules/specifications for
7756 math functions. It may, however, yield faster code for programs
7757 that do not require the guarantees of these specifications.
7759 The default is @option{-fno-finite-math-only}.
7761 @item -fno-signed-zeros
7762 @opindex fno-signed-zeros
7763 Allow optimizations for floating point arithmetic that ignore the
7764 signedness of zero.  IEEE arithmetic specifies the behavior of
7765 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
7766 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
7767 This option implies that the sign of a zero result isn't significant.
7769 The default is @option{-fsigned-zeros}.
7771 @item -fno-trapping-math
7772 @opindex fno-trapping-math
7773 Compile code assuming that floating-point operations cannot generate
7774 user-visible traps.  These traps include division by zero, overflow,
7775 underflow, inexact result and invalid operation.  This option requires
7776 that @option{-fno-signaling-nans} be in effect.  Setting this option may
7777 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
7779 This option should never be turned on by any @option{-O} option since
7780 it can result in incorrect output for programs which depend on
7781 an exact implementation of IEEE or ISO rules/specifications for
7782 math functions.
7784 The default is @option{-ftrapping-math}.
7786 @item -frounding-math
7787 @opindex frounding-math
7788 Disable transformations and optimizations that assume default floating
7789 point rounding behavior.  This is round-to-zero for all floating point
7790 to integer conversions, and round-to-nearest for all other arithmetic
7791 truncations.  This option should be specified for programs that change
7792 the FP rounding mode dynamically, or that may be executed with a
7793 non-default rounding mode.  This option disables constant folding of
7794 floating point expressions at compile-time (which may be affected by
7795 rounding mode) and arithmetic transformations that are unsafe in the
7796 presence of sign-dependent rounding modes.
7798 The default is @option{-fno-rounding-math}.
7800 This option is experimental and does not currently guarantee to
7801 disable all GCC optimizations that are affected by rounding mode.
7802 Future versions of GCC may provide finer control of this setting
7803 using C99's @code{FENV_ACCESS} pragma.  This command line option
7804 will be used to specify the default state for @code{FENV_ACCESS}.
7806 @item -fsignaling-nans
7807 @opindex fsignaling-nans
7808 Compile code assuming that IEEE signaling NaNs may generate user-visible
7809 traps during floating-point operations.  Setting this option disables
7810 optimizations that may change the number of exceptions visible with
7811 signaling NaNs.  This option implies @option{-ftrapping-math}.
7813 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
7814 be defined.
7816 The default is @option{-fno-signaling-nans}.
7818 This option is experimental and does not currently guarantee to
7819 disable all GCC optimizations that affect signaling NaN behavior.
7821 @item -fsingle-precision-constant
7822 @opindex fsingle-precision-constant
7823 Treat floating point constant as single precision constant instead of
7824 implicitly converting it to double precision constant.
7826 @item -fcx-limited-range
7827 @opindex fcx-limited-range
7828 When enabled, this option states that a range reduction step is not
7829 needed when performing complex division.  Also, there is no checking
7830 whether the result of a complex multiplication or division is @code{NaN
7831 + I*NaN}, with an attempt to rescue the situation in that case.  The
7832 default is @option{-fno-cx-limited-range}, but is enabled by
7833 @option{-ffast-math}.
7835 This option controls the default setting of the ISO C99
7836 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
7837 all languages.
7839 @item -fcx-fortran-rules
7840 @opindex fcx-fortran-rules
7841 Complex multiplication and division follow Fortran rules.  Range
7842 reduction is done as part of complex division, but there is no checking
7843 whether the result of a complex multiplication or division is @code{NaN
7844 + I*NaN}, with an attempt to rescue the situation in that case.
7846 The default is @option{-fno-cx-fortran-rules}.
7848 @end table
7850 The following options control optimizations that may improve
7851 performance, but are not enabled by any @option{-O} options.  This
7852 section includes experimental options that may produce broken code.
7854 @table @gcctabopt
7855 @item -fbranch-probabilities
7856 @opindex fbranch-probabilities
7857 After running a program compiled with @option{-fprofile-arcs}
7858 (@pxref{Debugging Options,, Options for Debugging Your Program or
7859 @command{gcc}}), you can compile it a second time using
7860 @option{-fbranch-probabilities}, to improve optimizations based on
7861 the number of times each branch was taken.  When the program
7862 compiled with @option{-fprofile-arcs} exits it saves arc execution
7863 counts to a file called @file{@var{sourcename}.gcda} for each source
7864 file.  The information in this data file is very dependent on the
7865 structure of the generated code, so you must use the same source code
7866 and the same optimization options for both compilations.
7868 With @option{-fbranch-probabilities}, GCC puts a
7869 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
7870 These can be used to improve optimization.  Currently, they are only
7871 used in one place: in @file{reorg.c}, instead of guessing which path a
7872 branch is mostly to take, the @samp{REG_BR_PROB} values are used to
7873 exactly determine which path is taken more often.
7875 @item -fprofile-values
7876 @opindex fprofile-values
7877 If combined with @option{-fprofile-arcs}, it adds code so that some
7878 data about values of expressions in the program is gathered.
7880 With @option{-fbranch-probabilities}, it reads back the data gathered
7881 from profiling values of expressions and adds @samp{REG_VALUE_PROFILE}
7882 notes to instructions for their later usage in optimizations.
7884 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
7886 @item -fvpt
7887 @opindex fvpt
7888 If combined with @option{-fprofile-arcs}, it instructs the compiler to add
7889 a code to gather information about values of expressions.
7891 With @option{-fbranch-probabilities}, it reads back the data gathered
7892 and actually performs the optimizations based on them.
7893 Currently the optimizations include specialization of division operation
7894 using the knowledge about the value of the denominator.
7896 @item -frename-registers
7897 @opindex frename-registers
7898 Attempt to avoid false dependencies in scheduled code by making use
7899 of registers left over after register allocation.  This optimization
7900 will most benefit processors with lots of registers.  Depending on the
7901 debug information format adopted by the target, however, it can
7902 make debugging impossible, since variables will no longer stay in
7903 a ``home register''.
7905 Enabled by default with @option{-funroll-loops} and @option{-fpeel-loops}.
7907 @item -ftracer
7908 @opindex ftracer
7909 Perform tail duplication to enlarge superblock size.  This transformation
7910 simplifies the control flow of the function allowing other optimizations to do
7911 better job.
7913 Enabled with @option{-fprofile-use}.
7915 @item -funroll-loops
7916 @opindex funroll-loops
7917 Unroll loops whose number of iterations can be determined at compile time or
7918 upon entry to the loop.  @option{-funroll-loops} implies
7919 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
7920 It also turns on complete loop peeling (i.e.@: complete removal of loops with
7921 small constant number of iterations).  This option makes code larger, and may
7922 or may not make it run faster.
7924 Enabled with @option{-fprofile-use}.
7926 @item -funroll-all-loops
7927 @opindex funroll-all-loops
7928 Unroll all loops, even if their number of iterations is uncertain when
7929 the loop is entered.  This usually makes programs run more slowly.
7930 @option{-funroll-all-loops} implies the same options as
7931 @option{-funroll-loops}.
7933 @item -fpeel-loops
7934 @opindex fpeel-loops
7935 Peels the loops for that there is enough information that they do not
7936 roll much (from profile feedback).  It also turns on complete loop peeling
7937 (i.e.@: complete removal of loops with small constant number of iterations).
7939 Enabled with @option{-fprofile-use}.
7941 @item -fmove-loop-invariants
7942 @opindex fmove-loop-invariants
7943 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
7944 at level @option{-O1}
7946 @item -funswitch-loops
7947 @opindex funswitch-loops
7948 Move branches with loop invariant conditions out of the loop, with duplicates
7949 of the loop on both branches (modified according to result of the condition).
7951 @item -ffunction-sections
7952 @itemx -fdata-sections
7953 @opindex ffunction-sections
7954 @opindex fdata-sections
7955 Place each function or data item into its own section in the output
7956 file if the target supports arbitrary sections.  The name of the
7957 function or the name of the data item determines the section's name
7958 in the output file.
7960 Use these options on systems where the linker can perform optimizations
7961 to improve locality of reference in the instruction space.  Most systems
7962 using the ELF object format and SPARC processors running Solaris 2 have
7963 linkers with such optimizations.  AIX may have these optimizations in
7964 the future.
7966 Only use these options when there are significant benefits from doing
7967 so.  When you specify these options, the assembler and linker will
7968 create larger object and executable files and will also be slower.
7969 You will not be able to use @code{gprof} on all systems if you
7970 specify this option and you may have problems with debugging if
7971 you specify both this option and @option{-g}.
7973 @item -fbranch-target-load-optimize
7974 @opindex fbranch-target-load-optimize
7975 Perform branch target register load optimization before prologue / epilogue
7976 threading.
7977 The use of target registers can typically be exposed only during reload,
7978 thus hoisting loads out of loops and doing inter-block scheduling needs
7979 a separate optimization pass.
7981 @item -fbranch-target-load-optimize2
7982 @opindex fbranch-target-load-optimize2
7983 Perform branch target register load optimization after prologue / epilogue
7984 threading.
7986 @item -fbtr-bb-exclusive
7987 @opindex fbtr-bb-exclusive
7988 When performing branch target register load optimization, don't reuse
7989 branch target registers in within any basic block.
7991 @item -fstack-protector
7992 @opindex fstack-protector
7993 Emit extra code to check for buffer overflows, such as stack smashing
7994 attacks.  This is done by adding a guard variable to functions with
7995 vulnerable objects.  This includes functions that call alloca, and
7996 functions with buffers larger than 8 bytes.  The guards are initialized
7997 when a function is entered and then checked when the function exits.
7998 If a guard check fails, an error message is printed and the program exits.
8000 @item -fstack-protector-all
8001 @opindex fstack-protector-all
8002 Like @option{-fstack-protector} except that all functions are protected.
8004 @item -fsection-anchors
8005 @opindex fsection-anchors
8006 Try to reduce the number of symbolic address calculations by using
8007 shared ``anchor'' symbols to address nearby objects.  This transformation
8008 can help to reduce the number of GOT entries and GOT accesses on some
8009 targets.
8011 For example, the implementation of the following function @code{foo}:
8013 @smallexample
8014 static int a, b, c;
8015 int foo (void) @{ return a + b + c; @}
8016 @end smallexample
8018 would usually calculate the addresses of all three variables, but if you
8019 compile it with @option{-fsection-anchors}, it will access the variables
8020 from a common anchor point instead.  The effect is similar to the
8021 following pseudocode (which isn't valid C):
8023 @smallexample
8024 int foo (void)
8026   register int *xr = &x;
8027   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
8029 @end smallexample
8031 Not all targets support this option.
8033 @item --param @var{name}=@var{value}
8034 @opindex param
8035 In some places, GCC uses various constants to control the amount of
8036 optimization that is done.  For example, GCC will not inline functions
8037 that contain more that a certain number of instructions.  You can
8038 control some of these constants on the command-line using the
8039 @option{--param} option.
8041 The names of specific parameters, and the meaning of the values, are
8042 tied to the internals of the compiler, and are subject to change
8043 without notice in future releases.
8045 In each case, the @var{value} is an integer.  The allowable choices for
8046 @var{name} are given in the following table:
8048 @table @gcctabopt
8049 @item struct-reorg-cold-struct-ratio
8050 The threshold ratio (as a percentage) between a structure frequency
8051 and the frequency of the hottest structure in the program.  This parameter
8052 is used by struct-reorg optimization enabled by @option{-fipa-struct-reorg}.
8053 We say that if the ratio of a structure frequency, calculated by profiling,
8054 to the hottest structure frequency in the program is less than this
8055 parameter, then structure reorganization is not applied to this structure.
8056 The default is 10.
8058 @item predictable-branch-outcome
8059 When branch is predicted to be taken with probability lower than this threshold
8060 (in percent), then it is considered well predictable. The default is 10.
8062 @item max-crossjump-edges
8063 The maximum number of incoming edges to consider for crossjumping.
8064 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
8065 the number of edges incoming to each block.  Increasing values mean
8066 more aggressive optimization, making the compile time increase with
8067 probably small improvement in executable size.
8069 @item min-crossjump-insns
8070 The minimum number of instructions which must be matched at the end
8071 of two blocks before crossjumping will be performed on them.  This
8072 value is ignored in the case where all instructions in the block being
8073 crossjumped from are matched.  The default value is 5.
8075 @item max-grow-copy-bb-insns
8076 The maximum code size expansion factor when copying basic blocks
8077 instead of jumping.  The expansion is relative to a jump instruction.
8078 The default value is 8.
8080 @item max-goto-duplication-insns
8081 The maximum number of instructions to duplicate to a block that jumps
8082 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
8083 passes, GCC factors computed gotos early in the compilation process,
8084 and unfactors them as late as possible.  Only computed jumps at the
8085 end of a basic blocks with no more than max-goto-duplication-insns are
8086 unfactored.  The default value is 8.
8088 @item max-delay-slot-insn-search
8089 The maximum number of instructions to consider when looking for an
8090 instruction to fill a delay slot.  If more than this arbitrary number of
8091 instructions is searched, the time savings from filling the delay slot
8092 will be minimal so stop searching.  Increasing values mean more
8093 aggressive optimization, making the compile time increase with probably
8094 small improvement in executable run time.
8096 @item max-delay-slot-live-search
8097 When trying to fill delay slots, the maximum number of instructions to
8098 consider when searching for a block with valid live register
8099 information.  Increasing this arbitrarily chosen value means more
8100 aggressive optimization, increasing the compile time.  This parameter
8101 should be removed when the delay slot code is rewritten to maintain the
8102 control-flow graph.
8104 @item max-gcse-memory
8105 The approximate maximum amount of memory that will be allocated in
8106 order to perform the global common subexpression elimination
8107 optimization.  If more memory than specified is required, the
8108 optimization will not be done.
8110 @item max-pending-list-length
8111 The maximum number of pending dependencies scheduling will allow
8112 before flushing the current state and starting over.  Large functions
8113 with few branches or calls can create excessively large lists which
8114 needlessly consume memory and resources.
8116 @item max-inline-insns-single
8117 Several parameters control the tree inliner used in gcc.
8118 This number sets the maximum number of instructions (counted in GCC's
8119 internal representation) in a single function that the tree inliner
8120 will consider for inlining.  This only affects functions declared
8121 inline and methods implemented in a class declaration (C++).
8122 The default value is 300.
8124 @item max-inline-insns-auto
8125 When you use @option{-finline-functions} (included in @option{-O3}),
8126 a lot of functions that would otherwise not be considered for inlining
8127 by the compiler will be investigated.  To those functions, a different
8128 (more restrictive) limit compared to functions declared inline can
8129 be applied.
8130 The default value is 40.
8132 @item large-function-insns
8133 The limit specifying really large functions.  For functions larger than this
8134 limit after inlining, inlining is constrained by
8135 @option{--param large-function-growth}.  This parameter is useful primarily
8136 to avoid extreme compilation time caused by non-linear algorithms used by the
8137 backend.
8138 The default value is 2700.
8140 @item large-function-growth
8141 Specifies maximal growth of large function caused by inlining in percents.
8142 The default value is 100 which limits large function growth to 2.0 times
8143 the original size.
8145 @item large-unit-insns
8146 The limit specifying large translation unit.  Growth caused by inlining of
8147 units larger than this limit is limited by @option{--param inline-unit-growth}.
8148 For small units this might be too tight (consider unit consisting of function A
8149 that is inline and B that just calls A three time.  If B is small relative to
8150 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
8151 large units consisting of small inlineable functions however the overall unit
8152 growth limit is needed to avoid exponential explosion of code size.  Thus for
8153 smaller units, the size is increased to @option{--param large-unit-insns}
8154 before applying @option{--param inline-unit-growth}.  The default is 10000
8156 @item inline-unit-growth
8157 Specifies maximal overall growth of the compilation unit caused by inlining.
8158 The default value is 30 which limits unit growth to 1.3 times the original
8159 size.
8161 @item ipcp-unit-growth
8162 Specifies maximal overall growth of the compilation unit caused by
8163 interprocedural constant propagation.  The default value is 10 which limits
8164 unit growth to 1.1 times the original size.
8166 @item large-stack-frame
8167 The limit specifying large stack frames.  While inlining the algorithm is trying
8168 to not grow past this limit too much.  Default value is 256 bytes.
8170 @item large-stack-frame-growth
8171 Specifies maximal growth of large stack frames caused by inlining in percents.
8172 The default value is 1000 which limits large stack frame growth to 11 times
8173 the original size.
8175 @item max-inline-insns-recursive
8176 @itemx max-inline-insns-recursive-auto
8177 Specifies maximum number of instructions out-of-line copy of self recursive inline
8178 function can grow into by performing recursive inlining.
8180 For functions declared inline @option{--param max-inline-insns-recursive} is
8181 taken into account.  For function not declared inline, recursive inlining
8182 happens only when @option{-finline-functions} (included in @option{-O3}) is
8183 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
8184 default value is 450.
8186 @item max-inline-recursive-depth
8187 @itemx max-inline-recursive-depth-auto
8188 Specifies maximum recursion depth used by the recursive inlining.
8190 For functions declared inline @option{--param max-inline-recursive-depth} is
8191 taken into account.  For function not declared inline, recursive inlining
8192 happens only when @option{-finline-functions} (included in @option{-O3}) is
8193 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
8194 default value is 8.
8196 @item min-inline-recursive-probability
8197 Recursive inlining is profitable only for function having deep recursion
8198 in average and can hurt for function having little recursion depth by
8199 increasing the prologue size or complexity of function body to other
8200 optimizers.
8202 When profile feedback is available (see @option{-fprofile-generate}) the actual
8203 recursion depth can be guessed from probability that function will recurse via
8204 given call expression.  This parameter limits inlining only to call expression
8205 whose probability exceeds given threshold (in percents).  The default value is
8208 @item early-inlining-insns
8209 Specify growth that early inliner can make.  In effect it increases amount of
8210 inlining for code having large abstraction penalty.  The default value is 8.
8212 @item max-early-inliner-iterations
8213 @itemx max-early-inliner-iterations
8214 Limit of iterations of early inliner.  This basically bounds number of nested
8215 indirect calls early inliner can resolve.  Deeper chains are still handled by
8216 late inlining.
8218 @item min-vect-loop-bound
8219 The minimum number of iterations under which a loop will not get vectorized
8220 when @option{-ftree-vectorize} is used.  The number of iterations after
8221 vectorization needs to be greater than the value specified by this option
8222 to allow vectorization.  The default value is 0.
8224 @item max-unrolled-insns
8225 The maximum number of instructions that a loop should have if that loop
8226 is unrolled, and if the loop is unrolled, it determines how many times
8227 the loop code is unrolled.
8229 @item max-average-unrolled-insns
8230 The maximum number of instructions biased by probabilities of their execution
8231 that a loop should have if that loop is unrolled, and if the loop is unrolled,
8232 it determines how many times the loop code is unrolled.
8234 @item max-unroll-times
8235 The maximum number of unrollings of a single loop.
8237 @item max-peeled-insns
8238 The maximum number of instructions that a loop should have if that loop
8239 is peeled, and if the loop is peeled, it determines how many times
8240 the loop code is peeled.
8242 @item max-peel-times
8243 The maximum number of peelings of a single loop.
8245 @item max-completely-peeled-insns
8246 The maximum number of insns of a completely peeled loop.
8248 @item max-completely-peel-times
8249 The maximum number of iterations of a loop to be suitable for complete peeling.
8251 @item max-completely-peel-loop-nest-depth
8252 The maximum depth of a loop nest suitable for complete peeling.
8254 @item max-unswitch-insns
8255 The maximum number of insns of an unswitched loop.
8257 @item max-unswitch-level
8258 The maximum number of branches unswitched in a single loop.
8260 @item lim-expensive
8261 The minimum cost of an expensive expression in the loop invariant motion.
8263 @item iv-consider-all-candidates-bound
8264 Bound on number of candidates for induction variables below that
8265 all candidates are considered for each use in induction variable
8266 optimizations.  Only the most relevant candidates are considered
8267 if there are more candidates, to avoid quadratic time complexity.
8269 @item iv-max-considered-uses
8270 The induction variable optimizations give up on loops that contain more
8271 induction variable uses.
8273 @item iv-always-prune-cand-set-bound
8274 If number of candidates in the set is smaller than this value,
8275 we always try to remove unnecessary ivs from the set during its
8276 optimization when a new iv is added to the set.
8278 @item scev-max-expr-size
8279 Bound on size of expressions used in the scalar evolutions analyzer.
8280 Large expressions slow the analyzer.
8282 @item omega-max-vars
8283 The maximum number of variables in an Omega constraint system.
8284 The default value is 128.
8286 @item omega-max-geqs
8287 The maximum number of inequalities in an Omega constraint system.
8288 The default value is 256.
8290 @item omega-max-eqs
8291 The maximum number of equalities in an Omega constraint system.
8292 The default value is 128.
8294 @item omega-max-wild-cards
8295 The maximum number of wildcard variables that the Omega solver will
8296 be able to insert.  The default value is 18.
8298 @item omega-hash-table-size
8299 The size of the hash table in the Omega solver.  The default value is
8300 550.
8302 @item omega-max-keys
8303 The maximal number of keys used by the Omega solver.  The default
8304 value is 500.
8306 @item omega-eliminate-redundant-constraints
8307 When set to 1, use expensive methods to eliminate all redundant
8308 constraints.  The default value is 0.
8310 @item vect-max-version-for-alignment-checks
8311 The maximum number of runtime checks that can be performed when
8312 doing loop versioning for alignment in the vectorizer.  See option
8313 ftree-vect-loop-version for more information.
8315 @item vect-max-version-for-alias-checks
8316 The maximum number of runtime checks that can be performed when
8317 doing loop versioning for alias in the vectorizer.  See option
8318 ftree-vect-loop-version for more information.
8320 @item max-iterations-to-track
8322 The maximum number of iterations of a loop the brute force algorithm
8323 for analysis of # of iterations of the loop tries to evaluate.
8325 @item hot-bb-count-fraction
8326 Select fraction of the maximal count of repetitions of basic block in program
8327 given basic block needs to have to be considered hot.
8329 @item hot-bb-frequency-fraction
8330 Select fraction of the maximal frequency of executions of basic block in
8331 function given basic block needs to have to be considered hot
8333 @item max-predicted-iterations
8334 The maximum number of loop iterations we predict statically.  This is useful
8335 in cases where function contain single loop with known bound and other loop
8336 with unknown.  We predict the known number of iterations correctly, while
8337 the unknown number of iterations average to roughly 10.  This means that the
8338 loop without bounds would appear artificially cold relative to the other one.
8340 @item align-threshold
8342 Select fraction of the maximal frequency of executions of basic block in
8343 function given basic block will get aligned.
8345 @item align-loop-iterations
8347 A loop expected to iterate at lest the selected number of iterations will get
8348 aligned.
8350 @item tracer-dynamic-coverage
8351 @itemx tracer-dynamic-coverage-feedback
8353 This value is used to limit superblock formation once the given percentage of
8354 executed instructions is covered.  This limits unnecessary code size
8355 expansion.
8357 The @option{tracer-dynamic-coverage-feedback} is used only when profile
8358 feedback is available.  The real profiles (as opposed to statically estimated
8359 ones) are much less balanced allowing the threshold to be larger value.
8361 @item tracer-max-code-growth
8362 Stop tail duplication once code growth has reached given percentage.  This is
8363 rather hokey argument, as most of the duplicates will be eliminated later in
8364 cross jumping, so it may be set to much higher values than is the desired code
8365 growth.
8367 @item tracer-min-branch-ratio
8369 Stop reverse growth when the reverse probability of best edge is less than this
8370 threshold (in percent).
8372 @item tracer-min-branch-ratio
8373 @itemx tracer-min-branch-ratio-feedback
8375 Stop forward growth if the best edge do have probability lower than this
8376 threshold.
8378 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
8379 compilation for profile feedback and one for compilation without.  The value
8380 for compilation with profile feedback needs to be more conservative (higher) in
8381 order to make tracer effective.
8383 @item max-cse-path-length
8385 Maximum number of basic blocks on path that cse considers.  The default is 10.
8387 @item max-cse-insns
8388 The maximum instructions CSE process before flushing. The default is 1000.
8390 @item ggc-min-expand
8392 GCC uses a garbage collector to manage its own memory allocation.  This
8393 parameter specifies the minimum percentage by which the garbage
8394 collector's heap should be allowed to expand between collections.
8395 Tuning this may improve compilation speed; it has no effect on code
8396 generation.
8398 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
8399 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of "RAM" is
8400 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
8401 GCC is not able to calculate RAM on a particular platform, the lower
8402 bound of 30% is used.  Setting this parameter and
8403 @option{ggc-min-heapsize} to zero causes a full collection to occur at
8404 every opportunity.  This is extremely slow, but can be useful for
8405 debugging.
8407 @item ggc-min-heapsize
8409 Minimum size of the garbage collector's heap before it begins bothering
8410 to collect garbage.  The first collection occurs after the heap expands
8411 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
8412 tuning this may improve compilation speed, and has no effect on code
8413 generation.
8415 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit which
8416 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
8417 with a lower bound of 4096 (four megabytes) and an upper bound of
8418 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
8419 particular platform, the lower bound is used.  Setting this parameter
8420 very large effectively disables garbage collection.  Setting this
8421 parameter and @option{ggc-min-expand} to zero causes a full collection
8422 to occur at every opportunity.
8424 @item max-reload-search-insns
8425 The maximum number of instruction reload should look backward for equivalent
8426 register.  Increasing values mean more aggressive optimization, making the
8427 compile time increase with probably slightly better performance.  The default
8428 value is 100.
8430 @item max-cselib-memory-locations
8431 The maximum number of memory locations cselib should take into account.
8432 Increasing values mean more aggressive optimization, making the compile time
8433 increase with probably slightly better performance.  The default value is 500.
8435 @item reorder-blocks-duplicate
8436 @itemx reorder-blocks-duplicate-feedback
8438 Used by basic block reordering pass to decide whether to use unconditional
8439 branch or duplicate the code on its destination.  Code is duplicated when its
8440 estimated size is smaller than this value multiplied by the estimated size of
8441 unconditional jump in the hot spots of the program.
8443 The @option{reorder-block-duplicate-feedback} is used only when profile
8444 feedback is available and may be set to higher values than
8445 @option{reorder-block-duplicate} since information about the hot spots is more
8446 accurate.
8448 @item max-sched-ready-insns
8449 The maximum number of instructions ready to be issued the scheduler should
8450 consider at any given time during the first scheduling pass.  Increasing
8451 values mean more thorough searches, making the compilation time increase
8452 with probably little benefit.  The default value is 100.
8454 @item max-sched-region-blocks
8455 The maximum number of blocks in a region to be considered for
8456 interblock scheduling.  The default value is 10.
8458 @item max-pipeline-region-blocks
8459 The maximum number of blocks in a region to be considered for
8460 pipelining in the selective scheduler.  The default value is 15.
8462 @item max-sched-region-insns
8463 The maximum number of insns in a region to be considered for
8464 interblock scheduling.  The default value is 100.
8466 @item max-pipeline-region-insns
8467 The maximum number of insns in a region to be considered for
8468 pipelining in the selective scheduler.  The default value is 200.
8470 @item min-spec-prob
8471 The minimum probability (in percents) of reaching a source block
8472 for interblock speculative scheduling.  The default value is 40.
8474 @item max-sched-extend-regions-iters
8475 The maximum number of iterations through CFG to extend regions.
8476 0 - disable region extension,
8477 N - do at most N iterations.
8478 The default value is 0.
8480 @item max-sched-insn-conflict-delay
8481 The maximum conflict delay for an insn to be considered for speculative motion.
8482 The default value is 3.
8484 @item sched-spec-prob-cutoff
8485 The minimal probability of speculation success (in percents), so that
8486 speculative insn will be scheduled.
8487 The default value is 40.
8489 @item sched-mem-true-dep-cost
8490 Minimal distance (in CPU cycles) between store and load targeting same
8491 memory locations.  The default value is 1.
8493 @item selsched-max-lookahead
8494 The maximum size of the lookahead window of selective scheduling.  It is a
8495 depth of search for available instructions.
8496 The default value is 50.
8498 @item selsched-max-sched-times
8499 The maximum number of times that an instruction will be scheduled during
8500 selective scheduling.  This is the limit on the number of iterations
8501 through which the instruction may be pipelined.  The default value is 2.
8503 @item selsched-max-insns-to-rename
8504 The maximum number of best instructions in the ready list that are considered
8505 for renaming in the selective scheduler.  The default value is 2.
8507 @item max-last-value-rtl
8508 The maximum size measured as number of RTLs that can be recorded in an expression
8509 in combiner for a pseudo register as last known value of that register.  The default
8510 is 10000.
8512 @item integer-share-limit
8513 Small integer constants can use a shared data structure, reducing the
8514 compiler's memory usage and increasing its speed.  This sets the maximum
8515 value of a shared integer constant.  The default value is 256.
8517 @item min-virtual-mappings
8518 Specifies the minimum number of virtual mappings in the incremental
8519 SSA updater that should be registered to trigger the virtual mappings
8520 heuristic defined by virtual-mappings-ratio.  The default value is
8521 100.
8523 @item virtual-mappings-ratio
8524 If the number of virtual mappings is virtual-mappings-ratio bigger
8525 than the number of virtual symbols to be updated, then the incremental
8526 SSA updater switches to a full update for those symbols.  The default
8527 ratio is 3.
8529 @item ssp-buffer-size
8530 The minimum size of buffers (i.e.@: arrays) that will receive stack smashing
8531 protection when @option{-fstack-protection} is used.
8533 @item max-jump-thread-duplication-stmts
8534 Maximum number of statements allowed in a block that needs to be
8535 duplicated when threading jumps.
8537 @item max-fields-for-field-sensitive
8538 Maximum number of fields in a structure we will treat in
8539 a field sensitive manner during pointer analysis.  The default is zero
8540 for -O0, and -O1 and 100 for -Os, -O2, and -O3.
8542 @item prefetch-latency
8543 Estimate on average number of instructions that are executed before
8544 prefetch finishes.  The distance we prefetch ahead is proportional
8545 to this constant.  Increasing this number may also lead to less
8546 streams being prefetched (see @option{simultaneous-prefetches}).
8548 @item simultaneous-prefetches
8549 Maximum number of prefetches that can run at the same time.
8551 @item l1-cache-line-size
8552 The size of cache line in L1 cache, in bytes.
8554 @item l1-cache-size
8555 The size of L1 cache, in kilobytes.
8557 @item l2-cache-size
8558 The size of L2 cache, in kilobytes.
8560 @item min-insn-to-prefetch-ratio
8561 The minimum ratio between the number of instructions and the
8562 number of prefetches to enable prefetching in a loop.
8564 @item prefetch-min-insn-to-mem-ratio
8565 The minimum ratio between the number of instructions and the
8566 number of memory references to enable prefetching in a loop.
8568 @item use-canonical-types
8569 Whether the compiler should use the ``canonical'' type system.  By
8570 default, this should always be 1, which uses a more efficient internal
8571 mechanism for comparing types in C++ and Objective-C++.  However, if
8572 bugs in the canonical type system are causing compilation failures,
8573 set this value to 0 to disable canonical types.
8575 @item switch-conversion-max-branch-ratio
8576 Switch initialization conversion will refuse to create arrays that are
8577 bigger than @option{switch-conversion-max-branch-ratio} times the number of
8578 branches in the switch.
8580 @item max-partial-antic-length
8581 Maximum length of the partial antic set computed during the tree
8582 partial redundancy elimination optimization (@option{-ftree-pre}) when
8583 optimizing at @option{-O3} and above.  For some sorts of source code
8584 the enhanced partial redundancy elimination optimization can run away,
8585 consuming all of the memory available on the host machine.  This
8586 parameter sets a limit on the length of the sets that are computed,
8587 which prevents the runaway behavior.  Setting a value of 0 for
8588 this parameter will allow an unlimited set length.
8590 @item sccvn-max-scc-size
8591 Maximum size of a strongly connected component (SCC) during SCCVN
8592 processing.  If this limit is hit, SCCVN processing for the whole
8593 function will not be done and optimizations depending on it will
8594 be disabled.  The default maximum SCC size is 10000.
8596 @item ira-max-loops-num
8597 IRA uses a regional register allocation by default.  If a function
8598 contains loops more than number given by the parameter, only at most
8599 given number of the most frequently executed loops will form regions
8600 for the regional register allocation.  The default value of the
8601 parameter is 100.
8603 @item ira-max-conflict-table-size
8604 Although IRA uses a sophisticated algorithm of compression conflict
8605 table, the table can be still big for huge functions.  If the conflict
8606 table for a function could be more than size in MB given by the
8607 parameter, the conflict table is not built and faster, simpler, and
8608 lower quality register allocation algorithm will be used.  The
8609 algorithm do not use pseudo-register conflicts.  The default value of
8610 the parameter is 2000.
8612 @item ira-loop-reserved-regs
8613 IRA can be used to evaluate more accurate register pressure in loops
8614 for decision to move loop invariants (see @option{-O3}).  The number
8615 of available registers reserved for some other purposes is described
8616 by this parameter.  The default value of the parameter is 2 which is
8617 minimal number of registers needed for execution of typical
8618 instruction.  This value is the best found from numerous experiments.
8620 @item loop-invariant-max-bbs-in-loop
8621 Loop invariant motion can be very expensive, both in compile time and
8622 in amount of needed compile time memory, with very large loops.  Loops
8623 with more basic blocks than this parameter won't have loop invariant
8624 motion optimization performed on them.  The default value of the
8625 parameter is 1000 for -O1 and 10000 for -O2 and above.
8627 @item max-vartrack-size
8628 Sets a maximum number of hash table slots to use during variable
8629 tracking dataflow analysis of any function.  If this limit is exceeded
8630 with variable tracking at assignments enabled, analysis for that
8631 function is retried without it, after removing all debug insns from
8632 the function.  If the limit is exceeded even without debug insns, var
8633 tracking analysis is completely disabled for the function.  Setting
8634 the parameter to zero makes it unlimited.
8636 @item min-nondebug-insn-uid
8637 Use uids starting at this parameter for nondebug insns.  The range below
8638 the parameter is reserved exclusively for debug insns created by
8639 @option{-fvar-tracking-assignments}, but debug insns may get
8640 (non-overlapping) uids above it if the reserved range is exhausted.
8642 @item ipa-sra-ptr-growth-factor
8643 IPA-SRA will replace a pointer to an aggregate with one or more new
8644 parameters only when their cumulative size is less or equal to
8645 @option{ipa-sra-ptr-growth-factor} times the size of the original
8646 pointer parameter.
8648 @item graphite-max-nb-scop-params
8649 To avoid exponential effects in the Graphite loop transforms, the
8650 number of parameters in a Static Control Part (SCoP) is bounded.  The
8651 default value is 10 parameters.  A variable whose value is unknown at
8652 compile time and defined outside a SCoP is a parameter of the SCoP.
8654 @item graphite-max-bbs-per-function
8655 To avoid exponential effects in the detection of SCoPs, the size of
8656 the functions analyzed by Graphite is bounded.  The default value is
8657 100 basic blocks.
8659 @item loop-block-tile-size
8660 Loop blocking or strip mining transforms, enabled with
8661 @option{-floop-block} or @option{-floop-strip-mine}, strip mine each
8662 loop in the loop nest by a given number of iterations.  The strip
8663 length can be changed using the @option{loop-block-tile-size}
8664 parameter.  The default value is 51 iterations.
8666 @end table
8667 @end table
8669 @node Preprocessor Options
8670 @section Options Controlling the Preprocessor
8671 @cindex preprocessor options
8672 @cindex options, preprocessor
8674 These options control the C preprocessor, which is run on each C source
8675 file before actual compilation.
8677 If you use the @option{-E} option, nothing is done except preprocessing.
8678 Some of these options make sense only together with @option{-E} because
8679 they cause the preprocessor output to be unsuitable for actual
8680 compilation.
8682 @table @gcctabopt
8683 @item -Wp,@var{option}
8684 @opindex Wp
8685 You can use @option{-Wp,@var{option}} to bypass the compiler driver
8686 and pass @var{option} directly through to the preprocessor.  If
8687 @var{option} contains commas, it is split into multiple options at the
8688 commas.  However, many options are modified, translated or interpreted
8689 by the compiler driver before being passed to the preprocessor, and
8690 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
8691 interface is undocumented and subject to change, so whenever possible
8692 you should avoid using @option{-Wp} and let the driver handle the
8693 options instead.
8695 @item -Xpreprocessor @var{option}
8696 @opindex Xpreprocessor
8697 Pass @var{option} as an option to the preprocessor.  You can use this to
8698 supply system-specific preprocessor options which GCC does not know how to
8699 recognize.
8701 If you want to pass an option that takes an argument, you must use
8702 @option{-Xpreprocessor} twice, once for the option and once for the argument.
8703 @end table
8705 @include cppopts.texi
8707 @node Assembler Options
8708 @section Passing Options to the Assembler
8710 @c prevent bad page break with this line
8711 You can pass options to the assembler.
8713 @table @gcctabopt
8714 @item -Wa,@var{option}
8715 @opindex Wa
8716 Pass @var{option} as an option to the assembler.  If @var{option}
8717 contains commas, it is split into multiple options at the commas.
8719 @item -Xassembler @var{option}
8720 @opindex Xassembler
8721 Pass @var{option} as an option to the assembler.  You can use this to
8722 supply system-specific assembler options which GCC does not know how to
8723 recognize.
8725 If you want to pass an option that takes an argument, you must use
8726 @option{-Xassembler} twice, once for the option and once for the argument.
8728 @end table
8730 @node Link Options
8731 @section Options for Linking
8732 @cindex link options
8733 @cindex options, linking
8735 These options come into play when the compiler links object files into
8736 an executable output file.  They are meaningless if the compiler is
8737 not doing a link step.
8739 @table @gcctabopt
8740 @cindex file names
8741 @item @var{object-file-name}
8742 A file name that does not end in a special recognized suffix is
8743 considered to name an object file or library.  (Object files are
8744 distinguished from libraries by the linker according to the file
8745 contents.)  If linking is done, these object files are used as input
8746 to the linker.
8748 @item -c
8749 @itemx -S
8750 @itemx -E
8751 @opindex c
8752 @opindex S
8753 @opindex E
8754 If any of these options is used, then the linker is not run, and
8755 object file names should not be used as arguments.  @xref{Overall
8756 Options}.
8758 @cindex Libraries
8759 @item -l@var{library}
8760 @itemx -l @var{library}
8761 @opindex l
8762 Search the library named @var{library} when linking.  (The second
8763 alternative with the library as a separate argument is only for
8764 POSIX compliance and is not recommended.)
8766 It makes a difference where in the command you write this option; the
8767 linker searches and processes libraries and object files in the order they
8768 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
8769 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
8770 to functions in @samp{z}, those functions may not be loaded.
8772 The linker searches a standard list of directories for the library,
8773 which is actually a file named @file{lib@var{library}.a}.  The linker
8774 then uses this file as if it had been specified precisely by name.
8776 The directories searched include several standard system directories
8777 plus any that you specify with @option{-L}.
8779 Normally the files found this way are library files---archive files
8780 whose members are object files.  The linker handles an archive file by
8781 scanning through it for members which define symbols that have so far
8782 been referenced but not defined.  But if the file that is found is an
8783 ordinary object file, it is linked in the usual fashion.  The only
8784 difference between using an @option{-l} option and specifying a file name
8785 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
8786 and searches several directories.
8788 @item -lobjc
8789 @opindex lobjc
8790 You need this special case of the @option{-l} option in order to
8791 link an Objective-C or Objective-C++ program.
8793 @item -nostartfiles
8794 @opindex nostartfiles
8795 Do not use the standard system startup files when linking.
8796 The standard system libraries are used normally, unless @option{-nostdlib}
8797 or @option{-nodefaultlibs} is used.
8799 @item -nodefaultlibs
8800 @opindex nodefaultlibs
8801 Do not use the standard system libraries when linking.
8802 Only the libraries you specify will be passed to the linker, options
8803 specifying linkage of the system libraries, such as @code{-static-libgcc}
8804 or @code{-shared-libgcc}, will be ignored.
8805 The standard startup files are used normally, unless @option{-nostartfiles}
8806 is used.  The compiler may generate calls to @code{memcmp},
8807 @code{memset}, @code{memcpy} and @code{memmove}.
8808 These entries are usually resolved by entries in
8809 libc.  These entry points should be supplied through some other
8810 mechanism when this option is specified.
8812 @item -nostdlib
8813 @opindex nostdlib
8814 Do not use the standard system startup files or libraries when linking.
8815 No startup files and only the libraries you specify will be passed to
8816 the linker, options specifying linkage of the system libraries, such as
8817 @code{-static-libgcc} or @code{-shared-libgcc}, will be ignored.
8818 The compiler may generate calls to @code{memcmp}, @code{memset},
8819 @code{memcpy} and @code{memmove}.
8820 These entries are usually resolved by entries in
8821 libc.  These entry points should be supplied through some other
8822 mechanism when this option is specified.
8824 @cindex @option{-lgcc}, use with @option{-nostdlib}
8825 @cindex @option{-nostdlib} and unresolved references
8826 @cindex unresolved references and @option{-nostdlib}
8827 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
8828 @cindex @option{-nodefaultlibs} and unresolved references
8829 @cindex unresolved references and @option{-nodefaultlibs}
8830 One of the standard libraries bypassed by @option{-nostdlib} and
8831 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
8832 that GCC uses to overcome shortcomings of particular machines, or special
8833 needs for some languages.
8834 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
8835 Collection (GCC) Internals},
8836 for more discussion of @file{libgcc.a}.)
8837 In most cases, you need @file{libgcc.a} even when you want to avoid
8838 other standard libraries.  In other words, when you specify @option{-nostdlib}
8839 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
8840 This ensures that you have no unresolved references to internal GCC
8841 library subroutines.  (For example, @samp{__main}, used to ensure C++
8842 constructors will be called; @pxref{Collect2,,@code{collect2}, gccint,
8843 GNU Compiler Collection (GCC) Internals}.)
8845 @item -pie
8846 @opindex pie
8847 Produce a position independent executable on targets which support it.
8848 For predictable results, you must also specify the same set of options
8849 that were used to generate code (@option{-fpie}, @option{-fPIE},
8850 or model suboptions) when you specify this option.
8852 @item -rdynamic
8853 @opindex rdynamic
8854 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
8855 that support it. This instructs the linker to add all symbols, not
8856 only used ones, to the dynamic symbol table. This option is needed
8857 for some uses of @code{dlopen} or to allow obtaining backtraces
8858 from within a program.
8860 @item -s
8861 @opindex s
8862 Remove all symbol table and relocation information from the executable.
8864 @item -static
8865 @opindex static
8866 On systems that support dynamic linking, this prevents linking with the shared
8867 libraries.  On other systems, this option has no effect.
8869 @item -shared
8870 @opindex shared
8871 Produce a shared object which can then be linked with other objects to
8872 form an executable.  Not all systems support this option.  For predictable
8873 results, you must also specify the same set of options that were used to
8874 generate code (@option{-fpic}, @option{-fPIC}, or model suboptions)
8875 when you specify this option.@footnote{On some systems, @samp{gcc -shared}
8876 needs to build supplementary stub code for constructors to work.  On
8877 multi-libbed systems, @samp{gcc -shared} must select the correct support
8878 libraries to link against.  Failing to supply the correct flags may lead
8879 to subtle defects.  Supplying them in cases where they are not necessary
8880 is innocuous.}
8882 @item -shared-libgcc
8883 @itemx -static-libgcc
8884 @opindex shared-libgcc
8885 @opindex static-libgcc
8886 On systems that provide @file{libgcc} as a shared library, these options
8887 force the use of either the shared or static version respectively.
8888 If no shared version of @file{libgcc} was built when the compiler was
8889 configured, these options have no effect.
8891 There are several situations in which an application should use the
8892 shared @file{libgcc} instead of the static version.  The most common
8893 of these is when the application wishes to throw and catch exceptions
8894 across different shared libraries.  In that case, each of the libraries
8895 as well as the application itself should use the shared @file{libgcc}.
8897 Therefore, the G++ and GCJ drivers automatically add
8898 @option{-shared-libgcc} whenever you build a shared library or a main
8899 executable, because C++ and Java programs typically use exceptions, so
8900 this is the right thing to do.
8902 If, instead, you use the GCC driver to create shared libraries, you may
8903 find that they will not always be linked with the shared @file{libgcc}.
8904 If GCC finds, at its configuration time, that you have a non-GNU linker
8905 or a GNU linker that does not support option @option{--eh-frame-hdr},
8906 it will link the shared version of @file{libgcc} into shared libraries
8907 by default.  Otherwise, it will take advantage of the linker and optimize
8908 away the linking with the shared version of @file{libgcc}, linking with
8909 the static version of libgcc by default.  This allows exceptions to
8910 propagate through such shared libraries, without incurring relocation
8911 costs at library load time.
8913 However, if a library or main executable is supposed to throw or catch
8914 exceptions, you must link it using the G++ or GCJ driver, as appropriate
8915 for the languages used in the program, or using the option
8916 @option{-shared-libgcc}, such that it is linked with the shared
8917 @file{libgcc}.
8919 @item -static-libstdc++
8920 When the @command{g++} program is used to link a C++ program, it will
8921 normally automatically link against @option{libstdc++}.  If
8922 @file{libstdc++} is available as a shared library, and the
8923 @option{-static} option is not used, then this will link against the
8924 shared version of @file{libstdc++}.  That is normally fine.  However, it
8925 is sometimes useful to freeze the version of @file{libstdc++} used by
8926 the program without going all the way to a fully static link.  The
8927 @option{-static-libstdc++} option directs the @command{g++} driver to
8928 link @file{libstdc++} statically, without necessarily linking other
8929 libraries statically.
8931 @item -symbolic
8932 @opindex symbolic
8933 Bind references to global symbols when building a shared object.  Warn
8934 about any unresolved references (unless overridden by the link editor
8935 option @samp{-Xlinker -z -Xlinker defs}).  Only a few systems support
8936 this option.
8938 @item -T @var{script}
8939 @opindex T
8940 @cindex linker script
8941 Use @var{script} as the linker script.  This option is supported by most
8942 systems using the GNU linker.  On some targets, such as bare-board
8943 targets without an operating system, the @option{-T} option may be required
8944 when linking to avoid references to undefined symbols.
8946 @item -Xlinker @var{option}
8947 @opindex Xlinker
8948 Pass @var{option} as an option to the linker.  You can use this to
8949 supply system-specific linker options which GCC does not know how to
8950 recognize.
8952 If you want to pass an option that takes a separate argument, you must use
8953 @option{-Xlinker} twice, once for the option and once for the argument.
8954 For example, to pass @option{-assert definitions}, you must write
8955 @samp{-Xlinker -assert -Xlinker definitions}.  It does not work to write
8956 @option{-Xlinker "-assert definitions"}, because this passes the entire
8957 string as a single argument, which is not what the linker expects.
8959 When using the GNU linker, it is usually more convenient to pass
8960 arguments to linker options using the @option{@var{option}=@var{value}}
8961 syntax than as separate arguments.  For example, you can specify
8962 @samp{-Xlinker -Map=output.map} rather than
8963 @samp{-Xlinker -Map -Xlinker output.map}.  Other linkers may not support
8964 this syntax for command-line options.
8966 @item -Wl,@var{option}
8967 @opindex Wl
8968 Pass @var{option} as an option to the linker.  If @var{option} contains
8969 commas, it is split into multiple options at the commas.  You can use this
8970 syntax to pass an argument to the option.
8971 For example, @samp{-Wl,-Map,output.map} passes @samp{-Map output.map} to the
8972 linker.  When using the GNU linker, you can also get the same effect with
8973 @samp{-Wl,-Map=output.map}.
8975 @item -u @var{symbol}
8976 @opindex u
8977 Pretend the symbol @var{symbol} is undefined, to force linking of
8978 library modules to define it.  You can use @option{-u} multiple times with
8979 different symbols to force loading of additional library modules.
8980 @end table
8982 @node Directory Options
8983 @section Options for Directory Search
8984 @cindex directory options
8985 @cindex options, directory search
8986 @cindex search path
8988 These options specify directories to search for header files, for
8989 libraries and for parts of the compiler:
8991 @table @gcctabopt
8992 @item -I@var{dir}
8993 @opindex I
8994 Add the directory @var{dir} to the head of the list of directories to be
8995 searched for header files.  This can be used to override a system header
8996 file, substituting your own version, since these directories are
8997 searched before the system header file directories.  However, you should
8998 not use this option to add directories that contain vendor-supplied
8999 system header files (use @option{-isystem} for that).  If you use more than
9000 one @option{-I} option, the directories are scanned in left-to-right
9001 order; the standard system directories come after.
9003 If a standard system include directory, or a directory specified with
9004 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
9005 option will be ignored.  The directory will still be searched but as a
9006 system directory at its normal position in the system include chain.
9007 This is to ensure that GCC's procedure to fix buggy system headers and
9008 the ordering for the include_next directive are not inadvertently changed.
9009 If you really need to change the search order for system directories,
9010 use the @option{-nostdinc} and/or @option{-isystem} options.
9012 @item -iplugindir=@var{dir}
9013 Set the directory to search for plugins which are passed
9014 by @option{-fplugin=@var{name}} instead of
9015 @option{-fplugin=@var{path}/@var{name}.so}.  This option is not meant
9016 to be used by the user, but only passed by the driver.
9018 @item -iquote@var{dir}
9019 @opindex iquote
9020 Add the directory @var{dir} to the head of the list of directories to
9021 be searched for header files only for the case of @samp{#include
9022 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
9023 otherwise just like @option{-I}.
9025 @item -L@var{dir}
9026 @opindex L
9027 Add directory @var{dir} to the list of directories to be searched
9028 for @option{-l}.
9030 @item -B@var{prefix}
9031 @opindex B
9032 This option specifies where to find the executables, libraries,
9033 include files, and data files of the compiler itself.
9035 The compiler driver program runs one or more of the subprograms
9036 @file{cpp}, @file{cc1}, @file{as} and @file{ld}.  It tries
9037 @var{prefix} as a prefix for each program it tries to run, both with and
9038 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
9040 For each subprogram to be run, the compiler driver first tries the
9041 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
9042 was not specified, the driver tries two standard prefixes, which are
9043 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
9044 those results in a file name that is found, the unmodified program
9045 name is searched for using the directories specified in your
9046 @env{PATH} environment variable.
9048 The compiler will check to see if the path provided by the @option{-B}
9049 refers to a directory, and if necessary it will add a directory
9050 separator character at the end of the path.
9052 @option{-B} prefixes that effectively specify directory names also apply
9053 to libraries in the linker, because the compiler translates these
9054 options into @option{-L} options for the linker.  They also apply to
9055 includes files in the preprocessor, because the compiler translates these
9056 options into @option{-isystem} options for the preprocessor.  In this case,
9057 the compiler appends @samp{include} to the prefix.
9059 The run-time support file @file{libgcc.a} can also be searched for using
9060 the @option{-B} prefix, if needed.  If it is not found there, the two
9061 standard prefixes above are tried, and that is all.  The file is left
9062 out of the link if it is not found by those means.
9064 Another way to specify a prefix much like the @option{-B} prefix is to use
9065 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
9066 Variables}.
9068 As a special kludge, if the path provided by @option{-B} is
9069 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
9070 9, then it will be replaced by @file{[dir/]include}.  This is to help
9071 with boot-strapping the compiler.
9073 @item -specs=@var{file}
9074 @opindex specs
9075 Process @var{file} after the compiler reads in the standard @file{specs}
9076 file, in order to override the defaults that the @file{gcc} driver
9077 program uses when determining what switches to pass to @file{cc1},
9078 @file{cc1plus}, @file{as}, @file{ld}, etc.  More than one
9079 @option{-specs=@var{file}} can be specified on the command line, and they
9080 are processed in order, from left to right.
9082 @item --sysroot=@var{dir}
9083 @opindex sysroot
9084 Use @var{dir} as the logical root directory for headers and libraries.
9085 For example, if the compiler would normally search for headers in
9086 @file{/usr/include} and libraries in @file{/usr/lib}, it will instead
9087 search @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
9089 If you use both this option and the @option{-isysroot} option, then
9090 the @option{--sysroot} option will apply to libraries, but the
9091 @option{-isysroot} option will apply to header files.
9093 The GNU linker (beginning with version 2.16) has the necessary support
9094 for this option.  If your linker does not support this option, the
9095 header file aspect of @option{--sysroot} will still work, but the
9096 library aspect will not.
9098 @item -I-
9099 @opindex I-
9100 This option has been deprecated.  Please use @option{-iquote} instead for
9101 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
9102 Any directories you specify with @option{-I} options before the @option{-I-}
9103 option are searched only for the case of @samp{#include "@var{file}"};
9104 they are not searched for @samp{#include <@var{file}>}.
9106 If additional directories are specified with @option{-I} options after
9107 the @option{-I-}, these directories are searched for all @samp{#include}
9108 directives.  (Ordinarily @emph{all} @option{-I} directories are used
9109 this way.)
9111 In addition, the @option{-I-} option inhibits the use of the current
9112 directory (where the current input file came from) as the first search
9113 directory for @samp{#include "@var{file}"}.  There is no way to
9114 override this effect of @option{-I-}.  With @option{-I.} you can specify
9115 searching the directory which was current when the compiler was
9116 invoked.  That is not exactly the same as what the preprocessor does
9117 by default, but it is often satisfactory.
9119 @option{-I-} does not inhibit the use of the standard system directories
9120 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
9121 independent.
9122 @end table
9124 @c man end
9126 @node Spec Files
9127 @section Specifying subprocesses and the switches to pass to them
9128 @cindex Spec Files
9130 @command{gcc} is a driver program.  It performs its job by invoking a
9131 sequence of other programs to do the work of compiling, assembling and
9132 linking.  GCC interprets its command-line parameters and uses these to
9133 deduce which programs it should invoke, and which command-line options
9134 it ought to place on their command lines.  This behavior is controlled
9135 by @dfn{spec strings}.  In most cases there is one spec string for each
9136 program that GCC can invoke, but a few programs have multiple spec
9137 strings to control their behavior.  The spec strings built into GCC can
9138 be overridden by using the @option{-specs=} command-line switch to specify
9139 a spec file.
9141 @dfn{Spec files} are plaintext files that are used to construct spec
9142 strings.  They consist of a sequence of directives separated by blank
9143 lines.  The type of directive is determined by the first non-whitespace
9144 character on the line and it can be one of the following:
9146 @table @code
9147 @item %@var{command}
9148 Issues a @var{command} to the spec file processor.  The commands that can
9149 appear here are:
9151 @table @code
9152 @item %include <@var{file}>
9153 @cindex %include
9154 Search for @var{file} and insert its text at the current point in the
9155 specs file.
9157 @item %include_noerr <@var{file}>
9158 @cindex %include_noerr
9159 Just like @samp{%include}, but do not generate an error message if the include
9160 file cannot be found.
9162 @item %rename @var{old_name} @var{new_name}
9163 @cindex %rename
9164 Rename the spec string @var{old_name} to @var{new_name}.
9166 @end table
9168 @item *[@var{spec_name}]:
9169 This tells the compiler to create, override or delete the named spec
9170 string.  All lines after this directive up to the next directive or
9171 blank line are considered to be the text for the spec string.  If this
9172 results in an empty string then the spec will be deleted.  (Or, if the
9173 spec did not exist, then nothing will happened.)  Otherwise, if the spec
9174 does not currently exist a new spec will be created.  If the spec does
9175 exist then its contents will be overridden by the text of this
9176 directive, unless the first character of that text is the @samp{+}
9177 character, in which case the text will be appended to the spec.
9179 @item [@var{suffix}]:
9180 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
9181 and up to the next directive or blank line are considered to make up the
9182 spec string for the indicated suffix.  When the compiler encounters an
9183 input file with the named suffix, it will processes the spec string in
9184 order to work out how to compile that file.  For example:
9186 @smallexample
9187 .ZZ:
9188 z-compile -input %i
9189 @end smallexample
9191 This says that any input file whose name ends in @samp{.ZZ} should be
9192 passed to the program @samp{z-compile}, which should be invoked with the
9193 command-line switch @option{-input} and with the result of performing the
9194 @samp{%i} substitution.  (See below.)
9196 As an alternative to providing a spec string, the text that follows a
9197 suffix directive can be one of the following:
9199 @table @code
9200 @item @@@var{language}
9201 This says that the suffix is an alias for a known @var{language}.  This is
9202 similar to using the @option{-x} command-line switch to GCC to specify a
9203 language explicitly.  For example:
9205 @smallexample
9206 .ZZ:
9207 @@c++
9208 @end smallexample
9210 Says that .ZZ files are, in fact, C++ source files.
9212 @item #@var{name}
9213 This causes an error messages saying:
9215 @smallexample
9216 @var{name} compiler not installed on this system.
9217 @end smallexample
9218 @end table
9220 GCC already has an extensive list of suffixes built into it.
9221 This directive will add an entry to the end of the list of suffixes, but
9222 since the list is searched from the end backwards, it is effectively
9223 possible to override earlier entries using this technique.
9225 @end table
9227 GCC has the following spec strings built into it.  Spec files can
9228 override these strings or create their own.  Note that individual
9229 targets can also add their own spec strings to this list.
9231 @smallexample
9232 asm          Options to pass to the assembler
9233 asm_final    Options to pass to the assembler post-processor
9234 cpp          Options to pass to the C preprocessor
9235 cc1          Options to pass to the C compiler
9236 cc1plus      Options to pass to the C++ compiler
9237 endfile      Object files to include at the end of the link
9238 link         Options to pass to the linker
9239 lib          Libraries to include on the command line to the linker
9240 libgcc       Decides which GCC support library to pass to the linker
9241 linker       Sets the name of the linker
9242 predefines   Defines to be passed to the C preprocessor
9243 signed_char  Defines to pass to CPP to say whether @code{char} is signed
9244              by default
9245 startfile    Object files to include at the start of the link
9246 @end smallexample
9248 Here is a small example of a spec file:
9250 @smallexample
9251 %rename lib                 old_lib
9253 *lib:
9254 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
9255 @end smallexample
9257 This example renames the spec called @samp{lib} to @samp{old_lib} and
9258 then overrides the previous definition of @samp{lib} with a new one.
9259 The new definition adds in some extra command-line options before
9260 including the text of the old definition.
9262 @dfn{Spec strings} are a list of command-line options to be passed to their
9263 corresponding program.  In addition, the spec strings can contain
9264 @samp{%}-prefixed sequences to substitute variable text or to
9265 conditionally insert text into the command line.  Using these constructs
9266 it is possible to generate quite complex command lines.
9268 Here is a table of all defined @samp{%}-sequences for spec
9269 strings.  Note that spaces are not generated automatically around the
9270 results of expanding these sequences.  Therefore you can concatenate them
9271 together or combine them with constant text in a single argument.
9273 @table @code
9274 @item %%
9275 Substitute one @samp{%} into the program name or argument.
9277 @item %i
9278 Substitute the name of the input file being processed.
9280 @item %b
9281 Substitute the basename of the input file being processed.
9282 This is the substring up to (and not including) the last period
9283 and not including the directory.
9285 @item %B
9286 This is the same as @samp{%b}, but include the file suffix (text after
9287 the last period).
9289 @item %d
9290 Marks the argument containing or following the @samp{%d} as a
9291 temporary file name, so that that file will be deleted if GCC exits
9292 successfully.  Unlike @samp{%g}, this contributes no text to the
9293 argument.
9295 @item %g@var{suffix}
9296 Substitute a file name that has suffix @var{suffix} and is chosen
9297 once per compilation, and mark the argument in the same way as
9298 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
9299 name is now chosen in a way that is hard to predict even when previously
9300 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
9301 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
9302 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
9303 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
9304 was simply substituted with a file name chosen once per compilation,
9305 without regard to any appended suffix (which was therefore treated
9306 just like ordinary text), making such attacks more likely to succeed.
9308 @item %u@var{suffix}
9309 Like @samp{%g}, but generates a new temporary file name even if
9310 @samp{%u@var{suffix}} was already seen.
9312 @item %U@var{suffix}
9313 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
9314 new one if there is no such last file name.  In the absence of any
9315 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
9316 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
9317 would involve the generation of two distinct file names, one
9318 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
9319 simply substituted with a file name chosen for the previous @samp{%u},
9320 without regard to any appended suffix.
9322 @item %j@var{suffix}
9323 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
9324 writable, and if save-temps is off; otherwise, substitute the name
9325 of a temporary file, just like @samp{%u}.  This temporary file is not
9326 meant for communication between processes, but rather as a junk
9327 disposal mechanism.
9329 @item %|@var{suffix}
9330 @itemx %m@var{suffix}
9331 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
9332 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
9333 all.  These are the two most common ways to instruct a program that it
9334 should read from standard input or write to standard output.  If you
9335 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
9336 construct: see for example @file{f/lang-specs.h}.
9338 @item %.@var{SUFFIX}
9339 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
9340 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
9341 terminated by the next space or %.
9343 @item %w
9344 Marks the argument containing or following the @samp{%w} as the
9345 designated output file of this compilation.  This puts the argument
9346 into the sequence of arguments that @samp{%o} will substitute later.
9348 @item %o
9349 Substitutes the names of all the output files, with spaces
9350 automatically placed around them.  You should write spaces
9351 around the @samp{%o} as well or the results are undefined.
9352 @samp{%o} is for use in the specs for running the linker.
9353 Input files whose names have no recognized suffix are not compiled
9354 at all, but they are included among the output files, so they will
9355 be linked.
9357 @item %O
9358 Substitutes the suffix for object files.  Note that this is
9359 handled specially when it immediately follows @samp{%g, %u, or %U},
9360 because of the need for those to form complete file names.  The
9361 handling is such that @samp{%O} is treated exactly as if it had already
9362 been substituted, except that @samp{%g, %u, and %U} do not currently
9363 support additional @var{suffix} characters following @samp{%O} as they would
9364 following, for example, @samp{.o}.
9366 @item %p
9367 Substitutes the standard macro predefinitions for the
9368 current target machine.  Use this when running @code{cpp}.
9370 @item %P
9371 Like @samp{%p}, but puts @samp{__} before and after the name of each
9372 predefined macro, except for macros that start with @samp{__} or with
9373 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
9376 @item %I
9377 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
9378 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
9379 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
9380 and @option{-imultilib} as necessary.
9382 @item %s
9383 Current argument is the name of a library or startup file of some sort.
9384 Search for that file in a standard list of directories and substitute
9385 the full name found.  The current working directory is included in the
9386 list of directories scanned.
9388 @item %T
9389 Current argument is the name of a linker script.  Search for that file
9390 in the current list of directories to scan for libraries. If the file
9391 is located insert a @option{--script} option into the command line
9392 followed by the full path name found.  If the file is not found then
9393 generate an error message.  Note: the current working directory is not
9394 searched.
9396 @item %e@var{str}
9397 Print @var{str} as an error message.  @var{str} is terminated by a newline.
9398 Use this when inconsistent options are detected.
9400 @item %(@var{name})
9401 Substitute the contents of spec string @var{name} at this point.
9403 @item %[@var{name}]
9404 Like @samp{%(@dots{})} but put @samp{__} around @option{-D} arguments.
9406 @item %x@{@var{option}@}
9407 Accumulate an option for @samp{%X}.
9409 @item %X
9410 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
9411 spec string.
9413 @item %Y
9414 Output the accumulated assembler options specified by @option{-Wa}.
9416 @item %Z
9417 Output the accumulated preprocessor options specified by @option{-Wp}.
9419 @item %a
9420 Process the @code{asm} spec.  This is used to compute the
9421 switches to be passed to the assembler.
9423 @item %A
9424 Process the @code{asm_final} spec.  This is a spec string for
9425 passing switches to an assembler post-processor, if such a program is
9426 needed.
9428 @item %l
9429 Process the @code{link} spec.  This is the spec for computing the
9430 command line passed to the linker.  Typically it will make use of the
9431 @samp{%L %G %S %D and %E} sequences.
9433 @item %D
9434 Dump out a @option{-L} option for each directory that GCC believes might
9435 contain startup files.  If the target supports multilibs then the
9436 current multilib directory will be prepended to each of these paths.
9438 @item %L
9439 Process the @code{lib} spec.  This is a spec string for deciding which
9440 libraries should be included on the command line to the linker.
9442 @item %G
9443 Process the @code{libgcc} spec.  This is a spec string for deciding
9444 which GCC support library should be included on the command line to the linker.
9446 @item %S
9447 Process the @code{startfile} spec.  This is a spec for deciding which
9448 object files should be the first ones passed to the linker.  Typically
9449 this might be a file named @file{crt0.o}.
9451 @item %E
9452 Process the @code{endfile} spec.  This is a spec string that specifies
9453 the last object files that will be passed to the linker.
9455 @item %C
9456 Process the @code{cpp} spec.  This is used to construct the arguments
9457 to be passed to the C preprocessor.
9459 @item %1
9460 Process the @code{cc1} spec.  This is used to construct the options to be
9461 passed to the actual C compiler (@samp{cc1}).
9463 @item %2
9464 Process the @code{cc1plus} spec.  This is used to construct the options to be
9465 passed to the actual C++ compiler (@samp{cc1plus}).
9467 @item %*
9468 Substitute the variable part of a matched option.  See below.
9469 Note that each comma in the substituted string is replaced by
9470 a single space.
9472 @item %<@code{S}
9473 Remove all occurrences of @code{-S} from the command line.  Note---this
9474 command is position dependent.  @samp{%} commands in the spec string
9475 before this one will see @code{-S}, @samp{%} commands in the spec string
9476 after this one will not.
9478 @item %:@var{function}(@var{args})
9479 Call the named function @var{function}, passing it @var{args}.
9480 @var{args} is first processed as a nested spec string, then split
9481 into an argument vector in the usual fashion.  The function returns
9482 a string which is processed as if it had appeared literally as part
9483 of the current spec.
9485 The following built-in spec functions are provided:
9487 @table @code
9488 @item @code{getenv}
9489 The @code{getenv} spec function takes two arguments: an environment
9490 variable name and a string.  If the environment variable is not
9491 defined, a fatal error is issued.  Otherwise, the return value is the
9492 value of the environment variable concatenated with the string.  For
9493 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
9495 @smallexample
9496 %:getenv(TOPDIR /include)
9497 @end smallexample
9499 expands to @file{/path/to/top/include}.
9501 @item @code{if-exists}
9502 The @code{if-exists} spec function takes one argument, an absolute
9503 pathname to a file.  If the file exists, @code{if-exists} returns the
9504 pathname.  Here is a small example of its usage:
9506 @smallexample
9507 *startfile:
9508 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
9509 @end smallexample
9511 @item @code{if-exists-else}
9512 The @code{if-exists-else} spec function is similar to the @code{if-exists}
9513 spec function, except that it takes two arguments.  The first argument is
9514 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
9515 returns the pathname.  If it does not exist, it returns the second argument.
9516 This way, @code{if-exists-else} can be used to select one file or another,
9517 based on the existence of the first.  Here is a small example of its usage:
9519 @smallexample
9520 *startfile:
9521 crt0%O%s %:if-exists(crti%O%s) \
9522 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
9523 @end smallexample
9525 @item @code{replace-outfile}
9526 The @code{replace-outfile} spec function takes two arguments.  It looks for the
9527 first argument in the outfiles array and replaces it with the second argument.  Here
9528 is a small example of its usage:
9530 @smallexample
9531 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
9532 @end smallexample
9534 @item @code{print-asm-header}
9535 The @code{print-asm-header} function takes no arguments and simply
9536 prints a banner like:
9538 @smallexample
9539 Assembler options
9540 =================
9542 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
9543 @end smallexample
9545 It is used to separate compiler options from assembler options
9546 in the @option{--target-help} output.
9547 @end table
9549 @item %@{@code{S}@}
9550 Substitutes the @code{-S} switch, if that switch was given to GCC@.
9551 If that switch was not specified, this substitutes nothing.  Note that
9552 the leading dash is omitted when specifying this option, and it is
9553 automatically inserted if the substitution is performed.  Thus the spec
9554 string @samp{%@{foo@}} would match the command-line option @option{-foo}
9555 and would output the command line option @option{-foo}.
9557 @item %W@{@code{S}@}
9558 Like %@{@code{S}@} but mark last argument supplied within as a file to be
9559 deleted on failure.
9561 @item %@{@code{S}*@}
9562 Substitutes all the switches specified to GCC whose names start
9563 with @code{-S}, but which also take an argument.  This is used for
9564 switches like @option{-o}, @option{-D}, @option{-I}, etc.
9565 GCC considers @option{-o foo} as being
9566 one switch whose names starts with @samp{o}.  %@{o*@} would substitute this
9567 text, including the space.  Thus two arguments would be generated.
9569 @item %@{@code{S}*&@code{T}*@}
9570 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
9571 (the order of @code{S} and @code{T} in the spec is not significant).
9572 There can be any number of ampersand-separated variables; for each the
9573 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
9575 @item %@{@code{S}:@code{X}@}
9576 Substitutes @code{X}, if the @samp{-S} switch was given to GCC@.
9578 @item %@{!@code{S}:@code{X}@}
9579 Substitutes @code{X}, if the @samp{-S} switch was @emph{not} given to GCC@.
9581 @item %@{@code{S}*:@code{X}@}
9582 Substitutes @code{X} if one or more switches whose names start with
9583 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
9584 once, no matter how many such switches appeared.  However, if @code{%*}
9585 appears somewhere in @code{X}, then @code{X} will be substituted once
9586 for each matching switch, with the @code{%*} replaced by the part of
9587 that switch that matched the @code{*}.
9589 @item %@{.@code{S}:@code{X}@}
9590 Substitutes @code{X}, if processing a file with suffix @code{S}.
9592 @item %@{!.@code{S}:@code{X}@}
9593 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
9595 @item %@{,@code{S}:@code{X}@}
9596 Substitutes @code{X}, if processing a file for language @code{S}.
9598 @item %@{!,@code{S}:@code{X}@}
9599 Substitutes @code{X}, if not processing a file for language @code{S}.
9601 @item %@{@code{S}|@code{P}:@code{X}@}
9602 Substitutes @code{X} if either @code{-S} or @code{-P} was given to
9603 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
9604 @code{*} sequences as well, although they have a stronger binding than
9605 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
9606 alternatives must be starred, and only the first matching alternative
9607 is substituted.
9609 For example, a spec string like this:
9611 @smallexample
9612 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
9613 @end smallexample
9615 will output the following command-line options from the following input
9616 command-line options:
9618 @smallexample
9619 fred.c        -foo -baz
9620 jim.d         -bar -boggle
9621 -d fred.c     -foo -baz -boggle
9622 -d jim.d      -bar -baz -boggle
9623 @end smallexample
9625 @item %@{S:X; T:Y; :D@}
9627 If @code{S} was given to GCC, substitutes @code{X}; else if @code{T} was
9628 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
9629 be as many clauses as you need.  This may be combined with @code{.},
9630 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
9633 @end table
9635 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
9636 construct may contain other nested @samp{%} constructs or spaces, or
9637 even newlines.  They are processed as usual, as described above.
9638 Trailing white space in @code{X} is ignored.  White space may also
9639 appear anywhere on the left side of the colon in these constructs,
9640 except between @code{.} or @code{*} and the corresponding word.
9642 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
9643 handled specifically in these constructs.  If another value of
9644 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
9645 @option{-W} switch is found later in the command line, the earlier
9646 switch value is ignored, except with @{@code{S}*@} where @code{S} is
9647 just one letter, which passes all matching options.
9649 The character @samp{|} at the beginning of the predicate text is used to
9650 indicate that a command should be piped to the following command, but
9651 only if @option{-pipe} is specified.
9653 It is built into GCC which switches take arguments and which do not.
9654 (You might think it would be useful to generalize this to allow each
9655 compiler's spec to say which switches take arguments.  But this cannot
9656 be done in a consistent fashion.  GCC cannot even decide which input
9657 files have been specified without knowing which switches take arguments,
9658 and it must know which input files to compile in order to tell which
9659 compilers to run).
9661 GCC also knows implicitly that arguments starting in @option{-l} are to be
9662 treated as compiler output files, and passed to the linker in their
9663 proper position among the other output files.
9665 @c man begin OPTIONS
9667 @node Target Options
9668 @section Specifying Target Machine and Compiler Version
9669 @cindex target options
9670 @cindex cross compiling
9671 @cindex specifying machine version
9672 @cindex specifying compiler version and target machine
9673 @cindex compiler version, specifying
9674 @cindex target machine, specifying
9676 The usual way to run GCC is to run the executable called @file{gcc}, or
9677 @file{<machine>-gcc} when cross-compiling, or
9678 @file{<machine>-gcc-<version>} to run a version other than the one that
9679 was installed last.
9681 @node Submodel Options
9682 @section Hardware Models and Configurations
9683 @cindex submodel options
9684 @cindex specifying hardware config
9685 @cindex hardware models and configurations, specifying
9686 @cindex machine dependent options
9688 Each target machine types can have its own
9689 special options, starting with @samp{-m}, to choose among various
9690 hardware models or configurations---for example, 68010 vs 68020,
9691 floating coprocessor or none.  A single installed version of the
9692 compiler can compile for any model or configuration, according to the
9693 options specified.
9695 Some configurations of the compiler also support additional special
9696 options, usually for compatibility with other compilers on the same
9697 platform.
9699 @c This list is ordered alphanumerically by subsection name.
9700 @c It should be the same order and spelling as these options are listed
9701 @c in Machine Dependent Options
9703 @menu
9704 * ARC Options::
9705 * ARM Options::
9706 * AVR Options::
9707 * Blackfin Options::
9708 * CRIS Options::
9709 * CRX Options::
9710 * Darwin Options::
9711 * DEC Alpha Options::
9712 * DEC Alpha/VMS Options::
9713 * FR30 Options::
9714 * FRV Options::
9715 * GNU/Linux Options::
9716 * H8/300 Options::
9717 * HPPA Options::
9718 * i386 and x86-64 Options::
9719 * i386 and x86-64 Windows Options::
9720 * IA-64 Options::
9721 * IA-64/VMS Options::
9722 * LM32 Options::
9723 * M32C Options::
9724 * M32R/D Options::
9725 * M680x0 Options::
9726 * M68hc1x Options::
9727 * MCore Options::
9728 * MeP Options::
9729 * MIPS Options::
9730 * MMIX Options::
9731 * MN10300 Options::
9732 * PDP-11 Options::
9733 * picoChip Options::
9734 * PowerPC Options::
9735 * RS/6000 and PowerPC Options::
9736 * RX Options::
9737 * S/390 and zSeries Options::
9738 * Score Options::
9739 * SH Options::
9740 * SPARC Options::
9741 * SPU Options::
9742 * System V Options::
9743 * V850 Options::
9744 * VAX Options::
9745 * VxWorks Options::
9746 * x86-64 Options::
9747 * Xstormy16 Options::
9748 * Xtensa Options::
9749 * zSeries Options::
9750 @end menu
9752 @node ARC Options
9753 @subsection ARC Options
9754 @cindex ARC Options
9756 These options are defined for ARC implementations:
9758 @table @gcctabopt
9759 @item -EL
9760 @opindex EL
9761 Compile code for little endian mode.  This is the default.
9763 @item -EB
9764 @opindex EB
9765 Compile code for big endian mode.
9767 @item -mmangle-cpu
9768 @opindex mmangle-cpu
9769 Prepend the name of the cpu to all public symbol names.
9770 In multiple-processor systems, there are many ARC variants with different
9771 instruction and register set characteristics.  This flag prevents code
9772 compiled for one cpu to be linked with code compiled for another.
9773 No facility exists for handling variants that are ``almost identical''.
9774 This is an all or nothing option.
9776 @item -mcpu=@var{cpu}
9777 @opindex mcpu
9778 Compile code for ARC variant @var{cpu}.
9779 Which variants are supported depend on the configuration.
9780 All variants support @option{-mcpu=base}, this is the default.
9782 @item -mtext=@var{text-section}
9783 @itemx -mdata=@var{data-section}
9784 @itemx -mrodata=@var{readonly-data-section}
9785 @opindex mtext
9786 @opindex mdata
9787 @opindex mrodata
9788 Put functions, data, and readonly data in @var{text-section},
9789 @var{data-section}, and @var{readonly-data-section} respectively
9790 by default.  This can be overridden with the @code{section} attribute.
9791 @xref{Variable Attributes}.
9793 @end table
9795 @node ARM Options
9796 @subsection ARM Options
9797 @cindex ARM options
9799 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
9800 architectures:
9802 @table @gcctabopt
9803 @item -mabi=@var{name}
9804 @opindex mabi
9805 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
9806 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
9808 @item -mapcs-frame
9809 @opindex mapcs-frame
9810 Generate a stack frame that is compliant with the ARM Procedure Call
9811 Standard for all functions, even if this is not strictly necessary for
9812 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
9813 with this option will cause the stack frames not to be generated for
9814 leaf functions.  The default is @option{-mno-apcs-frame}.
9816 @item -mapcs
9817 @opindex mapcs
9818 This is a synonym for @option{-mapcs-frame}.
9820 @ignore
9821 @c not currently implemented
9822 @item -mapcs-stack-check
9823 @opindex mapcs-stack-check
9824 Generate code to check the amount of stack space available upon entry to
9825 every function (that actually uses some stack space).  If there is
9826 insufficient space available then either the function
9827 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} will be
9828 called, depending upon the amount of stack space required.  The run time
9829 system is required to provide these functions.  The default is
9830 @option{-mno-apcs-stack-check}, since this produces smaller code.
9832 @c not currently implemented
9833 @item -mapcs-float
9834 @opindex mapcs-float
9835 Pass floating point arguments using the float point registers.  This is
9836 one of the variants of the APCS@.  This option is recommended if the
9837 target hardware has a floating point unit or if a lot of floating point
9838 arithmetic is going to be performed by the code.  The default is
9839 @option{-mno-apcs-float}, since integer only code is slightly increased in
9840 size if @option{-mapcs-float} is used.
9842 @c not currently implemented
9843 @item -mapcs-reentrant
9844 @opindex mapcs-reentrant
9845 Generate reentrant, position independent code.  The default is
9846 @option{-mno-apcs-reentrant}.
9847 @end ignore
9849 @item -mthumb-interwork
9850 @opindex mthumb-interwork
9851 Generate code which supports calling between the ARM and Thumb
9852 instruction sets.  Without this option the two instruction sets cannot
9853 be reliably used inside one program.  The default is
9854 @option{-mno-thumb-interwork}, since slightly larger code is generated
9855 when @option{-mthumb-interwork} is specified.
9857 @item -mno-sched-prolog
9858 @opindex mno-sched-prolog
9859 Prevent the reordering of instructions in the function prolog, or the
9860 merging of those instruction with the instructions in the function's
9861 body.  This means that all functions will start with a recognizable set
9862 of instructions (or in fact one of a choice from a small set of
9863 different function prologues), and this information can be used to
9864 locate the start if functions inside an executable piece of code.  The
9865 default is @option{-msched-prolog}.
9867 @item -mfloat-abi=@var{name}
9868 @opindex mfloat-abi
9869 Specifies which floating-point ABI to use.  Permissible values
9870 are: @samp{soft}, @samp{softfp} and @samp{hard}.
9872 Specifying @samp{soft} causes GCC to generate output containing
9873 library calls for floating-point operations.
9874 @samp{softfp} allows the generation of code using hardware floating-point
9875 instructions, but still uses the soft-float calling conventions.
9876 @samp{hard} allows generation of floating-point instructions
9877 and uses FPU-specific calling conventions.
9879 The default depends on the specific target configuration.  Note that
9880 the hard-float and soft-float ABIs are not link-compatible; you must
9881 compile your entire program with the same ABI, and link with a
9882 compatible set of libraries.
9884 @item -mhard-float
9885 @opindex mhard-float
9886 Equivalent to @option{-mfloat-abi=hard}.
9888 @item -msoft-float
9889 @opindex msoft-float
9890 Equivalent to @option{-mfloat-abi=soft}.
9892 @item -mlittle-endian
9893 @opindex mlittle-endian
9894 Generate code for a processor running in little-endian mode.  This is
9895 the default for all standard configurations.
9897 @item -mbig-endian
9898 @opindex mbig-endian
9899 Generate code for a processor running in big-endian mode; the default is
9900 to compile code for a little-endian processor.
9902 @item -mwords-little-endian
9903 @opindex mwords-little-endian
9904 This option only applies when generating code for big-endian processors.
9905 Generate code for a little-endian word order but a big-endian byte
9906 order.  That is, a byte order of the form @samp{32107654}.  Note: this
9907 option should only be used if you require compatibility with code for
9908 big-endian ARM processors generated by versions of the compiler prior to
9909 2.8.
9911 @item -mcpu=@var{name}
9912 @opindex mcpu
9913 This specifies the name of the target ARM processor.  GCC uses this name
9914 to determine what kind of instructions it can emit when generating
9915 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
9916 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
9917 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
9918 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
9919 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
9920 @samp{arm720},
9921 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
9922 @samp{arm710t}, @samp{arm720t}, @samp{arm740t},
9923 @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
9924 @samp{strongarm1110},
9925 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
9926 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
9927 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
9928 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
9929 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
9930 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
9931 @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
9932 @samp{cortex-a5}, @samp{cortex-a8}, @samp{cortex-a9},
9933 @samp{cortex-r4}, @samp{cortex-r4f}, @samp{cortex-m4}, @samp{cortex-m3},
9934 @samp{cortex-m1},
9935 @samp{cortex-m0},
9936 @samp{xscale}, @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}.
9938 @item -mtune=@var{name}
9939 @opindex mtune
9940 This option is very similar to the @option{-mcpu=} option, except that
9941 instead of specifying the actual target processor type, and hence
9942 restricting which instructions can be used, it specifies that GCC should
9943 tune the performance of the code as if the target were of the type
9944 specified in this option, but still choosing the instructions that it
9945 will generate based on the cpu specified by a @option{-mcpu=} option.
9946 For some ARM implementations better performance can be obtained by using
9947 this option.
9949 @item -march=@var{name}
9950 @opindex march
9951 This specifies the name of the target ARM architecture.  GCC uses this
9952 name to determine what kind of instructions it can emit when generating
9953 assembly code.  This option can be used in conjunction with or instead
9954 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
9955 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
9956 @samp{armv5}, @samp{armv5t}, @samp{armv5e}, @samp{armv5te},
9957 @samp{armv6}, @samp{armv6j},
9958 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv6-m},
9959 @samp{armv7}, @samp{armv7-a}, @samp{armv7-r}, @samp{armv7-m},
9960 @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}.
9962 @item -mfpu=@var{name}
9963 @itemx -mfpe=@var{number}
9964 @itemx -mfp=@var{number}
9965 @opindex mfpu
9966 @opindex mfpe
9967 @opindex mfp
9968 This specifies what floating point hardware (or hardware emulation) is
9969 available on the target.  Permissible names are: @samp{fpa}, @samp{fpe2},
9970 @samp{fpe3}, @samp{maverick}, @samp{vfp}, @samp{vfpv3}, @samp{vfpv3-fp16},
9971 @samp{vfpv3-d16}, @samp{vfpv3-d16-fp16}, @samp{vfpv3xd}, @samp{vfpv3xd-fp16},
9972 @samp{neon}, @samp{neon-fp16}, @samp{vfpv4}, @samp{vfpv4-d16},
9973 @samp{fpv4-sp-d16} and @samp{neon-vfpv4}.
9974 @option{-mfp} and @option{-mfpe} are synonyms for
9975 @option{-mfpu}=@samp{fpe}@var{number}, for compatibility with older versions
9976 of GCC@.
9978 If @option{-msoft-float} is specified this specifies the format of
9979 floating point values.
9981 If the selected floating-point hardware includes the NEON extension
9982 (e.g. @option{-mfpu}=@samp{neon}), note that floating-point
9983 operations will not be used by GCC's auto-vectorization pass unless
9984 @option{-funsafe-math-optimizations} is also specified.  This is
9985 because NEON hardware does not fully implement the IEEE 754 standard for
9986 floating-point arithmetic (in particular denormal values are treated as
9987 zero), so the use of NEON instructions may lead to a loss of precision.
9989 @item -mfp16-format=@var{name}
9990 @opindex mfp16-format
9991 Specify the format of the @code{__fp16} half-precision floating-point type.
9992 Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative};
9993 the default is @samp{none}, in which case the @code{__fp16} type is not
9994 defined.  @xref{Half-Precision}, for more information.
9996 @item -mstructure-size-boundary=@var{n}
9997 @opindex mstructure-size-boundary
9998 The size of all structures and unions will be rounded up to a multiple
9999 of the number of bits set by this option.  Permissible values are 8, 32
10000 and 64.  The default value varies for different toolchains.  For the COFF
10001 targeted toolchain the default value is 8.  A value of 64 is only allowed
10002 if the underlying ABI supports it.
10004 Specifying the larger number can produce faster, more efficient code, but
10005 can also increase the size of the program.  Different values are potentially
10006 incompatible.  Code compiled with one value cannot necessarily expect to
10007 work with code or libraries compiled with another value, if they exchange
10008 information using structures or unions.
10010 @item -mabort-on-noreturn
10011 @opindex mabort-on-noreturn
10012 Generate a call to the function @code{abort} at the end of a
10013 @code{noreturn} function.  It will be executed if the function tries to
10014 return.
10016 @item -mlong-calls
10017 @itemx -mno-long-calls
10018 @opindex mlong-calls
10019 @opindex mno-long-calls
10020 Tells the compiler to perform function calls by first loading the
10021 address of the function into a register and then performing a subroutine
10022 call on this register.  This switch is needed if the target function
10023 will lie outside of the 64 megabyte addressing range of the offset based
10024 version of subroutine call instruction.
10026 Even if this switch is enabled, not all function calls will be turned
10027 into long calls.  The heuristic is that static functions, functions
10028 which have the @samp{short-call} attribute, functions that are inside
10029 the scope of a @samp{#pragma no_long_calls} directive and functions whose
10030 definitions have already been compiled within the current compilation
10031 unit, will not be turned into long calls.  The exception to this rule is
10032 that weak function definitions, functions with the @samp{long-call}
10033 attribute or the @samp{section} attribute, and functions that are within
10034 the scope of a @samp{#pragma long_calls} directive, will always be
10035 turned into long calls.
10037 This feature is not enabled by default.  Specifying
10038 @option{-mno-long-calls} will restore the default behavior, as will
10039 placing the function calls within the scope of a @samp{#pragma
10040 long_calls_off} directive.  Note these switches have no effect on how
10041 the compiler generates code to handle function calls via function
10042 pointers.
10044 @item -msingle-pic-base
10045 @opindex msingle-pic-base
10046 Treat the register used for PIC addressing as read-only, rather than
10047 loading it in the prologue for each function.  The run-time system is
10048 responsible for initializing this register with an appropriate value
10049 before execution begins.
10051 @item -mpic-register=@var{reg}
10052 @opindex mpic-register
10053 Specify the register to be used for PIC addressing.  The default is R10
10054 unless stack-checking is enabled, when R9 is used.
10056 @item -mcirrus-fix-invalid-insns
10057 @opindex mcirrus-fix-invalid-insns
10058 @opindex mno-cirrus-fix-invalid-insns
10059 Insert NOPs into the instruction stream to in order to work around
10060 problems with invalid Maverick instruction combinations.  This option
10061 is only valid if the @option{-mcpu=ep9312} option has been used to
10062 enable generation of instructions for the Cirrus Maverick floating
10063 point co-processor.  This option is not enabled by default, since the
10064 problem is only present in older Maverick implementations.  The default
10065 can be re-enabled by use of the @option{-mno-cirrus-fix-invalid-insns}
10066 switch.
10068 @item -mpoke-function-name
10069 @opindex mpoke-function-name
10070 Write the name of each function into the text section, directly
10071 preceding the function prologue.  The generated code is similar to this:
10073 @smallexample
10074      t0
10075          .ascii "arm_poke_function_name", 0
10076          .align
10077      t1
10078          .word 0xff000000 + (t1 - t0)
10079      arm_poke_function_name
10080          mov     ip, sp
10081          stmfd   sp!, @{fp, ip, lr, pc@}
10082          sub     fp, ip, #4
10083 @end smallexample
10085 When performing a stack backtrace, code can inspect the value of
10086 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
10087 location @code{pc - 12} and the top 8 bits are set, then we know that
10088 there is a function name embedded immediately preceding this location
10089 and has length @code{((pc[-3]) & 0xff000000)}.
10091 @item -mthumb
10092 @opindex mthumb
10093 Generate code for the Thumb instruction set.  The default is to
10094 use the 32-bit ARM instruction set.
10095 This option automatically enables either 16-bit Thumb-1 or
10096 mixed 16/32-bit Thumb-2 instructions based on the @option{-mcpu=@var{name}}
10097 and @option{-march=@var{name}} options.  This option is not passed to the
10098 assembler. If you want to force assembler files to be interpreted as Thumb code,
10099 either add a @samp{.thumb} directive to the source or pass the @option{-mthumb}
10100 option directly to the assembler by prefixing it with @option{-Wa}.
10102 @item -mtpcs-frame
10103 @opindex mtpcs-frame
10104 Generate a stack frame that is compliant with the Thumb Procedure Call
10105 Standard for all non-leaf functions.  (A leaf function is one that does
10106 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
10108 @item -mtpcs-leaf-frame
10109 @opindex mtpcs-leaf-frame
10110 Generate a stack frame that is compliant with the Thumb Procedure Call
10111 Standard for all leaf functions.  (A leaf function is one that does
10112 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
10114 @item -mcallee-super-interworking
10115 @opindex mcallee-super-interworking
10116 Gives all externally visible functions in the file being compiled an ARM
10117 instruction set header which switches to Thumb mode before executing the
10118 rest of the function.  This allows these functions to be called from
10119 non-interworking code.  This option is not valid in AAPCS configurations
10120 because interworking is enabled by default.
10122 @item -mcaller-super-interworking
10123 @opindex mcaller-super-interworking
10124 Allows calls via function pointers (including virtual functions) to
10125 execute correctly regardless of whether the target code has been
10126 compiled for interworking or not.  There is a small overhead in the cost
10127 of executing a function pointer if this option is enabled.  This option
10128 is not valid in AAPCS configurations because interworking is enabled
10129 by default.
10131 @item -mtp=@var{name}
10132 @opindex mtp
10133 Specify the access model for the thread local storage pointer.  The valid
10134 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
10135 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
10136 (supported in the arm6k architecture), and @option{auto}, which uses the
10137 best available method for the selected processor.  The default setting is
10138 @option{auto}.
10140 @item -mword-relocations
10141 @opindex mword-relocations
10142 Only generate absolute relocations on word sized values (i.e. R_ARM_ABS32).
10143 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
10144 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
10145 is specified.
10147 @item -mfix-cortex-m3-ldrd
10148 @opindex mfix-cortex-m3-ldrd
10149 Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
10150 with overlapping destination and base registers are used.  This option avoids
10151 generating these instructions.  This option is enabled by default when
10152 @option{-mcpu=cortex-m3} is specified.
10154 @end table
10156 @node AVR Options
10157 @subsection AVR Options
10158 @cindex AVR Options
10160 These options are defined for AVR implementations:
10162 @table @gcctabopt
10163 @item -mmcu=@var{mcu}
10164 @opindex mmcu
10165 Specify ATMEL AVR instruction set or MCU type.
10167 Instruction set avr1 is for the minimal AVR core, not supported by the C
10168 compiler, only for assembler programs (MCU types: at90s1200, attiny10,
10169 attiny11, attiny12, attiny15, attiny28).
10171 Instruction set avr2 (default) is for the classic AVR core with up to
10172 8K program memory space (MCU types: at90s2313, at90s2323, attiny22,
10173 at90s2333, at90s2343, at90s4414, at90s4433, at90s4434, at90s8515,
10174 at90c8534, at90s8535).
10176 Instruction set avr3 is for the classic AVR core with up to 128K program
10177 memory space (MCU types: atmega103, atmega603, at43usb320, at76c711).
10179 Instruction set avr4 is for the enhanced AVR core with up to 8K program
10180 memory space (MCU types: atmega8, atmega83, atmega85).
10182 Instruction set avr5 is for the enhanced AVR core with up to 128K program
10183 memory space (MCU types: atmega16, atmega161, atmega163, atmega32, atmega323,
10184 atmega64, atmega128, at43usb355, at94k).
10186 @item -mno-interrupts
10187 @opindex mno-interrupts
10188 Generated code is not compatible with hardware interrupts.
10189 Code size will be smaller.
10191 @item -mcall-prologues
10192 @opindex mcall-prologues
10193 Functions prologues/epilogues expanded as call to appropriate
10194 subroutines.  Code size will be smaller.
10196 @item -mtiny-stack
10197 @opindex mtiny-stack
10198 Change only the low 8 bits of the stack pointer.
10200 @item -mint8
10201 @opindex mint8
10202 Assume int to be 8 bit integer.  This affects the sizes of all types: A
10203 char will be 1 byte, an int will be 1 byte, a long will be 2 bytes
10204 and long long will be 4 bytes.  Please note that this option does not
10205 comply to the C standards, but it will provide you with smaller code
10206 size.
10207 @end table
10209 @node Blackfin Options
10210 @subsection Blackfin Options
10211 @cindex Blackfin Options
10213 @table @gcctabopt
10214 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
10215 @opindex mcpu=
10216 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
10217 can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
10218 @samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
10219 @samp{bf527}, @samp{bf531}, @samp{bf532}, @samp{bf533},
10220 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
10221 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
10222 @samp{bf542m}, @samp{bf544m}, @samp{bf547m}, @samp{bf548m}, @samp{bf549m},
10223 @samp{bf561}.
10224 The optional @var{sirevision} specifies the silicon revision of the target
10225 Blackfin processor.  Any workarounds available for the targeted silicon revision
10226 will be enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
10227 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
10228 will be enabled.  The @code{__SILICON_REVISION__} macro is defined to two
10229 hexadecimal digits representing the major and minor numbers in the silicon
10230 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
10231 is not defined.  If @var{sirevision} is @samp{any}, the
10232 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
10233 If this optional @var{sirevision} is not used, GCC assumes the latest known
10234 silicon revision of the targeted Blackfin processor.
10236 Support for @samp{bf561} is incomplete.  For @samp{bf561},
10237 Only the processor macro is defined.
10238 Without this option, @samp{bf532} is used as the processor by default.
10239 The corresponding predefined processor macros for @var{cpu} is to
10240 be defined.  And for @samp{bfin-elf} toolchain, this causes the hardware BSP
10241 provided by libgloss to be linked in if @option{-msim} is not given.
10243 @item -msim
10244 @opindex msim
10245 Specifies that the program will be run on the simulator.  This causes
10246 the simulator BSP provided by libgloss to be linked in.  This option
10247 has effect only for @samp{bfin-elf} toolchain.
10248 Certain other options, such as @option{-mid-shared-library} and
10249 @option{-mfdpic}, imply @option{-msim}.
10251 @item -momit-leaf-frame-pointer
10252 @opindex momit-leaf-frame-pointer
10253 Don't keep the frame pointer in a register for leaf functions.  This
10254 avoids the instructions to save, set up and restore frame pointers and
10255 makes an extra register available in leaf functions.  The option
10256 @option{-fomit-frame-pointer} removes the frame pointer for all functions
10257 which might make debugging harder.
10259 @item -mspecld-anomaly
10260 @opindex mspecld-anomaly
10261 When enabled, the compiler will ensure that the generated code does not
10262 contain speculative loads after jump instructions. If this option is used,
10263 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
10265 @item -mno-specld-anomaly
10266 @opindex mno-specld-anomaly
10267 Don't generate extra code to prevent speculative loads from occurring.
10269 @item -mcsync-anomaly
10270 @opindex mcsync-anomaly
10271 When enabled, the compiler will ensure that the generated code does not
10272 contain CSYNC or SSYNC instructions too soon after conditional branches.
10273 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
10275 @item -mno-csync-anomaly
10276 @opindex mno-csync-anomaly
10277 Don't generate extra code to prevent CSYNC or SSYNC instructions from
10278 occurring too soon after a conditional branch.
10280 @item -mlow-64k
10281 @opindex mlow-64k
10282 When enabled, the compiler is free to take advantage of the knowledge that
10283 the entire program fits into the low 64k of memory.
10285 @item -mno-low-64k
10286 @opindex mno-low-64k
10287 Assume that the program is arbitrarily large.  This is the default.
10289 @item -mstack-check-l1
10290 @opindex mstack-check-l1
10291 Do stack checking using information placed into L1 scratchpad memory by the
10292 uClinux kernel.
10294 @item -mid-shared-library
10295 @opindex mid-shared-library
10296 Generate code that supports shared libraries via the library ID method.
10297 This allows for execute in place and shared libraries in an environment
10298 without virtual memory management.  This option implies @option{-fPIC}.
10299 With a @samp{bfin-elf} target, this option implies @option{-msim}.
10301 @item -mno-id-shared-library
10302 @opindex mno-id-shared-library
10303 Generate code that doesn't assume ID based shared libraries are being used.
10304 This is the default.
10306 @item -mleaf-id-shared-library
10307 @opindex mleaf-id-shared-library
10308 Generate code that supports shared libraries via the library ID method,
10309 but assumes that this library or executable won't link against any other
10310 ID shared libraries.  That allows the compiler to use faster code for jumps
10311 and calls.
10313 @item -mno-leaf-id-shared-library
10314 @opindex mno-leaf-id-shared-library
10315 Do not assume that the code being compiled won't link against any ID shared
10316 libraries.  Slower code will be generated for jump and call insns.
10318 @item -mshared-library-id=n
10319 @opindex mshared-library-id
10320 Specified the identification number of the ID based shared library being
10321 compiled.  Specifying a value of 0 will generate more compact code, specifying
10322 other values will force the allocation of that number to the current
10323 library but is no more space or time efficient than omitting this option.
10325 @item -msep-data
10326 @opindex msep-data
10327 Generate code that allows the data segment to be located in a different
10328 area of memory from the text segment.  This allows for execute in place in
10329 an environment without virtual memory management by eliminating relocations
10330 against the text section.
10332 @item -mno-sep-data
10333 @opindex mno-sep-data
10334 Generate code that assumes that the data segment follows the text segment.
10335 This is the default.
10337 @item -mlong-calls
10338 @itemx -mno-long-calls
10339 @opindex mlong-calls
10340 @opindex mno-long-calls
10341 Tells the compiler to perform function calls by first loading the
10342 address of the function into a register and then performing a subroutine
10343 call on this register.  This switch is needed if the target function
10344 will lie outside of the 24 bit addressing range of the offset based
10345 version of subroutine call instruction.
10347 This feature is not enabled by default.  Specifying
10348 @option{-mno-long-calls} will restore the default behavior.  Note these
10349 switches have no effect on how the compiler generates code to handle
10350 function calls via function pointers.
10352 @item -mfast-fp
10353 @opindex mfast-fp
10354 Link with the fast floating-point library. This library relaxes some of
10355 the IEEE floating-point standard's rules for checking inputs against
10356 Not-a-Number (NAN), in the interest of performance.
10358 @item -minline-plt
10359 @opindex minline-plt
10360 Enable inlining of PLT entries in function calls to functions that are
10361 not known to bind locally.  It has no effect without @option{-mfdpic}.
10363 @item -mmulticore
10364 @opindex mmulticore
10365 Build standalone application for multicore Blackfin processor. Proper
10366 start files and link scripts will be used to support multicore.
10367 This option defines @code{__BFIN_MULTICORE}. It can only be used with
10368 @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. It can be used with
10369 @option{-mcorea} or @option{-mcoreb}. If it's used without
10370 @option{-mcorea} or @option{-mcoreb}, single application/dual core
10371 programming model is used. In this model, the main function of Core B
10372 should be named as coreb_main. If it's used with @option{-mcorea} or
10373 @option{-mcoreb}, one application per core programming model is used.
10374 If this option is not used, single core application programming
10375 model is used.
10377 @item -mcorea
10378 @opindex mcorea
10379 Build standalone application for Core A of BF561 when using
10380 one application per core programming model. Proper start files
10381 and link scripts will be used to support Core A. This option
10382 defines @code{__BFIN_COREA}. It must be used with @option{-mmulticore}.
10384 @item -mcoreb
10385 @opindex mcoreb
10386 Build standalone application for Core B of BF561 when using
10387 one application per core programming model. Proper start files
10388 and link scripts will be used to support Core B. This option
10389 defines @code{__BFIN_COREB}. When this option is used, coreb_main
10390 should be used instead of main. It must be used with
10391 @option{-mmulticore}.
10393 @item -msdram
10394 @opindex msdram
10395 Build standalone application for SDRAM. Proper start files and
10396 link scripts will be used to put the application into SDRAM.
10397 Loader should initialize SDRAM before loading the application
10398 into SDRAM. This option defines @code{__BFIN_SDRAM}.
10400 @item -micplb
10401 @opindex micplb
10402 Assume that ICPLBs are enabled at runtime.  This has an effect on certain
10403 anomaly workarounds.  For Linux targets, the default is to assume ICPLBs
10404 are enabled; for standalone applications the default is off.
10405 @end table
10407 @node CRIS Options
10408 @subsection CRIS Options
10409 @cindex CRIS Options
10411 These options are defined specifically for the CRIS ports.
10413 @table @gcctabopt
10414 @item -march=@var{architecture-type}
10415 @itemx -mcpu=@var{architecture-type}
10416 @opindex march
10417 @opindex mcpu
10418 Generate code for the specified architecture.  The choices for
10419 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
10420 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
10421 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
10422 @samp{v10}.
10424 @item -mtune=@var{architecture-type}
10425 @opindex mtune
10426 Tune to @var{architecture-type} everything applicable about the generated
10427 code, except for the ABI and the set of available instructions.  The
10428 choices for @var{architecture-type} are the same as for
10429 @option{-march=@var{architecture-type}}.
10431 @item -mmax-stack-frame=@var{n}
10432 @opindex mmax-stack-frame
10433 Warn when the stack frame of a function exceeds @var{n} bytes.
10435 @item -metrax4
10436 @itemx -metrax100
10437 @opindex metrax4
10438 @opindex metrax100
10439 The options @option{-metrax4} and @option{-metrax100} are synonyms for
10440 @option{-march=v3} and @option{-march=v8} respectively.
10442 @item -mmul-bug-workaround
10443 @itemx -mno-mul-bug-workaround
10444 @opindex mmul-bug-workaround
10445 @opindex mno-mul-bug-workaround
10446 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
10447 models where it applies.  This option is active by default.
10449 @item -mpdebug
10450 @opindex mpdebug
10451 Enable CRIS-specific verbose debug-related information in the assembly
10452 code.  This option also has the effect to turn off the @samp{#NO_APP}
10453 formatted-code indicator to the assembler at the beginning of the
10454 assembly file.
10456 @item -mcc-init
10457 @opindex mcc-init
10458 Do not use condition-code results from previous instruction; always emit
10459 compare and test instructions before use of condition codes.
10461 @item -mno-side-effects
10462 @opindex mno-side-effects
10463 Do not emit instructions with side-effects in addressing modes other than
10464 post-increment.
10466 @item -mstack-align
10467 @itemx -mno-stack-align
10468 @itemx -mdata-align
10469 @itemx -mno-data-align
10470 @itemx -mconst-align
10471 @itemx -mno-const-align
10472 @opindex mstack-align
10473 @opindex mno-stack-align
10474 @opindex mdata-align
10475 @opindex mno-data-align
10476 @opindex mconst-align
10477 @opindex mno-const-align
10478 These options (no-options) arranges (eliminate arrangements) for the
10479 stack-frame, individual data and constants to be aligned for the maximum
10480 single data access size for the chosen CPU model.  The default is to
10481 arrange for 32-bit alignment.  ABI details such as structure layout are
10482 not affected by these options.
10484 @item -m32-bit
10485 @itemx -m16-bit
10486 @itemx -m8-bit
10487 @opindex m32-bit
10488 @opindex m16-bit
10489 @opindex m8-bit
10490 Similar to the stack- data- and const-align options above, these options
10491 arrange for stack-frame, writable data and constants to all be 32-bit,
10492 16-bit or 8-bit aligned.  The default is 32-bit alignment.
10494 @item -mno-prologue-epilogue
10495 @itemx -mprologue-epilogue
10496 @opindex mno-prologue-epilogue
10497 @opindex mprologue-epilogue
10498 With @option{-mno-prologue-epilogue}, the normal function prologue and
10499 epilogue that sets up the stack-frame are omitted and no return
10500 instructions or return sequences are generated in the code.  Use this
10501 option only together with visual inspection of the compiled code: no
10502 warnings or errors are generated when call-saved registers must be saved,
10503 or storage for local variable needs to be allocated.
10505 @item -mno-gotplt
10506 @itemx -mgotplt
10507 @opindex mno-gotplt
10508 @opindex mgotplt
10509 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
10510 instruction sequences that load addresses for functions from the PLT part
10511 of the GOT rather than (traditional on other architectures) calls to the
10512 PLT@.  The default is @option{-mgotplt}.
10514 @item -melf
10515 @opindex melf
10516 Legacy no-op option only recognized with the cris-axis-elf and
10517 cris-axis-linux-gnu targets.
10519 @item -mlinux
10520 @opindex mlinux
10521 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
10523 @item -sim
10524 @opindex sim
10525 This option, recognized for the cris-axis-elf arranges
10526 to link with input-output functions from a simulator library.  Code,
10527 initialized data and zero-initialized data are allocated consecutively.
10529 @item -sim2
10530 @opindex sim2
10531 Like @option{-sim}, but pass linker options to locate initialized data at
10532 0x40000000 and zero-initialized data at 0x80000000.
10533 @end table
10535 @node CRX Options
10536 @subsection CRX Options
10537 @cindex CRX Options
10539 These options are defined specifically for the CRX ports.
10541 @table @gcctabopt
10543 @item -mmac
10544 @opindex mmac
10545 Enable the use of multiply-accumulate instructions. Disabled by default.
10547 @item -mpush-args
10548 @opindex mpush-args
10549 Push instructions will be used to pass outgoing arguments when functions
10550 are called. Enabled by default.
10551 @end table
10553 @node Darwin Options
10554 @subsection Darwin Options
10555 @cindex Darwin options
10557 These options are defined for all architectures running the Darwin operating
10558 system.
10560 FSF GCC on Darwin does not create ``fat'' object files; it will create
10561 an object file for the single architecture that it was built to
10562 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
10563 @option{-arch} options are used; it does so by running the compiler or
10564 linker multiple times and joining the results together with
10565 @file{lipo}.
10567 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
10568 @samp{i686}) is determined by the flags that specify the ISA
10569 that GCC is targetting, like @option{-mcpu} or @option{-march}.  The
10570 @option{-force_cpusubtype_ALL} option can be used to override this.
10572 The Darwin tools vary in their behavior when presented with an ISA
10573 mismatch.  The assembler, @file{as}, will only permit instructions to
10574 be used that are valid for the subtype of the file it is generating,
10575 so you cannot put 64-bit instructions in a @samp{ppc750} object file.
10576 The linker for shared libraries, @file{/usr/bin/libtool}, will fail
10577 and print an error if asked to create a shared library with a less
10578 restrictive subtype than its input files (for instance, trying to put
10579 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
10580 for executables, @file{ld}, will quietly give the executable the most
10581 restrictive subtype of any of its input files.
10583 @table @gcctabopt
10584 @item -F@var{dir}
10585 @opindex F
10586 Add the framework directory @var{dir} to the head of the list of
10587 directories to be searched for header files.  These directories are
10588 interleaved with those specified by @option{-I} options and are
10589 scanned in a left-to-right order.
10591 A framework directory is a directory with frameworks in it.  A
10592 framework is a directory with a @samp{"Headers"} and/or
10593 @samp{"PrivateHeaders"} directory contained directly in it that ends
10594 in @samp{".framework"}.  The name of a framework is the name of this
10595 directory excluding the @samp{".framework"}.  Headers associated with
10596 the framework are found in one of those two directories, with
10597 @samp{"Headers"} being searched first.  A subframework is a framework
10598 directory that is in a framework's @samp{"Frameworks"} directory.
10599 Includes of subframework headers can only appear in a header of a
10600 framework that contains the subframework, or in a sibling subframework
10601 header.  Two subframeworks are siblings if they occur in the same
10602 framework.  A subframework should not have the same name as a
10603 framework, a warning will be issued if this is violated.  Currently a
10604 subframework cannot have subframeworks, in the future, the mechanism
10605 may be extended to support this.  The standard frameworks can be found
10606 in @samp{"/System/Library/Frameworks"} and
10607 @samp{"/Library/Frameworks"}.  An example include looks like
10608 @code{#include <Framework/header.h>}, where @samp{Framework} denotes
10609 the name of the framework and header.h is found in the
10610 @samp{"PrivateHeaders"} or @samp{"Headers"} directory.
10612 @item -iframework@var{dir}
10613 @opindex iframework
10614 Like @option{-F} except the directory is a treated as a system
10615 directory.  The main difference between this @option{-iframework} and
10616 @option{-F} is that with @option{-iframework} the compiler does not
10617 warn about constructs contained within header files found via
10618 @var{dir}.  This option is valid only for the C family of languages.
10620 @item -gused
10621 @opindex gused
10622 Emit debugging information for symbols that are used.  For STABS
10623 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
10624 This is by default ON@.
10626 @item -gfull
10627 @opindex gfull
10628 Emit debugging information for all symbols and types.
10630 @item -mmacosx-version-min=@var{version}
10631 The earliest version of MacOS X that this executable will run on
10632 is @var{version}.  Typical values of @var{version} include @code{10.1},
10633 @code{10.2}, and @code{10.3.9}.
10635 If the compiler was built to use the system's headers by default,
10636 then the default for this option is the system version on which the
10637 compiler is running, otherwise the default is to make choices which
10638 are compatible with as many systems and code bases as possible.
10640 @item -mkernel
10641 @opindex mkernel
10642 Enable kernel development mode.  The @option{-mkernel} option sets
10643 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
10644 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
10645 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
10646 applicable.  This mode also sets @option{-mno-altivec},
10647 @option{-msoft-float}, @option{-fno-builtin} and
10648 @option{-mlong-branch} for PowerPC targets.
10650 @item -mone-byte-bool
10651 @opindex mone-byte-bool
10652 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
10653 By default @samp{sizeof(bool)} is @samp{4} when compiling for
10654 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
10655 option has no effect on x86.
10657 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
10658 to generate code that is not binary compatible with code generated
10659 without that switch.  Using this switch may require recompiling all
10660 other modules in a program, including system libraries.  Use this
10661 switch to conform to a non-default data model.
10663 @item -mfix-and-continue
10664 @itemx -ffix-and-continue
10665 @itemx -findirect-data
10666 @opindex mfix-and-continue
10667 @opindex ffix-and-continue
10668 @opindex findirect-data
10669 Generate code suitable for fast turn around development.  Needed to
10670 enable gdb to dynamically load @code{.o} files into already running
10671 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
10672 are provided for backwards compatibility.
10674 @item -all_load
10675 @opindex all_load
10676 Loads all members of static archive libraries.
10677 See man ld(1) for more information.
10679 @item -arch_errors_fatal
10680 @opindex arch_errors_fatal
10681 Cause the errors having to do with files that have the wrong architecture
10682 to be fatal.
10684 @item -bind_at_load
10685 @opindex bind_at_load
10686 Causes the output file to be marked such that the dynamic linker will
10687 bind all undefined references when the file is loaded or launched.
10689 @item -bundle
10690 @opindex bundle
10691 Produce a Mach-o bundle format file.
10692 See man ld(1) for more information.
10694 @item -bundle_loader @var{executable}
10695 @opindex bundle_loader
10696 This option specifies the @var{executable} that will be loading the build
10697 output file being linked.  See man ld(1) for more information.
10699 @item -dynamiclib
10700 @opindex dynamiclib
10701 When passed this option, GCC will produce a dynamic library instead of
10702 an executable when linking, using the Darwin @file{libtool} command.
10704 @item -force_cpusubtype_ALL
10705 @opindex force_cpusubtype_ALL
10706 This causes GCC's output file to have the @var{ALL} subtype, instead of
10707 one controlled by the @option{-mcpu} or @option{-march} option.
10709 @item -allowable_client  @var{client_name}
10710 @itemx -client_name
10711 @itemx -compatibility_version
10712 @itemx -current_version
10713 @itemx -dead_strip
10714 @itemx -dependency-file
10715 @itemx -dylib_file
10716 @itemx -dylinker_install_name
10717 @itemx -dynamic
10718 @itemx -exported_symbols_list
10719 @itemx -filelist
10720 @itemx -flat_namespace
10721 @itemx -force_flat_namespace
10722 @itemx -headerpad_max_install_names
10723 @itemx -image_base
10724 @itemx -init
10725 @itemx -install_name
10726 @itemx -keep_private_externs
10727 @itemx -multi_module
10728 @itemx -multiply_defined
10729 @itemx -multiply_defined_unused
10730 @itemx -noall_load
10731 @itemx -no_dead_strip_inits_and_terms
10732 @itemx -nofixprebinding
10733 @itemx -nomultidefs
10734 @itemx -noprebind
10735 @itemx -noseglinkedit
10736 @itemx -pagezero_size
10737 @itemx -prebind
10738 @itemx -prebind_all_twolevel_modules
10739 @itemx -private_bundle
10740 @itemx -read_only_relocs
10741 @itemx -sectalign
10742 @itemx -sectobjectsymbols
10743 @itemx -whyload
10744 @itemx -seg1addr
10745 @itemx -sectcreate
10746 @itemx -sectobjectsymbols
10747 @itemx -sectorder
10748 @itemx -segaddr
10749 @itemx -segs_read_only_addr
10750 @itemx -segs_read_write_addr
10751 @itemx -seg_addr_table
10752 @itemx -seg_addr_table_filename
10753 @itemx -seglinkedit
10754 @itemx -segprot
10755 @itemx -segs_read_only_addr
10756 @itemx -segs_read_write_addr
10757 @itemx -single_module
10758 @itemx -static
10759 @itemx -sub_library
10760 @itemx -sub_umbrella
10761 @itemx -twolevel_namespace
10762 @itemx -umbrella
10763 @itemx -undefined
10764 @itemx -unexported_symbols_list
10765 @itemx -weak_reference_mismatches
10766 @itemx -whatsloaded
10767 @opindex allowable_client
10768 @opindex client_name
10769 @opindex compatibility_version
10770 @opindex current_version
10771 @opindex dead_strip
10772 @opindex dependency-file
10773 @opindex dylib_file
10774 @opindex dylinker_install_name
10775 @opindex dynamic
10776 @opindex exported_symbols_list
10777 @opindex filelist
10778 @opindex flat_namespace
10779 @opindex force_flat_namespace
10780 @opindex headerpad_max_install_names
10781 @opindex image_base
10782 @opindex init
10783 @opindex install_name
10784 @opindex keep_private_externs
10785 @opindex multi_module
10786 @opindex multiply_defined
10787 @opindex multiply_defined_unused
10788 @opindex noall_load
10789 @opindex no_dead_strip_inits_and_terms
10790 @opindex nofixprebinding
10791 @opindex nomultidefs
10792 @opindex noprebind
10793 @opindex noseglinkedit
10794 @opindex pagezero_size
10795 @opindex prebind
10796 @opindex prebind_all_twolevel_modules
10797 @opindex private_bundle
10798 @opindex read_only_relocs
10799 @opindex sectalign
10800 @opindex sectobjectsymbols
10801 @opindex whyload
10802 @opindex seg1addr
10803 @opindex sectcreate
10804 @opindex sectobjectsymbols
10805 @opindex sectorder
10806 @opindex segaddr
10807 @opindex segs_read_only_addr
10808 @opindex segs_read_write_addr
10809 @opindex seg_addr_table
10810 @opindex seg_addr_table_filename
10811 @opindex seglinkedit
10812 @opindex segprot
10813 @opindex segs_read_only_addr
10814 @opindex segs_read_write_addr
10815 @opindex single_module
10816 @opindex static
10817 @opindex sub_library
10818 @opindex sub_umbrella
10819 @opindex twolevel_namespace
10820 @opindex umbrella
10821 @opindex undefined
10822 @opindex unexported_symbols_list
10823 @opindex weak_reference_mismatches
10824 @opindex whatsloaded
10825 These options are passed to the Darwin linker.  The Darwin linker man page
10826 describes them in detail.
10827 @end table
10829 @node DEC Alpha Options
10830 @subsection DEC Alpha Options
10832 These @samp{-m} options are defined for the DEC Alpha implementations:
10834 @table @gcctabopt
10835 @item -mno-soft-float
10836 @itemx -msoft-float
10837 @opindex mno-soft-float
10838 @opindex msoft-float
10839 Use (do not use) the hardware floating-point instructions for
10840 floating-point operations.  When @option{-msoft-float} is specified,
10841 functions in @file{libgcc.a} will be used to perform floating-point
10842 operations.  Unless they are replaced by routines that emulate the
10843 floating-point operations, or compiled in such a way as to call such
10844 emulations routines, these routines will issue floating-point
10845 operations.   If you are compiling for an Alpha without floating-point
10846 operations, you must ensure that the library is built so as not to call
10847 them.
10849 Note that Alpha implementations without floating-point operations are
10850 required to have floating-point registers.
10852 @item -mfp-reg
10853 @itemx -mno-fp-regs
10854 @opindex mfp-reg
10855 @opindex mno-fp-regs
10856 Generate code that uses (does not use) the floating-point register set.
10857 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
10858 register set is not used, floating point operands are passed in integer
10859 registers as if they were integers and floating-point results are passed
10860 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
10861 so any function with a floating-point argument or return value called by code
10862 compiled with @option{-mno-fp-regs} must also be compiled with that
10863 option.
10865 A typical use of this option is building a kernel that does not use,
10866 and hence need not save and restore, any floating-point registers.
10868 @item -mieee
10869 @opindex mieee
10870 The Alpha architecture implements floating-point hardware optimized for
10871 maximum performance.  It is mostly compliant with the IEEE floating
10872 point standard.  However, for full compliance, software assistance is
10873 required.  This option generates code fully IEEE compliant code
10874 @emph{except} that the @var{inexact-flag} is not maintained (see below).
10875 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
10876 defined during compilation.  The resulting code is less efficient but is
10877 able to correctly support denormalized numbers and exceptional IEEE
10878 values such as not-a-number and plus/minus infinity.  Other Alpha
10879 compilers call this option @option{-ieee_with_no_inexact}.
10881 @item -mieee-with-inexact
10882 @opindex mieee-with-inexact
10883 This is like @option{-mieee} except the generated code also maintains
10884 the IEEE @var{inexact-flag}.  Turning on this option causes the
10885 generated code to implement fully-compliant IEEE math.  In addition to
10886 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
10887 macro.  On some Alpha implementations the resulting code may execute
10888 significantly slower than the code generated by default.  Since there is
10889 very little code that depends on the @var{inexact-flag}, you should
10890 normally not specify this option.  Other Alpha compilers call this
10891 option @option{-ieee_with_inexact}.
10893 @item -mfp-trap-mode=@var{trap-mode}
10894 @opindex mfp-trap-mode
10895 This option controls what floating-point related traps are enabled.
10896 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
10897 The trap mode can be set to one of four values:
10899 @table @samp
10900 @item n
10901 This is the default (normal) setting.  The only traps that are enabled
10902 are the ones that cannot be disabled in software (e.g., division by zero
10903 trap).
10905 @item u
10906 In addition to the traps enabled by @samp{n}, underflow traps are enabled
10907 as well.
10909 @item su
10910 Like @samp{u}, but the instructions are marked to be safe for software
10911 completion (see Alpha architecture manual for details).
10913 @item sui
10914 Like @samp{su}, but inexact traps are enabled as well.
10915 @end table
10917 @item -mfp-rounding-mode=@var{rounding-mode}
10918 @opindex mfp-rounding-mode
10919 Selects the IEEE rounding mode.  Other Alpha compilers call this option
10920 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
10923 @table @samp
10924 @item n
10925 Normal IEEE rounding mode.  Floating point numbers are rounded towards
10926 the nearest machine number or towards the even machine number in case
10927 of a tie.
10929 @item m
10930 Round towards minus infinity.
10932 @item c
10933 Chopped rounding mode.  Floating point numbers are rounded towards zero.
10935 @item d
10936 Dynamic rounding mode.  A field in the floating point control register
10937 (@var{fpcr}, see Alpha architecture reference manual) controls the
10938 rounding mode in effect.  The C library initializes this register for
10939 rounding towards plus infinity.  Thus, unless your program modifies the
10940 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
10941 @end table
10943 @item -mtrap-precision=@var{trap-precision}
10944 @opindex mtrap-precision
10945 In the Alpha architecture, floating point traps are imprecise.  This
10946 means without software assistance it is impossible to recover from a
10947 floating trap and program execution normally needs to be terminated.
10948 GCC can generate code that can assist operating system trap handlers
10949 in determining the exact location that caused a floating point trap.
10950 Depending on the requirements of an application, different levels of
10951 precisions can be selected:
10953 @table @samp
10954 @item p
10955 Program precision.  This option is the default and means a trap handler
10956 can only identify which program caused a floating point exception.
10958 @item f
10959 Function precision.  The trap handler can determine the function that
10960 caused a floating point exception.
10962 @item i
10963 Instruction precision.  The trap handler can determine the exact
10964 instruction that caused a floating point exception.
10965 @end table
10967 Other Alpha compilers provide the equivalent options called
10968 @option{-scope_safe} and @option{-resumption_safe}.
10970 @item -mieee-conformant
10971 @opindex mieee-conformant
10972 This option marks the generated code as IEEE conformant.  You must not
10973 use this option unless you also specify @option{-mtrap-precision=i} and either
10974 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
10975 is to emit the line @samp{.eflag 48} in the function prologue of the
10976 generated assembly file.  Under DEC Unix, this has the effect that
10977 IEEE-conformant math library routines will be linked in.
10979 @item -mbuild-constants
10980 @opindex mbuild-constants
10981 Normally GCC examines a 32- or 64-bit integer constant to
10982 see if it can construct it from smaller constants in two or three
10983 instructions.  If it cannot, it will output the constant as a literal and
10984 generate code to load it from the data segment at runtime.
10986 Use this option to require GCC to construct @emph{all} integer constants
10987 using code, even if it takes more instructions (the maximum is six).
10989 You would typically use this option to build a shared library dynamic
10990 loader.  Itself a shared library, it must relocate itself in memory
10991 before it can find the variables and constants in its own data segment.
10993 @item -malpha-as
10994 @itemx -mgas
10995 @opindex malpha-as
10996 @opindex mgas
10997 Select whether to generate code to be assembled by the vendor-supplied
10998 assembler (@option{-malpha-as}) or by the GNU assembler @option{-mgas}.
11000 @item -mbwx
11001 @itemx -mno-bwx
11002 @itemx -mcix
11003 @itemx -mno-cix
11004 @itemx -mfix
11005 @itemx -mno-fix
11006 @itemx -mmax
11007 @itemx -mno-max
11008 @opindex mbwx
11009 @opindex mno-bwx
11010 @opindex mcix
11011 @opindex mno-cix
11012 @opindex mfix
11013 @opindex mno-fix
11014 @opindex mmax
11015 @opindex mno-max
11016 Indicate whether GCC should generate code to use the optional BWX,
11017 CIX, FIX and MAX instruction sets.  The default is to use the instruction
11018 sets supported by the CPU type specified via @option{-mcpu=} option or that
11019 of the CPU on which GCC was built if none was specified.
11021 @item -mfloat-vax
11022 @itemx -mfloat-ieee
11023 @opindex mfloat-vax
11024 @opindex mfloat-ieee
11025 Generate code that uses (does not use) VAX F and G floating point
11026 arithmetic instead of IEEE single and double precision.
11028 @item -mexplicit-relocs
11029 @itemx -mno-explicit-relocs
11030 @opindex mexplicit-relocs
11031 @opindex mno-explicit-relocs
11032 Older Alpha assemblers provided no way to generate symbol relocations
11033 except via assembler macros.  Use of these macros does not allow
11034 optimal instruction scheduling.  GNU binutils as of version 2.12
11035 supports a new syntax that allows the compiler to explicitly mark
11036 which relocations should apply to which instructions.  This option
11037 is mostly useful for debugging, as GCC detects the capabilities of
11038 the assembler when it is built and sets the default accordingly.
11040 @item -msmall-data
11041 @itemx -mlarge-data
11042 @opindex msmall-data
11043 @opindex mlarge-data
11044 When @option{-mexplicit-relocs} is in effect, static data is
11045 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
11046 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
11047 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
11048 16-bit relocations off of the @code{$gp} register.  This limits the
11049 size of the small data area to 64KB, but allows the variables to be
11050 directly accessed via a single instruction.
11052 The default is @option{-mlarge-data}.  With this option the data area
11053 is limited to just below 2GB@.  Programs that require more than 2GB of
11054 data must use @code{malloc} or @code{mmap} to allocate the data in the
11055 heap instead of in the program's data segment.
11057 When generating code for shared libraries, @option{-fpic} implies
11058 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
11060 @item -msmall-text
11061 @itemx -mlarge-text
11062 @opindex msmall-text
11063 @opindex mlarge-text
11064 When @option{-msmall-text} is used, the compiler assumes that the
11065 code of the entire program (or shared library) fits in 4MB, and is
11066 thus reachable with a branch instruction.  When @option{-msmall-data}
11067 is used, the compiler can assume that all local symbols share the
11068 same @code{$gp} value, and thus reduce the number of instructions
11069 required for a function call from 4 to 1.
11071 The default is @option{-mlarge-text}.
11073 @item -mcpu=@var{cpu_type}
11074 @opindex mcpu
11075 Set the instruction set and instruction scheduling parameters for
11076 machine type @var{cpu_type}.  You can specify either the @samp{EV}
11077 style name or the corresponding chip number.  GCC supports scheduling
11078 parameters for the EV4, EV5 and EV6 family of processors and will
11079 choose the default values for the instruction set from the processor
11080 you specify.  If you do not specify a processor type, GCC will default
11081 to the processor on which the compiler was built.
11083 Supported values for @var{cpu_type} are
11085 @table @samp
11086 @item ev4
11087 @itemx ev45
11088 @itemx 21064
11089 Schedules as an EV4 and has no instruction set extensions.
11091 @item ev5
11092 @itemx 21164
11093 Schedules as an EV5 and has no instruction set extensions.
11095 @item ev56
11096 @itemx 21164a
11097 Schedules as an EV5 and supports the BWX extension.
11099 @item pca56
11100 @itemx 21164pc
11101 @itemx 21164PC
11102 Schedules as an EV5 and supports the BWX and MAX extensions.
11104 @item ev6
11105 @itemx 21264
11106 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
11108 @item ev67
11109 @itemx 21264a
11110 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
11111 @end table
11113 Native Linux/GNU toolchains also support the value @samp{native},
11114 which selects the best architecture option for the host processor.
11115 @option{-mcpu=native} has no effect if GCC does not recognize
11116 the processor.
11118 @item -mtune=@var{cpu_type}
11119 @opindex mtune
11120 Set only the instruction scheduling parameters for machine type
11121 @var{cpu_type}.  The instruction set is not changed.
11123 Native Linux/GNU toolchains also support the value @samp{native},
11124 which selects the best architecture option for the host processor.
11125 @option{-mtune=native} has no effect if GCC does not recognize
11126 the processor.
11128 @item -mmemory-latency=@var{time}
11129 @opindex mmemory-latency
11130 Sets the latency the scheduler should assume for typical memory
11131 references as seen by the application.  This number is highly
11132 dependent on the memory access patterns used by the application
11133 and the size of the external cache on the machine.
11135 Valid options for @var{time} are
11137 @table @samp
11138 @item @var{number}
11139 A decimal number representing clock cycles.
11141 @item L1
11142 @itemx L2
11143 @itemx L3
11144 @itemx main
11145 The compiler contains estimates of the number of clock cycles for
11146 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
11147 (also called Dcache, Scache, and Bcache), as well as to main memory.
11148 Note that L3 is only valid for EV5.
11150 @end table
11151 @end table
11153 @node DEC Alpha/VMS Options
11154 @subsection DEC Alpha/VMS Options
11156 These @samp{-m} options are defined for the DEC Alpha/VMS implementations:
11158 @table @gcctabopt
11159 @item -mvms-return-codes
11160 @opindex mvms-return-codes
11161 Return VMS condition codes from main.  The default is to return POSIX
11162 style condition (e.g.@: error) codes.
11164 @item -mdebug-main=@var{prefix}
11165 @opindex mdebug-main=@var{prefix}
11166 Flag the first routine whose name starts with @var{prefix} as the main
11167 routine for the debugger.
11169 @item -mmalloc64
11170 @opindex mmalloc64
11171 Default to 64bit memory allocation routines.
11172 @end table
11174 @node FR30 Options
11175 @subsection FR30 Options
11176 @cindex FR30 Options
11178 These options are defined specifically for the FR30 port.
11180 @table @gcctabopt
11182 @item -msmall-model
11183 @opindex msmall-model
11184 Use the small address space model.  This can produce smaller code, but
11185 it does assume that all symbolic values and addresses will fit into a
11186 20-bit range.
11188 @item -mno-lsim
11189 @opindex mno-lsim
11190 Assume that run-time support has been provided and so there is no need
11191 to include the simulator library (@file{libsim.a}) on the linker
11192 command line.
11194 @end table
11196 @node FRV Options
11197 @subsection FRV Options
11198 @cindex FRV Options
11200 @table @gcctabopt
11201 @item -mgpr-32
11202 @opindex mgpr-32
11204 Only use the first 32 general purpose registers.
11206 @item -mgpr-64
11207 @opindex mgpr-64
11209 Use all 64 general purpose registers.
11211 @item -mfpr-32
11212 @opindex mfpr-32
11214 Use only the first 32 floating point registers.
11216 @item -mfpr-64
11217 @opindex mfpr-64
11219 Use all 64 floating point registers
11221 @item -mhard-float
11222 @opindex mhard-float
11224 Use hardware instructions for floating point operations.
11226 @item -msoft-float
11227 @opindex msoft-float
11229 Use library routines for floating point operations.
11231 @item -malloc-cc
11232 @opindex malloc-cc
11234 Dynamically allocate condition code registers.
11236 @item -mfixed-cc
11237 @opindex mfixed-cc
11239 Do not try to dynamically allocate condition code registers, only
11240 use @code{icc0} and @code{fcc0}.
11242 @item -mdword
11243 @opindex mdword
11245 Change ABI to use double word insns.
11247 @item -mno-dword
11248 @opindex mno-dword
11250 Do not use double word instructions.
11252 @item -mdouble
11253 @opindex mdouble
11255 Use floating point double instructions.
11257 @item -mno-double
11258 @opindex mno-double
11260 Do not use floating point double instructions.
11262 @item -mmedia
11263 @opindex mmedia
11265 Use media instructions.
11267 @item -mno-media
11268 @opindex mno-media
11270 Do not use media instructions.
11272 @item -mmuladd
11273 @opindex mmuladd
11275 Use multiply and add/subtract instructions.
11277 @item -mno-muladd
11278 @opindex mno-muladd
11280 Do not use multiply and add/subtract instructions.
11282 @item -mfdpic
11283 @opindex mfdpic
11285 Select the FDPIC ABI, that uses function descriptors to represent
11286 pointers to functions.  Without any PIC/PIE-related options, it
11287 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
11288 assumes GOT entries and small data are within a 12-bit range from the
11289 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
11290 are computed with 32 bits.
11291 With a @samp{bfin-elf} target, this option implies @option{-msim}.
11293 @item -minline-plt
11294 @opindex minline-plt
11296 Enable inlining of PLT entries in function calls to functions that are
11297 not known to bind locally.  It has no effect without @option{-mfdpic}.
11298 It's enabled by default if optimizing for speed and compiling for
11299 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
11300 optimization option such as @option{-O3} or above is present in the
11301 command line.
11303 @item -mTLS
11304 @opindex mTLS
11306 Assume a large TLS segment when generating thread-local code.
11308 @item -mtls
11309 @opindex mtls
11311 Do not assume a large TLS segment when generating thread-local code.
11313 @item -mgprel-ro
11314 @opindex mgprel-ro
11316 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
11317 that is known to be in read-only sections.  It's enabled by default,
11318 except for @option{-fpic} or @option{-fpie}: even though it may help
11319 make the global offset table smaller, it trades 1 instruction for 4.
11320 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
11321 one of which may be shared by multiple symbols, and it avoids the need
11322 for a GOT entry for the referenced symbol, so it's more likely to be a
11323 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
11325 @item -multilib-library-pic
11326 @opindex multilib-library-pic
11328 Link with the (library, not FD) pic libraries.  It's implied by
11329 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
11330 @option{-fpic} without @option{-mfdpic}.  You should never have to use
11331 it explicitly.
11333 @item -mlinked-fp
11334 @opindex mlinked-fp
11336 Follow the EABI requirement of always creating a frame pointer whenever
11337 a stack frame is allocated.  This option is enabled by default and can
11338 be disabled with @option{-mno-linked-fp}.
11340 @item -mlong-calls
11341 @opindex mlong-calls
11343 Use indirect addressing to call functions outside the current
11344 compilation unit.  This allows the functions to be placed anywhere
11345 within the 32-bit address space.
11347 @item -malign-labels
11348 @opindex malign-labels
11350 Try to align labels to an 8-byte boundary by inserting nops into the
11351 previous packet.  This option only has an effect when VLIW packing
11352 is enabled.  It doesn't create new packets; it merely adds nops to
11353 existing ones.
11355 @item -mlibrary-pic
11356 @opindex mlibrary-pic
11358 Generate position-independent EABI code.
11360 @item -macc-4
11361 @opindex macc-4
11363 Use only the first four media accumulator registers.
11365 @item -macc-8
11366 @opindex macc-8
11368 Use all eight media accumulator registers.
11370 @item -mpack
11371 @opindex mpack
11373 Pack VLIW instructions.
11375 @item -mno-pack
11376 @opindex mno-pack
11378 Do not pack VLIW instructions.
11380 @item -mno-eflags
11381 @opindex mno-eflags
11383 Do not mark ABI switches in e_flags.
11385 @item -mcond-move
11386 @opindex mcond-move
11388 Enable the use of conditional-move instructions (default).
11390 This switch is mainly for debugging the compiler and will likely be removed
11391 in a future version.
11393 @item -mno-cond-move
11394 @opindex mno-cond-move
11396 Disable the use of conditional-move instructions.
11398 This switch is mainly for debugging the compiler and will likely be removed
11399 in a future version.
11401 @item -mscc
11402 @opindex mscc
11404 Enable the use of conditional set instructions (default).
11406 This switch is mainly for debugging the compiler and will likely be removed
11407 in a future version.
11409 @item -mno-scc
11410 @opindex mno-scc
11412 Disable the use of conditional set instructions.
11414 This switch is mainly for debugging the compiler and will likely be removed
11415 in a future version.
11417 @item -mcond-exec
11418 @opindex mcond-exec
11420 Enable the use of conditional execution (default).
11422 This switch is mainly for debugging the compiler and will likely be removed
11423 in a future version.
11425 @item -mno-cond-exec
11426 @opindex mno-cond-exec
11428 Disable the use of conditional execution.
11430 This switch is mainly for debugging the compiler and will likely be removed
11431 in a future version.
11433 @item -mvliw-branch
11434 @opindex mvliw-branch
11436 Run a pass to pack branches into VLIW instructions (default).
11438 This switch is mainly for debugging the compiler and will likely be removed
11439 in a future version.
11441 @item -mno-vliw-branch
11442 @opindex mno-vliw-branch
11444 Do not run a pass to pack branches into VLIW instructions.
11446 This switch is mainly for debugging the compiler and will likely be removed
11447 in a future version.
11449 @item -mmulti-cond-exec
11450 @opindex mmulti-cond-exec
11452 Enable optimization of @code{&&} and @code{||} in conditional execution
11453 (default).
11455 This switch is mainly for debugging the compiler and will likely be removed
11456 in a future version.
11458 @item -mno-multi-cond-exec
11459 @opindex mno-multi-cond-exec
11461 Disable optimization of @code{&&} and @code{||} in conditional execution.
11463 This switch is mainly for debugging the compiler and will likely be removed
11464 in a future version.
11466 @item -mnested-cond-exec
11467 @opindex mnested-cond-exec
11469 Enable nested conditional execution optimizations (default).
11471 This switch is mainly for debugging the compiler and will likely be removed
11472 in a future version.
11474 @item -mno-nested-cond-exec
11475 @opindex mno-nested-cond-exec
11477 Disable nested conditional execution optimizations.
11479 This switch is mainly for debugging the compiler and will likely be removed
11480 in a future version.
11482 @item -moptimize-membar
11483 @opindex moptimize-membar
11485 This switch removes redundant @code{membar} instructions from the
11486 compiler generated code.  It is enabled by default.
11488 @item -mno-optimize-membar
11489 @opindex mno-optimize-membar
11491 This switch disables the automatic removal of redundant @code{membar}
11492 instructions from the generated code.
11494 @item -mtomcat-stats
11495 @opindex mtomcat-stats
11497 Cause gas to print out tomcat statistics.
11499 @item -mcpu=@var{cpu}
11500 @opindex mcpu
11502 Select the processor type for which to generate code.  Possible values are
11503 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
11504 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
11506 @end table
11508 @node GNU/Linux Options
11509 @subsection GNU/Linux Options
11511 These @samp{-m} options are defined for GNU/Linux targets:
11513 @table @gcctabopt
11514 @item -mglibc
11515 @opindex mglibc
11516 Use the GNU C library.  This is the default except
11517 on @samp{*-*-linux-*uclibc*} and @samp{*-*-linux-*android*} targets.
11519 @item -muclibc
11520 @opindex muclibc
11521 Use uClibc C library.  This is the default on
11522 @samp{*-*-linux-*uclibc*} targets.
11524 @item -mbionic
11525 @opindex mbionic
11526 Use Bionic C library.  This is the default on
11527 @samp{*-*-linux-*android*} targets.
11529 @item -mandroid
11530 @opindex mandroid
11531 Compile code compatible with Android platform.  This is the default on
11532 @samp{*-*-linux-*android*} targets.
11534 When compiling, this option enables @option{-mbionic}, @option{-fPIC},
11535 @option{-fno-exceptions} and @option{-fno-rtti} by default.  When linking,
11536 this option makes the GCC driver pass Android-specific options to the linker.
11537 Finally, this option causes the preprocessor macro @code{__ANDROID__}
11538 to be defined.
11540 @item -tno-android-cc
11541 @opindex tno-android-cc
11542 Disable compilation effects of @option{-mandroid}, i.e., do not enable
11543 @option{-mbionic}, @option{-fPIC}, @option{-fno-exceptions} and
11544 @option{-fno-rtti} by default.
11546 @item -tno-android-ld
11547 @opindex tno-android-ld
11548 Disable linking effects of @option{-mandroid}, i.e., pass standard Linux
11549 linking options to the linker.
11551 @end table
11553 @node H8/300 Options
11554 @subsection H8/300 Options
11556 These @samp{-m} options are defined for the H8/300 implementations:
11558 @table @gcctabopt
11559 @item -mrelax
11560 @opindex mrelax
11561 Shorten some address references at link time, when possible; uses the
11562 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
11563 ld, Using ld}, for a fuller description.
11565 @item -mh
11566 @opindex mh
11567 Generate code for the H8/300H@.
11569 @item -ms
11570 @opindex ms
11571 Generate code for the H8S@.
11573 @item -mn
11574 @opindex mn
11575 Generate code for the H8S and H8/300H in the normal mode.  This switch
11576 must be used either with @option{-mh} or @option{-ms}.
11578 @item -ms2600
11579 @opindex ms2600
11580 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
11582 @item -mint32
11583 @opindex mint32
11584 Make @code{int} data 32 bits by default.
11586 @item -malign-300
11587 @opindex malign-300
11588 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
11589 The default for the H8/300H and H8S is to align longs and floats on 4
11590 byte boundaries.
11591 @option{-malign-300} causes them to be aligned on 2 byte boundaries.
11592 This option has no effect on the H8/300.
11593 @end table
11595 @node HPPA Options
11596 @subsection HPPA Options
11597 @cindex HPPA Options
11599 These @samp{-m} options are defined for the HPPA family of computers:
11601 @table @gcctabopt
11602 @item -march=@var{architecture-type}
11603 @opindex march
11604 Generate code for the specified architecture.  The choices for
11605 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
11606 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
11607 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
11608 architecture option for your machine.  Code compiled for lower numbered
11609 architectures will run on higher numbered architectures, but not the
11610 other way around.
11612 @item -mpa-risc-1-0
11613 @itemx -mpa-risc-1-1
11614 @itemx -mpa-risc-2-0
11615 @opindex mpa-risc-1-0
11616 @opindex mpa-risc-1-1
11617 @opindex mpa-risc-2-0
11618 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
11620 @item -mbig-switch
11621 @opindex mbig-switch
11622 Generate code suitable for big switch tables.  Use this option only if
11623 the assembler/linker complain about out of range branches within a switch
11624 table.
11626 @item -mjump-in-delay
11627 @opindex mjump-in-delay
11628 Fill delay slots of function calls with unconditional jump instructions
11629 by modifying the return pointer for the function call to be the target
11630 of the conditional jump.
11632 @item -mdisable-fpregs
11633 @opindex mdisable-fpregs
11634 Prevent floating point registers from being used in any manner.  This is
11635 necessary for compiling kernels which perform lazy context switching of
11636 floating point registers.  If you use this option and attempt to perform
11637 floating point operations, the compiler will abort.
11639 @item -mdisable-indexing
11640 @opindex mdisable-indexing
11641 Prevent the compiler from using indexing address modes.  This avoids some
11642 rather obscure problems when compiling MIG generated code under MACH@.
11644 @item -mno-space-regs
11645 @opindex mno-space-regs
11646 Generate code that assumes the target has no space registers.  This allows
11647 GCC to generate faster indirect calls and use unscaled index address modes.
11649 Such code is suitable for level 0 PA systems and kernels.
11651 @item -mfast-indirect-calls
11652 @opindex mfast-indirect-calls
11653 Generate code that assumes calls never cross space boundaries.  This
11654 allows GCC to emit code which performs faster indirect calls.
11656 This option will not work in the presence of shared libraries or nested
11657 functions.
11659 @item -mfixed-range=@var{register-range}
11660 @opindex mfixed-range
11661 Generate code treating the given register range as fixed registers.
11662 A fixed register is one that the register allocator can not use.  This is
11663 useful when compiling kernel code.  A register range is specified as
11664 two registers separated by a dash.  Multiple register ranges can be
11665 specified separated by a comma.
11667 @item -mlong-load-store
11668 @opindex mlong-load-store
11669 Generate 3-instruction load and store sequences as sometimes required by
11670 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
11671 the HP compilers.
11673 @item -mportable-runtime
11674 @opindex mportable-runtime
11675 Use the portable calling conventions proposed by HP for ELF systems.
11677 @item -mgas
11678 @opindex mgas
11679 Enable the use of assembler directives only GAS understands.
11681 @item -mschedule=@var{cpu-type}
11682 @opindex mschedule
11683 Schedule code according to the constraints for the machine type
11684 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
11685 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
11686 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
11687 proper scheduling option for your machine.  The default scheduling is
11688 @samp{8000}.
11690 @item -mlinker-opt
11691 @opindex mlinker-opt
11692 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
11693 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
11694 linkers in which they give bogus error messages when linking some programs.
11696 @item -msoft-float
11697 @opindex msoft-float
11698 Generate output containing library calls for floating point.
11699 @strong{Warning:} the requisite libraries are not available for all HPPA
11700 targets.  Normally the facilities of the machine's usual C compiler are
11701 used, but this cannot be done directly in cross-compilation.  You must make
11702 your own arrangements to provide suitable library functions for
11703 cross-compilation.
11705 @option{-msoft-float} changes the calling convention in the output file;
11706 therefore, it is only useful if you compile @emph{all} of a program with
11707 this option.  In particular, you need to compile @file{libgcc.a}, the
11708 library that comes with GCC, with @option{-msoft-float} in order for
11709 this to work.
11711 @item -msio
11712 @opindex msio
11713 Generate the predefine, @code{_SIO}, for server IO@.  The default is
11714 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
11715 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
11716 options are available under HP-UX and HI-UX@.
11718 @item -mgnu-ld
11719 @opindex mgnu-ld
11720 Use GNU ld specific options.  This passes @option{-shared} to ld when
11721 building a shared library.  It is the default when GCC is configured,
11722 explicitly or implicitly, with the GNU linker.  This option does not
11723 have any affect on which ld is called, it only changes what parameters
11724 are passed to that ld.  The ld that is called is determined by the
11725 @option{--with-ld} configure option, GCC's program search path, and
11726 finally by the user's @env{PATH}.  The linker used by GCC can be printed
11727 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
11728 on the 64 bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
11730 @item -mhp-ld
11731 @opindex mhp-ld
11732 Use HP ld specific options.  This passes @option{-b} to ld when building
11733 a shared library and passes @option{+Accept TypeMismatch} to ld on all
11734 links.  It is the default when GCC is configured, explicitly or
11735 implicitly, with the HP linker.  This option does not have any affect on
11736 which ld is called, it only changes what parameters are passed to that
11737 ld.  The ld that is called is determined by the @option{--with-ld}
11738 configure option, GCC's program search path, and finally by the user's
11739 @env{PATH}.  The linker used by GCC can be printed using @samp{which
11740 `gcc -print-prog-name=ld`}.  This option is only available on the 64 bit
11741 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
11743 @item -mlong-calls
11744 @opindex mno-long-calls
11745 Generate code that uses long call sequences.  This ensures that a call
11746 is always able to reach linker generated stubs.  The default is to generate
11747 long calls only when the distance from the call site to the beginning
11748 of the function or translation unit, as the case may be, exceeds a
11749 predefined limit set by the branch type being used.  The limits for
11750 normal calls are 7,600,000 and 240,000 bytes, respectively for the
11751 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
11752 240,000 bytes.
11754 Distances are measured from the beginning of functions when using the
11755 @option{-ffunction-sections} option, or when using the @option{-mgas}
11756 and @option{-mno-portable-runtime} options together under HP-UX with
11757 the SOM linker.
11759 It is normally not desirable to use this option as it will degrade
11760 performance.  However, it may be useful in large applications,
11761 particularly when partial linking is used to build the application.
11763 The types of long calls used depends on the capabilities of the
11764 assembler and linker, and the type of code being generated.  The
11765 impact on systems that support long absolute calls, and long pic
11766 symbol-difference or pc-relative calls should be relatively small.
11767 However, an indirect call is used on 32-bit ELF systems in pic code
11768 and it is quite long.
11770 @item -munix=@var{unix-std}
11771 @opindex march
11772 Generate compiler predefines and select a startfile for the specified
11773 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
11774 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
11775 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
11776 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
11777 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
11778 and later.
11780 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
11781 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
11782 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
11783 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
11784 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
11785 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
11787 It is @emph{important} to note that this option changes the interfaces
11788 for various library routines.  It also affects the operational behavior
11789 of the C library.  Thus, @emph{extreme} care is needed in using this
11790 option.
11792 Library code that is intended to operate with more than one UNIX
11793 standard must test, set and restore the variable @var{__xpg4_extended_mask}
11794 as appropriate.  Most GNU software doesn't provide this capability.
11796 @item -nolibdld
11797 @opindex nolibdld
11798 Suppress the generation of link options to search libdld.sl when the
11799 @option{-static} option is specified on HP-UX 10 and later.
11801 @item -static
11802 @opindex static
11803 The HP-UX implementation of setlocale in libc has a dependency on
11804 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
11805 when the @option{-static} option is specified, special link options
11806 are needed to resolve this dependency.
11808 On HP-UX 10 and later, the GCC driver adds the necessary options to
11809 link with libdld.sl when the @option{-static} option is specified.
11810 This causes the resulting binary to be dynamic.  On the 64-bit port,
11811 the linkers generate dynamic binaries by default in any case.  The
11812 @option{-nolibdld} option can be used to prevent the GCC driver from
11813 adding these link options.
11815 @item -threads
11816 @opindex threads
11817 Add support for multithreading with the @dfn{dce thread} library
11818 under HP-UX@.  This option sets flags for both the preprocessor and
11819 linker.
11820 @end table
11822 @node i386 and x86-64 Options
11823 @subsection Intel 386 and AMD x86-64 Options
11824 @cindex i386 Options
11825 @cindex x86-64 Options
11826 @cindex Intel 386 Options
11827 @cindex AMD x86-64 Options
11829 These @samp{-m} options are defined for the i386 and x86-64 family of
11830 computers:
11832 @table @gcctabopt
11833 @item -mtune=@var{cpu-type}
11834 @opindex mtune
11835 Tune to @var{cpu-type} everything applicable about the generated code, except
11836 for the ABI and the set of available instructions.  The choices for
11837 @var{cpu-type} are:
11838 @table @emph
11839 @item generic
11840 Produce code optimized for the most common IA32/AMD64/EM64T processors.
11841 If you know the CPU on which your code will run, then you should use
11842 the corresponding @option{-mtune} option instead of
11843 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
11844 of your application will have, then you should use this option.
11846 As new processors are deployed in the marketplace, the behavior of this
11847 option will change.  Therefore, if you upgrade to a newer version of
11848 GCC, the code generated option will change to reflect the processors
11849 that were most common when that version of GCC was released.
11851 There is no @option{-march=generic} option because @option{-march}
11852 indicates the instruction set the compiler can use, and there is no
11853 generic instruction set applicable to all processors.  In contrast,
11854 @option{-mtune} indicates the processor (or, in this case, collection of
11855 processors) for which the code is optimized.
11856 @item native
11857 This selects the CPU to tune for at compilation time by determining
11858 the processor type of the compiling machine.  Using @option{-mtune=native}
11859 will produce code optimized for the local machine under the constraints
11860 of the selected instruction set.  Using @option{-march=native} will
11861 enable all instruction subsets supported by the local machine (hence
11862 the result might not run on different machines).
11863 @item i386
11864 Original Intel's i386 CPU@.
11865 @item i486
11866 Intel's i486 CPU@.  (No scheduling is implemented for this chip.)
11867 @item i586, pentium
11868 Intel Pentium CPU with no MMX support.
11869 @item pentium-mmx
11870 Intel PentiumMMX CPU based on Pentium core with MMX instruction set support.
11871 @item pentiumpro
11872 Intel PentiumPro CPU@.
11873 @item i686
11874 Same as @code{generic}, but when used as @code{march} option, PentiumPro
11875 instruction set will be used, so the code will run on all i686 family chips.
11876 @item pentium2
11877 Intel Pentium2 CPU based on PentiumPro core with MMX instruction set support.
11878 @item pentium3, pentium3m
11879 Intel Pentium3 CPU based on PentiumPro core with MMX and SSE instruction set
11880 support.
11881 @item pentium-m
11882 Low power version of Intel Pentium3 CPU with MMX, SSE and SSE2 instruction set
11883 support.  Used by Centrino notebooks.
11884 @item pentium4, pentium4m
11885 Intel Pentium4 CPU with MMX, SSE and SSE2 instruction set support.
11886 @item prescott
11887 Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2 and SSE3 instruction
11888 set support.
11889 @item nocona
11890 Improved version of Intel Pentium4 CPU with 64-bit extensions, MMX, SSE,
11891 SSE2 and SSE3 instruction set support.
11892 @item core2
11893 Intel Core2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
11894 instruction set support.
11895 @item atom
11896 Intel Atom CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
11897 instruction set support.
11898 @item k6
11899 AMD K6 CPU with MMX instruction set support.
11900 @item k6-2, k6-3
11901 Improved versions of AMD K6 CPU with MMX and 3DNow!@: instruction set support.
11902 @item athlon, athlon-tbird
11903 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3DNow!@: and SSE prefetch instructions
11904 support.
11905 @item athlon-4, athlon-xp, athlon-mp
11906 Improved AMD Athlon CPU with MMX, 3DNow!, enhanced 3DNow!@: and full SSE
11907 instruction set support.
11908 @item k8, opteron, athlon64, athlon-fx
11909 AMD K8 core based CPUs with x86-64 instruction set support.  (This supersets
11910 MMX, SSE, SSE2, 3DNow!, enhanced 3DNow!@: and 64-bit instruction set extensions.)
11911 @item k8-sse3, opteron-sse3, athlon64-sse3
11912 Improved versions of k8, opteron and athlon64 with SSE3 instruction set support.
11913 @item amdfam10, barcelona
11914 AMD Family 10h core based CPUs with x86-64 instruction set support.  (This
11915 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!, enhanced 3DNow!, ABM and 64-bit
11916 instruction set extensions.)
11917 @item winchip-c6
11918 IDT Winchip C6 CPU, dealt in same way as i486 with additional MMX instruction
11919 set support.
11920 @item winchip2
11921 IDT Winchip2 CPU, dealt in same way as i486 with additional MMX and 3DNow!@:
11922 instruction set support.
11923 @item c3
11924 Via C3 CPU with MMX and 3DNow!@: instruction set support.  (No scheduling is
11925 implemented for this chip.)
11926 @item c3-2
11927 Via C3-2 CPU with MMX and SSE instruction set support.  (No scheduling is
11928 implemented for this chip.)
11929 @item geode
11930 Embedded AMD CPU with MMX and 3DNow!@: instruction set support.
11931 @end table
11933 While picking a specific @var{cpu-type} will schedule things appropriately
11934 for that particular chip, the compiler will not generate any code that
11935 does not run on the i386 without the @option{-march=@var{cpu-type}} option
11936 being used.
11938 @item -march=@var{cpu-type}
11939 @opindex march
11940 Generate instructions for the machine type @var{cpu-type}.  The choices
11941 for @var{cpu-type} are the same as for @option{-mtune}.  Moreover,
11942 specifying @option{-march=@var{cpu-type}} implies @option{-mtune=@var{cpu-type}}.
11944 @item -mcpu=@var{cpu-type}
11945 @opindex mcpu
11946 A deprecated synonym for @option{-mtune}.
11948 @item -mfpmath=@var{unit}
11949 @opindex mfpmath
11950 Generate floating point arithmetics for selected unit @var{unit}.  The choices
11951 for @var{unit} are:
11953 @table @samp
11954 @item 387
11955 Use the standard 387 floating point coprocessor present majority of chips and
11956 emulated otherwise.  Code compiled with this option will run almost everywhere.
11957 The temporary results are computed in 80bit precision instead of precision
11958 specified by the type resulting in slightly different results compared to most
11959 of other chips.  See @option{-ffloat-store} for more detailed description.
11961 This is the default choice for i386 compiler.
11963 @item sse
11964 Use scalar floating point instructions present in the SSE instruction set.
11965 This instruction set is supported by Pentium3 and newer chips, in the AMD line
11966 by Athlon-4, Athlon-xp and Athlon-mp chips.  The earlier version of SSE
11967 instruction set supports only single precision arithmetics, thus the double and
11968 extended precision arithmetics is still done using 387.  Later version, present
11969 only in Pentium4 and the future AMD x86-64 chips supports double precision
11970 arithmetics too.
11972 For the i386 compiler, you need to use @option{-march=@var{cpu-type}}, @option{-msse}
11973 or @option{-msse2} switches to enable SSE extensions and make this option
11974 effective.  For the x86-64 compiler, these extensions are enabled by default.
11976 The resulting code should be considerably faster in the majority of cases and avoid
11977 the numerical instability problems of 387 code, but may break some existing
11978 code that expects temporaries to be 80bit.
11980 This is the default choice for the x86-64 compiler.
11982 @item sse,387
11983 @itemx sse+387
11984 @itemx both
11985 Attempt to utilize both instruction sets at once.  This effectively double the
11986 amount of available registers and on chips with separate execution units for
11987 387 and SSE the execution resources too.  Use this option with care, as it is
11988 still experimental, because the GCC register allocator does not model separate
11989 functional units well resulting in instable performance.
11990 @end table
11992 @item -masm=@var{dialect}
11993 @opindex masm=@var{dialect}
11994 Output asm instructions using selected @var{dialect}.  Supported
11995 choices are @samp{intel} or @samp{att} (the default one).  Darwin does
11996 not support @samp{intel}.
11998 @item -mieee-fp
11999 @itemx -mno-ieee-fp
12000 @opindex mieee-fp
12001 @opindex mno-ieee-fp
12002 Control whether or not the compiler uses IEEE floating point
12003 comparisons.  These handle correctly the case where the result of a
12004 comparison is unordered.
12006 @item -msoft-float
12007 @opindex msoft-float
12008 Generate output containing library calls for floating point.
12009 @strong{Warning:} the requisite libraries are not part of GCC@.
12010 Normally the facilities of the machine's usual C compiler are used, but
12011 this can't be done directly in cross-compilation.  You must make your
12012 own arrangements to provide suitable library functions for
12013 cross-compilation.
12015 On machines where a function returns floating point results in the 80387
12016 register stack, some floating point opcodes may be emitted even if
12017 @option{-msoft-float} is used.
12019 @item -mno-fp-ret-in-387
12020 @opindex mno-fp-ret-in-387
12021 Do not use the FPU registers for return values of functions.
12023 The usual calling convention has functions return values of types
12024 @code{float} and @code{double} in an FPU register, even if there
12025 is no FPU@.  The idea is that the operating system should emulate
12026 an FPU@.
12028 The option @option{-mno-fp-ret-in-387} causes such values to be returned
12029 in ordinary CPU registers instead.
12031 @item -mno-fancy-math-387
12032 @opindex mno-fancy-math-387
12033 Some 387 emulators do not support the @code{sin}, @code{cos} and
12034 @code{sqrt} instructions for the 387.  Specify this option to avoid
12035 generating those instructions.  This option is the default on FreeBSD,
12036 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
12037 indicates that the target cpu will always have an FPU and so the
12038 instruction will not need emulation.  As of revision 2.6.1, these
12039 instructions are not generated unless you also use the
12040 @option{-funsafe-math-optimizations} switch.
12042 @item -malign-double
12043 @itemx -mno-align-double
12044 @opindex malign-double
12045 @opindex mno-align-double
12046 Control whether GCC aligns @code{double}, @code{long double}, and
12047 @code{long long} variables on a two word boundary or a one word
12048 boundary.  Aligning @code{double} variables on a two word boundary will
12049 produce code that runs somewhat faster on a @samp{Pentium} at the
12050 expense of more memory.
12052 On x86-64, @option{-malign-double} is enabled by default.
12054 @strong{Warning:} if you use the @option{-malign-double} switch,
12055 structures containing the above types will be aligned differently than
12056 the published application binary interface specifications for the 386
12057 and will not be binary compatible with structures in code compiled
12058 without that switch.
12060 @item -m96bit-long-double
12061 @itemx -m128bit-long-double
12062 @opindex m96bit-long-double
12063 @opindex m128bit-long-double
12064 These switches control the size of @code{long double} type.  The i386
12065 application binary interface specifies the size to be 96 bits,
12066 so @option{-m96bit-long-double} is the default in 32 bit mode.
12068 Modern architectures (Pentium and newer) would prefer @code{long double}
12069 to be aligned to an 8 or 16 byte boundary.  In arrays or structures
12070 conforming to the ABI, this would not be possible.  So specifying a
12071 @option{-m128bit-long-double} will align @code{long double}
12072 to a 16 byte boundary by padding the @code{long double} with an additional
12073 32 bit zero.
12075 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
12076 its ABI specifies that @code{long double} is to be aligned on 16 byte boundary.
12078 Notice that neither of these options enable any extra precision over the x87
12079 standard of 80 bits for a @code{long double}.
12081 @strong{Warning:} if you override the default value for your target ABI, the
12082 structures and arrays containing @code{long double} variables will change
12083 their size as well as function calling convention for function taking
12084 @code{long double} will be modified.  Hence they will not be binary
12085 compatible with arrays or structures in code compiled without that switch.
12087 @item -mlarge-data-threshold=@var{number}
12088 @opindex mlarge-data-threshold=@var{number}
12089 When @option{-mcmodel=medium} is specified, the data greater than
12090 @var{threshold} are placed in large data section.  This value must be the
12091 same across all object linked into the binary and defaults to 65535.
12093 @item -mrtd
12094 @opindex mrtd
12095 Use a different function-calling convention, in which functions that
12096 take a fixed number of arguments return with the @code{ret} @var{num}
12097 instruction, which pops their arguments while returning.  This saves one
12098 instruction in the caller since there is no need to pop the arguments
12099 there.
12101 You can specify that an individual function is called with this calling
12102 sequence with the function attribute @samp{stdcall}.  You can also
12103 override the @option{-mrtd} option by using the function attribute
12104 @samp{cdecl}.  @xref{Function Attributes}.
12106 @strong{Warning:} this calling convention is incompatible with the one
12107 normally used on Unix, so you cannot use it if you need to call
12108 libraries compiled with the Unix compiler.
12110 Also, you must provide function prototypes for all functions that
12111 take variable numbers of arguments (including @code{printf});
12112 otherwise incorrect code will be generated for calls to those
12113 functions.
12115 In addition, seriously incorrect code will result if you call a
12116 function with too many arguments.  (Normally, extra arguments are
12117 harmlessly ignored.)
12119 @item -mregparm=@var{num}
12120 @opindex mregparm
12121 Control how many registers are used to pass integer arguments.  By
12122 default, no registers are used to pass arguments, and at most 3
12123 registers can be used.  You can control this behavior for a specific
12124 function by using the function attribute @samp{regparm}.
12125 @xref{Function Attributes}.
12127 @strong{Warning:} if you use this switch, and
12128 @var{num} is nonzero, then you must build all modules with the same
12129 value, including any libraries.  This includes the system libraries and
12130 startup modules.
12132 @item -msseregparm
12133 @opindex msseregparm
12134 Use SSE register passing conventions for float and double arguments
12135 and return values.  You can control this behavior for a specific
12136 function by using the function attribute @samp{sseregparm}.
12137 @xref{Function Attributes}.
12139 @strong{Warning:} if you use this switch then you must build all
12140 modules with the same value, including any libraries.  This includes
12141 the system libraries and startup modules.
12143 @item -mpc32
12144 @itemx -mpc64
12145 @itemx -mpc80
12146 @opindex mpc32
12147 @opindex mpc64
12148 @opindex mpc80
12150 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
12151 is specified, the significands of results of floating-point operations are
12152 rounded to 24 bits (single precision); @option{-mpc64} rounds the
12153 significands of results of floating-point operations to 53 bits (double
12154 precision) and @option{-mpc80} rounds the significands of results of
12155 floating-point operations to 64 bits (extended double precision), which is
12156 the default.  When this option is used, floating-point operations in higher
12157 precisions are not available to the programmer without setting the FPU
12158 control word explicitly.
12160 Setting the rounding of floating-point operations to less than the default
12161 80 bits can speed some programs by 2% or more.  Note that some mathematical
12162 libraries assume that extended precision (80 bit) floating-point operations
12163 are enabled by default; routines in such libraries could suffer significant
12164 loss of accuracy, typically through so-called "catastrophic cancellation",
12165 when this option is used to set the precision to less than extended precision.
12167 @item -mstackrealign
12168 @opindex mstackrealign
12169 Realign the stack at entry.  On the Intel x86, the @option{-mstackrealign}
12170 option will generate an alternate prologue and epilogue that realigns the
12171 runtime stack if necessary.  This supports mixing legacy codes that keep
12172 a 4-byte aligned stack with modern codes that keep a 16-byte stack for
12173 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
12174 applicable to individual functions.
12176 @item -mpreferred-stack-boundary=@var{num}
12177 @opindex mpreferred-stack-boundary
12178 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
12179 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
12180 the default is 4 (16 bytes or 128 bits).
12182 @item -mincoming-stack-boundary=@var{num}
12183 @opindex mincoming-stack-boundary
12184 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
12185 boundary.  If @option{-mincoming-stack-boundary} is not specified,
12186 the one specified by @option{-mpreferred-stack-boundary} will be used.
12188 On Pentium and PentiumPro, @code{double} and @code{long double} values
12189 should be aligned to an 8 byte boundary (see @option{-malign-double}) or
12190 suffer significant run time performance penalties.  On Pentium III, the
12191 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
12192 properly if it is not 16 byte aligned.
12194 To ensure proper alignment of this values on the stack, the stack boundary
12195 must be as aligned as that required by any value stored on the stack.
12196 Further, every function must be generated such that it keeps the stack
12197 aligned.  Thus calling a function compiled with a higher preferred
12198 stack boundary from a function compiled with a lower preferred stack
12199 boundary will most likely misalign the stack.  It is recommended that
12200 libraries that use callbacks always use the default setting.
12202 This extra alignment does consume extra stack space, and generally
12203 increases code size.  Code that is sensitive to stack space usage, such
12204 as embedded systems and operating system kernels, may want to reduce the
12205 preferred alignment to @option{-mpreferred-stack-boundary=2}.
12207 @item -mmmx
12208 @itemx -mno-mmx
12209 @itemx -msse
12210 @itemx -mno-sse
12211 @itemx -msse2
12212 @itemx -mno-sse2
12213 @itemx -msse3
12214 @itemx -mno-sse3
12215 @itemx -mssse3
12216 @itemx -mno-ssse3
12217 @itemx -msse4.1
12218 @itemx -mno-sse4.1
12219 @itemx -msse4.2
12220 @itemx -mno-sse4.2
12221 @itemx -msse4
12222 @itemx -mno-sse4
12223 @itemx -mavx
12224 @itemx -mno-avx
12225 @itemx -maes
12226 @itemx -mno-aes
12227 @itemx -mpclmul
12228 @itemx -mno-pclmul
12229 @itemx -mfsgsbase
12230 @itemx -mno-fsgsbase
12231 @itemx -mrdrnd
12232 @itemx -mno-rdrnd
12233 @itemx -mf16c
12234 @itemx -mno-f16c
12235 @itemx -msse4a
12236 @itemx -mno-sse4a
12237 @itemx -mfma4
12238 @itemx -mno-fma4
12239 @itemx -mxop
12240 @itemx -mno-xop
12241 @itemx -mlwp
12242 @itemx -mno-lwp
12243 @itemx -m3dnow
12244 @itemx -mno-3dnow
12245 @itemx -mpopcnt
12246 @itemx -mno-popcnt
12247 @itemx -mabm
12248 @itemx -mno-abm
12249 @opindex mmmx
12250 @opindex mno-mmx
12251 @opindex msse
12252 @opindex mno-sse
12253 @opindex m3dnow
12254 @opindex mno-3dnow
12255 These switches enable or disable the use of instructions in the MMX,
12256 SSE, SSE2, SSE3, SSSE3, SSE4.1, AVX, AES, PCLMUL, FSGSBASE, RDRND,
12257 F16C, SSE4A, FMA4, XOP, LWP, ABM or 3DNow!@: extended instruction sets.
12258 These extensions are also available as built-in functions: see
12259 @ref{X86 Built-in Functions}, for details of the functions enabled and
12260 disabled by these switches.
12262 To have SSE/SSE2 instructions generated automatically from floating-point
12263 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
12265 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
12266 generates new AVX instructions or AVX equivalence for all SSEx instructions
12267 when needed.
12269 These options will enable GCC to use these extended instructions in
12270 generated code, even without @option{-mfpmath=sse}.  Applications which
12271 perform runtime CPU detection must compile separate files for each
12272 supported architecture, using the appropriate flags.  In particular,
12273 the file containing the CPU detection code should be compiled without
12274 these options.
12276 @item -mfused-madd
12277 @itemx -mno-fused-madd
12278 @opindex mfused-madd
12279 @opindex mno-fused-madd
12280 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
12281 instructions.  The default is to use these instructions.
12283 @item -mcld
12284 @opindex mcld
12285 This option instructs GCC to emit a @code{cld} instruction in the prologue
12286 of functions that use string instructions.  String instructions depend on
12287 the DF flag to select between autoincrement or autodecrement mode.  While the
12288 ABI specifies the DF flag to be cleared on function entry, some operating
12289 systems violate this specification by not clearing the DF flag in their
12290 exception dispatchers.  The exception handler can be invoked with the DF flag
12291 set which leads to wrong direction mode, when string instructions are used.
12292 This option can be enabled by default on 32-bit x86 targets by configuring
12293 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
12294 instructions can be suppressed with the @option{-mno-cld} compiler option
12295 in this case.
12297 @item -mcx16
12298 @opindex mcx16
12299 This option will enable GCC to use CMPXCHG16B instruction in generated code.
12300 CMPXCHG16B allows for atomic operations on 128-bit double quadword (or oword)
12301 data types.  This is useful for high resolution counters that could be updated
12302 by multiple processors (or cores).  This instruction is generated as part of
12303 atomic built-in functions: see @ref{Atomic Builtins} for details.
12305 @item -msahf
12306 @opindex msahf
12307 This option will enable GCC to use SAHF instruction in generated 64-bit code.
12308 Early Intel CPUs with Intel 64 lacked LAHF and SAHF instructions supported
12309 by AMD64 until introduction of Pentium 4 G1 step in December 2005.  LAHF and
12310 SAHF are load and store instructions, respectively, for certain status flags.
12311 In 64-bit mode, SAHF instruction is used to optimize @code{fmod}, @code{drem}
12312 or @code{remainder} built-in functions: see @ref{Other Builtins} for details.
12314 @item -mmovbe
12315 @opindex mmovbe
12316 This option will enable GCC to use movbe instruction to implement
12317 @code{__builtin_bswap32} and @code{__builtin_bswap64}.
12319 @item -mcrc32
12320 @opindex mcrc32
12321 This option will enable built-in functions, @code{__builtin_ia32_crc32qi},
12322 @code{__builtin_ia32_crc32hi}. @code{__builtin_ia32_crc32si} and
12323 @code{__builtin_ia32_crc32di} to generate the crc32 machine instruction.
12325 @item -mrecip
12326 @opindex mrecip
12327 This option will enable GCC to use RCPSS and RSQRTSS instructions (and their
12328 vectorized variants RCPPS and RSQRTPS) with an additional Newton-Raphson step
12329 to increase precision instead of DIVSS and SQRTSS (and their vectorized
12330 variants) for single precision floating point arguments.  These instructions
12331 are generated only when @option{-funsafe-math-optimizations} is enabled
12332 together with @option{-finite-math-only} and @option{-fno-trapping-math}.
12333 Note that while the throughput of the sequence is higher than the throughput
12334 of the non-reciprocal instruction, the precision of the sequence can be
12335 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
12337 Note that GCC implements 1.0f/sqrtf(x) in terms of RSQRTSS (or RSQRTPS)
12338 already with @option{-ffast-math} (or the above option combination), and
12339 doesn't need @option{-mrecip}.
12341 @item -mveclibabi=@var{type}
12342 @opindex mveclibabi
12343 Specifies the ABI type to use for vectorizing intrinsics using an
12344 external library.  Supported types are @code{svml} for the Intel short
12345 vector math library and @code{acml} for the AMD math core library style
12346 of interfacing.  GCC will currently emit calls to @code{vmldExp2},
12347 @code{vmldLn2}, @code{vmldLog102}, @code{vmldLog102}, @code{vmldPow2},
12348 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
12349 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
12350 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
12351 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4}, @code{vmlsLog104},
12352 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
12353 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
12354 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
12355 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
12356 function type when @option{-mveclibabi=svml} is used and @code{__vrd2_sin},
12357 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
12358 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
12359 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
12360 @code{__vrs4_log10f} and @code{__vrs4_powf} for corresponding function type
12361 when @option{-mveclibabi=acml} is used. Both @option{-ftree-vectorize} and
12362 @option{-funsafe-math-optimizations} have to be enabled. A SVML or ACML ABI
12363 compatible library will have to be specified at link time.
12365 @item -mabi=@var{name}
12366 @opindex mabi
12367 Generate code for the specified calling convention.  Permissible values
12368 are: @samp{sysv} for the ABI used on GNU/Linux and other systems and
12369 @samp{ms} for the Microsoft ABI.  The default is to use the Microsoft
12370 ABI when targeting Windows.  On all other systems, the default is the
12371 SYSV ABI.  You can control this behavior for a specific function by
12372 using the function attribute @samp{ms_abi}/@samp{sysv_abi}.
12373 @xref{Function Attributes}.
12375 @item -mpush-args
12376 @itemx -mno-push-args
12377 @opindex mpush-args
12378 @opindex mno-push-args
12379 Use PUSH operations to store outgoing parameters.  This method is shorter
12380 and usually equally fast as method using SUB/MOV operations and is enabled
12381 by default.  In some cases disabling it may improve performance because of
12382 improved scheduling and reduced dependencies.
12384 @item -maccumulate-outgoing-args
12385 @opindex maccumulate-outgoing-args
12386 If enabled, the maximum amount of space required for outgoing arguments will be
12387 computed in the function prologue.  This is faster on most modern CPUs
12388 because of reduced dependencies, improved scheduling and reduced stack usage
12389 when preferred stack boundary is not equal to 2.  The drawback is a notable
12390 increase in code size.  This switch implies @option{-mno-push-args}.
12392 @item -mthreads
12393 @opindex mthreads
12394 Support thread-safe exception handling on @samp{Mingw32}.  Code that relies
12395 on thread-safe exception handling must compile and link all code with the
12396 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
12397 @option{-D_MT}; when linking, it links in a special thread helper library
12398 @option{-lmingwthrd} which cleans up per thread exception handling data.
12400 @item -mno-align-stringops
12401 @opindex mno-align-stringops
12402 Do not align destination of inlined string operations.  This switch reduces
12403 code size and improves performance in case the destination is already aligned,
12404 but GCC doesn't know about it.
12406 @item -minline-all-stringops
12407 @opindex minline-all-stringops
12408 By default GCC inlines string operations only when destination is known to be
12409 aligned at least to 4 byte boundary.  This enables more inlining, increase code
12410 size, but may improve performance of code that depends on fast memcpy, strlen
12411 and memset for short lengths.
12413 @item -minline-stringops-dynamically
12414 @opindex minline-stringops-dynamically
12415 For string operation of unknown size, inline runtime checks so for small
12416 blocks inline code is used, while for large blocks library call is used.
12418 @item -mstringop-strategy=@var{alg}
12419 @opindex mstringop-strategy=@var{alg}
12420 Overwrite internal decision heuristic about particular algorithm to inline
12421 string operation with.  The allowed values are @code{rep_byte},
12422 @code{rep_4byte}, @code{rep_8byte} for expanding using i386 @code{rep} prefix
12423 of specified size, @code{byte_loop}, @code{loop}, @code{unrolled_loop} for
12424 expanding inline loop, @code{libcall} for always expanding library call.
12426 @item -momit-leaf-frame-pointer
12427 @opindex momit-leaf-frame-pointer
12428 Don't keep the frame pointer in a register for leaf functions.  This
12429 avoids the instructions to save, set up and restore frame pointers and
12430 makes an extra register available in leaf functions.  The option
12431 @option{-fomit-frame-pointer} removes the frame pointer for all functions
12432 which might make debugging harder.
12434 @item -mtls-direct-seg-refs
12435 @itemx -mno-tls-direct-seg-refs
12436 @opindex mtls-direct-seg-refs
12437 Controls whether TLS variables may be accessed with offsets from the
12438 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
12439 or whether the thread base pointer must be added.  Whether or not this
12440 is legal depends on the operating system, and whether it maps the
12441 segment to cover the entire TLS area.
12443 For systems that use GNU libc, the default is on.
12445 @item -msse2avx
12446 @itemx -mno-sse2avx
12447 @opindex msse2avx
12448 Specify that the assembler should encode SSE instructions with VEX
12449 prefix.  The option @option{-mavx} turns this on by default.
12450 @end table
12452 These @samp{-m} switches are supported in addition to the above
12453 on AMD x86-64 processors in 64-bit environments.
12455 @table @gcctabopt
12456 @item -m32
12457 @itemx -m64
12458 @opindex m32
12459 @opindex m64
12460 Generate code for a 32-bit or 64-bit environment.
12461 The 32-bit environment sets int, long and pointer to 32 bits and
12462 generates code that runs on any i386 system.
12463 The 64-bit environment sets int to 32 bits and long and pointer
12464 to 64 bits and generates code for AMD's x86-64 architecture. For
12465 darwin only the -m64 option turns off the @option{-fno-pic} and
12466 @option{-mdynamic-no-pic} options.
12468 @item -mno-red-zone
12469 @opindex mno-red-zone
12470 Do not use a so called red zone for x86-64 code.  The red zone is mandated
12471 by the x86-64 ABI, it is a 128-byte area beyond the location of the
12472 stack pointer that will not be modified by signal or interrupt handlers
12473 and therefore can be used for temporary data without adjusting the stack
12474 pointer.  The flag @option{-mno-red-zone} disables this red zone.
12476 @item -mcmodel=small
12477 @opindex mcmodel=small
12478 Generate code for the small code model: the program and its symbols must
12479 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
12480 Programs can be statically or dynamically linked.  This is the default
12481 code model.
12483 @item -mcmodel=kernel
12484 @opindex mcmodel=kernel
12485 Generate code for the kernel code model.  The kernel runs in the
12486 negative 2 GB of the address space.
12487 This model has to be used for Linux kernel code.
12489 @item -mcmodel=medium
12490 @opindex mcmodel=medium
12491 Generate code for the medium model: The program is linked in the lower 2
12492 GB of the address space.  Small symbols are also placed there.  Symbols
12493 with sizes larger than @option{-mlarge-data-threshold} are put into
12494 large data or bss sections and can be located above 2GB.  Programs can
12495 be statically or dynamically linked.
12497 @item -mcmodel=large
12498 @opindex mcmodel=large
12499 Generate code for the large model: This model makes no assumptions
12500 about addresses and sizes of sections.
12501 @end table
12503 @node IA-64 Options
12504 @subsection IA-64 Options
12505 @cindex IA-64 Options
12507 These are the @samp{-m} options defined for the Intel IA-64 architecture.
12509 @table @gcctabopt
12510 @item -mbig-endian
12511 @opindex mbig-endian
12512 Generate code for a big endian target.  This is the default for HP-UX@.
12514 @item -mlittle-endian
12515 @opindex mlittle-endian
12516 Generate code for a little endian target.  This is the default for AIX5
12517 and GNU/Linux.
12519 @item -mgnu-as
12520 @itemx -mno-gnu-as
12521 @opindex mgnu-as
12522 @opindex mno-gnu-as
12523 Generate (or don't) code for the GNU assembler.  This is the default.
12524 @c Also, this is the default if the configure option @option{--with-gnu-as}
12525 @c is used.
12527 @item -mgnu-ld
12528 @itemx -mno-gnu-ld
12529 @opindex mgnu-ld
12530 @opindex mno-gnu-ld
12531 Generate (or don't) code for the GNU linker.  This is the default.
12532 @c Also, this is the default if the configure option @option{--with-gnu-ld}
12533 @c is used.
12535 @item -mno-pic
12536 @opindex mno-pic
12537 Generate code that does not use a global pointer register.  The result
12538 is not position independent code, and violates the IA-64 ABI@.
12540 @item -mvolatile-asm-stop
12541 @itemx -mno-volatile-asm-stop
12542 @opindex mvolatile-asm-stop
12543 @opindex mno-volatile-asm-stop
12544 Generate (or don't) a stop bit immediately before and after volatile asm
12545 statements.
12547 @item -mregister-names
12548 @itemx -mno-register-names
12549 @opindex mregister-names
12550 @opindex mno-register-names
12551 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
12552 the stacked registers.  This may make assembler output more readable.
12554 @item -mno-sdata
12555 @itemx -msdata
12556 @opindex mno-sdata
12557 @opindex msdata
12558 Disable (or enable) optimizations that use the small data section.  This may
12559 be useful for working around optimizer bugs.
12561 @item -mconstant-gp
12562 @opindex mconstant-gp
12563 Generate code that uses a single constant global pointer value.  This is
12564 useful when compiling kernel code.
12566 @item -mauto-pic
12567 @opindex mauto-pic
12568 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
12569 This is useful when compiling firmware code.
12571 @item -minline-float-divide-min-latency
12572 @opindex minline-float-divide-min-latency
12573 Generate code for inline divides of floating point values
12574 using the minimum latency algorithm.
12576 @item -minline-float-divide-max-throughput
12577 @opindex minline-float-divide-max-throughput
12578 Generate code for inline divides of floating point values
12579 using the maximum throughput algorithm.
12581 @item -mno-inline-float-divide
12582 @opindex mno-inline-float-divide
12583 Do not generate inline code for divides of floating point values.
12585 @item -minline-int-divide-min-latency
12586 @opindex minline-int-divide-min-latency
12587 Generate code for inline divides of integer values
12588 using the minimum latency algorithm.
12590 @item -minline-int-divide-max-throughput
12591 @opindex minline-int-divide-max-throughput
12592 Generate code for inline divides of integer values
12593 using the maximum throughput algorithm.
12595 @item -mno-inline-int-divide
12596 @opindex mno-inline-int-divide
12597 Do not generate inline code for divides of integer values.
12599 @item -minline-sqrt-min-latency
12600 @opindex minline-sqrt-min-latency
12601 Generate code for inline square roots
12602 using the minimum latency algorithm.
12604 @item -minline-sqrt-max-throughput
12605 @opindex minline-sqrt-max-throughput
12606 Generate code for inline square roots
12607 using the maximum throughput algorithm.
12609 @item -mno-inline-sqrt
12610 @opindex mno-inline-sqrt
12611 Do not generate inline code for sqrt.
12613 @item -mfused-madd
12614 @itemx -mno-fused-madd
12615 @opindex mfused-madd
12616 @opindex mno-fused-madd
12617 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
12618 instructions.  The default is to use these instructions.
12620 @item -mno-dwarf2-asm
12621 @itemx -mdwarf2-asm
12622 @opindex mno-dwarf2-asm
12623 @opindex mdwarf2-asm
12624 Don't (or do) generate assembler code for the DWARF2 line number debugging
12625 info.  This may be useful when not using the GNU assembler.
12627 @item -mearly-stop-bits
12628 @itemx -mno-early-stop-bits
12629 @opindex mearly-stop-bits
12630 @opindex mno-early-stop-bits
12631 Allow stop bits to be placed earlier than immediately preceding the
12632 instruction that triggered the stop bit.  This can improve instruction
12633 scheduling, but does not always do so.
12635 @item -mfixed-range=@var{register-range}
12636 @opindex mfixed-range
12637 Generate code treating the given register range as fixed registers.
12638 A fixed register is one that the register allocator can not use.  This is
12639 useful when compiling kernel code.  A register range is specified as
12640 two registers separated by a dash.  Multiple register ranges can be
12641 specified separated by a comma.
12643 @item -mtls-size=@var{tls-size}
12644 @opindex mtls-size
12645 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
12648 @item -mtune=@var{cpu-type}
12649 @opindex mtune
12650 Tune the instruction scheduling for a particular CPU, Valid values are
12651 itanium, itanium1, merced, itanium2, and mckinley.
12653 @item -milp32
12654 @itemx -mlp64
12655 @opindex milp32
12656 @opindex mlp64
12657 Generate code for a 32-bit or 64-bit environment.
12658 The 32-bit environment sets int, long and pointer to 32 bits.
12659 The 64-bit environment sets int to 32 bits and long and pointer
12660 to 64 bits.  These are HP-UX specific flags.
12662 @item -mno-sched-br-data-spec
12663 @itemx -msched-br-data-spec
12664 @opindex mno-sched-br-data-spec
12665 @opindex msched-br-data-spec
12666 (Dis/En)able data speculative scheduling before reload.
12667 This will result in generation of the ld.a instructions and
12668 the corresponding check instructions (ld.c / chk.a).
12669 The default is 'disable'.
12671 @item -msched-ar-data-spec
12672 @itemx -mno-sched-ar-data-spec
12673 @opindex msched-ar-data-spec
12674 @opindex mno-sched-ar-data-spec
12675 (En/Dis)able data speculative scheduling after reload.
12676 This will result in generation of the ld.a instructions and
12677 the corresponding check instructions (ld.c / chk.a).
12678 The default is 'enable'.
12680 @item -mno-sched-control-spec
12681 @itemx -msched-control-spec
12682 @opindex mno-sched-control-spec
12683 @opindex msched-control-spec
12684 (Dis/En)able control speculative scheduling.  This feature is
12685 available only during region scheduling (i.e.@: before reload).
12686 This will result in generation of the ld.s instructions and
12687 the corresponding check instructions chk.s .
12688 The default is 'disable'.
12690 @item -msched-br-in-data-spec
12691 @itemx -mno-sched-br-in-data-spec
12692 @opindex msched-br-in-data-spec
12693 @opindex mno-sched-br-in-data-spec
12694 (En/Dis)able speculative scheduling of the instructions that
12695 are dependent on the data speculative loads before reload.
12696 This is effective only with @option{-msched-br-data-spec} enabled.
12697 The default is 'enable'.
12699 @item -msched-ar-in-data-spec
12700 @itemx -mno-sched-ar-in-data-spec
12701 @opindex msched-ar-in-data-spec
12702 @opindex mno-sched-ar-in-data-spec
12703 (En/Dis)able speculative scheduling of the instructions that
12704 are dependent on the data speculative loads after reload.
12705 This is effective only with @option{-msched-ar-data-spec} enabled.
12706 The default is 'enable'.
12708 @item -msched-in-control-spec
12709 @itemx -mno-sched-in-control-spec
12710 @opindex msched-in-control-spec
12711 @opindex mno-sched-in-control-spec
12712 (En/Dis)able speculative scheduling of the instructions that
12713 are dependent on the control speculative loads.
12714 This is effective only with @option{-msched-control-spec} enabled.
12715 The default is 'enable'.
12717 @item -mno-sched-prefer-non-data-spec-insns
12718 @itemx -msched-prefer-non-data-spec-insns
12719 @opindex mno-sched-prefer-non-data-spec-insns
12720 @opindex msched-prefer-non-data-spec-insns
12721 If enabled, data speculative instructions will be chosen for schedule
12722 only if there are no other choices at the moment.  This will make
12723 the use of the data speculation much more conservative.
12724 The default is 'disable'.
12726 @item -mno-sched-prefer-non-control-spec-insns
12727 @itemx -msched-prefer-non-control-spec-insns
12728 @opindex mno-sched-prefer-non-control-spec-insns
12729 @opindex msched-prefer-non-control-spec-insns
12730 If enabled, control speculative instructions will be chosen for schedule
12731 only if there are no other choices at the moment.  This will make
12732 the use of the control speculation much more conservative.
12733 The default is 'disable'.
12735 @item -mno-sched-count-spec-in-critical-path
12736 @itemx -msched-count-spec-in-critical-path
12737 @opindex mno-sched-count-spec-in-critical-path
12738 @opindex msched-count-spec-in-critical-path
12739 If enabled, speculative dependencies will be considered during
12740 computation of the instructions priorities.  This will make the use of the
12741 speculation a bit more conservative.
12742 The default is 'disable'.
12744 @item -msched-spec-ldc
12745 @opindex msched-spec-ldc
12746 Use a simple data speculation check.  This option is on by default.
12748 @item -msched-control-spec-ldc
12749 @opindex msched-spec-ldc
12750 Use a simple check for control speculation.  This option is on by default.
12752 @item -msched-stop-bits-after-every-cycle
12753 @opindex msched-stop-bits-after-every-cycle
12754 Place a stop bit after every cycle when scheduling.  This option is on
12755 by default.
12757 @item -msched-fp-mem-deps-zero-cost
12758 @opindex msched-fp-mem-deps-zero-cost
12759 Assume that floating-point stores and loads are not likely to cause a conflict
12760 when placed into the same instruction group.  This option is disabled by
12761 default.
12763 @item -msel-sched-dont-check-control-spec
12764 @opindex msel-sched-dont-check-control-spec
12765 Generate checks for control speculation in selective scheduling.
12766 This flag is disabled by default.
12768 @item -msched-max-memory-insns=@var{max-insns}
12769 @opindex msched-max-memory-insns
12770 Limit on the number of memory insns per instruction group, giving lower
12771 priority to subsequent memory insns attempting to schedule in the same
12772 instruction group. Frequently useful to prevent cache bank conflicts.
12773 The default value is 1.
12775 @item -msched-max-memory-insns-hard-limit
12776 @opindex msched-max-memory-insns-hard-limit
12777 Disallow more than `msched-max-memory-insns' in instruction group.
12778 Otherwise, limit is `soft' meaning that we would prefer non-memory operations
12779 when limit is reached but may still schedule memory operations.
12781 @end table
12783 @node IA-64/VMS Options
12784 @subsection IA-64/VMS Options
12786 These @samp{-m} options are defined for the IA-64/VMS implementations:
12788 @table @gcctabopt
12789 @item -mvms-return-codes
12790 @opindex mvms-return-codes
12791 Return VMS condition codes from main. The default is to return POSIX
12792 style condition (e.g.@ error) codes.
12794 @item -mdebug-main=@var{prefix}
12795 @opindex mdebug-main=@var{prefix}
12796 Flag the first routine whose name starts with @var{prefix} as the main
12797 routine for the debugger.
12799 @item -mmalloc64
12800 @opindex mmalloc64
12801 Default to 64bit memory allocation routines.
12802 @end table
12804 @node LM32 Options
12805 @subsection LM32 Options
12806 @cindex LM32 options
12808 These @option{-m} options are defined for the Lattice Mico32 architecture:
12810 @table @gcctabopt
12811 @item -mbarrel-shift-enabled
12812 @opindex mbarrel-shift-enabled
12813 Enable barrel-shift instructions.
12815 @item -mdivide-enabled
12816 @opindex mdivide-enabled
12817 Enable divide and modulus instructions.
12819 @item -mmultiply-enabled
12820 @opindex multiply-enabled
12821 Enable multiply instructions.
12823 @item -msign-extend-enabled
12824 @opindex msign-extend-enabled
12825 Enable sign extend instructions.
12827 @item -muser-enabled
12828 @opindex muser-enabled
12829 Enable user-defined instructions.
12831 @end table
12833 @node M32C Options
12834 @subsection M32C Options
12835 @cindex M32C options
12837 @table @gcctabopt
12838 @item -mcpu=@var{name}
12839 @opindex mcpu=
12840 Select the CPU for which code is generated.  @var{name} may be one of
12841 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
12842 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
12843 the M32C/80 series.
12845 @item -msim
12846 @opindex msim
12847 Specifies that the program will be run on the simulator.  This causes
12848 an alternate runtime library to be linked in which supports, for
12849 example, file I/O@.  You must not use this option when generating
12850 programs that will run on real hardware; you must provide your own
12851 runtime library for whatever I/O functions are needed.
12853 @item -memregs=@var{number}
12854 @opindex memregs=
12855 Specifies the number of memory-based pseudo-registers GCC will use
12856 during code generation.  These pseudo-registers will be used like real
12857 registers, so there is a tradeoff between GCC's ability to fit the
12858 code into available registers, and the performance penalty of using
12859 memory instead of registers.  Note that all modules in a program must
12860 be compiled with the same value for this option.  Because of that, you
12861 must not use this option with the default runtime libraries gcc
12862 builds.
12864 @end table
12866 @node M32R/D Options
12867 @subsection M32R/D Options
12868 @cindex M32R/D options
12870 These @option{-m} options are defined for Renesas M32R/D architectures:
12872 @table @gcctabopt
12873 @item -m32r2
12874 @opindex m32r2
12875 Generate code for the M32R/2@.
12877 @item -m32rx
12878 @opindex m32rx
12879 Generate code for the M32R/X@.
12881 @item -m32r
12882 @opindex m32r
12883 Generate code for the M32R@.  This is the default.
12885 @item -mmodel=small
12886 @opindex mmodel=small
12887 Assume all objects live in the lower 16MB of memory (so that their addresses
12888 can be loaded with the @code{ld24} instruction), and assume all subroutines
12889 are reachable with the @code{bl} instruction.
12890 This is the default.
12892 The addressability of a particular object can be set with the
12893 @code{model} attribute.
12895 @item -mmodel=medium
12896 @opindex mmodel=medium
12897 Assume objects may be anywhere in the 32-bit address space (the compiler
12898 will generate @code{seth/add3} instructions to load their addresses), and
12899 assume all subroutines are reachable with the @code{bl} instruction.
12901 @item -mmodel=large
12902 @opindex mmodel=large
12903 Assume objects may be anywhere in the 32-bit address space (the compiler
12904 will generate @code{seth/add3} instructions to load their addresses), and
12905 assume subroutines may not be reachable with the @code{bl} instruction
12906 (the compiler will generate the much slower @code{seth/add3/jl}
12907 instruction sequence).
12909 @item -msdata=none
12910 @opindex msdata=none
12911 Disable use of the small data area.  Variables will be put into
12912 one of @samp{.data}, @samp{bss}, or @samp{.rodata} (unless the
12913 @code{section} attribute has been specified).
12914 This is the default.
12916 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
12917 Objects may be explicitly put in the small data area with the
12918 @code{section} attribute using one of these sections.
12920 @item -msdata=sdata
12921 @opindex msdata=sdata
12922 Put small global and static data in the small data area, but do not
12923 generate special code to reference them.
12925 @item -msdata=use
12926 @opindex msdata=use
12927 Put small global and static data in the small data area, and generate
12928 special instructions to reference them.
12930 @item -G @var{num}
12931 @opindex G
12932 @cindex smaller data references
12933 Put global and static objects less than or equal to @var{num} bytes
12934 into the small data or bss sections instead of the normal data or bss
12935 sections.  The default value of @var{num} is 8.
12936 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
12937 for this option to have any effect.
12939 All modules should be compiled with the same @option{-G @var{num}} value.
12940 Compiling with different values of @var{num} may or may not work; if it
12941 doesn't the linker will give an error message---incorrect code will not be
12942 generated.
12944 @item -mdebug
12945 @opindex mdebug
12946 Makes the M32R specific code in the compiler display some statistics
12947 that might help in debugging programs.
12949 @item -malign-loops
12950 @opindex malign-loops
12951 Align all loops to a 32-byte boundary.
12953 @item -mno-align-loops
12954 @opindex mno-align-loops
12955 Do not enforce a 32-byte alignment for loops.  This is the default.
12957 @item -missue-rate=@var{number}
12958 @opindex missue-rate=@var{number}
12959 Issue @var{number} instructions per cycle.  @var{number} can only be 1
12960 or 2.
12962 @item -mbranch-cost=@var{number}
12963 @opindex mbranch-cost=@var{number}
12964 @var{number} can only be 1 or 2.  If it is 1 then branches will be
12965 preferred over conditional code, if it is 2, then the opposite will
12966 apply.
12968 @item -mflush-trap=@var{number}
12969 @opindex mflush-trap=@var{number}
12970 Specifies the trap number to use to flush the cache.  The default is
12971 12.  Valid numbers are between 0 and 15 inclusive.
12973 @item -mno-flush-trap
12974 @opindex mno-flush-trap
12975 Specifies that the cache cannot be flushed by using a trap.
12977 @item -mflush-func=@var{name}
12978 @opindex mflush-func=@var{name}
12979 Specifies the name of the operating system function to call to flush
12980 the cache.  The default is @emph{_flush_cache}, but a function call
12981 will only be used if a trap is not available.
12983 @item -mno-flush-func
12984 @opindex mno-flush-func
12985 Indicates that there is no OS function for flushing the cache.
12987 @end table
12989 @node M680x0 Options
12990 @subsection M680x0 Options
12991 @cindex M680x0 options
12993 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
12994 The default settings depend on which architecture was selected when
12995 the compiler was configured; the defaults for the most common choices
12996 are given below.
12998 @table @gcctabopt
12999 @item -march=@var{arch}
13000 @opindex march
13001 Generate code for a specific M680x0 or ColdFire instruction set
13002 architecture.  Permissible values of @var{arch} for M680x0
13003 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
13004 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
13005 architectures are selected according to Freescale's ISA classification
13006 and the permissible values are: @samp{isaa}, @samp{isaaplus},
13007 @samp{isab} and @samp{isac}.
13009 gcc defines a macro @samp{__mcf@var{arch}__} whenever it is generating
13010 code for a ColdFire target.  The @var{arch} in this macro is one of the
13011 @option{-march} arguments given above.
13013 When used together, @option{-march} and @option{-mtune} select code
13014 that runs on a family of similar processors but that is optimized
13015 for a particular microarchitecture.
13017 @item -mcpu=@var{cpu}
13018 @opindex mcpu
13019 Generate code for a specific M680x0 or ColdFire processor.
13020 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
13021 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
13022 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
13023 below, which also classifies the CPUs into families:
13025 @multitable @columnfractions 0.20 0.80
13026 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
13027 @item @samp{51} @tab @samp{51} @samp{51ac} @samp{51cn} @samp{51em} @samp{51qe}
13028 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
13029 @item @samp{5206e} @tab @samp{5206e}
13030 @item @samp{5208} @tab @samp{5207} @samp{5208}
13031 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
13032 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
13033 @item @samp{5216} @tab @samp{5214} @samp{5216}
13034 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
13035 @item @samp{5225} @tab @samp{5224} @samp{5225}
13036 @item @samp{52259} @tab @samp{52252} @samp{52254} @samp{52255} @samp{52256} @samp{52258} @samp{52259}
13037 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
13038 @item @samp{5249} @tab @samp{5249}
13039 @item @samp{5250} @tab @samp{5250}
13040 @item @samp{5271} @tab @samp{5270} @samp{5271}
13041 @item @samp{5272} @tab @samp{5272}
13042 @item @samp{5275} @tab @samp{5274} @samp{5275}
13043 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
13044 @item @samp{53017} @tab @samp{53011} @samp{53012} @samp{53013} @samp{53014} @samp{53015} @samp{53016} @samp{53017}
13045 @item @samp{5307} @tab @samp{5307}
13046 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
13047 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
13048 @item @samp{5407} @tab @samp{5407}
13049 @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}
13050 @end multitable
13052 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
13053 @var{arch} is compatible with @var{cpu}.  Other combinations of
13054 @option{-mcpu} and @option{-march} are rejected.
13056 gcc defines the macro @samp{__mcf_cpu_@var{cpu}} when ColdFire target
13057 @var{cpu} is selected.  It also defines @samp{__mcf_family_@var{family}},
13058 where the value of @var{family} is given by the table above.
13060 @item -mtune=@var{tune}
13061 @opindex mtune
13062 Tune the code for a particular microarchitecture, within the
13063 constraints set by @option{-march} and @option{-mcpu}.
13064 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
13065 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
13066 and @samp{cpu32}.  The ColdFire microarchitectures
13067 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
13069 You can also use @option{-mtune=68020-40} for code that needs
13070 to run relatively well on 68020, 68030 and 68040 targets.
13071 @option{-mtune=68020-60} is similar but includes 68060 targets
13072 as well.  These two options select the same tuning decisions as
13073 @option{-m68020-40} and @option{-m68020-60} respectively.
13075 gcc defines the macros @samp{__mc@var{arch}} and @samp{__mc@var{arch}__}
13076 when tuning for 680x0 architecture @var{arch}.  It also defines
13077 @samp{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
13078 option is used.  If gcc is tuning for a range of architectures,
13079 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
13080 it defines the macros for every architecture in the range.
13082 gcc also defines the macro @samp{__m@var{uarch}__} when tuning for
13083 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
13084 of the arguments given above.
13086 @item -m68000
13087 @itemx -mc68000
13088 @opindex m68000
13089 @opindex mc68000
13090 Generate output for a 68000.  This is the default
13091 when the compiler is configured for 68000-based systems.
13092 It is equivalent to @option{-march=68000}.
13094 Use this option for microcontrollers with a 68000 or EC000 core,
13095 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
13097 @item -m68010
13098 @opindex m68010
13099 Generate output for a 68010.  This is the default
13100 when the compiler is configured for 68010-based systems.
13101 It is equivalent to @option{-march=68010}.
13103 @item -m68020
13104 @itemx -mc68020
13105 @opindex m68020
13106 @opindex mc68020
13107 Generate output for a 68020.  This is the default
13108 when the compiler is configured for 68020-based systems.
13109 It is equivalent to @option{-march=68020}.
13111 @item -m68030
13112 @opindex m68030
13113 Generate output for a 68030.  This is the default when the compiler is
13114 configured for 68030-based systems.  It is equivalent to
13115 @option{-march=68030}.
13117 @item -m68040
13118 @opindex m68040
13119 Generate output for a 68040.  This is the default when the compiler is
13120 configured for 68040-based systems.  It is equivalent to
13121 @option{-march=68040}.
13123 This option inhibits the use of 68881/68882 instructions that have to be
13124 emulated by software on the 68040.  Use this option if your 68040 does not
13125 have code to emulate those instructions.
13127 @item -m68060
13128 @opindex m68060
13129 Generate output for a 68060.  This is the default when the compiler is
13130 configured for 68060-based systems.  It is equivalent to
13131 @option{-march=68060}.
13133 This option inhibits the use of 68020 and 68881/68882 instructions that
13134 have to be emulated by software on the 68060.  Use this option if your 68060
13135 does not have code to emulate those instructions.
13137 @item -mcpu32
13138 @opindex mcpu32
13139 Generate output for a CPU32.  This is the default
13140 when the compiler is configured for CPU32-based systems.
13141 It is equivalent to @option{-march=cpu32}.
13143 Use this option for microcontrollers with a
13144 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
13145 68336, 68340, 68341, 68349 and 68360.
13147 @item -m5200
13148 @opindex m5200
13149 Generate output for a 520X ColdFire CPU@.  This is the default
13150 when the compiler is configured for 520X-based systems.
13151 It is equivalent to @option{-mcpu=5206}, and is now deprecated
13152 in favor of that option.
13154 Use this option for microcontroller with a 5200 core, including
13155 the MCF5202, MCF5203, MCF5204 and MCF5206.
13157 @item -m5206e
13158 @opindex m5206e
13159 Generate output for a 5206e ColdFire CPU@.  The option is now
13160 deprecated in favor of the equivalent @option{-mcpu=5206e}.
13162 @item -m528x
13163 @opindex m528x
13164 Generate output for a member of the ColdFire 528X family.
13165 The option is now deprecated in favor of the equivalent
13166 @option{-mcpu=528x}.
13168 @item -m5307
13169 @opindex m5307
13170 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
13171 in favor of the equivalent @option{-mcpu=5307}.
13173 @item -m5407
13174 @opindex m5407
13175 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
13176 in favor of the equivalent @option{-mcpu=5407}.
13178 @item -mcfv4e
13179 @opindex mcfv4e
13180 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
13181 This includes use of hardware floating point instructions.
13182 The option is equivalent to @option{-mcpu=547x}, and is now
13183 deprecated in favor of that option.
13185 @item -m68020-40
13186 @opindex m68020-40
13187 Generate output for a 68040, without using any of the new instructions.
13188 This results in code which can run relatively efficiently on either a
13189 68020/68881 or a 68030 or a 68040.  The generated code does use the
13190 68881 instructions that are emulated on the 68040.
13192 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
13194 @item -m68020-60
13195 @opindex m68020-60
13196 Generate output for a 68060, without using any of the new instructions.
13197 This results in code which can run relatively efficiently on either a
13198 68020/68881 or a 68030 or a 68040.  The generated code does use the
13199 68881 instructions that are emulated on the 68060.
13201 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
13203 @item -mhard-float
13204 @itemx -m68881
13205 @opindex mhard-float
13206 @opindex m68881
13207 Generate floating-point instructions.  This is the default for 68020
13208 and above, and for ColdFire devices that have an FPU@.  It defines the
13209 macro @samp{__HAVE_68881__} on M680x0 targets and @samp{__mcffpu__}
13210 on ColdFire targets.
13212 @item -msoft-float
13213 @opindex msoft-float
13214 Do not generate floating-point instructions; use library calls instead.
13215 This is the default for 68000, 68010, and 68832 targets.  It is also
13216 the default for ColdFire devices that have no FPU.
13218 @item -mdiv
13219 @itemx -mno-div
13220 @opindex mdiv
13221 @opindex mno-div
13222 Generate (do not generate) ColdFire hardware divide and remainder
13223 instructions.  If @option{-march} is used without @option{-mcpu},
13224 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
13225 architectures.  Otherwise, the default is taken from the target CPU
13226 (either the default CPU, or the one specified by @option{-mcpu}).  For
13227 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
13228 @option{-mcpu=5206e}.
13230 gcc defines the macro @samp{__mcfhwdiv__} when this option is enabled.
13232 @item -mshort
13233 @opindex mshort
13234 Consider type @code{int} to be 16 bits wide, like @code{short int}.
13235 Additionally, parameters passed on the stack are also aligned to a
13236 16-bit boundary even on targets whose API mandates promotion to 32-bit.
13238 @item -mno-short
13239 @opindex mno-short
13240 Do not consider type @code{int} to be 16 bits wide.  This is the default.
13242 @item -mnobitfield
13243 @itemx -mno-bitfield
13244 @opindex mnobitfield
13245 @opindex mno-bitfield
13246 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
13247 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
13249 @item -mbitfield
13250 @opindex mbitfield
13251 Do use the bit-field instructions.  The @option{-m68020} option implies
13252 @option{-mbitfield}.  This is the default if you use a configuration
13253 designed for a 68020.
13255 @item -mrtd
13256 @opindex mrtd
13257 Use a different function-calling convention, in which functions
13258 that take a fixed number of arguments return with the @code{rtd}
13259 instruction, which pops their arguments while returning.  This
13260 saves one instruction in the caller since there is no need to pop
13261 the arguments there.
13263 This calling convention is incompatible with the one normally
13264 used on Unix, so you cannot use it if you need to call libraries
13265 compiled with the Unix compiler.
13267 Also, you must provide function prototypes for all functions that
13268 take variable numbers of arguments (including @code{printf});
13269 otherwise incorrect code will be generated for calls to those
13270 functions.
13272 In addition, seriously incorrect code will result if you call a
13273 function with too many arguments.  (Normally, extra arguments are
13274 harmlessly ignored.)
13276 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
13277 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
13279 @item -mno-rtd
13280 @opindex mno-rtd
13281 Do not use the calling conventions selected by @option{-mrtd}.
13282 This is the default.
13284 @item -malign-int
13285 @itemx -mno-align-int
13286 @opindex malign-int
13287 @opindex mno-align-int
13288 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
13289 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
13290 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
13291 Aligning variables on 32-bit boundaries produces code that runs somewhat
13292 faster on processors with 32-bit busses at the expense of more memory.
13294 @strong{Warning:} if you use the @option{-malign-int} switch, GCC will
13295 align structures containing the above types  differently than
13296 most published application binary interface specifications for the m68k.
13298 @item -mpcrel
13299 @opindex mpcrel
13300 Use the pc-relative addressing mode of the 68000 directly, instead of
13301 using a global offset table.  At present, this option implies @option{-fpic},
13302 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
13303 not presently supported with @option{-mpcrel}, though this could be supported for
13304 68020 and higher processors.
13306 @item -mno-strict-align
13307 @itemx -mstrict-align
13308 @opindex mno-strict-align
13309 @opindex mstrict-align
13310 Do not (do) assume that unaligned memory references will be handled by
13311 the system.
13313 @item -msep-data
13314 Generate code that allows the data segment to be located in a different
13315 area of memory from the text segment.  This allows for execute in place in
13316 an environment without virtual memory management.  This option implies
13317 @option{-fPIC}.
13319 @item -mno-sep-data
13320 Generate code that assumes that the data segment follows the text segment.
13321 This is the default.
13323 @item -mid-shared-library
13324 Generate code that supports shared libraries via the library ID method.
13325 This allows for execute in place and shared libraries in an environment
13326 without virtual memory management.  This option implies @option{-fPIC}.
13328 @item -mno-id-shared-library
13329 Generate code that doesn't assume ID based shared libraries are being used.
13330 This is the default.
13332 @item -mshared-library-id=n
13333 Specified the identification number of the ID based shared library being
13334 compiled.  Specifying a value of 0 will generate more compact code, specifying
13335 other values will force the allocation of that number to the current
13336 library but is no more space or time efficient than omitting this option.
13338 @item -mxgot
13339 @itemx -mno-xgot
13340 @opindex mxgot
13341 @opindex mno-xgot
13342 When generating position-independent code for ColdFire, generate code
13343 that works if the GOT has more than 8192 entries.  This code is
13344 larger and slower than code generated without this option.  On M680x0
13345 processors, this option is not needed; @option{-fPIC} suffices.
13347 GCC normally uses a single instruction to load values from the GOT@.
13348 While this is relatively efficient, it only works if the GOT
13349 is smaller than about 64k.  Anything larger causes the linker
13350 to report an error such as:
13352 @cindex relocation truncated to fit (ColdFire)
13353 @smallexample
13354 relocation truncated to fit: R_68K_GOT16O foobar
13355 @end smallexample
13357 If this happens, you should recompile your code with @option{-mxgot}.
13358 It should then work with very large GOTs.  However, code generated with
13359 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
13360 the value of a global symbol.
13362 Note that some linkers, including newer versions of the GNU linker,
13363 can create multiple GOTs and sort GOT entries.  If you have such a linker,
13364 you should only need to use @option{-mxgot} when compiling a single
13365 object file that accesses more than 8192 GOT entries.  Very few do.
13367 These options have no effect unless GCC is generating
13368 position-independent code.
13370 @end table
13372 @node M68hc1x Options
13373 @subsection M68hc1x Options
13374 @cindex M68hc1x options
13376 These are the @samp{-m} options defined for the 68hc11 and 68hc12
13377 microcontrollers.  The default values for these options depends on
13378 which style of microcontroller was selected when the compiler was configured;
13379 the defaults for the most common choices are given below.
13381 @table @gcctabopt
13382 @item -m6811
13383 @itemx -m68hc11
13384 @opindex m6811
13385 @opindex m68hc11
13386 Generate output for a 68HC11.  This is the default
13387 when the compiler is configured for 68HC11-based systems.
13389 @item -m6812
13390 @itemx -m68hc12
13391 @opindex m6812
13392 @opindex m68hc12
13393 Generate output for a 68HC12.  This is the default
13394 when the compiler is configured for 68HC12-based systems.
13396 @item -m68S12
13397 @itemx -m68hcs12
13398 @opindex m68S12
13399 @opindex m68hcs12
13400 Generate output for a 68HCS12.
13402 @item -mauto-incdec
13403 @opindex mauto-incdec
13404 Enable the use of 68HC12 pre and post auto-increment and auto-decrement
13405 addressing modes.
13407 @item -minmax
13408 @itemx -mnominmax
13409 @opindex minmax
13410 @opindex mnominmax
13411 Enable the use of 68HC12 min and max instructions.
13413 @item -mlong-calls
13414 @itemx -mno-long-calls
13415 @opindex mlong-calls
13416 @opindex mno-long-calls
13417 Treat all calls as being far away (near).  If calls are assumed to be
13418 far away, the compiler will use the @code{call} instruction to
13419 call a function and the @code{rtc} instruction for returning.
13421 @item -mshort
13422 @opindex mshort
13423 Consider type @code{int} to be 16 bits wide, like @code{short int}.
13425 @item -msoft-reg-count=@var{count}
13426 @opindex msoft-reg-count
13427 Specify the number of pseudo-soft registers which are used for the
13428 code generation.  The maximum number is 32.  Using more pseudo-soft
13429 register may or may not result in better code depending on the program.
13430 The default is 4 for 68HC11 and 2 for 68HC12.
13432 @end table
13434 @node MCore Options
13435 @subsection MCore Options
13436 @cindex MCore options
13438 These are the @samp{-m} options defined for the Motorola M*Core
13439 processors.
13441 @table @gcctabopt
13443 @item -mhardlit
13444 @itemx -mno-hardlit
13445 @opindex mhardlit
13446 @opindex mno-hardlit
13447 Inline constants into the code stream if it can be done in two
13448 instructions or less.
13450 @item -mdiv
13451 @itemx -mno-div
13452 @opindex mdiv
13453 @opindex mno-div
13454 Use the divide instruction.  (Enabled by default).
13456 @item -mrelax-immediate
13457 @itemx -mno-relax-immediate
13458 @opindex mrelax-immediate
13459 @opindex mno-relax-immediate
13460 Allow arbitrary sized immediates in bit operations.
13462 @item -mwide-bitfields
13463 @itemx -mno-wide-bitfields
13464 @opindex mwide-bitfields
13465 @opindex mno-wide-bitfields
13466 Always treat bit-fields as int-sized.
13468 @item -m4byte-functions
13469 @itemx -mno-4byte-functions
13470 @opindex m4byte-functions
13471 @opindex mno-4byte-functions
13472 Force all functions to be aligned to a four byte boundary.
13474 @item -mcallgraph-data
13475 @itemx -mno-callgraph-data
13476 @opindex mcallgraph-data
13477 @opindex mno-callgraph-data
13478 Emit callgraph information.
13480 @item -mslow-bytes
13481 @itemx -mno-slow-bytes
13482 @opindex mslow-bytes
13483 @opindex mno-slow-bytes
13484 Prefer word access when reading byte quantities.
13486 @item -mlittle-endian
13487 @itemx -mbig-endian
13488 @opindex mlittle-endian
13489 @opindex mbig-endian
13490 Generate code for a little endian target.
13492 @item -m210
13493 @itemx -m340
13494 @opindex m210
13495 @opindex m340
13496 Generate code for the 210 processor.
13498 @item -mno-lsim
13499 @opindex mno-lsim
13500 Assume that run-time support has been provided and so omit the
13501 simulator library (@file{libsim.a)} from the linker command line.
13503 @item -mstack-increment=@var{size}
13504 @opindex mstack-increment
13505 Set the maximum amount for a single stack increment operation.  Large
13506 values can increase the speed of programs which contain functions
13507 that need a large amount of stack space, but they can also trigger a
13508 segmentation fault if the stack is extended too much.  The default
13509 value is 0x1000.
13511 @end table
13513 @node MeP Options
13514 @subsection MeP Options
13515 @cindex MeP options
13517 @table @gcctabopt
13519 @item -mabsdiff
13520 @opindex mabsdiff
13521 Enables the @code{abs} instruction, which is the absolute difference
13522 between two registers.
13524 @item -mall-opts
13525 @opindex mall-opts
13526 Enables all the optional instructions - average, multiply, divide, bit
13527 operations, leading zero, absolute difference, min/max, clip, and
13528 saturation.
13531 @item -maverage
13532 @opindex maverage
13533 Enables the @code{ave} instruction, which computes the average of two
13534 registers.
13536 @item -mbased=@var{n}
13537 @opindex mbased=
13538 Variables of size @var{n} bytes or smaller will be placed in the
13539 @code{.based} section by default.  Based variables use the @code{$tp}
13540 register as a base register, and there is a 128 byte limit to the
13541 @code{.based} section.
13543 @item -mbitops
13544 @opindex mbitops
13545 Enables the bit operation instructions - bit test (@code{btstm}), set
13546 (@code{bsetm}), clear (@code{bclrm}), invert (@code{bnotm}), and
13547 test-and-set (@code{tas}).
13549 @item -mc=@var{name}
13550 @opindex mc=
13551 Selects which section constant data will be placed in.  @var{name} may
13552 be @code{tiny}, @code{near}, or @code{far}.
13554 @item -mclip
13555 @opindex mclip
13556 Enables the @code{clip} instruction.  Note that @code{-mclip} is not
13557 useful unless you also provide @code{-mminmax}.
13559 @item -mconfig=@var{name}
13560 @opindex mconfig=
13561 Selects one of the build-in core configurations.  Each MeP chip has
13562 one or more modules in it; each module has a core CPU and a variety of
13563 coprocessors, optional instructions, and peripherals.  The
13564 @code{MeP-Integrator} tool, not part of GCC, provides these
13565 configurations through this option; using this option is the same as
13566 using all the corresponding command line options.  The default
13567 configuration is @code{default}.
13569 @item -mcop
13570 @opindex mcop
13571 Enables the coprocessor instructions.  By default, this is a 32-bit
13572 coprocessor.  Note that the coprocessor is normally enabled via the
13573 @code{-mconfig=} option.
13575 @item -mcop32
13576 @opindex mcop32
13577 Enables the 32-bit coprocessor's instructions.
13579 @item -mcop64
13580 @opindex mcop64
13581 Enables the 64-bit coprocessor's instructions.
13583 @item -mivc2
13584 @opindex mivc2
13585 Enables IVC2 scheduling.  IVC2 is a 64-bit VLIW coprocessor.
13587 @item -mdc
13588 @opindex mdc
13589 Causes constant variables to be placed in the @code{.near} section.
13591 @item -mdiv
13592 @opindex mdiv
13593 Enables the @code{div} and @code{divu} instructions.
13595 @item -meb
13596 @opindex meb
13597 Generate big-endian code.
13599 @item -mel
13600 @opindex mel
13601 Generate little-endian code.
13603 @item -mio-volatile
13604 @opindex mio-volatile
13605 Tells the compiler that any variable marked with the @code{io}
13606 attribute is to be considered volatile.
13608 @item -ml
13609 @opindex ml
13610 Causes variables to be assigned to the @code{.far} section by default.
13612 @item -mleadz
13613 @opindex mleadz
13614 Enables the @code{leadz} (leading zero) instruction.
13616 @item -mm
13617 @opindex mm
13618 Causes variables to be assigned to the @code{.near} section by default.
13620 @item -mminmax
13621 @opindex mminmax
13622 Enables the @code{min} and @code{max} instructions.
13624 @item -mmult
13625 @opindex mmult
13626 Enables the multiplication and multiply-accumulate instructions.
13628 @item -mno-opts
13629 @opindex mno-opts
13630 Disables all the optional instructions enabled by @code{-mall-opts}.
13632 @item -mrepeat
13633 @opindex mrepeat
13634 Enables the @code{repeat} and @code{erepeat} instructions, used for
13635 low-overhead looping.
13637 @item -ms
13638 @opindex ms
13639 Causes all variables to default to the @code{.tiny} section.  Note
13640 that there is a 65536 byte limit to this section.  Accesses to these
13641 variables use the @code{%gp} base register.
13643 @item -msatur
13644 @opindex msatur
13645 Enables the saturation instructions.  Note that the compiler does not
13646 currently generate these itself, but this option is included for
13647 compatibility with other tools, like @code{as}.
13649 @item -msdram
13650 @opindex msdram
13651 Link the SDRAM-based runtime instead of the default ROM-based runtime.
13653 @item -msim
13654 @opindex msim
13655 Link the simulator runtime libraries.
13657 @item -msimnovec
13658 @opindex msimnovec
13659 Link the simulator runtime libraries, excluding built-in support
13660 for reset and exception vectors and tables.
13662 @item -mtf
13663 @opindex mtf
13664 Causes all functions to default to the @code{.far} section.  Without
13665 this option, functions default to the @code{.near} section.
13667 @item -mtiny=@var{n}
13668 @opindex mtiny=
13669 Variables that are @var{n} bytes or smaller will be allocated to the
13670 @code{.tiny} section.  These variables use the @code{$gp} base
13671 register.  The default for this option is 4, but note that there's a
13672 65536 byte limit to the @code{.tiny} section.
13674 @end table
13676 @node MIPS Options
13677 @subsection MIPS Options
13678 @cindex MIPS options
13680 @table @gcctabopt
13682 @item -EB
13683 @opindex EB
13684 Generate big-endian code.
13686 @item -EL
13687 @opindex EL
13688 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
13689 configurations.
13691 @item -march=@var{arch}
13692 @opindex march
13693 Generate code that will run on @var{arch}, which can be the name of a
13694 generic MIPS ISA, or the name of a particular processor.
13695 The ISA names are:
13696 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
13697 @samp{mips32}, @samp{mips32r2}, @samp{mips64} and @samp{mips64r2}.
13698 The processor names are:
13699 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
13700 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
13701 @samp{5kc}, @samp{5kf},
13702 @samp{20kc},
13703 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
13704 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
13705 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1},
13706 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
13707 @samp{1004kc}, @samp{1004kf2_1}, @samp{1004kf1_1},
13708 @samp{loongson2e}, @samp{loongson2f},
13709 @samp{m4k},
13710 @samp{octeon},
13711 @samp{orion},
13712 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
13713 @samp{r4600}, @samp{r4650}, @samp{r6000}, @samp{r8000},
13714 @samp{rm7000}, @samp{rm9000},
13715 @samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
13716 @samp{sb1},
13717 @samp{sr71000},
13718 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
13719 @samp{vr5000}, @samp{vr5400}, @samp{vr5500}
13720 and @samp{xlr}.
13721 The special value @samp{from-abi} selects the
13722 most compatible architecture for the selected ABI (that is,
13723 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
13725 Native Linux/GNU toolchains also support the value @samp{native},
13726 which selects the best architecture option for the host processor.
13727 @option{-march=native} has no effect if GCC does not recognize
13728 the processor.
13730 In processor names, a final @samp{000} can be abbreviated as @samp{k}
13731 (for example, @samp{-march=r2k}).  Prefixes are optional, and
13732 @samp{vr} may be written @samp{r}.
13734 Names of the form @samp{@var{n}f2_1} refer to processors with
13735 FPUs clocked at half the rate of the core, names of the form
13736 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
13737 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
13738 processors with FPUs clocked a ratio of 3:2 with respect to the core.
13739 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
13740 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
13741 accepted as synonyms for @samp{@var{n}f1_1}.
13743 GCC defines two macros based on the value of this option.  The first
13744 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
13745 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
13746 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
13747 For example, @samp{-march=r2000} will set @samp{_MIPS_ARCH}
13748 to @samp{"r2000"} and define the macro @samp{_MIPS_ARCH_R2000}.
13750 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
13751 above.  In other words, it will have the full prefix and will not
13752 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
13753 the macro names the resolved architecture (either @samp{"mips1"} or
13754 @samp{"mips3"}).  It names the default architecture when no
13755 @option{-march} option is given.
13757 @item -mtune=@var{arch}
13758 @opindex mtune
13759 Optimize for @var{arch}.  Among other things, this option controls
13760 the way instructions are scheduled, and the perceived cost of arithmetic
13761 operations.  The list of @var{arch} values is the same as for
13762 @option{-march}.
13764 When this option is not used, GCC will optimize for the processor
13765 specified by @option{-march}.  By using @option{-march} and
13766 @option{-mtune} together, it is possible to generate code that will
13767 run on a family of processors, but optimize the code for one
13768 particular member of that family.
13770 @samp{-mtune} defines the macros @samp{_MIPS_TUNE} and
13771 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
13772 @samp{-march} ones described above.
13774 @item -mips1
13775 @opindex mips1
13776 Equivalent to @samp{-march=mips1}.
13778 @item -mips2
13779 @opindex mips2
13780 Equivalent to @samp{-march=mips2}.
13782 @item -mips3
13783 @opindex mips3
13784 Equivalent to @samp{-march=mips3}.
13786 @item -mips4
13787 @opindex mips4
13788 Equivalent to @samp{-march=mips4}.
13790 @item -mips32
13791 @opindex mips32
13792 Equivalent to @samp{-march=mips32}.
13794 @item -mips32r2
13795 @opindex mips32r2
13796 Equivalent to @samp{-march=mips32r2}.
13798 @item -mips64
13799 @opindex mips64
13800 Equivalent to @samp{-march=mips64}.
13802 @item -mips64r2
13803 @opindex mips64r2
13804 Equivalent to @samp{-march=mips64r2}.
13806 @item -mips16
13807 @itemx -mno-mips16
13808 @opindex mips16
13809 @opindex mno-mips16
13810 Generate (do not generate) MIPS16 code.  If GCC is targetting a
13811 MIPS32 or MIPS64 architecture, it will make use of the MIPS16e ASE@.
13813 MIPS16 code generation can also be controlled on a per-function basis
13814 by means of @code{mips16} and @code{nomips16} attributes.
13815 @xref{Function Attributes}, for more information.
13817 @item -mflip-mips16
13818 @opindex mflip-mips16
13819 Generate MIPS16 code on alternating functions.  This option is provided
13820 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
13821 not intended for ordinary use in compiling user code.
13823 @item -minterlink-mips16
13824 @itemx -mno-interlink-mips16
13825 @opindex minterlink-mips16
13826 @opindex mno-interlink-mips16
13827 Require (do not require) that non-MIPS16 code be link-compatible with
13828 MIPS16 code.
13830 For example, non-MIPS16 code cannot jump directly to MIPS16 code;
13831 it must either use a call or an indirect jump.  @option{-minterlink-mips16}
13832 therefore disables direct jumps unless GCC knows that the target of the
13833 jump is not MIPS16.
13835 @item -mabi=32
13836 @itemx -mabi=o64
13837 @itemx -mabi=n32
13838 @itemx -mabi=64
13839 @itemx -mabi=eabi
13840 @opindex mabi=32
13841 @opindex mabi=o64
13842 @opindex mabi=n32
13843 @opindex mabi=64
13844 @opindex mabi=eabi
13845 Generate code for the given ABI@.
13847 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
13848 generates 64-bit code when you select a 64-bit architecture, but you
13849 can use @option{-mgp32} to get 32-bit code instead.
13851 For information about the O64 ABI, see
13852 @w{@uref{http://gcc.gnu.org/projects/mipso64-abi.html}}.
13854 GCC supports a variant of the o32 ABI in which floating-point registers
13855 are 64 rather than 32 bits wide.  You can select this combination with
13856 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @samp{mthc1}
13857 and @samp{mfhc1} instructions and is therefore only supported for
13858 MIPS32R2 processors.
13860 The register assignments for arguments and return values remain the
13861 same, but each scalar value is passed in a single 64-bit register
13862 rather than a pair of 32-bit registers.  For example, scalar
13863 floating-point values are returned in @samp{$f0} only, not a
13864 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
13865 remains the same, but all 64 bits are saved.
13867 @item -mabicalls
13868 @itemx -mno-abicalls
13869 @opindex mabicalls
13870 @opindex mno-abicalls
13871 Generate (do not generate) code that is suitable for SVR4-style
13872 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
13873 systems.
13875 @item -mshared
13876 @itemx -mno-shared
13877 Generate (do not generate) code that is fully position-independent,
13878 and that can therefore be linked into shared libraries.  This option
13879 only affects @option{-mabicalls}.
13881 All @option{-mabicalls} code has traditionally been position-independent,
13882 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
13883 as an extension, the GNU toolchain allows executables to use absolute
13884 accesses for locally-binding symbols.  It can also use shorter GP
13885 initialization sequences and generate direct calls to locally-defined
13886 functions.  This mode is selected by @option{-mno-shared}.
13888 @option{-mno-shared} depends on binutils 2.16 or higher and generates
13889 objects that can only be linked by the GNU linker.  However, the option
13890 does not affect the ABI of the final executable; it only affects the ABI
13891 of relocatable objects.  Using @option{-mno-shared} will generally make
13892 executables both smaller and quicker.
13894 @option{-mshared} is the default.
13896 @item -mplt
13897 @itemx -mno-plt
13898 @opindex mplt
13899 @opindex mno-plt
13900 Assume (do not assume) that the static and dynamic linkers
13901 support PLTs and copy relocations.  This option only affects
13902 @samp{-mno-shared -mabicalls}.  For the n64 ABI, this option
13903 has no effect without @samp{-msym32}.
13905 You can make @option{-mplt} the default by configuring
13906 GCC with @option{--with-mips-plt}.  The default is
13907 @option{-mno-plt} otherwise.
13909 @item -mxgot
13910 @itemx -mno-xgot
13911 @opindex mxgot
13912 @opindex mno-xgot
13913 Lift (do not lift) the usual restrictions on the size of the global
13914 offset table.
13916 GCC normally uses a single instruction to load values from the GOT@.
13917 While this is relatively efficient, it will only work if the GOT
13918 is smaller than about 64k.  Anything larger will cause the linker
13919 to report an error such as:
13921 @cindex relocation truncated to fit (MIPS)
13922 @smallexample
13923 relocation truncated to fit: R_MIPS_GOT16 foobar
13924 @end smallexample
13926 If this happens, you should recompile your code with @option{-mxgot}.
13927 It should then work with very large GOTs, although it will also be
13928 less efficient, since it will take three instructions to fetch the
13929 value of a global symbol.
13931 Note that some linkers can create multiple GOTs.  If you have such a
13932 linker, you should only need to use @option{-mxgot} when a single object
13933 file accesses more than 64k's worth of GOT entries.  Very few do.
13935 These options have no effect unless GCC is generating position
13936 independent code.
13938 @item -mgp32
13939 @opindex mgp32
13940 Assume that general-purpose registers are 32 bits wide.
13942 @item -mgp64
13943 @opindex mgp64
13944 Assume that general-purpose registers are 64 bits wide.
13946 @item -mfp32
13947 @opindex mfp32
13948 Assume that floating-point registers are 32 bits wide.
13950 @item -mfp64
13951 @opindex mfp64
13952 Assume that floating-point registers are 64 bits wide.
13954 @item -mhard-float
13955 @opindex mhard-float
13956 Use floating-point coprocessor instructions.
13958 @item -msoft-float
13959 @opindex msoft-float
13960 Do not use floating-point coprocessor instructions.  Implement
13961 floating-point calculations using library calls instead.
13963 @item -msingle-float
13964 @opindex msingle-float
13965 Assume that the floating-point coprocessor only supports single-precision
13966 operations.
13968 @item -mdouble-float
13969 @opindex mdouble-float
13970 Assume that the floating-point coprocessor supports double-precision
13971 operations.  This is the default.
13973 @item -mllsc
13974 @itemx -mno-llsc
13975 @opindex mllsc
13976 @opindex mno-llsc
13977 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
13978 implement atomic memory built-in functions.  When neither option is
13979 specified, GCC will use the instructions if the target architecture
13980 supports them.
13982 @option{-mllsc} is useful if the runtime environment can emulate the
13983 instructions and @option{-mno-llsc} can be useful when compiling for
13984 nonstandard ISAs.  You can make either option the default by
13985 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
13986 respectively.  @option{--with-llsc} is the default for some
13987 configurations; see the installation documentation for details.
13989 @item -mdsp
13990 @itemx -mno-dsp
13991 @opindex mdsp
13992 @opindex mno-dsp
13993 Use (do not use) revision 1 of the MIPS DSP ASE@.
13994 @xref{MIPS DSP Built-in Functions}.  This option defines the
13995 preprocessor macro @samp{__mips_dsp}.  It also defines
13996 @samp{__mips_dsp_rev} to 1.
13998 @item -mdspr2
13999 @itemx -mno-dspr2
14000 @opindex mdspr2
14001 @opindex mno-dspr2
14002 Use (do not use) revision 2 of the MIPS DSP ASE@.
14003 @xref{MIPS DSP Built-in Functions}.  This option defines the
14004 preprocessor macros @samp{__mips_dsp} and @samp{__mips_dspr2}.
14005 It also defines @samp{__mips_dsp_rev} to 2.
14007 @item -msmartmips
14008 @itemx -mno-smartmips
14009 @opindex msmartmips
14010 @opindex mno-smartmips
14011 Use (do not use) the MIPS SmartMIPS ASE.
14013 @item -mpaired-single
14014 @itemx -mno-paired-single
14015 @opindex mpaired-single
14016 @opindex mno-paired-single
14017 Use (do not use) paired-single floating-point instructions.
14018 @xref{MIPS Paired-Single Support}.  This option requires
14019 hardware floating-point support to be enabled.
14021 @item -mdmx
14022 @itemx -mno-mdmx
14023 @opindex mdmx
14024 @opindex mno-mdmx
14025 Use (do not use) MIPS Digital Media Extension instructions.
14026 This option can only be used when generating 64-bit code and requires
14027 hardware floating-point support to be enabled.
14029 @item -mips3d
14030 @itemx -mno-mips3d
14031 @opindex mips3d
14032 @opindex mno-mips3d
14033 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
14034 The option @option{-mips3d} implies @option{-mpaired-single}.
14036 @item -mmt
14037 @itemx -mno-mt
14038 @opindex mmt
14039 @opindex mno-mt
14040 Use (do not use) MT Multithreading instructions.
14042 @item -mlong64
14043 @opindex mlong64
14044 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
14045 an explanation of the default and the way that the pointer size is
14046 determined.
14048 @item -mlong32
14049 @opindex mlong32
14050 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
14052 The default size of @code{int}s, @code{long}s and pointers depends on
14053 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
14054 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
14055 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
14056 or the same size as integer registers, whichever is smaller.
14058 @item -msym32
14059 @itemx -mno-sym32
14060 @opindex msym32
14061 @opindex mno-sym32
14062 Assume (do not assume) that all symbols have 32-bit values, regardless
14063 of the selected ABI@.  This option is useful in combination with
14064 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
14065 to generate shorter and faster references to symbolic addresses.
14067 @item -G @var{num}
14068 @opindex G
14069 Put definitions of externally-visible data in a small data section
14070 if that data is no bigger than @var{num} bytes.  GCC can then access
14071 the data more efficiently; see @option{-mgpopt} for details.
14073 The default @option{-G} option depends on the configuration.
14075 @item -mlocal-sdata
14076 @itemx -mno-local-sdata
14077 @opindex mlocal-sdata
14078 @opindex mno-local-sdata
14079 Extend (do not extend) the @option{-G} behavior to local data too,
14080 such as to static variables in C@.  @option{-mlocal-sdata} is the
14081 default for all configurations.
14083 If the linker complains that an application is using too much small data,
14084 you might want to try rebuilding the less performance-critical parts with
14085 @option{-mno-local-sdata}.  You might also want to build large
14086 libraries with @option{-mno-local-sdata}, so that the libraries leave
14087 more room for the main program.
14089 @item -mextern-sdata
14090 @itemx -mno-extern-sdata
14091 @opindex mextern-sdata
14092 @opindex mno-extern-sdata
14093 Assume (do not assume) that externally-defined data will be in
14094 a small data section if that data is within the @option{-G} limit.
14095 @option{-mextern-sdata} is the default for all configurations.
14097 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
14098 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
14099 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
14100 is placed in a small data section.  If @var{Var} is defined by another
14101 module, you must either compile that module with a high-enough
14102 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
14103 definition.  If @var{Var} is common, you must link the application
14104 with a high-enough @option{-G} setting.
14106 The easiest way of satisfying these restrictions is to compile
14107 and link every module with the same @option{-G} option.  However,
14108 you may wish to build a library that supports several different
14109 small data limits.  You can do this by compiling the library with
14110 the highest supported @option{-G} setting and additionally using
14111 @option{-mno-extern-sdata} to stop the library from making assumptions
14112 about externally-defined data.
14114 @item -mgpopt
14115 @itemx -mno-gpopt
14116 @opindex mgpopt
14117 @opindex mno-gpopt
14118 Use (do not use) GP-relative accesses for symbols that are known to be
14119 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
14120 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
14121 configurations.
14123 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
14124 might not hold the value of @code{_gp}.  For example, if the code is
14125 part of a library that might be used in a boot monitor, programs that
14126 call boot monitor routines will pass an unknown value in @code{$gp}.
14127 (In such situations, the boot monitor itself would usually be compiled
14128 with @option{-G0}.)
14130 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
14131 @option{-mno-extern-sdata}.
14133 @item -membedded-data
14134 @itemx -mno-embedded-data
14135 @opindex membedded-data
14136 @opindex mno-embedded-data
14137 Allocate variables to the read-only data section first if possible, then
14138 next in the small data section if possible, otherwise in data.  This gives
14139 slightly slower code than the default, but reduces the amount of RAM required
14140 when executing, and thus may be preferred for some embedded systems.
14142 @item -muninit-const-in-rodata
14143 @itemx -mno-uninit-const-in-rodata
14144 @opindex muninit-const-in-rodata
14145 @opindex mno-uninit-const-in-rodata
14146 Put uninitialized @code{const} variables in the read-only data section.
14147 This option is only meaningful in conjunction with @option{-membedded-data}.
14149 @item -mcode-readable=@var{setting}
14150 @opindex mcode-readable
14151 Specify whether GCC may generate code that reads from executable sections.
14152 There are three possible settings:
14154 @table @gcctabopt
14155 @item -mcode-readable=yes
14156 Instructions may freely access executable sections.  This is the
14157 default setting.
14159 @item -mcode-readable=pcrel
14160 MIPS16 PC-relative load instructions can access executable sections,
14161 but other instructions must not do so.  This option is useful on 4KSc
14162 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
14163 It is also useful on processors that can be configured to have a dual
14164 instruction/data SRAM interface and that, like the M4K, automatically
14165 redirect PC-relative loads to the instruction RAM.
14167 @item -mcode-readable=no
14168 Instructions must not access executable sections.  This option can be
14169 useful on targets that are configured to have a dual instruction/data
14170 SRAM interface but that (unlike the M4K) do not automatically redirect
14171 PC-relative loads to the instruction RAM.
14172 @end table
14174 @item -msplit-addresses
14175 @itemx -mno-split-addresses
14176 @opindex msplit-addresses
14177 @opindex mno-split-addresses
14178 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
14179 relocation operators.  This option has been superseded by
14180 @option{-mexplicit-relocs} but is retained for backwards compatibility.
14182 @item -mexplicit-relocs
14183 @itemx -mno-explicit-relocs
14184 @opindex mexplicit-relocs
14185 @opindex mno-explicit-relocs
14186 Use (do not use) assembler relocation operators when dealing with symbolic
14187 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
14188 is to use assembler macros instead.
14190 @option{-mexplicit-relocs} is the default if GCC was configured
14191 to use an assembler that supports relocation operators.
14193 @item -mcheck-zero-division
14194 @itemx -mno-check-zero-division
14195 @opindex mcheck-zero-division
14196 @opindex mno-check-zero-division
14197 Trap (do not trap) on integer division by zero.
14199 The default is @option{-mcheck-zero-division}.
14201 @item -mdivide-traps
14202 @itemx -mdivide-breaks
14203 @opindex mdivide-traps
14204 @opindex mdivide-breaks
14205 MIPS systems check for division by zero by generating either a
14206 conditional trap or a break instruction.  Using traps results in
14207 smaller code, but is only supported on MIPS II and later.  Also, some
14208 versions of the Linux kernel have a bug that prevents trap from
14209 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
14210 allow conditional traps on architectures that support them and
14211 @option{-mdivide-breaks} to force the use of breaks.
14213 The default is usually @option{-mdivide-traps}, but this can be
14214 overridden at configure time using @option{--with-divide=breaks}.
14215 Divide-by-zero checks can be completely disabled using
14216 @option{-mno-check-zero-division}.
14218 @item -mmemcpy
14219 @itemx -mno-memcpy
14220 @opindex mmemcpy
14221 @opindex mno-memcpy
14222 Force (do not force) the use of @code{memcpy()} for non-trivial block
14223 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
14224 most constant-sized copies.
14226 @item -mlong-calls
14227 @itemx -mno-long-calls
14228 @opindex mlong-calls
14229 @opindex mno-long-calls
14230 Disable (do not disable) use of the @code{jal} instruction.  Calling
14231 functions using @code{jal} is more efficient but requires the caller
14232 and callee to be in the same 256 megabyte segment.
14234 This option has no effect on abicalls code.  The default is
14235 @option{-mno-long-calls}.
14237 @item -mmad
14238 @itemx -mno-mad
14239 @opindex mmad
14240 @opindex mno-mad
14241 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
14242 instructions, as provided by the R4650 ISA@.
14244 @item -mfused-madd
14245 @itemx -mno-fused-madd
14246 @opindex mfused-madd
14247 @opindex mno-fused-madd
14248 Enable (disable) use of the floating point multiply-accumulate
14249 instructions, when they are available.  The default is
14250 @option{-mfused-madd}.
14252 When multiply-accumulate instructions are used, the intermediate
14253 product is calculated to infinite precision and is not subject to
14254 the FCSR Flush to Zero bit.  This may be undesirable in some
14255 circumstances.
14257 @item -nocpp
14258 @opindex nocpp
14259 Tell the MIPS assembler to not run its preprocessor over user
14260 assembler files (with a @samp{.s} suffix) when assembling them.
14262 @item -mfix-r4000
14263 @itemx -mno-fix-r4000
14264 @opindex mfix-r4000
14265 @opindex mno-fix-r4000
14266 Work around certain R4000 CPU errata:
14267 @itemize @minus
14268 @item
14269 A double-word or a variable shift may give an incorrect result if executed
14270 immediately after starting an integer division.
14271 @item
14272 A double-word or a variable shift may give an incorrect result if executed
14273 while an integer multiplication is in progress.
14274 @item
14275 An integer division may give an incorrect result if started in a delay slot
14276 of a taken branch or a jump.
14277 @end itemize
14279 @item -mfix-r4400
14280 @itemx -mno-fix-r4400
14281 @opindex mfix-r4400
14282 @opindex mno-fix-r4400
14283 Work around certain R4400 CPU errata:
14284 @itemize @minus
14285 @item
14286 A double-word or a variable shift may give an incorrect result if executed
14287 immediately after starting an integer division.
14288 @end itemize
14290 @item -mfix-r10000
14291 @itemx -mno-fix-r10000
14292 @opindex mfix-r10000
14293 @opindex mno-fix-r10000
14294 Work around certain R10000 errata:
14295 @itemize @minus
14296 @item
14297 @code{ll}/@code{sc} sequences may not behave atomically on revisions
14298 prior to 3.0.  They may deadlock on revisions 2.6 and earlier.
14299 @end itemize
14301 This option can only be used if the target architecture supports
14302 branch-likely instructions.  @option{-mfix-r10000} is the default when
14303 @option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
14304 otherwise.
14306 @item -mfix-vr4120
14307 @itemx -mno-fix-vr4120
14308 @opindex mfix-vr4120
14309 Work around certain VR4120 errata:
14310 @itemize @minus
14311 @item
14312 @code{dmultu} does not always produce the correct result.
14313 @item
14314 @code{div} and @code{ddiv} do not always produce the correct result if one
14315 of the operands is negative.
14316 @end itemize
14317 The workarounds for the division errata rely on special functions in
14318 @file{libgcc.a}.  At present, these functions are only provided by
14319 the @code{mips64vr*-elf} configurations.
14321 Other VR4120 errata require a nop to be inserted between certain pairs of
14322 instructions.  These errata are handled by the assembler, not by GCC itself.
14324 @item -mfix-vr4130
14325 @opindex mfix-vr4130
14326 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
14327 workarounds are implemented by the assembler rather than by GCC,
14328 although GCC will avoid using @code{mflo} and @code{mfhi} if the
14329 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
14330 instructions are available instead.
14332 @item -mfix-sb1
14333 @itemx -mno-fix-sb1
14334 @opindex mfix-sb1
14335 Work around certain SB-1 CPU core errata.
14336 (This flag currently works around the SB-1 revision 2
14337 ``F1'' and ``F2'' floating point errata.)
14339 @item -mr10k-cache-barrier=@var{setting}
14340 @opindex mr10k-cache-barrier
14341 Specify whether GCC should insert cache barriers to avoid the
14342 side-effects of speculation on R10K processors.
14344 In common with many processors, the R10K tries to predict the outcome
14345 of a conditional branch and speculatively executes instructions from
14346 the ``taken'' branch.  It later aborts these instructions if the
14347 predicted outcome was wrong.  However, on the R10K, even aborted
14348 instructions can have side effects.
14350 This problem only affects kernel stores and, depending on the system,
14351 kernel loads.  As an example, a speculatively-executed store may load
14352 the target memory into cache and mark the cache line as dirty, even if
14353 the store itself is later aborted.  If a DMA operation writes to the
14354 same area of memory before the ``dirty'' line is flushed, the cached
14355 data will overwrite the DMA-ed data.  See the R10K processor manual
14356 for a full description, including other potential problems.
14358 One workaround is to insert cache barrier instructions before every memory
14359 access that might be speculatively executed and that might have side
14360 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
14361 controls GCC's implementation of this workaround.  It assumes that
14362 aborted accesses to any byte in the following regions will not have
14363 side effects:
14365 @enumerate
14366 @item
14367 the memory occupied by the current function's stack frame;
14369 @item
14370 the memory occupied by an incoming stack argument;
14372 @item
14373 the memory occupied by an object with a link-time-constant address.
14374 @end enumerate
14376 It is the kernel's responsibility to ensure that speculative
14377 accesses to these regions are indeed safe.
14379 If the input program contains a function declaration such as:
14381 @smallexample
14382 void foo (void);
14383 @end smallexample
14385 then the implementation of @code{foo} must allow @code{j foo} and
14386 @code{jal foo} to be executed speculatively.  GCC honors this
14387 restriction for functions it compiles itself.  It expects non-GCC
14388 functions (such as hand-written assembly code) to do the same.
14390 The option has three forms:
14392 @table @gcctabopt
14393 @item -mr10k-cache-barrier=load-store
14394 Insert a cache barrier before a load or store that might be
14395 speculatively executed and that might have side effects even
14396 if aborted.
14398 @item -mr10k-cache-barrier=store
14399 Insert a cache barrier before a store that might be speculatively
14400 executed and that might have side effects even if aborted.
14402 @item -mr10k-cache-barrier=none
14403 Disable the insertion of cache barriers.  This is the default setting.
14404 @end table
14406 @item -mflush-func=@var{func}
14407 @itemx -mno-flush-func
14408 @opindex mflush-func
14409 Specifies the function to call to flush the I and D caches, or to not
14410 call any such function.  If called, the function must take the same
14411 arguments as the common @code{_flush_func()}, that is, the address of the
14412 memory range for which the cache is being flushed, the size of the
14413 memory range, and the number 3 (to flush both caches).  The default
14414 depends on the target GCC was configured for, but commonly is either
14415 @samp{_flush_func} or @samp{__cpu_flush}.
14417 @item mbranch-cost=@var{num}
14418 @opindex mbranch-cost
14419 Set the cost of branches to roughly @var{num} ``simple'' instructions.
14420 This cost is only a heuristic and is not guaranteed to produce
14421 consistent results across releases.  A zero cost redundantly selects
14422 the default, which is based on the @option{-mtune} setting.
14424 @item -mbranch-likely
14425 @itemx -mno-branch-likely
14426 @opindex mbranch-likely
14427 @opindex mno-branch-likely
14428 Enable or disable use of Branch Likely instructions, regardless of the
14429 default for the selected architecture.  By default, Branch Likely
14430 instructions may be generated if they are supported by the selected
14431 architecture.  An exception is for the MIPS32 and MIPS64 architectures
14432 and processors which implement those architectures; for those, Branch
14433 Likely instructions will not be generated by default because the MIPS32
14434 and MIPS64 architectures specifically deprecate their use.
14436 @item -mfp-exceptions
14437 @itemx -mno-fp-exceptions
14438 @opindex mfp-exceptions
14439 Specifies whether FP exceptions are enabled.  This affects how we schedule
14440 FP instructions for some processors.  The default is that FP exceptions are
14441 enabled.
14443 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
14444 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
14445 FP pipe.
14447 @item -mvr4130-align
14448 @itemx -mno-vr4130-align
14449 @opindex mvr4130-align
14450 The VR4130 pipeline is two-way superscalar, but can only issue two
14451 instructions together if the first one is 8-byte aligned.  When this
14452 option is enabled, GCC will align pairs of instructions that it
14453 thinks should execute in parallel.
14455 This option only has an effect when optimizing for the VR4130.
14456 It normally makes code faster, but at the expense of making it bigger.
14457 It is enabled by default at optimization level @option{-O3}.
14459 @item -msynci
14460 @itemx -mno-synci
14461 @opindex msynci
14462 Enable (disable) generation of @code{synci} instructions on
14463 architectures that support it.  The @code{synci} instructions (if
14464 enabled) will be generated when @code{__builtin___clear_cache()} is
14465 compiled.
14467 This option defaults to @code{-mno-synci}, but the default can be
14468 overridden by configuring with @code{--with-synci}.
14470 When compiling code for single processor systems, it is generally safe
14471 to use @code{synci}.  However, on many multi-core (SMP) systems, it
14472 will not invalidate the instruction caches on all cores and may lead
14473 to undefined behavior.
14475 @item -mrelax-pic-calls
14476 @itemx -mno-relax-pic-calls
14477 @opindex mrelax-pic-calls
14478 Try to turn PIC calls that are normally dispatched via register
14479 @code{$25} into direct calls.  This is only possible if the linker can
14480 resolve the destination at link-time and if the destination is within
14481 range for a direct call.
14483 @option{-mrelax-pic-calls} is the default if GCC was configured to use
14484 an assembler and a linker that supports the @code{.reloc} assembly
14485 directive and @code{-mexplicit-relocs} is in effect.  With
14486 @code{-mno-explicit-relocs}, this optimization can be performed by the
14487 assembler and the linker alone without help from the compiler.
14489 @item -mmcount-ra-address
14490 @itemx -mno-mcount-ra-address
14491 @opindex mmcount-ra-address
14492 @opindex mno-mcount-ra-address
14493 Emit (do not emit) code that allows @code{_mcount} to modify the
14494 calling function's return address.  When enabled, this option extends
14495 the usual @code{_mcount} interface with a new @var{ra-address}
14496 parameter, which has type @code{intptr_t *} and is passed in register
14497 @code{$12}.  @code{_mcount} can then modify the return address by
14498 doing both of the following:
14499 @itemize
14500 @item
14501 Returning the new address in register @code{$31}.
14502 @item
14503 Storing the new address in @code{*@var{ra-address}},
14504 if @var{ra-address} is nonnull.
14505 @end itemize
14507 The default is @option{-mno-mcount-ra-address}.
14509 @end table
14511 @node MMIX Options
14512 @subsection MMIX Options
14513 @cindex MMIX Options
14515 These options are defined for the MMIX:
14517 @table @gcctabopt
14518 @item -mlibfuncs
14519 @itemx -mno-libfuncs
14520 @opindex mlibfuncs
14521 @opindex mno-libfuncs
14522 Specify that intrinsic library functions are being compiled, passing all
14523 values in registers, no matter the size.
14525 @item -mepsilon
14526 @itemx -mno-epsilon
14527 @opindex mepsilon
14528 @opindex mno-epsilon
14529 Generate floating-point comparison instructions that compare with respect
14530 to the @code{rE} epsilon register.
14532 @item -mabi=mmixware
14533 @itemx -mabi=gnu
14534 @opindex mabi=mmixware
14535 @opindex mabi=gnu
14536 Generate code that passes function parameters and return values that (in
14537 the called function) are seen as registers @code{$0} and up, as opposed to
14538 the GNU ABI which uses global registers @code{$231} and up.
14540 @item -mzero-extend
14541 @itemx -mno-zero-extend
14542 @opindex mzero-extend
14543 @opindex mno-zero-extend
14544 When reading data from memory in sizes shorter than 64 bits, use (do not
14545 use) zero-extending load instructions by default, rather than
14546 sign-extending ones.
14548 @item -mknuthdiv
14549 @itemx -mno-knuthdiv
14550 @opindex mknuthdiv
14551 @opindex mno-knuthdiv
14552 Make the result of a division yielding a remainder have the same sign as
14553 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
14554 remainder follows the sign of the dividend.  Both methods are
14555 arithmetically valid, the latter being almost exclusively used.
14557 @item -mtoplevel-symbols
14558 @itemx -mno-toplevel-symbols
14559 @opindex mtoplevel-symbols
14560 @opindex mno-toplevel-symbols
14561 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
14562 code can be used with the @code{PREFIX} assembly directive.
14564 @item -melf
14565 @opindex melf
14566 Generate an executable in the ELF format, rather than the default
14567 @samp{mmo} format used by the @command{mmix} simulator.
14569 @item -mbranch-predict
14570 @itemx -mno-branch-predict
14571 @opindex mbranch-predict
14572 @opindex mno-branch-predict
14573 Use (do not use) the probable-branch instructions, when static branch
14574 prediction indicates a probable branch.
14576 @item -mbase-addresses
14577 @itemx -mno-base-addresses
14578 @opindex mbase-addresses
14579 @opindex mno-base-addresses
14580 Generate (do not generate) code that uses @emph{base addresses}.  Using a
14581 base address automatically generates a request (handled by the assembler
14582 and the linker) for a constant to be set up in a global register.  The
14583 register is used for one or more base address requests within the range 0
14584 to 255 from the value held in the register.  The generally leads to short
14585 and fast code, but the number of different data items that can be
14586 addressed is limited.  This means that a program that uses lots of static
14587 data may require @option{-mno-base-addresses}.
14589 @item -msingle-exit
14590 @itemx -mno-single-exit
14591 @opindex msingle-exit
14592 @opindex mno-single-exit
14593 Force (do not force) generated code to have a single exit point in each
14594 function.
14595 @end table
14597 @node MN10300 Options
14598 @subsection MN10300 Options
14599 @cindex MN10300 options
14601 These @option{-m} options are defined for Matsushita MN10300 architectures:
14603 @table @gcctabopt
14604 @item -mmult-bug
14605 @opindex mmult-bug
14606 Generate code to avoid bugs in the multiply instructions for the MN10300
14607 processors.  This is the default.
14609 @item -mno-mult-bug
14610 @opindex mno-mult-bug
14611 Do not generate code to avoid bugs in the multiply instructions for the
14612 MN10300 processors.
14614 @item -mam33
14615 @opindex mam33
14616 Generate code which uses features specific to the AM33 processor.
14618 @item -mno-am33
14619 @opindex mno-am33
14620 Do not generate code which uses features specific to the AM33 processor.  This
14621 is the default.
14623 @item -mreturn-pointer-on-d0
14624 @opindex mreturn-pointer-on-d0
14625 When generating a function which returns a pointer, return the pointer
14626 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
14627 only in a0, and attempts to call such functions without a prototype
14628 would result in errors.  Note that this option is on by default; use
14629 @option{-mno-return-pointer-on-d0} to disable it.
14631 @item -mno-crt0
14632 @opindex mno-crt0
14633 Do not link in the C run-time initialization object file.
14635 @item -mrelax
14636 @opindex mrelax
14637 Indicate to the linker that it should perform a relaxation optimization pass
14638 to shorten branches, calls and absolute memory addresses.  This option only
14639 has an effect when used on the command line for the final link step.
14641 This option makes symbolic debugging impossible.
14642 @end table
14644 @node PDP-11 Options
14645 @subsection PDP-11 Options
14646 @cindex PDP-11 Options
14648 These options are defined for the PDP-11:
14650 @table @gcctabopt
14651 @item -mfpu
14652 @opindex mfpu
14653 Use hardware FPP floating point.  This is the default.  (FIS floating
14654 point on the PDP-11/40 is not supported.)
14656 @item -msoft-float
14657 @opindex msoft-float
14658 Do not use hardware floating point.
14660 @item -mac0
14661 @opindex mac0
14662 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
14664 @item -mno-ac0
14665 @opindex mno-ac0
14666 Return floating-point results in memory.  This is the default.
14668 @item -m40
14669 @opindex m40
14670 Generate code for a PDP-11/40.
14672 @item -m45
14673 @opindex m45
14674 Generate code for a PDP-11/45.  This is the default.
14676 @item -m10
14677 @opindex m10
14678 Generate code for a PDP-11/10.
14680 @item -mbcopy-builtin
14681 @opindex mbcopy-builtin
14682 Use inline @code{movmemhi} patterns for copying memory.  This is the
14683 default.
14685 @item -mbcopy
14686 @opindex mbcopy
14687 Do not use inline @code{movmemhi} patterns for copying memory.
14689 @item -mint16
14690 @itemx -mno-int32
14691 @opindex mint16
14692 @opindex mno-int32
14693 Use 16-bit @code{int}.  This is the default.
14695 @item -mint32
14696 @itemx -mno-int16
14697 @opindex mint32
14698 @opindex mno-int16
14699 Use 32-bit @code{int}.
14701 @item -mfloat64
14702 @itemx -mno-float32
14703 @opindex mfloat64
14704 @opindex mno-float32
14705 Use 64-bit @code{float}.  This is the default.
14707 @item -mfloat32
14708 @itemx -mno-float64
14709 @opindex mfloat32
14710 @opindex mno-float64
14711 Use 32-bit @code{float}.
14713 @item -mabshi
14714 @opindex mabshi
14715 Use @code{abshi2} pattern.  This is the default.
14717 @item -mno-abshi
14718 @opindex mno-abshi
14719 Do not use @code{abshi2} pattern.
14721 @item -mbranch-expensive
14722 @opindex mbranch-expensive
14723 Pretend that branches are expensive.  This is for experimenting with
14724 code generation only.
14726 @item -mbranch-cheap
14727 @opindex mbranch-cheap
14728 Do not pretend that branches are expensive.  This is the default.
14730 @item -msplit
14731 @opindex msplit
14732 Generate code for a system with split I&D@.
14734 @item -mno-split
14735 @opindex mno-split
14736 Generate code for a system without split I&D@.  This is the default.
14738 @item -munix-asm
14739 @opindex munix-asm
14740 Use Unix assembler syntax.  This is the default when configured for
14741 @samp{pdp11-*-bsd}.
14743 @item -mdec-asm
14744 @opindex mdec-asm
14745 Use DEC assembler syntax.  This is the default when configured for any
14746 PDP-11 target other than @samp{pdp11-*-bsd}.
14747 @end table
14749 @node picoChip Options
14750 @subsection picoChip Options
14751 @cindex picoChip options
14753 These @samp{-m} options are defined for picoChip implementations:
14755 @table @gcctabopt
14757 @item -mae=@var{ae_type}
14758 @opindex mcpu
14759 Set the instruction set, register set, and instruction scheduling
14760 parameters for array element type @var{ae_type}.  Supported values
14761 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
14763 @option{-mae=ANY} selects a completely generic AE type.  Code
14764 generated with this option will run on any of the other AE types.  The
14765 code will not be as efficient as it would be if compiled for a specific
14766 AE type, and some types of operation (e.g., multiplication) will not
14767 work properly on all types of AE.
14769 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
14770 for compiled code, and is the default.
14772 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
14773 option may suffer from poor performance of byte (char) manipulation,
14774 since the DSP AE does not provide hardware support for byte load/stores.
14776 @item -msymbol-as-address
14777 Enable the compiler to directly use a symbol name as an address in a
14778 load/store instruction, without first loading it into a
14779 register.  Typically, the use of this option will generate larger
14780 programs, which run faster than when the option isn't used.  However, the
14781 results vary from program to program, so it is left as a user option,
14782 rather than being permanently enabled.
14784 @item -mno-inefficient-warnings
14785 Disables warnings about the generation of inefficient code.  These
14786 warnings can be generated, for example, when compiling code which
14787 performs byte-level memory operations on the MAC AE type.  The MAC AE has
14788 no hardware support for byte-level memory operations, so all byte
14789 load/stores must be synthesized from word load/store operations.  This is
14790 inefficient and a warning will be generated indicating to the programmer
14791 that they should rewrite the code to avoid byte operations, or to target
14792 an AE type which has the necessary hardware support.  This option enables
14793 the warning to be turned off.
14795 @end table
14797 @node PowerPC Options
14798 @subsection PowerPC Options
14799 @cindex PowerPC options
14801 These are listed under @xref{RS/6000 and PowerPC Options}.
14803 @node RS/6000 and PowerPC Options
14804 @subsection IBM RS/6000 and PowerPC Options
14805 @cindex RS/6000 and PowerPC Options
14806 @cindex IBM RS/6000 and PowerPC Options
14808 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
14809 @table @gcctabopt
14810 @item -mpower
14811 @itemx -mno-power
14812 @itemx -mpower2
14813 @itemx -mno-power2
14814 @itemx -mpowerpc
14815 @itemx -mno-powerpc
14816 @itemx -mpowerpc-gpopt
14817 @itemx -mno-powerpc-gpopt
14818 @itemx -mpowerpc-gfxopt
14819 @itemx -mno-powerpc-gfxopt
14820 @itemx -mpowerpc64
14821 @itemx -mno-powerpc64
14822 @itemx -mmfcrf
14823 @itemx -mno-mfcrf
14824 @itemx -mpopcntb
14825 @itemx -mno-popcntb
14826 @itemx -mpopcntd
14827 @itemx -mno-popcntd
14828 @itemx -mfprnd
14829 @itemx -mno-fprnd
14830 @itemx -mcmpb
14831 @itemx -mno-cmpb
14832 @itemx -mmfpgpr
14833 @itemx -mno-mfpgpr
14834 @itemx -mhard-dfp
14835 @itemx -mno-hard-dfp
14836 @opindex mpower
14837 @opindex mno-power
14838 @opindex mpower2
14839 @opindex mno-power2
14840 @opindex mpowerpc
14841 @opindex mno-powerpc
14842 @opindex mpowerpc-gpopt
14843 @opindex mno-powerpc-gpopt
14844 @opindex mpowerpc-gfxopt
14845 @opindex mno-powerpc-gfxopt
14846 @opindex mpowerpc64
14847 @opindex mno-powerpc64
14848 @opindex mmfcrf
14849 @opindex mno-mfcrf
14850 @opindex mpopcntb
14851 @opindex mno-popcntb
14852 @opindex mpopcntd
14853 @opindex mno-popcntd
14854 @opindex mfprnd
14855 @opindex mno-fprnd
14856 @opindex mcmpb
14857 @opindex mno-cmpb
14858 @opindex mmfpgpr
14859 @opindex mno-mfpgpr
14860 @opindex mhard-dfp
14861 @opindex mno-hard-dfp
14862 GCC supports two related instruction set architectures for the
14863 RS/6000 and PowerPC@.  The @dfn{POWER} instruction set are those
14864 instructions supported by the @samp{rios} chip set used in the original
14865 RS/6000 systems and the @dfn{PowerPC} instruction set is the
14866 architecture of the Freescale MPC5xx, MPC6xx, MPC8xx microprocessors, and
14867 the IBM 4xx, 6xx, and follow-on microprocessors.
14869 Neither architecture is a subset of the other.  However there is a
14870 large common subset of instructions supported by both.  An MQ
14871 register is included in processors supporting the POWER architecture.
14873 You use these options to specify which instructions are available on the
14874 processor you are using.  The default value of these options is
14875 determined when configuring GCC@.  Specifying the
14876 @option{-mcpu=@var{cpu_type}} overrides the specification of these
14877 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
14878 rather than the options listed above.
14880 The @option{-mpower} option allows GCC to generate instructions that
14881 are found only in the POWER architecture and to use the MQ register.
14882 Specifying @option{-mpower2} implies @option{-power} and also allows GCC
14883 to generate instructions that are present in the POWER2 architecture but
14884 not the original POWER architecture.
14886 The @option{-mpowerpc} option allows GCC to generate instructions that
14887 are found only in the 32-bit subset of the PowerPC architecture.
14888 Specifying @option{-mpowerpc-gpopt} implies @option{-mpowerpc} and also allows
14889 GCC to use the optional PowerPC architecture instructions in the
14890 General Purpose group, including floating-point square root.  Specifying
14891 @option{-mpowerpc-gfxopt} implies @option{-mpowerpc} and also allows GCC to
14892 use the optional PowerPC architecture instructions in the Graphics
14893 group, including floating-point select.
14895 The @option{-mmfcrf} option allows GCC to generate the move from
14896 condition register field instruction implemented on the POWER4
14897 processor and other processors that support the PowerPC V2.01
14898 architecture.
14899 The @option{-mpopcntb} option allows GCC to generate the popcount and
14900 double precision FP reciprocal estimate instruction implemented on the
14901 POWER5 processor and other processors that support the PowerPC V2.02
14902 architecture.
14903 The @option{-mpopcntd} option allows GCC to generate the popcount
14904 instruction implemented on the POWER7 processor and other processors
14905 that support the PowerPC V2.06 architecture.
14906 The @option{-mfprnd} option allows GCC to generate the FP round to
14907 integer instructions implemented on the POWER5+ processor and other
14908 processors that support the PowerPC V2.03 architecture.
14909 The @option{-mcmpb} option allows GCC to generate the compare bytes
14910 instruction implemented on the POWER6 processor and other processors
14911 that support the PowerPC V2.05 architecture.
14912 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
14913 general purpose register instructions implemented on the POWER6X
14914 processor and other processors that support the extended PowerPC V2.05
14915 architecture.
14916 The @option{-mhard-dfp} option allows GCC to generate the decimal floating
14917 point instructions implemented on some POWER processors.
14919 The @option{-mpowerpc64} option allows GCC to generate the additional
14920 64-bit instructions that are found in the full PowerPC64 architecture
14921 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
14922 @option{-mno-powerpc64}.
14924 If you specify both @option{-mno-power} and @option{-mno-powerpc}, GCC
14925 will use only the instructions in the common subset of both
14926 architectures plus some special AIX common-mode calls, and will not use
14927 the MQ register.  Specifying both @option{-mpower} and @option{-mpowerpc}
14928 permits GCC to use any instruction from either architecture and to
14929 allow use of the MQ register; specify this for the Motorola MPC601.
14931 @item -mnew-mnemonics
14932 @itemx -mold-mnemonics
14933 @opindex mnew-mnemonics
14934 @opindex mold-mnemonics
14935 Select which mnemonics to use in the generated assembler code.  With
14936 @option{-mnew-mnemonics}, GCC uses the assembler mnemonics defined for
14937 the PowerPC architecture.  With @option{-mold-mnemonics} it uses the
14938 assembler mnemonics defined for the POWER architecture.  Instructions
14939 defined in only one architecture have only one mnemonic; GCC uses that
14940 mnemonic irrespective of which of these options is specified.
14942 GCC defaults to the mnemonics appropriate for the architecture in
14943 use.  Specifying @option{-mcpu=@var{cpu_type}} sometimes overrides the
14944 value of these option.  Unless you are building a cross-compiler, you
14945 should normally not specify either @option{-mnew-mnemonics} or
14946 @option{-mold-mnemonics}, but should instead accept the default.
14948 @item -mcpu=@var{cpu_type}
14949 @opindex mcpu
14950 Set architecture type, register usage, choice of mnemonics, and
14951 instruction scheduling parameters for machine type @var{cpu_type}.
14952 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
14953 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
14954 @samp{476}, @samp{476fp}, @samp{505}, @samp{601}, @samp{602}, @samp{603},
14955 @samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{630}, @samp{740},
14956 @samp{7400}, @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
14957 @samp{860}, @samp{970}, @samp{8540}, @samp{a2}, @samp{e300c2},
14958 @samp{e300c3}, @samp{e500mc}, @samp{e500mc64}, @samp{ec603e}, @samp{G3},
14959 @samp{G4}, @samp{G5}, @samp{titan}, @samp{power}, @samp{power2}, @samp{power3},
14960 @samp{power4}, @samp{power5}, @samp{power5+}, @samp{power6}, @samp{power6x},
14961 @samp{power7}, @samp{common}, @samp{powerpc}, @samp{powerpc64}, @samp{rios},
14962 @samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64}.
14964 @option{-mcpu=common} selects a completely generic processor.  Code
14965 generated under this option will run on any POWER or PowerPC processor.
14966 GCC will use only the instructions in the common subset of both
14967 architectures, and will not use the MQ register.  GCC assumes a generic
14968 processor model for scheduling purposes.
14970 @option{-mcpu=power}, @option{-mcpu=power2}, @option{-mcpu=powerpc}, and
14971 @option{-mcpu=powerpc64} specify generic POWER, POWER2, pure 32-bit
14972 PowerPC (i.e., not MPC601), and 64-bit PowerPC architecture machine
14973 types, with an appropriate, generic processor model assumed for
14974 scheduling purposes.
14976 The other options specify a specific processor.  Code generated under
14977 those options will run best on that processor, and may not run at all on
14978 others.
14980 The @option{-mcpu} options automatically enable or disable the
14981 following options:
14983 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
14984 -mnew-mnemonics  -mpopcntb -mpopcntd  -mpower  -mpower2  -mpowerpc64 @gol
14985 -mpowerpc-gpopt  -mpowerpc-gfxopt  -msingle-float -mdouble-float @gol
14986 -msimple-fpu -mstring  -mmulhw  -mdlmzb  -mmfpgpr -mvsx}
14988 The particular options set for any particular CPU will vary between
14989 compiler versions, depending on what setting seems to produce optimal
14990 code for that CPU; it doesn't necessarily reflect the actual hardware's
14991 capabilities.  If you wish to set an individual option to a particular
14992 value, you may specify it after the @option{-mcpu} option, like
14993 @samp{-mcpu=970 -mno-altivec}.
14995 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
14996 not enabled or disabled by the @option{-mcpu} option at present because
14997 AIX does not have full support for these options.  You may still
14998 enable or disable them individually if you're sure it'll work in your
14999 environment.
15001 @item -mtune=@var{cpu_type}
15002 @opindex mtune
15003 Set the instruction scheduling parameters for machine type
15004 @var{cpu_type}, but do not set the architecture type, register usage, or
15005 choice of mnemonics, as @option{-mcpu=@var{cpu_type}} would.  The same
15006 values for @var{cpu_type} are used for @option{-mtune} as for
15007 @option{-mcpu}.  If both are specified, the code generated will use the
15008 architecture, registers, and mnemonics set by @option{-mcpu}, but the
15009 scheduling parameters set by @option{-mtune}.
15011 @item -mcmodel=small
15012 @opindex mcmodel=small
15013 Generate PowerPC64 code for the small model: The TOC is limited to
15014 64k.
15016 @item -mcmodel=large
15017 @opindex mcmodel=large
15018 Generate PowerPC64 code for the large model: The TOC may be up to 4G
15019 in size.  Other data and code is only limited by the 64-bit address
15020 space.
15022 @item -maltivec
15023 @itemx -mno-altivec
15024 @opindex maltivec
15025 @opindex mno-altivec
15026 Generate code that uses (does not use) AltiVec instructions, and also
15027 enable the use of built-in functions that allow more direct access to
15028 the AltiVec instruction set.  You may also need to set
15029 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
15030 enhancements.
15032 @item -mvrsave
15033 @itemx -mno-vrsave
15034 @opindex mvrsave
15035 @opindex mno-vrsave
15036 Generate VRSAVE instructions when generating AltiVec code.
15038 @item -mgen-cell-microcode
15039 @opindex mgen-cell-microcode
15040 Generate Cell microcode instructions
15042 @item -mwarn-cell-microcode
15043 @opindex mwarn-cell-microcode
15044 Warning when a Cell microcode instruction is going to emitted.  An example
15045 of a Cell microcode instruction is a variable shift.
15047 @item -msecure-plt
15048 @opindex msecure-plt
15049 Generate code that allows ld and ld.so to build executables and shared
15050 libraries with non-exec .plt and .got sections.  This is a PowerPC
15051 32-bit SYSV ABI option.
15053 @item -mbss-plt
15054 @opindex mbss-plt
15055 Generate code that uses a BSS .plt section that ld.so fills in, and
15056 requires .plt and .got sections that are both writable and executable.
15057 This is a PowerPC 32-bit SYSV ABI option.
15059 @item -misel
15060 @itemx -mno-isel
15061 @opindex misel
15062 @opindex mno-isel
15063 This switch enables or disables the generation of ISEL instructions.
15065 @item -misel=@var{yes/no}
15066 This switch has been deprecated.  Use @option{-misel} and
15067 @option{-mno-isel} instead.
15069 @item -mspe
15070 @itemx -mno-spe
15071 @opindex mspe
15072 @opindex mno-spe
15073 This switch enables or disables the generation of SPE simd
15074 instructions.
15076 @item -mpaired
15077 @itemx -mno-paired
15078 @opindex mpaired
15079 @opindex mno-paired
15080 This switch enables or disables the generation of PAIRED simd
15081 instructions.
15083 @item -mspe=@var{yes/no}
15084 This option has been deprecated.  Use @option{-mspe} and
15085 @option{-mno-spe} instead.
15087 @item -mvsx
15088 @itemx -mno-vsx
15089 @opindex mvsx
15090 @opindex mno-vsx
15091 Generate code that uses (does not use) vector/scalar (VSX)
15092 instructions, and also enable the use of built-in functions that allow
15093 more direct access to the VSX instruction set.
15095 @item -mfloat-gprs=@var{yes/single/double/no}
15096 @itemx -mfloat-gprs
15097 @opindex mfloat-gprs
15098 This switch enables or disables the generation of floating point
15099 operations on the general purpose registers for architectures that
15100 support it.
15102 The argument @var{yes} or @var{single} enables the use of
15103 single-precision floating point operations.
15105 The argument @var{double} enables the use of single and
15106 double-precision floating point operations.
15108 The argument @var{no} disables floating point operations on the
15109 general purpose registers.
15111 This option is currently only available on the MPC854x.
15113 @item -m32
15114 @itemx -m64
15115 @opindex m32
15116 @opindex m64
15117 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
15118 targets (including GNU/Linux).  The 32-bit environment sets int, long
15119 and pointer to 32 bits and generates code that runs on any PowerPC
15120 variant.  The 64-bit environment sets int to 32 bits and long and
15121 pointer to 64 bits, and generates code for PowerPC64, as for
15122 @option{-mpowerpc64}.
15124 @item -mfull-toc
15125 @itemx -mno-fp-in-toc
15126 @itemx -mno-sum-in-toc
15127 @itemx -mminimal-toc
15128 @opindex mfull-toc
15129 @opindex mno-fp-in-toc
15130 @opindex mno-sum-in-toc
15131 @opindex mminimal-toc
15132 Modify generation of the TOC (Table Of Contents), which is created for
15133 every executable file.  The @option{-mfull-toc} option is selected by
15134 default.  In that case, GCC will allocate at least one TOC entry for
15135 each unique non-automatic variable reference in your program.  GCC
15136 will also place floating-point constants in the TOC@.  However, only
15137 16,384 entries are available in the TOC@.
15139 If you receive a linker error message that saying you have overflowed
15140 the available TOC space, you can reduce the amount of TOC space used
15141 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
15142 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
15143 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
15144 generate code to calculate the sum of an address and a constant at
15145 run-time instead of putting that sum into the TOC@.  You may specify one
15146 or both of these options.  Each causes GCC to produce very slightly
15147 slower and larger code at the expense of conserving TOC space.
15149 If you still run out of space in the TOC even when you specify both of
15150 these options, specify @option{-mminimal-toc} instead.  This option causes
15151 GCC to make only one TOC entry for every file.  When you specify this
15152 option, GCC will produce code that is slower and larger but which
15153 uses extremely little TOC space.  You may wish to use this option
15154 only on files that contain less frequently executed code.
15156 @item -maix64
15157 @itemx -maix32
15158 @opindex maix64
15159 @opindex maix32
15160 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
15161 @code{long} type, and the infrastructure needed to support them.
15162 Specifying @option{-maix64} implies @option{-mpowerpc64} and
15163 @option{-mpowerpc}, while @option{-maix32} disables the 64-bit ABI and
15164 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
15166 @item -mxl-compat
15167 @itemx -mno-xl-compat
15168 @opindex mxl-compat
15169 @opindex mno-xl-compat
15170 Produce code that conforms more closely to IBM XL compiler semantics
15171 when using AIX-compatible ABI@.  Pass floating-point arguments to
15172 prototyped functions beyond the register save area (RSA) on the stack
15173 in addition to argument FPRs.  Do not assume that most significant
15174 double in 128-bit long double value is properly rounded when comparing
15175 values and converting to double.  Use XL symbol names for long double
15176 support routines.
15178 The AIX calling convention was extended but not initially documented to
15179 handle an obscure K&R C case of calling a function that takes the
15180 address of its arguments with fewer arguments than declared.  IBM XL
15181 compilers access floating point arguments which do not fit in the
15182 RSA from the stack when a subroutine is compiled without
15183 optimization.  Because always storing floating-point arguments on the
15184 stack is inefficient and rarely needed, this option is not enabled by
15185 default and only is necessary when calling subroutines compiled by IBM
15186 XL compilers without optimization.
15188 @item -mpe
15189 @opindex mpe
15190 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
15191 application written to use message passing with special startup code to
15192 enable the application to run.  The system must have PE installed in the
15193 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
15194 must be overridden with the @option{-specs=} option to specify the
15195 appropriate directory location.  The Parallel Environment does not
15196 support threads, so the @option{-mpe} option and the @option{-pthread}
15197 option are incompatible.
15199 @item -malign-natural
15200 @itemx -malign-power
15201 @opindex malign-natural
15202 @opindex malign-power
15203 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
15204 @option{-malign-natural} overrides the ABI-defined alignment of larger
15205 types, such as floating-point doubles, on their natural size-based boundary.
15206 The option @option{-malign-power} instructs GCC to follow the ABI-specified
15207 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
15209 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
15210 is not supported.
15212 @item -msoft-float
15213 @itemx -mhard-float
15214 @opindex msoft-float
15215 @opindex mhard-float
15216 Generate code that does not use (uses) the floating-point register set.
15217 Software floating point emulation is provided if you use the
15218 @option{-msoft-float} option, and pass the option to GCC when linking.
15220 @item -msingle-float
15221 @itemx -mdouble-float
15222 @opindex msingle-float
15223 @opindex mdouble-float
15224 Generate code for single or double-precision floating point operations.
15225 @option{-mdouble-float} implies @option{-msingle-float}.
15227 @item -msimple-fpu
15228 @opindex msimple-fpu
15229 Do not generate sqrt and div instructions for hardware floating point unit.
15231 @item -mfpu
15232 @opindex mfpu
15233 Specify type of floating point unit.  Valid values are @var{sp_lite}
15234 (equivalent to -msingle-float -msimple-fpu), @var{dp_lite} (equivalent
15235 to -mdouble-float -msimple-fpu), @var{sp_full} (equivalent to -msingle-float),
15236 and @var{dp_full} (equivalent to -mdouble-float).
15238 @item -mxilinx-fpu
15239 @opindex mxilinx-fpu
15240 Perform optimizations for floating point unit on Xilinx PPC 405/440.
15242 @item -mmultiple
15243 @itemx -mno-multiple
15244 @opindex mmultiple
15245 @opindex mno-multiple
15246 Generate code that uses (does not use) the load multiple word
15247 instructions and the store multiple word instructions.  These
15248 instructions are generated by default on POWER systems, and not
15249 generated on PowerPC systems.  Do not use @option{-mmultiple} on little
15250 endian PowerPC systems, since those instructions do not work when the
15251 processor is in little endian mode.  The exceptions are PPC740 and
15252 PPC750 which permit the instructions usage in little endian mode.
15254 @item -mstring
15255 @itemx -mno-string
15256 @opindex mstring
15257 @opindex mno-string
15258 Generate code that uses (does not use) the load string instructions
15259 and the store string word instructions to save multiple registers and
15260 do small block moves.  These instructions are generated by default on
15261 POWER systems, and not generated on PowerPC systems.  Do not use
15262 @option{-mstring} on little endian PowerPC systems, since those
15263 instructions do not work when the processor is in little endian mode.
15264 The exceptions are PPC740 and PPC750 which permit the instructions
15265 usage in little endian mode.
15267 @item -mupdate
15268 @itemx -mno-update
15269 @opindex mupdate
15270 @opindex mno-update
15271 Generate code that uses (does not use) the load or store instructions
15272 that update the base register to the address of the calculated memory
15273 location.  These instructions are generated by default.  If you use
15274 @option{-mno-update}, there is a small window between the time that the
15275 stack pointer is updated and the address of the previous frame is
15276 stored, which means code that walks the stack frame across interrupts or
15277 signals may get corrupted data.
15279 @item -mavoid-indexed-addresses
15280 @itemx -mno-avoid-indexed-addresses
15281 @opindex mavoid-indexed-addresses
15282 @opindex mno-avoid-indexed-addresses
15283 Generate code that tries to avoid (not avoid) the use of indexed load
15284 or store instructions. These instructions can incur a performance
15285 penalty on Power6 processors in certain situations, such as when
15286 stepping through large arrays that cross a 16M boundary.  This option
15287 is enabled by default when targetting Power6 and disabled otherwise.
15289 @item -mfused-madd
15290 @itemx -mno-fused-madd
15291 @opindex mfused-madd
15292 @opindex mno-fused-madd
15293 Generate code that uses (does not use) the floating point multiply and
15294 accumulate instructions.  These instructions are generated by default if
15295 hardware floating is used.
15297 @item -mmulhw
15298 @itemx -mno-mulhw
15299 @opindex mmulhw
15300 @opindex mno-mulhw
15301 Generate code that uses (does not use) the half-word multiply and
15302 multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors.
15303 These instructions are generated by default when targetting those
15304 processors.
15306 @item -mdlmzb
15307 @itemx -mno-dlmzb
15308 @opindex mdlmzb
15309 @opindex mno-dlmzb
15310 Generate code that uses (does not use) the string-search @samp{dlmzb}
15311 instruction on the IBM 405, 440, 464 and 476 processors.  This instruction is
15312 generated by default when targetting those processors.
15314 @item -mno-bit-align
15315 @itemx -mbit-align
15316 @opindex mno-bit-align
15317 @opindex mbit-align
15318 On System V.4 and embedded PowerPC systems do not (do) force structures
15319 and unions that contain bit-fields to be aligned to the base type of the
15320 bit-field.
15322 For example, by default a structure containing nothing but 8
15323 @code{unsigned} bit-fields of length 1 would be aligned to a 4 byte
15324 boundary and have a size of 4 bytes.  By using @option{-mno-bit-align},
15325 the structure would be aligned to a 1 byte boundary and be one byte in
15326 size.
15328 @item -mno-strict-align
15329 @itemx -mstrict-align
15330 @opindex mno-strict-align
15331 @opindex mstrict-align
15332 On System V.4 and embedded PowerPC systems do not (do) assume that
15333 unaligned memory references will be handled by the system.
15335 @item -mrelocatable
15336 @itemx -mno-relocatable
15337 @opindex mrelocatable
15338 @opindex mno-relocatable
15339 On embedded PowerPC systems generate code that allows (does not allow)
15340 the program to be relocated to a different address at runtime.  If you
15341 use @option{-mrelocatable} on any module, all objects linked together must
15342 be compiled with @option{-mrelocatable} or @option{-mrelocatable-lib}.
15344 @item -mrelocatable-lib
15345 @itemx -mno-relocatable-lib
15346 @opindex mrelocatable-lib
15347 @opindex mno-relocatable-lib
15348 On embedded PowerPC systems generate code that allows (does not allow)
15349 the program to be relocated to a different address at runtime.  Modules
15350 compiled with @option{-mrelocatable-lib} can be linked with either modules
15351 compiled without @option{-mrelocatable} and @option{-mrelocatable-lib} or
15352 with modules compiled with the @option{-mrelocatable} options.
15354 @item -mno-toc
15355 @itemx -mtoc
15356 @opindex mno-toc
15357 @opindex mtoc
15358 On System V.4 and embedded PowerPC systems do not (do) assume that
15359 register 2 contains a pointer to a global area pointing to the addresses
15360 used in the program.
15362 @item -mlittle
15363 @itemx -mlittle-endian
15364 @opindex mlittle
15365 @opindex mlittle-endian
15366 On System V.4 and embedded PowerPC systems compile code for the
15367 processor in little endian mode.  The @option{-mlittle-endian} option is
15368 the same as @option{-mlittle}.
15370 @item -mbig
15371 @itemx -mbig-endian
15372 @opindex mbig
15373 @opindex mbig-endian
15374 On System V.4 and embedded PowerPC systems compile code for the
15375 processor in big endian mode.  The @option{-mbig-endian} option is
15376 the same as @option{-mbig}.
15378 @item -mdynamic-no-pic
15379 @opindex mdynamic-no-pic
15380 On Darwin and Mac OS X systems, compile code so that it is not
15381 relocatable, but that its external references are relocatable.  The
15382 resulting code is suitable for applications, but not shared
15383 libraries.
15385 @item -mprioritize-restricted-insns=@var{priority}
15386 @opindex mprioritize-restricted-insns
15387 This option controls the priority that is assigned to
15388 dispatch-slot restricted instructions during the second scheduling
15389 pass.  The argument @var{priority} takes the value @var{0/1/2} to assign
15390 @var{no/highest/second-highest} priority to dispatch slot restricted
15391 instructions.
15393 @item -msched-costly-dep=@var{dependence_type}
15394 @opindex msched-costly-dep
15395 This option controls which dependences are considered costly
15396 by the target during instruction scheduling.  The argument
15397 @var{dependence_type} takes one of the following values:
15398 @var{no}: no dependence is costly,
15399 @var{all}: all dependences are costly,
15400 @var{true_store_to_load}: a true dependence from store to load is costly,
15401 @var{store_to_load}: any dependence from store to load is costly,
15402 @var{number}: any dependence which latency >= @var{number} is costly.
15404 @item -minsert-sched-nops=@var{scheme}
15405 @opindex minsert-sched-nops
15406 This option controls which nop insertion scheme will be used during
15407 the second scheduling pass.  The argument @var{scheme} takes one of the
15408 following values:
15409 @var{no}: Don't insert nops.
15410 @var{pad}: Pad with nops any dispatch group which has vacant issue slots,
15411 according to the scheduler's grouping.
15412 @var{regroup_exact}: Insert nops to force costly dependent insns into
15413 separate groups.  Insert exactly as many nops as needed to force an insn
15414 to a new group, according to the estimated processor grouping.
15415 @var{number}: Insert nops to force costly dependent insns into
15416 separate groups.  Insert @var{number} nops to force an insn to a new group.
15418 @item -mcall-sysv
15419 @opindex mcall-sysv
15420 On System V.4 and embedded PowerPC systems compile code using calling
15421 conventions that adheres to the March 1995 draft of the System V
15422 Application Binary Interface, PowerPC processor supplement.  This is the
15423 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
15425 @item -mcall-sysv-eabi
15426 @itemx -mcall-eabi
15427 @opindex mcall-sysv-eabi
15428 @opindex mcall-eabi
15429 Specify both @option{-mcall-sysv} and @option{-meabi} options.
15431 @item -mcall-sysv-noeabi
15432 @opindex mcall-sysv-noeabi
15433 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
15435 @item -mcall-aixdesc
15436 @opindex m
15437 On System V.4 and embedded PowerPC systems compile code for the AIX
15438 operating system.
15440 @item -mcall-linux
15441 @opindex mcall-linux
15442 On System V.4 and embedded PowerPC systems compile code for the
15443 Linux-based GNU system.
15445 @item -mcall-gnu
15446 @opindex mcall-gnu
15447 On System V.4 and embedded PowerPC systems compile code for the
15448 Hurd-based GNU system.
15450 @item -mcall-freebsd
15451 @opindex mcall-freebsd
15452 On System V.4 and embedded PowerPC systems compile code for the
15453 FreeBSD operating system.
15455 @item -mcall-netbsd
15456 @opindex mcall-netbsd
15457 On System V.4 and embedded PowerPC systems compile code for the
15458 NetBSD operating system.
15460 @item -mcall-openbsd
15461 @opindex mcall-netbsd
15462 On System V.4 and embedded PowerPC systems compile code for the
15463 OpenBSD operating system.
15465 @item -maix-struct-return
15466 @opindex maix-struct-return
15467 Return all structures in memory (as specified by the AIX ABI)@.
15469 @item -msvr4-struct-return
15470 @opindex msvr4-struct-return
15471 Return structures smaller than 8 bytes in registers (as specified by the
15472 SVR4 ABI)@.
15474 @item -mabi=@var{abi-type}
15475 @opindex mabi
15476 Extend the current ABI with a particular extension, or remove such extension.
15477 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
15478 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble}@.
15480 @item -mabi=spe
15481 @opindex mabi=spe
15482 Extend the current ABI with SPE ABI extensions.  This does not change
15483 the default ABI, instead it adds the SPE ABI extensions to the current
15484 ABI@.
15486 @item -mabi=no-spe
15487 @opindex mabi=no-spe
15488 Disable Booke SPE ABI extensions for the current ABI@.
15490 @item -mabi=ibmlongdouble
15491 @opindex mabi=ibmlongdouble
15492 Change the current ABI to use IBM extended precision long double.
15493 This is a PowerPC 32-bit SYSV ABI option.
15495 @item -mabi=ieeelongdouble
15496 @opindex mabi=ieeelongdouble
15497 Change the current ABI to use IEEE extended precision long double.
15498 This is a PowerPC 32-bit Linux ABI option.
15500 @item -mprototype
15501 @itemx -mno-prototype
15502 @opindex mprototype
15503 @opindex mno-prototype
15504 On System V.4 and embedded PowerPC systems assume that all calls to
15505 variable argument functions are properly prototyped.  Otherwise, the
15506 compiler must insert an instruction before every non prototyped call to
15507 set or clear bit 6 of the condition code register (@var{CR}) to
15508 indicate whether floating point values were passed in the floating point
15509 registers in case the function takes a variable arguments.  With
15510 @option{-mprototype}, only calls to prototyped variable argument functions
15511 will set or clear the bit.
15513 @item -msim
15514 @opindex msim
15515 On embedded PowerPC systems, assume that the startup module is called
15516 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
15517 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
15518 configurations.
15520 @item -mmvme
15521 @opindex mmvme
15522 On embedded PowerPC systems, assume that the startup module is called
15523 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
15524 @file{libc.a}.
15526 @item -mads
15527 @opindex mads
15528 On embedded PowerPC systems, assume that the startup module is called
15529 @file{crt0.o} and the standard C libraries are @file{libads.a} and
15530 @file{libc.a}.
15532 @item -myellowknife
15533 @opindex myellowknife
15534 On embedded PowerPC systems, assume that the startup module is called
15535 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
15536 @file{libc.a}.
15538 @item -mvxworks
15539 @opindex mvxworks
15540 On System V.4 and embedded PowerPC systems, specify that you are
15541 compiling for a VxWorks system.
15543 @item -memb
15544 @opindex memb
15545 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
15546 header to indicate that @samp{eabi} extended relocations are used.
15548 @item -meabi
15549 @itemx -mno-eabi
15550 @opindex meabi
15551 @opindex mno-eabi
15552 On System V.4 and embedded PowerPC systems do (do not) adhere to the
15553 Embedded Applications Binary Interface (eabi) which is a set of
15554 modifications to the System V.4 specifications.  Selecting @option{-meabi}
15555 means that the stack is aligned to an 8 byte boundary, a function
15556 @code{__eabi} is called to from @code{main} to set up the eabi
15557 environment, and the @option{-msdata} option can use both @code{r2} and
15558 @code{r13} to point to two separate small data areas.  Selecting
15559 @option{-mno-eabi} means that the stack is aligned to a 16 byte boundary,
15560 do not call an initialization function from @code{main}, and the
15561 @option{-msdata} option will only use @code{r13} to point to a single
15562 small data area.  The @option{-meabi} option is on by default if you
15563 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
15565 @item -msdata=eabi
15566 @opindex msdata=eabi
15567 On System V.4 and embedded PowerPC systems, put small initialized
15568 @code{const} global and static data in the @samp{.sdata2} section, which
15569 is pointed to by register @code{r2}.  Put small initialized
15570 non-@code{const} global and static data in the @samp{.sdata} section,
15571 which is pointed to by register @code{r13}.  Put small uninitialized
15572 global and static data in the @samp{.sbss} section, which is adjacent to
15573 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
15574 incompatible with the @option{-mrelocatable} option.  The
15575 @option{-msdata=eabi} option also sets the @option{-memb} option.
15577 @item -msdata=sysv
15578 @opindex msdata=sysv
15579 On System V.4 and embedded PowerPC systems, put small global and static
15580 data in the @samp{.sdata} section, which is pointed to by register
15581 @code{r13}.  Put small uninitialized global and static data in the
15582 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
15583 The @option{-msdata=sysv} option is incompatible with the
15584 @option{-mrelocatable} option.
15586 @item -msdata=default
15587 @itemx -msdata
15588 @opindex msdata=default
15589 @opindex msdata
15590 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
15591 compile code the same as @option{-msdata=eabi}, otherwise compile code the
15592 same as @option{-msdata=sysv}.
15594 @item -msdata=data
15595 @opindex msdata=data
15596 On System V.4 and embedded PowerPC systems, put small global
15597 data in the @samp{.sdata} section.  Put small uninitialized global
15598 data in the @samp{.sbss} section.  Do not use register @code{r13}
15599 to address small data however.  This is the default behavior unless
15600 other @option{-msdata} options are used.
15602 @item -msdata=none
15603 @itemx -mno-sdata
15604 @opindex msdata=none
15605 @opindex mno-sdata
15606 On embedded PowerPC systems, put all initialized global and static data
15607 in the @samp{.data} section, and all uninitialized data in the
15608 @samp{.bss} section.
15610 @item -G @var{num}
15611 @opindex G
15612 @cindex smaller data references (PowerPC)
15613 @cindex .sdata/.sdata2 references (PowerPC)
15614 On embedded PowerPC systems, put global and static items less than or
15615 equal to @var{num} bytes into the small data or bss sections instead of
15616 the normal data or bss section.  By default, @var{num} is 8.  The
15617 @option{-G @var{num}} switch is also passed to the linker.
15618 All modules should be compiled with the same @option{-G @var{num}} value.
15620 @item -mregnames
15621 @itemx -mno-regnames
15622 @opindex mregnames
15623 @opindex mno-regnames
15624 On System V.4 and embedded PowerPC systems do (do not) emit register
15625 names in the assembly language output using symbolic forms.
15627 @item -mlongcall
15628 @itemx -mno-longcall
15629 @opindex mlongcall
15630 @opindex mno-longcall
15631 By default assume that all calls are far away so that a longer more
15632 expensive calling sequence is required.  This is required for calls
15633 further than 32 megabytes (33,554,432 bytes) from the current location.
15634 A short call will be generated if the compiler knows
15635 the call cannot be that far away.  This setting can be overridden by
15636 the @code{shortcall} function attribute, or by @code{#pragma
15637 longcall(0)}.
15639 Some linkers are capable of detecting out-of-range calls and generating
15640 glue code on the fly.  On these systems, long calls are unnecessary and
15641 generate slower code.  As of this writing, the AIX linker can do this,
15642 as can the GNU linker for PowerPC/64.  It is planned to add this feature
15643 to the GNU linker for 32-bit PowerPC systems as well.
15645 On Darwin/PPC systems, @code{#pragma longcall} will generate ``jbsr
15646 callee, L42'', plus a ``branch island'' (glue code).  The two target
15647 addresses represent the callee and the ``branch island''.  The
15648 Darwin/PPC linker will prefer the first address and generate a ``bl
15649 callee'' if the PPC ``bl'' instruction will reach the callee directly;
15650 otherwise, the linker will generate ``bl L42'' to call the ``branch
15651 island''.  The ``branch island'' is appended to the body of the
15652 calling function; it computes the full 32-bit address of the callee
15653 and jumps to it.
15655 On Mach-O (Darwin) systems, this option directs the compiler emit to
15656 the glue for every direct call, and the Darwin linker decides whether
15657 to use or discard it.
15659 In the future, we may cause GCC to ignore all longcall specifications
15660 when the linker is known to generate glue.
15662 @item -mtls-markers
15663 @itemx -mno-tls-markers
15664 @opindex mtls-markers
15665 @opindex mno-tls-markers
15666 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
15667 specifying the function argument.  The relocation allows ld to
15668 reliably associate function call with argument setup instructions for
15669 TLS optimization, which in turn allows gcc to better schedule the
15670 sequence.
15672 @item -pthread
15673 @opindex pthread
15674 Adds support for multithreading with the @dfn{pthreads} library.
15675 This option sets flags for both the preprocessor and linker.
15677 @item -mrecip
15678 @itemx -mno-recip
15679 @opindex mrecip
15680 This option will enable GCC to use the reciprocal estimate and
15681 reciprocal square root estimate instructions with additional
15682 Newton-Raphson steps to increase precision instead of doing a divide or
15683 square root and divide for floating point arguments.  You should use
15684 the @option{-ffast-math} option when using @option{-mrecip} (or at
15685 least @option{-funsafe-math-optimizations},
15686 @option{-finite-math-only}, @option{-freciprocal-math} and
15687 @option{-fno-trapping-math}).  Note that while the throughput of the
15688 sequence is generally higher than the throughput of the non-reciprocal
15689 instruction, the precision of the sequence can be decreased by up to 2
15690 ulp (i.e. the inverse of 1.0 equals 0.99999994) for reciprocal square
15691 roots.
15693 @item -mrecip=@var{opt}
15694 @opindex mrecip=opt
15695 This option allows to control which reciprocal estimate instructions
15696 may be used.  @var{opt} is a comma separated list of options, that may
15697 be preceeded by a @code{!} to invert the option:
15698 @code{all}: enable all estimate instructions,
15699 @code{default}: enable the default instructions, equvalent to @option{-mrecip},
15700 @code{none}: disable all estimate instructions, equivalent to @option{-mno-recip};
15701 @code{div}: enable the reciprocal approximation instructions for both single and double precision;
15702 @code{divf}: enable the single precision reciprocal approximation instructions;
15703 @code{divd}: enable the double precision reciprocal approximation instructions;
15704 @code{rsqrt}: enable the reciprocal square root approximation instructions for both single and double precision;
15705 @code{rsqrtf}: enable the single precision reciprocal square root approximation instructions;
15706 @code{rsqrtd}: enable the double precision reciprocal square root approximation instructions;
15708 So for example, @option{-mrecip=all,!rsqrtd} would enable the
15709 all of the reciprocal estimate instructions, except for the
15710 @code{FRSQRTE}, @code{XSRSQRTEDP}, and @code{XVRSQRTEDP} instructions
15711 which handle the double precision reciprocal square root calculations.
15713 @item -mrecip-precision
15714 @itemx -mno-recip-precision
15715 @opindex mrecip-precision
15716 Assume (do not assume) that the reciprocal estimate instructions
15717 provide higher precision estimates than is mandated by the powerpc
15718 ABI.  Selecting @option{-mcpu=power6} or @option{-mcpu=power7}
15719 automatically selects @option{-mrecip-precision}.  The double
15720 precision square root estimate instructions are not generated by
15721 default on low precision machines, since they do not provide an
15722 estimate that converges after three steps.
15723 @end table
15725 @node RX Options
15726 @subsection RX Options
15727 @cindex RX Options
15729 These command line options are defined for RX targets:
15731 @table @gcctabopt
15732 @item -m64bit-doubles
15733 @itemx -m32bit-doubles
15734 @opindex m64bit-doubles
15735 @opindex m32bit-doubles
15736 Make the @code{double} data type be 64-bits (@option{-m64bit-doubles})
15737 or 32-bits (@option{-m32bit-doubles}) in size.  The default is
15738 @option{-m32bit-doubles}.  @emph{Note} RX floating point hardware only
15739 works on 32-bit values, which is why the default is
15740 @option{-m32bit-doubles}.
15742 @item -fpu
15743 @itemx -nofpu
15744 @opindex fpu
15745 @opindex nofpu
15746 Enables (@option{-fpu}) or disables (@option{-nofpu}) the use of RX
15747 floating point hardware.  The default is enabled for the @var{RX600}
15748 series and disabled for the @var{RX200} series.
15750 Floating point instructions will only be generated for 32-bit floating
15751 point values however, so if the @option{-m64bit-doubles} option is in
15752 use then the FPU hardware will not be used for doubles.
15754 @emph{Note} If the @option{-fpu} option is enabled then
15755 @option{-funsafe-math-optimizations} is also enabled automatically.
15756 This is because the RX FPU instructions are themselves unsafe.
15758 @item -mcpu=@var{name}
15759 @itemx -patch=@var{name}
15760 @opindex -mcpu
15761 @opindex -patch
15762 Selects the type of RX CPU to be targeted.  Currently three types are
15763 supported, the generic @var{RX600} and @var{RX200} series hardware and
15764 the specific @var{RX610} cpu.  The default is @var{RX600}.
15766 The only difference between @var{RX600} and @var{RX610} is that the
15767 @var{RX610} does not support the @code{MVTIPL} instruction.
15769 The @var{RX200} series does not have a hardware floating point unit
15770 and so @option{-nofpu} is enabled by default when this type is
15771 selected.
15773 @item -mbig-endian-data
15774 @itemx -mlittle-endian-data
15775 @opindex mbig-endian-data
15776 @opindex mlittle-endian-data
15777 Store data (but not code) in the big-endian format.  The default is
15778 @option{-mlittle-endian-data}, ie to store data in the little endian
15779 format.
15781 @item -msmall-data-limit=@var{N}
15782 @opindex msmall-data-limit
15783 Specifies the maximum size in bytes of global and static variables
15784 which can be placed into the small data area.  Using the small data
15785 area can lead to smaller and faster code, but the size of area is
15786 limited and it is up to the programmer to ensure that the area does
15787 not overflow.  Also when the small data area is used one of the RX's
15788 registers (@code{r13}) is reserved for use pointing to this area, so
15789 it is no longer available for use by the compiler.  This could result
15790 in slower and/or larger code if variables which once could have been
15791 held in @code{r13} are now pushed onto the stack.
15793 Note, common variables (variables which have not been initialised) and
15794 constants are not placed into the small data area as they are assigned
15795 to other sections in the output executable.
15797 The default value is zero, which disables this feature.  Note, this
15798 feature is not enabled by default with higher optimization levels
15799 (@option{-O2} etc) because of the potentially detrimental effects of
15800 reserving register @code{r13}.  It is up to the programmer to
15801 experiment and discover whether this feature is of benefit to their
15802 program.
15804 @item -msim
15805 @itemx -mno-sim
15806 @opindex msim
15807 @opindex mno-sim
15808 Use the simulator runtime.  The default is to use the libgloss board
15809 specific runtime.
15811 @item -mas100-syntax
15812 @itemx -mno-as100-syntax
15813 @opindex mas100-syntax
15814 @opindex mno-as100-syntax
15815 When generating assembler output use a syntax that is compatible with
15816 Renesas's AS100 assembler.  This syntax can also be handled by the GAS
15817 assembler but it has some restrictions so generating it is not the
15818 default option.
15820 @item -mmax-constant-size=@var{N}
15821 @opindex mmax-constant-size
15822 Specifies the maximum size, in bytes, of a constant that can be used as
15823 an operand in a RX instruction.  Although the RX instruction set does
15824 allow constants of up to 4 bytes in length to be used in instructions,
15825 a longer value equates to a longer instruction.  Thus in some
15826 circumstances it can be beneficial to restrict the size of constants
15827 that are used in instructions.  Constants that are too big are instead
15828 placed into a constant pool and referenced via register indirection.
15830 The value @var{N} can be between 0 and 4.  A value of 0 (the default)
15831 or 4 means that constants of any size are allowed.
15833 @item -mrelax
15834 @opindex mrelax
15835 Enable linker relaxation.  Linker relaxation is a process whereby the
15836 linker will attempt to reduce the size of a program by finding shorter
15837 versions of various instructions.  Disabled by default.
15839 @item -mint-register=@var{N}
15840 @opindex mint-register
15841 Specify the number of registers to reserve for fast interrupt handler
15842 functions.  The value @var{N} can be between 0 and 4.  A value of 1
15843 means that register @code{r13} will be reserved for the exclusive use
15844 of fast interrupt handlers.  A value of 2 reserves @code{r13} and
15845 @code{r12}.  A value of 3 reserves @code{r13}, @code{r12} and
15846 @code{r11}, and a value of 4 reserves @code{r13} through @code{r10}.
15847 A value of 0, the default, does not reserve any registers.
15849 @item -msave-acc-in-interrupts
15850 @opindex msave-acc-in-interrupts
15851 Specifies that interrupt handler functions should preserve the
15852 accumulator register.  This is only necessary if normal code might use
15853 the accumulator register, for example because it performs 64-bit
15854 multiplications.  The default is to ignore the accumulator as this
15855 makes the interrupt handlers faster.
15857 @end table
15859 @emph{Note:} The generic GCC command line @option{-ffixed-@var{reg}}
15860 has special significance to the RX port when used with the
15861 @code{interrupt} function attribute.  This attribute indicates a
15862 function intended to process fast interrupts.  GCC will will ensure
15863 that it only uses the registers @code{r10}, @code{r11}, @code{r12}
15864 and/or @code{r13} and only provided that the normal use of the
15865 corresponding registers have been restricted via the
15866 @option{-ffixed-@var{reg}} or @option{-mint-register} command line
15867 options.
15869 @node S/390 and zSeries Options
15870 @subsection S/390 and zSeries Options
15871 @cindex S/390 and zSeries Options
15873 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
15875 @table @gcctabopt
15876 @item -mhard-float
15877 @itemx -msoft-float
15878 @opindex mhard-float
15879 @opindex msoft-float
15880 Use (do not use) the hardware floating-point instructions and registers
15881 for floating-point operations.  When @option{-msoft-float} is specified,
15882 functions in @file{libgcc.a} will be used to perform floating-point
15883 operations.  When @option{-mhard-float} is specified, the compiler
15884 generates IEEE floating-point instructions.  This is the default.
15886 @item -mhard-dfp
15887 @itemx -mno-hard-dfp
15888 @opindex mhard-dfp
15889 @opindex mno-hard-dfp
15890 Use (do not use) the hardware decimal-floating-point instructions for
15891 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
15892 specified, functions in @file{libgcc.a} will be used to perform
15893 decimal-floating-point operations.  When @option{-mhard-dfp} is
15894 specified, the compiler generates decimal-floating-point hardware
15895 instructions.  This is the default for @option{-march=z9-ec} or higher.
15897 @item -mlong-double-64
15898 @itemx -mlong-double-128
15899 @opindex mlong-double-64
15900 @opindex mlong-double-128
15901 These switches control the size of @code{long double} type. A size
15902 of 64bit makes the @code{long double} type equivalent to the @code{double}
15903 type. This is the default.
15905 @item -mbackchain
15906 @itemx -mno-backchain
15907 @opindex mbackchain
15908 @opindex mno-backchain
15909 Store (do not store) the address of the caller's frame as backchain pointer
15910 into the callee's stack frame.
15911 A backchain may be needed to allow debugging using tools that do not understand
15912 DWARF-2 call frame information.
15913 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
15914 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
15915 the backchain is placed into the topmost word of the 96/160 byte register
15916 save area.
15918 In general, code compiled with @option{-mbackchain} is call-compatible with
15919 code compiled with @option{-mmo-backchain}; however, use of the backchain
15920 for debugging purposes usually requires that the whole binary is built with
15921 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
15922 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
15923 to build a linux kernel use @option{-msoft-float}.
15925 The default is to not maintain the backchain.
15927 @item -mpacked-stack
15928 @itemx -mno-packed-stack
15929 @opindex mpacked-stack
15930 @opindex mno-packed-stack
15931 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
15932 specified, the compiler uses the all fields of the 96/160 byte register save
15933 area only for their default purpose; unused fields still take up stack space.
15934 When @option{-mpacked-stack} is specified, register save slots are densely
15935 packed at the top of the register save area; unused space is reused for other
15936 purposes, allowing for more efficient use of the available stack space.
15937 However, when @option{-mbackchain} is also in effect, the topmost word of
15938 the save area is always used to store the backchain, and the return address
15939 register is always saved two words below the backchain.
15941 As long as the stack frame backchain is not used, code generated with
15942 @option{-mpacked-stack} is call-compatible with code generated with
15943 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
15944 S/390 or zSeries generated code that uses the stack frame backchain at run
15945 time, not just for debugging purposes.  Such code is not call-compatible
15946 with code compiled with @option{-mpacked-stack}.  Also, note that the
15947 combination of @option{-mbackchain},
15948 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
15949 to build a linux kernel use @option{-msoft-float}.
15951 The default is to not use the packed stack layout.
15953 @item -msmall-exec
15954 @itemx -mno-small-exec
15955 @opindex msmall-exec
15956 @opindex mno-small-exec
15957 Generate (or do not generate) code using the @code{bras} instruction
15958 to do subroutine calls.
15959 This only works reliably if the total executable size does not
15960 exceed 64k.  The default is to use the @code{basr} instruction instead,
15961 which does not have this limitation.
15963 @item -m64
15964 @itemx -m31
15965 @opindex m64
15966 @opindex m31
15967 When @option{-m31} is specified, generate code compliant to the
15968 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
15969 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
15970 particular to generate 64-bit instructions.  For the @samp{s390}
15971 targets, the default is @option{-m31}, while the @samp{s390x}
15972 targets default to @option{-m64}.
15974 @item -mzarch
15975 @itemx -mesa
15976 @opindex mzarch
15977 @opindex mesa
15978 When @option{-mzarch} is specified, generate code using the
15979 instructions available on z/Architecture.
15980 When @option{-mesa} is specified, generate code using the
15981 instructions available on ESA/390.  Note that @option{-mesa} is
15982 not possible with @option{-m64}.
15983 When generating code compliant to the GNU/Linux for S/390 ABI,
15984 the default is @option{-mesa}.  When generating code compliant
15985 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
15987 @item -mmvcle
15988 @itemx -mno-mvcle
15989 @opindex mmvcle
15990 @opindex mno-mvcle
15991 Generate (or do not generate) code using the @code{mvcle} instruction
15992 to perform block moves.  When @option{-mno-mvcle} is specified,
15993 use a @code{mvc} loop instead.  This is the default unless optimizing for
15994 size.
15996 @item -mdebug
15997 @itemx -mno-debug
15998 @opindex mdebug
15999 @opindex mno-debug
16000 Print (or do not print) additional debug information when compiling.
16001 The default is to not print debug information.
16003 @item -march=@var{cpu-type}
16004 @opindex march
16005 Generate code that will run on @var{cpu-type}, which is the name of a system
16006 representing a certain processor type.  Possible values for
16007 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, @samp{z990},
16008 @samp{z9-109}, @samp{z9-ec} and @samp{z10}.
16009 When generating code using the instructions available on z/Architecture,
16010 the default is @option{-march=z900}.  Otherwise, the default is
16011 @option{-march=g5}.
16013 @item -mtune=@var{cpu-type}
16014 @opindex mtune
16015 Tune to @var{cpu-type} everything applicable about the generated code,
16016 except for the ABI and the set of available instructions.
16017 The list of @var{cpu-type} values is the same as for @option{-march}.
16018 The default is the value used for @option{-march}.
16020 @item -mtpf-trace
16021 @itemx -mno-tpf-trace
16022 @opindex mtpf-trace
16023 @opindex mno-tpf-trace
16024 Generate code that adds (does not add) in TPF OS specific branches to trace
16025 routines in the operating system.  This option is off by default, even
16026 when compiling for the TPF OS@.
16028 @item -mfused-madd
16029 @itemx -mno-fused-madd
16030 @opindex mfused-madd
16031 @opindex mno-fused-madd
16032 Generate code that uses (does not use) the floating point multiply and
16033 accumulate instructions.  These instructions are generated by default if
16034 hardware floating point is used.
16036 @item -mwarn-framesize=@var{framesize}
16037 @opindex mwarn-framesize
16038 Emit a warning if the current function exceeds the given frame size.  Because
16039 this is a compile time check it doesn't need to be a real problem when the program
16040 runs.  It is intended to identify functions which most probably cause
16041 a stack overflow.  It is useful to be used in an environment with limited stack
16042 size e.g.@: the linux kernel.
16044 @item -mwarn-dynamicstack
16045 @opindex mwarn-dynamicstack
16046 Emit a warning if the function calls alloca or uses dynamically
16047 sized arrays.  This is generally a bad idea with a limited stack size.
16049 @item -mstack-guard=@var{stack-guard}
16050 @itemx -mstack-size=@var{stack-size}
16051 @opindex mstack-guard
16052 @opindex mstack-size
16053 If these options are provided the s390 back end emits additional instructions in
16054 the function prologue which trigger a trap if the stack size is @var{stack-guard}
16055 bytes above the @var{stack-size} (remember that the stack on s390 grows downward).
16056 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
16057 the frame size of the compiled function is chosen.
16058 These options are intended to be used to help debugging stack overflow problems.
16059 The additionally emitted code causes only little overhead and hence can also be
16060 used in production like systems without greater performance degradation.  The given
16061 values have to be exact powers of 2 and @var{stack-size} has to be greater than
16062 @var{stack-guard} without exceeding 64k.
16063 In order to be efficient the extra code makes the assumption that the stack starts
16064 at an address aligned to the value given by @var{stack-size}.
16065 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
16066 @end table
16068 @node Score Options
16069 @subsection Score Options
16070 @cindex Score Options
16072 These options are defined for Score implementations:
16074 @table @gcctabopt
16075 @item -meb
16076 @opindex meb
16077 Compile code for big endian mode.  This is the default.
16079 @item -mel
16080 @opindex mel
16081 Compile code for little endian mode.
16083 @item -mnhwloop
16084 @opindex mnhwloop
16085 Disable generate bcnz instruction.
16087 @item -muls
16088 @opindex muls
16089 Enable generate unaligned load and store instruction.
16091 @item -mmac
16092 @opindex mmac
16093 Enable the use of multiply-accumulate instructions. Disabled by default.
16095 @item -mscore5
16096 @opindex mscore5
16097 Specify the SCORE5 as the target architecture.
16099 @item -mscore5u
16100 @opindex mscore5u
16101 Specify the SCORE5U of the target architecture.
16103 @item -mscore7
16104 @opindex mscore7
16105 Specify the SCORE7 as the target architecture. This is the default.
16107 @item -mscore7d
16108 @opindex mscore7d
16109 Specify the SCORE7D as the target architecture.
16110 @end table
16112 @node SH Options
16113 @subsection SH Options
16115 These @samp{-m} options are defined for the SH implementations:
16117 @table @gcctabopt
16118 @item -m1
16119 @opindex m1
16120 Generate code for the SH1.
16122 @item -m2
16123 @opindex m2
16124 Generate code for the SH2.
16126 @item -m2e
16127 Generate code for the SH2e.
16129 @item -m2a-nofpu
16130 @opindex m2a-nofpu
16131 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a way
16132 that the floating-point unit is not used.
16134 @item -m2a-single-only
16135 @opindex m2a-single-only
16136 Generate code for the SH2a-FPU, in such a way that no double-precision
16137 floating point operations are used.
16139 @item -m2a-single
16140 @opindex m2a-single
16141 Generate code for the SH2a-FPU assuming the floating-point unit is in
16142 single-precision mode by default.
16144 @item -m2a
16145 @opindex m2a
16146 Generate code for the SH2a-FPU assuming the floating-point unit is in
16147 double-precision mode by default.
16149 @item -m3
16150 @opindex m3
16151 Generate code for the SH3.
16153 @item -m3e
16154 @opindex m3e
16155 Generate code for the SH3e.
16157 @item -m4-nofpu
16158 @opindex m4-nofpu
16159 Generate code for the SH4 without a floating-point unit.
16161 @item -m4-single-only
16162 @opindex m4-single-only
16163 Generate code for the SH4 with a floating-point unit that only
16164 supports single-precision arithmetic.
16166 @item -m4-single
16167 @opindex m4-single
16168 Generate code for the SH4 assuming the floating-point unit is in
16169 single-precision mode by default.
16171 @item -m4
16172 @opindex m4
16173 Generate code for the SH4.
16175 @item -m4a-nofpu
16176 @opindex m4a-nofpu
16177 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
16178 floating-point unit is not used.
16180 @item -m4a-single-only
16181 @opindex m4a-single-only
16182 Generate code for the SH4a, in such a way that no double-precision
16183 floating point operations are used.
16185 @item -m4a-single
16186 @opindex m4a-single
16187 Generate code for the SH4a assuming the floating-point unit is in
16188 single-precision mode by default.
16190 @item -m4a
16191 @opindex m4a
16192 Generate code for the SH4a.
16194 @item -m4al
16195 @opindex m4al
16196 Same as @option{-m4a-nofpu}, except that it implicitly passes
16197 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
16198 instructions at the moment.
16200 @item -mb
16201 @opindex mb
16202 Compile code for the processor in big endian mode.
16204 @item -ml
16205 @opindex ml
16206 Compile code for the processor in little endian mode.
16208 @item -mdalign
16209 @opindex mdalign
16210 Align doubles at 64-bit boundaries.  Note that this changes the calling
16211 conventions, and thus some functions from the standard C library will
16212 not work unless you recompile it first with @option{-mdalign}.
16214 @item -mrelax
16215 @opindex mrelax
16216 Shorten some address references at link time, when possible; uses the
16217 linker option @option{-relax}.
16219 @item -mbigtable
16220 @opindex mbigtable
16221 Use 32-bit offsets in @code{switch} tables.  The default is to use
16222 16-bit offsets.
16224 @item -mbitops
16225 @opindex mbitops
16226 Enable the use of bit manipulation instructions on SH2A.
16228 @item -mfmovd
16229 @opindex mfmovd
16230 Enable the use of the instruction @code{fmovd}.  Check @option{-mdalign} for
16231 alignment constraints.
16233 @item -mhitachi
16234 @opindex mhitachi
16235 Comply with the calling conventions defined by Renesas.
16237 @item -mrenesas
16238 @opindex mhitachi
16239 Comply with the calling conventions defined by Renesas.
16241 @item -mno-renesas
16242 @opindex mhitachi
16243 Comply with the calling conventions defined for GCC before the Renesas
16244 conventions were available.  This option is the default for all
16245 targets of the SH toolchain except for @samp{sh-symbianelf}.
16247 @item -mnomacsave
16248 @opindex mnomacsave
16249 Mark the @code{MAC} register as call-clobbered, even if
16250 @option{-mhitachi} is given.
16252 @item -mieee
16253 @opindex mieee
16254 Increase IEEE-compliance of floating-point code.
16255 At the moment, this is equivalent to @option{-fno-finite-math-only}.
16256 When generating 16 bit SH opcodes, getting IEEE-conforming results for
16257 comparisons of NANs / infinities incurs extra overhead in every
16258 floating point comparison, therefore the default is set to
16259 @option{-ffinite-math-only}.
16261 @item -minline-ic_invalidate
16262 @opindex minline-ic_invalidate
16263 Inline code to invalidate instruction cache entries after setting up
16264 nested function trampolines.
16265 This option has no effect if -musermode is in effect and the selected
16266 code generation option (e.g. -m4) does not allow the use of the icbi
16267 instruction.
16268 If the selected code generation option does not allow the use of the icbi
16269 instruction, and -musermode is not in effect, the inlined code will
16270 manipulate the instruction cache address array directly with an associative
16271 write.  This not only requires privileged mode, but it will also
16272 fail if the cache line had been mapped via the TLB and has become unmapped.
16274 @item -misize
16275 @opindex misize
16276 Dump instruction size and location in the assembly code.
16278 @item -mpadstruct
16279 @opindex mpadstruct
16280 This option is deprecated.  It pads structures to multiple of 4 bytes,
16281 which is incompatible with the SH ABI@.
16283 @item -mspace
16284 @opindex mspace
16285 Optimize for space instead of speed.  Implied by @option{-Os}.
16287 @item -mprefergot
16288 @opindex mprefergot
16289 When generating position-independent code, emit function calls using
16290 the Global Offset Table instead of the Procedure Linkage Table.
16292 @item -musermode
16293 @opindex musermode
16294 Don't generate privileged mode only code; implies -mno-inline-ic_invalidate
16295 if the inlined code would not work in user mode.
16296 This is the default when the target is @code{sh-*-linux*}.
16298 @item -multcost=@var{number}
16299 @opindex multcost=@var{number}
16300 Set the cost to assume for a multiply insn.
16302 @item -mdiv=@var{strategy}
16303 @opindex mdiv=@var{strategy}
16304 Set the division strategy to use for SHmedia code.  @var{strategy} must be
16305 one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, inv:call,
16306 inv:call2, inv:fp .
16307 "fp" performs the operation in floating point.  This has a very high latency,
16308 but needs only a few instructions, so it might be a good choice if
16309 your code has enough easily exploitable ILP to allow the compiler to
16310 schedule the floating point instructions together with other instructions.
16311 Division by zero causes a floating point exception.
16312 "inv" uses integer operations to calculate the inverse of the divisor,
16313 and then multiplies the dividend with the inverse.  This strategy allows
16314 cse and hoisting of the inverse calculation.  Division by zero calculates
16315 an unspecified result, but does not trap.
16316 "inv:minlat" is a variant of "inv" where if no cse / hoisting opportunities
16317 have been found, or if the entire operation has been hoisted to the same
16318 place, the last stages of the inverse calculation are intertwined with the
16319 final multiply to reduce the overall latency, at the expense of using a few
16320 more instructions, and thus offering fewer scheduling opportunities with
16321 other code.
16322 "call" calls a library function that usually implements the inv:minlat
16323 strategy.
16324 This gives high code density for m5-*media-nofpu compilations.
16325 "call2" uses a different entry point of the same library function, where it
16326 assumes that a pointer to a lookup table has already been set up, which
16327 exposes the pointer load to cse / code hoisting optimizations.
16328 "inv:call", "inv:call2" and "inv:fp" all use the "inv" algorithm for initial
16329 code generation, but if the code stays unoptimized, revert to the "call",
16330 "call2", or "fp" strategies, respectively.  Note that the
16331 potentially-trapping side effect of division by zero is carried by a
16332 separate instruction, so it is possible that all the integer instructions
16333 are hoisted out, but the marker for the side effect stays where it is.
16334 A recombination to fp operations or a call is not possible in that case.
16335 "inv20u" and "inv20l" are variants of the "inv:minlat" strategy.  In the case
16336 that the inverse calculation was nor separated from the multiply, they speed
16337 up division where the dividend fits into 20 bits (plus sign where applicable),
16338 by inserting a test to skip a number of operations in this case; this test
16339 slows down the case of larger dividends.  inv20u assumes the case of a such
16340 a small dividend to be unlikely, and inv20l assumes it to be likely.
16342 @item -maccumulate-outgoing-args
16343 @opindex maccumulate-outgoing-args
16344 Reserve space once for outgoing arguments in the function prologue rather 
16345 than around each call.  Generally beneficial for performance and size.  Also
16346 needed for unwinding to avoid changing the stack frame around conditional code.
16348 @item -mdivsi3_libfunc=@var{name}
16349 @opindex mdivsi3_libfunc=@var{name}
16350 Set the name of the library function used for 32 bit signed division to
16351 @var{name}.  This only affect the name used in the call and inv:call
16352 division strategies, and the compiler will still expect the same
16353 sets of input/output/clobbered registers as if this option was not present.
16355 @item -mfixed-range=@var{register-range}
16356 @opindex mfixed-range
16357 Generate code treating the given register range as fixed registers.
16358 A fixed register is one that the register allocator can not use.  This is
16359 useful when compiling kernel code.  A register range is specified as
16360 two registers separated by a dash.  Multiple register ranges can be
16361 specified separated by a comma.
16363 @item -madjust-unroll
16364 @opindex madjust-unroll
16365 Throttle unrolling to avoid thrashing target registers.
16366 This option only has an effect if the gcc code base supports the
16367 TARGET_ADJUST_UNROLL_MAX target hook.
16369 @item -mindexed-addressing
16370 @opindex mindexed-addressing
16371 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
16372 This is only safe if the hardware and/or OS implement 32 bit wrap-around
16373 semantics for the indexed addressing mode.  The architecture allows the
16374 implementation of processors with 64 bit MMU, which the OS could use to
16375 get 32 bit addressing, but since no current hardware implementation supports
16376 this or any other way to make the indexed addressing mode safe to use in
16377 the 32 bit ABI, the default is -mno-indexed-addressing.
16379 @item -mgettrcost=@var{number}
16380 @opindex mgettrcost=@var{number}
16381 Set the cost assumed for the gettr instruction to @var{number}.
16382 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
16384 @item -mpt-fixed
16385 @opindex mpt-fixed
16386 Assume pt* instructions won't trap.  This will generally generate better
16387 scheduled code, but is unsafe on current hardware.  The current architecture
16388 definition says that ptabs and ptrel trap when the target anded with 3 is 3.
16389 This has the unintentional effect of making it unsafe to schedule ptabs /
16390 ptrel before a branch, or hoist it out of a loop.  For example,
16391 __do_global_ctors, a part of libgcc that runs constructors at program
16392 startup, calls functions in a list which is delimited by @minus{}1.  With the
16393 -mpt-fixed option, the ptabs will be done before testing against @minus{}1.
16394 That means that all the constructors will be run a bit quicker, but when
16395 the loop comes to the end of the list, the program crashes because ptabs
16396 loads @minus{}1 into a target register.  Since this option is unsafe for any
16397 hardware implementing the current architecture specification, the default
16398 is -mno-pt-fixed.  Unless the user specifies a specific cost with
16399 @option{-mgettrcost}, -mno-pt-fixed also implies @option{-mgettrcost=100};
16400 this deters register allocation using target registers for storing
16401 ordinary integers.
16403 @item -minvalid-symbols
16404 @opindex minvalid-symbols
16405 Assume symbols might be invalid.  Ordinary function symbols generated by
16406 the compiler will always be valid to load with movi/shori/ptabs or
16407 movi/shori/ptrel, but with assembler and/or linker tricks it is possible
16408 to generate symbols that will cause ptabs / ptrel to trap.
16409 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
16410 It will then prevent cross-basic-block cse, hoisting and most scheduling
16411 of symbol loads.  The default is @option{-mno-invalid-symbols}.
16412 @end table
16414 @node SPARC Options
16415 @subsection SPARC Options
16416 @cindex SPARC options
16418 These @samp{-m} options are supported on the SPARC:
16420 @table @gcctabopt
16421 @item -mno-app-regs
16422 @itemx -mapp-regs
16423 @opindex mno-app-regs
16424 @opindex mapp-regs
16425 Specify @option{-mapp-regs} to generate output using the global registers
16426 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
16427 is the default.
16429 To be fully SVR4 ABI compliant at the cost of some performance loss,
16430 specify @option{-mno-app-regs}.  You should compile libraries and system
16431 software with this option.
16433 @item -mfpu
16434 @itemx -mhard-float
16435 @opindex mfpu
16436 @opindex mhard-float
16437 Generate output containing floating point instructions.  This is the
16438 default.
16440 @item -mno-fpu
16441 @itemx -msoft-float
16442 @opindex mno-fpu
16443 @opindex msoft-float
16444 Generate output containing library calls for floating point.
16445 @strong{Warning:} the requisite libraries are not available for all SPARC
16446 targets.  Normally the facilities of the machine's usual C compiler are
16447 used, but this cannot be done directly in cross-compilation.  You must make
16448 your own arrangements to provide suitable library functions for
16449 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
16450 @samp{sparclite-*-*} do provide software floating point support.
16452 @option{-msoft-float} changes the calling convention in the output file;
16453 therefore, it is only useful if you compile @emph{all} of a program with
16454 this option.  In particular, you need to compile @file{libgcc.a}, the
16455 library that comes with GCC, with @option{-msoft-float} in order for
16456 this to work.
16458 @item -mhard-quad-float
16459 @opindex mhard-quad-float
16460 Generate output containing quad-word (long double) floating point
16461 instructions.
16463 @item -msoft-quad-float
16464 @opindex msoft-quad-float
16465 Generate output containing library calls for quad-word (long double)
16466 floating point instructions.  The functions called are those specified
16467 in the SPARC ABI@.  This is the default.
16469 As of this writing, there are no SPARC implementations that have hardware
16470 support for the quad-word floating point instructions.  They all invoke
16471 a trap handler for one of these instructions, and then the trap handler
16472 emulates the effect of the instruction.  Because of the trap handler overhead,
16473 this is much slower than calling the ABI library routines.  Thus the
16474 @option{-msoft-quad-float} option is the default.
16476 @item -mno-unaligned-doubles
16477 @itemx -munaligned-doubles
16478 @opindex mno-unaligned-doubles
16479 @opindex munaligned-doubles
16480 Assume that doubles have 8 byte alignment.  This is the default.
16482 With @option{-munaligned-doubles}, GCC assumes that doubles have 8 byte
16483 alignment only if they are contained in another type, or if they have an
16484 absolute address.  Otherwise, it assumes they have 4 byte alignment.
16485 Specifying this option avoids some rare compatibility problems with code
16486 generated by other compilers.  It is not the default because it results
16487 in a performance loss, especially for floating point code.
16489 @item -mno-faster-structs
16490 @itemx -mfaster-structs
16491 @opindex mno-faster-structs
16492 @opindex mfaster-structs
16493 With @option{-mfaster-structs}, the compiler assumes that structures
16494 should have 8 byte alignment.  This enables the use of pairs of
16495 @code{ldd} and @code{std} instructions for copies in structure
16496 assignment, in place of twice as many @code{ld} and @code{st} pairs.
16497 However, the use of this changed alignment directly violates the SPARC
16498 ABI@.  Thus, it's intended only for use on targets where the developer
16499 acknowledges that their resulting code will not be directly in line with
16500 the rules of the ABI@.
16502 @item -mimpure-text
16503 @opindex mimpure-text
16504 @option{-mimpure-text}, used in addition to @option{-shared}, tells
16505 the compiler to not pass @option{-z text} to the linker when linking a
16506 shared object.  Using this option, you can link position-dependent
16507 code into a shared object.
16509 @option{-mimpure-text} suppresses the ``relocations remain against
16510 allocatable but non-writable sections'' linker error message.
16511 However, the necessary relocations will trigger copy-on-write, and the
16512 shared object is not actually shared across processes.  Instead of
16513 using @option{-mimpure-text}, you should compile all source code with
16514 @option{-fpic} or @option{-fPIC}.
16516 This option is only available on SunOS and Solaris.
16518 @item -mcpu=@var{cpu_type}
16519 @opindex mcpu
16520 Set the instruction set, register set, and instruction scheduling parameters
16521 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
16522 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{sparclite},
16523 @samp{f930}, @samp{f934}, @samp{hypersparc}, @samp{sparclite86x},
16524 @samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc},
16525 @samp{ultrasparc3}, @samp{niagara} and @samp{niagara2}.
16527 Default instruction scheduling parameters are used for values that select
16528 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
16529 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
16531 Here is a list of each supported architecture and their supported
16532 implementations.
16534 @smallexample
16535     v7:             cypress
16536     v8:             supersparc, hypersparc
16537     sparclite:      f930, f934, sparclite86x
16538     sparclet:       tsc701
16539     v9:             ultrasparc, ultrasparc3, niagara, niagara2
16540 @end smallexample
16542 By default (unless configured otherwise), GCC generates code for the V7
16543 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
16544 additionally optimizes it for the Cypress CY7C602 chip, as used in the
16545 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
16546 SPARCStation 1, 2, IPX etc.
16548 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
16549 architecture.  The only difference from V7 code is that the compiler emits
16550 the integer multiply and integer divide instructions which exist in SPARC-V8
16551 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
16552 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
16553 2000 series.
16555 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
16556 the SPARC architecture.  This adds the integer multiply, integer divide step
16557 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
16558 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
16559 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
16560 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
16561 MB86934 chip, which is the more recent SPARClite with FPU@.
16563 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
16564 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
16565 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
16566 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
16567 optimizes it for the TEMIC SPARClet chip.
16569 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
16570 architecture.  This adds 64-bit integer and floating-point move instructions,
16571 3 additional floating-point condition code registers and conditional move
16572 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
16573 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
16574 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
16575 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
16576 @option{-mcpu=niagara}, the compiler additionally optimizes it for
16577 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
16578 additionally optimizes it for Sun UltraSPARC T2 chips.
16580 @item -mtune=@var{cpu_type}
16581 @opindex mtune
16582 Set the instruction scheduling parameters for machine type
16583 @var{cpu_type}, but do not set the instruction set or register set that the
16584 option @option{-mcpu=@var{cpu_type}} would.
16586 The same values for @option{-mcpu=@var{cpu_type}} can be used for
16587 @option{-mtune=@var{cpu_type}}, but the only useful values are those
16588 that select a particular cpu implementation.  Those are @samp{cypress},
16589 @samp{supersparc}, @samp{hypersparc}, @samp{f930}, @samp{f934},
16590 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
16591 @samp{ultrasparc3}, @samp{niagara}, and @samp{niagara2}.
16593 @item -mv8plus
16594 @itemx -mno-v8plus
16595 @opindex mv8plus
16596 @opindex mno-v8plus
16597 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
16598 difference from the V8 ABI is that the global and out registers are
16599 considered 64-bit wide.  This is enabled by default on Solaris in 32-bit
16600 mode for all SPARC-V9 processors.
16602 @item -mvis
16603 @itemx -mno-vis
16604 @opindex mvis
16605 @opindex mno-vis
16606 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
16607 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
16608 @end table
16610 These @samp{-m} options are supported in addition to the above
16611 on SPARC-V9 processors in 64-bit environments:
16613 @table @gcctabopt
16614 @item -mlittle-endian
16615 @opindex mlittle-endian
16616 Generate code for a processor running in little-endian mode.  It is only
16617 available for a few configurations and most notably not on Solaris and Linux.
16619 @item -m32
16620 @itemx -m64
16621 @opindex m32
16622 @opindex m64
16623 Generate code for a 32-bit or 64-bit environment.
16624 The 32-bit environment sets int, long and pointer to 32 bits.
16625 The 64-bit environment sets int to 32 bits and long and pointer
16626 to 64 bits.
16628 @item -mcmodel=medlow
16629 @opindex mcmodel=medlow
16630 Generate code for the Medium/Low code model: 64-bit addresses, programs
16631 must be linked in the low 32 bits of memory.  Programs can be statically
16632 or dynamically linked.
16634 @item -mcmodel=medmid
16635 @opindex mcmodel=medmid
16636 Generate code for the Medium/Middle code model: 64-bit addresses, programs
16637 must be linked in the low 44 bits of memory, the text and data segments must
16638 be less than 2GB in size and the data segment must be located within 2GB of
16639 the text segment.
16641 @item -mcmodel=medany
16642 @opindex mcmodel=medany
16643 Generate code for the Medium/Anywhere code model: 64-bit addresses, programs
16644 may be linked anywhere in memory, the text and data segments must be less
16645 than 2GB in size and the data segment must be located within 2GB of the
16646 text segment.
16648 @item -mcmodel=embmedany
16649 @opindex mcmodel=embmedany
16650 Generate code for the Medium/Anywhere code model for embedded systems:
16651 64-bit addresses, the text and data segments must be less than 2GB in
16652 size, both starting anywhere in memory (determined at link time).  The
16653 global register %g4 points to the base of the data segment.  Programs
16654 are statically linked and PIC is not supported.
16656 @item -mstack-bias
16657 @itemx -mno-stack-bias
16658 @opindex mstack-bias
16659 @opindex mno-stack-bias
16660 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
16661 frame pointer if present, are offset by @minus{}2047 which must be added back
16662 when making stack frame references.  This is the default in 64-bit mode.
16663 Otherwise, assume no such offset is present.
16664 @end table
16666 These switches are supported in addition to the above on Solaris:
16668 @table @gcctabopt
16669 @item -threads
16670 @opindex threads
16671 Add support for multithreading using the Solaris threads library.  This
16672 option sets flags for both the preprocessor and linker.  This option does
16673 not affect the thread safety of object code produced by the compiler or
16674 that of libraries supplied with it.
16676 @item -pthreads
16677 @opindex pthreads
16678 Add support for multithreading using the POSIX threads library.  This
16679 option sets flags for both the preprocessor and linker.  This option does
16680 not affect the thread safety of object code produced  by the compiler or
16681 that of libraries supplied with it.
16683 @item -pthread
16684 @opindex pthread
16685 This is a synonym for @option{-pthreads}.
16686 @end table
16688 @node SPU Options
16689 @subsection SPU Options
16690 @cindex SPU options
16692 These @samp{-m} options are supported on the SPU:
16694 @table @gcctabopt
16695 @item -mwarn-reloc
16696 @itemx -merror-reloc
16697 @opindex mwarn-reloc
16698 @opindex merror-reloc
16700 The loader for SPU does not handle dynamic relocations.  By default, GCC
16701 will give an error when it generates code that requires a dynamic
16702 relocation.  @option{-mno-error-reloc} disables the error,
16703 @option{-mwarn-reloc} will generate a warning instead.
16705 @item -msafe-dma
16706 @itemx -munsafe-dma
16707 @opindex msafe-dma
16708 @opindex munsafe-dma
16710 Instructions which initiate or test completion of DMA must not be
16711 reordered with respect to loads and stores of the memory which is being
16712 accessed.  Users typically address this problem using the volatile
16713 keyword, but that can lead to inefficient code in places where the
16714 memory is known to not change.  Rather than mark the memory as volatile
16715 we treat the DMA instructions as potentially effecting all memory.  With
16716 @option{-munsafe-dma} users must use the volatile keyword to protect
16717 memory accesses.
16719 @item -mbranch-hints
16720 @opindex mbranch-hints
16722 By default, GCC will generate a branch hint instruction to avoid
16723 pipeline stalls for always taken or probably taken branches.  A hint
16724 will not be generated closer than 8 instructions away from its branch.
16725 There is little reason to disable them, except for debugging purposes,
16726 or to make an object a little bit smaller.
16728 @item -msmall-mem
16729 @itemx -mlarge-mem
16730 @opindex msmall-mem
16731 @opindex mlarge-mem
16733 By default, GCC generates code assuming that addresses are never larger
16734 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
16735 a full 32 bit address.
16737 @item -mstdmain
16738 @opindex mstdmain
16740 By default, GCC links against startup code that assumes the SPU-style
16741 main function interface (which has an unconventional parameter list).
16742 With @option{-mstdmain}, GCC will link your program against startup
16743 code that assumes a C99-style interface to @code{main}, including a
16744 local copy of @code{argv} strings.
16746 @item -mfixed-range=@var{register-range}
16747 @opindex mfixed-range
16748 Generate code treating the given register range as fixed registers.
16749 A fixed register is one that the register allocator can not use.  This is
16750 useful when compiling kernel code.  A register range is specified as
16751 two registers separated by a dash.  Multiple register ranges can be
16752 specified separated by a comma.
16754 @item -mea32
16755 @itemx -mea64
16756 @opindex mea32
16757 @opindex mea64
16758 Compile code assuming that pointers to the PPU address space accessed
16759 via the @code{__ea} named address space qualifier are either 32 or 64
16760 bits wide.  The default is 32 bits.  As this is an ABI changing option,
16761 all object code in an executable must be compiled with the same setting.
16763 @item -maddress-space-conversion
16764 @itemx -mno-address-space-conversion
16765 @opindex maddress-space-conversion
16766 @opindex mno-address-space-conversion
16767 Allow/disallow treating the @code{__ea} address space as superset
16768 of the generic address space.  This enables explicit type casts
16769 between @code{__ea} and generic pointer as well as implicit
16770 conversions of generic pointers to @code{__ea} pointers.  The
16771 default is to allow address space pointer conversions.
16773 @item -mcache-size=@var{cache-size}
16774 @opindex mcache-size
16775 This option controls the version of libgcc that the compiler links to an
16776 executable and selects a software-managed cache for accessing variables
16777 in the @code{__ea} address space with a particular cache size.  Possible
16778 options for @var{cache-size} are @samp{8}, @samp{16}, @samp{32}, @samp{64}
16779 and @samp{128}.  The default cache size is 64KB.
16781 @item -matomic-updates
16782 @itemx -mno-atomic-updates
16783 @opindex matomic-updates
16784 @opindex mno-atomic-updates
16785 This option controls the version of libgcc that the compiler links to an
16786 executable and selects whether atomic updates to the software-managed
16787 cache of PPU-side variables are used.  If you use atomic updates, changes
16788 to a PPU variable from SPU code using the @code{__ea} named address space
16789 qualifier will not interfere with changes to other PPU variables residing
16790 in the same cache line from PPU code.  If you do not use atomic updates,
16791 such interference may occur; however, writing back cache lines will be
16792 more efficient.  The default behavior is to use atomic updates.
16794 @item -mdual-nops
16795 @itemx -mdual-nops=@var{n}
16796 @opindex mdual-nops
16797 By default, GCC will insert nops to increase dual issue when it expects
16798 it to increase performance.  @var{n} can be a value from 0 to 10.  A
16799 smaller @var{n} will insert fewer nops.  10 is the default, 0 is the
16800 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
16802 @item -mhint-max-nops=@var{n}
16803 @opindex mhint-max-nops
16804 Maximum number of nops to insert for a branch hint.  A branch hint must
16805 be at least 8 instructions away from the branch it is effecting.  GCC
16806 will insert up to @var{n} nops to enforce this, otherwise it will not
16807 generate the branch hint.
16809 @item -mhint-max-distance=@var{n}
16810 @opindex mhint-max-distance
16811 The encoding of the branch hint instruction limits the hint to be within
16812 256 instructions of the branch it is effecting.  By default, GCC makes
16813 sure it is within 125.
16815 @item -msafe-hints
16816 @opindex msafe-hints
16817 Work around a hardware bug which causes the SPU to stall indefinitely.
16818 By default, GCC will insert the @code{hbrp} instruction to make sure
16819 this stall won't happen.
16821 @end table
16823 @node System V Options
16824 @subsection Options for System V
16826 These additional options are available on System V Release 4 for
16827 compatibility with other compilers on those systems:
16829 @table @gcctabopt
16830 @item -G
16831 @opindex G
16832 Create a shared object.
16833 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
16835 @item -Qy
16836 @opindex Qy
16837 Identify the versions of each tool used by the compiler, in a
16838 @code{.ident} assembler directive in the output.
16840 @item -Qn
16841 @opindex Qn
16842 Refrain from adding @code{.ident} directives to the output file (this is
16843 the default).
16845 @item -YP,@var{dirs}
16846 @opindex YP
16847 Search the directories @var{dirs}, and no others, for libraries
16848 specified with @option{-l}.
16850 @item -Ym,@var{dir}
16851 @opindex Ym
16852 Look in the directory @var{dir} to find the M4 preprocessor.
16853 The assembler uses this option.
16854 @c This is supposed to go with a -Yd for predefined M4 macro files, but
16855 @c the generic assembler that comes with Solaris takes just -Ym.
16856 @end table
16858 @node V850 Options
16859 @subsection V850 Options
16860 @cindex V850 Options
16862 These @samp{-m} options are defined for V850 implementations:
16864 @table @gcctabopt
16865 @item -mlong-calls
16866 @itemx -mno-long-calls
16867 @opindex mlong-calls
16868 @opindex mno-long-calls
16869 Treat all calls as being far away (near).  If calls are assumed to be
16870 far away, the compiler will always load the functions address up into a
16871 register, and call indirect through the pointer.
16873 @item -mno-ep
16874 @itemx -mep
16875 @opindex mno-ep
16876 @opindex mep
16877 Do not optimize (do optimize) basic blocks that use the same index
16878 pointer 4 or more times to copy pointer into the @code{ep} register, and
16879 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
16880 option is on by default if you optimize.
16882 @item -mno-prolog-function
16883 @itemx -mprolog-function
16884 @opindex mno-prolog-function
16885 @opindex mprolog-function
16886 Do not use (do use) external functions to save and restore registers
16887 at the prologue and epilogue of a function.  The external functions
16888 are slower, but use less code space if more than one function saves
16889 the same number of registers.  The @option{-mprolog-function} option
16890 is on by default if you optimize.
16892 @item -mspace
16893 @opindex mspace
16894 Try to make the code as small as possible.  At present, this just turns
16895 on the @option{-mep} and @option{-mprolog-function} options.
16897 @item -mtda=@var{n}
16898 @opindex mtda
16899 Put static or global variables whose size is @var{n} bytes or less into
16900 the tiny data area that register @code{ep} points to.  The tiny data
16901 area can hold up to 256 bytes in total (128 bytes for byte references).
16903 @item -msda=@var{n}
16904 @opindex msda
16905 Put static or global variables whose size is @var{n} bytes or less into
16906 the small data area that register @code{gp} points to.  The small data
16907 area can hold up to 64 kilobytes.
16909 @item -mzda=@var{n}
16910 @opindex mzda
16911 Put static or global variables whose size is @var{n} bytes or less into
16912 the first 32 kilobytes of memory.
16914 @item -mv850
16915 @opindex mv850
16916 Specify that the target processor is the V850.
16918 @item -mbig-switch
16919 @opindex mbig-switch
16920 Generate code suitable for big switch tables.  Use this option only if
16921 the assembler/linker complain about out of range branches within a switch
16922 table.
16924 @item -mapp-regs
16925 @opindex mapp-regs
16926 This option will cause r2 and r5 to be used in the code generated by
16927 the compiler.  This setting is the default.
16929 @item -mno-app-regs
16930 @opindex mno-app-regs
16931 This option will cause r2 and r5 to be treated as fixed registers.
16933 @item -mv850e1
16934 @opindex mv850e1
16935 Specify that the target processor is the V850E1.  The preprocessor
16936 constants @samp{__v850e1__} and @samp{__v850e__} will be defined if
16937 this option is used.
16939 @item -mv850e
16940 @opindex mv850e
16941 Specify that the target processor is the V850E@.  The preprocessor
16942 constant @samp{__v850e__} will be defined if this option is used.
16944 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
16945 are defined then a default target processor will be chosen and the
16946 relevant @samp{__v850*__} preprocessor constant will be defined.
16948 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
16949 defined, regardless of which processor variant is the target.
16951 @item -mdisable-callt
16952 @opindex mdisable-callt
16953 This option will suppress generation of the CALLT instruction for the
16954 v850e and v850e1 flavors of the v850 architecture.  The default is
16955 @option{-mno-disable-callt} which allows the CALLT instruction to be used.
16957 @end table
16959 @node VAX Options
16960 @subsection VAX Options
16961 @cindex VAX options
16963 These @samp{-m} options are defined for the VAX:
16965 @table @gcctabopt
16966 @item -munix
16967 @opindex munix
16968 Do not output certain jump instructions (@code{aobleq} and so on)
16969 that the Unix assembler for the VAX cannot handle across long
16970 ranges.
16972 @item -mgnu
16973 @opindex mgnu
16974 Do output those jump instructions, on the assumption that you
16975 will assemble with the GNU assembler.
16977 @item -mg
16978 @opindex mg
16979 Output code for g-format floating point numbers instead of d-format.
16980 @end table
16982 @node VxWorks Options
16983 @subsection VxWorks Options
16984 @cindex VxWorks Options
16986 The options in this section are defined for all VxWorks targets.
16987 Options specific to the target hardware are listed with the other
16988 options for that target.
16990 @table @gcctabopt
16991 @item -mrtp
16992 @opindex mrtp
16993 GCC can generate code for both VxWorks kernels and real time processes
16994 (RTPs).  This option switches from the former to the latter.  It also
16995 defines the preprocessor macro @code{__RTP__}.
16997 @item -non-static
16998 @opindex non-static
16999 Link an RTP executable against shared libraries rather than static
17000 libraries.  The options @option{-static} and @option{-shared} can
17001 also be used for RTPs (@pxref{Link Options}); @option{-static}
17002 is the default.
17004 @item -Bstatic
17005 @itemx -Bdynamic
17006 @opindex Bstatic
17007 @opindex Bdynamic
17008 These options are passed down to the linker.  They are defined for
17009 compatibility with Diab.
17011 @item -Xbind-lazy
17012 @opindex Xbind-lazy
17013 Enable lazy binding of function calls.  This option is equivalent to
17014 @option{-Wl,-z,now} and is defined for compatibility with Diab.
17016 @item -Xbind-now
17017 @opindex Xbind-now
17018 Disable lazy binding of function calls.  This option is the default and
17019 is defined for compatibility with Diab.
17020 @end table
17022 @node x86-64 Options
17023 @subsection x86-64 Options
17024 @cindex x86-64 options
17026 These are listed under @xref{i386 and x86-64 Options}.
17028 @node i386 and x86-64 Windows Options
17029 @subsection i386 and x86-64 Windows Options
17030 @cindex i386 and x86-64 Windows Options
17032 These additional options are available for Windows targets:
17034 @table @gcctabopt
17035 @item -mconsole
17036 @opindex mconsole
17037 This option is available for Cygwin and MinGW targets.  It
17038 specifies that a console application is to be generated, by
17039 instructing the linker to set the PE header subsystem type
17040 required for console applications.
17041 This is the default behavior for Cygwin and MinGW targets.
17043 @item -mcygwin
17044 @opindex mcygwin
17045 This option is available for Cygwin targets.  It specifies that
17046 the Cygwin internal interface is to be used for predefined
17047 preprocessor macros, C runtime libraries and related linker
17048 paths and options.  For Cygwin targets this is the default behavior.
17049 This option is deprecated and will be removed in a future release.
17051 @item -mno-cygwin
17052 @opindex mno-cygwin
17053 This option is available for Cygwin targets.  It specifies that
17054 the MinGW internal interface is to be used instead of Cygwin's, by
17055 setting MinGW-related predefined macros and linker paths and default
17056 library options.
17057 This option is deprecated and will be removed in a future release.
17059 @item -mdll
17060 @opindex mdll
17061 This option is available for Cygwin and MinGW targets.  It
17062 specifies that a DLL - a dynamic link library - is to be
17063 generated, enabling the selection of the required runtime
17064 startup object and entry point.
17066 @item -mnop-fun-dllimport
17067 @opindex mnop-fun-dllimport
17068 This option is available for Cygwin and MinGW targets.  It
17069 specifies that the dllimport attribute should be ignored.
17071 @item -mthread
17072 @opindex mthread
17073 This option is available for MinGW targets. It specifies
17074 that MinGW-specific thread support is to be used.
17076 @item -municode
17077 @opindex municode
17078 This option is available for mingw-w64 targets.  It specifies
17079 that the UNICODE macro is getting pre-defined and that the
17080 unicode capable runtime startup code is chosen.
17082 @item -mwin32
17083 @opindex mwin32
17084 This option is available for Cygwin and MinGW targets.  It
17085 specifies that the typical Windows pre-defined macros are to
17086 be set in the pre-processor, but does not influence the choice
17087 of runtime library/startup code.
17089 @item -mwindows
17090 @opindex mwindows
17091 This option is available for Cygwin and MinGW targets.  It
17092 specifies that a GUI application is to be generated by
17093 instructing the linker to set the PE header subsystem type
17094 appropriately.
17096 @item -fno-set-stack-executable
17097 @opindex fno-set-stack-executable
17098 This option is available for MinGW targets. It specifies that
17099 the executable flag for stack used by nested functions isn't
17100 set. This is necessary for binaries running in kernel mode of
17101 Windows, as there the user32 API, which is used to set executable
17102 privileges, isn't available.
17104 @item -mpe-aligned-commons
17105 @opindex mpe-aligned-commons
17106 This option is available for Cygwin and MinGW targets.  It
17107 specifies that the GNU extension to the PE file format that
17108 permits the correct alignment of COMMON variables should be
17109 used when generating code.  It will be enabled by default if
17110 GCC detects that the target assembler found during configuration
17111 supports the feature.
17112 @end table
17114 See also under @ref{i386 and x86-64 Options} for standard options.
17116 @node Xstormy16 Options
17117 @subsection Xstormy16 Options
17118 @cindex Xstormy16 Options
17120 These options are defined for Xstormy16:
17122 @table @gcctabopt
17123 @item -msim
17124 @opindex msim
17125 Choose startup files and linker script suitable for the simulator.
17126 @end table
17128 @node Xtensa Options
17129 @subsection Xtensa Options
17130 @cindex Xtensa Options
17132 These options are supported for Xtensa targets:
17134 @table @gcctabopt
17135 @item -mconst16
17136 @itemx -mno-const16
17137 @opindex mconst16
17138 @opindex mno-const16
17139 Enable or disable use of @code{CONST16} instructions for loading
17140 constant values.  The @code{CONST16} instruction is currently not a
17141 standard option from Tensilica.  When enabled, @code{CONST16}
17142 instructions are always used in place of the standard @code{L32R}
17143 instructions.  The use of @code{CONST16} is enabled by default only if
17144 the @code{L32R} instruction is not available.
17146 @item -mfused-madd
17147 @itemx -mno-fused-madd
17148 @opindex mfused-madd
17149 @opindex mno-fused-madd
17150 Enable or disable use of fused multiply/add and multiply/subtract
17151 instructions in the floating-point option.  This has no effect if the
17152 floating-point option is not also enabled.  Disabling fused multiply/add
17153 and multiply/subtract instructions forces the compiler to use separate
17154 instructions for the multiply and add/subtract operations.  This may be
17155 desirable in some cases where strict IEEE 754-compliant results are
17156 required: the fused multiply add/subtract instructions do not round the
17157 intermediate result, thereby producing results with @emph{more} bits of
17158 precision than specified by the IEEE standard.  Disabling fused multiply
17159 add/subtract instructions also ensures that the program output is not
17160 sensitive to the compiler's ability to combine multiply and add/subtract
17161 operations.
17163 @item -mserialize-volatile
17164 @itemx -mno-serialize-volatile
17165 @opindex mserialize-volatile
17166 @opindex mno-serialize-volatile
17167 When this option is enabled, GCC inserts @code{MEMW} instructions before
17168 @code{volatile} memory references to guarantee sequential consistency.
17169 The default is @option{-mserialize-volatile}.  Use
17170 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
17172 @item -mforce-no-pic
17173 @opindex mforce-no-pic
17174 For targets, like GNU/Linux, where all user-mode Xtensa code must be
17175 position-independent code (PIC), this option disables PIC for compiling
17176 kernel code.
17178 @item -mtext-section-literals
17179 @itemx -mno-text-section-literals
17180 @opindex mtext-section-literals
17181 @opindex mno-text-section-literals
17182 Control the treatment of literal pools.  The default is
17183 @option{-mno-text-section-literals}, which places literals in a separate
17184 section in the output file.  This allows the literal pool to be placed
17185 in a data RAM/ROM, and it also allows the linker to combine literal
17186 pools from separate object files to remove redundant literals and
17187 improve code size.  With @option{-mtext-section-literals}, the literals
17188 are interspersed in the text section in order to keep them as close as
17189 possible to their references.  This may be necessary for large assembly
17190 files.
17192 @item -mtarget-align
17193 @itemx -mno-target-align
17194 @opindex mtarget-align
17195 @opindex mno-target-align
17196 When this option is enabled, GCC instructs the assembler to
17197 automatically align instructions to reduce branch penalties at the
17198 expense of some code density.  The assembler attempts to widen density
17199 instructions to align branch targets and the instructions following call
17200 instructions.  If there are not enough preceding safe density
17201 instructions to align a target, no widening will be performed.  The
17202 default is @option{-mtarget-align}.  These options do not affect the
17203 treatment of auto-aligned instructions like @code{LOOP}, which the
17204 assembler will always align, either by widening density instructions or
17205 by inserting no-op instructions.
17207 @item -mlongcalls
17208 @itemx -mno-longcalls
17209 @opindex mlongcalls
17210 @opindex mno-longcalls
17211 When this option is enabled, GCC instructs the assembler to translate
17212 direct calls to indirect calls unless it can determine that the target
17213 of a direct call is in the range allowed by the call instruction.  This
17214 translation typically occurs for calls to functions in other source
17215 files.  Specifically, the assembler translates a direct @code{CALL}
17216 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
17217 The default is @option{-mno-longcalls}.  This option should be used in
17218 programs where the call target can potentially be out of range.  This
17219 option is implemented in the assembler, not the compiler, so the
17220 assembly code generated by GCC will still show direct call
17221 instructions---look at the disassembled object code to see the actual
17222 instructions.  Note that the assembler will use an indirect call for
17223 every cross-file call, not just those that really will be out of range.
17224 @end table
17226 @node zSeries Options
17227 @subsection zSeries Options
17228 @cindex zSeries options
17230 These are listed under @xref{S/390 and zSeries Options}.
17232 @node Code Gen Options
17233 @section Options for Code Generation Conventions
17234 @cindex code generation conventions
17235 @cindex options, code generation
17236 @cindex run-time options
17238 These machine-independent options control the interface conventions
17239 used in code generation.
17241 Most of them have both positive and negative forms; the negative form
17242 of @option{-ffoo} would be @option{-fno-foo}.  In the table below, only
17243 one of the forms is listed---the one which is not the default.  You
17244 can figure out the other form by either removing @samp{no-} or adding
17247 @table @gcctabopt
17248 @item -fbounds-check
17249 @opindex fbounds-check
17250 For front-ends that support it, generate additional code to check that
17251 indices used to access arrays are within the declared range.  This is
17252 currently only supported by the Java and Fortran front-ends, where
17253 this option defaults to true and false respectively.
17255 @item -ftrapv
17256 @opindex ftrapv
17257 This option generates traps for signed overflow on addition, subtraction,
17258 multiplication operations.
17260 @item -fwrapv
17261 @opindex fwrapv
17262 This option instructs the compiler to assume that signed arithmetic
17263 overflow of addition, subtraction and multiplication wraps around
17264 using twos-complement representation.  This flag enables some optimizations
17265 and disables others.  This option is enabled by default for the Java
17266 front-end, as required by the Java language specification.
17268 @item -fexceptions
17269 @opindex fexceptions
17270 Enable exception handling.  Generates extra code needed to propagate
17271 exceptions.  For some targets, this implies GCC will generate frame
17272 unwind information for all functions, which can produce significant data
17273 size overhead, although it does not affect execution.  If you do not
17274 specify this option, GCC will enable it by default for languages like
17275 C++ which normally require exception handling, and disable it for
17276 languages like C that do not normally require it.  However, you may need
17277 to enable this option when compiling C code that needs to interoperate
17278 properly with exception handlers written in C++.  You may also wish to
17279 disable this option if you are compiling older C++ programs that don't
17280 use exception handling.
17282 @item -fnon-call-exceptions
17283 @opindex fnon-call-exceptions
17284 Generate code that allows trapping instructions to throw exceptions.
17285 Note that this requires platform-specific runtime support that does
17286 not exist everywhere.  Moreover, it only allows @emph{trapping}
17287 instructions to throw exceptions, i.e.@: memory references or floating
17288 point instructions.  It does not allow exceptions to be thrown from
17289 arbitrary signal handlers such as @code{SIGALRM}.
17291 @item -funwind-tables
17292 @opindex funwind-tables
17293 Similar to @option{-fexceptions}, except that it will just generate any needed
17294 static data, but will not affect the generated code in any other way.
17295 You will normally not enable this option; instead, a language processor
17296 that needs this handling would enable it on your behalf.
17298 @item -fasynchronous-unwind-tables
17299 @opindex fasynchronous-unwind-tables
17300 Generate unwind table in dwarf2 format, if supported by target machine.  The
17301 table is exact at each instruction boundary, so it can be used for stack
17302 unwinding from asynchronous events (such as debugger or garbage collector).
17304 @item -fpcc-struct-return
17305 @opindex fpcc-struct-return
17306 Return ``short'' @code{struct} and @code{union} values in memory like
17307 longer ones, rather than in registers.  This convention is less
17308 efficient, but it has the advantage of allowing intercallability between
17309 GCC-compiled files and files compiled with other compilers, particularly
17310 the Portable C Compiler (pcc).
17312 The precise convention for returning structures in memory depends
17313 on the target configuration macros.
17315 Short structures and unions are those whose size and alignment match
17316 that of some integer type.
17318 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
17319 switch is not binary compatible with code compiled with the
17320 @option{-freg-struct-return} switch.
17321 Use it to conform to a non-default application binary interface.
17323 @item -freg-struct-return
17324 @opindex freg-struct-return
17325 Return @code{struct} and @code{union} values in registers when possible.
17326 This is more efficient for small structures than
17327 @option{-fpcc-struct-return}.
17329 If you specify neither @option{-fpcc-struct-return} nor
17330 @option{-freg-struct-return}, GCC defaults to whichever convention is
17331 standard for the target.  If there is no standard convention, GCC
17332 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
17333 the principal compiler.  In those cases, we can choose the standard, and
17334 we chose the more efficient register return alternative.
17336 @strong{Warning:} code compiled with the @option{-freg-struct-return}
17337 switch is not binary compatible with code compiled with the
17338 @option{-fpcc-struct-return} switch.
17339 Use it to conform to a non-default application binary interface.
17341 @item -fshort-enums
17342 @opindex fshort-enums
17343 Allocate to an @code{enum} type only as many bytes as it needs for the
17344 declared range of possible values.  Specifically, the @code{enum} type
17345 will be equivalent to the smallest integer type which has enough room.
17347 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
17348 code that is not binary compatible with code generated without that switch.
17349 Use it to conform to a non-default application binary interface.
17351 @item -fshort-double
17352 @opindex fshort-double
17353 Use the same size for @code{double} as for @code{float}.
17355 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
17356 code that is not binary compatible with code generated without that switch.
17357 Use it to conform to a non-default application binary interface.
17359 @item -fshort-wchar
17360 @opindex fshort-wchar
17361 Override the underlying type for @samp{wchar_t} to be @samp{short
17362 unsigned int} instead of the default for the target.  This option is
17363 useful for building programs to run under WINE@.
17365 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
17366 code that is not binary compatible with code generated without that switch.
17367 Use it to conform to a non-default application binary interface.
17369 @item -fno-common
17370 @opindex fno-common
17371 In C code, controls the placement of uninitialized global variables.
17372 Unix C compilers have traditionally permitted multiple definitions of
17373 such variables in different compilation units by placing the variables
17374 in a common block.
17375 This is the behavior specified by @option{-fcommon}, and is the default
17376 for GCC on most targets.
17377 On the other hand, this behavior is not required by ISO C, and on some
17378 targets may carry a speed or code size penalty on variable references.
17379 The @option{-fno-common} option specifies that the compiler should place
17380 uninitialized global variables in the data section of the object file,
17381 rather than generating them as common blocks.
17382 This has the effect that if the same variable is declared
17383 (without @code{extern}) in two different compilations,
17384 you will get a multiple-definition error when you link them.
17385 In this case, you must compile with @option{-fcommon} instead.
17386 Compiling with @option{-fno-common} is useful on targets for which
17387 it provides better performance, or if you wish to verify that the
17388 program will work on other systems which always treat uninitialized
17389 variable declarations this way.
17391 @item -fno-ident
17392 @opindex fno-ident
17393 Ignore the @samp{#ident} directive.
17395 @item -finhibit-size-directive
17396 @opindex finhibit-size-directive
17397 Don't output a @code{.size} assembler directive, or anything else that
17398 would cause trouble if the function is split in the middle, and the
17399 two halves are placed at locations far apart in memory.  This option is
17400 used when compiling @file{crtstuff.c}; you should not need to use it
17401 for anything else.
17403 @item -fverbose-asm
17404 @opindex fverbose-asm
17405 Put extra commentary information in the generated assembly code to
17406 make it more readable.  This option is generally only of use to those
17407 who actually need to read the generated assembly code (perhaps while
17408 debugging the compiler itself).
17410 @option{-fno-verbose-asm}, the default, causes the
17411 extra information to be omitted and is useful when comparing two assembler
17412 files.
17414 @item -frecord-gcc-switches
17415 @opindex frecord-gcc-switches
17416 This switch causes the command line that was used to invoke the
17417 compiler to be recorded into the object file that is being created.
17418 This switch is only implemented on some targets and the exact format
17419 of the recording is target and binary file format dependent, but it
17420 usually takes the form of a section containing ASCII text.  This
17421 switch is related to the @option{-fverbose-asm} switch, but that
17422 switch only records information in the assembler output file as
17423 comments, so it never reaches the object file.
17425 @item -fpic
17426 @opindex fpic
17427 @cindex global offset table
17428 @cindex PIC
17429 Generate position-independent code (PIC) suitable for use in a shared
17430 library, if supported for the target machine.  Such code accesses all
17431 constant addresses through a global offset table (GOT)@.  The dynamic
17432 loader resolves the GOT entries when the program starts (the dynamic
17433 loader is not part of GCC; it is part of the operating system).  If
17434 the GOT size for the linked executable exceeds a machine-specific
17435 maximum size, you get an error message from the linker indicating that
17436 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
17437 instead.  (These maximums are 8k on the SPARC and 32k
17438 on the m68k and RS/6000.  The 386 has no such limit.)
17440 Position-independent code requires special support, and therefore works
17441 only on certain machines.  For the 386, GCC supports PIC for System V
17442 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
17443 position-independent.
17445 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
17446 are defined to 1.
17448 @item -fPIC
17449 @opindex fPIC
17450 If supported for the target machine, emit position-independent code,
17451 suitable for dynamic linking and avoiding any limit on the size of the
17452 global offset table.  This option makes a difference on the m68k,
17453 PowerPC and SPARC@.
17455 Position-independent code requires special support, and therefore works
17456 only on certain machines.
17458 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
17459 are defined to 2.
17461 @item -fpie
17462 @itemx -fPIE
17463 @opindex fpie
17464 @opindex fPIE
17465 These options are similar to @option{-fpic} and @option{-fPIC}, but
17466 generated position independent code can be only linked into executables.
17467 Usually these options are used when @option{-pie} GCC option will be
17468 used during linking.
17470 @option{-fpie} and @option{-fPIE} both define the macros
17471 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
17472 for @option{-fpie} and 2 for @option{-fPIE}.
17474 @item -fno-jump-tables
17475 @opindex fno-jump-tables
17476 Do not use jump tables for switch statements even where it would be
17477 more efficient than other code generation strategies.  This option is
17478 of use in conjunction with @option{-fpic} or @option{-fPIC} for
17479 building code which forms part of a dynamic linker and cannot
17480 reference the address of a jump table.  On some targets, jump tables
17481 do not require a GOT and this option is not needed.
17483 @item -ffixed-@var{reg}
17484 @opindex ffixed
17485 Treat the register named @var{reg} as a fixed register; generated code
17486 should never refer to it (except perhaps as a stack pointer, frame
17487 pointer or in some other fixed role).
17489 @var{reg} must be the name of a register.  The register names accepted
17490 are machine-specific and are defined in the @code{REGISTER_NAMES}
17491 macro in the machine description macro file.
17493 This flag does not have a negative form, because it specifies a
17494 three-way choice.
17496 @item -fcall-used-@var{reg}
17497 @opindex fcall-used
17498 Treat the register named @var{reg} as an allocable register that is
17499 clobbered by function calls.  It may be allocated for temporaries or
17500 variables that do not live across a call.  Functions compiled this way
17501 will not save and restore the register @var{reg}.
17503 It is an error to used this flag with the frame pointer or stack pointer.
17504 Use of this flag for other registers that have fixed pervasive roles in
17505 the machine's execution model will produce disastrous results.
17507 This flag does not have a negative form, because it specifies a
17508 three-way choice.
17510 @item -fcall-saved-@var{reg}
17511 @opindex fcall-saved
17512 Treat the register named @var{reg} as an allocable register saved by
17513 functions.  It may be allocated even for temporaries or variables that
17514 live across a call.  Functions compiled this way will save and restore
17515 the register @var{reg} if they use it.
17517 It is an error to used this flag with the frame pointer or stack pointer.
17518 Use of this flag for other registers that have fixed pervasive roles in
17519 the machine's execution model will produce disastrous results.
17521 A different sort of disaster will result from the use of this flag for
17522 a register in which function values may be returned.
17524 This flag does not have a negative form, because it specifies a
17525 three-way choice.
17527 @item -fpack-struct[=@var{n}]
17528 @opindex fpack-struct
17529 Without a value specified, pack all structure members together without
17530 holes.  When a value is specified (which must be a small power of two), pack
17531 structure members according to this value, representing the maximum
17532 alignment (that is, objects with default alignment requirements larger than
17533 this will be output potentially unaligned at the next fitting location.
17535 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
17536 code that is not binary compatible with code generated without that switch.
17537 Additionally, it makes the code suboptimal.
17538 Use it to conform to a non-default application binary interface.
17540 @item -finstrument-functions
17541 @opindex finstrument-functions
17542 Generate instrumentation calls for entry and exit to functions.  Just
17543 after function entry and just before function exit, the following
17544 profiling functions will be called with the address of the current
17545 function and its call site.  (On some platforms,
17546 @code{__builtin_return_address} does not work beyond the current
17547 function, so the call site information may not be available to the
17548 profiling functions otherwise.)
17550 @smallexample
17551 void __cyg_profile_func_enter (void *this_fn,
17552                                void *call_site);
17553 void __cyg_profile_func_exit  (void *this_fn,
17554                                void *call_site);
17555 @end smallexample
17557 The first argument is the address of the start of the current function,
17558 which may be looked up exactly in the symbol table.
17560 This instrumentation is also done for functions expanded inline in other
17561 functions.  The profiling calls will indicate where, conceptually, the
17562 inline function is entered and exited.  This means that addressable
17563 versions of such functions must be available.  If all your uses of a
17564 function are expanded inline, this may mean an additional expansion of
17565 code size.  If you use @samp{extern inline} in your C code, an
17566 addressable version of such functions must be provided.  (This is
17567 normally the case anyways, but if you get lucky and the optimizer always
17568 expands the functions inline, you might have gotten away without
17569 providing static copies.)
17571 A function may be given the attribute @code{no_instrument_function}, in
17572 which case this instrumentation will not be done.  This can be used, for
17573 example, for the profiling functions listed above, high-priority
17574 interrupt routines, and any functions from which the profiling functions
17575 cannot safely be called (perhaps signal handlers, if the profiling
17576 routines generate output or allocate memory).
17578 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
17579 @opindex finstrument-functions-exclude-file-list
17581 Set the list of functions that are excluded from instrumentation (see
17582 the description of @code{-finstrument-functions}).  If the file that
17583 contains a function definition matches with one of @var{file}, then
17584 that function is not instrumented.  The match is done on substrings:
17585 if the @var{file} parameter is a substring of the file name, it is
17586 considered to be a match.
17588 For example,
17589 @code{-finstrument-functions-exclude-file-list=/bits/stl,include/sys}
17590 will exclude any inline function defined in files whose pathnames
17591 contain @code{/bits/stl} or @code{include/sys}.
17593 If, for some reason, you want to include letter @code{','} in one of
17594 @var{sym}, write @code{'\,'}. For example,
17595 @code{-finstrument-functions-exclude-file-list='\,\,tmp'}
17596 (note the single quote surrounding the option).
17598 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
17599 @opindex finstrument-functions-exclude-function-list
17601 This is similar to @code{-finstrument-functions-exclude-file-list},
17602 but this option sets the list of function names to be excluded from
17603 instrumentation.  The function name to be matched is its user-visible
17604 name, such as @code{vector<int> blah(const vector<int> &)}, not the
17605 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
17606 match is done on substrings: if the @var{sym} parameter is a substring
17607 of the function name, it is considered to be a match.  For C99 and C++
17608 extended identifiers, the function name must be given in UTF-8, not
17609 using universal character names.
17611 @item -fstack-check
17612 @opindex fstack-check
17613 Generate code to verify that you do not go beyond the boundary of the
17614 stack.  You should specify this flag if you are running in an
17615 environment with multiple threads, but only rarely need to specify it in
17616 a single-threaded environment since stack overflow is automatically
17617 detected on nearly all systems if there is only one stack.
17619 Note that this switch does not actually cause checking to be done; the
17620 operating system or the language runtime must do that.  The switch causes
17621 generation of code to ensure that they see the stack being extended.
17623 You can additionally specify a string parameter: @code{no} means no
17624 checking, @code{generic} means force the use of old-style checking,
17625 @code{specific} means use the best checking method and is equivalent
17626 to bare @option{-fstack-check}.
17628 Old-style checking is a generic mechanism that requires no specific
17629 target support in the compiler but comes with the following drawbacks:
17631 @enumerate
17632 @item
17633 Modified allocation strategy for large objects: they will always be
17634 allocated dynamically if their size exceeds a fixed threshold.
17636 @item
17637 Fixed limit on the size of the static frame of functions: when it is
17638 topped by a particular function, stack checking is not reliable and
17639 a warning is issued by the compiler.
17641 @item
17642 Inefficiency: because of both the modified allocation strategy and the
17643 generic implementation, the performances of the code are hampered.
17644 @end enumerate
17646 Note that old-style stack checking is also the fallback method for
17647 @code{specific} if no target support has been added in the compiler.
17649 @item -fstack-limit-register=@var{reg}
17650 @itemx -fstack-limit-symbol=@var{sym}
17651 @itemx -fno-stack-limit
17652 @opindex fstack-limit-register
17653 @opindex fstack-limit-symbol
17654 @opindex fno-stack-limit
17655 Generate code to ensure that the stack does not grow beyond a certain value,
17656 either the value of a register or the address of a symbol.  If the stack
17657 would grow beyond the value, a signal is raised.  For most targets,
17658 the signal is raised before the stack overruns the boundary, so
17659 it is possible to catch the signal without taking special precautions.
17661 For instance, if the stack starts at absolute address @samp{0x80000000}
17662 and grows downwards, you can use the flags
17663 @option{-fstack-limit-symbol=__stack_limit} and
17664 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
17665 of 128KB@.  Note that this may only work with the GNU linker.
17667 @item -fleading-underscore
17668 @opindex fleading-underscore
17669 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
17670 change the way C symbols are represented in the object file.  One use
17671 is to help link with legacy assembly code.
17673 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
17674 generate code that is not binary compatible with code generated without that
17675 switch.  Use it to conform to a non-default application binary interface.
17676 Not all targets provide complete support for this switch.
17678 @item -ftls-model=@var{model}
17679 @opindex ftls-model
17680 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
17681 The @var{model} argument should be one of @code{global-dynamic},
17682 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
17684 The default without @option{-fpic} is @code{initial-exec}; with
17685 @option{-fpic} the default is @code{global-dynamic}.
17687 @item -fvisibility=@var{default|internal|hidden|protected}
17688 @opindex fvisibility
17689 Set the default ELF image symbol visibility to the specified option---all
17690 symbols will be marked with this unless overridden within the code.
17691 Using this feature can very substantially improve linking and
17692 load times of shared object libraries, produce more optimized
17693 code, provide near-perfect API export and prevent symbol clashes.
17694 It is @strong{strongly} recommended that you use this in any shared objects
17695 you distribute.
17697 Despite the nomenclature, @code{default} always means public ie;
17698 available to be linked against from outside the shared object.
17699 @code{protected} and @code{internal} are pretty useless in real-world
17700 usage so the only other commonly used option will be @code{hidden}.
17701 The default if @option{-fvisibility} isn't specified is
17702 @code{default}, i.e., make every
17703 symbol public---this causes the same behavior as previous versions of
17704 GCC@.
17706 A good explanation of the benefits offered by ensuring ELF
17707 symbols have the correct visibility is given by ``How To Write
17708 Shared Libraries'' by Ulrich Drepper (which can be found at
17709 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
17710 solution made possible by this option to marking things hidden when
17711 the default is public is to make the default hidden and mark things
17712 public.  This is the norm with DLL's on Windows and with @option{-fvisibility=hidden}
17713 and @code{__attribute__ ((visibility("default")))} instead of
17714 @code{__declspec(dllexport)} you get almost identical semantics with
17715 identical syntax.  This is a great boon to those working with
17716 cross-platform projects.
17718 For those adding visibility support to existing code, you may find
17719 @samp{#pragma GCC visibility} of use.  This works by you enclosing
17720 the declarations you wish to set visibility for with (for example)
17721 @samp{#pragma GCC visibility push(hidden)} and
17722 @samp{#pragma GCC visibility pop}.
17723 Bear in mind that symbol visibility should be viewed @strong{as
17724 part of the API interface contract} and thus all new code should
17725 always specify visibility when it is not the default ie; declarations
17726 only for use within the local DSO should @strong{always} be marked explicitly
17727 as hidden as so to avoid PLT indirection overheads---making this
17728 abundantly clear also aids readability and self-documentation of the code.
17729 Note that due to ISO C++ specification requirements, operator new and
17730 operator delete must always be of default visibility.
17732 Be aware that headers from outside your project, in particular system
17733 headers and headers from any other library you use, may not be
17734 expecting to be compiled with visibility other than the default.  You
17735 may need to explicitly say @samp{#pragma GCC visibility push(default)}
17736 before including any such headers.
17738 @samp{extern} declarations are not affected by @samp{-fvisibility}, so
17739 a lot of code can be recompiled with @samp{-fvisibility=hidden} with
17740 no modifications.  However, this means that calls to @samp{extern}
17741 functions with no explicit visibility will use the PLT, so it is more
17742 effective to use @samp{__attribute ((visibility))} and/or
17743 @samp{#pragma GCC visibility} to tell the compiler which @samp{extern}
17744 declarations should be treated as hidden.
17746 Note that @samp{-fvisibility} does affect C++ vague linkage
17747 entities. This means that, for instance, an exception class that will
17748 be thrown between DSOs must be explicitly marked with default
17749 visibility so that the @samp{type_info} nodes will be unified between
17750 the DSOs.
17752 An overview of these techniques, their benefits and how to use them
17753 is at @w{@uref{http://gcc.gnu.org/wiki/Visibility}}.
17755 @item -fstrict-volatile-bitfields
17756 This option should be used if accesses to volatile bitfields (or other
17757 structure fields, although the compiler usually honors those types
17758 anyway) should use a single access in a mode of the same size as the
17759 container's type, aligned to a natural alignment if possible.  For
17760 example, targets with memory-mapped peripheral registers might require
17761 all such accesses to be 16 bits wide; with this flag the user could
17762 declare all peripheral bitfields as ``unsigned short'' (assuming short
17763 is 16 bits on these targets) to force GCC to use 16 bit accesses
17764 instead of, perhaps, a more efficient 32 bit access.
17766 If this option is disabled, the compiler will use the most efficient
17767 instruction.  In the previous example, that might be a 32-bit load
17768 instruction, even though that will access bytes that do not contain
17769 any portion of the bitfield, or memory-mapped registers unrelated to
17770 the one being updated.
17772 If the target requires strict alignment, and honoring the container
17773 type would require violating this alignment, a warning is issued.
17774 However, the access happens as the user requested, under the
17775 assumption that the user knows something about the target hardware
17776 that GCC is unaware of.
17778 The default value of this option is determined by the application binary
17779 interface for the target processor.
17781 @end table
17783 @c man end
17785 @node Environment Variables
17786 @section Environment Variables Affecting GCC
17787 @cindex environment variables
17789 @c man begin ENVIRONMENT
17790 This section describes several environment variables that affect how GCC
17791 operates.  Some of them work by specifying directories or prefixes to use
17792 when searching for various kinds of files.  Some are used to specify other
17793 aspects of the compilation environment.
17795 Note that you can also specify places to search using options such as
17796 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
17797 take precedence over places specified using environment variables, which
17798 in turn take precedence over those specified by the configuration of GCC@.
17799 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
17800 GNU Compiler Collection (GCC) Internals}.
17802 @table @env
17803 @item LANG
17804 @itemx LC_CTYPE
17805 @c @itemx LC_COLLATE
17806 @itemx LC_MESSAGES
17807 @c @itemx LC_MONETARY
17808 @c @itemx LC_NUMERIC
17809 @c @itemx LC_TIME
17810 @itemx LC_ALL
17811 @findex LANG
17812 @findex LC_CTYPE
17813 @c @findex LC_COLLATE
17814 @findex LC_MESSAGES
17815 @c @findex LC_MONETARY
17816 @c @findex LC_NUMERIC
17817 @c @findex LC_TIME
17818 @findex LC_ALL
17819 @cindex locale
17820 These environment variables control the way that GCC uses
17821 localization information that allow GCC to work with different
17822 national conventions.  GCC inspects the locale categories
17823 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
17824 so.  These locale categories can be set to any value supported by your
17825 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
17826 Kingdom encoded in UTF-8.
17828 The @env{LC_CTYPE} environment variable specifies character
17829 classification.  GCC uses it to determine the character boundaries in
17830 a string; this is needed for some multibyte encodings that contain quote
17831 and escape characters that would otherwise be interpreted as a string
17832 end or escape.
17834 The @env{LC_MESSAGES} environment variable specifies the language to
17835 use in diagnostic messages.
17837 If the @env{LC_ALL} environment variable is set, it overrides the value
17838 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
17839 and @env{LC_MESSAGES} default to the value of the @env{LANG}
17840 environment variable.  If none of these variables are set, GCC
17841 defaults to traditional C English behavior.
17843 @item TMPDIR
17844 @findex TMPDIR
17845 If @env{TMPDIR} is set, it specifies the directory to use for temporary
17846 files.  GCC uses temporary files to hold the output of one stage of
17847 compilation which is to be used as input to the next stage: for example,
17848 the output of the preprocessor, which is the input to the compiler
17849 proper.
17851 @item GCC_EXEC_PREFIX
17852 @findex GCC_EXEC_PREFIX
17853 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
17854 names of the subprograms executed by the compiler.  No slash is added
17855 when this prefix is combined with the name of a subprogram, but you can
17856 specify a prefix that ends with a slash if you wish.
17858 If @env{GCC_EXEC_PREFIX} is not set, GCC will attempt to figure out
17859 an appropriate prefix to use based on the pathname it was invoked with.
17861 If GCC cannot find the subprogram using the specified prefix, it
17862 tries looking in the usual places for the subprogram.
17864 The default value of @env{GCC_EXEC_PREFIX} is
17865 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
17866 the installed compiler. In many cases @var{prefix} is the value
17867 of @code{prefix} when you ran the @file{configure} script.
17869 Other prefixes specified with @option{-B} take precedence over this prefix.
17871 This prefix is also used for finding files such as @file{crt0.o} that are
17872 used for linking.
17874 In addition, the prefix is used in an unusual way in finding the
17875 directories to search for header files.  For each of the standard
17876 directories whose name normally begins with @samp{/usr/local/lib/gcc}
17877 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
17878 replacing that beginning with the specified prefix to produce an
17879 alternate directory name.  Thus, with @option{-Bfoo/}, GCC will search
17880 @file{foo/bar} where it would normally search @file{/usr/local/lib/bar}.
17881 These alternate directories are searched first; the standard directories
17882 come next. If a standard directory begins with the configured
17883 @var{prefix} then the value of @var{prefix} is replaced by
17884 @env{GCC_EXEC_PREFIX} when looking for header files.
17886 @item COMPILER_PATH
17887 @findex COMPILER_PATH
17888 The value of @env{COMPILER_PATH} is a colon-separated list of
17889 directories, much like @env{PATH}.  GCC tries the directories thus
17890 specified when searching for subprograms, if it can't find the
17891 subprograms using @env{GCC_EXEC_PREFIX}.
17893 @item LIBRARY_PATH
17894 @findex LIBRARY_PATH
17895 The value of @env{LIBRARY_PATH} is a colon-separated list of
17896 directories, much like @env{PATH}.  When configured as a native compiler,
17897 GCC tries the directories thus specified when searching for special
17898 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
17899 using GCC also uses these directories when searching for ordinary
17900 libraries for the @option{-l} option (but directories specified with
17901 @option{-L} come first).
17903 @item LANG
17904 @findex LANG
17905 @cindex locale definition
17906 This variable is used to pass locale information to the compiler.  One way in
17907 which this information is used is to determine the character set to be used
17908 when character literals, string literals and comments are parsed in C and C++.
17909 When the compiler is configured to allow multibyte characters,
17910 the following values for @env{LANG} are recognized:
17912 @table @samp
17913 @item C-JIS
17914 Recognize JIS characters.
17915 @item C-SJIS
17916 Recognize SJIS characters.
17917 @item C-EUCJP
17918 Recognize EUCJP characters.
17919 @end table
17921 If @env{LANG} is not defined, or if it has some other value, then the
17922 compiler will use mblen and mbtowc as defined by the default locale to
17923 recognize and translate multibyte characters.
17924 @end table
17926 @noindent
17927 Some additional environments variables affect the behavior of the
17928 preprocessor.
17930 @include cppenv.texi
17932 @c man end
17934 @node Precompiled Headers
17935 @section Using Precompiled Headers
17936 @cindex precompiled headers
17937 @cindex speed of compilation
17939 Often large projects have many header files that are included in every
17940 source file.  The time the compiler takes to process these header files
17941 over and over again can account for nearly all of the time required to
17942 build the project.  To make builds faster, GCC allows users to
17943 `precompile' a header file; then, if builds can use the precompiled
17944 header file they will be much faster.
17946 To create a precompiled header file, simply compile it as you would any
17947 other file, if necessary using the @option{-x} option to make the driver
17948 treat it as a C or C++ header file.  You will probably want to use a
17949 tool like @command{make} to keep the precompiled header up-to-date when
17950 the headers it contains change.
17952 A precompiled header file will be searched for when @code{#include} is
17953 seen in the compilation.  As it searches for the included file
17954 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
17955 compiler looks for a precompiled header in each directory just before it
17956 looks for the include file in that directory.  The name searched for is
17957 the name specified in the @code{#include} with @samp{.gch} appended.  If
17958 the precompiled header file can't be used, it is ignored.
17960 For instance, if you have @code{#include "all.h"}, and you have
17961 @file{all.h.gch} in the same directory as @file{all.h}, then the
17962 precompiled header file will be used if possible, and the original
17963 header will be used otherwise.
17965 Alternatively, you might decide to put the precompiled header file in a
17966 directory and use @option{-I} to ensure that directory is searched
17967 before (or instead of) the directory containing the original header.
17968 Then, if you want to check that the precompiled header file is always
17969 used, you can put a file of the same name as the original header in this
17970 directory containing an @code{#error} command.
17972 This also works with @option{-include}.  So yet another way to use
17973 precompiled headers, good for projects not designed with precompiled
17974 header files in mind, is to simply take most of the header files used by
17975 a project, include them from another header file, precompile that header
17976 file, and @option{-include} the precompiled header.  If the header files
17977 have guards against multiple inclusion, they will be skipped because
17978 they've already been included (in the precompiled header).
17980 If you need to precompile the same header file for different
17981 languages, targets, or compiler options, you can instead make a
17982 @emph{directory} named like @file{all.h.gch}, and put each precompiled
17983 header in the directory, perhaps using @option{-o}.  It doesn't matter
17984 what you call the files in the directory, every precompiled header in
17985 the directory will be considered.  The first precompiled header
17986 encountered in the directory that is valid for this compilation will
17987 be used; they're searched in no particular order.
17989 There are many other possibilities, limited only by your imagination,
17990 good sense, and the constraints of your build system.
17992 A precompiled header file can be used only when these conditions apply:
17994 @itemize
17995 @item
17996 Only one precompiled header can be used in a particular compilation.
17998 @item
17999 A precompiled header can't be used once the first C token is seen.  You
18000 can have preprocessor directives before a precompiled header; you can
18001 even include a precompiled header from inside another header, so long as
18002 there are no C tokens before the @code{#include}.
18004 @item
18005 The precompiled header file must be produced for the same language as
18006 the current compilation.  You can't use a C precompiled header for a C++
18007 compilation.
18009 @item
18010 The precompiled header file must have been produced by the same compiler
18011 binary as the current compilation is using.
18013 @item
18014 Any macros defined before the precompiled header is included must
18015 either be defined in the same way as when the precompiled header was
18016 generated, or must not affect the precompiled header, which usually
18017 means that they don't appear in the precompiled header at all.
18019 The @option{-D} option is one way to define a macro before a
18020 precompiled header is included; using a @code{#define} can also do it.
18021 There are also some options that define macros implicitly, like
18022 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
18023 defined this way.
18025 @item If debugging information is output when using the precompiled
18026 header, using @option{-g} or similar, the same kind of debugging information
18027 must have been output when building the precompiled header.  However,
18028 a precompiled header built using @option{-g} can be used in a compilation
18029 when no debugging information is being output.
18031 @item The same @option{-m} options must generally be used when building
18032 and using the precompiled header.  @xref{Submodel Options},
18033 for any cases where this rule is relaxed.
18035 @item Each of the following options must be the same when building and using
18036 the precompiled header:
18038 @gccoptlist{-fexceptions}
18040 @item
18041 Some other command-line options starting with @option{-f},
18042 @option{-p}, or @option{-O} must be defined in the same way as when
18043 the precompiled header was generated.  At present, it's not clear
18044 which options are safe to change and which are not; the safest choice
18045 is to use exactly the same options when generating and using the
18046 precompiled header.  The following are known to be safe:
18048 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
18049 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
18050 -fsched-verbose=<number>  -fschedule-insns  -fvisibility= @gol
18051 -pedantic-errors}
18053 @end itemize
18055 For all of these except the last, the compiler will automatically
18056 ignore the precompiled header if the conditions aren't met.  If you
18057 find an option combination that doesn't work and doesn't cause the
18058 precompiled header to be ignored, please consider filing a bug report,
18059 see @ref{Bugs}.
18061 If you do use differing options when generating and using the
18062 precompiled header, the actual behavior will be a mixture of the
18063 behavior for the options.  For instance, if you use @option{-g} to
18064 generate the precompiled header but not when using it, you may or may
18065 not get debugging information for routines in the precompiled header.