OSDN Git Service

Update -fmodulo-sched-allow-regmoves documentation
[pf3gnuchains/gcc-fork.git] / gcc / doc / invoke.texi
1 @c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2 @c 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
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.
6
7 @ignore
8 @c man begin INCLUDE
9 @include gcc-vers.texi
10 @c man end
11
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,
15 2007 Free Software Foundation, Inc.
16
17 Permission is granted to copy, distribute and/or modify this document
18 under the terms of the GNU Free Documentation License, Version 1.2 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.
24
25 (a) The FSF's Front-Cover Text is:
26
27      A GNU Manual
28
29 (b) The FSF's Back-Cover Text is:
30
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{}
46
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
66
67 @node Invoking GCC
68 @chapter GCC Command Options
69 @cindex GCC command options
70 @cindex command options
71 @cindex options, GCC command
72
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.
79
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.
84
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.
91
92 @cindex C++ compilation options
93 @xref{Invoking G++,,Compiling C++ Programs}, for a summary of special
94 options for compiling C++ programs.
95
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{-dr} is very different from @w{@samp{-d
101 -r}}.
102
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.
110
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.
117
118 @c man end
119
120 @xref{Option Index}, for an index to GCC's options.
121
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 * Running Protoize::    Automatically adding or removing function prototypes.
152 @end menu
153
154 @c man begin OPTIONS
155
156 @node Option Summary
157 @section Option Summary
158
159 Here is a summary of all the options, grouped by type.  Explanations are
160 in the following sections.
161
162 @table @emph
163 @item Overall Options
164 @xref{Overall Options,,Options Controlling the Kind of Output}.
165 @gccoptlist{-c  -S  -E  -o @var{file}  -combine  -pipe  -pass-exit-codes  @gol
166 -x @var{language}  -v  -###  --help@r{[}=@var{class}@r{]}  --target-help  @gol
167 --version @@@var{file}}
168
169 @item C Language Options
170 @xref{C Dialect Options,,Options Controlling C Dialect}.
171 @gccoptlist{-ansi  -std=@var{standard}  -fgnu89-inline @gol
172 -aux-info @var{filename} @gol
173 -fno-asm  -fno-builtin  -fno-builtin-@var{function} @gol
174 -fhosted  -ffreestanding -fopenmp -fms-extensions @gol
175 -trigraphs  -no-integrated-cpp  -traditional  -traditional-cpp @gol
176 -fallow-single-precision  -fcond-mismatch -flax-vector-conversions @gol
177 -fsigned-bitfields  -fsigned-char @gol
178 -funsigned-bitfields  -funsigned-char}
179
180 @item C++ Language Options
181 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
182 @gccoptlist{-fabi-version=@var{n}  -fno-access-control  -fcheck-new @gol
183 -fconserve-space  -ffriend-injection @gol
184 -fno-elide-constructors @gol
185 -fno-enforce-eh-specs @gol
186 -ffor-scope  -fno-for-scope  -fno-gnu-keywords @gol
187 -fno-implicit-templates @gol
188 -fno-implicit-inline-templates @gol
189 -fno-implement-inlines  -fms-extensions @gol
190 -fno-nonansi-builtins  -fno-operator-names @gol
191 -fno-optional-diags  -fpermissive @gol
192 -frepo  -fno-rtti  -fstats  -ftemplate-depth-@var{n} @gol
193 -fno-threadsafe-statics -fuse-cxa-atexit  -fno-weak  -nostdinc++ @gol
194 -fno-default-inline  -fvisibility-inlines-hidden @gol
195 -fvisibility-ms-compat @gol
196 -Wabi  -Wctor-dtor-privacy @gol
197 -Wnon-virtual-dtor  -Wreorder @gol
198 -Weffc++  -Wno-deprecated  -Wstrict-null-sentinel @gol
199 -Wno-non-template-friend  -Wold-style-cast @gol
200 -Woverloaded-virtual  -Wno-pmf-conversions @gol
201 -Wsign-promo}
202
203 @item Objective-C and Objective-C++ Language Options
204 @xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling
205 Objective-C and Objective-C++ Dialects}.
206 @gccoptlist{-fconstant-string-class=@var{class-name} @gol
207 -fgnu-runtime  -fnext-runtime @gol
208 -fno-nil-receivers @gol
209 -fobjc-call-cxx-cdtors @gol
210 -fobjc-direct-dispatch @gol
211 -fobjc-exceptions @gol
212 -fobjc-gc @gol
213 -freplace-objc-classes @gol
214 -fzero-link @gol
215 -gen-decls @gol
216 -Wassign-intercept @gol
217 -Wno-protocol  -Wselector @gol
218 -Wstrict-selector-match @gol
219 -Wundeclared-selector}
220
221 @item Language Independent Options
222 @xref{Language Independent Options,,Options to Control Diagnostic Messages Formatting}.
223 @gccoptlist{-fmessage-length=@var{n}  @gol
224 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol
225 -fdiagnostics-show-option}
226
227 @item Warning Options
228 @xref{Warning Options,,Options to Request or Suppress Warnings}.
229 @gccoptlist{-fsyntax-only  -pedantic  -pedantic-errors @gol
230 -w  -Wextra  -Wall  -Waddress  -Waggregate-return  -Warray-bounds @gol
231 -Wno-attributes -Wc++-compat -Wc++0x-compat -Wcast-align  -Wcast-qual  @gol
232 -Wchar-subscripts -Wclobbered  -Wcomment @gol
233 -Wconversion  -Wcoverage-mismatch  -Wno-deprecated-declarations @gol
234 -Wdisabled-optimization  -Wno-div-by-zero  @gol
235 -Wempty-body  -Wno-endif-labels @gol
236 -Werror  -Werror=* @gol
237 -Wfatal-errors  -Wfloat-equal  -Wformat  -Wformat=2 @gol
238 -Wno-format-extra-args -Wformat-nonliteral @gol
239 -Wformat-security  -Wformat-y2k @gol
240 -Wimplicit  -Wimplicit-function-declaration  -Wimplicit-int @gol
241 -Wimport  -Wno-import  -Winit-self  -Winline @gol
242 -Wno-int-to-pointer-cast -Wno-invalid-offsetof @gol
243 -Winvalid-pch -Wlarger-than-@var{len}  -Wunsafe-loop-optimizations @gol
244 -Wlogical-op -Wlong-long @gol
245 -Wmain  -Wmissing-braces  -Wmissing-field-initializers @gol
246 -Wmissing-format-attribute  -Wmissing-include-dirs @gol
247 -Wmissing-noreturn @gol
248 -Wno-multichar  -Wnonnull  -Wno-overflow @gol
249 -Woverlength-strings  -Wpacked  -Wpadded @gol
250 -Wparentheses  -Wpointer-arith  -Wno-pointer-to-int-cast @gol
251 -Wredundant-decls @gol
252 -Wreturn-type  -Wsequence-point  -Wshadow @gol
253 -Wsign-compare  -Wsign-conversion  -Wstack-protector @gol
254 -Wstrict-aliasing -Wstrict-aliasing=n @gol
255 -Wstrict-overflow -Wstrict-overflow=@var{n} @gol
256 -Wswitch  -Wswitch-default  -Wswitch-enum @gol
257 -Wsystem-headers  -Wtrigraphs  -Wtype-limits  -Wundef  -Wuninitialized @gol
258 -Wunknown-pragmas  -Wno-pragmas -Wunreachable-code @gol
259 -Wunused  -Wunused-function  -Wunused-label  -Wunused-parameter @gol
260 -Wunused-value  -Wunused-variable @gol
261 -Wvariadic-macros -Wvla @gol
262 -Wvolatile-register-var  -Wwrite-strings}
263
264 @item C-only Warning Options
265 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
266 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
267 -Wold-style-declaration  -Wold-style-definition @gol
268 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
269 -Wdeclaration-after-statement -Wpointer-sign}
270
271 @item Debugging Options
272 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
273 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
274 -fdbg-cnt-list -fdbg-cnt=@var{counter-value-list} @gol
275 -fdump-noaddr -fdump-unnumbered  -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
276 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
277 -fdump-ipa-all -fdump-ipa-cgraph @gol
278 -fdump-tree-all @gol
279 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
280 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
281 -fdump-tree-inlined@r{[}-@var{n}@r{]} @gol
282 -fdump-tree-cfg -fdump-tree-vcg -fdump-tree-alias @gol
283 -fdump-tree-ch @gol
284 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
285 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
286 -fdump-tree-gimple@r{[}-raw@r{]} -fdump-tree-mudflap@r{[}-@var{n}@r{]} @gol
287 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
288 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
289 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
290 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
291 -fdump-tree-copyrename@r{[}-@var{n}@r{]} @gol
292 -fdump-tree-nrv -fdump-tree-vect @gol
293 -fdump-tree-sink @gol
294 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
295 -fdump-tree-salias @gol
296 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
297 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
298 -ftree-vectorizer-verbose=@var{n} @gol
299 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
300 -feliminate-dwarf2-dups -feliminate-unused-debug-types @gol
301 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
302 -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
303 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
304 -ftest-coverage  -ftime-report -fvar-tracking @gol
305 -g  -g@var{level}  -gcoff -gdwarf-2 @gol
306 -ggdb  -gstabs  -gstabs+  -gvms  -gxcoff  -gxcoff+ @gol
307 -fdebug-prefix-map=@var{old}=@var{new} @gol
308 -femit-struct-debug-baseonly -femit-struct-debug-reduced @gol
309 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
310 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
311 -print-multi-directory  -print-multi-lib @gol
312 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
313 -print-sysroot-headers-suffix @gol
314 -save-temps  -time}
315
316 @item Optimization Options
317 @xref{Optimize Options,,Options that Control Optimization}.
318 @gccoptlist{-falign-functions=@var{n}  -falign-jumps=@var{n} @gol
319 -falign-labels=@var{n}  -falign-loops=@var{n}  @gol
320 -fbounds-check -fmudflap -fmudflapth -fmudflapir @gol
321 -fbranch-probabilities -fprofile-values -fvpt -fbranch-target-load-optimize @gol
322 -fbranch-target-load-optimize2 -fbtr-bb-exclusive @gol
323 -fcaller-saves  -fcprop-registers  -fcse-follow-jumps @gol
324 -fcse-skip-blocks  -fcx-limited-range  -fdata-sections @gol
325 -fdelayed-branch  -fdelete-null-pointer-checks -fearly-inlining @gol
326 -fexpensive-optimizations  -ffast-math  -ffloat-store @gol
327 -fforce-addr  -fforward-propagate  -ffunction-sections @gol
328 -fgcse  -fgcse-lm  -fgcse-sm  -fgcse-las  -fgcse-after-reload @gol
329 -fcrossjumping  -fif-conversion  -fif-conversion2 @gol
330 -finline-functions  -finline-functions-called-once @gol
331 -finline-limit=@var{n}  -fkeep-inline-functions @gol
332 -fkeep-static-consts  -fmerge-constants  -fmerge-all-constants @gol
333 -fmodulo-sched -fmodulo-sched-allow-regmoves -fno-branch-count-reg @gol
334 -fno-default-inline  -fno-defer-pop -fmove-loop-invariants @gol
335 -fno-function-cse  -fno-guess-branch-probability @gol
336 -fno-inline  -fno-math-errno  -fno-peephole  -fno-peephole2 @gol
337 -funsafe-math-optimizations  -funsafe-loop-optimizations @gol
338 -ffinite-math-only  -fno-signed-zeros @gol
339 -fno-toplevel-reorder -fno-trapping-math  -fno-zero-initialized-in-bss @gol
340 -fomit-frame-pointer  -foptimize-register-move @gol
341 -foptimize-sibling-calls  -fpredictive-commoning -fprefetch-loop-arrays @gol
342 -fprofile-generate -fprofile-use @gol
343 -fregmove  -frename-registers @gol
344 -freorder-blocks  -freorder-blocks-and-partition -freorder-functions @gol
345 -frerun-cse-after-loop @gol
346 -frounding-math -frtl-abstract-sequences @gol
347 -fschedule-insns  -fschedule-insns2 @gol
348 -fno-sched-interblock  -fno-sched-spec  -fsched-spec-load @gol
349 -fsched-spec-load-dangerous  @gol
350 -fsched-stalled-insns=@var{n} -fsched-stalled-insns-dep=@var{n} @gol
351 -fsched2-use-superblocks @gol
352 -fsched2-use-traces -fsee -freschedule-modulo-scheduled-loops @gol
353 -fsection-anchors  -fsignaling-nans  -fsingle-precision-constant @gol
354 -fno-split-wide-types -fstack-protector  -fstack-protector-all @gol
355 -fstrict-aliasing  -fstrict-overflow  -ftracer  -fthread-jumps @gol
356 -funroll-all-loops  -funroll-loops  -fpeel-loops @gol
357 -fsplit-ivs-in-unroller -funswitch-loops @gol
358 -fvariable-expansion-in-unroller -ftree-reassoc @gol
359 -ftree-pre  -ftree-ccp  -ftree-dce -ftree-loop-optimize @gol
360 -ftree-loop-linear -ftree-loop-im -ftree-loop-ivcanon -fivopts @gol
361 -fcheck-data-deps @gol
362 -ftree-dominator-opts -ftree-dse -ftree-copyrename -ftree-sink @gol
363 -ftree-ch -ftree-sra -ftree-ter -ftree-fre -ftree-vectorize @gol
364 -ftree-vect-loop-version -fvect-cost-model -ftree-salias -fipa-pta -fweb @gol
365 -ftree-copy-prop -ftree-store-ccp -ftree-store-copy-prop -fwhole-program @gol
366 --param @var{name}=@var{value}
367 -O  -O0  -O1  -O2  -O3  -Os}
368
369 @item Preprocessor Options
370 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
371 @gccoptlist{-A@var{question}=@var{answer} @gol
372 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
373 -C  -dD  -dI  -dM  -dN @gol
374 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
375 -idirafter @var{dir} @gol
376 -include @var{file}  -imacros @var{file} @gol
377 -iprefix @var{file}  -iwithprefix @var{dir} @gol
378 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
379 -imultilib @var{dir} -isysroot @var{dir} @gol
380 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
381 -P  -fworking-directory  -remap @gol
382 -trigraphs  -undef  -U@var{macro}  -Wp,@var{option} @gol
383 -Xpreprocessor @var{option}}
384
385 @item Assembler Option
386 @xref{Assembler Options,,Passing Options to the Assembler}.
387 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
388
389 @item Linker Options
390 @xref{Link Options,,Options for Linking}.
391 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
392 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
393 -s  -static  -static-libgcc  -shared  -shared-libgcc  -symbolic @gol
394 -Wl,@var{option}  -Xlinker @var{option} @gol
395 -u @var{symbol}}
396
397 @item Directory Options
398 @xref{Directory Options,,Options for Directory Search}.
399 @gccoptlist{-B@var{prefix}  -I@var{dir}  -iquote@var{dir}  -L@var{dir}
400 -specs=@var{file}  -I- --sysroot=@var{dir}}
401
402 @item Target Options
403 @c I wrote this xref this way to avoid overfull hbox. -- rms
404 @xref{Target Options}.
405 @gccoptlist{-V @var{version}  -b @var{machine}}
406
407 @item Machine Dependent Options
408 @xref{Submodel Options,,Hardware Models and Configurations}.
409 @c This list is ordered alphanumerically by subsection name.
410 @c Try and put the significant identifier (CPU or system) first,
411 @c so users have a clue at guessing where the ones they want will be.
412
413 @emph{ARC Options}
414 @gccoptlist{-EB  -EL @gol
415 -mmangle-cpu  -mcpu=@var{cpu}  -mtext=@var{text-section} @gol
416 -mdata=@var{data-section}  -mrodata=@var{readonly-data-section}}
417
418 @emph{ARM Options}
419 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
420 -mabi=@var{name} @gol
421 -mapcs-stack-check  -mno-apcs-stack-check @gol
422 -mapcs-float  -mno-apcs-float @gol
423 -mapcs-reentrant  -mno-apcs-reentrant @gol
424 -msched-prolog  -mno-sched-prolog @gol
425 -mlittle-endian  -mbig-endian  -mwords-little-endian @gol
426 -mfloat-abi=@var{name}  -msoft-float  -mhard-float  -mfpe @gol
427 -mthumb-interwork  -mno-thumb-interwork @gol
428 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
429 -mstructure-size-boundary=@var{n} @gol
430 -mabort-on-noreturn @gol
431 -mlong-calls  -mno-long-calls @gol
432 -msingle-pic-base  -mno-single-pic-base @gol
433 -mpic-register=@var{reg} @gol
434 -mnop-fun-dllimport @gol
435 -mcirrus-fix-invalid-insns -mno-cirrus-fix-invalid-insns @gol
436 -mpoke-function-name @gol
437 -mthumb  -marm @gol
438 -mtpcs-frame  -mtpcs-leaf-frame @gol
439 -mcaller-super-interworking  -mcallee-super-interworking @gol
440 -mtp=@var{name}}
441
442 @emph{AVR Options}
443 @gccoptlist{-mmcu=@var{mcu}  -msize  -minit-stack=@var{n}  -mno-interrupts @gol
444 -mcall-prologues  -mno-tablejump  -mtiny-stack  -mint8}
445
446 @emph{Blackfin Options}
447 @gccoptlist{-mcpu=@var{cpu}  -msim  -momit-leaf-frame-pointer @gol
448 -mno-omit-leaf-frame-pointer  -mspecld-anomaly  -mno-specld-anomaly @gol
449 -mcsync-anomaly  -mno-csync-anomaly  -mlow-64k  -mno-low64k @gol
450 -mstack-check-l1  -mid-shared-library  -mno-id-shared-library @gol
451 -mshared-library-id=@var{n}  -mleaf-id-shared-library @gol
452 -mno-leaf-id-shared-library  -msep-data  -mno-sep-data  -mlong-calls @gol
453 -mno-long-calls -mfast-fp -minline-plt}
454
455 @emph{CRIS Options}
456 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
457 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
458 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
459 -mstack-align  -mdata-align  -mconst-align @gol
460 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
461 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
462 -mmul-bug-workaround  -mno-mul-bug-workaround}
463
464 @emph{CRX Options}
465 @gccoptlist{-mmac -mpush-args}
466
467 @emph{Darwin Options}
468 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
469 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
470 -client_name  -compatibility_version  -current_version @gol
471 -dead_strip @gol
472 -dependency-file  -dylib_file  -dylinker_install_name @gol
473 -dynamic  -dynamiclib  -exported_symbols_list @gol
474 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
475 -force_flat_namespace  -headerpad_max_install_names @gol
476 -iframework @gol
477 -image_base  -init  -install_name  -keep_private_externs @gol
478 -multi_module  -multiply_defined  -multiply_defined_unused @gol
479 -noall_load   -no_dead_strip_inits_and_terms @gol
480 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
481 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
482 -private_bundle  -read_only_relocs  -sectalign @gol
483 -sectobjectsymbols  -whyload  -seg1addr @gol
484 -sectcreate  -sectobjectsymbols  -sectorder @gol
485 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
486 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
487 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
488 -single_module  -static  -sub_library  -sub_umbrella @gol
489 -twolevel_namespace  -umbrella  -undefined @gol
490 -unexported_symbols_list  -weak_reference_mismatches @gol
491 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
492 -mkernel -mone-byte-bool}
493
494 @emph{DEC Alpha Options}
495 @gccoptlist{-mno-fp-regs  -msoft-float  -malpha-as  -mgas @gol
496 -mieee  -mieee-with-inexact  -mieee-conformant @gol
497 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
498 -mtrap-precision=@var{mode}  -mbuild-constants @gol
499 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
500 -mbwx  -mmax  -mfix  -mcix @gol
501 -mfloat-vax  -mfloat-ieee @gol
502 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
503 -msmall-text  -mlarge-text @gol
504 -mmemory-latency=@var{time}}
505
506 @emph{DEC Alpha/VMS Options}
507 @gccoptlist{-mvms-return-codes}
508
509 @emph{FRV Options}
510 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
511 -mhard-float  -msoft-float @gol
512 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
513 -mdouble  -mno-double @gol
514 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
515 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
516 -mlinked-fp  -mlong-calls  -malign-labels @gol
517 -mlibrary-pic  -macc-4  -macc-8 @gol
518 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
519 -moptimize-membar -mno-optimize-membar @gol
520 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
521 -mvliw-branch  -mno-vliw-branch @gol
522 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
523 -mno-nested-cond-exec  -mtomcat-stats @gol
524 -mTLS -mtls @gol
525 -mcpu=@var{cpu}}
526
527 @emph{GNU/Linux Options}
528 @gccoptlist{-muclibc}
529
530 @emph{H8/300 Options}
531 @gccoptlist{-mrelax  -mh  -ms  -mn  -mint32  -malign-300}
532
533 @emph{HPPA Options}
534 @gccoptlist{-march=@var{architecture-type} @gol
535 -mbig-switch  -mdisable-fpregs  -mdisable-indexing @gol
536 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
537 -mfixed-range=@var{register-range} @gol
538 -mjump-in-delay -mlinker-opt -mlong-calls @gol
539 -mlong-load-store  -mno-big-switch  -mno-disable-fpregs @gol
540 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
541 -mno-jump-in-delay  -mno-long-load-store @gol
542 -mno-portable-runtime  -mno-soft-float @gol
543 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
544 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
545 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
546 -munix=@var{unix-std}  -nolibdld  -static  -threads}
547
548 @emph{i386 and x86-64 Options}
549 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
550 -mfpmath=@var{unit} @gol
551 -masm=@var{dialect}  -mno-fancy-math-387 @gol
552 -mno-fp-ret-in-387  -msoft-float @gol
553 -mno-wide-multiply  -mrtd  -malign-double @gol
554 -mpreferred-stack-boundary=@var{num} -mcx16 -msahf -mrecip @gol
555 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 @gol
556 -msse4a -m3dnow -mpopcnt -mabm @gol
557 -mthreads  -mno-align-stringops  -minline-all-stringops @gol
558 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
559 -m96bit-long-double  -mregparm=@var{num}  -msseregparm @gol
560 -mveclibabi=@var{type} -mpc32 -mpc64 -mpc80 -mstackrealign @gol
561 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
562 -mcmodel=@var{code-model} @gol
563 -m32  -m64 -mlarge-data-threshold=@var{num}}
564
565 @emph{IA-64 Options}
566 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
567 -mvolatile-asm-stop  -mregister-names  -mno-sdata @gol
568 -mconstant-gp  -mauto-pic  -minline-float-divide-min-latency @gol
569 -minline-float-divide-max-throughput @gol
570 -minline-int-divide-min-latency @gol
571 -minline-int-divide-max-throughput  @gol
572 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
573 -mno-dwarf2-asm -mearly-stop-bits @gol
574 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
575 -mtune=@var{cpu-type} -mt -pthread -milp32 -mlp64 @gol
576 -mno-sched-br-data-spec -msched-ar-data-spec -mno-sched-control-spec @gol
577 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
578 -msched-ldc -mno-sched-control-ldc -mno-sched-spec-verbose @gol
579 -mno-sched-prefer-non-data-spec-insns @gol
580 -mno-sched-prefer-non-control-spec-insns @gol
581 -mno-sched-count-spec-in-critical-path}
582
583 @emph{M32R/D Options}
584 @gccoptlist{-m32r2 -m32rx -m32r @gol
585 -mdebug @gol
586 -malign-loops -mno-align-loops @gol
587 -missue-rate=@var{number} @gol
588 -mbranch-cost=@var{number} @gol
589 -mmodel=@var{code-size-model-type} @gol
590 -msdata=@var{sdata-type} @gol
591 -mno-flush-func -mflush-func=@var{name} @gol
592 -mno-flush-trap -mflush-trap=@var{number} @gol
593 -G @var{num}}
594
595 @emph{M32C Options}
596 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
597
598 @emph{M680x0 Options}
599 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune}
600 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
601 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
602 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
603 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
604 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
605 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
606 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library}
607
608 @emph{M68hc1x Options}
609 @gccoptlist{-m6811  -m6812  -m68hc11  -m68hc12   -m68hcs12 @gol
610 -mauto-incdec  -minmax  -mlong-calls  -mshort @gol
611 -msoft-reg-count=@var{count}}
612
613 @emph{MCore Options}
614 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
615 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
616 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
617 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
618 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
619
620 @emph{MIPS Options}
621 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
622 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2  -mips64 @gol
623 -mips16  -mno-mips16  -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
624 -mshared  -mno-shared  -mxgot  -mno-xgot  -mgp32  -mgp64 @gol
625 -mfp32  -mfp64  -mhard-float  -msoft-float @gol
626 -msingle-float  -mdouble-float  -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
627 -msmartmips  -mno-smartmips @gol
628 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
629 -mips3d  -mno-mips3d  -mmt  -mno-mt @gol
630 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
631 -G@var{num}  -membedded-data  -mno-embedded-data @gol
632 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
633 -mcode-readable=@var{setting} @gol
634 -msplit-addresses  -mno-split-addresses @gol
635 -mexplicit-relocs  -mno-explicit-relocs @gol
636 -mcheck-zero-division  -mno-check-zero-division @gol
637 -mdivide-traps  -mdivide-breaks @gol
638 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
639 -mmad  -mno-mad  -mfused-madd  -mno-fused-madd  -nocpp @gol
640 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
641 -mfix-vr4120  -mno-fix-vr4120  -mfix-vr4130  -mno-fix-vr4130 @gol
642 -mfix-sb1  -mno-fix-sb1 @gol
643 -mflush-func=@var{func}  -mno-flush-func @gol
644 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
645 -mfp-exceptions -mno-fp-exceptions @gol
646 -mvr4130-align -mno-vr4130-align}
647
648 @emph{MMIX Options}
649 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
650 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
651 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
652 -mno-base-addresses  -msingle-exit  -mno-single-exit}
653
654 @emph{MN10300 Options}
655 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
656 -mam33  -mno-am33 @gol
657 -mam33-2  -mno-am33-2 @gol
658 -mreturn-pointer-on-d0 @gol
659 -mno-crt0  -mrelax}
660
661 @emph{MT Options}
662 @gccoptlist{-mno-crt0 -mbacc -msim @gol
663 -march=@var{cpu-type} }
664
665 @emph{PDP-11 Options}
666 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
667 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
668 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
669 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
670 -mbranch-expensive  -mbranch-cheap @gol
671 -msplit  -mno-split  -munix-asm  -mdec-asm}
672
673 @emph{PowerPC Options}
674 See RS/6000 and PowerPC Options.
675
676 @emph{RS/6000 and PowerPC Options}
677 @gccoptlist{-mcpu=@var{cpu-type} @gol
678 -mtune=@var{cpu-type} @gol
679 -mpower  -mno-power  -mpower2  -mno-power2 @gol
680 -mpowerpc  -mpowerpc64  -mno-powerpc @gol
681 -maltivec  -mno-altivec @gol
682 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
683 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
684 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb  -mfprnd  -mno-fprnd @gol
685 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mdfp -mno-dfp @gol
686 -mnew-mnemonics  -mold-mnemonics @gol
687 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
688 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
689 -malign-power  -malign-natural @gol
690 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
691 -mstring  -mno-string  -mupdate  -mno-update @gol
692 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
693 -mstrict-align  -mno-strict-align  -mrelocatable @gol
694 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
695 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
696 -mdynamic-no-pic  -maltivec  -mswdiv @gol
697 -mprioritize-restricted-insns=@var{priority} @gol
698 -msched-costly-dep=@var{dependence_type} @gol
699 -minsert-sched-nops=@var{scheme} @gol
700 -mcall-sysv  -mcall-netbsd @gol
701 -maix-struct-return  -msvr4-struct-return @gol
702 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
703 -misel -mno-isel @gol
704 -misel=yes  -misel=no @gol
705 -mspe -mno-spe @gol
706 -mspe=yes  -mspe=no @gol
707 -mpaired @gol
708 -mvrsave -mno-vrsave @gol
709 -mmulhw -mno-mulhw @gol
710 -mdlmzb -mno-dlmzb @gol
711 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
712 -mprototype  -mno-prototype @gol
713 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
714 -msdata=@var{opt}  -mvxworks  -mwindiss  -G @var{num}  -pthread}
715
716 @emph{S/390 and zSeries Options}
717 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
718 -mhard-float  -msoft-float -mlong-double-64 -mlong-double-128 @gol
719 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
720 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
721 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
722 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
723 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard}
724
725 @emph{Score Options}
726 @gccoptlist{-meb -mel @gol
727 -mnhwloop @gol
728 -muls @gol
729 -mmac @gol
730 -mscore5 -mscore5u -mscore7 -mscore7d}
731
732 @emph{SH Options}
733 @gccoptlist{-m1  -m2  -m2e  -m3  -m3e @gol
734 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
735 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
736 -m5-64media  -m5-64media-nofpu @gol
737 -m5-32media  -m5-32media-nofpu @gol
738 -m5-compact  -m5-compact-nofpu @gol
739 -mb  -ml  -mdalign  -mrelax @gol
740 -mbigtable  -mfmovd  -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
741 -mieee  -misize  -minline-ic_invalidate -mpadstruct  -mspace @gol
742 -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
743 -mdivsi3_libfunc=@var{name}  @gol
744 -madjust-unroll -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
745  -minvalid-symbols}
746
747 @emph{SPARC Options}
748 @gccoptlist{-mcpu=@var{cpu-type} @gol
749 -mtune=@var{cpu-type} @gol
750 -mcmodel=@var{code-model} @gol
751 -m32  -m64  -mapp-regs  -mno-app-regs @gol
752 -mfaster-structs  -mno-faster-structs @gol
753 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
754 -mhard-quad-float  -msoft-quad-float @gol
755 -mimpure-text  -mno-impure-text  -mlittle-endian @gol
756 -mstack-bias  -mno-stack-bias @gol
757 -munaligned-doubles  -mno-unaligned-doubles @gol
758 -mv8plus  -mno-v8plus  -mvis  -mno-vis
759 -threads -pthreads -pthread}
760
761 @emph{SPU Options}
762 @gccoptlist{-mwarn-reloc -merror-reloc @gol
763 -msafe-dma -munsafe-dma @gol
764 -mbranch-hints @gol
765 -msmall-mem -mlarge-mem -mstdmain @gol
766 -mfixed-range=@var{register-range}}
767
768 @emph{System V Options}
769 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
770
771 @emph{TMS320C3x/C4x Options}
772 @gccoptlist{-mcpu=@var{cpu}  -mbig  -msmall  -mregparm  -mmemparm @gol
773 -mfast-fix  -mmpyi  -mbk  -mti  -mdp-isr-reload @gol
774 -mrpts=@var{count}  -mrptb  -mdb  -mloop-unsigned @gol
775 -mparallel-insns  -mparallel-mpy  -mpreserve-float}
776
777 @emph{V850 Options}
778 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
779 -mprolog-function  -mno-prolog-function  -mspace @gol
780 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
781 -mapp-regs  -mno-app-regs @gol
782 -mdisable-callt  -mno-disable-callt @gol
783 -mv850e1 @gol
784 -mv850e @gol
785 -mv850  -mbig-switch}
786
787 @emph{VAX Options}
788 @gccoptlist{-mg  -mgnu  -munix}
789
790 @emph{VxWorks Options}
791 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
792 -Xbind-lazy  -Xbind-now}
793
794 @emph{x86-64 Options}
795 See i386 and x86-64 Options.
796
797 @emph{Xstormy16 Options}
798 @gccoptlist{-msim}
799
800 @emph{Xtensa Options}
801 @gccoptlist{-mconst16 -mno-const16 @gol
802 -mfused-madd  -mno-fused-madd @gol
803 -mtext-section-literals  -mno-text-section-literals @gol
804 -mtarget-align  -mno-target-align @gol
805 -mlongcalls  -mno-longcalls}
806
807 @emph{zSeries Options}
808 See S/390 and zSeries Options.
809
810 @item Code Generation Options
811 @xref{Code Gen Options,,Options for Code Generation Conventions}.
812 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
813 -ffixed-@var{reg}  -fexceptions @gol
814 -fnon-call-exceptions  -funwind-tables @gol
815 -fasynchronous-unwind-tables @gol
816 -finhibit-size-directive  -finstrument-functions @gol
817 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
818 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol
819 -fno-common  -fno-ident @gol
820 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
821 -fno-jump-tables @gol
822 -frecord-gcc-switches @gol
823 -freg-struct-return  -fshort-enums @gol
824 -fshort-double  -fshort-wchar @gol
825 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
826 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
827 -fargument-alias  -fargument-noalias @gol
828 -fargument-noalias-global  -fargument-noalias-anything
829 -fleading-underscore  -ftls-model=@var{model} @gol
830 -ftrapv  -fwrapv  -fbounds-check @gol
831 -fvisibility}
832 @end table
833
834 @menu
835 * Overall Options::     Controlling the kind of output:
836                         an executable, object files, assembler files,
837                         or preprocessed source.
838 * C Dialect Options::   Controlling the variant of C language compiled.
839 * C++ Dialect Options:: Variations on C++.
840 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
841                         and Objective-C++.
842 * Language Independent Options:: Controlling how diagnostics should be
843                         formatted.
844 * Warning Options::     How picky should the compiler be?
845 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
846 * Optimize Options::    How much optimization?
847 * Preprocessor Options:: Controlling header files and macro definitions.
848                          Also, getting dependency information for Make.
849 * Assembler Options::   Passing options to the assembler.
850 * Link Options::        Specifying libraries and so on.
851 * Directory Options::   Where to find header files and libraries.
852                         Where to find the compiler executable files.
853 * Spec Files::          How to pass switches to sub-processes.
854 * Target Options::      Running a cross-compiler, or an old version of GCC.
855 @end menu
856
857 @node Overall Options
858 @section Options Controlling the Kind of Output
859
860 Compilation can involve up to four stages: preprocessing, compilation
861 proper, assembly and linking, always in that order.  GCC is capable of
862 preprocessing and compiling several files either into several
863 assembler input files, or into one assembler input file; then each
864 assembler input file produces an object file, and linking combines all
865 the object files (those newly compiled, and those specified as input)
866 into an executable file.
867
868 @cindex file name suffix
869 For any given input file, the file name suffix determines what kind of
870 compilation is done:
871
872 @table @gcctabopt
873 @item @var{file}.c
874 C source code which must be preprocessed.
875
876 @item @var{file}.i
877 C source code which should not be preprocessed.
878
879 @item @var{file}.ii
880 C++ source code which should not be preprocessed.
881
882 @item @var{file}.m
883 Objective-C source code.  Note that you must link with the @file{libobjc}
884 library to make an Objective-C program work.
885
886 @item @var{file}.mi
887 Objective-C source code which should not be preprocessed.
888
889 @item @var{file}.mm
890 @itemx @var{file}.M
891 Objective-C++ source code.  Note that you must link with the @file{libobjc}
892 library to make an Objective-C++ program work.  Note that @samp{.M} refers
893 to a literal capital M@.
894
895 @item @var{file}.mii
896 Objective-C++ source code which should not be preprocessed.
897
898 @item @var{file}.h
899 C, C++, Objective-C or Objective-C++ header file to be turned into a
900 precompiled header.
901
902 @item @var{file}.cc
903 @itemx @var{file}.cp
904 @itemx @var{file}.cxx
905 @itemx @var{file}.cpp
906 @itemx @var{file}.CPP
907 @itemx @var{file}.c++
908 @itemx @var{file}.C
909 C++ source code which must be preprocessed.  Note that in @samp{.cxx},
910 the last two letters must both be literally @samp{x}.  Likewise,
911 @samp{.C} refers to a literal capital C@.
912
913 @item @var{file}.mm
914 @itemx @var{file}.M
915 Objective-C++ source code which must be preprocessed.
916
917 @item @var{file}.mii
918 Objective-C++ source code which should not be preprocessed.
919
920 @item @var{file}.hh
921 @itemx @var{file}.H
922 @itemx @var{file}.hp
923 @itemx @var{file}.hxx
924 @itemx @var{file}.hpp
925 @itemx @var{file}.HPP
926 @itemx @var{file}.h++
927 @itemx @var{file}.tcc
928 C++ header file to be turned into a precompiled header.
929
930 @item @var{file}.f
931 @itemx @var{file}.for
932 @itemx @var{file}.FOR
933 Fixed form Fortran source code which should not be preprocessed.
934
935 @item @var{file}.F
936 @itemx @var{file}.fpp
937 @itemx @var{file}.FPP
938 Fixed form Fortran source code which must be preprocessed (with the traditional
939 preprocessor).
940
941 @item @var{file}.f90
942 @itemx @var{file}.f95
943 Free form Fortran source code which should not be preprocessed.
944
945 @item @var{file}.F90
946 @itemx @var{file}.F95
947 Free form Fortran source code which must be preprocessed (with the
948 traditional preprocessor).
949
950 @c FIXME: Descriptions of Java file types.
951 @c @var{file}.java
952 @c @var{file}.class
953 @c @var{file}.zip
954 @c @var{file}.jar
955
956 @item @var{file}.ads
957 Ada source code file which contains a library unit declaration (a
958 declaration of a package, subprogram, or generic, or a generic
959 instantiation), or a library unit renaming declaration (a package,
960 generic, or subprogram renaming declaration).  Such files are also
961 called @dfn{specs}.
962
963 @itemx @var{file}.adb
964 Ada source code file containing a library unit body (a subprogram or
965 package body).  Such files are also called @dfn{bodies}.
966
967 @c GCC also knows about some suffixes for languages not yet included:
968 @c Pascal:
969 @c @var{file}.p
970 @c @var{file}.pas
971 @c Ratfor:
972 @c @var{file}.r
973
974 @item @var{file}.s
975 Assembler code.
976
977 @item @var{file}.S
978 Assembler code which must be preprocessed.
979
980 @item @var{other}
981 An object file to be fed straight into linking.
982 Any file name with no recognized suffix is treated this way.
983 @end table
984
985 @opindex x
986 You can specify the input language explicitly with the @option{-x} option:
987
988 @table @gcctabopt
989 @item -x @var{language}
990 Specify explicitly the @var{language} for the following input files
991 (rather than letting the compiler choose a default based on the file
992 name suffix).  This option applies to all following input files until
993 the next @option{-x} option.  Possible values for @var{language} are:
994 @smallexample
995 c  c-header  c-cpp-output
996 c++  c++-header  c++-cpp-output
997 objective-c  objective-c-header  objective-c-cpp-output
998 objective-c++ objective-c++-header objective-c++-cpp-output
999 assembler  assembler-with-cpp
1000 ada
1001 f95  f95-cpp-input
1002 java
1003 treelang
1004 @end smallexample
1005
1006 @item -x none
1007 Turn off any specification of a language, so that subsequent files are
1008 handled according to their file name suffixes (as they are if @option{-x}
1009 has not been used at all).
1010
1011 @item -pass-exit-codes
1012 @opindex pass-exit-codes
1013 Normally the @command{gcc} program will exit with the code of 1 if any
1014 phase of the compiler returns a non-success return code.  If you specify
1015 @option{-pass-exit-codes}, the @command{gcc} program will instead return with
1016 numerically highest error produced by any phase that returned an error
1017 indication.  The C, C++, and Fortran frontends return 4, if an internal
1018 compiler error is encountered.
1019 @end table
1020
1021 If you only want some of the stages of compilation, you can use
1022 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1023 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1024 @command{gcc} is to stop.  Note that some combinations (for example,
1025 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1026
1027 @table @gcctabopt
1028 @item -c
1029 @opindex c
1030 Compile or assemble the source files, but do not link.  The linking
1031 stage simply is not done.  The ultimate output is in the form of an
1032 object file for each source file.
1033
1034 By default, the object file name for a source file is made by replacing
1035 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1036
1037 Unrecognized input files, not requiring compilation or assembly, are
1038 ignored.
1039
1040 @item -S
1041 @opindex S
1042 Stop after the stage of compilation proper; do not assemble.  The output
1043 is in the form of an assembler code file for each non-assembler input
1044 file specified.
1045
1046 By default, the assembler file name for a source file is made by
1047 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1048
1049 Input files that don't require compilation are ignored.
1050
1051 @item -E
1052 @opindex E
1053 Stop after the preprocessing stage; do not run the compiler proper.  The
1054 output is in the form of preprocessed source code, which is sent to the
1055 standard output.
1056
1057 Input files which don't require preprocessing are ignored.
1058
1059 @cindex output file option
1060 @item -o @var{file}
1061 @opindex o
1062 Place output in file @var{file}.  This applies regardless to whatever
1063 sort of output is being produced, whether it be an executable file,
1064 an object file, an assembler file or preprocessed C code.
1065
1066 If @option{-o} is not specified, the default is to put an executable
1067 file in @file{a.out}, the object file for
1068 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1069 assembler file in @file{@var{source}.s}, a precompiled header file in
1070 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1071 standard output.
1072
1073 @item -v
1074 @opindex v
1075 Print (on standard error output) the commands executed to run the stages
1076 of compilation.  Also print the version number of the compiler driver
1077 program and of the preprocessor and the compiler proper.
1078
1079 @item -###
1080 @opindex ###
1081 Like @option{-v} except the commands are not executed and all command
1082 arguments are quoted.  This is useful for shell scripts to capture the
1083 driver-generated command lines.
1084
1085 @item -pipe
1086 @opindex pipe
1087 Use pipes rather than temporary files for communication between the
1088 various stages of compilation.  This fails to work on some systems where
1089 the assembler is unable to read from a pipe; but the GNU assembler has
1090 no trouble.
1091
1092 @item -combine
1093 @opindex combine
1094 If you are compiling multiple source files, this option tells the driver
1095 to pass all the source files to the compiler at once (for those
1096 languages for which the compiler can handle this).  This will allow
1097 intermodule analysis (IMA) to be performed by the compiler.  Currently the only
1098 language for which this is supported is C@.  If you pass source files for
1099 multiple languages to the driver, using this option, the driver will invoke
1100 the compiler(s) that support IMA once each, passing each compiler all the
1101 source files appropriate for it.  For those languages that do not support
1102 IMA this option will be ignored, and the compiler will be invoked once for
1103 each source file in that language.  If you use this option in conjunction
1104 with @option{-save-temps}, the compiler will generate multiple
1105 pre-processed files
1106 (one for each source file), but only one (combined) @file{.o} or
1107 @file{.s} file.
1108
1109 @item --help
1110 @opindex help
1111 Print (on the standard output) a description of the command line options
1112 understood by @command{gcc}.  If the @option{-v} option is also specified
1113 then @option{--help} will also be passed on to the various processes
1114 invoked by @command{gcc}, so that they can display the command line options
1115 they accept.  If the @option{-Wextra} option has also been specified
1116 (prior to the @option{--help} option), then command line options which
1117 have no documentation associated with them will also be displayed.
1118
1119 @item --target-help
1120 @opindex target-help
1121 Print (on the standard output) a description of target-specific command
1122 line options for each tool.  For some targets extra target-specific
1123 information may also be printed.
1124
1125 @item --help=@var{class}@r{[},@var{qualifier}@r{]}
1126 Print (on the standard output) a description of the command line
1127 options understood by the compiler that fit into a specific class.
1128 The class can be one of @samp{optimizers}, @samp{warnings}, @samp{target},
1129 @samp{params}, or @var{language}:
1130
1131 @table @asis
1132 @item @samp{optimizers}
1133 This will display all of the optimization options supported by the
1134 compiler.
1135
1136 @item @samp{warnings}
1137 This will display all of the options controlling warning messages
1138 produced by the compiler.
1139
1140 @item @samp{target}
1141 This will display target-specific options.  Unlike the
1142 @option{--target-help} option however, target-specific options of the
1143 linker and assembler will not be displayed.  This is because those
1144 tools do not currently support the extended @option{--help=} syntax.
1145
1146 @item @samp{params}
1147 This will display the values recognized by the @option{--param}
1148 option.
1149
1150 @item @var{language}
1151 This will display the options supported for @var{language}, where 
1152 @var{language} is the name of one of the languages supported in this 
1153 version of GCC.
1154
1155 @item @samp{common}
1156 This will display the options that are common to all languages.
1157 @end table
1158
1159 It is possible to further refine the output of the @option{--help=}
1160 option by adding a comma separated list of qualifiers after the
1161 class.  These can be any from the following list:
1162
1163 @table @asis
1164 @item @samp{undocumented}
1165 Display only those options which are undocumented.
1166
1167 @item @samp{joined}
1168 Display options which take an argument that appears after an equal
1169 sign in the same continuous piece of text, such as:
1170 @samp{--help=target}.
1171
1172 @item @samp{separate}
1173 Display options which take an argument that appears as a separate word
1174 following the original option, such as: @samp{-o output-file}.
1175 @end table
1176
1177 Thus for example to display all the undocumented target-specific
1178 switches supported by the compiler the following can be used:
1179
1180 @smallexample
1181 --help=target,undocumented
1182 @end smallexample
1183
1184 The sense of a qualifier can be inverted by prefixing it with the
1185 @var{^} character, so for example to display all binary warning
1186 options (i.e. ones that are either on or off and that do not take an
1187 argument), which have a description the following can be used:
1188
1189 @smallexample
1190 --help=warnings,^joined,^undocumented
1191 @end smallexample
1192
1193 A class can also be used as a qualifier, although this usually
1194 restricts the output by so much that there is nothing to display.  One
1195 case where it does work however is when one of the classes is
1196 @var{target}.  So for example to display all the target-specific
1197 optimization options the following can be used:
1198
1199 @smallexample
1200 --help=target,optimizers
1201 @end smallexample
1202
1203 The @option{--help=} option can be repeated on the command line.  Each
1204 successive use will display its requested class of options, skipping
1205 those that have already been displayed.
1206
1207 If the @option{-Q} option appears on the command line before the
1208 @option{--help=} option, then the descriptive text displayed by
1209 @option{--help=} is changed.  Instead of describing the displayed
1210 options, an indication is given as to whether the option is enabled,
1211 disabled or set to a specific value (assuming that the compiler
1212 knows this at the point where the @option{--help=} option is used).
1213
1214 Here is a truncated example from the ARM port of @command{gcc}:
1215
1216 @smallexample
1217   % gcc -Q -mabi=2 --help=target -c
1218   The following options are target specific:
1219   -mabi=                                2
1220   -mabort-on-noreturn                   [disabled]
1221   -mapcs                                [disabled]
1222 @end smallexample
1223
1224 The output is sensitive to the effects of previous command line
1225 options, so for example it is possible to find out which optimizations
1226 are enabled at @option{-O2} by using:
1227
1228 @smallexample
1229 -O2 --help=optimizers
1230 @end smallexample
1231
1232 Alternatively you can discover which binary optimizations are enabled
1233 by @option{-O3} by using:
1234
1235 @smallexample
1236 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1237 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1238 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1239 @end smallexample
1240
1241 @item --version
1242 @opindex version
1243 Display the version number and copyrights of the invoked GCC@.
1244
1245 @include @value{srcdir}/../libiberty/at-file.texi
1246 @end table
1247
1248 @node Invoking G++
1249 @section Compiling C++ Programs
1250
1251 @cindex suffixes for C++ source
1252 @cindex C++ source file suffixes
1253 C++ source files conventionally use one of the suffixes @samp{.C},
1254 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1255 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1256 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1257 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1258 files with these names and compiles them as C++ programs even if you
1259 call the compiler the same way as for compiling C programs (usually
1260 with the name @command{gcc}).
1261
1262 @findex g++
1263 @findex c++
1264 However, the use of @command{gcc} does not add the C++ library.
1265 @command{g++} is a program that calls GCC and treats @samp{.c},
1266 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1267 files unless @option{-x} is used, and automatically specifies linking
1268 against the C++ library.  This program is also useful when
1269 precompiling a C header file with a @samp{.h} extension for use in C++
1270 compilations.  On many systems, @command{g++} is also installed with
1271 the name @command{c++}.
1272
1273 @cindex invoking @command{g++}
1274 When you compile C++ programs, you may specify many of the same
1275 command-line options that you use for compiling programs in any
1276 language; or command-line options meaningful for C and related
1277 languages; or options that are meaningful only for C++ programs.
1278 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1279 explanations of options for languages related to C@.
1280 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1281 explanations of options that are meaningful only for C++ programs.
1282
1283 @node C Dialect Options
1284 @section Options Controlling C Dialect
1285 @cindex dialect options
1286 @cindex language dialect options
1287 @cindex options, dialect
1288
1289 The following options control the dialect of C (or languages derived
1290 from C, such as C++, Objective-C and Objective-C++) that the compiler
1291 accepts:
1292
1293 @table @gcctabopt
1294 @cindex ANSI support
1295 @cindex ISO support
1296 @item -ansi
1297 @opindex ansi
1298 In C mode, support all ISO C90 programs.  In C++ mode,
1299 remove GNU extensions that conflict with ISO C++.
1300
1301 This turns off certain features of GCC that are incompatible with ISO
1302 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1303 such as the @code{asm} and @code{typeof} keywords, and
1304 predefined macros such as @code{unix} and @code{vax} that identify the
1305 type of system you are using.  It also enables the undesirable and
1306 rarely used ISO trigraph feature.  For the C compiler,
1307 it disables recognition of C++ style @samp{//} comments as well as
1308 the @code{inline} keyword.
1309
1310 The alternate keywords @code{__asm__}, @code{__extension__},
1311 @code{__inline__} and @code{__typeof__} continue to work despite
1312 @option{-ansi}.  You would not want to use them in an ISO C program, of
1313 course, but it is useful to put them in header files that might be included
1314 in compilations done with @option{-ansi}.  Alternate predefined macros
1315 such as @code{__unix__} and @code{__vax__} are also available, with or
1316 without @option{-ansi}.
1317
1318 The @option{-ansi} option does not cause non-ISO programs to be
1319 rejected gratuitously.  For that, @option{-pedantic} is required in
1320 addition to @option{-ansi}.  @xref{Warning Options}.
1321
1322 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1323 option is used.  Some header files may notice this macro and refrain
1324 from declaring certain functions or defining certain macros that the
1325 ISO standard doesn't call for; this is to avoid interfering with any
1326 programs that might use these names for other things.
1327
1328 Functions which would normally be built in but do not have semantics
1329 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1330 functions with @option{-ansi} is used.  @xref{Other Builtins,,Other
1331 built-in functions provided by GCC}, for details of the functions
1332 affected.
1333
1334 @item -std=
1335 @opindex std
1336 Determine the language standard.  This option is currently only
1337 supported when compiling C or C++.  A value for this option must be
1338 provided; possible values are
1339
1340 @table @samp
1341 @item c89
1342 @itemx iso9899:1990
1343 ISO C90 (same as @option{-ansi}).
1344
1345 @item iso9899:199409
1346 ISO C90 as modified in amendment 1.
1347
1348 @item c99
1349 @itemx c9x
1350 @itemx iso9899:1999
1351 @itemx iso9899:199x
1352 ISO C99.  Note that this standard is not yet fully supported; see
1353 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1354 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1355
1356 @item gnu89
1357 Default, ISO C90 plus GNU extensions (including some C99 features).
1358
1359 @item gnu99
1360 @itemx gnu9x
1361 ISO C99 plus GNU extensions.  When ISO C99 is fully implemented in GCC,
1362 this will become the default.  The name @samp{gnu9x} is deprecated.
1363
1364 @item c++98
1365 The 1998 ISO C++ standard plus amendments.
1366
1367 @item gnu++98
1368 The same as @option{-std=c++98} plus GNU extensions.  This is the
1369 default for C++ code.
1370
1371 @item c++0x
1372 The working draft of the upcoming ISO C++0x standard. This option
1373 enables experimental features that are likely to be included in
1374 C++0x. The working draft is constantly changing, and any feature that is
1375 enabled by this flag may be removed from future versions of GCC if it is
1376 not part of the C++0x standard.
1377
1378 @item gnu++0x
1379 The same as @option{-std=c++0x} plus GNU extensions. As with
1380 @option{-std=c++0x}, this option enables experimental features that may
1381 be removed in future versions of GCC.
1382 @end table
1383
1384 Even when this option is not specified, you can still use some of the
1385 features of newer standards in so far as they do not conflict with
1386 previous C standards.  For example, you may use @code{__restrict__} even
1387 when @option{-std=c99} is not specified.
1388
1389 The @option{-std} options specifying some version of ISO C have the same
1390 effects as @option{-ansi}, except that features that were not in ISO C90
1391 but are in the specified version (for example, @samp{//} comments and
1392 the @code{inline} keyword in ISO C99) are not disabled.
1393
1394 @xref{Standards,,Language Standards Supported by GCC}, for details of
1395 these standard versions.
1396
1397 @item -fgnu89-inline
1398 @opindex fgnu89-inline
1399 The option @option{-fgnu89-inline} tells GCC to use the traditional
1400 GNU semantics for @code{inline} functions when in C99 mode.
1401 @xref{Inline,,An Inline Function is As Fast As a Macro}.  This option
1402 is accepted and ignored by GCC versions 4.1.3 up to but not including
1403 4.3.  In GCC versions 4.3 and later it changes the behavior of GCC in
1404 C99 mode.  Using this option is roughly equivalent to adding the
1405 @code{gnu_inline} function attribute to all inline functions
1406 (@pxref{Function Attributes}).
1407
1408 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1409 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1410 specifies the default behavior).  This option was first supported in
1411 GCC 4.3.  This option is not supported in C89 or gnu89 mode.
1412
1413 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1414 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1415 in effect for @code{inline} functions.  @xref{Common Predefined
1416 Macros,,,cpp,The C Preprocessor}.
1417
1418 @item -aux-info @var{filename}
1419 @opindex aux-info
1420 Output to the given filename prototyped declarations for all functions
1421 declared and/or defined in a translation unit, including those in header
1422 files.  This option is silently ignored in any language other than C@.
1423
1424 Besides declarations, the file indicates, in comments, the origin of
1425 each declaration (source file and line), whether the declaration was
1426 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1427 @samp{O} for old, respectively, in the first character after the line
1428 number and the colon), and whether it came from a declaration or a
1429 definition (@samp{C} or @samp{F}, respectively, in the following
1430 character).  In the case of function definitions, a K&R-style list of
1431 arguments followed by their declarations is also provided, inside
1432 comments, after the declaration.
1433
1434 @item -fno-asm
1435 @opindex fno-asm
1436 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1437 keyword, so that code can use these words as identifiers.  You can use
1438 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1439 instead.  @option{-ansi} implies @option{-fno-asm}.
1440
1441 In C++, this switch only affects the @code{typeof} keyword, since
1442 @code{asm} and @code{inline} are standard keywords.  You may want to
1443 use the @option{-fno-gnu-keywords} flag instead, which has the same
1444 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1445 switch only affects the @code{asm} and @code{typeof} keywords, since
1446 @code{inline} is a standard keyword in ISO C99.
1447
1448 @item -fno-builtin
1449 @itemx -fno-builtin-@var{function}
1450 @opindex fno-builtin
1451 @cindex built-in functions
1452 Don't recognize built-in functions that do not begin with
1453 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1454 functions provided by GCC}, for details of the functions affected,
1455 including those which are not built-in functions when @option{-ansi} or
1456 @option{-std} options for strict ISO C conformance are used because they
1457 do not have an ISO standard meaning.
1458
1459 GCC normally generates special code to handle certain built-in functions
1460 more efficiently; for instance, calls to @code{alloca} may become single
1461 instructions that adjust the stack directly, and calls to @code{memcpy}
1462 may become inline copy loops.  The resulting code is often both smaller
1463 and faster, but since the function calls no longer appear as such, you
1464 cannot set a breakpoint on those calls, nor can you change the behavior
1465 of the functions by linking with a different library.  In addition,
1466 when a function is recognized as a built-in function, GCC may use
1467 information about that function to warn about problems with calls to
1468 that function, or to generate more efficient code, even if the
1469 resulting code still contains calls to that function.  For example,
1470 warnings are given with @option{-Wformat} for bad calls to
1471 @code{printf}, when @code{printf} is built in, and @code{strlen} is
1472 known not to modify global memory.
1473
1474 With the @option{-fno-builtin-@var{function}} option
1475 only the built-in function @var{function} is
1476 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1477 function is named this is not built-in in this version of GCC, this
1478 option is ignored.  There is no corresponding
1479 @option{-fbuiltin-@var{function}} option; if you wish to enable
1480 built-in functions selectively when using @option{-fno-builtin} or
1481 @option{-ffreestanding}, you may define macros such as:
1482
1483 @smallexample
1484 #define abs(n)          __builtin_abs ((n))
1485 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1486 @end smallexample
1487
1488 @item -fhosted
1489 @opindex fhosted
1490 @cindex hosted environment
1491
1492 Assert that compilation takes place in a hosted environment.  This implies
1493 @option{-fbuiltin}.  A hosted environment is one in which the
1494 entire standard library is available, and in which @code{main} has a return
1495 type of @code{int}.  Examples are nearly everything except a kernel.
1496 This is equivalent to @option{-fno-freestanding}.
1497
1498 @item -ffreestanding
1499 @opindex ffreestanding
1500 @cindex hosted environment
1501
1502 Assert that compilation takes place in a freestanding environment.  This
1503 implies @option{-fno-builtin}.  A freestanding environment
1504 is one in which the standard library may not exist, and program startup may
1505 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1506 This is equivalent to @option{-fno-hosted}.
1507
1508 @xref{Standards,,Language Standards Supported by GCC}, for details of
1509 freestanding and hosted environments.
1510
1511 @item -fopenmp
1512 @opindex fopenmp
1513 @cindex openmp parallel
1514 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1515 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1516 compiler generates parallel code according to the OpenMP Application
1517 Program Interface v2.5 @w{@uref{http://www.openmp.org/}}.
1518
1519 @item -fms-extensions
1520 @opindex fms-extensions
1521 Accept some non-standard constructs used in Microsoft header files.
1522
1523 Some cases of unnamed fields in structures and unions are only
1524 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1525 fields within structs/unions}, for details.
1526
1527 @item -trigraphs
1528 @opindex trigraphs
1529 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1530 options for strict ISO C conformance) implies @option{-trigraphs}.
1531
1532 @item -no-integrated-cpp
1533 @opindex no-integrated-cpp
1534 Performs a compilation in two passes: preprocessing and compiling.  This
1535 option allows a user supplied "cc1", "cc1plus", or "cc1obj" via the
1536 @option{-B} option.  The user supplied compilation step can then add in
1537 an additional preprocessing step after normal preprocessing but before
1538 compiling.  The default is to use the integrated cpp (internal cpp)
1539
1540 The semantics of this option will change if "cc1", "cc1plus", and
1541 "cc1obj" are merged.
1542
1543 @cindex traditional C language
1544 @cindex C language, traditional
1545 @item -traditional
1546 @itemx -traditional-cpp
1547 @opindex traditional-cpp
1548 @opindex traditional
1549 Formerly, these options caused GCC to attempt to emulate a pre-standard
1550 C compiler.  They are now only supported with the @option{-E} switch.
1551 The preprocessor continues to support a pre-standard mode.  See the GNU
1552 CPP manual for details.
1553
1554 @item -fcond-mismatch
1555 @opindex fcond-mismatch
1556 Allow conditional expressions with mismatched types in the second and
1557 third arguments.  The value of such an expression is void.  This option
1558 is not supported for C++.
1559
1560 @item -flax-vector-conversions
1561 @opindex flax-vector-conversions
1562 Allow implicit conversions between vectors with differing numbers of
1563 elements and/or incompatible element types.  This option should not be
1564 used for new code.
1565
1566 @item -funsigned-char
1567 @opindex funsigned-char
1568 Let the type @code{char} be unsigned, like @code{unsigned char}.
1569
1570 Each kind of machine has a default for what @code{char} should
1571 be.  It is either like @code{unsigned char} by default or like
1572 @code{signed char} by default.
1573
1574 Ideally, a portable program should always use @code{signed char} or
1575 @code{unsigned char} when it depends on the signedness of an object.
1576 But many programs have been written to use plain @code{char} and
1577 expect it to be signed, or expect it to be unsigned, depending on the
1578 machines they were written for.  This option, and its inverse, let you
1579 make such a program work with the opposite default.
1580
1581 The type @code{char} is always a distinct type from each of
1582 @code{signed char} or @code{unsigned char}, even though its behavior
1583 is always just like one of those two.
1584
1585 @item -fsigned-char
1586 @opindex fsigned-char
1587 Let the type @code{char} be signed, like @code{signed char}.
1588
1589 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1590 the negative form of @option{-funsigned-char}.  Likewise, the option
1591 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1592
1593 @item -fsigned-bitfields
1594 @itemx -funsigned-bitfields
1595 @itemx -fno-signed-bitfields
1596 @itemx -fno-unsigned-bitfields
1597 @opindex fsigned-bitfields
1598 @opindex funsigned-bitfields
1599 @opindex fno-signed-bitfields
1600 @opindex fno-unsigned-bitfields
1601 These options control whether a bit-field is signed or unsigned, when the
1602 declaration does not use either @code{signed} or @code{unsigned}.  By
1603 default, such a bit-field is signed, because this is consistent: the
1604 basic integer types such as @code{int} are signed types.
1605 @end table
1606
1607 @node C++ Dialect Options
1608 @section Options Controlling C++ Dialect
1609
1610 @cindex compiler options, C++
1611 @cindex C++ options, command line
1612 @cindex options, C++
1613 This section describes the command-line options that are only meaningful
1614 for C++ programs; but you can also use most of the GNU compiler options
1615 regardless of what language your program is in.  For example, you
1616 might compile a file @code{firstClass.C} like this:
1617
1618 @smallexample
1619 g++ -g -frepo -O -c firstClass.C
1620 @end smallexample
1621
1622 @noindent
1623 In this example, only @option{-frepo} is an option meant
1624 only for C++ programs; you can use the other options with any
1625 language supported by GCC@.
1626
1627 Here is a list of options that are @emph{only} for compiling C++ programs:
1628
1629 @table @gcctabopt
1630
1631 @item -fabi-version=@var{n}
1632 @opindex fabi-version
1633 Use version @var{n} of the C++ ABI@.  Version 2 is the version of the
1634 C++ ABI that first appeared in G++ 3.4.  Version 1 is the version of
1635 the C++ ABI that first appeared in G++ 3.2.  Version 0 will always be
1636 the version that conforms most closely to the C++ ABI specification.
1637 Therefore, the ABI obtained using version 0 will change as ABI bugs
1638 are fixed.
1639
1640 The default is version 2.
1641
1642 @item -fno-access-control
1643 @opindex fno-access-control
1644 Turn off all access checking.  This switch is mainly useful for working
1645 around bugs in the access control code.
1646
1647 @item -fcheck-new
1648 @opindex fcheck-new
1649 Check that the pointer returned by @code{operator new} is non-null
1650 before attempting to modify the storage allocated.  This check is
1651 normally unnecessary because the C++ standard specifies that
1652 @code{operator new} will only return @code{0} if it is declared
1653 @samp{throw()}, in which case the compiler will always check the
1654 return value even without this option.  In all other cases, when
1655 @code{operator new} has a non-empty exception specification, memory
1656 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
1657 @samp{new (nothrow)}.
1658
1659 @item -fconserve-space
1660 @opindex fconserve-space
1661 Put uninitialized or runtime-initialized global variables into the
1662 common segment, as C does.  This saves space in the executable at the
1663 cost of not diagnosing duplicate definitions.  If you compile with this
1664 flag and your program mysteriously crashes after @code{main()} has
1665 completed, you may have an object that is being destroyed twice because
1666 two definitions were merged.
1667
1668 This option is no longer useful on most targets, now that support has
1669 been added for putting variables into BSS without making them common.
1670
1671 @item -ffriend-injection
1672 @opindex ffriend-injection
1673 Inject friend functions into the enclosing namespace, so that they are
1674 visible outside the scope of the class in which they are declared.
1675 Friend functions were documented to work this way in the old Annotated
1676 C++ Reference Manual, and versions of G++ before 4.1 always worked
1677 that way.  However, in ISO C++ a friend function which is not declared
1678 in an enclosing scope can only be found using argument dependent
1679 lookup.  This option causes friends to be injected as they were in
1680 earlier releases.
1681
1682 This option is for compatibility, and may be removed in a future
1683 release of G++.
1684
1685 @item -fno-elide-constructors
1686 @opindex fno-elide-constructors
1687 The C++ standard allows an implementation to omit creating a temporary
1688 which is only used to initialize another object of the same type.
1689 Specifying this option disables that optimization, and forces G++ to
1690 call the copy constructor in all cases.
1691
1692 @item -fno-enforce-eh-specs
1693 @opindex fno-enforce-eh-specs
1694 Don't generate code to check for violation of exception specifications
1695 at runtime.  This option violates the C++ standard, but may be useful
1696 for reducing code size in production builds, much like defining
1697 @samp{NDEBUG}.  This does not give user code permission to throw
1698 exceptions in violation of the exception specifications; the compiler
1699 will still optimize based on the specifications, so throwing an
1700 unexpected exception will result in undefined behavior.
1701
1702 @item -ffor-scope
1703 @itemx -fno-for-scope
1704 @opindex ffor-scope
1705 @opindex fno-for-scope
1706 If @option{-ffor-scope} is specified, the scope of variables declared in
1707 a @i{for-init-statement} is limited to the @samp{for} loop itself,
1708 as specified by the C++ standard.
1709 If @option{-fno-for-scope} is specified, the scope of variables declared in
1710 a @i{for-init-statement} extends to the end of the enclosing scope,
1711 as was the case in old versions of G++, and other (traditional)
1712 implementations of C++.
1713
1714 The default if neither flag is given to follow the standard,
1715 but to allow and give a warning for old-style code that would
1716 otherwise be invalid, or have different behavior.
1717
1718 @item -fno-gnu-keywords
1719 @opindex fno-gnu-keywords
1720 Do not recognize @code{typeof} as a keyword, so that code can use this
1721 word as an identifier.  You can use the keyword @code{__typeof__} instead.
1722 @option{-ansi} implies @option{-fno-gnu-keywords}.
1723
1724 @item -fno-implicit-templates
1725 @opindex fno-implicit-templates
1726 Never emit code for non-inline templates which are instantiated
1727 implicitly (i.e.@: by use); only emit code for explicit instantiations.
1728 @xref{Template Instantiation}, for more information.
1729
1730 @item -fno-implicit-inline-templates
1731 @opindex fno-implicit-inline-templates
1732 Don't emit code for implicit instantiations of inline templates, either.
1733 The default is to handle inlines differently so that compiles with and
1734 without optimization will need the same set of explicit instantiations.
1735
1736 @item -fno-implement-inlines
1737 @opindex fno-implement-inlines
1738 To save space, do not emit out-of-line copies of inline functions
1739 controlled by @samp{#pragma implementation}.  This will cause linker
1740 errors if these functions are not inlined everywhere they are called.
1741
1742 @item -fms-extensions
1743 @opindex fms-extensions
1744 Disable pedantic warnings about constructs used in MFC, such as implicit
1745 int and getting a pointer to member function via non-standard syntax.
1746
1747 @item -fno-nonansi-builtins
1748 @opindex fno-nonansi-builtins
1749 Disable built-in declarations of functions that are not mandated by
1750 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
1751 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
1752
1753 @item -fno-operator-names
1754 @opindex fno-operator-names
1755 Do not treat the operator name keywords @code{and}, @code{bitand},
1756 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
1757 synonyms as keywords.
1758
1759 @item -fno-optional-diags
1760 @opindex fno-optional-diags
1761 Disable diagnostics that the standard says a compiler does not need to
1762 issue.  Currently, the only such diagnostic issued by G++ is the one for
1763 a name having multiple meanings within a class.
1764
1765 @item -fpermissive
1766 @opindex fpermissive
1767 Downgrade some diagnostics about nonconformant code from errors to
1768 warnings.  Thus, using @option{-fpermissive} will allow some
1769 nonconforming code to compile.
1770
1771 @item -frepo
1772 @opindex frepo
1773 Enable automatic template instantiation at link time.  This option also
1774 implies @option{-fno-implicit-templates}.  @xref{Template
1775 Instantiation}, for more information.
1776
1777 @item -fno-rtti
1778 @opindex fno-rtti
1779 Disable generation of information about every class with virtual
1780 functions for use by the C++ runtime type identification features
1781 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
1782 of the language, you can save some space by using this flag.  Note that
1783 exception handling uses the same information, but it will generate it as
1784 needed. The @samp{dynamic_cast} operator can still be used for casts that
1785 do not require runtime type information, i.e. casts to @code{void *} or to
1786 unambiguous base classes.
1787
1788 @item -fstats
1789 @opindex fstats
1790 Emit statistics about front-end processing at the end of the compilation.
1791 This information is generally only useful to the G++ development team.
1792
1793 @item -ftemplate-depth-@var{n}
1794 @opindex ftemplate-depth
1795 Set the maximum instantiation depth for template classes to @var{n}.
1796 A limit on the template instantiation depth is needed to detect
1797 endless recursions during template class instantiation.  ANSI/ISO C++
1798 conforming programs must not rely on a maximum depth greater than 17.
1799
1800 @item -fno-threadsafe-statics
1801 @opindex fno-threadsafe-statics
1802 Do not emit the extra code to use the routines specified in the C++
1803 ABI for thread-safe initialization of local statics.  You can use this
1804 option to reduce code size slightly in code that doesn't need to be
1805 thread-safe.
1806
1807 @item -fuse-cxa-atexit
1808 @opindex fuse-cxa-atexit
1809 Register destructors for objects with static storage duration with the
1810 @code{__cxa_atexit} function rather than the @code{atexit} function.
1811 This option is required for fully standards-compliant handling of static
1812 destructors, but will only work if your C library supports
1813 @code{__cxa_atexit}.
1814
1815 @item -fno-use-cxa-get-exception-ptr
1816 @opindex fno-use-cxa-get-exception-ptr
1817 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
1818 will cause @code{std::uncaught_exception} to be incorrect, but is necessary
1819 if the runtime routine is not available.
1820
1821 @item -fvisibility-inlines-hidden
1822 @opindex fvisibility-inlines-hidden
1823 This switch declares that the user does not attempt to compare
1824 pointers to inline methods where the addresses of the two functions
1825 were taken in different shared objects.
1826
1827 The effect of this is that GCC may, effectively, mark inline methods with
1828 @code{__attribute__ ((visibility ("hidden")))} so that they do not
1829 appear in the export table of a DSO and do not require a PLT indirection
1830 when used within the DSO@.  Enabling this option can have a dramatic effect
1831 on load and link times of a DSO as it massively reduces the size of the
1832 dynamic export table when the library makes heavy use of templates.
1833
1834 The behavior of this switch is not quite the same as marking the
1835 methods as hidden directly, because it does not affect static variables
1836 local to the function or cause the compiler to deduce that
1837 the function is defined in only one shared object.
1838
1839 You may mark a method as having a visibility explicitly to negate the
1840 effect of the switch for that method.  For example, if you do want to
1841 compare pointers to a particular inline method, you might mark it as
1842 having default visibility.  Marking the enclosing class with explicit
1843 visibility will have no effect.
1844
1845 Explicitly instantiated inline methods are unaffected by this option
1846 as their linkage might otherwise cross a shared library boundary.
1847 @xref{Template Instantiation}.
1848
1849 @item -fvisibility-ms-compat
1850 @opindex fvisibility-ms-compat
1851 This flag attempts to use visibility settings to make GCC's C++
1852 linkage model compatible with that of Microsoft Visual Studio.
1853
1854 The flag makes these changes to GCC's linkage model:
1855
1856 @enumerate
1857 @item
1858 It sets the default visibility to @code{hidden}, like
1859 @option{-fvisibility=hidden}.
1860
1861 @item
1862 Types, but not their members, are not hidden by default.
1863
1864 @item
1865 The One Definition Rule is relaxed for types without explicit
1866 visibility specifications which are defined in more than one different
1867 shared object: those declarations are permitted if they would have
1868 been permitted when this option was not used.
1869 @end enumerate
1870
1871 In new code it is better to use @option{-fvisibility=hidden} and
1872 export those classes which are intended to be externally visible.
1873 Unfortunately it is possible for code to rely, perhaps accidentally,
1874 on the Visual Studio behavior.
1875
1876 Among the consequences of these changes are that static data members
1877 of the same type with the same name but defined in different shared
1878 objects will be different, so changing one will not change the other;
1879 and that pointers to function members defined in different shared
1880 objects may not compare equal.  When this flag is given, it is a
1881 violation of the ODR to define types with the same name differently.
1882
1883 @item -fno-weak
1884 @opindex fno-weak
1885 Do not use weak symbol support, even if it is provided by the linker.
1886 By default, G++ will use weak symbols if they are available.  This
1887 option exists only for testing, and should not be used by end-users;
1888 it will result in inferior code and has no benefits.  This option may
1889 be removed in a future release of G++.
1890
1891 @item -nostdinc++
1892 @opindex nostdinc++
1893 Do not search for header files in the standard directories specific to
1894 C++, but do still search the other standard directories.  (This option
1895 is used when building the C++ library.)
1896 @end table
1897
1898 In addition, these optimization, warning, and code generation options
1899 have meanings only for C++ programs:
1900
1901 @table @gcctabopt
1902 @item -fno-default-inline
1903 @opindex fno-default-inline
1904 Do not assume @samp{inline} for functions defined inside a class scope.
1905 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
1906 functions will have linkage like inline functions; they just won't be
1907 inlined by default.
1908
1909 @item -Wabi @r{(C++ only)}
1910 @opindex Wabi
1911 Warn when G++ generates code that is probably not compatible with the
1912 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
1913 all such cases, there are probably some cases that are not warned about,
1914 even though G++ is generating incompatible code.  There may also be
1915 cases where warnings are emitted even though the code that is generated
1916 will be compatible.
1917
1918 You should rewrite your code to avoid these warnings if you are
1919 concerned about the fact that code generated by G++ may not be binary
1920 compatible with code generated by other compilers.
1921
1922 The known incompatibilities at this point include:
1923
1924 @itemize @bullet
1925
1926 @item
1927 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
1928 pack data into the same byte as a base class.  For example:
1929
1930 @smallexample
1931 struct A @{ virtual void f(); int f1 : 1; @};
1932 struct B : public A @{ int f2 : 1; @};
1933 @end smallexample
1934
1935 @noindent
1936 In this case, G++ will place @code{B::f2} into the same byte
1937 as@code{A::f1}; other compilers will not.  You can avoid this problem
1938 by explicitly padding @code{A} so that its size is a multiple of the
1939 byte size on your platform; that will cause G++ and other compilers to
1940 layout @code{B} identically.
1941
1942 @item
1943 Incorrect handling of tail-padding for virtual bases.  G++ does not use
1944 tail padding when laying out virtual bases.  For example:
1945
1946 @smallexample
1947 struct A @{ virtual void f(); char c1; @};
1948 struct B @{ B(); char c2; @};
1949 struct C : public A, public virtual B @{@};
1950 @end smallexample
1951
1952 @noindent
1953 In this case, G++ will not place @code{B} into the tail-padding for
1954 @code{A}; other compilers will.  You can avoid this problem by
1955 explicitly padding @code{A} so that its size is a multiple of its
1956 alignment (ignoring virtual base classes); that will cause G++ and other
1957 compilers to layout @code{C} identically.
1958
1959 @item
1960 Incorrect handling of bit-fields with declared widths greater than that
1961 of their underlying types, when the bit-fields appear in a union.  For
1962 example:
1963
1964 @smallexample
1965 union U @{ int i : 4096; @};
1966 @end smallexample
1967
1968 @noindent
1969 Assuming that an @code{int} does not have 4096 bits, G++ will make the
1970 union too small by the number of bits in an @code{int}.
1971
1972 @item
1973 Empty classes can be placed at incorrect offsets.  For example:
1974
1975 @smallexample
1976 struct A @{@};
1977
1978 struct B @{
1979   A a;
1980   virtual void f ();
1981 @};
1982
1983 struct C : public B, public A @{@};
1984 @end smallexample
1985
1986 @noindent
1987 G++ will place the @code{A} base class of @code{C} at a nonzero offset;
1988 it should be placed at offset zero.  G++ mistakenly believes that the
1989 @code{A} data member of @code{B} is already at offset zero.
1990
1991 @item
1992 Names of template functions whose types involve @code{typename} or
1993 template template parameters can be mangled incorrectly.
1994
1995 @smallexample
1996 template <typename Q>
1997 void f(typename Q::X) @{@}
1998
1999 template <template <typename> class Q>
2000 void f(typename Q<int>::X) @{@}
2001 @end smallexample
2002
2003 @noindent
2004 Instantiations of these templates may be mangled incorrectly.
2005
2006 @end itemize
2007
2008 @item -Wctor-dtor-privacy @r{(C++ only)}
2009 @opindex Wctor-dtor-privacy
2010 Warn when a class seems unusable because all the constructors or
2011 destructors in that class are private, and it has neither friends nor
2012 public static member functions.
2013
2014 @item -Wnon-virtual-dtor @r{(C++ only)}
2015 @opindex Wnon-virtual-dtor
2016 Warn when a class has virtual functions and accessible non-virtual
2017 destructor, in which case it would be possible but unsafe to delete
2018 an instance of a derived class through a pointer to the base class.
2019 This warning is also enabled if -Weffc++ is specified.
2020
2021 @item -Wreorder @r{(C++ only)}
2022 @opindex Wreorder
2023 @cindex reordering, warning
2024 @cindex warning for reordering of member initializers
2025 Warn when the order of member initializers given in the code does not
2026 match the order in which they must be executed.  For instance:
2027
2028 @smallexample
2029 struct A @{
2030   int i;
2031   int j;
2032   A(): j (0), i (1) @{ @}
2033 @};
2034 @end smallexample
2035
2036 The compiler will rearrange the member initializers for @samp{i}
2037 and @samp{j} to match the declaration order of the members, emitting
2038 a warning to that effect.  This warning is enabled by @option{-Wall}.
2039 @end table
2040
2041 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
2042
2043 @table @gcctabopt
2044 @item -Weffc++ @r{(C++ only)}
2045 @opindex Weffc++
2046 Warn about violations of the following style guidelines from Scott Meyers'
2047 @cite{Effective C++} book:
2048
2049 @itemize @bullet
2050 @item
2051 Item 11:  Define a copy constructor and an assignment operator for classes
2052 with dynamically allocated memory.
2053
2054 @item
2055 Item 12:  Prefer initialization to assignment in constructors.
2056
2057 @item
2058 Item 14:  Make destructors virtual in base classes.
2059
2060 @item
2061 Item 15:  Have @code{operator=} return a reference to @code{*this}.
2062
2063 @item
2064 Item 23:  Don't try to return a reference when you must return an object.
2065
2066 @end itemize
2067
2068 Also warn about violations of the following style guidelines from
2069 Scott Meyers' @cite{More Effective C++} book:
2070
2071 @itemize @bullet
2072 @item
2073 Item 6:  Distinguish between prefix and postfix forms of increment and
2074 decrement operators.
2075
2076 @item
2077 Item 7:  Never overload @code{&&}, @code{||}, or @code{,}.
2078
2079 @end itemize
2080
2081 When selecting this option, be aware that the standard library
2082 headers do not obey all of these guidelines; use @samp{grep -v}
2083 to filter out those warnings.
2084
2085 @item -Wno-deprecated @r{(C++ only)}
2086 @opindex Wno-deprecated
2087 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
2088
2089 @item -Wstrict-null-sentinel @r{(C++ only)}
2090 @opindex Wstrict-null-sentinel
2091 Warn also about the use of an uncasted @code{NULL} as sentinel.  When
2092 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2093 to @code{__null}.  Although it is a null pointer constant not a null pointer,
2094 it is guaranteed to of the same size as a pointer.  But this use is
2095 not portable across different compilers.
2096
2097 @item -Wno-non-template-friend @r{(C++ only)}
2098 @opindex Wno-non-template-friend
2099 Disable warnings when non-templatized friend functions are declared
2100 within a template.  Since the advent of explicit template specification
2101 support in G++, if the name of the friend is an unqualified-id (i.e.,
2102 @samp{friend foo(int)}), the C++ language specification demands that the
2103 friend declare or define an ordinary, nontemplate function.  (Section
2104 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2105 could be interpreted as a particular specialization of a templatized
2106 function.  Because this non-conforming behavior is no longer the default
2107 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2108 check existing code for potential trouble spots and is on by default.
2109 This new compiler behavior can be turned off with
2110 @option{-Wno-non-template-friend} which keeps the conformant compiler code
2111 but disables the helpful warning.
2112
2113 @item -Wold-style-cast @r{(C++ only)}
2114 @opindex Wold-style-cast
2115 Warn if an old-style (C-style) cast to a non-void type is used within
2116 a C++ program.  The new-style casts (@samp{dynamic_cast},
2117 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
2118 less vulnerable to unintended effects and much easier to search for.
2119
2120 @item -Woverloaded-virtual @r{(C++ only)}
2121 @opindex Woverloaded-virtual
2122 @cindex overloaded virtual fn, warning
2123 @cindex warning for overloaded virtual fn
2124 Warn when a function declaration hides virtual functions from a
2125 base class.  For example, in:
2126
2127 @smallexample
2128 struct A @{
2129   virtual void f();
2130 @};
2131
2132 struct B: public A @{
2133   void f(int);
2134 @};
2135 @end smallexample
2136
2137 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2138 like:
2139
2140 @smallexample
2141 B* b;
2142 b->f();
2143 @end smallexample
2144
2145 will fail to compile.
2146
2147 @item -Wno-pmf-conversions @r{(C++ only)}
2148 @opindex Wno-pmf-conversions
2149 Disable the diagnostic for converting a bound pointer to member function
2150 to a plain pointer.
2151
2152 @item -Wsign-promo @r{(C++ only)}
2153 @opindex Wsign-promo
2154 Warn when overload resolution chooses a promotion from unsigned or
2155 enumerated type to a signed type, over a conversion to an unsigned type of
2156 the same size.  Previous versions of G++ would try to preserve
2157 unsignedness, but the standard mandates the current behavior.
2158
2159 @smallexample
2160 struct A @{
2161   operator int ();
2162   A& operator = (int);
2163 @};
2164
2165 main ()
2166 @{
2167   A a,b;
2168   a = b;
2169 @}
2170 @end smallexample
2171
2172 In this example, G++ will synthesize a default @samp{A& operator =
2173 (const A&);}, while cfront will use the user-defined @samp{operator =}.
2174 @end table
2175
2176 @node Objective-C and Objective-C++ Dialect Options
2177 @section Options Controlling Objective-C and Objective-C++ Dialects
2178
2179 @cindex compiler options, Objective-C and Objective-C++
2180 @cindex Objective-C and Objective-C++ options, command line
2181 @cindex options, Objective-C and Objective-C++
2182 (NOTE: This manual does not describe the Objective-C and Objective-C++
2183 languages themselves.  See @xref{Standards,,Language Standards
2184 Supported by GCC}, for references.)
2185
2186 This section describes the command-line options that are only meaningful
2187 for Objective-C and Objective-C++ programs, but you can also use most of
2188 the language-independent GNU compiler options.
2189 For example, you might compile a file @code{some_class.m} like this:
2190
2191 @smallexample
2192 gcc -g -fgnu-runtime -O -c some_class.m
2193 @end smallexample
2194
2195 @noindent
2196 In this example, @option{-fgnu-runtime} is an option meant only for
2197 Objective-C and Objective-C++ programs; you can use the other options with
2198 any language supported by GCC@.
2199
2200 Note that since Objective-C is an extension of the C language, Objective-C
2201 compilations may also use options specific to the C front-end (e.g.,
2202 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2203 C++-specific options (e.g., @option{-Wabi}).
2204
2205 Here is a list of options that are @emph{only} for compiling Objective-C
2206 and Objective-C++ programs:
2207
2208 @table @gcctabopt
2209 @item -fconstant-string-class=@var{class-name}
2210 @opindex fconstant-string-class
2211 Use @var{class-name} as the name of the class to instantiate for each
2212 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2213 class name is @code{NXConstantString} if the GNU runtime is being used, and
2214 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2215 @option{-fconstant-cfstrings} option, if also present, will override the
2216 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2217 to be laid out as constant CoreFoundation strings.
2218
2219 @item -fgnu-runtime
2220 @opindex fgnu-runtime
2221 Generate object code compatible with the standard GNU Objective-C
2222 runtime.  This is the default for most types of systems.
2223
2224 @item -fnext-runtime
2225 @opindex fnext-runtime
2226 Generate output compatible with the NeXT runtime.  This is the default
2227 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2228 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2229 used.
2230
2231 @item -fno-nil-receivers
2232 @opindex fno-nil-receivers
2233 Assume that all Objective-C message dispatches (e.g.,
2234 @code{[receiver message:arg]}) in this translation unit ensure that the receiver
2235 is not @code{nil}.  This allows for more efficient entry points in the runtime
2236 to be used.  Currently, this option is only available in conjunction with
2237 the NeXT runtime on Mac OS X 10.3 and later.
2238
2239 @item -fobjc-call-cxx-cdtors
2240 @opindex fobjc-call-cxx-cdtors
2241 For each Objective-C class, check if any of its instance variables is a
2242 C++ object with a non-trivial default constructor.  If so, synthesize a
2243 special @code{- (id) .cxx_construct} instance method that will run
2244 non-trivial default constructors on any such instance variables, in order,
2245 and then return @code{self}.  Similarly, check if any instance variable
2246 is a C++ object with a non-trivial destructor, and if so, synthesize a
2247 special @code{- (void) .cxx_destruct} method that will run
2248 all such default destructors, in reverse order.
2249
2250 The @code{- (id) .cxx_construct} and/or @code{- (void) .cxx_destruct} methods
2251 thusly generated will only operate on instance variables declared in the
2252 current Objective-C class, and not those inherited from superclasses.  It
2253 is the responsibility of the Objective-C runtime to invoke all such methods
2254 in an object's inheritance hierarchy.  The @code{- (id) .cxx_construct} methods
2255 will be invoked by the runtime immediately after a new object
2256 instance is allocated; the @code{- (void) .cxx_destruct} methods will
2257 be invoked immediately before the runtime deallocates an object instance.
2258
2259 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2260 support for invoking the @code{- (id) .cxx_construct} and
2261 @code{- (void) .cxx_destruct} methods.
2262
2263 @item -fobjc-direct-dispatch
2264 @opindex fobjc-direct-dispatch
2265 Allow fast jumps to the message dispatcher.  On Darwin this is
2266 accomplished via the comm page.
2267
2268 @item -fobjc-exceptions
2269 @opindex fobjc-exceptions
2270 Enable syntactic support for structured exception handling in Objective-C,
2271 similar to what is offered by C++ and Java.  This option is
2272 unavailable in conjunction with the NeXT runtime on Mac OS X 10.2 and
2273 earlier.
2274
2275 @smallexample
2276   @@try @{
2277     @dots{}
2278        @@throw expr;
2279     @dots{}
2280   @}
2281   @@catch (AnObjCClass *exc) @{
2282     @dots{}
2283       @@throw expr;
2284     @dots{}
2285       @@throw;
2286     @dots{}
2287   @}
2288   @@catch (AnotherClass *exc) @{
2289     @dots{}
2290   @}
2291   @@catch (id allOthers) @{
2292     @dots{}
2293   @}
2294   @@finally @{
2295     @dots{}
2296       @@throw expr;
2297     @dots{}
2298   @}
2299 @end smallexample
2300
2301 The @code{@@throw} statement may appear anywhere in an Objective-C or
2302 Objective-C++ program; when used inside of a @code{@@catch} block, the
2303 @code{@@throw} may appear without an argument (as shown above), in which case
2304 the object caught by the @code{@@catch} will be rethrown.
2305
2306 Note that only (pointers to) Objective-C objects may be thrown and
2307 caught using this scheme.  When an object is thrown, it will be caught
2308 by the nearest @code{@@catch} clause capable of handling objects of that type,
2309 analogously to how @code{catch} blocks work in C++ and Java.  A
2310 @code{@@catch(id @dots{})} clause (as shown above) may also be provided to catch
2311 any and all Objective-C exceptions not caught by previous @code{@@catch}
2312 clauses (if any).
2313
2314 The @code{@@finally} clause, if present, will be executed upon exit from the
2315 immediately preceding @code{@@try @dots{} @@catch} section.  This will happen
2316 regardless of whether any exceptions are thrown, caught or rethrown
2317 inside the @code{@@try @dots{} @@catch} section, analogously to the behavior
2318 of the @code{finally} clause in Java.
2319
2320 There are several caveats to using the new exception mechanism:
2321
2322 @itemize @bullet
2323 @item
2324 Although currently designed to be binary compatible with @code{NS_HANDLER}-style
2325 idioms provided by the @code{NSException} class, the new
2326 exceptions can only be used on Mac OS X 10.3 (Panther) and later
2327 systems, due to additional functionality needed in the (NeXT) Objective-C
2328 runtime.
2329
2330 @item
2331 As mentioned above, the new exceptions do not support handling
2332 types other than Objective-C objects.   Furthermore, when used from
2333 Objective-C++, the Objective-C exception model does not interoperate with C++
2334 exceptions at this time.  This means you cannot @code{@@throw} an exception
2335 from Objective-C and @code{catch} it in C++, or vice versa
2336 (i.e., @code{throw @dots{} @@catch}).
2337 @end itemize
2338
2339 The @option{-fobjc-exceptions} switch also enables the use of synchronization
2340 blocks for thread-safe execution:
2341
2342 @smallexample
2343   @@synchronized (ObjCClass *guard) @{
2344     @dots{}
2345   @}
2346 @end smallexample
2347
2348 Upon entering the @code{@@synchronized} block, a thread of execution shall
2349 first check whether a lock has been placed on the corresponding @code{guard}
2350 object by another thread.  If it has, the current thread shall wait until
2351 the other thread relinquishes its lock.  Once @code{guard} becomes available,
2352 the current thread will place its own lock on it, execute the code contained in
2353 the @code{@@synchronized} block, and finally relinquish the lock (thereby
2354 making @code{guard} available to other threads).
2355
2356 Unlike Java, Objective-C does not allow for entire methods to be marked
2357 @code{@@synchronized}.  Note that throwing exceptions out of
2358 @code{@@synchronized} blocks is allowed, and will cause the guarding object
2359 to be unlocked properly.
2360
2361 @item -fobjc-gc
2362 @opindex fobjc-gc
2363 Enable garbage collection (GC) in Objective-C and Objective-C++ programs.
2364
2365 @item -freplace-objc-classes
2366 @opindex freplace-objc-classes
2367 Emit a special marker instructing @command{ld(1)} not to statically link in
2368 the resulting object file, and allow @command{dyld(1)} to load it in at
2369 run time instead.  This is used in conjunction with the Fix-and-Continue
2370 debugging mode, where the object file in question may be recompiled and
2371 dynamically reloaded in the course of program execution, without the need
2372 to restart the program itself.  Currently, Fix-and-Continue functionality
2373 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2374 and later.
2375
2376 @item -fzero-link
2377 @opindex fzero-link
2378 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2379 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2380 compile time) with static class references that get initialized at load time,
2381 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2382 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2383 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2384 for individual class implementations to be modified during program execution.
2385
2386 @item -gen-decls
2387 @opindex gen-decls
2388 Dump interface declarations for all classes seen in the source file to a
2389 file named @file{@var{sourcename}.decl}.
2390
2391 @item -Wassign-intercept
2392 @opindex Wassign-intercept
2393 Warn whenever an Objective-C assignment is being intercepted by the
2394 garbage collector.
2395
2396 @item -Wno-protocol
2397 @opindex Wno-protocol
2398 If a class is declared to implement a protocol, a warning is issued for
2399 every method in the protocol that is not implemented by the class.  The
2400 default behavior is to issue a warning for every method not explicitly
2401 implemented in the class, even if a method implementation is inherited
2402 from the superclass.  If you use the @option{-Wno-protocol} option, then
2403 methods inherited from the superclass are considered to be implemented,
2404 and no warning is issued for them.
2405
2406 @item -Wselector
2407 @opindex Wselector
2408 Warn if multiple methods of different types for the same selector are
2409 found during compilation.  The check is performed on the list of methods
2410 in the final stage of compilation.  Additionally, a check is performed
2411 for each selector appearing in a @code{@@selector(@dots{})}
2412 expression, and a corresponding method for that selector has been found
2413 during compilation.  Because these checks scan the method table only at
2414 the end of compilation, these warnings are not produced if the final
2415 stage of compilation is not reached, for example because an error is
2416 found during compilation, or because the @option{-fsyntax-only} option is
2417 being used.
2418
2419 @item -Wstrict-selector-match
2420 @opindex Wstrict-selector-match
2421 Warn if multiple methods with differing argument and/or return types are
2422 found for a given selector when attempting to send a message using this
2423 selector to a receiver of type @code{id} or @code{Class}.  When this flag
2424 is off (which is the default behavior), the compiler will omit such warnings
2425 if any differences found are confined to types which share the same size
2426 and alignment.
2427
2428 @item -Wundeclared-selector
2429 @opindex Wundeclared-selector
2430 Warn if a @code{@@selector(@dots{})} expression referring to an
2431 undeclared selector is found.  A selector is considered undeclared if no
2432 method with that name has been declared before the
2433 @code{@@selector(@dots{})} expression, either explicitly in an
2434 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
2435 an @code{@@implementation} section.  This option always performs its
2436 checks as soon as a @code{@@selector(@dots{})} expression is found,
2437 while @option{-Wselector} only performs its checks in the final stage of
2438 compilation.  This also enforces the coding style convention
2439 that methods and selectors must be declared before being used.
2440
2441 @item -print-objc-runtime-info
2442 @opindex print-objc-runtime-info
2443 Generate C header describing the largest structure that is passed by
2444 value, if any.
2445
2446 @end table
2447
2448 @node Language Independent Options
2449 @section Options to Control Diagnostic Messages Formatting
2450 @cindex options to control diagnostics formatting
2451 @cindex diagnostic messages
2452 @cindex message formatting
2453
2454 Traditionally, diagnostic messages have been formatted irrespective of
2455 the output device's aspect (e.g.@: its width, @dots{}).  The options described
2456 below can be used to control the diagnostic messages formatting
2457 algorithm, e.g.@: how many characters per line, how often source location
2458 information should be reported.  Right now, only the C++ front end can
2459 honor these options.  However it is expected, in the near future, that
2460 the remaining front ends would be able to digest them correctly.
2461
2462 @table @gcctabopt
2463 @item -fmessage-length=@var{n}
2464 @opindex fmessage-length
2465 Try to format error messages so that they fit on lines of about @var{n}
2466 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
2467 the front ends supported by GCC@.  If @var{n} is zero, then no
2468 line-wrapping will be done; each error message will appear on a single
2469 line.
2470
2471 @opindex fdiagnostics-show-location
2472 @item -fdiagnostics-show-location=once
2473 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
2474 reporter to emit @emph{once} source location information; that is, in
2475 case the message is too long to fit on a single physical line and has to
2476 be wrapped, the source location won't be emitted (as prefix) again,
2477 over and over, in subsequent continuation lines.  This is the default
2478 behavior.
2479
2480 @item -fdiagnostics-show-location=every-line
2481 Only meaningful in line-wrapping mode.  Instructs the diagnostic
2482 messages reporter to emit the same source location information (as
2483 prefix) for physical lines that result from the process of breaking
2484 a message which is too long to fit on a single line.
2485
2486 @item -fdiagnostics-show-option
2487 @opindex fdiagnostics-show-option
2488 This option instructs the diagnostic machinery to add text to each
2489 diagnostic emitted, which indicates which command line option directly
2490 controls that diagnostic, when such an option is known to the
2491 diagnostic machinery.
2492
2493 @item -Wcoverage-mismatch
2494 @opindex Wcoverage-mismatch
2495 Warn if feedback profiles do not match when using the
2496 @option{-fprofile-use} option.
2497 If a source file was changed between @option{-fprofile-gen} and
2498 @option{-fprofile-use}, the files with the profile feedback can fail
2499 to match the source file and GCC can not use the profile feedback
2500 information.  By default, GCC emits an error message in this case.
2501 The option @option{-Wcoverage-mismatch} emits a warning instead of an
2502 error.  GCC does not use appropriate feedback profiles, so using this
2503 option can result in poorly optimized code.  This option is useful
2504 only in the case of very minor changes such as bug fixes to an
2505 existing code-base.
2506
2507 @end table
2508
2509 @node Warning Options
2510 @section Options to Request or Suppress Warnings
2511 @cindex options to control warnings
2512 @cindex warning messages
2513 @cindex messages, warning
2514 @cindex suppressing warnings
2515
2516 Warnings are diagnostic messages that report constructions which
2517 are not inherently erroneous but which are risky or suggest there
2518 may have been an error.
2519
2520 You can request many specific warnings with options beginning @samp{-W},
2521 for example @option{-Wimplicit} to request warnings on implicit
2522 declarations.  Each of these specific warning options also has a
2523 negative form beginning @samp{-Wno-} to turn off warnings;
2524 for example, @option{-Wno-implicit}.  This manual lists only one of the
2525 two forms, whichever is not the default.
2526
2527 The following options control the amount and kinds of warnings produced
2528 by GCC; for further, language-specific options also refer to
2529 @ref{C++ Dialect Options} and @ref{Objective-C and Objective-C++ Dialect
2530 Options}.
2531
2532 @table @gcctabopt
2533 @cindex syntax checking
2534 @item -fsyntax-only
2535 @opindex fsyntax-only
2536 Check the code for syntax errors, but don't do anything beyond that.
2537
2538 @item -pedantic
2539 @opindex pedantic
2540 Issue all the warnings demanded by strict ISO C and ISO C++;
2541 reject all programs that use forbidden extensions, and some other
2542 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
2543 version of the ISO C standard specified by any @option{-std} option used.
2544
2545 Valid ISO C and ISO C++ programs should compile properly with or without
2546 this option (though a rare few will require @option{-ansi} or a
2547 @option{-std} option specifying the required version of ISO C)@.  However,
2548 without this option, certain GNU extensions and traditional C and C++
2549 features are supported as well.  With this option, they are rejected.
2550
2551 @option{-pedantic} does not cause warning messages for use of the
2552 alternate keywords whose names begin and end with @samp{__}.  Pedantic
2553 warnings are also disabled in the expression that follows
2554 @code{__extension__}.  However, only system header files should use
2555 these escape routes; application programs should avoid them.
2556 @xref{Alternate Keywords}.
2557
2558 Some users try to use @option{-pedantic} to check programs for strict ISO
2559 C conformance.  They soon find that it does not do quite what they want:
2560 it finds some non-ISO practices, but not all---only those for which
2561 ISO C @emph{requires} a diagnostic, and some others for which
2562 diagnostics have been added.
2563
2564 A feature to report any failure to conform to ISO C might be useful in
2565 some instances, but would require considerable additional work and would
2566 be quite different from @option{-pedantic}.  We don't have plans to
2567 support such a feature in the near future.
2568
2569 Where the standard specified with @option{-std} represents a GNU
2570 extended dialect of C, such as @samp{gnu89} or @samp{gnu99}, there is a
2571 corresponding @dfn{base standard}, the version of ISO C on which the GNU
2572 extended dialect is based.  Warnings from @option{-pedantic} are given
2573 where they are required by the base standard.  (It would not make sense
2574 for such warnings to be given only for features not in the specified GNU
2575 C dialect, since by definition the GNU dialects of C include all
2576 features the compiler supports with the given option, and there would be
2577 nothing to warn about.)
2578
2579 @item -pedantic-errors
2580 @opindex pedantic-errors
2581 Like @option{-pedantic}, except that errors are produced rather than
2582 warnings.
2583
2584 @item -w
2585 @opindex w
2586 Inhibit all warning messages.
2587
2588 @item -Wno-import
2589 @opindex Wno-import
2590 Inhibit warning messages about the use of @samp{#import}.
2591
2592 @item -Wchar-subscripts
2593 @opindex Wchar-subscripts
2594 Warn if an array subscript has type @code{char}.  This is a common cause
2595 of error, as programmers often forget that this type is signed on some
2596 machines.
2597 This warning is enabled by @option{-Wall}.
2598
2599 @item -Wcomment
2600 @opindex Wcomment
2601 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
2602 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
2603 This warning is enabled by @option{-Wall}.
2604
2605 @item -Wfatal-errors
2606 @opindex Wfatal-errors
2607 This option causes the compiler to abort compilation on the first error
2608 occurred rather than trying to keep going and printing further error
2609 messages.
2610
2611 @item -Wformat
2612 @opindex Wformat
2613 @opindex ffreestanding
2614 @opindex fno-builtin
2615 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
2616 the arguments supplied have types appropriate to the format string
2617 specified, and that the conversions specified in the format string make
2618 sense.  This includes standard functions, and others specified by format
2619 attributes (@pxref{Function Attributes}), in the @code{printf},
2620 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
2621 not in the C standard) families (or other target-specific families).
2622 Which functions are checked without format attributes having been
2623 specified depends on the standard version selected, and such checks of
2624 functions without the attribute specified are disabled by
2625 @option{-ffreestanding} or @option{-fno-builtin}.
2626
2627 The formats are checked against the format features supported by GNU
2628 libc version 2.2.  These include all ISO C90 and C99 features, as well
2629 as features from the Single Unix Specification and some BSD and GNU
2630 extensions.  Other library implementations may not support all these
2631 features; GCC does not support warning about features that go beyond a
2632 particular library's limitations.  However, if @option{-pedantic} is used
2633 with @option{-Wformat}, warnings will be given about format features not
2634 in the selected standard version (but not for @code{strfmon} formats,
2635 since those are not in any version of the C standard).  @xref{C Dialect
2636 Options,,Options Controlling C Dialect}.
2637
2638 Since @option{-Wformat} also checks for null format arguments for
2639 several functions, @option{-Wformat} also implies @option{-Wnonnull}.
2640
2641 @option{-Wformat} is included in @option{-Wall}.  For more control over some
2642 aspects of format checking, the options @option{-Wformat-y2k},
2643 @option{-Wno-format-extra-args}, @option{-Wno-format-zero-length},
2644 @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
2645 @option{-Wformat=2} are available, but are not included in @option{-Wall}.
2646
2647 @item -Wformat-y2k
2648 @opindex Wformat-y2k
2649 If @option{-Wformat} is specified, also warn about @code{strftime}
2650 formats which may yield only a two-digit year.
2651
2652 @item -Wno-format-extra-args
2653 @opindex Wno-format-extra-args
2654 If @option{-Wformat} is specified, do not warn about excess arguments to a
2655 @code{printf} or @code{scanf} format function.  The C standard specifies
2656 that such arguments are ignored.
2657
2658 Where the unused arguments lie between used arguments that are
2659 specified with @samp{$} operand number specifications, normally
2660 warnings are still given, since the implementation could not know what
2661 type to pass to @code{va_arg} to skip the unused arguments.  However,
2662 in the case of @code{scanf} formats, this option will suppress the
2663 warning if the unused arguments are all pointers, since the Single
2664 Unix Specification says that such unused arguments are allowed.
2665
2666 @item -Wno-format-zero-length
2667 @opindex Wno-format-zero-length
2668 If @option{-Wformat} is specified, do not warn about zero-length formats.
2669 The C standard specifies that zero-length formats are allowed.
2670
2671 @item -Wformat-nonliteral
2672 @opindex Wformat-nonliteral
2673 If @option{-Wformat} is specified, also warn if the format string is not a
2674 string literal and so cannot be checked, unless the format function
2675 takes its format arguments as a @code{va_list}.
2676
2677 @item -Wformat-security
2678 @opindex Wformat-security
2679 If @option{-Wformat} is specified, also warn about uses of format
2680 functions that represent possible security problems.  At present, this
2681 warns about calls to @code{printf} and @code{scanf} functions where the
2682 format string is not a string literal and there are no format arguments,
2683 as in @code{printf (foo);}.  This may be a security hole if the format
2684 string came from untrusted input and contains @samp{%n}.  (This is
2685 currently a subset of what @option{-Wformat-nonliteral} warns about, but
2686 in future warnings may be added to @option{-Wformat-security} that are not
2687 included in @option{-Wformat-nonliteral}.)
2688
2689 @item -Wformat=2
2690 @opindex Wformat=2
2691 Enable @option{-Wformat} plus format checks not included in
2692 @option{-Wformat}.  Currently equivalent to @samp{-Wformat
2693 -Wformat-nonliteral -Wformat-security -Wformat-y2k}.
2694
2695 @item -Wnonnull
2696 @opindex Wnonnull
2697 Warn about passing a null pointer for arguments marked as
2698 requiring a non-null value by the @code{nonnull} function attribute.
2699
2700 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
2701 can be disabled with the @option{-Wno-nonnull} option.
2702
2703 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
2704 @opindex Winit-self
2705 Warn about uninitialized variables which are initialized with themselves.
2706 Note this option can only be used with the @option{-Wuninitialized} option,
2707 which in turn only works with @option{-O1} and above.
2708
2709 For example, GCC will warn about @code{i} being uninitialized in the
2710 following snippet only when @option{-Winit-self} has been specified:
2711 @smallexample
2712 @group
2713 int f()
2714 @{
2715   int i = i;
2716   return i;
2717 @}
2718 @end group
2719 @end smallexample
2720
2721 @item -Wimplicit-int
2722 @opindex Wimplicit-int
2723 Warn when a declaration does not specify a type.
2724 This warning is enabled by @option{-Wall}.
2725
2726 @item -Wimplicit-function-declaration
2727 @opindex Wimplicit-function-declaration
2728 @opindex Wno-implicit-function-declaration
2729 Give a warning whenever a function is used before being declared. In
2730 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
2731 enabled by default and it is made into an error by
2732 @option{-pedantic-errors}. This warning is also enabled by
2733 @option{-Wall}.
2734
2735 @item -Wimplicit
2736 @opindex Wimplicit
2737 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
2738 This warning is enabled by @option{-Wall}.
2739
2740 @item -Wmain
2741 @opindex Wmain
2742 Warn if the type of @samp{main} is suspicious.  @samp{main} should be a
2743 function with external linkage, returning int, taking either zero
2744 arguments, two, or three arguments of appropriate types.
2745 This warning is enabled by @option{-Wall}.
2746
2747 @item -Wmissing-braces
2748 @opindex Wmissing-braces
2749 Warn if an aggregate or union initializer is not fully bracketed.  In
2750 the following example, the initializer for @samp{a} is not fully
2751 bracketed, but that for @samp{b} is fully bracketed.
2752
2753 @smallexample
2754 int a[2][2] = @{ 0, 1, 2, 3 @};
2755 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
2756 @end smallexample
2757
2758 This warning is enabled by @option{-Wall}.
2759
2760 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
2761 @opindex Wmissing-include-dirs
2762 Warn if a user-supplied include directory does not exist.
2763
2764 @item -Wparentheses
2765 @opindex Wparentheses
2766 Warn if parentheses are omitted in certain contexts, such
2767 as when there is an assignment in a context where a truth value
2768 is expected, or when operators are nested whose precedence people
2769 often get confused about.
2770
2771 Also warn if a comparison like @samp{x<=y<=z} appears; this is
2772 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
2773 interpretation from that of ordinary mathematical notation.
2774
2775 Also warn about constructions where there may be confusion to which
2776 @code{if} statement an @code{else} branch belongs.  Here is an example of
2777 such a case:
2778
2779 @smallexample
2780 @group
2781 @{
2782   if (a)
2783     if (b)
2784       foo ();
2785   else
2786     bar ();
2787 @}
2788 @end group
2789 @end smallexample
2790
2791 In C/C++, every @code{else} branch belongs to the innermost possible
2792 @code{if} statement, which in this example is @code{if (b)}.  This is
2793 often not what the programmer expected, as illustrated in the above
2794 example by indentation the programmer chose.  When there is the
2795 potential for this confusion, GCC will issue a warning when this flag
2796 is specified.  To eliminate the warning, add explicit braces around
2797 the innermost @code{if} statement so there is no way the @code{else}
2798 could belong to the enclosing @code{if}.  The resulting code would
2799 look like this:
2800
2801 @smallexample
2802 @group
2803 @{
2804   if (a)
2805     @{
2806       if (b)
2807         foo ();
2808       else
2809         bar ();
2810     @}
2811 @}
2812 @end group
2813 @end smallexample
2814
2815 This warning is enabled by @option{-Wall}.
2816
2817 @item -Wsequence-point
2818 @opindex Wsequence-point
2819 Warn about code that may have undefined semantics because of violations
2820 of sequence point rules in the C and C++ standards.
2821
2822 The C and C++ standards defines the order in which expressions in a C/C++
2823 program are evaluated in terms of @dfn{sequence points}, which represent
2824 a partial ordering between the execution of parts of the program: those
2825 executed before the sequence point, and those executed after it.  These
2826 occur after the evaluation of a full expression (one which is not part
2827 of a larger expression), after the evaluation of the first operand of a
2828 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
2829 function is called (but after the evaluation of its arguments and the
2830 expression denoting the called function), and in certain other places.
2831 Other than as expressed by the sequence point rules, the order of
2832 evaluation of subexpressions of an expression is not specified.  All
2833 these rules describe only a partial order rather than a total order,
2834 since, for example, if two functions are called within one expression
2835 with no sequence point between them, the order in which the functions
2836 are called is not specified.  However, the standards committee have
2837 ruled that function calls do not overlap.
2838
2839 It is not specified when between sequence points modifications to the
2840 values of objects take effect.  Programs whose behavior depends on this
2841 have undefined behavior; the C and C++ standards specify that ``Between
2842 the previous and next sequence point an object shall have its stored
2843 value modified at most once by the evaluation of an expression.
2844 Furthermore, the prior value shall be read only to determine the value
2845 to be stored.''.  If a program breaks these rules, the results on any
2846 particular implementation are entirely unpredictable.
2847
2848 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
2849 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
2850 diagnosed by this option, and it may give an occasional false positive
2851 result, but in general it has been found fairly effective at detecting
2852 this sort of problem in programs.
2853
2854 The standard is worded confusingly, therefore there is some debate
2855 over the precise meaning of the sequence point rules in subtle cases.
2856 Links to discussions of the problem, including proposed formal
2857 definitions, may be found on the GCC readings page, at
2858 @w{@uref{http://gcc.gnu.org/readings.html}}.
2859
2860 This warning is enabled by @option{-Wall} for C and C++.
2861
2862 @item -Wreturn-type
2863 @opindex Wreturn-type
2864 @opindex Wno-return-type
2865 Warn whenever a function is defined with a return-type that defaults
2866 to @code{int}.  Also warn about any @code{return} statement with no
2867 return-value in a function whose return-type is not @code{void}
2868 (falling off the end of the function body is considered returning
2869 without a value), and about a @code{return} statement with a
2870 expression in a function whose return-type is @code{void}.
2871
2872 Also warn if the return type of a function has a type qualifier
2873 such as @code{const}.  For ISO C such a type qualifier has no effect,
2874 since the value returned by a function is not an lvalue.
2875 For C++, the warning is only emitted for scalar types or @code{void}.
2876 ISO C prohibits qualified @code{void} return types on function
2877 definitions, so such return types always receive a warning
2878 even without this option.
2879
2880 For C++, a function without return type always produces a diagnostic
2881 message, even when @option{-Wno-return-type} is specified.  The only
2882 exceptions are @samp{main} and functions defined in system headers.
2883
2884 This warning is enabled by @option{-Wall}.
2885
2886 @item -Wswitch
2887 @opindex Wswitch
2888 Warn whenever a @code{switch} statement has an index of enumerated type
2889 and lacks a @code{case} for one or more of the named codes of that
2890 enumeration.  (The presence of a @code{default} label prevents this
2891 warning.)  @code{case} labels outside the enumeration range also
2892 provoke warnings when this option is used.
2893 This warning is enabled by @option{-Wall}.
2894
2895 @item -Wswitch-default
2896 @opindex Wswitch-switch
2897 Warn whenever a @code{switch} statement does not have a @code{default}
2898 case.
2899
2900 @item -Wswitch-enum
2901 @opindex Wswitch-enum
2902 Warn whenever a @code{switch} statement has an index of enumerated type
2903 and lacks a @code{case} for one or more of the named codes of that
2904 enumeration.  @code{case} labels outside the enumeration range also
2905 provoke warnings when this option is used.
2906
2907 @item -Wtrigraphs
2908 @opindex Wtrigraphs
2909 Warn if any trigraphs are encountered that might change the meaning of
2910 the program (trigraphs within comments are not warned about).
2911 This warning is enabled by @option{-Wall}.
2912
2913 @item -Wunused-function
2914 @opindex Wunused-function
2915 Warn whenever a static function is declared but not defined or a
2916 non-inline static function is unused.
2917 This warning is enabled by @option{-Wall}.
2918
2919 @item -Wunused-label
2920 @opindex Wunused-label
2921 Warn whenever a label is declared but not used.
2922 This warning is enabled by @option{-Wall}.
2923
2924 To suppress this warning use the @samp{unused} attribute
2925 (@pxref{Variable Attributes}).
2926
2927 @item -Wunused-parameter
2928 @opindex Wunused-parameter
2929 Warn whenever a function parameter is unused aside from its declaration.
2930
2931 To suppress this warning use the @samp{unused} attribute
2932 (@pxref{Variable Attributes}).
2933
2934 @item -Wunused-variable
2935 @opindex Wunused-variable
2936 Warn whenever a local variable or non-constant static variable is unused
2937 aside from its declaration.
2938 This warning is enabled by @option{-Wall}.
2939
2940 To suppress this warning use the @samp{unused} attribute
2941 (@pxref{Variable Attributes}).
2942
2943 @item -Wunused-value
2944 @opindex Wunused-value
2945 Warn whenever a statement computes a result that is explicitly not
2946 used. To suppress this warning cast the unused expression to
2947 @samp{void}. This includes an expression-statement or the left-hand
2948 side of a comma expression that contains no side effects. For example,
2949 an expression such as @samp{x[i,j]} will cause a warning, while
2950 @samp{x[(void)i,j]} will not.
2951
2952 This warning is enabled by @option{-Wall}.
2953
2954 @item -Wunused
2955 @opindex Wunused
2956 All the above @option{-Wunused} options combined.
2957
2958 In order to get a warning about an unused function parameter, you must
2959 either specify @samp{-Wextra -Wunused} (note that @samp{-Wall} implies
2960 @samp{-Wunused}), or separately specify @option{-Wunused-parameter}.
2961
2962 @item -Wuninitialized
2963 @opindex Wuninitialized
2964 Warn if an automatic variable is used without first being initialized or
2965 if a variable may be clobbered by a @code{setjmp} call.
2966
2967 These warnings are possible only in optimizing compilation,
2968 because they require data flow information that is computed only
2969 when optimizing.  If you do not specify @option{-O}, you will not get
2970 these warnings. Instead, GCC will issue a warning about @option{-Wuninitialized}
2971 requiring @option{-O}.
2972
2973 If you want to warn about code which uses the uninitialized value of the
2974 variable in its own initializer, use the @option{-Winit-self} option.
2975
2976 These warnings occur for individual uninitialized or clobbered
2977 elements of structure, union or array variables as well as for
2978 variables which are uninitialized or clobbered as a whole.  They do
2979 not occur for variables or elements declared @code{volatile}.  Because
2980 these warnings depend on optimization, the exact variables or elements
2981 for which there are warnings will depend on the precise optimization
2982 options and version of GCC used.
2983
2984 Note that there may be no warning about a variable that is used only
2985 to compute a value that itself is never used, because such
2986 computations may be deleted by data flow analysis before the warnings
2987 are printed.
2988
2989 These warnings are made optional because GCC is not smart
2990 enough to see all the reasons why the code might be correct
2991 despite appearing to have an error.  Here is one example of how
2992 this can happen:
2993
2994 @smallexample
2995 @group
2996 @{
2997   int x;
2998   switch (y)
2999     @{
3000     case 1: x = 1;
3001       break;
3002     case 2: x = 4;
3003       break;
3004     case 3: x = 5;
3005     @}
3006   foo (x);
3007 @}
3008 @end group
3009 @end smallexample
3010
3011 @noindent
3012 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
3013 always initialized, but GCC doesn't know this.  Here is
3014 another common case:
3015
3016 @smallexample
3017 @{
3018   int save_y;
3019   if (change_y) save_y = y, y = new_y;
3020   @dots{}
3021   if (change_y) y = save_y;
3022 @}
3023 @end smallexample
3024
3025 @noindent
3026 This has no bug because @code{save_y} is used only if it is set.
3027
3028 @cindex @code{longjmp} warnings
3029 This option also warns when a non-volatile automatic variable might be
3030 changed by a call to @code{longjmp}.  These warnings as well are possible
3031 only in optimizing compilation.
3032
3033 The compiler sees only the calls to @code{setjmp}.  It cannot know
3034 where @code{longjmp} will be called; in fact, a signal handler could
3035 call it at any point in the code.  As a result, you may get a warning
3036 even when there is in fact no problem because @code{longjmp} cannot
3037 in fact be called at the place which would cause a problem.
3038
3039 Some spurious warnings can be avoided if you declare all the functions
3040 you use that never return as @code{noreturn}.  @xref{Function
3041 Attributes}.
3042
3043 This warning is enabled by @option{-Wall}.
3044
3045 @item -Wunknown-pragmas
3046 @opindex Wunknown-pragmas
3047 @cindex warning for unknown pragmas
3048 @cindex unknown pragmas, warning
3049 @cindex pragmas, warning of unknown
3050 Warn when a #pragma directive is encountered which is not understood by
3051 GCC@.  If this command line option is used, warnings will even be issued
3052 for unknown pragmas in system header files.  This is not the case if
3053 the warnings were only enabled by the @option{-Wall} command line option.
3054
3055 @item -Wno-pragmas
3056 @opindex Wno-pragmas
3057 @opindex Wpragmas
3058 Do not warn about misuses of pragmas, such as incorrect parameters,
3059 invalid syntax, or conflicts between pragmas.  See also
3060 @samp{-Wunknown-pragmas}.
3061
3062 @item -Wstrict-aliasing
3063 @opindex Wstrict-aliasing
3064 This option is only active when @option{-fstrict-aliasing} is active.
3065 It warns about code which might break the strict aliasing rules that the
3066 compiler is using for optimization.  The warning does not catch all
3067 cases, but does attempt to catch the more common pitfalls.  It is
3068 included in @option{-Wall}.
3069 It is equivalent to -Wstrict-aliasing=3
3070
3071 @item -Wstrict-aliasing=n
3072 @opindex Wstrict-aliasing=n
3073 This option is only active when @option{-fstrict-aliasing} is active.
3074 It warns about code which might break the strict aliasing rules that the
3075 compiler is using for optimization.
3076 Higher levels correspond to higher accuracy (fewer false positives).
3077 Higher levels also correspond to more effort, similar to the way -O works.
3078 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=n},
3079 with n=3.
3080
3081 Level 1: Most aggressive, quick, least accurate.
3082 Possibly useful when higher levels
3083 do not warn but -fstrict-aliasing still breaks the code, as it has very few 
3084 false negatives.  However, it has many false positives.
3085 Warns for all pointer conversions between possibly incompatible types, 
3086 even if never dereferenced.  Runs in the frontend only.
3087
3088 Level 2: Aggressive, quick, not too precise.
3089 May still have many false positives (not as many as level 1 though),
3090 and few false negatives (but possibly more than level 1).
3091 Unlike level 1, it only warns when an address is taken.  Warns about
3092 incomplete types.  Runs in the frontend only.
3093
3094 Level 3 (default for @option{-Wstrict-aliasing}): 
3095 Should have very few false positives and few false 
3096 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
3097 Takes care of the common punn+dereference pattern in the frontend:
3098 @code{*(int*)&some_float}.
3099 If optimization is enabled, it also runs in the backend, where it deals 
3100 with multiple statement cases using flow-sensitive points-to information.
3101 Only warns when the converted pointer is dereferenced.
3102 Does not warn about incomplete types.
3103
3104 @item -Wstrict-overflow
3105 @item -Wstrict-overflow=@var{n}
3106 @opindex Wstrict-overflow
3107 This option is only active when @option{-fstrict-overflow} is active.
3108 It warns about cases where the compiler optimizes based on the
3109 assumption that signed overflow does not occur.  Note that it does not
3110 warn about all cases where the code might overflow: it only warns
3111 about cases where the compiler implements some optimization.  Thus
3112 this warning depends on the optimization level.
3113
3114 An optimization which assumes that signed overflow does not occur is
3115 perfectly safe if the values of the variables involved are such that
3116 overflow never does, in fact, occur.  Therefore this warning can
3117 easily give a false positive: a warning about code which is not
3118 actually a problem.  To help focus on important issues, several
3119 warning levels are defined.  No warnings are issued for the use of
3120 undefined signed overflow when estimating how many iterations a loop
3121 will require, in particular when determining whether a loop will be
3122 executed at all.
3123
3124 @table @option
3125 @item -Wstrict-overflow=1
3126 Warn about cases which are both questionable and easy to avoid.  For
3127 example: @code{x + 1 > x}; with @option{-fstrict-overflow}, the
3128 compiler will simplify this to @code{1}.  This level of
3129 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
3130 are not, and must be explicitly requested.
3131
3132 @item -Wstrict-overflow=2
3133 Also warn about other cases where a comparison is simplified to a
3134 constant.  For example: @code{abs (x) >= 0}.  This can only be
3135 simplified when @option{-fstrict-overflow} is in effect, because
3136 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
3137 zero.  @option{-Wstrict-overflow} (with no level) is the same as
3138 @option{-Wstrict-overflow=2}.
3139
3140 @item -Wstrict-overflow=3
3141 Also warn about other cases where a comparison is simplified.  For
3142 example: @code{x + 1 > 1} will be simplified to @code{x > 0}.
3143
3144 @item -Wstrict-overflow=4
3145 Also warn about other simplifications not covered by the above cases.
3146 For example: @code{(x * 10) / 5} will be simplified to @code{x * 2}.
3147
3148 @item -Wstrict-overflow=5
3149 Also warn about cases where the compiler reduces the magnitude of a
3150 constant involved in a comparison.  For example: @code{x + 2 > y} will
3151 be simplified to @code{x + 1 >= y}.  This is reported only at the
3152 highest warning level because this simplification applies to many
3153 comparisons, so this warning level will give a very large number of
3154 false positives.
3155 @end table
3156
3157 @item -Warray-bounds
3158 @opindex Wno-array-bounds
3159 @opindex Warray-bounds
3160 This option is only active when @option{-ftree-vrp} is active
3161 (default for -O2 and above). It warns about subscripts to arrays
3162 that are always out of bounds. This warning is enabled by @option{-Wall}.
3163
3164 @item -Wall
3165 @opindex Wall
3166 All of the above @samp{-W} options combined.  This enables all the
3167 warnings about constructions that some users consider questionable, and
3168 that are easy to avoid (or modify to prevent the warning), even in
3169 conjunction with macros.  This also enables some language-specific
3170 warnings described in @ref{C++ Dialect Options} and
3171 @ref{Objective-C and Objective-C++ Dialect Options}.
3172 @end table
3173
3174 The following @option{-W@dots{}} options are not implied by @option{-Wall}.
3175 Some of them warn about constructions that users generally do not
3176 consider questionable, but which occasionally you might wish to check
3177 for; others warn about constructions that are necessary or hard to avoid
3178 in some cases, and there is no simple way to modify the code to suppress
3179 the warning.
3180
3181 @table @gcctabopt
3182 @item -Wextra
3183 @opindex W
3184 @opindex Wextra
3185 (This option used to be called @option{-W}.  The older name is still
3186 supported, but the newer name is more descriptive.)  Print extra warning
3187 messages for these events:
3188
3189 @itemize @bullet
3190 @item
3191 Warn if a comparison is always true or always false due to the limited
3192 range of the data type, but do not warn for constant expressions.  For
3193 example, warn if an unsigned variable is compared against zero with
3194 @samp{<} or @samp{>=}.  This warning can be independently controlled
3195 by @option{-Wtype-limits}.
3196
3197 @item @r{(C only)}
3198 Storage-class specifiers like @code{static} are not the first things
3199 in a declaration.  According to the C Standard, this usage is
3200 obsolescent.  This warning can be independently controlled by
3201 @option{-Wold-style-declaration}.
3202
3203 @item
3204 If @option{-Wall} or @option{-Wunused} is also specified, warn about unused
3205 arguments.
3206
3207 @item
3208 A comparison between signed and unsigned values could produce an
3209 incorrect result when the signed value is converted to unsigned.
3210 (But don't warn if @option{-Wno-sign-compare} is also specified.)
3211
3212 @item
3213 An aggregate has an initializer which does not initialize all members.
3214 This warning can be independently controlled by
3215 @option{-Wmissing-field-initializers}.
3216
3217 @item
3218 An initialized field without side effects is overridden when using
3219 designated initializers (@pxref{Designated Inits, , Designated
3220 Initializers}).  This warning can be independently controlled by
3221 @option{-Woverride-init}.
3222
3223 @item @r{(C only)}
3224 A function parameter is declared without a type specifier in K&R-style
3225 functions.  This warning can be independently controlled by
3226 @option{-Wmissing-parameter-type}.
3227
3228 @item
3229 An empty body occurs in an @samp{if}, @samp{else} or
3230 @samp{do while} statement. This warning can be independently
3231 controlled by @option{-Wempty-body}.
3232
3233 @item @r{(C++ only)}
3234 An empty body occurs in a @samp{while} or @samp{for} statement with no
3235 whitespacing before the semicolon. This warning can be independently
3236 controlled by @option{-Wempty-body}.
3237
3238 @item
3239 A pointer is compared against integer zero with @samp{<}, @samp{<=},
3240 @samp{>}, or @samp{>=}.
3241
3242 @item
3243 A variable might be changed by @samp{longjmp} or @samp{vfork}.
3244 This warning can be independently controlled by @option{-Wclobbered}.
3245
3246 @item @r{(C++ only)}
3247 An enumerator and a non-enumerator both appear in a conditional expression.
3248
3249 @item @r{(C++ only)}
3250 A non-static reference or non-static @samp{const} member appears in a
3251 class without constructors.
3252
3253 @item @r{(C++ only)}
3254 Ambiguous virtual bases.
3255
3256 @item @r{(C++ only)}
3257 Subscripting an array which has been declared @samp{register}.
3258
3259 @item @r{(C++ only)}
3260 Taking the address of a variable which has been declared @samp{register}.
3261
3262 @item @r{(C++ only)}
3263 A base class is not initialized in a derived class' copy constructor.
3264 @end itemize
3265
3266 @item -Wno-div-by-zero
3267 @opindex Wno-div-by-zero
3268 @opindex Wdiv-by-zero
3269 Do not warn about compile-time integer division by zero.  Floating point
3270 division by zero is not warned about, as it can be a legitimate way of
3271 obtaining infinities and NaNs.
3272
3273 @item -Wsystem-headers
3274 @opindex Wsystem-headers
3275 @cindex warnings from system headers
3276 @cindex system headers, warnings from
3277 Print warning messages for constructs found in system header files.
3278 Warnings from system headers are normally suppressed, on the assumption
3279 that they usually do not indicate real problems and would only make the
3280 compiler output harder to read.  Using this command line option tells
3281 GCC to emit warnings from system headers as if they occurred in user
3282 code.  However, note that using @option{-Wall} in conjunction with this
3283 option will @emph{not} warn about unknown pragmas in system
3284 headers---for that, @option{-Wunknown-pragmas} must also be used.
3285
3286 @item -Wfloat-equal
3287 @opindex Wfloat-equal
3288 Warn if floating point values are used in equality comparisons.
3289
3290 The idea behind this is that sometimes it is convenient (for the
3291 programmer) to consider floating-point values as approximations to
3292 infinitely precise real numbers.  If you are doing this, then you need
3293 to compute (by analyzing the code, or in some other way) the maximum or
3294 likely maximum error that the computation introduces, and allow for it
3295 when performing comparisons (and when producing output, but that's a
3296 different problem).  In particular, instead of testing for equality, you
3297 would check to see whether the two values have ranges that overlap; and
3298 this is done with the relational operators, so equality comparisons are
3299 probably mistaken.
3300
3301 @item -Wtraditional @r{(C only)}
3302 @opindex Wtraditional
3303 Warn about certain constructs that behave differently in traditional and
3304 ISO C@.  Also warn about ISO C constructs that have no traditional C
3305 equivalent, and/or problematic constructs which should be avoided.
3306
3307 @itemize @bullet
3308 @item
3309 Macro parameters that appear within string literals in the macro body.
3310 In traditional C macro replacement takes place within string literals,
3311 but does not in ISO C@.
3312
3313 @item
3314 In traditional C, some preprocessor directives did not exist.
3315 Traditional preprocessors would only consider a line to be a directive
3316 if the @samp{#} appeared in column 1 on the line.  Therefore
3317 @option{-Wtraditional} warns about directives that traditional C
3318 understands but would ignore because the @samp{#} does not appear as the
3319 first character on the line.  It also suggests you hide directives like
3320 @samp{#pragma} not understood by traditional C by indenting them.  Some
3321 traditional implementations would not recognize @samp{#elif}, so it
3322 suggests avoiding it altogether.
3323
3324 @item
3325 A function-like macro that appears without arguments.
3326
3327 @item
3328 The unary plus operator.
3329
3330 @item
3331 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating point
3332 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
3333 constants.)  Note, these suffixes appear in macros defined in the system
3334 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
3335 Use of these macros in user code might normally lead to spurious
3336 warnings, however GCC's integrated preprocessor has enough context to
3337 avoid warning in these cases.
3338
3339 @item
3340 A function declared external in one block and then used after the end of
3341 the block.
3342
3343 @item
3344 A @code{switch} statement has an operand of type @code{long}.
3345
3346 @item
3347 A non-@code{static} function declaration follows a @code{static} one.
3348 This construct is not accepted by some traditional C compilers.
3349
3350 @item
3351 The ISO type of an integer constant has a different width or
3352 signedness from its traditional type.  This warning is only issued if
3353 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
3354 typically represent bit patterns, are not warned about.
3355
3356 @item
3357 Usage of ISO string concatenation is detected.
3358
3359 @item
3360 Initialization of automatic aggregates.
3361
3362 @item
3363 Identifier conflicts with labels.  Traditional C lacks a separate
3364 namespace for labels.
3365
3366 @item
3367 Initialization of unions.  If the initializer is zero, the warning is
3368 omitted.  This is done under the assumption that the zero initializer in
3369 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
3370 initializer warnings and relies on default initialization to zero in the
3371 traditional C case.
3372
3373 @item
3374 Conversions by prototypes between fixed/floating point values and vice
3375 versa.  The absence of these prototypes when compiling with traditional
3376 C would cause serious problems.  This is a subset of the possible
3377 conversion warnings, for the full set use @option{-Wtraditional-conversion}.
3378
3379 @item
3380 Use of ISO C style function definitions.  This warning intentionally is
3381 @emph{not} issued for prototype declarations or variadic functions
3382 because these ISO C features will appear in your code when using
3383 libiberty's traditional C compatibility macros, @code{PARAMS} and
3384 @code{VPARAMS}.  This warning is also bypassed for nested functions
3385 because that feature is already a GCC extension and thus not relevant to
3386 traditional C compatibility.
3387 @end itemize
3388
3389 @item -Wtraditional-conversion @r{(C only)}
3390 @opindex Wtraditional-conversion
3391 Warn if a prototype causes a type conversion that is different from what
3392 would happen to the same argument in the absence of a prototype.  This
3393 includes conversions of fixed point to floating and vice versa, and
3394 conversions changing the width or signedness of a fixed point argument
3395 except when the same as the default promotion.
3396
3397 @item -Wdeclaration-after-statement @r{(C only)}
3398 @opindex Wdeclaration-after-statement
3399 Warn when a declaration is found after a statement in a block.  This
3400 construct, known from C++, was introduced with ISO C99 and is by default
3401 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
3402 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
3403
3404 @item -Wundef
3405 @opindex Wundef
3406 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
3407
3408 @item -Wno-endif-labels
3409 @opindex Wno-endif-labels
3410 @opindex Wendif-labels
3411 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
3412
3413 @item -Wshadow
3414 @opindex Wshadow
3415 Warn whenever a local variable shadows another local variable, parameter or
3416 global variable or whenever a built-in function is shadowed.
3417
3418 @item -Wlarger-than-@var{len}
3419 @opindex Wlarger-than
3420 Warn whenever an object of larger than @var{len} bytes is defined.
3421
3422 @item -Wunsafe-loop-optimizations
3423 @opindex Wunsafe-loop-optimizations
3424 Warn if the loop cannot be optimized because the compiler could not
3425 assume anything on the bounds of the loop indices.  With
3426 @option{-funsafe-loop-optimizations} warn if the compiler made
3427 such assumptions.
3428
3429 @item -Wpointer-arith
3430 @opindex Wpointer-arith
3431 Warn about anything that depends on the ``size of'' a function type or
3432 of @code{void}.  GNU C assigns these types a size of 1, for
3433 convenience in calculations with @code{void *} pointers and pointers
3434 to functions.  In C++, warn also when an arithmetic operation involves
3435 @code{NULL}.  This warning is also enabled by @option{-pedantic}.
3436
3437 @item -Wtype-limits
3438 @opindex Wtype-limits
3439 @opindex Wno-type-limits
3440 Warn if a comparison is always true or always false due to the limited
3441 range of the data type, but do not warn for constant expressions.  For
3442 example, warn if an unsigned variable is compared against zero with
3443 @samp{<} or @samp{>=}.  This warning is also enabled by
3444 @option{-Wextra}.
3445
3446 @item -Wbad-function-cast @r{(C only)}
3447 @opindex Wbad-function-cast
3448 Warn whenever a function call is cast to a non-matching type.
3449 For example, warn if @code{int malloc()} is cast to @code{anything *}.
3450
3451 @item -Wc++-compat
3452 Warn about ISO C constructs that are outside of the common subset of
3453 ISO C and ISO C++, e.g.@: request for implicit conversion from
3454 @code{void *} to a pointer to non-@code{void} type.
3455
3456 @item -Wc++0x-compat @r{(C++ and Objective-C++ only)}
3457 Warn about C++ constructs whose meaning differs between ISO C++ 1998 and
3458 ISO C++ 200x, e.g., identifiers in ISO C++ 1998 that will become keywords
3459 in ISO C++ 200x.  This warning is enabled by @option{-Wall}.
3460
3461 @item -Wcast-qual
3462 @opindex Wcast-qual
3463 Warn whenever a pointer is cast so as to remove a type qualifier from
3464 the target type.  For example, warn if a @code{const char *} is cast
3465 to an ordinary @code{char *}.
3466
3467 @item -Wcast-align
3468 @opindex Wcast-align
3469 Warn whenever a pointer is cast such that the required alignment of the
3470 target is increased.  For example, warn if a @code{char *} is cast to
3471 an @code{int *} on machines where integers can only be accessed at
3472 two- or four-byte boundaries.
3473
3474 @item -Wwrite-strings
3475 @opindex Wwrite-strings
3476 When compiling C, give string constants the type @code{const
3477 char[@var{length}]} so that
3478 copying the address of one into a non-@code{const} @code{char *}
3479 pointer will get a warning; when compiling C++, warn about the
3480 deprecated conversion from string literals to @code{char *}.  This
3481 warning, by default, is enabled for C++ programs.
3482 These warnings will help you find at
3483 compile time code that can try to write into a string constant, but
3484 only if you have been very careful about using @code{const} in
3485 declarations and prototypes.  Otherwise, it will just be a nuisance;
3486 this is why we did not make @option{-Wall} request these warnings.
3487
3488 @item -Wclobbered
3489 @opindex Wclobbered
3490 Warn for variables that might be changed by @samp{longjmp} or
3491 @samp{vfork}.  This warning is also enabled by @option{-Wextra}.
3492
3493 @item -Wconversion
3494 @opindex Wconversion
3495 @opindex Wno-conversion
3496 Warn for implicit conversions that may alter a value. This includes
3497 conversions between real and integer, like @code{abs (x)} when
3498 @code{x} is @code{double}; conversions between signed and unsigned,
3499 like @code{unsigned ui = -1}; and conversions to smaller types, like
3500 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
3501 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
3502 changed by the conversion like in @code{abs (2.0)}.  Warnings about
3503 conversions between signed and unsigned integers can be disabled by
3504 using @option{-Wno-sign-conversion}.
3505
3506 For C++, also warn for conversions between @code{NULL} and non-pointer
3507 types; confusing overload resolution for user-defined conversions; and
3508 conversions that will never use a type conversion operator:
3509 conversions to @code{void}, the same type, a base class or a reference
3510 to them. Warnings about conversions between signed and unsigned
3511 integers are disabled by default in C++ unless
3512 @option{-Wsign-conversion} is explicitly enabled.
3513
3514 @item -Wempty-body
3515 @opindex Wempty-body
3516 Warn if an empty body occurs in an @samp{if}, @samp{else} or @samp{do
3517 while} statement.  Additionally, in C++, warn when an empty body occurs
3518 in a @samp{while} or @samp{for} statement with no whitespacing before
3519 the semicolon.  This warning is also enabled by @option{-Wextra}.
3520
3521 @item -Wsign-compare
3522 @opindex Wsign-compare
3523 @cindex warning for comparison of signed and unsigned values
3524 @cindex comparison of signed and unsigned values, warning
3525 @cindex signed and unsigned values, comparison warning
3526 Warn when a comparison between signed and unsigned values could produce
3527 an incorrect result when the signed value is converted to unsigned.
3528 This warning is also enabled by @option{-Wextra}; to get the other warnings
3529 of @option{-Wextra} without this warning, use @samp{-Wextra -Wno-sign-compare}.
3530
3531 @item -Wsign-conversion
3532 @opindex Wsign-conversion
3533 @opindex Wno-sign-conversion
3534 Warn for implicit conversions that may change the sign of an integer
3535 value, like assigning a signed integer expression to an unsigned
3536 integer variable. An explicit cast silences the warning. In C, this
3537 option is enabled also by @option{-Wconversion}.
3538
3539 @item -Waddress
3540 @opindex Waddress
3541 @opindex Wno-address
3542 Warn about suspicious uses of memory addresses. These include using
3543 the address of a function in a conditional expression, such as
3544 @code{void func(void); if (func)}, and comparisons against the memory
3545 address of a string literal, such as @code{if (x == "abc")}.  Such
3546 uses typically indicate a programmer error: the address of a function
3547 always evaluates to true, so their use in a conditional usually
3548 indicate that the programmer forgot the parentheses in a function
3549 call; and comparisons against string literals result in unspecified
3550 behavior and are not portable in C, so they usually indicate that the
3551 programmer intended to use @code{strcmp}.  This warning is enabled by
3552 @option{-Wall}.
3553
3554 @item -Wlogical-op
3555 @opindex Wlogical-op
3556 @opindex Wno-logical-op
3557 Warn about suspicious uses of logical operators in expressions.
3558 This includes using logical operators in contexts where a
3559 bit-wise operator is likely to be expected.
3560
3561 @item -Waggregate-return
3562 @opindex Waggregate-return
3563 Warn if any functions that return structures or unions are defined or
3564 called.  (In languages where you can return an array, this also elicits
3565 a warning.)
3566
3567 @item -Wno-attributes
3568 @opindex Wno-attributes
3569 @opindex Wattributes
3570 Do not warn if an unexpected @code{__attribute__} is used, such as
3571 unrecognized attributes, function attributes applied to variables,
3572 etc.  This will not stop errors for incorrect use of supported
3573 attributes.
3574
3575 @item -Wstrict-prototypes @r{(C only)}
3576 @opindex Wstrict-prototypes
3577 Warn if a function is declared or defined without specifying the
3578 argument types.  (An old-style function definition is permitted without
3579 a warning if preceded by a declaration which specifies the argument
3580 types.)
3581
3582 @item -Wold-style-declaration @r{(C only)}
3583 @opindex Wold-style-declaration
3584 Warn for obsolescent usages, according to the C Standard, in a
3585 declaration. For example, warn if storage-class specifiers like
3586 @code{static} are not the first things in a declaration.  This warning
3587 is also enabled by @option{-Wextra}.
3588
3589 @item -Wold-style-definition @r{(C only)}
3590 @opindex Wold-style-definition
3591 Warn if an old-style function definition is used.  A warning is given
3592 even if there is a previous prototype.
3593
3594 @item -Wmissing-parameter-type @r{(C only)}
3595 @opindex Wmissing-parameter-type
3596 A function parameter is declared without a type specifier in K&R-style
3597 functions:
3598
3599 @smallexample
3600 void foo(bar) @{ @}
3601 @end smallexample
3602
3603 This warning is also enabled by @option{-Wextra}.
3604
3605 @item -Wmissing-prototypes @r{(C only)}
3606 @opindex Wmissing-prototypes
3607 Warn if a global function is defined without a previous prototype
3608 declaration.  This warning is issued even if the definition itself
3609 provides a prototype.  The aim is to detect global functions that fail
3610 to be declared in header files.
3611
3612 @item -Wmissing-declarations @r{(C and C++ only)}
3613 @opindex Wmissing-declarations
3614 Warn if a global function is defined without a previous declaration.
3615 Do so even if the definition itself provides a prototype.
3616 Use this option to detect global functions that are not declared in
3617 header files.  In C++, no warnings are issued for function templates,
3618 or for inline functions, or for functions in anonymous namespaces.
3619
3620 @item -Wmissing-field-initializers
3621 @opindex Wmissing-field-initializers
3622 @opindex W
3623 @opindex Wextra
3624 Warn if a structure's initializer has some fields missing.  For
3625 example, the following code would cause such a warning, because
3626 @code{x.h} is implicitly zero:
3627
3628 @smallexample
3629 struct s @{ int f, g, h; @};
3630 struct s x = @{ 3, 4 @};
3631 @end smallexample
3632
3633 This option does not warn about designated initializers, so the following
3634 modification would not trigger a warning:
3635
3636 @smallexample
3637 struct s @{ int f, g, h; @};
3638 struct s x = @{ .f = 3, .g = 4 @};
3639 @end smallexample
3640
3641 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
3642 warnings without this one, use @samp{-Wextra -Wno-missing-field-initializers}.
3643
3644 @item -Wmissing-noreturn
3645 @opindex Wmissing-noreturn
3646 Warn about functions which might be candidates for attribute @code{noreturn}.
3647 Note these are only possible candidates, not absolute ones.  Care should
3648 be taken to manually verify functions actually do not ever return before
3649 adding the @code{noreturn} attribute, otherwise subtle code generation
3650 bugs could be introduced.  You will not get a warning for @code{main} in
3651 hosted C environments.
3652
3653 @item -Wmissing-format-attribute
3654 @opindex Wmissing-format-attribute
3655 @opindex Wformat
3656 Warn about function pointers which might be candidates for @code{format}
3657 attributes.  Note these are only possible candidates, not absolute ones.
3658 GCC will guess that function pointers with @code{format} attributes that
3659 are used in assignment, initialization, parameter passing or return
3660 statements should have a corresponding @code{format} attribute in the
3661 resulting type.  I.e.@: the left-hand side of the assignment or
3662 initialization, the type of the parameter variable, or the return type
3663 of the containing function respectively should also have a @code{format}
3664 attribute to avoid the warning.
3665
3666 GCC will also warn about function definitions which might be
3667 candidates for @code{format} attributes.  Again, these are only
3668 possible candidates.  GCC will guess that @code{format} attributes
3669 might be appropriate for any function that calls a function like
3670 @code{vprintf} or @code{vscanf}, but this might not always be the
3671 case, and some functions for which @code{format} attributes are
3672 appropriate may not be detected.
3673
3674 @item -Wno-multichar
3675 @opindex Wno-multichar
3676 @opindex Wmultichar
3677 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
3678 Usually they indicate a typo in the user's code, as they have
3679 implementation-defined values, and should not be used in portable code.
3680
3681 @item -Wnormalized=<none|id|nfc|nfkc>
3682 @opindex Wnormalized
3683 @cindex NFC
3684 @cindex NFKC
3685 @cindex character set, input normalization
3686 In ISO C and ISO C++, two identifiers are different if they are
3687 different sequences of characters.  However, sometimes when characters
3688 outside the basic ASCII character set are used, you can have two
3689 different character sequences that look the same.  To avoid confusion,
3690 the ISO 10646 standard sets out some @dfn{normalization rules} which
3691 when applied ensure that two sequences that look the same are turned into
3692 the same sequence.  GCC can warn you if you are using identifiers which
3693 have not been normalized; this option controls that warning.
3694
3695 There are four levels of warning that GCC supports.  The default is
3696 @option{-Wnormalized=nfc}, which warns about any identifier which is
3697 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
3698 recommended form for most uses.
3699
3700 Unfortunately, there are some characters which ISO C and ISO C++ allow
3701 in identifiers that when turned into NFC aren't allowable as
3702 identifiers.  That is, there's no way to use these symbols in portable
3703 ISO C or C++ and have all your identifiers in NFC.
3704 @option{-Wnormalized=id} suppresses the warning for these characters.
3705 It is hoped that future versions of the standards involved will correct
3706 this, which is why this option is not the default.
3707
3708 You can switch the warning off for all characters by writing
3709 @option{-Wnormalized=none}.  You would only want to do this if you
3710 were using some other normalization scheme (like ``D''), because
3711 otherwise you can easily create bugs that are literally impossible to see.
3712
3713 Some characters in ISO 10646 have distinct meanings but look identical
3714 in some fonts or display methodologies, especially once formatting has
3715 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
3716 LETTER N'', will display just like a regular @code{n} which has been
3717 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
3718 normalization scheme to convert all these into a standard form as
3719 well, and GCC will warn if your code is not in NFKC if you use
3720 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
3721 about every identifier that contains the letter O because it might be
3722 confused with the digit 0, and so is not the default, but may be
3723 useful as a local coding convention if the programming environment is
3724 unable to be fixed to display these characters distinctly.
3725
3726 @item -Wno-deprecated-declarations
3727 @opindex Wno-deprecated-declarations
3728 Do not warn about uses of functions (@pxref{Function Attributes}),
3729 variables (@pxref{Variable Attributes}), and types (@pxref{Type
3730 Attributes}) marked as deprecated by using the @code{deprecated}
3731 attribute.
3732
3733 @item -Wno-overflow
3734 @opindex Wno-overflow
3735 Do not warn about compile-time overflow in constant expressions.
3736
3737 @item -Woverride-init
3738 @opindex Woverride-init
3739 @opindex W
3740 @opindex Wextra
3741 Warn if an initialized field without side effects is overridden when
3742 using designated initializers (@pxref{Designated Inits, , Designated
3743 Initializers}).
3744
3745 This warning is included in @option{-Wextra}.  To get other
3746 @option{-Wextra} warnings without this one, use @samp{-Wextra
3747 -Wno-override-init}.
3748
3749 @item -Wpacked
3750 @opindex Wpacked
3751 Warn if a structure is given the packed attribute, but the packed
3752 attribute has no effect on the layout or size of the structure.
3753 Such structures may be mis-aligned for little benefit.  For
3754 instance, in this code, the variable @code{f.x} in @code{struct bar}
3755 will be misaligned even though @code{struct bar} does not itself
3756 have the packed attribute:
3757
3758 @smallexample
3759 @group
3760 struct foo @{
3761   int x;
3762   char a, b, c, d;
3763 @} __attribute__((packed));
3764 struct bar @{
3765   char z;
3766   struct foo f;
3767 @};
3768 @end group
3769 @end smallexample
3770
3771 @item -Wpadded
3772 @opindex Wpadded
3773 Warn if padding is included in a structure, either to align an element
3774 of the structure or to align the whole structure.  Sometimes when this
3775 happens it is possible to rearrange the fields of the structure to
3776 reduce the padding and so make the structure smaller.
3777
3778 @item -Wredundant-decls
3779 @opindex Wredundant-decls
3780 Warn if anything is declared more than once in the same scope, even in
3781 cases where multiple declaration is valid and changes nothing.
3782
3783 @item -Wnested-externs @r{(C only)}
3784 @opindex Wnested-externs
3785 Warn if an @code{extern} declaration is encountered within a function.
3786
3787 @item -Wunreachable-code
3788 @opindex Wunreachable-code
3789 Warn if the compiler detects that code will never be executed.
3790
3791 This option is intended to warn when the compiler detects that at
3792 least a whole line of source code will never be executed, because
3793 some condition is never satisfied or because it is after a
3794 procedure that never returns.
3795
3796 It is possible for this option to produce a warning even though there
3797 are circumstances under which part of the affected line can be executed,
3798 so care should be taken when removing apparently-unreachable code.
3799
3800 For instance, when a function is inlined, a warning may mean that the
3801 line is unreachable in only one inlined copy of the function.
3802
3803 This option is not made part of @option{-Wall} because in a debugging
3804 version of a program there is often substantial code which checks
3805 correct functioning of the program and is, hopefully, unreachable
3806 because the program does work.  Another common use of unreachable
3807 code is to provide behavior which is selectable at compile-time.
3808
3809 @item -Winline
3810 @opindex Winline
3811 Warn if a function can not be inlined and it was declared as inline.
3812 Even with this option, the compiler will not warn about failures to
3813 inline functions declared in system headers.
3814
3815 The compiler uses a variety of heuristics to determine whether or not
3816 to inline a function.  For example, the compiler takes into account
3817 the size of the function being inlined and the amount of inlining
3818 that has already been done in the current function.  Therefore,
3819 seemingly insignificant changes in the source program can cause the
3820 warnings produced by @option{-Winline} to appear or disappear.
3821
3822 @item -Wno-invalid-offsetof @r{(C++ only)}
3823 @opindex Wno-invalid-offsetof
3824 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
3825 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
3826 to a non-POD type is undefined.  In existing C++ implementations,
3827 however, @samp{offsetof} typically gives meaningful results even when
3828 applied to certain kinds of non-POD types. (Such as a simple
3829 @samp{struct} that fails to be a POD type only by virtue of having a
3830 constructor.)  This flag is for users who are aware that they are
3831 writing nonportable code and who have deliberately chosen to ignore the
3832 warning about it.
3833
3834 The restrictions on @samp{offsetof} may be relaxed in a future version
3835 of the C++ standard.
3836
3837 @item -Wno-int-to-pointer-cast @r{(C only)}
3838 @opindex Wno-int-to-pointer-cast
3839 Suppress warnings from casts to pointer type of an integer of a
3840 different size.
3841
3842 @item -Wno-pointer-to-int-cast @r{(C only)}
3843 @opindex Wno-pointer-to-int-cast
3844 Suppress warnings from casts from a pointer to an integer type of a
3845 different size.
3846
3847 @item -Winvalid-pch
3848 @opindex Winvalid-pch
3849 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
3850 the search path but can't be used.
3851
3852 @item -Wlong-long
3853 @opindex Wlong-long
3854 @opindex Wno-long-long
3855 Warn if @samp{long long} type is used.  This is default.  To inhibit
3856 the warning messages, use @option{-Wno-long-long}.  Flags
3857 @option{-Wlong-long} and @option{-Wno-long-long} are taken into account
3858 only when @option{-pedantic} flag is used.
3859
3860 @item -Wvariadic-macros
3861 @opindex Wvariadic-macros
3862 @opindex Wno-variadic-macros
3863 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
3864 alternate syntax when in pedantic ISO C99 mode.  This is default.
3865 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
3866
3867 @item -Wvla
3868 @opindex Wvla
3869 @opindex Wno-vla
3870 Warn if variable length array is used in the code.
3871 @option{-Wno-vla} will prevent the @option{-pedantic} warning of
3872 the variable length array.
3873
3874 @item -Wvolatile-register-var
3875 @opindex Wvolatile-register-var
3876 @opindex Wno-volatile-register-var
3877 Warn if a register variable is declared volatile.  The volatile
3878 modifier does not inhibit all optimizations that may eliminate reads
3879 and/or writes to register variables.
3880
3881 @item -Wdisabled-optimization
3882 @opindex Wdisabled-optimization
3883 Warn if a requested optimization pass is disabled.  This warning does
3884 not generally indicate that there is anything wrong with your code; it
3885 merely indicates that GCC's optimizers were unable to handle the code
3886 effectively.  Often, the problem is that your code is too big or too
3887 complex; GCC will refuse to optimize programs when the optimization
3888 itself is likely to take inordinate amounts of time.
3889
3890 @item -Wpointer-sign
3891 @opindex Wpointer-sign
3892 @opindex Wno-pointer-sign
3893 Warn for pointer argument passing or assignment with different signedness.
3894 This option is only supported for C and Objective-C@.  It is implied by
3895 @option{-Wall} and by @option{-pedantic}, which can be disabled with
3896 @option{-Wno-pointer-sign}.
3897
3898 @item -Werror
3899 @opindex Werror
3900 Make all warnings into errors.
3901
3902 @item -Werror=
3903 @opindex Werror=
3904 Make the specified warning into an errors.  The specifier for a
3905 warning is appended, for example @option{-Werror=switch} turns the
3906 warnings controlled by @option{-Wswitch} into errors.  This switch
3907 takes a negative form, to be used to negate @option{-Werror} for
3908 specific warnings, for example @option{-Wno-error=switch} makes
3909 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
3910 is in effect.  You can use the @option{-fdiagnostics-show-option}
3911 option to have each controllable warning amended with the option which
3912 controls it, to determine what to use with this option.
3913
3914 Note that specifying @option{-Werror=}@var{foo} automatically implies
3915 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
3916 imply anything.
3917
3918 @item -Wstack-protector
3919 @opindex Wstack-protector
3920 This option is only active when @option{-fstack-protector} is active.  It
3921 warns about functions that will not be protected against stack smashing.
3922
3923 @item -Woverlength-strings
3924 @opindex Woverlength-strings
3925 Warn about string constants which are longer than the ``minimum
3926 maximum'' length specified in the C standard.  Modern compilers
3927 generally allow string constants which are much longer than the
3928 standard's minimum limit, but very portable programs should avoid
3929 using longer strings.
3930
3931 The limit applies @emph{after} string constant concatenation, and does
3932 not count the trailing NUL@.  In C89, the limit was 509 characters; in
3933 C99, it was raised to 4095.  C++98 does not specify a normative
3934 minimum maximum, so we do not diagnose overlength strings in C++@.
3935
3936 This option is implied by @option{-pedantic}, and can be disabled with
3937 @option{-Wno-overlength-strings}.
3938 @end table
3939
3940 @node Debugging Options
3941 @section Options for Debugging Your Program or GCC
3942 @cindex options, debugging
3943 @cindex debugging information options
3944
3945 GCC has various special options that are used for debugging
3946 either your program or GCC:
3947
3948 @table @gcctabopt
3949 @item -g
3950 @opindex g
3951 Produce debugging information in the operating system's native format
3952 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
3953 information.
3954
3955 On most systems that use stabs format, @option{-g} enables use of extra
3956 debugging information that only GDB can use; this extra information
3957 makes debugging work better in GDB but will probably make other debuggers
3958 crash or
3959 refuse to read the program.  If you want to control for certain whether
3960 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
3961 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
3962
3963 GCC allows you to use @option{-g} with
3964 @option{-O}.  The shortcuts taken by optimized code may occasionally
3965 produce surprising results: some variables you declared may not exist
3966 at all; flow of control may briefly move where you did not expect it;
3967 some statements may not be executed because they compute constant
3968 results or their values were already at hand; some statements may
3969 execute in different places because they were moved out of loops.
3970
3971 Nevertheless it proves possible to debug optimized output.  This makes
3972 it reasonable to use the optimizer for programs that might have bugs.
3973
3974 The following options are useful when GCC is generated with the
3975 capability for more than one debugging format.
3976
3977 @item -ggdb
3978 @opindex ggdb
3979 Produce debugging information for use by GDB@.  This means to use the
3980 most expressive format available (DWARF 2, stabs, or the native format
3981 if neither of those are supported), including GDB extensions if at all
3982 possible.
3983
3984 @item -gstabs
3985 @opindex gstabs
3986 Produce debugging information in stabs format (if that is supported),
3987 without GDB extensions.  This is the format used by DBX on most BSD
3988 systems.  On MIPS, Alpha and System V Release 4 systems this option
3989 produces stabs debugging output which is not understood by DBX or SDB@.
3990 On System V Release 4 systems this option requires the GNU assembler.
3991
3992 @item -feliminate-unused-debug-symbols
3993 @opindex feliminate-unused-debug-symbols
3994 Produce debugging information in stabs format (if that is supported),
3995 for only symbols that are actually used.
3996
3997 @item -femit-class-debug-always
3998 Instead of emitting debugging information for a C++ class in only one
3999 object file, emit it in all object files using the class.  This option
4000 should be used only with debuggers that are unable to handle the way GCC
4001 normally emits debugging information for classes because using this
4002 option will increase the size of debugging information by as much as a
4003 factor of two.
4004
4005 @item -gstabs+
4006 @opindex gstabs+
4007 Produce debugging information in stabs format (if that is supported),
4008 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4009 use of these extensions is likely to make other debuggers crash or
4010 refuse to read the program.
4011
4012 @item -gcoff
4013 @opindex gcoff
4014 Produce debugging information in COFF format (if that is supported).
4015 This is the format used by SDB on most System V systems prior to
4016 System V Release 4.
4017
4018 @item -gxcoff
4019 @opindex gxcoff
4020 Produce debugging information in XCOFF format (if that is supported).
4021 This is the format used by the DBX debugger on IBM RS/6000 systems.
4022
4023 @item -gxcoff+
4024 @opindex gxcoff+
4025 Produce debugging information in XCOFF format (if that is supported),
4026 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4027 use of these extensions is likely to make other debuggers crash or
4028 refuse to read the program, and may cause assemblers other than the GNU
4029 assembler (GAS) to fail with an error.
4030
4031 @item -gdwarf-2
4032 @opindex gdwarf-2
4033 Produce debugging information in DWARF version 2 format (if that is
4034 supported).  This is the format used by DBX on IRIX 6.  With this
4035 option, GCC uses features of DWARF version 3 when they are useful;
4036 version 3 is upward compatible with version 2, but may still cause
4037 problems for older debuggers.
4038
4039 @item -gvms
4040 @opindex gvms
4041 Produce debugging information in VMS debug format (if that is
4042 supported).  This is the format used by DEBUG on VMS systems.
4043
4044 @item -g@var{level}
4045 @itemx -ggdb@var{level}
4046 @itemx -gstabs@var{level}
4047 @itemx -gcoff@var{level}
4048 @itemx -gxcoff@var{level}
4049 @itemx -gvms@var{level}
4050 Request debugging information and also use @var{level} to specify how
4051 much information.  The default level is 2.
4052
4053 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
4054 @option{-g}.
4055
4056 Level 1 produces minimal information, enough for making backtraces in
4057 parts of the program that you don't plan to debug.  This includes
4058 descriptions of functions and external variables, but no information
4059 about local variables and no line numbers.
4060
4061 Level 3 includes extra information, such as all the macro definitions
4062 present in the program.  Some debuggers support macro expansion when
4063 you use @option{-g3}.
4064
4065 @option{-gdwarf-2} does not accept a concatenated debug level, because
4066 GCC used to support an option @option{-gdwarf} that meant to generate
4067 debug information in version 1 of the DWARF format (which is very
4068 different from version 2), and it would have been too confusing.  That
4069 debug format is long obsolete, but the option cannot be changed now.
4070 Instead use an additional @option{-g@var{level}} option to change the
4071 debug level for DWARF2.
4072
4073 @item -feliminate-dwarf2-dups
4074 @opindex feliminate-dwarf2-dups
4075 Compress DWARF2 debugging information by eliminating duplicated
4076 information about each symbol.  This option only makes sense when
4077 generating DWARF2 debugging information with @option{-gdwarf-2}.
4078
4079 @item -femit-struct-debug-baseonly
4080 Emit debug information for struct-like types
4081 only when the base name of the compilation source file
4082 matches the base name of file in which the struct was defined.
4083
4084 This option substantially reduces the size of debugging information,
4085 but at significant potential loss in type information to the debugger.
4086 See @option{-femit-struct-debug-reduced} for a less aggressive option.
4087 See @option{-femit-struct-debug-detailed} for more detailed control.
4088
4089 This option works only with DWARF 2.
4090
4091 @item -femit-struct-debug-reduced
4092 Emit debug information for struct-like types
4093 only when the base name of the compilation source file
4094 matches the base name of file in which the type was defined,
4095 unless the struct is a template or defined in a system header.
4096
4097 This option significantly reduces the size of debugging information,
4098 with some potential loss in type information to the debugger.
4099 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
4100 See @option{-femit-struct-debug-detailed} for more detailed control.
4101
4102 This option works only with DWARF 2.
4103
4104 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
4105 Specify the struct-like types
4106 for which the compiler will generate debug information.
4107 The intent is to reduce duplicate struct debug information
4108 between different object files within the same program.
4109
4110 This option is a detailed version of
4111 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
4112 which will serve for most needs.
4113
4114 A specification has the syntax
4115 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
4116
4117 The optional first word limits the specification to
4118 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
4119 A struct type is used directly when it is the type of a variable, member.
4120 Indirect uses arise through pointers to structs.
4121 That is, when use of an incomplete struct would be legal, the use is indirect.
4122 An example is
4123 @samp{struct one direct; struct two * indirect;}.
4124
4125 The optional second word limits the specification to
4126 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
4127 Generic structs are a bit complicated to explain.
4128 For C++, these are non-explicit specializations of template classes,
4129 or non-template classes within the above.
4130 Other programming languages have generics,
4131 but @samp{-femit-struct-debug-detailed} does not yet implement them.
4132
4133 The third word specifies the source files for those
4134 structs for which the compiler will emit debug information.
4135 The values @samp{none} and @samp{any} have the normal meaning.
4136 The value @samp{base} means that
4137 the base of name of the file in which the type declaration appears
4138 must match the base of the name of the main compilation file.
4139 In practice, this means that
4140 types declared in @file{foo.c} and @file{foo.h} will have debug information,
4141 but types declared in other header will not.
4142 The value @samp{sys} means those types satisfying @samp{base}
4143 or declared in system or compiler headers.
4144
4145 You may need to experiment to determine the best settings for your application.
4146
4147 The default is @samp{-femit-struct-debug-detailed=all}.
4148
4149 This option works only with DWARF 2.
4150
4151 @item -fdebug-prefix-map=@var{old}=@var{new}
4152 @opindex fdebug-prefix-map
4153 When compiling files in directory @file{@var{old}}, record debugging
4154 information describing them as in @file{@var{new}} instead.
4155
4156 @cindex @command{prof}
4157 @item -p
4158 @opindex p
4159 Generate extra code to write profile information suitable for the
4160 analysis program @command{prof}.  You must use this option when compiling
4161 the source files you want data about, and you must also use it when
4162 linking.
4163
4164 @cindex @command{gprof}
4165 @item -pg
4166 @opindex pg
4167 Generate extra code to write profile information suitable for the
4168 analysis program @command{gprof}.  You must use this option when compiling
4169 the source files you want data about, and you must also use it when
4170 linking.
4171
4172 @item -Q
4173 @opindex Q
4174 Makes the compiler print out each function name as it is compiled, and
4175 print some statistics about each pass when it finishes.
4176
4177 @item -ftime-report
4178 @opindex ftime-report
4179 Makes the compiler print some statistics about the time consumed by each
4180 pass when it finishes.
4181
4182 @item -fmem-report
4183 @opindex fmem-report
4184 Makes the compiler print some statistics about permanent memory
4185 allocation when it finishes.
4186
4187 @item -fpre-ipa-mem-report
4188 @opindex fpre-ipa-mem-report
4189 @item -fpost-ipa-mem-report
4190 @opindex fpost-ipa-mem-report
4191 Makes the compiler print some statistics about permanent memory
4192 allocation before or after interprocedural optimization.
4193
4194 @item -fprofile-arcs
4195 @opindex fprofile-arcs
4196 Add code so that program flow @dfn{arcs} are instrumented.  During
4197 execution the program records how many times each branch and call is
4198 executed and how many times it is taken or returns.  When the compiled
4199 program exits it saves this data to a file called
4200 @file{@var{auxname}.gcda} for each source file.  The data may be used for
4201 profile-directed optimizations (@option{-fbranch-probabilities}), or for
4202 test coverage analysis (@option{-ftest-coverage}).  Each object file's
4203 @var{auxname} is generated from the name of the output file, if
4204 explicitly specified and it is not the final executable, otherwise it is
4205 the basename of the source file.  In both cases any suffix is removed
4206 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
4207 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
4208 @xref{Cross-profiling}.
4209
4210 @cindex @command{gcov}
4211 @item --coverage
4212 @opindex coverage
4213
4214 This option is used to compile and link code instrumented for coverage
4215 analysis.  The option is a synonym for @option{-fprofile-arcs}
4216 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
4217 linking).  See the documentation for those options for more details.
4218
4219 @itemize
4220
4221 @item
4222 Compile the source files with @option{-fprofile-arcs} plus optimization
4223 and code generation options.  For test coverage analysis, use the
4224 additional @option{-ftest-coverage} option.  You do not need to profile
4225 every source file in a program.
4226
4227 @item
4228 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
4229 (the latter implies the former).
4230
4231 @item
4232 Run the program on a representative workload to generate the arc profile
4233 information.  This may be repeated any number of times.  You can run
4234 concurrent instances of your program, and provided that the file system
4235 supports locking, the data files will be correctly updated.  Also
4236 @code{fork} calls are detected and correctly handled (double counting
4237 will not happen).
4238
4239 @item
4240 For profile-directed optimizations, compile the source files again with
4241 the same optimization and code generation options plus
4242 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
4243 Control Optimization}).
4244
4245 @item
4246 For test coverage analysis, use @command{gcov} to produce human readable
4247 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
4248 @command{gcov} documentation for further information.
4249
4250 @end itemize
4251
4252 With @option{-fprofile-arcs}, for each function of your program GCC
4253 creates a program flow graph, then finds a spanning tree for the graph.
4254 Only arcs that are not on the spanning tree have to be instrumented: the
4255 compiler adds code to count the number of times that these arcs are
4256 executed.  When an arc is the only exit or only entrance to a block, the
4257 instrumentation code can be added to the block; otherwise, a new basic
4258 block must be created to hold the instrumentation code.
4259
4260 @need 2000
4261 @item -ftest-coverage
4262 @opindex ftest-coverage
4263 Produce a notes file that the @command{gcov} code-coverage utility
4264 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
4265 show program coverage.  Each source file's note file is called
4266 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
4267 above for a description of @var{auxname} and instructions on how to
4268 generate test coverage data.  Coverage data will match the source files
4269 more closely, if you do not optimize.
4270
4271 @item -fdbg-cnt-list
4272 @opindex fdbg-cnt-list
4273 Print the name and the counter upperbound for all debug counters.
4274
4275 @item -fdbg-cnt=@var{counter-value-list}
4276 @opindex fdbg-cnt
4277 Set the internal debug counter upperbound. @var{counter-value-list} 
4278 is a comma-separated list of @var{name}:@var{value} pairs
4279 which sets the upperbound of each debug counter @var{name} to @var{value}.
4280 All debug counters have the initial upperbound of @var{UINT_MAX},
4281 thus dbg_cnt() returns true always unless the upperbound is set by this option.
4282 e.g. With -fdbg-cnt=dce:10,tail_call:0
4283 dbg_cnt(dce) will return true only for first 10 invocations
4284 and dbg_cnt(tail_call) will return false always.
4285
4286 @item -d@var{letters}
4287 @item -fdump-rtl-@var{pass}
4288 @opindex d
4289 Says to make debugging dumps during compilation at times specified by
4290 @var{letters}.    This is used for debugging the RTL-based passes of the
4291 compiler.  The file names for most of the dumps are made by appending a
4292 pass number and a word to the @var{dumpname}.  @var{dumpname} is generated
4293 from the name of the output file, if explicitly specified and it is not
4294 an executable, otherwise it is the basename of the source file. These
4295 switches may have different effects when @option{-E} is used for
4296 preprocessing.
4297
4298 Most debug dumps can be enabled either passing a letter to the @option{-d}
4299 option, or with a long @option{-fdump-rtl} switch; here are the possible
4300 letters for use in @var{letters} and @var{pass}, and their meanings:
4301
4302 @table @gcctabopt
4303 @item -dA
4304 @opindex dA
4305 Annotate the assembler output with miscellaneous debugging information.
4306
4307 @item -dB
4308 @itemx -fdump-rtl-bbro
4309 @opindex dB
4310 @opindex fdump-rtl-bbro
4311 Dump after block reordering, to @file{@var{file}.148r.bbro}.
4312
4313 @item -dc
4314 @itemx -fdump-rtl-combine
4315 @opindex dc
4316 @opindex fdump-rtl-combine
4317 Dump after the RTL instruction combination pass, to the file
4318 @file{@var{file}.129r.combine}.
4319
4320 @item -dC
4321 @itemx -fdump-rtl-ce1
4322 @itemx -fdump-rtl-ce2
4323 @opindex dC
4324 @opindex fdump-rtl-ce1
4325 @opindex fdump-rtl-ce2
4326 @option{-dC} and @option{-fdump-rtl-ce1} enable dumping after the
4327 first if conversion, to the file @file{@var{file}.117r.ce1}.  @option{-dC}
4328 and @option{-fdump-rtl-ce2} enable dumping after the second if
4329 conversion, to the file @file{@var{file}.130r.ce2}.
4330
4331 @item -dd
4332 @itemx -fdump-rtl-btl
4333 @itemx -fdump-rtl-dbr
4334 @opindex dd
4335 @opindex fdump-rtl-btl
4336 @opindex fdump-rtl-dbr
4337 @option{-dd} and @option{-fdump-rtl-btl} enable dumping after branch
4338 target load optimization, to @file{@var{file}.31.btl}.  @option{-dd}
4339 and @option{-fdump-rtl-dbr} enable dumping after delayed branch
4340 scheduling, to @file{@var{file}.36.dbr}.
4341
4342 @item -dD
4343 @opindex dD
4344 Dump all macro definitions, at the end of preprocessing, in addition to
4345 normal output.
4346
4347 @item -dE
4348 @itemx -fdump-rtl-ce3
4349 @opindex dE
4350 @opindex fdump-rtl-ce3
4351 Dump after the third if conversion, to @file{@var{file}.146r.ce3}.
4352
4353 @item -df
4354 @itemx -fdump-rtl-cfg
4355 @itemx -fdump-rtl-life
4356 @opindex df
4357 @opindex fdump-rtl-cfg
4358 @opindex fdump-rtl-life
4359 @option{-df} and @option{-fdump-rtl-cfg} enable dumping after control
4360 and data flow analysis, to @file{@var{file}.116r.cfg}.  @option{-df}
4361 and @option{-fdump-rtl-cfg} enable dumping dump after life analysis,
4362 to @file{@var{file}.128r.life1} and @file{@var{file}.135r.life2}.
4363
4364 @item -dg
4365 @itemx -fdump-rtl-greg
4366 @opindex dg
4367 @opindex fdump-rtl-greg
4368 Dump after global register allocation, to @file{@var{file}.139r.greg}.
4369
4370 @item -dG
4371 @itemx -fdump-rtl-gcse
4372 @itemx -fdump-rtl-bypass
4373 @opindex dG
4374 @opindex fdump-rtl-gcse
4375 @opindex fdump-rtl-bypass
4376 @option{-dG} and @option{-fdump-rtl-gcse} enable dumping after GCSE, to
4377 @file{@var{file}.114r.gcse}.  @option{-dG} and @option{-fdump-rtl-bypass}
4378 enable dumping after jump bypassing and control flow optimizations, to
4379 @file{@var{file}.115r.bypass}.
4380
4381 @item -dh
4382 @itemx -fdump-rtl-eh
4383 @opindex dh
4384 @opindex fdump-rtl-eh
4385 Dump after finalization of EH handling code, to @file{@var{file}.02.eh}.
4386
4387 @item -di
4388 @itemx -fdump-rtl-sibling
4389 @opindex di
4390 @opindex fdump-rtl-sibling
4391 Dump after sibling call optimizations, to @file{@var{file}.106r.sibling}.
4392
4393 @item -dj
4394 @itemx -fdump-rtl-jump
4395 @opindex dj
4396 @opindex fdump-rtl-jump
4397 Dump after the first jump optimization, to @file{@var{file}.112r.jump}.
4398
4399 @item -dk
4400 @itemx -fdump-rtl-stack
4401 @opindex dk
4402 @opindex fdump-rtl-stack
4403 Dump after conversion from GCC's "flat register file" registers to the
4404 x87's stack-like registers, to @file{@var{file}.152r.stack}.
4405
4406 @item -dl
4407 @itemx -fdump-rtl-lreg
4408 @opindex dl
4409 @opindex fdump-rtl-lreg
4410 Dump after local register allocation, to @file{@var{file}.138r.lreg}.
4411
4412 @item -dL
4413 @itemx -fdump-rtl-loop2
4414 @opindex dL
4415 @opindex fdump-rtl-loop2
4416 @option{-dL} and @option{-fdump-rtl-loop2} enable dumping after the
4417 loop optimization pass, to @file{@var{file}.119r.loop2},
4418 @file{@var{file}.120r.loop2_init},
4419 @file{@var{file}.121r.loop2_invariant}, and
4420 @file{@var{file}.125r.loop2_done}.
4421
4422 @item -dm
4423 @itemx -fdump-rtl-sms
4424 @opindex dm
4425 @opindex fdump-rtl-sms
4426 Dump after modulo scheduling, to @file{@var{file}.136r.sms}.
4427
4428 @item -dM
4429 @itemx -fdump-rtl-mach
4430 @opindex dM
4431 @opindex fdump-rtl-mach
4432 Dump after performing the machine dependent reorganization pass, to
4433 @file{@var{file}.155r.mach} if that pass exists.
4434
4435 @item -dn
4436 @itemx -fdump-rtl-rnreg
4437 @opindex dn
4438 @opindex fdump-rtl-rnreg
4439 Dump after register renumbering, to @file{@var{file}.147r.rnreg}.
4440
4441 @item -dN
4442 @itemx -fdump-rtl-regmove
4443 @opindex dN
4444 @opindex fdump-rtl-regmove
4445 Dump after the register move pass, to @file{@var{file}.132r.regmove}.
4446
4447 @item -do
4448 @itemx -fdump-rtl-postreload
4449 @opindex do
4450 @opindex fdump-rtl-postreload
4451 Dump after post-reload optimizations, to @file{@var{file}.24.postreload}.
4452
4453 @item -dr
4454 @itemx -fdump-rtl-expand
4455 @opindex dr
4456 @opindex fdump-rtl-expand
4457 Dump after RTL generation, to @file{@var{file}.104r.expand}.
4458
4459 @item -dR
4460 @itemx -fdump-rtl-sched2
4461 @opindex dR
4462 @opindex fdump-rtl-sched2
4463 Dump after the second scheduling pass, to @file{@var{file}.149r.sched2}.
4464
4465 @item -ds
4466 @itemx -fdump-rtl-cse
4467 @opindex ds
4468 @opindex fdump-rtl-cse
4469 Dump after CSE (including the jump optimization that sometimes follows
4470 CSE), to @file{@var{file}.113r.cse}.
4471
4472 @item -dS
4473 @itemx -fdump-rtl-sched1
4474 @opindex dS
4475 @opindex fdump-rtl-sched1
4476 Dump after the first scheduling pass, to @file{@var{file}.136r.sched1}.
4477
4478 @item -dt
4479 @itemx -fdump-rtl-cse2
4480 @opindex dt
4481 @opindex fdump-rtl-cse2
4482 Dump after the second CSE pass (including the jump optimization that
4483 sometimes follows CSE), to @file{@var{file}.127r.cse2}.
4484
4485 @item -dT
4486 @itemx -fdump-rtl-tracer
4487 @opindex dT
4488 @opindex fdump-rtl-tracer
4489 Dump after running tracer, to @file{@var{file}.118r.tracer}.
4490
4491 @item -dV
4492 @itemx -fdump-rtl-vpt
4493 @itemx -fdump-rtl-vartrack
4494 @opindex dV
4495 @opindex fdump-rtl-vpt
4496 @opindex fdump-rtl-vartrack
4497 @option{-dV} and @option{-fdump-rtl-vpt} enable dumping after the value
4498 profile transformations, to @file{@var{file}.10.vpt}.  @option{-dV}
4499 and @option{-fdump-rtl-vartrack} enable dumping after variable tracking,
4500 to @file{@var{file}.154r.vartrack}.
4501
4502 @item -dw
4503 @itemx -fdump-rtl-flow2
4504 @opindex dw
4505 @opindex fdump-rtl-flow2
4506 Dump after the second flow pass, to @file{@var{file}.142r.flow2}.
4507
4508 @item -dz
4509 @itemx -fdump-rtl-peephole2
4510 @opindex dz
4511 @opindex fdump-rtl-peephole2
4512 Dump after the peephole pass, to @file{@var{file}.145r.peephole2}.
4513
4514 @item -dZ
4515 @itemx -fdump-rtl-web
4516 @opindex dZ
4517 @opindex fdump-rtl-web
4518 Dump after live range splitting, to @file{@var{file}.126r.web}.
4519
4520 @item -da
4521 @itemx -fdump-rtl-all
4522 @opindex da
4523 @opindex fdump-rtl-all
4524 Produce all the dumps listed above.
4525
4526 @item -dH
4527 @opindex dH
4528 Produce a core dump whenever an error occurs.
4529
4530 @item -dm
4531 @opindex dm
4532 Print statistics on memory usage, at the end of the run, to
4533 standard error.
4534
4535 @item -dp
4536 @opindex dp
4537 Annotate the assembler output with a comment indicating which
4538 pattern and alternative was used.  The length of each instruction is
4539 also printed.
4540
4541 @item -dP
4542 @opindex dP
4543 Dump the RTL in the assembler output as a comment before each instruction.
4544 Also turns on @option{-dp} annotation.
4545
4546 @item -dv
4547 @opindex dv
4548 For each of the other indicated dump files (either with @option{-d} or
4549 @option{-fdump-rtl-@var{pass}}), dump a representation of the control flow
4550 graph suitable for viewing with VCG to @file{@var{file}.@var{pass}.vcg}.
4551
4552 @item -dx
4553 @opindex dx
4554 Just generate RTL for a function instead of compiling it.  Usually used
4555 with @samp{r} (@option{-fdump-rtl-expand}).
4556
4557 @item -dy
4558 @opindex dy
4559 Dump debugging information during parsing, to standard error.
4560 @end table
4561
4562 @item -fdump-noaddr
4563 @opindex fdump-noaddr
4564 When doing debugging dumps (see @option{-d} option above), suppress
4565 address output.  This makes it more feasible to use diff on debugging
4566 dumps for compiler invocations with different compiler binaries and/or
4567 different text / bss / data / heap / stack / dso start locations.
4568
4569 @item -fdump-unnumbered
4570 @opindex fdump-unnumbered
4571 When doing debugging dumps (see @option{-d} option above), suppress instruction
4572 numbers and address output.  This makes it more feasible to
4573 use diff on debugging dumps for compiler invocations with different
4574 options, in particular with and without @option{-g}.
4575
4576 @item -fdump-translation-unit @r{(C++ only)}
4577 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
4578 @opindex fdump-translation-unit
4579 Dump a representation of the tree structure for the entire translation
4580 unit to a file.  The file name is made by appending @file{.tu} to the
4581 source file name.  If the @samp{-@var{options}} form is used, @var{options}
4582 controls the details of the dump as described for the
4583 @option{-fdump-tree} options.
4584
4585 @item -fdump-class-hierarchy @r{(C++ only)}
4586 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
4587 @opindex fdump-class-hierarchy
4588 Dump a representation of each class's hierarchy and virtual function
4589 table layout to a file.  The file name is made by appending @file{.class}
4590 to the source file name.  If the @samp{-@var{options}} form is used,
4591 @var{options} controls the details of the dump as described for the
4592 @option{-fdump-tree} options.
4593
4594 @item -fdump-ipa-@var{switch}
4595 @opindex fdump-ipa
4596 Control the dumping at various stages of inter-procedural analysis
4597 language tree to a file.  The file name is generated by appending a switch
4598 specific suffix to the source file name.  The following dumps are possible:
4599
4600 @table @samp
4601 @item all
4602 Enables all inter-procedural analysis dumps; currently the only produced
4603 dump is the @samp{cgraph} dump.
4604
4605 @item cgraph
4606 Dumps information about call-graph optimization, unused function removal,
4607 and inlining decisions.
4608 @end table
4609
4610 @item -fdump-tree-@var{switch}
4611 @itemx -fdump-tree-@var{switch}-@var{options}
4612 @opindex fdump-tree
4613 Control the dumping at various stages of processing the intermediate
4614 language tree to a file.  The file name is generated by appending a switch
4615 specific suffix to the source file name.  If the @samp{-@var{options}}
4616 form is used, @var{options} is a list of @samp{-} separated options that
4617 control the details of the dump.  Not all options are applicable to all
4618 dumps, those which are not meaningful will be ignored.  The following
4619 options are available
4620
4621 @table @samp
4622 @item address
4623 Print the address of each node.  Usually this is not meaningful as it
4624 changes according to the environment and source file.  Its primary use
4625 is for tying up a dump file with a debug environment.
4626 @item slim
4627 Inhibit dumping of members of a scope or body of a function merely
4628 because that scope has been reached.  Only dump such items when they
4629 are directly reachable by some other path.  When dumping pretty-printed
4630 trees, this option inhibits dumping the bodies of control structures.
4631 @item raw
4632 Print a raw representation of the tree.  By default, trees are
4633 pretty-printed into a C-like representation.
4634 @item details
4635 Enable more detailed dumps (not honored by every dump option).
4636 @item stats
4637 Enable dumping various statistics about the pass (not honored by every dump
4638 option).
4639 @item blocks
4640 Enable showing basic block boundaries (disabled in raw dumps).
4641 @item vops
4642 Enable showing virtual operands for every statement.
4643 @item lineno
4644 Enable showing line numbers for statements.
4645 @item uid
4646 Enable showing the unique ID (@code{DECL_UID}) for each variable.
4647 @item all
4648 Turn on all options, except @option{raw}, @option{slim} and @option{lineno}.
4649 @end table
4650
4651 The following tree dumps are possible:
4652 @table @samp
4653
4654 @item original
4655 Dump before any tree based optimization, to @file{@var{file}.original}.
4656
4657 @item optimized
4658 Dump after all tree based optimization, to @file{@var{file}.optimized}.
4659
4660 @item inlined
4661 Dump after function inlining, to @file{@var{file}.inlined}.
4662
4663 @item gimple
4664 @opindex fdump-tree-gimple
4665 Dump each function before and after the gimplification pass to a file.  The
4666 file name is made by appending @file{.gimple} to the source file name.
4667
4668 @item cfg
4669 @opindex fdump-tree-cfg
4670 Dump the control flow graph of each function to a file.  The file name is
4671 made by appending @file{.cfg} to the source file name.
4672
4673 @item vcg
4674 @opindex fdump-tree-vcg
4675 Dump the control flow graph of each function to a file in VCG format.  The
4676 file name is made by appending @file{.vcg} to the source file name.  Note
4677 that if the file contains more than one function, the generated file cannot
4678 be used directly by VCG@.  You will need to cut and paste each function's
4679 graph into its own separate file first.
4680
4681 @item ch
4682 @opindex fdump-tree-ch
4683 Dump each function after copying loop headers.  The file name is made by
4684 appending @file{.ch} to the source file name.
4685
4686 @item ssa
4687 @opindex fdump-tree-ssa
4688 Dump SSA related information to a file.  The file name is made by appending
4689 @file{.ssa} to the source file name.
4690
4691 @item salias
4692 @opindex fdump-tree-salias
4693 Dump structure aliasing variable information to a file.  This file name
4694 is made by appending @file{.salias} to the source file name.
4695
4696 @item alias
4697 @opindex fdump-tree-alias
4698 Dump aliasing information for each function.  The file name is made by
4699 appending @file{.alias} to the source file name.
4700
4701 @item ccp
4702 @opindex fdump-tree-ccp
4703 Dump each function after CCP@.  The file name is made by appending
4704 @file{.ccp} to the source file name.
4705
4706 @item storeccp
4707 @opindex fdump-tree-storeccp
4708 Dump each function after STORE-CCP.  The file name is made by appending
4709 @file{.storeccp} to the source file name.
4710
4711 @item pre
4712 @opindex fdump-tree-pre
4713 Dump trees after partial redundancy elimination.  The file name is made
4714 by appending @file{.pre} to the source file name.
4715
4716 @item fre
4717 @opindex fdump-tree-fre
4718 Dump trees after full redundancy elimination.  The file name is made
4719 by appending @file{.fre} to the source file name.
4720
4721 @item copyprop
4722 @opindex fdump-tree-copyprop
4723 Dump trees after copy propagation.  The file name is made
4724 by appending @file{.copyprop} to the source file name.
4725
4726 @item store_copyprop
4727 @opindex fdump-tree-store_copyprop
4728 Dump trees after store copy-propagation.  The file name is made
4729 by appending @file{.store_copyprop} to the source file name.
4730
4731 @item dce
4732 @opindex fdump-tree-dce
4733 Dump each function after dead code elimination.  The file name is made by
4734 appending @file{.dce} to the source file name.
4735
4736 @item mudflap
4737 @opindex fdump-tree-mudflap
4738 Dump each function after adding mudflap instrumentation.  The file name is
4739 made by appending @file{.mudflap} to the source file name.
4740
4741 @item sra
4742 @opindex fdump-tree-sra
4743 Dump each function after performing scalar replacement of aggregates.  The
4744 file name is made by appending @file{.sra} to the source file name.
4745
4746 @item sink
4747 @opindex fdump-tree-sink
4748 Dump each function after performing code sinking.  The file name is made
4749 by appending @file{.sink} to the source file name.
4750
4751 @item dom
4752 @opindex fdump-tree-dom
4753 Dump each function after applying dominator tree optimizations.  The file
4754 name is made by appending @file{.dom} to the source file name.
4755
4756 @item dse
4757 @opindex fdump-tree-dse
4758 Dump each function after applying dead store elimination.  The file
4759 name is made by appending @file{.dse} to the source file name.
4760
4761 @item phiopt
4762 @opindex fdump-tree-phiopt
4763 Dump each function after optimizing PHI nodes into straightline code.  The file
4764 name is made by appending @file{.phiopt} to the source file name.
4765
4766 @item forwprop
4767 @opindex fdump-tree-forwprop
4768 Dump each function after forward propagating single use variables.  The file
4769 name is made by appending @file{.forwprop} to the source file name.
4770
4771 @item copyrename
4772 @opindex fdump-tree-copyrename
4773 Dump each function after applying the copy rename optimization.  The file
4774 name is made by appending @file{.copyrename} to the source file name.
4775
4776 @item nrv
4777 @opindex fdump-tree-nrv
4778 Dump each function after applying the named return value optimization on
4779 generic trees.  The file name is made by appending @file{.nrv} to the source
4780 file name.
4781
4782 @item vect
4783 @opindex fdump-tree-vect
4784 Dump each function after applying vectorization of loops.  The file name is
4785 made by appending @file{.vect} to the source file name.
4786
4787 @item vrp
4788 @opindex fdump-tree-vrp
4789 Dump each function after Value Range Propagation (VRP).  The file name
4790 is made by appending @file{.vrp} to the source file name.
4791
4792 @item all
4793 @opindex fdump-tree-all
4794 Enable all the available tree dumps with the flags provided in this option.
4795 @end table
4796
4797 @item -ftree-vectorizer-verbose=@var{n}
4798 @opindex ftree-vectorizer-verbose
4799 This option controls the amount of debugging output the vectorizer prints.
4800 This information is written to standard error, unless
4801 @option{-fdump-tree-all} or @option{-fdump-tree-vect} is specified,
4802 in which case it is output to the usual dump listing file, @file{.vect}.
4803 For @var{n}=0 no diagnostic information is reported.
4804 If @var{n}=1 the vectorizer reports each loop that got vectorized,
4805 and the total number of loops that got vectorized.
4806 If @var{n}=2 the vectorizer also reports non-vectorized loops that passed
4807 the first analysis phase (vect_analyze_loop_form) - i.e. countable,
4808 inner-most, single-bb, single-entry/exit loops.  This is the same verbosity
4809 level that @option{-fdump-tree-vect-stats} uses.
4810 Higher verbosity levels mean either more information dumped for each
4811 reported loop, or same amount of information reported for more loops:
4812 If @var{n}=3, alignment related information is added to the reports.
4813 If @var{n}=4, data-references related information (e.g. memory dependences,
4814 memory access-patterns) is added to the reports.
4815 If @var{n}=5, the vectorizer reports also non-vectorized inner-most loops
4816 that did not pass the first analysis phase (i.e. may not be countable, or
4817 may have complicated control-flow).
4818 If @var{n}=6, the vectorizer reports also non-vectorized nested loops.
4819 For @var{n}=7, all the information the vectorizer generates during its
4820 analysis and transformation is reported.  This is the same verbosity level
4821 that @option{-fdump-tree-vect-details} uses.
4822
4823 @item -frandom-seed=@var{string}
4824 @opindex frandom-string
4825 This option provides a seed that GCC uses when it would otherwise use
4826 random numbers.  It is used to generate certain symbol names
4827 that have to be different in every compiled file.  It is also used to
4828 place unique stamps in coverage data files and the object files that
4829 produce them.  You can use the @option{-frandom-seed} option to produce
4830 reproducibly identical object files.
4831
4832 The @var{string} should be different for every file you compile.
4833
4834 @item -fsched-verbose=@var{n}
4835 @opindex fsched-verbose
4836 On targets that use instruction scheduling, this option controls the
4837 amount of debugging output the scheduler prints.  This information is
4838 written to standard error, unless @option{-dS} or @option{-dR} is
4839 specified, in which case it is output to the usual dump
4840 listing file, @file{.sched} or @file{.sched2} respectively.  However
4841 for @var{n} greater than nine, the output is always printed to standard
4842 error.
4843
4844 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
4845 same information as @option{-dRS}.  For @var{n} greater than one, it
4846 also output basic block probabilities, detailed ready list information
4847 and unit/insn info.  For @var{n} greater than two, it includes RTL
4848 at abort point, control-flow and regions info.  And for @var{n} over
4849 four, @option{-fsched-verbose} also includes dependence info.
4850
4851 @item -save-temps
4852 @opindex save-temps
4853 Store the usual ``temporary'' intermediate files permanently; place them
4854 in the current directory and name them based on the source file.  Thus,
4855 compiling @file{foo.c} with @samp{-c -save-temps} would produce files
4856 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
4857 preprocessed @file{foo.i} output file even though the compiler now
4858 normally uses an integrated preprocessor.
4859
4860 When used in combination with the @option{-x} command line option,
4861 @option{-save-temps} is sensible enough to avoid over writing an
4862 input source file with the same extension as an intermediate file.
4863 The corresponding intermediate file may be obtained by renaming the
4864 source file before using @option{-save-temps}.
4865
4866 @item -time
4867 @opindex time
4868 Report the CPU time taken by each subprocess in the compilation
4869 sequence.  For C source files, this is the compiler proper and assembler
4870 (plus the linker if linking is done).  The output looks like this:
4871
4872 @smallexample
4873 # cc1 0.12 0.01
4874 # as 0.00 0.01
4875 @end smallexample
4876
4877 The first number on each line is the ``user time'', that is time spent
4878 executing the program itself.  The second number is ``system time'',
4879 time spent executing operating system routines on behalf of the program.
4880 Both numbers are in seconds.
4881
4882 @item -fvar-tracking
4883 @opindex fvar-tracking
4884 Run variable tracking pass.  It computes where variables are stored at each
4885 position in code.  Better debugging information is then generated
4886 (if the debugging information format supports this information).
4887
4888 It is enabled by default when compiling with optimization (@option{-Os},
4889 @option{-O}, @option{-O2}, ...), debugging information (@option{-g}) and
4890 the debug info format supports it.
4891
4892 @item -print-file-name=@var{library}
4893 @opindex print-file-name
4894 Print the full absolute name of the library file @var{library} that
4895 would be used when linking---and don't do anything else.  With this
4896 option, GCC does not compile or link anything; it just prints the
4897 file name.
4898
4899 @item -print-multi-directory
4900 @opindex print-multi-directory
4901 Print the directory name corresponding to the multilib selected by any
4902 other switches present in the command line.  This directory is supposed
4903 to exist in @env{GCC_EXEC_PREFIX}.
4904
4905 @item -print-multi-lib
4906 @opindex print-multi-lib
4907 Print the mapping from multilib directory names to compiler switches
4908 that enable them.  The directory name is separated from the switches by
4909 @samp{;}, and each switch starts with an @samp{@@} instead of the
4910 @samp{-}, without spaces between multiple switches.  This is supposed to
4911 ease shell-processing.
4912
4913 @item -print-prog-name=@var{program}
4914 @opindex print-prog-name
4915 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
4916
4917 @item -print-libgcc-file-name
4918 @opindex print-libgcc-file-name
4919 Same as @option{-print-file-name=libgcc.a}.
4920
4921 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
4922 but you do want to link with @file{libgcc.a}.  You can do
4923
4924 @smallexample
4925 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
4926 @end smallexample
4927
4928 @item -print-search-dirs
4929 @opindex print-search-dirs
4930 Print the name of the configured installation directory and a list of
4931 program and library directories @command{gcc} will search---and don't do anything else.
4932
4933 This is useful when @command{gcc} prints the error message
4934 @samp{installation problem, cannot exec cpp0: No such file or directory}.
4935 To resolve this you either need to put @file{cpp0} and the other compiler
4936 components where @command{gcc} expects to find them, or you can set the environment
4937 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
4938 Don't forget the trailing @samp{/}.
4939 @xref{Environment Variables}.
4940
4941 @item -print-sysroot-headers-suffix
4942 @opindex print-sysroot-headers-suffix
4943 Print the suffix added to the target sysroot when searching for
4944 headers, or give an error if the compiler is not configured with such
4945 a suffix---and don't do anything else.
4946
4947 @item -dumpmachine
4948 @opindex dumpmachine
4949 Print the compiler's target machine (for example,
4950 @samp{i686-pc-linux-gnu})---and don't do anything else.
4951
4952 @item -dumpversion
4953 @opindex dumpversion
4954 Print the compiler version (for example, @samp{3.0})---and don't do
4955 anything else.
4956
4957 @item -dumpspecs
4958 @opindex dumpspecs
4959 Print the compiler's built-in specs---and don't do anything else.  (This
4960 is used when GCC itself is being built.)  @xref{Spec Files}.
4961
4962 @item -feliminate-unused-debug-types
4963 @opindex feliminate-unused-debug-types
4964 Normally, when producing DWARF2 output, GCC will emit debugging
4965 information for all types declared in a compilation
4966 unit, regardless of whether or not they are actually used
4967 in that compilation unit.  Sometimes this is useful, such as
4968 if, in the debugger, you want to cast a value to a type that is
4969 not actually used in your program (but is declared).  More often,
4970 however, this results in a significant amount of wasted space.
4971 With this option, GCC will avoid producing debug symbol output
4972 for types that are nowhere used in the source file being compiled.
4973 @end table
4974
4975 @node Optimize Options
4976 @section Options That Control Optimization
4977 @cindex optimize options
4978 @cindex options, optimization
4979
4980 These options control various sorts of optimizations.
4981
4982 Without any optimization option, the compiler's goal is to reduce the
4983 cost of compilation and to make debugging produce the expected
4984 results.  Statements are independent: if you stop the program with a
4985 breakpoint between statements, you can then assign a new value to any
4986 variable or change the program counter to any other statement in the
4987 function and get exactly the results you would expect from the source
4988 code.
4989
4990 Turning on optimization flags makes the compiler attempt to improve
4991 the performance and/or code size at the expense of compilation time
4992 and possibly the ability to debug the program.
4993
4994 The compiler performs optimization based on the knowledge it has of
4995 the program.  Optimization levels @option{-O} and above, in
4996 particular, enable @emph{unit-at-a-time} mode, which allows the
4997 compiler to consider information gained from later functions in
4998 the file when compiling a function.  Compiling multiple files at
4999 once to a single output file in @emph{unit-at-a-time} mode allows
5000 the compiler to use information gained from all of the files when
5001 compiling each of them.
5002
5003 Not all optimizations are controlled directly by a flag.  Only
5004 optimizations that have a flag are listed.
5005
5006 @table @gcctabopt
5007 @item -O
5008 @itemx -O1
5009 @opindex O
5010 @opindex O1
5011 Optimize.  Optimizing compilation takes somewhat more time, and a lot
5012 more memory for a large function.
5013
5014 With @option{-O}, the compiler tries to reduce code size and execution
5015 time, without performing any optimizations that take a great deal of
5016 compilation time.
5017
5018 @option{-O} turns on the following optimization flags:
5019 @gccoptlist{-fdefer-pop @gol
5020 -fdelayed-branch @gol
5021 -fguess-branch-probability @gol
5022 -fcprop-registers @gol
5023 -fif-conversion @gol
5024 -fif-conversion2 @gol
5025 -fsplit-wide-types @gol
5026 -ftree-ccp @gol
5027 -ftree-dce @gol
5028 -ftree-dominator-opts @gol
5029 -ftree-dse @gol
5030 -ftree-ter @gol
5031 -ftree-sra @gol
5032 -ftree-copyrename @gol
5033 -ftree-fre @gol
5034 -ftree-ch @gol
5035 -funit-at-a-time @gol
5036 -fmerge-constants}
5037
5038 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
5039 where doing so does not interfere with debugging.
5040
5041 @item -O2
5042 @opindex O2
5043 Optimize even more.  GCC performs nearly all supported optimizations
5044 that do not involve a space-speed tradeoff.  The compiler does not
5045 perform loop unrolling or function inlining when you specify @option{-O2}.
5046 As compared to @option{-O}, this option increases both compilation time
5047 and the performance of the generated code.
5048
5049 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
5050 also turns on the following optimization flags:
5051 @gccoptlist{-fthread-jumps @gol
5052 -fcrossjumping @gol
5053 -foptimize-sibling-calls @gol
5054 -fcse-follow-jumps  -fcse-skip-blocks @gol
5055 -fgcse  -fgcse-lm  @gol
5056 -fexpensive-optimizations @gol
5057 -frerun-cse-after-loop  @gol
5058 -fcaller-saves @gol
5059 -fpeephole2 @gol
5060 -fschedule-insns  -fschedule-insns2 @gol
5061 -fsched-interblock  -fsched-spec @gol
5062 -fregmove @gol
5063 -fstrict-aliasing -fstrict-overflow @gol
5064 -fdelete-null-pointer-checks @gol
5065 -freorder-blocks  -freorder-functions @gol
5066 -falign-functions  -falign-jumps @gol
5067 -falign-loops  -falign-labels @gol
5068 -ftree-vrp @gol
5069 -ftree-pre}
5070
5071 Please note the warning under @option{-fgcse} about
5072 invoking @option{-O2} on programs that use computed gotos.
5073
5074 @item -O3
5075 @opindex O3
5076 Optimize yet more.  @option{-O3} turns on all optimizations specified by
5077 @option{-O2} and also turns on the @option{-finline-functions},
5078 @option{-funswitch-loops}, @option{-fpredictive-commoning} and
5079 @option{-fgcse-after-reload} options.
5080
5081 @item -O0
5082 @opindex O0
5083 Reduce compilation time and make debugging produce the expected
5084 results.  This is the default.
5085
5086 @item -Os
5087 @opindex Os
5088 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
5089 do not typically increase code size.  It also performs further
5090 optimizations designed to reduce code size.
5091
5092 @option{-Os} disables the following optimization flags:
5093 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
5094 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
5095 -fprefetch-loop-arrays  -ftree-vect-loop-version}
5096
5097 If you use multiple @option{-O} options, with or without level numbers,
5098 the last such option is the one that is effective.
5099 @end table
5100
5101 Options of the form @option{-f@var{flag}} specify machine-independent
5102 flags.  Most flags have both positive and negative forms; the negative
5103 form of @option{-ffoo} would be @option{-fno-foo}.  In the table
5104 below, only one of the forms is listed---the one you typically will
5105 use.  You can figure out the other form by either removing @samp{no-}
5106 or adding it.
5107
5108 The following options control specific optimizations.  They are either
5109 activated by @option{-O} options or are related to ones that are.  You
5110 can use the following flags in the rare cases when ``fine-tuning'' of
5111 optimizations to be performed is desired.
5112
5113 @table @gcctabopt
5114 @item -fno-default-inline
5115 @opindex fno-default-inline
5116 Do not make member functions inline by default merely because they are
5117 defined inside the class scope (C++ only).  Otherwise, when you specify
5118 @w{@option{-O}}, member functions defined inside class scope are compiled
5119 inline by default; i.e., you don't need to add @samp{inline} in front of
5120 the member function name.
5121
5122 @item -fno-defer-pop
5123 @opindex fno-defer-pop
5124 Always pop the arguments to each function call as soon as that function
5125 returns.  For machines which must pop arguments after a function call,
5126 the compiler normally lets arguments accumulate on the stack for several
5127 function calls and pops them all at once.
5128
5129 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5130
5131 @item -fforce-addr
5132 @opindex fforce-addr
5133 Force memory address constants to be copied into registers before
5134 doing arithmetic on them.
5135
5136 @item -fforward-propagate
5137 @opindex fforward-propagate
5138 Perform a forward propagation pass on RTL.  The pass tries to combine two
5139 instructions and checks if the result can be simplified.  If loop unrolling
5140 is active, two passes are performed and the second is scheduled after
5141 loop unrolling.
5142
5143 This option is enabled by default at optimization levels @option{-O2},
5144 @option{-O3}, @option{-Os}.
5145
5146 @item -fomit-frame-pointer
5147 @opindex fomit-frame-pointer
5148 Don't keep the frame pointer in a register for functions that
5149 don't need one.  This avoids the instructions to save, set up and
5150 restore frame pointers; it also makes an extra register available
5151 in many functions.  @strong{It also makes debugging impossible on
5152 some machines.}
5153
5154 On some machines, such as the VAX, this flag has no effect, because
5155 the standard calling sequence automatically handles the frame pointer
5156 and nothing is saved by pretending it doesn't exist.  The
5157 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
5158 whether a target machine supports this flag.  @xref{Registers,,Register
5159 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
5160
5161 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5162
5163 @item -foptimize-sibling-calls
5164 @opindex foptimize-sibling-calls
5165 Optimize sibling and tail recursive calls.
5166
5167 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5168
5169 @item -fno-inline
5170 @opindex fno-inline
5171 Don't pay attention to the @code{inline} keyword.  Normally this option
5172 is used to keep the compiler from expanding any functions inline.
5173 Note that if you are not optimizing, no functions can be expanded inline.
5174
5175 @item -finline-functions
5176 @opindex finline-functions
5177 Integrate all simple functions into their callers.  The compiler
5178 heuristically decides which functions are simple enough to be worth
5179 integrating in this way.
5180
5181 If all calls to a given function are integrated, and the function is
5182 declared @code{static}, then the function is normally not output as
5183 assembler code in its own right.
5184
5185 Enabled at level @option{-O3}.
5186
5187 @item -finline-functions-called-once
5188 @opindex finline-functions-called-once
5189 Consider all @code{static} functions called once for inlining into their
5190 caller even if they are not marked @code{inline}.  If a call to a given
5191 function is integrated, then the function is not output as assembler code
5192 in its own right.
5193
5194 Enabled if @option{-funit-at-a-time} is enabled.
5195
5196 @item -fearly-inlining
5197 @opindex fearly-inlining
5198 Inline functions marked by @code{always_inline} and functions whose body seems
5199 smaller than the function call overhead early before doing
5200 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
5201 makes profiling significantly cheaper and usually inlining faster on programs
5202 having large chains of nested wrapper functions.
5203
5204 Enabled by default.
5205
5206 @item -finline-limit=@var{n}
5207 @opindex finline-limit
5208 By default, GCC limits the size of functions that can be inlined.  This flag
5209 allows the control of this limit for functions that are explicitly marked as
5210 inline (i.e., marked with the inline keyword or defined within the class
5211 definition in c++).  @var{n} is the size of functions that can be inlined in
5212 number of pseudo instructions (not counting parameter handling).  The default
5213 value of @var{n} is 600.
5214 Increasing this value can result in more inlined code at
5215 the cost of compilation time and memory consumption.  Decreasing usually makes
5216 the compilation faster and less code will be inlined (which presumably
5217 means slower programs).  This option is particularly useful for programs that
5218 use inlining heavily such as those based on recursive templates with C++.
5219
5220 Inlining is actually controlled by a number of parameters, which may be
5221 specified individually by using @option{--param @var{name}=@var{value}}.
5222 The @option{-finline-limit=@var{n}} option sets some of these parameters
5223 as follows:
5224
5225 @table @gcctabopt
5226 @item max-inline-insns-single
5227  is set to @var{n}/2.
5228 @item max-inline-insns-auto
5229  is set to @var{n}/2.
5230 @item min-inline-insns
5231  is set to 130 or @var{n}/4, whichever is smaller.
5232 @item max-inline-insns-rtl
5233  is set to @var{n}.
5234 @end table
5235
5236 See below for a documentation of the individual
5237 parameters controlling inlining.
5238
5239 @emph{Note:} pseudo instruction represents, in this particular context, an
5240 abstract measurement of function's size.  In no way does it represent a count
5241 of assembly instructions and as such its exact meaning might change from one
5242 release to an another.
5243
5244 @item -fkeep-inline-functions
5245 @opindex fkeep-inline-functions
5246 In C, emit @code{static} functions that are declared @code{inline}
5247 into the object file, even if the function has been inlined into all
5248 of its callers.  This switch does not affect functions using the
5249 @code{extern inline} extension in GNU C89@.  In C++, emit any and all
5250 inline functions into the object file.
5251
5252 @item -fkeep-static-consts
5253 @opindex fkeep-static-consts
5254 Emit variables declared @code{static const} when optimization isn't turned
5255 on, even if the variables aren't referenced.
5256
5257 GCC enables this option by default.  If you want to force the compiler to
5258 check if the variable was referenced, regardless of whether or not
5259 optimization is turned on, use the @option{-fno-keep-static-consts} option.
5260
5261 @item -fmerge-constants
5262 Attempt to merge identical constants (string constants and floating point
5263 constants) across compilation units.
5264
5265 This option is the default for optimized compilation if the assembler and
5266 linker support it.  Use @option{-fno-merge-constants} to inhibit this
5267 behavior.
5268
5269 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5270
5271 @item -fmerge-all-constants
5272 Attempt to merge identical constants and identical variables.
5273
5274 This option implies @option{-fmerge-constants}.  In addition to
5275 @option{-fmerge-constants} this considers e.g.@: even constant initialized
5276 arrays or initialized constant variables with integral or floating point
5277 types.  Languages like C or C++ require each non-automatic variable to
5278 have distinct location, so using this option will result in non-conforming
5279 behavior.
5280
5281 @item -fmodulo-sched
5282 @opindex fmodulo-sched
5283 Perform swing modulo scheduling immediately before the first scheduling
5284 pass.  This pass looks at innermost loops and reorders their
5285 instructions by overlapping different iterations.
5286
5287 @item -fmodulo-sched-allow-regmoves
5288 @opindex fmodulo-sched-allow-regmoves
5289 Perform more aggressive SMS based modulo scheduling with register moves
5290 allowed.  By setting this flag certain anti-dependences edges will be
5291 deleted which will trigger the generation of reg-moves based on the
5292 life-range analysis.  This option is effective only with
5293 @option{-fmodulo-sched} enabled.
5294
5295 @item -fno-branch-count-reg
5296 @opindex fno-branch-count-reg
5297 Do not use ``decrement and branch'' instructions on a count register,
5298 but instead generate a sequence of instructions that decrement a
5299 register, compare it against zero, then branch based upon the result.
5300 This option is only meaningful on architectures that support such
5301 instructions, which include x86, PowerPC, IA-64 and S/390.
5302
5303 The default is @option{-fbranch-count-reg}.
5304
5305 @item -fno-function-cse
5306 @opindex fno-function-cse
5307 Do not put function addresses in registers; make each instruction that
5308 calls a constant function contain the function's address explicitly.
5309
5310 This option results in less efficient code, but some strange hacks
5311 that alter the assembler output may be confused by the optimizations
5312 performed when this option is not used.
5313
5314 The default is @option{-ffunction-cse}
5315
5316 @item -fno-zero-initialized-in-bss
5317 @opindex fno-zero-initialized-in-bss
5318 If the target supports a BSS section, GCC by default puts variables that
5319 are initialized to zero into BSS@.  This can save space in the resulting
5320 code.
5321
5322 This option turns off this behavior because some programs explicitly
5323 rely on variables going to the data section.  E.g., so that the
5324 resulting executable can find the beginning of that section and/or make
5325 assumptions based on that.
5326
5327 The default is @option{-fzero-initialized-in-bss}.
5328
5329 @item -fbounds-check
5330 @opindex fbounds-check
5331 For front-ends that support it, generate additional code to check that
5332 indices used to access arrays are within the declared range.  This is
5333 currently only supported by the Java and Fortran front-ends, where
5334 this option defaults to true and false respectively.
5335
5336 @item -fmudflap -fmudflapth -fmudflapir
5337 @opindex fmudflap
5338 @opindex fmudflapth
5339 @opindex fmudflapir
5340 @cindex bounds checking
5341 @cindex mudflap
5342 For front-ends that support it (C and C++), instrument all risky
5343 pointer/array dereferencing operations, some standard library
5344 string/heap functions, and some other associated constructs with
5345 range/validity tests.  Modules so instrumented should be immune to
5346 buffer overflows, invalid heap use, and some other classes of C/C++
5347 programming errors.  The instrumentation relies on a separate runtime
5348 library (@file{libmudflap}), which will be linked into a program if
5349 @option{-fmudflap} is given at link time.  Run-time behavior of the
5350 instrumented program is controlled by the @env{MUDFLAP_OPTIONS}
5351 environment variable.  See @code{env MUDFLAP_OPTIONS=-help a.out}
5352 for its options.
5353
5354 Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to
5355 link if your program is multi-threaded.  Use @option{-fmudflapir}, in
5356 addition to @option{-fmudflap} or @option{-fmudflapth}, if
5357 instrumentation should ignore pointer reads.  This produces less
5358 instrumentation (and therefore faster execution) and still provides
5359 some protection against outright memory corrupting writes, but allows
5360 erroneously read data to propagate within a program.
5361
5362 @item -fthread-jumps
5363 @opindex fthread-jumps
5364 Perform optimizations where we check to see if a jump branches to a
5365 location where another comparison subsumed by the first is found.  If
5366 so, the first branch is redirected to either the destination of the
5367 second branch or a point immediately following it, depending on whether
5368 the condition is known to be true or false.
5369
5370 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5371
5372 @item -fsplit-wide-types
5373 @opindex fsplit-wide-types
5374 When using a type that occupies multiple registers, such as @code{long
5375 long} on a 32-bit system, split the registers apart and allocate them
5376 independently.  This normally generates better code for those types,
5377 but may make debugging more difficult.
5378
5379 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
5380 @option{-Os}.
5381
5382 @item -fcse-follow-jumps
5383 @opindex fcse-follow-jumps
5384 In common subexpression elimination, scan through jump instructions
5385 when the target of the jump is not reached by any other path.  For
5386 example, when CSE encounters an @code{if} statement with an
5387 @code{else} clause, CSE will follow the jump when the condition
5388 tested is false.
5389
5390 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5391
5392 @item -fcse-skip-blocks
5393 @opindex fcse-skip-blocks
5394 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
5395 follow jumps which conditionally skip over blocks.  When CSE
5396 encounters a simple @code{if} statement with no else clause,
5397 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
5398 body of the @code{if}.
5399
5400 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5401
5402 @item -frerun-cse-after-loop
5403 @opindex frerun-cse-after-loop
5404 Re-run common subexpression elimination after loop optimizations has been
5405 performed.
5406
5407 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5408
5409 @item -fgcse
5410 @opindex fgcse
5411 Perform a global common subexpression elimination pass.
5412 This pass also performs global constant and copy propagation.
5413
5414 @emph{Note:} When compiling a program using computed gotos, a GCC
5415 extension, you may get better runtime performance if you disable
5416 the global common subexpression elimination pass by adding
5417 @option{-fno-gcse} to the command line.
5418
5419 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5420
5421 @item -fgcse-lm
5422 @opindex fgcse-lm
5423 When @option{-fgcse-lm} is enabled, global common subexpression elimination will
5424 attempt to move loads which are only killed by stores into themselves.  This
5425 allows a loop containing a load/store sequence to be changed to a load outside
5426 the loop, and a copy/store within the loop.
5427
5428 Enabled by default when gcse is enabled.
5429
5430 @item -fgcse-sm
5431 @opindex fgcse-sm
5432 When @option{-fgcse-sm} is enabled, a store motion pass is run after
5433 global common subexpression elimination.  This pass will attempt to move
5434 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
5435 loops containing a load/store sequence can be changed to a load before
5436 the loop and a store after the loop.
5437
5438 Not enabled at any optimization level.
5439
5440 @item -fgcse-las
5441 @opindex fgcse-las
5442 When @option{-fgcse-las} is enabled, the global common subexpression
5443 elimination pass eliminates redundant loads that come after stores to the
5444 same memory location (both partial and full redundancies).
5445
5446 Not enabled at any optimization level.
5447
5448 @item -fgcse-after-reload
5449 @opindex fgcse-after-reload
5450 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
5451 pass is performed after reload.  The purpose of this pass is to cleanup
5452 redundant spilling.
5453
5454 @item -funsafe-loop-optimizations
5455 @opindex funsafe-loop-optimizations
5456 If given, the loop optimizer will assume that loop indices do not
5457 overflow, and that the loops with nontrivial exit condition are not
5458 infinite.  This enables a wider range of loop optimizations even if
5459 the loop optimizer itself cannot prove that these assumptions are valid.
5460 Using @option{-Wunsafe-loop-optimizations}, the compiler will warn you
5461 if it finds this kind of loop.
5462
5463 @item -fcrossjumping
5464 @opindex crossjumping
5465 Perform cross-jumping transformation.  This transformation unifies equivalent code and save code size.  The
5466 resulting code may or may not perform better than without cross-jumping.
5467
5468 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5469
5470 @item -fif-conversion
5471 @opindex if-conversion
5472 Attempt to transform conditional jumps into branch-less equivalents.  This
5473 include use of conditional moves, min, max, set flags and abs instructions, and
5474 some tricks doable by standard arithmetics.  The use of conditional execution
5475 on chips where it is available is controlled by @code{if-conversion2}.
5476
5477 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5478
5479 @item -fif-conversion2
5480 @opindex if-conversion2
5481 Use conditional execution (where available) to transform conditional jumps into
5482 branch-less equivalents.
5483
5484 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5485
5486 @item -fdelete-null-pointer-checks
5487 @opindex fdelete-null-pointer-checks
5488 Use global dataflow analysis to identify and eliminate useless checks
5489 for null pointers.  The compiler assumes that dereferencing a null
5490 pointer would have halted the program.  If a pointer is checked after
5491 it has already been dereferenced, it cannot be null.
5492
5493 In some environments, this assumption is not true, and programs can
5494 safely dereference null pointers.  Use
5495 @option{-fno-delete-null-pointer-checks} to disable this optimization
5496 for programs which depend on that behavior.
5497
5498 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5499
5500 @item -fexpensive-optimizations
5501 @opindex fexpensive-optimizations
5502 Perform a number of minor optimizations that are relatively expensive.
5503
5504 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5505
5506 @item -foptimize-register-move
5507 @itemx -fregmove
5508 @opindex foptimize-register-move
5509 @opindex fregmove
5510 Attempt to reassign register numbers in move instructions and as
5511 operands of other simple instructions in order to maximize the amount of
5512 register tying.  This is especially helpful on machines with two-operand
5513 instructions.
5514
5515 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
5516 optimization.
5517
5518 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5519
5520 @item -fdelayed-branch
5521 @opindex fdelayed-branch
5522 If supported for the target machine, attempt to reorder instructions
5523 to exploit instruction slots available after delayed branch
5524 instructions.
5525
5526 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5527
5528 @item -fschedule-insns
5529 @opindex fschedule-insns
5530 If supported for the target machine, attempt to reorder instructions to
5531 eliminate execution stalls due to required data being unavailable.  This
5532 helps machines that have slow floating point or memory load instructions
5533 by allowing other instructions to be issued until the result of the load
5534 or floating point instruction is required.
5535
5536 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5537
5538 @item -fschedule-insns2
5539 @opindex fschedule-insns2
5540 Similar to @option{-fschedule-insns}, but requests an additional pass of
5541 instruction scheduling after register allocation has been done.  This is
5542 especially useful on machines with a relatively small number of
5543 registers and where memory load instructions take more than one cycle.
5544
5545 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5546
5547 @item -fno-sched-interblock
5548 @opindex fno-sched-interblock
5549 Don't schedule instructions across basic blocks.  This is normally
5550 enabled by default when scheduling before register allocation, i.e.@:
5551 with @option{-fschedule-insns} or at @option{-O2} or higher.
5552
5553 @item -fno-sched-spec
5554 @opindex fno-sched-spec
5555 Don't allow speculative motion of non-load instructions.  This is normally
5556 enabled by default when scheduling before register allocation, i.e.@:
5557 with @option{-fschedule-insns} or at @option{-O2} or higher.
5558
5559 @item -fsched-spec-load
5560 @opindex fsched-spec-load
5561 Allow speculative motion of some load instructions.  This only makes
5562 sense when scheduling before register allocation, i.e.@: with
5563 @option{-fschedule-insns} or at @option{-O2} or higher.
5564
5565 @item -fsched-spec-load-dangerous
5566 @opindex fsched-spec-load-dangerous
5567 Allow speculative motion of more load instructions.  This only makes
5568 sense when scheduling before register allocation, i.e.@: with
5569 @option{-fschedule-insns} or at @option{-O2} or higher.
5570
5571 @item -fsched-stalled-insns=@var{n}
5572 @opindex fsched-stalled-insns
5573 Define how many insns (if any) can be moved prematurely from the queue
5574 of stalled insns into the ready list, during the second scheduling pass.
5575
5576 @item -fsched-stalled-insns-dep=@var{n}
5577 @opindex fsched-stalled-insns-dep
5578 Define how many insn groups (cycles) will be examined for a dependency
5579 on a stalled insn that is candidate for premature removal from the queue
5580 of stalled insns.  Has an effect only during the second scheduling pass,
5581 and only if @option{-fsched-stalled-insns} is used and its value is not zero.
5582
5583 @item -fsched2-use-superblocks
5584 @opindex fsched2-use-superblocks
5585 When scheduling after register allocation, do use superblock scheduling
5586 algorithm.  Superblock scheduling allows motion across basic block boundaries
5587 resulting on faster schedules.  This option is experimental, as not all machine
5588 descriptions used by GCC model the CPU closely enough to avoid unreliable
5589 results from the algorithm.
5590
5591 This only makes sense when scheduling after register allocation, i.e.@: with
5592 @option{-fschedule-insns2} or at @option{-O2} or higher.
5593
5594 @item -fsched2-use-traces
5595 @opindex fsched2-use-traces
5596 Use @option{-fsched2-use-superblocks} algorithm when scheduling after register
5597 allocation and additionally perform code duplication in order to increase the
5598 size of superblocks using tracer pass.  See @option{-ftracer} for details on
5599 trace formation.
5600
5601 This mode should produce faster but significantly longer programs.  Also
5602 without @option{-fbranch-probabilities} the traces constructed may not
5603 match the reality and hurt the performance.  This only makes
5604 sense when scheduling after register allocation, i.e.@: with
5605 @option{-fschedule-insns2} or at @option{-O2} or higher.
5606
5607 @item -fsee
5608 @opindex fsee
5609 Eliminates redundant extension instructions and move the non redundant
5610 ones to optimal placement using LCM.
5611
5612 @item -freschedule-modulo-scheduled-loops
5613 @opindex fscheduling-in-modulo-scheduled-loops
5614 The modulo scheduling comes before the traditional scheduling, if a loop
5615 was modulo scheduled we may want to prevent the later scheduling passes
5616 from changing its schedule, we use this option to control that.
5617
5618 @item -fcaller-saves
5619 @opindex fcaller-saves
5620 Enable values to be allocated in registers that will be clobbered by
5621 function calls, by emitting extra instructions to save and restore the
5622 registers around such calls.  Such allocation is done only when it
5623 seems to result in better code than would otherwise be produced.
5624
5625 This option is always enabled by default on certain machines, usually
5626 those which have no call-preserved registers to use instead.
5627
5628 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5629
5630 @item -ftree-reassoc
5631 Perform Reassociation on trees  This flag is enabled by default
5632 at @option{-O} and higher.
5633
5634 @item -ftree-pre
5635 Perform Partial Redundancy Elimination (PRE) on trees.  This flag is
5636 enabled by default at @option{-O2} and @option{-O3}.
5637
5638 @item -ftree-fre
5639 Perform Full Redundancy Elimination (FRE) on trees.  The difference
5640 between FRE and PRE is that FRE only considers expressions
5641 that are computed on all paths leading to the redundant computation.
5642 This analysis is faster than PRE, though it exposes fewer redundancies.
5643 This flag is enabled by default at @option{-O} and higher.
5644
5645 @item -ftree-copy-prop
5646 Perform copy propagation on trees.  This pass eliminates unnecessary
5647 copy operations.  This flag is enabled by default at @option{-O} and
5648 higher.
5649
5650 @item -ftree-store-copy-prop
5651 Perform copy propagation of memory loads and stores.  This pass
5652 eliminates unnecessary copy operations in memory references
5653 (structures, global variables, arrays, etc).  This flag is enabled by
5654 default at @option{-O2} and higher.
5655
5656 @item -ftree-salias
5657 Perform structural alias analysis on trees.  This flag
5658 is enabled by default at @option{-O} and higher.
5659
5660 @item -fipa-pta
5661 Perform interprocedural pointer analysis.
5662
5663 @item -ftree-sink
5664 Perform forward store motion  on trees.  This flag is
5665 enabled by default at @option{-O} and higher.
5666
5667 @item -ftree-ccp
5668 Perform sparse conditional constant propagation (CCP) on trees.  This
5669 pass only operates on local scalar variables and is enabled by default
5670 at @option{-O} and higher.
5671
5672 @item -ftree-store-ccp
5673 Perform sparse conditional constant propagation (CCP) on trees.  This
5674 pass operates on both local scalar variables and memory stores and
5675 loads (global variables, structures, arrays, etc).  This flag is
5676 enabled by default at @option{-O2} and higher.
5677
5678 @item -ftree-dce
5679 Perform dead code elimination (DCE) on trees.  This flag is enabled by
5680 default at @option{-O} and higher.
5681
5682 @item -ftree-dominator-opts
5683 Perform a variety of simple scalar cleanups (constant/copy
5684 propagation, redundancy elimination, range propagation and expression
5685 simplification) based on a dominator tree traversal.  This also
5686 performs jump threading (to reduce jumps to jumps). This flag is
5687 enabled by default at @option{-O} and higher.
5688
5689 @item -ftree-ch
5690 Perform loop header copying on trees.  This is beneficial since it increases
5691 effectiveness of code motion optimizations.  It also saves one jump.  This flag
5692 is enabled by default at @option{-O} and higher.  It is not enabled
5693 for @option{-Os}, since it usually increases code size.
5694
5695 @item -ftree-loop-optimize
5696 Perform loop optimizations on trees.  This flag is enabled by default
5697 at @option{-O} and higher.
5698
5699 @item -ftree-loop-linear
5700 Perform linear loop transformations on tree.  This flag can improve cache
5701 performance and allow further loop optimizations to take place.
5702
5703 @item -fcheck-data-deps
5704 Compare the results of several data dependence analyzers.  This option
5705 is used for debugging the data dependence analyzers.
5706
5707 @item -ftree-loop-im
5708 Perform loop invariant motion on trees.  This pass moves only invariants that
5709 would be hard to handle at RTL level (function calls, operations that expand to
5710 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
5711 operands of conditions that are invariant out of the loop, so that we can use
5712 just trivial invariantness analysis in loop unswitching.  The pass also includes
5713 store motion.
5714
5715 @item -ftree-loop-ivcanon
5716 Create a canonical counter for number of iterations in the loop for that
5717 determining number of iterations requires complicated analysis.  Later
5718 optimizations then may determine the number easily.  Useful especially
5719 in connection with unrolling.
5720
5721 @item -fivopts
5722 Perform induction variable optimizations (strength reduction, induction
5723 variable merging and induction variable elimination) on trees.
5724
5725 @item -ftree-sra
5726 Perform scalar replacement of aggregates.  This pass replaces structure
5727 references with scalars to prevent committing structures to memory too
5728 early.  This flag is enabled by default at @option{-O} and higher.
5729
5730 @item -ftree-copyrename
5731 Perform copy renaming on trees.  This pass attempts to rename compiler
5732 temporaries to other variables at copy locations, usually resulting in
5733 variable names which more closely resemble the original variables.  This flag
5734 is enabled by default at @option{-O} and higher.
5735
5736 @item -ftree-ter
5737 Perform temporary expression replacement during the SSA->normal phase.  Single
5738 use/single def temporaries are replaced at their use location with their
5739 defining expression.  This results in non-GIMPLE code, but gives the expanders
5740 much more complex trees to work on resulting in better RTL generation.  This is
5741 enabled by default at @option{-O} and higher.
5742
5743 @item -ftree-vectorize
5744 Perform loop vectorization on trees.
5745
5746 @item -ftree-vect-loop-version
5747 @opindex ftree-vect-loop-version
5748 Perform loop versioning when doing loop vectorization on trees.  When a loop
5749 appears to be vectorizable except that data alignment or data dependence cannot
5750 be determined at compile time then vectorized and non-vectorized versions of
5751 the loop are generated along with runtime checks for alignment or dependence
5752 to control which version is executed.  This option is enabled by default
5753 except at level @option{-Os} where it is disabled.
5754
5755 @item -fvect-cost-model
5756 Enable cost model for vectorization.
5757
5758 @item -ftree-vrp
5759 Perform Value Range Propagation on trees.  This is similar to the
5760 constant propagation pass, but instead of values, ranges of values are
5761 propagated.  This allows the optimizers to remove unnecessary range
5762 checks like array bound checks and null pointer checks.  This is
5763 enabled by default at @option{-O2} and higher.  Null pointer check
5764 elimination is only done if @option{-fdelete-null-pointer-checks} is
5765 enabled.
5766
5767 @item -ftracer
5768 @opindex ftracer
5769 Perform tail duplication to enlarge superblock size.  This transformation
5770 simplifies the control flow of the function allowing other optimizations to do
5771 better job.
5772
5773 @item -funroll-loops
5774 @opindex funroll-loops
5775 Unroll loops whose number of iterations can be determined at compile
5776 time or upon entry to the loop.  @option{-funroll-loops} implies
5777 @option{-frerun-cse-after-loop}.  This option makes code larger,
5778 and may or may not make it run faster.
5779
5780 @item -funroll-all-loops
5781 @opindex funroll-all-loops
5782 Unroll all loops, even if their number of iterations is uncertain when
5783 the loop is entered.  This usually makes programs run more slowly.
5784 @option{-funroll-all-loops} implies the same options as
5785 @option{-funroll-loops},
5786
5787 @item -fsplit-ivs-in-unroller
5788 @opindex fsplit-ivs-in-unroller
5789 Enables expressing of values of induction variables in later iterations
5790 of the unrolled loop using the value in the first iteration.  This breaks
5791 long dependency chains, thus improving efficiency of the scheduling passes.
5792
5793 Combination of @option{-fweb} and CSE is often sufficient to obtain the
5794 same effect.  However in cases the loop body is more complicated than
5795 a single basic block, this is not reliable.  It also does not work at all
5796 on some of the architectures due to restrictions in the CSE pass.
5797
5798 This optimization is enabled by default.
5799
5800 @item -fvariable-expansion-in-unroller
5801 @opindex fvariable-expansion-in-unroller
5802 With this option, the compiler will create multiple copies of some
5803 local variables when unrolling a loop which can result in superior code.
5804
5805 @item -fpredictive-commoning
5806 @opindex fpredictive-commoning
5807 Perform predictive commoning optimization, i.e., reusing computations
5808 (especially memory loads and stores) performed in previous
5809 iterations of loops.
5810
5811 This option is enabled at level @option{-O3}.
5812
5813 @item -fprefetch-loop-arrays
5814 @opindex fprefetch-loop-arrays
5815 If supported by the target machine, generate instructions to prefetch
5816 memory to improve the performance of loops that access large arrays.
5817
5818 This option may generate better or worse code; results are highly
5819 dependent on the structure of loops within the source code.
5820
5821 Disabled at level @option{-Os}.
5822
5823 @item -fno-peephole
5824 @itemx -fno-peephole2
5825 @opindex fno-peephole
5826 @opindex fno-peephole2
5827 Disable any machine-specific peephole optimizations.  The difference
5828 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
5829 are implemented in the compiler; some targets use one, some use the
5830 other, a few use both.
5831
5832 @option{-fpeephole} is enabled by default.
5833 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5834
5835 @item -fno-guess-branch-probability
5836 @opindex fno-guess-branch-probability
5837 Do not guess branch probabilities using heuristics.
5838
5839 GCC will use heuristics to guess branch probabilities if they are
5840 not provided by profiling feedback (@option{-fprofile-arcs}).  These
5841 heuristics are based on the control flow graph.  If some branch probabilities
5842 are specified by @samp{__builtin_expect}, then the heuristics will be
5843 used to guess branch probabilities for the rest of the control flow graph,
5844 taking the @samp{__builtin_expect} info into account.  The interactions
5845 between the heuristics and @samp{__builtin_expect} can be complex, and in
5846 some cases, it may be useful to disable the heuristics so that the effects
5847 of @samp{__builtin_expect} are easier to understand.
5848
5849 The default is @option{-fguess-branch-probability} at levels
5850 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5851
5852 @item -freorder-blocks
5853 @opindex freorder-blocks
5854 Reorder basic blocks in the compiled function in order to reduce number of
5855 taken branches and improve code locality.
5856
5857 Enabled at levels @option{-O2}, @option{-O3}.
5858
5859 @item -freorder-blocks-and-partition
5860 @opindex freorder-blocks-and-partition
5861 In addition to reordering basic blocks in the compiled function, in order
5862 to reduce number of taken branches, partitions hot and cold basic blocks
5863 into separate sections of the assembly and .o files, to improve
5864 paging and cache locality performance.
5865
5866 This optimization is automatically turned off in the presence of
5867 exception handling, for linkonce sections, for functions with a user-defined
5868 section attribute and on any architecture that does not support named
5869 sections.
5870
5871 @item -freorder-functions
5872 @opindex freorder-functions
5873 Reorder functions in the object file in order to
5874 improve code locality.  This is implemented by using special
5875 subsections @code{.text.hot} for most frequently executed functions and
5876 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
5877 the linker so object file format must support named sections and linker must
5878 place them in a reasonable way.
5879
5880 Also profile feedback must be available in to make this option effective.  See
5881 @option{-fprofile-arcs} for details.
5882
5883 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5884
5885 @item -fstrict-aliasing
5886 @opindex fstrict-aliasing
5887 Allows the compiler to assume the strictest aliasing rules applicable to
5888 the language being compiled.  For C (and C++), this activates
5889 optimizations based on the type of expressions.  In particular, an
5890 object of one type is assumed never to reside at the same address as an
5891 object of a different type, unless the types are almost the same.  For
5892 example, an @code{unsigned int} can alias an @code{int}, but not a
5893 @code{void*} or a @code{double}.  A character type may alias any other
5894 type.
5895
5896 Pay special attention to code like this:
5897 @smallexample
5898 union a_union @{
5899   int i;
5900   double d;
5901 @};
5902
5903 int f() @{
5904   a_union t;
5905   t.d = 3.0;
5906   return t.i;
5907 @}
5908 @end smallexample
5909 The practice of reading from a different union member than the one most
5910 recently written to (called ``type-punning'') is common.  Even with
5911 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
5912 is accessed through the union type.  So, the code above will work as
5913 expected.  However, this code might not:
5914 @smallexample
5915 int f() @{
5916   a_union t;
5917   int* ip;
5918   t.d = 3.0;
5919   ip = &t.i;
5920   return *ip;
5921 @}
5922 @end smallexample
5923
5924 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5925
5926 @item -fstrict-overflow
5927 @opindex fstrict-overflow
5928 Allow the compiler to assume strict signed overflow rules, depending
5929 on the language being compiled.  For C (and C++) this means that
5930 overflow when doing arithmetic with signed numbers is undefined, which
5931 means that the compiler may assume that it will not happen.  This
5932 permits various optimizations.  For example, the compiler will assume
5933 that an expression like @code{i + 10 > i} will always be true for
5934 signed @code{i}.  This assumption is only valid if signed overflow is
5935 undefined, as the expression is false if @code{i + 10} overflows when
5936 using twos complement arithmetic.  When this option is in effect any
5937 attempt to determine whether an operation on signed numbers will
5938 overflow must be written carefully to not actually involve overflow.
5939
5940 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
5941 that signed overflow is fully defined: it wraps.  When
5942 @option{-fwrapv} is used, there is no difference between
5943 @option{-fstrict-overflow} and @option{-fno-strict-overflow}.  With
5944 @option{-fwrapv} certain types of overflow are permitted.  For
5945 example, if the compiler gets an overflow when doing arithmetic on
5946 constants, the overflowed value can still be used with
5947 @option{-fwrapv}, but not otherwise.
5948
5949 The @option{-fstrict-overflow} option is enabled at levels
5950 @option{-O2}, @option{-O3}, @option{-Os}.
5951
5952 @item -falign-functions
5953 @itemx -falign-functions=@var{n}
5954 @opindex falign-functions
5955 Align the start of functions to the next power-of-two greater than
5956 @var{n}, skipping up to @var{n} bytes.  For instance,
5957 @option{-falign-functions=32} aligns functions to the next 32-byte
5958 boundary, but @option{-falign-functions=24} would align to the next
5959 32-byte boundary only if this can be done by skipping 23 bytes or less.
5960
5961 @option{-fno-align-functions} and @option{-falign-functions=1} are
5962 equivalent and mean that functions will not be aligned.
5963
5964 Some assemblers only support this flag when @var{n} is a power of two;
5965 in that case, it is rounded up.
5966
5967 If @var{n} is not specified or is zero, use a machine-dependent default.
5968
5969 Enabled at levels @option{-O2}, @option{-O3}.
5970
5971 @item -falign-labels
5972 @itemx -falign-labels=@var{n}
5973 @opindex falign-labels
5974 Align all branch targets to a power-of-two boundary, skipping up to
5975 @var{n} bytes like @option{-falign-functions}.  This option can easily
5976 make code slower, because it must insert dummy operations for when the
5977 branch target is reached in the usual flow of the code.
5978
5979 @option{-fno-align-labels} and @option{-falign-labels=1} are
5980 equivalent and mean that labels will not be aligned.
5981
5982 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
5983 are greater than this value, then their values are used instead.
5984
5985 If @var{n} is not specified or is zero, use a machine-dependent default
5986 which is very likely to be @samp{1}, meaning no alignment.
5987
5988 Enabled at levels @option{-O2}, @option{-O3}.
5989
5990 @item -falign-loops
5991 @itemx -falign-loops=@var{n}
5992 @opindex falign-loops
5993 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
5994 like @option{-falign-functions}.  The hope is that the loop will be
5995 executed many times, which will make up for any execution of the dummy
5996 operations.
5997
5998 @option{-fno-align-loops} and @option{-falign-loops=1} are
5999 equivalent and mean that loops will not be aligned.
6000
6001 If @var{n} is not specified or is zero, use a machine-dependent default.
6002
6003 Enabled at levels @option{-O2}, @option{-O3}.
6004
6005 @item -falign-jumps
6006 @itemx -falign-jumps=@var{n}
6007 @opindex falign-jumps
6008 Align branch targets to a power-of-two boundary, for branch targets
6009 where the targets can only be reached by jumping, skipping up to @var{n}
6010 bytes like @option{-falign-functions}.  In this case, no dummy operations
6011 need be executed.
6012
6013 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
6014 equivalent and mean that loops will not be aligned.
6015
6016 If @var{n} is not specified or is zero, use a machine-dependent default.
6017
6018 Enabled at levels @option{-O2}, @option{-O3}.
6019
6020 @item -funit-at-a-time
6021 @opindex funit-at-a-time
6022 Parse the whole compilation unit before starting to produce code.
6023 This allows some extra optimizations to take place but consumes
6024 more memory (in general).  There are some compatibility issues
6025 with @emph{unit-at-a-time} mode:
6026 @itemize @bullet
6027 @item
6028 enabling @emph{unit-at-a-time} mode may change the order
6029 in which functions, variables, and top-level @code{asm} statements
6030 are emitted, and will likely break code relying on some particular
6031 ordering.  The majority of such top-level @code{asm} statements,
6032 though, can be replaced by @code{section} attributes.  The
6033 @option{fno-toplevel-reorder} option may be used to keep the ordering
6034 used in the input file, at the cost of some optimizations.
6035
6036 @item
6037 @emph{unit-at-a-time} mode removes unreferenced static variables
6038 and functions.  This may result in undefined references
6039 when an @code{asm} statement refers directly to variables or functions
6040 that are otherwise unused.  In that case either the variable/function
6041 shall be listed as an operand of the @code{asm} statement operand or,
6042 in the case of top-level @code{asm} statements the attribute @code{used}
6043 shall be used on the declaration.
6044
6045 @item
6046 Static functions now can use non-standard passing conventions that
6047 may break @code{asm} statements calling functions directly.  Again,
6048 attribute @code{used} will prevent this behavior.
6049 @end itemize
6050
6051 As a temporary workaround, @option{-fno-unit-at-a-time} can be used,
6052 but this scheme may not be supported by future releases of GCC@.
6053
6054 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6055
6056 @item -fno-toplevel-reorder
6057 Do not reorder top-level functions, variables, and @code{asm}
6058 statements.  Output them in the same order that they appear in the
6059 input file.  When this option is used, unreferenced static variables
6060 will not be removed.  This option is intended to support existing code
6061 which relies on a particular ordering.  For new code, it is better to
6062 use attributes.
6063
6064 @item -fweb
6065 @opindex fweb
6066 Constructs webs as commonly used for register allocation purposes and assign
6067 each web individual pseudo register.  This allows the register allocation pass
6068 to operate on pseudos directly, but also strengthens several other optimization
6069 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
6070 however, make debugging impossible, since variables will no longer stay in a
6071 ``home register''.
6072
6073 Enabled by default with @option{-funroll-loops}.
6074
6075 @item -fwhole-program
6076 @opindex fwhole-program
6077 Assume that the current compilation unit represents whole program being
6078 compiled.  All public functions and variables with the exception of @code{main}
6079 and those merged by attribute @code{externally_visible} become static functions
6080 and in a affect gets more aggressively optimized by interprocedural optimizers.
6081 While this option is equivalent to proper use of @code{static} keyword for
6082 programs consisting of single file, in combination with option
6083 @option{--combine} this flag can be used to compile most of smaller scale C
6084 programs since the functions and variables become local for the whole combined
6085 compilation unit, not for the single source file itself.
6086
6087
6088 @item -fno-cprop-registers
6089 @opindex fno-cprop-registers
6090 After register allocation and post-register allocation instruction splitting,
6091 we perform a copy-propagation pass to try to reduce scheduling dependencies
6092 and occasionally eliminate the copy.
6093
6094 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6095
6096 @item -fprofile-generate
6097 @opindex fprofile-generate
6098
6099 Enable options usually used for instrumenting application to produce
6100 profile useful for later recompilation with profile feedback based
6101 optimization.  You must use @option{-fprofile-generate} both when
6102 compiling and when linking your program.
6103
6104 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
6105
6106 @item -fprofile-use
6107 @opindex fprofile-use
6108 Enable profile feedback directed optimizations, and optimizations
6109 generally profitable only with profile feedback available.
6110
6111 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
6112 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}
6113
6114 By default, GCC emits an error message if the feedback profiles do not
6115 match the source code.  This error can be turned into a warning by using
6116 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
6117 code.
6118 @end table
6119
6120 The following options control compiler behavior regarding floating
6121 point arithmetic.  These options trade off between speed and
6122 correctness.  All must be specifically enabled.
6123
6124 @table @gcctabopt
6125 @item -ffloat-store
6126 @opindex ffloat-store
6127 Do not store floating point variables in registers, and inhibit other
6128 options that might change whether a floating point value is taken from a
6129 register or memory.
6130
6131 @cindex floating point precision
6132 This option prevents undesirable excess precision on machines such as
6133 the 68000 where the floating registers (of the 68881) keep more
6134 precision than a @code{double} is supposed to have.  Similarly for the
6135 x86 architecture.  For most programs, the excess precision does only
6136 good, but a few programs rely on the precise definition of IEEE floating
6137 point.  Use @option{-ffloat-store} for such programs, after modifying
6138 them to store all pertinent intermediate computations into variables.
6139
6140 @item -ffast-math
6141 @opindex ffast-math
6142 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations}, @*
6143 @option{-fno-trapping-math}, @option{-ffinite-math-only},
6144 @option{-fno-rounding-math}, @option{-fno-signaling-nans},
6145 @option{-fno-signed-zeros} and @option{fcx-limited-range}.
6146
6147 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
6148
6149 This option is not turned on by any @option{-O} option since
6150 it can result in incorrect output for programs which depend on
6151 an exact implementation of IEEE or ISO rules/specifications for
6152 math functions. It may, however, yield faster code for programs
6153 that do not require the guarantees of these specifications.
6154
6155 @item -fno-math-errno
6156 @opindex fno-math-errno
6157 Do not set ERRNO after calling math functions that are executed
6158 with a single instruction, e.g., sqrt.  A program that relies on
6159 IEEE exceptions for math error handling may want to use this flag
6160 for speed while maintaining IEEE arithmetic compatibility.
6161
6162 This option is not turned on by any @option{-O} option since
6163 it can result in incorrect output for programs which depend on
6164 an exact implementation of IEEE or ISO rules/specifications for
6165 math functions. It may, however, yield faster code for programs
6166 that do not require the guarantees of these specifications.
6167
6168 The default is @option{-fmath-errno}.
6169
6170 On Darwin systems, the math library never sets @code{errno}.  There is
6171 therefore no reason for the compiler to consider the possibility that
6172 it might, and @option{-fno-math-errno} is the default.
6173
6174 @item -funsafe-math-optimizations
6175 @opindex funsafe-math-optimizations
6176 Allow optimizations for floating-point arithmetic that (a) assume
6177 that arguments and results are valid and (b) may violate IEEE or
6178 ANSI standards.  When used at link-time, it may include libraries
6179 or startup files that change the default FPU control word or other
6180 similar optimizations.
6181
6182 This option is not turned on by any @option{-O} option since
6183 it can result in incorrect output for programs which depend on
6184 an exact implementation of IEEE or ISO rules/specifications for
6185 math functions. It may, however, yield faster code for programs
6186 that do not require the guarantees of these specifications.
6187
6188 The default is @option{-fno-unsafe-math-optimizations}.
6189
6190 @item -ffinite-math-only
6191 @opindex ffinite-math-only
6192 Allow optimizations for floating-point arithmetic that assume
6193 that arguments and results are not NaNs or +-Infs.
6194
6195 This option is not turned on by any @option{-O} option since
6196 it can result in incorrect output for programs which depend on
6197 an exact implementation of IEEE or ISO rules/specifications for
6198 math functions. It may, however, yield faster code for programs
6199 that do not require the guarantees of these specifications.
6200
6201 The default is @option{-fno-finite-math-only}.
6202
6203 @item -fno-signed-zeros
6204 @opindex fno-signed-zeros
6205 Allow optimizations for floating point arithmetic that ignore the
6206 signedness of zero.  IEEE arithmetic specifies the behavior of
6207 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
6208 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
6209 This option implies that the sign of a zero result isn't significant.
6210
6211 The default is @option{-fsigned-zeros}.
6212
6213 @item -fno-trapping-math
6214 @opindex fno-trapping-math
6215 Compile code assuming that floating-point operations cannot generate
6216 user-visible traps.  These traps include division by zero, overflow,
6217 underflow, inexact result and invalid operation.  This option implies
6218 @option{-fno-signaling-nans}.  Setting this option may allow faster
6219 code if one relies on ``non-stop'' IEEE arithmetic, for example.
6220
6221 This option should never be turned on by any @option{-O} option since
6222 it can result in incorrect output for programs which depend on
6223 an exact implementation of IEEE or ISO rules/specifications for
6224 math functions.
6225
6226 The default is @option{-ftrapping-math}.
6227
6228 @item -frounding-math
6229 @opindex frounding-math
6230 Disable transformations and optimizations that assume default floating
6231 point rounding behavior.  This is round-to-zero for all floating point
6232 to integer conversions, and round-to-nearest for all other arithmetic
6233 truncations.  This option should be specified for programs that change
6234 the FP rounding mode dynamically, or that may be executed with a
6235 non-default rounding mode.  This option disables constant folding of
6236 floating point expressions at compile-time (which may be affected by
6237 rounding mode) and arithmetic transformations that are unsafe in the
6238 presence of sign-dependent rounding modes.
6239
6240 The default is @option{-fno-rounding-math}.
6241
6242 This option is experimental and does not currently guarantee to
6243 disable all GCC optimizations that are affected by rounding mode.
6244 Future versions of GCC may provide finer control of this setting
6245 using C99's @code{FENV_ACCESS} pragma.  This command line option
6246 will be used to specify the default state for @code{FENV_ACCESS}.
6247
6248 @item -frtl-abstract-sequences
6249 @opindex frtl-abstract-sequences
6250 It is a size optimization method. This option is to find identical
6251 sequences of code, which can be turned into pseudo-procedures  and
6252 then  replace  all  occurrences with  calls to  the  newly created
6253 subroutine. It is kind of an opposite of @option{-finline-functions}.
6254 This optimization runs at RTL level.
6255
6256 @item -fsignaling-nans
6257 @opindex fsignaling-nans
6258 Compile code assuming that IEEE signaling NaNs may generate user-visible
6259 traps during floating-point operations.  Setting this option disables
6260 optimizations that may change the number of exceptions visible with
6261 signaling NaNs.  This option implies @option{-ftrapping-math}.
6262
6263 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
6264 be defined.
6265
6266 The default is @option{-fno-signaling-nans}.
6267
6268 This option is experimental and does not currently guarantee to
6269 disable all GCC optimizations that affect signaling NaN behavior.
6270
6271 @item -fsingle-precision-constant
6272 @opindex fsingle-precision-constant
6273 Treat floating point constant as single precision constant instead of
6274 implicitly converting it to double precision constant.
6275
6276 @item -fcx-limited-range
6277 @itemx -fno-cx-limited-range
6278 @opindex fcx-limited-range
6279 @opindex fno-cx-limited-range
6280 When enabled, this option states that a range reduction step is not
6281 needed when performing complex division.  The default is
6282 @option{-fno-cx-limited-range}, but is enabled by @option{-ffast-math}.
6283
6284 This option controls the default setting of the ISO C99
6285 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
6286 all languages.
6287
6288 @end table
6289
6290 The following options control optimizations that may improve
6291 performance, but are not enabled by any @option{-O} options.  This
6292 section includes experimental options that may produce broken code.
6293
6294 @table @gcctabopt
6295 @item -fbranch-probabilities
6296 @opindex fbranch-probabilities
6297 After running a program compiled with @option{-fprofile-arcs}
6298 (@pxref{Debugging Options,, Options for Debugging Your Program or
6299 @command{gcc}}), you can compile it a second time using
6300 @option{-fbranch-probabilities}, to improve optimizations based on
6301 the number of times each branch was taken.  When the program
6302 compiled with @option{-fprofile-arcs} exits it saves arc execution
6303 counts to a file called @file{@var{sourcename}.gcda} for each source
6304 file.  The information in this data file is very dependent on the
6305 structure of the generated code, so you must use the same source code
6306 and the same optimization options for both compilations.
6307
6308 With @option{-fbranch-probabilities}, GCC puts a
6309 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
6310 These can be used to improve optimization.  Currently, they are only
6311 used in one place: in @file{reorg.c}, instead of guessing which path a
6312 branch is mostly to take, the @samp{REG_BR_PROB} values are used to
6313 exactly determine which path is taken more often.
6314
6315 @item -fprofile-values
6316 @opindex fprofile-values
6317 If combined with @option{-fprofile-arcs}, it adds code so that some
6318 data about values of expressions in the program is gathered.
6319
6320 With @option{-fbranch-probabilities}, it reads back the data gathered
6321 from profiling values of expressions and adds @samp{REG_VALUE_PROFILE}
6322 notes to instructions for their later usage in optimizations.
6323
6324 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
6325
6326 @item -fvpt
6327 @opindex fvpt
6328 If combined with @option{-fprofile-arcs}, it instructs the compiler to add
6329 a code to gather information about values of expressions.
6330
6331 With @option{-fbranch-probabilities}, it reads back the data gathered
6332 and actually performs the optimizations based on them.
6333 Currently the optimizations include specialization of division operation
6334 using the knowledge about the value of the denominator.
6335
6336 @item -frename-registers
6337 @opindex frename-registers
6338 Attempt to avoid false dependencies in scheduled code by making use
6339 of registers left over after register allocation.  This optimization
6340 will most benefit processors with lots of registers.  Depending on the
6341 debug information format adopted by the target, however, it can
6342 make debugging impossible, since variables will no longer stay in
6343 a ``home register''.
6344
6345 Enabled by default with @option{-funroll-loops}.
6346
6347 @item -ftracer
6348 @opindex ftracer
6349 Perform tail duplication to enlarge superblock size.  This transformation
6350 simplifies the control flow of the function allowing other optimizations to do
6351 better job.
6352
6353 Enabled with @option{-fprofile-use}.
6354
6355 @item -funroll-loops
6356 @opindex funroll-loops
6357 Unroll loops whose number of iterations can be determined at compile time or
6358 upon entry to the loop.  @option{-funroll-loops} implies
6359 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
6360 It also turns on complete loop peeling (i.e.@: complete removal of loops with
6361 small constant number of iterations).  This option makes code larger, and may
6362 or may not make it run faster.
6363
6364 Enabled with @option{-fprofile-use}.
6365
6366 @item -funroll-all-loops
6367 @opindex funroll-all-loops
6368 Unroll all loops, even if their number of iterations is uncertain when
6369 the loop is entered.  This usually makes programs run more slowly.
6370 @option{-funroll-all-loops} implies the same options as
6371 @option{-funroll-loops}.
6372
6373 @item -fpeel-loops
6374 @opindex fpeel-loops
6375 Peels the loops for that there is enough information that they do not
6376 roll much (from profile feedback).  It also turns on complete loop peeling
6377 (i.e.@: complete removal of loops with small constant number of iterations).
6378
6379 Enabled with @option{-fprofile-use}.
6380
6381 @item -fmove-loop-invariants
6382 @opindex fmove-loop-invariants
6383 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
6384 at level @option{-O1}
6385
6386 @item -funswitch-loops
6387 @opindex funswitch-loops
6388 Move branches with loop invariant conditions out of the loop, with duplicates
6389 of the loop on both branches (modified according to result of the condition).
6390
6391 @item -ffunction-sections
6392 @itemx -fdata-sections
6393 @opindex ffunction-sections
6394 @opindex fdata-sections
6395 Place each function or data item into its own section in the output
6396 file if the target supports arbitrary sections.  The name of the
6397 function or the name of the data item determines the section's name
6398 in the output file.
6399
6400 Use these options on systems where the linker can perform optimizations
6401 to improve locality of reference in the instruction space.  Most systems
6402 using the ELF object format and SPARC processors running Solaris 2 have
6403 linkers with such optimizations.  AIX may have these optimizations in
6404 the future.
6405
6406 Only use these options when there are significant benefits from doing
6407 so.  When you specify these options, the assembler and linker will
6408 create larger object and executable files and will also be slower.
6409 You will not be able to use @code{gprof} on all systems if you
6410 specify this option and you may have problems with debugging if
6411 you specify both this option and @option{-g}.
6412
6413 @item -fbranch-target-load-optimize
6414 @opindex fbranch-target-load-optimize
6415 Perform branch target register load optimization before prologue / epilogue
6416 threading.
6417 The use of target registers can typically be exposed only during reload,
6418 thus hoisting loads out of loops and doing inter-block scheduling needs
6419 a separate optimization pass.
6420
6421 @item -fbranch-target-load-optimize2
6422 @opindex fbranch-target-load-optimize2
6423 Perform branch target register load optimization after prologue / epilogue
6424 threading.
6425
6426 @item -fbtr-bb-exclusive
6427 @opindex fbtr-bb-exclusive
6428 When performing branch target register load optimization, don't reuse
6429 branch target registers in within any basic block.
6430
6431 @item -fstack-protector
6432 Emit extra code to check for buffer overflows, such as stack smashing
6433 attacks.  This is done by adding a guard variable to functions with
6434 vulnerable objects.  This includes functions that call alloca, and
6435 functions with buffers larger than 8 bytes.  The guards are initialized
6436 when a function is entered and then checked when the function exits.
6437 If a guard check fails, an error message is printed and the program exits.
6438
6439 @item -fstack-protector-all
6440 Like @option{-fstack-protector} except that all functions are protected.
6441
6442 @item -fsection-anchors
6443 @opindex fsection-anchors
6444 Try to reduce the number of symbolic address calculations by using
6445 shared ``anchor'' symbols to address nearby objects.  This transformation
6446 can help to reduce the number of GOT entries and GOT accesses on some
6447 targets.
6448
6449 For example, the implementation of the following function @code{foo}:
6450
6451 @smallexample
6452 static int a, b, c;
6453 int foo (void) @{ return a + b + c; @}
6454 @end smallexample
6455
6456 would usually calculate the addresses of all three variables, but if you
6457 compile it with @option{-fsection-anchors}, it will access the variables
6458 from a common anchor point instead.  The effect is similar to the
6459 following pseudocode (which isn't valid C):
6460
6461 @smallexample
6462 int foo (void)
6463 @{
6464   register int *xr = &x;
6465   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
6466 @}
6467 @end smallexample
6468
6469 Not all targets support this option.
6470
6471 @item --param @var{name}=@var{value}
6472 @opindex param
6473 In some places, GCC uses various constants to control the amount of
6474 optimization that is done.  For example, GCC will not inline functions
6475 that contain more that a certain number of instructions.  You can
6476 control some of these constants on the command-line using the
6477 @option{--param} option.
6478
6479 The names of specific parameters, and the meaning of the values, are
6480 tied to the internals of the compiler, and are subject to change
6481 without notice in future releases.
6482
6483 In each case, the @var{value} is an integer.  The allowable choices for
6484 @var{name} are given in the following table:
6485
6486 @table @gcctabopt
6487 @item salias-max-implicit-fields
6488 The maximum number of fields in a variable without direct
6489 structure accesses for which structure aliasing will consider trying
6490 to track each field.  The default is 5
6491
6492 @item salias-max-array-elements
6493 The maximum number of elements an array can have and its elements
6494 still be tracked individually by structure aliasing. The default is 4
6495
6496 @item sra-max-structure-size
6497 The maximum structure size, in bytes, at which the scalar replacement
6498 of aggregates (SRA) optimization will perform block copies.  The
6499 default value, 0, implies that GCC will select the most appropriate
6500 size itself.
6501
6502 @item sra-field-structure-ratio
6503 The threshold ratio (as a percentage) between instantiated fields and
6504 the complete structure size.  We say that if the ratio of the number
6505 of bytes in instantiated fields to the number of bytes in the complete
6506 structure exceeds this parameter, then block copies are not used.  The
6507 default is 75.
6508
6509 @item max-crossjump-edges
6510 The maximum number of incoming edges to consider for crossjumping.
6511 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
6512 the number of edges incoming to each block.  Increasing values mean
6513 more aggressive optimization, making the compile time increase with
6514 probably small improvement in executable size.
6515
6516 @item min-crossjump-insns
6517 The minimum number of instructions which must be matched at the end
6518 of two blocks before crossjumping will be performed on them.  This
6519 value is ignored in the case where all instructions in the block being
6520 crossjumped from are matched.  The default value is 5.
6521
6522 @item max-grow-copy-bb-insns
6523 The maximum code size expansion factor when copying basic blocks
6524 instead of jumping.  The expansion is relative to a jump instruction.
6525 The default value is 8.
6526
6527 @item max-goto-duplication-insns
6528 The maximum number of instructions to duplicate to a block that jumps
6529 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
6530 passes, GCC factors computed gotos early in the compilation process,
6531 and unfactors them as late as possible.  Only computed jumps at the
6532 end of a basic blocks with no more than max-goto-duplication-insns are
6533 unfactored.  The default value is 8.
6534
6535 @item max-delay-slot-insn-search
6536 The maximum number of instructions to consider when looking for an
6537 instruction to fill a delay slot.  If more than this arbitrary number of
6538 instructions is searched, the time savings from filling the delay slot
6539 will be minimal so stop searching.  Increasing values mean more
6540 aggressive optimization, making the compile time increase with probably
6541 small improvement in executable run time.
6542
6543 @item max-delay-slot-live-search
6544 When trying to fill delay slots, the maximum number of instructions to
6545 consider when searching for a block with valid live register
6546 information.  Increasing this arbitrarily chosen value means more
6547 aggressive optimization, increasing the compile time.  This parameter
6548 should be removed when the delay slot code is rewritten to maintain the
6549 control-flow graph.
6550
6551 @item max-gcse-memory
6552 The approximate maximum amount of memory that will be allocated in
6553 order to perform the global common subexpression elimination
6554 optimization.  If more memory than specified is required, the
6555 optimization will not be done.
6556
6557 @item max-gcse-passes
6558 The maximum number of passes of GCSE to run.  The default is 1.
6559
6560 @item max-pending-list-length
6561 The maximum number of pending dependencies scheduling will allow
6562 before flushing the current state and starting over.  Large functions
6563 with few branches or calls can create excessively large lists which
6564 needlessly consume memory and resources.
6565
6566 @item max-inline-insns-single
6567 Several parameters control the tree inliner used in gcc.
6568 This number sets the maximum number of instructions (counted in GCC's
6569 internal representation) in a single function that the tree inliner
6570 will consider for inlining.  This only affects functions declared
6571 inline and methods implemented in a class declaration (C++).
6572 The default value is 450.
6573
6574 @item max-inline-insns-auto
6575 When you use @option{-finline-functions} (included in @option{-O3}),
6576 a lot of functions that would otherwise not be considered for inlining
6577 by the compiler will be investigated.  To those functions, a different
6578 (more restrictive) limit compared to functions declared inline can
6579 be applied.
6580 The default value is 90.
6581
6582 @item large-function-insns
6583 The limit specifying really large functions.  For functions larger than this
6584 limit after inlining inlining is constrained by
6585 @option{--param large-function-growth}.  This parameter is useful primarily
6586 to avoid extreme compilation time caused by non-linear algorithms used by the
6587 backend.
6588 This parameter is ignored when @option{-funit-at-a-time} is not used.
6589 The default value is 2700.
6590
6591 @item large-function-growth
6592 Specifies maximal growth of large function caused by inlining in percents.
6593 This parameter is ignored when @option{-funit-at-a-time} is not used.
6594 The default value is 100 which limits large function growth to 2.0 times
6595 the original size.
6596
6597 @item large-unit-insns
6598 The limit specifying large translation unit.  Growth caused by inlining of
6599 units larger than this limit is limited by @option{--param inline-unit-growth}.
6600 For small units this might be too tight (consider unit consisting of function A
6601 that is inline and B that just calls A three time.  If B is small relative to
6602 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
6603 large units consisting of small inlininable functions however the overall unit
6604 growth limit is needed to avoid exponential explosion of code size.  Thus for
6605 smaller units, the size is increased to @option{--param large-unit-insns}
6606 before applying @option{--param inline-unit-growth}.  The default is 10000
6607
6608 @item inline-unit-growth
6609 Specifies maximal overall growth of the compilation unit caused by inlining.
6610 This parameter is ignored when @option{-funit-at-a-time} is not used.
6611 The default value is 30 which limits unit growth to 1.3 times the original
6612 size.
6613
6614 @item large-stack-frame
6615 The limit specifying large stack frames.  While inlining the algorithm is trying
6616 to not grow past this limit too much.  Default value is 256 bytes.
6617
6618 @item large-stack-frame-growth
6619 Specifies maximal growth of large stack frames caused by inlining in percents.
6620 The default value is 1000 which limits large stack frame growth to 11 times
6621 the original size.
6622
6623 @item max-inline-insns-recursive
6624 @itemx max-inline-insns-recursive-auto
6625 Specifies maximum number of instructions out-of-line copy of self recursive inline
6626 function can grow into by performing recursive inlining.
6627
6628 For functions declared inline @option{--param max-inline-insns-recursive} is
6629 taken into account.  For function not declared inline, recursive inlining
6630 happens only when @option{-finline-functions} (included in @option{-O3}) is
6631 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
6632 default value is 450.
6633
6634 @item max-inline-recursive-depth
6635 @itemx max-inline-recursive-depth-auto
6636 Specifies maximum recursion depth used by the recursive inlining.
6637
6638 For functions declared inline @option{--param max-inline-recursive-depth} is
6639 taken into account.  For function not declared inline, recursive inlining
6640 happens only when @option{-finline-functions} (included in @option{-O3}) is
6641 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
6642 default value is 450.
6643
6644 @item min-inline-recursive-probability
6645 Recursive inlining is profitable only for function having deep recursion
6646 in average and can hurt for function having little recursion depth by
6647 increasing the prologue size or complexity of function body to other
6648 optimizers.
6649
6650 When profile feedback is available (see @option{-fprofile-generate}) the actual
6651 recursion depth can be guessed from probability that function will recurse via
6652 given call expression.  This parameter limits inlining only to call expression
6653 whose probability exceeds given threshold (in percents).  The default value is
6654 10.
6655
6656 @item inline-call-cost
6657 Specify cost of call instruction relative to simple arithmetics operations
6658 (having cost of 1).  Increasing this cost disqualifies inlining of non-leaf
6659 functions and at the same time increases size of leaf function that is believed to
6660 reduce function size by being inlined.  In effect it increases amount of
6661 inlining for code having large abstraction penalty (many functions that just
6662 pass the arguments to other functions) and decrease inlining for code with low
6663 abstraction penalty.  The default value is 16.
6664
6665 @item min-vect-loop-bound
6666 The minimum number of iterations under which a loop will not get vectorized
6667 when @option{-ftree-vectorize} is used.  The number of iterations after
6668 vectorization needs to be greater than the value specified by this option
6669 to allow vectorization.  The default value is 0.
6670
6671 @item max-unrolled-insns
6672 The maximum number of instructions that a loop should have if that loop
6673 is unrolled, and if the loop is unrolled, it determines how many times
6674 the loop code is unrolled.
6675
6676 @item max-average-unrolled-insns
6677 The maximum number of instructions biased by probabilities of their execution
6678 that a loop should have if that loop is unrolled, and if the loop is unrolled,
6679 it determines how many times the loop code is unrolled.
6680
6681 @item max-unroll-times
6682 The maximum number of unrollings of a single loop.
6683
6684 @item max-peeled-insns
6685 The maximum number of instructions that a loop should have if that loop
6686 is peeled, and if the loop is peeled, it determines how many times
6687 the loop code is peeled.
6688
6689 @item max-peel-times
6690 The maximum number of peelings of a single loop.
6691
6692 @item max-completely-peeled-insns
6693 The maximum number of insns of a completely peeled loop.
6694
6695 @item max-completely-peel-times
6696 The maximum number of iterations of a loop to be suitable for complete peeling.
6697
6698 @item max-unswitch-insns
6699 The maximum number of insns of an unswitched loop.
6700
6701 @item max-unswitch-level
6702 The maximum number of branches unswitched in a single loop.
6703
6704 @item lim-expensive
6705 The minimum cost of an expensive expression in the loop invariant motion.
6706
6707 @item iv-consider-all-candidates-bound
6708 Bound on number of candidates for induction variables below that
6709 all candidates are considered for each use in induction variable
6710 optimizations.  Only the most relevant candidates are considered
6711 if there are more candidates, to avoid quadratic time complexity.
6712
6713 @item iv-max-considered-uses
6714 The induction variable optimizations give up on loops that contain more
6715 induction variable uses.
6716
6717 @item iv-always-prune-cand-set-bound
6718 If number of candidates in the set is smaller than this value,
6719 we always try to remove unnecessary ivs from the set during its
6720 optimization when a new iv is added to the set.
6721
6722 @item scev-max-expr-size
6723 Bound on size of expressions used in the scalar evolutions analyzer.
6724 Large expressions slow the analyzer.
6725
6726 @item omega-max-vars
6727 The maximum number of variables in an Omega constraint system.
6728 The default value is 128.
6729
6730 @item omega-max-geqs
6731 The maximum number of inequalities in an Omega constraint system.
6732 The default value is 256.
6733
6734 @item omega-max-eqs
6735 The maximum number of equalities in an Omega constraint system.
6736 The default value is 128.
6737
6738 @item omega-max-wild-cards
6739 The maximum number of wildcard variables that the Omega solver will
6740 be able to insert.  The default value is 18.
6741
6742 @item omega-hash-table-size
6743 The size of the hash table in the Omega solver.  The default value is
6744 550.
6745
6746 @item omega-max-keys
6747 The maximal number of keys used by the Omega solver.  The default
6748 value is 500.
6749
6750 @item omega-eliminate-redundant-constraints
6751 When set to 1, use expensive methods to eliminate all redundant
6752 constraints.  The default value is 0.
6753
6754 @item vect-max-version-for-alignment-checks
6755 The maximum number of runtime checks that can be performed when
6756 doing loop versioning for alignment in the vectorizer.  See option
6757 ftree-vect-loop-version for more information.
6758
6759 @item vect-max-version-for-alias-checks
6760 The maximum number of runtime checks that can be performed when
6761 doing loop versioning for alias in the vectorizer.  See option
6762 ftree-vect-loop-version for more information.
6763
6764 @item max-iterations-to-track
6765
6766 The maximum number of iterations of a loop the brute force algorithm
6767 for analysis of # of iterations of the loop tries to evaluate.
6768
6769 @item hot-bb-count-fraction
6770 Select fraction of the maximal count of repetitions of basic block in program
6771 given basic block needs to have to be considered hot.
6772
6773 @item hot-bb-frequency-fraction
6774 Select fraction of the maximal frequency of executions of basic block in
6775 function given basic block needs to have to be considered hot
6776
6777 @item max-predicted-iterations
6778 The maximum number of loop iterations we predict statically.  This is useful
6779 in cases where function contain single loop with known bound and other loop
6780 with unknown.  We predict the known number of iterations correctly, while
6781 the unknown number of iterations average to roughly 10.  This means that the
6782 loop without bounds would appear artificially cold relative to the other one.
6783
6784 @item tracer-dynamic-coverage
6785 @itemx tracer-dynamic-coverage-feedback
6786
6787 This value is used to limit superblock formation once the given percentage of
6788 executed instructions is covered.  This limits unnecessary code size
6789 expansion.
6790
6791 The @option{tracer-dynamic-coverage-feedback} is used only when profile
6792 feedback is available.  The real profiles (as opposed to statically estimated
6793 ones) are much less balanced allowing the threshold to be larger value.
6794
6795 @item tracer-max-code-growth
6796 Stop tail duplication once code growth has reached given percentage.  This is
6797 rather hokey argument, as most of the duplicates will be eliminated later in
6798 cross jumping, so it may be set to much higher values than is the desired code
6799 growth.
6800
6801 @item tracer-min-branch-ratio
6802
6803 Stop reverse growth when the reverse probability of best edge is less than this
6804 threshold (in percent).
6805
6806 @item tracer-min-branch-ratio
6807 @itemx tracer-min-branch-ratio-feedback
6808
6809 Stop forward growth if the best edge do have probability lower than this
6810 threshold.
6811
6812 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
6813 compilation for profile feedback and one for compilation without.  The value
6814 for compilation with profile feedback needs to be more conservative (higher) in
6815 order to make tracer effective.
6816
6817 @item max-cse-path-length
6818
6819 Maximum number of basic blocks on path that cse considers.  The default is 10.
6820
6821 @item max-cse-insns
6822 The maximum instructions CSE process before flushing. The default is 1000.
6823
6824 @item max-aliased-vops
6825
6826 Maximum number of virtual operands per function allowed to represent
6827 aliases before triggering the alias partitioning heuristic.  Alias
6828 partitioning reduces compile times and memory consumption needed for
6829 aliasing at the expense of precision loss in alias information.  The
6830 default value for this parameter is 100 for -O1, 500 for -O2 and 1000
6831 for -O3.
6832
6833 Notice that if a function contains more memory statements than the
6834 value of this parameter, it is not really possible to achieve this
6835 reduction.  In this case, the compiler will use the number of memory
6836 statements as the value for @option{max-aliased-vops}.
6837
6838 @item avg-aliased-vops
6839
6840 Average number of virtual operands per statement allowed to represent
6841 aliases before triggering the alias partitioning heuristic.  This
6842 works in conjunction with @option{max-aliased-vops}.  If a function
6843 contains more than @option{max-aliased-vops} virtual operators, then
6844 memory symbols will be grouped into memory partitions until either the
6845 total number of virtual operators is below @option{max-aliased-vops}
6846 or the average number of virtual operators per memory statement is
6847 below @option{avg-aliased-vops}.  The default value for this parameter
6848 is 1 for -O1 and -O2, and 3 for -O3.
6849
6850 @item ggc-min-expand
6851
6852 GCC uses a garbage collector to manage its own memory allocation.  This
6853 parameter specifies the minimum percentage by which the garbage
6854 collector's heap should be allowed to expand between collections.
6855 Tuning this may improve compilation speed; it has no effect on code
6856 generation.
6857
6858 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
6859 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of "RAM" is
6860 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
6861 GCC is not able to calculate RAM on a particular platform, the lower
6862 bound of 30% is used.  Setting this parameter and
6863 @option{ggc-min-heapsize} to zero causes a full collection to occur at
6864 every opportunity.  This is extremely slow, but can be useful for
6865 debugging.
6866
6867 @item ggc-min-heapsize
6868
6869 Minimum size of the garbage collector's heap before it begins bothering
6870 to collect garbage.  The first collection occurs after the heap expands
6871 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
6872 tuning this may improve compilation speed, and has no effect on code
6873 generation.
6874
6875 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit which
6876 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
6877 with a lower bound of 4096 (four megabytes) and an upper bound of
6878 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
6879 particular platform, the lower bound is used.  Setting this parameter
6880 very large effectively disables garbage collection.  Setting this
6881 parameter and @option{ggc-min-expand} to zero causes a full collection
6882 to occur at every opportunity.
6883
6884 @item max-reload-search-insns
6885 The maximum number of instruction reload should look backward for equivalent
6886 register.  Increasing values mean more aggressive optimization, making the
6887 compile time increase with probably slightly better performance.  The default
6888 value is 100.
6889
6890 @item max-cselib-memory-locations
6891 The maximum number of memory locations cselib should take into account.
6892 Increasing values mean more aggressive optimization, making the compile time
6893 increase with probably slightly better performance.  The default value is 500.
6894
6895 @item max-flow-memory-locations
6896 Similar as @option{max-cselib-memory-locations} but for dataflow liveness.
6897 The default value is 100.
6898
6899 @item reorder-blocks-duplicate
6900 @itemx reorder-blocks-duplicate-feedback
6901
6902 Used by basic block reordering pass to decide whether to use unconditional
6903 branch or duplicate the code on its destination.  Code is duplicated when its
6904 estimated size is smaller than this value multiplied by the estimated size of
6905 unconditional jump in the hot spots of the program.
6906
6907 The @option{reorder-block-duplicate-feedback} is used only when profile
6908 feedback is available and may be set to higher values than
6909 @option{reorder-block-duplicate} since information about the hot spots is more
6910 accurate.
6911
6912 @item max-sched-ready-insns
6913 The maximum number of instructions ready to be issued the scheduler should
6914 consider at any given time during the first scheduling pass.  Increasing
6915 values mean more thorough searches, making the compilation time increase
6916 with probably little benefit.  The default value is 100.
6917
6918 @item max-sched-region-blocks
6919 The maximum number of blocks in a region to be considered for
6920 interblock scheduling.  The default value is 10.
6921
6922 @item max-sched-region-insns
6923 The maximum number of insns in a region to be considered for
6924 interblock scheduling.  The default value is 100.
6925
6926 @item min-spec-prob
6927 The minimum probability (in percents) of reaching a source block
6928 for interblock speculative scheduling.  The default value is 40.
6929
6930 @item max-sched-extend-regions-iters
6931 The maximum number of iterations through CFG to extend regions.
6932 0 - disable region extension,
6933 N - do at most N iterations.
6934 The default value is 0.
6935
6936 @item max-sched-insn-conflict-delay
6937 The maximum conflict delay for an insn to be considered for speculative motion.
6938 The default value is 3.
6939
6940 @item sched-spec-prob-cutoff
6941 The minimal probability of speculation success (in percents), so that
6942 speculative insn will be scheduled.
6943 The default value is 40.
6944
6945 @item max-last-value-rtl
6946
6947 The maximum size measured as number of RTLs that can be recorded in an expression
6948 in combiner for a pseudo register as last known value of that register.  The default
6949 is 10000.
6950
6951 @item integer-share-limit
6952 Small integer constants can use a shared data structure, reducing the
6953 compiler's memory usage and increasing its speed.  This sets the maximum
6954 value of a shared integer constant's.  The default value is 256.
6955
6956 @item min-virtual-mappings
6957 Specifies the minimum number of virtual mappings in the incremental
6958 SSA updater that should be registered to trigger the virtual mappings
6959 heuristic defined by virtual-mappings-ratio.  The default value is
6960 100.
6961
6962 @item virtual-mappings-ratio
6963 If the number of virtual mappings is virtual-mappings-ratio bigger
6964 than the number of virtual symbols to be updated, then the incremental
6965 SSA updater switches to a full update for those symbols.  The default
6966 ratio is 3.
6967
6968 @item ssp-buffer-size
6969 The minimum size of buffers (i.e. arrays) that will receive stack smashing
6970 protection when @option{-fstack-protection} is used.
6971
6972 @item max-jump-thread-duplication-stmts
6973 Maximum number of statements allowed in a block that needs to be
6974 duplicated when threading jumps.
6975
6976 @item max-fields-for-field-sensitive
6977 Maximum number of fields in a structure we will treat in
6978 a field sensitive manner during pointer analysis.
6979
6980 @item prefetch-latency
6981 Estimate on average number of instructions that are executed before
6982 prefetch finishes.  The distance we prefetch ahead is proportional
6983 to this constant.  Increasing this number may also lead to less
6984 streams being prefetched (see @option{simultaneous-prefetches}).
6985
6986 @item simultaneous-prefetches
6987 Maximum number of prefetches that can run at the same time.
6988
6989 @item l1-cache-line-size
6990 The size of cache line in L1 cache, in bytes.
6991
6992 @item l1-cache-size
6993 The size of L1 cache, in kilobytes.
6994
6995 @item l2-cache-size
6996 The size of L2 cache, in kilobytes.
6997
6998 @item use-canonical-types
6999 Whether the compiler should use the ``canonical'' type system.  By
7000 default, this should always be 1, which uses a more efficient internal
7001 mechanism for comparing types in C++ and Objective-C++.  However, if
7002 bugs in the canonical type system are causing compilation failures,
7003 set this value to 0 to disable canonical types.
7004
7005 @end table
7006 @end table
7007
7008 @node Preprocessor Options
7009 @section Options Controlling the Preprocessor
7010 @cindex preprocessor options
7011 @cindex options, preprocessor
7012
7013 These options control the C preprocessor, which is run on each C source
7014 file before actual compilation.
7015
7016 If you use the @option{-E} option, nothing is done except preprocessing.
7017 Some of these options make sense only together with @option{-E} because
7018 they cause the preprocessor output to be unsuitable for actual
7019 compilation.
7020
7021 @table @gcctabopt
7022 @opindex Wp
7023 You can use @option{-Wp,@var{option}} to bypass the compiler driver
7024 and pass @var{option} directly through to the preprocessor.  If
7025 @var{option} contains commas, it is split into multiple options at the
7026 commas.  However, many options are modified, translated or interpreted
7027 by the compiler driver before being passed to the preprocessor, and
7028 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
7029 interface is undocumented and subject to change, so whenever possible
7030 you should avoid using @option{-Wp} and let the driver handle the
7031 options instead.
7032
7033 @item -Xpreprocessor @var{option}
7034 @opindex preprocessor
7035 Pass @var{option} as an option to the preprocessor.  You can use this to
7036 supply system-specific preprocessor options which GCC does not know how to
7037 recognize.
7038
7039 If you want to pass an option that takes an argument, you must use
7040 @option{-Xpreprocessor} twice, once for the option and once for the argument.
7041 @end table
7042
7043 @include cppopts.texi
7044
7045 @node Assembler Options
7046 @section Passing Options to the Assembler
7047
7048 @c prevent bad page break with this line
7049 You can pass options to the assembler.
7050
7051 @table @gcctabopt
7052 @item -Wa,@var{option}
7053 @opindex Wa
7054 Pass @var{option} as an option to the assembler.  If @var{option}
7055 contains commas, it is split into multiple options at the commas.
7056
7057 @item -Xassembler @var{option}
7058 @opindex Xassembler
7059 Pass @var{option} as an option to the assembler.  You can use this to
7060 supply system-specific assembler options which GCC does not know how to
7061 recognize.
7062
7063 If you want to pass an option that takes an argument, you must use
7064 @option{-Xassembler} twice, once for the option and once for the argument.
7065
7066 @end table
7067
7068 @node Link Options
7069 @section Options for Linking
7070 @cindex link options
7071 @cindex options, linking
7072
7073 These options come into play when the compiler links object files into
7074 an executable output file.  They are meaningless if the compiler is
7075 not doing a link step.
7076
7077 @table @gcctabopt
7078 @cindex file names
7079 @item @var{object-file-name}
7080 A file name that does not end in a special recognized suffix is
7081 considered to name an object file or library.  (Object files are
7082 distinguished from libraries by the linker according to the file
7083 contents.)  If linking is done, these object files are used as input
7084 to the linker.
7085
7086 @item -c
7087 @itemx -S
7088 @itemx -E
7089 @opindex c
7090 @opindex S
7091 @opindex E
7092 If any of these options is used, then the linker is not run, and
7093 object file names should not be used as arguments.  @xref{Overall
7094 Options}.
7095
7096 @cindex Libraries
7097 @item -l@var{library}
7098 @itemx -l @var{library}
7099 @opindex l
7100 Search the library named @var{library} when linking.  (The second
7101 alternative with the library as a separate argument is only for
7102 POSIX compliance and is not recommended.)
7103
7104 It makes a difference where in the command you write this option; the
7105 linker searches and processes libraries and object files in the order they
7106 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
7107 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
7108 to functions in @samp{z}, those functions may not be loaded.
7109
7110 The linker searches a standard list of directories for the library,
7111 which is actually a file named @file{lib@var{library}.a}.  The linker
7112 then uses this file as if it had been specified precisely by name.
7113
7114 The directories searched include several standard system directories
7115 plus any that you specify with @option{-L}.
7116
7117 Normally the files found this way are library files---archive files
7118 whose members are object files.  The linker handles an archive file by
7119 scanning through it for members which define symbols that have so far
7120 been referenced but not defined.  But if the file that is found is an
7121 ordinary object file, it is linked in the usual fashion.  The only
7122 difference between using an @option{-l} option and specifying a file name
7123 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
7124 and searches several directories.
7125
7126 @item -lobjc
7127 @opindex lobjc
7128 You need this special case of the @option{-l} option in order to
7129 link an Objective-C or Objective-C++ program.
7130
7131 @item -nostartfiles
7132 @opindex nostartfiles
7133 Do not use the standard system startup files when linking.
7134 The standard system libraries are used normally, unless @option{-nostdlib}
7135 or @option{-nodefaultlibs} is used.
7136
7137 @item -nodefaultlibs
7138 @opindex nodefaultlibs
7139 Do not use the standard system libraries when linking.
7140 Only the libraries you specify will be passed to the linker.
7141 The standard startup files are used normally, unless @option{-nostartfiles}
7142 is used.  The compiler may generate calls to @code{memcmp},
7143 @code{memset}, @code{memcpy} and @code{memmove}.
7144 These entries are usually resolved by entries in
7145 libc.  These entry points should be supplied through some other
7146 mechanism when this option is specified.
7147
7148 @item -nostdlib
7149 @opindex nostdlib
7150 Do not use the standard system startup files or libraries when linking.
7151 No startup files and only the libraries you specify will be passed to
7152 the linker.  The compiler may generate calls to @code{memcmp}, @code{memset},
7153 @code{memcpy} and @code{memmove}.
7154 These entries are usually resolved by entries in
7155 libc.  These entry points should be supplied through some other
7156 mechanism when this option is specified.
7157
7158 @cindex @option{-lgcc}, use with @option{-nostdlib}
7159 @cindex @option{-nostdlib} and unresolved references
7160 @cindex unresolved references and @option{-nostdlib}
7161 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
7162 @cindex @option{-nodefaultlibs} and unresolved references
7163 @cindex unresolved references and @option{-nodefaultlibs}
7164 One of the standard libraries bypassed by @option{-nostdlib} and
7165 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
7166 that GCC uses to overcome shortcomings of particular machines, or special
7167 needs for some languages.
7168 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
7169 Collection (GCC) Internals},
7170 for more discussion of @file{libgcc.a}.)
7171 In most cases, you need @file{libgcc.a} even when you want to avoid
7172 other standard libraries.  In other words, when you specify @option{-nostdlib}
7173 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
7174 This ensures that you have no unresolved references to internal GCC
7175 library subroutines.  (For example, @samp{__main}, used to ensure C++
7176 constructors will be called; @pxref{Collect2,,@code{collect2}, gccint,
7177 GNU Compiler Collection (GCC) Internals}.)
7178
7179 @item -pie
7180 @opindex pie
7181 Produce a position independent executable on targets which support it.
7182 For predictable results, you must also specify the same set of options
7183 that were used to generate code (@option{-fpie}, @option{-fPIE},
7184 or model suboptions) when you specify this option.
7185
7186 @item -rdynamic
7187 @opindex rdynamic
7188 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
7189 that support it. This instructs the linker to add all symbols, not
7190 only used ones, to the dynamic symbol table. This option is needed
7191 for some uses of @code{dlopen} or to allow obtaining backtraces
7192 from within a program.
7193
7194 @item -s
7195 @opindex s
7196 Remove all symbol table and relocation information from the executable.
7197
7198 @item -static
7199 @opindex static
7200 On systems that support dynamic linking, this prevents linking with the shared
7201 libraries.  On other systems, this option has no effect.
7202
7203 @item -shared
7204 @opindex shared
7205 Produce a shared object which can then be linked with other objects to
7206 form an executable.  Not all systems support this option.  For predictable
7207 results, you must also specify the same set of options that were used to
7208 generate code (@option{-fpic}, @option{-fPIC}, or model suboptions)
7209 when you specify this option.@footnote{On some systems, @samp{gcc -shared}
7210 needs to build supplementary stub code for constructors to work.  On
7211 multi-libbed systems, @samp{gcc -shared} must select the correct support
7212 libraries to link against.  Failing to supply the correct flags may lead
7213 to subtle defects.  Supplying them in cases where they are not necessary
7214 is innocuous.}
7215
7216 @item -shared-libgcc
7217 @itemx -static-libgcc
7218 @opindex shared-libgcc
7219 @opindex static-libgcc
7220 On systems that provide @file{libgcc} as a shared library, these options
7221 force the use of either the shared or static version respectively.
7222 If no shared version of @file{libgcc} was built when the compiler was
7223 configured, these options have no effect.
7224
7225 There are several situations in which an application should use the
7226 shared @file{libgcc} instead of the static version.  The most common
7227 of these is when the application wishes to throw and catch exceptions
7228 across different shared libraries.  In that case, each of the libraries
7229 as well as the application itself should use the shared @file{libgcc}.
7230
7231 Therefore, the G++ and GCJ drivers automatically add
7232 @option{-shared-libgcc} whenever you build a shared library or a main
7233 executable, because C++ and Java programs typically use exceptions, so
7234 this is the right thing to do.
7235
7236 If, instead, you use the GCC driver to create shared libraries, you may
7237 find that they will not always be linked with the shared @file{libgcc}.
7238 If GCC finds, at its configuration time, that you have a non-GNU linker
7239 or a GNU linker that does not support option @option{--eh-frame-hdr},
7240 it will link the shared version of @file{libgcc} into shared libraries
7241 by default.  Otherwise, it will take advantage of the linker and optimize
7242 away the linking with the shared version of @file{libgcc}, linking with
7243 the static version of libgcc by default.  This allows exceptions to
7244 propagate through such shared libraries, without incurring relocation
7245 costs at library load time.
7246
7247 However, if a library or main executable is supposed to throw or catch
7248 exceptions, you must link it using the G++ or GCJ driver, as appropriate
7249 for the languages used in the program, or using the option
7250 @option{-shared-libgcc}, such that it is linked with the shared
7251 @file{libgcc}.
7252
7253 @item -symbolic
7254 @opindex symbolic
7255 Bind references to global symbols when building a shared object.  Warn
7256 about any unresolved references (unless overridden by the link editor
7257 option @samp{-Xlinker -z -Xlinker defs}).  Only a few systems support
7258 this option.
7259
7260 @item -Xlinker @var{option}
7261 @opindex Xlinker
7262 Pass @var{option} as an option to the linker.  You can use this to
7263 supply system-specific linker options which GCC does not know how to
7264 recognize.
7265
7266 If you want to pass an option that takes an argument, you must use
7267 @option{-Xlinker} twice, once for the option and once for the argument.
7268 For example, to pass @option{-assert definitions}, you must write
7269 @samp{-Xlinker -assert -Xlinker definitions}.  It does not work to write
7270 @option{-Xlinker "-assert definitions"}, because this passes the entire
7271 string as a single argument, which is not what the linker expects.
7272
7273 @item -Wl,@var{option}
7274 @opindex Wl
7275 Pass @var{option} as an option to the linker.  If @var{option} contains
7276 commas, it is split into multiple options at the commas.
7277
7278 @item -u @var{symbol}
7279 @opindex u
7280 Pretend the symbol @var{symbol} is undefined, to force linking of
7281 library modules to define it.  You can use @option{-u} multiple times with
7282 different symbols to force loading of additional library modules.
7283 @end table
7284
7285 @node Directory Options
7286 @section Options for Directory Search
7287 @cindex directory options
7288 @cindex options, directory search
7289 @cindex search path
7290
7291 These options specify directories to search for header files, for
7292 libraries and for parts of the compiler:
7293
7294 @table @gcctabopt
7295 @item -I@var{dir}
7296 @opindex I
7297 Add the directory @var{dir} to the head of the list of directories to be
7298 searched for header files.  This can be used to override a system header
7299 file, substituting your own version, since these directories are
7300 searched before the system header file directories.  However, you should
7301 not use this option to add directories that contain vendor-supplied
7302 system header files (use @option{-isystem} for that).  If you use more than
7303 one @option{-I} option, the directories are scanned in left-to-right
7304 order; the standard system directories come after.
7305
7306 If a standard system include directory, or a directory specified with
7307 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
7308 option will be ignored.  The directory will still be searched but as a
7309 system directory at its normal position in the system include chain.
7310 This is to ensure that GCC's procedure to fix buggy system headers and
7311 the ordering for the include_next directive are not inadvertently changed.
7312 If you really need to change the search order for system directories,
7313 use the @option{-nostdinc} and/or @option{-isystem} options.
7314
7315 @item -iquote@var{dir}
7316 @opindex iquote
7317 Add the directory @var{dir} to the head of the list of directories to
7318 be searched for header files only for the case of @samp{#include
7319 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
7320 otherwise just like @option{-I}.
7321
7322 @item -L@var{dir}
7323 @opindex L
7324 Add directory @var{dir} to the list of directories to be searched
7325 for @option{-l}.
7326
7327 @item -B@var{prefix}
7328 @opindex B
7329 This option specifies where to find the executables, libraries,
7330 include files, and data files of the compiler itself.
7331
7332 The compiler driver program runs one or more of the subprograms
7333 @file{cpp}, @file{cc1}, @file{as} and @file{ld}.  It tries
7334 @var{prefix} as a prefix for each program it tries to run, both with and
7335 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
7336
7337 For each subprogram to be run, the compiler driver first tries the
7338 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
7339 was not specified, the driver tries two standard prefixes, which are
7340 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
7341 those results in a file name that is found, the unmodified program
7342 name is searched for using the directories specified in your
7343 @env{PATH} environment variable.
7344
7345 The compiler will check to see if the path provided by the @option{-B}
7346 refers to a directory, and if necessary it will add a directory
7347 separator character at the end of the path.
7348
7349 @option{-B} prefixes that effectively specify directory names also apply
7350 to libraries in the linker, because the compiler translates these
7351 options into @option{-L} options for the linker.  They also apply to
7352 includes files in the preprocessor, because the compiler translates these
7353 options into @option{-isystem} options for the preprocessor.  In this case,
7354 the compiler appends @samp{include} to the prefix.
7355
7356 The run-time support file @file{libgcc.a} can also be searched for using
7357 the @option{-B} prefix, if needed.  If it is not found there, the two
7358 standard prefixes above are tried, and that is all.  The file is left
7359 out of the link if it is not found by those means.
7360
7361 Another way to specify a prefix much like the @option{-B} prefix is to use
7362 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
7363 Variables}.
7364
7365 As a special kludge, if the path provided by @option{-B} is
7366 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
7367 9, then it will be replaced by @file{[dir/]include}.  This is to help
7368 with boot-strapping the compiler.
7369
7370 @item -specs=@var{file}
7371 @opindex specs
7372 Process @var{file} after the compiler reads in the standard @file{specs}
7373 file, in order to override the defaults that the @file{gcc} driver
7374 program uses when determining what switches to pass to @file{cc1},
7375 @file{cc1plus}, @file{as}, @file{ld}, etc.  More than one
7376 @option{-specs=@var{file}} can be specified on the command line, and they
7377 are processed in order, from left to right.
7378
7379 @item --sysroot=@var{dir}
7380 @opindex sysroot
7381 Use @var{dir} as the logical root directory for headers and libraries.
7382 For example, if the compiler would normally search for headers in
7383 @file{/usr/include} and libraries in @file{/usr/lib}, it will instead
7384 search @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
7385
7386 If you use both this option and the @option{-isysroot} option, then
7387 the @option{--sysroot} option will apply to libraries, but the
7388 @option{-isysroot} option will apply to header files.
7389
7390 The GNU linker (beginning with version 2.16) has the necessary support
7391 for this option.  If your linker does not support this option, the
7392 header file aspect of @option{--sysroot} will still work, but the
7393 library aspect will not.
7394
7395 @item -I-
7396 @opindex I-
7397 This option has been deprecated.  Please use @option{-iquote} instead for
7398 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
7399 Any directories you specify with @option{-I} options before the @option{-I-}
7400 option are searched only for the case of @samp{#include "@var{file}"};
7401 they are not searched for @samp{#include <@var{file}>}.
7402
7403 If additional directories are specified with @option{-I} options after
7404 the @option{-I-}, these directories are searched for all @samp{#include}
7405 directives.  (Ordinarily @emph{all} @option{-I} directories are used
7406 this way.)
7407
7408 In addition, the @option{-I-} option inhibits the use of the current
7409 directory (where the current input file came from) as the first search
7410 directory for @samp{#include "@var{file}"}.  There is no way to
7411 override this effect of @option{-I-}.  With @option{-I.} you can specify
7412 searching the directory which was current when the compiler was
7413 invoked.  That is not exactly the same as what the preprocessor does
7414 by default, but it is often satisfactory.
7415
7416 @option{-I-} does not inhibit the use of the standard system directories
7417 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
7418 independent.
7419 @end table
7420
7421 @c man end
7422
7423 @node Spec Files
7424 @section Specifying subprocesses and the switches to pass to them
7425 @cindex Spec Files
7426
7427 @command{gcc} is a driver program.  It performs its job by invoking a
7428 sequence of other programs to do the work of compiling, assembling and
7429 linking.  GCC interprets its command-line parameters and uses these to
7430 deduce which programs it should invoke, and which command-line options
7431 it ought to place on their command lines.  This behavior is controlled
7432 by @dfn{spec strings}.  In most cases there is one spec string for each
7433 program that GCC can invoke, but a few programs have multiple spec
7434 strings to control their behavior.  The spec strings built into GCC can
7435 be overridden by using the @option{-specs=} command-line switch to specify
7436 a spec file.
7437
7438 @dfn{Spec files} are plaintext files that are used to construct spec
7439 strings.  They consist of a sequence of directives separated by blank
7440 lines.  The type of directive is determined by the first non-whitespace
7441 character on the line and it can be one of the following:
7442
7443 @table @code
7444 @item %@var{command}
7445 Issues a @var{command} to the spec file processor.  The commands that can
7446 appear here are:
7447
7448 @table @code
7449 @item %include <@var{file}>
7450 @cindex %include
7451 Search for @var{file} and insert its text at the current point in the
7452 specs file.
7453
7454 @item %include_noerr <@var{file}>
7455 @cindex %include_noerr
7456 Just like @samp{%include}, but do not generate an error message if the include
7457 file cannot be found.
7458
7459 @item %rename @var{old_name} @var{new_name}
7460 @cindex %rename
7461 Rename the spec string @var{old_name} to @var{new_name}.
7462
7463 @end table
7464
7465 @item *[@var{spec_name}]:
7466 This tells the compiler to create, override or delete the named spec
7467 string.  All lines after this directive up to the next directive or
7468 blank line are considered to be the text for the spec string.  If this
7469 results in an empty string then the spec will be deleted.  (Or, if the
7470 spec did not exist, then nothing will happened.)  Otherwise, if the spec
7471 does not currently exist a new spec will be created.  If the spec does
7472 exist then its contents will be overridden by the text of this
7473 directive, unless the first character of that text is the @samp{+}
7474 character, in which case the text will be appended to the spec.
7475
7476 @item [@var{suffix}]:
7477 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
7478 and up to the next directive or blank line are considered to make up the
7479 spec string for the indicated suffix.  When the compiler encounters an
7480 input file with the named suffix, it will processes the spec string in
7481 order to work out how to compile that file.  For example:
7482
7483 @smallexample
7484 .ZZ:
7485 z-compile -input %i
7486 @end smallexample
7487
7488 This says that any input file whose name ends in @samp{.ZZ} should be
7489 passed to the program @samp{z-compile}, which should be invoked with the
7490 command-line switch @option{-input} and with the result of performing the
7491 @samp{%i} substitution.  (See below.)
7492
7493 As an alternative to providing a spec string, the text that follows a
7494 suffix directive can be one of the following:
7495
7496 @table @code
7497 @item @@@var{language}
7498 This says that the suffix is an alias for a known @var{language}.  This is
7499 similar to using the @option{-x} command-line switch to GCC to specify a
7500 language explicitly.  For example:
7501
7502 @smallexample
7503 .ZZ:
7504 @@c++
7505 @end smallexample
7506
7507 Says that .ZZ files are, in fact, C++ source files.
7508
7509 @item #@var{name}
7510 This causes an error messages saying:
7511
7512 @smallexample
7513 @var{name} compiler not installed on this system.
7514 @end smallexample
7515 @end table
7516
7517 GCC already has an extensive list of suffixes built into it.
7518 This directive will add an entry to the end of the list of suffixes, but
7519 since the list is searched from the end backwards, it is effectively
7520 possible to override earlier entries using this technique.
7521
7522 @end table
7523
7524 GCC has the following spec strings built into it.  Spec files can
7525 override these strings or create their own.  Note that individual
7526 targets can also add their own spec strings to this list.
7527
7528 @smallexample
7529 asm          Options to pass to the assembler
7530 asm_final    Options to pass to the assembler post-processor
7531 cpp          Options to pass to the C preprocessor
7532 cc1          Options to pass to the C compiler
7533 cc1plus      Options to pass to the C++ compiler
7534 endfile      Object files to include at the end of the link
7535 link         Options to pass to the linker
7536 lib          Libraries to include on the command line to the linker
7537 libgcc       Decides which GCC support library to pass to the linker
7538 linker       Sets the name of the linker
7539 predefines   Defines to be passed to the C preprocessor
7540 signed_char  Defines to pass to CPP to say whether @code{char} is signed
7541              by default
7542 startfile    Object files to include at the start of the link
7543 @end smallexample
7544
7545 Here is a small example of a spec file:
7546
7547 @smallexample
7548 %rename lib                 old_lib
7549
7550 *lib:
7551 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
7552 @end smallexample
7553
7554 This example renames the spec called @samp{lib} to @samp{old_lib} and
7555 then overrides the previous definition of @samp{lib} with a new one.
7556 The new definition adds in some extra command-line options before
7557 including the text of the old definition.
7558
7559 @dfn{Spec strings} are a list of command-line options to be passed to their
7560 corresponding program.  In addition, the spec strings can contain
7561 @samp{%}-prefixed sequences to substitute variable text or to
7562 conditionally insert text into the command line.  Using these constructs
7563 it is possible to generate quite complex command lines.
7564
7565 Here is a table of all defined @samp{%}-sequences for spec
7566 strings.  Note that spaces are not generated automatically around the
7567 results of expanding these sequences.  Therefore you can concatenate them
7568 together or combine them with constant text in a single argument.
7569
7570 @table @code
7571 @item %%
7572 Substitute one @samp{%} into the program name or argument.
7573
7574 @item %i
7575 Substitute the name of the input file being processed.
7576
7577 @item %b
7578 Substitute the basename of the input file being processed.
7579 This is the substring up to (and not including) the last period
7580 and not including the directory.
7581
7582 @item %B
7583 This is the same as @samp{%b}, but include the file suffix (text after
7584 the last period).
7585
7586 @item %d
7587 Marks the argument containing or following the @samp{%d} as a
7588 temporary file name, so that that file will be deleted if GCC exits
7589 successfully.  Unlike @samp{%g}, this contributes no text to the
7590 argument.
7591
7592 @item %g@var{suffix}
7593 Substitute a file name that has suffix @var{suffix} and is chosen
7594 once per compilation, and mark the argument in the same way as
7595 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
7596 name is now chosen in a way that is hard to predict even when previously
7597 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
7598 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
7599 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
7600 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
7601 was simply substituted with a file name chosen once per compilation,
7602 without regard to any appended suffix (which was therefore treated
7603 just like ordinary text), making such attacks more likely to succeed.
7604
7605 @item %u@var{suffix}
7606 Like @samp{%g}, but generates a new temporary file name even if
7607 @samp{%u@var{suffix}} was already seen.
7608
7609 @item %U@var{suffix}
7610 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
7611 new one if there is no such last file name.  In the absence of any
7612 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
7613 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
7614 would involve the generation of two distinct file names, one
7615 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
7616 simply substituted with a file name chosen for the previous @samp{%u},
7617 without regard to any appended suffix.
7618
7619 @item %j@var{suffix}
7620 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
7621 writable, and if save-temps is off; otherwise, substitute the name
7622 of a temporary file, just like @samp{%u}.  This temporary file is not
7623 meant for communication between processes, but rather as a junk
7624 disposal mechanism.
7625
7626 @item %|@var{suffix}
7627 @itemx %m@var{suffix}
7628 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
7629 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
7630 all.  These are the two most common ways to instruct a program that it
7631 should read from standard input or write to standard output.  If you
7632 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
7633 construct: see for example @file{f/lang-specs.h}.
7634
7635 @item %.@var{SUFFIX}
7636 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
7637 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
7638 terminated by the next space or %.
7639
7640 @item %w
7641 Marks the argument containing or following the @samp{%w} as the
7642 designated output file of this compilation.  This puts the argument
7643 into the sequence of arguments that @samp{%o} will substitute later.
7644
7645 @item %o
7646 Substitutes the names of all the output files, with spaces
7647 automatically placed around them.  You should write spaces
7648 around the @samp{%o} as well or the results are undefined.
7649 @samp{%o} is for use in the specs for running the linker.
7650 Input files whose names have no recognized suffix are not compiled
7651 at all, but they are included among the output files, so they will
7652 be linked.
7653
7654 @item %O
7655 Substitutes the suffix for object files.  Note that this is
7656 handled specially when it immediately follows @samp{%g, %u, or %U},
7657 because of the need for those to form complete file names.  The
7658 handling is such that @samp{%O} is treated exactly as if it had already
7659 been substituted, except that @samp{%g, %u, and %U} do not currently
7660 support additional @var{suffix} characters following @samp{%O} as they would
7661 following, for example, @samp{.o}.
7662
7663 @item %p
7664 Substitutes the standard macro predefinitions for the
7665 current target machine.  Use this when running @code{cpp}.
7666
7667 @item %P
7668 Like @samp{%p}, but puts @samp{__} before and after the name of each
7669 predefined macro, except for macros that start with @samp{__} or with
7670 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
7671 C@.
7672
7673 @item %I
7674 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
7675 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
7676 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
7677 and @option{-imultilib} as necessary.
7678
7679 @item %s
7680 Current argument is the name of a library or startup file of some sort.
7681 Search for that file in a standard list of directories and substitute
7682 the full name found.
7683
7684 @item %e@var{str}
7685 Print @var{str} as an error message.  @var{str} is terminated by a newline.
7686 Use this when inconsistent options are detected.
7687
7688 @item %(@var{name})
7689 Substitute the contents of spec string @var{name} at this point.
7690
7691 @item %[@var{name}]
7692 Like @samp{%(@dots{})} but put @samp{__} around @option{-D} arguments.
7693
7694 @item %x@{@var{option}@}
7695 Accumulate an option for @samp{%X}.
7696
7697 @item %X
7698 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
7699 spec string.
7700
7701 @item %Y
7702 Output the accumulated assembler options specified by @option{-Wa}.
7703
7704 @item %Z
7705 Output the accumulated preprocessor options specified by @option{-Wp}.
7706
7707 @item %a
7708 Process the @code{asm} spec.  This is used to compute the
7709 switches to be passed to the assembler.
7710
7711 @item %A
7712 Process the @code{asm_final} spec.  This is a spec string for
7713 passing switches to an assembler post-processor, if such a program is
7714 needed.
7715
7716 @item %l
7717 Process the @code{link} spec.  This is the spec for computing the
7718 command line passed to the linker.  Typically it will make use of the
7719 @samp{%L %G %S %D and %E} sequences.
7720
7721 @item %D
7722 Dump out a @option{-L} option for each directory that GCC believes might
7723 contain startup files.  If the target supports multilibs then the
7724 current multilib directory will be prepended to each of these paths.
7725
7726 @item %L
7727 Process the @code{lib} spec.  This is a spec string for deciding which
7728 libraries should be included on the command line to the linker.
7729
7730 @item %G
7731 Process the @code{libgcc} spec.  This is a spec string for deciding
7732 which GCC support library should be included on the command line to the linker.
7733
7734 @item %S
7735 Process the @code{startfile} spec.  This is a spec for deciding which
7736 object files should be the first ones passed to the linker.  Typically
7737 this might be a file named @file{crt0.o}.
7738
7739 @item %E
7740 Process the @code{endfile} spec.  This is a spec string that specifies
7741 the last object files that will be passed to the linker.
7742
7743 @item %C
7744 Process the @code{cpp} spec.  This is used to construct the arguments
7745 to be passed to the C preprocessor.
7746
7747 @item %1
7748 Process the @code{cc1} spec.  This is used to construct the options to be
7749 passed to the actual C compiler (@samp{cc1}).
7750
7751 @item %2
7752 Process the @code{cc1plus} spec.  This is used to construct the options to be
7753 passed to the actual C++ compiler (@samp{cc1plus}).
7754
7755 @item %*
7756 Substitute the variable part of a matched option.  See below.
7757 Note that each comma in the substituted string is replaced by
7758 a single space.
7759
7760 @item %<@code{S}
7761 Remove all occurrences of @code{-S} from the command line.  Note---this
7762 command is position dependent.  @samp{%} commands in the spec string
7763 before this one will see @code{-S}, @samp{%} commands in the spec string
7764 after this one will not.
7765
7766 @item %:@var{function}(@var{args})
7767 Call the named function @var{function}, passing it @var{args}.
7768 @var{args} is first processed as a nested spec string, then split
7769 into an argument vector in the usual fashion.  The function returns
7770 a string which is processed as if it had appeared literally as part
7771 of the current spec.
7772
7773 The following built-in spec functions are provided:
7774
7775 @table @code
7776 @item @code{getenv}
7777 The @code{getenv} spec function takes two arguments: an environment
7778 variable name and a string.  If the environment variable is not
7779 defined, a fatal error is issued.  Otherwise, the return value is the
7780 value of the environment variable concatenated with the string.  For
7781 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
7782
7783 @smallexample
7784 %:getenv(TOPDIR /include)
7785 @end smallexample
7786
7787 expands to @file{/path/to/top/include}.
7788
7789 @item @code{if-exists}
7790 The @code{if-exists} spec function takes one argument, an absolute
7791 pathname to a file.  If the file exists, @code{if-exists} returns the
7792 pathname.  Here is a small example of its usage:
7793
7794 @smallexample
7795 *startfile:
7796 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
7797 @end smallexample
7798
7799 @item @code{if-exists-else}
7800 The @code{if-exists-else} spec function is similar to the @code{if-exists}
7801 spec function, except that it takes two arguments.  The first argument is
7802 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
7803 returns the pathname.  If it does not exist, it returns the second argument.
7804 This way, @code{if-exists-else} can be used to select one file or another,
7805 based on the existence of the first.  Here is a small example of its usage:
7806
7807 @smallexample
7808 *startfile:
7809 crt0%O%s %:if-exists(crti%O%s) \
7810 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
7811 @end smallexample
7812
7813 @item @code{replace-outfile}
7814 The @code{replace-outfile} spec function takes two arguments.  It looks for the
7815 first argument in the outfiles array and replaces it with the second argument.  Here
7816 is a small example of its usage:
7817
7818 @smallexample
7819 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
7820 @end smallexample
7821
7822 @item @code{print-asm-header}
7823 The @code{print-asm-header} function takes no arguments and simply
7824 prints a banner like:
7825
7826 @smallexample
7827 Assembler options
7828 =================
7829
7830 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
7831 @end smallexample
7832
7833 It is used to separate compiler options from assembler options
7834 in the @option{--target-help} output.
7835 @end table
7836
7837 @item %@{@code{S}@}
7838 Substitutes the @code{-S} switch, if that switch was given to GCC@.
7839 If that switch was not specified, this substitutes nothing.  Note that
7840 the leading dash is omitted when specifying this option, and it is
7841 automatically inserted if the substitution is performed.  Thus the spec
7842 string @samp{%@{foo@}} would match the command-line option @option{-foo}
7843 and would output the command line option @option{-foo}.
7844
7845 @item %W@{@code{S}@}
7846 Like %@{@code{S}@} but mark last argument supplied within as a file to be
7847 deleted on failure.
7848
7849 @item %@{@code{S}*@}
7850 Substitutes all the switches specified to GCC whose names start
7851 with @code{-S}, but which also take an argument.  This is used for
7852 switches like @option{-o}, @option{-D}, @option{-I}, etc.
7853 GCC considers @option{-o foo} as being
7854 one switch whose names starts with @samp{o}.  %@{o*@} would substitute this
7855 text, including the space.  Thus two arguments would be generated.
7856
7857 @item %@{@code{S}*&@code{T}*@}
7858 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
7859 (the order of @code{S} and @code{T} in the spec is not significant).
7860 There can be any number of ampersand-separated variables; for each the
7861 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
7862
7863 @item %@{@code{S}:@code{X}@}
7864 Substitutes @code{X}, if the @samp{-S} switch was given to GCC@.
7865
7866 @item %@{!@code{S}:@code{X}@}
7867 Substitutes @code{X}, if the @samp{-S} switch was @emph{not} given to GCC@.
7868
7869 @item %@{@code{S}*:@code{X}@}
7870 Substitutes @code{X} if one or more switches whose names start with
7871 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
7872 once, no matter how many such switches appeared.  However, if @code{%*}
7873 appears somewhere in @code{X}, then @code{X} will be substituted once
7874 for each matching switch, with the @code{%*} replaced by the part of
7875 that switch that matched the @code{*}.
7876
7877 @item %@{.@code{S}:@code{X}@}
7878 Substitutes @code{X}, if processing a file with suffix @code{S}.
7879
7880 @item %@{!.@code{S}:@code{X}@}
7881 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
7882
7883 @item %@{,@code{S}:@code{X}@}
7884 Substitutes @code{X}, if processing a file for language @code{S}.
7885
7886 @item %@{!,@code{S}:@code{X}@}
7887 Substitutes @code{X}, if not processing a file for language @code{S}.
7888
7889 @item %@{@code{S}|@code{P}:@code{X}@}
7890 Substitutes @code{X} if either @code{-S} or @code{-P} was given to
7891 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
7892 @code{*} sequences as well, although they have a stronger binding than
7893 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
7894 alternatives must be starred, and only the first matching alternative
7895 is substituted.
7896
7897 For example, a spec string like this:
7898
7899 @smallexample
7900 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
7901 @end smallexample
7902
7903 will output the following command-line options from the following input
7904 command-line options:
7905
7906 @smallexample
7907 fred.c        -foo -baz
7908 jim.d         -bar -boggle
7909 -d fred.c     -foo -baz -boggle
7910 -d jim.d      -bar -baz -boggle
7911 @end smallexample
7912
7913 @item %@{S:X; T:Y; :D@}
7914
7915 If @code{S} was given to GCC, substitutes @code{X}; else if @code{T} was
7916 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
7917 be as many clauses as you need.  This may be combined with @code{.},
7918 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
7919
7920
7921 @end table
7922
7923 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
7924 construct may contain other nested @samp{%} constructs or spaces, or
7925 even newlines.  They are processed as usual, as described above.
7926 Trailing white space in @code{X} is ignored.  White space may also
7927 appear anywhere on the left side of the colon in these constructs,
7928 except between @code{.} or @code{*} and the corresponding word.
7929
7930 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
7931 handled specifically in these constructs.  If another value of
7932 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
7933 @option{-W} switch is found later in the command line, the earlier
7934 switch value is ignored, except with @{@code{S}*@} where @code{S} is
7935 just one letter, which passes all matching options.
7936
7937 The character @samp{|} at the beginning of the predicate text is used to
7938 indicate that a command should be piped to the following command, but
7939 only if @option{-pipe} is specified.
7940
7941 It is built into GCC which switches take arguments and which do not.
7942 (You might think it would be useful to generalize this to allow each
7943 compiler's spec to say which switches take arguments.  But this cannot
7944 be done in a consistent fashion.  GCC cannot even decide which input
7945 files have been specified without knowing which switches take arguments,
7946 and it must know which input files to compile in order to tell which
7947 compilers to run).
7948
7949 GCC also knows implicitly that arguments starting in @option{-l} are to be
7950 treated as compiler output files, and passed to the linker in their
7951 proper position among the other output files.
7952
7953 @c man begin OPTIONS
7954
7955 @node Target Options
7956 @section Specifying Target Machine and Compiler Version
7957 @cindex target options
7958 @cindex cross compiling
7959 @cindex specifying machine version
7960 @cindex specifying compiler version and target machine
7961 @cindex compiler version, specifying
7962 @cindex target machine, specifying
7963
7964 The usual way to run GCC is to run the executable called @file{gcc}, or
7965 @file{<machine>-gcc} when cross-compiling, or
7966 @file{<machine>-gcc-<version>} to run a version other than the one that
7967 was installed last.  Sometimes this is inconvenient, so GCC provides
7968 options that will switch to another cross-compiler or version.
7969
7970 @table @gcctabopt
7971 @item -b @var{machine}
7972 @opindex b
7973 The argument @var{machine} specifies the target machine for compilation.
7974
7975 The value to use for @var{machine} is the same as was specified as the
7976 machine type when configuring GCC as a cross-compiler.  For
7977 example, if a cross-compiler was configured with @samp{configure
7978 arm-elf}, meaning to compile for an arm processor with elf binaries,
7979 then you would specify @option{-b arm-elf} to run that cross compiler.
7980 Because there are other options beginning with @option{-b}, the
7981 configuration must contain a hyphen.
7982
7983 @item -V @var{version}
7984 @opindex V
7985 The argument @var{version} specifies which version of GCC to run.
7986 This is useful when multiple versions are installed.  For example,
7987 @var{version} might be @samp{4.0}, meaning to run GCC version 4.0.
7988 @end table
7989
7990 The @option{-V} and @option{-b} options work by running the
7991 @file{<machine>-gcc-<version>} executable, so there's no real reason to
7992 use them if you can just run that directly.
7993
7994 @node Submodel Options
7995 @section Hardware Models and Configurations
7996 @cindex submodel options
7997 @cindex specifying hardware config
7998 @cindex hardware models and configurations, specifying
7999 @cindex machine dependent options
8000
8001 Earlier we discussed the standard option @option{-b} which chooses among
8002 different installed compilers for completely different target
8003 machines, such as VAX vs.@: 68000 vs.@: 80386.
8004
8005 In addition, each of these target machine types can have its own
8006 special options, starting with @samp{-m}, to choose among various
8007 hardware models or configurations---for example, 68010 vs 68020,
8008 floating coprocessor or none.  A single installed version of the
8009 compiler can compile for any model or configuration, according to the
8010 options specified.
8011
8012 Some configurations of the compiler also support additional special
8013 options, usually for compatibility with other compilers on the same
8014 platform.
8015
8016 @c This list is ordered alphanumerically by subsection name.
8017 @c It should be the same order and spelling as these options are listed
8018 @c in Machine Dependent Options
8019
8020 @menu
8021 * ARC Options::
8022 * ARM Options::
8023 * AVR Options::
8024 * Blackfin Options::
8025 * CRIS Options::
8026 * CRX Options::
8027 * Darwin Options::
8028 * DEC Alpha Options::
8029 * DEC Alpha/VMS Options::
8030 * FRV Options::
8031 * GNU/Linux Options::
8032 * H8/300 Options::
8033 * HPPA Options::
8034 * i386 and x86-64 Options::
8035 * IA-64 Options::
8036 * M32C Options::
8037 * M32R/D Options::
8038 * M680x0 Options::
8039 * M68hc1x Options::
8040 * MCore Options::
8041 * MIPS Options::
8042 * MMIX Options::
8043 * MN10300 Options::
8044 * MT Options::
8045 * PDP-11 Options::
8046 * PowerPC Options::
8047 * RS/6000 and PowerPC Options::
8048 * S/390 and zSeries Options::
8049 * Score Options::
8050 * SH Options::
8051 * SPARC Options::
8052 * SPU Options::
8053 * System V Options::
8054 * TMS320C3x/C4x Options::
8055 * V850 Options::
8056 * VAX Options::
8057 * VxWorks Options::
8058 * x86-64 Options::
8059 * Xstormy16 Options::
8060 * Xtensa Options::
8061 * zSeries Options::
8062 @end menu
8063
8064 @node ARC Options
8065 @subsection ARC Options
8066 @cindex ARC Options
8067
8068 These options are defined for ARC implementations:
8069
8070 @table @gcctabopt
8071 @item -EL
8072 @opindex EL
8073 Compile code for little endian mode.  This is the default.
8074
8075 @item -EB
8076 @opindex EB
8077 Compile code for big endian mode.
8078
8079 @item -mmangle-cpu
8080 @opindex mmangle-cpu
8081 Prepend the name of the cpu to all public symbol names.
8082 In multiple-processor systems, there are many ARC variants with different
8083 instruction and register set characteristics.  This flag prevents code
8084 compiled for one cpu to be linked with code compiled for another.
8085 No facility exists for handling variants that are ``almost identical''.
8086 This is an all or nothing option.
8087
8088 @item -mcpu=@var{cpu}
8089 @opindex mcpu
8090 Compile code for ARC variant @var{cpu}.
8091 Which variants are supported depend on the configuration.
8092 All variants support @option{-mcpu=base}, this is the default.
8093
8094 @item -mtext=@var{text-section}
8095 @itemx -mdata=@var{data-section}
8096 @itemx -mrodata=@var{readonly-data-section}
8097 @opindex mtext
8098 @opindex mdata
8099 @opindex mrodata
8100 Put functions, data, and readonly data in @var{text-section},
8101 @var{data-section}, and @var{readonly-data-section} respectively
8102 by default.  This can be overridden with the @code{section} attribute.
8103 @xref{Variable Attributes}.
8104
8105 @end table
8106
8107 @node ARM Options
8108 @subsection ARM Options
8109 @cindex ARM options
8110
8111 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
8112 architectures:
8113
8114 @table @gcctabopt
8115 @item -mabi=@var{name}
8116 @opindex mabi
8117 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
8118 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
8119
8120 @item -mapcs-frame
8121 @opindex mapcs-frame
8122 Generate a stack frame that is compliant with the ARM Procedure Call
8123 Standard for all functions, even if this is not strictly necessary for
8124 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
8125 with this option will cause the stack frames not to be generated for
8126 leaf functions.  The default is @option{-mno-apcs-frame}.
8127
8128 @item -mapcs
8129 @opindex mapcs
8130 This is a synonym for @option{-mapcs-frame}.
8131
8132 @ignore
8133 @c not currently implemented
8134 @item -mapcs-stack-check
8135 @opindex mapcs-stack-check
8136 Generate code to check the amount of stack space available upon entry to
8137 every function (that actually uses some stack space).  If there is
8138 insufficient space available then either the function
8139 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} will be
8140 called, depending upon the amount of stack space required.  The run time
8141 system is required to provide these functions.  The default is
8142 @option{-mno-apcs-stack-check}, since this produces smaller code.
8143
8144 @c not currently implemented
8145 @item -mapcs-float
8146 @opindex mapcs-float
8147 Pass floating point arguments using the float point registers.  This is
8148 one of the variants of the APCS@.  This option is recommended if the
8149 target hardware has a floating point unit or if a lot of floating point
8150 arithmetic is going to be performed by the code.  The default is
8151 @option{-mno-apcs-float}, since integer only code is slightly increased in
8152 size if @option{-mapcs-float} is used.
8153
8154 @c not currently implemented
8155 @item -mapcs-reentrant
8156 @opindex mapcs-reentrant
8157 Generate reentrant, position independent code.  The default is
8158 @option{-mno-apcs-reentrant}.
8159 @end ignore
8160
8161 @item -mthumb-interwork
8162 @opindex mthumb-interwork
8163 Generate code which supports calling between the ARM and Thumb
8164 instruction sets.  Without this option the two instruction sets cannot
8165 be reliably used inside one program.  The default is
8166 @option{-mno-thumb-interwork}, since slightly larger code is generated
8167 when @option{-mthumb-interwork} is specified.
8168
8169 @item -mno-sched-prolog
8170 @opindex mno-sched-prolog
8171 Prevent the reordering of instructions in the function prolog, or the
8172 merging of those instruction with the instructions in the function's
8173 body.  This means that all functions will start with a recognizable set
8174 of instructions (or in fact one of a choice from a small set of
8175 different function prologues), and this information can be used to
8176 locate the start if functions inside an executable piece of code.  The
8177 default is @option{-msched-prolog}.
8178
8179 @item -mhard-float
8180 @opindex mhard-float
8181 Generate output containing floating point instructions.  This is the
8182 default.
8183
8184 @item -msoft-float
8185 @opindex msoft-float
8186 Generate output containing library calls for floating point.
8187 @strong{Warning:} the requisite libraries are not available for all ARM
8188 targets.  Normally the facilities of the machine's usual C compiler are
8189 used, but this cannot be done directly in cross-compilation.  You must make
8190 your own arrangements to provide suitable library functions for
8191 cross-compilation.
8192
8193 @option{-msoft-float} changes the calling convention in the output file;
8194 therefore, it is only useful if you compile @emph{all} of a program with
8195 this option.  In particular, you need to compile @file{libgcc.a}, the
8196 library that comes with GCC, with @option{-msoft-float} in order for
8197 this to work.
8198
8199 @item -mfloat-abi=@var{name}
8200 @opindex mfloat-abi
8201 Specifies which ABI to use for floating point values.  Permissible values
8202 are: @samp{soft}, @samp{softfp} and @samp{hard}.
8203
8204 @samp{soft} and @samp{hard} are equivalent to @option{-msoft-float}
8205 and @option{-mhard-float} respectively.  @samp{softfp} allows the generation
8206 of floating point instructions, but still uses the soft-float calling
8207 conventions.
8208
8209 @item -mlittle-endian
8210 @opindex mlittle-endian
8211 Generate code for a processor running in little-endian mode.  This is
8212 the default for all standard configurations.
8213
8214 @item -mbig-endian
8215 @opindex mbig-endian
8216 Generate code for a processor running in big-endian mode; the default is
8217 to compile code for a little-endian processor.
8218
8219 @item -mwords-little-endian
8220 @opindex mwords-little-endian
8221 This option only applies when generating code for big-endian processors.
8222 Generate code for a little-endian word order but a big-endian byte
8223 order.  That is, a byte order of the form @samp{32107654}.  Note: this
8224 option should only be used if you require compatibility with code for
8225 big-endian ARM processors generated by versions of the compiler prior to
8226 2.8.
8227
8228 @item -mcpu=@var{name}
8229 @opindex mcpu
8230 This specifies the name of the target ARM processor.  GCC uses this name
8231 to determine what kind of instructions it can emit when generating
8232 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
8233 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
8234 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
8235 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
8236 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
8237 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
8238 @samp{arm8}, @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
8239 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
8240 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
8241 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
8242 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
8243 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
8244 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
8245 @samp{arm1156t2-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
8246 @samp{cortex-a8}, @samp{cortex-r4}, @samp{cortex-m3},
8247 @samp{xscale}, @samp{iwmmxt}, @samp{ep9312}.
8248
8249 @itemx -mtune=@var{name}
8250 @opindex mtune
8251 This option is very similar to the @option{-mcpu=} option, except that
8252 instead of specifying the actual target processor type, and hence
8253 restricting which instructions can be used, it specifies that GCC should
8254 tune the performance of the code as if the target were of the type
8255 specified in this option, but still choosing the instructions that it
8256 will generate based on the cpu specified by a @option{-mcpu=} option.
8257 For some ARM implementations better performance can be obtained by using
8258 this option.
8259
8260 @item -march=@var{name}
8261 @opindex march
8262 This specifies the name of the target ARM architecture.  GCC uses this
8263 name to determine what kind of instructions it can emit when generating
8264 assembly code.  This option can be used in conjunction with or instead
8265 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
8266 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
8267 @samp{armv5}, @samp{armv5t}, @samp{armv5te}, @samp{armv6}, @samp{armv6j},
8268 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv7}, @samp{armv7-a},
8269 @samp{armv7-r}, @samp{armv7-m}, @samp{iwmmxt}, @samp{ep9312}.
8270
8271 @item -mfpu=@var{name}
8272 @itemx -mfpe=@var{number}
8273 @itemx -mfp=@var{number}
8274 @opindex mfpu
8275 @opindex mfpe
8276 @opindex mfp
8277 This specifies what floating point hardware (or hardware emulation) is
8278 available on the target.  Permissible names are: @samp{fpa}, @samp{fpe2},
8279 @samp{fpe3}, @samp{maverick}, @samp{vfp}.  @option{-mfp} and @option{-mfpe}
8280 are synonyms for @option{-mfpu}=@samp{fpe}@var{number}, for compatibility
8281 with older versions of GCC@.
8282
8283 If @option{-msoft-float} is specified this specifies the format of
8284 floating point values.
8285
8286 @item -mstructure-size-boundary=@var{n}
8287 @opindex mstructure-size-boundary
8288 The size of all structures and unions will be rounded up to a multiple
8289 of the number of bits set by this option.  Permissible values are 8, 32
8290 and 64.  The default value varies for different toolchains.  For the COFF
8291 targeted toolchain the default value is 8.  A value of 64 is only allowed
8292 if the underlying ABI supports it.
8293
8294 Specifying the larger number can produce faster, more efficient code, but
8295 can also increase the size of the program.  Different values are potentially
8296 incompatible.  Code compiled with one value cannot necessarily expect to
8297 work with code or libraries compiled with another value, if they exchange
8298 information using structures or unions.
8299
8300 @item -mabort-on-noreturn
8301 @opindex mabort-on-noreturn
8302 Generate a call to the function @code{abort} at the end of a
8303 @code{noreturn} function.  It will be executed if the function tries to
8304 return.
8305
8306 @item -mlong-calls
8307 @itemx -mno-long-calls
8308 @opindex mlong-calls
8309 @opindex mno-long-calls
8310 Tells the compiler to perform function calls by first loading the
8311 address of the function into a register and then performing a subroutine
8312 call on this register.  This switch is needed if the target function
8313 will lie outside of the 64 megabyte addressing range of the offset based
8314 version of subroutine call instruction.
8315
8316 Even if this switch is enabled, not all function calls will be turned
8317 into long calls.  The heuristic is that static functions, functions
8318 which have the @samp{short-call} attribute, functions that are inside
8319 the scope of a @samp{#pragma no_long_calls} directive and functions whose
8320 definitions have already been compiled within the current compilation
8321 unit, will not be turned into long calls.  The exception to this rule is
8322 that weak function definitions, functions with the @samp{long-call}
8323 attribute or the @samp{section} attribute, and functions that are within
8324 the scope of a @samp{#pragma long_calls} directive, will always be
8325 turned into long calls.
8326
8327 This feature is not enabled by default.  Specifying
8328 @option{-mno-long-calls} will restore the default behavior, as will
8329 placing the function calls within the scope of a @samp{#pragma
8330 long_calls_off} directive.  Note these switches have no effect on how
8331 the compiler generates code to handle function calls via function
8332 pointers.
8333
8334 @item -mnop-fun-dllimport
8335 @opindex mnop-fun-dllimport
8336 Disable support for the @code{dllimport} attribute.
8337
8338 @item -msingle-pic-base
8339 @opindex msingle-pic-base
8340 Treat the register used for PIC addressing as read-only, rather than
8341 loading it in the prologue for each function.  The run-time system is
8342 responsible for initializing this register with an appropriate value
8343 before execution begins.
8344
8345 @item -mpic-register=@var{reg}
8346 @opindex mpic-register
8347 Specify the register to be used for PIC addressing.  The default is R10
8348 unless stack-checking is enabled, when R9 is used.
8349
8350 @item -mcirrus-fix-invalid-insns
8351 @opindex mcirrus-fix-invalid-insns
8352 @opindex mno-cirrus-fix-invalid-insns
8353 Insert NOPs into the instruction stream to in order to work around
8354 problems with invalid Maverick instruction combinations.  This option
8355 is only valid if the @option{-mcpu=ep9312} option has been used to
8356 enable generation of instructions for the Cirrus Maverick floating
8357 point co-processor.  This option is not enabled by default, since the
8358 problem is only present in older Maverick implementations.  The default
8359 can be re-enabled by use of the @option{-mno-cirrus-fix-invalid-insns}
8360 switch.
8361
8362 @item -mpoke-function-name
8363 @opindex mpoke-function-name
8364 Write the name of each function into the text section, directly
8365 preceding the function prologue.  The generated code is similar to this:
8366
8367 @smallexample
8368      t0
8369          .ascii "arm_poke_function_name", 0
8370          .align
8371      t1
8372          .word 0xff000000 + (t1 - t0)
8373      arm_poke_function_name
8374          mov     ip, sp
8375          stmfd   sp!, @{fp, ip, lr, pc@}
8376          sub     fp, ip, #4
8377 @end smallexample
8378
8379 When performing a stack backtrace, code can inspect the value of
8380 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
8381 location @code{pc - 12} and the top 8 bits are set, then we know that
8382 there is a function name embedded immediately preceding this location
8383 and has length @code{((pc[-3]) & 0xff000000)}.
8384
8385 @item -mthumb
8386 @opindex mthumb
8387 Generate code for the Thumb instruction set.  The default is to
8388 use the 32-bit ARM instruction set.
8389 This option automatically enables either 16-bit Thumb-1 or
8390 mixed 16/32-bit Thumb-2 instructions based on the @option{-mcpu=@var{name}}
8391 and @option{-march=@var{name}} options.
8392
8393 @item -mtpcs-frame
8394 @opindex mtpcs-frame
8395 Generate a stack frame that is compliant with the Thumb Procedure Call
8396 Standard for all non-leaf functions.  (A leaf function is one that does
8397 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
8398
8399 @item -mtpcs-leaf-frame
8400 @opindex mtpcs-leaf-frame
8401 Generate a stack frame that is compliant with the Thumb Procedure Call
8402 Standard for all leaf functions.  (A leaf function is one that does
8403 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
8404
8405 @item -mcallee-super-interworking
8406 @opindex mcallee-super-interworking
8407 Gives all externally visible functions in the file being compiled an ARM
8408 instruction set header which switches to Thumb mode before executing the
8409 rest of the function.  This allows these functions to be called from
8410 non-interworking code.
8411
8412 @item -mcaller-super-interworking
8413 @opindex mcaller-super-interworking
8414 Allows calls via function pointers (including virtual functions) to
8415 execute correctly regardless of whether the target code has been
8416 compiled for interworking or not.  There is a small overhead in the cost
8417 of executing a function pointer if this option is enabled.
8418
8419 @item -mtp=@var{name}
8420 @opindex mtp
8421 Specify the access model for the thread local storage pointer.  The valid
8422 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
8423 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
8424 (supported in the arm6k architecture), and @option{auto}, which uses the
8425 best available method for the selected processor.  The default setting is
8426 @option{auto}.
8427
8428 @end table
8429
8430 @node AVR Options
8431 @subsection AVR Options
8432 @cindex AVR Options
8433
8434 These options are defined for AVR implementations:
8435
8436 @table @gcctabopt
8437 @item -mmcu=@var{mcu}
8438 @opindex mmcu
8439 Specify ATMEL AVR instruction set or MCU type.
8440
8441 Instruction set avr1 is for the minimal AVR core, not supported by the C
8442 compiler, only for assembler programs (MCU types: at90s1200, attiny10,
8443 attiny11, attiny12, attiny15, attiny28).
8444
8445 Instruction set avr2 (default) is for the classic AVR core with up to
8446 8K program memory space (MCU types: at90s2313, at90s2323, attiny22,
8447 at90s2333, at90s2343, at90s4414, at90s4433, at90s4434, at90s8515,
8448 at90c8534, at90s8535).
8449
8450 Instruction set avr3 is for the classic AVR core with up to 128K program
8451 memory space (MCU types: atmega103, atmega603, at43usb320, at76c711).
8452
8453 Instruction set avr4 is for the enhanced AVR core with up to 8K program
8454 memory space (MCU types: atmega8, atmega83, atmega85).
8455
8456 Instruction set avr5 is for the enhanced AVR core with up to 128K program
8457 memory space (MCU types: atmega16, atmega161, atmega163, atmega32, atmega323,
8458 atmega64, atmega128, at43usb355, at94k).
8459
8460 @item -msize
8461 @opindex msize
8462 Output instruction sizes to the asm file.
8463
8464 @item -minit-stack=@var{N}
8465 @opindex minit-stack
8466 Specify the initial stack address, which may be a symbol or numeric value,
8467 @samp{__stack} is the default.
8468
8469 @item -mno-interrupts
8470 @opindex mno-interrupts
8471 Generated code is not compatible with hardware interrupts.
8472 Code size will be smaller.
8473
8474 @item -mcall-prologues
8475 @opindex mcall-prologues
8476 Functions prologues/epilogues expanded as call to appropriate
8477 subroutines.  Code size will be smaller.
8478
8479 @item -mno-tablejump
8480 @opindex mno-tablejump
8481 Do not generate tablejump insns which sometimes increase code size.
8482
8483 @item -mtiny-stack
8484 @opindex mtiny-stack
8485 Change only the low 8 bits of the stack pointer.
8486
8487 @item -mint8
8488 @opindex mint8
8489 Assume int to be 8 bit integer.  This affects the sizes of all types: A
8490 char will be 1 byte, an int will be 1 byte, an long will be 2 bytes
8491 and long long will be 4 bytes.  Please note that this option does not
8492 comply to the C standards, but it will provide you with smaller code
8493 size.
8494 @end table
8495
8496 @node Blackfin Options
8497 @subsection Blackfin Options
8498 @cindex Blackfin Options
8499
8500 @table @gcctabopt
8501 @item -mcpu=@var{cpu}
8502 @opindex mcpu=
8503 Specifies the name of the target Blackfin processor. Currently, @var{cpu}
8504 can be one of @samp{bf531}, @samp{bf532}, @samp{bf533},
8505 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf561}.
8506 Without this option, @samp{bf532} is used as the processor by default.
8507 The corresponding predefined processor macros for @var{cpu} is to
8508 be defined.  For the @samp{bfin-elf} toolchain, this causes the hardware
8509 BSP provided by libgloss to be linked in if @samp{-msim} is not given.
8510 Support for @samp{bf561} is incomplete; only the processor macro is defined.
8511
8512 @item -msim
8513 @opindex msim
8514 Specifies that the program will be run on the simulator.  This causes
8515 the simulator BSP provided by libgloss to be linked in.  This option
8516 has effect only for @samp{bfin-elf} toolchain.
8517
8518 @item -momit-leaf-frame-pointer
8519 @opindex momit-leaf-frame-pointer
8520 Don't keep the frame pointer in a register for leaf functions.  This
8521 avoids the instructions to save, set up and restore frame pointers and
8522 makes an extra register available in leaf functions.  The option
8523 @option{-fomit-frame-pointer} removes the frame pointer for all functions
8524 which might make debugging harder.
8525
8526 @item -mspecld-anomaly
8527 @opindex mspecld-anomaly
8528 When enabled, the compiler will ensure that the generated code does not
8529 contain speculative loads after jump instructions.  This option is enabled
8530 by default.
8531
8532 @item -mno-specld-anomaly
8533 @opindex mno-specld-anomaly
8534 Don't generate extra code to prevent speculative loads from occurring.
8535
8536 @item -mcsync-anomaly
8537 @opindex mcsync-anomaly
8538 When enabled, the compiler will ensure that the generated code does not
8539 contain CSYNC or SSYNC instructions too soon after conditional branches.
8540 This option is enabled by default.
8541
8542 @item -mno-csync-anomaly
8543 @opindex mno-csync-anomaly
8544 Don't generate extra code to prevent CSYNC or SSYNC instructions from
8545 occurring too soon after a conditional branch.
8546
8547 @item -mlow-64k
8548 @opindex mlow-64k
8549 When enabled, the compiler is free to take advantage of the knowledge that
8550 the entire program fits into the low 64k of memory.
8551
8552 @item -mno-low-64k
8553 @opindex mno-low-64k
8554 Assume that the program is arbitrarily large.  This is the default.
8555
8556 @item -mstack-check-l1
8557 @opindex mstack-check-l1
8558 Do stack checking using information placed into L1 scratchpad memory by the
8559 uClinux kernel.
8560
8561 @item -mid-shared-library
8562 @opindex mid-shared-library
8563 Generate code that supports shared libraries via the library ID method.
8564 This allows for execute in place and shared libraries in an environment
8565 without virtual memory management.  This option implies @option{-fPIC}.
8566
8567 @item -mno-id-shared-library
8568 @opindex mno-id-shared-library
8569 Generate code that doesn't assume ID based shared libraries are being used.
8570 This is the default.
8571
8572 @item -mleaf-id-shared-library
8573 @opindex mleaf-id-shared-library
8574 Generate code that supports shared libraries via the library ID method,
8575 but assumes that this library or executable won't link against any other
8576 ID shared libraries.  That allows the compiler to use faster code for jumps
8577 and calls.
8578
8579 @item -mno-leaf-id-shared-library
8580 @opindex mno-leaf-id-shared-library
8581 Do not assume that the code being compiled won't link against any ID shared
8582 libraries.  Slower code will be generated for jump and call insns.
8583
8584 @item -mshared-library-id=n
8585 @opindex mshared-library-id
8586 Specified the identification number of the ID based shared library being
8587 compiled.  Specifying a value of 0 will generate more compact code, specifying
8588 other values will force the allocation of that number to the current
8589 library but is no more space or time efficient than omitting this option.
8590
8591 @item -msep-data
8592 @opindex msep-data
8593 Generate code that allows the data segment to be located in a different
8594 area of memory from the text segment.  This allows for execute in place in
8595 an environment without virtual memory management by eliminating relocations
8596 against the text section.
8597
8598 @item -mno-sep-data
8599 @opindex mno-sep-data
8600 Generate code that assumes that the data segment follows the text segment.
8601 This is the default.
8602
8603 @item -mlong-calls
8604 @itemx -mno-long-calls
8605 @opindex mlong-calls
8606 @opindex mno-long-calls
8607 Tells the compiler to perform function calls by first loading the
8608 address of the function into a register and then performing a subroutine
8609 call on this register.  This switch is needed if the target function
8610 will lie outside of the 24 bit addressing range of the offset based
8611 version of subroutine call instruction.
8612
8613 This feature is not enabled by default.  Specifying
8614 @option{-mno-long-calls} will restore the default behavior.  Note these
8615 switches have no effect on how the compiler generates code to handle
8616 function calls via function pointers.
8617
8618 @item -mfast-fp
8619 @opindex mfast-fp
8620 Link with the fast floating-point library. This library relaxes some of
8621 the IEEE floating-point standard's rules for checking inputs against
8622 Not-a-Number (NAN), in the interest of performance.
8623
8624 @item -minline-plt
8625 @opindex minline-plt
8626 Enable inlining of PLT entries in function calls to functions that are
8627 not known to bind locally.  It has no effect without @option{-mfdpic}.
8628 @end table
8629
8630 @node CRIS Options
8631 @subsection CRIS Options
8632 @cindex CRIS Options
8633
8634 These options are defined specifically for the CRIS ports.
8635
8636 @table @gcctabopt
8637 @item -march=@var{architecture-type}
8638 @itemx -mcpu=@var{architecture-type}
8639 @opindex march
8640 @opindex mcpu
8641 Generate code for the specified architecture.  The choices for
8642 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
8643 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
8644 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
8645 @samp{v10}.
8646
8647 @item -mtune=@var{architecture-type}
8648 @opindex mtune
8649 Tune to @var{architecture-type} everything applicable about the generated
8650 code, except for the ABI and the set of available instructions.  The
8651 choices for @var{architecture-type} are the same as for
8652 @option{-march=@var{architecture-type}}.
8653
8654 @item -mmax-stack-frame=@var{n}
8655 @opindex mmax-stack-frame
8656 Warn when the stack frame of a function exceeds @var{n} bytes.
8657
8658 @item -melinux-stacksize=@var{n}
8659 @opindex melinux-stacksize
8660 Only available with the @samp{cris-axis-aout} target.  Arranges for
8661 indications in the program to the kernel loader that the stack of the
8662 program should be set to @var{n} bytes.
8663
8664 @item -metrax4
8665 @itemx -metrax100
8666 @opindex metrax4
8667 @opindex metrax100
8668 The options @option{-metrax4} and @option{-metrax100} are synonyms for
8669 @option{-march=v3} and @option{-march=v8} respectively.
8670
8671 @item -mmul-bug-workaround
8672 @itemx -mno-mul-bug-workaround
8673 @opindex mmul-bug-workaround
8674 @opindex mno-mul-bug-workaround
8675 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
8676 models where it applies.  This option is active by default.
8677
8678 @item -mpdebug
8679 @opindex mpdebug
8680 Enable CRIS-specific verbose debug-related information in the assembly
8681 code.  This option also has the effect to turn off the @samp{#NO_APP}
8682 formatted-code indicator to the assembler at the beginning of the
8683 assembly file.
8684
8685 @item -mcc-init
8686 @opindex mcc-init
8687 Do not use condition-code results from previous instruction; always emit
8688 compare and test instructions before use of condition codes.
8689
8690 @item -mno-side-effects
8691 @opindex mno-side-effects
8692 Do not emit instructions with side-effects in addressing modes other than
8693 post-increment.
8694
8695 @item -mstack-align
8696 @itemx -mno-stack-align
8697 @itemx -mdata-align
8698 @itemx -mno-data-align
8699 @itemx -mconst-align
8700 @itemx -mno-const-align
8701 @opindex mstack-align
8702 @opindex mno-stack-align
8703 @opindex mdata-align
8704 @opindex mno-data-align
8705 @opindex mconst-align
8706 @opindex mno-const-align
8707 These options (no-options) arranges (eliminate arrangements) for the
8708 stack-frame, individual data and constants to be aligned for the maximum
8709 single data access size for the chosen CPU model.  The default is to
8710 arrange for 32-bit alignment.  ABI details such as structure layout are
8711 not affected by these options.
8712
8713 @item -m32-bit
8714 @itemx -m16-bit
8715 @itemx -m8-bit
8716 @opindex m32-bit
8717 @opindex m16-bit
8718 @opindex m8-bit
8719 Similar to the stack- data- and const-align options above, these options
8720 arrange for stack-frame, writable data and constants to all be 32-bit,
8721 16-bit or 8-bit aligned.  The default is 32-bit alignment.
8722
8723 @item -mno-prologue-epilogue
8724 @itemx -mprologue-epilogue
8725 @opindex mno-prologue-epilogue
8726 @opindex mprologue-epilogue
8727 With @option{-mno-prologue-epilogue}, the normal function prologue and
8728 epilogue that sets up the stack-frame are omitted and no return
8729 instructions or return sequences are generated in the code.  Use this
8730 option only together with visual inspection of the compiled code: no
8731 warnings or errors are generated when call-saved registers must be saved,
8732 or storage for local variable needs to be allocated.
8733
8734 @item -mno-gotplt
8735 @itemx -mgotplt
8736 @opindex mno-gotplt
8737 @opindex mgotplt
8738 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
8739 instruction sequences that load addresses for functions from the PLT part
8740 of the GOT rather than (traditional on other architectures) calls to the
8741 PLT@.  The default is @option{-mgotplt}.
8742
8743 @item -maout
8744 @opindex maout
8745 Legacy no-op option only recognized with the cris-axis-aout target.
8746
8747 @item -melf
8748 @opindex melf
8749 Legacy no-op option only recognized with the cris-axis-elf and
8750 cris-axis-linux-gnu targets.
8751
8752 @item -melinux
8753 @opindex melinux
8754 Only recognized with the cris-axis-aout target, where it selects a
8755 GNU/linux-like multilib, include files and instruction set for
8756 @option{-march=v8}.
8757
8758 @item -mlinux
8759 @opindex mlinux
8760 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
8761
8762 @item -sim
8763 @opindex sim
8764 This option, recognized for the cris-axis-aout and cris-axis-elf arranges
8765 to link with input-output functions from a simulator library.  Code,
8766 initialized data and zero-initialized data are allocated consecutively.
8767
8768 @item -sim2
8769 @opindex sim2
8770 Like @option{-sim}, but pass linker options to locate initialized data at
8771 0x40000000 and zero-initialized data at 0x80000000.
8772 @end table
8773
8774 @node CRX Options
8775 @subsection CRX Options
8776 @cindex CRX Options
8777
8778 These options are defined specifically for the CRX ports.
8779
8780 @table @gcctabopt
8781
8782 @item -mmac
8783 @opindex mmac
8784 Enable the use of multiply-accumulate instructions. Disabled by default.
8785
8786 @item -mpush-args
8787 @opindex mpush-args
8788 Push instructions will be used to pass outgoing arguments when functions
8789 are called. Enabled by default.
8790 @end table
8791
8792 @node Darwin Options
8793 @subsection Darwin Options
8794 @cindex Darwin options
8795
8796 These options are defined for all architectures running the Darwin operating
8797 system.
8798
8799 FSF GCC on Darwin does not create ``fat'' object files; it will create
8800 an object file for the single architecture that it was built to
8801 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
8802 @option{-arch} options are used; it does so by running the compiler or
8803 linker multiple times and joining the results together with
8804 @file{lipo}.
8805
8806 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
8807 @samp{i686}) is determined by the flags that specify the ISA
8808 that GCC is targetting, like @option{-mcpu} or @option{-march}.  The
8809 @option{-force_cpusubtype_ALL} option can be used to override this.
8810
8811 The Darwin tools vary in their behavior when presented with an ISA
8812 mismatch.  The assembler, @file{as}, will only permit instructions to
8813 be used that are valid for the subtype of the file it is generating,
8814 so you cannot put 64-bit instructions in an @samp{ppc750} object file.
8815 The linker for shared libraries, @file{/usr/bin/libtool}, will fail
8816 and print an error if asked to create a shared library with a less
8817 restrictive subtype than its input files (for instance, trying to put
8818 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
8819 for executables, @file{ld}, will quietly give the executable the most
8820 restrictive subtype of any of its input files.
8821
8822 @table @gcctabopt
8823 @item -F@var{dir}
8824 @opindex F
8825 Add the framework directory @var{dir} to the head of the list of
8826 directories to be searched for header files.  These directories are
8827 interleaved with those specified by @option{-I} options and are
8828 scanned in a left-to-right order.
8829
8830 A framework directory is a directory with frameworks in it.  A
8831 framework is a directory with a @samp{"Headers"} and/or
8832 @samp{"PrivateHeaders"} directory contained directly in it that ends
8833 in @samp{".framework"}.  The name of a framework is the name of this
8834 directory excluding the @samp{".framework"}.  Headers associated with
8835 the framework are found in one of those two directories, with
8836 @samp{"Headers"} being searched first.  A subframework is a framework
8837 directory that is in a framework's @samp{"Frameworks"} directory.
8838 Includes of subframework headers can only appear in a header of a
8839 framework that contains the subframework, or in a sibling subframework
8840 header.  Two subframeworks are siblings if they occur in the same
8841 framework.  A subframework should not have the same name as a
8842 framework, a warning will be issued if this is violated.  Currently a
8843 subframework cannot have subframeworks, in the future, the mechanism
8844 may be extended to support this.  The standard frameworks can be found
8845 in @samp{"/System/Library/Frameworks"} and
8846 @samp{"/Library/Frameworks"}.  An example include looks like
8847 @code{#include <Framework/header.h>}, where @samp{Framework} denotes
8848 the name of the framework and header.h is found in the
8849 @samp{"PrivateHeaders"} or @samp{"Headers"} directory.
8850
8851 @item -iframework@var{dir}
8852 @opindex iframework
8853 Like @option{-F} except the directory is a treated as a system
8854 directory.  The main difference between this @option{-iframework} and
8855 @option{-F} is that with @option{-iframework} the compiler does not
8856 warn about constructs contained within header files found via
8857 @var{dir}.  This option is valid only for the C family of languages.
8858
8859 @item -gused
8860 @opindex gused
8861 Emit debugging information for symbols that are used.  For STABS
8862 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
8863 This is by default ON@.
8864
8865 @item -gfull
8866 @opindex gfull
8867 Emit debugging information for all symbols and types.
8868
8869 @item -mmacosx-version-min=@var{version}
8870 The earliest version of MacOS X that this executable will run on
8871 is @var{version}.  Typical values of @var{version} include @code{10.1},
8872 @code{10.2}, and @code{10.3.9}.
8873
8874 If the compiler was built to use the system's headers by default,
8875 then the default for this option is the system version on which the
8876 compiler is running, otherwise the default is to make choices which
8877 are compatible with as many systems and code bases as possible.
8878
8879 @item -mkernel
8880 @opindex mkernel
8881 Enable kernel development mode.  The @option{-mkernel} option sets
8882 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
8883 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
8884 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
8885 applicable.  This mode also sets @option{-mno-altivec},
8886 @option{-msoft-float}, @option{-fno-builtin} and
8887 @option{-mlong-branch} for PowerPC targets.
8888
8889 @item -mone-byte-bool
8890 @opindex mone-byte-bool
8891 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
8892 By default @samp{sizeof(bool)} is @samp{4} when compiling for
8893 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
8894 option has no effect on x86.
8895
8896 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
8897 to generate code that is not binary compatible with code generated
8898 without that switch.  Using this switch may require recompiling all
8899 other modules in a program, including system libraries.  Use this
8900 switch to conform to a non-default data model.
8901
8902 @item -mfix-and-continue
8903 @itemx -ffix-and-continue
8904 @itemx -findirect-data
8905 @opindex mfix-and-continue
8906 @opindex ffix-and-continue
8907 @opindex findirect-data
8908 Generate code suitable for fast turn around development.  Needed to
8909 enable gdb to dynamically load @code{.o} files into already running
8910 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
8911 are provided for backwards compatibility.
8912
8913 @item -all_load
8914 @opindex all_load
8915 Loads all members of static archive libraries.
8916 See man ld(1) for more information.
8917
8918 @item -arch_errors_fatal
8919 @opindex arch_errors_fatal
8920 Cause the errors having to do with files that have the wrong architecture
8921 to be fatal.
8922
8923 @item -bind_at_load
8924 @opindex bind_at_load
8925 Causes the output file to be marked such that the dynamic linker will
8926 bind all undefined references when the file is loaded or launched.
8927
8928 @item -bundle
8929 @opindex bundle
8930 Produce a Mach-o bundle format file.
8931 See man ld(1) for more information.
8932
8933 @item -bundle_loader @var{executable}
8934 @opindex bundle_loader
8935 This option specifies the @var{executable} that will be loading the build
8936 output file being linked.  See man ld(1) for more information.
8937
8938 @item -dynamiclib
8939 @opindex dynamiclib
8940 When passed this option, GCC will produce a dynamic library instead of
8941 an executable when linking, using the Darwin @file{libtool} command.
8942
8943 @item -force_cpusubtype_ALL
8944 @opindex force_cpusubtype_ALL
8945 This causes GCC's output file to have the @var{ALL} subtype, instead of
8946 one controlled by the @option{-mcpu} or @option{-march} option.
8947
8948 @item -allowable_client  @var{client_name}
8949 @itemx -client_name
8950 @itemx -compatibility_version
8951 @itemx -current_version
8952 @itemx -dead_strip
8953 @itemx -dependency-file
8954 @itemx -dylib_file
8955 @itemx -dylinker_install_name
8956 @itemx -dynamic
8957 @itemx -exported_symbols_list
8958 @itemx -filelist
8959 @itemx -flat_namespace
8960 @itemx -force_flat_namespace
8961 @itemx -headerpad_max_install_names
8962 @itemx -image_base
8963 @itemx -init
8964 @itemx -install_name
8965 @itemx -keep_private_externs
8966 @itemx -multi_module
8967 @itemx -multiply_defined
8968 @itemx -multiply_defined_unused
8969 @itemx -noall_load
8970 @itemx -no_dead_strip_inits_and_terms
8971 @itemx -nofixprebinding
8972 @itemx -nomultidefs
8973 @itemx -noprebind
8974 @itemx -noseglinkedit
8975 @itemx -pagezero_size
8976 @itemx -prebind
8977 @itemx -prebind_all_twolevel_modules
8978 @itemx -private_bundle
8979 @itemx -read_only_relocs
8980 @itemx -sectalign
8981 @itemx -sectobjectsymbols
8982 @itemx -whyload
8983 @itemx -seg1addr
8984 @itemx -sectcreate
8985 @itemx -sectobjectsymbols
8986 @itemx -sectorder
8987 @itemx -segaddr
8988 @itemx -segs_read_only_addr
8989 @itemx -segs_read_write_addr
8990 @itemx -seg_addr_table
8991 @itemx -seg_addr_table_filename
8992 @itemx -seglinkedit
8993 @itemx -segprot
8994 @itemx -segs_read_only_addr
8995 @itemx -segs_read_write_addr
8996 @itemx -single_module
8997 @itemx -static
8998 @itemx -sub_library
8999 @itemx -sub_umbrella
9000 @itemx -twolevel_namespace
9001 @itemx -umbrella
9002 @itemx -undefined
9003 @itemx -unexported_symbols_list
9004 @itemx -weak_reference_mismatches
9005 @itemx -whatsloaded
9006
9007 @opindex allowable_client
9008 @opindex client_name
9009 @opindex compatibility_version
9010 @opindex current_version
9011 @opindex dead_strip
9012 @opindex dependency-file
9013 @opindex dylib_file
9014 @opindex dylinker_install_name
9015 @opindex dynamic
9016 @opindex exported_symbols_list
9017 @opindex filelist
9018 @opindex flat_namespace
9019 @opindex force_flat_namespace
9020 @opindex headerpad_max_install_names
9021 @opindex image_base
9022 @opindex init
9023 @opindex install_name
9024 @opindex keep_private_externs
9025 @opindex multi_module
9026 @opindex multiply_defined
9027 @opindex multiply_defined_unused
9028 @opindex noall_load
9029 @opindex no_dead_strip_inits_and_terms
9030 @opindex nofixprebinding
9031 @opindex nomultidefs
9032 @opindex noprebind
9033 @opindex noseglinkedit
9034 @opindex pagezero_size
9035 @opindex prebind
9036 @opindex prebind_all_twolevel_modules
9037 @opindex private_bundle
9038 @opindex read_only_relocs
9039 @opindex sectalign
9040 @opindex sectobjectsymbols
9041 @opindex whyload
9042 @opindex seg1addr
9043 @opindex sectcreate
9044 @opindex sectobjectsymbols
9045 @opindex sectorder
9046 @opindex segaddr
9047 @opindex segs_read_only_addr
9048 @opindex segs_read_write_addr
9049 @opindex seg_addr_table
9050 @opindex seg_addr_table_filename
9051 @opindex seglinkedit
9052 @opindex segprot
9053 @opindex segs_read_only_addr
9054 @opindex segs_read_write_addr
9055 @opindex single_module
9056 @opindex static
9057 @opindex sub_library
9058 @opindex sub_umbrella
9059 @opindex twolevel_namespace
9060 @opindex umbrella
9061 @opindex undefined
9062 @opindex unexported_symbols_list
9063 @opindex weak_reference_mismatches
9064 @opindex whatsloaded
9065
9066 These options are passed to the Darwin linker.  The Darwin linker man page
9067 describes them in detail.
9068 @end table
9069
9070 @node DEC Alpha Options
9071 @subsection DEC Alpha Options
9072
9073 These @samp{-m} options are defined for the DEC Alpha implementations:
9074
9075 @table @gcctabopt
9076 @item -mno-soft-float
9077 @itemx -msoft-float
9078 @opindex mno-soft-float
9079 @opindex msoft-float
9080 Use (do not use) the hardware floating-point instructions for
9081 floating-point operations.  When @option{-msoft-float} is specified,
9082 functions in @file{libgcc.a} will be used to perform floating-point
9083 operations.  Unless they are replaced by routines that emulate the
9084 floating-point operations, or compiled in such a way as to call such
9085 emulations routines, these routines will issue floating-point
9086 operations.   If you are compiling for an Alpha without floating-point
9087 operations, you must ensure that the library is built so as not to call
9088 them.
9089
9090 Note that Alpha implementations without floating-point operations are
9091 required to have floating-point registers.
9092
9093 @item -mfp-reg
9094 @itemx -mno-fp-regs
9095 @opindex mfp-reg
9096 @opindex mno-fp-regs
9097 Generate code that uses (does not use) the floating-point register set.
9098 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
9099 register set is not used, floating point operands are passed in integer
9100 registers as if they were integers and floating-point results are passed
9101 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
9102 so any function with a floating-point argument or return value called by code
9103 compiled with @option{-mno-fp-regs} must also be compiled with that
9104 option.
9105
9106 A typical use of this option is building a kernel that does not use,
9107 and hence need not save and restore, any floating-point registers.
9108
9109 @item -mieee
9110 @opindex mieee
9111 The Alpha architecture implements floating-point hardware optimized for
9112 maximum performance.  It is mostly compliant with the IEEE floating
9113 point standard.  However, for full compliance, software assistance is
9114 required.  This option generates code fully IEEE compliant code
9115 @emph{except} that the @var{inexact-flag} is not maintained (see below).
9116 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
9117 defined during compilation.  The resulting code is less efficient but is
9118 able to correctly support denormalized numbers and exceptional IEEE
9119 values such as not-a-number and plus/minus infinity.  Other Alpha
9120 compilers call this option @option{-ieee_with_no_inexact}.
9121
9122 @item -mieee-with-inexact
9123 @opindex mieee-with-inexact
9124 This is like @option{-mieee} except the generated code also maintains
9125 the IEEE @var{inexact-flag}.  Turning on this option causes the
9126 generated code to implement fully-compliant IEEE math.  In addition to
9127 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
9128 macro.  On some Alpha implementations the resulting code may execute
9129 significantly slower than the code generated by default.  Since there is
9130 very little code that depends on the @var{inexact-flag}, you should
9131 normally not specify this option.  Other Alpha compilers call this
9132 option @option{-ieee_with_inexact}.
9133
9134 @item -mfp-trap-mode=@var{trap-mode}
9135 @opindex mfp-trap-mode
9136 This option controls what floating-point related traps are enabled.
9137 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
9138 The trap mode can be set to one of four values:
9139
9140 @table @samp
9141 @item n
9142 This is the default (normal) setting.  The only traps that are enabled
9143 are the ones that cannot be disabled in software (e.g., division by zero
9144 trap).
9145
9146 @item u
9147 In addition to the traps enabled by @samp{n}, underflow traps are enabled
9148 as well.
9149
9150 @item su
9151 Like @samp{u}, but the instructions are marked to be safe for software
9152 completion (see Alpha architecture manual for details).
9153
9154 @item sui
9155 Like @samp{su}, but inexact traps are enabled as well.
9156 @end table
9157
9158 @item -mfp-rounding-mode=@var{rounding-mode}
9159 @opindex mfp-rounding-mode
9160 Selects the IEEE rounding mode.  Other Alpha compilers call this option
9161 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
9162 of:
9163
9164 @table @samp
9165 @item n
9166 Normal IEEE rounding mode.  Floating point numbers are rounded towards
9167 the nearest machine number or towards the even machine number in case
9168 of a tie.
9169
9170 @item m
9171 Round towards minus infinity.
9172
9173 @item c
9174 Chopped rounding mode.  Floating point numbers are rounded towards zero.
9175
9176 @item d
9177 Dynamic rounding mode.  A field in the floating point control register
9178 (@var{fpcr}, see Alpha architecture reference manual) controls the
9179 rounding mode in effect.  The C library initializes this register for
9180 rounding towards plus infinity.  Thus, unless your program modifies the
9181 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
9182 @end table
9183
9184 @item -mtrap-precision=@var{trap-precision}
9185 @opindex mtrap-precision
9186 In the Alpha architecture, floating point traps are imprecise.  This
9187 means without software assistance it is impossible to recover from a
9188 floating trap and program execution normally needs to be terminated.
9189 GCC can generate code that can assist operating system trap handlers
9190 in determining the exact location that caused a floating point trap.
9191 Depending on the requirements of an application, different levels of
9192 precisions can be selected:
9193
9194 @table @samp
9195 @item p
9196 Program precision.  This option is the default and means a trap handler
9197 can only identify which program caused a floating point exception.
9198
9199 @item f
9200 Function precision.  The trap handler can determine the function that
9201 caused a floating point exception.
9202
9203 @item i
9204 Instruction precision.  The trap handler can determine the exact
9205 instruction that caused a floating point exception.
9206 @end table
9207
9208 Other Alpha compilers provide the equivalent options called
9209 @option{-scope_safe} and @option{-resumption_safe}.
9210
9211 @item -mieee-conformant
9212 @opindex mieee-conformant
9213 This option marks the generated code as IEEE conformant.  You must not
9214 use this option unless you also specify @option{-mtrap-precision=i} and either
9215 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
9216 is to emit the line @samp{.eflag 48} in the function prologue of the
9217 generated assembly file.  Under DEC Unix, this has the effect that
9218 IEEE-conformant math library routines will be linked in.
9219
9220 @item -mbuild-constants
9221 @opindex mbuild-constants
9222 Normally GCC examines a 32- or 64-bit integer constant to
9223 see if it can construct it from smaller constants in two or three
9224 instructions.  If it cannot, it will output the constant as a literal and
9225 generate code to load it from the data segment at runtime.
9226
9227 Use this option to require GCC to construct @emph{all} integer constants
9228 using code, even if it takes more instructions (the maximum is six).
9229
9230 You would typically use this option to build a shared library dynamic
9231 loader.  Itself a shared library, it must relocate itself in memory
9232 before it can find the variables and constants in its own data segment.
9233
9234 @item -malpha-as
9235 @itemx -mgas
9236 @opindex malpha-as
9237 @opindex mgas
9238 Select whether to generate code to be assembled by the vendor-supplied
9239 assembler (@option{-malpha-as}) or by the GNU assembler @option{-mgas}.
9240
9241 @item -mbwx
9242 @itemx -mno-bwx
9243 @itemx -mcix
9244 @itemx -mno-cix
9245 @itemx -mfix
9246 @itemx -mno-fix
9247 @itemx -mmax
9248 @itemx -mno-max
9249 @opindex mbwx
9250 @opindex mno-bwx
9251 @opindex mcix
9252 @opindex mno-cix
9253 @opindex mfix
9254 @opindex mno-fix
9255 @opindex mmax
9256 @opindex mno-max
9257 Indicate whether GCC should generate code to use the optional BWX,
9258 CIX, FIX and MAX instruction sets.  The default is to use the instruction
9259 sets supported by the CPU type specified via @option{-mcpu=} option or that
9260 of the CPU on which GCC was built if none was specified.
9261
9262 @item -mfloat-vax
9263 @itemx -mfloat-ieee
9264 @opindex mfloat-vax
9265 @opindex mfloat-ieee
9266 Generate code that uses (does not use) VAX F and G floating point
9267 arithmetic instead of IEEE single and double precision.
9268
9269 @item -mexplicit-relocs
9270 @itemx -mno-explicit-relocs
9271 @opindex mexplicit-relocs
9272 @opindex mno-explicit-relocs
9273 Older Alpha assemblers provided no way to generate symbol relocations
9274 except via assembler macros.  Use of these macros does not allow
9275 optimal instruction scheduling.  GNU binutils as of version 2.12
9276 supports a new syntax that allows the compiler to explicitly mark
9277 which relocations should apply to which instructions.  This option
9278 is mostly useful for debugging, as GCC detects the capabilities of
9279 the assembler when it is built and sets the default accordingly.
9280
9281 @item -msmall-data
9282 @itemx -mlarge-data
9283 @opindex msmall-data
9284 @opindex mlarge-data
9285 When @option{-mexplicit-relocs} is in effect, static data is
9286 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
9287 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
9288 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
9289 16-bit relocations off of the @code{$gp} register.  This limits the
9290 size of the small data area to 64KB, but allows the variables to be
9291 directly accessed via a single instruction.
9292
9293 The default is @option{-mlarge-data}.  With this option the data area
9294 is limited to just below 2GB@.  Programs that require more than 2GB of
9295 data must use @code{malloc} or @code{mmap} to allocate the data in the
9296 heap instead of in the program's data segment.
9297
9298 When generating code for shared libraries, @option{-fpic} implies
9299 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
9300
9301 @item -msmall-text
9302 @itemx -mlarge-text
9303 @opindex msmall-text
9304 @opindex mlarge-text
9305 When @option{-msmall-text} is used, the compiler assumes that the
9306 code of the entire program (or shared library) fits in 4MB, and is
9307 thus reachable with a branch instruction.  When @option{-msmall-data}
9308 is used, the compiler can assume that all local symbols share the
9309 same @code{$gp} value, and thus reduce the number of instructions
9310 required for a function call from 4 to 1.
9311
9312 The default is @option{-mlarge-text}.
9313
9314 @item -mcpu=@var{cpu_type}
9315 @opindex mcpu
9316 Set the instruction set and instruction scheduling parameters for
9317 machine type @var{cpu_type}.  You can specify either the @samp{EV}
9318 style name or the corresponding chip number.  GCC supports scheduling
9319 parameters for the EV4, EV5 and EV6 family of processors and will
9320 choose the default values for the instruction set from the processor
9321 you specify.  If you do not specify a processor type, GCC will default
9322 to the processor on which the compiler was built.
9323
9324 Supported values for @var{cpu_type} are
9325
9326 @table @samp
9327 @item ev4
9328 @itemx ev45
9329 @itemx 21064
9330 Schedules as an EV4 and has no instruction set extensions.
9331
9332 @item ev5
9333 @itemx 21164
9334 Schedules as an EV5 and has no instruction set extensions.
9335
9336 @item ev56
9337 @itemx 21164a
9338 Schedules as an EV5 and supports the BWX extension.
9339
9340 @item pca56
9341 @itemx 21164pc
9342 @itemx 21164PC
9343 Schedules as an EV5 and supports the BWX and MAX extensions.
9344
9345 @item ev6
9346 @itemx 21264
9347 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
9348
9349 @item ev67
9350 @itemx 21264a
9351 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
9352 @end table
9353
9354 @item -mtune=@var{cpu_type}
9355 @opindex mtune
9356 Set only the instruction scheduling parameters for machine type
9357 @var{cpu_type}.  The instruction set is not changed.
9358
9359 @item -mmemory-latency=@var{time}
9360 @opindex mmemory-latency
9361 Sets the latency the scheduler should assume for typical memory
9362 references as seen by the application.  This number is highly
9363 dependent on the memory access patterns used by the application
9364 and the size of the external cache on the machine.
9365
9366 Valid options for @var{time} are
9367
9368 @table @samp
9369 @item @var{number}
9370 A decimal number representing clock cycles.
9371
9372 @item L1
9373 @itemx L2
9374 @itemx L3
9375 @itemx main
9376 The compiler contains estimates of the number of clock cycles for
9377 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
9378 (also called Dcache, Scache, and Bcache), as well as to main memory.
9379 Note that L3 is only valid for EV5.
9380
9381 @end table
9382 @end table
9383
9384 @node DEC Alpha/VMS Options
9385 @subsection DEC Alpha/VMS Options
9386
9387 These @samp{-m} options are defined for the DEC Alpha/VMS implementations:
9388
9389 @table @gcctabopt
9390 @item -mvms-return-codes
9391 @opindex mvms-return-codes
9392 Return VMS condition codes from main.  The default is to return POSIX
9393 style condition (e.g.@: error) codes.
9394 @end table
9395
9396 @node FRV Options
9397 @subsection FRV Options
9398 @cindex FRV Options
9399
9400 @table @gcctabopt
9401 @item -mgpr-32
9402 @opindex mgpr-32
9403
9404 Only use the first 32 general purpose registers.
9405
9406 @item -mgpr-64
9407 @opindex mgpr-64
9408
9409 Use all 64 general purpose registers.
9410
9411 @item -mfpr-32
9412 @opindex mfpr-32
9413
9414 Use only the first 32 floating point registers.
9415
9416 @item -mfpr-64
9417 @opindex mfpr-64
9418
9419 Use all 64 floating point registers
9420
9421 @item -mhard-float
9422 @opindex mhard-float
9423
9424 Use hardware instructions for floating point operations.
9425
9426 @item -msoft-float
9427 @opindex msoft-float
9428
9429 Use library routines for floating point operations.
9430
9431 @item -malloc-cc
9432 @opindex malloc-cc
9433
9434 Dynamically allocate condition code registers.
9435
9436 @item -mfixed-cc
9437 @opindex mfixed-cc
9438
9439 Do not try to dynamically allocate condition code registers, only
9440 use @code{icc0} and @code{fcc0}.
9441
9442 @item -mdword
9443 @opindex mdword
9444
9445 Change ABI to use double word insns.
9446
9447 @item -mno-dword
9448 @opindex mno-dword
9449
9450 Do not use double word instructions.
9451
9452 @item -mdouble
9453 @opindex mdouble
9454
9455 Use floating point double instructions.
9456
9457 @item -mno-double
9458 @opindex mno-double
9459
9460 Do not use floating point double instructions.
9461
9462 @item -mmedia
9463 @opindex mmedia
9464
9465 Use media instructions.
9466
9467 @item -mno-media
9468 @opindex mno-media
9469
9470 Do not use media instructions.
9471
9472 @item -mmuladd
9473 @opindex mmuladd
9474
9475 Use multiply and add/subtract instructions.
9476
9477 @item -mno-muladd
9478 @opindex mno-muladd
9479
9480 Do not use multiply and add/subtract instructions.
9481
9482 @item -mfdpic
9483 @opindex mfdpic
9484
9485 Select the FDPIC ABI, that uses function descriptors to represent
9486 pointers to functions.  Without any PIC/PIE-related options, it
9487 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
9488 assumes GOT entries and small data are within a 12-bit range from the
9489 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
9490 are computed with 32 bits.
9491
9492 @item -minline-plt
9493 @opindex minline-plt
9494
9495 Enable inlining of PLT entries in function calls to functions that are
9496 not known to bind locally.  It has no effect without @option{-mfdpic}.
9497 It's enabled by default if optimizing for speed and compiling for
9498 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
9499 optimization option such as @option{-O3} or above is present in the
9500 command line.
9501
9502 @item -mTLS
9503 @opindex TLS
9504
9505 Assume a large TLS segment when generating thread-local code.
9506
9507 @item -mtls
9508 @opindex tls
9509
9510 Do not assume a large TLS segment when generating thread-local code.
9511
9512 @item -mgprel-ro
9513 @opindex mgprel-ro
9514
9515 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
9516 that is known to be in read-only sections.  It's enabled by default,
9517 except for @option{-fpic} or @option{-fpie}: even though it may help
9518 make the global offset table smaller, it trades 1 instruction for 4.
9519 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
9520 one of which may be shared by multiple symbols, and it avoids the need
9521 for a GOT entry for the referenced symbol, so it's more likely to be a
9522 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
9523
9524 @item -multilib-library-pic
9525 @opindex multilib-library-pic
9526
9527 Link with the (library, not FD) pic libraries.  It's implied by
9528 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
9529 @option{-fpic} without @option{-mfdpic}.  You should never have to use
9530 it explicitly.
9531
9532 @item -mlinked-fp
9533 @opindex mlinked-fp
9534
9535 Follow the EABI requirement of always creating a frame pointer whenever
9536 a stack frame is allocated.  This option is enabled by default and can
9537 be disabled with @option{-mno-linked-fp}.
9538
9539 @item -mlong-calls
9540 @opindex mlong-calls
9541
9542 Use indirect addressing to call functions outside the current
9543 compilation unit.  This allows the functions to be placed anywhere
9544 within the 32-bit address space.
9545
9546 @item -malign-labels
9547 @opindex malign-labels
9548
9549 Try to align labels to an 8-byte boundary by inserting nops into the
9550 previous packet.  This option only has an effect when VLIW packing
9551 is enabled.  It doesn't create new packets; it merely adds nops to
9552 existing ones.
9553
9554 @item -mlibrary-pic
9555 @opindex mlibrary-pic
9556
9557 Generate position-independent EABI code.
9558
9559 @item -macc-4
9560 @opindex macc-4
9561
9562 Use only the first four media accumulator registers.
9563
9564 @item -macc-8
9565 @opindex macc-8
9566
9567 Use all eight media accumulator registers.
9568
9569 @item -mpack
9570 @opindex mpack
9571
9572 Pack VLIW instructions.
9573
9574 @item -mno-pack
9575 @opindex mno-pack
9576
9577 Do not pack VLIW instructions.
9578
9579 @item -mno-eflags
9580 @opindex mno-eflags
9581
9582 Do not mark ABI switches in e_flags.
9583
9584 @item -mcond-move
9585 @opindex mcond-move
9586
9587 Enable the use of conditional-move instructions (default).
9588
9589 This switch is mainly for debugging the compiler and will likely be removed
9590 in a future version.
9591
9592 @item -mno-cond-move
9593 @opindex mno-cond-move
9594
9595 Disable the use of conditional-move instructions.
9596
9597 This switch is mainly for debugging the compiler and will likely be removed
9598 in a future version.
9599
9600 @item -mscc
9601 @opindex mscc
9602
9603 Enable the use of conditional set instructions (default).
9604
9605 This switch is mainly for debugging the compiler and will likely be removed
9606 in a future version.
9607
9608 @item -mno-scc
9609 @opindex mno-scc
9610
9611 Disable the use of conditional set instructions.
9612
9613 This switch is mainly for debugging the compiler and will likely be removed
9614 in a future version.
9615
9616 @item -mcond-exec
9617 @opindex mcond-exec
9618
9619 Enable the use of conditional execution (default).
9620
9621 This switch is mainly for debugging the compiler and will likely be removed
9622 in a future version.
9623
9624 @item -mno-cond-exec
9625 @opindex mno-cond-exec
9626
9627 Disable the use of conditional execution.
9628
9629 This switch is mainly for debugging the compiler and will likely be removed
9630 in a future version.
9631
9632 @item -mvliw-branch
9633 @opindex mvliw-branch
9634
9635 Run a pass to pack branches into VLIW instructions (default).
9636
9637 This switch is mainly for debugging the compiler and will likely be removed
9638 in a future version.
9639
9640 @item -mno-vliw-branch
9641 @opindex mno-vliw-branch
9642
9643 Do not run a pass to pack branches into VLIW instructions.
9644
9645 This switch is mainly for debugging the compiler and will likely be removed
9646 in a future version.
9647
9648 @item -mmulti-cond-exec
9649 @opindex mmulti-cond-exec
9650
9651 Enable optimization of @code{&&} and @code{||} in conditional execution
9652 (default).
9653
9654 This switch is mainly for debugging the compiler and will likely be removed
9655 in a future version.
9656
9657 @item -mno-multi-cond-exec
9658 @opindex mno-multi-cond-exec
9659
9660 Disable optimization of @code{&&} and @code{||} in conditional execution.
9661
9662 This switch is mainly for debugging the compiler and will likely be removed
9663 in a future version.
9664
9665 @item -mnested-cond-exec
9666 @opindex mnested-cond-exec
9667
9668 Enable nested conditional execution optimizations (default).
9669
9670 This switch is mainly for debugging the compiler and will likely be removed
9671 in a future version.
9672
9673 @item -mno-nested-cond-exec
9674 @opindex mno-nested-cond-exec
9675
9676 Disable nested conditional execution optimizations.
9677
9678 This switch is mainly for debugging the compiler and will likely be removed
9679 in a future version.
9680
9681 @item -moptimize-membar
9682 @opindex moptimize-membar
9683
9684 This switch removes redundant @code{membar} instructions from the
9685 compiler generated code.  It is enabled by default.
9686
9687 @item -mno-optimize-membar
9688 @opindex mno-optimize-membar
9689
9690 This switch disables the automatic removal of redundant @code{membar}
9691 instructions from the generated code.
9692
9693 @item -mtomcat-stats
9694 @opindex mtomcat-stats
9695
9696 Cause gas to print out tomcat statistics.
9697
9698 @item -mcpu=@var{cpu}
9699 @opindex mcpu
9700
9701 Select the processor type for which to generate code.  Possible values are
9702 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
9703 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
9704
9705 @end table
9706
9707 @node GNU/Linux Options
9708 @subsection GNU/Linux Options
9709
9710 These @samp{-m} options are defined for GNU/Linux targets:
9711
9712 @table @gcctabopt
9713 @item -mglibc
9714 @opindex mglibc
9715 Use the GNU C library instead of uClibc.  This is the default except
9716 on @samp{*-*-linux-*uclibc*} targets.
9717
9718 @item -muclibc
9719 @opindex muclibc
9720 Use uClibc instead of the GNU C library.  This is the default on
9721 @samp{*-*-linux-*uclibc*} targets.
9722 @end table
9723
9724 @node H8/300 Options
9725 @subsection H8/300 Options
9726
9727 These @samp{-m} options are defined for the H8/300 implementations:
9728
9729 @table @gcctabopt
9730 @item -mrelax
9731 @opindex mrelax
9732 Shorten some address references at link time, when possible; uses the
9733 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
9734 ld, Using ld}, for a fuller description.
9735
9736 @item -mh
9737 @opindex mh
9738 Generate code for the H8/300H@.
9739
9740 @item -ms
9741 @opindex ms
9742 Generate code for the H8S@.
9743
9744 @item -mn
9745 @opindex mn
9746 Generate code for the H8S and H8/300H in the normal mode.  This switch
9747 must be used either with @option{-mh} or @option{-ms}.
9748
9749 @item -ms2600
9750 @opindex ms2600
9751 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
9752
9753 @item -mint32
9754 @opindex mint32
9755 Make @code{int} data 32 bits by default.
9756
9757 @item -malign-300
9758 @opindex malign-300
9759 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
9760 The default for the H8/300H and H8S is to align longs and floats on 4
9761 byte boundaries.
9762 @option{-malign-300} causes them to be aligned on 2 byte boundaries.
9763 This option has no effect on the H8/300.
9764 @end table
9765
9766 @node HPPA Options
9767 @subsection HPPA Options
9768 @cindex HPPA Options
9769
9770 These @samp{-m} options are defined for the HPPA family of computers:
9771
9772 @table @gcctabopt
9773 @item -march=@var{architecture-type}
9774 @opindex march
9775 Generate code for the specified architecture.  The choices for
9776 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
9777 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
9778 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
9779 architecture option for your machine.  Code compiled for lower numbered
9780 architectures will run on higher numbered architectures, but not the
9781 other way around.
9782
9783 @item -mpa-risc-1-0
9784 @itemx -mpa-risc-1-1
9785 @itemx -mpa-risc-2-0
9786 @opindex mpa-risc-1-0
9787 @opindex mpa-risc-1-1
9788 @opindex mpa-risc-2-0
9789 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
9790
9791 @item -mbig-switch
9792 @opindex mbig-switch
9793 Generate code suitable for big switch tables.  Use this option only if
9794 the assembler/linker complain about out of range branches within a switch
9795 table.
9796
9797 @item -mjump-in-delay
9798 @opindex mjump-in-delay
9799 Fill delay slots of function calls with unconditional jump instructions
9800 by modifying the return pointer for the function call to be the target
9801 of the conditional jump.
9802
9803 @item -mdisable-fpregs
9804 @opindex mdisable-fpregs
9805 Prevent floating point registers from being used in any manner.  This is
9806 necessary for compiling kernels which perform lazy context switching of
9807 floating point registers.  If you use this option and attempt to perform
9808 floating point operations, the compiler will abort.
9809
9810 @item -mdisable-indexing
9811 @opindex mdisable-indexing
9812 Prevent the compiler from using indexing address modes.  This avoids some
9813 rather obscure problems when compiling MIG generated code under MACH@.
9814
9815 @item -mno-space-regs
9816 @opindex mno-space-regs
9817 Generate code that assumes the target has no space registers.  This allows
9818 GCC to generate faster indirect calls and use unscaled index address modes.
9819
9820 Such code is suitable for level 0 PA systems and kernels.
9821
9822 @item -mfast-indirect-calls
9823 @opindex mfast-indirect-calls
9824 Generate code that assumes calls never cross space boundaries.  This
9825 allows GCC to emit code which performs faster indirect calls.
9826
9827 This option will not work in the presence of shared libraries or nested
9828 functions.
9829
9830 @item -mfixed-range=@var{register-range}
9831 @opindex mfixed-range
9832 Generate code treating the given register range as fixed registers.
9833 A fixed register is one that the register allocator can not use.  This is
9834 useful when compiling kernel code.  A register range is specified as
9835 two registers separated by a dash.  Multiple register ranges can be
9836 specified separated by a comma.
9837
9838 @item -mlong-load-store
9839 @opindex mlong-load-store
9840 Generate 3-instruction load and store sequences as sometimes required by
9841 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
9842 the HP compilers.
9843
9844 @item -mportable-runtime
9845 @opindex mportable-runtime
9846 Use the portable calling conventions proposed by HP for ELF systems.
9847
9848 @item -mgas
9849 @opindex mgas
9850 Enable the use of assembler directives only GAS understands.
9851
9852 @item -mschedule=@var{cpu-type}
9853 @opindex mschedule
9854 Schedule code according to the constraints for the machine type
9855 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
9856 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
9857 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
9858 proper scheduling option for your machine.  The default scheduling is
9859 @samp{8000}.
9860
9861 @item -mlinker-opt
9862 @opindex mlinker-opt
9863 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
9864 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
9865 linkers in which they give bogus error messages when linking some programs.
9866
9867 @item -msoft-float
9868 @opindex msoft-float
9869 Generate output containing library calls for floating point.
9870 @strong{Warning:} the requisite libraries are not available for all HPPA
9871 targets.  Normally the facilities of the machine's usual C compiler are
9872 used, but this cannot be done directly in cross-compilation.  You must make
9873 your own arrangements to provide suitable library functions for
9874 cross-compilation.  The embedded target @samp{hppa1.1-*-pro}
9875 does provide software floating point support.
9876
9877 @option{-msoft-float} changes the calling convention in the output file;
9878 therefore, it is only useful if you compile @emph{all} of a program with
9879 this option.  In particular, you need to compile @file{libgcc.a}, the
9880 library that comes with GCC, with @option{-msoft-float} in order for
9881 this to work.
9882
9883 @item -msio
9884 @opindex msio
9885 Generate the predefine, @code{_SIO}, for server IO@.  The default is
9886 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
9887 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
9888 options are available under HP-UX and HI-UX@.
9889
9890 @item -mgnu-ld
9891 @opindex gnu-ld
9892 Use GNU ld specific options.  This passes @option{-shared} to ld when
9893 building a shared library.  It is the default when GCC is configured,
9894 explicitly or implicitly, with the GNU linker.  This option does not
9895 have any affect on which ld is called, it only changes what parameters
9896 are passed to that ld.  The ld that is called is determined by the
9897 @option{--with-ld} configure option, GCC's program search path, and
9898 finally by the user's @env{PATH}.  The linker used by GCC can be printed
9899 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
9900 on the 64 bit HP-UX GCC, i.e. configured with @samp{hppa*64*-*-hpux*}.
9901
9902 @item -mhp-ld
9903 @opindex hp-ld
9904 Use HP ld specific options.  This passes @option{-b} to ld when building
9905 a shared library and passes @option{+Accept TypeMismatch} to ld on all
9906 links.  It is the default when GCC is configured, explicitly or
9907 implicitly, with the HP linker.  This option does not have any affect on
9908 which ld is called, it only changes what parameters are passed to that
9909 ld.  The ld that is called is determined by the @option{--with-ld}
9910 configure option, GCC's program search path, and finally by the user's
9911 @env{PATH}.  The linker used by GCC can be printed using @samp{which
9912 `gcc -print-prog-name=ld`}.  This option is only available on the 64 bit
9913 HP-UX GCC, i.e. configured with @samp{hppa*64*-*-hpux*}.
9914
9915 @item -mlong-calls
9916 @opindex mno-long-calls
9917 Generate code that uses long call sequences.  This ensures that a call
9918 is always able to reach linker generated stubs.  The default is to generate
9919 long calls only when the distance from the call site to the beginning
9920 of the function or translation unit, as the case may be, exceeds a
9921 predefined limit set by the branch type being used.  The limits for
9922 normal calls are 7,600,000 and 240,000 bytes, respectively for the
9923 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
9924 240,000 bytes.
9925
9926 Distances are measured from the beginning of functions when using the
9927 @option{-ffunction-sections} option, or when using the @option{-mgas}
9928 and @option{-mno-portable-runtime} options together under HP-UX with
9929 the SOM linker.
9930
9931 It is normally not desirable to use this option as it will degrade
9932 performance.  However, it may be useful in large applications,
9933 particularly when partial linking is used to build the application.
9934
9935 The types of long calls used depends on the capabilities of the
9936 assembler and linker, and the type of code being generated.  The
9937 impact on systems that support long absolute calls, and long pic
9938 symbol-difference or pc-relative calls should be relatively small.
9939 However, an indirect call is used on 32-bit ELF systems in pic code
9940 and it is quite long.
9941
9942 @item -munix=@var{unix-std}
9943 @opindex march
9944 Generate compiler predefines and select a startfile for the specified
9945 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
9946 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
9947 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
9948 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
9949 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
9950 and later.
9951
9952 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
9953 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
9954 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
9955 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
9956 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
9957 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
9958
9959 It is @emph{important} to note that this option changes the interfaces
9960 for various library routines.  It also affects the operational behavior
9961 of the C library.  Thus, @emph{extreme} care is needed in using this
9962 option.
9963
9964 Library code that is intended to operate with more than one UNIX
9965 standard must test, set and restore the variable @var{__xpg4_extended_mask}
9966 as appropriate.  Most GNU software doesn't provide this capability.
9967
9968 @item -nolibdld
9969 @opindex nolibdld
9970 Suppress the generation of link options to search libdld.sl when the
9971 @option{-static} option is specified on HP-UX 10 and later.
9972
9973 @item -static
9974 @opindex static
9975 The HP-UX implementation of setlocale in libc has a dependency on
9976 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
9977 when the @option{-static} option is specified, special link options
9978 are needed to resolve this dependency.
9979
9980 On HP-UX 10 and later, the GCC driver adds the necessary options to
9981 link with libdld.sl when the @option{-static} option is specified.
9982 This causes the resulting binary to be dynamic.  On the 64-bit port,
9983 the linkers generate dynamic binaries by default in any case.  The
9984 @option{-nolibdld} option can be used to prevent the GCC driver from
9985 adding these link options.
9986
9987 @item -threads
9988 @opindex threads
9989 Add support for multithreading with the @dfn{dce thread} library
9990 under HP-UX@.  This option sets flags for both the preprocessor and
9991 linker.
9992 @end table
9993
9994 @node i386 and x86-64 Options
9995 @subsection Intel 386 and AMD x86-64 Options
9996 @cindex i386 Options
9997 @cindex x86-64 Options
9998 @cindex Intel 386 Options
9999 @cindex AMD x86-64 Options
10000
10001 These @samp{-m} options are defined for the i386 and x86-64 family of
10002 computers:
10003
10004 @table @gcctabopt
10005 @item -mtune=@var{cpu-type}
10006 @opindex mtune
10007 Tune to @var{cpu-type} everything applicable about the generated code, except
10008 for the ABI and the set of available instructions.  The choices for
10009 @var{cpu-type} are:
10010 @table @emph
10011 @item generic
10012 Produce code optimized for the most common IA32/AMD64/EM64T processors.
10013 If you know the CPU on which your code will run, then you should use
10014 the corresponding @option{-mtune} option instead of
10015 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
10016 of your application will have, then you should use this option.
10017
10018 As new processors are deployed in the marketplace, the behavior of this
10019 option will change.  Therefore, if you upgrade to a newer version of
10020 GCC, the code generated option will change to reflect the processors
10021 that were most common when that version of GCC was released.
10022
10023 There is no @option{-march=generic} option because @option{-march}
10024 indicates the instruction set the compiler can use, and there is no
10025 generic instruction set applicable to all processors.  In contrast,
10026 @option{-mtune} indicates the processor (or, in this case, collection of
10027 processors) for which the code is optimized.
10028 @item native
10029 This selects the CPU to tune for at compilation time by determining
10030 the processor type of the compiling machine.  Using @option{-mtune=native}
10031 will produce code optimized for the local machine under the constraints
10032 of the selected instruction set.  Using @option{-march=native} will
10033 enable all instruction subsets supported by the local machine (hence
10034 the result might not run on different machines).
10035 @item i386
10036 Original Intel's i386 CPU@.
10037 @item i486
10038 Intel's i486 CPU@.  (No scheduling is implemented for this chip.)
10039 @item i586, pentium
10040 Intel Pentium CPU with no MMX support.
10041 @item pentium-mmx
10042 Intel PentiumMMX CPU based on Pentium core with MMX instruction set support.
10043 @item pentiumpro
10044 Intel PentiumPro CPU@.
10045 @item i686
10046 Same as @code{generic}, but when used as @code{march} option, PentiumPro
10047 instruction set will be used, so the code will run on all i686 family chips.
10048 @item pentium2
10049 Intel Pentium2 CPU based on PentiumPro core with MMX instruction set support.
10050 @item pentium3, pentium3m
10051 Intel Pentium3 CPU based on PentiumPro core with MMX and SSE instruction set
10052 support.
10053 @item pentium-m
10054 Low power version of Intel Pentium3 CPU with MMX, SSE and SSE2 instruction set
10055 support.  Used by Centrino notebooks.
10056 @item pentium4, pentium4m
10057 Intel Pentium4 CPU with MMX, SSE and SSE2 instruction set support.
10058 @item prescott
10059 Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2 and SSE3 instruction
10060 set support.
10061 @item nocona
10062 Improved version of Intel Pentium4 CPU with 64-bit extensions, MMX, SSE,
10063 SSE2 and SSE3 instruction set support.
10064 @item core2
10065 Intel Core2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
10066 instruction set support.
10067 @item k6
10068 AMD K6 CPU with MMX instruction set support.
10069 @item k6-2, k6-3
10070 Improved versions of AMD K6 CPU with MMX and 3dNOW! instruction set support.
10071 @item athlon, athlon-tbird
10072 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and SSE prefetch instructions
10073 support.
10074 @item athlon-4, athlon-xp, athlon-mp
10075 Improved AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and full SSE
10076 instruction set support.
10077 @item k8, opteron, athlon64, athlon-fx
10078 AMD K8 core based CPUs with x86-64 instruction set support.  (This supersets
10079 MMX, SSE, SSE2, 3dNOW!, enhanced 3dNOW! and 64-bit instruction set extensions.)
10080 @item k8-sse3, opteron-sse3, athlon64-sse3
10081 Improved versions of k8, opteron and athlon64 with SSE3 instruction set support.
10082 @item amdfam10, barcelona
10083 AMD Family 10h core based CPUs with x86-64 instruction set support.  (This
10084 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3dNOW!, enhanced 3dNOW!, ABM and 64-bit
10085 instruction set extensions.)
10086 @item winchip-c6
10087 IDT Winchip C6 CPU, dealt in same way as i486 with additional MMX instruction
10088 set support.
10089 @item winchip2
10090 IDT Winchip2 CPU, dealt in same way as i486 with additional MMX and 3dNOW!
10091 instruction set support.
10092 @item c3
10093 Via C3 CPU with MMX and 3dNOW! instruction set support.  (No scheduling is
10094 implemented for this chip.)
10095 @item c3-2
10096 Via C3-2 CPU with MMX and SSE instruction set support.  (No scheduling is
10097 implemented for this chip.)
10098 @item geode
10099 Embedded AMD CPU with MMX and 3dNOW! instruction set support.
10100 @end table
10101
10102 While picking a specific @var{cpu-type} will schedule things appropriately
10103 for that particular chip, the compiler will not generate any code that
10104 does not run on the i386 without the @option{-march=@var{cpu-type}} option
10105 being used.
10106
10107 @item -march=@var{cpu-type}
10108 @opindex march
10109 Generate instructions for the machine type @var{cpu-type}.  The choices
10110 for @var{cpu-type} are the same as for @option{-mtune}.  Moreover,
10111 specifying @option{-march=@var{cpu-type}} implies @option{-mtune=@var{cpu-type}}.
10112
10113 @item -mcpu=@var{cpu-type}
10114 @opindex mcpu
10115 A deprecated synonym for @option{-mtune}.
10116
10117 @item -mfpmath=@var{unit}
10118 @opindex march
10119 Generate floating point arithmetics for selected unit @var{unit}.  The choices
10120 for @var{unit} are:
10121
10122 @table @samp
10123 @item 387
10124 Use the standard 387 floating point coprocessor present majority of chips and
10125 emulated otherwise.  Code compiled with this option will run almost everywhere.
10126 The temporary results are computed in 80bit precision instead of precision
10127 specified by the type resulting in slightly different results compared to most
10128 of other chips.  See @option{-ffloat-store} for more detailed description.
10129
10130 This is the default choice for i386 compiler.
10131
10132 @item sse
10133 Use scalar floating point instructions present in the SSE instruction set.
10134 This instruction set is supported by Pentium3 and newer chips, in the AMD line
10135 by Athlon-4, Athlon-xp and Athlon-mp chips.  The earlier version of SSE
10136 instruction set supports only single precision arithmetics, thus the double and
10137 extended precision arithmetics is still done using 387.  Later version, present
10138 only in Pentium4 and the future AMD x86-64 chips supports double precision
10139 arithmetics too.
10140
10141 For the i386 compiler, you need to use @option{-march=@var{cpu-type}}, @option{-msse}
10142 or @option{-msse2} switches to enable SSE extensions and make this option
10143 effective.  For the x86-64 compiler, these extensions are enabled by default.
10144
10145 The resulting code should be considerably faster in the majority of cases and avoid
10146 the numerical instability problems of 387 code, but may break some existing
10147 code that expects temporaries to be 80bit.
10148
10149 This is the default choice for the x86-64 compiler.
10150
10151 @item sse,387
10152 Attempt to utilize both instruction sets at once.  This effectively double the
10153 amount of available registers and on chips with separate execution units for
10154 387 and SSE the execution resources too.  Use this option with care, as it is
10155 still experimental, because the GCC register allocator does not model separate
10156 functional units well resulting in instable performance.
10157 @end table
10158
10159 @item -masm=@var{dialect}
10160 @opindex masm=@var{dialect}
10161 Output asm instructions using selected @var{dialect}.  Supported
10162 choices are @samp{intel} or @samp{att} (the default one).  Darwin does
10163 not support @samp{intel}.
10164
10165 @item -mieee-fp
10166 @itemx -mno-ieee-fp
10167 @opindex mieee-fp
10168 @opindex mno-ieee-fp
10169 Control whether or not the compiler uses IEEE floating point
10170 comparisons.  These handle correctly the case where the result of a
10171 comparison is unordered.
10172
10173 @item -msoft-float
10174 @opindex msoft-float
10175 Generate output containing library calls for floating point.
10176 @strong{Warning:} the requisite libraries are not part of GCC@.
10177 Normally the facilities of the machine's usual C compiler are used, but
10178 this can't be done directly in cross-compilation.  You must make your
10179 own arrangements to provide suitable library functions for
10180 cross-compilation.
10181
10182 On machines where a function returns floating point results in the 80387
10183 register stack, some floating point opcodes may be emitted even if
10184 @option{-msoft-float} is used.
10185
10186 @item -mno-fp-ret-in-387
10187 @opindex mno-fp-ret-in-387
10188 Do not use the FPU registers for return values of functions.
10189
10190 The usual calling convention has functions return values of types
10191 @code{float} and @code{double} in an FPU register, even if there
10192 is no FPU@.  The idea is that the operating system should emulate
10193 an FPU@.
10194
10195 The option @option{-mno-fp-ret-in-387} causes such values to be returned
10196 in ordinary CPU registers instead.
10197
10198 @item -mno-fancy-math-387
10199 @opindex mno-fancy-math-387
10200 Some 387 emulators do not support the @code{sin}, @code{cos} and
10201 @code{sqrt} instructions for the 387.  Specify this option to avoid
10202 generating those instructions.  This option is the default on FreeBSD,
10203 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
10204 indicates that the target cpu will always have an FPU and so the
10205 instruction will not need emulation.  As of revision 2.6.1, these
10206 instructions are not generated unless you also use the
10207 @option{-funsafe-math-optimizations} switch.
10208
10209 @item -malign-double
10210 @itemx -mno-align-double
10211 @opindex malign-double
10212 @opindex mno-align-double
10213 Control whether GCC aligns @code{double}, @code{long double}, and
10214 @code{long long} variables on a two word boundary or a one word
10215 boundary.  Aligning @code{double} variables on a two word boundary will
10216 produce code that runs somewhat faster on a @samp{Pentium} at the
10217 expense of more memory.
10218
10219 On x86-64, @option{-malign-double} is enabled by default.
10220
10221 @strong{Warning:} if you use the @option{-malign-double} switch,
10222 structures containing the above types will be aligned differently than
10223 the published application binary interface specifications for the 386
10224 and will not be binary compatible with structures in code compiled
10225 without that switch.
10226
10227 @item -m96bit-long-double
10228 @itemx -m128bit-long-double
10229 @opindex m96bit-long-double
10230 @opindex m128bit-long-double
10231 These switches control the size of @code{long double} type.  The i386
10232 application binary interface specifies the size to be 96 bits,
10233 so @option{-m96bit-long-double} is the default in 32 bit mode.
10234
10235 Modern architectures (Pentium and newer) would prefer @code{long double}
10236 to be aligned to an 8 or 16 byte boundary.  In arrays or structures
10237 conforming to the ABI, this would not be possible.  So specifying a
10238 @option{-m128bit-long-double} will align @code{long double}
10239 to a 16 byte boundary by padding the @code{long double} with an additional
10240 32 bit zero.
10241
10242 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
10243 its ABI specifies that @code{long double} is to be aligned on 16 byte boundary.
10244
10245 Notice that neither of these options enable any extra precision over the x87
10246 standard of 80 bits for a @code{long double}.
10247
10248 @strong{Warning:} if you override the default value for your target ABI, the
10249 structures and arrays containing @code{long double} variables will change
10250 their size as well as function calling convention for function taking
10251 @code{long double} will be modified.  Hence they will not be binary
10252 compatible with arrays or structures in code compiled without that switch.
10253
10254 @item -mmlarge-data-threshold=@var{number}
10255 @opindex mlarge-data-threshold=@var{number}
10256 When @option{-mcmodel=medium} is specified, the data greater than
10257 @var{threshold} are placed in large data section.  This value must be the
10258 same across all object linked into the binary and defaults to 65535.
10259
10260 @item -mrtd
10261 @opindex mrtd
10262 Use a different function-calling convention, in which functions that
10263 take a fixed number of arguments return with the @code{ret} @var{num}
10264 instruction, which pops their arguments while returning.  This saves one
10265 instruction in the caller since there is no need to pop the arguments
10266 there.
10267
10268 You can specify that an individual function is called with this calling
10269 sequence with the function attribute @samp{stdcall}.  You can also
10270 override the @option{-mrtd} option by using the function attribute
10271 @samp{cdecl}.  @xref{Function Attributes}.
10272
10273 @strong{Warning:} this calling convention is incompatible with the one
10274 normally used on Unix, so you cannot use it if you need to call
10275 libraries compiled with the Unix compiler.
10276
10277 Also, you must provide function prototypes for all functions that
10278 take variable numbers of arguments (including @code{printf});
10279 otherwise incorrect code will be generated for calls to those
10280 functions.
10281
10282 In addition, seriously incorrect code will result if you call a
10283 function with too many arguments.  (Normally, extra arguments are
10284 harmlessly ignored.)
10285
10286 @item -mregparm=@var{num}
10287 @opindex mregparm
10288 Control how many registers are used to pass integer arguments.  By
10289 default, no registers are used to pass arguments, and at most 3
10290 registers can be used.  You can control this behavior for a specific
10291 function by using the function attribute @samp{regparm}.
10292 @xref{Function Attributes}.
10293
10294 @strong{Warning:} if you use this switch, and
10295 @var{num} is nonzero, then you must build all modules with the same
10296 value, including any libraries.  This includes the system libraries and
10297 startup modules.
10298
10299 @item -msseregparm
10300 @opindex msseregparm
10301 Use SSE register passing conventions for float and double arguments
10302 and return values.  You can control this behavior for a specific
10303 function by using the function attribute @samp{sseregparm}.
10304 @xref{Function Attributes}.
10305
10306 @strong{Warning:} if you use this switch then you must build all
10307 modules with the same value, including any libraries.  This includes
10308 the system libraries and startup modules.
10309
10310 @item -mpc32
10311 @itemx -mpc64
10312 @itemx -mpc80
10313 @opindex mpc32
10314 @opindex mpc64
10315 @opindex mpc80
10316
10317 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
10318 is specified, the significands of results of floating-point operations are
10319 rounded to 24 bits (single precision); @option{-mpc64} rounds the the
10320 significands of results of floating-point operations to 53 bits (double
10321 precision) and @option{-mpc80} rounds the significands of results of
10322 floating-point operations to 64 bits (extended double precision), which is
10323 the default.  When this option is used, floating-point operations in higher
10324 precisions are not available to the programmer without setting the FPU
10325 control word explicitly.
10326
10327 Setting the rounding of floating-point operations to less than the default
10328 80 bits can speed some programs by 2% or more.  Note that some mathematical
10329 libraries assume that extended precision (80 bit) floating-point operations
10330 are enabled by default; routines in such libraries could suffer significant
10331 loss of accuracy, typically through so-called "catastrophic cancellation",
10332 when this option is used to set the precision to less than extended precision. 
10333
10334 @item -mstackrealign
10335 @opindex mstackrealign
10336 Realign the stack at entry.  On the Intel x86, the
10337 @option{-mstackrealign} option will generate an alternate prologue and
10338 epilogue that realigns the runtime stack.  This supports mixing legacy
10339 codes that keep a 4-byte aligned stack with modern codes that keep a
10340 16-byte stack for SSE compatibility.  The alternate prologue and
10341 epilogue are slower and bigger than the regular ones, and the
10342 alternate prologue requires an extra scratch register; this lowers the
10343 number of registers available if used in conjunction with the
10344 @code{regparm} attribute.  The @option{-mstackrealign} option is
10345 incompatible with the nested function prologue; this is considered a
10346 hard error.  See also the attribute @code{force_align_arg_pointer},
10347 applicable to individual functions.
10348
10349 @item -mpreferred-stack-boundary=@var{num}
10350 @opindex mpreferred-stack-boundary
10351 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
10352 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
10353 the default is 4 (16 bytes or 128 bits).
10354
10355 On Pentium and PentiumPro, @code{double} and @code{long double} values
10356 should be aligned to an 8 byte boundary (see @option{-malign-double}) or
10357 suffer significant run time performance penalties.  On Pentium III, the
10358 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
10359 properly if it is not 16 byte aligned.
10360
10361 To ensure proper alignment of this values on the stack, the stack boundary
10362 must be as aligned as that required by any value stored on the stack.
10363 Further, every function must be generated such that it keeps the stack
10364 aligned.  Thus calling a function compiled with a higher preferred
10365 stack boundary from a function compiled with a lower preferred stack
10366 boundary will most likely misalign the stack.  It is recommended that
10367 libraries that use callbacks always use the default setting.
10368
10369 This extra alignment does consume extra stack space, and generally
10370 increases code size.  Code that is sensitive to stack space usage, such
10371 as embedded systems and operating system kernels, may want to reduce the
10372 preferred alignment to @option{-mpreferred-stack-boundary=2}.
10373
10374 @item -mmmx
10375 @itemx -mno-mmx
10376 @item -msse
10377 @itemx -mno-sse
10378 @item -msse2
10379 @itemx -mno-sse2
10380 @item -msse3
10381 @itemx -mno-sse3
10382 @item -mssse3
10383 @itemx -mno-ssse3
10384 @item -msse4.1
10385 @itemx -mno-sse4.1
10386 @item -msse4.2
10387 @itemx -mno-sse4.2
10388 @item -msse4
10389 @itemx -mno-sse4
10390 @item -msse4a
10391 @item -mno-sse4a
10392 @item -m3dnow
10393 @itemx -mno-3dnow
10394 @item -mpopcnt
10395 @itemx -mno-popcnt
10396 @item -mabm
10397 @itemx -mno-abm
10398 @opindex mmmx
10399 @opindex mno-mmx
10400 @opindex msse
10401 @opindex mno-sse
10402 @opindex m3dnow
10403 @opindex mno-3dnow
10404 These switches enable or disable the use of instructions in the MMX,
10405 SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4A, ABM or 3DNow! extended
10406 instruction sets.
10407 These extensions are also available as built-in functions: see
10408 @ref{X86 Built-in Functions}, for details of the functions enabled and
10409 disabled by these switches.
10410
10411 To have SSE/SSE2 instructions generated automatically from floating-point
10412 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
10413
10414 These options will enable GCC to use these extended instructions in
10415 generated code, even without @option{-mfpmath=sse}.  Applications which
10416 perform runtime CPU detection must compile separate files for each
10417 supported architecture, using the appropriate flags.  In particular,
10418 the file containing the CPU detection code should be compiled without
10419 these options.
10420
10421 @item -mcx16
10422 @opindex mcx16
10423 This option will enable GCC to use CMPXCHG16B instruction in generated code.
10424 CMPXCHG16B allows for atomic operations on 128-bit double quadword (or oword)
10425 data types.  This is useful for high resolution counters that could be updated
10426 by multiple processors (or cores).  This instruction is generated as part of
10427 atomic built-in functions: see @ref{Atomic Builtins} for details.
10428
10429 @item -msahf
10430 @opindex msahf
10431 This option will enable GCC to use SAHF instruction in generated 64-bit code.
10432 Early Intel CPUs with Intel 64 lacked LAHF and SAHF instructions supported
10433 by AMD64 until introduction of Pentium 4 G1 step in December 2005.  LAHF and
10434 SAHF are load and store instructions, respectively, for certain status flags.
10435 In 64-bit mode, SAHF instruction is used to optimize @code{fmod}, @code{drem}
10436 or @code{remainder} built-in functions: see @ref{Other Builtins} for details.
10437
10438 @item -mrecip
10439 @opindex mrecip
10440 This option will enable GCC to use RCPSS and RSQRTSS instructions (and their
10441 vectorized variants RCPPS and RSQRTPS) instead of DIVSS and SQRTSS (and their
10442 vectorized variants).  These instructions will be generated only when
10443 @option{-funsafe-math-optimizations} is enabled.
10444
10445 @item -mveclibabi=@var{type}
10446 @opindex mveclibabi
10447 Specifies the ABI type to use for vectorizing intrinsics using an
10448 external library.  Supported types are @code{acml} for the AMD
10449 math core library style of interfacing.  GCC will currently emit
10450 calls to @code{__vrd2_sin}, @code{__vrd2_cos}, @code{__vrd2_exp},
10451 @code{__vrd2_log}, @code{__vrd2_log2}, @code{__vrd2_log10},
10452 @code{__vrs4_sinf}, @code{__vrs4_cosf}, @code{__vrs4_expf},
10453 @code{__vrs4_logf}, @code{__vrs4_log2f}, @code{__vrs4_log10f}
10454 and @code{__vrs4_powf} when using this type and @option{-ftree-vectorize}
10455 is enabled.  A ACML ABI compatible library will have to be specified
10456 at link time.
10457
10458 @item -mpush-args
10459 @itemx -mno-push-args
10460 @opindex mpush-args
10461 @opindex mno-push-args
10462 Use PUSH operations to store outgoing parameters.  This method is shorter
10463 and usually equally fast as method using SUB/MOV operations and is enabled
10464 by default.  In some cases disabling it may improve performance because of
10465 improved scheduling and reduced dependencies.
10466
10467 @item -maccumulate-outgoing-args
10468 @opindex maccumulate-outgoing-args
10469 If enabled, the maximum amount of space required for outgoing arguments will be
10470 computed in the function prologue.  This is faster on most modern CPUs
10471 because of reduced dependencies, improved scheduling and reduced stack usage
10472 when preferred stack boundary is not equal to 2.  The drawback is a notable
10473 increase in code size.  This switch implies @option{-mno-push-args}.
10474
10475 @item -mthreads
10476 @opindex mthreads
10477 Support thread-safe exception handling on @samp{Mingw32}.  Code that relies
10478 on thread-safe exception handling must compile and link all code with the
10479 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
10480 @option{-D_MT}; when linking, it links in a special thread helper library
10481 @option{-lmingwthrd} which cleans up per thread exception handling data.
10482
10483 @item -mno-align-stringops
10484 @opindex mno-align-stringops
10485 Do not align destination of inlined string operations.  This switch reduces
10486 code size and improves performance in case the destination is already aligned,
10487 but GCC doesn't know about it.
10488
10489 @item -minline-all-stringops
10490 @opindex minline-all-stringops
10491 By default GCC inlines string operations only when destination is known to be
10492 aligned at least to 4 byte boundary.  This enables more inlining, increase code
10493 size, but may improve performance of code that depends on fast memcpy, strlen
10494 and memset for short lengths.
10495
10496 @item -minline-stringops-dynamically
10497 @opindex minline-stringops-dynamically
10498 For string operation of unknown size, inline runtime checks so for small
10499 blocks inline code is used, while for large blocks library call is used.
10500
10501 @item -mstringop-strategy=@var{alg}
10502 @opindex mstringop-strategy=@var{alg}
10503 Overwrite internal decision heuristic about particular algorithm to inline
10504 string operation with.  The allowed values are @code{rep_byte},
10505 @code{rep_4byte}, @code{rep_8byte} for expanding using i386 @code{rep} prefix
10506 of specified size, @code{byte_loop}, @code{loop}, @code{unrolled_loop} for
10507 expanding inline loop, @code{libcall} for always expanding library call.
10508
10509 @item -momit-leaf-frame-pointer
10510 @opindex momit-leaf-frame-pointer
10511 Don't keep the frame pointer in a register for leaf functions.  This
10512 avoids the instructions to save, set up and restore frame pointers and
10513 makes an extra register available in leaf functions.  The option
10514 @option{-fomit-frame-pointer} removes the frame pointer for all functions
10515 which might make debugging harder.
10516
10517 @item -mtls-direct-seg-refs
10518 @itemx -mno-tls-direct-seg-refs
10519 @opindex mtls-direct-seg-refs
10520 Controls whether TLS variables may be accessed with offsets from the
10521 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
10522 or whether the thread base pointer must be added.  Whether or not this
10523 is legal depends on the operating system, and whether it maps the
10524 segment to cover the entire TLS area.
10525
10526 For systems that use GNU libc, the default is on.
10527 @end table
10528
10529 These @samp{-m} switches are supported in addition to the above
10530 on AMD x86-64 processors in 64-bit environments.
10531
10532 @table @gcctabopt
10533 @item -m32
10534 @itemx -m64
10535 @opindex m32
10536 @opindex m64
10537 Generate code for a 32-bit or 64-bit environment.
10538 The 32-bit environment sets int, long and pointer to 32 bits and
10539 generates code that runs on any i386 system.
10540 The 64-bit environment sets int to 32 bits and long and pointer
10541 to 64 bits and generates code for AMD's x86-64 architecture. For
10542 darwin only the -m64 option turns off the @option{-fno-pic} and
10543 @option{-mdynamic-no-pic} options.
10544
10545 @item -mno-red-zone
10546 @opindex no-red-zone
10547 Do not use a so called red zone for x86-64 code.  The red zone is mandated
10548 by the x86-64 ABI, it is a 128-byte area beyond the location of the
10549 stack pointer that will not be modified by signal or interrupt handlers
10550 and therefore can be used for temporary data without adjusting the stack
10551 pointer.  The flag @option{-mno-red-zone} disables this red zone.
10552
10553 @item -mcmodel=small
10554 @opindex mcmodel=small
10555 Generate code for the small code model: the program and its symbols must
10556 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
10557 Programs can be statically or dynamically linked.  This is the default
10558 code model.
10559
10560 @item -mcmodel=kernel
10561 @opindex mcmodel=kernel
10562 Generate code for the kernel code model.  The kernel runs in the
10563 negative 2 GB of the address space.
10564 This model has to be used for Linux kernel code.
10565
10566 @item -mcmodel=medium
10567 @opindex mcmodel=medium
10568 Generate code for the medium model: The program is linked in the lower 2
10569 GB of the address space but symbols can be located anywhere in the
10570 address space.  Programs can be statically or dynamically linked, but
10571 building of shared libraries are not supported with the medium model.
10572
10573 @item -mcmodel=large
10574 @opindex mcmodel=large
10575 Generate code for the large model: This model makes no assumptions
10576 about addresses and sizes of sections.
10577 @end table
10578
10579 @node IA-64 Options
10580 @subsection IA-64 Options
10581 @cindex IA-64 Options
10582
10583 These are the @samp{-m} options defined for the Intel IA-64 architecture.
10584
10585 @table @gcctabopt
10586 @item -mbig-endian
10587 @opindex mbig-endian
10588 Generate code for a big endian target.  This is the default for HP-UX@.
10589
10590 @item -mlittle-endian
10591 @opindex mlittle-endian
10592 Generate code for a little endian target.  This is the default for AIX5
10593 and GNU/Linux.
10594
10595 @item -mgnu-as
10596 @itemx -mno-gnu-as
10597 @opindex mgnu-as
10598 @opindex mno-gnu-as
10599 Generate (or don't) code for the GNU assembler.  This is the default.
10600 @c Also, this is the default if the configure option @option{--with-gnu-as}
10601 @c is used.
10602
10603 @item -mgnu-ld
10604 @itemx -mno-gnu-ld
10605 @opindex mgnu-ld
10606 @opindex mno-gnu-ld
10607 Generate (or don't) code for the GNU linker.  This is the default.
10608 @c Also, this is the default if the configure option @option{--with-gnu-ld}
10609 @c is used.
10610
10611 @item -mno-pic
10612 @opindex mno-pic
10613 Generate code that does not use a global pointer register.  The result
10614 is not position independent code, and violates the IA-64 ABI@.
10615
10616 @item -mvolatile-asm-stop
10617 @itemx -mno-volatile-asm-stop
10618 @opindex mvolatile-asm-stop
10619 @opindex mno-volatile-asm-stop
10620 Generate (or don't) a stop bit immediately before and after volatile asm
10621 statements.
10622
10623 @item -mregister-names
10624 @itemx -mno-register-names
10625 @opindex mregister-names
10626 @opindex mno-register-names
10627 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
10628 the stacked registers.  This may make assembler output more readable.
10629
10630 @item -mno-sdata
10631 @itemx -msdata
10632 @opindex mno-sdata
10633 @opindex msdata
10634 Disable (or enable) optimizations that use the small data section.  This may
10635 be useful for working around optimizer bugs.
10636
10637 @item -mconstant-gp
10638 @opindex mconstant-gp
10639 Generate code that uses a single constant global pointer value.  This is
10640 useful when compiling kernel code.
10641
10642 @item -mauto-pic
10643 @opindex mauto-pic
10644 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
10645 This is useful when compiling firmware code.
10646
10647 @item -minline-float-divide-min-latency
10648 @opindex minline-float-divide-min-latency
10649 Generate code for inline divides of floating point values
10650 using the minimum latency algorithm.
10651
10652 @item -minline-float-divide-max-throughput
10653 @opindex minline-float-divide-max-throughput
10654 Generate code for inline divides of floating point values
10655 using the maximum throughput algorithm.
10656
10657 @item -minline-int-divide-min-latency
10658 @opindex minline-int-divide-min-latency
10659 Generate code for inline divides of integer values
10660 using the minimum latency algorithm.
10661
10662 @item -minline-int-divide-max-throughput
10663 @opindex minline-int-divide-max-throughput
10664 Generate code for inline divides of integer values
10665 using the maximum throughput algorithm.
10666
10667 @item -minline-sqrt-min-latency
10668 @opindex minline-sqrt-min-latency
10669 Generate code for inline square roots
10670 using the minimum latency algorithm.
10671
10672 @item -minline-sqrt-max-throughput
10673 @opindex minline-sqrt-max-throughput
10674 Generate code for inline square roots
10675 using the maximum throughput algorithm.
10676
10677 @item -mno-dwarf2-asm
10678 @itemx -mdwarf2-asm
10679 @opindex mno-dwarf2-asm
10680 @opindex mdwarf2-asm
10681 Don't (or do) generate assembler code for the DWARF2 line number debugging
10682 info.  This may be useful when not using the GNU assembler.
10683
10684 @item -mearly-stop-bits
10685 @itemx -mno-early-stop-bits
10686 @opindex mearly-stop-bits
10687 @opindex mno-early-stop-bits
10688 Allow stop bits to be placed earlier than immediately preceding the
10689 instruction that triggered the stop bit.  This can improve instruction
10690 scheduling, but does not always do so.
10691
10692 @item -mfixed-range=@var{register-range}
10693 @opindex mfixed-range
10694 Generate code treating the given register range as fixed registers.
10695 A fixed register is one that the register allocator can not use.  This is
10696 useful when compiling kernel code.  A register range is specified as
10697 two registers separated by a dash.  Multiple register ranges can be
10698 specified separated by a comma.
10699
10700 @item -mtls-size=@var{tls-size}
10701 @opindex mtls-size
10702 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
10703 64.
10704
10705 @item -mtune=@var{cpu-type}
10706 @opindex mtune
10707 Tune the instruction scheduling for a particular CPU, Valid values are
10708 itanium, itanium1, merced, itanium2, and mckinley.
10709
10710 @item -mt
10711 @itemx -pthread
10712 @opindex mt
10713 @opindex pthread
10714 Add support for multithreading using the POSIX threads library.  This
10715 option sets flags for both the preprocessor and linker.  It does
10716 not affect the thread safety of object code produced by the compiler or
10717 that of libraries supplied with it.  These are HP-UX specific flags.
10718
10719 @item -milp32
10720 @itemx -mlp64
10721 @opindex milp32
10722 @opindex mlp64
10723 Generate code for a 32-bit or 64-bit environment.
10724 The 32-bit environment sets int, long and pointer to 32 bits.
10725 The 64-bit environment sets int to 32 bits and long and pointer
10726 to 64 bits.  These are HP-UX specific flags.
10727
10728 @item -mno-sched-br-data-spec
10729 @itemx -msched-br-data-spec
10730 @opindex mno-sched-br-data-spec
10731 @opindex msched-br-data-spec
10732 (Dis/En)able data speculative scheduling before reload.
10733 This will result in generation of the ld.a instructions and
10734 the corresponding check instructions (ld.c / chk.a).
10735 The default is 'disable'.
10736
10737 @item -msched-ar-data-spec
10738 @itemx -mno-sched-ar-data-spec
10739 @opindex msched-ar-data-spec
10740 @opindex mno-sched-ar-data-spec
10741 (En/Dis)able data speculative scheduling after reload.
10742 This will result in generation of the ld.a instructions and
10743 the corresponding check instructions (ld.c / chk.a).
10744 The default is 'enable'.
10745
10746 @item -mno-sched-control-spec
10747 @itemx -msched-control-spec
10748 @opindex mno-sched-control-spec
10749 @opindex msched-control-spec
10750 (Dis/En)able control speculative scheduling.  This feature is
10751 available only during region scheduling (i.e. before reload).
10752 This will result in generation of the ld.s instructions and
10753 the corresponding check instructions chk.s .
10754 The default is 'disable'.
10755
10756 @item -msched-br-in-data-spec
10757 @itemx -mno-sched-br-in-data-spec
10758 @opindex msched-br-in-data-spec
10759 @opindex mno-sched-br-in-data-spec
10760 (En/Dis)able speculative scheduling of the instructions that
10761 are dependent on the data speculative loads before reload.
10762 This is effective only with @option{-msched-br-data-spec} enabled.
10763 The default is 'enable'.
10764
10765 @item -msched-ar-in-data-spec
10766 @itemx -mno-sched-ar-in-data-spec
10767 @opindex msched-ar-in-data-spec
10768 @opindex mno-sched-ar-in-data-spec
10769 (En/Dis)able speculative scheduling of the instructions that
10770 are dependent on the data speculative loads after reload.
10771 This is effective only with @option{-msched-ar-data-spec} enabled.
10772 The default is 'enable'.
10773
10774 @item -msched-in-control-spec
10775 @itemx -mno-sched-in-control-spec
10776 @opindex msched-in-control-spec
10777 @opindex mno-sched-in-control-spec
10778 (En/Dis)able speculative scheduling of the instructions that
10779 are dependent on the control speculative loads.
10780 This is effective only with @option{-msched-control-spec} enabled.
10781 The default is 'enable'.
10782
10783 @item -msched-ldc
10784 @itemx -mno-sched-ldc
10785 @opindex msched-ldc
10786 @opindex mno-sched-ldc
10787 (En/Dis)able use of simple data speculation checks ld.c .
10788 If disabled, only chk.a instructions will be emitted to check
10789 data speculative loads.
10790 The default is 'enable'.
10791
10792 @item -mno-sched-control-ldc
10793 @itemx -msched-control-ldc
10794 @opindex mno-sched-control-ldc
10795 @opindex msched-control-ldc
10796 (Dis/En)able use of ld.c instructions to check control speculative loads.
10797 If enabled, in case of control speculative load with no speculatively
10798 scheduled dependent instructions this load will be emitted as ld.sa and
10799 ld.c will be used to check it.
10800 The default is 'disable'.
10801
10802 @item -mno-sched-spec-verbose
10803 @itemx -msched-spec-verbose
10804 @opindex mno-sched-spec-verbose
10805 @opindex msched-spec-verbose
10806 (Dis/En)able printing of the information about speculative motions.
10807
10808 @item -mno-sched-prefer-non-data-spec-insns
10809 @itemx -msched-prefer-non-data-spec-insns
10810 @opindex mno-sched-prefer-non-data-spec-insns
10811 @opindex msched-prefer-non-data-spec-insns
10812 If enabled, data speculative instructions will be chosen for schedule
10813 only if there are no other choices at the moment.  This will make
10814 the use of the data speculation much more conservative.
10815 The default is 'disable'.
10816
10817 @item -mno-sched-prefer-non-control-spec-insns
10818 @itemx -msched-prefer-non-control-spec-insns
10819 @opindex mno-sched-prefer-non-control-spec-insns
10820 @opindex msched-prefer-non-control-spec-insns
10821 If enabled, control speculative instructions will be chosen for schedule
10822 only if there are no other choices at the moment.  This will make
10823 the use of the control speculation much more conservative.
10824 The default is 'disable'.
10825
10826 @item -mno-sched-count-spec-in-critical-path
10827 @itemx -msched-count-spec-in-critical-path
10828 @opindex mno-sched-count-spec-in-critical-path
10829 @opindex msched-count-spec-in-critical-path
10830 If enabled, speculative dependencies will be considered during
10831 computation of the instructions priorities.  This will make the use of the
10832 speculation a bit more conservative.
10833 The default is 'disable'.
10834
10835 @end table
10836
10837 @node M32C Options
10838 @subsection M32C Options
10839 @cindex M32C options
10840
10841 @table @gcctabopt
10842 @item -mcpu=@var{name}
10843 @opindex mcpu=
10844 Select the CPU for which code is generated.  @var{name} may be one of
10845 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
10846 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
10847 the M32C/80 series.
10848
10849 @item -msim
10850 @opindex msim
10851 Specifies that the program will be run on the simulator.  This causes
10852 an alternate runtime library to be linked in which supports, for
10853 example, file I/O.  You must not use this option when generating
10854 programs that will run on real hardware; you must provide your own
10855 runtime library for whatever I/O functions are needed.
10856
10857 @item -memregs=@var{number}
10858 @opindex memregs=
10859 Specifies the number of memory-based pseudo-registers GCC will use
10860 during code generation.  These pseudo-registers will be used like real
10861 registers, so there is a tradeoff between GCC's ability to fit the
10862 code into available registers, and the performance penalty of using
10863 memory instead of registers.  Note that all modules in a program must
10864 be compiled with the same value for this option.  Because of that, you
10865 must not use this option with the default runtime libraries gcc
10866 builds.
10867
10868 @end table
10869
10870 @node M32R/D Options
10871 @subsection M32R/D Options
10872 @cindex M32R/D options
10873
10874 These @option{-m} options are defined for Renesas M32R/D architectures:
10875
10876 @table @gcctabopt
10877 @item -m32r2
10878 @opindex m32r2
10879 Generate code for the M32R/2@.
10880
10881 @item -m32rx
10882 @opindex m32rx
10883 Generate code for the M32R/X@.
10884
10885 @item -m32r
10886 @opindex m32r
10887 Generate code for the M32R@.  This is the default.
10888
10889 @item -mmodel=small
10890 @opindex mmodel=small
10891 Assume all objects live in the lower 16MB of memory (so that their addresses
10892 can be loaded with the @code{ld24} instruction), and assume all subroutines
10893 are reachable with the @code{bl} instruction.
10894 This is the default.
10895
10896 The addressability of a particular object can be set with the
10897 @code{model} attribute.
10898
10899 @item -mmodel=medium
10900 @opindex mmodel=medium
10901 Assume objects may be anywhere in the 32-bit address space (the compiler
10902 will generate @code{seth/add3} instructions to load their addresses), and
10903 assume all subroutines are reachable with the @code{bl} instruction.
10904
10905 @item -mmodel=large
10906 @opindex mmodel=large
10907 Assume objects may be anywhere in the 32-bit address space (the compiler
10908 will generate @code{seth/add3} instructions to load their addresses), and
10909 assume subroutines may not be reachable with the @code{bl} instruction
10910 (the compiler will generate the much slower @code{seth/add3/jl}
10911 instruction sequence).
10912
10913 @item -msdata=none
10914 @opindex msdata=none
10915 Disable use of the small data area.  Variables will be put into
10916 one of @samp{.data}, @samp{bss}, or @samp{.rodata} (unless the
10917 @code{section} attribute has been specified).
10918 This is the default.
10919
10920 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
10921 Objects may be explicitly put in the small data area with the
10922 @code{section} attribute using one of these sections.
10923
10924 @item -msdata=sdata
10925 @opindex msdata=sdata
10926 Put small global and static data in the small data area, but do not
10927 generate special code to reference them.
10928
10929 @item -msdata=use
10930 @opindex msdata=use
10931 Put small global and static data in the small data area, and generate
10932 special instructions to reference them.
10933
10934 @item -G @var{num}
10935 @opindex G
10936 @cindex smaller data references
10937 Put global and static objects less than or equal to @var{num} bytes
10938 into the small data or bss sections instead of the normal data or bss
10939 sections.  The default value of @var{num} is 8.
10940 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
10941 for this option to have any effect.
10942
10943 All modules should be compiled with the same @option{-G @var{num}} value.
10944 Compiling with different values of @var{num} may or may not work; if it
10945 doesn't the linker will give an error message---incorrect code will not be
10946 generated.
10947
10948 @item -mdebug
10949 @opindex mdebug
10950 Makes the M32R specific code in the compiler display some statistics
10951 that might help in debugging programs.
10952
10953 @item -malign-loops
10954 @opindex malign-loops
10955 Align all loops to a 32-byte boundary.
10956
10957 @item -mno-align-loops
10958 @opindex mno-align-loops
10959 Do not enforce a 32-byte alignment for loops.  This is the default.
10960
10961 @item -missue-rate=@var{number}
10962 @opindex missue-rate=@var{number}
10963 Issue @var{number} instructions per cycle.  @var{number} can only be 1
10964 or 2.
10965
10966 @item -mbranch-cost=@var{number}
10967 @opindex mbranch-cost=@var{number}
10968 @var{number} can only be 1 or 2.  If it is 1 then branches will be
10969 preferred over conditional code, if it is 2, then the opposite will
10970 apply.
10971
10972 @item -mflush-trap=@var{number}
10973 @opindex mflush-trap=@var{number}
10974 Specifies the trap number to use to flush the cache.  The default is
10975 12.  Valid numbers are between 0 and 15 inclusive.
10976
10977 @item -mno-flush-trap
10978 @opindex mno-flush-trap
10979 Specifies that the cache cannot be flushed by using a trap.
10980
10981 @item -mflush-func=@var{name}
10982 @opindex mflush-func=@var{name}
10983 Specifies the name of the operating system function to call to flush
10984 the cache.  The default is @emph{_flush_cache}, but a function call
10985 will only be used if a trap is not available.
10986
10987 @item -mno-flush-func
10988 @opindex mno-flush-func
10989 Indicates that there is no OS function for flushing the cache.
10990
10991 @end table
10992
10993 @node M680x0 Options
10994 @subsection M680x0 Options
10995 @cindex M680x0 options
10996
10997 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
10998 The default settings depend on which architecture was selected when
10999 the compiler was configured; the defaults for the most common choices
11000 are given below.
11001
11002 @table @gcctabopt
11003 @item -march=@var{arch}
11004 @opindex march
11005 Generate code for a specific M680x0 or ColdFire instruction set
11006 architecture.  Permissible values of @var{arch} for M680x0
11007 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
11008 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
11009 architectures are selected according to Freescale's ISA classification
11010 and the permissible values are: @samp{isaa}, @samp{isaaplus},
11011 @samp{isab} and @samp{isac}.
11012
11013 gcc defines a macro @samp{__mcf@var{arch}__} whenever it is generating
11014 code for a ColdFire target.  The @var{arch} in this macro is one of the
11015 @option{-march} arguments given above.
11016
11017 When used together, @option{-march} and @option{-mtune} select code
11018 that runs on a family of similar processors but that is optimized
11019 for a particular microarchitecture.
11020
11021 @item -mcpu=@var{cpu}
11022 @opindex mcpu
11023 Generate code for a specific M680x0 or ColdFire processor.
11024 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
11025 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
11026 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
11027 below, which also classifies the CPUs into families:
11028
11029 @multitable @columnfractions 0.20 0.80
11030 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
11031 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
11032 @item @samp{5206e} @tab @samp{5206e}
11033 @item @samp{5208} @tab @samp{5207} @samp{5208}
11034 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
11035 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
11036 @item @samp{5216} @tab @samp{5214} @samp{5216}
11037 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
11038 @item @samp{5225} @tab @samp{5224} @samp{5225}
11039 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
11040 @item @samp{5249} @tab @samp{5249}
11041 @item @samp{5250} @tab @samp{5250}
11042 @item @samp{5271} @tab @samp{5270} @samp{5271}
11043 @item @samp{5272} @tab @samp{5272}
11044 @item @samp{5275} @tab @samp{5274} @samp{5275}
11045 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
11046 @item @samp{5307} @tab @samp{5307}
11047 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
11048 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
11049 @item @samp{5407} @tab @samp{5407}
11050 @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}
11051 @end multitable
11052
11053 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
11054 @var{arch} is compatible with @var{cpu}.  Other combinations of
11055 @option{-mcpu} and @option{-march} are rejected.
11056
11057 gcc defines the macro @samp{__mcf_cpu_@var{cpu}} when ColdFire target
11058 @var{cpu} is selected.  It also defines @samp{__mcf_family_@var{family}},
11059 where the value of @var{family} is given by the table above.
11060
11061 @item -mtune=@var{tune}
11062 @opindex mtune
11063 Tune the code for a particular microarchitecture, within the
11064 constraints set by @option{-march} and @option{-mcpu}.
11065 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
11066 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
11067 and @samp{cpu32}.  The ColdFire microarchitectures
11068 are: @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
11069
11070 You can also use @option{-mtune=68020-40} for code that needs
11071 to run relatively well on 68020, 68030 and 68040 targets.
11072 @option{-mtune=68020-60} is similar but includes 68060 targets
11073 as well.  These two options select the same tuning decisions as
11074 @option{-m68020-40} and @option{-m68020-60} respectively.
11075
11076 gcc defines the macros @samp{__mc@var{arch}} and @samp{__mc@var{arch}__}
11077 when tuning for 680x0 architecture @var{arch}.  It also defines
11078 @samp{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
11079 option is used.  If gcc is tuning for a range of architectures,
11080 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
11081 it defines the macros for every architecture in the range.
11082
11083 gcc also defines the macro @samp{__m@var{uarch}__} when tuning for
11084 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
11085 of the arguments given above.
11086
11087 @item -m68000
11088 @itemx -mc68000
11089 @opindex m68000
11090 @opindex mc68000
11091 Generate output for a 68000.  This is the default
11092 when the compiler is configured for 68000-based systems.
11093 It is equivalent to @option{-march=68000}.
11094
11095 Use this option for microcontrollers with a 68000 or EC000 core,
11096 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
11097
11098 @item -m68010
11099 @opindex m68010
11100 Generate output for a 68010.  This is the default
11101 when the compiler is configured for 68010-based systems.
11102 It is equivalent to @option{-march=68010}.
11103
11104 @item -m68020
11105 @itemx -mc68020
11106 @opindex m68020
11107 @opindex mc68020
11108 Generate output for a 68020.  This is the default
11109 when the compiler is configured for 68020-based systems.
11110 It is equivalent to @option{-march=68020}.
11111
11112 @item -m68030
11113 @opindex m68030
11114 Generate output for a 68030.  This is the default when the compiler is
11115 configured for 68030-based systems.  It is equivalent to
11116 @option{-march=68030}.
11117
11118 @item -m68040
11119 @opindex m68040
11120 Generate output for a 68040.  This is the default when the compiler is
11121 configured for 68040-based systems.  It is equivalent to
11122 @option{-march=68040}.
11123
11124 This option inhibits the use of 68881/68882 instructions that have to be
11125 emulated by software on the 68040.  Use this option if your 68040 does not
11126 have code to emulate those instructions.
11127
11128 @item -m68060
11129 @opindex m68060
11130 Generate output for a 68060.  This is the default when the compiler is
11131 configured for 68060-based systems.  It is equivalent to
11132 @option{-march=68060}.
11133
11134 This option inhibits the use of 68020 and 68881/68882 instructions that
11135 have to be emulated by software on the 68060.  Use this option if your 68060
11136 does not have code to emulate those instructions.
11137
11138 @item -mcpu32
11139 @opindex mcpu32
11140 Generate output for a CPU32.  This is the default
11141 when the compiler is configured for CPU32-based systems.
11142 It is equivalent to @option{-march=cpu32}.
11143
11144 Use this option for microcontrollers with a
11145 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
11146 68336, 68340, 68341, 68349 and 68360.
11147
11148 @item -m5200
11149 @opindex m5200
11150 Generate output for a 520X ColdFire CPU.  This is the default
11151 when the compiler is configured for 520X-based systems.
11152 It is equivalent to @option{-mcpu=5206}, and is now deprecated
11153 in favor of that option.
11154
11155 Use this option for microcontroller with a 5200 core, including
11156 the MCF5202, MCF5203, MCF5204 and MCF5206.
11157
11158 @item -m5206e
11159 @opindex m5206e
11160 Generate output for a 5206e ColdFire CPU.  The option is now
11161 deprecated in favor of the equivalent @option{-mcpu=5206e}.
11162
11163 @item -m528x
11164 @opindex m528x
11165 Generate output for a member of the ColdFire 528X family.
11166 The option is now deprecated in favor of the equivalent
11167 @option{-mcpu=528x}.
11168
11169 @item -m5307
11170 @opindex m5307
11171 Generate output for a ColdFire 5307 CPU.  The option is now deprecated
11172 in favor of the equivalent @option{-mcpu=5307}.
11173
11174 @item -m5407
11175 @opindex m5407
11176 Generate output for a ColdFire 5407 CPU.  The option is now deprecated
11177 in favor of the equivalent @option{-mcpu=5407}.
11178
11179 @item -mcfv4e
11180 @opindex mcfv4e
11181 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
11182 This includes use of hardware floating point instructions.
11183 The option is equivalent to @option{-mcpu=547x}, and is now
11184 deprecated in favor of that option.
11185
11186 @item -m68020-40
11187 @opindex m68020-40
11188 Generate output for a 68040, without using any of the new instructions.
11189 This results in code which can run relatively efficiently on either a
11190 68020/68881 or a 68030 or a 68040.  The generated code does use the
11191 68881 instructions that are emulated on the 68040.
11192
11193 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
11194
11195 @item -m68020-60
11196 @opindex m68020-60
11197 Generate output for a 68060, without using any of the new instructions.
11198 This results in code which can run relatively efficiently on either a
11199 68020/68881 or a 68030 or a 68040.  The generated code does use the
11200 68881 instructions that are emulated on the 68060.
11201
11202 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
11203
11204 @item -mhard-float
11205 @itemx -m68881
11206 @opindex mhard-float
11207 @opindex m68881
11208 Generate floating-point instructions.  This is the default for 68020
11209 and above, and for ColdFire devices that have an FPU.  It defines the
11210 macro @samp{__HAVE_68881__} on M680x0 targets and @samp{__mcffpu__}
11211 on ColdFire targets.
11212
11213 @item -msoft-float
11214 @opindex msoft-float
11215 Do not generate floating-point instructions; use library calls instead.
11216 This is the default for 68000, 68010, and 68832 targets.  It is also
11217 the default for ColdFire devices that have no FPU.
11218
11219 @item -mdiv
11220 @itemx -mno-div
11221 @opindex mdiv
11222 @opindex mno-div
11223 Generate (do not generate) ColdFire hardware divide and remainder
11224 instructions.  If @option{-march} is used without @option{-mcpu},
11225 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
11226 architectures.  Otherwise, the default is taken from the target CPU
11227 (either the default CPU, or the one specified by @option{-mcpu}).  For
11228 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
11229 @option{-mcpu=5206e}.
11230
11231 gcc defines the macro @samp{__mcfhwdiv__} when this option is enabled.
11232
11233 @item -mshort
11234 @opindex mshort
11235 Consider type @code{int} to be 16 bits wide, like @code{short int}.
11236 Additionally, parameters passed on the stack are also aligned to a
11237 16-bit boundary even on targets whose API mandates promotion to 32-bit.
11238
11239 @item -mno-short
11240 @opindex mno-short
11241 Do not consider type @code{int} to be 16 bits wide.  This is the default.
11242
11243 @item -mnobitfield
11244 @itemx -mno-bitfield
11245 @opindex mnobitfield
11246 @opindex mno-bitfield
11247 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
11248 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
11249
11250 @item -mbitfield
11251 @opindex mbitfield
11252 Do use the bit-field instructions.  The @option{-m68020} option implies
11253 @option{-mbitfield}.  This is the default if you use a configuration
11254 designed for a 68020.
11255
11256 @item -mrtd
11257 @opindex mrtd
11258 Use a different function-calling convention, in which functions
11259 that take a fixed number of arguments return with the @code{rtd}
11260 instruction, which pops their arguments while returning.  This
11261 saves one instruction in the caller since there is no need to pop
11262 the arguments there.
11263
11264 This calling convention is incompatible with the one normally
11265 used on Unix, so you cannot use it if you need to call libraries
11266 compiled with the Unix compiler.
11267
11268 Also, you must provide function prototypes for all functions that
11269 take variable numbers of arguments (including @code{printf});
11270 otherwise incorrect code will be generated for calls to those
11271 functions.
11272
11273 In addition, seriously incorrect code will result if you call a
11274 function with too many arguments.  (Normally, extra arguments are
11275 harmlessly ignored.)
11276
11277 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
11278 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
11279
11280 @item -mno-rtd
11281 @opindex mno-rtd
11282 Do not use the calling conventions selected by @option{-mrtd}.
11283 This is the default.
11284
11285 @item -malign-int
11286 @itemx -mno-align-int
11287 @opindex malign-int
11288 @opindex mno-align-int
11289 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
11290 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
11291 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
11292 Aligning variables on 32-bit boundaries produces code that runs somewhat
11293 faster on processors with 32-bit busses at the expense of more memory.
11294
11295 @strong{Warning:} if you use the @option{-malign-int} switch, GCC will
11296 align structures containing the above types  differently than
11297 most published application binary interface specifications for the m68k.
11298
11299 @item -mpcrel
11300 @opindex mpcrel
11301 Use the pc-relative addressing mode of the 68000 directly, instead of
11302 using a global offset table.  At present, this option implies @option{-fpic},
11303 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
11304 not presently supported with @option{-mpcrel}, though this could be supported for
11305 68020 and higher processors.
11306
11307 @item -mno-strict-align
11308 @itemx -mstrict-align
11309 @opindex mno-strict-align
11310 @opindex mstrict-align
11311 Do not (do) assume that unaligned memory references will be handled by
11312 the system.
11313
11314 @item -msep-data
11315 Generate code that allows the data segment to be located in a different
11316 area of memory from the text segment.  This allows for execute in place in
11317 an environment without virtual memory management.  This option implies
11318 @option{-fPIC}.
11319
11320 @item -mno-sep-data
11321 Generate code that assumes that the data segment follows the text segment.
11322 This is the default.
11323
11324 @item -mid-shared-library
11325 Generate code that supports shared libraries via the library ID method.
11326 This allows for execute in place and shared libraries in an environment
11327 without virtual memory management.  This option implies @option{-fPIC}.
11328
11329 @item -mno-id-shared-library
11330 Generate code that doesn't assume ID based shared libraries are being used.
11331 This is the default.
11332
11333 @item -mshared-library-id=n
11334 Specified the identification number of the ID based shared library being
11335 compiled.  Specifying a value of 0 will generate more compact code, specifying
11336 other values will force the allocation of that number to the current
11337 library but is no more space or time efficient than omitting this option.
11338
11339 @end table
11340
11341 @node M68hc1x Options
11342 @subsection M68hc1x Options
11343 @cindex M68hc1x options
11344
11345 These are the @samp{-m} options defined for the 68hc11 and 68hc12
11346 microcontrollers.  The default values for these options depends on
11347 which style of microcontroller was selected when the compiler was configured;
11348 the defaults for the most common choices are given below.
11349
11350 @table @gcctabopt
11351 @item -m6811
11352 @itemx -m68hc11
11353 @opindex m6811
11354 @opindex m68hc11
11355 Generate output for a 68HC11.  This is the default
11356 when the compiler is configured for 68HC11-based systems.
11357
11358 @item -m6812
11359 @itemx -m68hc12
11360 @opindex m6812
11361 @opindex m68hc12
11362 Generate output for a 68HC12.  This is the default
11363 when the compiler is configured for 68HC12-based systems.
11364
11365 @item -m68S12
11366 @itemx -m68hcs12
11367 @opindex m68S12
11368 @opindex m68hcs12
11369 Generate output for a 68HCS12.
11370
11371 @item -mauto-incdec
11372 @opindex mauto-incdec
11373 Enable the use of 68HC12 pre and post auto-increment and auto-decrement
11374 addressing modes.
11375
11376 @item -minmax
11377 @itemx -nominmax
11378 @opindex minmax
11379 @opindex mnominmax
11380 Enable the use of 68HC12 min and max instructions.
11381
11382 @item -mlong-calls
11383 @itemx -mno-long-calls
11384 @opindex mlong-calls
11385 @opindex mno-long-calls
11386 Treat all calls as being far away (near).  If calls are assumed to be
11387 far away, the compiler will use the @code{call} instruction to
11388 call a function and the @code{rtc} instruction for returning.
11389
11390 @item -mshort
11391 @opindex mshort
11392 Consider type @code{int} to be 16 bits wide, like @code{short int}.
11393
11394 @item -msoft-reg-count=@var{count}
11395 @opindex msoft-reg-count
11396 Specify the number of pseudo-soft registers which are used for the
11397 code generation.  The maximum number is 32.  Using more pseudo-soft
11398 register may or may not result in better code depending on the program.
11399 The default is 4 for 68HC11 and 2 for 68HC12.
11400
11401 @end table
11402
11403 @node MCore Options
11404 @subsection MCore Options
11405 @cindex MCore options
11406
11407 These are the @samp{-m} options defined for the Motorola M*Core
11408 processors.
11409
11410 @table @gcctabopt
11411
11412 @item -mhardlit
11413 @itemx -mno-hardlit
11414 @opindex mhardlit
11415 @opindex mno-hardlit
11416 Inline constants into the code stream if it can be done in two
11417 instructions or less.
11418
11419 @item -mdiv
11420 @itemx -mno-div
11421 @opindex mdiv
11422 @opindex mno-div
11423 Use the divide instruction.  (Enabled by default).
11424
11425 @item -mrelax-immediate
11426 @itemx -mno-relax-immediate
11427 @opindex mrelax-immediate
11428 @opindex mno-relax-immediate
11429 Allow arbitrary sized immediates in bit operations.
11430
11431 @item -mwide-bitfields
11432 @itemx -mno-wide-bitfields
11433 @opindex mwide-bitfields
11434 @opindex mno-wide-bitfields
11435 Always treat bit-fields as int-sized.
11436
11437 @item -m4byte-functions
11438 @itemx -mno-4byte-functions
11439 @opindex m4byte-functions
11440 @opindex mno-4byte-functions
11441 Force all functions to be aligned to a four byte boundary.
11442
11443 @item -mcallgraph-data
11444 @itemx -mno-callgraph-data
11445 @opindex mcallgraph-data
11446 @opindex mno-callgraph-data
11447 Emit callgraph information.
11448
11449 @item -mslow-bytes
11450 @itemx -mno-slow-bytes
11451 @opindex mslow-bytes
11452 @opindex mno-slow-bytes
11453 Prefer word access when reading byte quantities.
11454
11455 @item -mlittle-endian
11456 @itemx -mbig-endian
11457 @opindex mlittle-endian
11458 @opindex mbig-endian
11459 Generate code for a little endian target.
11460
11461 @item -m210
11462 @itemx -m340
11463 @opindex m210
11464 @opindex m340
11465 Generate code for the 210 processor.
11466 @end table
11467
11468 @node MIPS Options
11469 @subsection MIPS Options
11470 @cindex MIPS options
11471
11472 @table @gcctabopt
11473
11474 @item -EB
11475 @opindex EB
11476 Generate big-endian code.
11477
11478 @item -EL
11479 @opindex EL
11480 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
11481 configurations.
11482
11483 @item -march=@var{arch}
11484 @opindex march
11485 Generate code that will run on @var{arch}, which can be the name of a
11486 generic MIPS ISA, or the name of a particular processor.
11487 The ISA names are:
11488 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
11489 @samp{mips32}, @samp{mips32r2}, and @samp{mips64}.
11490 The processor names are:
11491 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
11492 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
11493 @samp{5kc}, @samp{5kf},
11494 @samp{20kc},
11495 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
11496 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
11497 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1},
11498 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
11499 @samp{m4k},
11500 @samp{orion},
11501 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
11502 @samp{r4600}, @samp{r4650}, @samp{r6000}, @samp{r8000},
11503 @samp{rm7000}, @samp{rm9000},
11504 @samp{sb1},
11505 @samp{sr71000},
11506 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
11507 @samp{vr5000}, @samp{vr5400} and @samp{vr5500}.
11508 The special value @samp{from-abi} selects the
11509 most compatible architecture for the selected ABI (that is,
11510 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
11511
11512 In processor names, a final @samp{000} can be abbreviated as @samp{k}
11513 (for example, @samp{-march=r2k}).  Prefixes are optional, and
11514 @samp{vr} may be written @samp{r}.
11515
11516 Names of the form @samp{@var{n}f2_1} refer to processors with
11517 FPUs clocked at half the rate of the core, names of the form
11518 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
11519 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
11520 processors with FPUs clocked a ratio of 3:2 with respect to the core.
11521 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
11522 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
11523 accepted as synonyms for @samp{@var{n}f1_1}.
11524
11525 GCC defines two macros based on the value of this option.  The first
11526 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
11527 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
11528 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
11529 For example, @samp{-march=r2000} will set @samp{_MIPS_ARCH}
11530 to @samp{"r2000"} and define the macro @samp{_MIPS_ARCH_R2000}.
11531
11532 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
11533 above.  In other words, it will have the full prefix and will not
11534 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
11535 the macro names the resolved architecture (either @samp{"mips1"} or
11536 @samp{"mips3"}).  It names the default architecture when no
11537 @option{-march} option is given.
11538
11539 @item -mtune=@var{arch}
11540 @opindex mtune
11541 Optimize for @var{arch}.  Among other things, this option controls
11542 the way instructions are scheduled, and the perceived cost of arithmetic
11543 operations.  The list of @var{arch} values is the same as for
11544 @option{-march}.
11545
11546 When this option is not used, GCC will optimize for the processor
11547 specified by @option{-march}.  By using @option{-march} and
11548 @option{-mtune} together, it is possible to generate code that will
11549 run on a family of processors, but optimize the code for one
11550 particular member of that family.
11551
11552 @samp{-mtune} defines the macros @samp{_MIPS_TUNE} and
11553 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
11554 @samp{-march} ones described above.
11555
11556 @item -mips1
11557 @opindex mips1
11558 Equivalent to @samp{-march=mips1}.
11559
11560 @item -mips2
11561 @opindex mips2
11562 Equivalent to @samp{-march=mips2}.
11563
11564 @item -mips3
11565 @opindex mips3
11566 Equivalent to @samp{-march=mips3}.
11567
11568 @item -mips4
11569 @opindex mips4
11570 Equivalent to @samp{-march=mips4}.
11571
11572 @item -mips32
11573 @opindex mips32
11574 Equivalent to @samp{-march=mips32}.
11575
11576 @item -mips32r2
11577 @opindex mips32r2
11578 Equivalent to @samp{-march=mips32r2}.
11579
11580 @item -mips64
11581 @opindex mips64
11582 Equivalent to @samp{-march=mips64}.
11583
11584 @item -mips16
11585 @itemx -mno-mips16
11586 @opindex mips16
11587 @opindex mno-mips16
11588 Generate (do not generate) MIPS16 code.  If GCC is targetting a
11589 MIPS32 or MIPS64 architecture, it will make use of the MIPS16e ASE@.
11590
11591 @item -mabi=32
11592 @itemx -mabi=o64
11593 @itemx -mabi=n32
11594 @itemx -mabi=64
11595 @itemx -mabi=eabi
11596 @opindex mabi=32
11597 @opindex mabi=o64
11598 @opindex mabi=n32
11599 @opindex mabi=64
11600 @opindex mabi=eabi
11601 Generate code for the given ABI@.
11602
11603 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
11604 generates 64-bit code when you select a 64-bit architecture, but you
11605 can use @option{-mgp32} to get 32-bit code instead.
11606
11607 For information about the O64 ABI, see
11608 @w{@uref{http://gcc.gnu.org/projects/mipso64-abi.html}}.
11609
11610 GCC supports a variant of the o32 ABI in which floating-point registers
11611 are 64 rather than 32 bits wide.  You can select this combination with
11612 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @samp{mthc1}
11613 and @samp{mfhc1} instructions and is therefore only supported for
11614 MIPS32R2 processors.
11615
11616 The register assignments for arguments and return values remain the
11617 same, but each scalar value is passed in a single 64-bit register
11618 rather than a pair of 32-bit registers.  For example, scalar
11619 floating-point values are returned in @samp{$f0} only, not a
11620 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
11621 remains the same, but all 64 bits are saved.
11622
11623 @item -mabicalls
11624 @itemx -mno-abicalls
11625 @opindex mabicalls
11626 @opindex mno-abicalls
11627 Generate (do not generate) code that is suitable for SVR4-style
11628 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
11629 systems.
11630
11631 @item -mshared
11632 @itemx -mno-shared
11633 Generate (do not generate) code that is fully position-independent,
11634 and that can therefore be linked into shared libraries.  This option
11635 only affects @option{-mabicalls}.
11636
11637 All @option{-mabicalls} code has traditionally been position-independent,
11638 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
11639 as an extension, the GNU toolchain allows executables to use absolute
11640 accesses for locally-binding symbols.  It can also use shorter GP
11641 initialization sequences and generate direct calls to locally-defined
11642 functions.  This mode is selected by @option{-mno-shared}.
11643
11644 @option{-mno-shared} depends on binutils 2.16 or higher and generates
11645 objects that can only be linked by the GNU linker.  However, the option
11646 does not affect the ABI of the final executable; it only affects the ABI
11647 of relocatable objects.  Using @option{-mno-shared} will generally make
11648 executables both smaller and quicker.
11649
11650 @option{-mshared} is the default.
11651
11652 @item -mxgot
11653 @itemx -mno-xgot
11654 @opindex mxgot
11655 @opindex mno-xgot
11656 Lift (do not lift) the usual restrictions on the size of the global
11657 offset table.
11658
11659 GCC normally uses a single instruction to load values from the GOT@.
11660 While this is relatively efficient, it will only work if the GOT
11661 is smaller than about 64k.  Anything larger will cause the linker
11662 to report an error such as:
11663
11664 @cindex relocation truncated to fit (MIPS)
11665 @smallexample
11666 relocation truncated to fit: R_MIPS_GOT16 foobar
11667 @end smallexample
11668
11669 If this happens, you should recompile your code with @option{-mxgot}.
11670 It should then work with very large GOTs, although it will also be
11671 less efficient, since it will take three instructions to fetch the
11672 value of a global symbol.
11673
11674 Note that some linkers can create multiple GOTs.  If you have such a
11675 linker, you should only need to use @option{-mxgot} when a single object
11676 file accesses more than 64k's worth of GOT entries.  Very few do.
11677
11678 These options have no effect unless GCC is generating position
11679 independent code.
11680
11681 @item -mgp32
11682 @opindex mgp32
11683 Assume that general-purpose registers are 32 bits wide.
11684
11685 @item -mgp64
11686 @opindex mgp64
11687 Assume that general-purpose registers are 64 bits wide.
11688
11689 @item -mfp32
11690 @opindex mfp32
11691 Assume that floating-point registers are 32 bits wide.
11692
11693 @item -mfp64
11694 @opindex mfp64
11695 Assume that floating-point registers are 64 bits wide.
11696
11697 @item -mhard-float
11698 @opindex mhard-float
11699 Use floating-point coprocessor instructions.
11700
11701 @item -msoft-float
11702 @opindex msoft-float
11703 Do not use floating-point coprocessor instructions.  Implement
11704 floating-point calculations using library calls instead.
11705
11706 @item -msingle-float
11707 @opindex msingle-float
11708 Assume that the floating-point coprocessor only supports single-precision
11709 operations.
11710
11711 @item -mdouble-float
11712 @opindex mdouble-float
11713 Assume that the floating-point coprocessor supports double-precision
11714 operations.  This is the default.
11715
11716 @item -mdsp
11717 @itemx -mno-dsp
11718 @opindex mdsp
11719 @opindex mno-dsp
11720 Use (do not use) revision 1 of the MIPS DSP ASE.
11721 @xref{MIPS DSP Built-in Functions}.  This option defines the
11722 preprocessor macro @samp{__mips_dsp}.  It also defines
11723 @samp{__mips_dsp_rev} to 1.
11724
11725 @item -mdspr2
11726 @itemx -mno-dspr2
11727 @opindex mdspr2
11728 @opindex mno-dspr2
11729 Use (do not use) revision 2 of the MIPS DSP ASE.
11730 @xref{MIPS DSP Built-in Functions}.  This option defines the
11731 preprocessor macros @samp{__mips_dsp} and @samp{__mips_dspr2}.
11732 It also defines @samp{__mips_dsp_rev} to 2.
11733
11734 @item -msmartmips
11735 @itemx -mno-smartmips
11736 @opindex msmartmips
11737 @opindex mno-smartmips
11738 Use (do not use) the MIPS SmartMIPS ASE.
11739
11740 @item -mpaired-single
11741 @itemx -mno-paired-single
11742 @opindex mpaired-single
11743 @opindex mno-paired-single
11744 Use (do not use) paired-single floating-point instructions.
11745 @xref{MIPS Paired-Single Support}.  This option can only be used
11746 when generating 64-bit code and requires hardware floating-point
11747 support to be enabled.
11748
11749 @item -mdmx
11750 @itemx -mno-mdmx
11751 @opindex mdmx
11752 @opindex mno-mdmx
11753 Use (do not use) MIPS Digital Media Extension instructions.
11754 This option can only be used when generating 64-bit code and requires
11755 hardware floating-point support to be enabled.
11756
11757 @item -mips3d
11758 @itemx -mno-mips3d
11759 @opindex mips3d
11760 @opindex mno-mips3d
11761 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
11762 The option @option{-mips3d} implies @option{-mpaired-single}.
11763
11764 @item -mmt
11765 @itemx -mno-mt
11766 @opindex mmt
11767 @opindex mno-mt
11768 Use (do not use) MT Multithreading instructions.
11769
11770 @item -mlong64
11771 @opindex mlong64
11772 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
11773 an explanation of the default and the way that the pointer size is
11774 determined.
11775
11776 @item -mlong32
11777 @opindex mlong32
11778 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
11779
11780 The default size of @code{int}s, @code{long}s and pointers depends on
11781 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
11782 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
11783 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
11784 or the same size as integer registers, whichever is smaller.
11785
11786 @item -msym32
11787 @itemx -mno-sym32
11788 @opindex msym32
11789 @opindex mno-sym32
11790 Assume (do not assume) that all symbols have 32-bit values, regardless
11791 of the selected ABI@.  This option is useful in combination with
11792 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
11793 to generate shorter and faster references to symbolic addresses.
11794
11795 @item -G @var{num}
11796 @opindex G
11797 @cindex smaller data references (MIPS)
11798 @cindex gp-relative references (MIPS)
11799 Put global and static items less than or equal to @var{num} bytes into
11800 the small data or bss section instead of the normal data or bss section.
11801 This allows the data to be accessed using a single instruction.
11802
11803 All modules should be compiled with the same @option{-G @var{num}}
11804 value.
11805
11806 @item -membedded-data
11807 @itemx -mno-embedded-data
11808 @opindex membedded-data
11809 @opindex mno-embedded-data
11810 Allocate variables to the read-only data section first if possible, then
11811 next in the small data section if possible, otherwise in data.  This gives
11812 slightly slower code than the default, but reduces the amount of RAM required
11813 when executing, and thus may be preferred for some embedded systems.
11814
11815 @item -muninit-const-in-rodata
11816 @itemx -mno-uninit-const-in-rodata
11817 @opindex muninit-const-in-rodata
11818 @opindex mno-uninit-const-in-rodata
11819 Put uninitialized @code{const} variables in the read-only data section.
11820 This option is only meaningful in conjunction with @option{-membedded-data}.
11821
11822 @item -mcode-readable=@var{setting}
11823 @opindex mcode-readable
11824 Specify whether GCC may generate code that reads from executable sections.
11825 There are three possible settings:
11826
11827 @table @gcctabopt
11828 @item -mcode-readable=yes
11829 Instructions may freely access executable sections.  This is the
11830 default setting.
11831
11832 @item -mcode-readable=pcrel
11833 MIPS16 PC-relative load instructions can access executable sections,
11834 but other instructions must not do so.  This option is useful on 4KSc
11835 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
11836 It is also useful on processors that can be configured to have a dual
11837 instruction/data SRAM interface and that, like the M4K, automatically
11838 redirect PC-relative loads to the instruction RAM.
11839
11840 @item -mcode-readable=no
11841 Instructions must not access executable sections.  This option can be
11842 useful on targets that are configured to have a dual instruction/data
11843 SRAM interface but that (unlike the M4K) do not automatically redirect
11844 PC-relative loads to the instruction RAM.
11845 @end table
11846
11847 @item -msplit-addresses
11848 @itemx -mno-split-addresses
11849 @opindex msplit-addresses
11850 @opindex mno-split-addresses
11851 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
11852 relocation operators.  This option has been superseded by
11853 @option{-mexplicit-relocs} but is retained for backwards compatibility.
11854
11855 @item -mexplicit-relocs
11856 @itemx -mno-explicit-relocs
11857 @opindex mexplicit-relocs
11858 @opindex mno-explicit-relocs
11859 Use (do not use) assembler relocation operators when dealing with symbolic
11860 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
11861 is to use assembler macros instead.
11862
11863 @option{-mexplicit-relocs} is the default if GCC was configured
11864 to use an assembler that supports relocation operators.
11865
11866 @item -mcheck-zero-division
11867 @itemx -mno-check-zero-division
11868 @opindex mcheck-zero-division
11869 @opindex mno-check-zero-division
11870 Trap (do not trap) on integer division by zero.
11871
11872 The default is @option{-mcheck-zero-division}.
11873
11874 @item -mdivide-traps
11875 @itemx -mdivide-breaks
11876 @opindex mdivide-traps
11877 @opindex mdivide-breaks
11878 MIPS systems check for division by zero by generating either a
11879 conditional trap or a break instruction.  Using traps results in
11880 smaller code, but is only supported on MIPS II and later.  Also, some
11881 versions of the Linux kernel have a bug that prevents trap from
11882 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
11883 allow conditional traps on architectures that support them and
11884 @option{-mdivide-breaks} to force the use of breaks.
11885
11886 The default is usually @option{-mdivide-traps}, but this can be
11887 overridden at configure time using @option{--with-divide=breaks}.
11888 Divide-by-zero checks can be completely disabled using
11889 @option{-mno-check-zero-division}.
11890
11891 @item -mmemcpy
11892 @itemx -mno-memcpy
11893 @opindex mmemcpy
11894 @opindex mno-memcpy
11895 Force (do not force) the use of @code{memcpy()} for non-trivial block
11896 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
11897 most constant-sized copies.
11898
11899 @item -mlong-calls
11900 @itemx -mno-long-calls
11901 @opindex mlong-calls
11902 @opindex mno-long-calls
11903 Disable (do not disable) use of the @code{jal} instruction.  Calling
11904 functions using @code{jal} is more efficient but requires the caller
11905 and callee to be in the same 256 megabyte segment.
11906
11907 This option has no effect on abicalls code.  The default is
11908 @option{-mno-long-calls}.
11909
11910 @item -mmad
11911 @itemx -mno-mad
11912 @opindex mmad
11913 @opindex mno-mad
11914 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
11915 instructions, as provided by the R4650 ISA@.
11916
11917 @item -mfused-madd
11918 @itemx -mno-fused-madd
11919 @opindex mfused-madd
11920 @opindex mno-fused-madd
11921 Enable (disable) use of the floating point multiply-accumulate
11922 instructions, when they are available.  The default is
11923 @option{-mfused-madd}.
11924
11925 When multiply-accumulate instructions are used, the intermediate
11926 product is calculated to infinite precision and is not subject to
11927 the FCSR Flush to Zero bit.  This may be undesirable in some
11928 circumstances.
11929
11930 @item -nocpp
11931 @opindex nocpp
11932 Tell the MIPS assembler to not run its preprocessor over user
11933 assembler files (with a @samp{.s} suffix) when assembling them.
11934
11935 @item -mfix-r4000
11936 @itemx -mno-fix-r4000
11937 @opindex mfix-r4000
11938 @opindex mno-fix-r4000
11939 Work around certain R4000 CPU errata:
11940 @itemize @minus
11941 @item
11942 A double-word or a variable shift may give an incorrect result if executed
11943 immediately after starting an integer division.
11944 @item
11945 A double-word or a variable shift may give an incorrect result if executed
11946 while an integer multiplication is in progress.
11947 @item
11948 An integer division may give an incorrect result if started in a delay slot
11949 of a taken branch or a jump.
11950 @end itemize
11951
11952 @item -mfix-r4400
11953 @itemx -mno-fix-r4400
11954 @opindex mfix-r4400
11955 @opindex mno-fix-r4400
11956 Work around certain R4400 CPU errata:
11957 @itemize @minus
11958 @item
11959 A double-word or a variable shift may give an incorrect result if executed
11960 immediately after starting an integer division.
11961 @end itemize
11962
11963 @item -mfix-vr4120
11964 @itemx -mno-fix-vr4120
11965 @opindex mfix-vr4120
11966 Work around certain VR4120 errata:
11967 @itemize @minus
11968 @item
11969 @code{dmultu} does not always produce the correct result.
11970 @item
11971 @code{div} and @code{ddiv} do not always produce the correct result if one
11972 of the operands is negative.
11973 @end itemize
11974 The workarounds for the division errata rely on special functions in
11975 @file{libgcc.a}.  At present, these functions are only provided by
11976 the @code{mips64vr*-elf} configurations.
11977
11978 Other VR4120 errata require a nop to be inserted between certain pairs of
11979 instructions.  These errata are handled by the assembler, not by GCC itself.
11980
11981 @item -mfix-vr4130
11982 @opindex mfix-vr4130
11983 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
11984 workarounds are implemented by the assembler rather than by GCC,
11985 although GCC will avoid using @code{mflo} and @code{mfhi} if the
11986 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
11987 instructions are available instead.
11988
11989 @item -mfix-sb1
11990 @itemx -mno-fix-sb1
11991 @opindex mfix-sb1
11992 Work around certain SB-1 CPU core errata.
11993 (This flag currently works around the SB-1 revision 2
11994 ``F1'' and ``F2'' floating point errata.)
11995
11996 @item -mflush-func=@var{func}
11997 @itemx -mno-flush-func
11998 @opindex mflush-func
11999 Specifies the function to call to flush the I and D caches, or to not
12000 call any such function.  If called, the function must take the same
12001 arguments as the common @code{_flush_func()}, that is, the address of the
12002 memory range for which the cache is being flushed, the size of the
12003 memory range, and the number 3 (to flush both caches).  The default
12004 depends on the target GCC was configured for, but commonly is either
12005 @samp{_flush_func} or @samp{__cpu_flush}.
12006
12007 @item mbranch-cost=@var{num}
12008 @opindex mbranch-cost
12009 Set the cost of branches to roughly @var{num} ``simple'' instructions.
12010 This cost is only a heuristic and is not guaranteed to produce
12011 consistent results across releases.  A zero cost redundantly selects
12012 the default, which is based on the @option{-mtune} setting.
12013
12014 @item -mbranch-likely
12015 @itemx -mno-branch-likely
12016 @opindex mbranch-likely
12017 @opindex mno-branch-likely
12018 Enable or disable use of Branch Likely instructions, regardless of the
12019 default for the selected architecture.  By default, Branch Likely
12020 instructions may be generated if they are supported by the selected
12021 architecture.  An exception is for the MIPS32 and MIPS64 architectures
12022 and processors which implement those architectures; for those, Branch
12023 Likely instructions will not be generated by default because the MIPS32
12024 and MIPS64 architectures specifically deprecate their use.
12025
12026 @item -mfp-exceptions
12027 @itemx -mno-fp-exceptions
12028 @opindex mfp-exceptions
12029 Specifies whether FP exceptions are enabled.  This affects how we schedule
12030 FP instructions for some processors.  The default is that FP exceptions are
12031 enabled.
12032
12033 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
12034 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
12035 FP pipe.
12036
12037 @item -mvr4130-align
12038 @itemx -mno-vr4130-align
12039 @opindex mvr4130-align
12040 The VR4130 pipeline is two-way superscalar, but can only issue two
12041 instructions together if the first one is 8-byte aligned.  When this
12042 option is enabled, GCC will align pairs of instructions that it
12043 thinks should execute in parallel.
12044
12045 This option only has an effect when optimizing for the VR4130.
12046 It normally makes code faster, but at the expense of making it bigger.
12047 It is enabled by default at optimization level @option{-O3}.
12048 @end table
12049
12050 @node MMIX Options
12051 @subsection MMIX Options
12052 @cindex MMIX Options
12053
12054 These options are defined for the MMIX:
12055
12056 @table @gcctabopt
12057 @item -mlibfuncs
12058 @itemx -mno-libfuncs
12059 @opindex mlibfuncs
12060 @opindex mno-libfuncs
12061 Specify that intrinsic library functions are being compiled, passing all
12062 values in registers, no matter the size.
12063
12064 @item -mepsilon
12065 @itemx -mno-epsilon
12066 @opindex mepsilon
12067 @opindex mno-epsilon
12068 Generate floating-point comparison instructions that compare with respect
12069 to the @code{rE} epsilon register.
12070
12071 @item -mabi=mmixware
12072 @itemx -mabi=gnu
12073 @opindex mabi-mmixware
12074 @opindex mabi=gnu
12075 Generate code that passes function parameters and return values that (in
12076 the called function) are seen as registers @code{$0} and up, as opposed to
12077 the GNU ABI which uses global registers @code{$231} and up.
12078
12079 @item -mzero-extend
12080 @itemx -mno-zero-extend
12081 @opindex mzero-extend
12082 @opindex mno-zero-extend
12083 When reading data from memory in sizes shorter than 64 bits, use (do not
12084 use) zero-extending load instructions by default, rather than
12085 sign-extending ones.
12086
12087 @item -mknuthdiv
12088 @itemx -mno-knuthdiv
12089 @opindex mknuthdiv
12090 @opindex mno-knuthdiv
12091 Make the result of a division yielding a remainder have the same sign as
12092 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
12093 remainder follows the sign of the dividend.  Both methods are
12094 arithmetically valid, the latter being almost exclusively used.
12095
12096 @item -mtoplevel-symbols
12097 @itemx -mno-toplevel-symbols
12098 @opindex mtoplevel-symbols
12099 @opindex mno-toplevel-symbols
12100 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
12101 code can be used with the @code{PREFIX} assembly directive.
12102
12103 @item -melf
12104 @opindex melf
12105 Generate an executable in the ELF format, rather than the default
12106 @samp{mmo} format used by the @command{mmix} simulator.
12107
12108 @item -mbranch-predict
12109 @itemx -mno-branch-predict
12110 @opindex mbranch-predict
12111 @opindex mno-branch-predict
12112 Use (do not use) the probable-branch instructions, when static branch
12113 prediction indicates a probable branch.
12114
12115 @item -mbase-addresses
12116 @itemx -mno-base-addresses
12117 @opindex mbase-addresses
12118 @opindex mno-base-addresses
12119 Generate (do not generate) code that uses @emph{base addresses}.  Using a
12120 base address automatically generates a request (handled by the assembler
12121 and the linker) for a constant to be set up in a global register.  The
12122 register is used for one or more base address requests within the range 0
12123 to 255 from the value held in the register.  The generally leads to short
12124 and fast code, but the number of different data items that can be
12125 addressed is limited.  This means that a program that uses lots of static
12126 data may require @option{-mno-base-addresses}.
12127
12128 @item -msingle-exit
12129 @itemx -mno-single-exit
12130 @opindex msingle-exit
12131 @opindex mno-single-exit
12132 Force (do not force) generated code to have a single exit point in each
12133 function.
12134 @end table
12135
12136 @node MN10300 Options
12137 @subsection MN10300 Options
12138 @cindex MN10300 options
12139
12140 These @option{-m} options are defined for Matsushita MN10300 architectures:
12141
12142 @table @gcctabopt
12143 @item -mmult-bug
12144 @opindex mmult-bug
12145 Generate code to avoid bugs in the multiply instructions for the MN10300
12146 processors.  This is the default.
12147
12148 @item -mno-mult-bug
12149 @opindex mno-mult-bug
12150 Do not generate code to avoid bugs in the multiply instructions for the
12151 MN10300 processors.
12152
12153 @item -mam33
12154 @opindex mam33
12155 Generate code which uses features specific to the AM33 processor.
12156
12157 @item -mno-am33
12158 @opindex mno-am33
12159 Do not generate code which uses features specific to the AM33 processor.  This
12160 is the default.
12161
12162 @item -mreturn-pointer-on-d0
12163 @opindex mreturn-pointer-on-d0
12164 When generating a function which returns a pointer, return the pointer
12165 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
12166 only in a0, and attempts to call such functions without a prototype
12167 would result in errors.  Note that this option is on by default; use
12168 @option{-mno-return-pointer-on-d0} to disable it.
12169
12170 @item -mno-crt0
12171 @opindex mno-crt0
12172 Do not link in the C run-time initialization object file.
12173
12174 @item -mrelax
12175 @opindex mrelax
12176 Indicate to the linker that it should perform a relaxation optimization pass
12177 to shorten branches, calls and absolute memory addresses.  This option only
12178 has an effect when used on the command line for the final link step.
12179
12180 This option makes symbolic debugging impossible.
12181 @end table
12182
12183 @node MT Options
12184 @subsection MT Options
12185 @cindex MT options
12186
12187 These @option{-m} options are defined for Morpho MT architectures:
12188
12189 @table @gcctabopt
12190
12191 @item -march=@var{cpu-type}
12192 @opindex march
12193 Generate code that will run on @var{cpu-type}, which is the name of a system
12194 representing a certain processor type.  Possible values for
12195 @var{cpu-type} are @samp{ms1-64-001}, @samp{ms1-16-002},
12196 @samp{ms1-16-003} and @samp{ms2}.
12197
12198 When this option is not used, the default is @option{-march=ms1-16-002}.
12199
12200 @item -mbacc
12201 @opindex mbacc
12202 Use byte loads and stores when generating code.
12203
12204 @item -mno-bacc
12205 @opindex mno-bacc
12206 Do not use byte loads and stores when generating code.
12207
12208 @item -msim
12209 @opindex msim
12210 Use simulator runtime
12211
12212 @item -mno-crt0
12213 @opindex mno-crt0
12214 Do not link in the C run-time initialization object file
12215 @file{crti.o}.  Other run-time initialization and termination files
12216 such as @file{startup.o} and @file{exit.o} are still included on the
12217 linker command line.
12218
12219 @end table
12220
12221 @node PDP-11 Options
12222 @subsection PDP-11 Options
12223 @cindex PDP-11 Options
12224
12225 These options are defined for the PDP-11:
12226
12227 @table @gcctabopt
12228 @item -mfpu
12229 @opindex mfpu
12230 Use hardware FPP floating point.  This is the default.  (FIS floating
12231 point on the PDP-11/40 is not supported.)
12232
12233 @item -msoft-float
12234 @opindex msoft-float
12235 Do not use hardware floating point.
12236
12237 @item -mac0
12238 @opindex mac0
12239 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
12240
12241 @item -mno-ac0
12242 @opindex mno-ac0
12243 Return floating-point results in memory.  This is the default.
12244
12245 @item -m40
12246 @opindex m40
12247 Generate code for a PDP-11/40.
12248
12249 @item -m45
12250 @opindex m45
12251 Generate code for a PDP-11/45.  This is the default.
12252
12253 @item -m10
12254 @opindex m10
12255 Generate code for a PDP-11/10.
12256
12257 @item -mbcopy-builtin
12258 @opindex bcopy-builtin
12259 Use inline @code{movmemhi} patterns for copying memory.  This is the
12260 default.
12261
12262 @item -mbcopy
12263 @opindex mbcopy
12264 Do not use inline @code{movmemhi} patterns for copying memory.
12265
12266 @item -mint16
12267 @itemx -mno-int32
12268 @opindex mint16
12269 @opindex mno-int32
12270 Use 16-bit @code{int}.  This is the default.
12271
12272 @item -mint32
12273 @itemx -mno-int16
12274 @opindex mint32
12275 @opindex mno-int16
12276 Use 32-bit @code{int}.
12277
12278 @item -mfloat64
12279 @itemx -mno-float32
12280 @opindex mfloat64
12281 @opindex mno-float32
12282 Use 64-bit @code{float}.  This is the default.
12283
12284 @item -mfloat32
12285 @itemx -mno-float64
12286 @opindex mfloat32
12287 @opindex mno-float64
12288 Use 32-bit @code{float}.
12289
12290 @item -mabshi
12291 @opindex mabshi
12292 Use @code{abshi2} pattern.  This is the default.
12293
12294 @item -mno-abshi
12295 @opindex mno-abshi
12296 Do not use @code{abshi2} pattern.
12297
12298 @item -mbranch-expensive
12299 @opindex mbranch-expensive
12300 Pretend that branches are expensive.  This is for experimenting with
12301 code generation only.
12302
12303 @item -mbranch-cheap
12304 @opindex mbranch-cheap
12305 Do not pretend that branches are expensive.  This is the default.
12306
12307 @item -msplit
12308 @opindex msplit
12309 Generate code for a system with split I&D@.
12310
12311 @item -mno-split
12312 @opindex mno-split
12313 Generate code for a system without split I&D@.  This is the default.
12314
12315 @item -munix-asm
12316 @opindex munix-asm
12317 Use Unix assembler syntax.  This is the default when configured for
12318 @samp{pdp11-*-bsd}.
12319
12320 @item -mdec-asm
12321 @opindex mdec-asm
12322 Use DEC assembler syntax.  This is the default when configured for any
12323 PDP-11 target other than @samp{pdp11-*-bsd}.
12324 @end table
12325
12326 @node PowerPC Options
12327 @subsection PowerPC Options
12328 @cindex PowerPC options
12329
12330 These are listed under @xref{RS/6000 and PowerPC Options}.
12331
12332 @node RS/6000 and PowerPC Options
12333 @subsection IBM RS/6000 and PowerPC Options
12334 @cindex RS/6000 and PowerPC Options
12335 @cindex IBM RS/6000 and PowerPC Options
12336
12337 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
12338 @table @gcctabopt
12339 @item -mpower
12340 @itemx -mno-power
12341 @itemx -mpower2
12342 @itemx -mno-power2
12343 @itemx -mpowerpc
12344 @itemx -mno-powerpc
12345 @itemx -mpowerpc-gpopt
12346 @itemx -mno-powerpc-gpopt
12347 @itemx -mpowerpc-gfxopt
12348 @itemx -mno-powerpc-gfxopt
12349 @itemx -mpowerpc64
12350 @itemx -mno-powerpc64
12351 @itemx -mmfcrf
12352 @itemx -mno-mfcrf
12353 @itemx -mpopcntb
12354 @itemx -mno-popcntb
12355 @itemx -mfprnd
12356 @itemx -mno-fprnd
12357 @itemx -mcmpb
12358 @itemx -mno-cmpb
12359 @itemx -mmfpgpr
12360 @itemx -mno-mfpgpr
12361 @itemx -mdfp
12362 @itemx -mno-dfp
12363 @opindex mpower
12364 @opindex mno-power
12365 @opindex mpower2
12366 @opindex mno-power2
12367 @opindex mpowerpc
12368 @opindex mno-powerpc
12369 @opindex mpowerpc-gpopt
12370 @opindex mno-powerpc-gpopt
12371 @opindex mpowerpc-gfxopt
12372 @opindex mno-powerpc-gfxopt
12373 @opindex mpowerpc64
12374 @opindex mno-powerpc64
12375 @opindex mmfcrf
12376 @opindex mno-mfcrf
12377 @opindex mpopcntb
12378 @opindex mno-popcntb
12379 @opindex mfprnd
12380 @opindex mno-fprnd
12381 @opindex mcmpb
12382 @opindex mno-cmpb
12383 @opindex mmfpgpr
12384 @opindex mno-mfpgpr
12385 @opindex mdfp
12386 @opindex mno-dfp
12387 GCC supports two related instruction set architectures for the
12388 RS/6000 and PowerPC@.  The @dfn{POWER} instruction set are those
12389 instructions supported by the @samp{rios} chip set used in the original
12390 RS/6000 systems and the @dfn{PowerPC} instruction set is the
12391 architecture of the Freescale MPC5xx, MPC6xx, MPC8xx microprocessors, and
12392 the IBM 4xx, 6xx, and follow-on microprocessors.
12393
12394 Neither architecture is a subset of the other.  However there is a
12395 large common subset of instructions supported by both.  An MQ
12396 register is included in processors supporting the POWER architecture.
12397
12398 You use these options to specify which instructions are available on the
12399 processor you are using.  The default value of these options is
12400 determined when configuring GCC@.  Specifying the
12401 @option{-mcpu=@var{cpu_type}} overrides the specification of these
12402 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
12403 rather than the options listed above.
12404
12405 The @option{-mpower} option allows GCC to generate instructions that
12406 are found only in the POWER architecture and to use the MQ register.
12407 Specifying @option{-mpower2} implies @option{-power} and also allows GCC
12408 to generate instructions that are present in the POWER2 architecture but
12409 not the original POWER architecture.
12410
12411 The @option{-mpowerpc} option allows GCC to generate instructions that
12412 are found only in the 32-bit subset of the PowerPC architecture.
12413 Specifying @option{-mpowerpc-gpopt} implies @option{-mpowerpc} and also allows
12414 GCC to use the optional PowerPC architecture instructions in the
12415 General Purpose group, including floating-point square root.  Specifying
12416 @option{-mpowerpc-gfxopt} implies @option{-mpowerpc} and also allows GCC to
12417 use the optional PowerPC architecture instructions in the Graphics
12418 group, including floating-point select.
12419
12420 The @option{-mmfcrf} option allows GCC to generate the move from
12421 condition register field instruction implemented on the POWER4
12422 processor and other processors that support the PowerPC V2.01
12423 architecture.
12424 The @option{-mpopcntb} option allows GCC to generate the popcount and
12425 double precision FP reciprocal estimate instruction implemented on the
12426 POWER5 processor and other processors that support the PowerPC V2.02
12427 architecture.
12428 The @option{-mfprnd} option allows GCC to generate the FP round to
12429 integer instructions implemented on the POWER5+ processor and other
12430 processors that support the PowerPC V2.03 architecture.
12431 The @option{-mcmpb} option allows GCC to generate the compare bytes
12432 instruction implemented on the POWER6 processor and other processors
12433 that support the PowerPC V2.05 architecture.
12434 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
12435 general purpose register instructions implemented on the POWER6X
12436 processor and other processors that support the extended PowerPC V2.05
12437 architecture.
12438 The @option{-mdfp} option allows GCC to generate the decimal floating
12439 point instructions implemented on some POWER processors.
12440
12441 The @option{-mpowerpc64} option allows GCC to generate the additional
12442 64-bit instructions that are found in the full PowerPC64 architecture
12443 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
12444 @option{-mno-powerpc64}.
12445
12446 If you specify both @option{-mno-power} and @option{-mno-powerpc}, GCC
12447 will use only the instructions in the common subset of both
12448 architectures plus some special AIX common-mode calls, and will not use
12449 the MQ register.  Specifying both @option{-mpower} and @option{-mpowerpc}
12450 permits GCC to use any instruction from either architecture and to
12451 allow use of the MQ register; specify this for the Motorola MPC601.
12452
12453 @item -mnew-mnemonics
12454 @itemx -mold-mnemonics
12455 @opindex mnew-mnemonics
12456 @opindex mold-mnemonics
12457 Select which mnemonics to use in the generated assembler code.  With
12458 @option{-mnew-mnemonics}, GCC uses the assembler mnemonics defined for
12459 the PowerPC architecture.  With @option{-mold-mnemonics} it uses the
12460 assembler mnemonics defined for the POWER architecture.  Instructions
12461 defined in only one architecture have only one mnemonic; GCC uses that
12462 mnemonic irrespective of which of these options is specified.
12463
12464 GCC defaults to the mnemonics appropriate for the architecture in
12465 use.  Specifying @option{-mcpu=@var{cpu_type}} sometimes overrides the
12466 value of these option.  Unless you are building a cross-compiler, you
12467 should normally not specify either @option{-mnew-mnemonics} or
12468 @option{-mold-mnemonics}, but should instead accept the default.
12469
12470 @item -mcpu=@var{cpu_type}
12471 @opindex mcpu
12472 Set architecture type, register usage, choice of mnemonics, and
12473 instruction scheduling parameters for machine type @var{cpu_type}.
12474 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
12475 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{505},
12476 @samp{601}, @samp{602}, @samp{603}, @samp{603e}, @samp{604},
12477 @samp{604e}, @samp{620}, @samp{630}, @samp{740}, @samp{7400},
12478 @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
12479 @samp{860}, @samp{970}, @samp{8540}, @samp{ec603e}, @samp{G3},
12480 @samp{G4}, @samp{G5}, @samp{power}, @samp{power2}, @samp{power3},
12481 @samp{power4}, @samp{power5}, @samp{power5+}, @samp{power6},
12482 @samp{power6x}, @samp{common}, @samp{powerpc}, @samp{powerpc64},
12483 @samp{rios}, @samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64}.
12484
12485 @option{-mcpu=common} selects a completely generic processor.  Code
12486 generated under this option will run on any POWER or PowerPC processor.
12487 GCC will use only the instructions in the common subset of both
12488 architectures, and will not use the MQ register.  GCC assumes a generic
12489 processor model for scheduling purposes.
12490
12491 @option{-mcpu=power}, @option{-mcpu=power2}, @option{-mcpu=powerpc}, and
12492 @option{-mcpu=powerpc64} specify generic POWER, POWER2, pure 32-bit
12493 PowerPC (i.e., not MPC601), and 64-bit PowerPC architecture machine
12494 types, with an appropriate, generic processor model assumed for
12495 scheduling purposes.
12496
12497 The other options specify a specific processor.  Code generated under
12498 those options will run best on that processor, and may not run at all on
12499 others.
12500
12501 The @option{-mcpu} options automatically enable or disable the
12502 following options:
12503
12504 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
12505 -mnew-mnemonics  -mpopcntb  -mpower  -mpower2  -mpowerpc64 @gol
12506 -mpowerpc-gpopt  -mpowerpc-gfxopt  -mstring  -mmulhw  -mdlmzb  -mmfpgpr}
12507
12508 The particular options set for any particular CPU will vary between
12509 compiler versions, depending on what setting seems to produce optimal
12510 code for that CPU; it doesn't necessarily reflect the actual hardware's
12511 capabilities.  If you wish to set an individual option to a particular
12512 value, you may specify it after the @option{-mcpu} option, like
12513 @samp{-mcpu=970 -mno-altivec}.
12514
12515 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
12516 not enabled or disabled by the @option{-mcpu} option at present because
12517 AIX does not have full support for these options.  You may still
12518 enable or disable them individually if you're sure it'll work in your
12519 environment.
12520
12521 @item -mtune=@var{cpu_type}
12522 @opindex mtune
12523 Set the instruction scheduling parameters for machine type
12524 @var{cpu_type}, but do not set the architecture type, register usage, or
12525 choice of mnemonics, as @option{-mcpu=@var{cpu_type}} would.  The same
12526 values for @var{cpu_type} are used for @option{-mtune} as for
12527 @option{-mcpu}.  If both are specified, the code generated will use the
12528 architecture, registers, and mnemonics set by @option{-mcpu}, but the
12529 scheduling parameters set by @option{-mtune}.
12530
12531 @item -mswdiv
12532 @itemx -mno-swdiv
12533 @opindex mswdiv
12534 @opindex mno-swdiv
12535 Generate code to compute division as reciprocal estimate and iterative
12536 refinement, creating opportunities for increased throughput.  This
12537 feature requires: optional PowerPC Graphics instruction set for single
12538 precision and FRE instruction for double precision, assuming divides
12539 cannot generate user-visible traps, and the domain values not include
12540 Infinities, denormals or zero denominator.
12541
12542 @item -maltivec
12543 @itemx -mno-altivec
12544 @opindex maltivec
12545 @opindex mno-altivec
12546 Generate code that uses (does not use) AltiVec instructions, and also
12547 enable the use of built-in functions that allow more direct access to
12548 the AltiVec instruction set.  You may also need to set
12549 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
12550 enhancements.
12551
12552 @item -mvrsave
12553 @item -mno-vrsave
12554 @opindex mvrsave
12555 @opindex mno-vrsave
12556 Generate VRSAVE instructions when generating AltiVec code.
12557
12558 @item -msecure-plt
12559 @opindex msecure-plt
12560 Generate code that allows ld and ld.so to build executables and shared
12561 libraries with non-exec .plt and .got sections.  This is a PowerPC
12562 32-bit SYSV ABI option.
12563
12564 @item -mbss-plt
12565 @opindex mbss-plt
12566 Generate code that uses a BSS .plt section that ld.so fills in, and
12567 requires .plt and .got sections that are both writable and executable.
12568 This is a PowerPC 32-bit SYSV ABI option.
12569
12570 @item -misel
12571 @itemx -mno-isel
12572 @opindex misel
12573 @opindex mno-isel
12574 This switch enables or disables the generation of ISEL instructions.
12575
12576 @item -misel=@var{yes/no}
12577 This switch has been deprecated.  Use @option{-misel} and
12578 @option{-mno-isel} instead.
12579
12580 @item -mspe
12581 @itemx -mno-spe
12582 @opindex mspe
12583 @opindex mno-spe
12584 This switch enables or disables the generation of SPE simd
12585 instructions.
12586
12587 @item -mpaired
12588 @itemx -mno-paired
12589 @opindex mpaired
12590 @opindex mno-paired
12591 This switch enables or disables the generation of PAIRED simd
12592 instructions.
12593
12594 @item -mspe=@var{yes/no}
12595 This option has been deprecated.  Use @option{-mspe} and
12596 @option{-mno-spe} instead.
12597
12598 @item -mfloat-gprs=@var{yes/single/double/no}
12599 @itemx -mfloat-gprs
12600 @opindex mfloat-gprs
12601 This switch enables or disables the generation of floating point
12602 operations on the general purpose registers for architectures that
12603 support it.
12604
12605 The argument @var{yes} or @var{single} enables the use of
12606 single-precision floating point operations.
12607
12608 The argument @var{double} enables the use of single and
12609 double-precision floating point operations.
12610
12611 The argument @var{no} disables floating point operations on the
12612 general purpose registers.
12613
12614 This option is currently only available on the MPC854x.
12615
12616 @item -m32
12617 @itemx -m64
12618 @opindex m32
12619 @opindex m64
12620 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
12621 targets (including GNU/Linux).  The 32-bit environment sets int, long
12622 and pointer to 32 bits and generates code that runs on any PowerPC
12623 variant.  The 64-bit environment sets int to 32 bits and long and
12624 pointer to 64 bits, and generates code for PowerPC64, as for
12625 @option{-mpowerpc64}.
12626
12627 @item -mfull-toc
12628 @itemx -mno-fp-in-toc
12629 @itemx -mno-sum-in-toc
12630 @itemx -mminimal-toc
12631 @opindex mfull-toc
12632 @opindex mno-fp-in-toc
12633 @opindex mno-sum-in-toc
12634 @opindex mminimal-toc
12635 Modify generation of the TOC (Table Of Contents), which is created for
12636 every executable file.  The @option{-mfull-toc} option is selected by
12637 default.  In that case, GCC will allocate at least one TOC entry for
12638 each unique non-automatic variable reference in your program.  GCC
12639 will also place floating-point constants in the TOC@.  However, only
12640 16,384 entries are available in the TOC@.
12641
12642 If you receive a linker error message that saying you have overflowed
12643 the available TOC space, you can reduce the amount of TOC space used
12644 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
12645 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
12646 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
12647 generate code to calculate the sum of an address and a constant at
12648 run-time instead of putting that sum into the TOC@.  You may specify one
12649 or both of these options.  Each causes GCC to produce very slightly
12650 slower and larger code at the expense of conserving TOC space.
12651
12652 If you still run out of space in the TOC even when you specify both of
12653 these options, specify @option{-mminimal-toc} instead.  This option causes
12654 GCC to make only one TOC entry for every file.  When you specify this
12655 option, GCC will produce code that is slower and larger but which
12656 uses extremely little TOC space.  You may wish to use this option
12657 only on files that contain less frequently executed code.
12658
12659 @item -maix64
12660 @itemx -maix32
12661 @opindex maix64
12662 @opindex maix32
12663 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
12664 @code{long} type, and the infrastructure needed to support them.
12665 Specifying @option{-maix64} implies @option{-mpowerpc64} and
12666 @option{-mpowerpc}, while @option{-maix32} disables the 64-bit ABI and
12667 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
12668
12669 @item -mxl-compat
12670 @itemx -mno-xl-compat
12671 @opindex mxl-compat
12672 @opindex mno-xl-compat
12673 Produce code that conforms more closely to IBM XL compiler semantics
12674 when using AIX-compatible ABI.  Pass floating-point arguments to
12675 prototyped functions beyond the register save area (RSA) on the stack
12676 in addition to argument FPRs.  Do not assume that most significant
12677 double in 128-bit long double value is properly rounded when comparing
12678 values and converting to double.  Use XL symbol names for long double
12679 support routines.
12680
12681 The AIX calling convention was extended but not initially documented to
12682 handle an obscure K&R C case of calling a function that takes the
12683 address of its arguments with fewer arguments than declared.  IBM XL
12684 compilers access floating point arguments which do not fit in the
12685 RSA from the stack when a subroutine is compiled without
12686 optimization.  Because always storing floating-point arguments on the
12687 stack is inefficient and rarely needed, this option is not enabled by
12688 default and only is necessary when calling subroutines compiled by IBM
12689 XL compilers without optimization.
12690
12691 @item -mpe
12692 @opindex mpe
12693 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
12694 application written to use message passing with special startup code to
12695 enable the application to run.  The system must have PE installed in the
12696 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
12697 must be overridden with the @option{-specs=} option to specify the
12698 appropriate directory location.  The Parallel Environment does not
12699 support threads, so the @option{-mpe} option and the @option{-pthread}
12700 option are incompatible.
12701
12702 @item -malign-natural
12703 @itemx -malign-power
12704 @opindex malign-natural
12705 @opindex malign-power
12706 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
12707 @option{-malign-natural} overrides the ABI-defined alignment of larger
12708 types, such as floating-point doubles, on their natural size-based boundary.
12709 The option @option{-malign-power} instructs GCC to follow the ABI-specified
12710 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
12711
12712 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
12713 is not supported.
12714
12715 @item -msoft-float
12716 @itemx -mhard-float
12717 @opindex msoft-float
12718 @opindex mhard-float
12719 Generate code that does not use (uses) the floating-point register set.
12720 Software floating point emulation is provided if you use the
12721 @option{-msoft-float} option, and pass the option to GCC when linking.
12722
12723 @item -mmultiple
12724 @itemx -mno-multiple
12725 @opindex mmultiple
12726 @opindex mno-multiple
12727 Generate code that uses (does not use) the load multiple word
12728 instructions and the store multiple word instructions.  These
12729 instructions are generated by default on POWER systems, and not
12730 generated on PowerPC systems.  Do not use @option{-mmultiple} on little
12731 endian PowerPC systems, since those instructions do not work when the
12732 processor is in little endian mode.  The exceptions are PPC740 and
12733 PPC750 which permit the instructions usage in little endian mode.
12734
12735 @item -mstring
12736 @itemx -mno-string
12737 @opindex mstring
12738 @opindex mno-string
12739 Generate code that uses (does not use) the load string instructions
12740 and the store string word instructions to save multiple registers and
12741 do small block moves.  These instructions are generated by default on
12742 POWER systems, and not generated on PowerPC systems.  Do not use
12743 @option{-mstring} on little endian PowerPC systems, since those
12744 instructions do not work when the processor is in little endian mode.
12745 The exceptions are PPC740 and PPC750 which permit the instructions
12746 usage in little endian mode.
12747
12748 @item -mupdate
12749 @itemx -mno-update
12750 @opindex mupdate
12751 @opindex mno-update
12752 Generate code that uses (does not use) the load or store instructions
12753 that update the base register to the address of the calculated memory
12754 location.  These instructions are generated by default.  If you use
12755 @option{-mno-update}, there is a small window between the time that the
12756 stack pointer is updated and the address of the previous frame is
12757 stored, which means code that walks the stack frame across interrupts or
12758 signals may get corrupted data.
12759
12760 @item -mfused-madd
12761 @itemx -mno-fused-madd
12762 @opindex mfused-madd
12763 @opindex mno-fused-madd
12764 Generate code that uses (does not use) the floating point multiply and
12765 accumulate instructions.  These instructions are generated by default if
12766 hardware floating is used.
12767
12768 @item -mmulhw
12769 @itemx -mno-mulhw
12770 @opindex mmulhw
12771 @opindex mno-mulhw
12772 Generate code that uses (does not use) the half-word multiply and
12773 multiply-accumulate instructions on the IBM 405 and 440 processors.
12774 These instructions are generated by default when targetting those
12775 processors.
12776
12777 @item -mdlmzb
12778 @itemx -mno-dlmzb
12779 @opindex mdlmzb
12780 @opindex mno-dlmzb
12781 Generate code that uses (does not use) the string-search @samp{dlmzb}
12782 instruction on the IBM 405 and 440 processors.  This instruction is
12783 generated by default when targetting those processors.
12784
12785 @item -mno-bit-align
12786 @itemx -mbit-align
12787 @opindex mno-bit-align
12788 @opindex mbit-align
12789 On System V.4 and embedded PowerPC systems do not (do) force structures
12790 and unions that contain bit-fields to be aligned to the base type of the
12791 bit-field.
12792
12793 For example, by default a structure containing nothing but 8
12794 @code{unsigned} bit-fields of length 1 would be aligned to a 4 byte
12795 boundary and have a size of 4 bytes.  By using @option{-mno-bit-align},
12796 the structure would be aligned to a 1 byte boundary and be one byte in
12797 size.
12798
12799 @item -mno-strict-align
12800 @itemx -mstrict-align
12801 @opindex mno-strict-align
12802 @opindex mstrict-align
12803 On System V.4 and embedded PowerPC systems do not (do) assume that
12804 unaligned memory references will be handled by the system.
12805
12806 @item -mrelocatable
12807 @itemx -mno-relocatable
12808 @opindex mrelocatable
12809 @opindex mno-relocatable
12810 On embedded PowerPC systems generate code that allows (does not allow)
12811 the program to be relocated to a different address at runtime.  If you
12812 use @option{-mrelocatable} on any module, all objects linked together must
12813 be compiled with @option{-mrelocatable} or @option{-mrelocatable-lib}.
12814
12815 @item -mrelocatable-lib
12816 @itemx -mno-relocatable-lib
12817 @opindex mrelocatable-lib
12818 @opindex mno-relocatable-lib
12819 On embedded PowerPC systems generate code that allows (does not allow)
12820 the program to be relocated to a different address at runtime.  Modules
12821 compiled with @option{-mrelocatable-lib} can be linked with either modules
12822 compiled without @option{-mrelocatable} and @option{-mrelocatable-lib} or
12823 with modules compiled with the @option{-mrelocatable} options.
12824
12825 @item -mno-toc
12826 @itemx -mtoc
12827 @opindex mno-toc
12828 @opindex mtoc
12829 On System V.4 and embedded PowerPC systems do not (do) assume that
12830 register 2 contains a pointer to a global area pointing to the addresses
12831 used in the program.
12832
12833 @item -mlittle
12834 @itemx -mlittle-endian
12835 @opindex mlittle
12836 @opindex mlittle-endian
12837 On System V.4 and embedded PowerPC systems compile code for the
12838 processor in little endian mode.  The @option{-mlittle-endian} option is
12839 the same as @option{-mlittle}.
12840
12841 @item -mbig
12842 @itemx -mbig-endian
12843 @opindex mbig
12844 @opindex mbig-endian
12845 On System V.4 and embedded PowerPC systems compile code for the
12846 processor in big endian mode.  The @option{-mbig-endian} option is
12847 the same as @option{-mbig}.
12848
12849 @item -mdynamic-no-pic
12850 @opindex mdynamic-no-pic
12851 On Darwin and Mac OS X systems, compile code so that it is not
12852 relocatable, but that its external references are relocatable.  The
12853 resulting code is suitable for applications, but not shared
12854 libraries.
12855
12856 @item -mprioritize-restricted-insns=@var{priority}
12857 @opindex mprioritize-restricted-insns
12858 This option controls the priority that is assigned to
12859 dispatch-slot restricted instructions during the second scheduling
12860 pass.  The argument @var{priority} takes the value @var{0/1/2} to assign
12861 @var{no/highest/second-highest} priority to dispatch slot restricted
12862 instructions.
12863
12864 @item -msched-costly-dep=@var{dependence_type}
12865 @opindex msched-costly-dep
12866 This option controls which dependences are considered costly
12867 by the target during instruction scheduling.  The argument
12868 @var{dependence_type} takes one of the following values:
12869 @var{no}: no dependence is costly,
12870 @var{all}: all dependences are costly,
12871 @var{true_store_to_load}: a true dependence from store to load is costly,
12872 @var{store_to_load}: any dependence from store to load is costly,
12873 @var{number}: any dependence which latency >= @var{number} is costly.
12874
12875 @item -minsert-sched-nops=@var{scheme}
12876 @opindex minsert-sched-nops
12877 This option controls which nop insertion scheme will be used during
12878 the second scheduling pass.  The argument @var{scheme} takes one of the
12879 following values:
12880 @var{no}: Don't insert nops.
12881 @var{pad}: Pad with nops any dispatch group which has vacant issue slots,
12882 according to the scheduler's grouping.
12883 @var{regroup_exact}: Insert nops to force costly dependent insns into
12884 separate groups.  Insert exactly as many nops as needed to force an insn
12885 to a new group, according to the estimated processor grouping.
12886 @var{number}: Insert nops to force costly dependent insns into
12887 separate groups.  Insert @var{number} nops to force an insn to a new group.
12888
12889 @item -mcall-sysv
12890 @opindex mcall-sysv
12891 On System V.4 and embedded PowerPC systems compile code using calling
12892 conventions that adheres to the March 1995 draft of the System V
12893 Application Binary Interface, PowerPC processor supplement.  This is the
12894 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
12895
12896 @item -mcall-sysv-eabi
12897 @opindex mcall-sysv-eabi
12898 Specify both @option{-mcall-sysv} and @option{-meabi} options.
12899
12900 @item -mcall-sysv-noeabi
12901 @opindex mcall-sysv-noeabi
12902 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
12903
12904 @item -mcall-solaris
12905 @opindex mcall-solaris
12906 On System V.4 and embedded PowerPC systems compile code for the Solaris
12907 operating system.
12908
12909 @item -mcall-linux
12910 @opindex mcall-linux
12911 On System V.4 and embedded PowerPC systems compile code for the
12912 Linux-based GNU system.
12913
12914 @item -mcall-gnu
12915 @opindex mcall-gnu
12916 On System V.4 and embedded PowerPC systems compile code for the
12917 Hurd-based GNU system.
12918
12919 @item -mcall-netbsd
12920 @opindex mcall-netbsd
12921 On System V.4 and embedded PowerPC systems compile code for the
12922 NetBSD operating system.
12923
12924 @item -maix-struct-return
12925 @opindex maix-struct-return
12926 Return all structures in memory (as specified by the AIX ABI)@.
12927
12928 @item -msvr4-struct-return
12929 @opindex msvr4-struct-return
12930 Return structures smaller than 8 bytes in registers (as specified by the
12931 SVR4 ABI)@.
12932
12933 @item -mabi=@var{abi-type}
12934 @opindex mabi
12935 Extend the current ABI with a particular extension, or remove such extension.
12936 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
12937 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble}@.
12938
12939 @item -mabi=spe
12940 @opindex mabi=spe
12941 Extend the current ABI with SPE ABI extensions.  This does not change
12942 the default ABI, instead it adds the SPE ABI extensions to the current
12943 ABI@.
12944
12945 @item -mabi=no-spe
12946 @opindex mabi=no-spe
12947 Disable Booke SPE ABI extensions for the current ABI@.
12948
12949 @item -mabi=ibmlongdouble
12950 @opindex mabi=ibmlongdouble
12951 Change the current ABI to use IBM extended precision long double.
12952 This is a PowerPC 32-bit SYSV ABI option.
12953
12954 @item -mabi=ieeelongdouble
12955 @opindex mabi=ieeelongdouble
12956 Change the current ABI to use IEEE extended precision long double.
12957 This is a PowerPC 32-bit Linux ABI option.
12958
12959 @item -mprototype
12960 @itemx -mno-prototype
12961 @opindex mprototype
12962 @opindex mno-prototype
12963 On System V.4 and embedded PowerPC systems assume that all calls to
12964 variable argument functions are properly prototyped.  Otherwise, the
12965 compiler must insert an instruction before every non prototyped call to
12966 set or clear bit 6 of the condition code register (@var{CR}) to
12967 indicate whether floating point values were passed in the floating point
12968 registers in case the function takes a variable arguments.  With
12969 @option{-mprototype}, only calls to prototyped variable argument functions
12970 will set or clear the bit.
12971
12972 @item -msim
12973 @opindex msim
12974 On embedded PowerPC systems, assume that the startup module is called
12975 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
12976 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}.
12977 configurations.
12978
12979 @item -mmvme
12980 @opindex mmvme
12981 On embedded PowerPC systems, assume that the startup module is called
12982 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
12983 @file{libc.a}.
12984
12985 @item -mads
12986 @opindex mads
12987 On embedded PowerPC systems, assume that the startup module is called
12988 @file{crt0.o} and the standard C libraries are @file{libads.a} and
12989 @file{libc.a}.
12990
12991 @item -myellowknife
12992 @opindex myellowknife
12993 On embedded PowerPC systems, assume that the startup module is called
12994 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
12995 @file{libc.a}.
12996
12997 @item -mvxworks
12998 @opindex mvxworks
12999 On System V.4 and embedded PowerPC systems, specify that you are
13000 compiling for a VxWorks system.
13001
13002 @item -mwindiss
13003 @opindex mwindiss
13004 Specify that you are compiling for the WindISS simulation environment.
13005
13006 @item -memb
13007 @opindex memb
13008 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
13009 header to indicate that @samp{eabi} extended relocations are used.
13010
13011 @item -meabi
13012 @itemx -mno-eabi
13013 @opindex meabi
13014 @opindex mno-eabi
13015 On System V.4 and embedded PowerPC systems do (do not) adhere to the
13016 Embedded Applications Binary Interface (eabi) which is a set of
13017 modifications to the System V.4 specifications.  Selecting @option{-meabi}
13018 means that the stack is aligned to an 8 byte boundary, a function
13019 @code{__eabi} is called to from @code{main} to set up the eabi
13020 environment, and the @option{-msdata} option can use both @code{r2} and
13021 @code{r13} to point to two separate small data areas.  Selecting
13022 @option{-mno-eabi} means that the stack is aligned to a 16 byte boundary,
13023 do not call an initialization function from @code{main}, and the
13024 @option{-msdata} option will only use @code{r13} to point to a single
13025 small data area.  The @option{-meabi} option is on by default if you
13026 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
13027
13028 @item -msdata=eabi
13029 @opindex msdata=eabi
13030 On System V.4 and embedded PowerPC systems, put small initialized
13031 @code{const} global and static data in the @samp{.sdata2} section, which
13032 is pointed to by register @code{r2}.  Put small initialized
13033 non-@code{const} global and static data in the @samp{.sdata} section,
13034 which is pointed to by register @code{r13}.  Put small uninitialized
13035 global and static data in the @samp{.sbss} section, which is adjacent to
13036 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
13037 incompatible with the @option{-mrelocatable} option.  The
13038 @option{-msdata=eabi} option also sets the @option{-memb} option.
13039
13040 @item -msdata=sysv
13041 @opindex msdata=sysv
13042 On System V.4 and embedded PowerPC systems, put small global and static
13043 data in the @samp{.sdata} section, which is pointed to by register
13044 @code{r13}.  Put small uninitialized global and static data in the
13045 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
13046 The @option{-msdata=sysv} option is incompatible with the
13047 @option{-mrelocatable} option.
13048
13049 @item -msdata=default
13050 @itemx -msdata
13051 @opindex msdata=default
13052 @opindex msdata
13053 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
13054 compile code the same as @option{-msdata=eabi}, otherwise compile code the
13055 same as @option{-msdata=sysv}.
13056
13057 @item -msdata-data
13058 @opindex msdata-data
13059 On System V.4 and embedded PowerPC systems, put small global
13060 data in the @samp{.sdata} section.  Put small uninitialized global
13061 data in the @samp{.sbss} section.  Do not use register @code{r13}
13062 to address small data however.  This is the default behavior unless
13063 other @option{-msdata} options are used.
13064
13065 @item -msdata=none
13066 @itemx -mno-sdata
13067 @opindex msdata=none
13068 @opindex mno-sdata
13069 On embedded PowerPC systems, put all initialized global and static data
13070 in the @samp{.data} section, and all uninitialized data in the
13071 @samp{.bss} section.
13072
13073 @item -G @var{num}
13074 @opindex G
13075 @cindex smaller data references (PowerPC)
13076 @cindex .sdata/.sdata2 references (PowerPC)
13077 On embedded PowerPC systems, put global and static items less than or
13078 equal to @var{num} bytes into the small data or bss sections instead of
13079 the normal data or bss section.  By default, @var{num} is 8.  The
13080 @option{-G @var{num}} switch is also passed to the linker.
13081 All modules should be compiled with the same @option{-G @var{num}} value.
13082
13083 @item -mregnames
13084 @itemx -mno-regnames
13085 @opindex mregnames
13086 @opindex mno-regnames
13087 On System V.4 and embedded PowerPC systems do (do not) emit register
13088 names in the assembly language output using symbolic forms.
13089
13090 @item -mlongcall
13091 @itemx -mno-longcall
13092 @opindex mlongcall
13093 @opindex mno-longcall
13094 By default assume that all calls are far away so that a longer more
13095 expensive calling sequence is required.  This is required for calls
13096 further than 32 megabytes (33,554,432 bytes) from the current location.
13097 A short call will be generated if the compiler knows
13098 the call cannot be that far away.  This setting can be overridden by
13099 the @code{shortcall} function attribute, or by @code{#pragma
13100 longcall(0)}.
13101
13102 Some linkers are capable of detecting out-of-range calls and generating
13103 glue code on the fly.  On these systems, long calls are unnecessary and
13104 generate slower code.  As of this writing, the AIX linker can do this,
13105 as can the GNU linker for PowerPC/64.  It is planned to add this feature
13106 to the GNU linker for 32-bit PowerPC systems as well.
13107
13108 On Darwin/PPC systems, @code{#pragma longcall} will generate ``jbsr
13109 callee, L42'', plus a ``branch island'' (glue code).  The two target
13110 addresses represent the callee and the ``branch island''.  The
13111 Darwin/PPC linker will prefer the first address and generate a ``bl
13112 callee'' if the PPC ``bl'' instruction will reach the callee directly;
13113 otherwise, the linker will generate ``bl L42'' to call the ``branch
13114 island''.  The ``branch island'' is appended to the body of the
13115 calling function; it computes the full 32-bit address of the callee
13116 and jumps to it.
13117
13118 On Mach-O (Darwin) systems, this option directs the compiler emit to
13119 the glue for every direct call, and the Darwin linker decides whether
13120 to use or discard it.
13121
13122 In the future, we may cause GCC to ignore all longcall specifications
13123 when the linker is known to generate glue.
13124
13125 @item -pthread
13126 @opindex pthread
13127 Adds support for multithreading with the @dfn{pthreads} library.
13128 This option sets flags for both the preprocessor and linker.
13129
13130 @end table
13131
13132 @node S/390 and zSeries Options
13133 @subsection S/390 and zSeries Options
13134 @cindex S/390 and zSeries Options
13135
13136 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
13137
13138 @table @gcctabopt
13139 @item -mhard-float
13140 @itemx -msoft-float
13141 @opindex mhard-float
13142 @opindex msoft-float
13143 Use (do not use) the hardware floating-point instructions and registers
13144 for floating-point operations.  When @option{-msoft-float} is specified,
13145 functions in @file{libgcc.a} will be used to perform floating-point
13146 operations.  When @option{-mhard-float} is specified, the compiler
13147 generates IEEE floating-point instructions.  This is the default.
13148
13149 @item -mlong-double-64
13150 @itemx -mlong-double-128
13151 @opindex mlong-double-64
13152 @opindex mlong-double-128
13153 These switches control the size of @code{long double} type. A size
13154 of 64bit makes the @code{long double} type equivalent to the @code{double}
13155 type. This is the default.
13156
13157 @item -mbackchain
13158 @itemx -mno-backchain
13159 @opindex mbackchain
13160 @opindex mno-backchain
13161 Store (do not store) the address of the caller's frame as backchain pointer
13162 into the callee's stack frame.
13163 A backchain may be needed to allow debugging using tools that do not understand
13164 DWARF-2 call frame information.
13165 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
13166 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
13167 the backchain is placed into the topmost word of the 96/160 byte register
13168 save area.
13169
13170 In general, code compiled with @option{-mbackchain} is call-compatible with
13171 code compiled with @option{-mmo-backchain}; however, use of the backchain
13172 for debugging purposes usually requires that the whole binary is built with
13173 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
13174 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
13175 to build a linux kernel use @option{-msoft-float}.
13176
13177 The default is to not maintain the backchain.
13178
13179 @item -mpacked-stack
13180 @item -mno-packed-stack
13181 @opindex mpacked-stack
13182 @opindex mno-packed-stack
13183 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
13184 specified, the compiler uses the all fields of the 96/160 byte register save
13185 area only for their default purpose; unused fields still take up stack space.
13186 When @option{-mpacked-stack} is specified, register save slots are densely
13187 packed at the top of the register save area; unused space is reused for other
13188 purposes, allowing for more efficient use of the available stack space.
13189 However, when @option{-mbackchain} is also in effect, the topmost word of
13190 the save area is always used to store the backchain, and the return address
13191 register is always saved two words below the backchain.
13192
13193 As long as the stack frame backchain is not used, code generated with
13194 @option{-mpacked-stack} is call-compatible with code generated with
13195 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
13196 S/390 or zSeries generated code that uses the stack frame backchain at run
13197 time, not just for debugging purposes.  Such code is not call-compatible
13198 with code compiled with @option{-mpacked-stack}.  Also, note that the
13199 combination of @option{-mbackchain},
13200 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
13201 to build a linux kernel use @option{-msoft-float}.
13202
13203 The default is to not use the packed stack layout.
13204
13205 @item -msmall-exec
13206 @itemx -mno-small-exec
13207 @opindex msmall-exec
13208 @opindex mno-small-exec
13209 Generate (or do not generate) code using the @code{bras} instruction
13210 to do subroutine calls.
13211 This only works reliably if the total executable size does not
13212 exceed 64k.  The default is to use the @code{basr} instruction instead,
13213 which does not have this limitation.
13214
13215 @item -m64
13216 @itemx -m31
13217 @opindex m64
13218 @opindex m31
13219 When @option{-m31} is specified, generate code compliant to the
13220 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
13221 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
13222 particular to generate 64-bit instructions.  For the @samp{s390}
13223 targets, the default is @option{-m31}, while the @samp{s390x}
13224 targets default to @option{-m64}.
13225
13226 @item -mzarch
13227 @itemx -mesa
13228 @opindex mzarch
13229 @opindex mesa
13230 When @option{-mzarch} is specified, generate code using the
13231 instructions available on z/Architecture.
13232 When @option{-mesa} is specified, generate code using the
13233 instructions available on ESA/390.  Note that @option{-mesa} is
13234 not possible with @option{-m64}.
13235 When generating code compliant to the GNU/Linux for S/390 ABI,
13236 the default is @option{-mesa}.  When generating code compliant
13237 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
13238
13239 @item -mmvcle
13240 @itemx -mno-mvcle
13241 @opindex mmvcle
13242 @opindex mno-mvcle
13243 Generate (or do not generate) code using the @code{mvcle} instruction
13244 to perform block moves.  When @option{-mno-mvcle} is specified,
13245 use a @code{mvc} loop instead.  This is the default unless optimizing for
13246 size.
13247
13248 @item -mdebug
13249 @itemx -mno-debug
13250 @opindex mdebug
13251 @opindex mno-debug
13252 Print (or do not print) additional debug information when compiling.
13253 The default is to not print debug information.
13254
13255 @item -march=@var{cpu-type}
13256 @opindex march
13257 Generate code that will run on @var{cpu-type}, which is the name of a system
13258 representing a certain processor type.  Possible values for
13259 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, and @samp{z990}.
13260 When generating code using the instructions available on z/Architecture,
13261 the default is @option{-march=z900}.  Otherwise, the default is
13262 @option{-march=g5}.
13263
13264 @item -mtune=@var{cpu-type}
13265 @opindex mtune
13266 Tune to @var{cpu-type} everything applicable about the generated code,
13267 except for the ABI and the set of available instructions.
13268 The list of @var{cpu-type} values is the same as for @option{-march}.
13269 The default is the value used for @option{-march}.
13270
13271 @item -mtpf-trace
13272 @itemx -mno-tpf-trace
13273 @opindex mtpf-trace
13274 @opindex mno-tpf-trace
13275 Generate code that adds (does not add) in TPF OS specific branches to trace
13276 routines in the operating system.  This option is off by default, even
13277 when compiling for the TPF OS@.
13278
13279 @item -mfused-madd
13280 @itemx -mno-fused-madd
13281 @opindex mfused-madd
13282 @opindex mno-fused-madd
13283 Generate code that uses (does not use) the floating point multiply and
13284 accumulate instructions.  These instructions are generated by default if
13285 hardware floating point is used.
13286
13287 @item -mwarn-framesize=@var{framesize}
13288 @opindex mwarn-framesize
13289 Emit a warning if the current function exceeds the given frame size.  Because
13290 this is a compile time check it doesn't need to be a real problem when the program
13291 runs.  It is intended to identify functions which most probably cause
13292 a stack overflow.  It is useful to be used in an environment with limited stack
13293 size e.g.@: the linux kernel.
13294
13295 @item -mwarn-dynamicstack
13296 @opindex mwarn-dynamicstack
13297 Emit a warning if the function calls alloca or uses dynamically
13298 sized arrays.  This is generally a bad idea with a limited stack size.
13299
13300 @item -mstack-guard=@var{stack-guard}
13301 @item -mstack-size=@var{stack-size}
13302 @opindex mstack-guard
13303 @opindex mstack-size
13304 If these options are provided the s390 back end emits additional instructions in
13305 the function prologue which trigger a trap if the stack size is @var{stack-guard}
13306 bytes above the @var{stack-size} (remember that the stack on s390 grows downward).
13307 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
13308 the frame size of the compiled function is chosen.
13309 These options are intended to be used to help debugging stack overflow problems.
13310 The additionally emitted code causes only little overhead and hence can also be
13311 used in production like systems without greater performance degradation.  The given
13312 values have to be exact powers of 2 and @var{stack-size} has to be greater than
13313 @var{stack-guard} without exceeding 64k.
13314 In order to be efficient the extra code makes the assumption that the stack starts
13315 at an address aligned to the value given by @var{stack-size}.
13316 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
13317 @end table
13318
13319 @node Score Options
13320 @subsection Score Options
13321 @cindex Score Options
13322
13323 These options are defined for Score implementations:
13324
13325 @table @gcctabopt
13326 @item -meb
13327 @opindex meb
13328 Compile code for big endian mode.  This is the default.
13329
13330 @item -mel
13331 @opindex mel
13332 Compile code for little endian mode. 
13333
13334 @item -mnhwloop
13335 @opindex mnhwloop
13336 Disable generate bcnz instruction.
13337
13338 @item -muls
13339 @opindex muls
13340 Enable generate unaligned load and store instruction.
13341
13342 @item -mmac
13343 @opindex mmac
13344 Enable the use of multiply-accumulate instructions. Disabled by default. 
13345
13346 @item -mscore5
13347 @opindex mscore5
13348 Specify the SCORE5 as the target architecture.
13349
13350 @item -mscore5u
13351 @opindex mscore5u
13352 Specify the SCORE5U of the target architecture.
13353
13354 @item -mscore7
13355 @opindex mscore7
13356 Specify the SCORE7 as the target architecture. This is the default.
13357
13358 @item -mscore7d
13359 @opindex mscore7d
13360 Specify the SCORE7D as the target architecture.
13361 @end table
13362
13363 @node SH Options
13364 @subsection SH Options
13365
13366 These @samp{-m} options are defined for the SH implementations:
13367
13368 @table @gcctabopt
13369 @item -m1
13370 @opindex m1
13371 Generate code for the SH1.
13372
13373 @item -m2
13374 @opindex m2
13375 Generate code for the SH2.
13376
13377 @item -m2e
13378 Generate code for the SH2e.
13379
13380 @item -m3
13381 @opindex m3
13382 Generate code for the SH3.
13383
13384 @item -m3e
13385 @opindex m3e
13386 Generate code for the SH3e.
13387
13388 @item -m4-nofpu
13389 @opindex m4-nofpu
13390 Generate code for the SH4 without a floating-point unit.
13391
13392 @item -m4-single-only
13393 @opindex m4-single-only
13394 Generate code for the SH4 with a floating-point unit that only
13395 supports single-precision arithmetic.
13396
13397 @item -m4-single
13398 @opindex m4-single
13399 Generate code for the SH4 assuming the floating-point unit is in
13400 single-precision mode by default.
13401
13402 @item -m4
13403 @opindex m4
13404 Generate code for the SH4.
13405
13406 @item -m4a-nofpu
13407 @opindex m4a-nofpu
13408 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
13409 floating-point unit is not used.
13410
13411 @item -m4a-single-only
13412 @opindex m4a-single-only
13413 Generate code for the SH4a, in such a way that no double-precision
13414 floating point operations are used.
13415
13416 @item -m4a-single
13417 @opindex m4a-single
13418 Generate code for the SH4a assuming the floating-point unit is in
13419 single-precision mode by default.
13420
13421 @item -m4a
13422 @opindex m4a
13423 Generate code for the SH4a.
13424
13425 @item -m4al
13426 @opindex m4al
13427 Same as @option{-m4a-nofpu}, except that it implicitly passes
13428 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
13429 instructions at the moment.
13430
13431 @item -mb
13432 @opindex mb
13433 Compile code for the processor in big endian mode.
13434
13435 @item -ml
13436 @opindex ml
13437 Compile code for the processor in little endian mode.
13438
13439 @item -mdalign
13440 @opindex mdalign
13441 Align doubles at 64-bit boundaries.  Note that this changes the calling
13442 conventions, and thus some functions from the standard C library will
13443 not work unless you recompile it first with @option{-mdalign}.
13444
13445 @item -mrelax
13446 @opindex mrelax
13447 Shorten some address references at link time, when possible; uses the
13448 linker option @option{-relax}.
13449
13450 @item -mbigtable
13451 @opindex mbigtable
13452 Use 32-bit offsets in @code{switch} tables.  The default is to use
13453 16-bit offsets.
13454
13455 @item -mfmovd
13456 @opindex mfmovd
13457 Enable the use of the instruction @code{fmovd}.
13458
13459 @item -mhitachi
13460 @opindex mhitachi
13461 Comply with the calling conventions defined by Renesas.
13462
13463 @item -mrenesas
13464 @opindex mhitachi
13465 Comply with the calling conventions defined by Renesas.
13466
13467 @item -mno-renesas
13468 @opindex mhitachi
13469 Comply with the calling conventions defined for GCC before the Renesas
13470 conventions were available.  This option is the default for all
13471 targets of the SH toolchain except for @samp{sh-symbianelf}.
13472
13473 @item -mnomacsave
13474 @opindex mnomacsave
13475 Mark the @code{MAC} register as call-clobbered, even if
13476 @option{-mhitachi} is given.
13477
13478 @item -mieee
13479 @opindex mieee
13480 Increase IEEE-compliance of floating-point code.
13481 At the moment, this is equivalent to @option{-fno-finite-math-only}.
13482 When generating 16 bit SH opcodes, getting IEEE-conforming results for
13483 comparisons of NANs / infinities incurs extra overhead in every
13484 floating point comparison, therefore the default is set to
13485 @option{-ffinite-math-only}.
13486
13487 @item -minline-ic_invalidate
13488 @opindex minline-ic_invalidate
13489 Inline code to invalidate instruction cache entries after setting up
13490 nested function trampolines.
13491 This option has no effect if -musermode is in effect and the selected
13492 code generation option (e.g. -m4) does not allow the use of the icbi
13493 instruction.
13494 If the selected code generation option does not allow the use of the icbi
13495 instruction, and -musermode is not in effect, the inlined code will
13496 manipulate the instruction cache address array directly with an associative
13497 write.  This not only requires privileged mode, but it will also
13498 fail if the cache line had been mapped via the TLB and has become unmapped.
13499
13500 @item -misize
13501 @opindex misize
13502 Dump instruction size and location in the assembly code.
13503
13504 @item -mpadstruct
13505 @opindex mpadstruct
13506 This option is deprecated.  It pads structures to multiple of 4 bytes,
13507 which is incompatible with the SH ABI@.
13508
13509 @item -mspace
13510 @opindex mspace
13511 Optimize for space instead of speed.  Implied by @option{-Os}.
13512
13513 @item -mprefergot
13514 @opindex mprefergot
13515 When generating position-independent code, emit function calls using
13516 the Global Offset Table instead of the Procedure Linkage Table.
13517
13518 @item -musermode
13519 @opindex musermode
13520 Don't generate privileged mode only code; implies -mno-inline-ic_invalidate
13521 if the inlined code would not work in user mode.
13522 This is the default when the target is @code{sh-*-linux*}.
13523
13524 @item -multcost=@var{number}
13525 @opindex multcost=@var{number}
13526 Set the cost to assume for a multiply insn.
13527
13528 @item -mdiv=@var{strategy}
13529 @opindex mdiv=@var{strategy}
13530 Set the division strategy to use for SHmedia code.  @var{strategy} must be
13531 one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, inv:call,
13532 inv:call2, inv:fp .
13533 "fp" performs the operation in floating point.  This has a very high latency,
13534 but needs only a few instructions, so it might be a good choice if
13535 your code has enough easily exploitable ILP to allow the compiler to
13536 schedule the floating point instructions together with other instructions.
13537 Division by zero causes a floating point exception.
13538 "inv" uses integer operations to calculate the inverse of the divisor,
13539 and then multiplies the dividend with the inverse.  This strategy allows
13540 cse and hoisting of the inverse calculation.  Division by zero calculates
13541 an unspecified result, but does not trap.
13542 "inv:minlat" is a variant of "inv" where if no cse / hoisting opportunities
13543 have been found, or if the entire operation has been hoisted to the same
13544 place, the last stages of the inverse calculation are intertwined with the
13545 final multiply to reduce the overall latency, at the expense of using a few
13546 more instructions, and thus offering fewer scheduling opportunities with
13547 other code.
13548 "call" calls a library function that usually implements the inv:minlat
13549 strategy.
13550 This gives high code density for m5-*media-nofpu compilations.
13551 "call2" uses a different entry point of the same library function, where it
13552 assumes that a pointer to a lookup table has already been set up, which
13553 exposes the pointer load to cse / code hoisting optimizations.
13554 "inv:call", "inv:call2" and "inv:fp" all use the "inv" algorithm for initial
13555 code generation, but if the code stays unoptimized, revert to the "call",
13556 "call2", or "fp" strategies, respectively.  Note that the
13557 potentially-trapping side effect of division by zero is carried by a
13558 separate instruction, so it is possible that all the integer instructions
13559 are hoisted out, but the marker for the side effect stays where it is.
13560 A recombination to fp operations or a call is not possible in that case.
13561 "inv20u" and "inv20l" are variants of the "inv:minlat" strategy.  In the case
13562 that the inverse calculation was nor separated from the multiply, they speed
13563 up division where the dividend fits into 20 bits (plus sign where applicable),
13564 by inserting a test to skip a number of operations in this case; this test
13565 slows down the case of larger dividends.  inv20u assumes the case of a such
13566 a small dividend to be unlikely, and inv20l assumes it to be likely.
13567
13568 @item -mdivsi3_libfunc=@var{name}
13569 @opindex mdivsi3_libfunc=@var{name}
13570 Set the name of the library function used for 32 bit signed division to
13571 @var{name}.  This only affect the name used in the call and inv:call
13572 division strategies, and the compiler will still expect the same
13573 sets of input/output/clobbered registers as if this option was not present.
13574
13575 @item -madjust-unroll
13576 @opindex madjust-unroll
13577 Throttle unrolling to avoid thrashing target registers.
13578 This option only has an effect if the gcc code base supports the
13579 TARGET_ADJUST_UNROLL_MAX target hook.
13580
13581 @item -mindexed-addressing
13582 @opindex mindexed-addressing
13583 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
13584 This is only safe if the hardware and/or OS implement 32 bit wrap-around
13585 semantics for the indexed addressing mode.  The architecture allows the
13586 implementation of processors with 64 bit MMU, which the OS could use to
13587 get 32 bit addressing, but since no current hardware implementation supports
13588 this or any other way to make the indexed addressing mode safe to use in
13589 the 32 bit ABI, the default is -mno-indexed-addressing.
13590
13591 @item -mgettrcost=@var{number}
13592 @opindex mgettrcost=@var{number}
13593 Set the cost assumed for the gettr instruction to @var{number}.
13594 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
13595
13596 @item -mpt-fixed
13597 @opindex mpt-fixed
13598 Assume pt* instructions won't trap.  This will generally generate better
13599 scheduled code, but is unsafe on current hardware.  The current architecture
13600 definition says that ptabs and ptrel trap when the target anded with 3 is 3.
13601 This has the unintentional effect of making it unsafe to schedule ptabs /
13602 ptrel before a branch, or hoist it out of a loop.  For example,
13603 __do_global_ctors, a part of libgcc that runs constructors at program
13604 startup, calls functions in a list which is delimited by @minus{}1.  With the
13605 -mpt-fixed option, the ptabs will be done before testing against @minus{}1.
13606 That means that all the constructors will be run a bit quicker, but when
13607 the loop comes to the end of the list, the program crashes because ptabs
13608 loads @minus{}1 into a target register.  Since this option is unsafe for any
13609 hardware implementing the current architecture specification, the default
13610 is -mno-pt-fixed.  Unless the user specifies a specific cost with
13611 @option{-mgettrcost}, -mno-pt-fixed also implies @option{-mgettrcost=100};
13612 this deters register allocation using target registers for storing
13613 ordinary integers.
13614
13615 @item -minvalid-symbols
13616 @opindex minvalid-symbols
13617 Assume symbols might be invalid.  Ordinary function symbols generated by
13618 the compiler will always be valid to load with movi/shori/ptabs or
13619 movi/shori/ptrel, but with assembler and/or linker tricks it is possible
13620 to generate symbols that will cause ptabs / ptrel to trap.
13621 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
13622 It will then prevent cross-basic-block cse, hoisting and most scheduling
13623 of symbol loads.  The default is @option{-mno-invalid-symbols}.
13624 @end table
13625
13626 @node SPARC Options
13627 @subsection SPARC Options
13628 @cindex SPARC options
13629
13630 These @samp{-m} options are supported on the SPARC:
13631
13632 @table @gcctabopt
13633 @item -mno-app-regs
13634 @itemx -mapp-regs
13635 @opindex mno-app-regs
13636 @opindex mapp-regs
13637 Specify @option{-mapp-regs} to generate output using the global registers
13638 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
13639 is the default.
13640
13641 To be fully SVR4 ABI compliant at the cost of some performance loss,
13642 specify @option{-mno-app-regs}.  You should compile libraries and system
13643 software with this option.
13644
13645 @item -mfpu
13646 @itemx -mhard-float
13647 @opindex mfpu
13648 @opindex mhard-float
13649 Generate output containing floating point instructions.  This is the
13650 default.
13651
13652 @item -mno-fpu
13653 @itemx -msoft-float
13654 @opindex mno-fpu
13655 @opindex msoft-float
13656 Generate output containing library calls for floating point.
13657 @strong{Warning:} the requisite libraries are not available for all SPARC
13658 targets.  Normally the facilities of the machine's usual C compiler are
13659 used, but this cannot be done directly in cross-compilation.  You must make
13660 your own arrangements to provide suitable library functions for
13661 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
13662 @samp{sparclite-*-*} do provide software floating point support.
13663
13664 @option{-msoft-float} changes the calling convention in the output file;
13665 therefore, it is only useful if you compile @emph{all} of a program with
13666 this option.  In particular, you need to compile @file{libgcc.a}, the
13667 library that comes with GCC, with @option{-msoft-float} in order for
13668 this to work.
13669
13670 @item -mhard-quad-float
13671 @opindex mhard-quad-float
13672 Generate output containing quad-word (long double) floating point
13673 instructions.
13674
13675 @item -msoft-quad-float
13676 @opindex msoft-quad-float
13677 Generate output containing library calls for quad-word (long double)
13678 floating point instructions.  The functions called are those specified
13679 in the SPARC ABI@.  This is the default.
13680
13681 As of this writing, there are no SPARC implementations that have hardware
13682 support for the quad-word floating point instructions.  They all invoke
13683 a trap handler for one of these instructions, and then the trap handler
13684 emulates the effect of the instruction.  Because of the trap handler overhead,
13685 this is much slower than calling the ABI library routines.  Thus the
13686 @option{-msoft-quad-float} option is the default.
13687
13688 @item -mno-unaligned-doubles
13689 @itemx -munaligned-doubles
13690 @opindex mno-unaligned-doubles
13691 @opindex munaligned-doubles
13692 Assume that doubles have 8 byte alignment.  This is the default.
13693
13694 With @option{-munaligned-doubles}, GCC assumes that doubles have 8 byte
13695 alignment only if they are contained in another type, or if they have an
13696 absolute address.  Otherwise, it assumes they have 4 byte alignment.
13697 Specifying this option avoids some rare compatibility problems with code
13698 generated by other compilers.  It is not the default because it results
13699 in a performance loss, especially for floating point code.
13700
13701 @item -mno-faster-structs
13702 @itemx -mfaster-structs
13703 @opindex mno-faster-structs
13704 @opindex mfaster-structs
13705 With @option{-mfaster-structs}, the compiler assumes that structures
13706 should have 8 byte alignment.  This enables the use of pairs of
13707 @code{ldd} and @code{std} instructions for copies in structure
13708 assignment, in place of twice as many @code{ld} and @code{st} pairs.
13709 However, the use of this changed alignment directly violates the SPARC
13710 ABI@.  Thus, it's intended only for use on targets where the developer
13711 acknowledges that their resulting code will not be directly in line with
13712 the rules of the ABI@.
13713
13714 @item -mimpure-text
13715 @opindex mimpure-text
13716 @option{-mimpure-text}, used in addition to @option{-shared}, tells
13717 the compiler to not pass @option{-z text} to the linker when linking a
13718 shared object.  Using this option, you can link position-dependent
13719 code into a shared object.
13720
13721 @option{-mimpure-text} suppresses the ``relocations remain against
13722 allocatable but non-writable sections'' linker error message.
13723 However, the necessary relocations will trigger copy-on-write, and the
13724 shared object is not actually shared across processes.  Instead of
13725 using @option{-mimpure-text}, you should compile all source code with
13726 @option{-fpic} or @option{-fPIC}.
13727
13728 This option is only available on SunOS and Solaris.
13729
13730 @item -mcpu=@var{cpu_type}
13731 @opindex mcpu
13732 Set the instruction set, register set, and instruction scheduling parameters
13733 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
13734 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{sparclite},
13735 @samp{f930}, @samp{f934}, @samp{hypersparc}, @samp{sparclite86x},
13736 @samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc},
13737 @samp{ultrasparc3}, and @samp{niagara}.
13738
13739 Default instruction scheduling parameters are used for values that select
13740 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
13741 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
13742
13743 Here is a list of each supported architecture and their supported
13744 implementations.
13745
13746 @smallexample
13747     v7:             cypress
13748     v8:             supersparc, hypersparc
13749     sparclite:      f930, f934, sparclite86x
13750     sparclet:       tsc701
13751     v9:             ultrasparc, ultrasparc3, niagara
13752 @end smallexample
13753
13754 By default (unless configured otherwise), GCC generates code for the V7
13755 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
13756 additionally optimizes it for the Cypress CY7C602 chip, as used in the
13757 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
13758 SPARCStation 1, 2, IPX etc.
13759
13760 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
13761 architecture.  The only difference from V7 code is that the compiler emits
13762 the integer multiply and integer divide instructions which exist in SPARC-V8
13763 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
13764 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
13765 2000 series.
13766
13767 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
13768 the SPARC architecture.  This adds the integer multiply, integer divide step
13769 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
13770 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
13771 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
13772 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
13773 MB86934 chip, which is the more recent SPARClite with FPU@.
13774
13775 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
13776 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
13777 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
13778 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
13779 optimizes it for the TEMIC SPARClet chip.
13780
13781 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
13782 architecture.  This adds 64-bit integer and floating-point move instructions,
13783 3 additional floating-point condition code registers and conditional move
13784 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
13785 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
13786 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
13787 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
13788 @option{-mcpu=niagara}, the compiler additionally optimizes it for
13789 Sun UltraSPARC T1 chips.
13790
13791 @item -mtune=@var{cpu_type}
13792 @opindex mtune
13793 Set the instruction scheduling parameters for machine type
13794 @var{cpu_type}, but do not set the instruction set or register set that the
13795 option @option{-mcpu=@var{cpu_type}} would.
13796
13797 The same values for @option{-mcpu=@var{cpu_type}} can be used for
13798 @option{-mtune=@var{cpu_type}}, but the only useful values are those
13799 that select a particular cpu implementation.  Those are @samp{cypress},
13800 @samp{supersparc}, @samp{hypersparc}, @samp{f930}, @samp{f934},
13801 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
13802 @samp{ultrasparc3}, and @samp{niagara}.
13803
13804 @item -mv8plus
13805 @itemx -mno-v8plus
13806 @opindex mv8plus
13807 @opindex mno-v8plus
13808 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
13809 difference from the V8 ABI is that the global and out registers are
13810 considered 64-bit wide.  This is enabled by default on Solaris in 32-bit
13811 mode for all SPARC-V9 processors.
13812
13813 @item -mvis
13814 @itemx -mno-vis
13815 @opindex mvis
13816 @opindex mno-vis
13817 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
13818 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
13819 @end table
13820
13821 These @samp{-m} options are supported in addition to the above
13822 on SPARC-V9 processors in 64-bit environments:
13823
13824 @table @gcctabopt
13825 @item -mlittle-endian
13826 @opindex mlittle-endian
13827 Generate code for a processor running in little-endian mode.  It is only
13828 available for a few configurations and most notably not on Solaris and Linux.
13829
13830 @item -m32
13831 @itemx -m64
13832 @opindex m32
13833 @opindex m64
13834 Generate code for a 32-bit or 64-bit environment.
13835 The 32-bit environment sets int, long and pointer to 32 bits.
13836 The 64-bit environment sets int to 32 bits and long and pointer
13837 to 64 bits.
13838
13839 @item -mcmodel=medlow
13840 @opindex mcmodel=medlow
13841 Generate code for the Medium/Low code model: 64-bit addresses, programs
13842 must be linked in the low 32 bits of memory.  Programs can be statically
13843 or dynamically linked.
13844
13845 @item -mcmodel=medmid
13846 @opindex mcmodel=medmid
13847 Generate code for the Medium/Middle code model: 64-bit addresses, programs
13848 must be linked in the low 44 bits of memory, the text and data segments must
13849 be less than 2GB in size and the data segment must be located within 2GB of
13850 the text segment.
13851
13852 @item -mcmodel=medany
13853 @opindex mcmodel=medany
13854 Generate code for the Medium/Anywhere code model: 64-bit addresses, programs
13855 may be linked anywhere in memory, the text and data segments must be less
13856 than 2GB in size and the data segment must be located within 2GB of the
13857 text segment.
13858
13859 @item -mcmodel=embmedany
13860 @opindex mcmodel=embmedany
13861 Generate code for the Medium/Anywhere code model for embedded systems:
13862 64-bit addresses, the text and data segments must be less than 2GB in
13863 size, both starting anywhere in memory (determined at link time).  The
13864 global register %g4 points to the base of the data segment.  Programs
13865 are statically linked and PIC is not supported.
13866
13867 @item -mstack-bias
13868 @itemx -mno-stack-bias
13869 @opindex mstack-bias
13870 @opindex mno-stack-bias
13871 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
13872 frame pointer if present, are offset by @minus{}2047 which must be added back
13873 when making stack frame references.  This is the default in 64-bit mode.
13874 Otherwise, assume no such offset is present.
13875 @end table
13876
13877 These switches are supported in addition to the above on Solaris:
13878
13879 @table @gcctabopt
13880 @item -threads
13881 @opindex threads
13882 Add support for multithreading using the Solaris threads library.  This
13883 option sets flags for both the preprocessor and linker.  This option does
13884 not affect the thread safety of object code produced by the compiler or
13885 that of libraries supplied with it.
13886
13887 @item -pthreads
13888 @opindex pthreads
13889 Add support for multithreading using the POSIX threads library.  This
13890 option sets flags for both the preprocessor and linker.  This option does
13891 not affect the thread safety of object code produced  by the compiler or
13892 that of libraries supplied with it.
13893
13894 @item -pthread
13895 @opindex pthread
13896 This is a synonym for @option{-pthreads}.
13897 @end table
13898
13899 @node SPU Options
13900 @subsection SPU Options
13901 @cindex SPU options
13902
13903 These @samp{-m} options are supported on the SPU:
13904
13905 @table @gcctabopt
13906 @item -mwarn-reloc
13907 @itemx -merror-reloc
13908 @opindex mwarn-reloc
13909 @opindex merror-reloc
13910
13911 The loader for SPU does not handle dynamic relocations.  By default, GCC
13912 will give an error when it generates code that requires a dynamic
13913 relocation.  @option{-mno-error-reloc} disables the error,
13914 @option{-mwarn-reloc} will generate a warning instead.
13915
13916 @item -msafe-dma
13917 @itemx -munsafe-dma
13918 @opindex msafe-dma
13919 @opindex munsafe-dma
13920
13921 Instructions which initiate or test completion of DMA must not be
13922 reordered with respect to loads and stores of the memory which is being
13923 accessed.  Users typically address this problem using the volatile
13924 keyword, but that can lead to inefficient code in places where the
13925 memory is known to not change.  Rather than mark the memory as volatile
13926 we treat the DMA instructions as potentially effecting all memory.  With
13927 @option{-munsafe-dma} users must use the volatile keyword to protect
13928 memory accesses.
13929
13930 @item -mbranch-hints
13931 @opindex mbranch-hints
13932
13933 By default, GCC will generate a branch hint instruction to avoid
13934 pipeline stalls for always taken or probably taken branches.  A hint
13935 will not be generated closer than 8 instructions away from its branch.
13936 There is little reason to disable them, except for debugging purposes,
13937 or to make an object a little bit smaller.
13938
13939 @item -msmall-mem
13940 @itemx -mlarge-mem
13941 @opindex msmall-mem
13942 @opindex mlarge-mem
13943
13944 By default, GCC generates code assuming that addresses are never larger
13945 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
13946 a full 32 bit address.
13947
13948 @item -mstdmain
13949 @opindex mstdmain
13950
13951 By default, GCC links against startup code that assumes the SPU-style
13952 main function interface (which has an unconventional parameter list).
13953 With @option{-mstdmain}, GCC will link your program against startup
13954 code that assumes a C99-style interface to @code{main}, including a
13955 local copy of @code{argv} strings.
13956
13957 @item -mfixed-range=@var{register-range}
13958 @opindex mfixed-range
13959 Generate code treating the given register range as fixed registers.
13960 A fixed register is one that the register allocator can not use.  This is
13961 useful when compiling kernel code.  A register range is specified as
13962 two registers separated by a dash.  Multiple register ranges can be
13963 specified separated by a comma.
13964
13965 @end table
13966
13967 @node System V Options
13968 @subsection Options for System V
13969
13970 These additional options are available on System V Release 4 for
13971 compatibility with other compilers on those systems:
13972
13973 @table @gcctabopt
13974 @item -G
13975 @opindex G
13976 Create a shared object.
13977 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
13978
13979 @item -Qy
13980 @opindex Qy
13981 Identify the versions of each tool used by the compiler, in a
13982 @code{.ident} assembler directive in the output.
13983
13984 @item -Qn
13985 @opindex Qn
13986 Refrain from adding @code{.ident} directives to the output file (this is
13987 the default).
13988
13989 @item -YP,@var{dirs}
13990 @opindex YP
13991 Search the directories @var{dirs}, and no others, for libraries
13992 specified with @option{-l}.
13993
13994 @item -Ym,@var{dir}
13995 @opindex Ym
13996 Look in the directory @var{dir} to find the M4 preprocessor.
13997 The assembler uses this option.
13998 @c This is supposed to go with a -Yd for predefined M4 macro files, but
13999 @c the generic assembler that comes with Solaris takes just -Ym.
14000 @end table
14001
14002 @node TMS320C3x/C4x Options
14003 @subsection TMS320C3x/C4x Options
14004 @cindex TMS320C3x/C4x Options
14005
14006 These @samp{-m} options are defined for TMS320C3x/C4x implementations:
14007
14008 @table @gcctabopt
14009
14010 @item -mcpu=@var{cpu_type}
14011 @opindex mcpu
14012 Set the instruction set, register set, and instruction scheduling
14013 parameters for machine type @var{cpu_type}.  Supported values for
14014 @var{cpu_type} are @samp{c30}, @samp{c31}, @samp{c32}, @samp{c40}, and
14015 @samp{c44}.  The default is @samp{c40} to generate code for the
14016 TMS320C40.
14017
14018 @item -mbig-memory
14019 @itemx -mbig
14020 @itemx -msmall-memory
14021 @itemx -msmall
14022 @opindex mbig-memory
14023 @opindex mbig
14024 @opindex msmall-memory
14025 @opindex msmall
14026 Generates code for the big or small memory model.  The small memory
14027 model assumed that all data fits into one 64K word page.  At run-time
14028 the data page (DP) register must be set to point to the 64K page
14029 containing the .bss and .data program sections.  The big memory model is
14030 the default and requires reloading of the DP register for every direct
14031 memory access.
14032
14033 @item -mbk
14034 @itemx -mno-bk
14035 @opindex mbk
14036 @opindex mno-bk
14037 Allow (disallow) allocation of general integer operands into the block
14038 count register BK@.
14039
14040 @item -mdb
14041 @itemx -mno-db
14042 @opindex mdb
14043 @opindex mno-db
14044 Enable (disable) generation of code using decrement and branch,
14045 DBcond(D), instructions.  This is enabled by default for the C4x.  To be
14046 on the safe side, this is disabled for the C3x, since the maximum
14047 iteration count on the C3x is @math{2^{23} + 1} (but who iterates loops more than
14048 @math{2^{23}} times on the C3x?).  Note that GCC will try to reverse a loop so
14049 that it can utilize the decrement and branch instruction, but will give
14050 up if there is more than one memory reference in the loop.  Thus a loop
14051 where the loop counter is decremented can generate slightly more
14052 efficient code, in cases where the RPTB instruction cannot be utilized.
14053
14054 @item -mdp-isr-reload
14055 @itemx -mparanoid
14056 @opindex mdp-isr-reload
14057 @opindex mparanoid
14058 Force the DP register to be saved on entry to an interrupt service
14059 routine (ISR), reloaded to point to the data section, and restored on
14060 exit from the ISR@.  This should not be required unless someone has
14061 violated the small memory model by modifying the DP register, say within
14062 an object library.
14063
14064 @item -mmpyi
14065 @itemx -mno-mpyi
14066 @opindex mmpyi
14067 @opindex mno-mpyi
14068 For the C3x use the 24-bit MPYI instruction for integer multiplies
14069 instead of a library call to guarantee 32-bit results.  Note that if one
14070 of the operands is a constant, then the multiplication will be performed
14071 using shifts and adds.  If the @option{-mmpyi} option is not specified for the C3x,
14072 then squaring operations are performed inline instead of a library call.
14073
14074 @item -mfast-fix
14075 @itemx -mno-fast-fix
14076 @opindex mfast-fix
14077 @opindex mno-fast-fix
14078 The C3x/C4x FIX instruction to convert a floating point value to an
14079 integer value chooses the nearest integer less than or equal to the
14080 floating point value rather than to the nearest integer.  Thus if the
14081 floating point number is negative, the result will be incorrectly
14082 truncated an additional code is necessary to detect and correct this
14083 case.  This option can be used to disable generation of the additional
14084 code required to correct the result.
14085
14086 @item -mrptb
14087 @itemx -mno-rptb
14088 @opindex mrptb
14089 @opindex mno-rptb
14090 Enable (disable) generation of repeat block sequences using the RPTB
14091 instruction for zero overhead looping.  The RPTB construct is only used
14092 for innermost loops that do not call functions or jump across the loop
14093 boundaries.  There is no advantage having nested RPTB loops due to the
14094 overhead required to save and restore the RC, RS, and RE registers.
14095 This is enabled by default with @option{-O2}.
14096
14097 @item -mrpts=@var{count}
14098 @itemx -mno-rpts
14099 @opindex mrpts
14100 @opindex mno-rpts
14101 Enable (disable) the use of the single instruction repeat instruction
14102 RPTS@.  If a repeat block contains a single instruction, and the loop
14103 count can be guaranteed to be less than the value @var{count}, GCC will
14104 emit a RPTS instruction instead of a RPTB@.  If no value is specified,
14105 then a RPTS will be emitted even if the loop count cannot be determined
14106 at compile time.  Note that the repeated instruction following RPTS does
14107 not have to be reloaded from memory each iteration, thus freeing up the
14108 CPU buses for operands.  However, since interrupts are blocked by this
14109 instruction, it is disabled by default.
14110
14111 @item -mloop-unsigned
14112 @itemx -mno-loop-unsigned
14113 @opindex mloop-unsigned
14114 @opindex mno-loop-unsigned
14115 The maximum iteration count when using RPTS and RPTB (and DB on the C40)
14116 is @math{2^{31} + 1} since these instructions test if the iteration count is
14117 negative to terminate the loop.  If the iteration count is unsigned
14118 there is a possibility than the @math{2^{31} + 1} maximum iteration count may be
14119 exceeded.  This switch allows an unsigned iteration count.
14120
14121 @item -mti
14122 @opindex mti
14123 Try to emit an assembler syntax that the TI assembler (asm30) is happy
14124 with.  This also enforces compatibility with the API employed by the TI
14125 C3x C compiler.  For example, long doubles are passed as structures
14126 rather than in floating point registers.
14127
14128 @item -mregparm
14129 @itemx -mmemparm
14130 @opindex mregparm
14131 @opindex mmemparm
14132 Generate code that uses registers (stack) for passing arguments to functions.
14133 By default, arguments are passed in registers where possible rather
14134 than by pushing arguments on to the stack.
14135
14136 @item -mparallel-insns
14137 @itemx -mno-parallel-insns
14138 @opindex mparallel-insns
14139 @opindex mno-parallel-insns
14140 Allow the generation of parallel instructions.  This is enabled by
14141 default with @option{-O2}.
14142
14143 @item -mparallel-mpy
14144 @itemx -mno-parallel-mpy
14145 @opindex mparallel-mpy
14146 @opindex mno-parallel-mpy
14147 Allow the generation of MPY||ADD and MPY||SUB parallel instructions,
14148 provided @option{-mparallel-insns} is also specified.  These instructions have
14149 tight register constraints which can pessimize the code generation
14150 of large functions.
14151
14152 @end table
14153
14154 @node V850 Options
14155 @subsection V850 Options
14156 @cindex V850 Options
14157
14158 These @samp{-m} options are defined for V850 implementations:
14159
14160 @table @gcctabopt
14161 @item -mlong-calls
14162 @itemx -mno-long-calls
14163 @opindex mlong-calls
14164 @opindex mno-long-calls
14165 Treat all calls as being far away (near).  If calls are assumed to be
14166 far away, the compiler will always load the functions address up into a
14167 register, and call indirect through the pointer.
14168
14169 @item -mno-ep
14170 @itemx -mep
14171 @opindex mno-ep
14172 @opindex mep
14173 Do not optimize (do optimize) basic blocks that use the same index
14174 pointer 4 or more times to copy pointer into the @code{ep} register, and
14175 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
14176 option is on by default if you optimize.
14177
14178 @item -mno-prolog-function
14179 @itemx -mprolog-function
14180 @opindex mno-prolog-function
14181 @opindex mprolog-function
14182 Do not use (do use) external functions to save and restore registers
14183 at the prologue and epilogue of a function.  The external functions
14184 are slower, but use less code space if more than one function saves
14185 the same number of registers.  The @option{-mprolog-function} option
14186 is on by default if you optimize.
14187
14188 @item -mspace
14189 @opindex mspace
14190 Try to make the code as small as possible.  At present, this just turns
14191 on the @option{-mep} and @option{-mprolog-function} options.
14192
14193 @item -mtda=@var{n}
14194 @opindex mtda
14195 Put static or global variables whose size is @var{n} bytes or less into
14196 the tiny data area that register @code{ep} points to.  The tiny data
14197 area can hold up to 256 bytes in total (128 bytes for byte references).
14198
14199 @item -msda=@var{n}
14200 @opindex msda
14201 Put static or global variables whose size is @var{n} bytes or less into
14202 the small data area that register @code{gp} points to.  The small data
14203 area can hold up to 64 kilobytes.
14204
14205 @item -mzda=@var{n}
14206 @opindex mzda
14207 Put static or global variables whose size is @var{n} bytes or less into
14208 the first 32 kilobytes of memory.
14209
14210 @item -mv850
14211 @opindex mv850
14212 Specify that the target processor is the V850.
14213
14214 @item -mbig-switch
14215 @opindex mbig-switch
14216 Generate code suitable for big switch tables.  Use this option only if
14217 the assembler/linker complain about out of range branches within a switch
14218 table.
14219
14220 @item -mapp-regs
14221 @opindex mapp-regs
14222 This option will cause r2 and r5 to be used in the code generated by
14223 the compiler.  This setting is the default.
14224
14225 @item -mno-app-regs
14226 @opindex mno-app-regs
14227 This option will cause r2 and r5 to be treated as fixed registers.
14228
14229 @item -mv850e1
14230 @opindex mv850e1
14231 Specify that the target processor is the V850E1.  The preprocessor
14232 constants @samp{__v850e1__} and @samp{__v850e__} will be defined if
14233 this option is used.
14234
14235 @item -mv850e
14236 @opindex mv850e
14237 Specify that the target processor is the V850E@.  The preprocessor
14238 constant @samp{__v850e__} will be defined if this option is used.
14239
14240 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
14241 are defined then a default target processor will be chosen and the
14242 relevant @samp{__v850*__} preprocessor constant will be defined.
14243
14244 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
14245 defined, regardless of which processor variant is the target.
14246
14247 @item -mdisable-callt
14248 @opindex mdisable-callt
14249 This option will suppress generation of the CALLT instruction for the
14250 v850e and v850e1 flavors of the v850 architecture.  The default is
14251 @option{-mno-disable-callt} which allows the CALLT instruction to be used.
14252
14253 @end table
14254
14255 @node VAX Options
14256 @subsection VAX Options
14257 @cindex VAX options
14258
14259 These @samp{-m} options are defined for the VAX:
14260
14261 @table @gcctabopt
14262 @item -munix
14263 @opindex munix
14264 Do not output certain jump instructions (@code{aobleq} and so on)
14265 that the Unix assembler for the VAX cannot handle across long
14266 ranges.
14267
14268 @item -mgnu
14269 @opindex mgnu
14270 Do output those jump instructions, on the assumption that you
14271 will assemble with the GNU assembler.
14272
14273 @item -mg
14274 @opindex mg
14275 Output code for g-format floating point numbers instead of d-format.
14276 @end table
14277
14278 @node VxWorks Options
14279 @subsection VxWorks Options
14280 @cindex VxWorks Options
14281
14282 The options in this section are defined for all VxWorks targets.
14283 Options specific to the target hardware are listed with the other
14284 options for that target.
14285
14286 @table @gcctabopt
14287 @item -mrtp
14288 @opindex mrtp
14289 GCC can generate code for both VxWorks kernels and real time processes
14290 (RTPs).  This option switches from the former to the latter.  It also
14291 defines the preprocessor macro @code{__RTP__}.
14292
14293 @item -non-static
14294 @opindex non-static
14295 Link an RTP executable against shared libraries rather than static
14296 libraries.  The options @option{-static} and @option{-shared} can
14297 also be used for RTPs (@pxref{Link Options}); @option{-static}
14298 is the default.
14299
14300 @item -Bstatic
14301 @itemx -Bdynamic
14302 @opindex Bstatic
14303 @opindex Bdynamic
14304 These options are passed down to the linker.  They are defined for
14305 compatibility with Diab.
14306
14307 @item -Xbind-lazy
14308 @opindex Xbind-lazy
14309 Enable lazy binding of function calls.  This option is equivalent to
14310 @option{-Wl,-z,now} and is defined for compatibility with Diab.
14311
14312 @item -Xbind-now
14313 @opindex Xbind-now
14314 Disable lazy binding of function calls.  This option is the default and
14315 is defined for compatibility with Diab.
14316 @end table
14317
14318 @node x86-64 Options
14319 @subsection x86-64 Options
14320 @cindex x86-64 options
14321
14322 These are listed under @xref{i386 and x86-64 Options}.
14323
14324 @node Xstormy16 Options
14325 @subsection Xstormy16 Options
14326 @cindex Xstormy16 Options
14327
14328 These options are defined for Xstormy16:
14329
14330 @table @gcctabopt
14331 @item -msim
14332 @opindex msim
14333 Choose startup files and linker script suitable for the simulator.
14334 @end table
14335
14336 @node Xtensa Options
14337 @subsection Xtensa Options
14338 @cindex Xtensa Options
14339
14340 These options are supported for Xtensa targets:
14341
14342 @table @gcctabopt
14343 @item -mconst16
14344 @itemx -mno-const16
14345 @opindex mconst16
14346 @opindex mno-const16
14347 Enable or disable use of @code{CONST16} instructions for loading
14348 constant values.  The @code{CONST16} instruction is currently not a
14349 standard option from Tensilica.  When enabled, @code{CONST16}
14350 instructions are always used in place of the standard @code{L32R}
14351 instructions.  The use of @code{CONST16} is enabled by default only if
14352 the @code{L32R} instruction is not available.
14353
14354 @item -mfused-madd
14355 @itemx -mno-fused-madd
14356 @opindex mfused-madd
14357 @opindex mno-fused-madd
14358 Enable or disable use of fused multiply/add and multiply/subtract
14359 instructions in the floating-point option.  This has no effect if the
14360 floating-point option is not also enabled.  Disabling fused multiply/add
14361 and multiply/subtract instructions forces the compiler to use separate
14362 instructions for the multiply and add/subtract operations.  This may be
14363 desirable in some cases where strict IEEE 754-compliant results are
14364 required: the fused multiply add/subtract instructions do not round the
14365 intermediate result, thereby producing results with @emph{more} bits of
14366 precision than specified by the IEEE standard.  Disabling fused multiply
14367 add/subtract instructions also ensures that the program output is not
14368 sensitive to the compiler's ability to combine multiply and add/subtract
14369 operations.
14370
14371 @item -mtext-section-literals
14372 @itemx -mno-text-section-literals
14373 @opindex mtext-section-literals
14374 @opindex mno-text-section-literals
14375 Control the treatment of literal pools.  The default is
14376 @option{-mno-text-section-literals}, which places literals in a separate
14377 section in the output file.  This allows the literal pool to be placed
14378 in a data RAM/ROM, and it also allows the linker to combine literal
14379 pools from separate object files to remove redundant literals and
14380 improve code size.  With @option{-mtext-section-literals}, the literals
14381 are interspersed in the text section in order to keep them as close as
14382 possible to their references.  This may be necessary for large assembly
14383 files.
14384
14385 @item -mtarget-align
14386 @itemx -mno-target-align
14387 @opindex mtarget-align
14388 @opindex mno-target-align
14389 When this option is enabled, GCC instructs the assembler to
14390 automatically align instructions to reduce branch penalties at the
14391 expense of some code density.  The assembler attempts to widen density
14392 instructions to align branch targets and the instructions following call
14393 instructions.  If there are not enough preceding safe density
14394 instructions to align a target, no widening will be performed.  The
14395 default is @option{-mtarget-align}.  These options do not affect the
14396 treatment of auto-aligned instructions like @code{LOOP}, which the
14397 assembler will always align, either by widening density instructions or
14398 by inserting no-op instructions.
14399
14400 @item -mlongcalls
14401 @itemx -mno-longcalls
14402 @opindex mlongcalls
14403 @opindex mno-longcalls
14404 When this option is enabled, GCC instructs the assembler to translate
14405 direct calls to indirect calls unless it can determine that the target
14406 of a direct call is in the range allowed by the call instruction.  This
14407 translation typically occurs for calls to functions in other source
14408 files.  Specifically, the assembler translates a direct @code{CALL}
14409 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
14410 The default is @option{-mno-longcalls}.  This option should be used in
14411 programs where the call target can potentially be out of range.  This
14412 option is implemented in the assembler, not the compiler, so the
14413 assembly code generated by GCC will still show direct call
14414 instructions---look at the disassembled object code to see the actual
14415 instructions.  Note that the assembler will use an indirect call for
14416 every cross-file call, not just those that really will be out of range.
14417 @end table
14418
14419 @node zSeries Options
14420 @subsection zSeries Options
14421 @cindex zSeries options
14422
14423 These are listed under @xref{S/390 and zSeries Options}.
14424
14425 @node Code Gen Options
14426 @section Options for Code Generation Conventions
14427 @cindex code generation conventions
14428 @cindex options, code generation
14429 @cindex run-time options
14430
14431 These machine-independent options control the interface conventions
14432 used in code generation.
14433
14434 Most of them have both positive and negative forms; the negative form
14435 of @option{-ffoo} would be @option{-fno-foo}.  In the table below, only
14436 one of the forms is listed---the one which is not the default.  You
14437 can figure out the other form by either removing @samp{no-} or adding
14438 it.
14439
14440 @table @gcctabopt
14441 @item -fbounds-check
14442 @opindex fbounds-check
14443 For front-ends that support it, generate additional code to check that
14444 indices used to access arrays are within the declared range.  This is
14445 currently only supported by the Java and Fortran front-ends, where
14446 this option defaults to true and false respectively.
14447
14448 @item -ftrapv
14449 @opindex ftrapv
14450 This option generates traps for signed overflow on addition, subtraction,
14451 multiplication operations.
14452
14453 @item -fwrapv
14454 @opindex fwrapv
14455 This option instructs the compiler to assume that signed arithmetic
14456 overflow of addition, subtraction and multiplication wraps around
14457 using twos-complement representation.  This flag enables some optimizations
14458 and disables others.  This option is enabled by default for the Java
14459 front-end, as required by the Java language specification.
14460
14461 @item -fexceptions
14462 @opindex fexceptions
14463 Enable exception handling.  Generates extra code needed to propagate
14464 exceptions.  For some targets, this implies GCC will generate frame
14465 unwind information for all functions, which can produce significant data
14466 size overhead, although it does not affect execution.  If you do not
14467 specify this option, GCC will enable it by default for languages like
14468 C++ which normally require exception handling, and disable it for
14469 languages like C that do not normally require it.  However, you may need
14470 to enable this option when compiling C code that needs to interoperate
14471 properly with exception handlers written in C++.  You may also wish to
14472 disable this option if you are compiling older C++ programs that don't
14473 use exception handling.
14474
14475 @item -fnon-call-exceptions
14476 @opindex fnon-call-exceptions
14477 Generate code that allows trapping instructions to throw exceptions.
14478 Note that this requires platform-specific runtime support that does
14479 not exist everywhere.  Moreover, it only allows @emph{trapping}
14480 instructions to throw exceptions, i.e.@: memory references or floating
14481 point instructions.  It does not allow exceptions to be thrown from
14482 arbitrary signal handlers such as @code{SIGALRM}.
14483
14484 @item -funwind-tables
14485 @opindex funwind-tables
14486 Similar to @option{-fexceptions}, except that it will just generate any needed
14487 static data, but will not affect the generated code in any other way.
14488 You will normally not enable this option; instead, a language processor
14489 that needs this handling would enable it on your behalf.
14490
14491 @item -fasynchronous-unwind-tables
14492 @opindex fasynchronous-unwind-tables
14493 Generate unwind table in dwarf2 format, if supported by target machine.  The
14494 table is exact at each instruction boundary, so it can be used for stack
14495 unwinding from asynchronous events (such as debugger or garbage collector).
14496
14497 @item -fpcc-struct-return
14498 @opindex fpcc-struct-return
14499 Return ``short'' @code{struct} and @code{union} values in memory like
14500 longer ones, rather than in registers.  This convention is less
14501 efficient, but it has the advantage of allowing intercallability between
14502 GCC-compiled files and files compiled with other compilers, particularly
14503 the Portable C Compiler (pcc).
14504
14505 The precise convention for returning structures in memory depends
14506 on the target configuration macros.
14507
14508 Short structures and unions are those whose size and alignment match
14509 that of some integer type.
14510
14511 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
14512 switch is not binary compatible with code compiled with the
14513 @option{-freg-struct-return} switch.
14514 Use it to conform to a non-default application binary interface.
14515
14516 @item -freg-struct-return
14517 @opindex freg-struct-return
14518 Return @code{struct} and @code{union} values in registers when possible.
14519 This is more efficient for small structures than
14520 @option{-fpcc-struct-return}.
14521
14522 If you specify neither @option{-fpcc-struct-return} nor
14523 @option{-freg-struct-return}, GCC defaults to whichever convention is
14524 standard for the target.  If there is no standard convention, GCC
14525 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
14526 the principal compiler.  In those cases, we can choose the standard, and
14527 we chose the more efficient register return alternative.
14528
14529 @strong{Warning:} code compiled with the @option{-freg-struct-return}
14530 switch is not binary compatible with code compiled with the
14531 @option{-fpcc-struct-return} switch.
14532 Use it to conform to a non-default application binary interface.
14533
14534 @item -fshort-enums
14535 @opindex fshort-enums
14536 Allocate to an @code{enum} type only as many bytes as it needs for the
14537 declared range of possible values.  Specifically, the @code{enum} type
14538 will be equivalent to the smallest integer type which has enough room.
14539
14540 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
14541 code that is not binary compatible with code generated without that switch.
14542 Use it to conform to a non-default application binary interface.
14543
14544 @item -fshort-double
14545 @opindex fshort-double
14546 Use the same size for @code{double} as for @code{float}.
14547
14548 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
14549 code that is not binary compatible with code generated without that switch.
14550 Use it to conform to a non-default application binary interface.
14551
14552 @item -fshort-wchar
14553 @opindex fshort-wchar
14554 Override the underlying type for @samp{wchar_t} to be @samp{short
14555 unsigned int} instead of the default for the target.  This option is
14556 useful for building programs to run under WINE@.
14557
14558 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
14559 code that is not binary compatible with code generated without that switch.
14560 Use it to conform to a non-default application binary interface.
14561
14562 @item -fno-common
14563 @opindex fno-common
14564 In C, allocate even uninitialized global variables in the data section of the
14565 object file, rather than generating them as common blocks.  This has the
14566 effect that if the same variable is declared (without @code{extern}) in
14567 two different compilations, you will get an error when you link them.
14568 The only reason this might be useful is if you wish to verify that the
14569 program will work on other systems which always work this way.
14570
14571 @item -fno-ident
14572 @opindex fno-ident
14573 Ignore the @samp{#ident} directive.
14574
14575 @item -finhibit-size-directive
14576 @opindex finhibit-size-directive
14577 Don't output a @code{.size} assembler directive, or anything else that
14578 would cause trouble if the function is split in the middle, and the
14579 two halves are placed at locations far apart in memory.  This option is
14580 used when compiling @file{crtstuff.c}; you should not need to use it
14581 for anything else.
14582
14583 @item -fverbose-asm
14584 @opindex fverbose-asm
14585 Put extra commentary information in the generated assembly code to
14586 make it more readable.  This option is generally only of use to those
14587 who actually need to read the generated assembly code (perhaps while
14588 debugging the compiler itself).
14589
14590 @option{-fno-verbose-asm}, the default, causes the
14591 extra information to be omitted and is useful when comparing two assembler
14592 files.
14593
14594 @item -frecord-gcc-switches
14595 @opindex frecord-gcc-switches
14596 This switch causes the command line that was used to invoke the
14597 compiler to be recorded into the object file that is being created.
14598 This switch is only implemented on some targets and the exact format
14599 of the recording is target and binary file format dependent, but it
14600 usually takes the form of a section containing ASCII text.  This
14601 switch is related to the @option{-fverbose-asm} switch, but that
14602 switch only records information in the assembler output file as
14603 comments, so it never reaches the object file.
14604
14605 @item -fpic
14606 @opindex fpic
14607 @cindex global offset table
14608 @cindex PIC
14609 Generate position-independent code (PIC) suitable for use in a shared
14610 library, if supported for the target machine.  Such code accesses all
14611 constant addresses through a global offset table (GOT)@.  The dynamic
14612 loader resolves the GOT entries when the program starts (the dynamic
14613 loader is not part of GCC; it is part of the operating system).  If
14614 the GOT size for the linked executable exceeds a machine-specific
14615 maximum size, you get an error message from the linker indicating that
14616 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
14617 instead.  (These maximums are 8k on the SPARC and 32k
14618 on the m68k and RS/6000.  The 386 has no such limit.)
14619
14620 Position-independent code requires special support, and therefore works
14621 only on certain machines.  For the 386, GCC supports PIC for System V
14622 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
14623 position-independent.
14624
14625 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
14626 are defined to 1.
14627
14628 @item -fPIC
14629 @opindex fPIC
14630 If supported for the target machine, emit position-independent code,
14631 suitable for dynamic linking and avoiding any limit on the size of the
14632 global offset table.  This option makes a difference on the m68k,
14633 PowerPC and SPARC@.
14634
14635 Position-independent code requires special support, and therefore works
14636 only on certain machines.
14637
14638 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
14639 are defined to 2.
14640
14641 @item -fpie
14642 @itemx -fPIE
14643 @opindex fpie
14644 @opindex fPIE
14645 These options are similar to @option{-fpic} and @option{-fPIC}, but
14646 generated position independent code can be only linked into executables.
14647 Usually these options are used when @option{-pie} GCC option will be
14648 used during linking.
14649
14650 @option{-fpie} and @option{-fPIE} both define the macros
14651 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
14652 for @option{-fpie} and 2 for @option{-fPIE}.
14653
14654 @item -fno-jump-tables
14655 @opindex fno-jump-tables
14656 Do not use jump tables for switch statements even where it would be
14657 more efficient than other code generation strategies.  This option is
14658 of use in conjunction with @option{-fpic} or @option{-fPIC} for
14659 building code which forms part of a dynamic linker and cannot
14660 reference the address of a jump table.  On some targets, jump tables
14661 do not require a GOT and this option is not needed.
14662
14663 @item -ffixed-@var{reg}
14664 @opindex ffixed
14665 Treat the register named @var{reg} as a fixed register; generated code
14666 should never refer to it (except perhaps as a stack pointer, frame
14667 pointer or in some other fixed role).
14668
14669 @var{reg} must be the name of a register.  The register names accepted
14670 are machine-specific and are defined in the @code{REGISTER_NAMES}
14671 macro in the machine description macro file.
14672
14673 This flag does not have a negative form, because it specifies a
14674 three-way choice.
14675
14676 @item -fcall-used-@var{reg}
14677 @opindex fcall-used
14678 Treat the register named @var{reg} as an allocable register that is
14679 clobbered by function calls.  It may be allocated for temporaries or
14680 variables that do not live across a call.  Functions compiled this way
14681 will not save and restore the register @var{reg}.
14682
14683 It is an error to used this flag with the frame pointer or stack pointer.
14684 Use of this flag for other registers that have fixed pervasive roles in
14685 the machine's execution model will produce disastrous results.
14686
14687 This flag does not have a negative form, because it specifies a
14688 three-way choice.
14689
14690 @item -fcall-saved-@var{reg}
14691 @opindex fcall-saved
14692 Treat the register named @var{reg} as an allocable register saved by
14693 functions.  It may be allocated even for temporaries or variables that
14694 live across a call.  Functions compiled this way will save and restore
14695 the register @var{reg} if they use it.
14696
14697 It is an error to used this flag with the frame pointer or stack pointer.
14698 Use of this flag for other registers that have fixed pervasive roles in
14699 the machine's execution model will produce disastrous results.
14700
14701 A different sort of disaster will result from the use of this flag for
14702 a register in which function values may be returned.
14703
14704 This flag does not have a negative form, because it specifies a
14705 three-way choice.
14706
14707 @item -fpack-struct[=@var{n}]
14708 @opindex fpack-struct
14709 Without a value specified, pack all structure members together without
14710 holes.  When a value is specified (which must be a small power of two), pack
14711 structure members according to this value, representing the maximum
14712 alignment (that is, objects with default alignment requirements larger than
14713 this will be output potentially unaligned at the next fitting location.
14714
14715 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
14716 code that is not binary compatible with code generated without that switch.
14717 Additionally, it makes the code suboptimal.
14718 Use it to conform to a non-default application binary interface.
14719
14720 @item -finstrument-functions
14721 @opindex finstrument-functions
14722 Generate instrumentation calls for entry and exit to functions.  Just
14723 after function entry and just before function exit, the following
14724 profiling functions will be called with the address of the current
14725 function and its call site.  (On some platforms,
14726 @code{__builtin_return_address} does not work beyond the current
14727 function, so the call site information may not be available to the
14728 profiling functions otherwise.)
14729
14730 @smallexample
14731 void __cyg_profile_func_enter (void *this_fn,
14732                                void *call_site);
14733 void __cyg_profile_func_exit  (void *this_fn,
14734                                void *call_site);
14735 @end smallexample
14736
14737 The first argument is the address of the start of the current function,
14738 which may be looked up exactly in the symbol table.
14739
14740 This instrumentation is also done for functions expanded inline in other
14741 functions.  The profiling calls will indicate where, conceptually, the
14742 inline function is entered and exited.  This means that addressable
14743 versions of such functions must be available.  If all your uses of a
14744 function are expanded inline, this may mean an additional expansion of
14745 code size.  If you use @samp{extern inline} in your C code, an
14746 addressable version of such functions must be provided.  (This is
14747 normally the case anyways, but if you get lucky and the optimizer always
14748 expands the functions inline, you might have gotten away without
14749 providing static copies.)
14750
14751 A function may be given the attribute @code{no_instrument_function}, in
14752 which case this instrumentation will not be done.  This can be used, for
14753 example, for the profiling functions listed above, high-priority
14754 interrupt routines, and any functions from which the profiling functions
14755 cannot safely be called (perhaps signal handlers, if the profiling
14756 routines generate output or allocate memory).
14757
14758 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
14759 @opindex finstrument-functions-exclude-file-list
14760
14761 Set the list of functions that are excluded from instrumentation (see
14762 the description of @code{-finstrument-functions}).  If the file that
14763 contains a function definition matches with one of @var{file}, then
14764 that function is not instrumented.  The match is done on substrings:
14765 if the @var{file} parameter is a substring of the file name, it is
14766 considered to be a match.
14767
14768 For example,
14769 @code{-finstrument-functions-exclude-file-list=/bits/stl,include/sys}
14770 will exclude any inline function defined in files whose pathnames
14771 contain @code{/bits/stl} or @code{include/sys}.
14772
14773 If, for some reason, you want to include letter @code{','} in one of
14774 @var{sym}, write @code{'\,'}. For example,
14775 @code{-finstrument-functions-exclude-file-list='\,\,tmp'}
14776 (note the single quote surrounding the option).
14777
14778 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
14779 @opindex finstrument-functions-exclude-function-list
14780
14781 This is similar to @code{-finstrument-functions-exclude-file-list},
14782 but this option sets the list of function names to be excluded from
14783 instrumentation.  The function name to be matched is its user-visible
14784 name, such as @code{vector<int> blah(const vector<int> &)}, not the
14785 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
14786 match is done on substrings: if the @var{sym} parameter is a substring
14787 of the function name, it is considered to be a match.
14788
14789 @item -fstack-check
14790 @opindex fstack-check
14791 Generate code to verify that you do not go beyond the boundary of the
14792 stack.  You should specify this flag if you are running in an
14793 environment with multiple threads, but only rarely need to specify it in
14794 a single-threaded environment since stack overflow is automatically
14795 detected on nearly all systems if there is only one stack.
14796
14797 Note that this switch does not actually cause checking to be done; the
14798 operating system must do that.  The switch causes generation of code
14799 to ensure that the operating system sees the stack being extended.
14800
14801 @item -fstack-limit-register=@var{reg}
14802 @itemx -fstack-limit-symbol=@var{sym}
14803 @itemx -fno-stack-limit
14804 @opindex fstack-limit-register
14805 @opindex fstack-limit-symbol
14806 @opindex fno-stack-limit
14807 Generate code to ensure that the stack does not grow beyond a certain value,
14808 either the value of a register or the address of a symbol.  If the stack
14809 would grow beyond the value, a signal is raised.  For most targets,
14810 the signal is raised before the stack overruns the boundary, so
14811 it is possible to catch the signal without taking special precautions.
14812
14813 For instance, if the stack starts at absolute address @samp{0x80000000}
14814 and grows downwards, you can use the flags
14815 @option{-fstack-limit-symbol=__stack_limit} and
14816 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
14817 of 128KB@.  Note that this may only work with the GNU linker.
14818
14819 @cindex aliasing of parameters
14820 @cindex parameters, aliased
14821 @item -fargument-alias
14822 @itemx -fargument-noalias
14823 @itemx -fargument-noalias-global
14824 @itemx -fargument-noalias-anything
14825 @opindex fargument-alias
14826 @opindex fargument-noalias
14827 @opindex fargument-noalias-global
14828 @opindex fargument-noalias-anything
14829 Specify the possible relationships among parameters and between
14830 parameters and global data.
14831
14832 @option{-fargument-alias} specifies that arguments (parameters) may
14833 alias each other and may alias global storage.@*
14834 @option{-fargument-noalias} specifies that arguments do not alias
14835 each other, but may alias global storage.@*
14836 @option{-fargument-noalias-global} specifies that arguments do not
14837 alias each other and do not alias global storage.
14838 @option{-fargument-noalias-anything} specifies that arguments do not
14839 alias any other storage.
14840
14841 Each language will automatically use whatever option is required by
14842 the language standard.  You should not need to use these options yourself.
14843
14844 @item -fleading-underscore
14845 @opindex fleading-underscore
14846 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
14847 change the way C symbols are represented in the object file.  One use
14848 is to help link with legacy assembly code.
14849
14850 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
14851 generate code that is not binary compatible with code generated without that
14852 switch.  Use it to conform to a non-default application binary interface.
14853 Not all targets provide complete support for this switch.
14854
14855 @item -ftls-model=@var{model}
14856 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
14857 The @var{model} argument should be one of @code{global-dynamic},
14858 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
14859
14860 The default without @option{-fpic} is @code{initial-exec}; with
14861 @option{-fpic} the default is @code{global-dynamic}.
14862
14863 @item -fvisibility=@var{default|internal|hidden|protected}
14864 @opindex fvisibility
14865 Set the default ELF image symbol visibility to the specified option---all
14866 symbols will be marked with this unless overridden within the code.
14867 Using this feature can very substantially improve linking and
14868 load times of shared object libraries, produce more optimized
14869 code, provide near-perfect API export and prevent symbol clashes.
14870 It is @strong{strongly} recommended that you use this in any shared objects
14871 you distribute.
14872
14873 Despite the nomenclature, @code{default} always means public ie;
14874 available to be linked against from outside the shared object.
14875 @code{protected} and @code{internal} are pretty useless in real-world
14876 usage so the only other commonly used option will be @code{hidden}.
14877 The default if @option{-fvisibility} isn't specified is
14878 @code{default}, i.e., make every
14879 symbol public---this causes the same behavior as previous versions of
14880 GCC@.
14881
14882 A good explanation of the benefits offered by ensuring ELF
14883 symbols have the correct visibility is given by ``How To Write
14884 Shared Libraries'' by Ulrich Drepper (which can be found at
14885 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
14886 solution made possible by this option to marking things hidden when
14887 the default is public is to make the default hidden and mark things
14888 public.  This is the norm with DLL's on Windows and with @option{-fvisibility=hidden}
14889 and @code{__attribute__ ((visibility("default")))} instead of
14890 @code{__declspec(dllexport)} you get almost identical semantics with
14891 identical syntax.  This is a great boon to those working with
14892 cross-platform projects.
14893
14894 For those adding visibility support to existing code, you may find
14895 @samp{#pragma GCC visibility} of use.  This works by you enclosing
14896 the declarations you wish to set visibility for with (for example)
14897 @samp{#pragma GCC visibility push(hidden)} and
14898 @samp{#pragma GCC visibility pop}.
14899 Bear in mind that symbol visibility should be viewed @strong{as
14900 part of the API interface contract} and thus all new code should
14901 always specify visibility when it is not the default ie; declarations
14902 only for use within the local DSO should @strong{always} be marked explicitly
14903 as hidden as so to avoid PLT indirection overheads---making this
14904 abundantly clear also aids readability and self-documentation of the code.
14905 Note that due to ISO C++ specification requirements, operator new and
14906 operator delete must always be of default visibility.
14907
14908 Be aware that headers from outside your project, in particular system
14909 headers and headers from any other library you use, may not be
14910 expecting to be compiled with visibility other than the default.  You
14911 may need to explicitly say @samp{#pragma GCC visibility push(default)}
14912 before including any such headers.
14913
14914 @samp{extern} declarations are not affected by @samp{-fvisibility}, so
14915 a lot of code can be recompiled with @samp{-fvisibility=hidden} with
14916 no modifications.  However, this means that calls to @samp{extern}
14917 functions with no explicit visibility will use the PLT, so it is more
14918 effective to use @samp{__attribute ((visibility))} and/or
14919 @samp{#pragma GCC visibility} to tell the compiler which @samp{extern}
14920 declarations should be treated as hidden.
14921
14922 Note that @samp{-fvisibility} does affect C++ vague linkage
14923 entities. This means that, for instance, an exception class that will
14924 be thrown between DSOs must be explicitly marked with default
14925 visibility so that the @samp{type_info} nodes will be unified between
14926 the DSOs.
14927
14928 An overview of these techniques, their benefits and how to use them
14929 is at @w{@uref{http://gcc.gnu.org/wiki/Visibility}}.
14930
14931 @end table
14932
14933 @c man end
14934
14935 @node Environment Variables
14936 @section Environment Variables Affecting GCC
14937 @cindex environment variables
14938
14939 @c man begin ENVIRONMENT
14940 This section describes several environment variables that affect how GCC
14941 operates.  Some of them work by specifying directories or prefixes to use
14942 when searching for various kinds of files.  Some are used to specify other
14943 aspects of the compilation environment.
14944
14945 Note that you can also specify places to search using options such as
14946 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
14947 take precedence over places specified using environment variables, which
14948 in turn take precedence over those specified by the configuration of GCC@.
14949 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
14950 GNU Compiler Collection (GCC) Internals}.
14951
14952 @table @env
14953 @item LANG
14954 @itemx LC_CTYPE
14955 @c @itemx LC_COLLATE
14956 @itemx LC_MESSAGES
14957 @c @itemx LC_MONETARY
14958 @c @itemx LC_NUMERIC
14959 @c @itemx LC_TIME
14960 @itemx LC_ALL
14961 @findex LANG
14962 @findex LC_CTYPE
14963 @c @findex LC_COLLATE
14964 @findex LC_MESSAGES
14965 @c @findex LC_MONETARY
14966 @c @findex LC_NUMERIC
14967 @c @findex LC_TIME
14968 @findex LC_ALL
14969 @cindex locale
14970 These environment variables control the way that GCC uses
14971 localization information that allow GCC to work with different
14972 national conventions.  GCC inspects the locale categories
14973 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
14974 so.  These locale categories can be set to any value supported by your
14975 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
14976 Kingdom encoded in UTF-8.
14977
14978 The @env{LC_CTYPE} environment variable specifies character
14979 classification.  GCC uses it to determine the character boundaries in
14980 a string; this is needed for some multibyte encodings that contain quote
14981 and escape characters that would otherwise be interpreted as a string
14982 end or escape.
14983
14984 The @env{LC_MESSAGES} environment variable specifies the language to
14985 use in diagnostic messages.
14986
14987 If the @env{LC_ALL} environment variable is set, it overrides the value
14988 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
14989 and @env{LC_MESSAGES} default to the value of the @env{LANG}
14990 environment variable.  If none of these variables are set, GCC
14991 defaults to traditional C English behavior.
14992
14993 @item TMPDIR
14994 @findex TMPDIR
14995 If @env{TMPDIR} is set, it specifies the directory to use for temporary
14996 files.  GCC uses temporary files to hold the output of one stage of
14997 compilation which is to be used as input to the next stage: for example,
14998 the output of the preprocessor, which is the input to the compiler
14999 proper.
15000
15001 @item GCC_EXEC_PREFIX
15002 @findex GCC_EXEC_PREFIX
15003 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
15004 names of the subprograms executed by the compiler.  No slash is added
15005 when this prefix is combined with the name of a subprogram, but you can
15006 specify a prefix that ends with a slash if you wish.
15007
15008 If @env{GCC_EXEC_PREFIX} is not set, GCC will attempt to figure out
15009 an appropriate prefix to use based on the pathname it was invoked with.
15010
15011 If GCC cannot find the subprogram using the specified prefix, it
15012 tries looking in the usual places for the subprogram.
15013
15014 The default value of @env{GCC_EXEC_PREFIX} is
15015 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
15016 the installed compiler. In many cases @var{prefix} is the value
15017 of @code{prefix} when you ran the @file{configure} script.
15018
15019 Other prefixes specified with @option{-B} take precedence over this prefix.
15020
15021 This prefix is also used for finding files such as @file{crt0.o} that are
15022 used for linking.
15023
15024 In addition, the prefix is used in an unusual way in finding the
15025 directories to search for header files.  For each of the standard
15026 directories whose name normally begins with @samp{/usr/local/lib/gcc}
15027 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
15028 replacing that beginning with the specified prefix to produce an
15029 alternate directory name.  Thus, with @option{-Bfoo/}, GCC will search
15030 @file{foo/bar} where it would normally search @file{/usr/local/lib/bar}.
15031 These alternate directories are searched first; the standard directories
15032 come next. If a standard directory begins with the configured
15033 @var{prefix} then the value of @var{prefix} is replaced by
15034 @env{GCC_EXEC_PREFIX} when looking for header files.
15035
15036 @item COMPILER_PATH
15037 @findex COMPILER_PATH
15038 The value of @env{COMPILER_PATH} is a colon-separated list of
15039 directories, much like @env{PATH}.  GCC tries the directories thus
15040 specified when searching for subprograms, if it can't find the
15041 subprograms using @env{GCC_EXEC_PREFIX}.
15042
15043 @item LIBRARY_PATH
15044 @findex LIBRARY_PATH
15045 The value of @env{LIBRARY_PATH} is a colon-separated list of
15046 directories, much like @env{PATH}.  When configured as a native compiler,
15047 GCC tries the directories thus specified when searching for special
15048 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
15049 using GCC also uses these directories when searching for ordinary
15050 libraries for the @option{-l} option (but directories specified with
15051 @option{-L} come first).
15052
15053 @item LANG
15054 @findex LANG
15055 @cindex locale definition
15056 This variable is used to pass locale information to the compiler.  One way in
15057 which this information is used is to determine the character set to be used
15058 when character literals, string literals and comments are parsed in C and C++.
15059 When the compiler is configured to allow multibyte characters,
15060 the following values for @env{LANG} are recognized:
15061
15062 @table @samp
15063 @item C-JIS
15064 Recognize JIS characters.
15065 @item C-SJIS
15066 Recognize SJIS characters.
15067 @item C-EUCJP
15068 Recognize EUCJP characters.
15069 @end table
15070
15071 If @env{LANG} is not defined, or if it has some other value, then the
15072 compiler will use mblen and mbtowc as defined by the default locale to
15073 recognize and translate multibyte characters.
15074 @end table
15075
15076 @noindent
15077 Some additional environments variables affect the behavior of the
15078 preprocessor.
15079
15080 @include cppenv.texi
15081
15082 @c man end
15083
15084 @node Precompiled Headers
15085 @section Using Precompiled Headers
15086 @cindex precompiled headers
15087 @cindex speed of compilation
15088
15089 Often large projects have many header files that are included in every
15090 source file.  The time the compiler takes to process these header files
15091 over and over again can account for nearly all of the time required to
15092 build the project.  To make builds faster, GCC allows users to
15093 `precompile' a header file; then, if builds can use the precompiled
15094 header file they will be much faster.
15095
15096 To create a precompiled header file, simply compile it as you would any
15097 other file, if necessary using the @option{-x} option to make the driver
15098 treat it as a C or C++ header file.  You will probably want to use a
15099 tool like @command{make} to keep the precompiled header up-to-date when
15100 the headers it contains change.
15101
15102 A precompiled header file will be searched for when @code{#include} is
15103 seen in the compilation.  As it searches for the included file
15104 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
15105 compiler looks for a precompiled header in each directory just before it
15106 looks for the include file in that directory.  The name searched for is
15107 the name specified in the @code{#include} with @samp{.gch} appended.  If
15108 the precompiled header file can't be used, it is ignored.
15109
15110 For instance, if you have @code{#include "all.h"}, and you have
15111 @file{all.h.gch} in the same directory as @file{all.h}, then the
15112 precompiled header file will be used if possible, and the original
15113 header will be used otherwise.
15114
15115 Alternatively, you might decide to put the precompiled header file in a
15116 directory and use @option{-I} to ensure that directory is searched
15117 before (or instead of) the directory containing the original header.
15118 Then, if you want to check that the precompiled header file is always
15119 used, you can put a file of the same name as the original header in this
15120 directory containing an @code{#error} command.
15121
15122 This also works with @option{-include}.  So yet another way to use
15123 precompiled headers, good for projects not designed with precompiled
15124 header files in mind, is to simply take most of the header files used by
15125 a project, include them from another header file, precompile that header
15126 file, and @option{-include} the precompiled header.  If the header files
15127 have guards against multiple inclusion, they will be skipped because
15128 they've already been included (in the precompiled header).
15129
15130 If you need to precompile the same header file for different
15131 languages, targets, or compiler options, you can instead make a
15132 @emph{directory} named like @file{all.h.gch}, and put each precompiled
15133 header in the directory, perhaps using @option{-o}.  It doesn't matter
15134 what you call the files in the directory, every precompiled header in
15135 the directory will be considered.  The first precompiled header
15136 encountered in the directory that is valid for this compilation will
15137 be used; they're searched in no particular order.
15138
15139 There are many other possibilities, limited only by your imagination,
15140 good sense, and the constraints of your build system.
15141
15142 A precompiled header file can be used only when these conditions apply:
15143
15144 @itemize
15145 @item
15146 Only one precompiled header can be used in a particular compilation.
15147
15148 @item
15149 A precompiled header can't be used once the first C token is seen.  You
15150 can have preprocessor directives before a precompiled header; you can
15151 even include a precompiled header from inside another header, so long as
15152 there are no C tokens before the @code{#include}.
15153
15154 @item
15155 The precompiled header file must be produced for the same language as
15156 the current compilation.  You can't use a C precompiled header for a C++
15157 compilation.
15158
15159 @item
15160 The precompiled header file must have been produced by the same compiler
15161 binary as the current compilation is using.
15162
15163 @item
15164 Any macros defined before the precompiled header is included must
15165 either be defined in the same way as when the precompiled header was
15166 generated, or must not affect the precompiled header, which usually
15167 means that they don't appear in the precompiled header at all.
15168
15169 The @option{-D} option is one way to define a macro before a
15170 precompiled header is included; using a @code{#define} can also do it.
15171 There are also some options that define macros implicitly, like
15172 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
15173 defined this way.
15174
15175 @item If debugging information is output when using the precompiled
15176 header, using @option{-g} or similar, the same kind of debugging information
15177 must have been output when building the precompiled header.  However,
15178 a precompiled header built using @option{-g} can be used in a compilation
15179 when no debugging information is being output.
15180
15181 @item The same @option{-m} options must generally be used when building
15182 and using the precompiled header.  @xref{Submodel Options},
15183 for any cases where this rule is relaxed.
15184
15185 @item Each of the following options must be the same when building and using
15186 the precompiled header:
15187
15188 @gccoptlist{-fexceptions -funit-at-a-time}
15189
15190 @item
15191 Some other command-line options starting with @option{-f},
15192 @option{-p}, or @option{-O} must be defined in the same way as when
15193 the precompiled header was generated.  At present, it's not clear
15194 which options are safe to change and which are not; the safest choice
15195 is to use exactly the same options when generating and using the
15196 precompiled header.  The following are known to be safe:
15197
15198 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
15199 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
15200 -fsched-verbose=<number>  -fschedule-insns  -fvisibility= @gol
15201 -pedantic-errors}
15202
15203 @end itemize
15204
15205 For all of these except the last, the compiler will automatically
15206 ignore the precompiled header if the conditions aren't met.  If you
15207 find an option combination that doesn't work and doesn't cause the
15208 precompiled header to be ignored, please consider filing a bug report,
15209 see @ref{Bugs}.
15210
15211 If you do use differing options when generating and using the
15212 precompiled header, the actual behavior will be a mixture of the
15213 behavior for the options.  For instance, if you use @option{-g} to
15214 generate the precompiled header but not when using it, you may or may
15215 not get debugging information for routines in the precompiled header.
15216
15217 @node Running Protoize
15218 @section Running Protoize
15219
15220 The program @code{protoize} is an optional part of GCC@.  You can use
15221 it to add prototypes to a program, thus converting the program to ISO
15222 C in one respect.  The companion program @code{unprotoize} does the
15223 reverse: it removes argument types from any prototypes that are found.
15224
15225 When you run these programs, you must specify a set of source files as
15226 command line arguments.  The conversion programs start out by compiling
15227 these files to see what functions they define.  The information gathered
15228 about a file @var{foo} is saved in a file named @file{@var{foo}.X}.
15229
15230 After scanning comes actual conversion.  The specified files are all
15231 eligible to be converted; any files they include (whether sources or
15232 just headers) are eligible as well.
15233
15234 But not all the eligible files are converted.  By default,
15235 @code{protoize} and @code{unprotoize} convert only source and header
15236 files in the current directory.  You can specify additional directories
15237 whose files should be converted with the @option{-d @var{directory}}
15238 option.  You can also specify particular files to exclude with the
15239 @option{-x @var{file}} option.  A file is converted if it is eligible, its
15240 directory name matches one of the specified directory names, and its
15241 name within the directory has not been excluded.
15242
15243 Basic conversion with @code{protoize} consists of rewriting most
15244 function definitions and function declarations to specify the types of
15245 the arguments.  The only ones not rewritten are those for varargs
15246 functions.
15247
15248 @code{protoize} optionally inserts prototype declarations at the
15249 beginning of the source file, to make them available for any calls that
15250 precede the function's definition.  Or it can insert prototype
15251 declarations with block scope in the blocks where undeclared functions
15252 are called.
15253
15254 Basic conversion with @code{unprotoize} consists of rewriting most
15255 function declarations to remove any argument types, and rewriting
15256 function definitions to the old-style pre-ISO form.
15257
15258 Both conversion programs print a warning for any function declaration or
15259 definition that they can't convert.  You can suppress these warnings
15260 with @option{-q}.
15261
15262 The output from @code{protoize} or @code{unprotoize} replaces the
15263 original source file.  The original file is renamed to a name ending
15264 with @samp{.save} (for DOS, the saved filename ends in @samp{.sav}
15265 without the original @samp{.c} suffix).  If the @samp{.save} (@samp{.sav}
15266 for DOS) file already exists, then the source file is simply discarded.
15267
15268 @code{protoize} and @code{unprotoize} both depend on GCC itself to
15269 scan the program and collect information about the functions it uses.
15270 So neither of these programs will work until GCC is installed.
15271
15272 Here is a table of the options you can use with @code{protoize} and
15273 @code{unprotoize}.  Each option works with both programs unless
15274 otherwise stated.
15275
15276 @table @code
15277 @item -B @var{directory}
15278 Look for the file @file{SYSCALLS.c.X} in @var{directory}, instead of the
15279 usual directory (normally @file{/usr/local/lib}).  This file contains
15280 prototype information about standard system functions.  This option
15281 applies only to @code{protoize}.
15282
15283 @item -c @var{compilation-options}
15284 Use @var{compilation-options} as the options when running @command{gcc} to
15285 produce the @samp{.X} files.  The special option @option{-aux-info} is
15286 always passed in addition, to tell @command{gcc} to write a @samp{.X} file.
15287
15288 Note that the compilation options must be given as a single argument to
15289 @code{protoize} or @code{unprotoize}.  If you want to specify several
15290 @command{gcc} options, you must quote the entire set of compilation options
15291 to make them a single word in the shell.
15292
15293 There are certain @command{gcc} arguments that you cannot use, because they
15294 would produce the wrong kind of output.  These include @option{-g},
15295 @option{-O}, @option{-c}, @option{-S}, and @option{-o} If you include these in
15296 the @var{compilation-options}, they are ignored.
15297
15298 @item -C
15299 Rename files to end in @samp{.C} (@samp{.cc} for DOS-based file
15300 systems) instead of @samp{.c}.  This is convenient if you are converting
15301 a C program to C++.  This option applies only to @code{protoize}.
15302
15303 @item -g
15304 Add explicit global declarations.  This means inserting explicit
15305 declarations at the beginning of each source file for each function
15306 that is called in the file and was not declared.  These declarations
15307 precede the first function definition that contains a call to an
15308 undeclared function.  This option applies only to @code{protoize}.
15309
15310 @item -i @var{string}
15311 Indent old-style parameter declarations with the string @var{string}.
15312 This option applies only to @code{protoize}.
15313
15314 @code{unprotoize} converts prototyped function definitions to old-style
15315 function definitions, where the arguments are declared between the
15316 argument list and the initial @samp{@{}.  By default, @code{unprotoize}
15317 uses five spaces as the indentation.  If you want to indent with just
15318 one space instead, use @option{-i " "}.
15319
15320 @item -k
15321 Keep the @samp{.X} files.  Normally, they are deleted after conversion
15322 is finished.
15323
15324 @item -l
15325 Add explicit local declarations.  @code{protoize} with @option{-l} inserts
15326 a prototype declaration for each function in each block which calls the
15327 function without any declaration.  This option applies only to
15328 @code{protoize}.
15329
15330 @item -n
15331 Make no real changes.  This mode just prints information about the conversions
15332 that would have been done without @option{-n}.
15333
15334 @item -N
15335 Make no @samp{.save} files.  The original files are simply deleted.
15336 Use this option with caution.
15337
15338 @item -p @var{program}
15339 Use the program @var{program} as the compiler.  Normally, the name
15340 @file{gcc} is used.
15341
15342 @item -q
15343 Work quietly.  Most warnings are suppressed.
15344
15345 @item -v
15346 Print the version number, just like @option{-v} for @command{gcc}.
15347 @end table
15348
15349 If you need special compiler options to compile one of your program's
15350 source files, then you should generate that file's @samp{.X} file
15351 specially, by running @command{gcc} on that source file with the
15352 appropriate options and the option @option{-aux-info}.  Then run
15353 @code{protoize} on the entire set of files.  @code{protoize} will use
15354 the existing @samp{.X} file because it is newer than the source file.
15355 For example:
15356
15357 @smallexample
15358 gcc -Dfoo=bar file1.c -aux-info file1.X
15359 protoize *.c
15360 @end smallexample
15361
15362 @noindent
15363 You need to include the special files along with the rest in the
15364 @code{protoize} command, even though their @samp{.X} files already
15365 exist, because otherwise they won't get converted.
15366
15367 @xref{Protoize Caveats}, for more information on how to use
15368 @code{protoize} successfully.