Makefile.tpl (DEBUG_PREFIX_CFLAGS_FOR_TARGET): New.
[platform/upstream/gcc.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 Free Software Foundation, Inc.
15
16 Permission is granted to copy, distribute and/or modify this document
17 under the terms of the GNU Free Documentation License, Version 1.2 or
18 any later version published by the Free Software Foundation; with the
19 Invariant Sections being ``GNU General Public License'' and ``Funding
20 Free Software'', the Front-Cover texts being (a) (see below), and with
21 the Back-Cover Texts being (b) (see below).  A copy of the license is
22 included in the gfdl(7) man page.
23
24 (a) The FSF's Front-Cover Text is:
25
26      A GNU Manual
27
28 (b) The FSF's Back-Cover Text is:
29
30      You have freedom to copy and modify this GNU Manual, like GNU
31      software.  Copies published by the Free Software Foundation raise
32      funds for GNU development.
33 @c man end
34 @c Set file name and title for the man page.
35 @setfilename gcc
36 @settitle GNU project C and C++ compiler
37 @c man begin SYNOPSIS
38 gcc [@option{-c}|@option{-S}|@option{-E}] [@option{-std=}@var{standard}]
39     [@option{-g}] [@option{-pg}] [@option{-O}@var{level}]
40     [@option{-W}@var{warn}@dots{}] [@option{-pedantic}]
41     [@option{-I}@var{dir}@dots{}] [@option{-L}@var{dir}@dots{}]
42     [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}]
43     [@option{-f}@var{option}@dots{}] [@option{-m}@var{machine-option}@dots{}]
44     [@option{-o} @var{outfile}] [@@@var{file}] @var{infile}@dots{}
45
46 Only the most useful options are listed here; see below for the
47 remainder.  @samp{g++} accepts mostly the same options as @samp{gcc}.
48 @c man end
49 @c man begin SEEALSO
50 gpl(7), gfdl(7), fsf-funding(7),
51 cpp(1), gcov(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1)
52 and the Info entries for @file{gcc}, @file{cpp}, @file{as},
53 @file{ld}, @file{binutils} and @file{gdb}.
54 @c man end
55 @c man begin BUGS
56 For instructions on reporting bugs, see
57 @w{@uref{http://gcc.gnu.org/bugs.html}}.
58 @c man end
59 @c man begin AUTHOR
60 See the Info entry for @command{gcc}, or
61 @w{@uref{http://gcc.gnu.org/onlinedocs/gcc/Contributors.html}},
62 for contributors to GCC@.
63 @c man end
64 @end ignore
65
66 @node Invoking GCC
67 @chapter GCC Command Options
68 @cindex GCC command options
69 @cindex command options
70 @cindex options, GCC command
71
72 @c man begin DESCRIPTION
73 When you invoke GCC, it normally does preprocessing, compilation,
74 assembly and linking.  The ``overall options'' allow you to stop this
75 process at an intermediate stage.  For example, the @option{-c} option
76 says not to run the linker.  Then the output consists of object files
77 output by the assembler.
78
79 Other options are passed on to one stage of processing.  Some options
80 control the preprocessor and others the compiler itself.  Yet other
81 options control the assembler and linker; most of these are not
82 documented here, since you rarely need to use any of them.
83
84 @cindex C compilation options
85 Most of the command line options that you can use with GCC are useful
86 for C programs; when an option is only useful with another language
87 (usually C++), the explanation says so explicitly.  If the description
88 for a particular option does not mention a source language, you can use
89 that option with all supported languages.
90
91 @cindex C++ compilation options
92 @xref{Invoking G++,,Compiling C++ Programs}, for a summary of special
93 options for compiling C++ programs.
94
95 @cindex grouping options
96 @cindex options, grouping
97 The @command{gcc} program accepts options and file names as operands.  Many
98 options have multi-letter names; therefore multiple single-letter options
99 may @emph{not} be grouped: @option{-dr} is very different from @w{@samp{-d
100 -r}}.
101
102 @cindex order of options
103 @cindex options, order
104 You can mix options and other arguments.  For the most part, the order
105 you use doesn't matter.  Order does matter when you use several
106 options of the same kind; for example, if you specify @option{-L} more
107 than once, the directories are searched in the order specified.  Also,
108 the placement of the @option{-l} option is significant.
109
110 Many options have long names starting with @samp{-f} or with
111 @samp{-W}---for example,
112 @option{-fmove-loop-invariants}, @option{-Wformat} and so on.  Most of
113 these have both positive and negative forms; the negative form of
114 @option{-ffoo} would be @option{-fno-foo}.  This manual documents
115 only one of these two forms, whichever one is not the default.
116
117 @c man end
118
119 @xref{Option Index}, for an index to GCC's options.
120
121 @menu
122 * Option Summary::      Brief list of all options, without explanations.
123 * Overall Options::     Controlling the kind of output:
124                         an executable, object files, assembler files,
125                         or preprocessed source.
126 * Invoking G++::        Compiling C++ programs.
127 * C Dialect Options::   Controlling the variant of C language compiled.
128 * C++ Dialect Options:: Variations on C++.
129 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
130                         and Objective-C++.
131 * Language Independent Options:: Controlling how diagnostics should be
132                         formatted.
133 * Warning Options::     How picky should the compiler be?
134 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
135 * Optimize Options::    How much optimization?
136 * Preprocessor Options:: Controlling header files and macro definitions.
137                          Also, getting dependency information for Make.
138 * Assembler Options::   Passing options to the assembler.
139 * Link Options::        Specifying libraries and so on.
140 * Directory Options::   Where to find header files and libraries.
141                         Where to find the compiler executable files.
142 * Spec Files::          How to pass switches to sub-processes.
143 * Target Options::      Running a cross-compiler, or an old version of GCC.
144 * Submodel Options::    Specifying minor hardware or convention variations,
145                         such as 68010 vs 68020.
146 * Code Gen Options::    Specifying conventions for function calls, data layout
147                         and register usage.
148 * Environment Variables:: Env vars that affect GCC.
149 * Precompiled Headers:: Compiling a header once, and using it many times.
150 * Running Protoize::    Automatically adding or removing function prototypes.
151 @end menu
152
153 @c man begin OPTIONS
154
155 @node Option Summary
156 @section Option Summary
157
158 Here is a summary of all the options, grouped by type.  Explanations are
159 in the following sections.
160
161 @table @emph
162 @item Overall Options
163 @xref{Overall Options,,Options Controlling the Kind of Output}.
164 @gccoptlist{-c  -S  -E  -o @var{file}  -combine  -pipe  -pass-exit-codes  @gol
165 -x @var{language}  -v  -###  --help@r{[}=@var{class}@r{]}  --target-help  @gol
166 --version @@@var{file}}
167
168 @item C Language Options
169 @xref{C Dialect Options,,Options Controlling C Dialect}.
170 @gccoptlist{-ansi  -std=@var{standard}  -fgnu89-inline @gol
171 -aux-info @var{filename} @gol
172 -fno-asm  -fno-builtin  -fno-builtin-@var{function} @gol
173 -fhosted  -ffreestanding -fopenmp -fms-extensions @gol
174 -trigraphs  -no-integrated-cpp  -traditional  -traditional-cpp @gol
175 -fallow-single-precision  -fcond-mismatch -flax-vector-conversions @gol
176 -fsigned-bitfields  -fsigned-char @gol
177 -funsigned-bitfields  -funsigned-char}
178
179 @item C++ Language Options
180 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
181 @gccoptlist{-fabi-version=@var{n}  -fno-access-control  -fcheck-new @gol
182 -fconserve-space  -ffriend-injection @gol
183 -fno-elide-constructors @gol
184 -fno-enforce-eh-specs @gol
185 -ffor-scope  -fno-for-scope  -fno-gnu-keywords @gol
186 -fno-implicit-templates @gol
187 -fno-implicit-inline-templates @gol
188 -fno-implement-inlines  -fms-extensions @gol
189 -fno-nonansi-builtins  -fno-operator-names @gol
190 -fno-optional-diags  -fpermissive @gol
191 -frepo  -fno-rtti  -fstats  -ftemplate-depth-@var{n} @gol
192 -fno-threadsafe-statics -fuse-cxa-atexit  -fno-weak  -nostdinc++ @gol
193 -fno-default-inline  -fvisibility-inlines-hidden @gol
194 -fvisibility-ms-compat @gol
195 -Wabi  -Wctor-dtor-privacy @gol
196 -Wnon-virtual-dtor  -Wreorder @gol
197 -Weffc++  -Wno-deprecated  -Wstrict-null-sentinel @gol
198 -Wno-non-template-friend  -Wold-style-cast @gol
199 -Woverloaded-virtual  -Wno-pmf-conversions @gol
200 -Wsign-promo}
201
202 @item Objective-C and Objective-C++ Language Options
203 @xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling
204 Objective-C and Objective-C++ Dialects}.
205 @gccoptlist{-fconstant-string-class=@var{class-name} @gol
206 -fgnu-runtime  -fnext-runtime @gol
207 -fno-nil-receivers @gol
208 -fobjc-call-cxx-cdtors @gol
209 -fobjc-direct-dispatch @gol
210 -fobjc-exceptions @gol
211 -fobjc-gc @gol
212 -freplace-objc-classes @gol
213 -fzero-link @gol
214 -gen-decls @gol
215 -Wassign-intercept @gol
216 -Wno-protocol  -Wselector @gol
217 -Wstrict-selector-match @gol
218 -Wundeclared-selector}
219
220 @item Language Independent Options
221 @xref{Language Independent Options,,Options to Control Diagnostic Messages Formatting}.
222 @gccoptlist{-fmessage-length=@var{n}  @gol
223 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol
224 -fdiagnostics-show-option}
225
226 @item Warning Options
227 @xref{Warning Options,,Options to Request or Suppress Warnings}.
228 @gccoptlist{-fsyntax-only  -pedantic  -pedantic-errors @gol
229 -w  -Wextra  -Wall  -Waddress  -Waggregate-return  -Warray-bounds @gol
230 -Wno-attributes -Wc++-compat -Wc++0x-compat -Wcast-align  -Wcast-qual  @gol
231 -Wchar-subscripts -Wclobbered  -Wcomment @gol
232 -Wconversion  -Wcoverage-mismatch  -Wno-deprecated-declarations @gol
233 -Wdisabled-optimization  -Wno-div-by-zero  @gol
234 -Wempty-body  -Wno-endif-labels @gol
235 -Werror  -Werror=* @gol
236 -Wfatal-errors  -Wfloat-equal  -Wformat  -Wformat=2 @gol
237 -Wno-format-extra-args -Wformat-nonliteral @gol
238 -Wformat-security  -Wformat-y2k @gol
239 -Wimplicit  -Wimplicit-function-declaration  -Wimplicit-int @gol
240 -Wimport  -Wno-import  -Winit-self  -Winline @gol
241 -Wno-int-to-pointer-cast -Wno-invalid-offsetof @gol
242 -Winvalid-pch -Wlarger-than-@var{len}  -Wunsafe-loop-optimizations @gol
243 -Wlogical-op -Wlong-long @gol
244 -Wmain  -Wmissing-braces  -Wmissing-field-initializers @gol
245 -Wmissing-format-attribute  -Wmissing-include-dirs @gol
246 -Wmissing-noreturn @gol
247 -Wno-multichar  -Wnonnull  -Wno-overflow @gol
248 -Woverlength-strings  -Wpacked  -Wpadded @gol
249 -Wparentheses  -Wpointer-arith  -Wno-pointer-to-int-cast @gol
250 -Wredundant-decls @gol
251 -Wreturn-type  -Wsequence-point  -Wshadow @gol
252 -Wsign-compare  -Wsign-conversion  -Wstack-protector @gol
253 -Wstrict-aliasing -Wstrict-aliasing=n @gol
254 -Wstrict-overflow -Wstrict-overflow=@var{n} @gol
255 -Wswitch  -Wswitch-default  -Wswitch-enum @gol
256 -Wsystem-headers  -Wtrigraphs  -Wtype-limits  -Wundef  -Wuninitialized @gol
257 -Wunknown-pragmas  -Wno-pragmas -Wunreachable-code @gol
258 -Wunused  -Wunused-function  -Wunused-label  -Wunused-parameter @gol
259 -Wunused-value  -Wunused-variable @gol
260 -Wvariadic-macros -Wvla @gol
261 -Wvolatile-register-var  -Wwrite-strings}
262
263 @item C-only Warning Options
264 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
265 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
266 -Wold-style-declaration  -Wold-style-definition @gol
267 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
268 -Wdeclaration-after-statement -Wpointer-sign}
269
270 @item Debugging Options
271 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
272 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
273 -fdbg-cnt-list -fdbg-cnt=@var{counter-value-list} @gol
274 -fdump-noaddr -fdump-unnumbered  -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
275 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
276 -fdump-ipa-all -fdump-ipa-cgraph @gol
277 -fdump-tree-all @gol
278 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
279 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
280 -fdump-tree-inlined@r{[}-@var{n}@r{]} @gol
281 -fdump-tree-cfg -fdump-tree-vcg -fdump-tree-alias @gol
282 -fdump-tree-ch @gol
283 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
284 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
285 -fdump-tree-gimple@r{[}-raw@r{]} -fdump-tree-mudflap@r{[}-@var{n}@r{]} @gol
286 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
287 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
288 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
289 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
290 -fdump-tree-copyrename@r{[}-@var{n}@r{]} @gol
291 -fdump-tree-nrv -fdump-tree-vect @gol
292 -fdump-tree-sink @gol
293 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
294 -fdump-tree-salias @gol
295 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
296 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
297 -ftree-vectorizer-verbose=@var{n} @gol
298 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
299 -feliminate-dwarf2-dups -feliminate-unused-debug-types @gol
300 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
301 -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
302 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
303 -ftest-coverage  -ftime-report -fvar-tracking @gol
304 -g  -g@var{level}  -gcoff -gdwarf-2 @gol
305 -ggdb  -gstabs  -gstabs+  -gvms  -gxcoff  -gxcoff+ @gol
306 -fdebug-prefix-map=@var{old}=@var{new} @gol
307 -femit-struct-debug-baseonly -femit-struct-debug-reduced @gol
308 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
309 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
310 -print-multi-directory  -print-multi-lib @gol
311 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
312 -print-sysroot-headers-suffix @gol
313 -save-temps  -time}
314
315 @item Optimization Options
316 @xref{Optimize Options,,Options that Control Optimization}.
317 @gccoptlist{-falign-functions=@var{n}  -falign-jumps=@var{n} @gol
318 -falign-labels=@var{n}  -falign-loops=@var{n}  @gol
319 -fbounds-check -fmudflap -fmudflapth -fmudflapir @gol
320 -fbranch-probabilities -fprofile-values -fvpt -fbranch-target-load-optimize @gol
321 -fbranch-target-load-optimize2 -fbtr-bb-exclusive @gol
322 -fcaller-saves  -fcprop-registers  -fcse-follow-jumps @gol
323 -fcse-skip-blocks  -fcx-limited-range  -fdata-sections @gol
324 -fdelayed-branch  -fdelete-null-pointer-checks -fearly-inlining @gol
325 -fexpensive-optimizations  -ffast-math  -ffloat-store @gol
326 -fforce-addr  -fforward-propagate  -ffunction-sections @gol
327 -fgcse  -fgcse-lm  -fgcse-sm  -fgcse-las  -fgcse-after-reload @gol
328 -fcrossjumping  -fif-conversion  -fif-conversion2 @gol
329 -finline-functions  -finline-functions-called-once @gol
330 -finline-limit=@var{n}  -fkeep-inline-functions @gol
331 -fkeep-static-consts  -fmerge-constants  -fmerge-all-constants @gol
332 -fmodulo-sched -fmodulo-sched-allow-regmoves -fno-branch-count-reg @gol
333 -fno-default-inline  -fno-defer-pop -fmove-loop-invariants @gol
334 -fno-function-cse  -fno-guess-branch-probability @gol
335 -fno-inline  -fno-math-errno  -fno-peephole  -fno-peephole2 @gol
336 -funsafe-math-optimizations  -funsafe-loop-optimizations @gol
337 -ffinite-math-only  -fno-signed-zeros @gol
338 -fno-toplevel-reorder -fno-trapping-math  -fno-zero-initialized-in-bss @gol
339 -fomit-frame-pointer  -foptimize-register-move @gol
340 -foptimize-sibling-calls  -fpredictive-commoning -fprefetch-loop-arrays @gol
341 -fprofile-generate -fprofile-use @gol
342 -fregmove  -frename-registers @gol
343 -freorder-blocks  -freorder-blocks-and-partition -freorder-functions @gol
344 -frerun-cse-after-loop @gol
345 -frounding-math -frtl-abstract-sequences @gol
346 -fschedule-insns  -fschedule-insns2 @gol
347 -fno-sched-interblock  -fno-sched-spec  -fsched-spec-load @gol
348 -fsched-spec-load-dangerous  @gol
349 -fsched-stalled-insns=@var{n} -fsched-stalled-insns-dep=@var{n} @gol
350 -fsched2-use-superblocks @gol
351 -fsched2-use-traces -fsee -freschedule-modulo-scheduled-loops @gol
352 -fsection-anchors  -fsignaling-nans  -fsingle-precision-constant @gol
353 -fno-split-wide-types -fstack-protector  -fstack-protector-all @gol
354 -fstrict-aliasing  -fstrict-overflow  -ftracer  -fthread-jumps @gol
355 -funroll-all-loops  -funroll-loops  -fpeel-loops @gol
356 -fsplit-ivs-in-unroller -funswitch-loops @gol
357 -fvariable-expansion-in-unroller -ftree-reassoc @gol
358 -ftree-pre  -ftree-ccp  -ftree-dce -ftree-loop-optimize @gol
359 -ftree-loop-linear -ftree-loop-im -ftree-loop-ivcanon -fivopts @gol
360 -fcheck-data-deps @gol
361 -ftree-dominator-opts -ftree-dse -ftree-copyrename -ftree-sink @gol
362 -ftree-ch -ftree-sra -ftree-ter -ftree-fre -ftree-vectorize @gol
363 -ftree-vect-loop-version -fvect-cost-model -ftree-salias -fipa-pta -fweb @gol
364 -ftree-copy-prop -ftree-store-ccp -ftree-store-copy-prop -fwhole-program @gol
365 --param @var{name}=@var{value}
366 -O  -O0  -O1  -O2  -O3  -Os}
367
368 @item Preprocessor Options
369 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
370 @gccoptlist{-A@var{question}=@var{answer} @gol
371 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
372 -C  -dD  -dI  -dM  -dN @gol
373 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
374 -idirafter @var{dir} @gol
375 -include @var{file}  -imacros @var{file} @gol
376 -iprefix @var{file}  -iwithprefix @var{dir} @gol
377 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
378 -imultilib @var{dir} -isysroot @var{dir} @gol
379 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
380 -P  -fworking-directory  -remap @gol
381 -trigraphs  -undef  -U@var{macro}  -Wp,@var{option} @gol
382 -Xpreprocessor @var{option}}
383
384 @item Assembler Option
385 @xref{Assembler Options,,Passing Options to the Assembler}.
386 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
387
388 @item Linker Options
389 @xref{Link Options,,Options for Linking}.
390 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
391 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
392 -s  -static  -static-libgcc  -shared  -shared-libgcc  -symbolic @gol
393 -Wl,@var{option}  -Xlinker @var{option} @gol
394 -u @var{symbol}}
395
396 @item Directory Options
397 @xref{Directory Options,,Options for Directory Search}.
398 @gccoptlist{-B@var{prefix}  -I@var{dir}  -iquote@var{dir}  -L@var{dir}
399 -specs=@var{file}  -I- --sysroot=@var{dir}}
400
401 @item Target Options
402 @c I wrote this xref this way to avoid overfull hbox. -- rms
403 @xref{Target Options}.
404 @gccoptlist{-V @var{version}  -b @var{machine}}
405
406 @item Machine Dependent Options
407 @xref{Submodel Options,,Hardware Models and Configurations}.
408 @c This list is ordered alphanumerically by subsection name.
409 @c Try and put the significant identifier (CPU or system) first,
410 @c so users have a clue at guessing where the ones they want will be.
411
412 @emph{ARC Options}
413 @gccoptlist{-EB  -EL @gol
414 -mmangle-cpu  -mcpu=@var{cpu}  -mtext=@var{text-section} @gol
415 -mdata=@var{data-section}  -mrodata=@var{readonly-data-section}}
416
417 @emph{ARM Options}
418 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
419 -mabi=@var{name} @gol
420 -mapcs-stack-check  -mno-apcs-stack-check @gol
421 -mapcs-float  -mno-apcs-float @gol
422 -mapcs-reentrant  -mno-apcs-reentrant @gol
423 -msched-prolog  -mno-sched-prolog @gol
424 -mlittle-endian  -mbig-endian  -mwords-little-endian @gol
425 -mfloat-abi=@var{name}  -msoft-float  -mhard-float  -mfpe @gol
426 -mthumb-interwork  -mno-thumb-interwork @gol
427 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
428 -mstructure-size-boundary=@var{n} @gol
429 -mabort-on-noreturn @gol
430 -mlong-calls  -mno-long-calls @gol
431 -msingle-pic-base  -mno-single-pic-base @gol
432 -mpic-register=@var{reg} @gol
433 -mnop-fun-dllimport @gol
434 -mcirrus-fix-invalid-insns -mno-cirrus-fix-invalid-insns @gol
435 -mpoke-function-name @gol
436 -mthumb  -marm @gol
437 -mtpcs-frame  -mtpcs-leaf-frame @gol
438 -mcaller-super-interworking  -mcallee-super-interworking @gol
439 -mtp=@var{name}}
440
441 @emph{AVR Options}
442 @gccoptlist{-mmcu=@var{mcu}  -msize  -minit-stack=@var{n}  -mno-interrupts @gol
443 -mcall-prologues  -mno-tablejump  -mtiny-stack  -mint8}
444
445 @emph{Blackfin Options}
446 @gccoptlist{-mcpu=@var{cpu}  -msim  -momit-leaf-frame-pointer @gol
447 -mno-omit-leaf-frame-pointer  -mspecld-anomaly  -mno-specld-anomaly @gol
448 -mcsync-anomaly  -mno-csync-anomaly  -mlow-64k  -mno-low64k @gol
449 -mstack-check-l1  -mid-shared-library  -mno-id-shared-library @gol
450 -mshared-library-id=@var{n}  -mleaf-id-shared-library @gol
451 -mno-leaf-id-shared-library  -msep-data  -mno-sep-data  -mlong-calls @gol
452 -mno-long-calls}
453
454 @emph{CRIS Options}
455 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
456 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
457 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
458 -mstack-align  -mdata-align  -mconst-align @gol
459 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
460 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
461 -mmul-bug-workaround  -mno-mul-bug-workaround}
462
463 @emph{CRX Options}
464 @gccoptlist{-mmac -mpush-args}
465
466 @emph{Darwin Options}
467 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
468 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
469 -client_name  -compatibility_version  -current_version @gol
470 -dead_strip @gol
471 -dependency-file  -dylib_file  -dylinker_install_name @gol
472 -dynamic  -dynamiclib  -exported_symbols_list @gol
473 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
474 -force_flat_namespace  -headerpad_max_install_names @gol
475 -iframework @gol
476 -image_base  -init  -install_name  -keep_private_externs @gol
477 -multi_module  -multiply_defined  -multiply_defined_unused @gol
478 -noall_load   -no_dead_strip_inits_and_terms @gol
479 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
480 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
481 -private_bundle  -read_only_relocs  -sectalign @gol
482 -sectobjectsymbols  -whyload  -seg1addr @gol
483 -sectcreate  -sectobjectsymbols  -sectorder @gol
484 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
485 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
486 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
487 -single_module  -static  -sub_library  -sub_umbrella @gol
488 -twolevel_namespace  -umbrella  -undefined @gol
489 -unexported_symbols_list  -weak_reference_mismatches @gol
490 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
491 -mkernel -mone-byte-bool}
492
493 @emph{DEC Alpha Options}
494 @gccoptlist{-mno-fp-regs  -msoft-float  -malpha-as  -mgas @gol
495 -mieee  -mieee-with-inexact  -mieee-conformant @gol
496 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
497 -mtrap-precision=@var{mode}  -mbuild-constants @gol
498 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
499 -mbwx  -mmax  -mfix  -mcix @gol
500 -mfloat-vax  -mfloat-ieee @gol
501 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
502 -msmall-text  -mlarge-text @gol
503 -mmemory-latency=@var{time}}
504
505 @emph{DEC Alpha/VMS Options}
506 @gccoptlist{-mvms-return-codes}
507
508 @emph{FRV Options}
509 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
510 -mhard-float  -msoft-float @gol
511 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
512 -mdouble  -mno-double @gol
513 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
514 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
515 -mlinked-fp  -mlong-calls  -malign-labels @gol
516 -mlibrary-pic  -macc-4  -macc-8 @gol
517 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
518 -moptimize-membar -mno-optimize-membar @gol
519 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
520 -mvliw-branch  -mno-vliw-branch @gol
521 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
522 -mno-nested-cond-exec  -mtomcat-stats @gol
523 -mTLS -mtls @gol
524 -mcpu=@var{cpu}}
525
526 @emph{GNU/Linux Options}
527 @gccoptlist{-muclibc}
528
529 @emph{H8/300 Options}
530 @gccoptlist{-mrelax  -mh  -ms  -mn  -mint32  -malign-300}
531
532 @emph{HPPA Options}
533 @gccoptlist{-march=@var{architecture-type} @gol
534 -mbig-switch  -mdisable-fpregs  -mdisable-indexing @gol
535 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
536 -mfixed-range=@var{register-range} @gol
537 -mjump-in-delay -mlinker-opt -mlong-calls @gol
538 -mlong-load-store  -mno-big-switch  -mno-disable-fpregs @gol
539 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
540 -mno-jump-in-delay  -mno-long-load-store @gol
541 -mno-portable-runtime  -mno-soft-float @gol
542 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
543 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
544 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
545 -munix=@var{unix-std}  -nolibdld  -static  -threads}
546
547 @emph{i386 and x86-64 Options}
548 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
549 -mfpmath=@var{unit} @gol
550 -masm=@var{dialect}  -mno-fancy-math-387 @gol
551 -mno-fp-ret-in-387  -msoft-float @gol
552 -mno-wide-multiply  -mrtd  -malign-double @gol
553 -mpreferred-stack-boundary=@var{num} -mcx16 -msahf -mrecip @gol
554 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 @gol
555 -msse4a -m3dnow -mpopcnt -mabm @gol
556 -mthreads  -mno-align-stringops  -minline-all-stringops @gol
557 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
558 -m96bit-long-double  -mregparm=@var{num}  -msseregparm @gol
559 -mpc32 -mpc64 -mpc80 mstackrealign @gol
560 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
561 -mcmodel=@var{code-model} @gol
562 -m32  -m64 -mlarge-data-threshold=@var{num}}
563
564 @emph{IA-64 Options}
565 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
566 -mvolatile-asm-stop  -mregister-names  -mno-sdata @gol
567 -mconstant-gp  -mauto-pic  -minline-float-divide-min-latency @gol
568 -minline-float-divide-max-throughput @gol
569 -minline-int-divide-min-latency @gol
570 -minline-int-divide-max-throughput  @gol
571 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
572 -mno-dwarf2-asm -mearly-stop-bits @gol
573 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
574 -mtune=@var{cpu-type} -mt -pthread -milp32 -mlp64 @gol
575 -mno-sched-br-data-spec -msched-ar-data-spec -mno-sched-control-spec @gol
576 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
577 -msched-ldc -mno-sched-control-ldc -mno-sched-spec-verbose @gol
578 -mno-sched-prefer-non-data-spec-insns @gol
579 -mno-sched-prefer-non-control-spec-insns @gol
580 -mno-sched-count-spec-in-critical-path}
581
582 @emph{M32R/D Options}
583 @gccoptlist{-m32r2 -m32rx -m32r @gol
584 -mdebug @gol
585 -malign-loops -mno-align-loops @gol
586 -missue-rate=@var{number} @gol
587 -mbranch-cost=@var{number} @gol
588 -mmodel=@var{code-size-model-type} @gol
589 -msdata=@var{sdata-type} @gol
590 -mno-flush-func -mflush-func=@var{name} @gol
591 -mno-flush-trap -mflush-trap=@var{number} @gol
592 -G @var{num}}
593
594 @emph{M32C Options}
595 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
596
597 @emph{M680x0 Options}
598 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune}
599 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
600 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
601 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
602 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
603 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
604 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
605 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library}
606
607 @emph{M68hc1x Options}
608 @gccoptlist{-m6811  -m6812  -m68hc11  -m68hc12   -m68hcs12 @gol
609 -mauto-incdec  -minmax  -mlong-calls  -mshort @gol
610 -msoft-reg-count=@var{count}}
611
612 @emph{MCore Options}
613 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
614 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
615 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
616 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
617 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
618
619 @emph{MIPS Options}
620 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
621 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2  -mips64 @gol
622 -mips16  -mno-mips16  -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
623 -mshared  -mno-shared  -mxgot  -mno-xgot  -mgp32  -mgp64 @gol
624 -mfp32  -mfp64  -mhard-float  -msoft-float @gol
625 -msingle-float  -mdouble-float  -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
626 -msmartmips  -mno-smartmips @gol
627 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
628 -mips3d  -mno-mips3d  -mmt  -mno-mt @gol
629 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
630 -G@var{num}  -membedded-data  -mno-embedded-data @gol
631 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
632 -mcode-readable=@var{setting} @gol
633 -msplit-addresses  -mno-split-addresses @gol
634 -mexplicit-relocs  -mno-explicit-relocs @gol
635 -mcheck-zero-division  -mno-check-zero-division @gol
636 -mdivide-traps  -mdivide-breaks @gol
637 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
638 -mmad  -mno-mad  -mfused-madd  -mno-fused-madd  -nocpp @gol
639 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
640 -mfix-vr4120  -mno-fix-vr4120  -mfix-vr4130  -mno-fix-vr4130 @gol
641 -mfix-sb1  -mno-fix-sb1 @gol
642 -mflush-func=@var{func}  -mno-flush-func @gol
643 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
644 -mfp-exceptions -mno-fp-exceptions @gol
645 -mvr4130-align -mno-vr4130-align}
646
647 @emph{MMIX Options}
648 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
649 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
650 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
651 -mno-base-addresses  -msingle-exit  -mno-single-exit}
652
653 @emph{MN10300 Options}
654 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
655 -mam33  -mno-am33 @gol
656 -mam33-2  -mno-am33-2 @gol
657 -mreturn-pointer-on-d0 @gol
658 -mno-crt0  -mrelax}
659
660 @emph{MT Options}
661 @gccoptlist{-mno-crt0 -mbacc -msim @gol
662 -march=@var{cpu-type} }
663
664 @emph{PDP-11 Options}
665 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
666 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
667 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
668 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
669 -mbranch-expensive  -mbranch-cheap @gol
670 -msplit  -mno-split  -munix-asm  -mdec-asm}
671
672 @emph{PowerPC Options}
673 See RS/6000 and PowerPC Options.
674
675 @emph{RS/6000 and PowerPC Options}
676 @gccoptlist{-mcpu=@var{cpu-type} @gol
677 -mtune=@var{cpu-type} @gol
678 -mpower  -mno-power  -mpower2  -mno-power2 @gol
679 -mpowerpc  -mpowerpc64  -mno-powerpc @gol
680 -maltivec  -mno-altivec @gol
681 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
682 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
683 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb  -mfprnd  -mno-fprnd @gol
684 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mdfp -mno-dfp @gol
685 -mnew-mnemonics  -mold-mnemonics @gol
686 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
687 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
688 -malign-power  -malign-natural @gol
689 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
690 -mstring  -mno-string  -mupdate  -mno-update @gol
691 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
692 -mstrict-align  -mno-strict-align  -mrelocatable @gol
693 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
694 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
695 -mdynamic-no-pic  -maltivec  -mswdiv @gol
696 -mprioritize-restricted-insns=@var{priority} @gol
697 -msched-costly-dep=@var{dependence_type} @gol
698 -minsert-sched-nops=@var{scheme} @gol
699 -mcall-sysv  -mcall-netbsd @gol
700 -maix-struct-return  -msvr4-struct-return @gol
701 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
702 -misel -mno-isel @gol
703 -misel=yes  -misel=no @gol
704 -mspe -mno-spe @gol
705 -mspe=yes  -mspe=no @gol
706 -mvrsave -mno-vrsave @gol
707 -mmulhw -mno-mulhw @gol
708 -mdlmzb -mno-dlmzb @gol
709 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
710 -mprototype  -mno-prototype @gol
711 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
712 -msdata=@var{opt}  -mvxworks  -mwindiss  -G @var{num}  -pthread}
713
714 @emph{S/390 and zSeries Options}
715 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
716 -mhard-float  -msoft-float -mlong-double-64 -mlong-double-128 @gol
717 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
718 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
719 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
720 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
721 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard}
722
723 @emph{Score Options}
724 @gccoptlist{-meb -mel @gol
725 -mnhwloop @gol
726 -muls @gol
727 -mmac @gol
728 -mscore5 -mscore5u -mscore7 -mscore7d}
729
730 @emph{SH Options}
731 @gccoptlist{-m1  -m2  -m2e  -m3  -m3e @gol
732 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
733 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
734 -m5-64media  -m5-64media-nofpu @gol
735 -m5-32media  -m5-32media-nofpu @gol
736 -m5-compact  -m5-compact-nofpu @gol
737 -mb  -ml  -mdalign  -mrelax @gol
738 -mbigtable  -mfmovd  -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
739 -mieee  -misize  -minline-ic_invalidate -mpadstruct  -mspace @gol
740 -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
741 -mdivsi3_libfunc=@var{name}  @gol
742 -madjust-unroll -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
743  -minvalid-symbols}
744
745 @emph{SPARC Options}
746 @gccoptlist{-mcpu=@var{cpu-type} @gol
747 -mtune=@var{cpu-type} @gol
748 -mcmodel=@var{code-model} @gol
749 -m32  -m64  -mapp-regs  -mno-app-regs @gol
750 -mfaster-structs  -mno-faster-structs @gol
751 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
752 -mhard-quad-float  -msoft-quad-float @gol
753 -mimpure-text  -mno-impure-text  -mlittle-endian @gol
754 -mstack-bias  -mno-stack-bias @gol
755 -munaligned-doubles  -mno-unaligned-doubles @gol
756 -mv8plus  -mno-v8plus  -mvis  -mno-vis
757 -threads -pthreads -pthread}
758
759 @emph{SPU Options}
760 @gccoptlist{-mwarn-reloc -merror-reloc @gol
761 -msafe-dma -munsafe-dma @gol
762 -mbranch-hints @gol
763 -msmall-mem -mlarge-mem -mstdmain @gol
764 -mfixed-range=@var{register-range}}
765
766 @emph{System V Options}
767 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
768
769 @emph{TMS320C3x/C4x Options}
770 @gccoptlist{-mcpu=@var{cpu}  -mbig  -msmall  -mregparm  -mmemparm @gol
771 -mfast-fix  -mmpyi  -mbk  -mti  -mdp-isr-reload @gol
772 -mrpts=@var{count}  -mrptb  -mdb  -mloop-unsigned @gol
773 -mparallel-insns  -mparallel-mpy  -mpreserve-float}
774
775 @emph{V850 Options}
776 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
777 -mprolog-function  -mno-prolog-function  -mspace @gol
778 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
779 -mapp-regs  -mno-app-regs @gol
780 -mdisable-callt  -mno-disable-callt @gol
781 -mv850e1 @gol
782 -mv850e @gol
783 -mv850  -mbig-switch}
784
785 @emph{VAX Options}
786 @gccoptlist{-mg  -mgnu  -munix}
787
788 @emph{VxWorks Options}
789 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
790 -Xbind-lazy  -Xbind-now}
791
792 @emph{x86-64 Options}
793 See i386 and x86-64 Options.
794
795 @emph{Xstormy16 Options}
796 @gccoptlist{-msim}
797
798 @emph{Xtensa Options}
799 @gccoptlist{-mconst16 -mno-const16 @gol
800 -mfused-madd  -mno-fused-madd @gol
801 -mtext-section-literals  -mno-text-section-literals @gol
802 -mtarget-align  -mno-target-align @gol
803 -mlongcalls  -mno-longcalls}
804
805 @emph{zSeries Options}
806 See S/390 and zSeries Options.
807
808 @item Code Generation Options
809 @xref{Code Gen Options,,Options for Code Generation Conventions}.
810 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
811 -ffixed-@var{reg}  -fexceptions @gol
812 -fnon-call-exceptions  -funwind-tables @gol
813 -fasynchronous-unwind-tables @gol
814 -finhibit-size-directive  -finstrument-functions @gol
815 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
816 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol
817 -fno-common  -fno-ident @gol
818 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
819 -fno-jump-tables @gol
820 -frecord-gcc-switches @gol
821 -freg-struct-return  -fshort-enums @gol
822 -fshort-double  -fshort-wchar @gol
823 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
824 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
825 -fargument-alias  -fargument-noalias @gol
826 -fargument-noalias-global  -fargument-noalias-anything
827 -fleading-underscore  -ftls-model=@var{model} @gol
828 -ftrapv  -fwrapv  -fbounds-check @gol
829 -fvisibility}
830 @end table
831
832 @menu
833 * Overall Options::     Controlling the kind of output:
834                         an executable, object files, assembler files,
835                         or preprocessed source.
836 * C Dialect Options::   Controlling the variant of C language compiled.
837 * C++ Dialect Options:: Variations on C++.
838 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
839                         and Objective-C++.
840 * Language Independent Options:: Controlling how diagnostics should be
841                         formatted.
842 * Warning Options::     How picky should the compiler be?
843 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
844 * Optimize Options::    How much optimization?
845 * Preprocessor Options:: Controlling header files and macro definitions.
846                          Also, getting dependency information for Make.
847 * Assembler Options::   Passing options to the assembler.
848 * Link Options::        Specifying libraries and so on.
849 * Directory Options::   Where to find header files and libraries.
850                         Where to find the compiler executable files.
851 * Spec Files::          How to pass switches to sub-processes.
852 * Target Options::      Running a cross-compiler, or an old version of GCC.
853 @end menu
854
855 @node Overall Options
856 @section Options Controlling the Kind of Output
857
858 Compilation can involve up to four stages: preprocessing, compilation
859 proper, assembly and linking, always in that order.  GCC is capable of
860 preprocessing and compiling several files either into several
861 assembler input files, or into one assembler input file; then each
862 assembler input file produces an object file, and linking combines all
863 the object files (those newly compiled, and those specified as input)
864 into an executable file.
865
866 @cindex file name suffix
867 For any given input file, the file name suffix determines what kind of
868 compilation is done:
869
870 @table @gcctabopt
871 @item @var{file}.c
872 C source code which must be preprocessed.
873
874 @item @var{file}.i
875 C source code which should not be preprocessed.
876
877 @item @var{file}.ii
878 C++ source code which should not be preprocessed.
879
880 @item @var{file}.m
881 Objective-C source code.  Note that you must link with the @file{libobjc}
882 library to make an Objective-C program work.
883
884 @item @var{file}.mi
885 Objective-C source code which should not be preprocessed.
886
887 @item @var{file}.mm
888 @itemx @var{file}.M
889 Objective-C++ source code.  Note that you must link with the @file{libobjc}
890 library to make an Objective-C++ program work.  Note that @samp{.M} refers
891 to a literal capital M@.
892
893 @item @var{file}.mii
894 Objective-C++ source code which should not be preprocessed.
895
896 @item @var{file}.h
897 C, C++, Objective-C or Objective-C++ header file to be turned into a
898 precompiled header.
899
900 @item @var{file}.cc
901 @itemx @var{file}.cp
902 @itemx @var{file}.cxx
903 @itemx @var{file}.cpp
904 @itemx @var{file}.CPP
905 @itemx @var{file}.c++
906 @itemx @var{file}.C
907 C++ source code which must be preprocessed.  Note that in @samp{.cxx},
908 the last two letters must both be literally @samp{x}.  Likewise,
909 @samp{.C} refers to a literal capital C@.
910
911 @item @var{file}.mm
912 @itemx @var{file}.M
913 Objective-C++ source code which must be preprocessed.
914
915 @item @var{file}.mii
916 Objective-C++ source code which should not be preprocessed.
917
918 @item @var{file}.hh
919 @itemx @var{file}.H
920 @itemx @var{file}.hp
921 @itemx @var{file}.hxx
922 @itemx @var{file}.hpp
923 @itemx @var{file}.HPP
924 @itemx @var{file}.h++
925 @itemx @var{file}.tcc
926 C++ header file to be turned into a precompiled header.
927
928 @item @var{file}.f
929 @itemx @var{file}.for
930 @itemx @var{file}.FOR
931 Fixed form Fortran source code which should not be preprocessed.
932
933 @item @var{file}.F
934 @itemx @var{file}.fpp
935 @itemx @var{file}.FPP
936 Fixed form Fortran source code which must be preprocessed (with the traditional
937 preprocessor).
938
939 @item @var{file}.f90
940 @itemx @var{file}.f95
941 Free form Fortran source code which should not be preprocessed.
942
943 @item @var{file}.F90
944 @itemx @var{file}.F95
945 Free form Fortran source code which must be preprocessed (with the
946 traditional preprocessor).
947
948 @c FIXME: Descriptions of Java file types.
949 @c @var{file}.java
950 @c @var{file}.class
951 @c @var{file}.zip
952 @c @var{file}.jar
953
954 @item @var{file}.ads
955 Ada source code file which contains a library unit declaration (a
956 declaration of a package, subprogram, or generic, or a generic
957 instantiation), or a library unit renaming declaration (a package,
958 generic, or subprogram renaming declaration).  Such files are also
959 called @dfn{specs}.
960
961 @itemx @var{file}.adb
962 Ada source code file containing a library unit body (a subprogram or
963 package body).  Such files are also called @dfn{bodies}.
964
965 @c GCC also knows about some suffixes for languages not yet included:
966 @c Pascal:
967 @c @var{file}.p
968 @c @var{file}.pas
969 @c Ratfor:
970 @c @var{file}.r
971
972 @item @var{file}.s
973 Assembler code.
974
975 @item @var{file}.S
976 Assembler code which must be preprocessed.
977
978 @item @var{other}
979 An object file to be fed straight into linking.
980 Any file name with no recognized suffix is treated this way.
981 @end table
982
983 @opindex x
984 You can specify the input language explicitly with the @option{-x} option:
985
986 @table @gcctabopt
987 @item -x @var{language}
988 Specify explicitly the @var{language} for the following input files
989 (rather than letting the compiler choose a default based on the file
990 name suffix).  This option applies to all following input files until
991 the next @option{-x} option.  Possible values for @var{language} are:
992 @smallexample
993 c  c-header  c-cpp-output
994 c++  c++-header  c++-cpp-output
995 objective-c  objective-c-header  objective-c-cpp-output
996 objective-c++ objective-c++-header objective-c++-cpp-output
997 assembler  assembler-with-cpp
998 ada
999 f95  f95-cpp-input
1000 java
1001 treelang
1002 @end smallexample
1003
1004 @item -x none
1005 Turn off any specification of a language, so that subsequent files are
1006 handled according to their file name suffixes (as they are if @option{-x}
1007 has not been used at all).
1008
1009 @item -pass-exit-codes
1010 @opindex pass-exit-codes
1011 Normally the @command{gcc} program will exit with the code of 1 if any
1012 phase of the compiler returns a non-success return code.  If you specify
1013 @option{-pass-exit-codes}, the @command{gcc} program will instead return with
1014 numerically highest error produced by any phase that returned an error
1015 indication.  The C, C++, and Fortran frontends return 4, if an internal
1016 compiler error is encountered.
1017 @end table
1018
1019 If you only want some of the stages of compilation, you can use
1020 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1021 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1022 @command{gcc} is to stop.  Note that some combinations (for example,
1023 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1024
1025 @table @gcctabopt
1026 @item -c
1027 @opindex c
1028 Compile or assemble the source files, but do not link.  The linking
1029 stage simply is not done.  The ultimate output is in the form of an
1030 object file for each source file.
1031
1032 By default, the object file name for a source file is made by replacing
1033 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1034
1035 Unrecognized input files, not requiring compilation or assembly, are
1036 ignored.
1037
1038 @item -S
1039 @opindex S
1040 Stop after the stage of compilation proper; do not assemble.  The output
1041 is in the form of an assembler code file for each non-assembler input
1042 file specified.
1043
1044 By default, the assembler file name for a source file is made by
1045 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1046
1047 Input files that don't require compilation are ignored.
1048
1049 @item -E
1050 @opindex E
1051 Stop after the preprocessing stage; do not run the compiler proper.  The
1052 output is in the form of preprocessed source code, which is sent to the
1053 standard output.
1054
1055 Input files which don't require preprocessing are ignored.
1056
1057 @cindex output file option
1058 @item -o @var{file}
1059 @opindex o
1060 Place output in file @var{file}.  This applies regardless to whatever
1061 sort of output is being produced, whether it be an executable file,
1062 an object file, an assembler file or preprocessed C code.
1063
1064 If @option{-o} is not specified, the default is to put an executable
1065 file in @file{a.out}, the object file for
1066 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1067 assembler file in @file{@var{source}.s}, a precompiled header file in
1068 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1069 standard output.
1070
1071 @item -v
1072 @opindex v
1073 Print (on standard error output) the commands executed to run the stages
1074 of compilation.  Also print the version number of the compiler driver
1075 program and of the preprocessor and the compiler proper.
1076
1077 @item -###
1078 @opindex ###
1079 Like @option{-v} except the commands are not executed and all command
1080 arguments are quoted.  This is useful for shell scripts to capture the
1081 driver-generated command lines.
1082
1083 @item -pipe
1084 @opindex pipe
1085 Use pipes rather than temporary files for communication between the
1086 various stages of compilation.  This fails to work on some systems where
1087 the assembler is unable to read from a pipe; but the GNU assembler has
1088 no trouble.
1089
1090 @item -combine
1091 @opindex combine
1092 If you are compiling multiple source files, this option tells the driver
1093 to pass all the source files to the compiler at once (for those
1094 languages for which the compiler can handle this).  This will allow
1095 intermodule analysis (IMA) to be performed by the compiler.  Currently the only
1096 language for which this is supported is C@.  If you pass source files for
1097 multiple languages to the driver, using this option, the driver will invoke
1098 the compiler(s) that support IMA once each, passing each compiler all the
1099 source files appropriate for it.  For those languages that do not support
1100 IMA this option will be ignored, and the compiler will be invoked once for
1101 each source file in that language.  If you use this option in conjunction
1102 with @option{-save-temps}, the compiler will generate multiple
1103 pre-processed files
1104 (one for each source file), but only one (combined) @file{.o} or
1105 @file{.s} file.
1106
1107 @item --help
1108 @opindex help
1109 Print (on the standard output) a description of the command line options
1110 understood by @command{gcc}.  If the @option{-v} option is also specified
1111 then @option{--help} will also be passed on to the various processes
1112 invoked by @command{gcc}, so that they can display the command line options
1113 they accept.  If the @option{-Wextra} option has also been specified
1114 (prior to the @option{--help} option), then command line options which
1115 have no documentation associated with them will also be displayed.
1116
1117 @item --target-help
1118 @opindex target-help
1119 Print (on the standard output) a description of target-specific command
1120 line options for each tool.  For some targets extra target-specific
1121 information may also be printed.
1122
1123 @item --help=@var{class}@r{[},@var{qualifier}@r{]}
1124 Print (on the standard output) a description of the command line
1125 options understood by the compiler that fit into a specific class.
1126 The class can be one of @samp{optimizers}, @samp{warnings}, @samp{target},
1127 @samp{params}, or @var{language}:
1128
1129 @table @asis
1130 @item @samp{optimizers}
1131 This will display all of the optimization options supported by the
1132 compiler.
1133
1134 @item @samp{warnings}
1135 This will display all of the options controlling warning messages
1136 produced by the compiler.
1137
1138 @item @samp{target}
1139 This will display target-specific options.  Unlike the
1140 @option{--target-help} option however, target-specific options of the
1141 linker and assembler will not be displayed.  This is because those
1142 tools do not currently support the extended @option{--help=} syntax.
1143
1144 @item @samp{params}
1145 This will display the values recognized by the @option{--param}
1146 option.
1147
1148 @item @var{language}
1149 This will display the options supported for @var{language}, where 
1150 @var{language} is the name of one of the languages supported in this 
1151 version of GCC.
1152
1153 @item @samp{common}
1154 This will display the options that are common to all languages.
1155 @end table
1156
1157 It is possible to further refine the output of the @option{--help=}
1158 option by adding a comma separated list of qualifiers after the
1159 class.  These can be any from the following list:
1160
1161 @table @asis
1162 @item @samp{undocumented}
1163 Display only those options which are undocumented.
1164
1165 @item @samp{joined}
1166 Display options which take an argument that appears after an equal
1167 sign in the same continuous piece of text, such as:
1168 @samp{--help=target}.
1169
1170 @item @samp{separate}
1171 Display options which take an argument that appears as a separate word
1172 following the original option, such as: @samp{-o output-file}.
1173 @end table
1174
1175 Thus for example to display all the undocumented target-specific
1176 switches supported by the compiler the following can be used:
1177
1178 @smallexample
1179 --help=target,undocumented
1180 @end smallexample
1181
1182 The sense of a qualifier can be inverted by prefixing it with the
1183 @var{^} character, so for example to display all binary warning
1184 options (i.e. ones that are either on or off and that do not take an
1185 argument), which have a description the following can be used:
1186
1187 @smallexample
1188 --help=warnings,^joined,^undocumented
1189 @end smallexample
1190
1191 A class can also be used as a qualifier, although this usually
1192 restricts the output by so much that there is nothing to display.  One
1193 case where it does work however is when one of the classes is
1194 @var{target}.  So for example to display all the target-specific
1195 optimization options the following can be used:
1196
1197 @smallexample
1198 --help=target,optimizers
1199 @end smallexample
1200
1201 The @option{--help=} option can be repeated on the command line.  Each
1202 successive use will display its requested class of options, skipping
1203 those that have already been displayed.
1204
1205 If the @option{-Q} option appears on the command line before the
1206 @option{--help=} option, then the descriptive text displayed by
1207 @option{--help=} is changed.  Instead of describing the displayed
1208 options, an indication is given as to whether the option is enabled,
1209 disabled or set to a specific value (assuming that the compiler
1210 knows this at the point where the @option{--help=} option is used).
1211
1212 Here is a truncated example from the ARM port of @command{gcc}:
1213
1214 @smallexample
1215   % gcc -Q -mabi=2 --help=target -c
1216   The following options are target specific:
1217   -mabi=                                2
1218   -mabort-on-noreturn                   [disabled]
1219   -mapcs                                [disabled]
1220 @end smallexample
1221
1222 The output is sensitive to the effects of previous command line
1223 options, so for example it is possible to find out which optimizations
1224 are enabled at @option{-O2} by using:
1225
1226 @smallexample
1227 -O2 --help=optimizers
1228 @end smallexample
1229
1230 Alternatively you can discover which binary optimizations are enabled
1231 by @option{-O3} by using:
1232
1233 @smallexample
1234 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1235 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1236 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1237 @end smallexample
1238
1239 @item --version
1240 @opindex version
1241 Display the version number and copyrights of the invoked GCC@.
1242
1243 @include @value{srcdir}/../libiberty/at-file.texi
1244 @end table
1245
1246 @node Invoking G++
1247 @section Compiling C++ Programs
1248
1249 @cindex suffixes for C++ source
1250 @cindex C++ source file suffixes
1251 C++ source files conventionally use one of the suffixes @samp{.C},
1252 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1253 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1254 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1255 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1256 files with these names and compiles them as C++ programs even if you
1257 call the compiler the same way as for compiling C programs (usually
1258 with the name @command{gcc}).
1259
1260 @findex g++
1261 @findex c++
1262 However, the use of @command{gcc} does not add the C++ library.
1263 @command{g++} is a program that calls GCC and treats @samp{.c},
1264 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1265 files unless @option{-x} is used, and automatically specifies linking
1266 against the C++ library.  This program is also useful when
1267 precompiling a C header file with a @samp{.h} extension for use in C++
1268 compilations.  On many systems, @command{g++} is also installed with
1269 the name @command{c++}.
1270
1271 @cindex invoking @command{g++}
1272 When you compile C++ programs, you may specify many of the same
1273 command-line options that you use for compiling programs in any
1274 language; or command-line options meaningful for C and related
1275 languages; or options that are meaningful only for C++ programs.
1276 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1277 explanations of options for languages related to C@.
1278 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1279 explanations of options that are meaningful only for C++ programs.
1280
1281 @node C Dialect Options
1282 @section Options Controlling C Dialect
1283 @cindex dialect options
1284 @cindex language dialect options
1285 @cindex options, dialect
1286
1287 The following options control the dialect of C (or languages derived
1288 from C, such as C++, Objective-C and Objective-C++) that the compiler
1289 accepts:
1290
1291 @table @gcctabopt
1292 @cindex ANSI support
1293 @cindex ISO support
1294 @item -ansi
1295 @opindex ansi
1296 In C mode, support all ISO C90 programs.  In C++ mode,
1297 remove GNU extensions that conflict with ISO C++.
1298
1299 This turns off certain features of GCC that are incompatible with ISO
1300 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1301 such as the @code{asm} and @code{typeof} keywords, and
1302 predefined macros such as @code{unix} and @code{vax} that identify the
1303 type of system you are using.  It also enables the undesirable and
1304 rarely used ISO trigraph feature.  For the C compiler,
1305 it disables recognition of C++ style @samp{//} comments as well as
1306 the @code{inline} keyword.
1307
1308 The alternate keywords @code{__asm__}, @code{__extension__},
1309 @code{__inline__} and @code{__typeof__} continue to work despite
1310 @option{-ansi}.  You would not want to use them in an ISO C program, of
1311 course, but it is useful to put them in header files that might be included
1312 in compilations done with @option{-ansi}.  Alternate predefined macros
1313 such as @code{__unix__} and @code{__vax__} are also available, with or
1314 without @option{-ansi}.
1315
1316 The @option{-ansi} option does not cause non-ISO programs to be
1317 rejected gratuitously.  For that, @option{-pedantic} is required in
1318 addition to @option{-ansi}.  @xref{Warning Options}.
1319
1320 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1321 option is used.  Some header files may notice this macro and refrain
1322 from declaring certain functions or defining certain macros that the
1323 ISO standard doesn't call for; this is to avoid interfering with any
1324 programs that might use these names for other things.
1325
1326 Functions which would normally be built in but do not have semantics
1327 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1328 functions with @option{-ansi} is used.  @xref{Other Builtins,,Other
1329 built-in functions provided by GCC}, for details of the functions
1330 affected.
1331
1332 @item -std=
1333 @opindex std
1334 Determine the language standard.  This option is currently only
1335 supported when compiling C or C++.  A value for this option must be
1336 provided; possible values are
1337
1338 @table @samp
1339 @item c89
1340 @itemx iso9899:1990
1341 ISO C90 (same as @option{-ansi}).
1342
1343 @item iso9899:199409
1344 ISO C90 as modified in amendment 1.
1345
1346 @item c99
1347 @itemx c9x
1348 @itemx iso9899:1999
1349 @itemx iso9899:199x
1350 ISO C99.  Note that this standard is not yet fully supported; see
1351 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1352 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1353
1354 @item gnu89
1355 Default, ISO C90 plus GNU extensions (including some C99 features).
1356
1357 @item gnu99
1358 @itemx gnu9x
1359 ISO C99 plus GNU extensions.  When ISO C99 is fully implemented in GCC,
1360 this will become the default.  The name @samp{gnu9x} is deprecated.
1361
1362 @item c++98
1363 The 1998 ISO C++ standard plus amendments.
1364
1365 @item gnu++98
1366 The same as @option{-std=c++98} plus GNU extensions.  This is the
1367 default for C++ code.
1368
1369 @item c++0x
1370 The working draft of the upcoming ISO C++0x standard. This option
1371 enables experimental features that are likely to be included in
1372 C++0x. The working draft is constantly changing, and any feature that is
1373 enabled by this flag may be removed from future versions of GCC if it is
1374 not part of the C++0x standard.
1375
1376 @item gnu++0x
1377 The same as @option{-std=c++0x} plus GNU extensions. As with
1378 @option{-std=c++0x}, this option enables experimental features that may
1379 be removed in future versions of GCC.
1380 @end table
1381
1382 Even when this option is not specified, you can still use some of the
1383 features of newer standards in so far as they do not conflict with
1384 previous C standards.  For example, you may use @code{__restrict__} even
1385 when @option{-std=c99} is not specified.
1386
1387 The @option{-std} options specifying some version of ISO C have the same
1388 effects as @option{-ansi}, except that features that were not in ISO C90
1389 but are in the specified version (for example, @samp{//} comments and
1390 the @code{inline} keyword in ISO C99) are not disabled.
1391
1392 @xref{Standards,,Language Standards Supported by GCC}, for details of
1393 these standard versions.
1394
1395 @item -fgnu89-inline
1396 @opindex fgnu89-inline
1397 The option @option{-fgnu89-inline} tells GCC to use the traditional
1398 GNU semantics for @code{inline} functions when in C99 mode.
1399 @xref{Inline,,An Inline Function is As Fast As a Macro}.  This option
1400 is accepted and ignored by GCC versions 4.1.3 up to but not including
1401 4.3.  In GCC versions 4.3 and later it changes the behavior of GCC in
1402 C99 mode.  Using this option is roughly equivalent to adding the
1403 @code{gnu_inline} function attribute to all inline functions
1404 (@pxref{Function Attributes}).
1405
1406 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1407 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1408 specifies the default behavior).  This option was first supported in
1409 GCC 4.3.  This option is not supported in C89 or gnu89 mode.
1410
1411 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1412 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1413 in effect for @code{inline} functions.  @xref{Common Predefined
1414 Macros,,,cpp,The C Preprocessor}.
1415
1416 @item -aux-info @var{filename}
1417 @opindex aux-info
1418 Output to the given filename prototyped declarations for all functions
1419 declared and/or defined in a translation unit, including those in header
1420 files.  This option is silently ignored in any language other than C@.
1421
1422 Besides declarations, the file indicates, in comments, the origin of
1423 each declaration (source file and line), whether the declaration was
1424 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1425 @samp{O} for old, respectively, in the first character after the line
1426 number and the colon), and whether it came from a declaration or a
1427 definition (@samp{C} or @samp{F}, respectively, in the following
1428 character).  In the case of function definitions, a K&R-style list of
1429 arguments followed by their declarations is also provided, inside
1430 comments, after the declaration.
1431
1432 @item -fno-asm
1433 @opindex fno-asm
1434 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1435 keyword, so that code can use these words as identifiers.  You can use
1436 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1437 instead.  @option{-ansi} implies @option{-fno-asm}.
1438
1439 In C++, this switch only affects the @code{typeof} keyword, since
1440 @code{asm} and @code{inline} are standard keywords.  You may want to
1441 use the @option{-fno-gnu-keywords} flag instead, which has the same
1442 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1443 switch only affects the @code{asm} and @code{typeof} keywords, since
1444 @code{inline} is a standard keyword in ISO C99.
1445
1446 @item -fno-builtin
1447 @itemx -fno-builtin-@var{function}
1448 @opindex fno-builtin
1449 @cindex built-in functions
1450 Don't recognize built-in functions that do not begin with
1451 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1452 functions provided by GCC}, for details of the functions affected,
1453 including those which are not built-in functions when @option{-ansi} or
1454 @option{-std} options for strict ISO C conformance are used because they
1455 do not have an ISO standard meaning.
1456
1457 GCC normally generates special code to handle certain built-in functions
1458 more efficiently; for instance, calls to @code{alloca} may become single
1459 instructions that adjust the stack directly, and calls to @code{memcpy}
1460 may become inline copy loops.  The resulting code is often both smaller
1461 and faster, but since the function calls no longer appear as such, you
1462 cannot set a breakpoint on those calls, nor can you change the behavior
1463 of the functions by linking with a different library.  In addition,
1464 when a function is recognized as a built-in function, GCC may use
1465 information about that function to warn about problems with calls to
1466 that function, or to generate more efficient code, even if the
1467 resulting code still contains calls to that function.  For example,
1468 warnings are given with @option{-Wformat} for bad calls to
1469 @code{printf}, when @code{printf} is built in, and @code{strlen} is
1470 known not to modify global memory.
1471
1472 With the @option{-fno-builtin-@var{function}} option
1473 only the built-in function @var{function} is
1474 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1475 function is named this is not built-in in this version of GCC, this
1476 option is ignored.  There is no corresponding
1477 @option{-fbuiltin-@var{function}} option; if you wish to enable
1478 built-in functions selectively when using @option{-fno-builtin} or
1479 @option{-ffreestanding}, you may define macros such as:
1480
1481 @smallexample
1482 #define abs(n)          __builtin_abs ((n))
1483 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1484 @end smallexample
1485
1486 @item -fhosted
1487 @opindex fhosted
1488 @cindex hosted environment
1489
1490 Assert that compilation takes place in a hosted environment.  This implies
1491 @option{-fbuiltin}.  A hosted environment is one in which the
1492 entire standard library is available, and in which @code{main} has a return
1493 type of @code{int}.  Examples are nearly everything except a kernel.
1494 This is equivalent to @option{-fno-freestanding}.
1495
1496 @item -ffreestanding
1497 @opindex ffreestanding
1498 @cindex hosted environment
1499
1500 Assert that compilation takes place in a freestanding environment.  This
1501 implies @option{-fno-builtin}.  A freestanding environment
1502 is one in which the standard library may not exist, and program startup may
1503 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1504 This is equivalent to @option{-fno-hosted}.
1505
1506 @xref{Standards,,Language Standards Supported by GCC}, for details of
1507 freestanding and hosted environments.
1508
1509 @item -fopenmp
1510 @opindex fopenmp
1511 @cindex openmp parallel
1512 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1513 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1514 compiler generates parallel code according to the OpenMP Application
1515 Program Interface v2.5 @w{@uref{http://www.openmp.org/}}.
1516
1517 @item -fms-extensions
1518 @opindex fms-extensions
1519 Accept some non-standard constructs used in Microsoft header files.
1520
1521 Some cases of unnamed fields in structures and unions are only
1522 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1523 fields within structs/unions}, for details.
1524
1525 @item -trigraphs
1526 @opindex trigraphs
1527 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1528 options for strict ISO C conformance) implies @option{-trigraphs}.
1529
1530 @item -no-integrated-cpp
1531 @opindex no-integrated-cpp
1532 Performs a compilation in two passes: preprocessing and compiling.  This
1533 option allows a user supplied "cc1", "cc1plus", or "cc1obj" via the
1534 @option{-B} option.  The user supplied compilation step can then add in
1535 an additional preprocessing step after normal preprocessing but before
1536 compiling.  The default is to use the integrated cpp (internal cpp)
1537
1538 The semantics of this option will change if "cc1", "cc1plus", and
1539 "cc1obj" are merged.
1540
1541 @cindex traditional C language
1542 @cindex C language, traditional
1543 @item -traditional
1544 @itemx -traditional-cpp
1545 @opindex traditional-cpp
1546 @opindex traditional
1547 Formerly, these options caused GCC to attempt to emulate a pre-standard
1548 C compiler.  They are now only supported with the @option{-E} switch.
1549 The preprocessor continues to support a pre-standard mode.  See the GNU
1550 CPP manual for details.
1551
1552 @item -fcond-mismatch
1553 @opindex fcond-mismatch
1554 Allow conditional expressions with mismatched types in the second and
1555 third arguments.  The value of such an expression is void.  This option
1556 is not supported for C++.
1557
1558 @item -flax-vector-conversions
1559 @opindex flax-vector-conversions
1560 Allow implicit conversions between vectors with differing numbers of
1561 elements and/or incompatible element types.  This option should not be
1562 used for new code.
1563
1564 @item -funsigned-char
1565 @opindex funsigned-char
1566 Let the type @code{char} be unsigned, like @code{unsigned char}.
1567
1568 Each kind of machine has a default for what @code{char} should
1569 be.  It is either like @code{unsigned char} by default or like
1570 @code{signed char} by default.
1571
1572 Ideally, a portable program should always use @code{signed char} or
1573 @code{unsigned char} when it depends on the signedness of an object.
1574 But many programs have been written to use plain @code{char} and
1575 expect it to be signed, or expect it to be unsigned, depending on the
1576 machines they were written for.  This option, and its inverse, let you
1577 make such a program work with the opposite default.
1578
1579 The type @code{char} is always a distinct type from each of
1580 @code{signed char} or @code{unsigned char}, even though its behavior
1581 is always just like one of those two.
1582
1583 @item -fsigned-char
1584 @opindex fsigned-char
1585 Let the type @code{char} be signed, like @code{signed char}.
1586
1587 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1588 the negative form of @option{-funsigned-char}.  Likewise, the option
1589 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1590
1591 @item -fsigned-bitfields
1592 @itemx -funsigned-bitfields
1593 @itemx -fno-signed-bitfields
1594 @itemx -fno-unsigned-bitfields
1595 @opindex fsigned-bitfields
1596 @opindex funsigned-bitfields
1597 @opindex fno-signed-bitfields
1598 @opindex fno-unsigned-bitfields
1599 These options control whether a bit-field is signed or unsigned, when the
1600 declaration does not use either @code{signed} or @code{unsigned}.  By
1601 default, such a bit-field is signed, because this is consistent: the
1602 basic integer types such as @code{int} are signed types.
1603 @end table
1604
1605 @node C++ Dialect Options
1606 @section Options Controlling C++ Dialect
1607
1608 @cindex compiler options, C++
1609 @cindex C++ options, command line
1610 @cindex options, C++
1611 This section describes the command-line options that are only meaningful
1612 for C++ programs; but you can also use most of the GNU compiler options
1613 regardless of what language your program is in.  For example, you
1614 might compile a file @code{firstClass.C} like this:
1615
1616 @smallexample
1617 g++ -g -frepo -O -c firstClass.C
1618 @end smallexample
1619
1620 @noindent
1621 In this example, only @option{-frepo} is an option meant
1622 only for C++ programs; you can use the other options with any
1623 language supported by GCC@.
1624
1625 Here is a list of options that are @emph{only} for compiling C++ programs:
1626
1627 @table @gcctabopt
1628
1629 @item -fabi-version=@var{n}
1630 @opindex fabi-version
1631 Use version @var{n} of the C++ ABI@.  Version 2 is the version of the
1632 C++ ABI that first appeared in G++ 3.4.  Version 1 is the version of
1633 the C++ ABI that first appeared in G++ 3.2.  Version 0 will always be
1634 the version that conforms most closely to the C++ ABI specification.
1635 Therefore, the ABI obtained using version 0 will change as ABI bugs
1636 are fixed.
1637
1638 The default is version 2.
1639
1640 @item -fno-access-control
1641 @opindex fno-access-control
1642 Turn off all access checking.  This switch is mainly useful for working
1643 around bugs in the access control code.
1644
1645 @item -fcheck-new
1646 @opindex fcheck-new
1647 Check that the pointer returned by @code{operator new} is non-null
1648 before attempting to modify the storage allocated.  This check is
1649 normally unnecessary because the C++ standard specifies that
1650 @code{operator new} will only return @code{0} if it is declared
1651 @samp{throw()}, in which case the compiler will always check the
1652 return value even without this option.  In all other cases, when
1653 @code{operator new} has a non-empty exception specification, memory
1654 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
1655 @samp{new (nothrow)}.
1656
1657 @item -fconserve-space
1658 @opindex fconserve-space
1659 Put uninitialized or runtime-initialized global variables into the
1660 common segment, as C does.  This saves space in the executable at the
1661 cost of not diagnosing duplicate definitions.  If you compile with this
1662 flag and your program mysteriously crashes after @code{main()} has
1663 completed, you may have an object that is being destroyed twice because
1664 two definitions were merged.
1665
1666 This option is no longer useful on most targets, now that support has
1667 been added for putting variables into BSS without making them common.
1668
1669 @item -ffriend-injection
1670 @opindex ffriend-injection
1671 Inject friend functions into the enclosing namespace, so that they are
1672 visible outside the scope of the class in which they are declared.
1673 Friend functions were documented to work this way in the old Annotated
1674 C++ Reference Manual, and versions of G++ before 4.1 always worked
1675 that way.  However, in ISO C++ a friend function which is not declared
1676 in an enclosing scope can only be found using argument dependent
1677 lookup.  This option causes friends to be injected as they were in
1678 earlier releases.
1679
1680 This option is for compatibility, and may be removed in a future
1681 release of G++.
1682
1683 @item -fno-elide-constructors
1684 @opindex fno-elide-constructors
1685 The C++ standard allows an implementation to omit creating a temporary
1686 which is only used to initialize another object of the same type.
1687 Specifying this option disables that optimization, and forces G++ to
1688 call the copy constructor in all cases.
1689
1690 @item -fno-enforce-eh-specs
1691 @opindex fno-enforce-eh-specs
1692 Don't generate code to check for violation of exception specifications
1693 at runtime.  This option violates the C++ standard, but may be useful
1694 for reducing code size in production builds, much like defining
1695 @samp{NDEBUG}.  This does not give user code permission to throw
1696 exceptions in violation of the exception specifications; the compiler
1697 will still optimize based on the specifications, so throwing an
1698 unexpected exception will result in undefined behavior.
1699
1700 @item -ffor-scope
1701 @itemx -fno-for-scope
1702 @opindex ffor-scope
1703 @opindex fno-for-scope
1704 If @option{-ffor-scope} is specified, the scope of variables declared in
1705 a @i{for-init-statement} is limited to the @samp{for} loop itself,
1706 as specified by the C++ standard.
1707 If @option{-fno-for-scope} is specified, the scope of variables declared in
1708 a @i{for-init-statement} extends to the end of the enclosing scope,
1709 as was the case in old versions of G++, and other (traditional)
1710 implementations of C++.
1711
1712 The default if neither flag is given to follow the standard,
1713 but to allow and give a warning for old-style code that would
1714 otherwise be invalid, or have different behavior.
1715
1716 @item -fno-gnu-keywords
1717 @opindex fno-gnu-keywords
1718 Do not recognize @code{typeof} as a keyword, so that code can use this
1719 word as an identifier.  You can use the keyword @code{__typeof__} instead.
1720 @option{-ansi} implies @option{-fno-gnu-keywords}.
1721
1722 @item -fno-implicit-templates
1723 @opindex fno-implicit-templates
1724 Never emit code for non-inline templates which are instantiated
1725 implicitly (i.e.@: by use); only emit code for explicit instantiations.
1726 @xref{Template Instantiation}, for more information.
1727
1728 @item -fno-implicit-inline-templates
1729 @opindex fno-implicit-inline-templates
1730 Don't emit code for implicit instantiations of inline templates, either.
1731 The default is to handle inlines differently so that compiles with and
1732 without optimization will need the same set of explicit instantiations.
1733
1734 @item -fno-implement-inlines
1735 @opindex fno-implement-inlines
1736 To save space, do not emit out-of-line copies of inline functions
1737 controlled by @samp{#pragma implementation}.  This will cause linker
1738 errors if these functions are not inlined everywhere they are called.
1739
1740 @item -fms-extensions
1741 @opindex fms-extensions
1742 Disable pedantic warnings about constructs used in MFC, such as implicit
1743 int and getting a pointer to member function via non-standard syntax.
1744
1745 @item -fno-nonansi-builtins
1746 @opindex fno-nonansi-builtins
1747 Disable built-in declarations of functions that are not mandated by
1748 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
1749 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
1750
1751 @item -fno-operator-names
1752 @opindex fno-operator-names
1753 Do not treat the operator name keywords @code{and}, @code{bitand},
1754 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
1755 synonyms as keywords.
1756
1757 @item -fno-optional-diags
1758 @opindex fno-optional-diags
1759 Disable diagnostics that the standard says a compiler does not need to
1760 issue.  Currently, the only such diagnostic issued by G++ is the one for
1761 a name having multiple meanings within a class.
1762
1763 @item -fpermissive
1764 @opindex fpermissive
1765 Downgrade some diagnostics about nonconformant code from errors to
1766 warnings.  Thus, using @option{-fpermissive} will allow some
1767 nonconforming code to compile.
1768
1769 @item -frepo
1770 @opindex frepo
1771 Enable automatic template instantiation at link time.  This option also
1772 implies @option{-fno-implicit-templates}.  @xref{Template
1773 Instantiation}, for more information.
1774
1775 @item -fno-rtti
1776 @opindex fno-rtti
1777 Disable generation of information about every class with virtual
1778 functions for use by the C++ runtime type identification features
1779 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
1780 of the language, you can save some space by using this flag.  Note that
1781 exception handling uses the same information, but it will generate it as
1782 needed. The @samp{dynamic_cast} operator can still be used for casts that
1783 do not require runtime type information, i.e. casts to @code{void *} or to
1784 unambiguous base classes.
1785
1786 @item -fstats
1787 @opindex fstats
1788 Emit statistics about front-end processing at the end of the compilation.
1789 This information is generally only useful to the G++ development team.
1790
1791 @item -ftemplate-depth-@var{n}
1792 @opindex ftemplate-depth
1793 Set the maximum instantiation depth for template classes to @var{n}.
1794 A limit on the template instantiation depth is needed to detect
1795 endless recursions during template class instantiation.  ANSI/ISO C++
1796 conforming programs must not rely on a maximum depth greater than 17.
1797
1798 @item -fno-threadsafe-statics
1799 @opindex fno-threadsafe-statics
1800 Do not emit the extra code to use the routines specified in the C++
1801 ABI for thread-safe initialization of local statics.  You can use this
1802 option to reduce code size slightly in code that doesn't need to be
1803 thread-safe.
1804
1805 @item -fuse-cxa-atexit
1806 @opindex fuse-cxa-atexit
1807 Register destructors for objects with static storage duration with the
1808 @code{__cxa_atexit} function rather than the @code{atexit} function.
1809 This option is required for fully standards-compliant handling of static
1810 destructors, but will only work if your C library supports
1811 @code{__cxa_atexit}.
1812
1813 @item -fno-use-cxa-get-exception-ptr
1814 @opindex fno-use-cxa-get-exception-ptr
1815 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
1816 will cause @code{std::uncaught_exception} to be incorrect, but is necessary
1817 if the runtime routine is not available.
1818
1819 @item -fvisibility-inlines-hidden
1820 @opindex fvisibility-inlines-hidden
1821 This switch declares that the user does not attempt to compare
1822 pointers to inline methods where the addresses of the two functions
1823 were taken in different shared objects.
1824
1825 The effect of this is that GCC may, effectively, mark inline methods with
1826 @code{__attribute__ ((visibility ("hidden")))} so that they do not
1827 appear in the export table of a DSO and do not require a PLT indirection
1828 when used within the DSO@.  Enabling this option can have a dramatic effect
1829 on load and link times of a DSO as it massively reduces the size of the
1830 dynamic export table when the library makes heavy use of templates.
1831
1832 The behavior of this switch is not quite the same as marking the
1833 methods as hidden directly, because it does not affect static variables
1834 local to the function or cause the compiler to deduce that
1835 the function is defined in only one shared object.
1836
1837 You may mark a method as having a visibility explicitly to negate the
1838 effect of the switch for that method.  For example, if you do want to
1839 compare pointers to a particular inline method, you might mark it as
1840 having default visibility.  Marking the enclosing class with explicit
1841 visibility will have no effect.
1842
1843 Explicitly instantiated inline methods are unaffected by this option
1844 as their linkage might otherwise cross a shared library boundary.
1845 @xref{Template Instantiation}.
1846
1847 @item -fvisibility-ms-compat
1848 @opindex fvisibility-ms-compat
1849 This flag attempts to use visibility settings to make GCC's C++
1850 linkage model compatible with that of Microsoft Visual Studio.
1851
1852 The flag makes these changes to GCC's linkage model:
1853
1854 @enumerate
1855 @item
1856 It sets the default visibility to @code{hidden}, like
1857 @option{-fvisibility=hidden}.
1858
1859 @item
1860 Types, but not their members, are not hidden by default.
1861
1862 @item
1863 The One Definition Rule is relaxed for types without explicit
1864 visibility specifications which are defined in more than one different
1865 shared object: those declarations are permitted if they would have
1866 been permitted when this option was not used.
1867 @end enumerate
1868
1869 In new code it is better to use @option{-fvisibility=hidden} and
1870 export those classes which are intended to be externally visible.
1871 Unfortunately it is possible for code to rely, perhaps accidentally,
1872 on the Visual Studio behavior.
1873
1874 Among the consequences of these changes are that static data members
1875 of the same type with the same name but defined in different shared
1876 objects will be different, so changing one will not change the other;
1877 and that pointers to function members defined in different shared
1878 objects may not compare equal.  When this flag is given, it is a
1879 violation of the ODR to define types with the same name differently.
1880
1881 @item -fno-weak
1882 @opindex fno-weak
1883 Do not use weak symbol support, even if it is provided by the linker.
1884 By default, G++ will use weak symbols if they are available.  This
1885 option exists only for testing, and should not be used by end-users;
1886 it will result in inferior code and has no benefits.  This option may
1887 be removed in a future release of G++.
1888
1889 @item -nostdinc++
1890 @opindex nostdinc++
1891 Do not search for header files in the standard directories specific to
1892 C++, but do still search the other standard directories.  (This option
1893 is used when building the C++ library.)
1894 @end table
1895
1896 In addition, these optimization, warning, and code generation options
1897 have meanings only for C++ programs:
1898
1899 @table @gcctabopt
1900 @item -fno-default-inline
1901 @opindex fno-default-inline
1902 Do not assume @samp{inline} for functions defined inside a class scope.
1903 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
1904 functions will have linkage like inline functions; they just won't be
1905 inlined by default.
1906
1907 @item -Wabi @r{(C++ only)}
1908 @opindex Wabi
1909 Warn when G++ generates code that is probably not compatible with the
1910 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
1911 all such cases, there are probably some cases that are not warned about,
1912 even though G++ is generating incompatible code.  There may also be
1913 cases where warnings are emitted even though the code that is generated
1914 will be compatible.
1915
1916 You should rewrite your code to avoid these warnings if you are
1917 concerned about the fact that code generated by G++ may not be binary
1918 compatible with code generated by other compilers.
1919
1920 The known incompatibilities at this point include:
1921
1922 @itemize @bullet
1923
1924 @item
1925 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
1926 pack data into the same byte as a base class.  For example:
1927
1928 @smallexample
1929 struct A @{ virtual void f(); int f1 : 1; @};
1930 struct B : public A @{ int f2 : 1; @};
1931 @end smallexample
1932
1933 @noindent
1934 In this case, G++ will place @code{B::f2} into the same byte
1935 as@code{A::f1}; other compilers will not.  You can avoid this problem
1936 by explicitly padding @code{A} so that its size is a multiple of the
1937 byte size on your platform; that will cause G++ and other compilers to
1938 layout @code{B} identically.
1939
1940 @item
1941 Incorrect handling of tail-padding for virtual bases.  G++ does not use
1942 tail padding when laying out virtual bases.  For example:
1943
1944 @smallexample
1945 struct A @{ virtual void f(); char c1; @};
1946 struct B @{ B(); char c2; @};
1947 struct C : public A, public virtual B @{@};
1948 @end smallexample
1949
1950 @noindent
1951 In this case, G++ will not place @code{B} into the tail-padding for
1952 @code{A}; other compilers will.  You can avoid this problem by
1953 explicitly padding @code{A} so that its size is a multiple of its
1954 alignment (ignoring virtual base classes); that will cause G++ and other
1955 compilers to layout @code{C} identically.
1956
1957 @item
1958 Incorrect handling of bit-fields with declared widths greater than that
1959 of their underlying types, when the bit-fields appear in a union.  For
1960 example:
1961
1962 @smallexample
1963 union U @{ int i : 4096; @};
1964 @end smallexample
1965
1966 @noindent
1967 Assuming that an @code{int} does not have 4096 bits, G++ will make the
1968 union too small by the number of bits in an @code{int}.
1969
1970 @item
1971 Empty classes can be placed at incorrect offsets.  For example:
1972
1973 @smallexample
1974 struct A @{@};
1975
1976 struct B @{
1977   A a;
1978   virtual void f ();
1979 @};
1980
1981 struct C : public B, public A @{@};
1982 @end smallexample
1983
1984 @noindent
1985 G++ will place the @code{A} base class of @code{C} at a nonzero offset;
1986 it should be placed at offset zero.  G++ mistakenly believes that the
1987 @code{A} data member of @code{B} is already at offset zero.
1988
1989 @item
1990 Names of template functions whose types involve @code{typename} or
1991 template template parameters can be mangled incorrectly.
1992
1993 @smallexample
1994 template <typename Q>
1995 void f(typename Q::X) @{@}
1996
1997 template <template <typename> class Q>
1998 void f(typename Q<int>::X) @{@}
1999 @end smallexample
2000
2001 @noindent
2002 Instantiations of these templates may be mangled incorrectly.
2003
2004 @end itemize
2005
2006 @item -Wctor-dtor-privacy @r{(C++ only)}
2007 @opindex Wctor-dtor-privacy
2008 Warn when a class seems unusable because all the constructors or
2009 destructors in that class are private, and it has neither friends nor
2010 public static member functions.
2011
2012 @item -Wnon-virtual-dtor @r{(C++ only)}
2013 @opindex Wnon-virtual-dtor
2014 Warn when a class appears to be polymorphic, thereby requiring a virtual
2015 destructor, yet it declares a non-virtual one.  This warning is also
2016 enabled if -Weffc++ is specified.
2017
2018 @item -Wreorder @r{(C++ only)}
2019 @opindex Wreorder
2020 @cindex reordering, warning
2021 @cindex warning for reordering of member initializers
2022 Warn when the order of member initializers given in the code does not
2023 match the order in which they must be executed.  For instance:
2024
2025 @smallexample
2026 struct A @{
2027   int i;
2028   int j;
2029   A(): j (0), i (1) @{ @}
2030 @};
2031 @end smallexample
2032
2033 The compiler will rearrange the member initializers for @samp{i}
2034 and @samp{j} to match the declaration order of the members, emitting
2035 a warning to that effect.  This warning is enabled by @option{-Wall}.
2036 @end table
2037
2038 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
2039
2040 @table @gcctabopt
2041 @item -Weffc++ @r{(C++ only)}
2042 @opindex Weffc++
2043 Warn about violations of the following style guidelines from Scott Meyers'
2044 @cite{Effective C++} book:
2045
2046 @itemize @bullet
2047 @item
2048 Item 11:  Define a copy constructor and an assignment operator for classes
2049 with dynamically allocated memory.
2050
2051 @item
2052 Item 12:  Prefer initialization to assignment in constructors.
2053
2054 @item
2055 Item 14:  Make destructors virtual in base classes.
2056
2057 @item
2058 Item 15:  Have @code{operator=} return a reference to @code{*this}.
2059
2060 @item
2061 Item 23:  Don't try to return a reference when you must return an object.
2062
2063 @end itemize
2064
2065 Also warn about violations of the following style guidelines from
2066 Scott Meyers' @cite{More Effective C++} book:
2067
2068 @itemize @bullet
2069 @item
2070 Item 6:  Distinguish between prefix and postfix forms of increment and
2071 decrement operators.
2072
2073 @item
2074 Item 7:  Never overload @code{&&}, @code{||}, or @code{,}.
2075
2076 @end itemize
2077
2078 When selecting this option, be aware that the standard library
2079 headers do not obey all of these guidelines; use @samp{grep -v}
2080 to filter out those warnings.
2081
2082 @item -Wno-deprecated @r{(C++ only)}
2083 @opindex Wno-deprecated
2084 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
2085
2086 @item -Wstrict-null-sentinel @r{(C++ only)}
2087 @opindex Wstrict-null-sentinel
2088 Warn also about the use of an uncasted @code{NULL} as sentinel.  When
2089 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2090 to @code{__null}.  Although it is a null pointer constant not a null pointer,
2091 it is guaranteed to of the same size as a pointer.  But this use is
2092 not portable across different compilers.
2093
2094 @item -Wno-non-template-friend @r{(C++ only)}
2095 @opindex Wno-non-template-friend
2096 Disable warnings when non-templatized friend functions are declared
2097 within a template.  Since the advent of explicit template specification
2098 support in G++, if the name of the friend is an unqualified-id (i.e.,
2099 @samp{friend foo(int)}), the C++ language specification demands that the
2100 friend declare or define an ordinary, nontemplate function.  (Section
2101 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2102 could be interpreted as a particular specialization of a templatized
2103 function.  Because this non-conforming behavior is no longer the default
2104 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2105 check existing code for potential trouble spots and is on by default.
2106 This new compiler behavior can be turned off with
2107 @option{-Wno-non-template-friend} which keeps the conformant compiler code
2108 but disables the helpful warning.
2109
2110 @item -Wold-style-cast @r{(C++ only)}
2111 @opindex Wold-style-cast
2112 Warn if an old-style (C-style) cast to a non-void type is used within
2113 a C++ program.  The new-style casts (@samp{dynamic_cast},
2114 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
2115 less vulnerable to unintended effects and much easier to search for.
2116
2117 @item -Woverloaded-virtual @r{(C++ only)}
2118 @opindex Woverloaded-virtual
2119 @cindex overloaded virtual fn, warning
2120 @cindex warning for overloaded virtual fn
2121 Warn when a function declaration hides virtual functions from a
2122 base class.  For example, in:
2123
2124 @smallexample
2125 struct A @{
2126   virtual void f();
2127 @};
2128
2129 struct B: public A @{
2130   void f(int);
2131 @};
2132 @end smallexample
2133
2134 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2135 like:
2136
2137 @smallexample
2138 B* b;
2139 b->f();
2140 @end smallexample
2141
2142 will fail to compile.
2143
2144 @item -Wno-pmf-conversions @r{(C++ only)}
2145 @opindex Wno-pmf-conversions
2146 Disable the diagnostic for converting a bound pointer to member function
2147 to a plain pointer.
2148
2149 @item -Wsign-promo @r{(C++ only)}
2150 @opindex Wsign-promo
2151 Warn when overload resolution chooses a promotion from unsigned or
2152 enumerated type to a signed type, over a conversion to an unsigned type of
2153 the same size.  Previous versions of G++ would try to preserve
2154 unsignedness, but the standard mandates the current behavior.
2155
2156 @smallexample
2157 struct A @{
2158   operator int ();
2159   A& operator = (int);
2160 @};
2161
2162 main ()
2163 @{
2164   A a,b;
2165   a = b;
2166 @}
2167 @end smallexample
2168
2169 In this example, G++ will synthesize a default @samp{A& operator =
2170 (const A&);}, while cfront will use the user-defined @samp{operator =}.
2171 @end table
2172
2173 @node Objective-C and Objective-C++ Dialect Options
2174 @section Options Controlling Objective-C and Objective-C++ Dialects
2175
2176 @cindex compiler options, Objective-C and Objective-C++
2177 @cindex Objective-C and Objective-C++ options, command line
2178 @cindex options, Objective-C and Objective-C++
2179 (NOTE: This manual does not describe the Objective-C and Objective-C++
2180 languages themselves.  See @xref{Standards,,Language Standards
2181 Supported by GCC}, for references.)
2182
2183 This section describes the command-line options that are only meaningful
2184 for Objective-C and Objective-C++ programs, but you can also use most of
2185 the language-independent GNU compiler options.
2186 For example, you might compile a file @code{some_class.m} like this:
2187
2188 @smallexample
2189 gcc -g -fgnu-runtime -O -c some_class.m
2190 @end smallexample
2191
2192 @noindent
2193 In this example, @option{-fgnu-runtime} is an option meant only for
2194 Objective-C and Objective-C++ programs; you can use the other options with
2195 any language supported by GCC@.
2196
2197 Note that since Objective-C is an extension of the C language, Objective-C
2198 compilations may also use options specific to the C front-end (e.g.,
2199 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2200 C++-specific options (e.g., @option{-Wabi}).
2201
2202 Here is a list of options that are @emph{only} for compiling Objective-C
2203 and Objective-C++ programs:
2204
2205 @table @gcctabopt
2206 @item -fconstant-string-class=@var{class-name}
2207 @opindex fconstant-string-class
2208 Use @var{class-name} as the name of the class to instantiate for each
2209 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2210 class name is @code{NXConstantString} if the GNU runtime is being used, and
2211 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2212 @option{-fconstant-cfstrings} option, if also present, will override the
2213 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2214 to be laid out as constant CoreFoundation strings.
2215
2216 @item -fgnu-runtime
2217 @opindex fgnu-runtime
2218 Generate object code compatible with the standard GNU Objective-C
2219 runtime.  This is the default for most types of systems.
2220
2221 @item -fnext-runtime
2222 @opindex fnext-runtime
2223 Generate output compatible with the NeXT runtime.  This is the default
2224 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2225 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2226 used.
2227
2228 @item -fno-nil-receivers
2229 @opindex fno-nil-receivers
2230 Assume that all Objective-C message dispatches (e.g.,
2231 @code{[receiver message:arg]}) in this translation unit ensure that the receiver
2232 is not @code{nil}.  This allows for more efficient entry points in the runtime
2233 to be used.  Currently, this option is only available in conjunction with
2234 the NeXT runtime on Mac OS X 10.3 and later.
2235
2236 @item -fobjc-call-cxx-cdtors
2237 @opindex fobjc-call-cxx-cdtors
2238 For each Objective-C class, check if any of its instance variables is a
2239 C++ object with a non-trivial default constructor.  If so, synthesize a
2240 special @code{- (id) .cxx_construct} instance method that will run
2241 non-trivial default constructors on any such instance variables, in order,
2242 and then return @code{self}.  Similarly, check if any instance variable
2243 is a C++ object with a non-trivial destructor, and if so, synthesize a
2244 special @code{- (void) .cxx_destruct} method that will run
2245 all such default destructors, in reverse order.
2246
2247 The @code{- (id) .cxx_construct} and/or @code{- (void) .cxx_destruct} methods
2248 thusly generated will only operate on instance variables declared in the
2249 current Objective-C class, and not those inherited from superclasses.  It
2250 is the responsibility of the Objective-C runtime to invoke all such methods
2251 in an object's inheritance hierarchy.  The @code{- (id) .cxx_construct} methods
2252 will be invoked by the runtime immediately after a new object
2253 instance is allocated; the @code{- (void) .cxx_destruct} methods will
2254 be invoked immediately before the runtime deallocates an object instance.
2255
2256 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2257 support for invoking the @code{- (id) .cxx_construct} and
2258 @code{- (void) .cxx_destruct} methods.
2259
2260 @item -fobjc-direct-dispatch
2261 @opindex fobjc-direct-dispatch
2262 Allow fast jumps to the message dispatcher.  On Darwin this is
2263 accomplished via the comm page.
2264
2265 @item -fobjc-exceptions
2266 @opindex fobjc-exceptions
2267 Enable syntactic support for structured exception handling in Objective-C,
2268 similar to what is offered by C++ and Java.  This option is
2269 unavailable in conjunction with the NeXT runtime on Mac OS X 10.2 and
2270 earlier.
2271
2272 @smallexample
2273   @@try @{
2274     @dots{}
2275        @@throw expr;
2276     @dots{}
2277   @}
2278   @@catch (AnObjCClass *exc) @{
2279     @dots{}
2280       @@throw expr;
2281     @dots{}
2282       @@throw;
2283     @dots{}
2284   @}
2285   @@catch (AnotherClass *exc) @{
2286     @dots{}
2287   @}
2288   @@catch (id allOthers) @{
2289     @dots{}
2290   @}
2291   @@finally @{
2292     @dots{}
2293       @@throw expr;
2294     @dots{}
2295   @}
2296 @end smallexample
2297
2298 The @code{@@throw} statement may appear anywhere in an Objective-C or
2299 Objective-C++ program; when used inside of a @code{@@catch} block, the
2300 @code{@@throw} may appear without an argument (as shown above), in which case
2301 the object caught by the @code{@@catch} will be rethrown.
2302
2303 Note that only (pointers to) Objective-C objects may be thrown and
2304 caught using this scheme.  When an object is thrown, it will be caught
2305 by the nearest @code{@@catch} clause capable of handling objects of that type,
2306 analogously to how @code{catch} blocks work in C++ and Java.  A
2307 @code{@@catch(id @dots{})} clause (as shown above) may also be provided to catch
2308 any and all Objective-C exceptions not caught by previous @code{@@catch}
2309 clauses (if any).
2310
2311 The @code{@@finally} clause, if present, will be executed upon exit from the
2312 immediately preceding @code{@@try @dots{} @@catch} section.  This will happen
2313 regardless of whether any exceptions are thrown, caught or rethrown
2314 inside the @code{@@try @dots{} @@catch} section, analogously to the behavior
2315 of the @code{finally} clause in Java.
2316
2317 There are several caveats to using the new exception mechanism:
2318
2319 @itemize @bullet
2320 @item
2321 Although currently designed to be binary compatible with @code{NS_HANDLER}-style
2322 idioms provided by the @code{NSException} class, the new
2323 exceptions can only be used on Mac OS X 10.3 (Panther) and later
2324 systems, due to additional functionality needed in the (NeXT) Objective-C
2325 runtime.
2326
2327 @item
2328 As mentioned above, the new exceptions do not support handling
2329 types other than Objective-C objects.   Furthermore, when used from
2330 Objective-C++, the Objective-C exception model does not interoperate with C++
2331 exceptions at this time.  This means you cannot @code{@@throw} an exception
2332 from Objective-C and @code{catch} it in C++, or vice versa
2333 (i.e., @code{throw @dots{} @@catch}).
2334 @end itemize
2335
2336 The @option{-fobjc-exceptions} switch also enables the use of synchronization
2337 blocks for thread-safe execution:
2338
2339 @smallexample
2340   @@synchronized (ObjCClass *guard) @{
2341     @dots{}
2342   @}
2343 @end smallexample
2344
2345 Upon entering the @code{@@synchronized} block, a thread of execution shall
2346 first check whether a lock has been placed on the corresponding @code{guard}
2347 object by another thread.  If it has, the current thread shall wait until
2348 the other thread relinquishes its lock.  Once @code{guard} becomes available,
2349 the current thread will place its own lock on it, execute the code contained in
2350 the @code{@@synchronized} block, and finally relinquish the lock (thereby
2351 making @code{guard} available to other threads).
2352
2353 Unlike Java, Objective-C does not allow for entire methods to be marked
2354 @code{@@synchronized}.  Note that throwing exceptions out of
2355 @code{@@synchronized} blocks is allowed, and will cause the guarding object
2356 to be unlocked properly.
2357
2358 @item -fobjc-gc
2359 @opindex fobjc-gc
2360 Enable garbage collection (GC) in Objective-C and Objective-C++ programs.
2361
2362 @item -freplace-objc-classes
2363 @opindex freplace-objc-classes
2364 Emit a special marker instructing @command{ld(1)} not to statically link in
2365 the resulting object file, and allow @command{dyld(1)} to load it in at
2366 run time instead.  This is used in conjunction with the Fix-and-Continue
2367 debugging mode, where the object file in question may be recompiled and
2368 dynamically reloaded in the course of program execution, without the need
2369 to restart the program itself.  Currently, Fix-and-Continue functionality
2370 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2371 and later.
2372
2373 @item -fzero-link
2374 @opindex fzero-link
2375 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2376 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2377 compile time) with static class references that get initialized at load time,
2378 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2379 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2380 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2381 for individual class implementations to be modified during program execution.
2382
2383 @item -gen-decls
2384 @opindex gen-decls
2385 Dump interface declarations for all classes seen in the source file to a
2386 file named @file{@var{sourcename}.decl}.
2387
2388 @item -Wassign-intercept
2389 @opindex Wassign-intercept
2390 Warn whenever an Objective-C assignment is being intercepted by the
2391 garbage collector.
2392
2393 @item -Wno-protocol
2394 @opindex Wno-protocol
2395 If a class is declared to implement a protocol, a warning is issued for
2396 every method in the protocol that is not implemented by the class.  The
2397 default behavior is to issue a warning for every method not explicitly
2398 implemented in the class, even if a method implementation is inherited
2399 from the superclass.  If you use the @option{-Wno-protocol} option, then
2400 methods inherited from the superclass are considered to be implemented,
2401 and no warning is issued for them.
2402
2403 @item -Wselector
2404 @opindex Wselector
2405 Warn if multiple methods of different types for the same selector are
2406 found during compilation.  The check is performed on the list of methods
2407 in the final stage of compilation.  Additionally, a check is performed
2408 for each selector appearing in a @code{@@selector(@dots{})}
2409 expression, and a corresponding method for that selector has been found
2410 during compilation.  Because these checks scan the method table only at
2411 the end of compilation, these warnings are not produced if the final
2412 stage of compilation is not reached, for example because an error is
2413 found during compilation, or because the @option{-fsyntax-only} option is
2414 being used.
2415
2416 @item -Wstrict-selector-match
2417 @opindex Wstrict-selector-match
2418 Warn if multiple methods with differing argument and/or return types are
2419 found for a given selector when attempting to send a message using this
2420 selector to a receiver of type @code{id} or @code{Class}.  When this flag
2421 is off (which is the default behavior), the compiler will omit such warnings
2422 if any differences found are confined to types which share the same size
2423 and alignment.
2424
2425 @item -Wundeclared-selector
2426 @opindex Wundeclared-selector
2427 Warn if a @code{@@selector(@dots{})} expression referring to an
2428 undeclared selector is found.  A selector is considered undeclared if no
2429 method with that name has been declared before the
2430 @code{@@selector(@dots{})} expression, either explicitly in an
2431 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
2432 an @code{@@implementation} section.  This option always performs its
2433 checks as soon as a @code{@@selector(@dots{})} expression is found,
2434 while @option{-Wselector} only performs its checks in the final stage of
2435 compilation.  This also enforces the coding style convention
2436 that methods and selectors must be declared before being used.
2437
2438 @item -print-objc-runtime-info
2439 @opindex print-objc-runtime-info
2440 Generate C header describing the largest structure that is passed by
2441 value, if any.
2442
2443 @end table
2444
2445 @node Language Independent Options
2446 @section Options to Control Diagnostic Messages Formatting
2447 @cindex options to control diagnostics formatting
2448 @cindex diagnostic messages
2449 @cindex message formatting
2450
2451 Traditionally, diagnostic messages have been formatted irrespective of
2452 the output device's aspect (e.g.@: its width, @dots{}).  The options described
2453 below can be used to control the diagnostic messages formatting
2454 algorithm, e.g.@: how many characters per line, how often source location
2455 information should be reported.  Right now, only the C++ front end can
2456 honor these options.  However it is expected, in the near future, that
2457 the remaining front ends would be able to digest them correctly.
2458
2459 @table @gcctabopt
2460 @item -fmessage-length=@var{n}
2461 @opindex fmessage-length
2462 Try to format error messages so that they fit on lines of about @var{n}
2463 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
2464 the front ends supported by GCC@.  If @var{n} is zero, then no
2465 line-wrapping will be done; each error message will appear on a single
2466 line.
2467
2468 @opindex fdiagnostics-show-location
2469 @item -fdiagnostics-show-location=once
2470 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
2471 reporter to emit @emph{once} source location information; that is, in
2472 case the message is too long to fit on a single physical line and has to
2473 be wrapped, the source location won't be emitted (as prefix) again,
2474 over and over, in subsequent continuation lines.  This is the default
2475 behavior.
2476
2477 @item -fdiagnostics-show-location=every-line
2478 Only meaningful in line-wrapping mode.  Instructs the diagnostic
2479 messages reporter to emit the same source location information (as
2480 prefix) for physical lines that result from the process of breaking
2481 a message which is too long to fit on a single line.
2482
2483 @item -fdiagnostics-show-option
2484 @opindex fdiagnostics-show-option
2485 This option instructs the diagnostic machinery to add text to each
2486 diagnostic emitted, which indicates which command line option directly
2487 controls that diagnostic, when such an option is known to the
2488 diagnostic machinery.
2489
2490 @item -Wcoverage-mismatch
2491 @opindex Wcoverage-mismatch
2492 Warn if feedback profiles do not match when using the
2493 @option{-fprofile-use} option.
2494 If a source file was changed between @option{-fprofile-gen} and
2495 @option{-fprofile-use}, the files with the profile feedback can fail
2496 to match the source file and GCC can not use the profile feedback
2497 information.  By default, GCC emits an error message in this case.
2498 The option @option{-Wcoverage-mismatch} emits a warning instead of an
2499 error.  GCC does not use appropriate feedback profiles, so using this
2500 option can result in poorly optimized code.  This option is useful
2501 only in the case of very minor changes such as bug fixes to an
2502 existing code-base.
2503
2504 @end table
2505
2506 @node Warning Options
2507 @section Options to Request or Suppress Warnings
2508 @cindex options to control warnings
2509 @cindex warning messages
2510 @cindex messages, warning
2511 @cindex suppressing warnings
2512
2513 Warnings are diagnostic messages that report constructions which
2514 are not inherently erroneous but which are risky or suggest there
2515 may have been an error.
2516
2517 You can request many specific warnings with options beginning @samp{-W},
2518 for example @option{-Wimplicit} to request warnings on implicit
2519 declarations.  Each of these specific warning options also has a
2520 negative form beginning @samp{-Wno-} to turn off warnings;
2521 for example, @option{-Wno-implicit}.  This manual lists only one of the
2522 two forms, whichever is not the default.
2523
2524 The following options control the amount and kinds of warnings produced
2525 by GCC; for further, language-specific options also refer to
2526 @ref{C++ Dialect Options} and @ref{Objective-C and Objective-C++ Dialect
2527 Options}.
2528
2529 @table @gcctabopt
2530 @cindex syntax checking
2531 @item -fsyntax-only
2532 @opindex fsyntax-only
2533 Check the code for syntax errors, but don't do anything beyond that.
2534
2535 @item -pedantic
2536 @opindex pedantic
2537 Issue all the warnings demanded by strict ISO C and ISO C++;
2538 reject all programs that use forbidden extensions, and some other
2539 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
2540 version of the ISO C standard specified by any @option{-std} option used.
2541
2542 Valid ISO C and ISO C++ programs should compile properly with or without
2543 this option (though a rare few will require @option{-ansi} or a
2544 @option{-std} option specifying the required version of ISO C)@.  However,
2545 without this option, certain GNU extensions and traditional C and C++
2546 features are supported as well.  With this option, they are rejected.
2547
2548 @option{-pedantic} does not cause warning messages for use of the
2549 alternate keywords whose names begin and end with @samp{__}.  Pedantic
2550 warnings are also disabled in the expression that follows
2551 @code{__extension__}.  However, only system header files should use
2552 these escape routes; application programs should avoid them.
2553 @xref{Alternate Keywords}.
2554
2555 Some users try to use @option{-pedantic} to check programs for strict ISO
2556 C conformance.  They soon find that it does not do quite what they want:
2557 it finds some non-ISO practices, but not all---only those for which
2558 ISO C @emph{requires} a diagnostic, and some others for which
2559 diagnostics have been added.
2560
2561 A feature to report any failure to conform to ISO C might be useful in
2562 some instances, but would require considerable additional work and would
2563 be quite different from @option{-pedantic}.  We don't have plans to
2564 support such a feature in the near future.
2565
2566 Where the standard specified with @option{-std} represents a GNU
2567 extended dialect of C, such as @samp{gnu89} or @samp{gnu99}, there is a
2568 corresponding @dfn{base standard}, the version of ISO C on which the GNU
2569 extended dialect is based.  Warnings from @option{-pedantic} are given
2570 where they are required by the base standard.  (It would not make sense
2571 for such warnings to be given only for features not in the specified GNU
2572 C dialect, since by definition the GNU dialects of C include all
2573 features the compiler supports with the given option, and there would be
2574 nothing to warn about.)
2575
2576 @item -pedantic-errors
2577 @opindex pedantic-errors
2578 Like @option{-pedantic}, except that errors are produced rather than
2579 warnings.
2580
2581 @item -w
2582 @opindex w
2583 Inhibit all warning messages.
2584
2585 @item -Wno-import
2586 @opindex Wno-import
2587 Inhibit warning messages about the use of @samp{#import}.
2588
2589 @item -Wchar-subscripts
2590 @opindex Wchar-subscripts
2591 Warn if an array subscript has type @code{char}.  This is a common cause
2592 of error, as programmers often forget that this type is signed on some
2593 machines.
2594 This warning is enabled by @option{-Wall}.
2595
2596 @item -Wcomment
2597 @opindex Wcomment
2598 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
2599 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
2600 This warning is enabled by @option{-Wall}.
2601
2602 @item -Wfatal-errors
2603 @opindex Wfatal-errors
2604 This option causes the compiler to abort compilation on the first error
2605 occurred rather than trying to keep going and printing further error
2606 messages.
2607
2608 @item -Wformat
2609 @opindex Wformat
2610 @opindex ffreestanding
2611 @opindex fno-builtin
2612 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
2613 the arguments supplied have types appropriate to the format string
2614 specified, and that the conversions specified in the format string make
2615 sense.  This includes standard functions, and others specified by format
2616 attributes (@pxref{Function Attributes}), in the @code{printf},
2617 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
2618 not in the C standard) families (or other target-specific families).
2619 Which functions are checked without format attributes having been
2620 specified depends on the standard version selected, and such checks of
2621 functions without the attribute specified are disabled by
2622 @option{-ffreestanding} or @option{-fno-builtin}.
2623
2624 The formats are checked against the format features supported by GNU
2625 libc version 2.2.  These include all ISO C90 and C99 features, as well
2626 as features from the Single Unix Specification and some BSD and GNU
2627 extensions.  Other library implementations may not support all these
2628 features; GCC does not support warning about features that go beyond a
2629 particular library's limitations.  However, if @option{-pedantic} is used
2630 with @option{-Wformat}, warnings will be given about format features not
2631 in the selected standard version (but not for @code{strfmon} formats,
2632 since those are not in any version of the C standard).  @xref{C Dialect
2633 Options,,Options Controlling C Dialect}.
2634
2635 Since @option{-Wformat} also checks for null format arguments for
2636 several functions, @option{-Wformat} also implies @option{-Wnonnull}.
2637
2638 @option{-Wformat} is included in @option{-Wall}.  For more control over some
2639 aspects of format checking, the options @option{-Wformat-y2k},
2640 @option{-Wno-format-extra-args}, @option{-Wno-format-zero-length},
2641 @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
2642 @option{-Wformat=2} are available, but are not included in @option{-Wall}.
2643
2644 @item -Wformat-y2k
2645 @opindex Wformat-y2k
2646 If @option{-Wformat} is specified, also warn about @code{strftime}
2647 formats which may yield only a two-digit year.
2648
2649 @item -Wno-format-extra-args
2650 @opindex Wno-format-extra-args
2651 If @option{-Wformat} is specified, do not warn about excess arguments to a
2652 @code{printf} or @code{scanf} format function.  The C standard specifies
2653 that such arguments are ignored.
2654
2655 Where the unused arguments lie between used arguments that are
2656 specified with @samp{$} operand number specifications, normally
2657 warnings are still given, since the implementation could not know what
2658 type to pass to @code{va_arg} to skip the unused arguments.  However,
2659 in the case of @code{scanf} formats, this option will suppress the
2660 warning if the unused arguments are all pointers, since the Single
2661 Unix Specification says that such unused arguments are allowed.
2662
2663 @item -Wno-format-zero-length
2664 @opindex Wno-format-zero-length
2665 If @option{-Wformat} is specified, do not warn about zero-length formats.
2666 The C standard specifies that zero-length formats are allowed.
2667
2668 @item -Wformat-nonliteral
2669 @opindex Wformat-nonliteral
2670 If @option{-Wformat} is specified, also warn if the format string is not a
2671 string literal and so cannot be checked, unless the format function
2672 takes its format arguments as a @code{va_list}.
2673
2674 @item -Wformat-security
2675 @opindex Wformat-security
2676 If @option{-Wformat} is specified, also warn about uses of format
2677 functions that represent possible security problems.  At present, this
2678 warns about calls to @code{printf} and @code{scanf} functions where the
2679 format string is not a string literal and there are no format arguments,
2680 as in @code{printf (foo);}.  This may be a security hole if the format
2681 string came from untrusted input and contains @samp{%n}.  (This is
2682 currently a subset of what @option{-Wformat-nonliteral} warns about, but
2683 in future warnings may be added to @option{-Wformat-security} that are not
2684 included in @option{-Wformat-nonliteral}.)
2685
2686 @item -Wformat=2
2687 @opindex Wformat=2
2688 Enable @option{-Wformat} plus format checks not included in
2689 @option{-Wformat}.  Currently equivalent to @samp{-Wformat
2690 -Wformat-nonliteral -Wformat-security -Wformat-y2k}.
2691
2692 @item -Wnonnull
2693 @opindex Wnonnull
2694 Warn about passing a null pointer for arguments marked as
2695 requiring a non-null value by the @code{nonnull} function attribute.
2696
2697 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
2698 can be disabled with the @option{-Wno-nonnull} option.
2699
2700 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
2701 @opindex Winit-self
2702 Warn about uninitialized variables which are initialized with themselves.
2703 Note this option can only be used with the @option{-Wuninitialized} option,
2704 which in turn only works with @option{-O1} and above.
2705
2706 For example, GCC will warn about @code{i} being uninitialized in the
2707 following snippet only when @option{-Winit-self} has been specified:
2708 @smallexample
2709 @group
2710 int f()
2711 @{
2712   int i = i;
2713   return i;
2714 @}
2715 @end group
2716 @end smallexample
2717
2718 @item -Wimplicit-int
2719 @opindex Wimplicit-int
2720 Warn when a declaration does not specify a type.
2721 This warning is enabled by @option{-Wall}.
2722
2723 @item -Wimplicit-function-declaration
2724 @opindex Wimplicit-function-declaration
2725 @opindex Wno-implicit-function-declaration
2726 Give a warning whenever a function is used before being declared. In
2727 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
2728 enabled by default and it is made into an error by
2729 @option{-pedantic-errors}. This warning is also enabled by
2730 @option{-Wall}.
2731
2732 @item -Wimplicit
2733 @opindex Wimplicit
2734 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
2735 This warning is enabled by @option{-Wall}.
2736
2737 @item -Wmain
2738 @opindex Wmain
2739 Warn if the type of @samp{main} is suspicious.  @samp{main} should be a
2740 function with external linkage, returning int, taking either zero
2741 arguments, two, or three arguments of appropriate types.
2742 This warning is enabled by @option{-Wall}.
2743
2744 @item -Wmissing-braces
2745 @opindex Wmissing-braces
2746 Warn if an aggregate or union initializer is not fully bracketed.  In
2747 the following example, the initializer for @samp{a} is not fully
2748 bracketed, but that for @samp{b} is fully bracketed.
2749
2750 @smallexample
2751 int a[2][2] = @{ 0, 1, 2, 3 @};
2752 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
2753 @end smallexample
2754
2755 This warning is enabled by @option{-Wall}.
2756
2757 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
2758 @opindex Wmissing-include-dirs
2759 Warn if a user-supplied include directory does not exist.
2760
2761 @item -Wparentheses
2762 @opindex Wparentheses
2763 Warn if parentheses are omitted in certain contexts, such
2764 as when there is an assignment in a context where a truth value
2765 is expected, or when operators are nested whose precedence people
2766 often get confused about.
2767
2768 Also warn if a comparison like @samp{x<=y<=z} appears; this is
2769 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
2770 interpretation from that of ordinary mathematical notation.
2771
2772 Also warn about constructions where there may be confusion to which
2773 @code{if} statement an @code{else} branch belongs.  Here is an example of
2774 such a case:
2775
2776 @smallexample
2777 @group
2778 @{
2779   if (a)
2780     if (b)
2781       foo ();
2782   else
2783     bar ();
2784 @}
2785 @end group
2786 @end smallexample
2787
2788 In C/C++, every @code{else} branch belongs to the innermost possible
2789 @code{if} statement, which in this example is @code{if (b)}.  This is
2790 often not what the programmer expected, as illustrated in the above
2791 example by indentation the programmer chose.  When there is the
2792 potential for this confusion, GCC will issue a warning when this flag
2793 is specified.  To eliminate the warning, add explicit braces around
2794 the innermost @code{if} statement so there is no way the @code{else}
2795 could belong to the enclosing @code{if}.  The resulting code would
2796 look like this:
2797
2798 @smallexample
2799 @group
2800 @{
2801   if (a)
2802     @{
2803       if (b)
2804         foo ();
2805       else
2806         bar ();
2807     @}
2808 @}
2809 @end group
2810 @end smallexample
2811
2812 This warning is enabled by @option{-Wall}.
2813
2814 @item -Wsequence-point
2815 @opindex Wsequence-point
2816 Warn about code that may have undefined semantics because of violations
2817 of sequence point rules in the C and C++ standards.
2818
2819 The C and C++ standards defines the order in which expressions in a C/C++
2820 program are evaluated in terms of @dfn{sequence points}, which represent
2821 a partial ordering between the execution of parts of the program: those
2822 executed before the sequence point, and those executed after it.  These
2823 occur after the evaluation of a full expression (one which is not part
2824 of a larger expression), after the evaluation of the first operand of a
2825 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
2826 function is called (but after the evaluation of its arguments and the
2827 expression denoting the called function), and in certain other places.
2828 Other than as expressed by the sequence point rules, the order of
2829 evaluation of subexpressions of an expression is not specified.  All
2830 these rules describe only a partial order rather than a total order,
2831 since, for example, if two functions are called within one expression
2832 with no sequence point between them, the order in which the functions
2833 are called is not specified.  However, the standards committee have
2834 ruled that function calls do not overlap.
2835
2836 It is not specified when between sequence points modifications to the
2837 values of objects take effect.  Programs whose behavior depends on this
2838 have undefined behavior; the C and C++ standards specify that ``Between
2839 the previous and next sequence point an object shall have its stored
2840 value modified at most once by the evaluation of an expression.
2841 Furthermore, the prior value shall be read only to determine the value
2842 to be stored.''.  If a program breaks these rules, the results on any
2843 particular implementation are entirely unpredictable.
2844
2845 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
2846 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
2847 diagnosed by this option, and it may give an occasional false positive
2848 result, but in general it has been found fairly effective at detecting
2849 this sort of problem in programs.
2850
2851 The standard is worded confusingly, therefore there is some debate
2852 over the precise meaning of the sequence point rules in subtle cases.
2853 Links to discussions of the problem, including proposed formal
2854 definitions, may be found on the GCC readings page, at
2855 @w{@uref{http://gcc.gnu.org/readings.html}}.
2856
2857 This warning is enabled by @option{-Wall} for C and C++.
2858
2859 @item -Wreturn-type
2860 @opindex Wreturn-type
2861 @opindex Wno-return-type
2862 Warn whenever a function is defined with a return-type that defaults
2863 to @code{int}.  Also warn about any @code{return} statement with no
2864 return-value in a function whose return-type is not @code{void}
2865 (falling off the end of the function body is considered returning
2866 without a value), and about a @code{return} statement with a
2867 expression in a function whose return-type is @code{void}.
2868
2869 Also warn if the return type of a function has a type qualifier
2870 such as @code{const}.  For ISO C such a type qualifier has no effect,
2871 since the value returned by a function is not an lvalue.
2872 For C++, the warning is only emitted for scalar types or @code{void}.
2873 ISO C prohibits qualified @code{void} return types on function
2874 definitions, so such return types always receive a warning
2875 even without this option.
2876
2877 For C++, a function without return type always produces a diagnostic
2878 message, even when @option{-Wno-return-type} is specified.  The only
2879 exceptions are @samp{main} and functions defined in system headers.
2880
2881 This warning is enabled by @option{-Wall}.
2882
2883 @item -Wswitch
2884 @opindex Wswitch
2885 Warn whenever a @code{switch} statement has an index of enumerated type
2886 and lacks a @code{case} for one or more of the named codes of that
2887 enumeration.  (The presence of a @code{default} label prevents this
2888 warning.)  @code{case} labels outside the enumeration range also
2889 provoke warnings when this option is used.
2890 This warning is enabled by @option{-Wall}.
2891
2892 @item -Wswitch-default
2893 @opindex Wswitch-switch
2894 Warn whenever a @code{switch} statement does not have a @code{default}
2895 case.
2896
2897 @item -Wswitch-enum
2898 @opindex Wswitch-enum
2899 Warn whenever a @code{switch} statement has an index of enumerated type
2900 and lacks a @code{case} for one or more of the named codes of that
2901 enumeration.  @code{case} labels outside the enumeration range also
2902 provoke warnings when this option is used.
2903
2904 @item -Wtrigraphs
2905 @opindex Wtrigraphs
2906 Warn if any trigraphs are encountered that might change the meaning of
2907 the program (trigraphs within comments are not warned about).
2908 This warning is enabled by @option{-Wall}.
2909
2910 @item -Wunused-function
2911 @opindex Wunused-function
2912 Warn whenever a static function is declared but not defined or a
2913 non-inline static function is unused.
2914 This warning is enabled by @option{-Wall}.
2915
2916 @item -Wunused-label
2917 @opindex Wunused-label
2918 Warn whenever a label is declared but not used.
2919 This warning is enabled by @option{-Wall}.
2920
2921 To suppress this warning use the @samp{unused} attribute
2922 (@pxref{Variable Attributes}).
2923
2924 @item -Wunused-parameter
2925 @opindex Wunused-parameter
2926 Warn whenever a function parameter is unused aside from its declaration.
2927
2928 To suppress this warning use the @samp{unused} attribute
2929 (@pxref{Variable Attributes}).
2930
2931 @item -Wunused-variable
2932 @opindex Wunused-variable
2933 Warn whenever a local variable or non-constant static variable is unused
2934 aside from its declaration.
2935 This warning is enabled by @option{-Wall}.
2936
2937 To suppress this warning use the @samp{unused} attribute
2938 (@pxref{Variable Attributes}).
2939
2940 @item -Wunused-value
2941 @opindex Wunused-value
2942 Warn whenever a statement computes a result that is explicitly not
2943 used. To suppress this warning cast the unused expression to
2944 @samp{void}. This includes an expression-statement or the left-hand
2945 side of a comma expression that contains no side effects. For example,
2946 an expression such as @samp{x[i,j]} will cause a warning, while
2947 @samp{x[(void)i,j]} will not.
2948
2949 This warning is enabled by @option{-Wall}.
2950
2951 @item -Wunused
2952 @opindex Wunused
2953 All the above @option{-Wunused} options combined.
2954
2955 In order to get a warning about an unused function parameter, you must
2956 either specify @samp{-Wextra -Wunused} (note that @samp{-Wall} implies
2957 @samp{-Wunused}), or separately specify @option{-Wunused-parameter}.
2958
2959 @item -Wuninitialized
2960 @opindex Wuninitialized
2961 Warn if an automatic variable is used without first being initialized or
2962 if a variable may be clobbered by a @code{setjmp} call.
2963
2964 These warnings are possible only in optimizing compilation,
2965 because they require data flow information that is computed only
2966 when optimizing.  If you do not specify @option{-O}, you will not get
2967 these warnings. Instead, GCC will issue a warning about @option{-Wuninitialized}
2968 requiring @option{-O}.
2969
2970 If you want to warn about code which uses the uninitialized value of the
2971 variable in its own initializer, use the @option{-Winit-self} option.
2972
2973 These warnings occur for individual uninitialized or clobbered
2974 elements of structure, union or array variables as well as for
2975 variables which are uninitialized or clobbered as a whole.  They do
2976 not occur for variables or elements declared @code{volatile}.  Because
2977 these warnings depend on optimization, the exact variables or elements
2978 for which there are warnings will depend on the precise optimization
2979 options and version of GCC used.
2980
2981 Note that there may be no warning about a variable that is used only
2982 to compute a value that itself is never used, because such
2983 computations may be deleted by data flow analysis before the warnings
2984 are printed.
2985
2986 These warnings are made optional because GCC is not smart
2987 enough to see all the reasons why the code might be correct
2988 despite appearing to have an error.  Here is one example of how
2989 this can happen:
2990
2991 @smallexample
2992 @group
2993 @{
2994   int x;
2995   switch (y)
2996     @{
2997     case 1: x = 1;
2998       break;
2999     case 2: x = 4;
3000       break;
3001     case 3: x = 5;
3002     @}
3003   foo (x);
3004 @}
3005 @end group
3006 @end smallexample
3007
3008 @noindent
3009 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
3010 always initialized, but GCC doesn't know this.  Here is
3011 another common case:
3012
3013 @smallexample
3014 @{
3015   int save_y;
3016   if (change_y) save_y = y, y = new_y;
3017   @dots{}
3018   if (change_y) y = save_y;
3019 @}
3020 @end smallexample
3021
3022 @noindent
3023 This has no bug because @code{save_y} is used only if it is set.
3024
3025 @cindex @code{longjmp} warnings
3026 This option also warns when a non-volatile automatic variable might be
3027 changed by a call to @code{longjmp}.  These warnings as well are possible
3028 only in optimizing compilation.
3029
3030 The compiler sees only the calls to @code{setjmp}.  It cannot know
3031 where @code{longjmp} will be called; in fact, a signal handler could
3032 call it at any point in the code.  As a result, you may get a warning
3033 even when there is in fact no problem because @code{longjmp} cannot
3034 in fact be called at the place which would cause a problem.
3035
3036 Some spurious warnings can be avoided if you declare all the functions
3037 you use that never return as @code{noreturn}.  @xref{Function
3038 Attributes}.
3039
3040 This warning is enabled by @option{-Wall}.
3041
3042 @item -Wunknown-pragmas
3043 @opindex Wunknown-pragmas
3044 @cindex warning for unknown pragmas
3045 @cindex unknown pragmas, warning
3046 @cindex pragmas, warning of unknown
3047 Warn when a #pragma directive is encountered which is not understood by
3048 GCC@.  If this command line option is used, warnings will even be issued
3049 for unknown pragmas in system header files.  This is not the case if
3050 the warnings were only enabled by the @option{-Wall} command line option.
3051
3052 @item -Wno-pragmas
3053 @opindex Wno-pragmas
3054 @opindex Wpragmas
3055 Do not warn about misuses of pragmas, such as incorrect parameters,
3056 invalid syntax, or conflicts between pragmas.  See also
3057 @samp{-Wunknown-pragmas}.
3058
3059 @item -Wstrict-aliasing
3060 @opindex Wstrict-aliasing
3061 This option is only active when @option{-fstrict-aliasing} is active.
3062 It warns about code which might break the strict aliasing rules that the
3063 compiler is using for optimization.  The warning does not catch all
3064 cases, but does attempt to catch the more common pitfalls.  It is
3065 included in @option{-Wall}.
3066 It is equivalent to -Wstrict-aliasing=3
3067
3068 @item -Wstrict-aliasing=n
3069 @opindex Wstrict-aliasing=n
3070 This option is only active when @option{-fstrict-aliasing} is active.
3071 It warns about code which might break the strict aliasing rules that the
3072 compiler is using for optimization.
3073 Higher levels correspond to higher accuracy (fewer false positives).
3074 Higher levels also correspond to more effort, similar to the way -O works.
3075 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=n},
3076 with n=3.
3077
3078 Level 1: Most aggressive, quick, least accurate.
3079 Possibly useful when higher levels
3080 do not warn but -fstrict-aliasing still breaks the code, as it has very few 
3081 false negatives.  However, it has many false positives.
3082 Warns for all pointer conversions between possibly incompatible types, 
3083 even if never dereferenced.  Runs in the frontend only.
3084
3085 Level 2: Aggressive, quick, not too precise.
3086 May still have many false positives (not as many as level 1 though),
3087 and few false negatives (but possibly more than level 1).
3088 Unlike level 1, it only warns when an address is taken.  Warns about
3089 incomplete types.  Runs in the frontend only.
3090
3091 Level 3 (default for @option{-Wstrict-aliasing}): 
3092 Should have very few false positives and few false 
3093 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
3094 Takes care of the common punn+dereference pattern in the frontend:
3095 @code{*(int*)&some_float}.
3096 If optimization is enabled, it also runs in the backend, where it deals 
3097 with multiple statement cases using flow-sensitive points-to information.
3098 Only warns when the converted pointer is dereferenced.
3099 Does not warn about incomplete types.
3100
3101 @item -Wstrict-overflow
3102 @item -Wstrict-overflow=@var{n}
3103 @opindex Wstrict-overflow
3104 This option is only active when @option{-fstrict-overflow} is active.
3105 It warns about cases where the compiler optimizes based on the
3106 assumption that signed overflow does not occur.  Note that it does not
3107 warn about all cases where the code might overflow: it only warns
3108 about cases where the compiler implements some optimization.  Thus
3109 this warning depends on the optimization level.
3110
3111 An optimization which assumes that signed overflow does not occur is
3112 perfectly safe if the values of the variables involved are such that
3113 overflow never does, in fact, occur.  Therefore this warning can
3114 easily give a false positive: a warning about code which is not
3115 actually a problem.  To help focus on important issues, several
3116 warning levels are defined.  No warnings are issued for the use of
3117 undefined signed overflow when estimating how many iterations a loop
3118 will require, in particular when determining whether a loop will be
3119 executed at all.
3120
3121 @table @option
3122 @item -Wstrict-overflow=1
3123 Warn about cases which are both questionable and easy to avoid.  For
3124 example: @code{x + 1 > x}; with @option{-fstrict-overflow}, the
3125 compiler will simplify this to @code{1}.  This level of
3126 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
3127 are not, and must be explicitly requested.
3128
3129 @item -Wstrict-overflow=2
3130 Also warn about other cases where a comparison is simplified to a
3131 constant.  For example: @code{abs (x) >= 0}.  This can only be
3132 simplified when @option{-fstrict-overflow} is in effect, because
3133 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
3134 zero.  @option{-Wstrict-overflow} (with no level) is the same as
3135 @option{-Wstrict-overflow=2}.
3136
3137 @item -Wstrict-overflow=3
3138 Also warn about other cases where a comparison is simplified.  For
3139 example: @code{x + 1 > 1} will be simplified to @code{x > 0}.
3140
3141 @item -Wstrict-overflow=4
3142 Also warn about other simplifications not covered by the above cases.
3143 For example: @code{(x * 10) / 5} will be simplified to @code{x * 2}.
3144
3145 @item -Wstrict-overflow=5
3146 Also warn about cases where the compiler reduces the magnitude of a
3147 constant involved in a comparison.  For example: @code{x + 2 > y} will
3148 be simplified to @code{x + 1 >= y}.  This is reported only at the
3149 highest warning level because this simplification applies to many
3150 comparisons, so this warning level will give a very large number of
3151 false positives.
3152 @end table
3153
3154 @item -Warray-bounds
3155 @opindex Wno-array-bounds
3156 @opindex Warray-bounds
3157 This option is only active when @option{-ftree-vrp} is active
3158 (default for -O2 and above). It warns about subscripts to arrays
3159 that are always out of bounds. This warning is enabled by @option{-Wall}.
3160
3161 @item -Wall
3162 @opindex Wall
3163 All of the above @samp{-W} options combined.  This enables all the
3164 warnings about constructions that some users consider questionable, and
3165 that are easy to avoid (or modify to prevent the warning), even in
3166 conjunction with macros.  This also enables some language-specific
3167 warnings described in @ref{C++ Dialect Options} and
3168 @ref{Objective-C and Objective-C++ Dialect Options}.
3169 @end table
3170
3171 The following @option{-W@dots{}} options are not implied by @option{-Wall}.
3172 Some of them warn about constructions that users generally do not
3173 consider questionable, but which occasionally you might wish to check
3174 for; others warn about constructions that are necessary or hard to avoid
3175 in some cases, and there is no simple way to modify the code to suppress
3176 the warning.
3177
3178 @table @gcctabopt
3179 @item -Wextra
3180 @opindex W
3181 @opindex Wextra
3182 (This option used to be called @option{-W}.  The older name is still
3183 supported, but the newer name is more descriptive.)  Print extra warning
3184 messages for these events:
3185
3186 @itemize @bullet
3187 @item
3188 Warn if a comparison is always true or always false due to the limited
3189 range of the data type, but do not warn for constant expressions.  For
3190 example, warn if an unsigned variable is compared against zero with
3191 @samp{<} or @samp{>=}.  This warning can be independently controlled
3192 by @option{-Wtype-limits}.
3193
3194 @item @r{(C only)}
3195 Storage-class specifiers like @code{static} are not the first things
3196 in a declaration.  According to the C Standard, this usage is
3197 obsolescent.  This warning can be independently controlled by
3198 @option{-Wold-style-declaration}.
3199
3200 @item
3201 If @option{-Wall} or @option{-Wunused} is also specified, warn about unused
3202 arguments.
3203
3204 @item
3205 A comparison between signed and unsigned values could produce an
3206 incorrect result when the signed value is converted to unsigned.
3207 (But don't warn if @option{-Wno-sign-compare} is also specified.)
3208
3209 @item
3210 An aggregate has an initializer which does not initialize all members.
3211 This warning can be independently controlled by
3212 @option{-Wmissing-field-initializers}.
3213
3214 @item
3215 An initialized field without side effects is overridden when using
3216 designated initializers (@pxref{Designated Inits, , Designated
3217 Initializers}).  This warning can be independently controlled by
3218 @option{-Woverride-init}.
3219
3220 @item @r{(C only)}
3221 A function parameter is declared without a type specifier in K&R-style
3222 functions.  This warning can be independently controlled by
3223 @option{-Wmissing-parameter-type}.
3224
3225 @item
3226 An empty body occurs in an @samp{if}, @samp{else} or
3227 @samp{do while} statement. This warning can be independently
3228 controlled by @option{-Wempty-body}.
3229
3230 @item @r{(C++ only)}
3231 An empty body occurs in a @samp{while} or @samp{for} statement with no
3232 whitespacing before the semicolon. This warning can be independently
3233 controlled by @option{-Wempty-body}.
3234
3235 @item
3236 A pointer is compared against integer zero with @samp{<}, @samp{<=},
3237 @samp{>}, or @samp{>=}.
3238
3239 @item
3240 A variable might be changed by @samp{longjmp} or @samp{vfork}.
3241 This warning can be independently controlled by @option{-Wclobbered}.
3242
3243 @item @r{(C++ only)}
3244 An enumerator and a non-enumerator both appear in a conditional expression.
3245
3246 @item @r{(C++ only)}
3247 A non-static reference or non-static @samp{const} member appears in a
3248 class without constructors.
3249
3250 @item @r{(C++ only)}
3251 Ambiguous virtual bases.
3252
3253 @item @r{(C++ only)}
3254 Subscripting an array which has been declared @samp{register}.
3255
3256 @item @r{(C++ only)}
3257 Taking the address of a variable which has been declared @samp{register}.
3258
3259 @item @r{(C++ only)}
3260 A base class is not initialized in a derived class' copy constructor.
3261 @end itemize
3262
3263 @item -Wno-div-by-zero
3264 @opindex Wno-div-by-zero
3265 @opindex Wdiv-by-zero
3266 Do not warn about compile-time integer division by zero.  Floating point
3267 division by zero is not warned about, as it can be a legitimate way of
3268 obtaining infinities and NaNs.
3269
3270 @item -Wsystem-headers
3271 @opindex Wsystem-headers
3272 @cindex warnings from system headers
3273 @cindex system headers, warnings from
3274 Print warning messages for constructs found in system header files.
3275 Warnings from system headers are normally suppressed, on the assumption
3276 that they usually do not indicate real problems and would only make the
3277 compiler output harder to read.  Using this command line option tells
3278 GCC to emit warnings from system headers as if they occurred in user
3279 code.  However, note that using @option{-Wall} in conjunction with this
3280 option will @emph{not} warn about unknown pragmas in system
3281 headers---for that, @option{-Wunknown-pragmas} must also be used.
3282
3283 @item -Wfloat-equal
3284 @opindex Wfloat-equal
3285 Warn if floating point values are used in equality comparisons.
3286
3287 The idea behind this is that sometimes it is convenient (for the
3288 programmer) to consider floating-point values as approximations to
3289 infinitely precise real numbers.  If you are doing this, then you need
3290 to compute (by analyzing the code, or in some other way) the maximum or
3291 likely maximum error that the computation introduces, and allow for it
3292 when performing comparisons (and when producing output, but that's a
3293 different problem).  In particular, instead of testing for equality, you
3294 would check to see whether the two values have ranges that overlap; and
3295 this is done with the relational operators, so equality comparisons are
3296 probably mistaken.
3297
3298 @item -Wtraditional @r{(C only)}
3299 @opindex Wtraditional
3300 Warn about certain constructs that behave differently in traditional and
3301 ISO C@.  Also warn about ISO C constructs that have no traditional C
3302 equivalent, and/or problematic constructs which should be avoided.
3303
3304 @itemize @bullet
3305 @item
3306 Macro parameters that appear within string literals in the macro body.
3307 In traditional C macro replacement takes place within string literals,
3308 but does not in ISO C@.
3309
3310 @item
3311 In traditional C, some preprocessor directives did not exist.
3312 Traditional preprocessors would only consider a line to be a directive
3313 if the @samp{#} appeared in column 1 on the line.  Therefore
3314 @option{-Wtraditional} warns about directives that traditional C
3315 understands but would ignore because the @samp{#} does not appear as the
3316 first character on the line.  It also suggests you hide directives like
3317 @samp{#pragma} not understood by traditional C by indenting them.  Some
3318 traditional implementations would not recognize @samp{#elif}, so it
3319 suggests avoiding it altogether.
3320
3321 @item
3322 A function-like macro that appears without arguments.
3323
3324 @item
3325 The unary plus operator.
3326
3327 @item
3328 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating point
3329 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
3330 constants.)  Note, these suffixes appear in macros defined in the system
3331 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
3332 Use of these macros in user code might normally lead to spurious
3333 warnings, however GCC's integrated preprocessor has enough context to
3334 avoid warning in these cases.
3335
3336 @item
3337 A function declared external in one block and then used after the end of
3338 the block.
3339
3340 @item
3341 A @code{switch} statement has an operand of type @code{long}.
3342
3343 @item
3344 A non-@code{static} function declaration follows a @code{static} one.
3345 This construct is not accepted by some traditional C compilers.
3346
3347 @item
3348 The ISO type of an integer constant has a different width or
3349 signedness from its traditional type.  This warning is only issued if
3350 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
3351 typically represent bit patterns, are not warned about.
3352
3353 @item
3354 Usage of ISO string concatenation is detected.
3355
3356 @item
3357 Initialization of automatic aggregates.
3358
3359 @item
3360 Identifier conflicts with labels.  Traditional C lacks a separate
3361 namespace for labels.
3362
3363 @item
3364 Initialization of unions.  If the initializer is zero, the warning is
3365 omitted.  This is done under the assumption that the zero initializer in
3366 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
3367 initializer warnings and relies on default initialization to zero in the
3368 traditional C case.
3369
3370 @item
3371 Conversions by prototypes between fixed/floating point values and vice
3372 versa.  The absence of these prototypes when compiling with traditional
3373 C would cause serious problems.  This is a subset of the possible
3374 conversion warnings, for the full set use @option{-Wtraditional-conversion}.
3375
3376 @item
3377 Use of ISO C style function definitions.  This warning intentionally is
3378 @emph{not} issued for prototype declarations or variadic functions
3379 because these ISO C features will appear in your code when using
3380 libiberty's traditional C compatibility macros, @code{PARAMS} and
3381 @code{VPARAMS}.  This warning is also bypassed for nested functions
3382 because that feature is already a GCC extension and thus not relevant to
3383 traditional C compatibility.
3384 @end itemize
3385
3386 @item -Wtraditional-conversion @r{(C only)}
3387 @opindex Wtraditional-conversion
3388 Warn if a prototype causes a type conversion that is different from what
3389 would happen to the same argument in the absence of a prototype.  This
3390 includes conversions of fixed point to floating and vice versa, and
3391 conversions changing the width or signedness of a fixed point argument
3392 except when the same as the default promotion.
3393
3394 @item -Wdeclaration-after-statement @r{(C only)}
3395 @opindex Wdeclaration-after-statement
3396 Warn when a declaration is found after a statement in a block.  This
3397 construct, known from C++, was introduced with ISO C99 and is by default
3398 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
3399 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
3400
3401 @item -Wundef
3402 @opindex Wundef
3403 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
3404
3405 @item -Wno-endif-labels
3406 @opindex Wno-endif-labels
3407 @opindex Wendif-labels
3408 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
3409
3410 @item -Wshadow
3411 @opindex Wshadow
3412 Warn whenever a local variable shadows another local variable, parameter or
3413 global variable or whenever a built-in function is shadowed.
3414
3415 @item -Wlarger-than-@var{len}
3416 @opindex Wlarger-than
3417 Warn whenever an object of larger than @var{len} bytes is defined.
3418
3419 @item -Wunsafe-loop-optimizations
3420 @opindex Wunsafe-loop-optimizations
3421 Warn if the loop cannot be optimized because the compiler could not
3422 assume anything on the bounds of the loop indices.  With
3423 @option{-funsafe-loop-optimizations} warn if the compiler made
3424 such assumptions.
3425
3426 @item -Wpointer-arith
3427 @opindex Wpointer-arith
3428 Warn about anything that depends on the ``size of'' a function type or
3429 of @code{void}.  GNU C assigns these types a size of 1, for
3430 convenience in calculations with @code{void *} pointers and pointers
3431 to functions.  In C++, warn also when an arithmetic operation involves
3432 @code{NULL}.  This warning is also enabled by @option{-pedantic}.
3433
3434 @item -Wtype-limits
3435 @opindex Wtype-limits
3436 @opindex Wno-type-limits
3437 Warn if a comparison is always true or always false due to the limited
3438 range of the data type, but do not warn for constant expressions.  For
3439 example, warn if an unsigned variable is compared against zero with
3440 @samp{<} or @samp{>=}.  This warning is also enabled by
3441 @option{-Wextra}.
3442
3443 @item -Wbad-function-cast @r{(C only)}
3444 @opindex Wbad-function-cast
3445 Warn whenever a function call is cast to a non-matching type.
3446 For example, warn if @code{int malloc()} is cast to @code{anything *}.
3447
3448 @item -Wc++-compat
3449 Warn about ISO C constructs that are outside of the common subset of
3450 ISO C and ISO C++, e.g.@: request for implicit conversion from
3451 @code{void *} to a pointer to non-@code{void} type.
3452
3453 @item -Wc++0x-compat @r{(C++ and Objective-C++ only)}
3454 Warn about C++ constructs whose meaning differs between ISO C++ 1998 and
3455 ISO C++ 200x, e.g., identifiers in ISO C++ 1998 that will become keywords
3456 in ISO C++ 200x.  This warning is enabled by @option{-Wall}.
3457
3458 @item -Wcast-qual
3459 @opindex Wcast-qual
3460 Warn whenever a pointer is cast so as to remove a type qualifier from
3461 the target type.  For example, warn if a @code{const char *} is cast
3462 to an ordinary @code{char *}.
3463
3464 @item -Wcast-align
3465 @opindex Wcast-align
3466 Warn whenever a pointer is cast such that the required alignment of the
3467 target is increased.  For example, warn if a @code{char *} is cast to
3468 an @code{int *} on machines where integers can only be accessed at
3469 two- or four-byte boundaries.
3470
3471 @item -Wwrite-strings
3472 @opindex Wwrite-strings
3473 When compiling C, give string constants the type @code{const
3474 char[@var{length}]} so that
3475 copying the address of one into a non-@code{const} @code{char *}
3476 pointer will get a warning; when compiling C++, warn about the
3477 deprecated conversion from string literals to @code{char *}.  This
3478 warning, by default, is enabled for C++ programs.
3479 These warnings will help you find at
3480 compile time code that can try to write into a string constant, but
3481 only if you have been very careful about using @code{const} in
3482 declarations and prototypes.  Otherwise, it will just be a nuisance;
3483 this is why we did not make @option{-Wall} request these warnings.
3484
3485 @item -Wclobbered
3486 @opindex Wclobbered
3487 Warn for variables that might be changed by @samp{longjmp} or
3488 @samp{vfork}.  This warning is also enabled by @option{-Wextra}.
3489
3490 @item -Wconversion
3491 @opindex Wconversion
3492 @opindex Wno-conversion
3493 Warn for implicit conversions that may alter a value. This includes
3494 conversions between real and integer, like @code{abs (x)} when
3495 @code{x} is @code{double}; conversions between signed and unsigned,
3496 like @code{unsigned ui = -1}; and conversions to smaller types, like
3497 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
3498 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
3499 changed by the conversion like in @code{abs (2.0)}.  Warnings about
3500 conversions between signed and unsigned integers can be disabled by
3501 using @option{-Wno-sign-conversion}.
3502
3503 For C++, also warn for conversions between @code{NULL} and non-pointer
3504 types; confusing overload resolution for user-defined conversions; and
3505 conversions that will never use a type conversion operator:
3506 conversions to @code{void}, the same type, a base class or a reference
3507 to them. Warnings about conversions between signed and unsigned
3508 integers are disabled by default in C++ unless
3509 @option{-Wsign-conversion} is explicitly enabled.
3510
3511 @item -Wempty-body
3512 @opindex Wempty-body
3513 Warn if an empty body occurs in an @samp{if}, @samp{else} or @samp{do
3514 while} statement.  Additionally, in C++, warn when an empty body occurs
3515 in a @samp{while} or @samp{for} statement with no whitespacing before
3516 the semicolon.  This warning is also enabled by @option{-Wextra}.
3517
3518 @item -Wsign-compare
3519 @opindex Wsign-compare
3520 @cindex warning for comparison of signed and unsigned values
3521 @cindex comparison of signed and unsigned values, warning
3522 @cindex signed and unsigned values, comparison warning
3523 Warn when a comparison between signed and unsigned values could produce
3524 an incorrect result when the signed value is converted to unsigned.
3525 This warning is also enabled by @option{-Wextra}; to get the other warnings
3526 of @option{-Wextra} without this warning, use @samp{-Wextra -Wno-sign-compare}.
3527
3528 @item -Wsign-conversion
3529 @opindex Wsign-conversion
3530 @opindex Wno-sign-conversion
3531 Warn for implicit conversions that may change the sign of an integer
3532 value, like assigning a signed integer expression to an unsigned
3533 integer variable. An explicit cast silences the warning. In C, this
3534 option is enabled also by @option{-Wconversion}.
3535
3536 @item -Waddress
3537 @opindex Waddress
3538 @opindex Wno-address
3539 Warn about suspicious uses of memory addresses. These include using
3540 the address of a function in a conditional expression, such as
3541 @code{void func(void); if (func)}, and comparisons against the memory
3542 address of a string literal, such as @code{if (x == "abc")}.  Such
3543 uses typically indicate a programmer error: the address of a function
3544 always evaluates to true, so their use in a conditional usually
3545 indicate that the programmer forgot the parentheses in a function
3546 call; and comparisons against string literals result in unspecified
3547 behavior and are not portable in C, so they usually indicate that the
3548 programmer intended to use @code{strcmp}.  This warning is enabled by
3549 @option{-Wall}.
3550
3551 @item -Wlogical-op
3552 @opindex Wlogical-op
3553 @opindex Wno-logical-op
3554 Warn about suspicious uses of logical operators in expressions.
3555 This includes using logical operators in contexts where a
3556 bit-wise operator is likely to be expected.
3557
3558 @item -Waggregate-return
3559 @opindex Waggregate-return
3560 Warn if any functions that return structures or unions are defined or
3561 called.  (In languages where you can return an array, this also elicits
3562 a warning.)
3563
3564 @item -Wno-attributes
3565 @opindex Wno-attributes
3566 @opindex Wattributes
3567 Do not warn if an unexpected @code{__attribute__} is used, such as
3568 unrecognized attributes, function attributes applied to variables,
3569 etc.  This will not stop errors for incorrect use of supported
3570 attributes.
3571
3572 @item -Wstrict-prototypes @r{(C only)}
3573 @opindex Wstrict-prototypes
3574 Warn if a function is declared or defined without specifying the
3575 argument types.  (An old-style function definition is permitted without
3576 a warning if preceded by a declaration which specifies the argument
3577 types.)
3578
3579 @item -Wold-style-declaration @r{(C only)}
3580 @opindex Wold-style-declaration
3581 Warn for obsolescent usages, according to the C Standard, in a
3582 declaration. For example, warn if storage-class specifiers like
3583 @code{static} are not the first things in a declaration.  This warning
3584 is also enabled by @option{-Wextra}.
3585
3586 @item -Wold-style-definition @r{(C only)}
3587 @opindex Wold-style-definition
3588 Warn if an old-style function definition is used.  A warning is given
3589 even if there is a previous prototype.
3590
3591 @item -Wmissing-parameter-type @r{(C only)}
3592 @opindex Wmissing-parameter-type
3593 A function parameter is declared without a type specifier in K&R-style
3594 functions:
3595
3596 @smallexample
3597 void foo(bar) @{ @}
3598 @end smallexample
3599
3600 This warning is also enabled by @option{-Wextra}.
3601
3602 @item -Wmissing-prototypes @r{(C only)}
3603 @opindex Wmissing-prototypes
3604 Warn if a global function is defined without a previous prototype
3605 declaration.  This warning is issued even if the definition itself
3606 provides a prototype.  The aim is to detect global functions that fail
3607 to be declared in header files.
3608
3609 @item -Wmissing-declarations @r{(C and C++ only)}
3610 @opindex Wmissing-declarations
3611 Warn if a global function is defined without a previous declaration.
3612 Do so even if the definition itself provides a prototype.
3613 Use this option to detect global functions that are not declared in
3614 header files.  In C++, no warnings are issued for function templates,
3615 or for inline functions, or for functions in anonymous namespaces.
3616
3617 @item -Wmissing-field-initializers
3618 @opindex Wmissing-field-initializers
3619 @opindex W
3620 @opindex Wextra
3621 Warn if a structure's initializer has some fields missing.  For
3622 example, the following code would cause such a warning, because
3623 @code{x.h} is implicitly zero:
3624
3625 @smallexample
3626 struct s @{ int f, g, h; @};
3627 struct s x = @{ 3, 4 @};
3628 @end smallexample
3629
3630 This option does not warn about designated initializers, so the following
3631 modification would not trigger a warning:
3632
3633 @smallexample
3634 struct s @{ int f, g, h; @};
3635 struct s x = @{ .f = 3, .g = 4 @};
3636 @end smallexample
3637
3638 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
3639 warnings without this one, use @samp{-Wextra -Wno-missing-field-initializers}.
3640
3641 @item -Wmissing-noreturn
3642 @opindex Wmissing-noreturn
3643 Warn about functions which might be candidates for attribute @code{noreturn}.
3644 Note these are only possible candidates, not absolute ones.  Care should
3645 be taken to manually verify functions actually do not ever return before
3646 adding the @code{noreturn} attribute, otherwise subtle code generation
3647 bugs could be introduced.  You will not get a warning for @code{main} in
3648 hosted C environments.
3649
3650 @item -Wmissing-format-attribute
3651 @opindex Wmissing-format-attribute
3652 @opindex Wformat
3653 Warn about function pointers which might be candidates for @code{format}
3654 attributes.  Note these are only possible candidates, not absolute ones.
3655 GCC will guess that function pointers with @code{format} attributes that
3656 are used in assignment, initialization, parameter passing or return
3657 statements should have a corresponding @code{format} attribute in the
3658 resulting type.  I.e.@: the left-hand side of the assignment or
3659 initialization, the type of the parameter variable, or the return type
3660 of the containing function respectively should also have a @code{format}
3661 attribute to avoid the warning.
3662
3663 GCC will also warn about function definitions which might be
3664 candidates for @code{format} attributes.  Again, these are only
3665 possible candidates.  GCC will guess that @code{format} attributes
3666 might be appropriate for any function that calls a function like
3667 @code{vprintf} or @code{vscanf}, but this might not always be the
3668 case, and some functions for which @code{format} attributes are
3669 appropriate may not be detected.
3670
3671 @item -Wno-multichar
3672 @opindex Wno-multichar
3673 @opindex Wmultichar
3674 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
3675 Usually they indicate a typo in the user's code, as they have
3676 implementation-defined values, and should not be used in portable code.
3677
3678 @item -Wnormalized=<none|id|nfc|nfkc>
3679 @opindex Wnormalized
3680 @cindex NFC
3681 @cindex NFKC
3682 @cindex character set, input normalization
3683 In ISO C and ISO C++, two identifiers are different if they are
3684 different sequences of characters.  However, sometimes when characters
3685 outside the basic ASCII character set are used, you can have two
3686 different character sequences that look the same.  To avoid confusion,
3687 the ISO 10646 standard sets out some @dfn{normalization rules} which
3688 when applied ensure that two sequences that look the same are turned into
3689 the same sequence.  GCC can warn you if you are using identifiers which
3690 have not been normalized; this option controls that warning.
3691
3692 There are four levels of warning that GCC supports.  The default is
3693 @option{-Wnormalized=nfc}, which warns about any identifier which is
3694 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
3695 recommended form for most uses.
3696
3697 Unfortunately, there are some characters which ISO C and ISO C++ allow
3698 in identifiers that when turned into NFC aren't allowable as
3699 identifiers.  That is, there's no way to use these symbols in portable
3700 ISO C or C++ and have all your identifiers in NFC.
3701 @option{-Wnormalized=id} suppresses the warning for these characters.
3702 It is hoped that future versions of the standards involved will correct
3703 this, which is why this option is not the default.
3704
3705 You can switch the warning off for all characters by writing
3706 @option{-Wnormalized=none}.  You would only want to do this if you
3707 were using some other normalization scheme (like ``D''), because
3708 otherwise you can easily create bugs that are literally impossible to see.
3709
3710 Some characters in ISO 10646 have distinct meanings but look identical
3711 in some fonts or display methodologies, especially once formatting has
3712 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
3713 LETTER N'', will display just like a regular @code{n} which has been
3714 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
3715 normalization scheme to convert all these into a standard form as
3716 well, and GCC will warn if your code is not in NFKC if you use
3717 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
3718 about every identifier that contains the letter O because it might be
3719 confused with the digit 0, and so is not the default, but may be
3720 useful as a local coding convention if the programming environment is
3721 unable to be fixed to display these characters distinctly.
3722
3723 @item -Wno-deprecated-declarations
3724 @opindex Wno-deprecated-declarations
3725 Do not warn about uses of functions (@pxref{Function Attributes}),
3726 variables (@pxref{Variable Attributes}), and types (@pxref{Type
3727 Attributes}) marked as deprecated by using the @code{deprecated}
3728 attribute.
3729
3730 @item -Wno-overflow
3731 @opindex Wno-overflow
3732 Do not warn about compile-time overflow in constant expressions.
3733
3734 @item -Woverride-init
3735 @opindex Woverride-init
3736 @opindex W
3737 @opindex Wextra
3738 Warn if an initialized field without side effects is overridden when
3739 using designated initializers (@pxref{Designated Inits, , Designated
3740 Initializers}).
3741
3742 This warning is included in @option{-Wextra}.  To get other
3743 @option{-Wextra} warnings without this one, use @samp{-Wextra
3744 -Wno-override-init}.
3745
3746 @item -Wpacked
3747 @opindex Wpacked
3748 Warn if a structure is given the packed attribute, but the packed
3749 attribute has no effect on the layout or size of the structure.
3750 Such structures may be mis-aligned for little benefit.  For
3751 instance, in this code, the variable @code{f.x} in @code{struct bar}
3752 will be misaligned even though @code{struct bar} does not itself
3753 have the packed attribute:
3754
3755 @smallexample
3756 @group
3757 struct foo @{
3758   int x;
3759   char a, b, c, d;
3760 @} __attribute__((packed));
3761 struct bar @{
3762   char z;
3763   struct foo f;
3764 @};
3765 @end group
3766 @end smallexample
3767
3768 @item -Wpadded
3769 @opindex Wpadded
3770 Warn if padding is included in a structure, either to align an element
3771 of the structure or to align the whole structure.  Sometimes when this
3772 happens it is possible to rearrange the fields of the structure to
3773 reduce the padding and so make the structure smaller.
3774
3775 @item -Wredundant-decls
3776 @opindex Wredundant-decls
3777 Warn if anything is declared more than once in the same scope, even in
3778 cases where multiple declaration is valid and changes nothing.
3779
3780 @item -Wnested-externs @r{(C only)}
3781 @opindex Wnested-externs
3782 Warn if an @code{extern} declaration is encountered within a function.
3783
3784 @item -Wunreachable-code
3785 @opindex Wunreachable-code
3786 Warn if the compiler detects that code will never be executed.
3787
3788 This option is intended to warn when the compiler detects that at
3789 least a whole line of source code will never be executed, because
3790 some condition is never satisfied or because it is after a
3791 procedure that never returns.
3792
3793 It is possible for this option to produce a warning even though there
3794 are circumstances under which part of the affected line can be executed,
3795 so care should be taken when removing apparently-unreachable code.
3796
3797 For instance, when a function is inlined, a warning may mean that the
3798 line is unreachable in only one inlined copy of the function.
3799
3800 This option is not made part of @option{-Wall} because in a debugging
3801 version of a program there is often substantial code which checks
3802 correct functioning of the program and is, hopefully, unreachable
3803 because the program does work.  Another common use of unreachable
3804 code is to provide behavior which is selectable at compile-time.
3805
3806 @item -Winline
3807 @opindex Winline
3808 Warn if a function can not be inlined and it was declared as inline.
3809 Even with this option, the compiler will not warn about failures to
3810 inline functions declared in system headers.
3811
3812 The compiler uses a variety of heuristics to determine whether or not
3813 to inline a function.  For example, the compiler takes into account
3814 the size of the function being inlined and the amount of inlining
3815 that has already been done in the current function.  Therefore,
3816 seemingly insignificant changes in the source program can cause the
3817 warnings produced by @option{-Winline} to appear or disappear.
3818
3819 @item -Wno-invalid-offsetof @r{(C++ only)}
3820 @opindex Wno-invalid-offsetof
3821 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
3822 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
3823 to a non-POD type is undefined.  In existing C++ implementations,
3824 however, @samp{offsetof} typically gives meaningful results even when
3825 applied to certain kinds of non-POD types. (Such as a simple
3826 @samp{struct} that fails to be a POD type only by virtue of having a
3827 constructor.)  This flag is for users who are aware that they are
3828 writing nonportable code and who have deliberately chosen to ignore the
3829 warning about it.
3830
3831 The restrictions on @samp{offsetof} may be relaxed in a future version
3832 of the C++ standard.
3833
3834 @item -Wno-int-to-pointer-cast @r{(C only)}
3835 @opindex Wno-int-to-pointer-cast
3836 Suppress warnings from casts to pointer type of an integer of a
3837 different size.
3838
3839 @item -Wno-pointer-to-int-cast @r{(C only)}
3840 @opindex Wno-pointer-to-int-cast
3841 Suppress warnings from casts from a pointer to an integer type of a
3842 different size.
3843
3844 @item -Winvalid-pch
3845 @opindex Winvalid-pch
3846 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
3847 the search path but can't be used.
3848
3849 @item -Wlong-long
3850 @opindex Wlong-long
3851 @opindex Wno-long-long
3852 Warn if @samp{long long} type is used.  This is default.  To inhibit
3853 the warning messages, use @option{-Wno-long-long}.  Flags
3854 @option{-Wlong-long} and @option{-Wno-long-long} are taken into account
3855 only when @option{-pedantic} flag is used.
3856
3857 @item -Wvariadic-macros
3858 @opindex Wvariadic-macros
3859 @opindex Wno-variadic-macros
3860 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
3861 alternate syntax when in pedantic ISO C99 mode.  This is default.
3862 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
3863
3864 @item -Wvla
3865 @opindex Wvla
3866 @opindex Wno-vla
3867 Warn if variable length array is used in the code.
3868 @option{-Wno-vla} will prevent the @option{-pedantic} warning of
3869 the variable length array.
3870
3871 @item -Wvolatile-register-var
3872 @opindex Wvolatile-register-var
3873 @opindex Wno-volatile-register-var
3874 Warn if a register variable is declared volatile.  The volatile
3875 modifier does not inhibit all optimizations that may eliminate reads
3876 and/or writes to register variables.
3877
3878 @item -Wdisabled-optimization
3879 @opindex Wdisabled-optimization
3880 Warn if a requested optimization pass is disabled.  This warning does
3881 not generally indicate that there is anything wrong with your code; it
3882 merely indicates that GCC's optimizers were unable to handle the code
3883 effectively.  Often, the problem is that your code is too big or too
3884 complex; GCC will refuse to optimize programs when the optimization
3885 itself is likely to take inordinate amounts of time.
3886
3887 @item -Wpointer-sign
3888 @opindex Wpointer-sign
3889 @opindex Wno-pointer-sign
3890 Warn for pointer argument passing or assignment with different signedness.
3891 This option is only supported for C and Objective-C@.  It is implied by
3892 @option{-Wall} and by @option{-pedantic}, which can be disabled with
3893 @option{-Wno-pointer-sign}.
3894
3895 @item -Werror
3896 @opindex Werror
3897 Make all warnings into errors.
3898
3899 @item -Werror=
3900 @opindex Werror=
3901 Make the specified warning into an errors.  The specifier for a
3902 warning is appended, for example @option{-Werror=switch} turns the
3903 warnings controlled by @option{-Wswitch} into errors.  This switch
3904 takes a negative form, to be used to negate @option{-Werror} for
3905 specific warnings, for example @option{-Wno-error=switch} makes
3906 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
3907 is in effect.  You can use the @option{-fdiagnostics-show-option}
3908 option to have each controllable warning amended with the option which
3909 controls it, to determine what to use with this option.
3910
3911 Note that specifying @option{-Werror=}@var{foo} automatically implies
3912 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
3913 imply anything.
3914
3915 @item -Wstack-protector
3916 @opindex Wstack-protector
3917 This option is only active when @option{-fstack-protector} is active.  It
3918 warns about functions that will not be protected against stack smashing.
3919
3920 @item -Woverlength-strings
3921 @opindex Woverlength-strings
3922 Warn about string constants which are longer than the ``minimum
3923 maximum'' length specified in the C standard.  Modern compilers
3924 generally allow string constants which are much longer than the
3925 standard's minimum limit, but very portable programs should avoid
3926 using longer strings.
3927
3928 The limit applies @emph{after} string constant concatenation, and does
3929 not count the trailing NUL@.  In C89, the limit was 509 characters; in
3930 C99, it was raised to 4095.  C++98 does not specify a normative
3931 minimum maximum, so we do not diagnose overlength strings in C++@.
3932
3933 This option is implied by @option{-pedantic}, and can be disabled with
3934 @option{-Wno-overlength-strings}.
3935 @end table
3936
3937 @node Debugging Options
3938 @section Options for Debugging Your Program or GCC
3939 @cindex options, debugging
3940 @cindex debugging information options
3941
3942 GCC has various special options that are used for debugging
3943 either your program or GCC:
3944
3945 @table @gcctabopt
3946 @item -g
3947 @opindex g
3948 Produce debugging information in the operating system's native format
3949 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
3950 information.
3951
3952 On most systems that use stabs format, @option{-g} enables use of extra
3953 debugging information that only GDB can use; this extra information
3954 makes debugging work better in GDB but will probably make other debuggers
3955 crash or
3956 refuse to read the program.  If you want to control for certain whether
3957 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
3958 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
3959
3960 GCC allows you to use @option{-g} with
3961 @option{-O}.  The shortcuts taken by optimized code may occasionally
3962 produce surprising results: some variables you declared may not exist
3963 at all; flow of control may briefly move where you did not expect it;
3964 some statements may not be executed because they compute constant
3965 results or their values were already at hand; some statements may
3966 execute in different places because they were moved out of loops.
3967
3968 Nevertheless it proves possible to debug optimized output.  This makes
3969 it reasonable to use the optimizer for programs that might have bugs.
3970
3971 The following options are useful when GCC is generated with the
3972 capability for more than one debugging format.
3973
3974 @item -ggdb
3975 @opindex ggdb
3976 Produce debugging information for use by GDB@.  This means to use the
3977 most expressive format available (DWARF 2, stabs, or the native format
3978 if neither of those are supported), including GDB extensions if at all
3979 possible.
3980
3981 @item -gstabs
3982 @opindex gstabs
3983 Produce debugging information in stabs format (if that is supported),
3984 without GDB extensions.  This is the format used by DBX on most BSD
3985 systems.  On MIPS, Alpha and System V Release 4 systems this option
3986 produces stabs debugging output which is not understood by DBX or SDB@.
3987 On System V Release 4 systems this option requires the GNU assembler.
3988
3989 @item -feliminate-unused-debug-symbols
3990 @opindex feliminate-unused-debug-symbols
3991 Produce debugging information in stabs format (if that is supported),
3992 for only symbols that are actually used.
3993
3994 @item -femit-class-debug-always
3995 Instead of emitting debugging information for a C++ class in only one
3996 object file, emit it in all object files using the class.  This option
3997 should be used only with debuggers that are unable to handle the way GCC
3998 normally emits debugging information for classes because using this
3999 option will increase the size of debugging information by as much as a
4000 factor of two.
4001
4002 @item -gstabs+
4003 @opindex gstabs+
4004 Produce debugging information in stabs format (if that is supported),
4005 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4006 use of these extensions is likely to make other debuggers crash or
4007 refuse to read the program.
4008
4009 @item -gcoff
4010 @opindex gcoff
4011 Produce debugging information in COFF format (if that is supported).
4012 This is the format used by SDB on most System V systems prior to
4013 System V Release 4.
4014
4015 @item -gxcoff
4016 @opindex gxcoff
4017 Produce debugging information in XCOFF format (if that is supported).
4018 This is the format used by the DBX debugger on IBM RS/6000 systems.
4019
4020 @item -gxcoff+
4021 @opindex gxcoff+
4022 Produce debugging information in XCOFF format (if that is supported),
4023 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4024 use of these extensions is likely to make other debuggers crash or
4025 refuse to read the program, and may cause assemblers other than the GNU
4026 assembler (GAS) to fail with an error.
4027
4028 @item -gdwarf-2
4029 @opindex gdwarf-2
4030 Produce debugging information in DWARF version 2 format (if that is
4031 supported).  This is the format used by DBX on IRIX 6.  With this
4032 option, GCC uses features of DWARF version 3 when they are useful;
4033 version 3 is upward compatible with version 2, but may still cause
4034 problems for older debuggers.
4035
4036 @item -gvms
4037 @opindex gvms
4038 Produce debugging information in VMS debug format (if that is
4039 supported).  This is the format used by DEBUG on VMS systems.
4040
4041 @item -g@var{level}
4042 @itemx -ggdb@var{level}
4043 @itemx -gstabs@var{level}
4044 @itemx -gcoff@var{level}
4045 @itemx -gxcoff@var{level}
4046 @itemx -gvms@var{level}
4047 Request debugging information and also use @var{level} to specify how
4048 much information.  The default level is 2.
4049
4050 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
4051 @option{-g}.
4052
4053 Level 1 produces minimal information, enough for making backtraces in
4054 parts of the program that you don't plan to debug.  This includes
4055 descriptions of functions and external variables, but no information
4056 about local variables and no line numbers.
4057
4058 Level 3 includes extra information, such as all the macro definitions
4059 present in the program.  Some debuggers support macro expansion when
4060 you use @option{-g3}.
4061
4062 @option{-gdwarf-2} does not accept a concatenated debug level, because
4063 GCC used to support an option @option{-gdwarf} that meant to generate
4064 debug information in version 1 of the DWARF format (which is very
4065 different from version 2), and it would have been too confusing.  That
4066 debug format is long obsolete, but the option cannot be changed now.
4067 Instead use an additional @option{-g@var{level}} option to change the
4068 debug level for DWARF2.
4069
4070 @item -feliminate-dwarf2-dups
4071 @opindex feliminate-dwarf2-dups
4072 Compress DWARF2 debugging information by eliminating duplicated
4073 information about each symbol.  This option only makes sense when
4074 generating DWARF2 debugging information with @option{-gdwarf-2}.
4075
4076 @item -femit-struct-debug-baseonly
4077 Emit debug information for struct-like types
4078 only when the base name of the compilation source file
4079 matches the base name of file in which the struct was defined.
4080
4081 This option substantially reduces the size of debugging information,
4082 but at significant potential loss in type information to the debugger.
4083 See @option{-femit-struct-debug-reduced} for a less aggressive option.
4084 See @option{-femit-struct-debug-detailed} for more detailed control.
4085
4086 This option works only with DWARF 2.
4087
4088 @item -femit-struct-debug-reduced
4089 Emit debug information for struct-like types
4090 only when the base name of the compilation source file
4091 matches the base name of file in which the type was defined,
4092 unless the struct is a template or defined in a system header.
4093
4094 This option significantly reduces the size of debugging information,
4095 with some potential loss in type information to the debugger.
4096 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
4097 See @option{-femit-struct-debug-detailed} for more detailed control.
4098
4099 This option works only with DWARF 2.
4100
4101 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
4102 Specify the struct-like types
4103 for which the compiler will generate debug information.
4104 The intent is to reduce duplicate struct debug information
4105 between different object files within the same program.
4106
4107 This option is a detailed version of
4108 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
4109 which will serve for most needs.
4110
4111 A specification has the syntax
4112 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
4113
4114 The optional first word limits the specification to
4115 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
4116 A struct type is used directly when it is the type of a variable, member.
4117 Indirect uses arise through pointers to structs.
4118 That is, when use of an incomplete struct would be legal, the use is indirect.
4119 An example is
4120 @samp{struct one direct; struct two * indirect;}.
4121
4122 The optional second word limits the specification to
4123 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
4124 Generic structs are a bit complicated to explain.
4125 For C++, these are non-explicit specializations of template classes,
4126 or non-template classes within the above.
4127 Other programming languages have generics,
4128 but @samp{-femit-struct-debug-detailed} does not yet implement them.
4129
4130 The third word specifies the source files for those
4131 structs for which the compiler will emit debug information.
4132 The values @samp{none} and @samp{any} have the normal meaning.
4133 The value @samp{base} means that
4134 the base of name of the file in which the type declaration appears
4135 must match the base of the name of the main compilation file.
4136 In practice, this means that
4137 types declared in @file{foo.c} and @file{foo.h} will have debug information,
4138 but types declared in other header will not.
4139 The value @samp{sys} means those types satisfying @samp{base}
4140 or declared in system or compiler headers.
4141
4142 You may need to experiment to determine the best settings for your application.
4143
4144 The default is @samp{-femit-struct-debug-detailed=all}.
4145
4146 This option works only with DWARF 2.
4147
4148 @item -fdebug-prefix-map=@var{old}=@var{new}
4149 @opindex fdebug-prefix-map
4150 When compiling files in directory @file{@var{old}}, record debugging
4151 information describing them as in @file{@var{new}} instead.
4152
4153 @cindex @command{prof}
4154 @item -p
4155 @opindex p
4156 Generate extra code to write profile information suitable for the
4157 analysis program @command{prof}.  You must use this option when compiling
4158 the source files you want data about, and you must also use it when
4159 linking.
4160
4161 @cindex @command{gprof}
4162 @item -pg
4163 @opindex pg
4164 Generate extra code to write profile information suitable for the
4165 analysis program @command{gprof}.  You must use this option when compiling
4166 the source files you want data about, and you must also use it when
4167 linking.
4168
4169 @item -Q
4170 @opindex Q
4171 Makes the compiler print out each function name as it is compiled, and
4172 print some statistics about each pass when it finishes.
4173
4174 @item -ftime-report
4175 @opindex ftime-report
4176 Makes the compiler print some statistics about the time consumed by each
4177 pass when it finishes.
4178
4179 @item -fmem-report
4180 @opindex fmem-report
4181 Makes the compiler print some statistics about permanent memory
4182 allocation when it finishes.
4183
4184 @item -fpre-ipa-mem-report
4185 @opindex fpre-ipa-mem-report
4186 @item -fpost-ipa-mem-report
4187 @opindex fpost-ipa-mem-report
4188 Makes the compiler print some statistics about permanent memory
4189 allocation before or after interprocedural optimization.
4190
4191 @item -fprofile-arcs
4192 @opindex fprofile-arcs
4193 Add code so that program flow @dfn{arcs} are instrumented.  During
4194 execution the program records how many times each branch and call is
4195 executed and how many times it is taken or returns.  When the compiled
4196 program exits it saves this data to a file called
4197 @file{@var{auxname}.gcda} for each source file.  The data may be used for
4198 profile-directed optimizations (@option{-fbranch-probabilities}), or for
4199 test coverage analysis (@option{-ftest-coverage}).  Each object file's
4200 @var{auxname} is generated from the name of the output file, if
4201 explicitly specified and it is not the final executable, otherwise it is
4202 the basename of the source file.  In both cases any suffix is removed
4203 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
4204 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
4205 @xref{Cross-profiling}.
4206
4207 @cindex @command{gcov}
4208 @item --coverage
4209 @opindex coverage
4210
4211 This option is used to compile and link code instrumented for coverage
4212 analysis.  The option is a synonym for @option{-fprofile-arcs}
4213 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
4214 linking).  See the documentation for those options for more details.
4215
4216 @itemize
4217
4218 @item
4219 Compile the source files with @option{-fprofile-arcs} plus optimization
4220 and code generation options.  For test coverage analysis, use the
4221 additional @option{-ftest-coverage} option.  You do not need to profile
4222 every source file in a program.
4223
4224 @item
4225 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
4226 (the latter implies the former).
4227
4228 @item
4229 Run the program on a representative workload to generate the arc profile
4230 information.  This may be repeated any number of times.  You can run
4231 concurrent instances of your program, and provided that the file system
4232 supports locking, the data files will be correctly updated.  Also
4233 @code{fork} calls are detected and correctly handled (double counting
4234 will not happen).
4235
4236 @item
4237 For profile-directed optimizations, compile the source files again with
4238 the same optimization and code generation options plus
4239 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
4240 Control Optimization}).
4241
4242 @item
4243 For test coverage analysis, use @command{gcov} to produce human readable
4244 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
4245 @command{gcov} documentation for further information.
4246
4247 @end itemize
4248
4249 With @option{-fprofile-arcs}, for each function of your program GCC
4250 creates a program flow graph, then finds a spanning tree for the graph.
4251 Only arcs that are not on the spanning tree have to be instrumented: the
4252 compiler adds code to count the number of times that these arcs are
4253 executed.  When an arc is the only exit or only entrance to a block, the
4254 instrumentation code can be added to the block; otherwise, a new basic
4255 block must be created to hold the instrumentation code.
4256
4257 @need 2000
4258 @item -ftest-coverage
4259 @opindex ftest-coverage
4260 Produce a notes file that the @command{gcov} code-coverage utility
4261 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
4262 show program coverage.  Each source file's note file is called
4263 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
4264 above for a description of @var{auxname} and instructions on how to
4265 generate test coverage data.  Coverage data will match the source files
4266 more closely, if you do not optimize.
4267
4268 @item -fdbg-cnt-list
4269 @opindex fdbg-cnt-list
4270 Print the name and the counter upperbound for all debug counters.
4271
4272 @item -fdbg-cnt=@var{counter-value-list}
4273 @opindex fdbg-cnt
4274 Set the internal debug counter upperbound. @var{counter-value-list} 
4275 is a comma-separated list of @var{name}:@var{value} pairs
4276 which sets the upperbound of each debug counter @var{name} to @var{value}.
4277 All debug counters have the initial upperbound of @var{UINT_MAX},
4278 thus dbg_cnt() returns true always unless the upperbound is set by this option.
4279 e.g. With -fdbg-cnt=dce:10,tail_call:0
4280 dbg_cnt(dce) will return true only for first 10 invocations
4281 and dbg_cnt(tail_call) will return false always.
4282
4283 @item -d@var{letters}
4284 @item -fdump-rtl-@var{pass}
4285 @opindex d
4286 Says to make debugging dumps during compilation at times specified by
4287 @var{letters}.    This is used for debugging the RTL-based passes of the
4288 compiler.  The file names for most of the dumps are made by appending a
4289 pass number and a word to the @var{dumpname}.  @var{dumpname} is generated
4290 from the name of the output file, if explicitly specified and it is not
4291 an executable, otherwise it is the basename of the source file. These
4292 switches may have different effects when @option{-E} is used for
4293 preprocessing.
4294
4295 Most debug dumps can be enabled either passing a letter to the @option{-d}
4296 option, or with a long @option{-fdump-rtl} switch; here are the possible
4297 letters for use in @var{letters} and @var{pass}, and their meanings:
4298
4299 @table @gcctabopt
4300 @item -dA
4301 @opindex dA
4302 Annotate the assembler output with miscellaneous debugging information.
4303
4304 @item -dB
4305 @itemx -fdump-rtl-bbro
4306 @opindex dB
4307 @opindex fdump-rtl-bbro
4308 Dump after block reordering, to @file{@var{file}.148r.bbro}.
4309
4310 @item -dc
4311 @itemx -fdump-rtl-combine
4312 @opindex dc
4313 @opindex fdump-rtl-combine
4314 Dump after the RTL instruction combination pass, to the file
4315 @file{@var{file}.129r.combine}.
4316
4317 @item -dC
4318 @itemx -fdump-rtl-ce1
4319 @itemx -fdump-rtl-ce2
4320 @opindex dC
4321 @opindex fdump-rtl-ce1
4322 @opindex fdump-rtl-ce2
4323 @option{-dC} and @option{-fdump-rtl-ce1} enable dumping after the
4324 first if conversion, to the file @file{@var{file}.117r.ce1}.  @option{-dC}
4325 and @option{-fdump-rtl-ce2} enable dumping after the second if
4326 conversion, to the file @file{@var{file}.130r.ce2}.
4327
4328 @item -dd
4329 @itemx -fdump-rtl-btl
4330 @itemx -fdump-rtl-dbr
4331 @opindex dd
4332 @opindex fdump-rtl-btl
4333 @opindex fdump-rtl-dbr
4334 @option{-dd} and @option{-fdump-rtl-btl} enable dumping after branch
4335 target load optimization, to @file{@var{file}.31.btl}.  @option{-dd}
4336 and @option{-fdump-rtl-dbr} enable dumping after delayed branch
4337 scheduling, to @file{@var{file}.36.dbr}.
4338
4339 @item -dD
4340 @opindex dD
4341 Dump all macro definitions, at the end of preprocessing, in addition to
4342 normal output.
4343
4344 @item -dE
4345 @itemx -fdump-rtl-ce3
4346 @opindex dE
4347 @opindex fdump-rtl-ce3
4348 Dump after the third if conversion, to @file{@var{file}.146r.ce3}.
4349
4350 @item -df
4351 @itemx -fdump-rtl-cfg
4352 @itemx -fdump-rtl-life
4353 @opindex df
4354 @opindex fdump-rtl-cfg
4355 @opindex fdump-rtl-life
4356 @option{-df} and @option{-fdump-rtl-cfg} enable dumping after control
4357 and data flow analysis, to @file{@var{file}.116r.cfg}.  @option{-df}
4358 and @option{-fdump-rtl-cfg} enable dumping dump after life analysis,
4359 to @file{@var{file}.128r.life1} and @file{@var{file}.135r.life2}.
4360
4361 @item -dg
4362 @itemx -fdump-rtl-greg
4363 @opindex dg
4364 @opindex fdump-rtl-greg
4365 Dump after global register allocation, to @file{@var{file}.139r.greg}.
4366
4367 @item -dG
4368 @itemx -fdump-rtl-gcse
4369 @itemx -fdump-rtl-bypass
4370 @opindex dG
4371 @opindex fdump-rtl-gcse
4372 @opindex fdump-rtl-bypass
4373 @option{-dG} and @option{-fdump-rtl-gcse} enable dumping after GCSE, to
4374 @file{@var{file}.114r.gcse}.  @option{-dG} and @option{-fdump-rtl-bypass}
4375 enable dumping after jump bypassing and control flow optimizations, to
4376 @file{@var{file}.115r.bypass}.
4377
4378 @item -dh
4379 @itemx -fdump-rtl-eh
4380 @opindex dh
4381 @opindex fdump-rtl-eh
4382 Dump after finalization of EH handling code, to @file{@var{file}.02.eh}.
4383
4384 @item -di
4385 @itemx -fdump-rtl-sibling
4386 @opindex di
4387 @opindex fdump-rtl-sibling
4388 Dump after sibling call optimizations, to @file{@var{file}.106r.sibling}.
4389
4390 @item -dj
4391 @itemx -fdump-rtl-jump
4392 @opindex dj
4393 @opindex fdump-rtl-jump
4394 Dump after the first jump optimization, to @file{@var{file}.112r.jump}.
4395
4396 @item -dk
4397 @itemx -fdump-rtl-stack
4398 @opindex dk
4399 @opindex fdump-rtl-stack
4400 Dump after conversion from GCC's "flat register file" registers to the
4401 x87's stack-like registers, to @file{@var{file}.152r.stack}.
4402
4403 @item -dl
4404 @itemx -fdump-rtl-lreg
4405 @opindex dl
4406 @opindex fdump-rtl-lreg
4407 Dump after local register allocation, to @file{@var{file}.138r.lreg}.
4408
4409 @item -dL
4410 @itemx -fdump-rtl-loop2
4411 @opindex dL
4412 @opindex fdump-rtl-loop2
4413 @option{-dL} and @option{-fdump-rtl-loop2} enable dumping after the
4414 loop optimization pass, to @file{@var{file}.119r.loop2},
4415 @file{@var{file}.120r.loop2_init},
4416 @file{@var{file}.121r.loop2_invariant}, and
4417 @file{@var{file}.125r.loop2_done}.
4418
4419 @item -dm
4420 @itemx -fdump-rtl-sms
4421 @opindex dm
4422 @opindex fdump-rtl-sms
4423 Dump after modulo scheduling, to @file{@var{file}.136r.sms}.
4424
4425 @item -dM
4426 @itemx -fdump-rtl-mach
4427 @opindex dM
4428 @opindex fdump-rtl-mach
4429 Dump after performing the machine dependent reorganization pass, to
4430 @file{@var{file}.155r.mach} if that pass exists.
4431
4432 @item -dn
4433 @itemx -fdump-rtl-rnreg
4434 @opindex dn
4435 @opindex fdump-rtl-rnreg
4436 Dump after register renumbering, to @file{@var{file}.147r.rnreg}.
4437
4438 @item -dN
4439 @itemx -fdump-rtl-regmove
4440 @opindex dN
4441 @opindex fdump-rtl-regmove
4442 Dump after the register move pass, to @file{@var{file}.132r.regmove}.
4443
4444 @item -do
4445 @itemx -fdump-rtl-postreload
4446 @opindex do
4447 @opindex fdump-rtl-postreload
4448 Dump after post-reload optimizations, to @file{@var{file}.24.postreload}.
4449
4450 @item -dr
4451 @itemx -fdump-rtl-expand
4452 @opindex dr
4453 @opindex fdump-rtl-expand
4454 Dump after RTL generation, to @file{@var{file}.104r.expand}.
4455
4456 @item -dR
4457 @itemx -fdump-rtl-sched2
4458 @opindex dR
4459 @opindex fdump-rtl-sched2
4460 Dump after the second scheduling pass, to @file{@var{file}.149r.sched2}.
4461
4462 @item -ds
4463 @itemx -fdump-rtl-cse
4464 @opindex ds
4465 @opindex fdump-rtl-cse
4466 Dump after CSE (including the jump optimization that sometimes follows
4467 CSE), to @file{@var{file}.113r.cse}.
4468
4469 @item -dS
4470 @itemx -fdump-rtl-sched1
4471 @opindex dS
4472 @opindex fdump-rtl-sched1
4473 Dump after the first scheduling pass, to @file{@var{file}.136r.sched1}.
4474
4475 @item -dt
4476 @itemx -fdump-rtl-cse2
4477 @opindex dt
4478 @opindex fdump-rtl-cse2
4479 Dump after the second CSE pass (including the jump optimization that
4480 sometimes follows CSE), to @file{@var{file}.127r.cse2}.
4481
4482 @item -dT
4483 @itemx -fdump-rtl-tracer
4484 @opindex dT
4485 @opindex fdump-rtl-tracer
4486 Dump after running tracer, to @file{@var{file}.118r.tracer}.
4487
4488 @item -dV
4489 @itemx -fdump-rtl-vpt
4490 @itemx -fdump-rtl-vartrack
4491 @opindex dV
4492 @opindex fdump-rtl-vpt
4493 @opindex fdump-rtl-vartrack
4494 @option{-dV} and @option{-fdump-rtl-vpt} enable dumping after the value
4495 profile transformations, to @file{@var{file}.10.vpt}.  @option{-dV}
4496 and @option{-fdump-rtl-vartrack} enable dumping after variable tracking,
4497 to @file{@var{file}.154r.vartrack}.
4498
4499 @item -dw
4500 @itemx -fdump-rtl-flow2
4501 @opindex dw
4502 @opindex fdump-rtl-flow2
4503 Dump after the second flow pass, to @file{@var{file}.142r.flow2}.
4504
4505 @item -dz
4506 @itemx -fdump-rtl-peephole2
4507 @opindex dz
4508 @opindex fdump-rtl-peephole2
4509 Dump after the peephole pass, to @file{@var{file}.145r.peephole2}.
4510
4511 @item -dZ
4512 @itemx -fdump-rtl-web
4513 @opindex dZ
4514 @opindex fdump-rtl-web
4515 Dump after live range splitting, to @file{@var{file}.126r.web}.
4516
4517 @item -da
4518 @itemx -fdump-rtl-all
4519 @opindex da
4520 @opindex fdump-rtl-all
4521 Produce all the dumps listed above.
4522
4523 @item -dH
4524 @opindex dH
4525 Produce a core dump whenever an error occurs.
4526
4527 @item -dm
4528 @opindex dm
4529 Print statistics on memory usage, at the end of the run, to
4530 standard error.
4531
4532 @item -dp
4533 @opindex dp
4534 Annotate the assembler output with a comment indicating which
4535 pattern and alternative was used.  The length of each instruction is
4536 also printed.
4537
4538 @item -dP
4539 @opindex dP
4540 Dump the RTL in the assembler output as a comment before each instruction.
4541 Also turns on @option{-dp} annotation.
4542
4543 @item -dv
4544 @opindex dv
4545 For each of the other indicated dump files (either with @option{-d} or
4546 @option{-fdump-rtl-@var{pass}}), dump a representation of the control flow
4547 graph suitable for viewing with VCG to @file{@var{file}.@var{pass}.vcg}.
4548
4549 @item -dx
4550 @opindex dx
4551 Just generate RTL for a function instead of compiling it.  Usually used
4552 with @samp{r} (@option{-fdump-rtl-expand}).
4553
4554 @item -dy
4555 @opindex dy
4556 Dump debugging information during parsing, to standard error.
4557 @end table
4558
4559 @item -fdump-noaddr
4560 @opindex fdump-noaddr
4561 When doing debugging dumps (see @option{-d} option above), suppress
4562 address output.  This makes it more feasible to use diff on debugging
4563 dumps for compiler invocations with different compiler binaries and/or
4564 different text / bss / data / heap / stack / dso start locations.
4565
4566 @item -fdump-unnumbered
4567 @opindex fdump-unnumbered
4568 When doing debugging dumps (see @option{-d} option above), suppress instruction
4569 numbers and address output.  This makes it more feasible to
4570 use diff on debugging dumps for compiler invocations with different
4571 options, in particular with and without @option{-g}.
4572
4573 @item -fdump-translation-unit @r{(C++ only)}
4574 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
4575 @opindex fdump-translation-unit
4576 Dump a representation of the tree structure for the entire translation
4577 unit to a file.  The file name is made by appending @file{.tu} to the
4578 source file name.  If the @samp{-@var{options}} form is used, @var{options}
4579 controls the details of the dump as described for the
4580 @option{-fdump-tree} options.
4581
4582 @item -fdump-class-hierarchy @r{(C++ only)}
4583 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
4584 @opindex fdump-class-hierarchy
4585 Dump a representation of each class's hierarchy and virtual function
4586 table layout to a file.  The file name is made by appending @file{.class}
4587 to the source file name.  If the @samp{-@var{options}} form is used,
4588 @var{options} controls the details of the dump as described for the
4589 @option{-fdump-tree} options.
4590
4591 @item -fdump-ipa-@var{switch}
4592 @opindex fdump-ipa
4593 Control the dumping at various stages of inter-procedural analysis
4594 language tree to a file.  The file name is generated by appending a switch
4595 specific suffix to the source file name.  The following dumps are possible:
4596
4597 @table @samp
4598 @item all
4599 Enables all inter-procedural analysis dumps; currently the only produced
4600 dump is the @samp{cgraph} dump.
4601
4602 @item cgraph
4603 Dumps information about call-graph optimization, unused function removal,
4604 and inlining decisions.
4605 @end table
4606
4607 @item -fdump-tree-@var{switch}
4608 @itemx -fdump-tree-@var{switch}-@var{options}
4609 @opindex fdump-tree
4610 Control the dumping at various stages of processing the intermediate
4611 language tree to a file.  The file name is generated by appending a switch
4612 specific suffix to the source file name.  If the @samp{-@var{options}}
4613 form is used, @var{options} is a list of @samp{-} separated options that
4614 control the details of the dump.  Not all options are applicable to all
4615 dumps, those which are not meaningful will be ignored.  The following
4616 options are available
4617
4618 @table @samp
4619 @item address
4620 Print the address of each node.  Usually this is not meaningful as it
4621 changes according to the environment and source file.  Its primary use
4622 is for tying up a dump file with a debug environment.
4623 @item slim
4624 Inhibit dumping of members of a scope or body of a function merely
4625 because that scope has been reached.  Only dump such items when they
4626 are directly reachable by some other path.  When dumping pretty-printed
4627 trees, this option inhibits dumping the bodies of control structures.
4628 @item raw
4629 Print a raw representation of the tree.  By default, trees are
4630 pretty-printed into a C-like representation.
4631 @item details
4632 Enable more detailed dumps (not honored by every dump option).
4633 @item stats
4634 Enable dumping various statistics about the pass (not honored by every dump
4635 option).
4636 @item blocks
4637 Enable showing basic block boundaries (disabled in raw dumps).
4638 @item vops
4639 Enable showing virtual operands for every statement.
4640 @item lineno
4641 Enable showing line numbers for statements.
4642 @item uid
4643 Enable showing the unique ID (@code{DECL_UID}) for each variable.
4644 @item all
4645 Turn on all options, except @option{raw}, @option{slim} and @option{lineno}.
4646 @end table
4647
4648 The following tree dumps are possible:
4649 @table @samp
4650
4651 @item original
4652 Dump before any tree based optimization, to @file{@var{file}.original}.
4653
4654 @item optimized
4655 Dump after all tree based optimization, to @file{@var{file}.optimized}.
4656
4657 @item inlined
4658 Dump after function inlining, to @file{@var{file}.inlined}.
4659
4660 @item gimple
4661 @opindex fdump-tree-gimple
4662 Dump each function before and after the gimplification pass to a file.  The
4663 file name is made by appending @file{.gimple} to the source file name.
4664
4665 @item cfg
4666 @opindex fdump-tree-cfg
4667 Dump the control flow graph of each function to a file.  The file name is
4668 made by appending @file{.cfg} to the source file name.
4669
4670 @item vcg
4671 @opindex fdump-tree-vcg
4672 Dump the control flow graph of each function to a file in VCG format.  The
4673 file name is made by appending @file{.vcg} to the source file name.  Note
4674 that if the file contains more than one function, the generated file cannot
4675 be used directly by VCG@.  You will need to cut and paste each function's
4676 graph into its own separate file first.
4677
4678 @item ch
4679 @opindex fdump-tree-ch
4680 Dump each function after copying loop headers.  The file name is made by
4681 appending @file{.ch} to the source file name.
4682
4683 @item ssa
4684 @opindex fdump-tree-ssa
4685 Dump SSA related information to a file.  The file name is made by appending
4686 @file{.ssa} to the source file name.
4687
4688 @item salias
4689 @opindex fdump-tree-salias
4690 Dump structure aliasing variable information to a file.  This file name
4691 is made by appending @file{.salias} to the source file name.
4692
4693 @item alias
4694 @opindex fdump-tree-alias
4695 Dump aliasing information for each function.  The file name is made by
4696 appending @file{.alias} to the source file name.
4697
4698 @item ccp
4699 @opindex fdump-tree-ccp
4700 Dump each function after CCP@.  The file name is made by appending
4701 @file{.ccp} to the source file name.
4702
4703 @item storeccp
4704 @opindex fdump-tree-storeccp
4705 Dump each function after STORE-CCP.  The file name is made by appending
4706 @file{.storeccp} to the source file name.
4707
4708 @item pre
4709 @opindex fdump-tree-pre
4710 Dump trees after partial redundancy elimination.  The file name is made
4711 by appending @file{.pre} to the source file name.
4712
4713 @item fre
4714 @opindex fdump-tree-fre
4715 Dump trees after full redundancy elimination.  The file name is made
4716 by appending @file{.fre} to the source file name.
4717
4718 @item copyprop
4719 @opindex fdump-tree-copyprop
4720 Dump trees after copy propagation.  The file name is made
4721 by appending @file{.copyprop} to the source file name.
4722
4723 @item store_copyprop
4724 @opindex fdump-tree-store_copyprop
4725 Dump trees after store copy-propagation.  The file name is made
4726 by appending @file{.store_copyprop} to the source file name.
4727
4728 @item dce
4729 @opindex fdump-tree-dce
4730 Dump each function after dead code elimination.  The file name is made by
4731 appending @file{.dce} to the source file name.
4732
4733 @item mudflap
4734 @opindex fdump-tree-mudflap
4735 Dump each function after adding mudflap instrumentation.  The file name is
4736 made by appending @file{.mudflap} to the source file name.
4737
4738 @item sra
4739 @opindex fdump-tree-sra
4740 Dump each function after performing scalar replacement of aggregates.  The
4741 file name is made by appending @file{.sra} to the source file name.
4742
4743 @item sink
4744 @opindex fdump-tree-sink
4745 Dump each function after performing code sinking.  The file name is made
4746 by appending @file{.sink} to the source file name.
4747
4748 @item dom
4749 @opindex fdump-tree-dom
4750 Dump each function after applying dominator tree optimizations.  The file
4751 name is made by appending @file{.dom} to the source file name.
4752
4753 @item dse
4754 @opindex fdump-tree-dse
4755 Dump each function after applying dead store elimination.  The file
4756 name is made by appending @file{.dse} to the source file name.
4757
4758 @item phiopt
4759 @opindex fdump-tree-phiopt
4760 Dump each function after optimizing PHI nodes into straightline code.  The file
4761 name is made by appending @file{.phiopt} to the source file name.
4762
4763 @item forwprop
4764 @opindex fdump-tree-forwprop
4765 Dump each function after forward propagating single use variables.  The file
4766 name is made by appending @file{.forwprop} to the source file name.
4767
4768 @item copyrename
4769 @opindex fdump-tree-copyrename
4770 Dump each function after applying the copy rename optimization.  The file
4771 name is made by appending @file{.copyrename} to the source file name.
4772
4773 @item nrv
4774 @opindex fdump-tree-nrv
4775 Dump each function after applying the named return value optimization on
4776 generic trees.  The file name is made by appending @file{.nrv} to the source
4777 file name.
4778
4779 @item vect
4780 @opindex fdump-tree-vect
4781 Dump each function after applying vectorization of loops.  The file name is
4782 made by appending @file{.vect} to the source file name.
4783
4784 @item vrp
4785 @opindex fdump-tree-vrp
4786 Dump each function after Value Range Propagation (VRP).  The file name
4787 is made by appending @file{.vrp} to the source file name.
4788
4789 @item all
4790 @opindex fdump-tree-all
4791 Enable all the available tree dumps with the flags provided in this option.
4792 @end table
4793
4794 @item -ftree-vectorizer-verbose=@var{n}
4795 @opindex ftree-vectorizer-verbose
4796 This option controls the amount of debugging output the vectorizer prints.
4797 This information is written to standard error, unless
4798 @option{-fdump-tree-all} or @option{-fdump-tree-vect} is specified,
4799 in which case it is output to the usual dump listing file, @file{.vect}.
4800 For @var{n}=0 no diagnostic information is reported.
4801 If @var{n}=1 the vectorizer reports each loop that got vectorized,
4802 and the total number of loops that got vectorized.
4803 If @var{n}=2 the vectorizer also reports non-vectorized loops that passed
4804 the first analysis phase (vect_analyze_loop_form) - i.e. countable,
4805 inner-most, single-bb, single-entry/exit loops.  This is the same verbosity
4806 level that @option{-fdump-tree-vect-stats} uses.
4807 Higher verbosity levels mean either more information dumped for each
4808 reported loop, or same amount of information reported for more loops:
4809 If @var{n}=3, alignment related information is added to the reports.
4810 If @var{n}=4, data-references related information (e.g. memory dependences,
4811 memory access-patterns) is added to the reports.
4812 If @var{n}=5, the vectorizer reports also non-vectorized inner-most loops
4813 that did not pass the first analysis phase (i.e. may not be countable, or
4814 may have complicated control-flow).
4815 If @var{n}=6, the vectorizer reports also non-vectorized nested loops.
4816 For @var{n}=7, all the information the vectorizer generates during its
4817 analysis and transformation is reported.  This is the same verbosity level
4818 that @option{-fdump-tree-vect-details} uses.
4819
4820 @item -frandom-seed=@var{string}
4821 @opindex frandom-string
4822 This option provides a seed that GCC uses when it would otherwise use
4823 random numbers.  It is used to generate certain symbol names
4824 that have to be different in every compiled file.  It is also used to
4825 place unique stamps in coverage data files and the object files that
4826 produce them.  You can use the @option{-frandom-seed} option to produce
4827 reproducibly identical object files.
4828
4829 The @var{string} should be different for every file you compile.
4830
4831 @item -fsched-verbose=@var{n}
4832 @opindex fsched-verbose
4833 On targets that use instruction scheduling, this option controls the
4834 amount of debugging output the scheduler prints.  This information is
4835 written to standard error, unless @option{-dS} or @option{-dR} is
4836 specified, in which case it is output to the usual dump
4837 listing file, @file{.sched} or @file{.sched2} respectively.  However
4838 for @var{n} greater than nine, the output is always printed to standard
4839 error.
4840
4841 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
4842 same information as @option{-dRS}.  For @var{n} greater than one, it
4843 also output basic block probabilities, detailed ready list information
4844 and unit/insn info.  For @var{n} greater than two, it includes RTL
4845 at abort point, control-flow and regions info.  And for @var{n} over
4846 four, @option{-fsched-verbose} also includes dependence info.
4847
4848 @item -save-temps
4849 @opindex save-temps
4850 Store the usual ``temporary'' intermediate files permanently; place them
4851 in the current directory and name them based on the source file.  Thus,
4852 compiling @file{foo.c} with @samp{-c -save-temps} would produce files
4853 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
4854 preprocessed @file{foo.i} output file even though the compiler now
4855 normally uses an integrated preprocessor.
4856
4857 When used in combination with the @option{-x} command line option,
4858 @option{-save-temps} is sensible enough to avoid over writing an
4859 input source file with the same extension as an intermediate file.
4860 The corresponding intermediate file may be obtained by renaming the
4861 source file before using @option{-save-temps}.
4862
4863 @item -time
4864 @opindex time
4865 Report the CPU time taken by each subprocess in the compilation
4866 sequence.  For C source files, this is the compiler proper and assembler
4867 (plus the linker if linking is done).  The output looks like this:
4868
4869 @smallexample
4870 # cc1 0.12 0.01
4871 # as 0.00 0.01
4872 @end smallexample
4873
4874 The first number on each line is the ``user time'', that is time spent
4875 executing the program itself.  The second number is ``system time'',
4876 time spent executing operating system routines on behalf of the program.
4877 Both numbers are in seconds.
4878
4879 @item -fvar-tracking
4880 @opindex fvar-tracking
4881 Run variable tracking pass.  It computes where variables are stored at each
4882 position in code.  Better debugging information is then generated
4883 (if the debugging information format supports this information).
4884
4885 It is enabled by default when compiling with optimization (@option{-Os},
4886 @option{-O}, @option{-O2}, ...), debugging information (@option{-g}) and
4887 the debug info format supports it.
4888
4889 @item -print-file-name=@var{library}
4890 @opindex print-file-name
4891 Print the full absolute name of the library file @var{library} that
4892 would be used when linking---and don't do anything else.  With this
4893 option, GCC does not compile or link anything; it just prints the
4894 file name.
4895
4896 @item -print-multi-directory
4897 @opindex print-multi-directory
4898 Print the directory name corresponding to the multilib selected by any
4899 other switches present in the command line.  This directory is supposed
4900 to exist in @env{GCC_EXEC_PREFIX}.
4901
4902 @item -print-multi-lib
4903 @opindex print-multi-lib
4904 Print the mapping from multilib directory names to compiler switches
4905 that enable them.  The directory name is separated from the switches by
4906 @samp{;}, and each switch starts with an @samp{@@} instead of the
4907 @samp{-}, without spaces between multiple switches.  This is supposed to
4908 ease shell-processing.
4909
4910 @item -print-prog-name=@var{program}
4911 @opindex print-prog-name
4912 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
4913
4914 @item -print-libgcc-file-name
4915 @opindex print-libgcc-file-name
4916 Same as @option{-print-file-name=libgcc.a}.
4917
4918 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
4919 but you do want to link with @file{libgcc.a}.  You can do
4920
4921 @smallexample
4922 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
4923 @end smallexample
4924
4925 @item -print-search-dirs
4926 @opindex print-search-dirs
4927 Print the name of the configured installation directory and a list of
4928 program and library directories @command{gcc} will search---and don't do anything else.
4929
4930 This is useful when @command{gcc} prints the error message
4931 @samp{installation problem, cannot exec cpp0: No such file or directory}.
4932 To resolve this you either need to put @file{cpp0} and the other compiler
4933 components where @command{gcc} expects to find them, or you can set the environment
4934 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
4935 Don't forget the trailing @samp{/}.
4936 @xref{Environment Variables}.
4937
4938 @item -print-sysroot-headers-suffix
4939 @opindex print-sysroot-headers-suffix
4940 Print the suffix added to the target sysroot when searching for
4941 headers, or give an error if the compiler is not configured with such
4942 a suffix---and don't do anything else.
4943
4944 @item -dumpmachine
4945 @opindex dumpmachine
4946 Print the compiler's target machine (for example,
4947 @samp{i686-pc-linux-gnu})---and don't do anything else.
4948
4949 @item -dumpversion
4950 @opindex dumpversion
4951 Print the compiler version (for example, @samp{3.0})---and don't do
4952 anything else.
4953
4954 @item -dumpspecs
4955 @opindex dumpspecs
4956 Print the compiler's built-in specs---and don't do anything else.  (This
4957 is used when GCC itself is being built.)  @xref{Spec Files}.
4958
4959 @item -feliminate-unused-debug-types
4960 @opindex feliminate-unused-debug-types
4961 Normally, when producing DWARF2 output, GCC will emit debugging
4962 information for all types declared in a compilation
4963 unit, regardless of whether or not they are actually used
4964 in that compilation unit.  Sometimes this is useful, such as
4965 if, in the debugger, you want to cast a value to a type that is
4966 not actually used in your program (but is declared).  More often,
4967 however, this results in a significant amount of wasted space.
4968 With this option, GCC will avoid producing debug symbol output
4969 for types that are nowhere used in the source file being compiled.
4970 @end table
4971
4972 @node Optimize Options
4973 @section Options That Control Optimization
4974 @cindex optimize options
4975 @cindex options, optimization
4976
4977 These options control various sorts of optimizations.
4978
4979 Without any optimization option, the compiler's goal is to reduce the
4980 cost of compilation and to make debugging produce the expected
4981 results.  Statements are independent: if you stop the program with a
4982 breakpoint between statements, you can then assign a new value to any
4983 variable or change the program counter to any other statement in the
4984 function and get exactly the results you would expect from the source
4985 code.
4986
4987 Turning on optimization flags makes the compiler attempt to improve
4988 the performance and/or code size at the expense of compilation time
4989 and possibly the ability to debug the program.
4990
4991 The compiler performs optimization based on the knowledge it has of
4992 the program.  Optimization levels @option{-O} and above, in
4993 particular, enable @emph{unit-at-a-time} mode, which allows the
4994 compiler to consider information gained from later functions in
4995 the file when compiling a function.  Compiling multiple files at
4996 once to a single output file in @emph{unit-at-a-time} mode allows
4997 the compiler to use information gained from all of the files when
4998 compiling each of them.
4999
5000 Not all optimizations are controlled directly by a flag.  Only
5001 optimizations that have a flag are listed.
5002
5003 @table @gcctabopt
5004 @item -O
5005 @itemx -O1
5006 @opindex O
5007 @opindex O1
5008 Optimize.  Optimizing compilation takes somewhat more time, and a lot
5009 more memory for a large function.
5010
5011 With @option{-O}, the compiler tries to reduce code size and execution
5012 time, without performing any optimizations that take a great deal of
5013 compilation time.
5014
5015 @option{-O} turns on the following optimization flags:
5016 @gccoptlist{-fdefer-pop @gol
5017 -fdelayed-branch @gol
5018 -fguess-branch-probability @gol
5019 -fcprop-registers @gol
5020 -fif-conversion @gol
5021 -fif-conversion2 @gol
5022 -fsplit-wide-types @gol
5023 -ftree-ccp @gol
5024 -ftree-dce @gol
5025 -ftree-dominator-opts @gol
5026 -ftree-dse @gol
5027 -ftree-ter @gol
5028 -ftree-sra @gol
5029 -ftree-copyrename @gol
5030 -ftree-fre @gol
5031 -ftree-ch @gol
5032 -funit-at-a-time @gol
5033 -fmerge-constants}
5034
5035 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
5036 where doing so does not interfere with debugging.
5037
5038 @item -O2
5039 @opindex O2
5040 Optimize even more.  GCC performs nearly all supported optimizations
5041 that do not involve a space-speed tradeoff.  The compiler does not
5042 perform loop unrolling or function inlining when you specify @option{-O2}.
5043 As compared to @option{-O}, this option increases both compilation time
5044 and the performance of the generated code.
5045
5046 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
5047 also turns on the following optimization flags:
5048 @gccoptlist{-fthread-jumps @gol
5049 -fcrossjumping @gol
5050 -foptimize-sibling-calls @gol
5051 -fcse-follow-jumps  -fcse-skip-blocks @gol
5052 -fgcse  -fgcse-lm  @gol
5053 -fexpensive-optimizations @gol
5054 -frerun-cse-after-loop  @gol
5055 -fcaller-saves @gol
5056 -fpeephole2 @gol
5057 -fschedule-insns  -fschedule-insns2 @gol
5058 -fsched-interblock  -fsched-spec @gol
5059 -fregmove @gol
5060 -fstrict-aliasing -fstrict-overflow @gol
5061 -fdelete-null-pointer-checks @gol
5062 -freorder-blocks  -freorder-functions @gol
5063 -falign-functions  -falign-jumps @gol
5064 -falign-loops  -falign-labels @gol
5065 -ftree-vrp @gol
5066 -ftree-pre}
5067
5068 Please note the warning under @option{-fgcse} about
5069 invoking @option{-O2} on programs that use computed gotos.
5070
5071 @item -O3
5072 @opindex O3
5073 Optimize yet more.  @option{-O3} turns on all optimizations specified by
5074 @option{-O2} and also turns on the @option{-finline-functions},
5075 @option{-funswitch-loops}, @option{-fpredictive-commoning} and
5076 @option{-fgcse-after-reload} options.
5077
5078 @item -O0
5079 @opindex O0
5080 Reduce compilation time and make debugging produce the expected
5081 results.  This is the default.
5082
5083 @item -Os
5084 @opindex Os
5085 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
5086 do not typically increase code size.  It also performs further
5087 optimizations designed to reduce code size.
5088
5089 @option{-Os} disables the following optimization flags:
5090 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
5091 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
5092 -fprefetch-loop-arrays  -ftree-vect-loop-version}
5093
5094 If you use multiple @option{-O} options, with or without level numbers,
5095 the last such option is the one that is effective.
5096 @end table
5097
5098 Options of the form @option{-f@var{flag}} specify machine-independent
5099 flags.  Most flags have both positive and negative forms; the negative
5100 form of @option{-ffoo} would be @option{-fno-foo}.  In the table
5101 below, only one of the forms is listed---the one you typically will
5102 use.  You can figure out the other form by either removing @samp{no-}
5103 or adding it.
5104
5105 The following options control specific optimizations.  They are either
5106 activated by @option{-O} options or are related to ones that are.  You
5107 can use the following flags in the rare cases when ``fine-tuning'' of
5108 optimizations to be performed is desired.
5109
5110 @table @gcctabopt
5111 @item -fno-default-inline
5112 @opindex fno-default-inline
5113 Do not make member functions inline by default merely because they are
5114 defined inside the class scope (C++ only).  Otherwise, when you specify
5115 @w{@option{-O}}, member functions defined inside class scope are compiled
5116 inline by default; i.e., you don't need to add @samp{inline} in front of
5117 the member function name.
5118
5119 @item -fno-defer-pop
5120 @opindex fno-defer-pop
5121 Always pop the arguments to each function call as soon as that function
5122 returns.  For machines which must pop arguments after a function call,
5123 the compiler normally lets arguments accumulate on the stack for several
5124 function calls and pops them all at once.
5125
5126 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5127
5128 @item -fforce-addr
5129 @opindex fforce-addr
5130 Force memory address constants to be copied into registers before
5131 doing arithmetic on them.
5132
5133 @item -fforward-propagate
5134 @opindex fforward-propagate
5135 Perform a forward propagation pass on RTL.  The pass tries to combine two
5136 instructions and checks if the result can be simplified.  If loop unrolling
5137 is active, two passes are performed and the second is scheduled after
5138 loop unrolling.
5139
5140 This option is enabled by default at optimization levels @option{-O2},
5141 @option{-O3}, @option{-Os}.
5142
5143 @item -fomit-frame-pointer
5144 @opindex fomit-frame-pointer
5145 Don't keep the frame pointer in a register for functions that
5146 don't need one.  This avoids the instructions to save, set up and
5147 restore frame pointers; it also makes an extra register available
5148 in many functions.  @strong{It also makes debugging impossible on
5149 some machines.}
5150
5151 On some machines, such as the VAX, this flag has no effect, because
5152 the standard calling sequence automatically handles the frame pointer
5153 and nothing is saved by pretending it doesn't exist.  The
5154 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
5155 whether a target machine supports this flag.  @xref{Registers,,Register
5156 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
5157
5158 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5159
5160 @item -foptimize-sibling-calls
5161 @opindex foptimize-sibling-calls
5162 Optimize sibling and tail recursive calls.
5163
5164 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5165
5166 @item -fno-inline
5167 @opindex fno-inline
5168 Don't pay attention to the @code{inline} keyword.  Normally this option
5169 is used to keep the compiler from expanding any functions inline.
5170 Note that if you are not optimizing, no functions can be expanded inline.
5171
5172 @item -finline-functions
5173 @opindex finline-functions
5174 Integrate all simple functions into their callers.  The compiler
5175 heuristically decides which functions are simple enough to be worth
5176 integrating in this way.
5177
5178 If all calls to a given function are integrated, and the function is
5179 declared @code{static}, then the function is normally not output as
5180 assembler code in its own right.
5181
5182 Enabled at level @option{-O3}.
5183
5184 @item -finline-functions-called-once
5185 @opindex finline-functions-called-once
5186 Consider all @code{static} functions called once for inlining into their
5187 caller even if they are not marked @code{inline}.  If a call to a given
5188 function is integrated, then the function is not output as assembler code
5189 in its own right.
5190
5191 Enabled if @option{-funit-at-a-time} is enabled.
5192
5193 @item -fearly-inlining
5194 @opindex fearly-inlining
5195 Inline functions marked by @code{always_inline} and functions whose body seems
5196 smaller than the function call overhead early before doing
5197 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
5198 makes profiling significantly cheaper and usually inlining faster on programs
5199 having large chains of nested wrapper functions.
5200
5201 Enabled by default.
5202
5203 @item -finline-limit=@var{n}
5204 @opindex finline-limit
5205 By default, GCC limits the size of functions that can be inlined.  This flag
5206 allows the control of this limit for functions that are explicitly marked as
5207 inline (i.e., marked with the inline keyword or defined within the class
5208 definition in c++).  @var{n} is the size of functions that can be inlined in
5209 number of pseudo instructions (not counting parameter handling).  The default
5210 value of @var{n} is 600.
5211 Increasing this value can result in more inlined code at
5212 the cost of compilation time and memory consumption.  Decreasing usually makes
5213 the compilation faster and less code will be inlined (which presumably
5214 means slower programs).  This option is particularly useful for programs that
5215 use inlining heavily such as those based on recursive templates with C++.
5216
5217 Inlining is actually controlled by a number of parameters, which may be
5218 specified individually by using @option{--param @var{name}=@var{value}}.
5219 The @option{-finline-limit=@var{n}} option sets some of these parameters
5220 as follows:
5221
5222 @table @gcctabopt
5223 @item max-inline-insns-single
5224  is set to @var{n}/2.
5225 @item max-inline-insns-auto
5226  is set to @var{n}/2.
5227 @item min-inline-insns
5228  is set to 130 or @var{n}/4, whichever is smaller.
5229 @item max-inline-insns-rtl
5230  is set to @var{n}.
5231 @end table
5232
5233 See below for a documentation of the individual
5234 parameters controlling inlining.
5235
5236 @emph{Note:} pseudo instruction represents, in this particular context, an
5237 abstract measurement of function's size.  In no way does it represent a count
5238 of assembly instructions and as such its exact meaning might change from one
5239 release to an another.
5240
5241 @item -fkeep-inline-functions
5242 @opindex fkeep-inline-functions
5243 In C, emit @code{static} functions that are declared @code{inline}
5244 into the object file, even if the function has been inlined into all
5245 of its callers.  This switch does not affect functions using the
5246 @code{extern inline} extension in GNU C89@.  In C++, emit any and all
5247 inline functions into the object file.
5248
5249 @item -fkeep-static-consts
5250 @opindex fkeep-static-consts
5251 Emit variables declared @code{static const} when optimization isn't turned
5252 on, even if the variables aren't referenced.
5253
5254 GCC enables this option by default.  If you want to force the compiler to
5255 check if the variable was referenced, regardless of whether or not
5256 optimization is turned on, use the @option{-fno-keep-static-consts} option.
5257
5258 @item -fmerge-constants
5259 Attempt to merge identical constants (string constants and floating point
5260 constants) across compilation units.
5261
5262 This option is the default for optimized compilation if the assembler and
5263 linker support it.  Use @option{-fno-merge-constants} to inhibit this
5264 behavior.
5265
5266 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5267
5268 @item -fmerge-all-constants
5269 Attempt to merge identical constants and identical variables.
5270
5271 This option implies @option{-fmerge-constants}.  In addition to
5272 @option{-fmerge-constants} this considers e.g.@: even constant initialized
5273 arrays or initialized constant variables with integral or floating point
5274 types.  Languages like C or C++ require each non-automatic variable to
5275 have distinct location, so using this option will result in non-conforming
5276 behavior.
5277
5278 @item -fmodulo-sched
5279 @opindex fmodulo-sched
5280 Perform swing modulo scheduling immediately before the first scheduling
5281 pass.  This pass looks at innermost loops and reorders their
5282 instructions by overlapping different iterations.
5283
5284 @item -fmodulo-sched-allow-regmoves
5285 @opindex fmodulo-sched-allow-regmoves
5286 Perform more aggressive SMS based modulo scheduling with register moves
5287 allowed.  By setting this flag certain anti-dependences edges will be
5288 deleted which will trigger the generation of reg-moves based on the
5289 life-range analysis.
5290
5291 @item -fno-branch-count-reg
5292 @opindex fno-branch-count-reg
5293 Do not use ``decrement and branch'' instructions on a count register,
5294 but instead generate a sequence of instructions that decrement a
5295 register, compare it against zero, then branch based upon the result.
5296 This option is only meaningful on architectures that support such
5297 instructions, which include x86, PowerPC, IA-64 and S/390.
5298
5299 The default is @option{-fbranch-count-reg}.
5300
5301 @item -fno-function-cse
5302 @opindex fno-function-cse
5303 Do not put function addresses in registers; make each instruction that
5304 calls a constant function contain the function's address explicitly.
5305
5306 This option results in less efficient code, but some strange hacks
5307 that alter the assembler output may be confused by the optimizations
5308 performed when this option is not used.
5309
5310 The default is @option{-ffunction-cse}
5311
5312 @item -fno-zero-initialized-in-bss
5313 @opindex fno-zero-initialized-in-bss
5314 If the target supports a BSS section, GCC by default puts variables that
5315 are initialized to zero into BSS@.  This can save space in the resulting
5316 code.
5317
5318 This option turns off this behavior because some programs explicitly
5319 rely on variables going to the data section.  E.g., so that the
5320 resulting executable can find the beginning of that section and/or make
5321 assumptions based on that.
5322
5323 The default is @option{-fzero-initialized-in-bss}.
5324
5325 @item -fbounds-check
5326 @opindex fbounds-check
5327 For front-ends that support it, generate additional code to check that
5328 indices used to access arrays are within the declared range.  This is
5329 currently only supported by the Java and Fortran front-ends, where
5330 this option defaults to true and false respectively.
5331
5332 @item -fmudflap -fmudflapth -fmudflapir
5333 @opindex fmudflap
5334 @opindex fmudflapth
5335 @opindex fmudflapir
5336 @cindex bounds checking
5337 @cindex mudflap
5338 For front-ends that support it (C and C++), instrument all risky
5339 pointer/array dereferencing operations, some standard library
5340 string/heap functions, and some other associated constructs with
5341 range/validity tests.  Modules so instrumented should be immune to
5342 buffer overflows, invalid heap use, and some other classes of C/C++
5343 programming errors.  The instrumentation relies on a separate runtime
5344 library (@file{libmudflap}), which will be linked into a program if
5345 @option{-fmudflap} is given at link time.  Run-time behavior of the
5346 instrumented program is controlled by the @env{MUDFLAP_OPTIONS}
5347 environment variable.  See @code{env MUDFLAP_OPTIONS=-help a.out}
5348 for its options.
5349
5350 Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to
5351 link if your program is multi-threaded.  Use @option{-fmudflapir}, in
5352 addition to @option{-fmudflap} or @option{-fmudflapth}, if
5353 instrumentation should ignore pointer reads.  This produces less
5354 instrumentation (and therefore faster execution) and still provides
5355 some protection against outright memory corrupting writes, but allows
5356 erroneously read data to propagate within a program.
5357
5358 @item -fthread-jumps
5359 @opindex fthread-jumps
5360 Perform optimizations where we check to see if a jump branches to a
5361 location where another comparison subsumed by the first is found.  If
5362 so, the first branch is redirected to either the destination of the
5363 second branch or a point immediately following it, depending on whether
5364 the condition is known to be true or false.
5365
5366 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5367
5368 @item -fsplit-wide-types
5369 @opindex fsplit-wide-types
5370 When using a type that occupies multiple registers, such as @code{long
5371 long} on a 32-bit system, split the registers apart and allocate them
5372 independently.  This normally generates better code for those types,
5373 but may make debugging more difficult.
5374
5375 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
5376 @option{-Os}.
5377
5378 @item -fcse-follow-jumps
5379 @opindex fcse-follow-jumps
5380 In common subexpression elimination, scan through jump instructions
5381 when the target of the jump is not reached by any other path.  For
5382 example, when CSE encounters an @code{if} statement with an
5383 @code{else} clause, CSE will follow the jump when the condition
5384 tested is false.
5385
5386 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5387
5388 @item -fcse-skip-blocks
5389 @opindex fcse-skip-blocks
5390 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
5391 follow jumps which conditionally skip over blocks.  When CSE
5392 encounters a simple @code{if} statement with no else clause,
5393 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
5394 body of the @code{if}.
5395
5396 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5397
5398 @item -frerun-cse-after-loop
5399 @opindex frerun-cse-after-loop
5400 Re-run common subexpression elimination after loop optimizations has been
5401 performed.
5402
5403 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5404
5405 @item -fgcse
5406 @opindex fgcse
5407 Perform a global common subexpression elimination pass.
5408 This pass also performs global constant and copy propagation.
5409
5410 @emph{Note:} When compiling a program using computed gotos, a GCC
5411 extension, you may get better runtime performance if you disable
5412 the global common subexpression elimination pass by adding
5413 @option{-fno-gcse} to the command line.
5414
5415 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5416
5417 @item -fgcse-lm
5418 @opindex fgcse-lm
5419 When @option{-fgcse-lm} is enabled, global common subexpression elimination will
5420 attempt to move loads which are only killed by stores into themselves.  This
5421 allows a loop containing a load/store sequence to be changed to a load outside
5422 the loop, and a copy/store within the loop.
5423
5424 Enabled by default when gcse is enabled.
5425
5426 @item -fgcse-sm
5427 @opindex fgcse-sm
5428 When @option{-fgcse-sm} is enabled, a store motion pass is run after
5429 global common subexpression elimination.  This pass will attempt to move
5430 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
5431 loops containing a load/store sequence can be changed to a load before
5432 the loop and a store after the loop.
5433
5434 Not enabled at any optimization level.
5435
5436 @item -fgcse-las
5437 @opindex fgcse-las
5438 When @option{-fgcse-las} is enabled, the global common subexpression
5439 elimination pass eliminates redundant loads that come after stores to the
5440 same memory location (both partial and full redundancies).
5441
5442 Not enabled at any optimization level.
5443
5444 @item -fgcse-after-reload
5445 @opindex fgcse-after-reload
5446 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
5447 pass is performed after reload.  The purpose of this pass is to cleanup
5448 redundant spilling.
5449
5450 @item -funsafe-loop-optimizations
5451 @opindex funsafe-loop-optimizations
5452 If given, the loop optimizer will assume that loop indices do not
5453 overflow, and that the loops with nontrivial exit condition are not
5454 infinite.  This enables a wider range of loop optimizations even if
5455 the loop optimizer itself cannot prove that these assumptions are valid.
5456 Using @option{-Wunsafe-loop-optimizations}, the compiler will warn you
5457 if it finds this kind of loop.
5458
5459 @item -fcrossjumping
5460 @opindex crossjumping
5461 Perform cross-jumping transformation.  This transformation unifies equivalent code and save code size.  The
5462 resulting code may or may not perform better than without cross-jumping.
5463
5464 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5465
5466 @item -fif-conversion
5467 @opindex if-conversion
5468 Attempt to transform conditional jumps into branch-less equivalents.  This
5469 include use of conditional moves, min, max, set flags and abs instructions, and
5470 some tricks doable by standard arithmetics.  The use of conditional execution
5471 on chips where it is available is controlled by @code{if-conversion2}.
5472
5473 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5474
5475 @item -fif-conversion2
5476 @opindex if-conversion2
5477 Use conditional execution (where available) to transform conditional jumps into
5478 branch-less equivalents.
5479
5480 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5481
5482 @item -fdelete-null-pointer-checks
5483 @opindex fdelete-null-pointer-checks
5484 Use global dataflow analysis to identify and eliminate useless checks
5485 for null pointers.  The compiler assumes that dereferencing a null
5486 pointer would have halted the program.  If a pointer is checked after
5487 it has already been dereferenced, it cannot be null.
5488
5489 In some environments, this assumption is not true, and programs can
5490 safely dereference null pointers.  Use
5491 @option{-fno-delete-null-pointer-checks} to disable this optimization
5492 for programs which depend on that behavior.
5493
5494 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5495
5496 @item -fexpensive-optimizations
5497 @opindex fexpensive-optimizations
5498 Perform a number of minor optimizations that are relatively expensive.
5499
5500 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5501
5502 @item -foptimize-register-move
5503 @itemx -fregmove
5504 @opindex foptimize-register-move
5505 @opindex fregmove
5506 Attempt to reassign register numbers in move instructions and as
5507 operands of other simple instructions in order to maximize the amount of
5508 register tying.  This is especially helpful on machines with two-operand
5509 instructions.
5510
5511 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
5512 optimization.
5513
5514 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5515
5516 @item -fdelayed-branch
5517 @opindex fdelayed-branch
5518 If supported for the target machine, attempt to reorder instructions
5519 to exploit instruction slots available after delayed branch
5520 instructions.
5521
5522 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5523
5524 @item -fschedule-insns
5525 @opindex fschedule-insns
5526 If supported for the target machine, attempt to reorder instructions to
5527 eliminate execution stalls due to required data being unavailable.  This
5528 helps machines that have slow floating point or memory load instructions
5529 by allowing other instructions to be issued until the result of the load
5530 or floating point instruction is required.
5531
5532 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5533
5534 @item -fschedule-insns2
5535 @opindex fschedule-insns2
5536 Similar to @option{-fschedule-insns}, but requests an additional pass of
5537 instruction scheduling after register allocation has been done.  This is
5538 especially useful on machines with a relatively small number of
5539 registers and where memory load instructions take more than one cycle.
5540
5541 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5542
5543 @item -fno-sched-interblock
5544 @opindex fno-sched-interblock
5545 Don't schedule instructions across basic blocks.  This is normally
5546 enabled by default when scheduling before register allocation, i.e.@:
5547 with @option{-fschedule-insns} or at @option{-O2} or higher.
5548
5549 @item -fno-sched-spec
5550 @opindex fno-sched-spec
5551 Don't allow speculative motion of non-load instructions.  This is normally
5552 enabled by default when scheduling before register allocation, i.e.@:
5553 with @option{-fschedule-insns} or at @option{-O2} or higher.
5554
5555 @item -fsched-spec-load
5556 @opindex fsched-spec-load
5557 Allow speculative motion of some load instructions.  This only makes
5558 sense when scheduling before register allocation, i.e.@: with
5559 @option{-fschedule-insns} or at @option{-O2} or higher.
5560
5561 @item -fsched-spec-load-dangerous
5562 @opindex fsched-spec-load-dangerous
5563 Allow speculative motion of more load instructions.  This only makes
5564 sense when scheduling before register allocation, i.e.@: with
5565 @option{-fschedule-insns} or at @option{-O2} or higher.
5566
5567 @item -fsched-stalled-insns=@var{n}
5568 @opindex fsched-stalled-insns
5569 Define how many insns (if any) can be moved prematurely from the queue
5570 of stalled insns into the ready list, during the second scheduling pass.
5571
5572 @item -fsched-stalled-insns-dep=@var{n}
5573 @opindex fsched-stalled-insns-dep
5574 Define how many insn groups (cycles) will be examined for a dependency
5575 on a stalled insn that is candidate for premature removal from the queue
5576 of stalled insns.  Has an effect only during the second scheduling pass,
5577 and only if @option{-fsched-stalled-insns} is used and its value is not zero.
5578
5579 @item -fsched2-use-superblocks
5580 @opindex fsched2-use-superblocks
5581 When scheduling after register allocation, do use superblock scheduling
5582 algorithm.  Superblock scheduling allows motion across basic block boundaries
5583 resulting on faster schedules.  This option is experimental, as not all machine
5584 descriptions used by GCC model the CPU closely enough to avoid unreliable
5585 results from the algorithm.
5586
5587 This only makes sense when scheduling after register allocation, i.e.@: with
5588 @option{-fschedule-insns2} or at @option{-O2} or higher.
5589
5590 @item -fsched2-use-traces
5591 @opindex fsched2-use-traces
5592 Use @option{-fsched2-use-superblocks} algorithm when scheduling after register
5593 allocation and additionally perform code duplication in order to increase the
5594 size of superblocks using tracer pass.  See @option{-ftracer} for details on
5595 trace formation.
5596
5597 This mode should produce faster but significantly longer programs.  Also
5598 without @option{-fbranch-probabilities} the traces constructed may not
5599 match the reality and hurt the performance.  This only makes
5600 sense when scheduling after register allocation, i.e.@: with
5601 @option{-fschedule-insns2} or at @option{-O2} or higher.
5602
5603 @item -fsee
5604 @opindex fsee
5605 Eliminates redundant extension instructions and move the non redundant
5606 ones to optimal placement using LCM.
5607
5608 @item -freschedule-modulo-scheduled-loops
5609 @opindex fscheduling-in-modulo-scheduled-loops
5610 The modulo scheduling comes before the traditional scheduling, if a loop
5611 was modulo scheduled we may want to prevent the later scheduling passes
5612 from changing its schedule, we use this option to control that.
5613
5614 @item -fcaller-saves
5615 @opindex fcaller-saves
5616 Enable values to be allocated in registers that will be clobbered by
5617 function calls, by emitting extra instructions to save and restore the
5618 registers around such calls.  Such allocation is done only when it
5619 seems to result in better code than would otherwise be produced.
5620
5621 This option is always enabled by default on certain machines, usually
5622 those which have no call-preserved registers to use instead.
5623
5624 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5625
5626 @item -ftree-reassoc
5627 Perform Reassociation on trees  This flag is enabled by default
5628 at @option{-O} and higher.
5629
5630 @item -ftree-pre
5631 Perform Partial Redundancy Elimination (PRE) on trees.  This flag is
5632 enabled by default at @option{-O2} and @option{-O3}.
5633
5634 @item -ftree-fre
5635 Perform Full Redundancy Elimination (FRE) on trees.  The difference
5636 between FRE and PRE is that FRE only considers expressions
5637 that are computed on all paths leading to the redundant computation.
5638 This analysis is faster than PRE, though it exposes fewer redundancies.
5639 This flag is enabled by default at @option{-O} and higher.
5640
5641 @item -ftree-copy-prop
5642 Perform copy propagation on trees.  This pass eliminates unnecessary
5643 copy operations.  This flag is enabled by default at @option{-O} and
5644 higher.
5645
5646 @item -ftree-store-copy-prop
5647 Perform copy propagation of memory loads and stores.  This pass
5648 eliminates unnecessary copy operations in memory references
5649 (structures, global variables, arrays, etc).  This flag is enabled by
5650 default at @option{-O2} and higher.
5651
5652 @item -ftree-salias
5653 Perform structural alias analysis on trees.  This flag
5654 is enabled by default at @option{-O} and higher.
5655
5656 @item -fipa-pta
5657 Perform interprocedural pointer analysis.
5658
5659 @item -ftree-sink
5660 Perform forward store motion  on trees.  This flag is
5661 enabled by default at @option{-O} and higher.
5662
5663 @item -ftree-ccp
5664 Perform sparse conditional constant propagation (CCP) on trees.  This
5665 pass only operates on local scalar variables and is enabled by default
5666 at @option{-O} and higher.
5667
5668 @item -ftree-store-ccp
5669 Perform sparse conditional constant propagation (CCP) on trees.  This
5670 pass operates on both local scalar variables and memory stores and
5671 loads (global variables, structures, arrays, etc).  This flag is
5672 enabled by default at @option{-O2} and higher.
5673
5674 @item -ftree-dce
5675 Perform dead code elimination (DCE) on trees.  This flag is enabled by
5676 default at @option{-O} and higher.
5677
5678 @item -ftree-dominator-opts
5679 Perform a variety of simple scalar cleanups (constant/copy
5680 propagation, redundancy elimination, range propagation and expression
5681 simplification) based on a dominator tree traversal.  This also
5682 performs jump threading (to reduce jumps to jumps). This flag is
5683 enabled by default at @option{-O} and higher.
5684
5685 @item -ftree-ch
5686 Perform loop header copying on trees.  This is beneficial since it increases
5687 effectiveness of code motion optimizations.  It also saves one jump.  This flag
5688 is enabled by default at @option{-O} and higher.  It is not enabled
5689 for @option{-Os}, since it usually increases code size.
5690
5691 @item -ftree-loop-optimize
5692 Perform loop optimizations on trees.  This flag is enabled by default
5693 at @option{-O} and higher.
5694
5695 @item -ftree-loop-linear
5696 Perform linear loop transformations on tree.  This flag can improve cache
5697 performance and allow further loop optimizations to take place.
5698
5699 @item -fcheck-data-deps
5700 Compare the results of several data dependence analyzers.  This option
5701 is used for debugging the data dependence analyzers.
5702
5703 @item -ftree-loop-im
5704 Perform loop invariant motion on trees.  This pass moves only invariants that
5705 would be hard to handle at RTL level (function calls, operations that expand to
5706 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
5707 operands of conditions that are invariant out of the loop, so that we can use
5708 just trivial invariantness analysis in loop unswitching.  The pass also includes
5709 store motion.
5710
5711 @item -ftree-loop-ivcanon
5712 Create a canonical counter for number of iterations in the loop for that
5713 determining number of iterations requires complicated analysis.  Later
5714 optimizations then may determine the number easily.  Useful especially
5715 in connection with unrolling.
5716
5717 @item -fivopts
5718 Perform induction variable optimizations (strength reduction, induction
5719 variable merging and induction variable elimination) on trees.
5720
5721 @item -ftree-sra
5722 Perform scalar replacement of aggregates.  This pass replaces structure
5723 references with scalars to prevent committing structures to memory too
5724 early.  This flag is enabled by default at @option{-O} and higher.
5725
5726 @item -ftree-copyrename
5727 Perform copy renaming on trees.  This pass attempts to rename compiler
5728 temporaries to other variables at copy locations, usually resulting in
5729 variable names which more closely resemble the original variables.  This flag
5730 is enabled by default at @option{-O} and higher.
5731
5732 @item -ftree-ter
5733 Perform temporary expression replacement during the SSA->normal phase.  Single
5734 use/single def temporaries are replaced at their use location with their
5735 defining expression.  This results in non-GIMPLE code, but gives the expanders
5736 much more complex trees to work on resulting in better RTL generation.  This is
5737 enabled by default at @option{-O} and higher.
5738
5739 @item -ftree-vectorize
5740 Perform loop vectorization on trees.
5741
5742 @item -ftree-vect-loop-version
5743 @opindex ftree-vect-loop-version
5744 Perform loop versioning when doing loop vectorization on trees.  When a loop
5745 appears to be vectorizable except that data alignment or data dependence cannot
5746 be determined at compile time then vectorized and non-vectorized versions of
5747 the loop are generated along with runtime checks for alignment or dependence
5748 to control which version is executed.  This option is enabled by default
5749 except at level @option{-Os} where it is disabled.
5750
5751 @item -fvect-cost-model
5752 Enable cost model for vectorization.
5753
5754 @item -ftree-vrp
5755 Perform Value Range Propagation on trees.  This is similar to the
5756 constant propagation pass, but instead of values, ranges of values are
5757 propagated.  This allows the optimizers to remove unnecessary range
5758 checks like array bound checks and null pointer checks.  This is
5759 enabled by default at @option{-O2} and higher.  Null pointer check
5760 elimination is only done if @option{-fdelete-null-pointer-checks} is
5761 enabled.
5762
5763 @item -ftracer
5764 @opindex ftracer
5765 Perform tail duplication to enlarge superblock size.  This transformation
5766 simplifies the control flow of the function allowing other optimizations to do
5767 better job.
5768
5769 @item -funroll-loops
5770 @opindex funroll-loops
5771 Unroll loops whose number of iterations can be determined at compile
5772 time or upon entry to the loop.  @option{-funroll-loops} implies
5773 @option{-frerun-cse-after-loop}.  This option makes code larger,
5774 and may or may not make it run faster.
5775
5776 @item -funroll-all-loops
5777 @opindex funroll-all-loops
5778 Unroll all loops, even if their number of iterations is uncertain when
5779 the loop is entered.  This usually makes programs run more slowly.
5780 @option{-funroll-all-loops} implies the same options as
5781 @option{-funroll-loops},
5782
5783 @item -fsplit-ivs-in-unroller
5784 @opindex fsplit-ivs-in-unroller
5785 Enables expressing of values of induction variables in later iterations
5786 of the unrolled loop using the value in the first iteration.  This breaks
5787 long dependency chains, thus improving efficiency of the scheduling passes.
5788
5789 Combination of @option{-fweb} and CSE is often sufficient to obtain the
5790 same effect.  However in cases the loop body is more complicated than
5791 a single basic block, this is not reliable.  It also does not work at all
5792 on some of the architectures due to restrictions in the CSE pass.
5793
5794 This optimization is enabled by default.
5795
5796 @item -fvariable-expansion-in-unroller
5797 @opindex fvariable-expansion-in-unroller
5798 With this option, the compiler will create multiple copies of some
5799 local variables when unrolling a loop which can result in superior code.
5800
5801 @item -fpredictive-commoning
5802 @opindex fpredictive-commoning
5803 Perform predictive commoning optimization, i.e., reusing computations
5804 (especially memory loads and stores) performed in previous
5805 iterations of loops.
5806
5807 This option is enabled at level @option{-O3}.
5808
5809 @item -fprefetch-loop-arrays
5810 @opindex fprefetch-loop-arrays
5811 If supported by the target machine, generate instructions to prefetch
5812 memory to improve the performance of loops that access large arrays.
5813
5814 This option may generate better or worse code; results are highly
5815 dependent on the structure of loops within the source code.
5816
5817 Disabled at level @option{-Os}.
5818
5819 @item -fno-peephole
5820 @itemx -fno-peephole2
5821 @opindex fno-peephole
5822 @opindex fno-peephole2
5823 Disable any machine-specific peephole optimizations.  The difference
5824 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
5825 are implemented in the compiler; some targets use one, some use the
5826 other, a few use both.
5827
5828 @option{-fpeephole} is enabled by default.
5829 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5830
5831 @item -fno-guess-branch-probability
5832 @opindex fno-guess-branch-probability
5833 Do not guess branch probabilities using heuristics.
5834
5835 GCC will use heuristics to guess branch probabilities if they are
5836 not provided by profiling feedback (@option{-fprofile-arcs}).  These
5837 heuristics are based on the control flow graph.  If some branch probabilities
5838 are specified by @samp{__builtin_expect}, then the heuristics will be
5839 used to guess branch probabilities for the rest of the control flow graph,
5840 taking the @samp{__builtin_expect} info into account.  The interactions
5841 between the heuristics and @samp{__builtin_expect} can be complex, and in
5842 some cases, it may be useful to disable the heuristics so that the effects
5843 of @samp{__builtin_expect} are easier to understand.
5844
5845 The default is @option{-fguess-branch-probability} at levels
5846 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5847
5848 @item -freorder-blocks
5849 @opindex freorder-blocks
5850 Reorder basic blocks in the compiled function in order to reduce number of
5851 taken branches and improve code locality.
5852
5853 Enabled at levels @option{-O2}, @option{-O3}.
5854
5855 @item -freorder-blocks-and-partition
5856 @opindex freorder-blocks-and-partition
5857 In addition to reordering basic blocks in the compiled function, in order
5858 to reduce number of taken branches, partitions hot and cold basic blocks
5859 into separate sections of the assembly and .o files, to improve
5860 paging and cache locality performance.
5861
5862 This optimization is automatically turned off in the presence of
5863 exception handling, for linkonce sections, for functions with a user-defined
5864 section attribute and on any architecture that does not support named
5865 sections.
5866
5867 @item -freorder-functions
5868 @opindex freorder-functions
5869 Reorder functions in the object file in order to
5870 improve code locality.  This is implemented by using special
5871 subsections @code{.text.hot} for most frequently executed functions and
5872 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
5873 the linker so object file format must support named sections and linker must
5874 place them in a reasonable way.
5875
5876 Also profile feedback must be available in to make this option effective.  See
5877 @option{-fprofile-arcs} for details.
5878
5879 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5880
5881 @item -fstrict-aliasing
5882 @opindex fstrict-aliasing
5883 Allows the compiler to assume the strictest aliasing rules applicable to
5884 the language being compiled.  For C (and C++), this activates
5885 optimizations based on the type of expressions.  In particular, an
5886 object of one type is assumed never to reside at the same address as an
5887 object of a different type, unless the types are almost the same.  For
5888 example, an @code{unsigned int} can alias an @code{int}, but not a
5889 @code{void*} or a @code{double}.  A character type may alias any other
5890 type.
5891
5892 Pay special attention to code like this:
5893 @smallexample
5894 union a_union @{
5895   int i;
5896   double d;
5897 @};
5898
5899 int f() @{
5900   a_union t;
5901   t.d = 3.0;
5902   return t.i;
5903 @}
5904 @end smallexample
5905 The practice of reading from a different union member than the one most
5906 recently written to (called ``type-punning'') is common.  Even with
5907 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
5908 is accessed through the union type.  So, the code above will work as
5909 expected.  However, this code might not:
5910 @smallexample
5911 int f() @{
5912   a_union t;
5913   int* ip;
5914   t.d = 3.0;
5915   ip = &t.i;
5916   return *ip;
5917 @}
5918 @end smallexample
5919
5920 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5921
5922 @item -fstrict-overflow
5923 @opindex fstrict-overflow
5924 Allow the compiler to assume strict signed overflow rules, depending
5925 on the language being compiled.  For C (and C++) this means that
5926 overflow when doing arithmetic with signed numbers is undefined, which
5927 means that the compiler may assume that it will not happen.  This
5928 permits various optimizations.  For example, the compiler will assume
5929 that an expression like @code{i + 10 > i} will always be true for
5930 signed @code{i}.  This assumption is only valid if signed overflow is
5931 undefined, as the expression is false if @code{i + 10} overflows when
5932 using twos complement arithmetic.  When this option is in effect any
5933 attempt to determine whether an operation on signed numbers will
5934 overflow must be written carefully to not actually involve overflow.
5935
5936 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
5937 that signed overflow is fully defined: it wraps.  When
5938 @option{-fwrapv} is used, there is no difference between
5939 @option{-fstrict-overflow} and @option{-fno-strict-overflow}.  With
5940 @option{-fwrapv} certain types of overflow are permitted.  For
5941 example, if the compiler gets an overflow when doing arithmetic on
5942 constants, the overflowed value can still be used with
5943 @option{-fwrapv}, but not otherwise.
5944
5945 The @option{-fstrict-overflow} option is enabled at levels
5946 @option{-O2}, @option{-O3}, @option{-Os}.
5947
5948 @item -falign-functions
5949 @itemx -falign-functions=@var{n}
5950 @opindex falign-functions
5951 Align the start of functions to the next power-of-two greater than
5952 @var{n}, skipping up to @var{n} bytes.  For instance,
5953 @option{-falign-functions=32} aligns functions to the next 32-byte
5954 boundary, but @option{-falign-functions=24} would align to the next
5955 32-byte boundary only if this can be done by skipping 23 bytes or less.
5956
5957 @option{-fno-align-functions} and @option{-falign-functions=1} are
5958 equivalent and mean that functions will not be aligned.
5959
5960 Some assemblers only support this flag when @var{n} is a power of two;
5961 in that case, it is rounded up.
5962
5963 If @var{n} is not specified or is zero, use a machine-dependent default.
5964
5965 Enabled at levels @option{-O2}, @option{-O3}.
5966
5967 @item -falign-labels
5968 @itemx -falign-labels=@var{n}
5969 @opindex falign-labels
5970 Align all branch targets to a power-of-two boundary, skipping up to
5971 @var{n} bytes like @option{-falign-functions}.  This option can easily
5972 make code slower, because it must insert dummy operations for when the
5973 branch target is reached in the usual flow of the code.
5974
5975 @option{-fno-align-labels} and @option{-falign-labels=1} are
5976 equivalent and mean that labels will not be aligned.
5977
5978 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
5979 are greater than this value, then their values are used instead.
5980
5981 If @var{n} is not specified or is zero, use a machine-dependent default
5982 which is very likely to be @samp{1}, meaning no alignment.
5983
5984 Enabled at levels @option{-O2}, @option{-O3}.
5985
5986 @item -falign-loops
5987 @itemx -falign-loops=@var{n}
5988 @opindex falign-loops
5989 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
5990 like @option{-falign-functions}.  The hope is that the loop will be
5991 executed many times, which will make up for any execution of the dummy
5992 operations.
5993
5994 @option{-fno-align-loops} and @option{-falign-loops=1} are
5995 equivalent and mean that loops will not be aligned.
5996
5997 If @var{n} is not specified or is zero, use a machine-dependent default.
5998
5999 Enabled at levels @option{-O2}, @option{-O3}.
6000
6001 @item -falign-jumps
6002 @itemx -falign-jumps=@var{n}
6003 @opindex falign-jumps
6004 Align branch targets to a power-of-two boundary, for branch targets
6005 where the targets can only be reached by jumping, skipping up to @var{n}
6006 bytes like @option{-falign-functions}.  In this case, no dummy operations
6007 need be executed.
6008
6009 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
6010 equivalent and mean that loops will not be aligned.
6011
6012 If @var{n} is not specified or is zero, use a machine-dependent default.
6013
6014 Enabled at levels @option{-O2}, @option{-O3}.
6015
6016 @item -funit-at-a-time
6017 @opindex funit-at-a-time
6018 Parse the whole compilation unit before starting to produce code.
6019 This allows some extra optimizations to take place but consumes
6020 more memory (in general).  There are some compatibility issues
6021 with @emph{unit-at-a-time} mode:
6022 @itemize @bullet
6023 @item
6024 enabling @emph{unit-at-a-time} mode may change the order
6025 in which functions, variables, and top-level @code{asm} statements
6026 are emitted, and will likely break code relying on some particular
6027 ordering.  The majority of such top-level @code{asm} statements,
6028 though, can be replaced by @code{section} attributes.  The
6029 @option{fno-toplevel-reorder} option may be used to keep the ordering
6030 used in the input file, at the cost of some optimizations.
6031
6032 @item
6033 @emph{unit-at-a-time} mode removes unreferenced static variables
6034 and functions.  This may result in undefined references
6035 when an @code{asm} statement refers directly to variables or functions
6036 that are otherwise unused.  In that case either the variable/function
6037 shall be listed as an operand of the @code{asm} statement operand or,
6038 in the case of top-level @code{asm} statements the attribute @code{used}
6039 shall be used on the declaration.
6040
6041 @item
6042 Static functions now can use non-standard passing conventions that
6043 may break @code{asm} statements calling functions directly.  Again,
6044 attribute @code{used} will prevent this behavior.
6045 @end itemize
6046
6047 As a temporary workaround, @option{-fno-unit-at-a-time} can be used,
6048 but this scheme may not be supported by future releases of GCC@.
6049
6050 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6051
6052 @item -fno-toplevel-reorder
6053 Do not reorder top-level functions, variables, and @code{asm}
6054 statements.  Output them in the same order that they appear in the
6055 input file.  When this option is used, unreferenced static variables
6056 will not be removed.  This option is intended to support existing code
6057 which relies on a particular ordering.  For new code, it is better to
6058 use attributes.
6059
6060 @item -fweb
6061 @opindex fweb
6062 Constructs webs as commonly used for register allocation purposes and assign
6063 each web individual pseudo register.  This allows the register allocation pass
6064 to operate on pseudos directly, but also strengthens several other optimization
6065 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
6066 however, make debugging impossible, since variables will no longer stay in a
6067 ``home register''.
6068
6069 Enabled by default with @option{-funroll-loops}.
6070
6071 @item -fwhole-program
6072 @opindex fwhole-program
6073 Assume that the current compilation unit represents whole program being
6074 compiled.  All public functions and variables with the exception of @code{main}
6075 and those merged by attribute @code{externally_visible} become static functions
6076 and in a affect gets more aggressively optimized by interprocedural optimizers.
6077 While this option is equivalent to proper use of @code{static} keyword for
6078 programs consisting of single file, in combination with option
6079 @option{--combine} this flag can be used to compile most of smaller scale C
6080 programs since the functions and variables become local for the whole combined
6081 compilation unit, not for the single source file itself.
6082
6083
6084 @item -fno-cprop-registers
6085 @opindex fno-cprop-registers
6086 After register allocation and post-register allocation instruction splitting,
6087 we perform a copy-propagation pass to try to reduce scheduling dependencies
6088 and occasionally eliminate the copy.
6089
6090 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6091
6092 @item -fprofile-generate
6093 @opindex fprofile-generate
6094
6095 Enable options usually used for instrumenting application to produce
6096 profile useful for later recompilation with profile feedback based
6097 optimization.  You must use @option{-fprofile-generate} both when
6098 compiling and when linking your program.
6099
6100 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
6101
6102 @item -fprofile-use
6103 @opindex fprofile-use
6104 Enable profile feedback directed optimizations, and optimizations
6105 generally profitable only with profile feedback available.
6106
6107 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
6108 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}
6109
6110 By default, GCC emits an error message if the feedback profiles do not
6111 match the source code.  This error can be turned into a warning by using
6112 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
6113 code.
6114 @end table
6115
6116 The following options control compiler behavior regarding floating
6117 point arithmetic.  These options trade off between speed and
6118 correctness.  All must be specifically enabled.
6119
6120 @table @gcctabopt
6121 @item -ffloat-store
6122 @opindex ffloat-store
6123 Do not store floating point variables in registers, and inhibit other
6124 options that might change whether a floating point value is taken from a
6125 register or memory.
6126
6127 @cindex floating point precision
6128 This option prevents undesirable excess precision on machines such as
6129 the 68000 where the floating registers (of the 68881) keep more
6130 precision than a @code{double} is supposed to have.  Similarly for the
6131 x86 architecture.  For most programs, the excess precision does only
6132 good, but a few programs rely on the precise definition of IEEE floating
6133 point.  Use @option{-ffloat-store} for such programs, after modifying
6134 them to store all pertinent intermediate computations into variables.
6135
6136 @item -ffast-math
6137 @opindex ffast-math
6138 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations}, @*
6139 @option{-fno-trapping-math}, @option{-ffinite-math-only},
6140 @option{-fno-rounding-math}, @option{-fno-signaling-nans},
6141 @option{-fno-signed-zeros} and @option{fcx-limited-range}.
6142
6143 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
6144
6145 This option is not turned on by any @option{-O} option since
6146 it can result in incorrect output for programs which depend on
6147 an exact implementation of IEEE or ISO rules/specifications for
6148 math functions. It may, however, yield faster code for programs
6149 that do not require the guarantees of these specifications.
6150
6151 @item -fno-math-errno
6152 @opindex fno-math-errno
6153 Do not set ERRNO after calling math functions that are executed
6154 with a single instruction, e.g., sqrt.  A program that relies on
6155 IEEE exceptions for math error handling may want to use this flag
6156 for speed while maintaining IEEE arithmetic compatibility.
6157
6158 This option is not turned on by any @option{-O} option since
6159 it can result in incorrect output for programs which depend on
6160 an exact implementation of IEEE or ISO rules/specifications for
6161 math functions. It may, however, yield faster code for programs
6162 that do not require the guarantees of these specifications.
6163
6164 The default is @option{-fmath-errno}.
6165
6166 On Darwin systems, the math library never sets @code{errno}.  There is
6167 therefore no reason for the compiler to consider the possibility that
6168 it might, and @option{-fno-math-errno} is the default.
6169
6170 @item -funsafe-math-optimizations
6171 @opindex funsafe-math-optimizations
6172 Allow optimizations for floating-point arithmetic that (a) assume
6173 that arguments and results are valid and (b) may violate IEEE or
6174 ANSI standards.  When used at link-time, it may include libraries
6175 or startup files that change the default FPU control word or other
6176 similar optimizations.
6177
6178 This option is not turned on by any @option{-O} option since
6179 it can result in incorrect output for programs which depend on
6180 an exact implementation of IEEE or ISO rules/specifications for
6181 math functions. It may, however, yield faster code for programs
6182 that do not require the guarantees of these specifications.
6183
6184 The default is @option{-fno-unsafe-math-optimizations}.
6185
6186 @item -ffinite-math-only
6187 @opindex ffinite-math-only
6188 Allow optimizations for floating-point arithmetic that assume
6189 that arguments and results are not NaNs or +-Infs.
6190
6191 This option is not turned on by any @option{-O} option since
6192 it can result in incorrect output for programs which depend on
6193 an exact implementation of IEEE or ISO rules/specifications for
6194 math functions. It may, however, yield faster code for programs
6195 that do not require the guarantees of these specifications.
6196
6197 The default is @option{-fno-finite-math-only}.
6198
6199 @item -fno-signed-zeros
6200 @opindex fno-signed-zeros
6201 Allow optimizations for floating point arithmetic that ignore the
6202 signedness of zero.  IEEE arithmetic specifies the behavior of
6203 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
6204 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
6205 This option implies that the sign of a zero result isn't significant.
6206
6207 The default is @option{-fsigned-zeros}.
6208
6209 @item -fno-trapping-math
6210 @opindex fno-trapping-math
6211 Compile code assuming that floating-point operations cannot generate
6212 user-visible traps.  These traps include division by zero, overflow,
6213 underflow, inexact result and invalid operation.  This option implies
6214 @option{-fno-signaling-nans}.  Setting this option may allow faster
6215 code if one relies on ``non-stop'' IEEE arithmetic, for example.
6216
6217 This option should never be turned on by any @option{-O} option since
6218 it can result in incorrect output for programs which depend on
6219 an exact implementation of IEEE or ISO rules/specifications for
6220 math functions.
6221
6222 The default is @option{-ftrapping-math}.
6223
6224 @item -frounding-math
6225 @opindex frounding-math
6226 Disable transformations and optimizations that assume default floating
6227 point rounding behavior.  This is round-to-zero for all floating point
6228 to integer conversions, and round-to-nearest for all other arithmetic
6229 truncations.  This option should be specified for programs that change
6230 the FP rounding mode dynamically, or that may be executed with a
6231 non-default rounding mode.  This option disables constant folding of
6232 floating point expressions at compile-time (which may be affected by
6233 rounding mode) and arithmetic transformations that are unsafe in the
6234 presence of sign-dependent rounding modes.
6235
6236 The default is @option{-fno-rounding-math}.
6237
6238 This option is experimental and does not currently guarantee to
6239 disable all GCC optimizations that are affected by rounding mode.
6240 Future versions of GCC may provide finer control of this setting
6241 using C99's @code{FENV_ACCESS} pragma.  This command line option
6242 will be used to specify the default state for @code{FENV_ACCESS}.
6243
6244 @item -frtl-abstract-sequences
6245 @opindex frtl-abstract-sequences
6246 It is a size optimization method. This option is to find identical
6247 sequences of code, which can be turned into pseudo-procedures  and
6248 then  replace  all  occurrences with  calls to  the  newly created
6249 subroutine. It is kind of an opposite of @option{-finline-functions}.
6250 This optimization runs at RTL level.
6251
6252 @item -fsignaling-nans
6253 @opindex fsignaling-nans
6254 Compile code assuming that IEEE signaling NaNs may generate user-visible
6255 traps during floating-point operations.  Setting this option disables
6256 optimizations that may change the number of exceptions visible with
6257 signaling NaNs.  This option implies @option{-ftrapping-math}.
6258
6259 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
6260 be defined.
6261
6262 The default is @option{-fno-signaling-nans}.
6263
6264 This option is experimental and does not currently guarantee to
6265 disable all GCC optimizations that affect signaling NaN behavior.
6266
6267 @item -fsingle-precision-constant
6268 @opindex fsingle-precision-constant
6269 Treat floating point constant as single precision constant instead of
6270 implicitly converting it to double precision constant.
6271
6272 @item -fcx-limited-range
6273 @itemx -fno-cx-limited-range
6274 @opindex fcx-limited-range
6275 @opindex fno-cx-limited-range
6276 When enabled, this option states that a range reduction step is not
6277 needed when performing complex division.  The default is
6278 @option{-fno-cx-limited-range}, but is enabled by @option{-ffast-math}.
6279
6280 This option controls the default setting of the ISO C99
6281 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
6282 all languages.
6283
6284 @end table
6285
6286 The following options control optimizations that may improve
6287 performance, but are not enabled by any @option{-O} options.  This
6288 section includes experimental options that may produce broken code.
6289
6290 @table @gcctabopt
6291 @item -fbranch-probabilities
6292 @opindex fbranch-probabilities
6293 After running a program compiled with @option{-fprofile-arcs}
6294 (@pxref{Debugging Options,, Options for Debugging Your Program or
6295 @command{gcc}}), you can compile it a second time using
6296 @option{-fbranch-probabilities}, to improve optimizations based on
6297 the number of times each branch was taken.  When the program
6298 compiled with @option{-fprofile-arcs} exits it saves arc execution
6299 counts to a file called @file{@var{sourcename}.gcda} for each source
6300 file.  The information in this data file is very dependent on the
6301 structure of the generated code, so you must use the same source code
6302 and the same optimization options for both compilations.
6303
6304 With @option{-fbranch-probabilities}, GCC puts a
6305 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
6306 These can be used to improve optimization.  Currently, they are only
6307 used in one place: in @file{reorg.c}, instead of guessing which path a
6308 branch is mostly to take, the @samp{REG_BR_PROB} values are used to
6309 exactly determine which path is taken more often.
6310
6311 @item -fprofile-values
6312 @opindex fprofile-values
6313 If combined with @option{-fprofile-arcs}, it adds code so that some
6314 data about values of expressions in the program is gathered.
6315
6316 With @option{-fbranch-probabilities}, it reads back the data gathered
6317 from profiling values of expressions and adds @samp{REG_VALUE_PROFILE}
6318 notes to instructions for their later usage in optimizations.
6319
6320 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
6321
6322 @item -fvpt
6323 @opindex fvpt
6324 If combined with @option{-fprofile-arcs}, it instructs the compiler to add
6325 a code to gather information about values of expressions.
6326
6327 With @option{-fbranch-probabilities}, it reads back the data gathered
6328 and actually performs the optimizations based on them.
6329 Currently the optimizations include specialization of division operation
6330 using the knowledge about the value of the denominator.
6331
6332 @item -frename-registers
6333 @opindex frename-registers
6334 Attempt to avoid false dependencies in scheduled code by making use
6335 of registers left over after register allocation.  This optimization
6336 will most benefit processors with lots of registers.  Depending on the
6337 debug information format adopted by the target, however, it can
6338 make debugging impossible, since variables will no longer stay in
6339 a ``home register''.
6340
6341 Enabled by default with @option{-funroll-loops}.
6342
6343 @item -ftracer
6344 @opindex ftracer
6345 Perform tail duplication to enlarge superblock size.  This transformation
6346 simplifies the control flow of the function allowing other optimizations to do
6347 better job.
6348
6349 Enabled with @option{-fprofile-use}.
6350
6351 @item -funroll-loops
6352 @opindex funroll-loops
6353 Unroll loops whose number of iterations can be determined at compile time or
6354 upon entry to the loop.  @option{-funroll-loops} implies
6355 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
6356 It also turns on complete loop peeling (i.e.@: complete removal of loops with
6357 small constant number of iterations).  This option makes code larger, and may
6358 or may not make it run faster.
6359
6360 Enabled with @option{-fprofile-use}.
6361
6362 @item -funroll-all-loops
6363 @opindex funroll-all-loops
6364 Unroll all loops, even if their number of iterations is uncertain when
6365 the loop is entered.  This usually makes programs run more slowly.
6366 @option{-funroll-all-loops} implies the same options as
6367 @option{-funroll-loops}.
6368
6369 @item -fpeel-loops
6370 @opindex fpeel-loops
6371 Peels the loops for that there is enough information that they do not
6372 roll much (from profile feedback).  It also turns on complete loop peeling
6373 (i.e.@: complete removal of loops with small constant number of iterations).
6374
6375 Enabled with @option{-fprofile-use}.
6376
6377 @item -fmove-loop-invariants
6378 @opindex fmove-loop-invariants
6379 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
6380 at level @option{-O1}
6381
6382 @item -funswitch-loops
6383 @opindex funswitch-loops
6384 Move branches with loop invariant conditions out of the loop, with duplicates
6385 of the loop on both branches (modified according to result of the condition).
6386
6387 @item -ffunction-sections
6388 @itemx -fdata-sections
6389 @opindex ffunction-sections
6390 @opindex fdata-sections
6391 Place each function or data item into its own section in the output
6392 file if the target supports arbitrary sections.  The name of the
6393 function or the name of the data item determines the section's name
6394 in the output file.
6395
6396 Use these options on systems where the linker can perform optimizations
6397 to improve locality of reference in the instruction space.  Most systems
6398 using the ELF object format and SPARC processors running Solaris 2 have
6399 linkers with such optimizations.  AIX may have these optimizations in
6400 the future.
6401
6402 Only use these options when there are significant benefits from doing
6403 so.  When you specify these options, the assembler and linker will
6404 create larger object and executable files and will also be slower.
6405 You will not be able to use @code{gprof} on all systems if you
6406 specify this option and you may have problems with debugging if
6407 you specify both this option and @option{-g}.
6408
6409 @item -fbranch-target-load-optimize
6410 @opindex fbranch-target-load-optimize
6411 Perform branch target register load optimization before prologue / epilogue
6412 threading.
6413 The use of target registers can typically be exposed only during reload,
6414 thus hoisting loads out of loops and doing inter-block scheduling needs
6415 a separate optimization pass.
6416
6417 @item -fbranch-target-load-optimize2
6418 @opindex fbranch-target-load-optimize2
6419 Perform branch target register load optimization after prologue / epilogue
6420 threading.
6421
6422 @item -fbtr-bb-exclusive
6423 @opindex fbtr-bb-exclusive
6424 When performing branch target register load optimization, don't reuse
6425 branch target registers in within any basic block.
6426
6427 @item -fstack-protector
6428 Emit extra code to check for buffer overflows, such as stack smashing
6429 attacks.  This is done by adding a guard variable to functions with
6430 vulnerable objects.  This includes functions that call alloca, and
6431 functions with buffers larger than 8 bytes.  The guards are initialized
6432 when a function is entered and then checked when the function exits.
6433 If a guard check fails, an error message is printed and the program exits.
6434
6435 @item -fstack-protector-all
6436 Like @option{-fstack-protector} except that all functions are protected.
6437
6438 @item -fsection-anchors
6439 @opindex fsection-anchors
6440 Try to reduce the number of symbolic address calculations by using
6441 shared ``anchor'' symbols to address nearby objects.  This transformation
6442 can help to reduce the number of GOT entries and GOT accesses on some
6443 targets.
6444
6445 For example, the implementation of the following function @code{foo}:
6446
6447 @smallexample
6448 static int a, b, c;
6449 int foo (void) @{ return a + b + c; @}
6450 @end smallexample
6451
6452 would usually calculate the addresses of all three variables, but if you
6453 compile it with @option{-fsection-anchors}, it will access the variables
6454 from a common anchor point instead.  The effect is similar to the
6455 following pseudocode (which isn't valid C):
6456
6457 @smallexample
6458 int foo (void)
6459 @{
6460   register int *xr = &x;
6461   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
6462 @}
6463 @end smallexample
6464
6465 Not all targets support this option.
6466
6467 @item --param @var{name}=@var{value}
6468 @opindex param
6469 In some places, GCC uses various constants to control the amount of
6470 optimization that is done.  For example, GCC will not inline functions
6471 that contain more that a certain number of instructions.  You can
6472 control some of these constants on the command-line using the
6473 @option{--param} option.
6474
6475 The names of specific parameters, and the meaning of the values, are
6476 tied to the internals of the compiler, and are subject to change
6477 without notice in future releases.
6478
6479 In each case, the @var{value} is an integer.  The allowable choices for
6480 @var{name} are given in the following table:
6481
6482 @table @gcctabopt
6483 @item salias-max-implicit-fields
6484 The maximum number of fields in a variable without direct
6485 structure accesses for which structure aliasing will consider trying
6486 to track each field.  The default is 5
6487
6488 @item salias-max-array-elements
6489 The maximum number of elements an array can have and its elements
6490 still be tracked individually by structure aliasing. The default is 4
6491
6492 @item sra-max-structure-size
6493 The maximum structure size, in bytes, at which the scalar replacement
6494 of aggregates (SRA) optimization will perform block copies.  The
6495 default value, 0, implies that GCC will select the most appropriate
6496 size itself.
6497
6498 @item sra-field-structure-ratio
6499 The threshold ratio (as a percentage) between instantiated fields and
6500 the complete structure size.  We say that if the ratio of the number
6501 of bytes in instantiated fields to the number of bytes in the complete
6502 structure exceeds this parameter, then block copies are not used.  The
6503 default is 75.
6504
6505 @item max-crossjump-edges
6506 The maximum number of incoming edges to consider for crossjumping.
6507 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
6508 the number of edges incoming to each block.  Increasing values mean
6509 more aggressive optimization, making the compile time increase with
6510 probably small improvement in executable size.
6511
6512 @item min-crossjump-insns
6513 The minimum number of instructions which must be matched at the end
6514 of two blocks before crossjumping will be performed on them.  This
6515 value is ignored in the case where all instructions in the block being
6516 crossjumped from are matched.  The default value is 5.
6517
6518 @item max-grow-copy-bb-insns
6519 The maximum code size expansion factor when copying basic blocks
6520 instead of jumping.  The expansion is relative to a jump instruction.
6521 The default value is 8.
6522
6523 @item max-goto-duplication-insns
6524 The maximum number of instructions to duplicate to a block that jumps
6525 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
6526 passes, GCC factors computed gotos early in the compilation process,
6527 and unfactors them as late as possible.  Only computed jumps at the
6528 end of a basic blocks with no more than max-goto-duplication-insns are
6529 unfactored.  The default value is 8.
6530
6531 @item max-delay-slot-insn-search
6532 The maximum number of instructions to consider when looking for an
6533 instruction to fill a delay slot.  If more than this arbitrary number of
6534 instructions is searched, the time savings from filling the delay slot
6535 will be minimal so stop searching.  Increasing values mean more
6536 aggressive optimization, making the compile time increase with probably
6537 small improvement in executable run time.
6538
6539 @item max-delay-slot-live-search
6540 When trying to fill delay slots, the maximum number of instructions to
6541 consider when searching for a block with valid live register
6542 information.  Increasing this arbitrarily chosen value means more
6543 aggressive optimization, increasing the compile time.  This parameter
6544 should be removed when the delay slot code is rewritten to maintain the
6545 control-flow graph.
6546
6547 @item max-gcse-memory
6548 The approximate maximum amount of memory that will be allocated in
6549 order to perform the global common subexpression elimination
6550 optimization.  If more memory than specified is required, the
6551 optimization will not be done.
6552
6553 @item max-gcse-passes
6554 The maximum number of passes of GCSE to run.  The default is 1.
6555
6556 @item max-pending-list-length
6557 The maximum number of pending dependencies scheduling will allow
6558 before flushing the current state and starting over.  Large functions
6559 with few branches or calls can create excessively large lists which
6560 needlessly consume memory and resources.
6561
6562 @item max-inline-insns-single
6563 Several parameters control the tree inliner used in gcc.
6564 This number sets the maximum number of instructions (counted in GCC's
6565 internal representation) in a single function that the tree inliner
6566 will consider for inlining.  This only affects functions declared
6567 inline and methods implemented in a class declaration (C++).
6568 The default value is 450.
6569
6570 @item max-inline-insns-auto
6571 When you use @option{-finline-functions} (included in @option{-O3}),
6572 a lot of functions that would otherwise not be considered for inlining
6573 by the compiler will be investigated.  To those functions, a different
6574 (more restrictive) limit compared to functions declared inline can
6575 be applied.
6576 The default value is 90.
6577
6578 @item large-function-insns
6579 The limit specifying really large functions.  For functions larger than this
6580 limit after inlining inlining is constrained by
6581 @option{--param large-function-growth}.  This parameter is useful primarily
6582 to avoid extreme compilation time caused by non-linear algorithms used by the
6583 backend.
6584 This parameter is ignored when @option{-funit-at-a-time} is not used.
6585 The default value is 2700.
6586
6587 @item large-function-growth
6588 Specifies maximal growth of large function caused by inlining in percents.
6589 This parameter is ignored when @option{-funit-at-a-time} is not used.
6590 The default value is 100 which limits large function growth to 2.0 times
6591 the original size.
6592
6593 @item large-unit-insns
6594 The limit specifying large translation unit.  Growth caused by inlining of
6595 units larger than this limit is limited by @option{--param inline-unit-growth}.
6596 For small units this might be too tight (consider unit consisting of function A
6597 that is inline and B that just calls A three time.  If B is small relative to
6598 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
6599 large units consisting of small inlininable functions however the overall unit
6600 growth limit is needed to avoid exponential explosion of code size.  Thus for
6601 smaller units, the size is increased to @option{--param large-unit-insns}
6602 before applying @option{--param inline-unit-growth}.  The default is 10000
6603
6604 @item inline-unit-growth
6605 Specifies maximal overall growth of the compilation unit caused by inlining.
6606 This parameter is ignored when @option{-funit-at-a-time} is not used.
6607 The default value is 30 which limits unit growth to 1.3 times the original
6608 size.
6609
6610 @item large-stack-frame
6611 The limit specifying large stack frames.  While inlining the algorithm is trying
6612 to not grow past this limit too much.  Default value is 256 bytes.
6613
6614 @item large-stack-frame-growth
6615 Specifies maximal growth of large stack frames caused by inlining in percents.
6616 The default value is 1000 which limits large stack frame growth to 11 times
6617 the original size.
6618
6619 @item max-inline-insns-recursive
6620 @itemx max-inline-insns-recursive-auto
6621 Specifies maximum number of instructions out-of-line copy of self recursive inline
6622 function can grow into by performing recursive inlining.
6623
6624 For functions declared inline @option{--param max-inline-insns-recursive} is
6625 taken into account.  For function not declared inline, recursive inlining
6626 happens only when @option{-finline-functions} (included in @option{-O3}) is
6627 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
6628 default value is 450.
6629
6630 @item max-inline-recursive-depth
6631 @itemx max-inline-recursive-depth-auto
6632 Specifies maximum recursion depth used by the recursive inlining.
6633
6634 For functions declared inline @option{--param max-inline-recursive-depth} is
6635 taken into account.  For function not declared inline, recursive inlining
6636 happens only when @option{-finline-functions} (included in @option{-O3}) is
6637 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
6638 default value is 450.
6639
6640 @item min-inline-recursive-probability
6641 Recursive inlining is profitable only for function having deep recursion
6642 in average and can hurt for function having little recursion depth by
6643 increasing the prologue size or complexity of function body to other
6644 optimizers.
6645
6646 When profile feedback is available (see @option{-fprofile-generate}) the actual
6647 recursion depth can be guessed from probability that function will recurse via
6648 given call expression.  This parameter limits inlining only to call expression
6649 whose probability exceeds given threshold (in percents).  The default value is
6650 10.
6651
6652 @item inline-call-cost
6653 Specify cost of call instruction relative to simple arithmetics operations
6654 (having cost of 1).  Increasing this cost disqualifies inlining of non-leaf
6655 functions and at the same time increases size of leaf function that is believed to
6656 reduce function size by being inlined.  In effect it increases amount of
6657 inlining for code having large abstraction penalty (many functions that just
6658 pass the arguments to other functions) and decrease inlining for code with low
6659 abstraction penalty.  The default value is 16.
6660
6661 @item min-vect-loop-bound
6662 The minimum number of iterations under which a loop will not get vectorized
6663 when @option{-ftree-vectorize} is used.  The number of iterations after
6664 vectorization needs to be greater than the value specified by this option
6665 to allow vectorization.  The default value is 0.
6666
6667 @item max-unrolled-insns
6668 The maximum number of instructions that a loop should have if that loop
6669 is unrolled, and if the loop is unrolled, it determines how many times
6670 the loop code is unrolled.
6671
6672 @item max-average-unrolled-insns
6673 The maximum number of instructions biased by probabilities of their execution
6674 that a loop should have if that loop is unrolled, and if the loop is unrolled,
6675 it determines how many times the loop code is unrolled.
6676
6677 @item max-unroll-times
6678 The maximum number of unrollings of a single loop.
6679
6680 @item max-peeled-insns
6681 The maximum number of instructions that a loop should have if that loop
6682 is peeled, and if the loop is peeled, it determines how many times
6683 the loop code is peeled.
6684
6685 @item max-peel-times
6686 The maximum number of peelings of a single loop.
6687
6688 @item max-completely-peeled-insns
6689 The maximum number of insns of a completely peeled loop.
6690
6691 @item max-completely-peel-times
6692 The maximum number of iterations of a loop to be suitable for complete peeling.
6693
6694 @item max-unswitch-insns
6695 The maximum number of insns of an unswitched loop.
6696
6697 @item max-unswitch-level
6698 The maximum number of branches unswitched in a single loop.
6699
6700 @item lim-expensive
6701 The minimum cost of an expensive expression in the loop invariant motion.
6702
6703 @item iv-consider-all-candidates-bound
6704 Bound on number of candidates for induction variables below that
6705 all candidates are considered for each use in induction variable
6706 optimizations.  Only the most relevant candidates are considered
6707 if there are more candidates, to avoid quadratic time complexity.
6708
6709 @item iv-max-considered-uses
6710 The induction variable optimizations give up on loops that contain more
6711 induction variable uses.
6712
6713 @item iv-always-prune-cand-set-bound
6714 If number of candidates in the set is smaller than this value,
6715 we always try to remove unnecessary ivs from the set during its
6716 optimization when a new iv is added to the set.
6717
6718 @item scev-max-expr-size
6719 Bound on size of expressions used in the scalar evolutions analyzer.
6720 Large expressions slow the analyzer.
6721
6722 @item omega-max-vars
6723 The maximum number of variables in an Omega constraint system.
6724 The default value is 128.
6725
6726 @item omega-max-geqs
6727 The maximum number of inequalities in an Omega constraint system.
6728 The default value is 256.
6729
6730 @item omega-max-eqs
6731 The maximum number of equalities in an Omega constraint system.
6732 The default value is 128.
6733
6734 @item omega-max-wild-cards
6735 The maximum number of wildcard variables that the Omega solver will
6736 be able to insert.  The default value is 18.
6737
6738 @item omega-hash-table-size
6739 The size of the hash table in the Omega solver.  The default value is
6740 550.
6741
6742 @item omega-max-keys
6743 The maximal number of keys used by the Omega solver.  The default
6744 value is 500.
6745
6746 @item omega-eliminate-redundant-constraints
6747 When set to 1, use expensive methods to eliminate all redundant
6748 constraints.  The default value is 0.
6749
6750 @item vect-max-version-for-alignment-checks
6751 The maximum number of runtime checks that can be performed when
6752 doing loop versioning for alignment in the vectorizer.  See option
6753 ftree-vect-loop-version for more information.
6754
6755 @item vect-max-version-for-alias-checks
6756 The maximum number of runtime checks that can be performed when
6757 doing loop versioning for alias in the vectorizer.  See option
6758 ftree-vect-loop-version for more information.
6759
6760 @item max-iterations-to-track
6761
6762 The maximum number of iterations of a loop the brute force algorithm
6763 for analysis of # of iterations of the loop tries to evaluate.
6764
6765 @item hot-bb-count-fraction
6766 Select fraction of the maximal count of repetitions of basic block in program
6767 given basic block needs to have to be considered hot.
6768
6769 @item hot-bb-frequency-fraction
6770 Select fraction of the maximal frequency of executions of basic block in
6771 function given basic block needs to have to be considered hot
6772
6773 @item max-predicted-iterations
6774 The maximum number of loop iterations we predict statically.  This is useful
6775 in cases where function contain single loop with known bound and other loop
6776 with unknown.  We predict the known number of iterations correctly, while
6777 the unknown number of iterations average to roughly 10.  This means that the
6778 loop without bounds would appear artificially cold relative to the other one.
6779
6780 @item tracer-dynamic-coverage
6781 @itemx tracer-dynamic-coverage-feedback
6782
6783 This value is used to limit superblock formation once the given percentage of
6784 executed instructions is covered.  This limits unnecessary code size
6785 expansion.
6786
6787 The @option{tracer-dynamic-coverage-feedback} is used only when profile
6788 feedback is available.  The real profiles (as opposed to statically estimated
6789 ones) are much less balanced allowing the threshold to be larger value.
6790
6791 @item tracer-max-code-growth
6792 Stop tail duplication once code growth has reached given percentage.  This is
6793 rather hokey argument, as most of the duplicates will be eliminated later in
6794 cross jumping, so it may be set to much higher values than is the desired code
6795 growth.
6796
6797 @item tracer-min-branch-ratio
6798
6799 Stop reverse growth when the reverse probability of best edge is less than this
6800 threshold (in percent).
6801
6802 @item tracer-min-branch-ratio
6803 @itemx tracer-min-branch-ratio-feedback
6804
6805 Stop forward growth if the best edge do have probability lower than this
6806 threshold.
6807
6808 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
6809 compilation for profile feedback and one for compilation without.  The value
6810 for compilation with profile feedback needs to be more conservative (higher) in
6811 order to make tracer effective.
6812
6813 @item max-cse-path-length
6814
6815 Maximum number of basic blocks on path that cse considers.  The default is 10.
6816
6817 @item max-cse-insns
6818 The maximum instructions CSE process before flushing. The default is 1000.
6819
6820 @item max-aliased-vops
6821
6822 Maximum number of virtual operands per function allowed to represent
6823 aliases before triggering the alias partitioning heuristic.  Alias
6824 partitioning reduces compile times and memory consumption needed for
6825 aliasing at the expense of precision loss in alias information.  The
6826 default value for this parameter is 100 for -O1, 500 for -O2 and 1000
6827 for -O3.
6828
6829 Notice that if a function contains more memory statements than the
6830 value of this parameter, it is not really possible to achieve this
6831 reduction.  In this case, the compiler will use the number of memory
6832 statements as the value for @option{max-aliased-vops}.
6833
6834 @item avg-aliased-vops
6835
6836 Average number of virtual operands per statement allowed to represent
6837 aliases before triggering the alias partitioning heuristic.  This
6838 works in conjunction with @option{max-aliased-vops}.  If a function
6839 contains more than @option{max-aliased-vops} virtual operators, then
6840 memory symbols will be grouped into memory partitions until either the
6841 total number of virtual operators is below @option{max-aliased-vops}
6842 or the average number of virtual operators per memory statement is
6843 below @option{avg-aliased-vops}.  The default value for this parameter
6844 is 1 for -O1 and -O2, and 3 for -O3.
6845
6846 @item ggc-min-expand
6847
6848 GCC uses a garbage collector to manage its own memory allocation.  This
6849 parameter specifies the minimum percentage by which the garbage
6850 collector's heap should be allowed to expand between collections.
6851 Tuning this may improve compilation speed; it has no effect on code
6852 generation.
6853
6854 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
6855 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of "RAM" is
6856 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
6857 GCC is not able to calculate RAM on a particular platform, the lower
6858 bound of 30% is used.  Setting this parameter and
6859 @option{ggc-min-heapsize} to zero causes a full collection to occur at
6860 every opportunity.  This is extremely slow, but can be useful for
6861 debugging.
6862
6863 @item ggc-min-heapsize
6864
6865 Minimum size of the garbage collector's heap before it begins bothering
6866 to collect garbage.  The first collection occurs after the heap expands
6867 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
6868 tuning this may improve compilation speed, and has no effect on code
6869 generation.
6870
6871 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit which
6872 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
6873 with a lower bound of 4096 (four megabytes) and an upper bound of
6874 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
6875 particular platform, the lower bound is used.  Setting this parameter
6876 very large effectively disables garbage collection.  Setting this
6877 parameter and @option{ggc-min-expand} to zero causes a full collection
6878 to occur at every opportunity.
6879
6880 @item max-reload-search-insns
6881 The maximum number of instruction reload should look backward for equivalent
6882 register.  Increasing values mean more aggressive optimization, making the
6883 compile time increase with probably slightly better performance.  The default
6884 value is 100.
6885
6886 @item max-cselib-memory-locations
6887 The maximum number of memory locations cselib should take into account.
6888 Increasing values mean more aggressive optimization, making the compile time
6889 increase with probably slightly better performance.  The default value is 500.
6890
6891 @item max-flow-memory-locations
6892 Similar as @option{max-cselib-memory-locations} but for dataflow liveness.
6893 The default value is 100.
6894
6895 @item reorder-blocks-duplicate
6896 @itemx reorder-blocks-duplicate-feedback
6897
6898 Used by basic block reordering pass to decide whether to use unconditional
6899 branch or duplicate the code on its destination.  Code is duplicated when its
6900 estimated size is smaller than this value multiplied by the estimated size of
6901 unconditional jump in the hot spots of the program.
6902
6903 The @option{reorder-block-duplicate-feedback} is used only when profile
6904 feedback is available and may be set to higher values than
6905 @option{reorder-block-duplicate} since information about the hot spots is more
6906 accurate.
6907
6908 @item max-sched-ready-insns
6909 The maximum number of instructions ready to be issued the scheduler should
6910 consider at any given time during the first scheduling pass.  Increasing
6911 values mean more thorough searches, making the compilation time increase
6912 with probably little benefit.  The default value is 100.
6913
6914 @item max-sched-region-blocks
6915 The maximum number of blocks in a region to be considered for
6916 interblock scheduling.  The default value is 10.
6917
6918 @item max-sched-region-insns
6919 The maximum number of insns in a region to be considered for
6920 interblock scheduling.  The default value is 100.
6921
6922 @item min-spec-prob
6923 The minimum probability (in percents) of reaching a source block
6924 for interblock speculative scheduling.  The default value is 40.
6925
6926 @item max-sched-extend-regions-iters
6927 The maximum number of iterations through CFG to extend regions.
6928 0 - disable region extension,
6929 N - do at most N iterations.
6930 The default value is 0.
6931
6932 @item max-sched-insn-conflict-delay
6933 The maximum conflict delay for an insn to be considered for speculative motion.
6934 The default value is 3.
6935
6936 @item sched-spec-prob-cutoff
6937 The minimal probability of speculation success (in percents), so that
6938 speculative insn will be scheduled.
6939 The default value is 40.
6940
6941 @item max-last-value-rtl
6942
6943 The maximum size measured as number of RTLs that can be recorded in an expression
6944 in combiner for a pseudo register as last known value of that register.  The default
6945 is 10000.
6946
6947 @item integer-share-limit
6948 Small integer constants can use a shared data structure, reducing the
6949 compiler's memory usage and increasing its speed.  This sets the maximum
6950 value of a shared integer constant's.  The default value is 256.
6951
6952 @item min-virtual-mappings
6953 Specifies the minimum number of virtual mappings in the incremental
6954 SSA updater that should be registered to trigger the virtual mappings
6955 heuristic defined by virtual-mappings-ratio.  The default value is
6956 100.
6957
6958 @item virtual-mappings-ratio
6959 If the number of virtual mappings is virtual-mappings-ratio bigger
6960 than the number of virtual symbols to be updated, then the incremental
6961 SSA updater switches to a full update for those symbols.  The default
6962 ratio is 3.
6963
6964 @item ssp-buffer-size
6965 The minimum size of buffers (i.e. arrays) that will receive stack smashing
6966 protection when @option{-fstack-protection} is used.
6967
6968 @item max-jump-thread-duplication-stmts
6969 Maximum number of statements allowed in a block that needs to be
6970 duplicated when threading jumps.
6971
6972 @item max-fields-for-field-sensitive
6973 Maximum number of fields in a structure we will treat in
6974 a field sensitive manner during pointer analysis.
6975
6976 @item prefetch-latency
6977 Estimate on average number of instructions that are executed before
6978 prefetch finishes.  The distance we prefetch ahead is proportional
6979 to this constant.  Increasing this number may also lead to less
6980 streams being prefetched (see @option{simultaneous-prefetches}).
6981
6982 @item simultaneous-prefetches
6983 Maximum number of prefetches that can run at the same time.
6984
6985 @item l1-cache-line-size
6986 The size of cache line in L1 cache, in bytes.
6987
6988 @item l1-cache-size
6989 The size of L1 cache, in kilobytes.
6990
6991 @item l2-cache-size
6992 The size of L2 cache, in kilobytes.
6993
6994 @item use-canonical-types
6995 Whether the compiler should use the ``canonical'' type system.  By
6996 default, this should always be 1, which uses a more efficient internal
6997 mechanism for comparing types in C++ and Objective-C++.  However, if
6998 bugs in the canonical type system are causing compilation failures,
6999 set this value to 0 to disable canonical types.
7000
7001 @end table
7002 @end table
7003
7004 @node Preprocessor Options
7005 @section Options Controlling the Preprocessor
7006 @cindex preprocessor options
7007 @cindex options, preprocessor
7008
7009 These options control the C preprocessor, which is run on each C source
7010 file before actual compilation.
7011
7012 If you use the @option{-E} option, nothing is done except preprocessing.
7013 Some of these options make sense only together with @option{-E} because
7014 they cause the preprocessor output to be unsuitable for actual
7015 compilation.
7016
7017 @table @gcctabopt
7018 @opindex Wp
7019 You can use @option{-Wp,@var{option}} to bypass the compiler driver
7020 and pass @var{option} directly through to the preprocessor.  If
7021 @var{option} contains commas, it is split into multiple options at the
7022 commas.  However, many options are modified, translated or interpreted
7023 by the compiler driver before being passed to the preprocessor, and
7024 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
7025 interface is undocumented and subject to change, so whenever possible
7026 you should avoid using @option{-Wp} and let the driver handle the
7027 options instead.
7028
7029 @item -Xpreprocessor @var{option}
7030 @opindex preprocessor
7031 Pass @var{option} as an option to the preprocessor.  You can use this to
7032 supply system-specific preprocessor options which GCC does not know how to
7033 recognize.
7034
7035 If you want to pass an option that takes an argument, you must use
7036 @option{-Xpreprocessor} twice, once for the option and once for the argument.
7037 @end table
7038
7039 @include cppopts.texi
7040
7041 @node Assembler Options
7042 @section Passing Options to the Assembler
7043
7044 @c prevent bad page break with this line
7045 You can pass options to the assembler.
7046
7047 @table @gcctabopt
7048 @item -Wa,@var{option}
7049 @opindex Wa
7050 Pass @var{option} as an option to the assembler.  If @var{option}
7051 contains commas, it is split into multiple options at the commas.
7052
7053 @item -Xassembler @var{option}
7054 @opindex Xassembler
7055 Pass @var{option} as an option to the assembler.  You can use this to
7056 supply system-specific assembler options which GCC does not know how to
7057 recognize.
7058
7059 If you want to pass an option that takes an argument, you must use
7060 @option{-Xassembler} twice, once for the option and once for the argument.
7061
7062 @end table
7063
7064 @node Link Options
7065 @section Options for Linking
7066 @cindex link options
7067 @cindex options, linking
7068
7069 These options come into play when the compiler links object files into
7070 an executable output file.  They are meaningless if the compiler is
7071 not doing a link step.
7072
7073 @table @gcctabopt
7074 @cindex file names
7075 @item @var{object-file-name}
7076 A file name that does not end in a special recognized suffix is
7077 considered to name an object file or library.  (Object files are
7078 distinguished from libraries by the linker according to the file
7079 contents.)  If linking is done, these object files are used as input
7080 to the linker.
7081
7082 @item -c
7083 @itemx -S
7084 @itemx -E
7085 @opindex c
7086 @opindex S
7087 @opindex E
7088 If any of these options is used, then the linker is not run, and
7089 object file names should not be used as arguments.  @xref{Overall
7090 Options}.
7091
7092 @cindex Libraries
7093 @item -l@var{library}
7094 @itemx -l @var{library}
7095 @opindex l
7096 Search the library named @var{library} when linking.  (The second
7097 alternative with the library as a separate argument is only for
7098 POSIX compliance and is not recommended.)
7099
7100 It makes a difference where in the command you write this option; the
7101 linker searches and processes libraries and object files in the order they
7102 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
7103 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
7104 to functions in @samp{z}, those functions may not be loaded.
7105
7106 The linker searches a standard list of directories for the library,
7107 which is actually a file named @file{lib@var{library}.a}.  The linker
7108 then uses this file as if it had been specified precisely by name.
7109
7110 The directories searched include several standard system directories
7111 plus any that you specify with @option{-L}.
7112
7113 Normally the files found this way are library files---archive files
7114 whose members are object files.  The linker handles an archive file by
7115 scanning through it for members which define symbols that have so far
7116 been referenced but not defined.  But if the file that is found is an
7117 ordinary object file, it is linked in the usual fashion.  The only
7118 difference between using an @option{-l} option and specifying a file name
7119 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
7120 and searches several directories.
7121
7122 @item -lobjc
7123 @opindex lobjc
7124 You need this special case of the @option{-l} option in order to
7125 link an Objective-C or Objective-C++ program.
7126
7127 @item -nostartfiles
7128 @opindex nostartfiles
7129 Do not use the standard system startup files when linking.
7130 The standard system libraries are used normally, unless @option{-nostdlib}
7131 or @option{-nodefaultlibs} is used.
7132
7133 @item -nodefaultlibs
7134 @opindex nodefaultlibs
7135 Do not use the standard system libraries when linking.
7136 Only the libraries you specify will be passed to the linker.
7137 The standard startup files are used normally, unless @option{-nostartfiles}
7138 is used.  The compiler may generate calls to @code{memcmp},
7139 @code{memset}, @code{memcpy} and @code{memmove}.
7140 These entries are usually resolved by entries in
7141 libc.  These entry points should be supplied through some other
7142 mechanism when this option is specified.
7143
7144 @item -nostdlib
7145 @opindex nostdlib
7146 Do not use the standard system startup files or libraries when linking.
7147 No startup files and only the libraries you specify will be passed to
7148 the linker.  The compiler may generate calls to @code{memcmp}, @code{memset},
7149 @code{memcpy} and @code{memmove}.
7150 These entries are usually resolved by entries in
7151 libc.  These entry points should be supplied through some other
7152 mechanism when this option is specified.
7153
7154 @cindex @option{-lgcc}, use with @option{-nostdlib}
7155 @cindex @option{-nostdlib} and unresolved references
7156 @cindex unresolved references and @option{-nostdlib}
7157 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
7158 @cindex @option{-nodefaultlibs} and unresolved references
7159 @cindex unresolved references and @option{-nodefaultlibs}
7160 One of the standard libraries bypassed by @option{-nostdlib} and
7161 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
7162 that GCC uses to overcome shortcomings of particular machines, or special
7163 needs for some languages.
7164 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
7165 Collection (GCC) Internals},
7166 for more discussion of @file{libgcc.a}.)
7167 In most cases, you need @file{libgcc.a} even when you want to avoid
7168 other standard libraries.  In other words, when you specify @option{-nostdlib}
7169 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
7170 This ensures that you have no unresolved references to internal GCC
7171 library subroutines.  (For example, @samp{__main}, used to ensure C++
7172 constructors will be called; @pxref{Collect2,,@code{collect2}, gccint,
7173 GNU Compiler Collection (GCC) Internals}.)
7174
7175 @item -pie
7176 @opindex pie
7177 Produce a position independent executable on targets which support it.
7178 For predictable results, you must also specify the same set of options
7179 that were used to generate code (@option{-fpie}, @option{-fPIE},
7180 or model suboptions) when you specify this option.
7181
7182 @item -rdynamic
7183 @opindex rdynamic
7184 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
7185 that support it. This instructs the linker to add all symbols, not
7186 only used ones, to the dynamic symbol table. This option is needed
7187 for some uses of @code{dlopen} or to allow obtaining backtraces
7188 from within a program.
7189
7190 @item -s
7191 @opindex s
7192 Remove all symbol table and relocation information from the executable.
7193
7194 @item -static
7195 @opindex static
7196 On systems that support dynamic linking, this prevents linking with the shared
7197 libraries.  On other systems, this option has no effect.
7198
7199 @item -shared
7200 @opindex shared
7201 Produce a shared object which can then be linked with other objects to
7202 form an executable.  Not all systems support this option.  For predictable
7203 results, you must also specify the same set of options that were used to
7204 generate code (@option{-fpic}, @option{-fPIC}, or model suboptions)
7205 when you specify this option.@footnote{On some systems, @samp{gcc -shared}
7206 needs to build supplementary stub code for constructors to work.  On
7207 multi-libbed systems, @samp{gcc -shared} must select the correct support
7208 libraries to link against.  Failing to supply the correct flags may lead
7209 to subtle defects.  Supplying them in cases where they are not necessary
7210 is innocuous.}
7211
7212 @item -shared-libgcc
7213 @itemx -static-libgcc
7214 @opindex shared-libgcc
7215 @opindex static-libgcc
7216 On systems that provide @file{libgcc} as a shared library, these options
7217 force the use of either the shared or static version respectively.
7218 If no shared version of @file{libgcc} was built when the compiler was
7219 configured, these options have no effect.
7220
7221 There are several situations in which an application should use the
7222 shared @file{libgcc} instead of the static version.  The most common
7223 of these is when the application wishes to throw and catch exceptions
7224 across different shared libraries.  In that case, each of the libraries
7225 as well as the application itself should use the shared @file{libgcc}.
7226
7227 Therefore, the G++ and GCJ drivers automatically add
7228 @option{-shared-libgcc} whenever you build a shared library or a main
7229 executable, because C++ and Java programs typically use exceptions, so
7230 this is the right thing to do.
7231
7232 If, instead, you use the GCC driver to create shared libraries, you may
7233 find that they will not always be linked with the shared @file{libgcc}.
7234 If GCC finds, at its configuration time, that you have a non-GNU linker
7235 or a GNU linker that does not support option @option{--eh-frame-hdr},
7236 it will link the shared version of @file{libgcc} into shared libraries
7237 by default.  Otherwise, it will take advantage of the linker and optimize
7238 away the linking with the shared version of @file{libgcc}, linking with
7239 the static version of libgcc by default.  This allows exceptions to
7240 propagate through such shared libraries, without incurring relocation
7241 costs at library load time.
7242
7243 However, if a library or main executable is supposed to throw or catch
7244 exceptions, you must link it using the G++ or GCJ driver, as appropriate
7245 for the languages used in the program, or using the option
7246 @option{-shared-libgcc}, such that it is linked with the shared
7247 @file{libgcc}.
7248
7249 @item -symbolic
7250 @opindex symbolic
7251 Bind references to global symbols when building a shared object.  Warn
7252 about any unresolved references (unless overridden by the link editor
7253 option @samp{-Xlinker -z -Xlinker defs}).  Only a few systems support
7254 this option.
7255
7256 @item -Xlinker @var{option}
7257 @opindex Xlinker
7258 Pass @var{option} as an option to the linker.  You can use this to
7259 supply system-specific linker options which GCC does not know how to
7260 recognize.
7261
7262 If you want to pass an option that takes an argument, you must use
7263 @option{-Xlinker} twice, once for the option and once for the argument.
7264 For example, to pass @option{-assert definitions}, you must write
7265 @samp{-Xlinker -assert -Xlinker definitions}.  It does not work to write
7266 @option{-Xlinker "-assert definitions"}, because this passes the entire
7267 string as a single argument, which is not what the linker expects.
7268
7269 @item -Wl,@var{option}
7270 @opindex Wl
7271 Pass @var{option} as an option to the linker.  If @var{option} contains
7272 commas, it is split into multiple options at the commas.
7273
7274 @item -u @var{symbol}
7275 @opindex u
7276 Pretend the symbol @var{symbol} is undefined, to force linking of
7277 library modules to define it.  You can use @option{-u} multiple times with
7278 different symbols to force loading of additional library modules.
7279 @end table
7280
7281 @node Directory Options
7282 @section Options for Directory Search
7283 @cindex directory options
7284 @cindex options, directory search
7285 @cindex search path
7286
7287 These options specify directories to search for header files, for
7288 libraries and for parts of the compiler:
7289
7290 @table @gcctabopt
7291 @item -I@var{dir}
7292 @opindex I
7293 Add the directory @var{dir} to the head of the list of directories to be
7294 searched for header files.  This can be used to override a system header
7295 file, substituting your own version, since these directories are
7296 searched before the system header file directories.  However, you should
7297 not use this option to add directories that contain vendor-supplied
7298 system header files (use @option{-isystem} for that).  If you use more than
7299 one @option{-I} option, the directories are scanned in left-to-right
7300 order; the standard system directories come after.
7301
7302 If a standard system include directory, or a directory specified with
7303 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
7304 option will be ignored.  The directory will still be searched but as a
7305 system directory at its normal position in the system include chain.
7306 This is to ensure that GCC's procedure to fix buggy system headers and
7307 the ordering for the include_next directive are not inadvertently changed.
7308 If you really need to change the search order for system directories,
7309 use the @option{-nostdinc} and/or @option{-isystem} options.
7310
7311 @item -iquote@var{dir}
7312 @opindex iquote
7313 Add the directory @var{dir} to the head of the list of directories to
7314 be searched for header files only for the case of @samp{#include
7315 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
7316 otherwise just like @option{-I}.
7317
7318 @item -L@var{dir}
7319 @opindex L
7320 Add directory @var{dir} to the list of directories to be searched
7321 for @option{-l}.
7322
7323 @item -B@var{prefix}
7324 @opindex B
7325 This option specifies where to find the executables, libraries,
7326 include files, and data files of the compiler itself.
7327
7328 The compiler driver program runs one or more of the subprograms
7329 @file{cpp}, @file{cc1}, @file{as} and @file{ld}.  It tries
7330 @var{prefix} as a prefix for each program it tries to run, both with and
7331 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
7332
7333 For each subprogram to be run, the compiler driver first tries the
7334 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
7335 was not specified, the driver tries two standard prefixes, which are
7336 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
7337 those results in a file name that is found, the unmodified program
7338 name is searched for using the directories specified in your
7339 @env{PATH} environment variable.
7340
7341 The compiler will check to see if the path provided by the @option{-B}
7342 refers to a directory, and if necessary it will add a directory
7343 separator character at the end of the path.
7344
7345 @option{-B} prefixes that effectively specify directory names also apply
7346 to libraries in the linker, because the compiler translates these
7347 options into @option{-L} options for the linker.  They also apply to
7348 includes files in the preprocessor, because the compiler translates these
7349 options into @option{-isystem} options for the preprocessor.  In this case,
7350 the compiler appends @samp{include} to the prefix.
7351
7352 The run-time support file @file{libgcc.a} can also be searched for using
7353 the @option{-B} prefix, if needed.  If it is not found there, the two
7354 standard prefixes above are tried, and that is all.  The file is left
7355 out of the link if it is not found by those means.
7356
7357 Another way to specify a prefix much like the @option{-B} prefix is to use
7358 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
7359 Variables}.
7360
7361 As a special kludge, if the path provided by @option{-B} is
7362 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
7363 9, then it will be replaced by @file{[dir/]include}.  This is to help
7364 with boot-strapping the compiler.
7365
7366 @item -specs=@var{file}
7367 @opindex specs
7368 Process @var{file} after the compiler reads in the standard @file{specs}
7369 file, in order to override the defaults that the @file{gcc} driver
7370 program uses when determining what switches to pass to @file{cc1},
7371 @file{cc1plus}, @file{as}, @file{ld}, etc.  More than one
7372 @option{-specs=@var{file}} can be specified on the command line, and they
7373 are processed in order, from left to right.
7374
7375 @item --sysroot=@var{dir}
7376 @opindex sysroot
7377 Use @var{dir} as the logical root directory for headers and libraries.
7378 For example, if the compiler would normally search for headers in
7379 @file{/usr/include} and libraries in @file{/usr/lib}, it will instead
7380 search @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
7381
7382 If you use both this option and the @option{-isysroot} option, then
7383 the @option{--sysroot} option will apply to libraries, but the
7384 @option{-isysroot} option will apply to header files.
7385
7386 The GNU linker (beginning with version 2.16) has the necessary support
7387 for this option.  If your linker does not support this option, the
7388 header file aspect of @option{--sysroot} will still work, but the
7389 library aspect will not.
7390
7391 @item -I-
7392 @opindex I-
7393 This option has been deprecated.  Please use @option{-iquote} instead for
7394 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
7395 Any directories you specify with @option{-I} options before the @option{-I-}
7396 option are searched only for the case of @samp{#include "@var{file}"};
7397 they are not searched for @samp{#include <@var{file}>}.
7398
7399 If additional directories are specified with @option{-I} options after
7400 the @option{-I-}, these directories are searched for all @samp{#include}
7401 directives.  (Ordinarily @emph{all} @option{-I} directories are used
7402 this way.)
7403
7404 In addition, the @option{-I-} option inhibits the use of the current
7405 directory (where the current input file came from) as the first search
7406 directory for @samp{#include "@var{file}"}.  There is no way to
7407 override this effect of @option{-I-}.  With @option{-I.} you can specify
7408 searching the directory which was current when the compiler was
7409 invoked.  That is not exactly the same as what the preprocessor does
7410 by default, but it is often satisfactory.
7411
7412 @option{-I-} does not inhibit the use of the standard system directories
7413 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
7414 independent.
7415 @end table
7416
7417 @c man end
7418
7419 @node Spec Files
7420 @section Specifying subprocesses and the switches to pass to them
7421 @cindex Spec Files
7422
7423 @command{gcc} is a driver program.  It performs its job by invoking a
7424 sequence of other programs to do the work of compiling, assembling and
7425 linking.  GCC interprets its command-line parameters and uses these to
7426 deduce which programs it should invoke, and which command-line options
7427 it ought to place on their command lines.  This behavior is controlled
7428 by @dfn{spec strings}.  In most cases there is one spec string for each
7429 program that GCC can invoke, but a few programs have multiple spec
7430 strings to control their behavior.  The spec strings built into GCC can
7431 be overridden by using the @option{-specs=} command-line switch to specify
7432 a spec file.
7433
7434 @dfn{Spec files} are plaintext files that are used to construct spec
7435 strings.  They consist of a sequence of directives separated by blank
7436 lines.  The type of directive is determined by the first non-whitespace
7437 character on the line and it can be one of the following:
7438
7439 @table @code
7440 @item %@var{command}
7441 Issues a @var{command} to the spec file processor.  The commands that can
7442 appear here are:
7443
7444 @table @code
7445 @item %include <@var{file}>
7446 @cindex %include
7447 Search for @var{file} and insert its text at the current point in the
7448 specs file.
7449
7450 @item %include_noerr <@var{file}>
7451 @cindex %include_noerr
7452 Just like @samp{%include}, but do not generate an error message if the include
7453 file cannot be found.
7454
7455 @item %rename @var{old_name} @var{new_name}
7456 @cindex %rename
7457 Rename the spec string @var{old_name} to @var{new_name}.
7458
7459 @end table
7460
7461 @item *[@var{spec_name}]:
7462 This tells the compiler to create, override or delete the named spec
7463 string.  All lines after this directive up to the next directive or
7464 blank line are considered to be the text for the spec string.  If this
7465 results in an empty string then the spec will be deleted.  (Or, if the
7466 spec did not exist, then nothing will happened.)  Otherwise, if the spec
7467 does not currently exist a new spec will be created.  If the spec does
7468 exist then its contents will be overridden by the text of this
7469 directive, unless the first character of that text is the @samp{+}
7470 character, in which case the text will be appended to the spec.
7471
7472 @item [@var{suffix}]:
7473 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
7474 and up to the next directive or blank line are considered to make up the
7475 spec string for the indicated suffix.  When the compiler encounters an
7476 input file with the named suffix, it will processes the spec string in
7477 order to work out how to compile that file.  For example:
7478
7479 @smallexample
7480 .ZZ:
7481 z-compile -input %i
7482 @end smallexample
7483
7484 This says that any input file whose name ends in @samp{.ZZ} should be
7485 passed to the program @samp{z-compile}, which should be invoked with the
7486 command-line switch @option{-input} and with the result of performing the
7487 @samp{%i} substitution.  (See below.)
7488
7489 As an alternative to providing a spec string, the text that follows a
7490 suffix directive can be one of the following:
7491
7492 @table @code
7493 @item @@@var{language}
7494 This says that the suffix is an alias for a known @var{language}.  This is
7495 similar to using the @option{-x} command-line switch to GCC to specify a
7496 language explicitly.  For example:
7497
7498 @smallexample
7499 .ZZ:
7500 @@c++
7501 @end smallexample
7502
7503 Says that .ZZ files are, in fact, C++ source files.
7504
7505 @item #@var{name}
7506 This causes an error messages saying:
7507
7508 @smallexample
7509 @var{name} compiler not installed on this system.
7510 @end smallexample
7511 @end table
7512
7513 GCC already has an extensive list of suffixes built into it.
7514 This directive will add an entry to the end of the list of suffixes, but
7515 since the list is searched from the end backwards, it is effectively
7516 possible to override earlier entries using this technique.
7517
7518 @end table
7519
7520 GCC has the following spec strings built into it.  Spec files can
7521 override these strings or create their own.  Note that individual
7522 targets can also add their own spec strings to this list.
7523
7524 @smallexample
7525 asm          Options to pass to the assembler
7526 asm_final    Options to pass to the assembler post-processor
7527 cpp          Options to pass to the C preprocessor
7528 cc1          Options to pass to the C compiler
7529 cc1plus      Options to pass to the C++ compiler
7530 endfile      Object files to include at the end of the link
7531 link         Options to pass to the linker
7532 lib          Libraries to include on the command line to the linker
7533 libgcc       Decides which GCC support library to pass to the linker
7534 linker       Sets the name of the linker
7535 predefines   Defines to be passed to the C preprocessor
7536 signed_char  Defines to pass to CPP to say whether @code{char} is signed
7537              by default
7538 startfile    Object files to include at the start of the link
7539 @end smallexample
7540
7541 Here is a small example of a spec file:
7542
7543 @smallexample
7544 %rename lib                 old_lib
7545
7546 *lib:
7547 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
7548 @end smallexample
7549
7550 This example renames the spec called @samp{lib} to @samp{old_lib} and
7551 then overrides the previous definition of @samp{lib} with a new one.
7552 The new definition adds in some extra command-line options before
7553 including the text of the old definition.
7554
7555 @dfn{Spec strings} are a list of command-line options to be passed to their
7556 corresponding program.  In addition, the spec strings can contain
7557 @samp{%}-prefixed sequences to substitute variable text or to
7558 conditionally insert text into the command line.  Using these constructs
7559 it is possible to generate quite complex command lines.
7560
7561 Here is a table of all defined @samp{%}-sequences for spec
7562 strings.  Note that spaces are not generated automatically around the
7563 results of expanding these sequences.  Therefore you can concatenate them
7564 together or combine them with constant text in a single argument.
7565
7566 @table @code
7567 @item %%
7568 Substitute one @samp{%} into the program name or argument.
7569
7570 @item %i
7571 Substitute the name of the input file being processed.
7572
7573 @item %b
7574 Substitute the basename of the input file being processed.
7575 This is the substring up to (and not including) the last period
7576 and not including the directory.
7577
7578 @item %B
7579 This is the same as @samp{%b}, but include the file suffix (text after
7580 the last period).
7581
7582 @item %d
7583 Marks the argument containing or following the @samp{%d} as a
7584 temporary file name, so that that file will be deleted if GCC exits
7585 successfully.  Unlike @samp{%g}, this contributes no text to the
7586 argument.
7587
7588 @item %g@var{suffix}
7589 Substitute a file name that has suffix @var{suffix} and is chosen
7590 once per compilation, and mark the argument in the same way as
7591 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
7592 name is now chosen in a way that is hard to predict even when previously
7593 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
7594 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
7595 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
7596 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
7597 was simply substituted with a file name chosen once per compilation,
7598 without regard to any appended suffix (which was therefore treated
7599 just like ordinary text), making such attacks more likely to succeed.
7600
7601 @item %u@var{suffix}
7602 Like @samp{%g}, but generates a new temporary file name even if
7603 @samp{%u@var{suffix}} was already seen.
7604
7605 @item %U@var{suffix}
7606 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
7607 new one if there is no such last file name.  In the absence of any
7608 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
7609 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
7610 would involve the generation of two distinct file names, one
7611 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
7612 simply substituted with a file name chosen for the previous @samp{%u},
7613 without regard to any appended suffix.
7614
7615 @item %j@var{suffix}
7616 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
7617 writable, and if save-temps is off; otherwise, substitute the name
7618 of a temporary file, just like @samp{%u}.  This temporary file is not
7619 meant for communication between processes, but rather as a junk
7620 disposal mechanism.
7621
7622 @item %|@var{suffix}
7623 @itemx %m@var{suffix}
7624 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
7625 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
7626 all.  These are the two most common ways to instruct a program that it
7627 should read from standard input or write to standard output.  If you
7628 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
7629 construct: see for example @file{f/lang-specs.h}.
7630
7631 @item %.@var{SUFFIX}
7632 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
7633 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
7634 terminated by the next space or %.
7635
7636 @item %w
7637 Marks the argument containing or following the @samp{%w} as the
7638 designated output file of this compilation.  This puts the argument
7639 into the sequence of arguments that @samp{%o} will substitute later.
7640
7641 @item %o
7642 Substitutes the names of all the output files, with spaces
7643 automatically placed around them.  You should write spaces
7644 around the @samp{%o} as well or the results are undefined.
7645 @samp{%o} is for use in the specs for running the linker.
7646 Input files whose names have no recognized suffix are not compiled
7647 at all, but they are included among the output files, so they will
7648 be linked.
7649
7650 @item %O
7651 Substitutes the suffix for object files.  Note that this is
7652 handled specially when it immediately follows @samp{%g, %u, or %U},
7653 because of the need for those to form complete file names.  The
7654 handling is such that @samp{%O} is treated exactly as if it had already
7655 been substituted, except that @samp{%g, %u, and %U} do not currently
7656 support additional @var{suffix} characters following @samp{%O} as they would
7657 following, for example, @samp{.o}.
7658
7659 @item %p
7660 Substitutes the standard macro predefinitions for the
7661 current target machine.  Use this when running @code{cpp}.
7662
7663 @item %P
7664 Like @samp{%p}, but puts @samp{__} before and after the name of each
7665 predefined macro, except for macros that start with @samp{__} or with
7666 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
7667 C@.
7668
7669 @item %I
7670 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
7671 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
7672 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
7673 and @option{-imultilib} as necessary.
7674
7675 @item %s
7676 Current argument is the name of a library or startup file of some sort.
7677 Search for that file in a standard list of directories and substitute
7678 the full name found.
7679
7680 @item %e@var{str}
7681 Print @var{str} as an error message.  @var{str} is terminated by a newline.
7682 Use this when inconsistent options are detected.
7683
7684 @item %(@var{name})
7685 Substitute the contents of spec string @var{name} at this point.
7686
7687 @item %[@var{name}]
7688 Like @samp{%(@dots{})} but put @samp{__} around @option{-D} arguments.
7689
7690 @item %x@{@var{option}@}
7691 Accumulate an option for @samp{%X}.
7692
7693 @item %X
7694 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
7695 spec string.
7696
7697 @item %Y
7698 Output the accumulated assembler options specified by @option{-Wa}.
7699
7700 @item %Z
7701 Output the accumulated preprocessor options specified by @option{-Wp}.
7702
7703 @item %a
7704 Process the @code{asm} spec.  This is used to compute the
7705 switches to be passed to the assembler.
7706
7707 @item %A
7708 Process the @code{asm_final} spec.  This is a spec string for
7709 passing switches to an assembler post-processor, if such a program is
7710 needed.
7711
7712 @item %l
7713 Process the @code{link} spec.  This is the spec for computing the
7714 command line passed to the linker.  Typically it will make use of the
7715 @samp{%L %G %S %D and %E} sequences.
7716
7717 @item %D
7718 Dump out a @option{-L} option for each directory that GCC believes might
7719 contain startup files.  If the target supports multilibs then the
7720 current multilib directory will be prepended to each of these paths.
7721
7722 @item %L
7723 Process the @code{lib} spec.  This is a spec string for deciding which
7724 libraries should be included on the command line to the linker.
7725
7726 @item %G
7727 Process the @code{libgcc} spec.  This is a spec string for deciding
7728 which GCC support library should be included on the command line to the linker.
7729
7730 @item %S
7731 Process the @code{startfile} spec.  This is a spec for deciding which
7732 object files should be the first ones passed to the linker.  Typically
7733 this might be a file named @file{crt0.o}.
7734
7735 @item %E
7736 Process the @code{endfile} spec.  This is a spec string that specifies
7737 the last object files that will be passed to the linker.
7738
7739 @item %C
7740 Process the @code{cpp} spec.  This is used to construct the arguments
7741 to be passed to the C preprocessor.
7742
7743 @item %1
7744 Process the @code{cc1} spec.  This is used to construct the options to be
7745 passed to the actual C compiler (@samp{cc1}).
7746
7747 @item %2
7748 Process the @code{cc1plus} spec.  This is used to construct the options to be
7749 passed to the actual C++ compiler (@samp{cc1plus}).
7750
7751 @item %*
7752 Substitute the variable part of a matched option.  See below.
7753 Note that each comma in the substituted string is replaced by
7754 a single space.
7755
7756 @item %<@code{S}
7757 Remove all occurrences of @code{-S} from the command line.  Note---this
7758 command is position dependent.  @samp{%} commands in the spec string
7759 before this one will see @code{-S}, @samp{%} commands in the spec string
7760 after this one will not.
7761
7762 @item %:@var{function}(@var{args})
7763 Call the named function @var{function}, passing it @var{args}.
7764 @var{args} is first processed as a nested spec string, then split
7765 into an argument vector in the usual fashion.  The function returns
7766 a string which is processed as if it had appeared literally as part
7767 of the current spec.
7768
7769 The following built-in spec functions are provided:
7770
7771 @table @code
7772 @item @code{getenv}
7773 The @code{getenv} spec function takes two arguments: an environment
7774 variable name and a string.  If the environment variable is not
7775 defined, a fatal error is issued.  Otherwise, the return value is the
7776 value of the environment variable concatenated with the string.  For
7777 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
7778
7779 @smallexample
7780 %:getenv(TOPDIR /include)
7781 @end smallexample
7782
7783 expands to @file{/path/to/top/include}.
7784
7785 @item @code{if-exists}
7786 The @code{if-exists} spec function takes one argument, an absolute
7787 pathname to a file.  If the file exists, @code{if-exists} returns the
7788 pathname.  Here is a small example of its usage:
7789
7790 @smallexample
7791 *startfile:
7792 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
7793 @end smallexample
7794
7795 @item @code{if-exists-else}
7796 The @code{if-exists-else} spec function is similar to the @code{if-exists}
7797 spec function, except that it takes two arguments.  The first argument is
7798 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
7799 returns the pathname.  If it does not exist, it returns the second argument.
7800 This way, @code{if-exists-else} can be used to select one file or another,
7801 based on the existence of the first.  Here is a small example of its usage:
7802
7803 @smallexample
7804 *startfile:
7805 crt0%O%s %:if-exists(crti%O%s) \
7806 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
7807 @end smallexample
7808
7809 @item @code{replace-outfile}
7810 The @code{replace-outfile} spec function takes two arguments.  It looks for the
7811 first argument in the outfiles array and replaces it with the second argument.  Here
7812 is a small example of its usage:
7813
7814 @smallexample
7815 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
7816 @end smallexample
7817
7818 @item @code{print-asm-header}
7819 The @code{print-asm-header} function takes no arguments and simply
7820 prints a banner like:
7821
7822 @smallexample
7823 Assembler options
7824 =================
7825
7826 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
7827 @end smallexample
7828
7829 It is used to separate compiler options from assembler options
7830 in the @option{--target-help} output.
7831 @end table
7832
7833 @item %@{@code{S}@}
7834 Substitutes the @code{-S} switch, if that switch was given to GCC@.
7835 If that switch was not specified, this substitutes nothing.  Note that
7836 the leading dash is omitted when specifying this option, and it is
7837 automatically inserted if the substitution is performed.  Thus the spec
7838 string @samp{%@{foo@}} would match the command-line option @option{-foo}
7839 and would output the command line option @option{-foo}.
7840
7841 @item %W@{@code{S}@}
7842 Like %@{@code{S}@} but mark last argument supplied within as a file to be
7843 deleted on failure.
7844
7845 @item %@{@code{S}*@}
7846 Substitutes all the switches specified to GCC whose names start
7847 with @code{-S}, but which also take an argument.  This is used for
7848 switches like @option{-o}, @option{-D}, @option{-I}, etc.
7849 GCC considers @option{-o foo} as being
7850 one switch whose names starts with @samp{o}.  %@{o*@} would substitute this
7851 text, including the space.  Thus two arguments would be generated.
7852
7853 @item %@{@code{S}*&@code{T}*@}
7854 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
7855 (the order of @code{S} and @code{T} in the spec is not significant).
7856 There can be any number of ampersand-separated variables; for each the
7857 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
7858
7859 @item %@{@code{S}:@code{X}@}
7860 Substitutes @code{X}, if the @samp{-S} switch was given to GCC@.
7861
7862 @item %@{!@code{S}:@code{X}@}
7863 Substitutes @code{X}, if the @samp{-S} switch was @emph{not} given to GCC@.
7864
7865 @item %@{@code{S}*:@code{X}@}
7866 Substitutes @code{X} if one or more switches whose names start with
7867 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
7868 once, no matter how many such switches appeared.  However, if @code{%*}
7869 appears somewhere in @code{X}, then @code{X} will be substituted once
7870 for each matching switch, with the @code{%*} replaced by the part of
7871 that switch that matched the @code{*}.
7872
7873 @item %@{.@code{S}:@code{X}@}
7874 Substitutes @code{X}, if processing a file with suffix @code{S}.
7875
7876 @item %@{!.@code{S}:@code{X}@}
7877 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
7878
7879 @item %@{,@code{S}:@code{X}@}
7880 Substitutes @code{X}, if processing a file for language @code{S}.
7881
7882 @item %@{!,@code{S}:@code{X}@}
7883 Substitutes @code{X}, if not processing a file for language @code{S}.
7884
7885 @item %@{@code{S}|@code{P}:@code{X}@}
7886 Substitutes @code{X} if either @code{-S} or @code{-P} was given to
7887 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
7888 @code{*} sequences as well, although they have a stronger binding than
7889 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
7890 alternatives must be starred, and only the first matching alternative
7891 is substituted.
7892
7893 For example, a spec string like this:
7894
7895 @smallexample
7896 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
7897 @end smallexample
7898
7899 will output the following command-line options from the following input
7900 command-line options:
7901
7902 @smallexample
7903 fred.c        -foo -baz
7904 jim.d         -bar -boggle
7905 -d fred.c     -foo -baz -boggle
7906 -d jim.d      -bar -baz -boggle
7907 @end smallexample
7908
7909 @item %@{S:X; T:Y; :D@}
7910
7911 If @code{S} was given to GCC, substitutes @code{X}; else if @code{T} was
7912 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
7913 be as many clauses as you need.  This may be combined with @code{.},
7914 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
7915
7916
7917 @end table
7918
7919 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
7920 construct may contain other nested @samp{%} constructs or spaces, or
7921 even newlines.  They are processed as usual, as described above.
7922 Trailing white space in @code{X} is ignored.  White space may also
7923 appear anywhere on the left side of the colon in these constructs,
7924 except between @code{.} or @code{*} and the corresponding word.
7925
7926 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
7927 handled specifically in these constructs.  If another value of
7928 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
7929 @option{-W} switch is found later in the command line, the earlier
7930 switch value is ignored, except with @{@code{S}*@} where @code{S} is
7931 just one letter, which passes all matching options.
7932
7933 The character @samp{|} at the beginning of the predicate text is used to
7934 indicate that a command should be piped to the following command, but
7935 only if @option{-pipe} is specified.
7936
7937 It is built into GCC which switches take arguments and which do not.
7938 (You might think it would be useful to generalize this to allow each
7939 compiler's spec to say which switches take arguments.  But this cannot
7940 be done in a consistent fashion.  GCC cannot even decide which input
7941 files have been specified without knowing which switches take arguments,
7942 and it must know which input files to compile in order to tell which
7943 compilers to run).
7944
7945 GCC also knows implicitly that arguments starting in @option{-l} are to be
7946 treated as compiler output files, and passed to the linker in their
7947 proper position among the other output files.
7948
7949 @c man begin OPTIONS
7950
7951 @node Target Options
7952 @section Specifying Target Machine and Compiler Version
7953 @cindex target options
7954 @cindex cross compiling
7955 @cindex specifying machine version
7956 @cindex specifying compiler version and target machine
7957 @cindex compiler version, specifying
7958 @cindex target machine, specifying
7959
7960 The usual way to run GCC is to run the executable called @file{gcc}, or
7961 @file{<machine>-gcc} when cross-compiling, or
7962 @file{<machine>-gcc-<version>} to run a version other than the one that
7963 was installed last.  Sometimes this is inconvenient, so GCC provides
7964 options that will switch to another cross-compiler or version.
7965
7966 @table @gcctabopt
7967 @item -b @var{machine}
7968 @opindex b
7969 The argument @var{machine} specifies the target machine for compilation.
7970
7971 The value to use for @var{machine} is the same as was specified as the
7972 machine type when configuring GCC as a cross-compiler.  For
7973 example, if a cross-compiler was configured with @samp{configure
7974 arm-elf}, meaning to compile for an arm processor with elf binaries,
7975 then you would specify @option{-b arm-elf} to run that cross compiler.
7976 Because there are other options beginning with @option{-b}, the
7977 configuration must contain a hyphen.
7978
7979 @item -V @var{version}
7980 @opindex V
7981 The argument @var{version} specifies which version of GCC to run.
7982 This is useful when multiple versions are installed.  For example,
7983 @var{version} might be @samp{4.0}, meaning to run GCC version 4.0.
7984 @end table
7985
7986 The @option{-V} and @option{-b} options work by running the
7987 @file{<machine>-gcc-<version>} executable, so there's no real reason to
7988 use them if you can just run that directly.
7989
7990 @node Submodel Options
7991 @section Hardware Models and Configurations
7992 @cindex submodel options
7993 @cindex specifying hardware config
7994 @cindex hardware models and configurations, specifying
7995 @cindex machine dependent options
7996
7997 Earlier we discussed the standard option @option{-b} which chooses among
7998 different installed compilers for completely different target
7999 machines, such as VAX vs.@: 68000 vs.@: 80386.
8000
8001 In addition, each of these target machine types can have its own
8002 special options, starting with @samp{-m}, to choose among various
8003 hardware models or configurations---for example, 68010 vs 68020,
8004 floating coprocessor or none.  A single installed version of the
8005 compiler can compile for any model or configuration, according to the
8006 options specified.
8007
8008 Some configurations of the compiler also support additional special
8009 options, usually for compatibility with other compilers on the same
8010 platform.
8011
8012 @c This list is ordered alphanumerically by subsection name.
8013 @c It should be the same order and spelling as these options are listed
8014 @c in Machine Dependent Options
8015
8016 @menu
8017 * ARC Options::
8018 * ARM Options::
8019 * AVR Options::
8020 * Blackfin Options::
8021 * CRIS Options::
8022 * CRX Options::
8023 * Darwin Options::
8024 * DEC Alpha Options::
8025 * DEC Alpha/VMS Options::
8026 * FRV Options::
8027 * GNU/Linux Options::
8028 * H8/300 Options::
8029 * HPPA Options::
8030 * i386 and x86-64 Options::
8031 * IA-64 Options::
8032 * M32C Options::
8033 * M32R/D Options::
8034 * M680x0 Options::
8035 * M68hc1x Options::
8036 * MCore Options::
8037 * MIPS Options::
8038 * MMIX Options::
8039 * MN10300 Options::
8040 * MT Options::
8041 * PDP-11 Options::
8042 * PowerPC Options::
8043 * RS/6000 and PowerPC Options::
8044 * S/390 and zSeries Options::
8045 * Score Options::
8046 * SH Options::
8047 * SPARC Options::
8048 * SPU Options::
8049 * System V Options::
8050 * TMS320C3x/C4x Options::
8051 * V850 Options::
8052 * VAX Options::
8053 * VxWorks Options::
8054 * x86-64 Options::
8055 * Xstormy16 Options::
8056 * Xtensa Options::
8057 * zSeries Options::
8058 @end menu
8059
8060 @node ARC Options
8061 @subsection ARC Options
8062 @cindex ARC Options
8063
8064 These options are defined for ARC implementations:
8065
8066 @table @gcctabopt
8067 @item -EL
8068 @opindex EL
8069 Compile code for little endian mode.  This is the default.
8070
8071 @item -EB
8072 @opindex EB
8073 Compile code for big endian mode.
8074
8075 @item -mmangle-cpu
8076 @opindex mmangle-cpu
8077 Prepend the name of the cpu to all public symbol names.
8078 In multiple-processor systems, there are many ARC variants with different
8079 instruction and register set characteristics.  This flag prevents code
8080 compiled for one cpu to be linked with code compiled for another.
8081 No facility exists for handling variants that are ``almost identical''.
8082 This is an all or nothing option.
8083
8084 @item -mcpu=@var{cpu}
8085 @opindex mcpu
8086 Compile code for ARC variant @var{cpu}.
8087 Which variants are supported depend on the configuration.
8088 All variants support @option{-mcpu=base}, this is the default.
8089
8090 @item -mtext=@var{text-section}
8091 @itemx -mdata=@var{data-section}
8092 @itemx -mrodata=@var{readonly-data-section}
8093 @opindex mtext
8094 @opindex mdata
8095 @opindex mrodata
8096 Put functions, data, and readonly data in @var{text-section},
8097 @var{data-section}, and @var{readonly-data-section} respectively
8098 by default.  This can be overridden with the @code{section} attribute.
8099 @xref{Variable Attributes}.
8100
8101 @end table
8102
8103 @node ARM Options
8104 @subsection ARM Options
8105 @cindex ARM options
8106
8107 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
8108 architectures:
8109
8110 @table @gcctabopt
8111 @item -mabi=@var{name}
8112 @opindex mabi
8113 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
8114 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
8115
8116 @item -mapcs-frame
8117 @opindex mapcs-frame
8118 Generate a stack frame that is compliant with the ARM Procedure Call
8119 Standard for all functions, even if this is not strictly necessary for
8120 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
8121 with this option will cause the stack frames not to be generated for
8122 leaf functions.  The default is @option{-mno-apcs-frame}.
8123
8124 @item -mapcs
8125 @opindex mapcs
8126 This is a synonym for @option{-mapcs-frame}.
8127
8128 @ignore
8129 @c not currently implemented
8130 @item -mapcs-stack-check
8131 @opindex mapcs-stack-check
8132 Generate code to check the amount of stack space available upon entry to
8133 every function (that actually uses some stack space).  If there is
8134 insufficient space available then either the function
8135 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} will be
8136 called, depending upon the amount of stack space required.  The run time
8137 system is required to provide these functions.  The default is
8138 @option{-mno-apcs-stack-check}, since this produces smaller code.
8139
8140 @c not currently implemented
8141 @item -mapcs-float
8142 @opindex mapcs-float
8143 Pass floating point arguments using the float point registers.  This is
8144 one of the variants of the APCS@.  This option is recommended if the
8145 target hardware has a floating point unit or if a lot of floating point
8146 arithmetic is going to be performed by the code.  The default is
8147 @option{-mno-apcs-float}, since integer only code is slightly increased in
8148 size if @option{-mapcs-float} is used.
8149
8150 @c not currently implemented
8151 @item -mapcs-reentrant
8152 @opindex mapcs-reentrant
8153 Generate reentrant, position independent code.  The default is
8154 @option{-mno-apcs-reentrant}.
8155 @end ignore
8156
8157 @item -mthumb-interwork
8158 @opindex mthumb-interwork
8159 Generate code which supports calling between the ARM and Thumb
8160 instruction sets.  Without this option the two instruction sets cannot
8161 be reliably used inside one program.  The default is
8162 @option{-mno-thumb-interwork}, since slightly larger code is generated
8163 when @option{-mthumb-interwork} is specified.
8164
8165 @item -mno-sched-prolog
8166 @opindex mno-sched-prolog
8167 Prevent the reordering of instructions in the function prolog, or the
8168 merging of those instruction with the instructions in the function's
8169 body.  This means that all functions will start with a recognizable set
8170 of instructions (or in fact one of a choice from a small set of
8171 different function prologues), and this information can be used to
8172 locate the start if functions inside an executable piece of code.  The
8173 default is @option{-msched-prolog}.
8174
8175 @item -mhard-float
8176 @opindex mhard-float
8177 Generate output containing floating point instructions.  This is the
8178 default.
8179
8180 @item -msoft-float
8181 @opindex msoft-float
8182 Generate output containing library calls for floating point.
8183 @strong{Warning:} the requisite libraries are not available for all ARM
8184 targets.  Normally the facilities of the machine's usual C compiler are
8185 used, but this cannot be done directly in cross-compilation.  You must make
8186 your own arrangements to provide suitable library functions for
8187 cross-compilation.
8188
8189 @option{-msoft-float} changes the calling convention in the output file;
8190 therefore, it is only useful if you compile @emph{all} of a program with
8191 this option.  In particular, you need to compile @file{libgcc.a}, the
8192 library that comes with GCC, with @option{-msoft-float} in order for
8193 this to work.
8194
8195 @item -mfloat-abi=@var{name}
8196 @opindex mfloat-abi
8197 Specifies which ABI to use for floating point values.  Permissible values
8198 are: @samp{soft}, @samp{softfp} and @samp{hard}.
8199
8200 @samp{soft} and @samp{hard} are equivalent to @option{-msoft-float}
8201 and @option{-mhard-float} respectively.  @samp{softfp} allows the generation
8202 of floating point instructions, but still uses the soft-float calling
8203 conventions.
8204
8205 @item -mlittle-endian
8206 @opindex mlittle-endian
8207 Generate code for a processor running in little-endian mode.  This is
8208 the default for all standard configurations.
8209
8210 @item -mbig-endian
8211 @opindex mbig-endian
8212 Generate code for a processor running in big-endian mode; the default is
8213 to compile code for a little-endian processor.
8214
8215 @item -mwords-little-endian
8216 @opindex mwords-little-endian
8217 This option only applies when generating code for big-endian processors.
8218 Generate code for a little-endian word order but a big-endian byte
8219 order.  That is, a byte order of the form @samp{32107654}.  Note: this
8220 option should only be used if you require compatibility with code for
8221 big-endian ARM processors generated by versions of the compiler prior to
8222 2.8.
8223
8224 @item -mcpu=@var{name}
8225 @opindex mcpu
8226 This specifies the name of the target ARM processor.  GCC uses this name
8227 to determine what kind of instructions it can emit when generating
8228 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
8229 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
8230 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
8231 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
8232 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
8233 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
8234 @samp{arm8}, @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
8235 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
8236 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
8237 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
8238 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
8239 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
8240 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
8241 @samp{arm1156t2-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
8242 @samp{cortex-a8}, @samp{cortex-r4}, @samp{cortex-m3},
8243 @samp{xscale}, @samp{iwmmxt}, @samp{ep9312}.
8244
8245 @itemx -mtune=@var{name}
8246 @opindex mtune
8247 This option is very similar to the @option{-mcpu=} option, except that
8248 instead of specifying the actual target processor type, and hence
8249 restricting which instructions can be used, it specifies that GCC should
8250 tune the performance of the code as if the target were of the type
8251 specified in this option, but still choosing the instructions that it
8252 will generate based on the cpu specified by a @option{-mcpu=} option.
8253 For some ARM implementations better performance can be obtained by using
8254 this option.
8255
8256 @item -march=@var{name}
8257 @opindex march
8258 This specifies the name of the target ARM architecture.  GCC uses this
8259 name to determine what kind of instructions it can emit when generating
8260 assembly code.  This option can be used in conjunction with or instead
8261 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
8262 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
8263 @samp{armv5}, @samp{armv5t}, @samp{armv5te}, @samp{armv6}, @samp{armv6j},
8264 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv7}, @samp{armv7-a},
8265 @samp{armv7-r}, @samp{armv7-m}, @samp{iwmmxt}, @samp{ep9312}.
8266
8267 @item -mfpu=@var{name}
8268 @itemx -mfpe=@var{number}
8269 @itemx -mfp=@var{number}
8270 @opindex mfpu
8271 @opindex mfpe
8272 @opindex mfp
8273 This specifies what floating point hardware (or hardware emulation) is
8274 available on the target.  Permissible names are: @samp{fpa}, @samp{fpe2},
8275 @samp{fpe3}, @samp{maverick}, @samp{vfp}.  @option{-mfp} and @option{-mfpe}
8276 are synonyms for @option{-mfpu}=@samp{fpe}@var{number}, for compatibility
8277 with older versions of GCC@.
8278
8279 If @option{-msoft-float} is specified this specifies the format of
8280 floating point values.
8281
8282 @item -mstructure-size-boundary=@var{n}
8283 @opindex mstructure-size-boundary
8284 The size of all structures and unions will be rounded up to a multiple
8285 of the number of bits set by this option.  Permissible values are 8, 32
8286 and 64.  The default value varies for different toolchains.  For the COFF
8287 targeted toolchain the default value is 8.  A value of 64 is only allowed
8288 if the underlying ABI supports it.
8289
8290 Specifying the larger number can produce faster, more efficient code, but
8291 can also increase the size of the program.  Different values are potentially
8292 incompatible.  Code compiled with one value cannot necessarily expect to
8293 work with code or libraries compiled with another value, if they exchange
8294 information using structures or unions.
8295
8296 @item -mabort-on-noreturn
8297 @opindex mabort-on-noreturn
8298 Generate a call to the function @code{abort} at the end of a
8299 @code{noreturn} function.  It will be executed if the function tries to
8300 return.
8301
8302 @item -mlong-calls
8303 @itemx -mno-long-calls
8304 @opindex mlong-calls
8305 @opindex mno-long-calls
8306 Tells the compiler to perform function calls by first loading the
8307 address of the function into a register and then performing a subroutine
8308 call on this register.  This switch is needed if the target function
8309 will lie outside of the 64 megabyte addressing range of the offset based
8310 version of subroutine call instruction.
8311
8312 Even if this switch is enabled, not all function calls will be turned
8313 into long calls.  The heuristic is that static functions, functions
8314 which have the @samp{short-call} attribute, functions that are inside
8315 the scope of a @samp{#pragma no_long_calls} directive and functions whose
8316 definitions have already been compiled within the current compilation
8317 unit, will not be turned into long calls.  The exception to this rule is
8318 that weak function definitions, functions with the @samp{long-call}
8319 attribute or the @samp{section} attribute, and functions that are within
8320 the scope of a @samp{#pragma long_calls} directive, will always be
8321 turned into long calls.
8322
8323 This feature is not enabled by default.  Specifying
8324 @option{-mno-long-calls} will restore the default behavior, as will
8325 placing the function calls within the scope of a @samp{#pragma
8326 long_calls_off} directive.  Note these switches have no effect on how
8327 the compiler generates code to handle function calls via function
8328 pointers.
8329
8330 @item -mnop-fun-dllimport
8331 @opindex mnop-fun-dllimport
8332 Disable support for the @code{dllimport} attribute.
8333
8334 @item -msingle-pic-base
8335 @opindex msingle-pic-base
8336 Treat the register used for PIC addressing as read-only, rather than
8337 loading it in the prologue for each function.  The run-time system is
8338 responsible for initializing this register with an appropriate value
8339 before execution begins.
8340
8341 @item -mpic-register=@var{reg}
8342 @opindex mpic-register
8343 Specify the register to be used for PIC addressing.  The default is R10
8344 unless stack-checking is enabled, when R9 is used.
8345
8346 @item -mcirrus-fix-invalid-insns
8347 @opindex mcirrus-fix-invalid-insns
8348 @opindex mno-cirrus-fix-invalid-insns
8349 Insert NOPs into the instruction stream to in order to work around
8350 problems with invalid Maverick instruction combinations.  This option
8351 is only valid if the @option{-mcpu=ep9312} option has been used to
8352 enable generation of instructions for the Cirrus Maverick floating
8353 point co-processor.  This option is not enabled by default, since the
8354 problem is only present in older Maverick implementations.  The default
8355 can be re-enabled by use of the @option{-mno-cirrus-fix-invalid-insns}
8356 switch.
8357
8358 @item -mpoke-function-name
8359 @opindex mpoke-function-name
8360 Write the name of each function into the text section, directly
8361 preceding the function prologue.  The generated code is similar to this:
8362
8363 @smallexample
8364      t0
8365          .ascii "arm_poke_function_name", 0
8366          .align
8367      t1
8368          .word 0xff000000 + (t1 - t0)
8369      arm_poke_function_name
8370          mov     ip, sp
8371          stmfd   sp!, @{fp, ip, lr, pc@}
8372          sub     fp, ip, #4
8373 @end smallexample
8374
8375 When performing a stack backtrace, code can inspect the value of
8376 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
8377 location @code{pc - 12} and the top 8 bits are set, then we know that
8378 there is a function name embedded immediately preceding this location
8379 and has length @code{((pc[-3]) & 0xff000000)}.
8380
8381 @item -mthumb
8382 @opindex mthumb
8383 Generate code for the Thumb instruction set.  The default is to
8384 use the 32-bit ARM instruction set.
8385 This option automatically enables either 16-bit Thumb-1 or
8386 mixed 16/32-bit Thumb-2 instructions based on the @option{-mcpu=@var{name}}
8387 and @option{-march=@var{name}} options.
8388
8389 @item -mtpcs-frame
8390 @opindex mtpcs-frame
8391 Generate a stack frame that is compliant with the Thumb Procedure Call
8392 Standard for all non-leaf functions.  (A leaf function is one that does
8393 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
8394
8395 @item -mtpcs-leaf-frame
8396 @opindex mtpcs-leaf-frame
8397 Generate a stack frame that is compliant with the Thumb Procedure Call
8398 Standard for all leaf functions.  (A leaf function is one that does
8399 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
8400
8401 @item -mcallee-super-interworking
8402 @opindex mcallee-super-interworking
8403 Gives all externally visible functions in the file being compiled an ARM
8404 instruction set header which switches to Thumb mode before executing the
8405 rest of the function.  This allows these functions to be called from
8406 non-interworking code.
8407
8408 @item -mcaller-super-interworking
8409 @opindex mcaller-super-interworking
8410 Allows calls via function pointers (including virtual functions) to
8411 execute correctly regardless of whether the target code has been
8412 compiled for interworking or not.  There is a small overhead in the cost
8413 of executing a function pointer if this option is enabled.
8414
8415 @item -mtp=@var{name}
8416 @opindex mtp
8417 Specify the access model for the thread local storage pointer.  The valid
8418 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
8419 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
8420 (supported in the arm6k architecture), and @option{auto}, which uses the
8421 best available method for the selected processor.  The default setting is
8422 @option{auto}.
8423
8424 @end table
8425
8426 @node AVR Options
8427 @subsection AVR Options
8428 @cindex AVR Options
8429
8430 These options are defined for AVR implementations:
8431
8432 @table @gcctabopt
8433 @item -mmcu=@var{mcu}
8434 @opindex mmcu
8435 Specify ATMEL AVR instruction set or MCU type.
8436
8437 Instruction set avr1 is for the minimal AVR core, not supported by the C
8438 compiler, only for assembler programs (MCU types: at90s1200, attiny10,
8439 attiny11, attiny12, attiny15, attiny28).
8440
8441 Instruction set avr2 (default) is for the classic AVR core with up to
8442 8K program memory space (MCU types: at90s2313, at90s2323, attiny22,
8443 at90s2333, at90s2343, at90s4414, at90s4433, at90s4434, at90s8515,
8444 at90c8534, at90s8535).
8445
8446 Instruction set avr3 is for the classic AVR core with up to 128K program
8447 memory space (MCU types: atmega103, atmega603, at43usb320, at76c711).
8448
8449 Instruction set avr4 is for the enhanced AVR core with up to 8K program
8450 memory space (MCU types: atmega8, atmega83, atmega85).
8451
8452 Instruction set avr5 is for the enhanced AVR core with up to 128K program
8453 memory space (MCU types: atmega16, atmega161, atmega163, atmega32, atmega323,
8454 atmega64, atmega128, at43usb355, at94k).
8455
8456 @item -msize
8457 @opindex msize
8458 Output instruction sizes to the asm file.
8459
8460 @item -minit-stack=@var{N}
8461 @opindex minit-stack
8462 Specify the initial stack address, which may be a symbol or numeric value,
8463 @samp{__stack} is the default.
8464
8465 @item -mno-interrupts
8466 @opindex mno-interrupts
8467 Generated code is not compatible with hardware interrupts.
8468 Code size will be smaller.
8469
8470 @item -mcall-prologues
8471 @opindex mcall-prologues
8472 Functions prologues/epilogues expanded as call to appropriate
8473 subroutines.  Code size will be smaller.
8474
8475 @item -mno-tablejump
8476 @opindex mno-tablejump
8477 Do not generate tablejump insns which sometimes increase code size.
8478
8479 @item -mtiny-stack
8480 @opindex mtiny-stack
8481 Change only the low 8 bits of the stack pointer.
8482
8483 @item -mint8
8484 @opindex mint8
8485 Assume int to be 8 bit integer.  This affects the sizes of all types: A
8486 char will be 1 byte, an int will be 1 byte, an long will be 2 bytes
8487 and long long will be 4 bytes.  Please note that this option does not
8488 comply to the C standards, but it will provide you with smaller code
8489 size.
8490 @end table
8491
8492 @node Blackfin Options
8493 @subsection Blackfin Options
8494 @cindex Blackfin Options
8495
8496 @table @gcctabopt
8497 @item -mcpu=@var{cpu}
8498 @opindex mcpu=
8499 Specifies the name of the target Blackfin processor. Currently, @var{cpu}
8500 can be one of @samp{bf531}, @samp{bf532}, @samp{bf533},
8501 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf561}.
8502 Without this option, @samp{bf532} is used as the processor by default.
8503 The corresponding predefined processor macros for @var{cpu} is to
8504 be defined.  For the @samp{bfin-elf} toolchain, this causes the hardware
8505 BSP provided by libgloss to be linked in if @samp{-msim} is not given.
8506 Support for @samp{bf561} is incomplete; only the processor macro is defined.
8507
8508 @item -msim
8509 @opindex msim
8510 Specifies that the program will be run on the simulator.  This causes
8511 the simulator BSP provided by libgloss to be linked in.  This option
8512 has effect only for @samp{bfin-elf} toolchain.
8513
8514 @item -momit-leaf-frame-pointer
8515 @opindex momit-leaf-frame-pointer
8516 Don't keep the frame pointer in a register for leaf functions.  This
8517 avoids the instructions to save, set up and restore frame pointers and
8518 makes an extra register available in leaf functions.  The option
8519 @option{-fomit-frame-pointer} removes the frame pointer for all functions
8520 which might make debugging harder.
8521
8522 @item -mspecld-anomaly
8523 @opindex mspecld-anomaly
8524 When enabled, the compiler will ensure that the generated code does not
8525 contain speculative loads after jump instructions.  This option is enabled
8526 by default.
8527
8528 @item -mno-specld-anomaly
8529 @opindex mno-specld-anomaly
8530 Don't generate extra code to prevent speculative loads from occurring.
8531
8532 @item -mcsync-anomaly
8533 @opindex mcsync-anomaly
8534 When enabled, the compiler will ensure that the generated code does not
8535 contain CSYNC or SSYNC instructions too soon after conditional branches.
8536 This option is enabled by default.
8537
8538 @item -mno-csync-anomaly
8539 @opindex mno-csync-anomaly
8540 Don't generate extra code to prevent CSYNC or SSYNC instructions from
8541 occurring too soon after a conditional branch.
8542
8543 @item -mlow-64k
8544 @opindex mlow-64k
8545 When enabled, the compiler is free to take advantage of the knowledge that
8546 the entire program fits into the low 64k of memory.
8547
8548 @item -mno-low-64k
8549 @opindex mno-low-64k
8550 Assume that the program is arbitrarily large.  This is the default.
8551
8552 @item -mstack-check-l1
8553 @opindex mstack-check-l1
8554 Do stack checking using information placed into L1 scratchpad memory by the
8555 uClinux kernel.
8556
8557 @item -mid-shared-library
8558 @opindex mid-shared-library
8559 Generate code that supports shared libraries via the library ID method.
8560 This allows for execute in place and shared libraries in an environment
8561 without virtual memory management.  This option implies @option{-fPIC}.
8562
8563 @item -mno-id-shared-library
8564 @opindex mno-id-shared-library
8565 Generate code that doesn't assume ID based shared libraries are being used.
8566 This is the default.
8567
8568 @item -mleaf-id-shared-library
8569 @opindex mleaf-id-shared-library
8570 Generate code that supports shared libraries via the library ID method,
8571 but assumes that this library or executable won't link against any other
8572 ID shared libraries.  That allows the compiler to use faster code for jumps
8573 and calls.
8574
8575 @item -mno-leaf-id-shared-library
8576 @opindex mno-leaf-id-shared-library
8577 Do not assume that the code being compiled won't link against any ID shared
8578 libraries.  Slower code will be generated for jump and call insns.
8579
8580 @item -mshared-library-id=n
8581 @opindex mshared-library-id
8582 Specified the identification number of the ID based shared library being
8583 compiled.  Specifying a value of 0 will generate more compact code, specifying
8584 other values will force the allocation of that number to the current
8585 library but is no more space or time efficient than omitting this option.
8586
8587 @item -msep-data
8588 @opindex msep-data
8589 Generate code that allows the data segment to be located in a different
8590 area of memory from the text segment.  This allows for execute in place in
8591 an environment without virtual memory management by eliminating relocations
8592 against the text section.
8593
8594 @item -mno-sep-data
8595 @opindex mno-sep-data
8596 Generate code that assumes that the data segment follows the text segment.
8597 This is the default.
8598
8599 @item -mlong-calls
8600 @itemx -mno-long-calls
8601 @opindex mlong-calls
8602 @opindex mno-long-calls
8603 Tells the compiler to perform function calls by first loading the
8604 address of the function into a register and then performing a subroutine
8605 call on this register.  This switch is needed if the target function
8606 will lie outside of the 24 bit addressing range of the offset based
8607 version of subroutine call instruction.
8608
8609 This feature is not enabled by default.  Specifying
8610 @option{-mno-long-calls} will restore the default behavior.  Note these
8611 switches have no effect on how the compiler generates code to handle
8612 function calls via function pointers.
8613 @end table
8614
8615 @node CRIS Options
8616 @subsection CRIS Options
8617 @cindex CRIS Options
8618
8619 These options are defined specifically for the CRIS ports.
8620
8621 @table @gcctabopt
8622 @item -march=@var{architecture-type}
8623 @itemx -mcpu=@var{architecture-type}
8624 @opindex march
8625 @opindex mcpu
8626 Generate code for the specified architecture.  The choices for
8627 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
8628 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
8629 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
8630 @samp{v10}.
8631
8632 @item -mtune=@var{architecture-type}
8633 @opindex mtune
8634 Tune to @var{architecture-type} everything applicable about the generated
8635 code, except for the ABI and the set of available instructions.  The
8636 choices for @var{architecture-type} are the same as for
8637 @option{-march=@var{architecture-type}}.
8638
8639 @item -mmax-stack-frame=@var{n}
8640 @opindex mmax-stack-frame
8641 Warn when the stack frame of a function exceeds @var{n} bytes.
8642
8643 @item -melinux-stacksize=@var{n}
8644 @opindex melinux-stacksize
8645 Only available with the @samp{cris-axis-aout} target.  Arranges for
8646 indications in the program to the kernel loader that the stack of the
8647 program should be set to @var{n} bytes.
8648
8649 @item -metrax4
8650 @itemx -metrax100
8651 @opindex metrax4
8652 @opindex metrax100
8653 The options @option{-metrax4} and @option{-metrax100} are synonyms for
8654 @option{-march=v3} and @option{-march=v8} respectively.
8655
8656 @item -mmul-bug-workaround
8657 @itemx -mno-mul-bug-workaround
8658 @opindex mmul-bug-workaround
8659 @opindex mno-mul-bug-workaround
8660 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
8661 models where it applies.  This option is active by default.
8662
8663 @item -mpdebug
8664 @opindex mpdebug
8665 Enable CRIS-specific verbose debug-related information in the assembly
8666 code.  This option also has the effect to turn off the @samp{#NO_APP}
8667 formatted-code indicator to the assembler at the beginning of the
8668 assembly file.
8669
8670 @item -mcc-init
8671 @opindex mcc-init
8672 Do not use condition-code results from previous instruction; always emit
8673 compare and test instructions before use of condition codes.
8674
8675 @item -mno-side-effects
8676 @opindex mno-side-effects
8677 Do not emit instructions with side-effects in addressing modes other than
8678 post-increment.
8679
8680 @item -mstack-align
8681 @itemx -mno-stack-align
8682 @itemx -mdata-align
8683 @itemx -mno-data-align
8684 @itemx -mconst-align
8685 @itemx -mno-const-align
8686 @opindex mstack-align
8687 @opindex mno-stack-align
8688 @opindex mdata-align
8689 @opindex mno-data-align
8690 @opindex mconst-align
8691 @opindex mno-const-align
8692 These options (no-options) arranges (eliminate arrangements) for the
8693 stack-frame, individual data and constants to be aligned for the maximum
8694 single data access size for the chosen CPU model.  The default is to
8695 arrange for 32-bit alignment.  ABI details such as structure layout are
8696 not affected by these options.
8697
8698 @item -m32-bit
8699 @itemx -m16-bit
8700 @itemx -m8-bit
8701 @opindex m32-bit
8702 @opindex m16-bit
8703 @opindex m8-bit
8704 Similar to the stack- data- and const-align options above, these options
8705 arrange for stack-frame, writable data and constants to all be 32-bit,
8706 16-bit or 8-bit aligned.  The default is 32-bit alignment.
8707
8708 @item -mno-prologue-epilogue
8709 @itemx -mprologue-epilogue
8710 @opindex mno-prologue-epilogue
8711 @opindex mprologue-epilogue
8712 With @option{-mno-prologue-epilogue}, the normal function prologue and
8713 epilogue that sets up the stack-frame are omitted and no return
8714 instructions or return sequences are generated in the code.  Use this
8715 option only together with visual inspection of the compiled code: no
8716 warnings or errors are generated when call-saved registers must be saved,
8717 or storage for local variable needs to be allocated.
8718
8719 @item -mno-gotplt
8720 @itemx -mgotplt
8721 @opindex mno-gotplt
8722 @opindex mgotplt
8723 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
8724 instruction sequences that load addresses for functions from the PLT part
8725 of the GOT rather than (traditional on other architectures) calls to the
8726 PLT@.  The default is @option{-mgotplt}.
8727
8728 @item -maout
8729 @opindex maout
8730 Legacy no-op option only recognized with the cris-axis-aout target.
8731
8732 @item -melf
8733 @opindex melf
8734 Legacy no-op option only recognized with the cris-axis-elf and
8735 cris-axis-linux-gnu targets.
8736
8737 @item -melinux
8738 @opindex melinux
8739 Only recognized with the cris-axis-aout target, where it selects a
8740 GNU/linux-like multilib, include files and instruction set for
8741 @option{-march=v8}.
8742
8743 @item -mlinux
8744 @opindex mlinux
8745 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
8746
8747 @item -sim
8748 @opindex sim
8749 This option, recognized for the cris-axis-aout and cris-axis-elf arranges
8750 to link with input-output functions from a simulator library.  Code,
8751 initialized data and zero-initialized data are allocated consecutively.
8752
8753 @item -sim2
8754 @opindex sim2
8755 Like @option{-sim}, but pass linker options to locate initialized data at
8756 0x40000000 and zero-initialized data at 0x80000000.
8757 @end table
8758
8759 @node CRX Options
8760 @subsection CRX Options
8761 @cindex CRX Options
8762
8763 These options are defined specifically for the CRX ports.
8764
8765 @table @gcctabopt
8766
8767 @item -mmac
8768 @opindex mmac
8769 Enable the use of multiply-accumulate instructions. Disabled by default.
8770
8771 @item -mpush-args
8772 @opindex mpush-args
8773 Push instructions will be used to pass outgoing arguments when functions
8774 are called. Enabled by default.
8775 @end table
8776
8777 @node Darwin Options
8778 @subsection Darwin Options
8779 @cindex Darwin options
8780
8781 These options are defined for all architectures running the Darwin operating
8782 system.
8783
8784 FSF GCC on Darwin does not create ``fat'' object files; it will create
8785 an object file for the single architecture that it was built to
8786 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
8787 @option{-arch} options are used; it does so by running the compiler or
8788 linker multiple times and joining the results together with
8789 @file{lipo}.
8790
8791 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
8792 @samp{i686}) is determined by the flags that specify the ISA
8793 that GCC is targetting, like @option{-mcpu} or @option{-march}.  The
8794 @option{-force_cpusubtype_ALL} option can be used to override this.
8795
8796 The Darwin tools vary in their behavior when presented with an ISA
8797 mismatch.  The assembler, @file{as}, will only permit instructions to
8798 be used that are valid for the subtype of the file it is generating,
8799 so you cannot put 64-bit instructions in an @samp{ppc750} object file.
8800 The linker for shared libraries, @file{/usr/bin/libtool}, will fail
8801 and print an error if asked to create a shared library with a less
8802 restrictive subtype than its input files (for instance, trying to put
8803 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
8804 for executables, @file{ld}, will quietly give the executable the most
8805 restrictive subtype of any of its input files.
8806
8807 @table @gcctabopt
8808 @item -F@var{dir}
8809 @opindex F
8810 Add the framework directory @var{dir} to the head of the list of
8811 directories to be searched for header files.  These directories are
8812 interleaved with those specified by @option{-I} options and are
8813 scanned in a left-to-right order.
8814
8815 A framework directory is a directory with frameworks in it.  A
8816 framework is a directory with a @samp{"Headers"} and/or
8817 @samp{"PrivateHeaders"} directory contained directly in it that ends
8818 in @samp{".framework"}.  The name of a framework is the name of this
8819 directory excluding the @samp{".framework"}.  Headers associated with
8820 the framework are found in one of those two directories, with
8821 @samp{"Headers"} being searched first.  A subframework is a framework
8822 directory that is in a framework's @samp{"Frameworks"} directory.
8823 Includes of subframework headers can only appear in a header of a
8824 framework that contains the subframework, or in a sibling subframework
8825 header.  Two subframeworks are siblings if they occur in the same
8826 framework.  A subframework should not have the same name as a
8827 framework, a warning will be issued if this is violated.  Currently a
8828 subframework cannot have subframeworks, in the future, the mechanism
8829 may be extended to support this.  The standard frameworks can be found
8830 in @samp{"/System/Library/Frameworks"} and
8831 @samp{"/Library/Frameworks"}.  An example include looks like
8832 @code{#include <Framework/header.h>}, where @samp{Framework} denotes
8833 the name of the framework and header.h is found in the
8834 @samp{"PrivateHeaders"} or @samp{"Headers"} directory.
8835
8836 @item -iframework@var{dir}
8837 @opindex iframework
8838 Like @option{-F} except the directory is a treated as a system
8839 directory.  The main difference between this @option{-iframework} and
8840 @option{-F} is that with @option{-iframework} the compiler does not
8841 warn about constructs contained within header files found via
8842 @var{dir}.  This option is valid only for the C family of languages.
8843
8844 @item -gused
8845 @opindex gused
8846 Emit debugging information for symbols that are used.  For STABS
8847 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
8848 This is by default ON@.
8849
8850 @item -gfull
8851 @opindex gfull
8852 Emit debugging information for all symbols and types.
8853
8854 @item -mmacosx-version-min=@var{version}
8855 The earliest version of MacOS X that this executable will run on
8856 is @var{version}.  Typical values of @var{version} include @code{10.1},
8857 @code{10.2}, and @code{10.3.9}.
8858
8859 If the compiler was built to use the system's headers by default,
8860 then the default for this option is the system version on which the
8861 compiler is running, otherwise the default is to make choices which
8862 are compatible with as many systems and code bases as possible.
8863
8864 @item -mkernel
8865 @opindex mkernel
8866 Enable kernel development mode.  The @option{-mkernel} option sets
8867 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
8868 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
8869 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
8870 applicable.  This mode also sets @option{-mno-altivec},
8871 @option{-msoft-float}, @option{-fno-builtin} and
8872 @option{-mlong-branch} for PowerPC targets.
8873
8874 @item -mone-byte-bool
8875 @opindex mone-byte-bool
8876 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
8877 By default @samp{sizeof(bool)} is @samp{4} when compiling for
8878 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
8879 option has no effect on x86.
8880
8881 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
8882 to generate code that is not binary compatible with code generated
8883 without that switch.  Using this switch may require recompiling all
8884 other modules in a program, including system libraries.  Use this
8885 switch to conform to a non-default data model.
8886
8887 @item -mfix-and-continue
8888 @itemx -ffix-and-continue
8889 @itemx -findirect-data
8890 @opindex mfix-and-continue
8891 @opindex ffix-and-continue
8892 @opindex findirect-data
8893 Generate code suitable for fast turn around development.  Needed to
8894 enable gdb to dynamically load @code{.o} files into already running
8895 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
8896 are provided for backwards compatibility.
8897
8898 @item -all_load
8899 @opindex all_load
8900 Loads all members of static archive libraries.
8901 See man ld(1) for more information.
8902
8903 @item -arch_errors_fatal
8904 @opindex arch_errors_fatal
8905 Cause the errors having to do with files that have the wrong architecture
8906 to be fatal.
8907
8908 @item -bind_at_load
8909 @opindex bind_at_load
8910 Causes the output file to be marked such that the dynamic linker will
8911 bind all undefined references when the file is loaded or launched.
8912
8913 @item -bundle
8914 @opindex bundle
8915 Produce a Mach-o bundle format file.
8916 See man ld(1) for more information.
8917
8918 @item -bundle_loader @var{executable}
8919 @opindex bundle_loader
8920 This option specifies the @var{executable} that will be loading the build
8921 output file being linked.  See man ld(1) for more information.
8922
8923 @item -dynamiclib
8924 @opindex dynamiclib
8925 When passed this option, GCC will produce a dynamic library instead of
8926 an executable when linking, using the Darwin @file{libtool} command.
8927
8928 @item -force_cpusubtype_ALL
8929 @opindex force_cpusubtype_ALL
8930 This causes GCC's output file to have the @var{ALL} subtype, instead of
8931 one controlled by the @option{-mcpu} or @option{-march} option.
8932
8933 @item -allowable_client  @var{client_name}
8934 @itemx -client_name
8935 @itemx -compatibility_version
8936 @itemx -current_version
8937 @itemx -dead_strip
8938 @itemx -dependency-file
8939 @itemx -dylib_file
8940 @itemx -dylinker_install_name
8941 @itemx -dynamic
8942 @itemx -exported_symbols_list
8943 @itemx -filelist
8944 @itemx -flat_namespace
8945 @itemx -force_flat_namespace
8946 @itemx -headerpad_max_install_names
8947 @itemx -image_base
8948 @itemx -init
8949 @itemx -install_name
8950 @itemx -keep_private_externs
8951 @itemx -multi_module
8952 @itemx -multiply_defined
8953 @itemx -multiply_defined_unused
8954 @itemx -noall_load
8955 @itemx -no_dead_strip_inits_and_terms
8956 @itemx -nofixprebinding
8957 @itemx -nomultidefs
8958 @itemx -noprebind
8959 @itemx -noseglinkedit
8960 @itemx -pagezero_size
8961 @itemx -prebind
8962 @itemx -prebind_all_twolevel_modules
8963 @itemx -private_bundle
8964 @itemx -read_only_relocs
8965 @itemx -sectalign
8966 @itemx -sectobjectsymbols
8967 @itemx -whyload
8968 @itemx -seg1addr
8969 @itemx -sectcreate
8970 @itemx -sectobjectsymbols
8971 @itemx -sectorder
8972 @itemx -segaddr
8973 @itemx -segs_read_only_addr
8974 @itemx -segs_read_write_addr
8975 @itemx -seg_addr_table
8976 @itemx -seg_addr_table_filename
8977 @itemx -seglinkedit
8978 @itemx -segprot
8979 @itemx -segs_read_only_addr
8980 @itemx -segs_read_write_addr
8981 @itemx -single_module
8982 @itemx -static
8983 @itemx -sub_library
8984 @itemx -sub_umbrella
8985 @itemx -twolevel_namespace
8986 @itemx -umbrella
8987 @itemx -undefined
8988 @itemx -unexported_symbols_list
8989 @itemx -weak_reference_mismatches
8990 @itemx -whatsloaded
8991
8992 @opindex allowable_client
8993 @opindex client_name
8994 @opindex compatibility_version
8995 @opindex current_version
8996 @opindex dead_strip
8997 @opindex dependency-file
8998 @opindex dylib_file
8999 @opindex dylinker_install_name
9000 @opindex dynamic
9001 @opindex exported_symbols_list
9002 @opindex filelist
9003 @opindex flat_namespace
9004 @opindex force_flat_namespace
9005 @opindex headerpad_max_install_names
9006 @opindex image_base
9007 @opindex init
9008 @opindex install_name
9009 @opindex keep_private_externs
9010 @opindex multi_module
9011 @opindex multiply_defined
9012 @opindex multiply_defined_unused
9013 @opindex noall_load
9014 @opindex no_dead_strip_inits_and_terms
9015 @opindex nofixprebinding
9016 @opindex nomultidefs
9017 @opindex noprebind
9018 @opindex noseglinkedit
9019 @opindex pagezero_size
9020 @opindex prebind
9021 @opindex prebind_all_twolevel_modules
9022 @opindex private_bundle
9023 @opindex read_only_relocs
9024 @opindex sectalign
9025 @opindex sectobjectsymbols
9026 @opindex whyload
9027 @opindex seg1addr
9028 @opindex sectcreate
9029 @opindex sectobjectsymbols
9030 @opindex sectorder
9031 @opindex segaddr
9032 @opindex segs_read_only_addr
9033 @opindex segs_read_write_addr
9034 @opindex seg_addr_table
9035 @opindex seg_addr_table_filename
9036 @opindex seglinkedit
9037 @opindex segprot
9038 @opindex segs_read_only_addr
9039 @opindex segs_read_write_addr
9040 @opindex single_module
9041 @opindex static
9042 @opindex sub_library
9043 @opindex sub_umbrella
9044 @opindex twolevel_namespace
9045 @opindex umbrella
9046 @opindex undefined
9047 @opindex unexported_symbols_list
9048 @opindex weak_reference_mismatches
9049 @opindex whatsloaded
9050
9051 These options are passed to the Darwin linker.  The Darwin linker man page
9052 describes them in detail.
9053 @end table
9054
9055 @node DEC Alpha Options
9056 @subsection DEC Alpha Options
9057
9058 These @samp{-m} options are defined for the DEC Alpha implementations:
9059
9060 @table @gcctabopt
9061 @item -mno-soft-float
9062 @itemx -msoft-float
9063 @opindex mno-soft-float
9064 @opindex msoft-float
9065 Use (do not use) the hardware floating-point instructions for
9066 floating-point operations.  When @option{-msoft-float} is specified,
9067 functions in @file{libgcc.a} will be used to perform floating-point
9068 operations.  Unless they are replaced by routines that emulate the
9069 floating-point operations, or compiled in such a way as to call such
9070 emulations routines, these routines will issue floating-point
9071 operations.   If you are compiling for an Alpha without floating-point
9072 operations, you must ensure that the library is built so as not to call
9073 them.
9074
9075 Note that Alpha implementations without floating-point operations are
9076 required to have floating-point registers.
9077
9078 @item -mfp-reg
9079 @itemx -mno-fp-regs
9080 @opindex mfp-reg
9081 @opindex mno-fp-regs
9082 Generate code that uses (does not use) the floating-point register set.
9083 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
9084 register set is not used, floating point operands are passed in integer
9085 registers as if they were integers and floating-point results are passed
9086 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
9087 so any function with a floating-point argument or return value called by code
9088 compiled with @option{-mno-fp-regs} must also be compiled with that
9089 option.
9090
9091 A typical use of this option is building a kernel that does not use,
9092 and hence need not save and restore, any floating-point registers.
9093
9094 @item -mieee
9095 @opindex mieee
9096 The Alpha architecture implements floating-point hardware optimized for
9097 maximum performance.  It is mostly compliant with the IEEE floating
9098 point standard.  However, for full compliance, software assistance is
9099 required.  This option generates code fully IEEE compliant code
9100 @emph{except} that the @var{inexact-flag} is not maintained (see below).
9101 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
9102 defined during compilation.  The resulting code is less efficient but is
9103 able to correctly support denormalized numbers and exceptional IEEE
9104 values such as not-a-number and plus/minus infinity.  Other Alpha
9105 compilers call this option @option{-ieee_with_no_inexact}.
9106
9107 @item -mieee-with-inexact
9108 @opindex mieee-with-inexact
9109 This is like @option{-mieee} except the generated code also maintains
9110 the IEEE @var{inexact-flag}.  Turning on this option causes the
9111 generated code to implement fully-compliant IEEE math.  In addition to
9112 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
9113 macro.  On some Alpha implementations the resulting code may execute
9114 significantly slower than the code generated by default.  Since there is
9115 very little code that depends on the @var{inexact-flag}, you should
9116 normally not specify this option.  Other Alpha compilers call this
9117 option @option{-ieee_with_inexact}.
9118
9119 @item -mfp-trap-mode=@var{trap-mode}
9120 @opindex mfp-trap-mode
9121 This option controls what floating-point related traps are enabled.
9122 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
9123 The trap mode can be set to one of four values:
9124
9125 @table @samp
9126 @item n
9127 This is the default (normal) setting.  The only traps that are enabled
9128 are the ones that cannot be disabled in software (e.g., division by zero
9129 trap).
9130
9131 @item u
9132 In addition to the traps enabled by @samp{n}, underflow traps are enabled
9133 as well.
9134
9135 @item su
9136 Like @samp{u}, but the instructions are marked to be safe for software
9137 completion (see Alpha architecture manual for details).
9138
9139 @item sui
9140 Like @samp{su}, but inexact traps are enabled as well.
9141 @end table
9142
9143 @item -mfp-rounding-mode=@var{rounding-mode}
9144 @opindex mfp-rounding-mode
9145 Selects the IEEE rounding mode.  Other Alpha compilers call this option
9146 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
9147 of:
9148
9149 @table @samp
9150 @item n
9151 Normal IEEE rounding mode.  Floating point numbers are rounded towards
9152 the nearest machine number or towards the even machine number in case
9153 of a tie.
9154
9155 @item m
9156 Round towards minus infinity.
9157
9158 @item c
9159 Chopped rounding mode.  Floating point numbers are rounded towards zero.
9160
9161 @item d
9162 Dynamic rounding mode.  A field in the floating point control register
9163 (@var{fpcr}, see Alpha architecture reference manual) controls the
9164 rounding mode in effect.  The C library initializes this register for
9165 rounding towards plus infinity.  Thus, unless your program modifies the
9166 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
9167 @end table
9168
9169 @item -mtrap-precision=@var{trap-precision}
9170 @opindex mtrap-precision
9171 In the Alpha architecture, floating point traps are imprecise.  This
9172 means without software assistance it is impossible to recover from a
9173 floating trap and program execution normally needs to be terminated.
9174 GCC can generate code that can assist operating system trap handlers
9175 in determining the exact location that caused a floating point trap.
9176 Depending on the requirements of an application, different levels of
9177 precisions can be selected:
9178
9179 @table @samp
9180 @item p
9181 Program precision.  This option is the default and means a trap handler
9182 can only identify which program caused a floating point exception.
9183
9184 @item f
9185 Function precision.  The trap handler can determine the function that
9186 caused a floating point exception.
9187
9188 @item i
9189 Instruction precision.  The trap handler can determine the exact
9190 instruction that caused a floating point exception.
9191 @end table
9192
9193 Other Alpha compilers provide the equivalent options called
9194 @option{-scope_safe} and @option{-resumption_safe}.
9195
9196 @item -mieee-conformant
9197 @opindex mieee-conformant
9198 This option marks the generated code as IEEE conformant.  You must not
9199 use this option unless you also specify @option{-mtrap-precision=i} and either
9200 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
9201 is to emit the line @samp{.eflag 48} in the function prologue of the
9202 generated assembly file.  Under DEC Unix, this has the effect that
9203 IEEE-conformant math library routines will be linked in.
9204
9205 @item -mbuild-constants
9206 @opindex mbuild-constants
9207 Normally GCC examines a 32- or 64-bit integer constant to
9208 see if it can construct it from smaller constants in two or three
9209 instructions.  If it cannot, it will output the constant as a literal and
9210 generate code to load it from the data segment at runtime.
9211
9212 Use this option to require GCC to construct @emph{all} integer constants
9213 using code, even if it takes more instructions (the maximum is six).
9214
9215 You would typically use this option to build a shared library dynamic
9216 loader.  Itself a shared library, it must relocate itself in memory
9217 before it can find the variables and constants in its own data segment.
9218
9219 @item -malpha-as
9220 @itemx -mgas
9221 @opindex malpha-as
9222 @opindex mgas
9223 Select whether to generate code to be assembled by the vendor-supplied
9224 assembler (@option{-malpha-as}) or by the GNU assembler @option{-mgas}.
9225
9226 @item -mbwx
9227 @itemx -mno-bwx
9228 @itemx -mcix
9229 @itemx -mno-cix
9230 @itemx -mfix
9231 @itemx -mno-fix
9232 @itemx -mmax
9233 @itemx -mno-max
9234 @opindex mbwx
9235 @opindex mno-bwx
9236 @opindex mcix
9237 @opindex mno-cix
9238 @opindex mfix
9239 @opindex mno-fix
9240 @opindex mmax
9241 @opindex mno-max
9242 Indicate whether GCC should generate code to use the optional BWX,
9243 CIX, FIX and MAX instruction sets.  The default is to use the instruction
9244 sets supported by the CPU type specified via @option{-mcpu=} option or that
9245 of the CPU on which GCC was built if none was specified.
9246
9247 @item -mfloat-vax
9248 @itemx -mfloat-ieee
9249 @opindex mfloat-vax
9250 @opindex mfloat-ieee
9251 Generate code that uses (does not use) VAX F and G floating point
9252 arithmetic instead of IEEE single and double precision.
9253
9254 @item -mexplicit-relocs
9255 @itemx -mno-explicit-relocs
9256 @opindex mexplicit-relocs
9257 @opindex mno-explicit-relocs
9258 Older Alpha assemblers provided no way to generate symbol relocations
9259 except via assembler macros.  Use of these macros does not allow
9260 optimal instruction scheduling.  GNU binutils as of version 2.12
9261 supports a new syntax that allows the compiler to explicitly mark
9262 which relocations should apply to which instructions.  This option
9263 is mostly useful for debugging, as GCC detects the capabilities of
9264 the assembler when it is built and sets the default accordingly.
9265
9266 @item -msmall-data
9267 @itemx -mlarge-data
9268 @opindex msmall-data
9269 @opindex mlarge-data
9270 When @option{-mexplicit-relocs} is in effect, static data is
9271 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
9272 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
9273 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
9274 16-bit relocations off of the @code{$gp} register.  This limits the
9275 size of the small data area to 64KB, but allows the variables to be
9276 directly accessed via a single instruction.
9277
9278 The default is @option{-mlarge-data}.  With this option the data area
9279 is limited to just below 2GB@.  Programs that require more than 2GB of
9280 data must use @code{malloc} or @code{mmap} to allocate the data in the
9281 heap instead of in the program's data segment.
9282
9283 When generating code for shared libraries, @option{-fpic} implies
9284 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
9285
9286 @item -msmall-text
9287 @itemx -mlarge-text
9288 @opindex msmall-text
9289 @opindex mlarge-text
9290 When @option{-msmall-text} is used, the compiler assumes that the
9291 code of the entire program (or shared library) fits in 4MB, and is
9292 thus reachable with a branch instruction.  When @option{-msmall-data}
9293 is used, the compiler can assume that all local symbols share the
9294 same @code{$gp} value, and thus reduce the number of instructions
9295 required for a function call from 4 to 1.
9296
9297 The default is @option{-mlarge-text}.
9298
9299 @item -mcpu=@var{cpu_type}
9300 @opindex mcpu
9301 Set the instruction set and instruction scheduling parameters for
9302 machine type @var{cpu_type}.  You can specify either the @samp{EV}
9303 style name or the corresponding chip number.  GCC supports scheduling
9304 parameters for the EV4, EV5 and EV6 family of processors and will
9305 choose the default values for the instruction set from the processor
9306 you specify.  If you do not specify a processor type, GCC will default
9307 to the processor on which the compiler was built.
9308
9309 Supported values for @var{cpu_type} are
9310
9311 @table @samp
9312 @item ev4
9313 @itemx ev45
9314 @itemx 21064
9315 Schedules as an EV4 and has no instruction set extensions.
9316
9317 @item ev5
9318 @itemx 21164
9319 Schedules as an EV5 and has no instruction set extensions.
9320
9321 @item ev56
9322 @itemx 21164a
9323 Schedules as an EV5 and supports the BWX extension.
9324
9325 @item pca56
9326 @itemx 21164pc
9327 @itemx 21164PC
9328 Schedules as an EV5 and supports the BWX and MAX extensions.
9329
9330 @item ev6
9331 @itemx 21264
9332 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
9333
9334 @item ev67
9335 @itemx 21264a
9336 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
9337 @end table
9338
9339 @item -mtune=@var{cpu_type}
9340 @opindex mtune
9341 Set only the instruction scheduling parameters for machine type
9342 @var{cpu_type}.  The instruction set is not changed.
9343
9344 @item -mmemory-latency=@var{time}
9345 @opindex mmemory-latency
9346 Sets the latency the scheduler should assume for typical memory
9347 references as seen by the application.  This number is highly
9348 dependent on the memory access patterns used by the application
9349 and the size of the external cache on the machine.
9350
9351 Valid options for @var{time} are
9352
9353 @table @samp
9354 @item @var{number}
9355 A decimal number representing clock cycles.
9356
9357 @item L1
9358 @itemx L2
9359 @itemx L3
9360 @itemx main
9361 The compiler contains estimates of the number of clock cycles for
9362 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
9363 (also called Dcache, Scache, and Bcache), as well as to main memory.
9364 Note that L3 is only valid for EV5.
9365
9366 @end table
9367 @end table
9368
9369 @node DEC Alpha/VMS Options
9370 @subsection DEC Alpha/VMS Options
9371
9372 These @samp{-m} options are defined for the DEC Alpha/VMS implementations:
9373
9374 @table @gcctabopt
9375 @item -mvms-return-codes
9376 @opindex mvms-return-codes
9377 Return VMS condition codes from main.  The default is to return POSIX
9378 style condition (e.g.@: error) codes.
9379 @end table
9380
9381 @node FRV Options
9382 @subsection FRV Options
9383 @cindex FRV Options
9384
9385 @table @gcctabopt
9386 @item -mgpr-32
9387 @opindex mgpr-32
9388
9389 Only use the first 32 general purpose registers.
9390
9391 @item -mgpr-64
9392 @opindex mgpr-64
9393
9394 Use all 64 general purpose registers.
9395
9396 @item -mfpr-32
9397 @opindex mfpr-32
9398
9399 Use only the first 32 floating point registers.
9400
9401 @item -mfpr-64
9402 @opindex mfpr-64
9403
9404 Use all 64 floating point registers
9405
9406 @item -mhard-float
9407 @opindex mhard-float
9408
9409 Use hardware instructions for floating point operations.
9410
9411 @item -msoft-float
9412 @opindex msoft-float
9413
9414 Use library routines for floating point operations.
9415
9416 @item -malloc-cc
9417 @opindex malloc-cc
9418
9419 Dynamically allocate condition code registers.
9420
9421 @item -mfixed-cc
9422 @opindex mfixed-cc
9423
9424 Do not try to dynamically allocate condition code registers, only
9425 use @code{icc0} and @code{fcc0}.
9426
9427 @item -mdword
9428 @opindex mdword
9429
9430 Change ABI to use double word insns.
9431
9432 @item -mno-dword
9433 @opindex mno-dword
9434
9435 Do not use double word instructions.
9436
9437 @item -mdouble
9438 @opindex mdouble
9439
9440 Use floating point double instructions.
9441
9442 @item -mno-double
9443 @opindex mno-double
9444
9445 Do not use floating point double instructions.
9446
9447 @item -mmedia
9448 @opindex mmedia
9449
9450 Use media instructions.
9451
9452 @item -mno-media
9453 @opindex mno-media
9454
9455 Do not use media instructions.
9456
9457 @item -mmuladd
9458 @opindex mmuladd
9459
9460 Use multiply and add/subtract instructions.
9461
9462 @item -mno-muladd
9463 @opindex mno-muladd
9464
9465 Do not use multiply and add/subtract instructions.
9466
9467 @item -mfdpic
9468 @opindex mfdpic
9469
9470 Select the FDPIC ABI, that uses function descriptors to represent
9471 pointers to functions.  Without any PIC/PIE-related options, it
9472 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
9473 assumes GOT entries and small data are within a 12-bit range from the
9474 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
9475 are computed with 32 bits.
9476
9477 @item -minline-plt
9478 @opindex minline-plt
9479
9480 Enable inlining of PLT entries in function calls to functions that are
9481 not known to bind locally.  It has no effect without @option{-mfdpic}.
9482 It's enabled by default if optimizing for speed and compiling for
9483 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
9484 optimization option such as @option{-O3} or above is present in the
9485 command line.
9486
9487 @item -mTLS
9488 @opindex TLS
9489
9490 Assume a large TLS segment when generating thread-local code.
9491
9492 @item -mtls
9493 @opindex tls
9494
9495 Do not assume a large TLS segment when generating thread-local code.
9496
9497 @item -mgprel-ro
9498 @opindex mgprel-ro
9499
9500 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
9501 that is known to be in read-only sections.  It's enabled by default,
9502 except for @option{-fpic} or @option{-fpie}: even though it may help
9503 make the global offset table smaller, it trades 1 instruction for 4.
9504 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
9505 one of which may be shared by multiple symbols, and it avoids the need
9506 for a GOT entry for the referenced symbol, so it's more likely to be a
9507 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
9508
9509 @item -multilib-library-pic
9510 @opindex multilib-library-pic
9511
9512 Link with the (library, not FD) pic libraries.  It's implied by
9513 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
9514 @option{-fpic} without @option{-mfdpic}.  You should never have to use
9515 it explicitly.
9516
9517 @item -mlinked-fp
9518 @opindex mlinked-fp
9519
9520 Follow the EABI requirement of always creating a frame pointer whenever
9521 a stack frame is allocated.  This option is enabled by default and can
9522 be disabled with @option{-mno-linked-fp}.
9523
9524 @item -mlong-calls
9525 @opindex mlong-calls
9526
9527 Use indirect addressing to call functions outside the current
9528 compilation unit.  This allows the functions to be placed anywhere
9529 within the 32-bit address space.
9530
9531 @item -malign-labels
9532 @opindex malign-labels
9533
9534 Try to align labels to an 8-byte boundary by inserting nops into the
9535 previous packet.  This option only has an effect when VLIW packing
9536 is enabled.  It doesn't create new packets; it merely adds nops to
9537 existing ones.
9538
9539 @item -mlibrary-pic
9540 @opindex mlibrary-pic
9541
9542 Generate position-independent EABI code.
9543
9544 @item -macc-4
9545 @opindex macc-4
9546
9547 Use only the first four media accumulator registers.
9548
9549 @item -macc-8
9550 @opindex macc-8
9551
9552 Use all eight media accumulator registers.
9553
9554 @item -mpack
9555 @opindex mpack
9556
9557 Pack VLIW instructions.
9558
9559 @item -mno-pack
9560 @opindex mno-pack
9561
9562 Do not pack VLIW instructions.
9563
9564 @item -mno-eflags
9565 @opindex mno-eflags
9566
9567 Do not mark ABI switches in e_flags.
9568
9569 @item -mcond-move
9570 @opindex mcond-move
9571
9572 Enable the use of conditional-move instructions (default).
9573
9574 This switch is mainly for debugging the compiler and will likely be removed
9575 in a future version.
9576
9577 @item -mno-cond-move
9578 @opindex mno-cond-move
9579
9580 Disable the use of conditional-move instructions.
9581
9582 This switch is mainly for debugging the compiler and will likely be removed
9583 in a future version.
9584
9585 @item -mscc
9586 @opindex mscc
9587
9588 Enable the use of conditional set instructions (default).
9589
9590 This switch is mainly for debugging the compiler and will likely be removed
9591 in a future version.
9592
9593 @item -mno-scc
9594 @opindex mno-scc
9595
9596 Disable the use of conditional set instructions.
9597
9598 This switch is mainly for debugging the compiler and will likely be removed
9599 in a future version.
9600
9601 @item -mcond-exec
9602 @opindex mcond-exec
9603
9604 Enable the use of conditional execution (default).
9605
9606 This switch is mainly for debugging the compiler and will likely be removed
9607 in a future version.
9608
9609 @item -mno-cond-exec
9610 @opindex mno-cond-exec
9611
9612 Disable the use of conditional execution.
9613
9614 This switch is mainly for debugging the compiler and will likely be removed
9615 in a future version.
9616
9617 @item -mvliw-branch
9618 @opindex mvliw-branch
9619
9620 Run a pass to pack branches into VLIW instructions (default).
9621
9622 This switch is mainly for debugging the compiler and will likely be removed
9623 in a future version.
9624
9625 @item -mno-vliw-branch
9626 @opindex mno-vliw-branch
9627
9628 Do not run a pass to pack branches into VLIW instructions.
9629
9630 This switch is mainly for debugging the compiler and will likely be removed
9631 in a future version.
9632
9633 @item -mmulti-cond-exec
9634 @opindex mmulti-cond-exec
9635
9636 Enable optimization of @code{&&} and @code{||} in conditional execution
9637 (default).
9638
9639 This switch is mainly for debugging the compiler and will likely be removed
9640 in a future version.
9641
9642 @item -mno-multi-cond-exec
9643 @opindex mno-multi-cond-exec
9644
9645 Disable optimization of @code{&&} and @code{||} in conditional execution.
9646
9647 This switch is mainly for debugging the compiler and will likely be removed
9648 in a future version.
9649
9650 @item -mnested-cond-exec
9651 @opindex mnested-cond-exec
9652
9653 Enable nested conditional execution optimizations (default).
9654
9655 This switch is mainly for debugging the compiler and will likely be removed
9656 in a future version.
9657
9658 @item -mno-nested-cond-exec
9659 @opindex mno-nested-cond-exec
9660
9661 Disable nested conditional execution optimizations.
9662
9663 This switch is mainly for debugging the compiler and will likely be removed
9664 in a future version.
9665
9666 @item -moptimize-membar
9667 @opindex moptimize-membar
9668
9669 This switch removes redundant @code{membar} instructions from the
9670 compiler generated code.  It is enabled by default.
9671
9672 @item -mno-optimize-membar
9673 @opindex mno-optimize-membar
9674
9675 This switch disables the automatic removal of redundant @code{membar}
9676 instructions from the generated code.
9677
9678 @item -mtomcat-stats
9679 @opindex mtomcat-stats
9680
9681 Cause gas to print out tomcat statistics.
9682
9683 @item -mcpu=@var{cpu}
9684 @opindex mcpu
9685
9686 Select the processor type for which to generate code.  Possible values are
9687 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
9688 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
9689
9690 @end table
9691
9692 @node GNU/Linux Options
9693 @subsection GNU/Linux Options
9694
9695 These @samp{-m} options are defined for GNU/Linux targets:
9696
9697 @table @gcctabopt
9698 @item -mglibc
9699 @opindex mglibc
9700 Use the GNU C library instead of uClibc.  This is the default except
9701 on @samp{*-*-linux-*uclibc*} targets.
9702
9703 @item -muclibc
9704 @opindex muclibc
9705 Use uClibc instead of the GNU C library.  This is the default on
9706 @samp{*-*-linux-*uclibc*} targets.
9707 @end table
9708
9709 @node H8/300 Options
9710 @subsection H8/300 Options
9711
9712 These @samp{-m} options are defined for the H8/300 implementations:
9713
9714 @table @gcctabopt
9715 @item -mrelax
9716 @opindex mrelax
9717 Shorten some address references at link time, when possible; uses the
9718 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
9719 ld, Using ld}, for a fuller description.
9720
9721 @item -mh
9722 @opindex mh
9723 Generate code for the H8/300H@.
9724
9725 @item -ms
9726 @opindex ms
9727 Generate code for the H8S@.
9728
9729 @item -mn
9730 @opindex mn
9731 Generate code for the H8S and H8/300H in the normal mode.  This switch
9732 must be used either with @option{-mh} or @option{-ms}.
9733
9734 @item -ms2600
9735 @opindex ms2600
9736 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
9737
9738 @item -mint32
9739 @opindex mint32
9740 Make @code{int} data 32 bits by default.
9741
9742 @item -malign-300
9743 @opindex malign-300
9744 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
9745 The default for the H8/300H and H8S is to align longs and floats on 4
9746 byte boundaries.
9747 @option{-malign-300} causes them to be aligned on 2 byte boundaries.
9748 This option has no effect on the H8/300.
9749 @end table
9750
9751 @node HPPA Options
9752 @subsection HPPA Options
9753 @cindex HPPA Options
9754
9755 These @samp{-m} options are defined for the HPPA family of computers:
9756
9757 @table @gcctabopt
9758 @item -march=@var{architecture-type}
9759 @opindex march
9760 Generate code for the specified architecture.  The choices for
9761 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
9762 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
9763 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
9764 architecture option for your machine.  Code compiled for lower numbered
9765 architectures will run on higher numbered architectures, but not the
9766 other way around.
9767
9768 @item -mpa-risc-1-0
9769 @itemx -mpa-risc-1-1
9770 @itemx -mpa-risc-2-0
9771 @opindex mpa-risc-1-0
9772 @opindex mpa-risc-1-1
9773 @opindex mpa-risc-2-0
9774 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
9775
9776 @item -mbig-switch
9777 @opindex mbig-switch
9778 Generate code suitable for big switch tables.  Use this option only if
9779 the assembler/linker complain about out of range branches within a switch
9780 table.
9781
9782 @item -mjump-in-delay
9783 @opindex mjump-in-delay
9784 Fill delay slots of function calls with unconditional jump instructions
9785 by modifying the return pointer for the function call to be the target
9786 of the conditional jump.
9787
9788 @item -mdisable-fpregs
9789 @opindex mdisable-fpregs
9790 Prevent floating point registers from being used in any manner.  This is
9791 necessary for compiling kernels which perform lazy context switching of
9792 floating point registers.  If you use this option and attempt to perform
9793 floating point operations, the compiler will abort.
9794
9795 @item -mdisable-indexing
9796 @opindex mdisable-indexing
9797 Prevent the compiler from using indexing address modes.  This avoids some
9798 rather obscure problems when compiling MIG generated code under MACH@.
9799
9800 @item -mno-space-regs
9801 @opindex mno-space-regs
9802 Generate code that assumes the target has no space registers.  This allows
9803 GCC to generate faster indirect calls and use unscaled index address modes.
9804
9805 Such code is suitable for level 0 PA systems and kernels.
9806
9807 @item -mfast-indirect-calls
9808 @opindex mfast-indirect-calls
9809 Generate code that assumes calls never cross space boundaries.  This
9810 allows GCC to emit code which performs faster indirect calls.
9811
9812 This option will not work in the presence of shared libraries or nested
9813 functions.
9814
9815 @item -mfixed-range=@var{register-range}
9816 @opindex mfixed-range
9817 Generate code treating the given register range as fixed registers.
9818 A fixed register is one that the register allocator can not use.  This is
9819 useful when compiling kernel code.  A register range is specified as
9820 two registers separated by a dash.  Multiple register ranges can be
9821 specified separated by a comma.
9822
9823 @item -mlong-load-store
9824 @opindex mlong-load-store
9825 Generate 3-instruction load and store sequences as sometimes required by
9826 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
9827 the HP compilers.
9828
9829 @item -mportable-runtime
9830 @opindex mportable-runtime
9831 Use the portable calling conventions proposed by HP for ELF systems.
9832
9833 @item -mgas
9834 @opindex mgas
9835 Enable the use of assembler directives only GAS understands.
9836
9837 @item -mschedule=@var{cpu-type}
9838 @opindex mschedule
9839 Schedule code according to the constraints for the machine type
9840 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
9841 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
9842 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
9843 proper scheduling option for your machine.  The default scheduling is
9844 @samp{8000}.
9845
9846 @item -mlinker-opt
9847 @opindex mlinker-opt
9848 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
9849 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
9850 linkers in which they give bogus error messages when linking some programs.
9851
9852 @item -msoft-float
9853 @opindex msoft-float
9854 Generate output containing library calls for floating point.
9855 @strong{Warning:} the requisite libraries are not available for all HPPA
9856 targets.  Normally the facilities of the machine's usual C compiler are
9857 used, but this cannot be done directly in cross-compilation.  You must make
9858 your own arrangements to provide suitable library functions for
9859 cross-compilation.  The embedded target @samp{hppa1.1-*-pro}
9860 does provide software floating point support.
9861
9862 @option{-msoft-float} changes the calling convention in the output file;
9863 therefore, it is only useful if you compile @emph{all} of a program with
9864 this option.  In particular, you need to compile @file{libgcc.a}, the
9865 library that comes with GCC, with @option{-msoft-float} in order for
9866 this to work.
9867
9868 @item -msio
9869 @opindex msio
9870 Generate the predefine, @code{_SIO}, for server IO@.  The default is
9871 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
9872 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
9873 options are available under HP-UX and HI-UX@.
9874
9875 @item -mgnu-ld
9876 @opindex gnu-ld
9877 Use GNU ld specific options.  This passes @option{-shared} to ld when
9878 building a shared library.  It is the default when GCC is configured,
9879 explicitly or implicitly, with the GNU linker.  This option does not
9880 have any affect on which ld is called, it only changes what parameters
9881 are passed to that ld.  The ld that is called is determined by the
9882 @option{--with-ld} configure option, GCC's program search path, and
9883 finally by the user's @env{PATH}.  The linker used by GCC can be printed
9884 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
9885 on the 64 bit HP-UX GCC, i.e. configured with @samp{hppa*64*-*-hpux*}.
9886
9887 @item -mhp-ld
9888 @opindex hp-ld
9889 Use HP ld specific options.  This passes @option{-b} to ld when building
9890 a shared library and passes @option{+Accept TypeMismatch} to ld on all
9891 links.  It is the default when GCC is configured, explicitly or
9892 implicitly, with the HP linker.  This option does not have any affect on
9893 which ld is called, it only changes what parameters are passed to that
9894 ld.  The ld that is called is determined by the @option{--with-ld}
9895 configure option, GCC's program search path, and finally by the user's
9896 @env{PATH}.  The linker used by GCC can be printed using @samp{which
9897 `gcc -print-prog-name=ld`}.  This option is only available on the 64 bit
9898 HP-UX GCC, i.e. configured with @samp{hppa*64*-*-hpux*}.
9899
9900 @item -mlong-calls
9901 @opindex mno-long-calls
9902 Generate code that uses long call sequences.  This ensures that a call
9903 is always able to reach linker generated stubs.  The default is to generate
9904 long calls only when the distance from the call site to the beginning
9905 of the function or translation unit, as the case may be, exceeds a
9906 predefined limit set by the branch type being used.  The limits for
9907 normal calls are 7,600,000 and 240,000 bytes, respectively for the
9908 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
9909 240,000 bytes.
9910
9911 Distances are measured from the beginning of functions when using the
9912 @option{-ffunction-sections} option, or when using the @option{-mgas}
9913 and @option{-mno-portable-runtime} options together under HP-UX with
9914 the SOM linker.
9915
9916 It is normally not desirable to use this option as it will degrade
9917 performance.  However, it may be useful in large applications,
9918 particularly when partial linking is used to build the application.
9919
9920 The types of long calls used depends on the capabilities of the
9921 assembler and linker, and the type of code being generated.  The
9922 impact on systems that support long absolute calls, and long pic
9923 symbol-difference or pc-relative calls should be relatively small.
9924 However, an indirect call is used on 32-bit ELF systems in pic code
9925 and it is quite long.
9926
9927 @item -munix=@var{unix-std}
9928 @opindex march
9929 Generate compiler predefines and select a startfile for the specified
9930 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
9931 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
9932 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
9933 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
9934 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
9935 and later.
9936
9937 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
9938 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
9939 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
9940 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
9941 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
9942 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
9943
9944 It is @emph{important} to note that this option changes the interfaces
9945 for various library routines.  It also affects the operational behavior
9946 of the C library.  Thus, @emph{extreme} care is needed in using this
9947 option.
9948
9949 Library code that is intended to operate with more than one UNIX
9950 standard must test, set and restore the variable @var{__xpg4_extended_mask}
9951 as appropriate.  Most GNU software doesn't provide this capability.
9952
9953 @item -nolibdld
9954 @opindex nolibdld
9955 Suppress the generation of link options to search libdld.sl when the
9956 @option{-static} option is specified on HP-UX 10 and later.
9957
9958 @item -static
9959 @opindex static
9960 The HP-UX implementation of setlocale in libc has a dependency on
9961 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
9962 when the @option{-static} option is specified, special link options
9963 are needed to resolve this dependency.
9964
9965 On HP-UX 10 and later, the GCC driver adds the necessary options to
9966 link with libdld.sl when the @option{-static} option is specified.
9967 This causes the resulting binary to be dynamic.  On the 64-bit port,
9968 the linkers generate dynamic binaries by default in any case.  The
9969 @option{-nolibdld} option can be used to prevent the GCC driver from
9970 adding these link options.
9971
9972 @item -threads
9973 @opindex threads
9974 Add support for multithreading with the @dfn{dce thread} library
9975 under HP-UX@.  This option sets flags for both the preprocessor and
9976 linker.
9977 @end table
9978
9979 @node i386 and x86-64 Options
9980 @subsection Intel 386 and AMD x86-64 Options
9981 @cindex i386 Options
9982 @cindex x86-64 Options
9983 @cindex Intel 386 Options
9984 @cindex AMD x86-64 Options
9985
9986 These @samp{-m} options are defined for the i386 and x86-64 family of
9987 computers:
9988
9989 @table @gcctabopt
9990 @item -mtune=@var{cpu-type}
9991 @opindex mtune
9992 Tune to @var{cpu-type} everything applicable about the generated code, except
9993 for the ABI and the set of available instructions.  The choices for
9994 @var{cpu-type} are:
9995 @table @emph
9996 @item generic
9997 Produce code optimized for the most common IA32/AMD64/EM64T processors.
9998 If you know the CPU on which your code will run, then you should use
9999 the corresponding @option{-mtune} option instead of
10000 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
10001 of your application will have, then you should use this option.
10002
10003 As new processors are deployed in the marketplace, the behavior of this
10004 option will change.  Therefore, if you upgrade to a newer version of
10005 GCC, the code generated option will change to reflect the processors
10006 that were most common when that version of GCC was released.
10007
10008 There is no @option{-march=generic} option because @option{-march}
10009 indicates the instruction set the compiler can use, and there is no
10010 generic instruction set applicable to all processors.  In contrast,
10011 @option{-mtune} indicates the processor (or, in this case, collection of
10012 processors) for which the code is optimized.
10013 @item native
10014 This selects the CPU to tune for at compilation time by determining
10015 the processor type of the compiling machine.  Using @option{-mtune=native}
10016 will produce code optimized for the local machine under the constraints
10017 of the selected instruction set.  Using @option{-march=native} will
10018 enable all instruction subsets supported by the local machine (hence
10019 the result might not run on different machines).
10020 @item i386
10021 Original Intel's i386 CPU@.
10022 @item i486
10023 Intel's i486 CPU@.  (No scheduling is implemented for this chip.)
10024 @item i586, pentium
10025 Intel Pentium CPU with no MMX support.
10026 @item pentium-mmx
10027 Intel PentiumMMX CPU based on Pentium core with MMX instruction set support.
10028 @item pentiumpro
10029 Intel PentiumPro CPU@.
10030 @item i686
10031 Same as @code{generic}, but when used as @code{march} option, PentiumPro
10032 instruction set will be used, so the code will run on all i686 family chips.
10033 @item pentium2
10034 Intel Pentium2 CPU based on PentiumPro core with MMX instruction set support.
10035 @item pentium3, pentium3m
10036 Intel Pentium3 CPU based on PentiumPro core with MMX and SSE instruction set
10037 support.
10038 @item pentium-m
10039 Low power version of Intel Pentium3 CPU with MMX, SSE and SSE2 instruction set
10040 support.  Used by Centrino notebooks.
10041 @item pentium4, pentium4m
10042 Intel Pentium4 CPU with MMX, SSE and SSE2 instruction set support.
10043 @item prescott
10044 Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2 and SSE3 instruction
10045 set support.
10046 @item nocona
10047 Improved version of Intel Pentium4 CPU with 64-bit extensions, MMX, SSE,
10048 SSE2 and SSE3 instruction set support.
10049 @item core2
10050 Intel Core2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
10051 instruction set support.
10052 @item k6
10053 AMD K6 CPU with MMX instruction set support.
10054 @item k6-2, k6-3
10055 Improved versions of AMD K6 CPU with MMX and 3dNOW! instruction set support.
10056 @item athlon, athlon-tbird
10057 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and SSE prefetch instructions
10058 support.
10059 @item athlon-4, athlon-xp, athlon-mp
10060 Improved AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and full SSE
10061 instruction set support.
10062 @item k8, opteron, athlon64, athlon-fx
10063 AMD K8 core based CPUs with x86-64 instruction set support.  (This supersets
10064 MMX, SSE, SSE2, 3dNOW!, enhanced 3dNOW! and 64-bit instruction set extensions.)
10065 @item k8-sse3, opteron-sse3, athlon64-sse3
10066 Improved versions of k8, opteron and athlon64 with SSE3 instruction set support.
10067 @item amdfam10, barcelona
10068 AMD Family 10h core based CPUs with x86-64 instruction set support.  (This
10069 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3dNOW!, enhanced 3dNOW!, ABM and 64-bit
10070 instruction set extensions.)
10071 @item winchip-c6
10072 IDT Winchip C6 CPU, dealt in same way as i486 with additional MMX instruction
10073 set support.
10074 @item winchip2
10075 IDT Winchip2 CPU, dealt in same way as i486 with additional MMX and 3dNOW!
10076 instruction set support.
10077 @item c3
10078 Via C3 CPU with MMX and 3dNOW! instruction set support.  (No scheduling is
10079 implemented for this chip.)
10080 @item c3-2
10081 Via C3-2 CPU with MMX and SSE instruction set support.  (No scheduling is
10082 implemented for this chip.)
10083 @item geode
10084 Embedded AMD CPU with MMX and 3dNOW! instruction set support.
10085 @end table
10086
10087 While picking a specific @var{cpu-type} will schedule things appropriately
10088 for that particular chip, the compiler will not generate any code that
10089 does not run on the i386 without the @option{-march=@var{cpu-type}} option
10090 being used.
10091
10092 @item -march=@var{cpu-type}
10093 @opindex march
10094 Generate instructions for the machine type @var{cpu-type}.  The choices
10095 for @var{cpu-type} are the same as for @option{-mtune}.  Moreover,
10096 specifying @option{-march=@var{cpu-type}} implies @option{-mtune=@var{cpu-type}}.
10097
10098 @item -mcpu=@var{cpu-type}
10099 @opindex mcpu
10100 A deprecated synonym for @option{-mtune}.
10101
10102 @item -mfpmath=@var{unit}
10103 @opindex march
10104 Generate floating point arithmetics for selected unit @var{unit}.  The choices
10105 for @var{unit} are:
10106
10107 @table @samp
10108 @item 387
10109 Use the standard 387 floating point coprocessor present majority of chips and
10110 emulated otherwise.  Code compiled with this option will run almost everywhere.
10111 The temporary results are computed in 80bit precision instead of precision
10112 specified by the type resulting in slightly different results compared to most
10113 of other chips.  See @option{-ffloat-store} for more detailed description.
10114
10115 This is the default choice for i386 compiler.
10116
10117 @item sse
10118 Use scalar floating point instructions present in the SSE instruction set.
10119 This instruction set is supported by Pentium3 and newer chips, in the AMD line
10120 by Athlon-4, Athlon-xp and Athlon-mp chips.  The earlier version of SSE
10121 instruction set supports only single precision arithmetics, thus the double and
10122 extended precision arithmetics is still done using 387.  Later version, present
10123 only in Pentium4 and the future AMD x86-64 chips supports double precision
10124 arithmetics too.
10125
10126 For the i386 compiler, you need to use @option{-march=@var{cpu-type}}, @option{-msse}
10127 or @option{-msse2} switches to enable SSE extensions and make this option
10128 effective.  For the x86-64 compiler, these extensions are enabled by default.
10129
10130 The resulting code should be considerably faster in the majority of cases and avoid
10131 the numerical instability problems of 387 code, but may break some existing
10132 code that expects temporaries to be 80bit.
10133
10134 This is the default choice for the x86-64 compiler.
10135
10136 @item sse,387
10137 Attempt to utilize both instruction sets at once.  This effectively double the
10138 amount of available registers and on chips with separate execution units for
10139 387 and SSE the execution resources too.  Use this option with care, as it is
10140 still experimental, because the GCC register allocator does not model separate
10141 functional units well resulting in instable performance.
10142 @end table
10143
10144 @item -masm=@var{dialect}
10145 @opindex masm=@var{dialect}
10146 Output asm instructions using selected @var{dialect}.  Supported
10147 choices are @samp{intel} or @samp{att} (the default one).  Darwin does
10148 not support @samp{intel}.
10149
10150 @item -mieee-fp
10151 @itemx -mno-ieee-fp
10152 @opindex mieee-fp
10153 @opindex mno-ieee-fp
10154 Control whether or not the compiler uses IEEE floating point
10155 comparisons.  These handle correctly the case where the result of a
10156 comparison is unordered.
10157
10158 @item -msoft-float
10159 @opindex msoft-float
10160 Generate output containing library calls for floating point.
10161 @strong{Warning:} the requisite libraries are not part of GCC@.
10162 Normally the facilities of the machine's usual C compiler are used, but
10163 this can't be done directly in cross-compilation.  You must make your
10164 own arrangements to provide suitable library functions for
10165 cross-compilation.
10166
10167 On machines where a function returns floating point results in the 80387
10168 register stack, some floating point opcodes may be emitted even if
10169 @option{-msoft-float} is used.
10170
10171 @item -mno-fp-ret-in-387
10172 @opindex mno-fp-ret-in-387
10173 Do not use the FPU registers for return values of functions.
10174
10175 The usual calling convention has functions return values of types
10176 @code{float} and @code{double} in an FPU register, even if there
10177 is no FPU@.  The idea is that the operating system should emulate
10178 an FPU@.
10179
10180 The option @option{-mno-fp-ret-in-387} causes such values to be returned
10181 in ordinary CPU registers instead.
10182
10183 @item -mno-fancy-math-387
10184 @opindex mno-fancy-math-387
10185 Some 387 emulators do not support the @code{sin}, @code{cos} and
10186 @code{sqrt} instructions for the 387.  Specify this option to avoid
10187 generating those instructions.  This option is the default on FreeBSD,
10188 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
10189 indicates that the target cpu will always have an FPU and so the
10190 instruction will not need emulation.  As of revision 2.6.1, these
10191 instructions are not generated unless you also use the
10192 @option{-funsafe-math-optimizations} switch.
10193
10194 @item -malign-double
10195 @itemx -mno-align-double
10196 @opindex malign-double
10197 @opindex mno-align-double
10198 Control whether GCC aligns @code{double}, @code{long double}, and
10199 @code{long long} variables on a two word boundary or a one word
10200 boundary.  Aligning @code{double} variables on a two word boundary will
10201 produce code that runs somewhat faster on a @samp{Pentium} at the
10202 expense of more memory.
10203
10204 On x86-64, @option{-malign-double} is enabled by default.
10205
10206 @strong{Warning:} if you use the @option{-malign-double} switch,
10207 structures containing the above types will be aligned differently than
10208 the published application binary interface specifications for the 386
10209 and will not be binary compatible with structures in code compiled
10210 without that switch.
10211
10212 @item -m96bit-long-double
10213 @itemx -m128bit-long-double
10214 @opindex m96bit-long-double
10215 @opindex m128bit-long-double
10216 These switches control the size of @code{long double} type.  The i386
10217 application binary interface specifies the size to be 96 bits,
10218 so @option{-m96bit-long-double} is the default in 32 bit mode.
10219
10220 Modern architectures (Pentium and newer) would prefer @code{long double}
10221 to be aligned to an 8 or 16 byte boundary.  In arrays or structures
10222 conforming to the ABI, this would not be possible.  So specifying a
10223 @option{-m128bit-long-double} will align @code{long double}
10224 to a 16 byte boundary by padding the @code{long double} with an additional
10225 32 bit zero.
10226
10227 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
10228 its ABI specifies that @code{long double} is to be aligned on 16 byte boundary.
10229
10230 Notice that neither of these options enable any extra precision over the x87
10231 standard of 80 bits for a @code{long double}.
10232
10233 @strong{Warning:} if you override the default value for your target ABI, the
10234 structures and arrays containing @code{long double} variables will change
10235 their size as well as function calling convention for function taking
10236 @code{long double} will be modified.  Hence they will not be binary
10237 compatible with arrays or structures in code compiled without that switch.
10238
10239 @item -mmlarge-data-threshold=@var{number}
10240 @opindex mlarge-data-threshold=@var{number}
10241 When @option{-mcmodel=medium} is specified, the data greater than
10242 @var{threshold} are placed in large data section.  This value must be the
10243 same across all object linked into the binary and defaults to 65535.
10244
10245 @item -mrtd
10246 @opindex mrtd
10247 Use a different function-calling convention, in which functions that
10248 take a fixed number of arguments return with the @code{ret} @var{num}
10249 instruction, which pops their arguments while returning.  This saves one
10250 instruction in the caller since there is no need to pop the arguments
10251 there.
10252
10253 You can specify that an individual function is called with this calling
10254 sequence with the function attribute @samp{stdcall}.  You can also
10255 override the @option{-mrtd} option by using the function attribute
10256 @samp{cdecl}.  @xref{Function Attributes}.
10257
10258 @strong{Warning:} this calling convention is incompatible with the one
10259 normally used on Unix, so you cannot use it if you need to call
10260 libraries compiled with the Unix compiler.
10261
10262 Also, you must provide function prototypes for all functions that
10263 take variable numbers of arguments (including @code{printf});
10264 otherwise incorrect code will be generated for calls to those
10265 functions.
10266
10267 In addition, seriously incorrect code will result if you call a
10268 function with too many arguments.  (Normally, extra arguments are
10269 harmlessly ignored.)
10270
10271 @item -mregparm=@var{num}
10272 @opindex mregparm
10273 Control how many registers are used to pass integer arguments.  By
10274 default, no registers are used to pass arguments, and at most 3
10275 registers can be used.  You can control this behavior for a specific
10276 function by using the function attribute @samp{regparm}.
10277 @xref{Function Attributes}.
10278
10279 @strong{Warning:} if you use this switch, and
10280 @var{num} is nonzero, then you must build all modules with the same
10281 value, including any libraries.  This includes the system libraries and
10282 startup modules.
10283
10284 @item -msseregparm
10285 @opindex msseregparm
10286 Use SSE register passing conventions for float and double arguments
10287 and return values.  You can control this behavior for a specific
10288 function by using the function attribute @samp{sseregparm}.
10289 @xref{Function Attributes}.
10290
10291 @strong{Warning:} if you use this switch then you must build all
10292 modules with the same value, including any libraries.  This includes
10293 the system libraries and startup modules.
10294
10295 @item -mpc32
10296 @itemx -mpc64
10297 @itemx -mpc80
10298 @opindex mpc32
10299 @opindex mpc64
10300 @opindex mpc80
10301
10302 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
10303 is specified, the significands of results of floating-point operations are
10304 rounded to 24 bits (single precision); @option{-mpc64} rounds the the
10305 significands of results of floating-point operations to 53 bits (double
10306 precision) and @option{-mpc80} rounds the significands of results of
10307 floating-point operations to 64 bits (extended double precision), which is
10308 the default.  When this option is used, floating-point operations in higher
10309 precisions are not available to the programmer without setting the FPU
10310 control word explicitly.
10311
10312 Setting the rounding of floating-point operations to less than the default
10313 80 bits can speed some programs by 2% or more.  Note that some mathematical
10314 libraries assume that extended precision (80 bit) floating-point operations
10315 are enabled by default; routines in such libraries could suffer significant
10316 loss of accuracy, typically through so-called "catastrophic cancellation",
10317 when this option is used to set the precision to less than extended precision. 
10318
10319 @item -mstackrealign
10320 @opindex mstackrealign
10321 Realign the stack at entry.  On the Intel x86, the
10322 @option{-mstackrealign} option will generate an alternate prologue and
10323 epilogue that realigns the runtime stack.  This supports mixing legacy
10324 codes that keep a 4-byte aligned stack with modern codes that keep a
10325 16-byte stack for SSE compatibility.  The alternate prologue and
10326 epilogue are slower and bigger than the regular ones, and the
10327 alternate prologue requires an extra scratch register; this lowers the
10328 number of registers available if used in conjunction with the
10329 @code{regparm} attribute.  The @option{-mstackrealign} option is
10330 incompatible with the nested function prologue; this is considered a
10331 hard error.  See also the attribute @code{force_align_arg_pointer},
10332 applicable to individual functions.
10333
10334 @item -mpreferred-stack-boundary=@var{num}
10335 @opindex mpreferred-stack-boundary
10336 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
10337 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
10338 the default is 4 (16 bytes or 128 bits).
10339
10340 On Pentium and PentiumPro, @code{double} and @code{long double} values
10341 should be aligned to an 8 byte boundary (see @option{-malign-double}) or
10342 suffer significant run time performance penalties.  On Pentium III, the
10343 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
10344 properly if it is not 16 byte aligned.
10345
10346 To ensure proper alignment of this values on the stack, the stack boundary
10347 must be as aligned as that required by any value stored on the stack.
10348 Further, every function must be generated such that it keeps the stack
10349 aligned.  Thus calling a function compiled with a higher preferred
10350 stack boundary from a function compiled with a lower preferred stack
10351 boundary will most likely misalign the stack.  It is recommended that
10352 libraries that use callbacks always use the default setting.
10353
10354 This extra alignment does consume extra stack space, and generally
10355 increases code size.  Code that is sensitive to stack space usage, such
10356 as embedded systems and operating system kernels, may want to reduce the
10357 preferred alignment to @option{-mpreferred-stack-boundary=2}.
10358
10359 @item -mmmx
10360 @itemx -mno-mmx
10361 @item -msse
10362 @itemx -mno-sse
10363 @item -msse2
10364 @itemx -mno-sse2
10365 @item -msse3
10366 @itemx -mno-sse3
10367 @item -mssse3
10368 @itemx -mno-ssse3
10369 @item -msse4.1
10370 @itemx -mno-sse4.1
10371 @item -msse4.2
10372 @itemx -mno-sse4.2
10373 @item -msse4
10374 @itemx -mno-sse4
10375 @item -msse4a
10376 @item -mno-sse4a
10377 @item -m3dnow
10378 @itemx -mno-3dnow
10379 @item -mpopcnt
10380 @itemx -mno-popcnt
10381 @item -mabm
10382 @itemx -mno-abm
10383 @opindex mmmx
10384 @opindex mno-mmx
10385 @opindex msse
10386 @opindex mno-sse
10387 @opindex m3dnow
10388 @opindex mno-3dnow
10389 These switches enable or disable the use of instructions in the MMX,
10390 SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4A, ABM or 3DNow! extended
10391 instruction sets.
10392 These extensions are also available as built-in functions: see
10393 @ref{X86 Built-in Functions}, for details of the functions enabled and
10394 disabled by these switches.
10395
10396 To have SSE/SSE2 instructions generated automatically from floating-point
10397 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
10398
10399 These options will enable GCC to use these extended instructions in
10400 generated code, even without @option{-mfpmath=sse}.  Applications which
10401 perform runtime CPU detection must compile separate files for each
10402 supported architecture, using the appropriate flags.  In particular,
10403 the file containing the CPU detection code should be compiled without
10404 these options.
10405
10406 @item -mcx16
10407 @opindex mcx16
10408 This option will enable GCC to use CMPXCHG16B instruction in generated code.
10409 CMPXCHG16B allows for atomic operations on 128-bit double quadword (or oword)
10410 data types.  This is useful for high resolution counters that could be updated
10411 by multiple processors (or cores).  This instruction is generated as part of
10412 atomic built-in functions: see @ref{Atomic Builtins} for details.
10413
10414 @item -msahf
10415 @opindex msahf
10416 This option will enable GCC to use SAHF instruction in generated 64-bit code.
10417 Early Intel CPUs with Intel 64 lacked LAHF and SAHF instructions supported
10418 by AMD64 until introduction of Pentium 4 G1 step in December 2005.  LAHF and
10419 SAHF are load and store instructions, respectively, for certain status flags.
10420 In 64-bit mode, SAHF instruction is used to optimize @code{fmod}, @code{drem}
10421 or @code{remainder} built-in functions: see @ref{Other Builtins} for details.
10422
10423 @item -mrecip
10424 @opindex mrecip
10425 This option will enable GCC to use RCPSS and RSQRTSS instructions (and their
10426 vectorized variants RCPPS and RSQRTPS) instead of DIVSS and SQRTSS (and their
10427 vectorized variants).  These instructions will be generated only when
10428 @option{-funsafe-math-optimizations} is enabled.
10429
10430 @item -mpush-args
10431 @itemx -mno-push-args
10432 @opindex mpush-args
10433 @opindex mno-push-args
10434 Use PUSH operations to store outgoing parameters.  This method is shorter
10435 and usually equally fast as method using SUB/MOV operations and is enabled
10436 by default.  In some cases disabling it may improve performance because of
10437 improved scheduling and reduced dependencies.
10438
10439 @item -maccumulate-outgoing-args
10440 @opindex maccumulate-outgoing-args
10441 If enabled, the maximum amount of space required for outgoing arguments will be
10442 computed in the function prologue.  This is faster on most modern CPUs
10443 because of reduced dependencies, improved scheduling and reduced stack usage
10444 when preferred stack boundary is not equal to 2.  The drawback is a notable
10445 increase in code size.  This switch implies @option{-mno-push-args}.
10446
10447 @item -mthreads
10448 @opindex mthreads
10449 Support thread-safe exception handling on @samp{Mingw32}.  Code that relies
10450 on thread-safe exception handling must compile and link all code with the
10451 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
10452 @option{-D_MT}; when linking, it links in a special thread helper library
10453 @option{-lmingwthrd} which cleans up per thread exception handling data.
10454
10455 @item -mno-align-stringops
10456 @opindex mno-align-stringops
10457 Do not align destination of inlined string operations.  This switch reduces
10458 code size and improves performance in case the destination is already aligned,
10459 but GCC doesn't know about it.
10460
10461 @item -minline-all-stringops
10462 @opindex minline-all-stringops
10463 By default GCC inlines string operations only when destination is known to be
10464 aligned at least to 4 byte boundary.  This enables more inlining, increase code
10465 size, but may improve performance of code that depends on fast memcpy, strlen
10466 and memset for short lengths.
10467
10468 @item -minline-stringops-dynamically
10469 @opindex minline-stringops-dynamically
10470 For string operation of unknown size, inline runtime checks so for small
10471 blocks inline code is used, while for large blocks library call is used.
10472
10473 @item -mstringop-strategy=@var{alg}
10474 @opindex mstringop-strategy=@var{alg}
10475 Overwrite internal decision heuristic about particular algorithm to inline
10476 string operation with.  The allowed values are @code{rep_byte},
10477 @code{rep_4byte}, @code{rep_8byte} for expanding using i386 @code{rep} prefix
10478 of specified size, @code{byte_loop}, @code{loop}, @code{unrolled_loop} for
10479 expanding inline loop, @code{libcall} for always expanding library call.
10480
10481 @item -momit-leaf-frame-pointer
10482 @opindex momit-leaf-frame-pointer
10483 Don't keep the frame pointer in a register for leaf functions.  This
10484 avoids the instructions to save, set up and restore frame pointers and
10485 makes an extra register available in leaf functions.  The option
10486 @option{-fomit-frame-pointer} removes the frame pointer for all functions
10487 which might make debugging harder.
10488
10489 @item -mtls-direct-seg-refs
10490 @itemx -mno-tls-direct-seg-refs
10491 @opindex mtls-direct-seg-refs
10492 Controls whether TLS variables may be accessed with offsets from the
10493 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
10494 or whether the thread base pointer must be added.  Whether or not this
10495 is legal depends on the operating system, and whether it maps the
10496 segment to cover the entire TLS area.
10497
10498 For systems that use GNU libc, the default is on.
10499 @end table
10500
10501 These @samp{-m} switches are supported in addition to the above
10502 on AMD x86-64 processors in 64-bit environments.
10503
10504 @table @gcctabopt
10505 @item -m32
10506 @itemx -m64
10507 @opindex m32
10508 @opindex m64
10509 Generate code for a 32-bit or 64-bit environment.
10510 The 32-bit environment sets int, long and pointer to 32 bits and
10511 generates code that runs on any i386 system.
10512 The 64-bit environment sets int to 32 bits and long and pointer
10513 to 64 bits and generates code for AMD's x86-64 architecture. For
10514 darwin only the -m64 option turns off the @option{-fno-pic} and
10515 @option{-mdynamic-no-pic} options.
10516
10517 @item -mno-red-zone
10518 @opindex no-red-zone
10519 Do not use a so called red zone for x86-64 code.  The red zone is mandated
10520 by the x86-64 ABI, it is a 128-byte area beyond the location of the
10521 stack pointer that will not be modified by signal or interrupt handlers
10522 and therefore can be used for temporary data without adjusting the stack
10523 pointer.  The flag @option{-mno-red-zone} disables this red zone.
10524
10525 @item -mcmodel=small
10526 @opindex mcmodel=small
10527 Generate code for the small code model: the program and its symbols must
10528 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
10529 Programs can be statically or dynamically linked.  This is the default
10530 code model.
10531
10532 @item -mcmodel=kernel
10533 @opindex mcmodel=kernel
10534 Generate code for the kernel code model.  The kernel runs in the
10535 negative 2 GB of the address space.
10536 This model has to be used for Linux kernel code.
10537
10538 @item -mcmodel=medium
10539 @opindex mcmodel=medium
10540 Generate code for the medium model: The program is linked in the lower 2
10541 GB of the address space but symbols can be located anywhere in the
10542 address space.  Programs can be statically or dynamically linked, but
10543 building of shared libraries are not supported with the medium model.
10544
10545 @item -mcmodel=large
10546 @opindex mcmodel=large
10547 Generate code for the large model: This model makes no assumptions
10548 about addresses and sizes of sections.
10549 @end table
10550
10551 @node IA-64 Options
10552 @subsection IA-64 Options
10553 @cindex IA-64 Options
10554
10555 These are the @samp{-m} options defined for the Intel IA-64 architecture.
10556
10557 @table @gcctabopt
10558 @item -mbig-endian
10559 @opindex mbig-endian
10560 Generate code for a big endian target.  This is the default for HP-UX@.
10561
10562 @item -mlittle-endian
10563 @opindex mlittle-endian
10564 Generate code for a little endian target.  This is the default for AIX5
10565 and GNU/Linux.
10566
10567 @item -mgnu-as
10568 @itemx -mno-gnu-as
10569 @opindex mgnu-as
10570 @opindex mno-gnu-as
10571 Generate (or don't) code for the GNU assembler.  This is the default.
10572 @c Also, this is the default if the configure option @option{--with-gnu-as}
10573 @c is used.
10574
10575 @item -mgnu-ld
10576 @itemx -mno-gnu-ld
10577 @opindex mgnu-ld
10578 @opindex mno-gnu-ld
10579 Generate (or don't) code for the GNU linker.  This is the default.
10580 @c Also, this is the default if the configure option @option{--with-gnu-ld}
10581 @c is used.
10582
10583 @item -mno-pic
10584 @opindex mno-pic
10585 Generate code that does not use a global pointer register.  The result
10586 is not position independent code, and violates the IA-64 ABI@.
10587
10588 @item -mvolatile-asm-stop
10589 @itemx -mno-volatile-asm-stop
10590 @opindex mvolatile-asm-stop
10591 @opindex mno-volatile-asm-stop
10592 Generate (or don't) a stop bit immediately before and after volatile asm
10593 statements.
10594
10595 @item -mregister-names
10596 @itemx -mno-register-names
10597 @opindex mregister-names
10598 @opindex mno-register-names
10599 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
10600 the stacked registers.  This may make assembler output more readable.
10601
10602 @item -mno-sdata
10603 @itemx -msdata
10604 @opindex mno-sdata
10605 @opindex msdata
10606 Disable (or enable) optimizations that use the small data section.  This may
10607 be useful for working around optimizer bugs.
10608
10609 @item -mconstant-gp
10610 @opindex mconstant-gp
10611 Generate code that uses a single constant global pointer value.  This is
10612 useful when compiling kernel code.
10613
10614 @item -mauto-pic
10615 @opindex mauto-pic
10616 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
10617 This is useful when compiling firmware code.
10618
10619 @item -minline-float-divide-min-latency
10620 @opindex minline-float-divide-min-latency
10621 Generate code for inline divides of floating point values
10622 using the minimum latency algorithm.
10623
10624 @item -minline-float-divide-max-throughput
10625 @opindex minline-float-divide-max-throughput
10626 Generate code for inline divides of floating point values
10627 using the maximum throughput algorithm.
10628
10629 @item -minline-int-divide-min-latency
10630 @opindex minline-int-divide-min-latency
10631 Generate code for inline divides of integer values
10632 using the minimum latency algorithm.
10633
10634 @item -minline-int-divide-max-throughput
10635 @opindex minline-int-divide-max-throughput
10636 Generate code for inline divides of integer values
10637 using the maximum throughput algorithm.
10638
10639 @item -minline-sqrt-min-latency
10640 @opindex minline-sqrt-min-latency
10641 Generate code for inline square roots
10642 using the minimum latency algorithm.
10643
10644 @item -minline-sqrt-max-throughput
10645 @opindex minline-sqrt-max-throughput
10646 Generate code for inline square roots
10647 using the maximum throughput algorithm.
10648
10649 @item -mno-dwarf2-asm
10650 @itemx -mdwarf2-asm
10651 @opindex mno-dwarf2-asm
10652 @opindex mdwarf2-asm
10653 Don't (or do) generate assembler code for the DWARF2 line number debugging
10654 info.  This may be useful when not using the GNU assembler.
10655
10656 @item -mearly-stop-bits
10657 @itemx -mno-early-stop-bits
10658 @opindex mearly-stop-bits
10659 @opindex mno-early-stop-bits
10660 Allow stop bits to be placed earlier than immediately preceding the
10661 instruction that triggered the stop bit.  This can improve instruction
10662 scheduling, but does not always do so.
10663
10664 @item -mfixed-range=@var{register-range}
10665 @opindex mfixed-range
10666 Generate code treating the given register range as fixed registers.
10667 A fixed register is one that the register allocator can not use.  This is
10668 useful when compiling kernel code.  A register range is specified as
10669 two registers separated by a dash.  Multiple register ranges can be
10670 specified separated by a comma.
10671
10672 @item -mtls-size=@var{tls-size}
10673 @opindex mtls-size
10674 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
10675 64.
10676
10677 @item -mtune=@var{cpu-type}
10678 @opindex mtune
10679 Tune the instruction scheduling for a particular CPU, Valid values are
10680 itanium, itanium1, merced, itanium2, and mckinley.
10681
10682 @item -mt
10683 @itemx -pthread
10684 @opindex mt
10685 @opindex pthread
10686 Add support for multithreading using the POSIX threads library.  This
10687 option sets flags for both the preprocessor and linker.  It does
10688 not affect the thread safety of object code produced by the compiler or
10689 that of libraries supplied with it.  These are HP-UX specific flags.
10690
10691 @item -milp32
10692 @itemx -mlp64
10693 @opindex milp32
10694 @opindex mlp64
10695 Generate code for a 32-bit or 64-bit environment.
10696 The 32-bit environment sets int, long and pointer to 32 bits.
10697 The 64-bit environment sets int to 32 bits and long and pointer
10698 to 64 bits.  These are HP-UX specific flags.
10699
10700 @item -mno-sched-br-data-spec
10701 @itemx -msched-br-data-spec
10702 @opindex mno-sched-br-data-spec
10703 @opindex msched-br-data-spec
10704 (Dis/En)able data speculative scheduling before reload.
10705 This will result in generation of the ld.a instructions and
10706 the corresponding check instructions (ld.c / chk.a).
10707 The default is 'disable'.
10708
10709 @item -msched-ar-data-spec
10710 @itemx -mno-sched-ar-data-spec
10711 @opindex msched-ar-data-spec
10712 @opindex mno-sched-ar-data-spec
10713 (En/Dis)able data speculative scheduling after reload.
10714 This will result in generation of the ld.a instructions and
10715 the corresponding check instructions (ld.c / chk.a).
10716 The default is 'enable'.
10717
10718 @item -mno-sched-control-spec
10719 @itemx -msched-control-spec
10720 @opindex mno-sched-control-spec
10721 @opindex msched-control-spec
10722 (Dis/En)able control speculative scheduling.  This feature is
10723 available only during region scheduling (i.e. before reload).
10724 This will result in generation of the ld.s instructions and
10725 the corresponding check instructions chk.s .
10726 The default is 'disable'.
10727
10728 @item -msched-br-in-data-spec
10729 @itemx -mno-sched-br-in-data-spec
10730 @opindex msched-br-in-data-spec
10731 @opindex mno-sched-br-in-data-spec
10732 (En/Dis)able speculative scheduling of the instructions that
10733 are dependent on the data speculative loads before reload.
10734 This is effective only with @option{-msched-br-data-spec} enabled.
10735 The default is 'enable'.
10736
10737 @item -msched-ar-in-data-spec
10738 @itemx -mno-sched-ar-in-data-spec
10739 @opindex msched-ar-in-data-spec
10740 @opindex mno-sched-ar-in-data-spec
10741 (En/Dis)able speculative scheduling of the instructions that
10742 are dependent on the data speculative loads after reload.
10743 This is effective only with @option{-msched-ar-data-spec} enabled.
10744 The default is 'enable'.
10745
10746 @item -msched-in-control-spec
10747 @itemx -mno-sched-in-control-spec
10748 @opindex msched-in-control-spec
10749 @opindex mno-sched-in-control-spec
10750 (En/Dis)able speculative scheduling of the instructions that
10751 are dependent on the control speculative loads.
10752 This is effective only with @option{-msched-control-spec} enabled.
10753 The default is 'enable'.
10754
10755 @item -msched-ldc
10756 @itemx -mno-sched-ldc
10757 @opindex msched-ldc
10758 @opindex mno-sched-ldc
10759 (En/Dis)able use of simple data speculation checks ld.c .
10760 If disabled, only chk.a instructions will be emitted to check
10761 data speculative loads.
10762 The default is 'enable'.
10763
10764 @item -mno-sched-control-ldc
10765 @itemx -msched-control-ldc
10766 @opindex mno-sched-control-ldc
10767 @opindex msched-control-ldc
10768 (Dis/En)able use of ld.c instructions to check control speculative loads.
10769 If enabled, in case of control speculative load with no speculatively
10770 scheduled dependent instructions this load will be emitted as ld.sa and
10771 ld.c will be used to check it.
10772 The default is 'disable'.
10773
10774 @item -mno-sched-spec-verbose
10775 @itemx -msched-spec-verbose
10776 @opindex mno-sched-spec-verbose
10777 @opindex msched-spec-verbose
10778 (Dis/En)able printing of the information about speculative motions.
10779
10780 @item -mno-sched-prefer-non-data-spec-insns
10781 @itemx -msched-prefer-non-data-spec-insns
10782 @opindex mno-sched-prefer-non-data-spec-insns
10783 @opindex msched-prefer-non-data-spec-insns
10784 If enabled, data speculative instructions will be chosen for schedule
10785 only if there are no other choices at the moment.  This will make
10786 the use of the data speculation much more conservative.
10787 The default is 'disable'.
10788
10789 @item -mno-sched-prefer-non-control-spec-insns
10790 @itemx -msched-prefer-non-control-spec-insns
10791 @opindex mno-sched-prefer-non-control-spec-insns
10792 @opindex msched-prefer-non-control-spec-insns
10793 If enabled, control speculative instructions will be chosen for schedule
10794 only if there are no other choices at the moment.  This will make
10795 the use of the control speculation much more conservative.
10796 The default is 'disable'.
10797
10798 @item -mno-sched-count-spec-in-critical-path
10799 @itemx -msched-count-spec-in-critical-path
10800 @opindex mno-sched-count-spec-in-critical-path
10801 @opindex msched-count-spec-in-critical-path
10802 If enabled, speculative dependencies will be considered during
10803 computation of the instructions priorities.  This will make the use of the
10804 speculation a bit more conservative.
10805 The default is 'disable'.
10806
10807 @end table
10808
10809 @node M32C Options
10810 @subsection M32C Options
10811 @cindex M32C options
10812
10813 @table @gcctabopt
10814 @item -mcpu=@var{name}
10815 @opindex mcpu=
10816 Select the CPU for which code is generated.  @var{name} may be one of
10817 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
10818 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
10819 the M32C/80 series.
10820
10821 @item -msim
10822 @opindex msim
10823 Specifies that the program will be run on the simulator.  This causes
10824 an alternate runtime library to be linked in which supports, for
10825 example, file I/O.  You must not use this option when generating
10826 programs that will run on real hardware; you must provide your own
10827 runtime library for whatever I/O functions are needed.
10828
10829 @item -memregs=@var{number}
10830 @opindex memregs=
10831 Specifies the number of memory-based pseudo-registers GCC will use
10832 during code generation.  These pseudo-registers will be used like real
10833 registers, so there is a tradeoff between GCC's ability to fit the
10834 code into available registers, and the performance penalty of using
10835 memory instead of registers.  Note that all modules in a program must
10836 be compiled with the same value for this option.  Because of that, you
10837 must not use this option with the default runtime libraries gcc
10838 builds.
10839
10840 @end table
10841
10842 @node M32R/D Options
10843 @subsection M32R/D Options
10844 @cindex M32R/D options
10845
10846 These @option{-m} options are defined for Renesas M32R/D architectures:
10847
10848 @table @gcctabopt
10849 @item -m32r2
10850 @opindex m32r2
10851 Generate code for the M32R/2@.
10852
10853 @item -m32rx
10854 @opindex m32rx
10855 Generate code for the M32R/X@.
10856
10857 @item -m32r
10858 @opindex m32r
10859 Generate code for the M32R@.  This is the default.
10860
10861 @item -mmodel=small
10862 @opindex mmodel=small
10863 Assume all objects live in the lower 16MB of memory (so that their addresses
10864 can be loaded with the @code{ld24} instruction), and assume all subroutines
10865 are reachable with the @code{bl} instruction.
10866 This is the default.
10867
10868 The addressability of a particular object can be set with the
10869 @code{model} attribute.
10870
10871 @item -mmodel=medium
10872 @opindex mmodel=medium
10873 Assume objects may be anywhere in the 32-bit address space (the compiler
10874 will generate @code{seth/add3} instructions to load their addresses), and
10875 assume all subroutines are reachable with the @code{bl} instruction.
10876
10877 @item -mmodel=large
10878 @opindex mmodel=large
10879 Assume objects may be anywhere in the 32-bit address space (the compiler
10880 will generate @code{seth/add3} instructions to load their addresses), and
10881 assume subroutines may not be reachable with the @code{bl} instruction
10882 (the compiler will generate the much slower @code{seth/add3/jl}
10883 instruction sequence).
10884
10885 @item -msdata=none
10886 @opindex msdata=none
10887 Disable use of the small data area.  Variables will be put into
10888 one of @samp{.data}, @samp{bss}, or @samp{.rodata} (unless the
10889 @code{section} attribute has been specified).
10890 This is the default.
10891
10892 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
10893 Objects may be explicitly put in the small data area with the
10894 @code{section} attribute using one of these sections.
10895
10896 @item -msdata=sdata
10897 @opindex msdata=sdata
10898 Put small global and static data in the small data area, but do not
10899 generate special code to reference them.
10900
10901 @item -msdata=use
10902 @opindex msdata=use
10903 Put small global and static data in the small data area, and generate
10904 special instructions to reference them.
10905
10906 @item -G @var{num}
10907 @opindex G
10908 @cindex smaller data references
10909 Put global and static objects less than or equal to @var{num} bytes
10910 into the small data or bss sections instead of the normal data or bss
10911 sections.  The default value of @var{num} is 8.
10912 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
10913 for this option to have any effect.
10914
10915 All modules should be compiled with the same @option{-G @var{num}} value.
10916 Compiling with different values of @var{num} may or may not work; if it
10917 doesn't the linker will give an error message---incorrect code will not be
10918 generated.
10919
10920 @item -mdebug
10921 @opindex mdebug
10922 Makes the M32R specific code in the compiler display some statistics
10923 that might help in debugging programs.
10924
10925 @item -malign-loops
10926 @opindex malign-loops
10927 Align all loops to a 32-byte boundary.
10928
10929 @item -mno-align-loops
10930 @opindex mno-align-loops
10931 Do not enforce a 32-byte alignment for loops.  This is the default.
10932
10933 @item -missue-rate=@var{number}
10934 @opindex missue-rate=@var{number}
10935 Issue @var{number} instructions per cycle.  @var{number} can only be 1
10936 or 2.
10937
10938 @item -mbranch-cost=@var{number}
10939 @opindex mbranch-cost=@var{number}
10940 @var{number} can only be 1 or 2.  If it is 1 then branches will be
10941 preferred over conditional code, if it is 2, then the opposite will
10942 apply.
10943
10944 @item -mflush-trap=@var{number}
10945 @opindex mflush-trap=@var{number}
10946 Specifies the trap number to use to flush the cache.  The default is
10947 12.  Valid numbers are between 0 and 15 inclusive.
10948
10949 @item -mno-flush-trap
10950 @opindex mno-flush-trap
10951 Specifies that the cache cannot be flushed by using a trap.
10952
10953 @item -mflush-func=@var{name}
10954 @opindex mflush-func=@var{name}
10955 Specifies the name of the operating system function to call to flush
10956 the cache.  The default is @emph{_flush_cache}, but a function call
10957 will only be used if a trap is not available.
10958
10959 @item -mno-flush-func
10960 @opindex mno-flush-func
10961 Indicates that there is no OS function for flushing the cache.
10962
10963 @end table
10964
10965 @node M680x0 Options
10966 @subsection M680x0 Options
10967 @cindex M680x0 options
10968
10969 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
10970 The default settings depend on which architecture was selected when
10971 the compiler was configured; the defaults for the most common choices
10972 are given below.
10973
10974 @table @gcctabopt
10975 @item -march=@var{arch}
10976 @opindex march
10977 Generate code for a specific M680x0 or ColdFire instruction set
10978 architecture.  Permissible values of @var{arch} for M680x0
10979 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
10980 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
10981 architectures are selected according to Freescale's ISA classification
10982 and the permissible values are: @samp{isaa}, @samp{isaaplus},
10983 @samp{isab} and @samp{isac}.
10984
10985 gcc defines a macro @samp{__mcf@var{arch}__} whenever it is generating
10986 code for a ColdFire target.  The @var{arch} in this macro is one of the
10987 @option{-march} arguments given above.
10988
10989 When used together, @option{-march} and @option{-mtune} select code
10990 that runs on a family of similar processors but that is optimized
10991 for a particular microarchitecture.
10992
10993 @item -mcpu=@var{cpu}
10994 @opindex mcpu
10995 Generate code for a specific M680x0 or ColdFire processor.
10996 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
10997 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
10998 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
10999 below, which also classifies the CPUs into families:
11000
11001 @multitable @columnfractions 0.20 0.80
11002 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
11003 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
11004 @item @samp{5206e} @tab @samp{5206e}
11005 @item @samp{5208} @tab @samp{5207} @samp{5208}
11006 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
11007 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
11008 @item @samp{5216} @tab @samp{5214} @samp{5216}
11009 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
11010 @item @samp{5225} @tab @samp{5224} @samp{5225}
11011 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
11012 @item @samp{5249} @tab @samp{5249}
11013 @item @samp{5250} @tab @samp{5250}
11014 @item @samp{5271} @tab @samp{5270} @samp{5271}
11015 @item @samp{5272} @tab @samp{5272}
11016 @item @samp{5275} @tab @samp{5274} @samp{5275}
11017 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
11018 @item @samp{5307} @tab @samp{5307}
11019 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
11020 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
11021 @item @samp{5407} @tab @samp{5407}
11022 @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}
11023 @end multitable
11024
11025 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
11026 @var{arch} is compatible with @var{cpu}.  Other combinations of
11027 @option{-mcpu} and @option{-march} are rejected.
11028
11029 gcc defines the macro @samp{__mcf_cpu_@var{cpu}} when ColdFire target
11030 @var{cpu} is selected.  It also defines @samp{__mcf_family_@var{family}},
11031 where the value of @var{family} is given by the table above.
11032
11033 @item -mtune=@var{tune}
11034 @opindex mtune
11035 Tune the code for a particular microarchitecture, within the
11036 constraints set by @option{-march} and @option{-mcpu}.
11037 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
11038 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
11039 and @samp{cpu32}.  The ColdFire microarchitectures
11040 are: @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
11041
11042 You can also use @option{-mtune=68020-40} for code that needs
11043 to run relatively well on 68020, 68030 and 68040 targets.
11044 @option{-mtune=68020-60} is similar but includes 68060 targets
11045 as well.  These two options select the same tuning decisions as
11046 @option{-m68020-40} and @option{-m68020-60} respectively.
11047
11048 gcc defines the macros @samp{__mc@var{arch}} and @samp{__mc@var{arch}__}
11049 when tuning for 680x0 architecture @var{arch}.  It also defines
11050 @samp{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
11051 option is used.  If gcc is tuning for a range of architectures,
11052 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
11053 it defines the macros for every architecture in the range.
11054
11055 gcc also defines the macro @samp{__m@var{uarch}__} when tuning for
11056 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
11057 of the arguments given above.
11058
11059 @item -m68000
11060 @itemx -mc68000
11061 @opindex m68000
11062 @opindex mc68000
11063 Generate output for a 68000.  This is the default
11064 when the compiler is configured for 68000-based systems.
11065 It is equivalent to @option{-march=68000}.
11066
11067 Use this option for microcontrollers with a 68000 or EC000 core,
11068 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
11069
11070 @item -m68010
11071 @opindex m68010
11072 Generate output for a 68010.  This is the default
11073 when the compiler is configured for 68010-based systems.
11074 It is equivalent to @option{-march=68010}.
11075
11076 @item -m68020
11077 @itemx -mc68020
11078 @opindex m68020
11079 @opindex mc68020
11080 Generate output for a 68020.  This is the default
11081 when the compiler is configured for 68020-based systems.
11082 It is equivalent to @option{-march=68020}.
11083
11084 @item -m68030
11085 @opindex m68030
11086 Generate output for a 68030.  This is the default when the compiler is
11087 configured for 68030-based systems.  It is equivalent to
11088 @option{-march=68030}.
11089
11090 @item -m68040
11091 @opindex m68040
11092 Generate output for a 68040.  This is the default when the compiler is
11093 configured for 68040-based systems.  It is equivalent to
11094 @option{-march=68040}.
11095
11096 This option inhibits the use of 68881/68882 instructions that have to be
11097 emulated by software on the 68040.  Use this option if your 68040 does not
11098 have code to emulate those instructions.
11099
11100 @item -m68060
11101 @opindex m68060
11102 Generate output for a 68060.  This is the default when the compiler is
11103 configured for 68060-based systems.  It is equivalent to
11104 @option{-march=68060}.
11105
11106 This option inhibits the use of 68020 and 68881/68882 instructions that
11107 have to be emulated by software on the 68060.  Use this option if your 68060
11108 does not have code to emulate those instructions.
11109
11110 @item -mcpu32
11111 @opindex mcpu32
11112 Generate output for a CPU32.  This is the default
11113 when the compiler is configured for CPU32-based systems.
11114 It is equivalent to @option{-march=cpu32}.
11115
11116 Use this option for microcontrollers with a
11117 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
11118 68336, 68340, 68341, 68349 and 68360.
11119
11120 @item -m5200
11121 @opindex m5200
11122 Generate output for a 520X ColdFire CPU.  This is the default
11123 when the compiler is configured for 520X-based systems.
11124 It is equivalent to @option{-mcpu=5206}, and is now deprecated
11125 in favor of that option.
11126
11127 Use this option for microcontroller with a 5200 core, including
11128 the MCF5202, MCF5203, MCF5204 and MCF5206.
11129
11130 @item -m5206e
11131 @opindex m5206e
11132 Generate output for a 5206e ColdFire CPU.  The option is now
11133 deprecated in favor of the equivalent @option{-mcpu=5206e}.
11134
11135 @item -m528x
11136 @opindex m528x
11137 Generate output for a member of the ColdFire 528X family.
11138 The option is now deprecated in favor of the equivalent
11139 @option{-mcpu=528x}.
11140
11141 @item -m5307
11142 @opindex m5307
11143 Generate output for a ColdFire 5307 CPU.  The option is now deprecated
11144 in favor of the equivalent @option{-mcpu=5307}.
11145
11146 @item -m5407
11147 @opindex m5407
11148 Generate output for a ColdFire 5407 CPU.  The option is now deprecated
11149 in favor of the equivalent @option{-mcpu=5407}.
11150
11151 @item -mcfv4e
11152 @opindex mcfv4e
11153 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
11154 This includes use of hardware floating point instructions.
11155 The option is equivalent to @option{-mcpu=547x}, and is now
11156 deprecated in favor of that option.
11157
11158 @item -m68020-40
11159 @opindex m68020-40
11160 Generate output for a 68040, without using any of the new instructions.
11161 This results in code which can run relatively efficiently on either a
11162 68020/68881 or a 68030 or a 68040.  The generated code does use the
11163 68881 instructions that are emulated on the 68040.
11164
11165 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
11166
11167 @item -m68020-60
11168 @opindex m68020-60
11169 Generate output for a 68060, without using any of the new instructions.
11170 This results in code which can run relatively efficiently on either a
11171 68020/68881 or a 68030 or a 68040.  The generated code does use the
11172 68881 instructions that are emulated on the 68060.
11173
11174 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
11175
11176 @item -mhard-float
11177 @itemx -m68881
11178 @opindex mhard-float
11179 @opindex m68881
11180 Generate floating-point instructions.  This is the default for 68020
11181 and above, and for ColdFire devices that have an FPU.  It defines the
11182 macro @samp{__HAVE_68881__} on M680x0 targets and @samp{__mcffpu__}
11183 on ColdFire targets.
11184
11185 @item -msoft-float
11186 @opindex msoft-float
11187 Do not generate floating-point instructions; use library calls instead.
11188 This is the default for 68000, 68010, and 68832 targets.  It is also
11189 the default for ColdFire devices that have no FPU.
11190
11191 @item -mdiv
11192 @itemx -mno-div
11193 @opindex mdiv
11194 @opindex mno-div
11195 Generate (do not generate) ColdFire hardware divide and remainder
11196 instructions.  If @option{-march} is used without @option{-mcpu},
11197 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
11198 architectures.  Otherwise, the default is taken from the target CPU
11199 (either the default CPU, or the one specified by @option{-mcpu}).  For
11200 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
11201 @option{-mcpu=5206e}.
11202
11203 gcc defines the macro @samp{__mcfhwdiv__} when this option is enabled.
11204
11205 @item -mshort
11206 @opindex mshort
11207 Consider type @code{int} to be 16 bits wide, like @code{short int}.
11208 Additionally, parameters passed on the stack are also aligned to a
11209 16-bit boundary even on targets whose API mandates promotion to 32-bit.
11210
11211 @item -mno-short
11212 @opindex mno-short
11213 Do not consider type @code{int} to be 16 bits wide.  This is the default.
11214
11215 @item -mnobitfield
11216 @itemx -mno-bitfield
11217 @opindex mnobitfield
11218 @opindex mno-bitfield
11219 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
11220 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
11221
11222 @item -mbitfield
11223 @opindex mbitfield
11224 Do use the bit-field instructions.  The @option{-m68020} option implies
11225 @option{-mbitfield}.  This is the default if you use a configuration
11226 designed for a 68020.
11227
11228 @item -mrtd
11229 @opindex mrtd
11230 Use a different function-calling convention, in which functions
11231 that take a fixed number of arguments return with the @code{rtd}
11232 instruction, which pops their arguments while returning.  This
11233 saves one instruction in the caller since there is no need to pop
11234 the arguments there.
11235
11236 This calling convention is incompatible with the one normally
11237 used on Unix, so you cannot use it if you need to call libraries
11238 compiled with the Unix compiler.
11239
11240 Also, you must provide function prototypes for all functions that
11241 take variable numbers of arguments (including @code{printf});
11242 otherwise incorrect code will be generated for calls to those
11243 functions.
11244
11245 In addition, seriously incorrect code will result if you call a
11246 function with too many arguments.  (Normally, extra arguments are
11247 harmlessly ignored.)
11248
11249 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
11250 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
11251
11252 @item -mno-rtd
11253 @opindex mno-rtd
11254 Do not use the calling conventions selected by @option{-mrtd}.
11255 This is the default.
11256
11257 @item -malign-int
11258 @itemx -mno-align-int
11259 @opindex malign-int
11260 @opindex mno-align-int
11261 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
11262 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
11263 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
11264 Aligning variables on 32-bit boundaries produces code that runs somewhat
11265 faster on processors with 32-bit busses at the expense of more memory.
11266
11267 @strong{Warning:} if you use the @option{-malign-int} switch, GCC will
11268 align structures containing the above types  differently than
11269 most published application binary interface specifications for the m68k.
11270
11271 @item -mpcrel
11272 @opindex mpcrel
11273 Use the pc-relative addressing mode of the 68000 directly, instead of
11274 using a global offset table.  At present, this option implies @option{-fpic},
11275 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
11276 not presently supported with @option{-mpcrel}, though this could be supported for
11277 68020 and higher processors.
11278
11279 @item -mno-strict-align
11280 @itemx -mstrict-align
11281 @opindex mno-strict-align
11282 @opindex mstrict-align
11283 Do not (do) assume that unaligned memory references will be handled by
11284 the system.
11285
11286 @item -msep-data
11287 Generate code that allows the data segment to be located in a different
11288 area of memory from the text segment.  This allows for execute in place in
11289 an environment without virtual memory management.  This option implies
11290 @option{-fPIC}.
11291
11292 @item -mno-sep-data
11293 Generate code that assumes that the data segment follows the text segment.
11294 This is the default.
11295
11296 @item -mid-shared-library
11297 Generate code that supports shared libraries via the library ID method.
11298 This allows for execute in place and shared libraries in an environment
11299 without virtual memory management.  This option implies @option{-fPIC}.
11300
11301 @item -mno-id-shared-library
11302 Generate code that doesn't assume ID based shared libraries are being used.
11303 This is the default.
11304
11305 @item -mshared-library-id=n
11306 Specified the identification number of the ID based shared library being
11307 compiled.  Specifying a value of 0 will generate more compact code, specifying
11308 other values will force the allocation of that number to the current
11309 library but is no more space or time efficient than omitting this option.
11310
11311 @end table
11312
11313 @node M68hc1x Options
11314 @subsection M68hc1x Options
11315 @cindex M68hc1x options
11316
11317 These are the @samp{-m} options defined for the 68hc11 and 68hc12
11318 microcontrollers.  The default values for these options depends on
11319 which style of microcontroller was selected when the compiler was configured;
11320 the defaults for the most common choices are given below.
11321
11322 @table @gcctabopt
11323 @item -m6811
11324 @itemx -m68hc11
11325 @opindex m6811
11326 @opindex m68hc11
11327 Generate output for a 68HC11.  This is the default
11328 when the compiler is configured for 68HC11-based systems.
11329
11330 @item -m6812
11331 @itemx -m68hc12
11332 @opindex m6812
11333 @opindex m68hc12
11334 Generate output for a 68HC12.  This is the default
11335 when the compiler is configured for 68HC12-based systems.
11336
11337 @item -m68S12
11338 @itemx -m68hcs12
11339 @opindex m68S12
11340 @opindex m68hcs12
11341 Generate output for a 68HCS12.
11342
11343 @item -mauto-incdec
11344 @opindex mauto-incdec
11345 Enable the use of 68HC12 pre and post auto-increment and auto-decrement
11346 addressing modes.
11347
11348 @item -minmax
11349 @itemx -nominmax
11350 @opindex minmax
11351 @opindex mnominmax
11352 Enable the use of 68HC12 min and max instructions.
11353
11354 @item -mlong-calls
11355 @itemx -mno-long-calls
11356 @opindex mlong-calls
11357 @opindex mno-long-calls
11358 Treat all calls as being far away (near).  If calls are assumed to be
11359 far away, the compiler will use the @code{call} instruction to
11360 call a function and the @code{rtc} instruction for returning.
11361
11362 @item -mshort
11363 @opindex mshort
11364 Consider type @code{int} to be 16 bits wide, like @code{short int}.
11365
11366 @item -msoft-reg-count=@var{count}
11367 @opindex msoft-reg-count
11368 Specify the number of pseudo-soft registers which are used for the
11369 code generation.  The maximum number is 32.  Using more pseudo-soft
11370 register may or may not result in better code depending on the program.
11371 The default is 4 for 68HC11 and 2 for 68HC12.
11372
11373 @end table
11374
11375 @node MCore Options
11376 @subsection MCore Options
11377 @cindex MCore options
11378
11379 These are the @samp{-m} options defined for the Motorola M*Core
11380 processors.
11381
11382 @table @gcctabopt
11383
11384 @item -mhardlit
11385 @itemx -mno-hardlit
11386 @opindex mhardlit
11387 @opindex mno-hardlit
11388 Inline constants into the code stream if it can be done in two
11389 instructions or less.
11390
11391 @item -mdiv
11392 @itemx -mno-div
11393 @opindex mdiv
11394 @opindex mno-div
11395 Use the divide instruction.  (Enabled by default).
11396
11397 @item -mrelax-immediate
11398 @itemx -mno-relax-immediate
11399 @opindex mrelax-immediate
11400 @opindex mno-relax-immediate
11401 Allow arbitrary sized immediates in bit operations.
11402
11403 @item -mwide-bitfields
11404 @itemx -mno-wide-bitfields
11405 @opindex mwide-bitfields
11406 @opindex mno-wide-bitfields
11407 Always treat bit-fields as int-sized.
11408
11409 @item -m4byte-functions
11410 @itemx -mno-4byte-functions
11411 @opindex m4byte-functions
11412 @opindex mno-4byte-functions
11413 Force all functions to be aligned to a four byte boundary.
11414
11415 @item -mcallgraph-data
11416 @itemx -mno-callgraph-data
11417 @opindex mcallgraph-data
11418 @opindex mno-callgraph-data
11419 Emit callgraph information.
11420
11421 @item -mslow-bytes
11422 @itemx -mno-slow-bytes
11423 @opindex mslow-bytes
11424 @opindex mno-slow-bytes
11425 Prefer word access when reading byte quantities.
11426
11427 @item -mlittle-endian
11428 @itemx -mbig-endian
11429 @opindex mlittle-endian
11430 @opindex mbig-endian
11431 Generate code for a little endian target.
11432
11433 @item -m210
11434 @itemx -m340
11435 @opindex m210
11436 @opindex m340
11437 Generate code for the 210 processor.
11438 @end table
11439
11440 @node MIPS Options
11441 @subsection MIPS Options
11442 @cindex MIPS options
11443
11444 @table @gcctabopt
11445
11446 @item -EB
11447 @opindex EB
11448 Generate big-endian code.
11449
11450 @item -EL
11451 @opindex EL
11452 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
11453 configurations.
11454
11455 @item -march=@var{arch}
11456 @opindex march
11457 Generate code that will run on @var{arch}, which can be the name of a
11458 generic MIPS ISA, or the name of a particular processor.
11459 The ISA names are:
11460 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
11461 @samp{mips32}, @samp{mips32r2}, and @samp{mips64}.
11462 The processor names are:
11463 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
11464 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
11465 @samp{5kc}, @samp{5kf},
11466 @samp{20kc},
11467 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
11468 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
11469 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1},
11470 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
11471 @samp{m4k},
11472 @samp{orion},
11473 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
11474 @samp{r4600}, @samp{r4650}, @samp{r6000}, @samp{r8000},
11475 @samp{rm7000}, @samp{rm9000},
11476 @samp{sb1},
11477 @samp{sr71000},
11478 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
11479 @samp{vr5000}, @samp{vr5400} and @samp{vr5500}.
11480 The special value @samp{from-abi} selects the
11481 most compatible architecture for the selected ABI (that is,
11482 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
11483
11484 In processor names, a final @samp{000} can be abbreviated as @samp{k}
11485 (for example, @samp{-march=r2k}).  Prefixes are optional, and
11486 @samp{vr} may be written @samp{r}.
11487
11488 Names of the form @samp{@var{n}f2_1} refer to processors with
11489 FPUs clocked at half the rate of the core, names of the form
11490 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
11491 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
11492 processors with FPUs clocked a ratio of 3:2 with respect to the core.
11493 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
11494 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
11495 accepted as synonyms for @samp{@var{n}f1_1}.
11496
11497 GCC defines two macros based on the value of this option.  The first
11498 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
11499 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
11500 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
11501 For example, @samp{-march=r2000} will set @samp{_MIPS_ARCH}
11502 to @samp{"r2000"} and define the macro @samp{_MIPS_ARCH_R2000}.
11503
11504 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
11505 above.  In other words, it will have the full prefix and will not
11506 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
11507 the macro names the resolved architecture (either @samp{"mips1"} or
11508 @samp{"mips3"}).  It names the default architecture when no
11509 @option{-march} option is given.
11510
11511 @item -mtune=@var{arch}
11512 @opindex mtune
11513 Optimize for @var{arch}.  Among other things, this option controls
11514 the way instructions are scheduled, and the perceived cost of arithmetic
11515 operations.  The list of @var{arch} values is the same as for
11516 @option{-march}.
11517
11518 When this option is not used, GCC will optimize for the processor
11519 specified by @option{-march}.  By using @option{-march} and
11520 @option{-mtune} together, it is possible to generate code that will
11521 run on a family of processors, but optimize the code for one
11522 particular member of that family.
11523
11524 @samp{-mtune} defines the macros @samp{_MIPS_TUNE} and
11525 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
11526 @samp{-march} ones described above.
11527
11528 @item -mips1
11529 @opindex mips1
11530 Equivalent to @samp{-march=mips1}.
11531
11532 @item -mips2
11533 @opindex mips2
11534 Equivalent to @samp{-march=mips2}.
11535
11536 @item -mips3
11537 @opindex mips3
11538 Equivalent to @samp{-march=mips3}.
11539
11540 @item -mips4
11541 @opindex mips4
11542 Equivalent to @samp{-march=mips4}.
11543
11544 @item -mips32
11545 @opindex mips32
11546 Equivalent to @samp{-march=mips32}.
11547
11548 @item -mips32r2
11549 @opindex mips32r2
11550 Equivalent to @samp{-march=mips32r2}.
11551
11552 @item -mips64
11553 @opindex mips64
11554 Equivalent to @samp{-march=mips64}.
11555
11556 @item -mips16
11557 @itemx -mno-mips16
11558 @opindex mips16
11559 @opindex mno-mips16
11560 Generate (do not generate) MIPS16 code.  If GCC is targetting a
11561 MIPS32 or MIPS64 architecture, it will make use of the MIPS16e ASE@.
11562
11563 @item -mabi=32
11564 @itemx -mabi=o64
11565 @itemx -mabi=n32
11566 @itemx -mabi=64
11567 @itemx -mabi=eabi
11568 @opindex mabi=32
11569 @opindex mabi=o64
11570 @opindex mabi=n32
11571 @opindex mabi=64
11572 @opindex mabi=eabi
11573 Generate code for the given ABI@.
11574
11575 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
11576 generates 64-bit code when you select a 64-bit architecture, but you
11577 can use @option{-mgp32} to get 32-bit code instead.
11578
11579 For information about the O64 ABI, see
11580 @w{@uref{http://gcc.gnu.org/projects/mipso64-abi.html}}.
11581
11582 GCC supports a variant of the o32 ABI in which floating-point registers
11583 are 64 rather than 32 bits wide.  You can select this combination with
11584 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @samp{mthc1}
11585 and @samp{mfhc1} instructions and is therefore only supported for
11586 MIPS32R2 processors.
11587
11588 The register assignments for arguments and return values remain the
11589 same, but each scalar value is passed in a single 64-bit register
11590 rather than a pair of 32-bit registers.  For example, scalar
11591 floating-point values are returned in @samp{$f0} only, not a
11592 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
11593 remains the same, but all 64 bits are saved.
11594
11595 @item -mabicalls
11596 @itemx -mno-abicalls
11597 @opindex mabicalls
11598 @opindex mno-abicalls
11599 Generate (do not generate) code that is suitable for SVR4-style
11600 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
11601 systems.
11602
11603 @item -mshared
11604 @itemx -mno-shared
11605 Generate (do not generate) code that is fully position-independent,
11606 and that can therefore be linked into shared libraries.  This option
11607 only affects @option{-mabicalls}.
11608
11609 All @option{-mabicalls} code has traditionally been position-independent,
11610 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
11611 as an extension, the GNU toolchain allows executables to use absolute
11612 accesses for locally-binding symbols.  It can also use shorter GP
11613 initialization sequences and generate direct calls to locally-defined
11614 functions.  This mode is selected by @option{-mno-shared}.
11615
11616 @option{-mno-shared} depends on binutils 2.16 or higher and generates
11617 objects that can only be linked by the GNU linker.  However, the option
11618 does not affect the ABI of the final executable; it only affects the ABI
11619 of relocatable objects.  Using @option{-mno-shared} will generally make
11620 executables both smaller and quicker.
11621
11622 @option{-mshared} is the default.
11623
11624 @item -mxgot
11625 @itemx -mno-xgot
11626 @opindex mxgot
11627 @opindex mno-xgot
11628 Lift (do not lift) the usual restrictions on the size of the global
11629 offset table.
11630
11631 GCC normally uses a single instruction to load values from the GOT@.
11632 While this is relatively efficient, it will only work if the GOT
11633 is smaller than about 64k.  Anything larger will cause the linker
11634 to report an error such as:
11635
11636 @cindex relocation truncated to fit (MIPS)
11637 @smallexample
11638 relocation truncated to fit: R_MIPS_GOT16 foobar
11639 @end smallexample
11640
11641 If this happens, you should recompile your code with @option{-mxgot}.
11642 It should then work with very large GOTs, although it will also be
11643 less efficient, since it will take three instructions to fetch the
11644 value of a global symbol.
11645
11646 Note that some linkers can create multiple GOTs.  If you have such a
11647 linker, you should only need to use @option{-mxgot} when a single object
11648 file accesses more than 64k's worth of GOT entries.  Very few do.
11649
11650 These options have no effect unless GCC is generating position
11651 independent code.
11652
11653 @item -mgp32
11654 @opindex mgp32
11655 Assume that general-purpose registers are 32 bits wide.
11656
11657 @item -mgp64
11658 @opindex mgp64
11659 Assume that general-purpose registers are 64 bits wide.
11660
11661 @item -mfp32
11662 @opindex mfp32
11663 Assume that floating-point registers are 32 bits wide.
11664
11665 @item -mfp64
11666 @opindex mfp64
11667 Assume that floating-point registers are 64 bits wide.
11668
11669 @item -mhard-float
11670 @opindex mhard-float
11671 Use floating-point coprocessor instructions.
11672
11673 @item -msoft-float
11674 @opindex msoft-float
11675 Do not use floating-point coprocessor instructions.  Implement
11676 floating-point calculations using library calls instead.
11677
11678 @item -msingle-float
11679 @opindex msingle-float
11680 Assume that the floating-point coprocessor only supports single-precision
11681 operations.
11682
11683 @item -mdouble-float
11684 @opindex mdouble-float
11685 Assume that the floating-point coprocessor supports double-precision
11686 operations.  This is the default.
11687
11688 @item -mdsp
11689 @itemx -mno-dsp
11690 @opindex mdsp
11691 @opindex mno-dsp
11692 Use (do not use) revision 1 of the MIPS DSP ASE.
11693 @xref{MIPS DSP Built-in Functions}.  This option defines the
11694 preprocessor macro @samp{__mips_dsp}.  It also defines
11695 @samp{__mips_dsp_rev} to 1.
11696
11697 @item -mdspr2
11698 @itemx -mno-dspr2
11699 @opindex mdspr2
11700 @opindex mno-dspr2
11701 Use (do not use) revision 2 of the MIPS DSP ASE.
11702 @xref{MIPS DSP Built-in Functions}.  This option defines the
11703 preprocessor macros @samp{__mips_dsp} and @samp{__mips_dspr2}.
11704 It also defines @samp{__mips_dsp_rev} to 2.
11705
11706 @item -msmartmips
11707 @itemx -mno-smartmips
11708 @opindex msmartmips
11709 @opindex mno-smartmips
11710 Use (do not use) the MIPS SmartMIPS ASE.
11711
11712 @item -mpaired-single
11713 @itemx -mno-paired-single
11714 @opindex mpaired-single
11715 @opindex mno-paired-single
11716 Use (do not use) paired-single floating-point instructions.
11717 @xref{MIPS Paired-Single Support}.  This option can only be used
11718 when generating 64-bit code and requires hardware floating-point
11719 support to be enabled.
11720
11721 @item -mdmx
11722 @itemx -mno-mdmx
11723 @opindex mdmx
11724 @opindex mno-mdmx
11725 Use (do not use) MIPS Digital Media Extension instructions.
11726 This option can only be used when generating 64-bit code and requires
11727 hardware floating-point support to be enabled.
11728
11729 @item -mips3d
11730 @itemx -mno-mips3d
11731 @opindex mips3d
11732 @opindex mno-mips3d
11733 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
11734 The option @option{-mips3d} implies @option{-mpaired-single}.
11735
11736 @item -mmt
11737 @itemx -mno-mt
11738 @opindex mmt
11739 @opindex mno-mt
11740 Use (do not use) MT Multithreading instructions.
11741
11742 @item -mlong64
11743 @opindex mlong64
11744 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
11745 an explanation of the default and the way that the pointer size is
11746 determined.
11747
11748 @item -mlong32
11749 @opindex mlong32
11750 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
11751
11752 The default size of @code{int}s, @code{long}s and pointers depends on
11753 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
11754 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
11755 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
11756 or the same size as integer registers, whichever is smaller.
11757
11758 @item -msym32
11759 @itemx -mno-sym32
11760 @opindex msym32
11761 @opindex mno-sym32
11762 Assume (do not assume) that all symbols have 32-bit values, regardless
11763 of the selected ABI@.  This option is useful in combination with
11764 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
11765 to generate shorter and faster references to symbolic addresses.
11766
11767 @item -G @var{num}
11768 @opindex G
11769 @cindex smaller data references (MIPS)
11770 @cindex gp-relative references (MIPS)
11771 Put global and static items less than or equal to @var{num} bytes into
11772 the small data or bss section instead of the normal data or bss section.
11773 This allows the data to be accessed using a single instruction.
11774
11775 All modules should be compiled with the same @option{-G @var{num}}
11776 value.
11777
11778 @item -membedded-data
11779 @itemx -mno-embedded-data
11780 @opindex membedded-data
11781 @opindex mno-embedded-data
11782 Allocate variables to the read-only data section first if possible, then
11783 next in the small data section if possible, otherwise in data.  This gives
11784 slightly slower code than the default, but reduces the amount of RAM required
11785 when executing, and thus may be preferred for some embedded systems.
11786
11787 @item -muninit-const-in-rodata
11788 @itemx -mno-uninit-const-in-rodata
11789 @opindex muninit-const-in-rodata
11790 @opindex mno-uninit-const-in-rodata
11791 Put uninitialized @code{const} variables in the read-only data section.
11792 This option is only meaningful in conjunction with @option{-membedded-data}.
11793
11794 @item -mcode-readable=@var{setting}
11795 @opindex mcode-readable
11796 Specify whether GCC may generate code that reads from executable sections.
11797 There are three possible settings:
11798
11799 @table @gcctabopt
11800 @item -mcode-readable=yes
11801 Instructions may freely access executable sections.  This is the
11802 default setting.
11803
11804 @item -mcode-readable=pcrel
11805 MIPS16 PC-relative load instructions can access executable sections,
11806 but other instructions must not do so.  This option is useful on 4KSc
11807 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
11808 It is also useful on processors that can be configured to have a dual
11809 instruction/data SRAM interface and that, like the M4K, automatically
11810 redirect PC-relative loads to the instruction RAM.
11811
11812 @item -mcode-readable=no
11813 Instructions must not access executable sections.  This option can be
11814 useful on targets that are configured to have a dual instruction/data
11815 SRAM interface but that (unlike the M4K) do not automatically redirect
11816 PC-relative loads to the instruction RAM.
11817 @end table
11818
11819 @item -msplit-addresses
11820 @itemx -mno-split-addresses
11821 @opindex msplit-addresses
11822 @opindex mno-split-addresses
11823 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
11824 relocation operators.  This option has been superseded by
11825 @option{-mexplicit-relocs} but is retained for backwards compatibility.
11826
11827 @item -mexplicit-relocs
11828 @itemx -mno-explicit-relocs
11829 @opindex mexplicit-relocs
11830 @opindex mno-explicit-relocs
11831 Use (do not use) assembler relocation operators when dealing with symbolic
11832 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
11833 is to use assembler macros instead.
11834
11835 @option{-mexplicit-relocs} is the default if GCC was configured
11836 to use an assembler that supports relocation operators.
11837
11838 @item -mcheck-zero-division
11839 @itemx -mno-check-zero-division
11840 @opindex mcheck-zero-division
11841 @opindex mno-check-zero-division
11842 Trap (do not trap) on integer division by zero.
11843
11844 The default is @option{-mcheck-zero-division}.
11845
11846 @item -mdivide-traps
11847 @itemx -mdivide-breaks
11848 @opindex mdivide-traps
11849 @opindex mdivide-breaks
11850 MIPS systems check for division by zero by generating either a
11851 conditional trap or a break instruction.  Using traps results in
11852 smaller code, but is only supported on MIPS II and later.  Also, some
11853 versions of the Linux kernel have a bug that prevents trap from
11854 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
11855 allow conditional traps on architectures that support them and
11856 @option{-mdivide-breaks} to force the use of breaks.
11857
11858 The default is usually @option{-mdivide-traps}, but this can be
11859 overridden at configure time using @option{--with-divide=breaks}.
11860 Divide-by-zero checks can be completely disabled using
11861 @option{-mno-check-zero-division}.
11862
11863 @item -mmemcpy
11864 @itemx -mno-memcpy
11865 @opindex mmemcpy
11866 @opindex mno-memcpy
11867 Force (do not force) the use of @code{memcpy()} for non-trivial block
11868 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
11869 most constant-sized copies.
11870
11871 @item -mlong-calls
11872 @itemx -mno-long-calls
11873 @opindex mlong-calls
11874 @opindex mno-long-calls
11875 Disable (do not disable) use of the @code{jal} instruction.  Calling
11876 functions using @code{jal} is more efficient but requires the caller
11877 and callee to be in the same 256 megabyte segment.
11878
11879 This option has no effect on abicalls code.  The default is
11880 @option{-mno-long-calls}.
11881
11882 @item -mmad
11883 @itemx -mno-mad
11884 @opindex mmad
11885 @opindex mno-mad
11886 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
11887 instructions, as provided by the R4650 ISA@.
11888
11889 @item -mfused-madd
11890 @itemx -mno-fused-madd
11891 @opindex mfused-madd
11892 @opindex mno-fused-madd
11893 Enable (disable) use of the floating point multiply-accumulate
11894 instructions, when they are available.  The default is
11895 @option{-mfused-madd}.
11896
11897 When multiply-accumulate instructions are used, the intermediate
11898 product is calculated to infinite precision and is not subject to
11899 the FCSR Flush to Zero bit.  This may be undesirable in some
11900 circumstances.
11901
11902 @item -nocpp
11903 @opindex nocpp
11904 Tell the MIPS assembler to not run its preprocessor over user
11905 assembler files (with a @samp{.s} suffix) when assembling them.
11906
11907 @item -mfix-r4000
11908 @itemx -mno-fix-r4000
11909 @opindex mfix-r4000
11910 @opindex mno-fix-r4000
11911 Work around certain R4000 CPU errata:
11912 @itemize @minus
11913 @item
11914 A double-word or a variable shift may give an incorrect result if executed
11915 immediately after starting an integer division.
11916 @item
11917 A double-word or a variable shift may give an incorrect result if executed
11918 while an integer multiplication is in progress.
11919 @item
11920 An integer division may give an incorrect result if started in a delay slot
11921 of a taken branch or a jump.
11922 @end itemize
11923
11924 @item -mfix-r4400
11925 @itemx -mno-fix-r4400
11926 @opindex mfix-r4400
11927 @opindex mno-fix-r4400
11928 Work around certain R4400 CPU errata:
11929 @itemize @minus
11930 @item
11931 A double-word or a variable shift may give an incorrect result if executed
11932 immediately after starting an integer division.
11933 @end itemize
11934
11935 @item -mfix-vr4120
11936 @itemx -mno-fix-vr4120
11937 @opindex mfix-vr4120
11938 Work around certain VR4120 errata:
11939 @itemize @minus
11940 @item
11941 @code{dmultu} does not always produce the correct result.
11942 @item
11943 @code{div} and @code{ddiv} do not always produce the correct result if one
11944 of the operands is negative.
11945 @end itemize
11946 The workarounds for the division errata rely on special functions in
11947 @file{libgcc.a}.  At present, these functions are only provided by
11948 the @code{mips64vr*-elf} configurations.
11949
11950 Other VR4120 errata require a nop to be inserted between certain pairs of
11951 instructions.  These errata are handled by the assembler, not by GCC itself.
11952
11953 @item -mfix-vr4130
11954 @opindex mfix-vr4130
11955 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
11956 workarounds are implemented by the assembler rather than by GCC,
11957 although GCC will avoid using @code{mflo} and @code{mfhi} if the
11958 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
11959 instructions are available instead.
11960
11961 @item -mfix-sb1
11962 @itemx -mno-fix-sb1
11963 @opindex mfix-sb1
11964 Work around certain SB-1 CPU core errata.
11965 (This flag currently works around the SB-1 revision 2
11966 ``F1'' and ``F2'' floating point errata.)
11967
11968 @item -mflush-func=@var{func}
11969 @itemx -mno-flush-func
11970 @opindex mflush-func
11971 Specifies the function to call to flush the I and D caches, or to not
11972 call any such function.  If called, the function must take the same
11973 arguments as the common @code{_flush_func()}, that is, the address of the
11974 memory range for which the cache is being flushed, the size of the
11975 memory range, and the number 3 (to flush both caches).  The default
11976 depends on the target GCC was configured for, but commonly is either
11977 @samp{_flush_func} or @samp{__cpu_flush}.
11978
11979 @item mbranch-cost=@var{num}
11980 @opindex mbranch-cost
11981 Set the cost of branches to roughly @var{num} ``simple'' instructions.
11982 This cost is only a heuristic and is not guaranteed to produce
11983 consistent results across releases.  A zero cost redundantly selects
11984 the default, which is based on the @option{-mtune} setting.
11985
11986 @item -mbranch-likely
11987 @itemx -mno-branch-likely
11988 @opindex mbranch-likely
11989 @opindex mno-branch-likely
11990 Enable or disable use of Branch Likely instructions, regardless of the
11991 default for the selected architecture.  By default, Branch Likely
11992 instructions may be generated if they are supported by the selected
11993 architecture.  An exception is for the MIPS32 and MIPS64 architectures
11994 and processors which implement those architectures; for those, Branch
11995 Likely instructions will not be generated by default because the MIPS32
11996 and MIPS64 architectures specifically deprecate their use.
11997
11998 @item -mfp-exceptions
11999 @itemx -mno-fp-exceptions
12000 @opindex mfp-exceptions
12001 Specifies whether FP exceptions are enabled.  This affects how we schedule
12002 FP instructions for some processors.  The default is that FP exceptions are
12003 enabled.
12004
12005 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
12006 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
12007 FP pipe.
12008
12009 @item -mvr4130-align
12010 @itemx -mno-vr4130-align
12011 @opindex mvr4130-align
12012 The VR4130 pipeline is two-way superscalar, but can only issue two
12013 instructions together if the first one is 8-byte aligned.  When this
12014 option is enabled, GCC will align pairs of instructions that it
12015 thinks should execute in parallel.
12016
12017 This option only has an effect when optimizing for the VR4130.
12018 It normally makes code faster, but at the expense of making it bigger.
12019 It is enabled by default at optimization level @option{-O3}.
12020 @end table
12021
12022 @node MMIX Options
12023 @subsection MMIX Options
12024 @cindex MMIX Options
12025
12026 These options are defined for the MMIX:
12027
12028 @table @gcctabopt
12029 @item -mlibfuncs
12030 @itemx -mno-libfuncs
12031 @opindex mlibfuncs
12032 @opindex mno-libfuncs
12033 Specify that intrinsic library functions are being compiled, passing all
12034 values in registers, no matter the size.
12035
12036 @item -mepsilon
12037 @itemx -mno-epsilon
12038 @opindex mepsilon
12039 @opindex mno-epsilon
12040 Generate floating-point comparison instructions that compare with respect
12041 to the @code{rE} epsilon register.
12042
12043 @item -mabi=mmixware
12044 @itemx -mabi=gnu
12045 @opindex mabi-mmixware
12046 @opindex mabi=gnu
12047 Generate code that passes function parameters and return values that (in
12048 the called function) are seen as registers @code{$0} and up, as opposed to
12049 the GNU ABI which uses global registers @code{$231} and up.
12050
12051 @item -mzero-extend
12052 @itemx -mno-zero-extend
12053 @opindex mzero-extend
12054 @opindex mno-zero-extend
12055 When reading data from memory in sizes shorter than 64 bits, use (do not
12056 use) zero-extending load instructions by default, rather than
12057 sign-extending ones.
12058
12059 @item -mknuthdiv
12060 @itemx -mno-knuthdiv
12061 @opindex mknuthdiv
12062 @opindex mno-knuthdiv
12063 Make the result of a division yielding a remainder have the same sign as
12064 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
12065 remainder follows the sign of the dividend.  Both methods are
12066 arithmetically valid, the latter being almost exclusively used.
12067
12068 @item -mtoplevel-symbols
12069 @itemx -mno-toplevel-symbols
12070 @opindex mtoplevel-symbols
12071 @opindex mno-toplevel-symbols
12072 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
12073 code can be used with the @code{PREFIX} assembly directive.
12074
12075 @item -melf
12076 @opindex melf
12077 Generate an executable in the ELF format, rather than the default
12078 @samp{mmo} format used by the @command{mmix} simulator.
12079
12080 @item -mbranch-predict
12081 @itemx -mno-branch-predict
12082 @opindex mbranch-predict
12083 @opindex mno-branch-predict
12084 Use (do not use) the probable-branch instructions, when static branch
12085 prediction indicates a probable branch.
12086
12087 @item -mbase-addresses
12088 @itemx -mno-base-addresses
12089 @opindex mbase-addresses
12090 @opindex mno-base-addresses
12091 Generate (do not generate) code that uses @emph{base addresses}.  Using a
12092 base address automatically generates a request (handled by the assembler
12093 and the linker) for a constant to be set up in a global register.  The
12094 register is used for one or more base address requests within the range 0
12095 to 255 from the value held in the register.  The generally leads to short
12096 and fast code, but the number of different data items that can be
12097 addressed is limited.  This means that a program that uses lots of static
12098 data may require @option{-mno-base-addresses}.
12099
12100 @item -msingle-exit
12101 @itemx -mno-single-exit
12102 @opindex msingle-exit
12103 @opindex mno-single-exit
12104 Force (do not force) generated code to have a single exit point in each
12105 function.
12106 @end table
12107
12108 @node MN10300 Options
12109 @subsection MN10300 Options
12110 @cindex MN10300 options
12111
12112 These @option{-m} options are defined for Matsushita MN10300 architectures:
12113
12114 @table @gcctabopt
12115 @item -mmult-bug
12116 @opindex mmult-bug
12117 Generate code to avoid bugs in the multiply instructions for the MN10300
12118 processors.  This is the default.
12119
12120 @item -mno-mult-bug
12121 @opindex mno-mult-bug
12122 Do not generate code to avoid bugs in the multiply instructions for the
12123 MN10300 processors.
12124
12125 @item -mam33
12126 @opindex mam33
12127 Generate code which uses features specific to the AM33 processor.
12128
12129 @item -mno-am33
12130 @opindex mno-am33
12131 Do not generate code which uses features specific to the AM33 processor.  This
12132 is the default.
12133
12134 @item -mreturn-pointer-on-d0
12135 @opindex mreturn-pointer-on-d0
12136 When generating a function which returns a pointer, return the pointer
12137 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
12138 only in a0, and attempts to call such functions without a prototype
12139 would result in errors.  Note that this option is on by default; use
12140 @option{-mno-return-pointer-on-d0} to disable it.
12141
12142 @item -mno-crt0
12143 @opindex mno-crt0
12144 Do not link in the C run-time initialization object file.
12145
12146 @item -mrelax
12147 @opindex mrelax
12148 Indicate to the linker that it should perform a relaxation optimization pass
12149 to shorten branches, calls and absolute memory addresses.  This option only
12150 has an effect when used on the command line for the final link step.
12151
12152 This option makes symbolic debugging impossible.
12153 @end table
12154
12155 @node MT Options
12156 @subsection MT Options
12157 @cindex MT options
12158
12159 These @option{-m} options are defined for Morpho MT architectures:
12160
12161 @table @gcctabopt
12162
12163 @item -march=@var{cpu-type}
12164 @opindex march
12165 Generate code that will run on @var{cpu-type}, which is the name of a system
12166 representing a certain processor type.  Possible values for
12167 @var{cpu-type} are @samp{ms1-64-001}, @samp{ms1-16-002},
12168 @samp{ms1-16-003} and @samp{ms2}.
12169
12170 When this option is not used, the default is @option{-march=ms1-16-002}.
12171
12172 @item -mbacc
12173 @opindex mbacc
12174 Use byte loads and stores when generating code.
12175
12176 @item -mno-bacc
12177 @opindex mno-bacc
12178 Do not use byte loads and stores when generating code.
12179
12180 @item -msim
12181 @opindex msim
12182 Use simulator runtime
12183
12184 @item -mno-crt0
12185 @opindex mno-crt0
12186 Do not link in the C run-time initialization object file
12187 @file{crti.o}.  Other run-time initialization and termination files
12188 such as @file{startup.o} and @file{exit.o} are still included on the
12189 linker command line.
12190
12191 @end table
12192
12193 @node PDP-11 Options
12194 @subsection PDP-11 Options
12195 @cindex PDP-11 Options
12196
12197 These options are defined for the PDP-11:
12198
12199 @table @gcctabopt
12200 @item -mfpu
12201 @opindex mfpu
12202 Use hardware FPP floating point.  This is the default.  (FIS floating
12203 point on the PDP-11/40 is not supported.)
12204
12205 @item -msoft-float
12206 @opindex msoft-float
12207 Do not use hardware floating point.
12208
12209 @item -mac0
12210 @opindex mac0
12211 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
12212
12213 @item -mno-ac0
12214 @opindex mno-ac0
12215 Return floating-point results in memory.  This is the default.
12216
12217 @item -m40
12218 @opindex m40
12219 Generate code for a PDP-11/40.
12220
12221 @item -m45
12222 @opindex m45
12223 Generate code for a PDP-11/45.  This is the default.
12224
12225 @item -m10
12226 @opindex m10
12227 Generate code for a PDP-11/10.
12228
12229 @item -mbcopy-builtin
12230 @opindex bcopy-builtin
12231 Use inline @code{movmemhi} patterns for copying memory.  This is the
12232 default.
12233
12234 @item -mbcopy
12235 @opindex mbcopy
12236 Do not use inline @code{movmemhi} patterns for copying memory.
12237
12238 @item -mint16
12239 @itemx -mno-int32
12240 @opindex mint16
12241 @opindex mno-int32
12242 Use 16-bit @code{int}.  This is the default.
12243
12244 @item -mint32
12245 @itemx -mno-int16
12246 @opindex mint32
12247 @opindex mno-int16
12248 Use 32-bit @code{int}.
12249
12250 @item -mfloat64
12251 @itemx -mno-float32
12252 @opindex mfloat64
12253 @opindex mno-float32
12254 Use 64-bit @code{float}.  This is the default.
12255
12256 @item -mfloat32
12257 @itemx -mno-float64
12258 @opindex mfloat32
12259 @opindex mno-float64
12260 Use 32-bit @code{float}.
12261
12262 @item -mabshi
12263 @opindex mabshi
12264 Use @code{abshi2} pattern.  This is the default.
12265
12266 @item -mno-abshi
12267 @opindex mno-abshi
12268 Do not use @code{abshi2} pattern.
12269
12270 @item -mbranch-expensive
12271 @opindex mbranch-expensive
12272 Pretend that branches are expensive.  This is for experimenting with
12273 code generation only.
12274
12275 @item -mbranch-cheap
12276 @opindex mbranch-cheap
12277 Do not pretend that branches are expensive.  This is the default.
12278
12279 @item -msplit
12280 @opindex msplit
12281 Generate code for a system with split I&D@.
12282
12283 @item -mno-split
12284 @opindex mno-split
12285 Generate code for a system without split I&D@.  This is the default.
12286
12287 @item -munix-asm
12288 @opindex munix-asm
12289 Use Unix assembler syntax.  This is the default when configured for
12290 @samp{pdp11-*-bsd}.
12291
12292 @item -mdec-asm
12293 @opindex mdec-asm
12294 Use DEC assembler syntax.  This is the default when configured for any
12295 PDP-11 target other than @samp{pdp11-*-bsd}.
12296 @end table
12297
12298 @node PowerPC Options
12299 @subsection PowerPC Options
12300 @cindex PowerPC options
12301
12302 These are listed under @xref{RS/6000 and PowerPC Options}.
12303
12304 @node RS/6000 and PowerPC Options
12305 @subsection IBM RS/6000 and PowerPC Options
12306 @cindex RS/6000 and PowerPC Options
12307 @cindex IBM RS/6000 and PowerPC Options
12308
12309 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
12310 @table @gcctabopt
12311 @item -mpower
12312 @itemx -mno-power
12313 @itemx -mpower2
12314 @itemx -mno-power2
12315 @itemx -mpowerpc
12316 @itemx -mno-powerpc
12317 @itemx -mpowerpc-gpopt
12318 @itemx -mno-powerpc-gpopt
12319 @itemx -mpowerpc-gfxopt
12320 @itemx -mno-powerpc-gfxopt
12321 @itemx -mpowerpc64
12322 @itemx -mno-powerpc64
12323 @itemx -mmfcrf
12324 @itemx -mno-mfcrf
12325 @itemx -mpopcntb
12326 @itemx -mno-popcntb
12327 @itemx -mfprnd
12328 @itemx -mno-fprnd
12329 @itemx -mcmpb
12330 @itemx -mno-cmpb
12331 @itemx -mmfpgpr
12332 @itemx -mno-mfpgpr
12333 @itemx -mdfp
12334 @itemx -mno-dfp
12335 @opindex mpower
12336 @opindex mno-power
12337 @opindex mpower2
12338 @opindex mno-power2
12339 @opindex mpowerpc
12340 @opindex mno-powerpc
12341 @opindex mpowerpc-gpopt
12342 @opindex mno-powerpc-gpopt
12343 @opindex mpowerpc-gfxopt
12344 @opindex mno-powerpc-gfxopt
12345 @opindex mpowerpc64
12346 @opindex mno-powerpc64
12347 @opindex mmfcrf
12348 @opindex mno-mfcrf
12349 @opindex mpopcntb
12350 @opindex mno-popcntb
12351 @opindex mfprnd
12352 @opindex mno-fprnd
12353 @opindex mcmpb
12354 @opindex mno-cmpb
12355 @opindex mmfpgpr
12356 @opindex mno-mfpgpr
12357 @opindex mdfp
12358 @opindex mno-dfp
12359 GCC supports two related instruction set architectures for the
12360 RS/6000 and PowerPC@.  The @dfn{POWER} instruction set are those
12361 instructions supported by the @samp{rios} chip set used in the original
12362 RS/6000 systems and the @dfn{PowerPC} instruction set is the
12363 architecture of the Freescale MPC5xx, MPC6xx, MPC8xx microprocessors, and
12364 the IBM 4xx, 6xx, and follow-on microprocessors.
12365
12366 Neither architecture is a subset of the other.  However there is a
12367 large common subset of instructions supported by both.  An MQ
12368 register is included in processors supporting the POWER architecture.
12369
12370 You use these options to specify which instructions are available on the
12371 processor you are using.  The default value of these options is
12372 determined when configuring GCC@.  Specifying the
12373 @option{-mcpu=@var{cpu_type}} overrides the specification of these
12374 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
12375 rather than the options listed above.
12376
12377 The @option{-mpower} option allows GCC to generate instructions that
12378 are found only in the POWER architecture and to use the MQ register.
12379 Specifying @option{-mpower2} implies @option{-power} and also allows GCC
12380 to generate instructions that are present in the POWER2 architecture but
12381 not the original POWER architecture.
12382
12383 The @option{-mpowerpc} option allows GCC to generate instructions that
12384 are found only in the 32-bit subset of the PowerPC architecture.
12385 Specifying @option{-mpowerpc-gpopt} implies @option{-mpowerpc} and also allows
12386 GCC to use the optional PowerPC architecture instructions in the
12387 General Purpose group, including floating-point square root.  Specifying
12388 @option{-mpowerpc-gfxopt} implies @option{-mpowerpc} and also allows GCC to
12389 use the optional PowerPC architecture instructions in the Graphics
12390 group, including floating-point select.
12391
12392 The @option{-mmfcrf} option allows GCC to generate the move from
12393 condition register field instruction implemented on the POWER4
12394 processor and other processors that support the PowerPC V2.01
12395 architecture.
12396 The @option{-mpopcntb} option allows GCC to generate the popcount and
12397 double precision FP reciprocal estimate instruction implemented on the
12398 POWER5 processor and other processors that support the PowerPC V2.02
12399 architecture.
12400 The @option{-mfprnd} option allows GCC to generate the FP round to
12401 integer instructions implemented on the POWER5+ processor and other
12402 processors that support the PowerPC V2.03 architecture.
12403 The @option{-mcmpb} option allows GCC to generate the compare bytes
12404 instruction implemented on the POWER6 processor and other processors
12405 that support the PowerPC V2.05 architecture.
12406 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
12407 general purpose register instructions implemented on the POWER6X
12408 processor and other processors that support the extended PowerPC V2.05
12409 architecture.
12410 The @option{-mdfp} option allows GCC to generate the decimal floating
12411 point instructions implemented on some POWER processors.
12412
12413 The @option{-mpowerpc64} option allows GCC to generate the additional
12414 64-bit instructions that are found in the full PowerPC64 architecture
12415 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
12416 @option{-mno-powerpc64}.
12417
12418 If you specify both @option{-mno-power} and @option{-mno-powerpc}, GCC
12419 will use only the instructions in the common subset of both
12420 architectures plus some special AIX common-mode calls, and will not use
12421 the MQ register.  Specifying both @option{-mpower} and @option{-mpowerpc}
12422 permits GCC to use any instruction from either architecture and to
12423 allow use of the MQ register; specify this for the Motorola MPC601.
12424
12425 @item -mnew-mnemonics
12426 @itemx -mold-mnemonics
12427 @opindex mnew-mnemonics
12428 @opindex mold-mnemonics
12429 Select which mnemonics to use in the generated assembler code.  With
12430 @option{-mnew-mnemonics}, GCC uses the assembler mnemonics defined for
12431 the PowerPC architecture.  With @option{-mold-mnemonics} it uses the
12432 assembler mnemonics defined for the POWER architecture.  Instructions
12433 defined in only one architecture have only one mnemonic; GCC uses that
12434 mnemonic irrespective of which of these options is specified.
12435
12436 GCC defaults to the mnemonics appropriate for the architecture in
12437 use.  Specifying @option{-mcpu=@var{cpu_type}} sometimes overrides the
12438 value of these option.  Unless you are building a cross-compiler, you
12439 should normally not specify either @option{-mnew-mnemonics} or
12440 @option{-mold-mnemonics}, but should instead accept the default.
12441
12442 @item -mcpu=@var{cpu_type}
12443 @opindex mcpu
12444 Set architecture type, register usage, choice of mnemonics, and
12445 instruction scheduling parameters for machine type @var{cpu_type}.
12446 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
12447 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{505},
12448 @samp{601}, @samp{602}, @samp{603}, @samp{603e}, @samp{604},
12449 @samp{604e}, @samp{620}, @samp{630}, @samp{740}, @samp{7400},
12450 @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
12451 @samp{860}, @samp{970}, @samp{8540}, @samp{ec603e}, @samp{G3},
12452 @samp{G4}, @samp{G5}, @samp{power}, @samp{power2}, @samp{power3},
12453 @samp{power4}, @samp{power5}, @samp{power5+}, @samp{power6},
12454 @samp{power6x}, @samp{common}, @samp{powerpc}, @samp{powerpc64},
12455 @samp{rios}, @samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64}.
12456
12457 @option{-mcpu=common} selects a completely generic processor.  Code
12458 generated under this option will run on any POWER or PowerPC processor.
12459 GCC will use only the instructions in the common subset of both
12460 architectures, and will not use the MQ register.  GCC assumes a generic
12461 processor model for scheduling purposes.
12462
12463 @option{-mcpu=power}, @option{-mcpu=power2}, @option{-mcpu=powerpc}, and
12464 @option{-mcpu=powerpc64} specify generic POWER, POWER2, pure 32-bit
12465 PowerPC (i.e., not MPC601), and 64-bit PowerPC architecture machine
12466 types, with an appropriate, generic processor model assumed for
12467 scheduling purposes.
12468
12469 The other options specify a specific processor.  Code generated under
12470 those options will run best on that processor, and may not run at all on
12471 others.
12472
12473 The @option{-mcpu} options automatically enable or disable the
12474 following options:
12475
12476 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
12477 -mnew-mnemonics  -mpopcntb  -mpower  -mpower2  -mpowerpc64 @gol
12478 -mpowerpc-gpopt  -mpowerpc-gfxopt  -mstring  -mmulhw  -mdlmzb  -mmfpgpr}
12479
12480 The particular options set for any particular CPU will vary between
12481 compiler versions, depending on what setting seems to produce optimal
12482 code for that CPU; it doesn't necessarily reflect the actual hardware's
12483 capabilities.  If you wish to set an individual option to a particular
12484 value, you may specify it after the @option{-mcpu} option, like
12485 @samp{-mcpu=970 -mno-altivec}.
12486
12487 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
12488 not enabled or disabled by the @option{-mcpu} option at present because
12489 AIX does not have full support for these options.  You may still
12490 enable or disable them individually if you're sure it'll work in your
12491 environment.
12492
12493 @item -mtune=@var{cpu_type}
12494 @opindex mtune
12495 Set the instruction scheduling parameters for machine type
12496 @var{cpu_type}, but do not set the architecture type, register usage, or
12497 choice of mnemonics, as @option{-mcpu=@var{cpu_type}} would.  The same
12498 values for @var{cpu_type} are used for @option{-mtune} as for
12499 @option{-mcpu}.  If both are specified, the code generated will use the
12500 architecture, registers, and mnemonics set by @option{-mcpu}, but the
12501 scheduling parameters set by @option{-mtune}.
12502
12503 @item -mswdiv
12504 @itemx -mno-swdiv
12505 @opindex mswdiv
12506 @opindex mno-swdiv
12507 Generate code to compute division as reciprocal estimate and iterative
12508 refinement, creating opportunities for increased throughput.  This
12509 feature requires: optional PowerPC Graphics instruction set for single
12510 precision and FRE instruction for double precision, assuming divides
12511 cannot generate user-visible traps, and the domain values not include
12512 Infinities, denormals or zero denominator.
12513
12514 @item -maltivec
12515 @itemx -mno-altivec
12516 @opindex maltivec
12517 @opindex mno-altivec
12518 Generate code that uses (does not use) AltiVec instructions, and also
12519 enable the use of built-in functions that allow more direct access to
12520 the AltiVec instruction set.  You may also need to set
12521 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
12522 enhancements.
12523
12524 @item -mvrsave
12525 @item -mno-vrsave
12526 @opindex mvrsave
12527 @opindex mno-vrsave
12528 Generate VRSAVE instructions when generating AltiVec code.
12529
12530 @item -msecure-plt
12531 @opindex msecure-plt
12532 Generate code that allows ld and ld.so to build executables and shared
12533 libraries with non-exec .plt and .got sections.  This is a PowerPC
12534 32-bit SYSV ABI option.
12535
12536 @item -mbss-plt
12537 @opindex mbss-plt
12538 Generate code that uses a BSS .plt section that ld.so fills in, and
12539 requires .plt and .got sections that are both writable and executable.
12540 This is a PowerPC 32-bit SYSV ABI option.
12541
12542 @item -misel
12543 @itemx -mno-isel
12544 @opindex misel
12545 @opindex mno-isel
12546 This switch enables or disables the generation of ISEL instructions.
12547
12548 @item -misel=@var{yes/no}
12549 This switch has been deprecated.  Use @option{-misel} and
12550 @option{-mno-isel} instead.
12551
12552 @item -mspe
12553 @itemx -mno-spe
12554 @opindex mspe
12555 @opindex mno-spe
12556 This switch enables or disables the generation of SPE simd
12557 instructions.
12558
12559 @item -mspe=@var{yes/no}
12560 This option has been deprecated.  Use @option{-mspe} and
12561 @option{-mno-spe} instead.
12562
12563 @item -mfloat-gprs=@var{yes/single/double/no}
12564 @itemx -mfloat-gprs
12565 @opindex mfloat-gprs
12566 This switch enables or disables the generation of floating point
12567 operations on the general purpose registers for architectures that
12568 support it.
12569
12570 The argument @var{yes} or @var{single} enables the use of
12571 single-precision floating point operations.
12572
12573 The argument @var{double} enables the use of single and
12574 double-precision floating point operations.
12575
12576 The argument @var{no} disables floating point operations on the
12577 general purpose registers.
12578
12579 This option is currently only available on the MPC854x.
12580
12581 @item -m32
12582 @itemx -m64
12583 @opindex m32
12584 @opindex m64
12585 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
12586 targets (including GNU/Linux).  The 32-bit environment sets int, long
12587 and pointer to 32 bits and generates code that runs on any PowerPC
12588 variant.  The 64-bit environment sets int to 32 bits and long and
12589 pointer to 64 bits, and generates code for PowerPC64, as for
12590 @option{-mpowerpc64}.
12591
12592 @item -mfull-toc
12593 @itemx -mno-fp-in-toc
12594 @itemx -mno-sum-in-toc
12595 @itemx -mminimal-toc
12596 @opindex mfull-toc
12597 @opindex mno-fp-in-toc
12598 @opindex mno-sum-in-toc
12599 @opindex mminimal-toc
12600 Modify generation of the TOC (Table Of Contents), which is created for
12601 every executable file.  The @option{-mfull-toc} option is selected by
12602 default.  In that case, GCC will allocate at least one TOC entry for
12603 each unique non-automatic variable reference in your program.  GCC
12604 will also place floating-point constants in the TOC@.  However, only
12605 16,384 entries are available in the TOC@.
12606
12607 If you receive a linker error message that saying you have overflowed
12608 the available TOC space, you can reduce the amount of TOC space used
12609 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
12610 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
12611 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
12612 generate code to calculate the sum of an address and a constant at
12613 run-time instead of putting that sum into the TOC@.  You may specify one
12614 or both of these options.  Each causes GCC to produce very slightly
12615 slower and larger code at the expense of conserving TOC space.
12616
12617 If you still run out of space in the TOC even when you specify both of
12618 these options, specify @option{-mminimal-toc} instead.  This option causes
12619 GCC to make only one TOC entry for every file.  When you specify this
12620 option, GCC will produce code that is slower and larger but which
12621 uses extremely little TOC space.  You may wish to use this option
12622 only on files that contain less frequently executed code.
12623
12624 @item -maix64
12625 @itemx -maix32
12626 @opindex maix64
12627 @opindex maix32
12628 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
12629 @code{long} type, and the infrastructure needed to support them.
12630 Specifying @option{-maix64} implies @option{-mpowerpc64} and
12631 @option{-mpowerpc}, while @option{-maix32} disables the 64-bit ABI and
12632 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
12633
12634 @item -mxl-compat
12635 @itemx -mno-xl-compat
12636 @opindex mxl-compat
12637 @opindex mno-xl-compat
12638 Produce code that conforms more closely to IBM XL compiler semantics
12639 when using AIX-compatible ABI.  Pass floating-point arguments to
12640 prototyped functions beyond the register save area (RSA) on the stack
12641 in addition to argument FPRs.  Do not assume that most significant
12642 double in 128-bit long double value is properly rounded when comparing
12643 values and converting to double.  Use XL symbol names for long double
12644 support routines.
12645
12646 The AIX calling convention was extended but not initially documented to
12647 handle an obscure K&R C case of calling a function that takes the
12648 address of its arguments with fewer arguments than declared.  IBM XL
12649 compilers access floating point arguments which do not fit in the
12650 RSA from the stack when a subroutine is compiled without
12651 optimization.  Because always storing floating-point arguments on the
12652 stack is inefficient and rarely needed, this option is not enabled by
12653 default and only is necessary when calling subroutines compiled by IBM
12654 XL compilers without optimization.
12655
12656 @item -mpe
12657 @opindex mpe
12658 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
12659 application written to use message passing with special startup code to
12660 enable the application to run.  The system must have PE installed in the
12661 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
12662 must be overridden with the @option{-specs=} option to specify the
12663 appropriate directory location.  The Parallel Environment does not
12664 support threads, so the @option{-mpe} option and the @option{-pthread}
12665 option are incompatible.
12666
12667 @item -malign-natural
12668 @itemx -malign-power
12669 @opindex malign-natural
12670 @opindex malign-power
12671 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
12672 @option{-malign-natural} overrides the ABI-defined alignment of larger
12673 types, such as floating-point doubles, on their natural size-based boundary.
12674 The option @option{-malign-power} instructs GCC to follow the ABI-specified
12675 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
12676
12677 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
12678 is not supported.
12679
12680 @item -msoft-float
12681 @itemx -mhard-float
12682 @opindex msoft-float
12683 @opindex mhard-float
12684 Generate code that does not use (uses) the floating-point register set.
12685 Software floating point emulation is provided if you use the
12686 @option{-msoft-float} option, and pass the option to GCC when linking.
12687
12688 @item -mmultiple
12689 @itemx -mno-multiple
12690 @opindex mmultiple
12691 @opindex mno-multiple
12692 Generate code that uses (does not use) the load multiple word
12693 instructions and the store multiple word instructions.  These
12694 instructions are generated by default on POWER systems, and not
12695 generated on PowerPC systems.  Do not use @option{-mmultiple} on little
12696 endian PowerPC systems, since those instructions do not work when the
12697 processor is in little endian mode.  The exceptions are PPC740 and
12698 PPC750 which permit the instructions usage in little endian mode.
12699
12700 @item -mstring
12701 @itemx -mno-string
12702 @opindex mstring
12703 @opindex mno-string
12704 Generate code that uses (does not use) the load string instructions
12705 and the store string word instructions to save multiple registers and
12706 do small block moves.  These instructions are generated by default on
12707 POWER systems, and not generated on PowerPC systems.  Do not use
12708 @option{-mstring} on little endian PowerPC systems, since those
12709 instructions do not work when the processor is in little endian mode.
12710 The exceptions are PPC740 and PPC750 which permit the instructions
12711 usage in little endian mode.
12712
12713 @item -mupdate
12714 @itemx -mno-update
12715 @opindex mupdate
12716 @opindex mno-update
12717 Generate code that uses (does not use) the load or store instructions
12718 that update the base register to the address of the calculated memory
12719 location.  These instructions are generated by default.  If you use
12720 @option{-mno-update}, there is a small window between the time that the
12721 stack pointer is updated and the address of the previous frame is
12722 stored, which means code that walks the stack frame across interrupts or
12723 signals may get corrupted data.
12724
12725 @item -mfused-madd
12726 @itemx -mno-fused-madd
12727 @opindex mfused-madd
12728 @opindex mno-fused-madd
12729 Generate code that uses (does not use) the floating point multiply and
12730 accumulate instructions.  These instructions are generated by default if
12731 hardware floating is used.
12732
12733 @item -mmulhw
12734 @itemx -mno-mulhw
12735 @opindex mmulhw
12736 @opindex mno-mulhw
12737 Generate code that uses (does not use) the half-word multiply and
12738 multiply-accumulate instructions on the IBM 405 and 440 processors.
12739 These instructions are generated by default when targetting those
12740 processors.
12741
12742 @item -mdlmzb
12743 @itemx -mno-dlmzb
12744 @opindex mdlmzb
12745 @opindex mno-dlmzb
12746 Generate code that uses (does not use) the string-search @samp{dlmzb}
12747 instruction on the IBM 405 and 440 processors.  This instruction is
12748 generated by default when targetting those processors.
12749
12750 @item -mno-bit-align
12751 @itemx -mbit-align
12752 @opindex mno-bit-align
12753 @opindex mbit-align
12754 On System V.4 and embedded PowerPC systems do not (do) force structures
12755 and unions that contain bit-fields to be aligned to the base type of the
12756 bit-field.
12757
12758 For example, by default a structure containing nothing but 8
12759 @code{unsigned} bit-fields of length 1 would be aligned to a 4 byte
12760 boundary and have a size of 4 bytes.  By using @option{-mno-bit-align},
12761 the structure would be aligned to a 1 byte boundary and be one byte in
12762 size.
12763
12764 @item -mno-strict-align
12765 @itemx -mstrict-align
12766 @opindex mno-strict-align
12767 @opindex mstrict-align
12768 On System V.4 and embedded PowerPC systems do not (do) assume that
12769 unaligned memory references will be handled by the system.
12770
12771 @item -mrelocatable
12772 @itemx -mno-relocatable
12773 @opindex mrelocatable
12774 @opindex mno-relocatable
12775 On embedded PowerPC systems generate code that allows (does not allow)
12776 the program to be relocated to a different address at runtime.  If you
12777 use @option{-mrelocatable} on any module, all objects linked together must
12778 be compiled with @option{-mrelocatable} or @option{-mrelocatable-lib}.
12779
12780 @item -mrelocatable-lib
12781 @itemx -mno-relocatable-lib
12782 @opindex mrelocatable-lib
12783 @opindex mno-relocatable-lib
12784 On embedded PowerPC systems generate code that allows (does not allow)
12785 the program to be relocated to a different address at runtime.  Modules
12786 compiled with @option{-mrelocatable-lib} can be linked with either modules
12787 compiled without @option{-mrelocatable} and @option{-mrelocatable-lib} or
12788 with modules compiled with the @option{-mrelocatable} options.
12789
12790 @item -mno-toc
12791 @itemx -mtoc
12792 @opindex mno-toc
12793 @opindex mtoc
12794 On System V.4 and embedded PowerPC systems do not (do) assume that
12795 register 2 contains a pointer to a global area pointing to the addresses
12796 used in the program.
12797
12798 @item -mlittle
12799 @itemx -mlittle-endian
12800 @opindex mlittle
12801 @opindex mlittle-endian
12802 On System V.4 and embedded PowerPC systems compile code for the
12803 processor in little endian mode.  The @option{-mlittle-endian} option is
12804 the same as @option{-mlittle}.
12805
12806 @item -mbig
12807 @itemx -mbig-endian
12808 @opindex mbig
12809 @opindex mbig-endian
12810 On System V.4 and embedded PowerPC systems compile code for the
12811 processor in big endian mode.  The @option{-mbig-endian} option is
12812 the same as @option{-mbig}.
12813
12814 @item -mdynamic-no-pic
12815 @opindex mdynamic-no-pic
12816 On Darwin and Mac OS X systems, compile code so that it is not
12817 relocatable, but that its external references are relocatable.  The
12818 resulting code is suitable for applications, but not shared
12819 libraries.
12820
12821 @item -mprioritize-restricted-insns=@var{priority}
12822 @opindex mprioritize-restricted-insns
12823 This option controls the priority that is assigned to
12824 dispatch-slot restricted instructions during the second scheduling
12825 pass.  The argument @var{priority} takes the value @var{0/1/2} to assign
12826 @var{no/highest/second-highest} priority to dispatch slot restricted
12827 instructions.
12828
12829 @item -msched-costly-dep=@var{dependence_type}
12830 @opindex msched-costly-dep
12831 This option controls which dependences are considered costly
12832 by the target during instruction scheduling.  The argument
12833 @var{dependence_type} takes one of the following values:
12834 @var{no}: no dependence is costly,
12835 @var{all}: all dependences are costly,
12836 @var{true_store_to_load}: a true dependence from store to load is costly,
12837 @var{store_to_load}: any dependence from store to load is costly,
12838 @var{number}: any dependence which latency >= @var{number} is costly.
12839
12840 @item -minsert-sched-nops=@var{scheme}
12841 @opindex minsert-sched-nops
12842 This option controls which nop insertion scheme will be used during
12843 the second scheduling pass.  The argument @var{scheme} takes one of the
12844 following values:
12845 @var{no}: Don't insert nops.
12846 @var{pad}: Pad with nops any dispatch group which has vacant issue slots,
12847 according to the scheduler's grouping.
12848 @var{regroup_exact}: Insert nops to force costly dependent insns into
12849 separate groups.  Insert exactly as many nops as needed to force an insn
12850 to a new group, according to the estimated processor grouping.
12851 @var{number}: Insert nops to force costly dependent insns into
12852 separate groups.  Insert @var{number} nops to force an insn to a new group.
12853
12854 @item -mcall-sysv
12855 @opindex mcall-sysv
12856 On System V.4 and embedded PowerPC systems compile code using calling
12857 conventions that adheres to the March 1995 draft of the System V
12858 Application Binary Interface, PowerPC processor supplement.  This is the
12859 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
12860
12861 @item -mcall-sysv-eabi
12862 @opindex mcall-sysv-eabi
12863 Specify both @option{-mcall-sysv} and @option{-meabi} options.
12864
12865 @item -mcall-sysv-noeabi
12866 @opindex mcall-sysv-noeabi
12867 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
12868
12869 @item -mcall-solaris
12870 @opindex mcall-solaris
12871 On System V.4 and embedded PowerPC systems compile code for the Solaris
12872 operating system.
12873
12874 @item -mcall-linux
12875 @opindex mcall-linux
12876 On System V.4 and embedded PowerPC systems compile code for the
12877 Linux-based GNU system.
12878
12879 @item -mcall-gnu
12880 @opindex mcall-gnu
12881 On System V.4 and embedded PowerPC systems compile code for the
12882 Hurd-based GNU system.
12883
12884 @item -mcall-netbsd
12885 @opindex mcall-netbsd
12886 On System V.4 and embedded PowerPC systems compile code for the
12887 NetBSD operating system.
12888
12889 @item -maix-struct-return
12890 @opindex maix-struct-return
12891 Return all structures in memory (as specified by the AIX ABI)@.
12892
12893 @item -msvr4-struct-return
12894 @opindex msvr4-struct-return
12895 Return structures smaller than 8 bytes in registers (as specified by the
12896 SVR4 ABI)@.
12897
12898 @item -mabi=@var{abi-type}
12899 @opindex mabi
12900 Extend the current ABI with a particular extension, or remove such extension.
12901 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
12902 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble}@.
12903
12904 @item -mabi=spe
12905 @opindex mabi=spe
12906 Extend the current ABI with SPE ABI extensions.  This does not change
12907 the default ABI, instead it adds the SPE ABI extensions to the current
12908 ABI@.
12909
12910 @item -mabi=no-spe
12911 @opindex mabi=no-spe
12912 Disable Booke SPE ABI extensions for the current ABI@.
12913
12914 @item -mabi=ibmlongdouble
12915 @opindex mabi=ibmlongdouble
12916 Change the current ABI to use IBM extended precision long double.
12917 This is a PowerPC 32-bit SYSV ABI option.
12918
12919 @item -mabi=ieeelongdouble
12920 @opindex mabi=ieeelongdouble
12921 Change the current ABI to use IEEE extended precision long double.
12922 This is a PowerPC 32-bit Linux ABI option.
12923
12924 @item -mprototype
12925 @itemx -mno-prototype
12926 @opindex mprototype
12927 @opindex mno-prototype
12928 On System V.4 and embedded PowerPC systems assume that all calls to
12929 variable argument functions are properly prototyped.  Otherwise, the
12930 compiler must insert an instruction before every non prototyped call to
12931 set or clear bit 6 of the condition code register (@var{CR}) to
12932 indicate whether floating point values were passed in the floating point
12933 registers in case the function takes a variable arguments.  With
12934 @option{-mprototype}, only calls to prototyped variable argument functions
12935 will set or clear the bit.
12936
12937 @item -msim
12938 @opindex msim
12939 On embedded PowerPC systems, assume that the startup module is called
12940 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
12941 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}.
12942 configurations.
12943
12944 @item -mmvme
12945 @opindex mmvme
12946 On embedded PowerPC systems, assume that the startup module is called
12947 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
12948 @file{libc.a}.
12949
12950 @item -mads
12951 @opindex mads
12952 On embedded PowerPC systems, assume that the startup module is called
12953 @file{crt0.o} and the standard C libraries are @file{libads.a} and
12954 @file{libc.a}.
12955
12956 @item -myellowknife
12957 @opindex myellowknife
12958 On embedded PowerPC systems, assume that the startup module is called
12959 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
12960 @file{libc.a}.
12961
12962 @item -mvxworks
12963 @opindex mvxworks
12964 On System V.4 and embedded PowerPC systems, specify that you are
12965 compiling for a VxWorks system.
12966
12967 @item -mwindiss
12968 @opindex mwindiss
12969 Specify that you are compiling for the WindISS simulation environment.
12970
12971 @item -memb
12972 @opindex memb
12973 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
12974 header to indicate that @samp{eabi} extended relocations are used.
12975
12976 @item -meabi
12977 @itemx -mno-eabi
12978 @opindex meabi
12979 @opindex mno-eabi
12980 On System V.4 and embedded PowerPC systems do (do not) adhere to the
12981 Embedded Applications Binary Interface (eabi) which is a set of
12982 modifications to the System V.4 specifications.  Selecting @option{-meabi}
12983 means that the stack is aligned to an 8 byte boundary, a function
12984 @code{__eabi} is called to from @code{main} to set up the eabi
12985 environment, and the @option{-msdata} option can use both @code{r2} and
12986 @code{r13} to point to two separate small data areas.  Selecting
12987 @option{-mno-eabi} means that the stack is aligned to a 16 byte boundary,
12988 do not call an initialization function from @code{main}, and the
12989 @option{-msdata} option will only use @code{r13} to point to a single
12990 small data area.  The @option{-meabi} option is on by default if you
12991 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
12992
12993 @item -msdata=eabi
12994 @opindex msdata=eabi
12995 On System V.4 and embedded PowerPC systems, put small initialized
12996 @code{const} global and static data in the @samp{.sdata2} section, which
12997 is pointed to by register @code{r2}.  Put small initialized
12998 non-@code{const} global and static data in the @samp{.sdata} section,
12999 which is pointed to by register @code{r13}.  Put small uninitialized
13000 global and static data in the @samp{.sbss} section, which is adjacent to
13001 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
13002 incompatible with the @option{-mrelocatable} option.  The
13003 @option{-msdata=eabi} option also sets the @option{-memb} option.
13004
13005 @item -msdata=sysv
13006 @opindex msdata=sysv
13007 On System V.4 and embedded PowerPC systems, put small global and static
13008 data in the @samp{.sdata} section, which is pointed to by register
13009 @code{r13}.  Put small uninitialized global and static data in the
13010 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
13011 The @option{-msdata=sysv} option is incompatible with the
13012 @option{-mrelocatable} option.
13013
13014 @item -msdata=default
13015 @itemx -msdata
13016 @opindex msdata=default
13017 @opindex msdata
13018 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
13019 compile code the same as @option{-msdata=eabi}, otherwise compile code the
13020 same as @option{-msdata=sysv}.
13021
13022 @item -msdata-data
13023 @opindex msdata-data
13024 On System V.4 and embedded PowerPC systems, put small global
13025 data in the @samp{.sdata} section.  Put small uninitialized global
13026 data in the @samp{.sbss} section.  Do not use register @code{r13}
13027 to address small data however.  This is the default behavior unless
13028 other @option{-msdata} options are used.
13029
13030 @item -msdata=none
13031 @itemx -mno-sdata
13032 @opindex msdata=none
13033 @opindex mno-sdata
13034 On embedded PowerPC systems, put all initialized global and static data
13035 in the @samp{.data} section, and all uninitialized data in the
13036 @samp{.bss} section.
13037
13038 @item -G @var{num}
13039 @opindex G
13040 @cindex smaller data references (PowerPC)
13041 @cindex .sdata/.sdata2 references (PowerPC)
13042 On embedded PowerPC systems, put global and static items less than or
13043 equal to @var{num} bytes into the small data or bss sections instead of
13044 the normal data or bss section.  By default, @var{num} is 8.  The
13045 @option{-G @var{num}} switch is also passed to the linker.
13046 All modules should be compiled with the same @option{-G @var{num}} value.
13047
13048 @item -mregnames
13049 @itemx -mno-regnames
13050 @opindex mregnames
13051 @opindex mno-regnames
13052 On System V.4 and embedded PowerPC systems do (do not) emit register
13053 names in the assembly language output using symbolic forms.
13054
13055 @item -mlongcall
13056 @itemx -mno-longcall
13057 @opindex mlongcall
13058 @opindex mno-longcall
13059 By default assume that all calls are far away so that a longer more
13060 expensive calling sequence is required.  This is required for calls
13061 further than 32 megabytes (33,554,432 bytes) from the current location.
13062 A short call will be generated if the compiler knows
13063 the call cannot be that far away.  This setting can be overridden by
13064 the @code{shortcall} function attribute, or by @code{#pragma
13065 longcall(0)}.
13066
13067 Some linkers are capable of detecting out-of-range calls and generating
13068 glue code on the fly.  On these systems, long calls are unnecessary and
13069 generate slower code.  As of this writing, the AIX linker can do this,
13070 as can the GNU linker for PowerPC/64.  It is planned to add this feature
13071 to the GNU linker for 32-bit PowerPC systems as well.
13072
13073 On Darwin/PPC systems, @code{#pragma longcall} will generate ``jbsr
13074 callee, L42'', plus a ``branch island'' (glue code).  The two target
13075 addresses represent the callee and the ``branch island''.  The
13076 Darwin/PPC linker will prefer the first address and generate a ``bl
13077 callee'' if the PPC ``bl'' instruction will reach the callee directly;
13078 otherwise, the linker will generate ``bl L42'' to call the ``branch
13079 island''.  The ``branch island'' is appended to the body of the
13080 calling function; it computes the full 32-bit address of the callee
13081 and jumps to it.
13082
13083 On Mach-O (Darwin) systems, this option directs the compiler emit to
13084 the glue for every direct call, and the Darwin linker decides whether
13085 to use or discard it.
13086
13087 In the future, we may cause GCC to ignore all longcall specifications
13088 when the linker is known to generate glue.
13089
13090 @item -pthread
13091 @opindex pthread
13092 Adds support for multithreading with the @dfn{pthreads} library.
13093 This option sets flags for both the preprocessor and linker.
13094
13095 @end table
13096
13097 @node S/390 and zSeries Options
13098 @subsection S/390 and zSeries Options
13099 @cindex S/390 and zSeries Options
13100
13101 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
13102
13103 @table @gcctabopt
13104 @item -mhard-float
13105 @itemx -msoft-float
13106 @opindex mhard-float
13107 @opindex msoft-float
13108 Use (do not use) the hardware floating-point instructions and registers
13109 for floating-point operations.  When @option{-msoft-float} is specified,
13110 functions in @file{libgcc.a} will be used to perform floating-point
13111 operations.  When @option{-mhard-float} is specified, the compiler
13112 generates IEEE floating-point instructions.  This is the default.
13113
13114 @item -mlong-double-64
13115 @itemx -mlong-double-128
13116 @opindex mlong-double-64
13117 @opindex mlong-double-128
13118 These switches control the size of @code{long double} type. A size
13119 of 64bit makes the @code{long double} type equivalent to the @code{double}
13120 type. This is the default.
13121
13122 @item -mbackchain
13123 @itemx -mno-backchain
13124 @opindex mbackchain
13125 @opindex mno-backchain
13126 Store (do not store) the address of the caller's frame as backchain pointer
13127 into the callee's stack frame.
13128 A backchain may be needed to allow debugging using tools that do not understand
13129 DWARF-2 call frame information.
13130 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
13131 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
13132 the backchain is placed into the topmost word of the 96/160 byte register
13133 save area.
13134
13135 In general, code compiled with @option{-mbackchain} is call-compatible with
13136 code compiled with @option{-mmo-backchain}; however, use of the backchain
13137 for debugging purposes usually requires that the whole binary is built with
13138 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
13139 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
13140 to build a linux kernel use @option{-msoft-float}.
13141
13142 The default is to not maintain the backchain.
13143
13144 @item -mpacked-stack
13145 @item -mno-packed-stack
13146 @opindex mpacked-stack
13147 @opindex mno-packed-stack
13148 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
13149 specified, the compiler uses the all fields of the 96/160 byte register save
13150 area only for their default purpose; unused fields still take up stack space.
13151 When @option{-mpacked-stack} is specified, register save slots are densely
13152 packed at the top of the register save area; unused space is reused for other
13153 purposes, allowing for more efficient use of the available stack space.
13154 However, when @option{-mbackchain} is also in effect, the topmost word of
13155 the save area is always used to store the backchain, and the return address
13156 register is always saved two words below the backchain.
13157
13158 As long as the stack frame backchain is not used, code generated with
13159 @option{-mpacked-stack} is call-compatible with code generated with
13160 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
13161 S/390 or zSeries generated code that uses the stack frame backchain at run
13162 time, not just for debugging purposes.  Such code is not call-compatible
13163 with code compiled with @option{-mpacked-stack}.  Also, note that the
13164 combination of @option{-mbackchain},
13165 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
13166 to build a linux kernel use @option{-msoft-float}.
13167
13168 The default is to not use the packed stack layout.
13169
13170 @item -msmall-exec
13171 @itemx -mno-small-exec
13172 @opindex msmall-exec
13173 @opindex mno-small-exec
13174 Generate (or do not generate) code using the @code{bras} instruction
13175 to do subroutine calls.
13176 This only works reliably if the total executable size does not
13177 exceed 64k.  The default is to use the @code{basr} instruction instead,
13178 which does not have this limitation.
13179
13180 @item -m64
13181 @itemx -m31
13182 @opindex m64
13183 @opindex m31
13184 When @option{-m31} is specified, generate code compliant to the
13185 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
13186 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
13187 particular to generate 64-bit instructions.  For the @samp{s390}
13188 targets, the default is @option{-m31}, while the @samp{s390x}
13189 targets default to @option{-m64}.
13190
13191 @item -mzarch
13192 @itemx -mesa
13193 @opindex mzarch
13194 @opindex mesa
13195 When @option{-mzarch} is specified, generate code using the
13196 instructions available on z/Architecture.
13197 When @option{-mesa} is specified, generate code using the
13198 instructions available on ESA/390.  Note that @option{-mesa} is
13199 not possible with @option{-m64}.
13200 When generating code compliant to the GNU/Linux for S/390 ABI,
13201 the default is @option{-mesa}.  When generating code compliant
13202 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
13203
13204 @item -mmvcle
13205 @itemx -mno-mvcle
13206 @opindex mmvcle
13207 @opindex mno-mvcle
13208 Generate (or do not generate) code using the @code{mvcle} instruction
13209 to perform block moves.  When @option{-mno-mvcle} is specified,
13210 use a @code{mvc} loop instead.  This is the default unless optimizing for
13211 size.
13212
13213 @item -mdebug
13214 @itemx -mno-debug
13215 @opindex mdebug
13216 @opindex mno-debug
13217 Print (or do not print) additional debug information when compiling.
13218 The default is to not print debug information.
13219
13220 @item -march=@var{cpu-type}
13221 @opindex march
13222 Generate code that will run on @var{cpu-type}, which is the name of a system
13223 representing a certain processor type.  Possible values for
13224 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, and @samp{z990}.
13225 When generating code using the instructions available on z/Architecture,
13226 the default is @option{-march=z900}.  Otherwise, the default is
13227 @option{-march=g5}.
13228
13229 @item -mtune=@var{cpu-type}
13230 @opindex mtune
13231 Tune to @var{cpu-type} everything applicable about the generated code,
13232 except for the ABI and the set of available instructions.
13233 The list of @var{cpu-type} values is the same as for @option{-march}.
13234 The default is the value used for @option{-march}.
13235
13236 @item -mtpf-trace
13237 @itemx -mno-tpf-trace
13238 @opindex mtpf-trace
13239 @opindex mno-tpf-trace
13240 Generate code that adds (does not add) in TPF OS specific branches to trace
13241 routines in the operating system.  This option is off by default, even
13242 when compiling for the TPF OS@.
13243
13244 @item -mfused-madd
13245 @itemx -mno-fused-madd
13246 @opindex mfused-madd
13247 @opindex mno-fused-madd
13248 Generate code that uses (does not use) the floating point multiply and
13249 accumulate instructions.  These instructions are generated by default if
13250 hardware floating point is used.
13251
13252 @item -mwarn-framesize=@var{framesize}
13253 @opindex mwarn-framesize
13254 Emit a warning if the current function exceeds the given frame size.  Because
13255 this is a compile time check it doesn't need to be a real problem when the program
13256 runs.  It is intended to identify functions which most probably cause
13257 a stack overflow.  It is useful to be used in an environment with limited stack
13258 size e.g.@: the linux kernel.
13259
13260 @item -mwarn-dynamicstack
13261 @opindex mwarn-dynamicstack
13262 Emit a warning if the function calls alloca or uses dynamically
13263 sized arrays.  This is generally a bad idea with a limited stack size.
13264
13265 @item -mstack-guard=@var{stack-guard}
13266 @item -mstack-size=@var{stack-size}
13267 @opindex mstack-guard
13268 @opindex mstack-size
13269 If these options are provided the s390 back end emits additional instructions in
13270 the function prologue which trigger a trap if the stack size is @var{stack-guard}
13271 bytes above the @var{stack-size} (remember that the stack on s390 grows downward).
13272 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
13273 the frame size of the compiled function is chosen.
13274 These options are intended to be used to help debugging stack overflow problems.
13275 The additionally emitted code causes only little overhead and hence can also be
13276 used in production like systems without greater performance degradation.  The given
13277 values have to be exact powers of 2 and @var{stack-size} has to be greater than
13278 @var{stack-guard} without exceeding 64k.
13279 In order to be efficient the extra code makes the assumption that the stack starts
13280 at an address aligned to the value given by @var{stack-size}.
13281 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
13282 @end table
13283
13284 @node Score Options
13285 @subsection Score Options
13286 @cindex Score Options
13287
13288 These options are defined for Score implementations:
13289
13290 @table @gcctabopt
13291 @item -meb
13292 @opindex meb
13293 Compile code for big endian mode.  This is the default.
13294
13295 @item -mel
13296 @opindex mel
13297 Compile code for little endian mode. 
13298
13299 @item -mnhwloop
13300 @opindex mnhwloop
13301 Disable generate bcnz instruction.
13302
13303 @item -muls
13304 @opindex muls
13305 Enable generate unaligned load and store instruction.
13306
13307 @item -mmac
13308 @opindex mmac
13309 Enable the use of multiply-accumulate instructions. Disabled by default. 
13310
13311 @item -mscore5
13312 @opindex mscore5
13313 Specify the SCORE5 as the target architecture.
13314
13315 @item -mscore5u
13316 @opindex mscore5u
13317 Specify the SCORE5U of the target architecture.
13318
13319 @item -mscore7
13320 @opindex mscore7
13321 Specify the SCORE7 as the target architecture. This is the default.
13322
13323 @item -mscore7d
13324 @opindex mscore7d
13325 Specify the SCORE7D as the target architecture.
13326 @end table
13327
13328 @node SH Options
13329 @subsection SH Options
13330
13331 These @samp{-m} options are defined for the SH implementations:
13332
13333 @table @gcctabopt
13334 @item -m1
13335 @opindex m1
13336 Generate code for the SH1.
13337
13338 @item -m2
13339 @opindex m2
13340 Generate code for the SH2.
13341
13342 @item -m2e
13343 Generate code for the SH2e.
13344
13345 @item -m3
13346 @opindex m3
13347 Generate code for the SH3.
13348
13349 @item -m3e
13350 @opindex m3e
13351 Generate code for the SH3e.
13352
13353 @item -m4-nofpu
13354 @opindex m4-nofpu
13355 Generate code for the SH4 without a floating-point unit.
13356
13357 @item -m4-single-only
13358 @opindex m4-single-only
13359 Generate code for the SH4 with a floating-point unit that only
13360 supports single-precision arithmetic.
13361
13362 @item -m4-single
13363 @opindex m4-single
13364 Generate code for the SH4 assuming the floating-point unit is in
13365 single-precision mode by default.
13366
13367 @item -m4
13368 @opindex m4
13369 Generate code for the SH4.
13370
13371 @item -m4a-nofpu
13372 @opindex m4a-nofpu
13373 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
13374 floating-point unit is not used.
13375
13376 @item -m4a-single-only
13377 @opindex m4a-single-only
13378 Generate code for the SH4a, in such a way that no double-precision
13379 floating point operations are used.
13380
13381 @item -m4a-single
13382 @opindex m4a-single
13383 Generate code for the SH4a assuming the floating-point unit is in
13384 single-precision mode by default.
13385
13386 @item -m4a
13387 @opindex m4a
13388 Generate code for the SH4a.
13389
13390 @item -m4al
13391 @opindex m4al
13392 Same as @option{-m4a-nofpu}, except that it implicitly passes
13393 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
13394 instructions at the moment.
13395
13396 @item -mb
13397 @opindex mb
13398 Compile code for the processor in big endian mode.
13399
13400 @item -ml
13401 @opindex ml
13402 Compile code for the processor in little endian mode.
13403
13404 @item -mdalign
13405 @opindex mdalign
13406 Align doubles at 64-bit boundaries.  Note that this changes the calling
13407 conventions, and thus some functions from the standard C library will
13408 not work unless you recompile it first with @option{-mdalign}.
13409
13410 @item -mrelax
13411 @opindex mrelax
13412 Shorten some address references at link time, when possible; uses the
13413 linker option @option{-relax}.
13414
13415 @item -mbigtable
13416 @opindex mbigtable
13417 Use 32-bit offsets in @code{switch} tables.  The default is to use
13418 16-bit offsets.
13419
13420 @item -mfmovd
13421 @opindex mfmovd
13422 Enable the use of the instruction @code{fmovd}.
13423
13424 @item -mhitachi
13425 @opindex mhitachi
13426 Comply with the calling conventions defined by Renesas.
13427
13428 @item -mrenesas
13429 @opindex mhitachi
13430 Comply with the calling conventions defined by Renesas.
13431
13432 @item -mno-renesas
13433 @opindex mhitachi
13434 Comply with the calling conventions defined for GCC before the Renesas
13435 conventions were available.  This option is the default for all
13436 targets of the SH toolchain except for @samp{sh-symbianelf}.
13437
13438 @item -mnomacsave
13439 @opindex mnomacsave
13440 Mark the @code{MAC} register as call-clobbered, even if
13441 @option{-mhitachi} is given.
13442
13443 @item -mieee
13444 @opindex mieee
13445 Increase IEEE-compliance of floating-point code.
13446 At the moment, this is equivalent to @option{-fno-finite-math-only}.
13447 When generating 16 bit SH opcodes, getting IEEE-conforming results for
13448 comparisons of NANs / infinities incurs extra overhead in every
13449 floating point comparison, therefore the default is set to
13450 @option{-ffinite-math-only}.
13451
13452 @item -minline-ic_invalidate
13453 @opindex minline-ic_invalidate
13454 Inline code to invalidate instruction cache entries after setting up
13455 nested function trampolines.
13456 This option has no effect if -musermode is in effect and the selected
13457 code generation option (e.g. -m4) does not allow the use of the icbi
13458 instruction.
13459 If the selected code generation option does not allow the use of the icbi
13460 instruction, and -musermode is not in effect, the inlined code will
13461 manipulate the instruction cache address array directly with an associative
13462 write.  This not only requires privileged mode, but it will also
13463 fail if the cache line had been mapped via the TLB and has become unmapped.
13464
13465 @item -misize
13466 @opindex misize
13467 Dump instruction size and location in the assembly code.
13468
13469 @item -mpadstruct
13470 @opindex mpadstruct
13471 This option is deprecated.  It pads structures to multiple of 4 bytes,
13472 which is incompatible with the SH ABI@.
13473
13474 @item -mspace
13475 @opindex mspace
13476 Optimize for space instead of speed.  Implied by @option{-Os}.
13477
13478 @item -mprefergot
13479 @opindex mprefergot
13480 When generating position-independent code, emit function calls using
13481 the Global Offset Table instead of the Procedure Linkage Table.
13482
13483 @item -musermode
13484 @opindex musermode
13485 Don't generate privileged mode only code; implies -mno-inline-ic_invalidate
13486 if the inlined code would not work in user mode.
13487 This is the default when the target is @code{sh-*-linux*}.
13488
13489 @item -multcost=@var{number}
13490 @opindex multcost=@var{number}
13491 Set the cost to assume for a multiply insn.
13492
13493 @item -mdiv=@var{strategy}
13494 @opindex mdiv=@var{strategy}
13495 Set the division strategy to use for SHmedia code.  @var{strategy} must be
13496 one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, inv:call,
13497 inv:call2, inv:fp .
13498 "fp" performs the operation in floating point.  This has a very high latency,
13499 but needs only a few instructions, so it might be a good choice if
13500 your code has enough easily exploitable ILP to allow the compiler to
13501 schedule the floating point instructions together with other instructions.
13502 Division by zero causes a floating point exception.
13503 "inv" uses integer operations to calculate the inverse of the divisor,
13504 and then multiplies the dividend with the inverse.  This strategy allows
13505 cse and hoisting of the inverse calculation.  Division by zero calculates
13506 an unspecified result, but does not trap.
13507 "inv:minlat" is a variant of "inv" where if no cse / hoisting opportunities
13508 have been found, or if the entire operation has been hoisted to the same
13509 place, the last stages of the inverse calculation are intertwined with the
13510 final multiply to reduce the overall latency, at the expense of using a few
13511 more instructions, and thus offering fewer scheduling opportunities with
13512 other code.
13513 "call" calls a library function that usually implements the inv:minlat
13514 strategy.
13515 This gives high code density for m5-*media-nofpu compilations.
13516 "call2" uses a different entry point of the same library function, where it
13517 assumes that a pointer to a lookup table has already been set up, which
13518 exposes the pointer load to cse / code hoisting optimizations.
13519 "inv:call", "inv:call2" and "inv:fp" all use the "inv" algorithm for initial
13520 code generation, but if the code stays unoptimized, revert to the "call",
13521 "call2", or "fp" strategies, respectively.  Note that the
13522 potentially-trapping side effect of division by zero is carried by a
13523 separate instruction, so it is possible that all the integer instructions
13524 are hoisted out, but the marker for the side effect stays where it is.
13525 A recombination to fp operations or a call is not possible in that case.
13526 "inv20u" and "inv20l" are variants of the "inv:minlat" strategy.  In the case
13527 that the inverse calculation was nor separated from the multiply, they speed
13528 up division where the dividend fits into 20 bits (plus sign where applicable),
13529 by inserting a test to skip a number of operations in this case; this test
13530 slows down the case of larger dividends.  inv20u assumes the case of a such
13531 a small dividend to be unlikely, and inv20l assumes it to be likely.
13532
13533 @item -mdivsi3_libfunc=@var{name}
13534 @opindex mdivsi3_libfunc=@var{name}
13535 Set the name of the library function used for 32 bit signed division to
13536 @var{name}.  This only affect the name used in the call and inv:call
13537 division strategies, and the compiler will still expect the same
13538 sets of input/output/clobbered registers as if this option was not present.
13539
13540 @item -madjust-unroll
13541 @opindex madjust-unroll
13542 Throttle unrolling to avoid thrashing target registers.
13543 This option only has an effect if the gcc code base supports the
13544 TARGET_ADJUST_UNROLL_MAX target hook.
13545
13546 @item -mindexed-addressing
13547 @opindex mindexed-addressing
13548 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
13549 This is only safe if the hardware and/or OS implement 32 bit wrap-around
13550 semantics for the indexed addressing mode.  The architecture allows the
13551 implementation of processors with 64 bit MMU, which the OS could use to
13552 get 32 bit addressing, but since no current hardware implementation supports
13553 this or any other way to make the indexed addressing mode safe to use in
13554 the 32 bit ABI, the default is -mno-indexed-addressing.
13555
13556 @item -mgettrcost=@var{number}
13557 @opindex mgettrcost=@var{number}
13558 Set the cost assumed for the gettr instruction to @var{number}.
13559 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
13560
13561 @item -mpt-fixed
13562 @opindex mpt-fixed
13563 Assume pt* instructions won't trap.  This will generally generate better
13564 scheduled code, but is unsafe on current hardware.  The current architecture
13565 definition says that ptabs and ptrel trap when the target anded with 3 is 3.
13566 This has the unintentional effect of making it unsafe to schedule ptabs /
13567 ptrel before a branch, or hoist it out of a loop.  For example,
13568 __do_global_ctors, a part of libgcc that runs constructors at program
13569 startup, calls functions in a list which is delimited by @minus{}1.  With the
13570 -mpt-fixed option, the ptabs will be done before testing against @minus{}1.
13571 That means that all the constructors will be run a bit quicker, but when
13572 the loop comes to the end of the list, the program crashes because ptabs
13573 loads @minus{}1 into a target register.  Since this option is unsafe for any
13574 hardware implementing the current architecture specification, the default
13575 is -mno-pt-fixed.  Unless the user specifies a specific cost with
13576 @option{-mgettrcost}, -mno-pt-fixed also implies @option{-mgettrcost=100};
13577 this deters register allocation using target registers for storing
13578 ordinary integers.
13579
13580 @item -minvalid-symbols
13581 @opindex minvalid-symbols
13582 Assume symbols might be invalid.  Ordinary function symbols generated by
13583 the compiler will always be valid to load with movi/shori/ptabs or
13584 movi/shori/ptrel, but with assembler and/or linker tricks it is possible
13585 to generate symbols that will cause ptabs / ptrel to trap.
13586 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
13587 It will then prevent cross-basic-block cse, hoisting and most scheduling
13588 of symbol loads.  The default is @option{-mno-invalid-symbols}.
13589 @end table
13590
13591 @node SPARC Options
13592 @subsection SPARC Options
13593 @cindex SPARC options
13594
13595 These @samp{-m} options are supported on the SPARC:
13596
13597 @table @gcctabopt
13598 @item -mno-app-regs
13599 @itemx -mapp-regs
13600 @opindex mno-app-regs
13601 @opindex mapp-regs
13602 Specify @option{-mapp-regs} to generate output using the global registers
13603 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
13604 is the default.
13605
13606 To be fully SVR4 ABI compliant at the cost of some performance loss,
13607 specify @option{-mno-app-regs}.  You should compile libraries and system
13608 software with this option.
13609
13610 @item -mfpu
13611 @itemx -mhard-float
13612 @opindex mfpu
13613 @opindex mhard-float
13614 Generate output containing floating point instructions.  This is the
13615 default.
13616
13617 @item -mno-fpu
13618 @itemx -msoft-float
13619 @opindex mno-fpu
13620 @opindex msoft-float
13621 Generate output containing library calls for floating point.
13622 @strong{Warning:} the requisite libraries are not available for all SPARC
13623 targets.  Normally the facilities of the machine's usual C compiler are
13624 used, but this cannot be done directly in cross-compilation.  You must make
13625 your own arrangements to provide suitable library functions for
13626 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
13627 @samp{sparclite-*-*} do provide software floating point support.
13628
13629 @option{-msoft-float} changes the calling convention in the output file;
13630 therefore, it is only useful if you compile @emph{all} of a program with
13631 this option.  In particular, you need to compile @file{libgcc.a}, the
13632 library that comes with GCC, with @option{-msoft-float} in order for
13633 this to work.
13634
13635 @item -mhard-quad-float
13636 @opindex mhard-quad-float
13637 Generate output containing quad-word (long double) floating point
13638 instructions.
13639
13640 @item -msoft-quad-float
13641 @opindex msoft-quad-float
13642 Generate output containing library calls for quad-word (long double)
13643 floating point instructions.  The functions called are those specified
13644 in the SPARC ABI@.  This is the default.
13645
13646 As of this writing, there are no SPARC implementations that have hardware
13647 support for the quad-word floating point instructions.  They all invoke
13648 a trap handler for one of these instructions, and then the trap handler
13649 emulates the effect of the instruction.  Because of the trap handler overhead,
13650 this is much slower than calling the ABI library routines.  Thus the
13651 @option{-msoft-quad-float} option is the default.
13652
13653 @item -mno-unaligned-doubles
13654 @itemx -munaligned-doubles
13655 @opindex mno-unaligned-doubles
13656 @opindex munaligned-doubles
13657 Assume that doubles have 8 byte alignment.  This is the default.
13658
13659 With @option{-munaligned-doubles}, GCC assumes that doubles have 8 byte
13660 alignment only if they are contained in another type, or if they have an
13661 absolute address.  Otherwise, it assumes they have 4 byte alignment.
13662 Specifying this option avoids some rare compatibility problems with code
13663 generated by other compilers.  It is not the default because it results
13664 in a performance loss, especially for floating point code.
13665
13666 @item -mno-faster-structs
13667 @itemx -mfaster-structs
13668 @opindex mno-faster-structs
13669 @opindex mfaster-structs
13670 With @option{-mfaster-structs}, the compiler assumes that structures
13671 should have 8 byte alignment.  This enables the use of pairs of
13672 @code{ldd} and @code{std} instructions for copies in structure
13673 assignment, in place of twice as many @code{ld} and @code{st} pairs.
13674 However, the use of this changed alignment directly violates the SPARC
13675 ABI@.  Thus, it's intended only for use on targets where the developer
13676 acknowledges that their resulting code will not be directly in line with
13677 the rules of the ABI@.
13678
13679 @item -mimpure-text
13680 @opindex mimpure-text
13681 @option{-mimpure-text}, used in addition to @option{-shared}, tells
13682 the compiler to not pass @option{-z text} to the linker when linking a
13683 shared object.  Using this option, you can link position-dependent
13684 code into a shared object.
13685
13686 @option{-mimpure-text} suppresses the ``relocations remain against
13687 allocatable but non-writable sections'' linker error message.
13688 However, the necessary relocations will trigger copy-on-write, and the
13689 shared object is not actually shared across processes.  Instead of
13690 using @option{-mimpure-text}, you should compile all source code with
13691 @option{-fpic} or @option{-fPIC}.
13692
13693 This option is only available on SunOS and Solaris.
13694
13695 @item -mcpu=@var{cpu_type}
13696 @opindex mcpu
13697 Set the instruction set, register set, and instruction scheduling parameters
13698 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
13699 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{sparclite},
13700 @samp{f930}, @samp{f934}, @samp{hypersparc}, @samp{sparclite86x},
13701 @samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc},
13702 @samp{ultrasparc3}, and @samp{niagara}.
13703
13704 Default instruction scheduling parameters are used for values that select
13705 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
13706 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
13707
13708 Here is a list of each supported architecture and their supported
13709 implementations.
13710
13711 @smallexample
13712     v7:             cypress
13713     v8:             supersparc, hypersparc
13714     sparclite:      f930, f934, sparclite86x
13715     sparclet:       tsc701
13716     v9:             ultrasparc, ultrasparc3, niagara
13717 @end smallexample
13718
13719 By default (unless configured otherwise), GCC generates code for the V7
13720 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
13721 additionally optimizes it for the Cypress CY7C602 chip, as used in the
13722 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
13723 SPARCStation 1, 2, IPX etc.
13724
13725 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
13726 architecture.  The only difference from V7 code is that the compiler emits
13727 the integer multiply and integer divide instructions which exist in SPARC-V8
13728 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
13729 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
13730 2000 series.
13731
13732 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
13733 the SPARC architecture.  This adds the integer multiply, integer divide step
13734 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
13735 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
13736 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
13737 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
13738 MB86934 chip, which is the more recent SPARClite with FPU@.
13739
13740 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
13741 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
13742 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
13743 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
13744 optimizes it for the TEMIC SPARClet chip.
13745
13746 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
13747 architecture.  This adds 64-bit integer and floating-point move instructions,
13748 3 additional floating-point condition code registers and conditional move
13749 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
13750 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
13751 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
13752 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
13753 @option{-mcpu=niagara}, the compiler additionally optimizes it for
13754 Sun UltraSPARC T1 chips.
13755
13756 @item -mtune=@var{cpu_type}
13757 @opindex mtune
13758 Set the instruction scheduling parameters for machine type
13759 @var{cpu_type}, but do not set the instruction set or register set that the
13760 option @option{-mcpu=@var{cpu_type}} would.
13761
13762 The same values for @option{-mcpu=@var{cpu_type}} can be used for
13763 @option{-mtune=@var{cpu_type}}, but the only useful values are those
13764 that select a particular cpu implementation.  Those are @samp{cypress},
13765 @samp{supersparc}, @samp{hypersparc}, @samp{f930}, @samp{f934},
13766 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
13767 @samp{ultrasparc3}, and @samp{niagara}.
13768
13769 @item -mv8plus
13770 @itemx -mno-v8plus
13771 @opindex mv8plus
13772 @opindex mno-v8plus
13773 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
13774 difference from the V8 ABI is that the global and out registers are
13775 considered 64-bit wide.  This is enabled by default on Solaris in 32-bit
13776 mode for all SPARC-V9 processors.
13777
13778 @item -mvis
13779 @itemx -mno-vis
13780 @opindex mvis
13781 @opindex mno-vis
13782 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
13783 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
13784 @end table
13785
13786 These @samp{-m} options are supported in addition to the above
13787 on SPARC-V9 processors in 64-bit environments:
13788
13789 @table @gcctabopt
13790 @item -mlittle-endian
13791 @opindex mlittle-endian
13792 Generate code for a processor running in little-endian mode.  It is only
13793 available for a few configurations and most notably not on Solaris and Linux.
13794
13795 @item -m32
13796 @itemx -m64
13797 @opindex m32
13798 @opindex m64
13799 Generate code for a 32-bit or 64-bit environment.
13800 The 32-bit environment sets int, long and pointer to 32 bits.
13801 The 64-bit environment sets int to 32 bits and long and pointer
13802 to 64 bits.
13803
13804 @item -mcmodel=medlow
13805 @opindex mcmodel=medlow
13806 Generate code for the Medium/Low code model: 64-bit addresses, programs
13807 must be linked in the low 32 bits of memory.  Programs can be statically
13808 or dynamically linked.
13809
13810 @item -mcmodel=medmid
13811 @opindex mcmodel=medmid
13812 Generate code for the Medium/Middle code model: 64-bit addresses, programs
13813 must be linked in the low 44 bits of memory, the text and data segments must
13814 be less than 2GB in size and the data segment must be located within 2GB of
13815 the text segment.
13816
13817 @item -mcmodel=medany
13818 @opindex mcmodel=medany
13819 Generate code for the Medium/Anywhere code model: 64-bit addresses, programs
13820 may be linked anywhere in memory, the text and data segments must be less
13821 than 2GB in size and the data segment must be located within 2GB of the
13822 text segment.
13823
13824 @item -mcmodel=embmedany
13825 @opindex mcmodel=embmedany
13826 Generate code for the Medium/Anywhere code model for embedded systems:
13827 64-bit addresses, the text and data segments must be less than 2GB in
13828 size, both starting anywhere in memory (determined at link time).  The
13829 global register %g4 points to the base of the data segment.  Programs
13830 are statically linked and PIC is not supported.
13831
13832 @item -mstack-bias
13833 @itemx -mno-stack-bias
13834 @opindex mstack-bias
13835 @opindex mno-stack-bias
13836 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
13837 frame pointer if present, are offset by @minus{}2047 which must be added back
13838 when making stack frame references.  This is the default in 64-bit mode.
13839 Otherwise, assume no such offset is present.
13840 @end table
13841
13842 These switches are supported in addition to the above on Solaris:
13843
13844 @table @gcctabopt
13845 @item -threads
13846 @opindex threads
13847 Add support for multithreading using the Solaris threads library.  This
13848 option sets flags for both the preprocessor and linker.  This option does
13849 not affect the thread safety of object code produced by the compiler or
13850 that of libraries supplied with it.
13851
13852 @item -pthreads
13853 @opindex pthreads
13854 Add support for multithreading using the POSIX threads library.  This
13855 option sets flags for both the preprocessor and linker.  This option does
13856 not affect the thread safety of object code produced  by the compiler or
13857 that of libraries supplied with it.
13858
13859 @item -pthread
13860 @opindex pthread
13861 This is a synonym for @option{-pthreads}.
13862 @end table
13863
13864 @node SPU Options
13865 @subsection SPU Options
13866 @cindex SPU options
13867
13868 These @samp{-m} options are supported on the SPU:
13869
13870 @table @gcctabopt
13871 @item -mwarn-reloc
13872 @itemx -merror-reloc
13873 @opindex mwarn-reloc
13874 @opindex merror-reloc
13875
13876 The loader for SPU does not handle dynamic relocations.  By default, GCC
13877 will give an error when it generates code that requires a dynamic
13878 relocation.  @option{-mno-error-reloc} disables the error,
13879 @option{-mwarn-reloc} will generate a warning instead.
13880
13881 @item -msafe-dma
13882 @itemx -munsafe-dma
13883 @opindex msafe-dma
13884 @opindex munsafe-dma
13885
13886 Instructions which initiate or test completion of DMA must not be
13887 reordered with respect to loads and stores of the memory which is being
13888 accessed.  Users typically address this problem using the volatile
13889 keyword, but that can lead to inefficient code in places where the
13890 memory is known to not change.  Rather than mark the memory as volatile
13891 we treat the DMA instructions as potentially effecting all memory.  With
13892 @option{-munsafe-dma} users must use the volatile keyword to protect
13893 memory accesses.
13894
13895 @item -mbranch-hints
13896 @opindex mbranch-hints
13897
13898 By default, GCC will generate a branch hint instruction to avoid
13899 pipeline stalls for always taken or probably taken branches.  A hint
13900 will not be generated closer than 8 instructions away from its branch.
13901 There is little reason to disable them, except for debugging purposes,
13902 or to make an object a little bit smaller.
13903
13904 @item -msmall-mem
13905 @itemx -mlarge-mem
13906 @opindex msmall-mem
13907 @opindex mlarge-mem
13908
13909 By default, GCC generates code assuming that addresses are never larger
13910 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
13911 a full 32 bit address.
13912
13913 @item -mstdmain
13914 @opindex mstdmain
13915
13916 By default, GCC links against startup code that assumes the SPU-style
13917 main function interface (which has an unconventional parameter list).
13918 With @option{-mstdmain}, GCC will link your program against startup
13919 code that assumes a C99-style interface to @code{main}, including a
13920 local copy of @code{argv} strings.
13921
13922 @item -mfixed-range=@var{register-range}
13923 @opindex mfixed-range
13924 Generate code treating the given register range as fixed registers.
13925 A fixed register is one that the register allocator can not use.  This is
13926 useful when compiling kernel code.  A register range is specified as
13927 two registers separated by a dash.  Multiple register ranges can be
13928 specified separated by a comma.
13929
13930 @end table
13931
13932 @node System V Options
13933 @subsection Options for System V
13934
13935 These additional options are available on System V Release 4 for
13936 compatibility with other compilers on those systems:
13937
13938 @table @gcctabopt
13939 @item -G
13940 @opindex G
13941 Create a shared object.
13942 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
13943
13944 @item -Qy
13945 @opindex Qy
13946 Identify the versions of each tool used by the compiler, in a
13947 @code{.ident} assembler directive in the output.
13948
13949 @item -Qn
13950 @opindex Qn
13951 Refrain from adding @code{.ident} directives to the output file (this is
13952 the default).
13953
13954 @item -YP,@var{dirs}
13955 @opindex YP
13956 Search the directories @var{dirs}, and no others, for libraries
13957 specified with @option{-l}.
13958
13959 @item -Ym,@var{dir}
13960 @opindex Ym
13961 Look in the directory @var{dir} to find the M4 preprocessor.
13962 The assembler uses this option.
13963 @c This is supposed to go with a -Yd for predefined M4 macro files, but
13964 @c the generic assembler that comes with Solaris takes just -Ym.
13965 @end table
13966
13967 @node TMS320C3x/C4x Options
13968 @subsection TMS320C3x/C4x Options
13969 @cindex TMS320C3x/C4x Options
13970
13971 These @samp{-m} options are defined for TMS320C3x/C4x implementations:
13972
13973 @table @gcctabopt
13974
13975 @item -mcpu=@var{cpu_type}
13976 @opindex mcpu
13977 Set the instruction set, register set, and instruction scheduling
13978 parameters for machine type @var{cpu_type}.  Supported values for
13979 @var{cpu_type} are @samp{c30}, @samp{c31}, @samp{c32}, @samp{c40}, and
13980 @samp{c44}.  The default is @samp{c40} to generate code for the
13981 TMS320C40.
13982
13983 @item -mbig-memory
13984 @itemx -mbig
13985 @itemx -msmall-memory
13986 @itemx -msmall
13987 @opindex mbig-memory
13988 @opindex mbig
13989 @opindex msmall-memory
13990 @opindex msmall
13991 Generates code for the big or small memory model.  The small memory
13992 model assumed that all data fits into one 64K word page.  At run-time
13993 the data page (DP) register must be set to point to the 64K page
13994 containing the .bss and .data program sections.  The big memory model is
13995 the default and requires reloading of the DP register for every direct
13996 memory access.
13997
13998 @item -mbk
13999 @itemx -mno-bk
14000 @opindex mbk
14001 @opindex mno-bk
14002 Allow (disallow) allocation of general integer operands into the block
14003 count register BK@.
14004
14005 @item -mdb
14006 @itemx -mno-db
14007 @opindex mdb
14008 @opindex mno-db
14009 Enable (disable) generation of code using decrement and branch,
14010 DBcond(D), instructions.  This is enabled by default for the C4x.  To be
14011 on the safe side, this is disabled for the C3x, since the maximum
14012 iteration count on the C3x is @math{2^{23} + 1} (but who iterates loops more than
14013 @math{2^{23}} times on the C3x?).  Note that GCC will try to reverse a loop so
14014 that it can utilize the decrement and branch instruction, but will give
14015 up if there is more than one memory reference in the loop.  Thus a loop
14016 where the loop counter is decremented can generate slightly more
14017 efficient code, in cases where the RPTB instruction cannot be utilized.
14018
14019 @item -mdp-isr-reload
14020 @itemx -mparanoid
14021 @opindex mdp-isr-reload
14022 @opindex mparanoid
14023 Force the DP register to be saved on entry to an interrupt service
14024 routine (ISR), reloaded to point to the data section, and restored on
14025 exit from the ISR@.  This should not be required unless someone has
14026 violated the small memory model by modifying the DP register, say within
14027 an object library.
14028
14029 @item -mmpyi
14030 @itemx -mno-mpyi
14031 @opindex mmpyi
14032 @opindex mno-mpyi
14033 For the C3x use the 24-bit MPYI instruction for integer multiplies
14034 instead of a library call to guarantee 32-bit results.  Note that if one
14035 of the operands is a constant, then the multiplication will be performed
14036 using shifts and adds.  If the @option{-mmpyi} option is not specified for the C3x,
14037 then squaring operations are performed inline instead of a library call.
14038
14039 @item -mfast-fix
14040 @itemx -mno-fast-fix
14041 @opindex mfast-fix
14042 @opindex mno-fast-fix
14043 The C3x/C4x FIX instruction to convert a floating point value to an
14044 integer value chooses the nearest integer less than or equal to the
14045 floating point value rather than to the nearest integer.  Thus if the
14046 floating point number is negative, the result will be incorrectly
14047 truncated an additional code is necessary to detect and correct this
14048 case.  This option can be used to disable generation of the additional
14049 code required to correct the result.
14050
14051 @item -mrptb
14052 @itemx -mno-rptb
14053 @opindex mrptb
14054 @opindex mno-rptb
14055 Enable (disable) generation of repeat block sequences using the RPTB
14056 instruction for zero overhead looping.  The RPTB construct is only used
14057 for innermost loops that do not call functions or jump across the loop
14058 boundaries.  There is no advantage having nested RPTB loops due to the
14059 overhead required to save and restore the RC, RS, and RE registers.
14060 This is enabled by default with @option{-O2}.
14061
14062 @item -mrpts=@var{count}
14063 @itemx -mno-rpts
14064 @opindex mrpts
14065 @opindex mno-rpts
14066 Enable (disable) the use of the single instruction repeat instruction
14067 RPTS@.  If a repeat block contains a single instruction, and the loop
14068 count can be guaranteed to be less than the value @var{count}, GCC will
14069 emit a RPTS instruction instead of a RPTB@.  If no value is specified,
14070 then a RPTS will be emitted even if the loop count cannot be determined
14071 at compile time.  Note that the repeated instruction following RPTS does
14072 not have to be reloaded from memory each iteration, thus freeing up the
14073 CPU buses for operands.  However, since interrupts are blocked by this
14074 instruction, it is disabled by default.
14075
14076 @item -mloop-unsigned
14077 @itemx -mno-loop-unsigned
14078 @opindex mloop-unsigned
14079 @opindex mno-loop-unsigned
14080 The maximum iteration count when using RPTS and RPTB (and DB on the C40)
14081 is @math{2^{31} + 1} since these instructions test if the iteration count is
14082 negative to terminate the loop.  If the iteration count is unsigned
14083 there is a possibility than the @math{2^{31} + 1} maximum iteration count may be
14084 exceeded.  This switch allows an unsigned iteration count.
14085
14086 @item -mti
14087 @opindex mti
14088 Try to emit an assembler syntax that the TI assembler (asm30) is happy
14089 with.  This also enforces compatibility with the API employed by the TI
14090 C3x C compiler.  For example, long doubles are passed as structures
14091 rather than in floating point registers.
14092
14093 @item -mregparm
14094 @itemx -mmemparm
14095 @opindex mregparm
14096 @opindex mmemparm
14097 Generate code that uses registers (stack) for passing arguments to functions.
14098 By default, arguments are passed in registers where possible rather
14099 than by pushing arguments on to the stack.
14100
14101 @item -mparallel-insns
14102 @itemx -mno-parallel-insns
14103 @opindex mparallel-insns
14104 @opindex mno-parallel-insns
14105 Allow the generation of parallel instructions.  This is enabled by
14106 default with @option{-O2}.
14107
14108 @item -mparallel-mpy
14109 @itemx -mno-parallel-mpy
14110 @opindex mparallel-mpy
14111 @opindex mno-parallel-mpy
14112 Allow the generation of MPY||ADD and MPY||SUB parallel instructions,
14113 provided @option{-mparallel-insns} is also specified.  These instructions have
14114 tight register constraints which can pessimize the code generation
14115 of large functions.
14116
14117 @end table
14118
14119 @node V850 Options
14120 @subsection V850 Options
14121 @cindex V850 Options
14122
14123 These @samp{-m} options are defined for V850 implementations:
14124
14125 @table @gcctabopt
14126 @item -mlong-calls
14127 @itemx -mno-long-calls
14128 @opindex mlong-calls
14129 @opindex mno-long-calls
14130 Treat all calls as being far away (near).  If calls are assumed to be
14131 far away, the compiler will always load the functions address up into a
14132 register, and call indirect through the pointer.
14133
14134 @item -mno-ep
14135 @itemx -mep
14136 @opindex mno-ep
14137 @opindex mep
14138 Do not optimize (do optimize) basic blocks that use the same index
14139 pointer 4 or more times to copy pointer into the @code{ep} register, and
14140 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
14141 option is on by default if you optimize.
14142
14143 @item -mno-prolog-function
14144 @itemx -mprolog-function
14145 @opindex mno-prolog-function
14146 @opindex mprolog-function
14147 Do not use (do use) external functions to save and restore registers
14148 at the prologue and epilogue of a function.  The external functions
14149 are slower, but use less code space if more than one function saves
14150 the same number of registers.  The @option{-mprolog-function} option
14151 is on by default if you optimize.
14152
14153 @item -mspace
14154 @opindex mspace
14155 Try to make the code as small as possible.  At present, this just turns
14156 on the @option{-mep} and @option{-mprolog-function} options.
14157
14158 @item -mtda=@var{n}
14159 @opindex mtda
14160 Put static or global variables whose size is @var{n} bytes or less into
14161 the tiny data area that register @code{ep} points to.  The tiny data
14162 area can hold up to 256 bytes in total (128 bytes for byte references).
14163
14164 @item -msda=@var{n}
14165 @opindex msda
14166 Put static or global variables whose size is @var{n} bytes or less into
14167 the small data area that register @code{gp} points to.  The small data
14168 area can hold up to 64 kilobytes.
14169
14170 @item -mzda=@var{n}
14171 @opindex mzda
14172 Put static or global variables whose size is @var{n} bytes or less into
14173 the first 32 kilobytes of memory.
14174
14175 @item -mv850
14176 @opindex mv850
14177 Specify that the target processor is the V850.
14178
14179 @item -mbig-switch
14180 @opindex mbig-switch
14181 Generate code suitable for big switch tables.  Use this option only if
14182 the assembler/linker complain about out of range branches within a switch
14183 table.
14184
14185 @item -mapp-regs
14186 @opindex mapp-regs
14187 This option will cause r2 and r5 to be used in the code generated by
14188 the compiler.  This setting is the default.
14189
14190 @item -mno-app-regs
14191 @opindex mno-app-regs
14192 This option will cause r2 and r5 to be treated as fixed registers.
14193
14194 @item -mv850e1
14195 @opindex mv850e1
14196 Specify that the target processor is the V850E1.  The preprocessor
14197 constants @samp{__v850e1__} and @samp{__v850e__} will be defined if
14198 this option is used.
14199
14200 @item -mv850e
14201 @opindex mv850e
14202 Specify that the target processor is the V850E@.  The preprocessor
14203 constant @samp{__v850e__} will be defined if this option is used.
14204
14205 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
14206 are defined then a default target processor will be chosen and the
14207 relevant @samp{__v850*__} preprocessor constant will be defined.
14208
14209 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
14210 defined, regardless of which processor variant is the target.
14211
14212 @item -mdisable-callt
14213 @opindex mdisable-callt
14214 This option will suppress generation of the CALLT instruction for the
14215 v850e and v850e1 flavors of the v850 architecture.  The default is
14216 @option{-mno-disable-callt} which allows the CALLT instruction to be used.
14217
14218 @end table
14219
14220 @node VAX Options
14221 @subsection VAX Options
14222 @cindex VAX options
14223
14224 These @samp{-m} options are defined for the VAX:
14225
14226 @table @gcctabopt
14227 @item -munix
14228 @opindex munix
14229 Do not output certain jump instructions (@code{aobleq} and so on)
14230 that the Unix assembler for the VAX cannot handle across long
14231 ranges.
14232
14233 @item -mgnu
14234 @opindex mgnu
14235 Do output those jump instructions, on the assumption that you
14236 will assemble with the GNU assembler.
14237
14238 @item -mg
14239 @opindex mg
14240 Output code for g-format floating point numbers instead of d-format.
14241 @end table
14242
14243 @node VxWorks Options
14244 @subsection VxWorks Options
14245 @cindex VxWorks Options
14246
14247 The options in this section are defined for all VxWorks targets.
14248 Options specific to the target hardware are listed with the other
14249 options for that target.
14250
14251 @table @gcctabopt
14252 @item -mrtp
14253 @opindex mrtp
14254 GCC can generate code for both VxWorks kernels and real time processes
14255 (RTPs).  This option switches from the former to the latter.  It also
14256 defines the preprocessor macro @code{__RTP__}.
14257
14258 @item -non-static
14259 @opindex non-static
14260 Link an RTP executable against shared libraries rather than static
14261 libraries.  The options @option{-static} and @option{-shared} can
14262 also be used for RTPs (@pxref{Link Options}); @option{-static}
14263 is the default.
14264
14265 @item -Bstatic
14266 @itemx -Bdynamic
14267 @opindex Bstatic
14268 @opindex Bdynamic
14269 These options are passed down to the linker.  They are defined for
14270 compatibility with Diab.
14271
14272 @item -Xbind-lazy
14273 @opindex Xbind-lazy
14274 Enable lazy binding of function calls.  This option is equivalent to
14275 @option{-Wl,-z,now} and is defined for compatibility with Diab.
14276
14277 @item -Xbind-now
14278 @opindex Xbind-now
14279 Disable lazy binding of function calls.  This option is the default and
14280 is defined for compatibility with Diab.
14281 @end table
14282
14283 @node x86-64 Options
14284 @subsection x86-64 Options
14285 @cindex x86-64 options
14286
14287 These are listed under @xref{i386 and x86-64 Options}.
14288
14289 @node Xstormy16 Options
14290 @subsection Xstormy16 Options
14291 @cindex Xstormy16 Options
14292
14293 These options are defined for Xstormy16:
14294
14295 @table @gcctabopt
14296 @item -msim
14297 @opindex msim
14298 Choose startup files and linker script suitable for the simulator.
14299 @end table
14300
14301 @node Xtensa Options
14302 @subsection Xtensa Options
14303 @cindex Xtensa Options
14304
14305 These options are supported for Xtensa targets:
14306
14307 @table @gcctabopt
14308 @item -mconst16
14309 @itemx -mno-const16
14310 @opindex mconst16
14311 @opindex mno-const16
14312 Enable or disable use of @code{CONST16} instructions for loading
14313 constant values.  The @code{CONST16} instruction is currently not a
14314 standard option from Tensilica.  When enabled, @code{CONST16}
14315 instructions are always used in place of the standard @code{L32R}
14316 instructions.  The use of @code{CONST16} is enabled by default only if
14317 the @code{L32R} instruction is not available.
14318
14319 @item -mfused-madd
14320 @itemx -mno-fused-madd
14321 @opindex mfused-madd
14322 @opindex mno-fused-madd
14323 Enable or disable use of fused multiply/add and multiply/subtract
14324 instructions in the floating-point option.  This has no effect if the
14325 floating-point option is not also enabled.  Disabling fused multiply/add
14326 and multiply/subtract instructions forces the compiler to use separate
14327 instructions for the multiply and add/subtract operations.  This may be
14328 desirable in some cases where strict IEEE 754-compliant results are
14329 required: the fused multiply add/subtract instructions do not round the
14330 intermediate result, thereby producing results with @emph{more} bits of
14331 precision than specified by the IEEE standard.  Disabling fused multiply
14332 add/subtract instructions also ensures that the program output is not
14333 sensitive to the compiler's ability to combine multiply and add/subtract
14334 operations.
14335
14336 @item -mtext-section-literals
14337 @itemx -mno-text-section-literals
14338 @opindex mtext-section-literals
14339 @opindex mno-text-section-literals
14340 Control the treatment of literal pools.  The default is
14341 @option{-mno-text-section-literals}, which places literals in a separate
14342 section in the output file.  This allows the literal pool to be placed
14343 in a data RAM/ROM, and it also allows the linker to combine literal
14344 pools from separate object files to remove redundant literals and
14345 improve code size.  With @option{-mtext-section-literals}, the literals
14346 are interspersed in the text section in order to keep them as close as
14347 possible to their references.  This may be necessary for large assembly
14348 files.
14349
14350 @item -mtarget-align
14351 @itemx -mno-target-align
14352 @opindex mtarget-align
14353 @opindex mno-target-align
14354 When this option is enabled, GCC instructs the assembler to
14355 automatically align instructions to reduce branch penalties at the
14356 expense of some code density.  The assembler attempts to widen density
14357 instructions to align branch targets and the instructions following call
14358 instructions.  If there are not enough preceding safe density
14359 instructions to align a target, no widening will be performed.  The
14360 default is @option{-mtarget-align}.  These options do not affect the
14361 treatment of auto-aligned instructions like @code{LOOP}, which the
14362 assembler will always align, either by widening density instructions or
14363 by inserting no-op instructions.
14364
14365 @item -mlongcalls
14366 @itemx -mno-longcalls
14367 @opindex mlongcalls
14368 @opindex mno-longcalls
14369 When this option is enabled, GCC instructs the assembler to translate
14370 direct calls to indirect calls unless it can determine that the target
14371 of a direct call is in the range allowed by the call instruction.  This
14372 translation typically occurs for calls to functions in other source
14373 files.  Specifically, the assembler translates a direct @code{CALL}
14374 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
14375 The default is @option{-mno-longcalls}.  This option should be used in
14376 programs where the call target can potentially be out of range.  This
14377 option is implemented in the assembler, not the compiler, so the
14378 assembly code generated by GCC will still show direct call
14379 instructions---look at the disassembled object code to see the actual
14380 instructions.  Note that the assembler will use an indirect call for
14381 every cross-file call, not just those that really will be out of range.
14382 @end table
14383
14384 @node zSeries Options
14385 @subsection zSeries Options
14386 @cindex zSeries options
14387
14388 These are listed under @xref{S/390 and zSeries Options}.
14389
14390 @node Code Gen Options
14391 @section Options for Code Generation Conventions
14392 @cindex code generation conventions
14393 @cindex options, code generation
14394 @cindex run-time options
14395
14396 These machine-independent options control the interface conventions
14397 used in code generation.
14398
14399 Most of them have both positive and negative forms; the negative form
14400 of @option{-ffoo} would be @option{-fno-foo}.  In the table below, only
14401 one of the forms is listed---the one which is not the default.  You
14402 can figure out the other form by either removing @samp{no-} or adding
14403 it.
14404
14405 @table @gcctabopt
14406 @item -fbounds-check
14407 @opindex fbounds-check
14408 For front-ends that support it, generate additional code to check that
14409 indices used to access arrays are within the declared range.  This is
14410 currently only supported by the Java and Fortran front-ends, where
14411 this option defaults to true and false respectively.
14412
14413 @item -ftrapv
14414 @opindex ftrapv
14415 This option generates traps for signed overflow on addition, subtraction,
14416 multiplication operations.
14417
14418 @item -fwrapv
14419 @opindex fwrapv
14420 This option instructs the compiler to assume that signed arithmetic
14421 overflow of addition, subtraction and multiplication wraps around
14422 using twos-complement representation.  This flag enables some optimizations
14423 and disables others.  This option is enabled by default for the Java
14424 front-end, as required by the Java language specification.
14425
14426 @item -fexceptions
14427 @opindex fexceptions
14428 Enable exception handling.  Generates extra code needed to propagate
14429 exceptions.  For some targets, this implies GCC will generate frame
14430 unwind information for all functions, which can produce significant data
14431 size overhead, although it does not affect execution.  If you do not
14432 specify this option, GCC will enable it by default for languages like
14433 C++ which normally require exception handling, and disable it for
14434 languages like C that do not normally require it.  However, you may need
14435 to enable this option when compiling C code that needs to interoperate
14436 properly with exception handlers written in C++.  You may also wish to
14437 disable this option if you are compiling older C++ programs that don't
14438 use exception handling.
14439
14440 @item -fnon-call-exceptions
14441 @opindex fnon-call-exceptions
14442 Generate code that allows trapping instructions to throw exceptions.
14443 Note that this requires platform-specific runtime support that does
14444 not exist everywhere.  Moreover, it only allows @emph{trapping}
14445 instructions to throw exceptions, i.e.@: memory references or floating
14446 point instructions.  It does not allow exceptions to be thrown from
14447 arbitrary signal handlers such as @code{SIGALRM}.
14448
14449 @item -funwind-tables
14450 @opindex funwind-tables
14451 Similar to @option{-fexceptions}, except that it will just generate any needed
14452 static data, but will not affect the generated code in any other way.
14453 You will normally not enable this option; instead, a language processor
14454 that needs this handling would enable it on your behalf.
14455
14456 @item -fasynchronous-unwind-tables
14457 @opindex fasynchronous-unwind-tables
14458 Generate unwind table in dwarf2 format, if supported by target machine.  The
14459 table is exact at each instruction boundary, so it can be used for stack
14460 unwinding from asynchronous events (such as debugger or garbage collector).
14461
14462 @item -fpcc-struct-return
14463 @opindex fpcc-struct-return
14464 Return ``short'' @code{struct} and @code{union} values in memory like
14465 longer ones, rather than in registers.  This convention is less
14466 efficient, but it has the advantage of allowing intercallability between
14467 GCC-compiled files and files compiled with other compilers, particularly
14468 the Portable C Compiler (pcc).
14469
14470 The precise convention for returning structures in memory depends
14471 on the target configuration macros.
14472
14473 Short structures and unions are those whose size and alignment match
14474 that of some integer type.
14475
14476 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
14477 switch is not binary compatible with code compiled with the
14478 @option{-freg-struct-return} switch.
14479 Use it to conform to a non-default application binary interface.
14480
14481 @item -freg-struct-return
14482 @opindex freg-struct-return
14483 Return @code{struct} and @code{union} values in registers when possible.
14484 This is more efficient for small structures than
14485 @option{-fpcc-struct-return}.
14486
14487 If you specify neither @option{-fpcc-struct-return} nor
14488 @option{-freg-struct-return}, GCC defaults to whichever convention is
14489 standard for the target.  If there is no standard convention, GCC
14490 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
14491 the principal compiler.  In those cases, we can choose the standard, and
14492 we chose the more efficient register return alternative.
14493
14494 @strong{Warning:} code compiled with the @option{-freg-struct-return}
14495 switch is not binary compatible with code compiled with the
14496 @option{-fpcc-struct-return} switch.
14497 Use it to conform to a non-default application binary interface.
14498
14499 @item -fshort-enums
14500 @opindex fshort-enums
14501 Allocate to an @code{enum} type only as many bytes as it needs for the
14502 declared range of possible values.  Specifically, the @code{enum} type
14503 will be equivalent to the smallest integer type which has enough room.
14504
14505 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
14506 code that is not binary compatible with code generated without that switch.
14507 Use it to conform to a non-default application binary interface.
14508
14509 @item -fshort-double
14510 @opindex fshort-double
14511 Use the same size for @code{double} as for @code{float}.
14512
14513 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
14514 code that is not binary compatible with code generated without that switch.
14515 Use it to conform to a non-default application binary interface.
14516
14517 @item -fshort-wchar
14518 @opindex fshort-wchar
14519 Override the underlying type for @samp{wchar_t} to be @samp{short
14520 unsigned int} instead of the default for the target.  This option is
14521 useful for building programs to run under WINE@.
14522
14523 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
14524 code that is not binary compatible with code generated without that switch.
14525 Use it to conform to a non-default application binary interface.
14526
14527 @item -fno-common
14528 @opindex fno-common
14529 In C, allocate even uninitialized global variables in the data section of the
14530 object file, rather than generating them as common blocks.  This has the
14531 effect that if the same variable is declared (without @code{extern}) in
14532 two different compilations, you will get an error when you link them.
14533 The only reason this might be useful is if you wish to verify that the
14534 program will work on other systems which always work this way.
14535
14536 @item -fno-ident
14537 @opindex fno-ident
14538 Ignore the @samp{#ident} directive.
14539
14540 @item -finhibit-size-directive
14541 @opindex finhibit-size-directive
14542 Don't output a @code{.size} assembler directive, or anything else that
14543 would cause trouble if the function is split in the middle, and the
14544 two halves are placed at locations far apart in memory.  This option is
14545 used when compiling @file{crtstuff.c}; you should not need to use it
14546 for anything else.
14547
14548 @item -fverbose-asm
14549 @opindex fverbose-asm
14550 Put extra commentary information in the generated assembly code to
14551 make it more readable.  This option is generally only of use to those
14552 who actually need to read the generated assembly code (perhaps while
14553 debugging the compiler itself).
14554
14555 @option{-fno-verbose-asm}, the default, causes the
14556 extra information to be omitted and is useful when comparing two assembler
14557 files.
14558
14559 @item -frecord-gcc-switches
14560 @opindex frecord-gcc-switches
14561 This switch causes the command line that was used to invoke the
14562 compiler to be recorded into the object file that is being created.
14563 This switch is only implemented on some targets and the exact format
14564 of the recording is target and binary file format dependent, but it
14565 usually takes the form of a section containing ASCII text.  This
14566 switch is related to the @option{-fverbose-asm} switch, but that
14567 switch only records information in the assembler output file as
14568 comments, so it never reaches the object file.
14569
14570 @item -fpic
14571 @opindex fpic
14572 @cindex global offset table
14573 @cindex PIC
14574 Generate position-independent code (PIC) suitable for use in a shared
14575 library, if supported for the target machine.  Such code accesses all
14576 constant addresses through a global offset table (GOT)@.  The dynamic
14577 loader resolves the GOT entries when the program starts (the dynamic
14578 loader is not part of GCC; it is part of the operating system).  If
14579 the GOT size for the linked executable exceeds a machine-specific
14580 maximum size, you get an error message from the linker indicating that
14581 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
14582 instead.  (These maximums are 8k on the SPARC and 32k
14583 on the m68k and RS/6000.  The 386 has no such limit.)
14584
14585 Position-independent code requires special support, and therefore works
14586 only on certain machines.  For the 386, GCC supports PIC for System V
14587 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
14588 position-independent.
14589
14590 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
14591 are defined to 1.
14592
14593 @item -fPIC
14594 @opindex fPIC
14595 If supported for the target machine, emit position-independent code,
14596 suitable for dynamic linking and avoiding any limit on the size of the
14597 global offset table.  This option makes a difference on the m68k,
14598 PowerPC and SPARC@.
14599
14600 Position-independent code requires special support, and therefore works
14601 only on certain machines.
14602
14603 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
14604 are defined to 2.
14605
14606 @item -fpie
14607 @itemx -fPIE
14608 @opindex fpie
14609 @opindex fPIE
14610 These options are similar to @option{-fpic} and @option{-fPIC}, but
14611 generated position independent code can be only linked into executables.
14612 Usually these options are used when @option{-pie} GCC option will be
14613 used during linking.
14614
14615 @option{-fpie} and @option{-fPIE} both define the macros
14616 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
14617 for @option{-fpie} and 2 for @option{-fPIE}.
14618
14619 @item -fno-jump-tables
14620 @opindex fno-jump-tables
14621 Do not use jump tables for switch statements even where it would be
14622 more efficient than other code generation strategies.  This option is
14623 of use in conjunction with @option{-fpic} or @option{-fPIC} for
14624 building code which forms part of a dynamic linker and cannot
14625 reference the address of a jump table.  On some targets, jump tables
14626 do not require a GOT and this option is not needed.
14627
14628 @item -ffixed-@var{reg}
14629 @opindex ffixed
14630 Treat the register named @var{reg} as a fixed register; generated code
14631 should never refer to it (except perhaps as a stack pointer, frame
14632 pointer or in some other fixed role).
14633
14634 @var{reg} must be the name of a register.  The register names accepted
14635 are machine-specific and are defined in the @code{REGISTER_NAMES}
14636 macro in the machine description macro file.
14637
14638 This flag does not have a negative form, because it specifies a
14639 three-way choice.
14640
14641 @item -fcall-used-@var{reg}
14642 @opindex fcall-used
14643 Treat the register named @var{reg} as an allocable register that is
14644 clobbered by function calls.  It may be allocated for temporaries or
14645 variables that do not live across a call.  Functions compiled this way
14646 will not save and restore the register @var{reg}.
14647
14648 It is an error to used this flag with the frame pointer or stack pointer.
14649 Use of this flag for other registers that have fixed pervasive roles in
14650 the machine's execution model will produce disastrous results.
14651
14652 This flag does not have a negative form, because it specifies a
14653 three-way choice.
14654
14655 @item -fcall-saved-@var{reg}
14656 @opindex fcall-saved
14657 Treat the register named @var{reg} as an allocable register saved by
14658 functions.  It may be allocated even for temporaries or variables that
14659 live across a call.  Functions compiled this way will save and restore
14660 the register @var{reg} if they use it.
14661
14662 It is an error to used this flag with the frame pointer or stack pointer.
14663 Use of this flag for other registers that have fixed pervasive roles in
14664 the machine's execution model will produce disastrous results.
14665
14666 A different sort of disaster will result from the use of this flag for
14667 a register in which function values may be returned.
14668
14669 This flag does not have a negative form, because it specifies a
14670 three-way choice.
14671
14672 @item -fpack-struct[=@var{n}]
14673 @opindex fpack-struct
14674 Without a value specified, pack all structure members together without
14675 holes.  When a value is specified (which must be a small power of two), pack
14676 structure members according to this value, representing the maximum
14677 alignment (that is, objects with default alignment requirements larger than
14678 this will be output potentially unaligned at the next fitting location.
14679
14680 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
14681 code that is not binary compatible with code generated without that switch.
14682 Additionally, it makes the code suboptimal.
14683 Use it to conform to a non-default application binary interface.
14684
14685 @item -finstrument-functions
14686 @opindex finstrument-functions
14687 Generate instrumentation calls for entry and exit to functions.  Just
14688 after function entry and just before function exit, the following
14689 profiling functions will be called with the address of the current
14690 function and its call site.  (On some platforms,
14691 @code{__builtin_return_address} does not work beyond the current
14692 function, so the call site information may not be available to the
14693 profiling functions otherwise.)
14694
14695 @smallexample
14696 void __cyg_profile_func_enter (void *this_fn,
14697                                void *call_site);
14698 void __cyg_profile_func_exit  (void *this_fn,
14699                                void *call_site);
14700 @end smallexample
14701
14702 The first argument is the address of the start of the current function,
14703 which may be looked up exactly in the symbol table.
14704
14705 This instrumentation is also done for functions expanded inline in other
14706 functions.  The profiling calls will indicate where, conceptually, the
14707 inline function is entered and exited.  This means that addressable
14708 versions of such functions must be available.  If all your uses of a
14709 function are expanded inline, this may mean an additional expansion of
14710 code size.  If you use @samp{extern inline} in your C code, an
14711 addressable version of such functions must be provided.  (This is
14712 normally the case anyways, but if you get lucky and the optimizer always
14713 expands the functions inline, you might have gotten away without
14714 providing static copies.)
14715
14716 A function may be given the attribute @code{no_instrument_function}, in
14717 which case this instrumentation will not be done.  This can be used, for
14718 example, for the profiling functions listed above, high-priority
14719 interrupt routines, and any functions from which the profiling functions
14720 cannot safely be called (perhaps signal handlers, if the profiling
14721 routines generate output or allocate memory).
14722
14723 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
14724 @opindex finstrument-functions-exclude-file-list
14725
14726 Set the list of functions that are excluded from instrumentation (see
14727 the description of @code{-finstrument-functions}).  If the file that
14728 contains a function definition matches with one of @var{file}, then
14729 that function is not instrumented.  The match is done on substrings:
14730 if the @var{file} parameter is a substring of the file name, it is
14731 considered to be a match.
14732
14733 For example,
14734 @code{-finstrument-functions-exclude-file-list=/bits/stl,include/sys}
14735 will exclude any inline function defined in files whose pathnames
14736 contain @code{/bits/stl} or @code{include/sys}.
14737
14738 If, for some reason, you want to include letter @code{','} in one of
14739 @var{sym}, write @code{'\,'}. For example,
14740 @code{-finstrument-functions-exclude-file-list='\,\,tmp'}
14741 (note the single quote surrounding the option).
14742
14743 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
14744 @opindex finstrument-functions-exclude-function-list
14745
14746 This is similar to @code{-finstrument-functions-exclude-file-list},
14747 but this option sets the list of function names to be excluded from
14748 instrumentation.  The function name to be matched is its user-visible
14749 name, such as @code{vector<int> blah(const vector<int> &)}, not the
14750 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
14751 match is done on substrings: if the @var{sym} parameter is a substring
14752 of the function name, it is considered to be a match.
14753
14754 @item -fstack-check
14755 @opindex fstack-check
14756 Generate code to verify that you do not go beyond the boundary of the
14757 stack.  You should specify this flag if you are running in an
14758 environment with multiple threads, but only rarely need to specify it in
14759 a single-threaded environment since stack overflow is automatically
14760 detected on nearly all systems if there is only one stack.
14761
14762 Note that this switch does not actually cause checking to be done; the
14763 operating system must do that.  The switch causes generation of code
14764 to ensure that the operating system sees the stack being extended.
14765
14766 @item -fstack-limit-register=@var{reg}
14767 @itemx -fstack-limit-symbol=@var{sym}
14768 @itemx -fno-stack-limit
14769 @opindex fstack-limit-register
14770 @opindex fstack-limit-symbol
14771 @opindex fno-stack-limit
14772 Generate code to ensure that the stack does not grow beyond a certain value,
14773 either the value of a register or the address of a symbol.  If the stack
14774 would grow beyond the value, a signal is raised.  For most targets,
14775 the signal is raised before the stack overruns the boundary, so
14776 it is possible to catch the signal without taking special precautions.
14777
14778 For instance, if the stack starts at absolute address @samp{0x80000000}
14779 and grows downwards, you can use the flags
14780 @option{-fstack-limit-symbol=__stack_limit} and
14781 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
14782 of 128KB@.  Note that this may only work with the GNU linker.
14783
14784 @cindex aliasing of parameters
14785 @cindex parameters, aliased
14786 @item -fargument-alias
14787 @itemx -fargument-noalias
14788 @itemx -fargument-noalias-global
14789 @itemx -fargument-noalias-anything
14790 @opindex fargument-alias
14791 @opindex fargument-noalias
14792 @opindex fargument-noalias-global
14793 @opindex fargument-noalias-anything
14794 Specify the possible relationships among parameters and between
14795 parameters and global data.
14796
14797 @option{-fargument-alias} specifies that arguments (parameters) may
14798 alias each other and may alias global storage.@*
14799 @option{-fargument-noalias} specifies that arguments do not alias
14800 each other, but may alias global storage.@*
14801 @option{-fargument-noalias-global} specifies that arguments do not
14802 alias each other and do not alias global storage.
14803 @option{-fargument-noalias-anything} specifies that arguments do not
14804 alias any other storage.
14805
14806 Each language will automatically use whatever option is required by
14807 the language standard.  You should not need to use these options yourself.
14808
14809 @item -fleading-underscore
14810 @opindex fleading-underscore
14811 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
14812 change the way C symbols are represented in the object file.  One use
14813 is to help link with legacy assembly code.
14814
14815 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
14816 generate code that is not binary compatible with code generated without that
14817 switch.  Use it to conform to a non-default application binary interface.
14818 Not all targets provide complete support for this switch.
14819
14820 @item -ftls-model=@var{model}
14821 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
14822 The @var{model} argument should be one of @code{global-dynamic},
14823 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
14824
14825 The default without @option{-fpic} is @code{initial-exec}; with
14826 @option{-fpic} the default is @code{global-dynamic}.
14827
14828 @item -fvisibility=@var{default|internal|hidden|protected}
14829 @opindex fvisibility
14830 Set the default ELF image symbol visibility to the specified option---all
14831 symbols will be marked with this unless overridden within the code.
14832 Using this feature can very substantially improve linking and
14833 load times of shared object libraries, produce more optimized
14834 code, provide near-perfect API export and prevent symbol clashes.
14835 It is @strong{strongly} recommended that you use this in any shared objects
14836 you distribute.
14837
14838 Despite the nomenclature, @code{default} always means public ie;
14839 available to be linked against from outside the shared object.
14840 @code{protected} and @code{internal} are pretty useless in real-world
14841 usage so the only other commonly used option will be @code{hidden}.
14842 The default if @option{-fvisibility} isn't specified is
14843 @code{default}, i.e., make every
14844 symbol public---this causes the same behavior as previous versions of
14845 GCC@.
14846
14847 A good explanation of the benefits offered by ensuring ELF
14848 symbols have the correct visibility is given by ``How To Write
14849 Shared Libraries'' by Ulrich Drepper (which can be found at
14850 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
14851 solution made possible by this option to marking things hidden when
14852 the default is public is to make the default hidden and mark things
14853 public.  This is the norm with DLL's on Windows and with @option{-fvisibility=hidden}
14854 and @code{__attribute__ ((visibility("default")))} instead of
14855 @code{__declspec(dllexport)} you get almost identical semantics with
14856 identical syntax.  This is a great boon to those working with
14857 cross-platform projects.
14858
14859 For those adding visibility support to existing code, you may find
14860 @samp{#pragma GCC visibility} of use.  This works by you enclosing
14861 the declarations you wish to set visibility for with (for example)
14862 @samp{#pragma GCC visibility push(hidden)} and
14863 @samp{#pragma GCC visibility pop}.
14864 Bear in mind that symbol visibility should be viewed @strong{as
14865 part of the API interface contract} and thus all new code should
14866 always specify visibility when it is not the default ie; declarations
14867 only for use within the local DSO should @strong{always} be marked explicitly
14868 as hidden as so to avoid PLT indirection overheads---making this
14869 abundantly clear also aids readability and self-documentation of the code.
14870 Note that due to ISO C++ specification requirements, operator new and
14871 operator delete must always be of default visibility.
14872
14873 Be aware that headers from outside your project, in particular system
14874 headers and headers from any other library you use, may not be
14875 expecting to be compiled with visibility other than the default.  You
14876 may need to explicitly say @samp{#pragma GCC visibility push(default)}
14877 before including any such headers.
14878
14879 @samp{extern} declarations are not affected by @samp{-fvisibility}, so
14880 a lot of code can be recompiled with @samp{-fvisibility=hidden} with
14881 no modifications.  However, this means that calls to @samp{extern}
14882 functions with no explicit visibility will use the PLT, so it is more
14883 effective to use @samp{__attribute ((visibility))} and/or
14884 @samp{#pragma GCC visibility} to tell the compiler which @samp{extern}
14885 declarations should be treated as hidden.
14886
14887 Note that @samp{-fvisibility} does affect C++ vague linkage
14888 entities. This means that, for instance, an exception class that will
14889 be thrown between DSOs must be explicitly marked with default
14890 visibility so that the @samp{type_info} nodes will be unified between
14891 the DSOs.
14892
14893 An overview of these techniques, their benefits and how to use them
14894 is at @w{@uref{http://gcc.gnu.org/wiki/Visibility}}.
14895
14896 @end table
14897
14898 @c man end
14899
14900 @node Environment Variables
14901 @section Environment Variables Affecting GCC
14902 @cindex environment variables
14903
14904 @c man begin ENVIRONMENT
14905 This section describes several environment variables that affect how GCC
14906 operates.  Some of them work by specifying directories or prefixes to use
14907 when searching for various kinds of files.  Some are used to specify other
14908 aspects of the compilation environment.
14909
14910 Note that you can also specify places to search using options such as
14911 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
14912 take precedence over places specified using environment variables, which
14913 in turn take precedence over those specified by the configuration of GCC@.
14914 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
14915 GNU Compiler Collection (GCC) Internals}.
14916
14917 @table @env
14918 @item LANG
14919 @itemx LC_CTYPE
14920 @c @itemx LC_COLLATE
14921 @itemx LC_MESSAGES
14922 @c @itemx LC_MONETARY
14923 @c @itemx LC_NUMERIC
14924 @c @itemx LC_TIME
14925 @itemx LC_ALL
14926 @findex LANG
14927 @findex LC_CTYPE
14928 @c @findex LC_COLLATE
14929 @findex LC_MESSAGES
14930 @c @findex LC_MONETARY
14931 @c @findex LC_NUMERIC
14932 @c @findex LC_TIME
14933 @findex LC_ALL
14934 @cindex locale
14935 These environment variables control the way that GCC uses
14936 localization information that allow GCC to work with different
14937 national conventions.  GCC inspects the locale categories
14938 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
14939 so.  These locale categories can be set to any value supported by your
14940 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
14941 Kingdom encoded in UTF-8.
14942
14943 The @env{LC_CTYPE} environment variable specifies character
14944 classification.  GCC uses it to determine the character boundaries in
14945 a string; this is needed for some multibyte encodings that contain quote
14946 and escape characters that would otherwise be interpreted as a string
14947 end or escape.
14948
14949 The @env{LC_MESSAGES} environment variable specifies the language to
14950 use in diagnostic messages.
14951
14952 If the @env{LC_ALL} environment variable is set, it overrides the value
14953 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
14954 and @env{LC_MESSAGES} default to the value of the @env{LANG}
14955 environment variable.  If none of these variables are set, GCC
14956 defaults to traditional C English behavior.
14957
14958 @item TMPDIR
14959 @findex TMPDIR
14960 If @env{TMPDIR} is set, it specifies the directory to use for temporary
14961 files.  GCC uses temporary files to hold the output of one stage of
14962 compilation which is to be used as input to the next stage: for example,
14963 the output of the preprocessor, which is the input to the compiler
14964 proper.
14965
14966 @item GCC_EXEC_PREFIX
14967 @findex GCC_EXEC_PREFIX
14968 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
14969 names of the subprograms executed by the compiler.  No slash is added
14970 when this prefix is combined with the name of a subprogram, but you can
14971 specify a prefix that ends with a slash if you wish.
14972
14973 If @env{GCC_EXEC_PREFIX} is not set, GCC will attempt to figure out
14974 an appropriate prefix to use based on the pathname it was invoked with.
14975
14976 If GCC cannot find the subprogram using the specified prefix, it
14977 tries looking in the usual places for the subprogram.
14978
14979 The default value of @env{GCC_EXEC_PREFIX} is
14980 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
14981 the installed compiler. In many cases @var{prefix} is the value
14982 of @code{prefix} when you ran the @file{configure} script.
14983
14984 Other prefixes specified with @option{-B} take precedence over this prefix.
14985
14986 This prefix is also used for finding files such as @file{crt0.o} that are
14987 used for linking.
14988
14989 In addition, the prefix is used in an unusual way in finding the
14990 directories to search for header files.  For each of the standard
14991 directories whose name normally begins with @samp{/usr/local/lib/gcc}
14992 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
14993 replacing that beginning with the specified prefix to produce an
14994 alternate directory name.  Thus, with @option{-Bfoo/}, GCC will search
14995 @file{foo/bar} where it would normally search @file{/usr/local/lib/bar}.
14996 These alternate directories are searched first; the standard directories
14997 come next. If a standard directory begins with the configured
14998 @var{prefix} then the value of @var{prefix} is replaced by
14999 @env{GCC_EXEC_PREFIX} when looking for header files.
15000
15001 @item COMPILER_PATH
15002 @findex COMPILER_PATH
15003 The value of @env{COMPILER_PATH} is a colon-separated list of
15004 directories, much like @env{PATH}.  GCC tries the directories thus
15005 specified when searching for subprograms, if it can't find the
15006 subprograms using @env{GCC_EXEC_PREFIX}.
15007
15008 @item LIBRARY_PATH
15009 @findex LIBRARY_PATH
15010 The value of @env{LIBRARY_PATH} is a colon-separated list of
15011 directories, much like @env{PATH}.  When configured as a native compiler,
15012 GCC tries the directories thus specified when searching for special
15013 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
15014 using GCC also uses these directories when searching for ordinary
15015 libraries for the @option{-l} option (but directories specified with
15016 @option{-L} come first).
15017
15018 @item LANG
15019 @findex LANG
15020 @cindex locale definition
15021 This variable is used to pass locale information to the compiler.  One way in
15022 which this information is used is to determine the character set to be used
15023 when character literals, string literals and comments are parsed in C and C++.
15024 When the compiler is configured to allow multibyte characters,
15025 the following values for @env{LANG} are recognized:
15026
15027 @table @samp
15028 @item C-JIS
15029 Recognize JIS characters.
15030 @item C-SJIS
15031 Recognize SJIS characters.
15032 @item C-EUCJP
15033 Recognize EUCJP characters.
15034 @end table
15035
15036 If @env{LANG} is not defined, or if it has some other value, then the
15037 compiler will use mblen and mbtowc as defined by the default locale to
15038 recognize and translate multibyte characters.
15039 @end table
15040
15041 @noindent
15042 Some additional environments variables affect the behavior of the
15043 preprocessor.
15044
15045 @include cppenv.texi
15046
15047 @c man end
15048
15049 @node Precompiled Headers
15050 @section Using Precompiled Headers
15051 @cindex precompiled headers
15052 @cindex speed of compilation
15053
15054 Often large projects have many header files that are included in every
15055 source file.  The time the compiler takes to process these header files
15056 over and over again can account for nearly all of the time required to
15057 build the project.  To make builds faster, GCC allows users to
15058 `precompile' a header file; then, if builds can use the precompiled
15059 header file they will be much faster.
15060
15061 To create a precompiled header file, simply compile it as you would any
15062 other file, if necessary using the @option{-x} option to make the driver
15063 treat it as a C or C++ header file.  You will probably want to use a
15064 tool like @command{make} to keep the precompiled header up-to-date when
15065 the headers it contains change.
15066
15067 A precompiled header file will be searched for when @code{#include} is
15068 seen in the compilation.  As it searches for the included file
15069 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
15070 compiler looks for a precompiled header in each directory just before it
15071 looks for the include file in that directory.  The name searched for is
15072 the name specified in the @code{#include} with @samp{.gch} appended.  If
15073 the precompiled header file can't be used, it is ignored.
15074
15075 For instance, if you have @code{#include "all.h"}, and you have
15076 @file{all.h.gch} in the same directory as @file{all.h}, then the
15077 precompiled header file will be used if possible, and the original
15078 header will be used otherwise.
15079
15080 Alternatively, you might decide to put the precompiled header file in a
15081 directory and use @option{-I} to ensure that directory is searched
15082 before (or instead of) the directory containing the original header.
15083 Then, if you want to check that the precompiled header file is always
15084 used, you can put a file of the same name as the original header in this
15085 directory containing an @code{#error} command.
15086
15087 This also works with @option{-include}.  So yet another way to use
15088 precompiled headers, good for projects not designed with precompiled
15089 header files in mind, is to simply take most of the header files used by
15090 a project, include them from another header file, precompile that header
15091 file, and @option{-include} the precompiled header.  If the header files
15092 have guards against multiple inclusion, they will be skipped because
15093 they've already been included (in the precompiled header).
15094
15095 If you need to precompile the same header file for different
15096 languages, targets, or compiler options, you can instead make a
15097 @emph{directory} named like @file{all.h.gch}, and put each precompiled
15098 header in the directory, perhaps using @option{-o}.  It doesn't matter
15099 what you call the files in the directory, every precompiled header in
15100 the directory will be considered.  The first precompiled header
15101 encountered in the directory that is valid for this compilation will
15102 be used; they're searched in no particular order.
15103
15104 There are many other possibilities, limited only by your imagination,
15105 good sense, and the constraints of your build system.
15106
15107 A precompiled header file can be used only when these conditions apply:
15108
15109 @itemize
15110 @item
15111 Only one precompiled header can be used in a particular compilation.
15112
15113 @item
15114 A precompiled header can't be used once the first C token is seen.  You
15115 can have preprocessor directives before a precompiled header; you can
15116 even include a precompiled header from inside another header, so long as
15117 there are no C tokens before the @code{#include}.
15118
15119 @item
15120 The precompiled header file must be produced for the same language as
15121 the current compilation.  You can't use a C precompiled header for a C++
15122 compilation.
15123
15124 @item
15125 The precompiled header file must have been produced by the same compiler
15126 binary as the current compilation is using.
15127
15128 @item
15129 Any macros defined before the precompiled header is included must
15130 either be defined in the same way as when the precompiled header was
15131 generated, or must not affect the precompiled header, which usually
15132 means that they don't appear in the precompiled header at all.
15133
15134 The @option{-D} option is one way to define a macro before a
15135 precompiled header is included; using a @code{#define} can also do it.
15136 There are also some options that define macros implicitly, like
15137 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
15138 defined this way.
15139
15140 @item If debugging information is output when using the precompiled
15141 header, using @option{-g} or similar, the same kind of debugging information
15142 must have been output when building the precompiled header.  However,
15143 a precompiled header built using @option{-g} can be used in a compilation
15144 when no debugging information is being output.
15145
15146 @item The same @option{-m} options must generally be used when building
15147 and using the precompiled header.  @xref{Submodel Options},
15148 for any cases where this rule is relaxed.
15149
15150 @item Each of the following options must be the same when building and using
15151 the precompiled header:
15152
15153 @gccoptlist{-fexceptions -funit-at-a-time}
15154
15155 @item
15156 Some other command-line options starting with @option{-f},
15157 @option{-p}, or @option{-O} must be defined in the same way as when
15158 the precompiled header was generated.  At present, it's not clear
15159 which options are safe to change and which are not; the safest choice
15160 is to use exactly the same options when generating and using the
15161 precompiled header.  The following are known to be safe:
15162
15163 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
15164 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
15165 -fsched-verbose=<number>  -fschedule-insns  -fvisibility= @gol
15166 -pedantic-errors}
15167
15168 @end itemize
15169
15170 For all of these except the last, the compiler will automatically
15171 ignore the precompiled header if the conditions aren't met.  If you
15172 find an option combination that doesn't work and doesn't cause the
15173 precompiled header to be ignored, please consider filing a bug report,
15174 see @ref{Bugs}.
15175
15176 If you do use differing options when generating and using the
15177 precompiled header, the actual behavior will be a mixture of the
15178 behavior for the options.  For instance, if you use @option{-g} to
15179 generate the precompiled header but not when using it, you may or may
15180 not get debugging information for routines in the precompiled header.
15181
15182 @node Running Protoize
15183 @section Running Protoize
15184
15185 The program @code{protoize} is an optional part of GCC@.  You can use
15186 it to add prototypes to a program, thus converting the program to ISO
15187 C in one respect.  The companion program @code{unprotoize} does the
15188 reverse: it removes argument types from any prototypes that are found.
15189
15190 When you run these programs, you must specify a set of source files as
15191 command line arguments.  The conversion programs start out by compiling
15192 these files to see what functions they define.  The information gathered
15193 about a file @var{foo} is saved in a file named @file{@var{foo}.X}.
15194
15195 After scanning comes actual conversion.  The specified files are all
15196 eligible to be converted; any files they include (whether sources or
15197 just headers) are eligible as well.
15198
15199 But not all the eligible files are converted.  By default,
15200 @code{protoize} and @code{unprotoize} convert only source and header
15201 files in the current directory.  You can specify additional directories
15202 whose files should be converted with the @option{-d @var{directory}}
15203 option.  You can also specify particular files to exclude with the
15204 @option{-x @var{file}} option.  A file is converted if it is eligible, its
15205 directory name matches one of the specified directory names, and its
15206 name within the directory has not been excluded.
15207
15208 Basic conversion with @code{protoize} consists of rewriting most
15209 function definitions and function declarations to specify the types of
15210 the arguments.  The only ones not rewritten are those for varargs
15211 functions.
15212
15213 @code{protoize} optionally inserts prototype declarations at the
15214 beginning of the source file, to make them available for any calls that
15215 precede the function's definition.  Or it can insert prototype
15216 declarations with block scope in the blocks where undeclared functions
15217 are called.
15218
15219 Basic conversion with @code{unprotoize} consists of rewriting most
15220 function declarations to remove any argument types, and rewriting
15221 function definitions to the old-style pre-ISO form.
15222
15223 Both conversion programs print a warning for any function declaration or
15224 definition that they can't convert.  You can suppress these warnings
15225 with @option{-q}.
15226
15227 The output from @code{protoize} or @code{unprotoize} replaces the
15228 original source file.  The original file is renamed to a name ending
15229 with @samp{.save} (for DOS, the saved filename ends in @samp{.sav}
15230 without the original @samp{.c} suffix).  If the @samp{.save} (@samp{.sav}
15231 for DOS) file already exists, then the source file is simply discarded.
15232
15233 @code{protoize} and @code{unprotoize} both depend on GCC itself to
15234 scan the program and collect information about the functions it uses.
15235 So neither of these programs will work until GCC is installed.
15236
15237 Here is a table of the options you can use with @code{protoize} and
15238 @code{unprotoize}.  Each option works with both programs unless
15239 otherwise stated.
15240
15241 @table @code
15242 @item -B @var{directory}
15243 Look for the file @file{SYSCALLS.c.X} in @var{directory}, instead of the
15244 usual directory (normally @file{/usr/local/lib}).  This file contains
15245 prototype information about standard system functions.  This option
15246 applies only to @code{protoize}.
15247
15248 @item -c @var{compilation-options}
15249 Use @var{compilation-options} as the options when running @command{gcc} to
15250 produce the @samp{.X} files.  The special option @option{-aux-info} is
15251 always passed in addition, to tell @command{gcc} to write a @samp{.X} file.
15252
15253 Note that the compilation options must be given as a single argument to
15254 @code{protoize} or @code{unprotoize}.  If you want to specify several
15255 @command{gcc} options, you must quote the entire set of compilation options
15256 to make them a single word in the shell.
15257
15258 There are certain @command{gcc} arguments that you cannot use, because they
15259 would produce the wrong kind of output.  These include @option{-g},
15260 @option{-O}, @option{-c}, @option{-S}, and @option{-o} If you include these in
15261 the @var{compilation-options}, they are ignored.
15262
15263 @item -C
15264 Rename files to end in @samp{.C} (@samp{.cc} for DOS-based file
15265 systems) instead of @samp{.c}.  This is convenient if you are converting
15266 a C program to C++.  This option applies only to @code{protoize}.
15267
15268 @item -g
15269 Add explicit global declarations.  This means inserting explicit
15270 declarations at the beginning of each source file for each function
15271 that is called in the file and was not declared.  These declarations
15272 precede the first function definition that contains a call to an
15273 undeclared function.  This option applies only to @code{protoize}.
15274
15275 @item -i @var{string}
15276 Indent old-style parameter declarations with the string @var{string}.
15277 This option applies only to @code{protoize}.
15278
15279 @code{unprotoize} converts prototyped function definitions to old-style
15280 function definitions, where the arguments are declared between the
15281 argument list and the initial @samp{@{}.  By default, @code{unprotoize}
15282 uses five spaces as the indentation.  If you want to indent with just
15283 one space instead, use @option{-i " "}.
15284
15285 @item -k
15286 Keep the @samp{.X} files.  Normally, they are deleted after conversion
15287 is finished.
15288
15289 @item -l
15290 Add explicit local declarations.  @code{protoize} with @option{-l} inserts
15291 a prototype declaration for each function in each block which calls the
15292 function without any declaration.  This option applies only to
15293 @code{protoize}.
15294
15295 @item -n
15296 Make no real changes.  This mode just prints information about the conversions
15297 that would have been done without @option{-n}.
15298
15299 @item -N
15300 Make no @samp{.save} files.  The original files are simply deleted.
15301 Use this option with caution.
15302
15303 @item -p @var{program}
15304 Use the program @var{program} as the compiler.  Normally, the name
15305 @file{gcc} is used.
15306
15307 @item -q
15308 Work quietly.  Most warnings are suppressed.
15309
15310 @item -v
15311 Print the version number, just like @option{-v} for @command{gcc}.
15312 @end table
15313
15314 If you need special compiler options to compile one of your program's
15315 source files, then you should generate that file's @samp{.X} file
15316 specially, by running @command{gcc} on that source file with the
15317 appropriate options and the option @option{-aux-info}.  Then run
15318 @code{protoize} on the entire set of files.  @code{protoize} will use
15319 the existing @samp{.X} file because it is newer than the source file.
15320 For example:
15321
15322 @smallexample
15323 gcc -Dfoo=bar file1.c -aux-info file1.X
15324 protoize *.c
15325 @end smallexample
15326
15327 @noindent
15328 You need to include the special files along with the rest in the
15329 @code{protoize} command, even though their @samp{.X} files already
15330 exist, because otherwise they won't get converted.
15331
15332 @xref{Protoize Caveats}, for more information on how to use
15333 @code{protoize} successfully.