OSDN Git Service

PR pch/13676
[pf3gnuchains/gcc-fork.git] / gcc / doc / invoke.texi
1 @c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2 @c 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
3 @c Free Software Foundation, Inc.
4 @c This is part of the GCC manual.
5 @c For copying conditions, see the file gcc.texi.
6
7 @ignore
8 @c man begin INCLUDE
9 @include gcc-vers.texi
10 @c man end
11
12 @c man begin COPYRIGHT
13 Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
14 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 -femit-struct-debug-baseonly -femit-struct-debug-reduced @gol
307 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
308 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
309 -print-multi-directory  -print-multi-lib @gol
310 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
311 -print-sysroot-headers-suffix @gol
312 -save-temps  -time}
313
314 @item Optimization Options
315 @xref{Optimize Options,,Options that Control Optimization}.
316 @gccoptlist{-falign-functions=@var{n}  -falign-jumps=@var{n} @gol
317 -falign-labels=@var{n}  -falign-loops=@var{n}  @gol
318 -fbounds-check -fmudflap -fmudflapth -fmudflapir @gol
319 -fbranch-probabilities -fprofile-values -fvpt -fbranch-target-load-optimize @gol
320 -fbranch-target-load-optimize2 -fbtr-bb-exclusive @gol
321 -fcaller-saves  -fcprop-registers  -fcse-follow-jumps @gol
322 -fcse-skip-blocks  -fcx-limited-range  -fdata-sections @gol
323 -fdelayed-branch  -fdelete-null-pointer-checks -fearly-inlining @gol
324 -fexpensive-optimizations  -ffast-math  -ffloat-store @gol
325 -fforce-addr  -fforward-propagate  -ffunction-sections @gol
326 -fgcse  -fgcse-lm  -fgcse-sm  -fgcse-las  -fgcse-after-reload @gol
327 -fcrossjumping  -fif-conversion  -fif-conversion2 @gol
328 -finline-functions  -finline-functions-called-once @gol
329 -finline-limit=@var{n}  -fkeep-inline-functions @gol
330 -fkeep-static-consts  -fmerge-constants  -fmerge-all-constants @gol
331 -fmodulo-sched -fmodulo-sched-allow-regmoves -fno-branch-count-reg @gol
332 -fno-default-inline  -fno-defer-pop -fmove-loop-invariants @gol
333 -fno-function-cse  -fno-guess-branch-probability @gol
334 -fno-inline  -fno-math-errno  -fno-peephole  -fno-peephole2 @gol
335 -funsafe-math-optimizations  -funsafe-loop-optimizations @gol
336 -ffinite-math-only  -fno-signed-zeros @gol
337 -fno-toplevel-reorder -fno-trapping-math  -fno-zero-initialized-in-bss @gol
338 -fomit-frame-pointer  -foptimize-register-move @gol
339 -foptimize-sibling-calls  -fpredictive-commoning -fprefetch-loop-arrays @gol
340 -fprofile-generate -fprofile-use @gol
341 -fregmove  -frename-registers @gol
342 -freorder-blocks  -freorder-blocks-and-partition -freorder-functions @gol
343 -frerun-cse-after-loop @gol
344 -frounding-math -frtl-abstract-sequences @gol
345 -fschedule-insns  -fschedule-insns2 @gol
346 -fno-sched-interblock  -fno-sched-spec  -fsched-spec-load @gol
347 -fsched-spec-load-dangerous  @gol
348 -fsched-stalled-insns=@var{n} -fsched-stalled-insns-dep=@var{n} @gol
349 -fsched2-use-superblocks @gol
350 -fsched2-use-traces -fsee -freschedule-modulo-scheduled-loops @gol
351 -fsection-anchors  -fsignaling-nans  -fsingle-precision-constant @gol
352 -fno-split-wide-types -fstack-protector  -fstack-protector-all @gol
353 -fstrict-aliasing  -fstrict-overflow  -ftracer  -fthread-jumps @gol
354 -funroll-all-loops  -funroll-loops  -fpeel-loops @gol
355 -fsplit-ivs-in-unroller -funswitch-loops @gol
356 -fvariable-expansion-in-unroller -ftree-reassoc @gol
357 -ftree-pre  -ftree-ccp  -ftree-dce -ftree-loop-optimize @gol
358 -ftree-loop-linear -ftree-loop-im -ftree-loop-ivcanon -fivopts @gol
359 -fcheck-data-deps @gol
360 -ftree-dominator-opts -ftree-dse -ftree-copyrename -ftree-sink @gol
361 -ftree-ch -ftree-sra -ftree-ter -ftree-fre -ftree-vectorize @gol
362 -ftree-vect-loop-version -fvect-cost-model -ftree-salias -fipa-pta -fweb @gol
363 -ftree-copy-prop -ftree-store-ccp -ftree-store-copy-prop -fwhole-program @gol
364 --param @var{name}=@var{value}
365 -O  -O0  -O1  -O2  -O3  -Os}
366
367 @item Preprocessor Options
368 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
369 @gccoptlist{-A@var{question}=@var{answer} @gol
370 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
371 -C  -dD  -dI  -dM  -dN @gol
372 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
373 -idirafter @var{dir} @gol
374 -include @var{file}  -imacros @var{file} @gol
375 -iprefix @var{file}  -iwithprefix @var{dir} @gol
376 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
377 -imultilib @var{dir} -isysroot @var{dir} @gol
378 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
379 -P  -fworking-directory  -remap @gol
380 -trigraphs  -undef  -U@var{macro}  -Wp,@var{option} @gol
381 -Xpreprocessor @var{option}}
382
383 @item Assembler Option
384 @xref{Assembler Options,,Passing Options to the Assembler}.
385 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
386
387 @item Linker Options
388 @xref{Link Options,,Options for Linking}.
389 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
390 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
391 -s  -static  -static-libgcc  -shared  -shared-libgcc  -symbolic @gol
392 -Wl,@var{option}  -Xlinker @var{option} @gol
393 -u @var{symbol}}
394
395 @item Directory Options
396 @xref{Directory Options,,Options for Directory Search}.
397 @gccoptlist{-B@var{prefix}  -I@var{dir}  -iquote@var{dir}  -L@var{dir}
398 -specs=@var{file}  -I- --sysroot=@var{dir}}
399
400 @item Target Options
401 @c I wrote this xref this way to avoid overfull hbox. -- rms
402 @xref{Target Options}.
403 @gccoptlist{-V @var{version}  -b @var{machine}}
404
405 @item Machine Dependent Options
406 @xref{Submodel Options,,Hardware Models and Configurations}.
407 @c This list is ordered alphanumerically by subsection name.
408 @c Try and put the significant identifier (CPU or system) first,
409 @c so users have a clue at guessing where the ones they want will be.
410
411 @emph{ARC Options}
412 @gccoptlist{-EB  -EL @gol
413 -mmangle-cpu  -mcpu=@var{cpu}  -mtext=@var{text-section} @gol
414 -mdata=@var{data-section}  -mrodata=@var{readonly-data-section}}
415
416 @emph{ARM Options}
417 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
418 -mabi=@var{name} @gol
419 -mapcs-stack-check  -mno-apcs-stack-check @gol
420 -mapcs-float  -mno-apcs-float @gol
421 -mapcs-reentrant  -mno-apcs-reentrant @gol
422 -msched-prolog  -mno-sched-prolog @gol
423 -mlittle-endian  -mbig-endian  -mwords-little-endian @gol
424 -mfloat-abi=@var{name}  -msoft-float  -mhard-float  -mfpe @gol
425 -mthumb-interwork  -mno-thumb-interwork @gol
426 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
427 -mstructure-size-boundary=@var{n} @gol
428 -mabort-on-noreturn @gol
429 -mlong-calls  -mno-long-calls @gol
430 -msingle-pic-base  -mno-single-pic-base @gol
431 -mpic-register=@var{reg} @gol
432 -mnop-fun-dllimport @gol
433 -mcirrus-fix-invalid-insns -mno-cirrus-fix-invalid-insns @gol
434 -mpoke-function-name @gol
435 -mthumb  -marm @gol
436 -mtpcs-frame  -mtpcs-leaf-frame @gol
437 -mcaller-super-interworking  -mcallee-super-interworking @gol
438 -mtp=@var{name}}
439
440 @emph{AVR Options}
441 @gccoptlist{-mmcu=@var{mcu}  -msize  -minit-stack=@var{n}  -mno-interrupts @gol
442 -mcall-prologues  -mno-tablejump  -mtiny-stack  -mint8}
443
444 @emph{Blackfin Options}
445 @gccoptlist{-mcpu=@var{cpu}  -msim  -momit-leaf-frame-pointer @gol
446 -mno-omit-leaf-frame-pointer  -mspecld-anomaly  -mno-specld-anomaly @gol
447 -mcsync-anomaly  -mno-csync-anomaly  -mlow-64k  -mno-low64k @gol
448 -mstack-check-l1  -mid-shared-library  -mno-id-shared-library @gol
449 -mshared-library-id=@var{n}  -mleaf-id-shared-library @gol
450 -mno-leaf-id-shared-library  -msep-data  -mno-sep-data  -mlong-calls @gol
451 -mno-long-calls}
452
453 @emph{CRIS Options}
454 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
455 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
456 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
457 -mstack-align  -mdata-align  -mconst-align @gol
458 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
459 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
460 -mmul-bug-workaround  -mno-mul-bug-workaround}
461
462 @emph{CRX Options}
463 @gccoptlist{-mmac -mpush-args}
464
465 @emph{Darwin Options}
466 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
467 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
468 -client_name  -compatibility_version  -current_version @gol
469 -dead_strip @gol
470 -dependency-file  -dylib_file  -dylinker_install_name @gol
471 -dynamic  -dynamiclib  -exported_symbols_list @gol
472 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
473 -force_flat_namespace  -headerpad_max_install_names @gol
474 -iframework @gol
475 -image_base  -init  -install_name  -keep_private_externs @gol
476 -multi_module  -multiply_defined  -multiply_defined_unused @gol
477 -noall_load   -no_dead_strip_inits_and_terms @gol
478 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
479 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
480 -private_bundle  -read_only_relocs  -sectalign @gol
481 -sectobjectsymbols  -whyload  -seg1addr @gol
482 -sectcreate  -sectobjectsymbols  -sectorder @gol
483 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
484 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
485 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
486 -single_module  -static  -sub_library  -sub_umbrella @gol
487 -twolevel_namespace  -umbrella  -undefined @gol
488 -unexported_symbols_list  -weak_reference_mismatches @gol
489 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
490 -mkernel -mone-byte-bool}
491
492 @emph{DEC Alpha Options}
493 @gccoptlist{-mno-fp-regs  -msoft-float  -malpha-as  -mgas @gol
494 -mieee  -mieee-with-inexact  -mieee-conformant @gol
495 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
496 -mtrap-precision=@var{mode}  -mbuild-constants @gol
497 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
498 -mbwx  -mmax  -mfix  -mcix @gol
499 -mfloat-vax  -mfloat-ieee @gol
500 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
501 -msmall-text  -mlarge-text @gol
502 -mmemory-latency=@var{time}}
503
504 @emph{DEC Alpha/VMS Options}
505 @gccoptlist{-mvms-return-codes}
506
507 @emph{FRV Options}
508 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
509 -mhard-float  -msoft-float @gol
510 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
511 -mdouble  -mno-double @gol
512 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
513 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
514 -mlinked-fp  -mlong-calls  -malign-labels @gol
515 -mlibrary-pic  -macc-4  -macc-8 @gol
516 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
517 -moptimize-membar -mno-optimize-membar @gol
518 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
519 -mvliw-branch  -mno-vliw-branch @gol
520 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
521 -mno-nested-cond-exec  -mtomcat-stats @gol
522 -mTLS -mtls @gol
523 -mcpu=@var{cpu}}
524
525 @emph{GNU/Linux Options}
526 @gccoptlist{-muclibc}
527
528 @emph{H8/300 Options}
529 @gccoptlist{-mrelax  -mh  -ms  -mn  -mint32  -malign-300}
530
531 @emph{HPPA Options}
532 @gccoptlist{-march=@var{architecture-type} @gol
533 -mbig-switch  -mdisable-fpregs  -mdisable-indexing @gol
534 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
535 -mfixed-range=@var{register-range} @gol
536 -mjump-in-delay -mlinker-opt -mlong-calls @gol
537 -mlong-load-store  -mno-big-switch  -mno-disable-fpregs @gol
538 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
539 -mno-jump-in-delay  -mno-long-load-store @gol
540 -mno-portable-runtime  -mno-soft-float @gol
541 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
542 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
543 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
544 -munix=@var{unix-std}  -nolibdld  -static  -threads}
545
546 @emph{i386 and x86-64 Options}
547 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
548 -mfpmath=@var{unit} @gol
549 -masm=@var{dialect}  -mno-fancy-math-387 @gol
550 -mno-fp-ret-in-387  -msoft-float @gol
551 -mno-wide-multiply  -mrtd  -malign-double @gol
552 -mpreferred-stack-boundary=@var{num} -mcx16 -msahf -mrecip @gol
553 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 @gol
554 -msse4a -m3dnow -mpopcnt -mabm @gol
555 -mthreads  -mno-align-stringops  -minline-all-stringops @gol
556 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
557 -m96bit-long-double  -mregparm=@var{num}  -msseregparm @gol
558 -mpc32 -mpc64 -mpc80 mstackrealign @gol
559 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
560 -mcmodel=@var{code-model} @gol
561 -m32  -m64 -mlarge-data-threshold=@var{num}}
562
563 @emph{IA-64 Options}
564 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
565 -mvolatile-asm-stop  -mregister-names  -mno-sdata @gol
566 -mconstant-gp  -mauto-pic  -minline-float-divide-min-latency @gol
567 -minline-float-divide-max-throughput @gol
568 -minline-int-divide-min-latency @gol
569 -minline-int-divide-max-throughput  @gol
570 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
571 -mno-dwarf2-asm -mearly-stop-bits @gol
572 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
573 -mtune=@var{cpu-type} -mt -pthread -milp32 -mlp64 @gol
574 -mno-sched-br-data-spec -msched-ar-data-spec -mno-sched-control-spec @gol
575 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
576 -msched-ldc -mno-sched-control-ldc -mno-sched-spec-verbose @gol
577 -mno-sched-prefer-non-data-spec-insns @gol
578 -mno-sched-prefer-non-control-spec-insns @gol
579 -mno-sched-count-spec-in-critical-path}
580
581 @emph{M32R/D Options}
582 @gccoptlist{-m32r2 -m32rx -m32r @gol
583 -mdebug @gol
584 -malign-loops -mno-align-loops @gol
585 -missue-rate=@var{number} @gol
586 -mbranch-cost=@var{number} @gol
587 -mmodel=@var{code-size-model-type} @gol
588 -msdata=@var{sdata-type} @gol
589 -mno-flush-func -mflush-func=@var{name} @gol
590 -mno-flush-trap -mflush-trap=@var{number} @gol
591 -G @var{num}}
592
593 @emph{M32C Options}
594 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
595
596 @emph{M680x0 Options}
597 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune}
598 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
599 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
600 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
601 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
602 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
603 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
604 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library}
605
606 @emph{M68hc1x Options}
607 @gccoptlist{-m6811  -m6812  -m68hc11  -m68hc12   -m68hcs12 @gol
608 -mauto-incdec  -minmax  -mlong-calls  -mshort @gol
609 -msoft-reg-count=@var{count}}
610
611 @emph{MCore Options}
612 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
613 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
614 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
615 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
616 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
617
618 @emph{MIPS Options}
619 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
620 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2  -mips64 @gol
621 -mips16  -mno-mips16  -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
622 -mshared  -mno-shared  -mxgot  -mno-xgot  -mgp32  -mgp64 @gol
623 -mfp32  -mfp64  -mhard-float  -msoft-float @gol
624 -msingle-float  -mdouble-float  -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
625 -msmartmips  -mno-smartmips @gol
626 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
627 -mips3d  -mno-mips3d  -mmt  -mno-mt @gol
628 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
629 -G@var{num}  -membedded-data  -mno-embedded-data @gol
630 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
631 -msplit-addresses  -mno-split-addresses @gol
632 -mexplicit-relocs  -mno-explicit-relocs @gol
633 -mcheck-zero-division  -mno-check-zero-division @gol
634 -mdivide-traps  -mdivide-breaks @gol
635 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
636 -mmad  -mno-mad  -mfused-madd  -mno-fused-madd  -nocpp @gol
637 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
638 -mfix-vr4120  -mno-fix-vr4120  -mfix-vr4130  -mno-fix-vr4130 @gol
639 -mfix-sb1  -mno-fix-sb1 @gol
640 -mflush-func=@var{func}  -mno-flush-func @gol
641 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
642 -mfp-exceptions -mno-fp-exceptions @gol
643 -mvr4130-align -mno-vr4130-align}
644
645 @emph{MMIX Options}
646 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
647 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
648 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
649 -mno-base-addresses  -msingle-exit  -mno-single-exit}
650
651 @emph{MN10300 Options}
652 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
653 -mam33  -mno-am33 @gol
654 -mam33-2  -mno-am33-2 @gol
655 -mreturn-pointer-on-d0 @gol
656 -mno-crt0  -mrelax}
657
658 @emph{MT Options}
659 @gccoptlist{-mno-crt0 -mbacc -msim @gol
660 -march=@var{cpu-type} }
661
662 @emph{PDP-11 Options}
663 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
664 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
665 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
666 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
667 -mbranch-expensive  -mbranch-cheap @gol
668 -msplit  -mno-split  -munix-asm  -mdec-asm}
669
670 @emph{PowerPC Options}
671 See RS/6000 and PowerPC Options.
672
673 @emph{RS/6000 and PowerPC Options}
674 @gccoptlist{-mcpu=@var{cpu-type} @gol
675 -mtune=@var{cpu-type} @gol
676 -mpower  -mno-power  -mpower2  -mno-power2 @gol
677 -mpowerpc  -mpowerpc64  -mno-powerpc @gol
678 -maltivec  -mno-altivec @gol
679 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
680 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
681 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb  -mfprnd  -mno-fprnd @gol
682 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mdfp -mno-dfp @gol
683 -mnew-mnemonics  -mold-mnemonics @gol
684 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
685 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
686 -malign-power  -malign-natural @gol
687 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
688 -mstring  -mno-string  -mupdate  -mno-update @gol
689 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
690 -mstrict-align  -mno-strict-align  -mrelocatable @gol
691 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
692 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
693 -mdynamic-no-pic  -maltivec  -mswdiv @gol
694 -mprioritize-restricted-insns=@var{priority} @gol
695 -msched-costly-dep=@var{dependence_type} @gol
696 -minsert-sched-nops=@var{scheme} @gol
697 -mcall-sysv  -mcall-netbsd @gol
698 -maix-struct-return  -msvr4-struct-return @gol
699 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
700 -misel -mno-isel @gol
701 -misel=yes  -misel=no @gol
702 -mspe -mno-spe @gol
703 -mspe=yes  -mspe=no @gol
704 -mvrsave -mno-vrsave @gol
705 -mmulhw -mno-mulhw @gol
706 -mdlmzb -mno-dlmzb @gol
707 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
708 -mprototype  -mno-prototype @gol
709 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
710 -msdata=@var{opt}  -mvxworks  -mwindiss  -G @var{num}  -pthread}
711
712 @emph{S/390 and zSeries Options}
713 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
714 -mhard-float  -msoft-float -mlong-double-64 -mlong-double-128 @gol
715 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
716 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
717 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
718 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
719 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard}
720
721 @emph{Score Options}
722 @gccoptlist{-meb -mel @gol
723 -mnhwloop @gol
724 -muls @gol
725 -mmac @gol
726 -mscore5 -mscore5u -mscore7 -mscore7d}
727
728 @emph{SH Options}
729 @gccoptlist{-m1  -m2  -m2e  -m3  -m3e @gol
730 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
731 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
732 -m5-64media  -m5-64media-nofpu @gol
733 -m5-32media  -m5-32media-nofpu @gol
734 -m5-compact  -m5-compact-nofpu @gol
735 -mb  -ml  -mdalign  -mrelax @gol
736 -mbigtable  -mfmovd  -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
737 -mieee  -misize  -minline-ic_invalidate -mpadstruct  -mspace @gol
738 -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
739 -mdivsi3_libfunc=@var{name}  @gol
740 -madjust-unroll -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
741  -minvalid-symbols}
742
743 @emph{SPARC Options}
744 @gccoptlist{-mcpu=@var{cpu-type} @gol
745 -mtune=@var{cpu-type} @gol
746 -mcmodel=@var{code-model} @gol
747 -m32  -m64  -mapp-regs  -mno-app-regs @gol
748 -mfaster-structs  -mno-faster-structs @gol
749 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
750 -mhard-quad-float  -msoft-quad-float @gol
751 -mimpure-text  -mno-impure-text  -mlittle-endian @gol
752 -mstack-bias  -mno-stack-bias @gol
753 -munaligned-doubles  -mno-unaligned-doubles @gol
754 -mv8plus  -mno-v8plus  -mvis  -mno-vis
755 -threads -pthreads -pthread}
756
757 @emph{SPU Options}
758 @gccoptlist{-mwarn-reloc -merror-reloc @gol
759 -msafe-dma -munsafe-dma @gol
760 -mbranch-hints @gol
761 -msmall-mem -mlarge-mem -mstdmain @gol
762 -mfixed-range=@var{register-range}}
763
764 @emph{System V Options}
765 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
766
767 @emph{TMS320C3x/C4x Options}
768 @gccoptlist{-mcpu=@var{cpu}  -mbig  -msmall  -mregparm  -mmemparm @gol
769 -mfast-fix  -mmpyi  -mbk  -mti  -mdp-isr-reload @gol
770 -mrpts=@var{count}  -mrptb  -mdb  -mloop-unsigned @gol
771 -mparallel-insns  -mparallel-mpy  -mpreserve-float}
772
773 @emph{V850 Options}
774 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
775 -mprolog-function  -mno-prolog-function  -mspace @gol
776 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
777 -mapp-regs  -mno-app-regs @gol
778 -mdisable-callt  -mno-disable-callt @gol
779 -mv850e1 @gol
780 -mv850e @gol
781 -mv850  -mbig-switch}
782
783 @emph{VAX Options}
784 @gccoptlist{-mg  -mgnu  -munix}
785
786 @emph{VxWorks Options}
787 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
788 -Xbind-lazy  -Xbind-now}
789
790 @emph{x86-64 Options}
791 See i386 and x86-64 Options.
792
793 @emph{Xstormy16 Options}
794 @gccoptlist{-msim}
795
796 @emph{Xtensa Options}
797 @gccoptlist{-mconst16 -mno-const16 @gol
798 -mfused-madd  -mno-fused-madd @gol
799 -mtext-section-literals  -mno-text-section-literals @gol
800 -mtarget-align  -mno-target-align @gol
801 -mlongcalls  -mno-longcalls}
802
803 @emph{zSeries Options}
804 See S/390 and zSeries Options.
805
806 @item Code Generation Options
807 @xref{Code Gen Options,,Options for Code Generation Conventions}.
808 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
809 -ffixed-@var{reg}  -fexceptions @gol
810 -fnon-call-exceptions  -funwind-tables @gol
811 -fasynchronous-unwind-tables @gol
812 -finhibit-size-directive  -finstrument-functions @gol
813 -fno-common  -fno-ident @gol
814 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
815 -fno-jump-tables @gol
816 -frecord-gcc-switches @gol
817 -freg-struct-return  -fshort-enums @gol
818 -fshort-double  -fshort-wchar @gol
819 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
820 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
821 -fargument-alias  -fargument-noalias @gol
822 -fargument-noalias-global  -fargument-noalias-anything
823 -fleading-underscore  -ftls-model=@var{model} @gol
824 -ftrapv  -fwrapv  -fbounds-check @gol
825 -fvisibility}
826 @end table
827
828 @menu
829 * Overall Options::     Controlling the kind of output:
830                         an executable, object files, assembler files,
831                         or preprocessed source.
832 * C Dialect Options::   Controlling the variant of C language compiled.
833 * C++ Dialect Options:: Variations on C++.
834 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
835                         and Objective-C++.
836 * Language Independent Options:: Controlling how diagnostics should be
837                         formatted.
838 * Warning Options::     How picky should the compiler be?
839 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
840 * Optimize Options::    How much optimization?
841 * Preprocessor Options:: Controlling header files and macro definitions.
842                          Also, getting dependency information for Make.
843 * Assembler Options::   Passing options to the assembler.
844 * Link Options::        Specifying libraries and so on.
845 * Directory Options::   Where to find header files and libraries.
846                         Where to find the compiler executable files.
847 * Spec Files::          How to pass switches to sub-processes.
848 * Target Options::      Running a cross-compiler, or an old version of GCC.
849 @end menu
850
851 @node Overall Options
852 @section Options Controlling the Kind of Output
853
854 Compilation can involve up to four stages: preprocessing, compilation
855 proper, assembly and linking, always in that order.  GCC is capable of
856 preprocessing and compiling several files either into several
857 assembler input files, or into one assembler input file; then each
858 assembler input file produces an object file, and linking combines all
859 the object files (those newly compiled, and those specified as input)
860 into an executable file.
861
862 @cindex file name suffix
863 For any given input file, the file name suffix determines what kind of
864 compilation is done:
865
866 @table @gcctabopt
867 @item @var{file}.c
868 C source code which must be preprocessed.
869
870 @item @var{file}.i
871 C source code which should not be preprocessed.
872
873 @item @var{file}.ii
874 C++ source code which should not be preprocessed.
875
876 @item @var{file}.m
877 Objective-C source code.  Note that you must link with the @file{libobjc}
878 library to make an Objective-C program work.
879
880 @item @var{file}.mi
881 Objective-C source code which should not be preprocessed.
882
883 @item @var{file}.mm
884 @itemx @var{file}.M
885 Objective-C++ source code.  Note that you must link with the @file{libobjc}
886 library to make an Objective-C++ program work.  Note that @samp{.M} refers
887 to a literal capital M@.
888
889 @item @var{file}.mii
890 Objective-C++ source code which should not be preprocessed.
891
892 @item @var{file}.h
893 C, C++, Objective-C or Objective-C++ header file to be turned into a
894 precompiled header.
895
896 @item @var{file}.cc
897 @itemx @var{file}.cp
898 @itemx @var{file}.cxx
899 @itemx @var{file}.cpp
900 @itemx @var{file}.CPP
901 @itemx @var{file}.c++
902 @itemx @var{file}.C
903 C++ source code which must be preprocessed.  Note that in @samp{.cxx},
904 the last two letters must both be literally @samp{x}.  Likewise,
905 @samp{.C} refers to a literal capital C@.
906
907 @item @var{file}.mm
908 @itemx @var{file}.M
909 Objective-C++ source code which must be preprocessed.
910
911 @item @var{file}.mii
912 Objective-C++ source code which should not be preprocessed.
913
914 @item @var{file}.hh
915 @itemx @var{file}.H
916 @itemx @var{file}.hp
917 @itemx @var{file}.hxx
918 @itemx @var{file}.hpp
919 @itemx @var{file}.HPP
920 @itemx @var{file}.h++
921 @itemx @var{file}.tcc
922 C++ header file to be turned into a precompiled header.
923
924 @item @var{file}.f
925 @itemx @var{file}.for
926 @itemx @var{file}.FOR
927 Fixed form Fortran source code which should not be preprocessed.
928
929 @item @var{file}.F
930 @itemx @var{file}.fpp
931 @itemx @var{file}.FPP
932 Fixed form Fortran source code which must be preprocessed (with the traditional
933 preprocessor).
934
935 @item @var{file}.f90
936 @itemx @var{file}.f95
937 Free form Fortran source code which should not be preprocessed.
938
939 @item @var{file}.F90
940 @itemx @var{file}.F95
941 Free form Fortran source code which must be preprocessed (with the
942 traditional preprocessor).
943
944 @c FIXME: Descriptions of Java file types.
945 @c @var{file}.java
946 @c @var{file}.class
947 @c @var{file}.zip
948 @c @var{file}.jar
949
950 @item @var{file}.ads
951 Ada source code file which contains a library unit declaration (a
952 declaration of a package, subprogram, or generic, or a generic
953 instantiation), or a library unit renaming declaration (a package,
954 generic, or subprogram renaming declaration).  Such files are also
955 called @dfn{specs}.
956
957 @itemx @var{file}.adb
958 Ada source code file containing a library unit body (a subprogram or
959 package body).  Such files are also called @dfn{bodies}.
960
961 @c GCC also knows about some suffixes for languages not yet included:
962 @c Pascal:
963 @c @var{file}.p
964 @c @var{file}.pas
965 @c Ratfor:
966 @c @var{file}.r
967
968 @item @var{file}.s
969 Assembler code.
970
971 @item @var{file}.S
972 Assembler code which must be preprocessed.
973
974 @item @var{other}
975 An object file to be fed straight into linking.
976 Any file name with no recognized suffix is treated this way.
977 @end table
978
979 @opindex x
980 You can specify the input language explicitly with the @option{-x} option:
981
982 @table @gcctabopt
983 @item -x @var{language}
984 Specify explicitly the @var{language} for the following input files
985 (rather than letting the compiler choose a default based on the file
986 name suffix).  This option applies to all following input files until
987 the next @option{-x} option.  Possible values for @var{language} are:
988 @smallexample
989 c  c-header  c-cpp-output
990 c++  c++-header  c++-cpp-output
991 objective-c  objective-c-header  objective-c-cpp-output
992 objective-c++ objective-c++-header objective-c++-cpp-output
993 assembler  assembler-with-cpp
994 ada
995 f95  f95-cpp-input
996 java
997 treelang
998 @end smallexample
999
1000 @item -x none
1001 Turn off any specification of a language, so that subsequent files are
1002 handled according to their file name suffixes (as they are if @option{-x}
1003 has not been used at all).
1004
1005 @item -pass-exit-codes
1006 @opindex pass-exit-codes
1007 Normally the @command{gcc} program will exit with the code of 1 if any
1008 phase of the compiler returns a non-success return code.  If you specify
1009 @option{-pass-exit-codes}, the @command{gcc} program will instead return with
1010 numerically highest error produced by any phase that returned an error
1011 indication.  The C, C++, and Fortran frontends return 4, if an internal
1012 compiler error is encountered.
1013 @end table
1014
1015 If you only want some of the stages of compilation, you can use
1016 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1017 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1018 @command{gcc} is to stop.  Note that some combinations (for example,
1019 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1020
1021 @table @gcctabopt
1022 @item -c
1023 @opindex c
1024 Compile or assemble the source files, but do not link.  The linking
1025 stage simply is not done.  The ultimate output is in the form of an
1026 object file for each source file.
1027
1028 By default, the object file name for a source file is made by replacing
1029 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1030
1031 Unrecognized input files, not requiring compilation or assembly, are
1032 ignored.
1033
1034 @item -S
1035 @opindex S
1036 Stop after the stage of compilation proper; do not assemble.  The output
1037 is in the form of an assembler code file for each non-assembler input
1038 file specified.
1039
1040 By default, the assembler file name for a source file is made by
1041 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1042
1043 Input files that don't require compilation are ignored.
1044
1045 @item -E
1046 @opindex E
1047 Stop after the preprocessing stage; do not run the compiler proper.  The
1048 output is in the form of preprocessed source code, which is sent to the
1049 standard output.
1050
1051 Input files which don't require preprocessing are ignored.
1052
1053 @cindex output file option
1054 @item -o @var{file}
1055 @opindex o
1056 Place output in file @var{file}.  This applies regardless to whatever
1057 sort of output is being produced, whether it be an executable file,
1058 an object file, an assembler file or preprocessed C code.
1059
1060 If @option{-o} is not specified, the default is to put an executable
1061 file in @file{a.out}, the object file for
1062 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1063 assembler file in @file{@var{source}.s}, a precompiled header file in
1064 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1065 standard output.
1066
1067 @item -v
1068 @opindex v
1069 Print (on standard error output) the commands executed to run the stages
1070 of compilation.  Also print the version number of the compiler driver
1071 program and of the preprocessor and the compiler proper.
1072
1073 @item -###
1074 @opindex ###
1075 Like @option{-v} except the commands are not executed and all command
1076 arguments are quoted.  This is useful for shell scripts to capture the
1077 driver-generated command lines.
1078
1079 @item -pipe
1080 @opindex pipe
1081 Use pipes rather than temporary files for communication between the
1082 various stages of compilation.  This fails to work on some systems where
1083 the assembler is unable to read from a pipe; but the GNU assembler has
1084 no trouble.
1085
1086 @item -combine
1087 @opindex combine
1088 If you are compiling multiple source files, this option tells the driver
1089 to pass all the source files to the compiler at once (for those
1090 languages for which the compiler can handle this).  This will allow
1091 intermodule analysis (IMA) to be performed by the compiler.  Currently the only
1092 language for which this is supported is C@.  If you pass source files for
1093 multiple languages to the driver, using this option, the driver will invoke
1094 the compiler(s) that support IMA once each, passing each compiler all the
1095 source files appropriate for it.  For those languages that do not support
1096 IMA this option will be ignored, and the compiler will be invoked once for
1097 each source file in that language.  If you use this option in conjunction
1098 with @option{-save-temps}, the compiler will generate multiple
1099 pre-processed files
1100 (one for each source file), but only one (combined) @file{.o} or
1101 @file{.s} file.
1102
1103 @item --help
1104 @opindex help
1105 Print (on the standard output) a description of the command line options
1106 understood by @command{gcc}.  If the @option{-v} option is also specified
1107 then @option{--help} will also be passed on to the various processes
1108 invoked by @command{gcc}, so that they can display the command line options
1109 they accept.  If the @option{-Wextra} option has also been specified
1110 (prior to the @option{--help} option), then command line options which
1111 have no documentation associated with them will also be displayed.
1112
1113 @item --target-help
1114 @opindex target-help
1115 Print (on the standard output) a description of target-specific command
1116 line options for each tool.  For some targets extra target-specific
1117 information may also be printed.
1118
1119 @item --help=@var{class}@r{[},@var{qualifier}@r{]}
1120 Print (on the standard output) a description of the command line
1121 options understood by the compiler that fit into a specific class.
1122 The class can be one of @samp{optimizers}, @samp{warnings}, @samp{target},
1123 @samp{params}, or @var{language}:
1124
1125 @table @asis
1126 @item @samp{optimizers}
1127 This will display all of the optimization options supported by the
1128 compiler.
1129
1130 @item @samp{warnings}
1131 This will display all of the options controlling warning messages
1132 produced by the compiler.
1133
1134 @item @samp{target}
1135 This will display target-specific options.  Unlike the
1136 @option{--target-help} option however, target-specific options of the
1137 linker and assembler will not be displayed.  This is because those
1138 tools do not currently support the extended @option{--help=} syntax.
1139
1140 @item @samp{params}
1141 This will display the values recognized by the @option{--param}
1142 option.
1143
1144 @item @var{language}
1145 This will display the options supported for @var{language}, where 
1146 @var{language} is the name of one of the languages supported in this 
1147 version of GCC.
1148
1149 @item @samp{common}
1150 This will display the options that are common to all languages.
1151 @end table
1152
1153 It is possible to further refine the output of the @option{--help=}
1154 option by adding a comma separated list of qualifiers after the
1155 class.  These can be any from the following list:
1156
1157 @table @asis
1158 @item @samp{undocumented}
1159 Display only those options which are undocumented.
1160
1161 @item @samp{joined}
1162 Display options which take an argument that appears after an equal
1163 sign in the same continuous piece of text, such as:
1164 @samp{--help=target}.
1165
1166 @item @samp{separate}
1167 Display options which take an argument that appears as a separate word
1168 following the original option, such as: @samp{-o output-file}.
1169 @end table
1170
1171 Thus for example to display all the undocumented target-specific
1172 switches supported by the compiler the following can be used:
1173
1174 @smallexample
1175 --help=target,undocumented
1176 @end smallexample
1177
1178 The sense of a qualifier can be inverted by prefixing it with the
1179 @var{^} character, so for example to display all binary warning
1180 options (i.e. ones that are either on or off and that do not take an
1181 argument), which have a description the following can be used:
1182
1183 @smallexample
1184 --help=warnings,^joined,^undocumented
1185 @end smallexample
1186
1187 A class can also be used as a qualifier, although this usually
1188 restricts the output by so much that there is nothing to display.  One
1189 case where it does work however is when one of the classes is
1190 @var{target}.  So for example to display all the target-specific
1191 optimization options the following can be used:
1192
1193 @smallexample
1194 --help=target,optimizers
1195 @end smallexample
1196
1197 The @option{--help=} option can be repeated on the command line.  Each
1198 successive use will display its requested class of options, skipping
1199 those that have already been displayed.
1200
1201 If the @option{-Q} option appears on the command line before the
1202 @option{--help=} option, then the descriptive text displayed by
1203 @option{--help=} is changed.  Instead of describing the displayed
1204 options, an indication is given as to whether the option is enabled,
1205 disabled or set to a specific value (assuming that the compiler
1206 knows this at the point where the @option{--help=} option is used).
1207
1208 Here is a truncated example from the ARM port of @command{gcc}:
1209
1210 @smallexample
1211   % gcc -Q -mabi=2 --help=target -c
1212   The following options are target specific:
1213   -mabi=                                2
1214   -mabort-on-noreturn                   [disabled]
1215   -mapcs                                [disabled]
1216 @end smallexample
1217
1218 The output is sensitive to the effects of previous command line
1219 options, so for example it is possible to find out which optimizations
1220 are enabled at @option{-O2} by using:
1221
1222 @smallexample
1223 -O2 --help=optimizers
1224 @end smallexample
1225
1226 Alternatively you can discover which binary optimizations are enabled
1227 by @option{-O3} by using:
1228
1229 @smallexample
1230 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1231 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1232 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1233 @end smallexample
1234
1235 @item --version
1236 @opindex version
1237 Display the version number and copyrights of the invoked GCC@.
1238
1239 @include @value{srcdir}/../libiberty/at-file.texi
1240 @end table
1241
1242 @node Invoking G++
1243 @section Compiling C++ Programs
1244
1245 @cindex suffixes for C++ source
1246 @cindex C++ source file suffixes
1247 C++ source files conventionally use one of the suffixes @samp{.C},
1248 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1249 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1250 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1251 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1252 files with these names and compiles them as C++ programs even if you
1253 call the compiler the same way as for compiling C programs (usually
1254 with the name @command{gcc}).
1255
1256 @findex g++
1257 @findex c++
1258 However, the use of @command{gcc} does not add the C++ library.
1259 @command{g++} is a program that calls GCC and treats @samp{.c},
1260 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1261 files unless @option{-x} is used, and automatically specifies linking
1262 against the C++ library.  This program is also useful when
1263 precompiling a C header file with a @samp{.h} extension for use in C++
1264 compilations.  On many systems, @command{g++} is also installed with
1265 the name @command{c++}.
1266
1267 @cindex invoking @command{g++}
1268 When you compile C++ programs, you may specify many of the same
1269 command-line options that you use for compiling programs in any
1270 language; or command-line options meaningful for C and related
1271 languages; or options that are meaningful only for C++ programs.
1272 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1273 explanations of options for languages related to C@.
1274 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1275 explanations of options that are meaningful only for C++ programs.
1276
1277 @node C Dialect Options
1278 @section Options Controlling C Dialect
1279 @cindex dialect options
1280 @cindex language dialect options
1281 @cindex options, dialect
1282
1283 The following options control the dialect of C (or languages derived
1284 from C, such as C++, Objective-C and Objective-C++) that the compiler
1285 accepts:
1286
1287 @table @gcctabopt
1288 @cindex ANSI support
1289 @cindex ISO support
1290 @item -ansi
1291 @opindex ansi
1292 In C mode, support all ISO C90 programs.  In C++ mode,
1293 remove GNU extensions that conflict with ISO C++.
1294
1295 This turns off certain features of GCC that are incompatible with ISO
1296 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1297 such as the @code{asm} and @code{typeof} keywords, and
1298 predefined macros such as @code{unix} and @code{vax} that identify the
1299 type of system you are using.  It also enables the undesirable and
1300 rarely used ISO trigraph feature.  For the C compiler,
1301 it disables recognition of C++ style @samp{//} comments as well as
1302 the @code{inline} keyword.
1303
1304 The alternate keywords @code{__asm__}, @code{__extension__},
1305 @code{__inline__} and @code{__typeof__} continue to work despite
1306 @option{-ansi}.  You would not want to use them in an ISO C program, of
1307 course, but it is useful to put them in header files that might be included
1308 in compilations done with @option{-ansi}.  Alternate predefined macros
1309 such as @code{__unix__} and @code{__vax__} are also available, with or
1310 without @option{-ansi}.
1311
1312 The @option{-ansi} option does not cause non-ISO programs to be
1313 rejected gratuitously.  For that, @option{-pedantic} is required in
1314 addition to @option{-ansi}.  @xref{Warning Options}.
1315
1316 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1317 option is used.  Some header files may notice this macro and refrain
1318 from declaring certain functions or defining certain macros that the
1319 ISO standard doesn't call for; this is to avoid interfering with any
1320 programs that might use these names for other things.
1321
1322 Functions which would normally be built in but do not have semantics
1323 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1324 functions with @option{-ansi} is used.  @xref{Other Builtins,,Other
1325 built-in functions provided by GCC}, for details of the functions
1326 affected.
1327
1328 @item -std=
1329 @opindex std
1330 Determine the language standard.  This option is currently only
1331 supported when compiling C or C++.  A value for this option must be
1332 provided; possible values are
1333
1334 @table @samp
1335 @item c89
1336 @itemx iso9899:1990
1337 ISO C90 (same as @option{-ansi}).
1338
1339 @item iso9899:199409
1340 ISO C90 as modified in amendment 1.
1341
1342 @item c99
1343 @itemx c9x
1344 @itemx iso9899:1999
1345 @itemx iso9899:199x
1346 ISO C99.  Note that this standard is not yet fully supported; see
1347 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1348 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1349
1350 @item gnu89
1351 Default, ISO C90 plus GNU extensions (including some C99 features).
1352
1353 @item gnu99
1354 @itemx gnu9x
1355 ISO C99 plus GNU extensions.  When ISO C99 is fully implemented in GCC,
1356 this will become the default.  The name @samp{gnu9x} is deprecated.
1357
1358 @item c++98
1359 The 1998 ISO C++ standard plus amendments.
1360
1361 @item gnu++98
1362 The same as @option{-std=c++98} plus GNU extensions.  This is the
1363 default for C++ code.
1364
1365 @item c++0x
1366 The working draft of the upcoming ISO C++0x standard. This option
1367 enables experimental features that are likely to be included in
1368 C++0x. The working draft is constantly changing, and any feature that is
1369 enabled by this flag may be removed from future versions of GCC if it is
1370 not part of the C++0x standard.
1371
1372 @item gnu++0x
1373 The same as @option{-std=c++0x} plus GNU extensions. As with
1374 @option{-std=c++0x}, this option enables experimental features that may
1375 be removed in future versions of GCC.
1376 @end table
1377
1378 Even when this option is not specified, you can still use some of the
1379 features of newer standards in so far as they do not conflict with
1380 previous C standards.  For example, you may use @code{__restrict__} even
1381 when @option{-std=c99} is not specified.
1382
1383 The @option{-std} options specifying some version of ISO C have the same
1384 effects as @option{-ansi}, except that features that were not in ISO C90
1385 but are in the specified version (for example, @samp{//} comments and
1386 the @code{inline} keyword in ISO C99) are not disabled.
1387
1388 @xref{Standards,,Language Standards Supported by GCC}, for details of
1389 these standard versions.
1390
1391 @item -fgnu89-inline
1392 @opindex fgnu89-inline
1393 The option @option{-fgnu89-inline} tells GCC to use the traditional
1394 GNU semantics for @code{inline} functions when in C99 mode.
1395 @xref{Inline,,An Inline Function is As Fast As a Macro}.  This option
1396 is accepted and ignored by GCC versions 4.1.3 up to but not including
1397 4.3.  In GCC versions 4.3 and later it changes the behavior of GCC in
1398 C99 mode.  Using this option is roughly equivalent to adding the
1399 @code{gnu_inline} function attribute to all inline functions
1400 (@pxref{Function Attributes}).
1401
1402 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1403 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1404 specifies the default behavior).  This option was first supported in
1405 GCC 4.3.  This option is not supported in C89 or gnu89 mode.
1406
1407 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1408 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1409 in effect for @code{inline} functions.  @xref{Common Predefined
1410 Macros,,,cpp,The C Preprocessor}.
1411
1412 @item -aux-info @var{filename}
1413 @opindex aux-info
1414 Output to the given filename prototyped declarations for all functions
1415 declared and/or defined in a translation unit, including those in header
1416 files.  This option is silently ignored in any language other than C@.
1417
1418 Besides declarations, the file indicates, in comments, the origin of
1419 each declaration (source file and line), whether the declaration was
1420 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1421 @samp{O} for old, respectively, in the first character after the line
1422 number and the colon), and whether it came from a declaration or a
1423 definition (@samp{C} or @samp{F}, respectively, in the following
1424 character).  In the case of function definitions, a K&R-style list of
1425 arguments followed by their declarations is also provided, inside
1426 comments, after the declaration.
1427
1428 @item -fno-asm
1429 @opindex fno-asm
1430 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1431 keyword, so that code can use these words as identifiers.  You can use
1432 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1433 instead.  @option{-ansi} implies @option{-fno-asm}.
1434
1435 In C++, this switch only affects the @code{typeof} keyword, since
1436 @code{asm} and @code{inline} are standard keywords.  You may want to
1437 use the @option{-fno-gnu-keywords} flag instead, which has the same
1438 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1439 switch only affects the @code{asm} and @code{typeof} keywords, since
1440 @code{inline} is a standard keyword in ISO C99.
1441
1442 @item -fno-builtin
1443 @itemx -fno-builtin-@var{function}
1444 @opindex fno-builtin
1445 @cindex built-in functions
1446 Don't recognize built-in functions that do not begin with
1447 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1448 functions provided by GCC}, for details of the functions affected,
1449 including those which are not built-in functions when @option{-ansi} or
1450 @option{-std} options for strict ISO C conformance are used because they
1451 do not have an ISO standard meaning.
1452
1453 GCC normally generates special code to handle certain built-in functions
1454 more efficiently; for instance, calls to @code{alloca} may become single
1455 instructions that adjust the stack directly, and calls to @code{memcpy}
1456 may become inline copy loops.  The resulting code is often both smaller
1457 and faster, but since the function calls no longer appear as such, you
1458 cannot set a breakpoint on those calls, nor can you change the behavior
1459 of the functions by linking with a different library.  In addition,
1460 when a function is recognized as a built-in function, GCC may use
1461 information about that function to warn about problems with calls to
1462 that function, or to generate more efficient code, even if the
1463 resulting code still contains calls to that function.  For example,
1464 warnings are given with @option{-Wformat} for bad calls to
1465 @code{printf}, when @code{printf} is built in, and @code{strlen} is
1466 known not to modify global memory.
1467
1468 With the @option{-fno-builtin-@var{function}} option
1469 only the built-in function @var{function} is
1470 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1471 function is named this is not built-in in this version of GCC, this
1472 option is ignored.  There is no corresponding
1473 @option{-fbuiltin-@var{function}} option; if you wish to enable
1474 built-in functions selectively when using @option{-fno-builtin} or
1475 @option{-ffreestanding}, you may define macros such as:
1476
1477 @smallexample
1478 #define abs(n)          __builtin_abs ((n))
1479 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1480 @end smallexample
1481
1482 @item -fhosted
1483 @opindex fhosted
1484 @cindex hosted environment
1485
1486 Assert that compilation takes place in a hosted environment.  This implies
1487 @option{-fbuiltin}.  A hosted environment is one in which the
1488 entire standard library is available, and in which @code{main} has a return
1489 type of @code{int}.  Examples are nearly everything except a kernel.
1490 This is equivalent to @option{-fno-freestanding}.
1491
1492 @item -ffreestanding
1493 @opindex ffreestanding
1494 @cindex hosted environment
1495
1496 Assert that compilation takes place in a freestanding environment.  This
1497 implies @option{-fno-builtin}.  A freestanding environment
1498 is one in which the standard library may not exist, and program startup may
1499 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1500 This is equivalent to @option{-fno-hosted}.
1501
1502 @xref{Standards,,Language Standards Supported by GCC}, for details of
1503 freestanding and hosted environments.
1504
1505 @item -fopenmp
1506 @opindex fopenmp
1507 @cindex openmp parallel
1508 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1509 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1510 compiler generates parallel code according to the OpenMP Application
1511 Program Interface v2.5 @w{@uref{http://www.openmp.org/}}.
1512
1513 @item -fms-extensions
1514 @opindex fms-extensions
1515 Accept some non-standard constructs used in Microsoft header files.
1516
1517 Some cases of unnamed fields in structures and unions are only
1518 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1519 fields within structs/unions}, for details.
1520
1521 @item -trigraphs
1522 @opindex trigraphs
1523 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1524 options for strict ISO C conformance) implies @option{-trigraphs}.
1525
1526 @item -no-integrated-cpp
1527 @opindex no-integrated-cpp
1528 Performs a compilation in two passes: preprocessing and compiling.  This
1529 option allows a user supplied "cc1", "cc1plus", or "cc1obj" via the
1530 @option{-B} option.  The user supplied compilation step can then add in
1531 an additional preprocessing step after normal preprocessing but before
1532 compiling.  The default is to use the integrated cpp (internal cpp)
1533
1534 The semantics of this option will change if "cc1", "cc1plus", and
1535 "cc1obj" are merged.
1536
1537 @cindex traditional C language
1538 @cindex C language, traditional
1539 @item -traditional
1540 @itemx -traditional-cpp
1541 @opindex traditional-cpp
1542 @opindex traditional
1543 Formerly, these options caused GCC to attempt to emulate a pre-standard
1544 C compiler.  They are now only supported with the @option{-E} switch.
1545 The preprocessor continues to support a pre-standard mode.  See the GNU
1546 CPP manual for details.
1547
1548 @item -fcond-mismatch
1549 @opindex fcond-mismatch
1550 Allow conditional expressions with mismatched types in the second and
1551 third arguments.  The value of such an expression is void.  This option
1552 is not supported for C++.
1553
1554 @item -flax-vector-conversions
1555 @opindex flax-vector-conversions
1556 Allow implicit conversions between vectors with differing numbers of
1557 elements and/or incompatible element types.  This option should not be
1558 used for new code.
1559
1560 @item -funsigned-char
1561 @opindex funsigned-char
1562 Let the type @code{char} be unsigned, like @code{unsigned char}.
1563
1564 Each kind of machine has a default for what @code{char} should
1565 be.  It is either like @code{unsigned char} by default or like
1566 @code{signed char} by default.
1567
1568 Ideally, a portable program should always use @code{signed char} or
1569 @code{unsigned char} when it depends on the signedness of an object.
1570 But many programs have been written to use plain @code{char} and
1571 expect it to be signed, or expect it to be unsigned, depending on the
1572 machines they were written for.  This option, and its inverse, let you
1573 make such a program work with the opposite default.
1574
1575 The type @code{char} is always a distinct type from each of
1576 @code{signed char} or @code{unsigned char}, even though its behavior
1577 is always just like one of those two.
1578
1579 @item -fsigned-char
1580 @opindex fsigned-char
1581 Let the type @code{char} be signed, like @code{signed char}.
1582
1583 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1584 the negative form of @option{-funsigned-char}.  Likewise, the option
1585 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1586
1587 @item -fsigned-bitfields
1588 @itemx -funsigned-bitfields
1589 @itemx -fno-signed-bitfields
1590 @itemx -fno-unsigned-bitfields
1591 @opindex fsigned-bitfields
1592 @opindex funsigned-bitfields
1593 @opindex fno-signed-bitfields
1594 @opindex fno-unsigned-bitfields
1595 These options control whether a bit-field is signed or unsigned, when the
1596 declaration does not use either @code{signed} or @code{unsigned}.  By
1597 default, such a bit-field is signed, because this is consistent: the
1598 basic integer types such as @code{int} are signed types.
1599 @end table
1600
1601 @node C++ Dialect Options
1602 @section Options Controlling C++ Dialect
1603
1604 @cindex compiler options, C++
1605 @cindex C++ options, command line
1606 @cindex options, C++
1607 This section describes the command-line options that are only meaningful
1608 for C++ programs; but you can also use most of the GNU compiler options
1609 regardless of what language your program is in.  For example, you
1610 might compile a file @code{firstClass.C} like this:
1611
1612 @smallexample
1613 g++ -g -frepo -O -c firstClass.C
1614 @end smallexample
1615
1616 @noindent
1617 In this example, only @option{-frepo} is an option meant
1618 only for C++ programs; you can use the other options with any
1619 language supported by GCC@.
1620
1621 Here is a list of options that are @emph{only} for compiling C++ programs:
1622
1623 @table @gcctabopt
1624
1625 @item -fabi-version=@var{n}
1626 @opindex fabi-version
1627 Use version @var{n} of the C++ ABI@.  Version 2 is the version of the
1628 C++ ABI that first appeared in G++ 3.4.  Version 1 is the version of
1629 the C++ ABI that first appeared in G++ 3.2.  Version 0 will always be
1630 the version that conforms most closely to the C++ ABI specification.
1631 Therefore, the ABI obtained using version 0 will change as ABI bugs
1632 are fixed.
1633
1634 The default is version 2.
1635
1636 @item -fno-access-control
1637 @opindex fno-access-control
1638 Turn off all access checking.  This switch is mainly useful for working
1639 around bugs in the access control code.
1640
1641 @item -fcheck-new
1642 @opindex fcheck-new
1643 Check that the pointer returned by @code{operator new} is non-null
1644 before attempting to modify the storage allocated.  This check is
1645 normally unnecessary because the C++ standard specifies that
1646 @code{operator new} will only return @code{0} if it is declared
1647 @samp{throw()}, in which case the compiler will always check the
1648 return value even without this option.  In all other cases, when
1649 @code{operator new} has a non-empty exception specification, memory
1650 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
1651 @samp{new (nothrow)}.
1652
1653 @item -fconserve-space
1654 @opindex fconserve-space
1655 Put uninitialized or runtime-initialized global variables into the
1656 common segment, as C does.  This saves space in the executable at the
1657 cost of not diagnosing duplicate definitions.  If you compile with this
1658 flag and your program mysteriously crashes after @code{main()} has
1659 completed, you may have an object that is being destroyed twice because
1660 two definitions were merged.
1661
1662 This option is no longer useful on most targets, now that support has
1663 been added for putting variables into BSS without making them common.
1664
1665 @item -ffriend-injection
1666 @opindex ffriend-injection
1667 Inject friend functions into the enclosing namespace, so that they are
1668 visible outside the scope of the class in which they are declared.
1669 Friend functions were documented to work this way in the old Annotated
1670 C++ Reference Manual, and versions of G++ before 4.1 always worked
1671 that way.  However, in ISO C++ a friend function which is not declared
1672 in an enclosing scope can only be found using argument dependent
1673 lookup.  This option causes friends to be injected as they were in
1674 earlier releases.
1675
1676 This option is for compatibility, and may be removed in a future
1677 release of G++.
1678
1679 @item -fno-elide-constructors
1680 @opindex fno-elide-constructors
1681 The C++ standard allows an implementation to omit creating a temporary
1682 which is only used to initialize another object of the same type.
1683 Specifying this option disables that optimization, and forces G++ to
1684 call the copy constructor in all cases.
1685
1686 @item -fno-enforce-eh-specs
1687 @opindex fno-enforce-eh-specs
1688 Don't generate code to check for violation of exception specifications
1689 at runtime.  This option violates the C++ standard, but may be useful
1690 for reducing code size in production builds, much like defining
1691 @samp{NDEBUG}.  This does not give user code permission to throw
1692 exceptions in violation of the exception specifications; the compiler
1693 will still optimize based on the specifications, so throwing an
1694 unexpected exception will result in undefined behavior.
1695
1696 @item -ffor-scope
1697 @itemx -fno-for-scope
1698 @opindex ffor-scope
1699 @opindex fno-for-scope
1700 If @option{-ffor-scope} is specified, the scope of variables declared in
1701 a @i{for-init-statement} is limited to the @samp{for} loop itself,
1702 as specified by the C++ standard.
1703 If @option{-fno-for-scope} is specified, the scope of variables declared in
1704 a @i{for-init-statement} extends to the end of the enclosing scope,
1705 as was the case in old versions of G++, and other (traditional)
1706 implementations of C++.
1707
1708 The default if neither flag is given to follow the standard,
1709 but to allow and give a warning for old-style code that would
1710 otherwise be invalid, or have different behavior.
1711
1712 @item -fno-gnu-keywords
1713 @opindex fno-gnu-keywords
1714 Do not recognize @code{typeof} as a keyword, so that code can use this
1715 word as an identifier.  You can use the keyword @code{__typeof__} instead.
1716 @option{-ansi} implies @option{-fno-gnu-keywords}.
1717
1718 @item -fno-implicit-templates
1719 @opindex fno-implicit-templates
1720 Never emit code for non-inline templates which are instantiated
1721 implicitly (i.e.@: by use); only emit code for explicit instantiations.
1722 @xref{Template Instantiation}, for more information.
1723
1724 @item -fno-implicit-inline-templates
1725 @opindex fno-implicit-inline-templates
1726 Don't emit code for implicit instantiations of inline templates, either.
1727 The default is to handle inlines differently so that compiles with and
1728 without optimization will need the same set of explicit instantiations.
1729
1730 @item -fno-implement-inlines
1731 @opindex fno-implement-inlines
1732 To save space, do not emit out-of-line copies of inline functions
1733 controlled by @samp{#pragma implementation}.  This will cause linker
1734 errors if these functions are not inlined everywhere they are called.
1735
1736 @item -fms-extensions
1737 @opindex fms-extensions
1738 Disable pedantic warnings about constructs used in MFC, such as implicit
1739 int and getting a pointer to member function via non-standard syntax.
1740
1741 @item -fno-nonansi-builtins
1742 @opindex fno-nonansi-builtins
1743 Disable built-in declarations of functions that are not mandated by
1744 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
1745 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
1746
1747 @item -fno-operator-names
1748 @opindex fno-operator-names
1749 Do not treat the operator name keywords @code{and}, @code{bitand},
1750 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
1751 synonyms as keywords.
1752
1753 @item -fno-optional-diags
1754 @opindex fno-optional-diags
1755 Disable diagnostics that the standard says a compiler does not need to
1756 issue.  Currently, the only such diagnostic issued by G++ is the one for
1757 a name having multiple meanings within a class.
1758
1759 @item -fpermissive
1760 @opindex fpermissive
1761 Downgrade some diagnostics about nonconformant code from errors to
1762 warnings.  Thus, using @option{-fpermissive} will allow some
1763 nonconforming code to compile.
1764
1765 @item -frepo
1766 @opindex frepo
1767 Enable automatic template instantiation at link time.  This option also
1768 implies @option{-fno-implicit-templates}.  @xref{Template
1769 Instantiation}, for more information.
1770
1771 @item -fno-rtti
1772 @opindex fno-rtti
1773 Disable generation of information about every class with virtual
1774 functions for use by the C++ runtime type identification features
1775 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
1776 of the language, you can save some space by using this flag.  Note that
1777 exception handling uses the same information, but it will generate it as
1778 needed. The @samp{dynamic_cast} operator can still be used for casts that
1779 do not require runtime type information, i.e. casts to @code{void *} or to
1780 unambiguous base classes.
1781
1782 @item -fstats
1783 @opindex fstats
1784 Emit statistics about front-end processing at the end of the compilation.
1785 This information is generally only useful to the G++ development team.
1786
1787 @item -ftemplate-depth-@var{n}
1788 @opindex ftemplate-depth
1789 Set the maximum instantiation depth for template classes to @var{n}.
1790 A limit on the template instantiation depth is needed to detect
1791 endless recursions during template class instantiation.  ANSI/ISO C++
1792 conforming programs must not rely on a maximum depth greater than 17.
1793
1794 @item -fno-threadsafe-statics
1795 @opindex fno-threadsafe-statics
1796 Do not emit the extra code to use the routines specified in the C++
1797 ABI for thread-safe initialization of local statics.  You can use this
1798 option to reduce code size slightly in code that doesn't need to be
1799 thread-safe.
1800
1801 @item -fuse-cxa-atexit
1802 @opindex fuse-cxa-atexit
1803 Register destructors for objects with static storage duration with the
1804 @code{__cxa_atexit} function rather than the @code{atexit} function.
1805 This option is required for fully standards-compliant handling of static
1806 destructors, but will only work if your C library supports
1807 @code{__cxa_atexit}.
1808
1809 @item -fno-use-cxa-get-exception-ptr
1810 @opindex fno-use-cxa-get-exception-ptr
1811 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
1812 will cause @code{std::uncaught_exception} to be incorrect, but is necessary
1813 if the runtime routine is not available.
1814
1815 @item -fvisibility-inlines-hidden
1816 @opindex fvisibility-inlines-hidden
1817 This switch declares that the user does not attempt to compare
1818 pointers to inline methods where the addresses of the two functions
1819 were taken in different shared objects.
1820
1821 The effect of this is that GCC may, effectively, mark inline methods with
1822 @code{__attribute__ ((visibility ("hidden")))} so that they do not
1823 appear in the export table of a DSO and do not require a PLT indirection
1824 when used within the DSO@.  Enabling this option can have a dramatic effect
1825 on load and link times of a DSO as it massively reduces the size of the
1826 dynamic export table when the library makes heavy use of templates.
1827
1828 The behavior of this switch is not quite the same as marking the
1829 methods as hidden directly, because it does not affect static variables
1830 local to the function or cause the compiler to deduce that
1831 the function is defined in only one shared object.
1832
1833 You may mark a method as having a visibility explicitly to negate the
1834 effect of the switch for that method.  For example, if you do want to
1835 compare pointers to a particular inline method, you might mark it as
1836 having default visibility.  Marking the enclosing class with explicit
1837 visibility will have no effect.
1838
1839 Explicitly instantiated inline methods are unaffected by this option
1840 as their linkage might otherwise cross a shared library boundary.
1841 @xref{Template Instantiation}.
1842
1843 @item -fvisibility-ms-compat
1844 @opindex fvisibility-ms-compat
1845 This flag attempts to use visibility settings to make GCC's C++
1846 linkage model compatible with that of Microsoft Visual Studio.
1847
1848 The flag makes these changes to GCC's linkage model:
1849
1850 @enumerate
1851 @item
1852 It sets the default visibility to @code{hidden}, like
1853 @option{-fvisibility=hidden}.
1854
1855 @item
1856 Types, but not their members, are not hidden by default.
1857
1858 @item
1859 The One Definition Rule is relaxed for types without explicit
1860 visibility specifications which are defined in more than one different
1861 shared object: those declarations are permitted if they would have
1862 been permitted when this option was not used.
1863 @end enumerate
1864
1865 In new code it is better to use @option{-fvisibility=hidden} and
1866 export those classes which are intended to be externally visible.
1867 Unfortunately it is possible for code to rely, perhaps accidentally,
1868 on the Visual Studio behavior.
1869
1870 Among the consequences of these changes are that static data members
1871 of the same type with the same name but defined in different shared
1872 objects will be different, so changing one will not change the other;
1873 and that pointers to function members defined in different shared
1874 objects may not compare equal.  When this flag is given, it is a
1875 violation of the ODR to define types with the same name differently.
1876
1877 @item -fno-weak
1878 @opindex fno-weak
1879 Do not use weak symbol support, even if it is provided by the linker.
1880 By default, G++ will use weak symbols if they are available.  This
1881 option exists only for testing, and should not be used by end-users;
1882 it will result in inferior code and has no benefits.  This option may
1883 be removed in a future release of G++.
1884
1885 @item -nostdinc++
1886 @opindex nostdinc++
1887 Do not search for header files in the standard directories specific to
1888 C++, but do still search the other standard directories.  (This option
1889 is used when building the C++ library.)
1890 @end table
1891
1892 In addition, these optimization, warning, and code generation options
1893 have meanings only for C++ programs:
1894
1895 @table @gcctabopt
1896 @item -fno-default-inline
1897 @opindex fno-default-inline
1898 Do not assume @samp{inline} for functions defined inside a class scope.
1899 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
1900 functions will have linkage like inline functions; they just won't be
1901 inlined by default.
1902
1903 @item -Wabi @r{(C++ only)}
1904 @opindex Wabi
1905 Warn when G++ generates code that is probably not compatible with the
1906 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
1907 all such cases, there are probably some cases that are not warned about,
1908 even though G++ is generating incompatible code.  There may also be
1909 cases where warnings are emitted even though the code that is generated
1910 will be compatible.
1911
1912 You should rewrite your code to avoid these warnings if you are
1913 concerned about the fact that code generated by G++ may not be binary
1914 compatible with code generated by other compilers.
1915
1916 The known incompatibilities at this point include:
1917
1918 @itemize @bullet
1919
1920 @item
1921 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
1922 pack data into the same byte as a base class.  For example:
1923
1924 @smallexample
1925 struct A @{ virtual void f(); int f1 : 1; @};
1926 struct B : public A @{ int f2 : 1; @};
1927 @end smallexample
1928
1929 @noindent
1930 In this case, G++ will place @code{B::f2} into the same byte
1931 as@code{A::f1}; other compilers will not.  You can avoid this problem
1932 by explicitly padding @code{A} so that its size is a multiple of the
1933 byte size on your platform; that will cause G++ and other compilers to
1934 layout @code{B} identically.
1935
1936 @item
1937 Incorrect handling of tail-padding for virtual bases.  G++ does not use
1938 tail padding when laying out virtual bases.  For example:
1939
1940 @smallexample
1941 struct A @{ virtual void f(); char c1; @};
1942 struct B @{ B(); char c2; @};
1943 struct C : public A, public virtual B @{@};
1944 @end smallexample
1945
1946 @noindent
1947 In this case, G++ will not place @code{B} into the tail-padding for
1948 @code{A}; other compilers will.  You can avoid this problem by
1949 explicitly padding @code{A} so that its size is a multiple of its
1950 alignment (ignoring virtual base classes); that will cause G++ and other
1951 compilers to layout @code{C} identically.
1952
1953 @item
1954 Incorrect handling of bit-fields with declared widths greater than that
1955 of their underlying types, when the bit-fields appear in a union.  For
1956 example:
1957
1958 @smallexample
1959 union U @{ int i : 4096; @};
1960 @end smallexample
1961
1962 @noindent
1963 Assuming that an @code{int} does not have 4096 bits, G++ will make the
1964 union too small by the number of bits in an @code{int}.
1965
1966 @item
1967 Empty classes can be placed at incorrect offsets.  For example:
1968
1969 @smallexample
1970 struct A @{@};
1971
1972 struct B @{
1973   A a;
1974   virtual void f ();
1975 @};
1976
1977 struct C : public B, public A @{@};
1978 @end smallexample
1979
1980 @noindent
1981 G++ will place the @code{A} base class of @code{C} at a nonzero offset;
1982 it should be placed at offset zero.  G++ mistakenly believes that the
1983 @code{A} data member of @code{B} is already at offset zero.
1984
1985 @item
1986 Names of template functions whose types involve @code{typename} or
1987 template template parameters can be mangled incorrectly.
1988
1989 @smallexample
1990 template <typename Q>
1991 void f(typename Q::X) @{@}
1992
1993 template <template <typename> class Q>
1994 void f(typename Q<int>::X) @{@}
1995 @end smallexample
1996
1997 @noindent
1998 Instantiations of these templates may be mangled incorrectly.
1999
2000 @end itemize
2001
2002 @item -Wctor-dtor-privacy @r{(C++ only)}
2003 @opindex Wctor-dtor-privacy
2004 Warn when a class seems unusable because all the constructors or
2005 destructors in that class are private, and it has neither friends nor
2006 public static member functions.
2007
2008 @item -Wnon-virtual-dtor @r{(C++ only)}
2009 @opindex Wnon-virtual-dtor
2010 Warn when a class appears to be polymorphic, thereby requiring a virtual
2011 destructor, yet it declares a non-virtual one.  This warning is also
2012 enabled if -Weffc++ is specified.
2013
2014 @item -Wreorder @r{(C++ only)}
2015 @opindex Wreorder
2016 @cindex reordering, warning
2017 @cindex warning for reordering of member initializers
2018 Warn when the order of member initializers given in the code does not
2019 match the order in which they must be executed.  For instance:
2020
2021 @smallexample
2022 struct A @{
2023   int i;
2024   int j;
2025   A(): j (0), i (1) @{ @}
2026 @};
2027 @end smallexample
2028
2029 The compiler will rearrange the member initializers for @samp{i}
2030 and @samp{j} to match the declaration order of the members, emitting
2031 a warning to that effect.  This warning is enabled by @option{-Wall}.
2032 @end table
2033
2034 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
2035
2036 @table @gcctabopt
2037 @item -Weffc++ @r{(C++ only)}
2038 @opindex Weffc++
2039 Warn about violations of the following style guidelines from Scott Meyers'
2040 @cite{Effective C++} book:
2041
2042 @itemize @bullet
2043 @item
2044 Item 11:  Define a copy constructor and an assignment operator for classes
2045 with dynamically allocated memory.
2046
2047 @item
2048 Item 12:  Prefer initialization to assignment in constructors.
2049
2050 @item
2051 Item 14:  Make destructors virtual in base classes.
2052
2053 @item
2054 Item 15:  Have @code{operator=} return a reference to @code{*this}.
2055
2056 @item
2057 Item 23:  Don't try to return a reference when you must return an object.
2058
2059 @end itemize
2060
2061 Also warn about violations of the following style guidelines from
2062 Scott Meyers' @cite{More Effective C++} book:
2063
2064 @itemize @bullet
2065 @item
2066 Item 6:  Distinguish between prefix and postfix forms of increment and
2067 decrement operators.
2068
2069 @item
2070 Item 7:  Never overload @code{&&}, @code{||}, or @code{,}.
2071
2072 @end itemize
2073
2074 When selecting this option, be aware that the standard library
2075 headers do not obey all of these guidelines; use @samp{grep -v}
2076 to filter out those warnings.
2077
2078 @item -Wno-deprecated @r{(C++ only)}
2079 @opindex Wno-deprecated
2080 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
2081
2082 @item -Wstrict-null-sentinel @r{(C++ only)}
2083 @opindex Wstrict-null-sentinel
2084 Warn also about the use of an uncasted @code{NULL} as sentinel.  When
2085 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2086 to @code{__null}.  Although it is a null pointer constant not a null pointer,
2087 it is guaranteed to of the same size as a pointer.  But this use is
2088 not portable across different compilers.
2089
2090 @item -Wno-non-template-friend @r{(C++ only)}
2091 @opindex Wno-non-template-friend
2092 Disable warnings when non-templatized friend functions are declared
2093 within a template.  Since the advent of explicit template specification
2094 support in G++, if the name of the friend is an unqualified-id (i.e.,
2095 @samp{friend foo(int)}), the C++ language specification demands that the
2096 friend declare or define an ordinary, nontemplate function.  (Section
2097 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2098 could be interpreted as a particular specialization of a templatized
2099 function.  Because this non-conforming behavior is no longer the default
2100 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2101 check existing code for potential trouble spots and is on by default.
2102 This new compiler behavior can be turned off with
2103 @option{-Wno-non-template-friend} which keeps the conformant compiler code
2104 but disables the helpful warning.
2105
2106 @item -Wold-style-cast @r{(C++ only)}
2107 @opindex Wold-style-cast
2108 Warn if an old-style (C-style) cast to a non-void type is used within
2109 a C++ program.  The new-style casts (@samp{dynamic_cast},
2110 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
2111 less vulnerable to unintended effects and much easier to search for.
2112
2113 @item -Woverloaded-virtual @r{(C++ only)}
2114 @opindex Woverloaded-virtual
2115 @cindex overloaded virtual fn, warning
2116 @cindex warning for overloaded virtual fn
2117 Warn when a function declaration hides virtual functions from a
2118 base class.  For example, in:
2119
2120 @smallexample
2121 struct A @{
2122   virtual void f();
2123 @};
2124
2125 struct B: public A @{
2126   void f(int);
2127 @};
2128 @end smallexample
2129
2130 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2131 like:
2132
2133 @smallexample
2134 B* b;
2135 b->f();
2136 @end smallexample
2137
2138 will fail to compile.
2139
2140 @item -Wno-pmf-conversions @r{(C++ only)}
2141 @opindex Wno-pmf-conversions
2142 Disable the diagnostic for converting a bound pointer to member function
2143 to a plain pointer.
2144
2145 @item -Wsign-promo @r{(C++ only)}
2146 @opindex Wsign-promo
2147 Warn when overload resolution chooses a promotion from unsigned or
2148 enumerated type to a signed type, over a conversion to an unsigned type of
2149 the same size.  Previous versions of G++ would try to preserve
2150 unsignedness, but the standard mandates the current behavior.
2151
2152 @smallexample
2153 struct A @{
2154   operator int ();
2155   A& operator = (int);
2156 @};
2157
2158 main ()
2159 @{
2160   A a,b;
2161   a = b;
2162 @}
2163 @end smallexample
2164
2165 In this example, G++ will synthesize a default @samp{A& operator =
2166 (const A&);}, while cfront will use the user-defined @samp{operator =}.
2167 @end table
2168
2169 @node Objective-C and Objective-C++ Dialect Options
2170 @section Options Controlling Objective-C and Objective-C++ Dialects
2171
2172 @cindex compiler options, Objective-C and Objective-C++
2173 @cindex Objective-C and Objective-C++ options, command line
2174 @cindex options, Objective-C and Objective-C++
2175 (NOTE: This manual does not describe the Objective-C and Objective-C++
2176 languages themselves.  See @xref{Standards,,Language Standards
2177 Supported by GCC}, for references.)
2178
2179 This section describes the command-line options that are only meaningful
2180 for Objective-C and Objective-C++ programs, but you can also use most of
2181 the language-independent GNU compiler options.
2182 For example, you might compile a file @code{some_class.m} like this:
2183
2184 @smallexample
2185 gcc -g -fgnu-runtime -O -c some_class.m
2186 @end smallexample
2187
2188 @noindent
2189 In this example, @option{-fgnu-runtime} is an option meant only for
2190 Objective-C and Objective-C++ programs; you can use the other options with
2191 any language supported by GCC@.
2192
2193 Note that since Objective-C is an extension of the C language, Objective-C
2194 compilations may also use options specific to the C front-end (e.g.,
2195 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2196 C++-specific options (e.g., @option{-Wabi}).
2197
2198 Here is a list of options that are @emph{only} for compiling Objective-C
2199 and Objective-C++ programs:
2200
2201 @table @gcctabopt
2202 @item -fconstant-string-class=@var{class-name}
2203 @opindex fconstant-string-class
2204 Use @var{class-name} as the name of the class to instantiate for each
2205 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2206 class name is @code{NXConstantString} if the GNU runtime is being used, and
2207 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2208 @option{-fconstant-cfstrings} option, if also present, will override the
2209 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2210 to be laid out as constant CoreFoundation strings.
2211
2212 @item -fgnu-runtime
2213 @opindex fgnu-runtime
2214 Generate object code compatible with the standard GNU Objective-C
2215 runtime.  This is the default for most types of systems.
2216
2217 @item -fnext-runtime
2218 @opindex fnext-runtime
2219 Generate output compatible with the NeXT runtime.  This is the default
2220 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2221 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2222 used.
2223
2224 @item -fno-nil-receivers
2225 @opindex fno-nil-receivers
2226 Assume that all Objective-C message dispatches (e.g.,
2227 @code{[receiver message:arg]}) in this translation unit ensure that the receiver
2228 is not @code{nil}.  This allows for more efficient entry points in the runtime
2229 to be used.  Currently, this option is only available in conjunction with
2230 the NeXT runtime on Mac OS X 10.3 and later.
2231
2232 @item -fobjc-call-cxx-cdtors
2233 @opindex fobjc-call-cxx-cdtors
2234 For each Objective-C class, check if any of its instance variables is a
2235 C++ object with a non-trivial default constructor.  If so, synthesize a
2236 special @code{- (id) .cxx_construct} instance method that will run
2237 non-trivial default constructors on any such instance variables, in order,
2238 and then return @code{self}.  Similarly, check if any instance variable
2239 is a C++ object with a non-trivial destructor, and if so, synthesize a
2240 special @code{- (void) .cxx_destruct} method that will run
2241 all such default destructors, in reverse order.
2242
2243 The @code{- (id) .cxx_construct} and/or @code{- (void) .cxx_destruct} methods
2244 thusly generated will only operate on instance variables declared in the
2245 current Objective-C class, and not those inherited from superclasses.  It
2246 is the responsibility of the Objective-C runtime to invoke all such methods
2247 in an object's inheritance hierarchy.  The @code{- (id) .cxx_construct} methods
2248 will be invoked by the runtime immediately after a new object
2249 instance is allocated; the @code{- (void) .cxx_destruct} methods will
2250 be invoked immediately before the runtime deallocates an object instance.
2251
2252 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2253 support for invoking the @code{- (id) .cxx_construct} and
2254 @code{- (void) .cxx_destruct} methods.
2255
2256 @item -fobjc-direct-dispatch
2257 @opindex fobjc-direct-dispatch
2258 Allow fast jumps to the message dispatcher.  On Darwin this is
2259 accomplished via the comm page.
2260
2261 @item -fobjc-exceptions
2262 @opindex fobjc-exceptions
2263 Enable syntactic support for structured exception handling in Objective-C,
2264 similar to what is offered by C++ and Java.  This option is
2265 unavailable in conjunction with the NeXT runtime on Mac OS X 10.2 and
2266 earlier.
2267
2268 @smallexample
2269   @@try @{
2270     @dots{}
2271        @@throw expr;
2272     @dots{}
2273   @}
2274   @@catch (AnObjCClass *exc) @{
2275     @dots{}
2276       @@throw expr;
2277     @dots{}
2278       @@throw;
2279     @dots{}
2280   @}
2281   @@catch (AnotherClass *exc) @{
2282     @dots{}
2283   @}
2284   @@catch (id allOthers) @{
2285     @dots{}
2286   @}
2287   @@finally @{
2288     @dots{}
2289       @@throw expr;
2290     @dots{}
2291   @}
2292 @end smallexample
2293
2294 The @code{@@throw} statement may appear anywhere in an Objective-C or
2295 Objective-C++ program; when used inside of a @code{@@catch} block, the
2296 @code{@@throw} may appear without an argument (as shown above), in which case
2297 the object caught by the @code{@@catch} will be rethrown.
2298
2299 Note that only (pointers to) Objective-C objects may be thrown and
2300 caught using this scheme.  When an object is thrown, it will be caught
2301 by the nearest @code{@@catch} clause capable of handling objects of that type,
2302 analogously to how @code{catch} blocks work in C++ and Java.  A
2303 @code{@@catch(id @dots{})} clause (as shown above) may also be provided to catch
2304 any and all Objective-C exceptions not caught by previous @code{@@catch}
2305 clauses (if any).
2306
2307 The @code{@@finally} clause, if present, will be executed upon exit from the
2308 immediately preceding @code{@@try @dots{} @@catch} section.  This will happen
2309 regardless of whether any exceptions are thrown, caught or rethrown
2310 inside the @code{@@try @dots{} @@catch} section, analogously to the behavior
2311 of the @code{finally} clause in Java.
2312
2313 There are several caveats to using the new exception mechanism:
2314
2315 @itemize @bullet
2316 @item
2317 Although currently designed to be binary compatible with @code{NS_HANDLER}-style
2318 idioms provided by the @code{NSException} class, the new
2319 exceptions can only be used on Mac OS X 10.3 (Panther) and later
2320 systems, due to additional functionality needed in the (NeXT) Objective-C
2321 runtime.
2322
2323 @item
2324 As mentioned above, the new exceptions do not support handling
2325 types other than Objective-C objects.   Furthermore, when used from
2326 Objective-C++, the Objective-C exception model does not interoperate with C++
2327 exceptions at this time.  This means you cannot @code{@@throw} an exception
2328 from Objective-C and @code{catch} it in C++, or vice versa
2329 (i.e., @code{throw @dots{} @@catch}).
2330 @end itemize
2331
2332 The @option{-fobjc-exceptions} switch also enables the use of synchronization
2333 blocks for thread-safe execution:
2334
2335 @smallexample
2336   @@synchronized (ObjCClass *guard) @{
2337     @dots{}
2338   @}
2339 @end smallexample
2340
2341 Upon entering the @code{@@synchronized} block, a thread of execution shall
2342 first check whether a lock has been placed on the corresponding @code{guard}
2343 object by another thread.  If it has, the current thread shall wait until
2344 the other thread relinquishes its lock.  Once @code{guard} becomes available,
2345 the current thread will place its own lock on it, execute the code contained in
2346 the @code{@@synchronized} block, and finally relinquish the lock (thereby
2347 making @code{guard} available to other threads).
2348
2349 Unlike Java, Objective-C does not allow for entire methods to be marked
2350 @code{@@synchronized}.  Note that throwing exceptions out of
2351 @code{@@synchronized} blocks is allowed, and will cause the guarding object
2352 to be unlocked properly.
2353
2354 @item -fobjc-gc
2355 @opindex fobjc-gc
2356 Enable garbage collection (GC) in Objective-C and Objective-C++ programs.
2357
2358 @item -freplace-objc-classes
2359 @opindex freplace-objc-classes
2360 Emit a special marker instructing @command{ld(1)} not to statically link in
2361 the resulting object file, and allow @command{dyld(1)} to load it in at
2362 run time instead.  This is used in conjunction with the Fix-and-Continue
2363 debugging mode, where the object file in question may be recompiled and
2364 dynamically reloaded in the course of program execution, without the need
2365 to restart the program itself.  Currently, Fix-and-Continue functionality
2366 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2367 and later.
2368
2369 @item -fzero-link
2370 @opindex fzero-link
2371 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2372 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2373 compile time) with static class references that get initialized at load time,
2374 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2375 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2376 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2377 for individual class implementations to be modified during program execution.
2378
2379 @item -gen-decls
2380 @opindex gen-decls
2381 Dump interface declarations for all classes seen in the source file to a
2382 file named @file{@var{sourcename}.decl}.
2383
2384 @item -Wassign-intercept
2385 @opindex Wassign-intercept
2386 Warn whenever an Objective-C assignment is being intercepted by the
2387 garbage collector.
2388
2389 @item -Wno-protocol
2390 @opindex Wno-protocol
2391 If a class is declared to implement a protocol, a warning is issued for
2392 every method in the protocol that is not implemented by the class.  The
2393 default behavior is to issue a warning for every method not explicitly
2394 implemented in the class, even if a method implementation is inherited
2395 from the superclass.  If you use the @option{-Wno-protocol} option, then
2396 methods inherited from the superclass are considered to be implemented,
2397 and no warning is issued for them.
2398
2399 @item -Wselector
2400 @opindex Wselector
2401 Warn if multiple methods of different types for the same selector are
2402 found during compilation.  The check is performed on the list of methods
2403 in the final stage of compilation.  Additionally, a check is performed
2404 for each selector appearing in a @code{@@selector(@dots{})}
2405 expression, and a corresponding method for that selector has been found
2406 during compilation.  Because these checks scan the method table only at
2407 the end of compilation, these warnings are not produced if the final
2408 stage of compilation is not reached, for example because an error is
2409 found during compilation, or because the @option{-fsyntax-only} option is
2410 being used.
2411
2412 @item -Wstrict-selector-match
2413 @opindex Wstrict-selector-match
2414 Warn if multiple methods with differing argument and/or return types are
2415 found for a given selector when attempting to send a message using this
2416 selector to a receiver of type @code{id} or @code{Class}.  When this flag
2417 is off (which is the default behavior), the compiler will omit such warnings
2418 if any differences found are confined to types which share the same size
2419 and alignment.
2420
2421 @item -Wundeclared-selector
2422 @opindex Wundeclared-selector
2423 Warn if a @code{@@selector(@dots{})} expression referring to an
2424 undeclared selector is found.  A selector is considered undeclared if no
2425 method with that name has been declared before the
2426 @code{@@selector(@dots{})} expression, either explicitly in an
2427 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
2428 an @code{@@implementation} section.  This option always performs its
2429 checks as soon as a @code{@@selector(@dots{})} expression is found,
2430 while @option{-Wselector} only performs its checks in the final stage of
2431 compilation.  This also enforces the coding style convention
2432 that methods and selectors must be declared before being used.
2433
2434 @item -print-objc-runtime-info
2435 @opindex print-objc-runtime-info
2436 Generate C header describing the largest structure that is passed by
2437 value, if any.
2438
2439 @end table
2440
2441 @node Language Independent Options
2442 @section Options to Control Diagnostic Messages Formatting
2443 @cindex options to control diagnostics formatting
2444 @cindex diagnostic messages
2445 @cindex message formatting
2446
2447 Traditionally, diagnostic messages have been formatted irrespective of
2448 the output device's aspect (e.g.@: its width, @dots{}).  The options described
2449 below can be used to control the diagnostic messages formatting
2450 algorithm, e.g.@: how many characters per line, how often source location
2451 information should be reported.  Right now, only the C++ front end can
2452 honor these options.  However it is expected, in the near future, that
2453 the remaining front ends would be able to digest them correctly.
2454
2455 @table @gcctabopt
2456 @item -fmessage-length=@var{n}
2457 @opindex fmessage-length
2458 Try to format error messages so that they fit on lines of about @var{n}
2459 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
2460 the front ends supported by GCC@.  If @var{n} is zero, then no
2461 line-wrapping will be done; each error message will appear on a single
2462 line.
2463
2464 @opindex fdiagnostics-show-location
2465 @item -fdiagnostics-show-location=once
2466 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
2467 reporter to emit @emph{once} source location information; that is, in
2468 case the message is too long to fit on a single physical line and has to
2469 be wrapped, the source location won't be emitted (as prefix) again,
2470 over and over, in subsequent continuation lines.  This is the default
2471 behavior.
2472
2473 @item -fdiagnostics-show-location=every-line
2474 Only meaningful in line-wrapping mode.  Instructs the diagnostic
2475 messages reporter to emit the same source location information (as
2476 prefix) for physical lines that result from the process of breaking
2477 a message which is too long to fit on a single line.
2478
2479 @item -fdiagnostics-show-option
2480 @opindex fdiagnostics-show-option
2481 This option instructs the diagnostic machinery to add text to each
2482 diagnostic emitted, which indicates which command line option directly
2483 controls that diagnostic, when such an option is known to the
2484 diagnostic machinery.
2485
2486 @item -Wcoverage-mismatch
2487 @opindex Wcoverage-mismatch
2488 Warn if feedback profiles do not match when using the
2489 @option{-fprofile-use} option.
2490 If a source file was changed between @option{-fprofile-gen} and
2491 @option{-fprofile-use}, the files with the profile feedback can fail
2492 to match the source file and GCC can not use the profile feedback
2493 information.  By default, GCC emits an error message in this case.
2494 The option @option{-Wcoverage-mismatch} emits a warning instead of an
2495 error.  GCC does not use appropriate feedback profiles, so using this
2496 option can result in poorly optimized code.  This option is useful
2497 only in the case of very minor changes such as bug fixes to an
2498 existing code-base.
2499
2500 @end table
2501
2502 @node Warning Options
2503 @section Options to Request or Suppress Warnings
2504 @cindex options to control warnings
2505 @cindex warning messages
2506 @cindex messages, warning
2507 @cindex suppressing warnings
2508
2509 Warnings are diagnostic messages that report constructions which
2510 are not inherently erroneous but which are risky or suggest there
2511 may have been an error.
2512
2513 You can request many specific warnings with options beginning @samp{-W},
2514 for example @option{-Wimplicit} to request warnings on implicit
2515 declarations.  Each of these specific warning options also has a
2516 negative form beginning @samp{-Wno-} to turn off warnings;
2517 for example, @option{-Wno-implicit}.  This manual lists only one of the
2518 two forms, whichever is not the default.
2519
2520 The following options control the amount and kinds of warnings produced
2521 by GCC; for further, language-specific options also refer to
2522 @ref{C++ Dialect Options} and @ref{Objective-C and Objective-C++ Dialect
2523 Options}.
2524
2525 @table @gcctabopt
2526 @cindex syntax checking
2527 @item -fsyntax-only
2528 @opindex fsyntax-only
2529 Check the code for syntax errors, but don't do anything beyond that.
2530
2531 @item -pedantic
2532 @opindex pedantic
2533 Issue all the warnings demanded by strict ISO C and ISO C++;
2534 reject all programs that use forbidden extensions, and some other
2535 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
2536 version of the ISO C standard specified by any @option{-std} option used.
2537
2538 Valid ISO C and ISO C++ programs should compile properly with or without
2539 this option (though a rare few will require @option{-ansi} or a
2540 @option{-std} option specifying the required version of ISO C)@.  However,
2541 without this option, certain GNU extensions and traditional C and C++
2542 features are supported as well.  With this option, they are rejected.
2543
2544 @option{-pedantic} does not cause warning messages for use of the
2545 alternate keywords whose names begin and end with @samp{__}.  Pedantic
2546 warnings are also disabled in the expression that follows
2547 @code{__extension__}.  However, only system header files should use
2548 these escape routes; application programs should avoid them.
2549 @xref{Alternate Keywords}.
2550
2551 Some users try to use @option{-pedantic} to check programs for strict ISO
2552 C conformance.  They soon find that it does not do quite what they want:
2553 it finds some non-ISO practices, but not all---only those for which
2554 ISO C @emph{requires} a diagnostic, and some others for which
2555 diagnostics have been added.
2556
2557 A feature to report any failure to conform to ISO C might be useful in
2558 some instances, but would require considerable additional work and would
2559 be quite different from @option{-pedantic}.  We don't have plans to
2560 support such a feature in the near future.
2561
2562 Where the standard specified with @option{-std} represents a GNU
2563 extended dialect of C, such as @samp{gnu89} or @samp{gnu99}, there is a
2564 corresponding @dfn{base standard}, the version of ISO C on which the GNU
2565 extended dialect is based.  Warnings from @option{-pedantic} are given
2566 where they are required by the base standard.  (It would not make sense
2567 for such warnings to be given only for features not in the specified GNU
2568 C dialect, since by definition the GNU dialects of C include all
2569 features the compiler supports with the given option, and there would be
2570 nothing to warn about.)
2571
2572 @item -pedantic-errors
2573 @opindex pedantic-errors
2574 Like @option{-pedantic}, except that errors are produced rather than
2575 warnings.
2576
2577 @item -w
2578 @opindex w
2579 Inhibit all warning messages.
2580
2581 @item -Wno-import
2582 @opindex Wno-import
2583 Inhibit warning messages about the use of @samp{#import}.
2584
2585 @item -Wchar-subscripts
2586 @opindex Wchar-subscripts
2587 Warn if an array subscript has type @code{char}.  This is a common cause
2588 of error, as programmers often forget that this type is signed on some
2589 machines.
2590 This warning is enabled by @option{-Wall}.
2591
2592 @item -Wcomment
2593 @opindex Wcomment
2594 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
2595 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
2596 This warning is enabled by @option{-Wall}.
2597
2598 @item -Wfatal-errors
2599 @opindex Wfatal-errors
2600 This option causes the compiler to abort compilation on the first error
2601 occurred rather than trying to keep going and printing further error
2602 messages.
2603
2604 @item -Wformat
2605 @opindex Wformat
2606 @opindex ffreestanding
2607 @opindex fno-builtin
2608 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
2609 the arguments supplied have types appropriate to the format string
2610 specified, and that the conversions specified in the format string make
2611 sense.  This includes standard functions, and others specified by format
2612 attributes (@pxref{Function Attributes}), in the @code{printf},
2613 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
2614 not in the C standard) families (or other target-specific families).
2615 Which functions are checked without format attributes having been
2616 specified depends on the standard version selected, and such checks of
2617 functions without the attribute specified are disabled by
2618 @option{-ffreestanding} or @option{-fno-builtin}.
2619
2620 The formats are checked against the format features supported by GNU
2621 libc version 2.2.  These include all ISO C90 and C99 features, as well
2622 as features from the Single Unix Specification and some BSD and GNU
2623 extensions.  Other library implementations may not support all these
2624 features; GCC does not support warning about features that go beyond a
2625 particular library's limitations.  However, if @option{-pedantic} is used
2626 with @option{-Wformat}, warnings will be given about format features not
2627 in the selected standard version (but not for @code{strfmon} formats,
2628 since those are not in any version of the C standard).  @xref{C Dialect
2629 Options,,Options Controlling C Dialect}.
2630
2631 Since @option{-Wformat} also checks for null format arguments for
2632 several functions, @option{-Wformat} also implies @option{-Wnonnull}.
2633
2634 @option{-Wformat} is included in @option{-Wall}.  For more control over some
2635 aspects of format checking, the options @option{-Wformat-y2k},
2636 @option{-Wno-format-extra-args}, @option{-Wno-format-zero-length},
2637 @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
2638 @option{-Wformat=2} are available, but are not included in @option{-Wall}.
2639
2640 @item -Wformat-y2k
2641 @opindex Wformat-y2k
2642 If @option{-Wformat} is specified, also warn about @code{strftime}
2643 formats which may yield only a two-digit year.
2644
2645 @item -Wno-format-extra-args
2646 @opindex Wno-format-extra-args
2647 If @option{-Wformat} is specified, do not warn about excess arguments to a
2648 @code{printf} or @code{scanf} format function.  The C standard specifies
2649 that such arguments are ignored.
2650
2651 Where the unused arguments lie between used arguments that are
2652 specified with @samp{$} operand number specifications, normally
2653 warnings are still given, since the implementation could not know what
2654 type to pass to @code{va_arg} to skip the unused arguments.  However,
2655 in the case of @code{scanf} formats, this option will suppress the
2656 warning if the unused arguments are all pointers, since the Single
2657 Unix Specification says that such unused arguments are allowed.
2658
2659 @item -Wno-format-zero-length
2660 @opindex Wno-format-zero-length
2661 If @option{-Wformat} is specified, do not warn about zero-length formats.
2662 The C standard specifies that zero-length formats are allowed.
2663
2664 @item -Wformat-nonliteral
2665 @opindex Wformat-nonliteral
2666 If @option{-Wformat} is specified, also warn if the format string is not a
2667 string literal and so cannot be checked, unless the format function
2668 takes its format arguments as a @code{va_list}.
2669
2670 @item -Wformat-security
2671 @opindex Wformat-security
2672 If @option{-Wformat} is specified, also warn about uses of format
2673 functions that represent possible security problems.  At present, this
2674 warns about calls to @code{printf} and @code{scanf} functions where the
2675 format string is not a string literal and there are no format arguments,
2676 as in @code{printf (foo);}.  This may be a security hole if the format
2677 string came from untrusted input and contains @samp{%n}.  (This is
2678 currently a subset of what @option{-Wformat-nonliteral} warns about, but
2679 in future warnings may be added to @option{-Wformat-security} that are not
2680 included in @option{-Wformat-nonliteral}.)
2681
2682 @item -Wformat=2
2683 @opindex Wformat=2
2684 Enable @option{-Wformat} plus format checks not included in
2685 @option{-Wformat}.  Currently equivalent to @samp{-Wformat
2686 -Wformat-nonliteral -Wformat-security -Wformat-y2k}.
2687
2688 @item -Wnonnull
2689 @opindex Wnonnull
2690 Warn about passing a null pointer for arguments marked as
2691 requiring a non-null value by the @code{nonnull} function attribute.
2692
2693 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
2694 can be disabled with the @option{-Wno-nonnull} option.
2695
2696 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
2697 @opindex Winit-self
2698 Warn about uninitialized variables which are initialized with themselves.
2699 Note this option can only be used with the @option{-Wuninitialized} option,
2700 which in turn only works with @option{-O1} and above.
2701
2702 For example, GCC will warn about @code{i} being uninitialized in the
2703 following snippet only when @option{-Winit-self} has been specified:
2704 @smallexample
2705 @group
2706 int f()
2707 @{
2708   int i = i;
2709   return i;
2710 @}
2711 @end group
2712 @end smallexample
2713
2714 @item -Wimplicit-int
2715 @opindex Wimplicit-int
2716 Warn when a declaration does not specify a type.
2717 This warning is enabled by @option{-Wall}.
2718
2719 @item -Wimplicit-function-declaration
2720 @opindex Wimplicit-function-declaration
2721 @opindex Wno-implicit-function-declaration
2722 Give a warning whenever a function is used before being declared. In
2723 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
2724 enabled by default and it is made into an error by
2725 @option{-pedantic-errors}. This warning is also enabled by
2726 @option{-Wall}.
2727
2728 @item -Wimplicit
2729 @opindex Wimplicit
2730 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
2731 This warning is enabled by @option{-Wall}.
2732
2733 @item -Wmain
2734 @opindex Wmain
2735 Warn if the type of @samp{main} is suspicious.  @samp{main} should be a
2736 function with external linkage, returning int, taking either zero
2737 arguments, two, or three arguments of appropriate types.
2738 This warning is enabled by @option{-Wall}.
2739
2740 @item -Wmissing-braces
2741 @opindex Wmissing-braces
2742 Warn if an aggregate or union initializer is not fully bracketed.  In
2743 the following example, the initializer for @samp{a} is not fully
2744 bracketed, but that for @samp{b} is fully bracketed.
2745
2746 @smallexample
2747 int a[2][2] = @{ 0, 1, 2, 3 @};
2748 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
2749 @end smallexample
2750
2751 This warning is enabled by @option{-Wall}.
2752
2753 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
2754 @opindex Wmissing-include-dirs
2755 Warn if a user-supplied include directory does not exist.
2756
2757 @item -Wparentheses
2758 @opindex Wparentheses
2759 Warn if parentheses are omitted in certain contexts, such
2760 as when there is an assignment in a context where a truth value
2761 is expected, or when operators are nested whose precedence people
2762 often get confused about.
2763
2764 Also warn if a comparison like @samp{x<=y<=z} appears; this is
2765 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
2766 interpretation from that of ordinary mathematical notation.
2767
2768 Also warn about constructions where there may be confusion to which
2769 @code{if} statement an @code{else} branch belongs.  Here is an example of
2770 such a case:
2771
2772 @smallexample
2773 @group
2774 @{
2775   if (a)
2776     if (b)
2777       foo ();
2778   else
2779     bar ();
2780 @}
2781 @end group
2782 @end smallexample
2783
2784 In C/C++, every @code{else} branch belongs to the innermost possible
2785 @code{if} statement, which in this example is @code{if (b)}.  This is
2786 often not what the programmer expected, as illustrated in the above
2787 example by indentation the programmer chose.  When there is the
2788 potential for this confusion, GCC will issue a warning when this flag
2789 is specified.  To eliminate the warning, add explicit braces around
2790 the innermost @code{if} statement so there is no way the @code{else}
2791 could belong to the enclosing @code{if}.  The resulting code would
2792 look like this:
2793
2794 @smallexample
2795 @group
2796 @{
2797   if (a)
2798     @{
2799       if (b)
2800         foo ();
2801       else
2802         bar ();
2803     @}
2804 @}
2805 @end group
2806 @end smallexample
2807
2808 This warning is enabled by @option{-Wall}.
2809
2810 @item -Wsequence-point
2811 @opindex Wsequence-point
2812 Warn about code that may have undefined semantics because of violations
2813 of sequence point rules in the C and C++ standards.
2814
2815 The C and C++ standards defines the order in which expressions in a C/C++
2816 program are evaluated in terms of @dfn{sequence points}, which represent
2817 a partial ordering between the execution of parts of the program: those
2818 executed before the sequence point, and those executed after it.  These
2819 occur after the evaluation of a full expression (one which is not part
2820 of a larger expression), after the evaluation of the first operand of a
2821 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
2822 function is called (but after the evaluation of its arguments and the
2823 expression denoting the called function), and in certain other places.
2824 Other than as expressed by the sequence point rules, the order of
2825 evaluation of subexpressions of an expression is not specified.  All
2826 these rules describe only a partial order rather than a total order,
2827 since, for example, if two functions are called within one expression
2828 with no sequence point between them, the order in which the functions
2829 are called is not specified.  However, the standards committee have
2830 ruled that function calls do not overlap.
2831
2832 It is not specified when between sequence points modifications to the
2833 values of objects take effect.  Programs whose behavior depends on this
2834 have undefined behavior; the C and C++ standards specify that ``Between
2835 the previous and next sequence point an object shall have its stored
2836 value modified at most once by the evaluation of an expression.
2837 Furthermore, the prior value shall be read only to determine the value
2838 to be stored.''.  If a program breaks these rules, the results on any
2839 particular implementation are entirely unpredictable.
2840
2841 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
2842 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
2843 diagnosed by this option, and it may give an occasional false positive
2844 result, but in general it has been found fairly effective at detecting
2845 this sort of problem in programs.
2846
2847 The standard is worded confusingly, therefore there is some debate
2848 over the precise meaning of the sequence point rules in subtle cases.
2849 Links to discussions of the problem, including proposed formal
2850 definitions, may be found on the GCC readings page, at
2851 @w{@uref{http://gcc.gnu.org/readings.html}}.
2852
2853 This warning is enabled by @option{-Wall} for C and C++.
2854
2855 @item -Wreturn-type
2856 @opindex Wreturn-type
2857 @opindex Wno-return-type
2858 Warn whenever a function is defined with a return-type that defaults
2859 to @code{int}.  Also warn about any @code{return} statement with no
2860 return-value in a function whose return-type is not @code{void}
2861 (falling off the end of the function body is considered returning
2862 without a value), and about a @code{return} statement with a
2863 expression in a function whose return-type is @code{void}.
2864
2865 Also warn if the return type of a function has a type qualifier
2866 such as @code{const}.  For ISO C such a type qualifier has no effect,
2867 since the value returned by a function is not an lvalue.
2868 For C++, the warning is only emitted for scalar types or @code{void}.
2869 ISO C prohibits qualified @code{void} return types on function
2870 definitions, so such return types always receive a warning
2871 even without this option.
2872
2873 For C++, a function without return type always produces a diagnostic
2874 message, even when @option{-Wno-return-type} is specified.  The only
2875 exceptions are @samp{main} and functions defined in system headers.
2876
2877 This warning is enabled by @option{-Wall}.
2878
2879 @item -Wswitch
2880 @opindex Wswitch
2881 Warn whenever a @code{switch} statement has an index of enumerated type
2882 and lacks a @code{case} for one or more of the named codes of that
2883 enumeration.  (The presence of a @code{default} label prevents this
2884 warning.)  @code{case} labels outside the enumeration range also
2885 provoke warnings when this option is used.
2886 This warning is enabled by @option{-Wall}.
2887
2888 @item -Wswitch-default
2889 @opindex Wswitch-switch
2890 Warn whenever a @code{switch} statement does not have a @code{default}
2891 case.
2892
2893 @item -Wswitch-enum
2894 @opindex Wswitch-enum
2895 Warn whenever a @code{switch} statement has an index of enumerated type
2896 and lacks a @code{case} for one or more of the named codes of that
2897 enumeration.  @code{case} labels outside the enumeration range also
2898 provoke warnings when this option is used.
2899
2900 @item -Wtrigraphs
2901 @opindex Wtrigraphs
2902 Warn if any trigraphs are encountered that might change the meaning of
2903 the program (trigraphs within comments are not warned about).
2904 This warning is enabled by @option{-Wall}.
2905
2906 @item -Wunused-function
2907 @opindex Wunused-function
2908 Warn whenever a static function is declared but not defined or a
2909 non-inline static function is unused.
2910 This warning is enabled by @option{-Wall}.
2911
2912 @item -Wunused-label
2913 @opindex Wunused-label
2914 Warn whenever a label is declared but not used.
2915 This warning is enabled by @option{-Wall}.
2916
2917 To suppress this warning use the @samp{unused} attribute
2918 (@pxref{Variable Attributes}).
2919
2920 @item -Wunused-parameter
2921 @opindex Wunused-parameter
2922 Warn whenever a function parameter is unused aside from its declaration.
2923
2924 To suppress this warning use the @samp{unused} attribute
2925 (@pxref{Variable Attributes}).
2926
2927 @item -Wunused-variable
2928 @opindex Wunused-variable
2929 Warn whenever a local variable or non-constant static variable is unused
2930 aside from its declaration.
2931 This warning is enabled by @option{-Wall}.
2932
2933 To suppress this warning use the @samp{unused} attribute
2934 (@pxref{Variable Attributes}).
2935
2936 @item -Wunused-value
2937 @opindex Wunused-value
2938 Warn whenever a statement computes a result that is explicitly not
2939 used. To suppress this warning cast the unused expression to
2940 @samp{void}. This includes an expression-statement or the left-hand
2941 side of a comma expression that contains no side effects. For example,
2942 an expression such as @samp{x[i,j]} will cause a warning, while
2943 @samp{x[(void)i,j]} will not.
2944
2945 This warning is enabled by @option{-Wall}.
2946
2947 @item -Wunused
2948 @opindex Wunused
2949 All the above @option{-Wunused} options combined.
2950
2951 In order to get a warning about an unused function parameter, you must
2952 either specify @samp{-Wextra -Wunused} (note that @samp{-Wall} implies
2953 @samp{-Wunused}), or separately specify @option{-Wunused-parameter}.
2954
2955 @item -Wuninitialized
2956 @opindex Wuninitialized
2957 Warn if an automatic variable is used without first being initialized or
2958 if a variable may be clobbered by a @code{setjmp} call.
2959
2960 These warnings are possible only in optimizing compilation,
2961 because they require data flow information that is computed only
2962 when optimizing.  If you do not specify @option{-O}, you will not get
2963 these warnings. Instead, GCC will issue a warning about @option{-Wuninitialized}
2964 requiring @option{-O}.
2965
2966 If you want to warn about code which uses the uninitialized value of the
2967 variable in its own initializer, use the @option{-Winit-self} option.
2968
2969 These warnings occur for individual uninitialized or clobbered
2970 elements of structure, union or array variables as well as for
2971 variables which are uninitialized or clobbered as a whole.  They do
2972 not occur for variables or elements declared @code{volatile}.  Because
2973 these warnings depend on optimization, the exact variables or elements
2974 for which there are warnings will depend on the precise optimization
2975 options and version of GCC used.
2976
2977 Note that there may be no warning about a variable that is used only
2978 to compute a value that itself is never used, because such
2979 computations may be deleted by data flow analysis before the warnings
2980 are printed.
2981
2982 These warnings are made optional because GCC is not smart
2983 enough to see all the reasons why the code might be correct
2984 despite appearing to have an error.  Here is one example of how
2985 this can happen:
2986
2987 @smallexample
2988 @group
2989 @{
2990   int x;
2991   switch (y)
2992     @{
2993     case 1: x = 1;
2994       break;
2995     case 2: x = 4;
2996       break;
2997     case 3: x = 5;
2998     @}
2999   foo (x);
3000 @}
3001 @end group
3002 @end smallexample
3003
3004 @noindent
3005 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
3006 always initialized, but GCC doesn't know this.  Here is
3007 another common case:
3008
3009 @smallexample
3010 @{
3011   int save_y;
3012   if (change_y) save_y = y, y = new_y;
3013   @dots{}
3014   if (change_y) y = save_y;
3015 @}
3016 @end smallexample
3017
3018 @noindent
3019 This has no bug because @code{save_y} is used only if it is set.
3020
3021 @cindex @code{longjmp} warnings
3022 This option also warns when a non-volatile automatic variable might be
3023 changed by a call to @code{longjmp}.  These warnings as well are possible
3024 only in optimizing compilation.
3025
3026 The compiler sees only the calls to @code{setjmp}.  It cannot know
3027 where @code{longjmp} will be called; in fact, a signal handler could
3028 call it at any point in the code.  As a result, you may get a warning
3029 even when there is in fact no problem because @code{longjmp} cannot
3030 in fact be called at the place which would cause a problem.
3031
3032 Some spurious warnings can be avoided if you declare all the functions
3033 you use that never return as @code{noreturn}.  @xref{Function
3034 Attributes}.
3035
3036 This warning is enabled by @option{-Wall}.
3037
3038 @item -Wunknown-pragmas
3039 @opindex Wunknown-pragmas
3040 @cindex warning for unknown pragmas
3041 @cindex unknown pragmas, warning
3042 @cindex pragmas, warning of unknown
3043 Warn when a #pragma directive is encountered which is not understood by
3044 GCC@.  If this command line option is used, warnings will even be issued
3045 for unknown pragmas in system header files.  This is not the case if
3046 the warnings were only enabled by the @option{-Wall} command line option.
3047
3048 @item -Wno-pragmas
3049 @opindex Wno-pragmas
3050 @opindex Wpragmas
3051 Do not warn about misuses of pragmas, such as incorrect parameters,
3052 invalid syntax, or conflicts between pragmas.  See also
3053 @samp{-Wunknown-pragmas}.
3054
3055 @item -Wstrict-aliasing
3056 @opindex Wstrict-aliasing
3057 This option is only active when @option{-fstrict-aliasing} is active.
3058 It warns about code which might break the strict aliasing rules that the
3059 compiler is using for optimization.  The warning does not catch all
3060 cases, but does attempt to catch the more common pitfalls.  It is
3061 included in @option{-Wall}.
3062 It is equivalent to -Wstrict-aliasing=3
3063
3064 @item -Wstrict-aliasing=n
3065 @opindex Wstrict-aliasing=n
3066 This option is only active when @option{-fstrict-aliasing} is active.
3067 It warns about code which might break the strict aliasing rules that the
3068 compiler is using for optimization.
3069 Higher levels correspond to higher accuracy (fewer false positives).
3070 Higher levels also correspond to more effort, similar to the way -O works.
3071 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=n},
3072 with n=3.
3073
3074 Level 1: Most aggressive, quick, least accurate.
3075 Possibly useful when higher levels
3076 do not warn but -fstrict-aliasing still breaks the code, as it has very few 
3077 false negatives.  However, it has many false positives.
3078 Warns for all pointer conversions between possibly incompatible types, 
3079 even if never dereferenced.  Runs in the frontend only.
3080
3081 Level 2: Aggressive, quick, not too precise.
3082 May still have many false positives (not as many as level 1 though),
3083 and few false negatives (but possibly more than level 1).
3084 Unlike level 1, it only warns when an address is taken.  Warns about
3085 incomplete types.  Runs in the frontend only.
3086
3087 Level 3 (default for @option{-Wstrict-aliasing}): 
3088 Should have very few false positives and few false 
3089 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
3090 Takes care of the common punn+dereference pattern in the frontend:
3091 @code{*(int*)&some_float}.
3092 If optimization is enabled, it also runs in the backend, where it deals 
3093 with multiple statement cases using flow-sensitive points-to information.
3094 Only warns when the converted pointer is dereferenced.
3095 Does not warn about incomplete types.
3096
3097 @item -Wstrict-overflow
3098 @item -Wstrict-overflow=@var{n}
3099 @opindex Wstrict-overflow
3100 This option is only active when @option{-fstrict-overflow} is active.
3101 It warns about cases where the compiler optimizes based on the
3102 assumption that signed overflow does not occur.  Note that it does not
3103 warn about all cases where the code might overflow: it only warns
3104 about cases where the compiler implements some optimization.  Thus
3105 this warning depends on the optimization level.
3106
3107 An optimization which assumes that signed overflow does not occur is
3108 perfectly safe if the values of the variables involved are such that
3109 overflow never does, in fact, occur.  Therefore this warning can
3110 easily give a false positive: a warning about code which is not
3111 actually a problem.  To help focus on important issues, several
3112 warning levels are defined.  No warnings are issued for the use of
3113 undefined signed overflow when estimating how many iterations a loop
3114 will require, in particular when determining whether a loop will be
3115 executed at all.
3116
3117 @table @option
3118 @item -Wstrict-overflow=1
3119 Warn about cases which are both questionable and easy to avoid.  For
3120 example: @code{x + 1 > x}; with @option{-fstrict-overflow}, the
3121 compiler will simplify this to @code{1}.  This level of
3122 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
3123 are not, and must be explicitly requested.
3124
3125 @item -Wstrict-overflow=2
3126 Also warn about other cases where a comparison is simplified to a
3127 constant.  For example: @code{abs (x) >= 0}.  This can only be
3128 simplified when @option{-fstrict-overflow} is in effect, because
3129 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
3130 zero.  @option{-Wstrict-overflow} (with no level) is the same as
3131 @option{-Wstrict-overflow=2}.
3132
3133 @item -Wstrict-overflow=3
3134 Also warn about other cases where a comparison is simplified.  For
3135 example: @code{x + 1 > 1} will be simplified to @code{x > 0}.
3136
3137 @item -Wstrict-overflow=4
3138 Also warn about other simplifications not covered by the above cases.
3139 For example: @code{(x * 10) / 5} will be simplified to @code{x * 2}.
3140
3141 @item -Wstrict-overflow=5
3142 Also warn about cases where the compiler reduces the magnitude of a
3143 constant involved in a comparison.  For example: @code{x + 2 > y} will
3144 be simplified to @code{x + 1 >= y}.  This is reported only at the
3145 highest warning level because this simplification applies to many
3146 comparisons, so this warning level will give a very large number of
3147 false positives.
3148 @end table
3149
3150 @item -Warray-bounds
3151 @opindex Wno-array-bounds
3152 @opindex Warray-bounds
3153 This option is only active when @option{-ftree-vrp} is active
3154 (default for -O2 and above). It warns about subscripts to arrays
3155 that are always out of bounds. This warning is enabled by @option{-Wall}.
3156
3157 @item -Wall
3158 @opindex Wall
3159 All of the above @samp{-W} options combined.  This enables all the
3160 warnings about constructions that some users consider questionable, and
3161 that are easy to avoid (or modify to prevent the warning), even in
3162 conjunction with macros.  This also enables some language-specific
3163 warnings described in @ref{C++ Dialect Options} and
3164 @ref{Objective-C and Objective-C++ Dialect Options}.
3165 @end table
3166
3167 The following @option{-W@dots{}} options are not implied by @option{-Wall}.
3168 Some of them warn about constructions that users generally do not
3169 consider questionable, but which occasionally you might wish to check
3170 for; others warn about constructions that are necessary or hard to avoid
3171 in some cases, and there is no simple way to modify the code to suppress
3172 the warning.
3173
3174 @table @gcctabopt
3175 @item -Wextra
3176 @opindex W
3177 @opindex Wextra
3178 (This option used to be called @option{-W}.  The older name is still
3179 supported, but the newer name is more descriptive.)  Print extra warning
3180 messages for these events:
3181
3182 @itemize @bullet
3183 @item
3184 Warn if a comparison is always true or always false due to the limited
3185 range of the data type, but do not warn for constant expressions.  For
3186 example, warn if an unsigned variable is compared against zero with
3187 @samp{<} or @samp{>=}.  This warning can be independently controlled
3188 by @option{-Wtype-limits}.
3189
3190 @item @r{(C only)}
3191 Storage-class specifiers like @code{static} are not the first things
3192 in a declaration.  According to the C Standard, this usage is
3193 obsolescent.  This warning can be independently controlled by
3194 @option{-Wold-style-declaration}.
3195
3196 @item
3197 If @option{-Wall} or @option{-Wunused} is also specified, warn about unused
3198 arguments.
3199
3200 @item
3201 A comparison between signed and unsigned values could produce an
3202 incorrect result when the signed value is converted to unsigned.
3203 (But don't warn if @option{-Wno-sign-compare} is also specified.)
3204
3205 @item
3206 An aggregate has an initializer which does not initialize all members.
3207 This warning can be independently controlled by
3208 @option{-Wmissing-field-initializers}.
3209
3210 @item
3211 An initialized field without side effects is overridden when using
3212 designated initializers (@pxref{Designated Inits, , Designated
3213 Initializers}).  This warning can be independently controlled by
3214 @option{-Woverride-init}.
3215
3216 @item @r{(C only)}
3217 A function parameter is declared without a type specifier in K&R-style
3218 functions.  This warning can be independently controlled by
3219 @option{-Wmissing-parameter-type}.
3220
3221 @item
3222 An empty body occurs in an @samp{if}, @samp{else} or
3223 @samp{do while} statement. This warning can be independently
3224 controlled by @option{-Wempty-body}.
3225
3226 @item @r{(C++ only)}
3227 An empty body occurs in a @samp{while} or @samp{for} statement with no
3228 whitespacing before the semicolon. This warning can be independently
3229 controlled by @option{-Wempty-body}.
3230
3231 @item
3232 A pointer is compared against integer zero with @samp{<}, @samp{<=},
3233 @samp{>}, or @samp{>=}.
3234
3235 @item
3236 A variable might be changed by @samp{longjmp} or @samp{vfork}.
3237 This warning can be independently controlled by @option{-Wclobbered}.
3238
3239 @item @r{(C++ only)}
3240 An enumerator and a non-enumerator both appear in a conditional expression.
3241
3242 @item @r{(C++ only)}
3243 A non-static reference or non-static @samp{const} member appears in a
3244 class without constructors.
3245
3246 @item @r{(C++ only)}
3247 Ambiguous virtual bases.
3248
3249 @item @r{(C++ only)}
3250 Subscripting an array which has been declared @samp{register}.
3251
3252 @item @r{(C++ only)}
3253 Taking the address of a variable which has been declared @samp{register}.
3254
3255 @item @r{(C++ only)}
3256 A base class is not initialized in a derived class' copy constructor.
3257 @end itemize
3258
3259 @item -Wno-div-by-zero
3260 @opindex Wno-div-by-zero
3261 @opindex Wdiv-by-zero
3262 Do not warn about compile-time integer division by zero.  Floating point
3263 division by zero is not warned about, as it can be a legitimate way of
3264 obtaining infinities and NaNs.
3265
3266 @item -Wsystem-headers
3267 @opindex Wsystem-headers
3268 @cindex warnings from system headers
3269 @cindex system headers, warnings from
3270 Print warning messages for constructs found in system header files.
3271 Warnings from system headers are normally suppressed, on the assumption
3272 that they usually do not indicate real problems and would only make the
3273 compiler output harder to read.  Using this command line option tells
3274 GCC to emit warnings from system headers as if they occurred in user
3275 code.  However, note that using @option{-Wall} in conjunction with this
3276 option will @emph{not} warn about unknown pragmas in system
3277 headers---for that, @option{-Wunknown-pragmas} must also be used.
3278
3279 @item -Wfloat-equal
3280 @opindex Wfloat-equal
3281 Warn if floating point values are used in equality comparisons.
3282
3283 The idea behind this is that sometimes it is convenient (for the
3284 programmer) to consider floating-point values as approximations to
3285 infinitely precise real numbers.  If you are doing this, then you need
3286 to compute (by analyzing the code, or in some other way) the maximum or
3287 likely maximum error that the computation introduces, and allow for it
3288 when performing comparisons (and when producing output, but that's a
3289 different problem).  In particular, instead of testing for equality, you
3290 would check to see whether the two values have ranges that overlap; and
3291 this is done with the relational operators, so equality comparisons are
3292 probably mistaken.
3293
3294 @item -Wtraditional @r{(C only)}
3295 @opindex Wtraditional
3296 Warn about certain constructs that behave differently in traditional and
3297 ISO C@.  Also warn about ISO C constructs that have no traditional C
3298 equivalent, and/or problematic constructs which should be avoided.
3299
3300 @itemize @bullet
3301 @item
3302 Macro parameters that appear within string literals in the macro body.
3303 In traditional C macro replacement takes place within string literals,
3304 but does not in ISO C@.
3305
3306 @item
3307 In traditional C, some preprocessor directives did not exist.
3308 Traditional preprocessors would only consider a line to be a directive
3309 if the @samp{#} appeared in column 1 on the line.  Therefore
3310 @option{-Wtraditional} warns about directives that traditional C
3311 understands but would ignore because the @samp{#} does not appear as the
3312 first character on the line.  It also suggests you hide directives like
3313 @samp{#pragma} not understood by traditional C by indenting them.  Some
3314 traditional implementations would not recognize @samp{#elif}, so it
3315 suggests avoiding it altogether.
3316
3317 @item
3318 A function-like macro that appears without arguments.
3319
3320 @item
3321 The unary plus operator.
3322
3323 @item
3324 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating point
3325 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
3326 constants.)  Note, these suffixes appear in macros defined in the system
3327 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
3328 Use of these macros in user code might normally lead to spurious
3329 warnings, however GCC's integrated preprocessor has enough context to
3330 avoid warning in these cases.
3331
3332 @item
3333 A function declared external in one block and then used after the end of
3334 the block.
3335
3336 @item
3337 A @code{switch} statement has an operand of type @code{long}.
3338
3339 @item
3340 A non-@code{static} function declaration follows a @code{static} one.
3341 This construct is not accepted by some traditional C compilers.
3342
3343 @item
3344 The ISO type of an integer constant has a different width or
3345 signedness from its traditional type.  This warning is only issued if
3346 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
3347 typically represent bit patterns, are not warned about.
3348
3349 @item
3350 Usage of ISO string concatenation is detected.
3351
3352 @item
3353 Initialization of automatic aggregates.
3354
3355 @item
3356 Identifier conflicts with labels.  Traditional C lacks a separate
3357 namespace for labels.
3358
3359 @item
3360 Initialization of unions.  If the initializer is zero, the warning is
3361 omitted.  This is done under the assumption that the zero initializer in
3362 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
3363 initializer warnings and relies on default initialization to zero in the
3364 traditional C case.
3365
3366 @item
3367 Conversions by prototypes between fixed/floating point values and vice
3368 versa.  The absence of these prototypes when compiling with traditional
3369 C would cause serious problems.  This is a subset of the possible
3370 conversion warnings, for the full set use @option{-Wtraditional-conversion}.
3371
3372 @item
3373 Use of ISO C style function definitions.  This warning intentionally is
3374 @emph{not} issued for prototype declarations or variadic functions
3375 because these ISO C features will appear in your code when using
3376 libiberty's traditional C compatibility macros, @code{PARAMS} and
3377 @code{VPARAMS}.  This warning is also bypassed for nested functions
3378 because that feature is already a GCC extension and thus not relevant to
3379 traditional C compatibility.
3380 @end itemize
3381
3382 @item -Wtraditional-conversion @r{(C only)}
3383 @opindex Wtraditional-conversion
3384 Warn if a prototype causes a type conversion that is different from what
3385 would happen to the same argument in the absence of a prototype.  This
3386 includes conversions of fixed point to floating and vice versa, and
3387 conversions changing the width or signedness of a fixed point argument
3388 except when the same as the default promotion.
3389
3390 @item -Wdeclaration-after-statement @r{(C only)}
3391 @opindex Wdeclaration-after-statement
3392 Warn when a declaration is found after a statement in a block.  This
3393 construct, known from C++, was introduced with ISO C99 and is by default
3394 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
3395 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
3396
3397 @item -Wundef
3398 @opindex Wundef
3399 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
3400
3401 @item -Wno-endif-labels
3402 @opindex Wno-endif-labels
3403 @opindex Wendif-labels
3404 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
3405
3406 @item -Wshadow
3407 @opindex Wshadow
3408 Warn whenever a local variable shadows another local variable, parameter or
3409 global variable or whenever a built-in function is shadowed.
3410
3411 @item -Wlarger-than-@var{len}
3412 @opindex Wlarger-than
3413 Warn whenever an object of larger than @var{len} bytes is defined.
3414
3415 @item -Wunsafe-loop-optimizations
3416 @opindex Wunsafe-loop-optimizations
3417 Warn if the loop cannot be optimized because the compiler could not
3418 assume anything on the bounds of the loop indices.  With
3419 @option{-funsafe-loop-optimizations} warn if the compiler made
3420 such assumptions.
3421
3422 @item -Wpointer-arith
3423 @opindex Wpointer-arith
3424 Warn about anything that depends on the ``size of'' a function type or
3425 of @code{void}.  GNU C assigns these types a size of 1, for
3426 convenience in calculations with @code{void *} pointers and pointers
3427 to functions.  In C++, warn also when an arithmetic operation involves
3428 @code{NULL}.  This warning is also enabled by @option{-pedantic}.
3429
3430 @item -Wtype-limits
3431 @opindex Wtype-limits
3432 @opindex Wno-type-limits
3433 Warn if a comparison is always true or always false due to the limited
3434 range of the data type, but do not warn for constant expressions.  For
3435 example, warn if an unsigned variable is compared against zero with
3436 @samp{<} or @samp{>=}.  This warning is also enabled by
3437 @option{-Wextra}.
3438
3439 @item -Wbad-function-cast @r{(C only)}
3440 @opindex Wbad-function-cast
3441 Warn whenever a function call is cast to a non-matching type.
3442 For example, warn if @code{int malloc()} is cast to @code{anything *}.
3443
3444 @item -Wc++-compat
3445 Warn about ISO C constructs that are outside of the common subset of
3446 ISO C and ISO C++, e.g.@: request for implicit conversion from
3447 @code{void *} to a pointer to non-@code{void} type.
3448
3449 @item -Wc++0x-compat @r{(C++ and Objective-C++ only)}
3450 Warn about C++ constructs whose meaning differs between ISO C++ 1998 and
3451 ISO C++ 200x, e.g., identifiers in ISO C++ 1998 that will become keywords
3452 in ISO C++ 200x.  This warning is enabled by @option{-Wall}.
3453
3454 @item -Wcast-qual
3455 @opindex Wcast-qual
3456 Warn whenever a pointer is cast so as to remove a type qualifier from
3457 the target type.  For example, warn if a @code{const char *} is cast
3458 to an ordinary @code{char *}.
3459
3460 @item -Wcast-align
3461 @opindex Wcast-align
3462 Warn whenever a pointer is cast such that the required alignment of the
3463 target is increased.  For example, warn if a @code{char *} is cast to
3464 an @code{int *} on machines where integers can only be accessed at
3465 two- or four-byte boundaries.
3466
3467 @item -Wwrite-strings
3468 @opindex Wwrite-strings
3469 When compiling C, give string constants the type @code{const
3470 char[@var{length}]} so that
3471 copying the address of one into a non-@code{const} @code{char *}
3472 pointer will get a warning; when compiling C++, warn about the
3473 deprecated conversion from string literals to @code{char *}.  This
3474 warning, by default, is enabled for C++ programs.
3475 These warnings will help you find at
3476 compile time code that can try to write into a string constant, but
3477 only if you have been very careful about using @code{const} in
3478 declarations and prototypes.  Otherwise, it will just be a nuisance;
3479 this is why we did not make @option{-Wall} request these warnings.
3480
3481 @item -Wclobbered
3482 @opindex Wclobbered
3483 Warn for variables that might be changed by @samp{longjmp} or
3484 @samp{vfork}.  This warning is also enabled by @option{-Wextra}.
3485
3486 @item -Wconversion
3487 @opindex Wconversion
3488 @opindex Wno-conversion
3489 Warn for implicit conversions that may alter a value. This includes
3490 conversions between real and integer, like @code{abs (x)} when
3491 @code{x} is @code{double}; conversions between signed and unsigned,
3492 like @code{unsigned ui = -1}; and conversions to smaller types, like
3493 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
3494 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
3495 changed by the conversion like in @code{abs (2.0)}.  Warnings about
3496 conversions between signed and unsigned integers can be disabled by
3497 using @option{-Wno-sign-conversion}.
3498
3499 For C++, also warn for conversions between @code{NULL} and non-pointer
3500 types; confusing overload resolution for user-defined conversions; and
3501 conversions that will never use a type conversion operator:
3502 conversions to @code{void}, the same type, a base class or a reference
3503 to them. Warnings about conversions between signed and unsigned
3504 integers are disabled by default in C++ unless
3505 @option{-Wsign-conversion} is explicitly enabled.
3506
3507 @item -Wempty-body
3508 @opindex Wempty-body
3509 Warn if an empty body occurs in an @samp{if}, @samp{else} or @samp{do
3510 while} statement.  Additionally, in C++, warn when an empty body occurs
3511 in a @samp{while} or @samp{for} statement with no whitespacing before
3512 the semicolon.  This warning is also enabled by @option{-Wextra}.
3513
3514 @item -Wsign-compare
3515 @opindex Wsign-compare
3516 @cindex warning for comparison of signed and unsigned values
3517 @cindex comparison of signed and unsigned values, warning
3518 @cindex signed and unsigned values, comparison warning
3519 Warn when a comparison between signed and unsigned values could produce
3520 an incorrect result when the signed value is converted to unsigned.
3521 This warning is also enabled by @option{-Wextra}; to get the other warnings
3522 of @option{-Wextra} without this warning, use @samp{-Wextra -Wno-sign-compare}.
3523
3524 @item -Wsign-conversion
3525 @opindex Wsign-conversion
3526 @opindex Wno-sign-conversion
3527 Warn for implicit conversions that may change the sign of an integer
3528 value, like assigning a signed integer expression to an unsigned
3529 integer variable. An explicit cast silences the warning. In C, this
3530 option is enabled also by @option{-Wconversion}.
3531
3532 @item -Waddress
3533 @opindex Waddress
3534 @opindex Wno-address
3535 Warn about suspicious uses of memory addresses. These include using
3536 the address of a function in a conditional expression, such as
3537 @code{void func(void); if (func)}, and comparisons against the memory
3538 address of a string literal, such as @code{if (x == "abc")}.  Such
3539 uses typically indicate a programmer error: the address of a function
3540 always evaluates to true, so their use in a conditional usually
3541 indicate that the programmer forgot the parentheses in a function
3542 call; and comparisons against string literals result in unspecified
3543 behavior and are not portable in C, so they usually indicate that the
3544 programmer intended to use @code{strcmp}.  This warning is enabled by
3545 @option{-Wall}.
3546
3547 @item -Wlogical-op
3548 @opindex Wlogical-op
3549 @opindex Wno-logical-op
3550 Warn about suspicious uses of logical operators in expressions.
3551 This includes using logical operators in contexts where a
3552 bit-wise operator is likely to be expected.
3553
3554 @item -Waggregate-return
3555 @opindex Waggregate-return
3556 Warn if any functions that return structures or unions are defined or
3557 called.  (In languages where you can return an array, this also elicits
3558 a warning.)
3559
3560 @item -Wno-attributes
3561 @opindex Wno-attributes
3562 @opindex Wattributes
3563 Do not warn if an unexpected @code{__attribute__} is used, such as
3564 unrecognized attributes, function attributes applied to variables,
3565 etc.  This will not stop errors for incorrect use of supported
3566 attributes.
3567
3568 @item -Wstrict-prototypes @r{(C only)}
3569 @opindex Wstrict-prototypes
3570 Warn if a function is declared or defined without specifying the
3571 argument types.  (An old-style function definition is permitted without
3572 a warning if preceded by a declaration which specifies the argument
3573 types.)
3574
3575 @item -Wold-style-declaration @r{(C only)}
3576 @opindex Wold-style-declaration
3577 Warn for obsolescent usages, according to the C Standard, in a
3578 declaration. For example, warn if storage-class specifiers like
3579 @code{static} are not the first things in a declaration.  This warning
3580 is also enabled by @option{-Wextra}.
3581
3582 @item -Wold-style-definition @r{(C only)}
3583 @opindex Wold-style-definition
3584 Warn if an old-style function definition is used.  A warning is given
3585 even if there is a previous prototype.
3586
3587 @item -Wmissing-parameter-type @r{(C only)}
3588 @opindex Wmissing-parameter-type
3589 A function parameter is declared without a type specifier in K&R-style
3590 functions:
3591
3592 @smallexample
3593 void foo(bar) @{ @}
3594 @end smallexample
3595
3596 This warning is also enabled by @option{-Wextra}.
3597
3598 @item -Wmissing-prototypes @r{(C only)}
3599 @opindex Wmissing-prototypes
3600 Warn if a global function is defined without a previous prototype
3601 declaration.  This warning is issued even if the definition itself
3602 provides a prototype.  The aim is to detect global functions that fail
3603 to be declared in header files.
3604
3605 @item -Wmissing-declarations @r{(C and C++ only)}
3606 @opindex Wmissing-declarations
3607 Warn if a global function is defined without a previous declaration.
3608 Do so even if the definition itself provides a prototype.
3609 Use this option to detect global functions that are not declared in
3610 header files.  In C++, no warnings are issued for function templates,
3611 or for inline functions, or for functions in anonymous namespaces.
3612
3613 @item -Wmissing-field-initializers
3614 @opindex Wmissing-field-initializers
3615 @opindex W
3616 @opindex Wextra
3617 Warn if a structure's initializer has some fields missing.  For
3618 example, the following code would cause such a warning, because
3619 @code{x.h} is implicitly zero:
3620
3621 @smallexample
3622 struct s @{ int f, g, h; @};
3623 struct s x = @{ 3, 4 @};
3624 @end smallexample
3625
3626 This option does not warn about designated initializers, so the following
3627 modification would not trigger a warning:
3628
3629 @smallexample
3630 struct s @{ int f, g, h; @};
3631 struct s x = @{ .f = 3, .g = 4 @};
3632 @end smallexample
3633
3634 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
3635 warnings without this one, use @samp{-Wextra -Wno-missing-field-initializers}.
3636
3637 @item -Wmissing-noreturn
3638 @opindex Wmissing-noreturn
3639 Warn about functions which might be candidates for attribute @code{noreturn}.
3640 Note these are only possible candidates, not absolute ones.  Care should
3641 be taken to manually verify functions actually do not ever return before
3642 adding the @code{noreturn} attribute, otherwise subtle code generation
3643 bugs could be introduced.  You will not get a warning for @code{main} in
3644 hosted C environments.
3645
3646 @item -Wmissing-format-attribute
3647 @opindex Wmissing-format-attribute
3648 @opindex Wformat
3649 Warn about function pointers which might be candidates for @code{format}
3650 attributes.  Note these are only possible candidates, not absolute ones.
3651 GCC will guess that function pointers with @code{format} attributes that
3652 are used in assignment, initialization, parameter passing or return
3653 statements should have a corresponding @code{format} attribute in the
3654 resulting type.  I.e.@: the left-hand side of the assignment or
3655 initialization, the type of the parameter variable, or the return type
3656 of the containing function respectively should also have a @code{format}
3657 attribute to avoid the warning.
3658
3659 GCC will also warn about function definitions which might be
3660 candidates for @code{format} attributes.  Again, these are only
3661 possible candidates.  GCC will guess that @code{format} attributes
3662 might be appropriate for any function that calls a function like
3663 @code{vprintf} or @code{vscanf}, but this might not always be the
3664 case, and some functions for which @code{format} attributes are
3665 appropriate may not be detected.
3666
3667 @item -Wno-multichar
3668 @opindex Wno-multichar
3669 @opindex Wmultichar
3670 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
3671 Usually they indicate a typo in the user's code, as they have
3672 implementation-defined values, and should not be used in portable code.
3673
3674 @item -Wnormalized=<none|id|nfc|nfkc>
3675 @opindex Wnormalized
3676 @cindex NFC
3677 @cindex NFKC
3678 @cindex character set, input normalization
3679 In ISO C and ISO C++, two identifiers are different if they are
3680 different sequences of characters.  However, sometimes when characters
3681 outside the basic ASCII character set are used, you can have two
3682 different character sequences that look the same.  To avoid confusion,
3683 the ISO 10646 standard sets out some @dfn{normalization rules} which
3684 when applied ensure that two sequences that look the same are turned into
3685 the same sequence.  GCC can warn you if you are using identifiers which
3686 have not been normalized; this option controls that warning.
3687
3688 There are four levels of warning that GCC supports.  The default is
3689 @option{-Wnormalized=nfc}, which warns about any identifier which is
3690 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
3691 recommended form for most uses.
3692
3693 Unfortunately, there are some characters which ISO C and ISO C++ allow
3694 in identifiers that when turned into NFC aren't allowable as
3695 identifiers.  That is, there's no way to use these symbols in portable
3696 ISO C or C++ and have all your identifiers in NFC.
3697 @option{-Wnormalized=id} suppresses the warning for these characters.
3698 It is hoped that future versions of the standards involved will correct
3699 this, which is why this option is not the default.
3700
3701 You can switch the warning off for all characters by writing
3702 @option{-Wnormalized=none}.  You would only want to do this if you
3703 were using some other normalization scheme (like ``D''), because
3704 otherwise you can easily create bugs that are literally impossible to see.
3705
3706 Some characters in ISO 10646 have distinct meanings but look identical
3707 in some fonts or display methodologies, especially once formatting has
3708 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
3709 LETTER N'', will display just like a regular @code{n} which has been
3710 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
3711 normalization scheme to convert all these into a standard form as
3712 well, and GCC will warn if your code is not in NFKC if you use
3713 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
3714 about every identifier that contains the letter O because it might be
3715 confused with the digit 0, and so is not the default, but may be
3716 useful as a local coding convention if the programming environment is
3717 unable to be fixed to display these characters distinctly.
3718
3719 @item -Wno-deprecated-declarations
3720 @opindex Wno-deprecated-declarations
3721 Do not warn about uses of functions (@pxref{Function Attributes}),
3722 variables (@pxref{Variable Attributes}), and types (@pxref{Type
3723 Attributes}) marked as deprecated by using the @code{deprecated}
3724 attribute.
3725
3726 @item -Wno-overflow
3727 @opindex Wno-overflow
3728 Do not warn about compile-time overflow in constant expressions.
3729
3730 @item -Woverride-init
3731 @opindex Woverride-init
3732 @opindex W
3733 @opindex Wextra
3734 Warn if an initialized field without side effects is overridden when
3735 using designated initializers (@pxref{Designated Inits, , Designated
3736 Initializers}).
3737
3738 This warning is included in @option{-Wextra}.  To get other
3739 @option{-Wextra} warnings without this one, use @samp{-Wextra
3740 -Wno-override-init}.
3741
3742 @item -Wpacked
3743 @opindex Wpacked
3744 Warn if a structure is given the packed attribute, but the packed
3745 attribute has no effect on the layout or size of the structure.
3746 Such structures may be mis-aligned for little benefit.  For
3747 instance, in this code, the variable @code{f.x} in @code{struct bar}
3748 will be misaligned even though @code{struct bar} does not itself
3749 have the packed attribute:
3750
3751 @smallexample
3752 @group
3753 struct foo @{
3754   int x;
3755   char a, b, c, d;
3756 @} __attribute__((packed));
3757 struct bar @{
3758   char z;
3759   struct foo f;
3760 @};
3761 @end group
3762 @end smallexample
3763
3764 @item -Wpadded
3765 @opindex Wpadded
3766 Warn if padding is included in a structure, either to align an element
3767 of the structure or to align the whole structure.  Sometimes when this
3768 happens it is possible to rearrange the fields of the structure to
3769 reduce the padding and so make the structure smaller.
3770
3771 @item -Wredundant-decls
3772 @opindex Wredundant-decls
3773 Warn if anything is declared more than once in the same scope, even in
3774 cases where multiple declaration is valid and changes nothing.
3775
3776 @item -Wnested-externs @r{(C only)}
3777 @opindex Wnested-externs
3778 Warn if an @code{extern} declaration is encountered within a function.
3779
3780 @item -Wunreachable-code
3781 @opindex Wunreachable-code
3782 Warn if the compiler detects that code will never be executed.
3783
3784 This option is intended to warn when the compiler detects that at
3785 least a whole line of source code will never be executed, because
3786 some condition is never satisfied or because it is after a
3787 procedure that never returns.
3788
3789 It is possible for this option to produce a warning even though there
3790 are circumstances under which part of the affected line can be executed,
3791 so care should be taken when removing apparently-unreachable code.
3792
3793 For instance, when a function is inlined, a warning may mean that the
3794 line is unreachable in only one inlined copy of the function.
3795
3796 This option is not made part of @option{-Wall} because in a debugging
3797 version of a program there is often substantial code which checks
3798 correct functioning of the program and is, hopefully, unreachable
3799 because the program does work.  Another common use of unreachable
3800 code is to provide behavior which is selectable at compile-time.
3801
3802 @item -Winline
3803 @opindex Winline
3804 Warn if a function can not be inlined and it was declared as inline.
3805 Even with this option, the compiler will not warn about failures to
3806 inline functions declared in system headers.
3807
3808 The compiler uses a variety of heuristics to determine whether or not
3809 to inline a function.  For example, the compiler takes into account
3810 the size of the function being inlined and the amount of inlining
3811 that has already been done in the current function.  Therefore,
3812 seemingly insignificant changes in the source program can cause the
3813 warnings produced by @option{-Winline} to appear or disappear.
3814
3815 @item -Wno-invalid-offsetof @r{(C++ only)}
3816 @opindex Wno-invalid-offsetof
3817 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
3818 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
3819 to a non-POD type is undefined.  In existing C++ implementations,
3820 however, @samp{offsetof} typically gives meaningful results even when
3821 applied to certain kinds of non-POD types. (Such as a simple
3822 @samp{struct} that fails to be a POD type only by virtue of having a
3823 constructor.)  This flag is for users who are aware that they are
3824 writing nonportable code and who have deliberately chosen to ignore the
3825 warning about it.
3826
3827 The restrictions on @samp{offsetof} may be relaxed in a future version
3828 of the C++ standard.
3829
3830 @item -Wno-int-to-pointer-cast @r{(C only)}
3831 @opindex Wno-int-to-pointer-cast
3832 Suppress warnings from casts to pointer type of an integer of a
3833 different size.
3834
3835 @item -Wno-pointer-to-int-cast @r{(C only)}
3836 @opindex Wno-pointer-to-int-cast
3837 Suppress warnings from casts from a pointer to an integer type of a
3838 different size.
3839
3840 @item -Winvalid-pch
3841 @opindex Winvalid-pch
3842 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
3843 the search path but can't be used.
3844
3845 @item -Wlong-long
3846 @opindex Wlong-long
3847 @opindex Wno-long-long
3848 Warn if @samp{long long} type is used.  This is default.  To inhibit
3849 the warning messages, use @option{-Wno-long-long}.  Flags
3850 @option{-Wlong-long} and @option{-Wno-long-long} are taken into account
3851 only when @option{-pedantic} flag is used.
3852
3853 @item -Wvariadic-macros
3854 @opindex Wvariadic-macros
3855 @opindex Wno-variadic-macros
3856 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
3857 alternate syntax when in pedantic ISO C99 mode.  This is default.
3858 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
3859
3860 @item -Wvla
3861 @opindex Wvla
3862 @opindex Wno-vla
3863 Warn if variable length array is used in the code.
3864 @option{-Wno-vla} will prevent the @option{-pedantic} warning of
3865 the variable length array.
3866
3867 @item -Wvolatile-register-var
3868 @opindex Wvolatile-register-var
3869 @opindex Wno-volatile-register-var
3870 Warn if a register variable is declared volatile.  The volatile
3871 modifier does not inhibit all optimizations that may eliminate reads
3872 and/or writes to register variables.
3873
3874 @item -Wdisabled-optimization
3875 @opindex Wdisabled-optimization
3876 Warn if a requested optimization pass is disabled.  This warning does
3877 not generally indicate that there is anything wrong with your code; it
3878 merely indicates that GCC's optimizers were unable to handle the code
3879 effectively.  Often, the problem is that your code is too big or too
3880 complex; GCC will refuse to optimize programs when the optimization
3881 itself is likely to take inordinate amounts of time.
3882
3883 @item -Wpointer-sign
3884 @opindex Wpointer-sign
3885 @opindex Wno-pointer-sign
3886 Warn for pointer argument passing or assignment with different signedness.
3887 This option is only supported for C and Objective-C@.  It is implied by
3888 @option{-Wall} and by @option{-pedantic}, which can be disabled with
3889 @option{-Wno-pointer-sign}.
3890
3891 @item -Werror
3892 @opindex Werror
3893 Make all warnings into errors.
3894
3895 @item -Werror=
3896 @opindex Werror=
3897 Make the specified warning into an errors.  The specifier for a
3898 warning is appended, for example @option{-Werror=switch} turns the
3899 warnings controlled by @option{-Wswitch} into errors.  This switch
3900 takes a negative form, to be used to negate @option{-Werror} for
3901 specific warnings, for example @option{-Wno-error=switch} makes
3902 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
3903 is in effect.  You can use the @option{-fdiagnostics-show-option}
3904 option to have each controllable warning amended with the option which
3905 controls it, to determine what to use with this option.
3906
3907 Note that specifying @option{-Werror=}@var{foo} automatically implies
3908 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
3909 imply anything.
3910
3911 @item -Wstack-protector
3912 @opindex Wstack-protector
3913 This option is only active when @option{-fstack-protector} is active.  It
3914 warns about functions that will not be protected against stack smashing.
3915
3916 @item -Woverlength-strings
3917 @opindex Woverlength-strings
3918 Warn about string constants which are longer than the ``minimum
3919 maximum'' length specified in the C standard.  Modern compilers
3920 generally allow string constants which are much longer than the
3921 standard's minimum limit, but very portable programs should avoid
3922 using longer strings.
3923
3924 The limit applies @emph{after} string constant concatenation, and does
3925 not count the trailing NUL@.  In C89, the limit was 509 characters; in
3926 C99, it was raised to 4095.  C++98 does not specify a normative
3927 minimum maximum, so we do not diagnose overlength strings in C++@.
3928
3929 This option is implied by @option{-pedantic}, and can be disabled with
3930 @option{-Wno-overlength-strings}.
3931 @end table
3932
3933 @node Debugging Options
3934 @section Options for Debugging Your Program or GCC
3935 @cindex options, debugging
3936 @cindex debugging information options
3937
3938 GCC has various special options that are used for debugging
3939 either your program or GCC:
3940
3941 @table @gcctabopt
3942 @item -g
3943 @opindex g
3944 Produce debugging information in the operating system's native format
3945 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
3946 information.
3947
3948 On most systems that use stabs format, @option{-g} enables use of extra
3949 debugging information that only GDB can use; this extra information
3950 makes debugging work better in GDB but will probably make other debuggers
3951 crash or
3952 refuse to read the program.  If you want to control for certain whether
3953 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
3954 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
3955
3956 GCC allows you to use @option{-g} with
3957 @option{-O}.  The shortcuts taken by optimized code may occasionally
3958 produce surprising results: some variables you declared may not exist
3959 at all; flow of control may briefly move where you did not expect it;
3960 some statements may not be executed because they compute constant
3961 results or their values were already at hand; some statements may
3962 execute in different places because they were moved out of loops.
3963
3964 Nevertheless it proves possible to debug optimized output.  This makes
3965 it reasonable to use the optimizer for programs that might have bugs.
3966
3967 The following options are useful when GCC is generated with the
3968 capability for more than one debugging format.
3969
3970 @item -ggdb
3971 @opindex ggdb
3972 Produce debugging information for use by GDB@.  This means to use the
3973 most expressive format available (DWARF 2, stabs, or the native format
3974 if neither of those are supported), including GDB extensions if at all
3975 possible.
3976
3977 @item -gstabs
3978 @opindex gstabs
3979 Produce debugging information in stabs format (if that is supported),
3980 without GDB extensions.  This is the format used by DBX on most BSD
3981 systems.  On MIPS, Alpha and System V Release 4 systems this option
3982 produces stabs debugging output which is not understood by DBX or SDB@.
3983 On System V Release 4 systems this option requires the GNU assembler.
3984
3985 @item -feliminate-unused-debug-symbols
3986 @opindex feliminate-unused-debug-symbols
3987 Produce debugging information in stabs format (if that is supported),
3988 for only symbols that are actually used.
3989
3990 @item -femit-class-debug-always
3991 Instead of emitting debugging information for a C++ class in only one
3992 object file, emit it in all object files using the class.  This option
3993 should be used only with debuggers that are unable to handle the way GCC
3994 normally emits debugging information for classes because using this
3995 option will increase the size of debugging information by as much as a
3996 factor of two.
3997
3998 @item -gstabs+
3999 @opindex gstabs+
4000 Produce debugging information in stabs format (if that is supported),
4001 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4002 use of these extensions is likely to make other debuggers crash or
4003 refuse to read the program.
4004
4005 @item -gcoff
4006 @opindex gcoff
4007 Produce debugging information in COFF format (if that is supported).
4008 This is the format used by SDB on most System V systems prior to
4009 System V Release 4.
4010
4011 @item -gxcoff
4012 @opindex gxcoff
4013 Produce debugging information in XCOFF format (if that is supported).
4014 This is the format used by the DBX debugger on IBM RS/6000 systems.
4015
4016 @item -gxcoff+
4017 @opindex gxcoff+
4018 Produce debugging information in XCOFF format (if that is supported),
4019 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4020 use of these extensions is likely to make other debuggers crash or
4021 refuse to read the program, and may cause assemblers other than the GNU
4022 assembler (GAS) to fail with an error.
4023
4024 @item -gdwarf-2
4025 @opindex gdwarf-2
4026 Produce debugging information in DWARF version 2 format (if that is
4027 supported).  This is the format used by DBX on IRIX 6.  With this
4028 option, GCC uses features of DWARF version 3 when they are useful;
4029 version 3 is upward compatible with version 2, but may still cause
4030 problems for older debuggers.
4031
4032 @item -gvms
4033 @opindex gvms
4034 Produce debugging information in VMS debug format (if that is
4035 supported).  This is the format used by DEBUG on VMS systems.
4036
4037 @item -g@var{level}
4038 @itemx -ggdb@var{level}
4039 @itemx -gstabs@var{level}
4040 @itemx -gcoff@var{level}
4041 @itemx -gxcoff@var{level}
4042 @itemx -gvms@var{level}
4043 Request debugging information and also use @var{level} to specify how
4044 much information.  The default level is 2.
4045
4046 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
4047 @option{-g}.
4048
4049 Level 1 produces minimal information, enough for making backtraces in
4050 parts of the program that you don't plan to debug.  This includes
4051 descriptions of functions and external variables, but no information
4052 about local variables and no line numbers.
4053
4054 Level 3 includes extra information, such as all the macro definitions
4055 present in the program.  Some debuggers support macro expansion when
4056 you use @option{-g3}.
4057
4058 @option{-gdwarf-2} does not accept a concatenated debug level, because
4059 GCC used to support an option @option{-gdwarf} that meant to generate
4060 debug information in version 1 of the DWARF format (which is very
4061 different from version 2), and it would have been too confusing.  That
4062 debug format is long obsolete, but the option cannot be changed now.
4063 Instead use an additional @option{-g@var{level}} option to change the
4064 debug level for DWARF2.
4065
4066 @item -feliminate-dwarf2-dups
4067 @opindex feliminate-dwarf2-dups
4068 Compress DWARF2 debugging information by eliminating duplicated
4069 information about each symbol.  This option only makes sense when
4070 generating DWARF2 debugging information with @option{-gdwarf-2}.
4071
4072 @item -femit-struct-debug-baseonly
4073 Emit debug information for struct-like types
4074 only when the base name of the compilation source file
4075 matches the base name of file in which the struct was defined.
4076
4077 This option substantially reduces the size of debugging information,
4078 but at significant potential loss in type information to the debugger.
4079 See @option{-femit-struct-debug-reduced} for a less aggressive option.
4080 See @option{-femit-struct-debug-detailed} for more detailed control.
4081
4082 This option works only with DWARF 2.
4083
4084 @item -femit-struct-debug-reduced
4085 Emit debug information for struct-like types
4086 only when the base name of the compilation source file
4087 matches the base name of file in which the type was defined,
4088 unless the struct is a template or defined in a system header.
4089
4090 This option significantly reduces the size of debugging information,
4091 with some potential loss in type information to the debugger.
4092 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
4093 See @option{-femit-struct-debug-detailed} for more detailed control.
4094
4095 This option works only with DWARF 2.
4096
4097 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
4098 Specify the struct-like types
4099 for which the compiler will generate debug information.
4100 The intent is to reduce duplicate struct debug information
4101 between different object files within the same program.
4102
4103 This option is a detailed version of
4104 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
4105 which will serve for most needs.
4106
4107 A specification has the syntax
4108 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
4109
4110 The optional first word limits the specification to
4111 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
4112 A struct type is used directly when it is the type of a variable, member.
4113 Indirect uses arise through pointers to structs.
4114 That is, when use of an incomplete struct would be legal, the use is indirect.
4115 An example is
4116 @samp{struct one direct; struct two * indirect;}.
4117
4118 The optional second word limits the specification to
4119 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
4120 Generic structs are a bit complicated to explain.
4121 For C++, these are non-explicit specializations of template classes,
4122 or non-template classes within the above.
4123 Other programming languages have generics,
4124 but @samp{-femit-struct-debug-detailed} does not yet implement them.
4125
4126 The third word specifies the source files for those
4127 structs for which the compiler will emit debug information.
4128 The values @samp{none} and @samp{any} have the normal meaning.
4129 The value @samp{base} means that
4130 the base of name of the file in which the type declaration appears
4131 must match the base of the name of the main compilation file.
4132 In practice, this means that
4133 types declared in @file{foo.c} and @file{foo.h} will have debug information,
4134 but types declared in other header will not.
4135 The value @samp{sys} means those types satisfying @samp{base}
4136 or declared in system or compiler headers.
4137
4138 You may need to experiment to determine the best settings for your application.
4139
4140 The default is @samp{-femit-struct-debug-detailed=all}.
4141
4142 This option works only with DWARF 2.
4143
4144 @cindex @command{prof}
4145 @item -p
4146 @opindex p
4147 Generate extra code to write profile information suitable for the
4148 analysis program @command{prof}.  You must use this option when compiling
4149 the source files you want data about, and you must also use it when
4150 linking.
4151
4152 @cindex @command{gprof}
4153 @item -pg
4154 @opindex pg
4155 Generate extra code to write profile information suitable for the
4156 analysis program @command{gprof}.  You must use this option when compiling
4157 the source files you want data about, and you must also use it when
4158 linking.
4159
4160 @item -Q
4161 @opindex Q
4162 Makes the compiler print out each function name as it is compiled, and
4163 print some statistics about each pass when it finishes.
4164
4165 @item -ftime-report
4166 @opindex ftime-report
4167 Makes the compiler print some statistics about the time consumed by each
4168 pass when it finishes.
4169
4170 @item -fmem-report
4171 @opindex fmem-report
4172 Makes the compiler print some statistics about permanent memory
4173 allocation when it finishes.
4174
4175 @item -fpre-ipa-mem-report
4176 @opindex fpre-ipa-mem-report
4177 @item -fpost-ipa-mem-report
4178 @opindex fpost-ipa-mem-report
4179 Makes the compiler print some statistics about permanent memory
4180 allocation before or after interprocedural optimization.
4181
4182 @item -fprofile-arcs
4183 @opindex fprofile-arcs
4184 Add code so that program flow @dfn{arcs} are instrumented.  During
4185 execution the program records how many times each branch and call is
4186 executed and how many times it is taken or returns.  When the compiled
4187 program exits it saves this data to a file called
4188 @file{@var{auxname}.gcda} for each source file.  The data may be used for
4189 profile-directed optimizations (@option{-fbranch-probabilities}), or for
4190 test coverage analysis (@option{-ftest-coverage}).  Each object file's
4191 @var{auxname} is generated from the name of the output file, if
4192 explicitly specified and it is not the final executable, otherwise it is
4193 the basename of the source file.  In both cases any suffix is removed
4194 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
4195 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
4196 @xref{Cross-profiling}.
4197
4198 @cindex @command{gcov}
4199 @item --coverage
4200 @opindex coverage
4201
4202 This option is used to compile and link code instrumented for coverage
4203 analysis.  The option is a synonym for @option{-fprofile-arcs}
4204 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
4205 linking).  See the documentation for those options for more details.
4206
4207 @itemize
4208
4209 @item
4210 Compile the source files with @option{-fprofile-arcs} plus optimization
4211 and code generation options.  For test coverage analysis, use the
4212 additional @option{-ftest-coverage} option.  You do not need to profile
4213 every source file in a program.
4214
4215 @item
4216 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
4217 (the latter implies the former).
4218
4219 @item
4220 Run the program on a representative workload to generate the arc profile
4221 information.  This may be repeated any number of times.  You can run
4222 concurrent instances of your program, and provided that the file system
4223 supports locking, the data files will be correctly updated.  Also
4224 @code{fork} calls are detected and correctly handled (double counting
4225 will not happen).
4226
4227 @item
4228 For profile-directed optimizations, compile the source files again with
4229 the same optimization and code generation options plus
4230 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
4231 Control Optimization}).
4232
4233 @item
4234 For test coverage analysis, use @command{gcov} to produce human readable
4235 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
4236 @command{gcov} documentation for further information.
4237
4238 @end itemize
4239
4240 With @option{-fprofile-arcs}, for each function of your program GCC
4241 creates a program flow graph, then finds a spanning tree for the graph.
4242 Only arcs that are not on the spanning tree have to be instrumented: the
4243 compiler adds code to count the number of times that these arcs are
4244 executed.  When an arc is the only exit or only entrance to a block, the
4245 instrumentation code can be added to the block; otherwise, a new basic
4246 block must be created to hold the instrumentation code.
4247
4248 @need 2000
4249 @item -ftest-coverage
4250 @opindex ftest-coverage
4251 Produce a notes file that the @command{gcov} code-coverage utility
4252 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
4253 show program coverage.  Each source file's note file is called
4254 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
4255 above for a description of @var{auxname} and instructions on how to
4256 generate test coverage data.  Coverage data will match the source files
4257 more closely, if you do not optimize.
4258
4259 @item -fdbg-cnt-list
4260 @opindex fdbg-cnt-list
4261 Print the name and the counter upperbound for all debug counters.
4262
4263 @item -fdbg-cnt=@var{counter-value-list}
4264 @opindex fdbg-cnt
4265 Set the internal debug counter upperbound. @var{counter-value-list} 
4266 is a comma-separated list of @var{name}:@var{value} pairs
4267 which sets the upperbound of each debug counter @var{name} to @var{value}.
4268 All debug counters have the initial upperbound of @var{UINT_MAX},
4269 thus dbg_cnt() returns true always unless the upperbound is set by this option.
4270 e.g. With -fdbg-cnt=dce:10,tail_call:0
4271 dbg_cnt(dce) will return true only for first 10 invocations
4272 and dbg_cnt(tail_call) will return false always.
4273
4274 @item -d@var{letters}
4275 @item -fdump-rtl-@var{pass}
4276 @opindex d
4277 Says to make debugging dumps during compilation at times specified by
4278 @var{letters}.    This is used for debugging the RTL-based passes of the
4279 compiler.  The file names for most of the dumps are made by appending a
4280 pass number and a word to the @var{dumpname}.  @var{dumpname} is generated
4281 from the name of the output file, if explicitly specified and it is not
4282 an executable, otherwise it is the basename of the source file. These
4283 switches may have different effects when @option{-E} is used for
4284 preprocessing.
4285
4286 Most debug dumps can be enabled either passing a letter to the @option{-d}
4287 option, or with a long @option{-fdump-rtl} switch; here are the possible
4288 letters for use in @var{letters} and @var{pass}, and their meanings:
4289
4290 @table @gcctabopt
4291 @item -dA
4292 @opindex dA
4293 Annotate the assembler output with miscellaneous debugging information.
4294
4295 @item -dB
4296 @itemx -fdump-rtl-bbro
4297 @opindex dB
4298 @opindex fdump-rtl-bbro
4299 Dump after block reordering, to @file{@var{file}.148r.bbro}.
4300
4301 @item -dc
4302 @itemx -fdump-rtl-combine
4303 @opindex dc
4304 @opindex fdump-rtl-combine
4305 Dump after the RTL instruction combination pass, to the file
4306 @file{@var{file}.129r.combine}.
4307
4308 @item -dC
4309 @itemx -fdump-rtl-ce1
4310 @itemx -fdump-rtl-ce2
4311 @opindex dC
4312 @opindex fdump-rtl-ce1
4313 @opindex fdump-rtl-ce2
4314 @option{-dC} and @option{-fdump-rtl-ce1} enable dumping after the
4315 first if conversion, to the file @file{@var{file}.117r.ce1}.  @option{-dC}
4316 and @option{-fdump-rtl-ce2} enable dumping after the second if
4317 conversion, to the file @file{@var{file}.130r.ce2}.
4318
4319 @item -dd
4320 @itemx -fdump-rtl-btl
4321 @itemx -fdump-rtl-dbr
4322 @opindex dd
4323 @opindex fdump-rtl-btl
4324 @opindex fdump-rtl-dbr
4325 @option{-dd} and @option{-fdump-rtl-btl} enable dumping after branch
4326 target load optimization, to @file{@var{file}.31.btl}.  @option{-dd}
4327 and @option{-fdump-rtl-dbr} enable dumping after delayed branch
4328 scheduling, to @file{@var{file}.36.dbr}.
4329
4330 @item -dD
4331 @opindex dD
4332 Dump all macro definitions, at the end of preprocessing, in addition to
4333 normal output.
4334
4335 @item -dE
4336 @itemx -fdump-rtl-ce3
4337 @opindex dE
4338 @opindex fdump-rtl-ce3
4339 Dump after the third if conversion, to @file{@var{file}.146r.ce3}.
4340
4341 @item -df
4342 @itemx -fdump-rtl-cfg
4343 @itemx -fdump-rtl-life
4344 @opindex df
4345 @opindex fdump-rtl-cfg
4346 @opindex fdump-rtl-life
4347 @option{-df} and @option{-fdump-rtl-cfg} enable dumping after control
4348 and data flow analysis, to @file{@var{file}.116r.cfg}.  @option{-df}
4349 and @option{-fdump-rtl-cfg} enable dumping dump after life analysis,
4350 to @file{@var{file}.128r.life1} and @file{@var{file}.135r.life2}.
4351
4352 @item -dg
4353 @itemx -fdump-rtl-greg
4354 @opindex dg
4355 @opindex fdump-rtl-greg
4356 Dump after global register allocation, to @file{@var{file}.139r.greg}.
4357
4358 @item -dG
4359 @itemx -fdump-rtl-gcse
4360 @itemx -fdump-rtl-bypass
4361 @opindex dG
4362 @opindex fdump-rtl-gcse
4363 @opindex fdump-rtl-bypass
4364 @option{-dG} and @option{-fdump-rtl-gcse} enable dumping after GCSE, to
4365 @file{@var{file}.114r.gcse}.  @option{-dG} and @option{-fdump-rtl-bypass}
4366 enable dumping after jump bypassing and control flow optimizations, to
4367 @file{@var{file}.115r.bypass}.
4368
4369 @item -dh
4370 @itemx -fdump-rtl-eh
4371 @opindex dh
4372 @opindex fdump-rtl-eh
4373 Dump after finalization of EH handling code, to @file{@var{file}.02.eh}.
4374
4375 @item -di
4376 @itemx -fdump-rtl-sibling
4377 @opindex di
4378 @opindex fdump-rtl-sibling
4379 Dump after sibling call optimizations, to @file{@var{file}.106r.sibling}.
4380
4381 @item -dj
4382 @itemx -fdump-rtl-jump
4383 @opindex dj
4384 @opindex fdump-rtl-jump
4385 Dump after the first jump optimization, to @file{@var{file}.112r.jump}.
4386
4387 @item -dk
4388 @itemx -fdump-rtl-stack
4389 @opindex dk
4390 @opindex fdump-rtl-stack
4391 Dump after conversion from GCC's "flat register file" registers to the
4392 x87's stack-like registers, to @file{@var{file}.152r.stack}.
4393
4394 @item -dl
4395 @itemx -fdump-rtl-lreg
4396 @opindex dl
4397 @opindex fdump-rtl-lreg
4398 Dump after local register allocation, to @file{@var{file}.138r.lreg}.
4399
4400 @item -dL
4401 @itemx -fdump-rtl-loop2
4402 @opindex dL
4403 @opindex fdump-rtl-loop2
4404 @option{-dL} and @option{-fdump-rtl-loop2} enable dumping after the
4405 loop optimization pass, to @file{@var{file}.119r.loop2},
4406 @file{@var{file}.120r.loop2_init},
4407 @file{@var{file}.121r.loop2_invariant}, and
4408 @file{@var{file}.125r.loop2_done}.
4409
4410 @item -dm
4411 @itemx -fdump-rtl-sms
4412 @opindex dm
4413 @opindex fdump-rtl-sms
4414 Dump after modulo scheduling, to @file{@var{file}.136r.sms}.
4415
4416 @item -dM
4417 @itemx -fdump-rtl-mach
4418 @opindex dM
4419 @opindex fdump-rtl-mach
4420 Dump after performing the machine dependent reorganization pass, to
4421 @file{@var{file}.155r.mach} if that pass exists.
4422
4423 @item -dn
4424 @itemx -fdump-rtl-rnreg
4425 @opindex dn
4426 @opindex fdump-rtl-rnreg
4427 Dump after register renumbering, to @file{@var{file}.147r.rnreg}.
4428
4429 @item -dN
4430 @itemx -fdump-rtl-regmove
4431 @opindex dN
4432 @opindex fdump-rtl-regmove
4433 Dump after the register move pass, to @file{@var{file}.132r.regmove}.
4434
4435 @item -do
4436 @itemx -fdump-rtl-postreload
4437 @opindex do
4438 @opindex fdump-rtl-postreload
4439 Dump after post-reload optimizations, to @file{@var{file}.24.postreload}.
4440
4441 @item -dr
4442 @itemx -fdump-rtl-expand
4443 @opindex dr
4444 @opindex fdump-rtl-expand
4445 Dump after RTL generation, to @file{@var{file}.104r.expand}.
4446
4447 @item -dR
4448 @itemx -fdump-rtl-sched2
4449 @opindex dR
4450 @opindex fdump-rtl-sched2
4451 Dump after the second scheduling pass, to @file{@var{file}.149r.sched2}.
4452
4453 @item -ds
4454 @itemx -fdump-rtl-cse
4455 @opindex ds
4456 @opindex fdump-rtl-cse
4457 Dump after CSE (including the jump optimization that sometimes follows
4458 CSE), to @file{@var{file}.113r.cse}.
4459
4460 @item -dS
4461 @itemx -fdump-rtl-sched1
4462 @opindex dS
4463 @opindex fdump-rtl-sched1
4464 Dump after the first scheduling pass, to @file{@var{file}.136r.sched1}.
4465
4466 @item -dt
4467 @itemx -fdump-rtl-cse2
4468 @opindex dt
4469 @opindex fdump-rtl-cse2
4470 Dump after the second CSE pass (including the jump optimization that
4471 sometimes follows CSE), to @file{@var{file}.127r.cse2}.
4472
4473 @item -dT
4474 @itemx -fdump-rtl-tracer
4475 @opindex dT
4476 @opindex fdump-rtl-tracer
4477 Dump after running tracer, to @file{@var{file}.118r.tracer}.
4478
4479 @item -dV
4480 @itemx -fdump-rtl-vpt
4481 @itemx -fdump-rtl-vartrack
4482 @opindex dV
4483 @opindex fdump-rtl-vpt
4484 @opindex fdump-rtl-vartrack
4485 @option{-dV} and @option{-fdump-rtl-vpt} enable dumping after the value
4486 profile transformations, to @file{@var{file}.10.vpt}.  @option{-dV}
4487 and @option{-fdump-rtl-vartrack} enable dumping after variable tracking,
4488 to @file{@var{file}.154r.vartrack}.
4489
4490 @item -dw
4491 @itemx -fdump-rtl-flow2
4492 @opindex dw
4493 @opindex fdump-rtl-flow2
4494 Dump after the second flow pass, to @file{@var{file}.142r.flow2}.
4495
4496 @item -dz
4497 @itemx -fdump-rtl-peephole2
4498 @opindex dz
4499 @opindex fdump-rtl-peephole2
4500 Dump after the peephole pass, to @file{@var{file}.145r.peephole2}.
4501
4502 @item -dZ
4503 @itemx -fdump-rtl-web
4504 @opindex dZ
4505 @opindex fdump-rtl-web
4506 Dump after live range splitting, to @file{@var{file}.126r.web}.
4507
4508 @item -da
4509 @itemx -fdump-rtl-all
4510 @opindex da
4511 @opindex fdump-rtl-all
4512 Produce all the dumps listed above.
4513
4514 @item -dH
4515 @opindex dH
4516 Produce a core dump whenever an error occurs.
4517
4518 @item -dm
4519 @opindex dm
4520 Print statistics on memory usage, at the end of the run, to
4521 standard error.
4522
4523 @item -dp
4524 @opindex dp
4525 Annotate the assembler output with a comment indicating which
4526 pattern and alternative was used.  The length of each instruction is
4527 also printed.
4528
4529 @item -dP
4530 @opindex dP
4531 Dump the RTL in the assembler output as a comment before each instruction.
4532 Also turns on @option{-dp} annotation.
4533
4534 @item -dv
4535 @opindex dv
4536 For each of the other indicated dump files (either with @option{-d} or
4537 @option{-fdump-rtl-@var{pass}}), dump a representation of the control flow
4538 graph suitable for viewing with VCG to @file{@var{file}.@var{pass}.vcg}.
4539
4540 @item -dx
4541 @opindex dx
4542 Just generate RTL for a function instead of compiling it.  Usually used
4543 with @samp{r} (@option{-fdump-rtl-expand}).
4544
4545 @item -dy
4546 @opindex dy
4547 Dump debugging information during parsing, to standard error.
4548 @end table
4549
4550 @item -fdump-noaddr
4551 @opindex fdump-noaddr
4552 When doing debugging dumps (see @option{-d} option above), suppress
4553 address output.  This makes it more feasible to use diff on debugging
4554 dumps for compiler invocations with different compiler binaries and/or
4555 different text / bss / data / heap / stack / dso start locations.
4556
4557 @item -fdump-unnumbered
4558 @opindex fdump-unnumbered
4559 When doing debugging dumps (see @option{-d} option above), suppress instruction
4560 numbers and address output.  This makes it more feasible to
4561 use diff on debugging dumps for compiler invocations with different
4562 options, in particular with and without @option{-g}.
4563
4564 @item -fdump-translation-unit @r{(C++ only)}
4565 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
4566 @opindex fdump-translation-unit
4567 Dump a representation of the tree structure for the entire translation
4568 unit to a file.  The file name is made by appending @file{.tu} to the
4569 source file name.  If the @samp{-@var{options}} form is used, @var{options}
4570 controls the details of the dump as described for the
4571 @option{-fdump-tree} options.
4572
4573 @item -fdump-class-hierarchy @r{(C++ only)}
4574 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
4575 @opindex fdump-class-hierarchy
4576 Dump a representation of each class's hierarchy and virtual function
4577 table layout to a file.  The file name is made by appending @file{.class}
4578 to the source file name.  If the @samp{-@var{options}} form is used,
4579 @var{options} controls the details of the dump as described for the
4580 @option{-fdump-tree} options.
4581
4582 @item -fdump-ipa-@var{switch}
4583 @opindex fdump-ipa
4584 Control the dumping at various stages of inter-procedural analysis
4585 language tree to a file.  The file name is generated by appending a switch
4586 specific suffix to the source file name.  The following dumps are possible:
4587
4588 @table @samp
4589 @item all
4590 Enables all inter-procedural analysis dumps; currently the only produced
4591 dump is the @samp{cgraph} dump.
4592
4593 @item cgraph
4594 Dumps information about call-graph optimization, unused function removal,
4595 and inlining decisions.
4596 @end table
4597
4598 @item -fdump-tree-@var{switch}
4599 @itemx -fdump-tree-@var{switch}-@var{options}
4600 @opindex fdump-tree
4601 Control the dumping at various stages of processing the intermediate
4602 language tree to a file.  The file name is generated by appending a switch
4603 specific suffix to the source file name.  If the @samp{-@var{options}}
4604 form is used, @var{options} is a list of @samp{-} separated options that
4605 control the details of the dump.  Not all options are applicable to all
4606 dumps, those which are not meaningful will be ignored.  The following
4607 options are available
4608
4609 @table @samp
4610 @item address
4611 Print the address of each node.  Usually this is not meaningful as it
4612 changes according to the environment and source file.  Its primary use
4613 is for tying up a dump file with a debug environment.
4614 @item slim
4615 Inhibit dumping of members of a scope or body of a function merely
4616 because that scope has been reached.  Only dump such items when they
4617 are directly reachable by some other path.  When dumping pretty-printed
4618 trees, this option inhibits dumping the bodies of control structures.
4619 @item raw
4620 Print a raw representation of the tree.  By default, trees are
4621 pretty-printed into a C-like representation.
4622 @item details
4623 Enable more detailed dumps (not honored by every dump option).
4624 @item stats
4625 Enable dumping various statistics about the pass (not honored by every dump
4626 option).
4627 @item blocks
4628 Enable showing basic block boundaries (disabled in raw dumps).
4629 @item vops
4630 Enable showing virtual operands for every statement.
4631 @item lineno
4632 Enable showing line numbers for statements.
4633 @item uid
4634 Enable showing the unique ID (@code{DECL_UID}) for each variable.
4635 @item all
4636 Turn on all options, except @option{raw}, @option{slim} and @option{lineno}.
4637 @end table
4638
4639 The following tree dumps are possible:
4640 @table @samp
4641
4642 @item original
4643 Dump before any tree based optimization, to @file{@var{file}.original}.
4644
4645 @item optimized
4646 Dump after all tree based optimization, to @file{@var{file}.optimized}.
4647
4648 @item inlined
4649 Dump after function inlining, to @file{@var{file}.inlined}.
4650
4651 @item gimple
4652 @opindex fdump-tree-gimple
4653 Dump each function before and after the gimplification pass to a file.  The
4654 file name is made by appending @file{.gimple} to the source file name.
4655
4656 @item cfg
4657 @opindex fdump-tree-cfg
4658 Dump the control flow graph of each function to a file.  The file name is
4659 made by appending @file{.cfg} to the source file name.
4660
4661 @item vcg
4662 @opindex fdump-tree-vcg
4663 Dump the control flow graph of each function to a file in VCG format.  The
4664 file name is made by appending @file{.vcg} to the source file name.  Note
4665 that if the file contains more than one function, the generated file cannot
4666 be used directly by VCG@.  You will need to cut and paste each function's
4667 graph into its own separate file first.
4668
4669 @item ch
4670 @opindex fdump-tree-ch
4671 Dump each function after copying loop headers.  The file name is made by
4672 appending @file{.ch} to the source file name.
4673
4674 @item ssa
4675 @opindex fdump-tree-ssa
4676 Dump SSA related information to a file.  The file name is made by appending
4677 @file{.ssa} to the source file name.
4678
4679 @item salias
4680 @opindex fdump-tree-salias
4681 Dump structure aliasing variable information to a file.  This file name
4682 is made by appending @file{.salias} to the source file name.
4683
4684 @item alias
4685 @opindex fdump-tree-alias
4686 Dump aliasing information for each function.  The file name is made by
4687 appending @file{.alias} to the source file name.
4688
4689 @item ccp
4690 @opindex fdump-tree-ccp
4691 Dump each function after CCP@.  The file name is made by appending
4692 @file{.ccp} to the source file name.
4693
4694 @item storeccp
4695 @opindex fdump-tree-storeccp
4696 Dump each function after STORE-CCP.  The file name is made by appending
4697 @file{.storeccp} to the source file name.
4698
4699 @item pre
4700 @opindex fdump-tree-pre
4701 Dump trees after partial redundancy elimination.  The file name is made
4702 by appending @file{.pre} to the source file name.
4703
4704 @item fre
4705 @opindex fdump-tree-fre
4706 Dump trees after full redundancy elimination.  The file name is made
4707 by appending @file{.fre} to the source file name.
4708
4709 @item copyprop
4710 @opindex fdump-tree-copyprop
4711 Dump trees after copy propagation.  The file name is made
4712 by appending @file{.copyprop} to the source file name.
4713
4714 @item store_copyprop
4715 @opindex fdump-tree-store_copyprop
4716 Dump trees after store copy-propagation.  The file name is made
4717 by appending @file{.store_copyprop} to the source file name.
4718
4719 @item dce
4720 @opindex fdump-tree-dce
4721 Dump each function after dead code elimination.  The file name is made by
4722 appending @file{.dce} to the source file name.
4723
4724 @item mudflap
4725 @opindex fdump-tree-mudflap
4726 Dump each function after adding mudflap instrumentation.  The file name is
4727 made by appending @file{.mudflap} to the source file name.
4728
4729 @item sra
4730 @opindex fdump-tree-sra
4731 Dump each function after performing scalar replacement of aggregates.  The
4732 file name is made by appending @file{.sra} to the source file name.
4733
4734 @item sink
4735 @opindex fdump-tree-sink
4736 Dump each function after performing code sinking.  The file name is made
4737 by appending @file{.sink} to the source file name.
4738
4739 @item dom
4740 @opindex fdump-tree-dom
4741 Dump each function after applying dominator tree optimizations.  The file
4742 name is made by appending @file{.dom} to the source file name.
4743
4744 @item dse
4745 @opindex fdump-tree-dse
4746 Dump each function after applying dead store elimination.  The file
4747 name is made by appending @file{.dse} to the source file name.
4748
4749 @item phiopt
4750 @opindex fdump-tree-phiopt
4751 Dump each function after optimizing PHI nodes into straightline code.  The file
4752 name is made by appending @file{.phiopt} to the source file name.
4753
4754 @item forwprop
4755 @opindex fdump-tree-forwprop
4756 Dump each function after forward propagating single use variables.  The file
4757 name is made by appending @file{.forwprop} to the source file name.
4758
4759 @item copyrename
4760 @opindex fdump-tree-copyrename
4761 Dump each function after applying the copy rename optimization.  The file
4762 name is made by appending @file{.copyrename} to the source file name.
4763
4764 @item nrv
4765 @opindex fdump-tree-nrv
4766 Dump each function after applying the named return value optimization on
4767 generic trees.  The file name is made by appending @file{.nrv} to the source
4768 file name.
4769
4770 @item vect
4771 @opindex fdump-tree-vect
4772 Dump each function after applying vectorization of loops.  The file name is
4773 made by appending @file{.vect} to the source file name.
4774
4775 @item vrp
4776 @opindex fdump-tree-vrp
4777 Dump each function after Value Range Propagation (VRP).  The file name
4778 is made by appending @file{.vrp} to the source file name.
4779
4780 @item all
4781 @opindex fdump-tree-all
4782 Enable all the available tree dumps with the flags provided in this option.
4783 @end table
4784
4785 @item -ftree-vectorizer-verbose=@var{n}
4786 @opindex ftree-vectorizer-verbose
4787 This option controls the amount of debugging output the vectorizer prints.
4788 This information is written to standard error, unless
4789 @option{-fdump-tree-all} or @option{-fdump-tree-vect} is specified,
4790 in which case it is output to the usual dump listing file, @file{.vect}.
4791 For @var{n}=0 no diagnostic information is reported.
4792 If @var{n}=1 the vectorizer reports each loop that got vectorized,
4793 and the total number of loops that got vectorized.
4794 If @var{n}=2 the vectorizer also reports non-vectorized loops that passed
4795 the first analysis phase (vect_analyze_loop_form) - i.e. countable,
4796 inner-most, single-bb, single-entry/exit loops.  This is the same verbosity
4797 level that @option{-fdump-tree-vect-stats} uses.
4798 Higher verbosity levels mean either more information dumped for each
4799 reported loop, or same amount of information reported for more loops:
4800 If @var{n}=3, alignment related information is added to the reports.
4801 If @var{n}=4, data-references related information (e.g. memory dependences,
4802 memory access-patterns) is added to the reports.
4803 If @var{n}=5, the vectorizer reports also non-vectorized inner-most loops
4804 that did not pass the first analysis phase (i.e. may not be countable, or
4805 may have complicated control-flow).
4806 If @var{n}=6, the vectorizer reports also non-vectorized nested loops.
4807 For @var{n}=7, all the information the vectorizer generates during its
4808 analysis and transformation is reported.  This is the same verbosity level
4809 that @option{-fdump-tree-vect-details} uses.
4810
4811 @item -frandom-seed=@var{string}
4812 @opindex frandom-string
4813 This option provides a seed that GCC uses when it would otherwise use
4814 random numbers.  It is used to generate certain symbol names
4815 that have to be different in every compiled file.  It is also used to
4816 place unique stamps in coverage data files and the object files that
4817 produce them.  You can use the @option{-frandom-seed} option to produce
4818 reproducibly identical object files.
4819
4820 The @var{string} should be different for every file you compile.
4821
4822 @item -fsched-verbose=@var{n}
4823 @opindex fsched-verbose
4824 On targets that use instruction scheduling, this option controls the
4825 amount of debugging output the scheduler prints.  This information is
4826 written to standard error, unless @option{-dS} or @option{-dR} is
4827 specified, in which case it is output to the usual dump
4828 listing file, @file{.sched} or @file{.sched2} respectively.  However
4829 for @var{n} greater than nine, the output is always printed to standard
4830 error.
4831
4832 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
4833 same information as @option{-dRS}.  For @var{n} greater than one, it
4834 also output basic block probabilities, detailed ready list information
4835 and unit/insn info.  For @var{n} greater than two, it includes RTL
4836 at abort point, control-flow and regions info.  And for @var{n} over
4837 four, @option{-fsched-verbose} also includes dependence info.
4838
4839 @item -save-temps
4840 @opindex save-temps
4841 Store the usual ``temporary'' intermediate files permanently; place them
4842 in the current directory and name them based on the source file.  Thus,
4843 compiling @file{foo.c} with @samp{-c -save-temps} would produce files
4844 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
4845 preprocessed @file{foo.i} output file even though the compiler now
4846 normally uses an integrated preprocessor.
4847
4848 When used in combination with the @option{-x} command line option,
4849 @option{-save-temps} is sensible enough to avoid over writing an
4850 input source file with the same extension as an intermediate file.
4851 The corresponding intermediate file may be obtained by renaming the
4852 source file before using @option{-save-temps}.
4853
4854 @item -time
4855 @opindex time
4856 Report the CPU time taken by each subprocess in the compilation
4857 sequence.  For C source files, this is the compiler proper and assembler
4858 (plus the linker if linking is done).  The output looks like this:
4859
4860 @smallexample
4861 # cc1 0.12 0.01
4862 # as 0.00 0.01
4863 @end smallexample
4864
4865 The first number on each line is the ``user time'', that is time spent
4866 executing the program itself.  The second number is ``system time'',
4867 time spent executing operating system routines on behalf of the program.
4868 Both numbers are in seconds.
4869
4870 @item -fvar-tracking
4871 @opindex fvar-tracking
4872 Run variable tracking pass.  It computes where variables are stored at each
4873 position in code.  Better debugging information is then generated
4874 (if the debugging information format supports this information).
4875
4876 It is enabled by default when compiling with optimization (@option{-Os},
4877 @option{-O}, @option{-O2}, ...), debugging information (@option{-g}) and
4878 the debug info format supports it.
4879
4880 @item -print-file-name=@var{library}
4881 @opindex print-file-name
4882 Print the full absolute name of the library file @var{library} that
4883 would be used when linking---and don't do anything else.  With this
4884 option, GCC does not compile or link anything; it just prints the
4885 file name.
4886
4887 @item -print-multi-directory
4888 @opindex print-multi-directory
4889 Print the directory name corresponding to the multilib selected by any
4890 other switches present in the command line.  This directory is supposed
4891 to exist in @env{GCC_EXEC_PREFIX}.
4892
4893 @item -print-multi-lib
4894 @opindex print-multi-lib
4895 Print the mapping from multilib directory names to compiler switches
4896 that enable them.  The directory name is separated from the switches by
4897 @samp{;}, and each switch starts with an @samp{@@} instead of the
4898 @samp{-}, without spaces between multiple switches.  This is supposed to
4899 ease shell-processing.
4900
4901 @item -print-prog-name=@var{program}
4902 @opindex print-prog-name
4903 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
4904
4905 @item -print-libgcc-file-name
4906 @opindex print-libgcc-file-name
4907 Same as @option{-print-file-name=libgcc.a}.
4908
4909 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
4910 but you do want to link with @file{libgcc.a}.  You can do
4911
4912 @smallexample
4913 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
4914 @end smallexample
4915
4916 @item -print-search-dirs
4917 @opindex print-search-dirs
4918 Print the name of the configured installation directory and a list of
4919 program and library directories @command{gcc} will search---and don't do anything else.
4920
4921 This is useful when @command{gcc} prints the error message
4922 @samp{installation problem, cannot exec cpp0: No such file or directory}.
4923 To resolve this you either need to put @file{cpp0} and the other compiler
4924 components where @command{gcc} expects to find them, or you can set the environment
4925 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
4926 Don't forget the trailing @samp{/}.
4927 @xref{Environment Variables}.
4928
4929 @item -print-sysroot-headers-suffix
4930 @opindex print-sysroot-headers-suffix
4931 Print the suffix added to the target sysroot when searching for
4932 headers, or give an error if the compiler is not configured with such
4933 a suffix---and don't do anything else.
4934
4935 @item -dumpmachine
4936 @opindex dumpmachine
4937 Print the compiler's target machine (for example,
4938 @samp{i686-pc-linux-gnu})---and don't do anything else.
4939
4940 @item -dumpversion
4941 @opindex dumpversion
4942 Print the compiler version (for example, @samp{3.0})---and don't do
4943 anything else.
4944
4945 @item -dumpspecs
4946 @opindex dumpspecs
4947 Print the compiler's built-in specs---and don't do anything else.  (This
4948 is used when GCC itself is being built.)  @xref{Spec Files}.
4949
4950 @item -feliminate-unused-debug-types
4951 @opindex feliminate-unused-debug-types
4952 Normally, when producing DWARF2 output, GCC will emit debugging
4953 information for all types declared in a compilation
4954 unit, regardless of whether or not they are actually used
4955 in that compilation unit.  Sometimes this is useful, such as
4956 if, in the debugger, you want to cast a value to a type that is
4957 not actually used in your program (but is declared).  More often,
4958 however, this results in a significant amount of wasted space.
4959 With this option, GCC will avoid producing debug symbol output
4960 for types that are nowhere used in the source file being compiled.
4961 @end table
4962
4963 @node Optimize Options
4964 @section Options That Control Optimization
4965 @cindex optimize options
4966 @cindex options, optimization
4967
4968 These options control various sorts of optimizations.
4969
4970 Without any optimization option, the compiler's goal is to reduce the
4971 cost of compilation and to make debugging produce the expected
4972 results.  Statements are independent: if you stop the program with a
4973 breakpoint between statements, you can then assign a new value to any
4974 variable or change the program counter to any other statement in the
4975 function and get exactly the results you would expect from the source
4976 code.
4977
4978 Turning on optimization flags makes the compiler attempt to improve
4979 the performance and/or code size at the expense of compilation time
4980 and possibly the ability to debug the program.
4981
4982 The compiler performs optimization based on the knowledge it has of
4983 the program.  Optimization levels @option{-O} and above, in
4984 particular, enable @emph{unit-at-a-time} mode, which allows the
4985 compiler to consider information gained from later functions in
4986 the file when compiling a function.  Compiling multiple files at
4987 once to a single output file in @emph{unit-at-a-time} mode allows
4988 the compiler to use information gained from all of the files when
4989 compiling each of them.
4990
4991 Not all optimizations are controlled directly by a flag.  Only
4992 optimizations that have a flag are listed.
4993
4994 @table @gcctabopt
4995 @item -O
4996 @itemx -O1
4997 @opindex O
4998 @opindex O1
4999 Optimize.  Optimizing compilation takes somewhat more time, and a lot
5000 more memory for a large function.
5001
5002 With @option{-O}, the compiler tries to reduce code size and execution
5003 time, without performing any optimizations that take a great deal of
5004 compilation time.
5005
5006 @option{-O} turns on the following optimization flags:
5007 @gccoptlist{-fdefer-pop @gol
5008 -fdelayed-branch @gol
5009 -fguess-branch-probability @gol
5010 -fcprop-registers @gol
5011 -fif-conversion @gol
5012 -fif-conversion2 @gol
5013 -fsplit-wide-types @gol
5014 -ftree-ccp @gol
5015 -ftree-dce @gol
5016 -ftree-dominator-opts @gol
5017 -ftree-dse @gol
5018 -ftree-ter @gol
5019 -ftree-sra @gol
5020 -ftree-copyrename @gol
5021 -ftree-fre @gol
5022 -ftree-ch @gol
5023 -funit-at-a-time @gol
5024 -fmerge-constants}
5025
5026 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
5027 where doing so does not interfere with debugging.
5028
5029 @item -O2
5030 @opindex O2
5031 Optimize even more.  GCC performs nearly all supported optimizations
5032 that do not involve a space-speed tradeoff.  The compiler does not
5033 perform loop unrolling or function inlining when you specify @option{-O2}.
5034 As compared to @option{-O}, this option increases both compilation time
5035 and the performance of the generated code.
5036
5037 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
5038 also turns on the following optimization flags:
5039 @gccoptlist{-fthread-jumps @gol
5040 -fcrossjumping @gol
5041 -foptimize-sibling-calls @gol
5042 -fcse-follow-jumps  -fcse-skip-blocks @gol
5043 -fgcse  -fgcse-lm  @gol
5044 -fexpensive-optimizations @gol
5045 -frerun-cse-after-loop  @gol
5046 -fcaller-saves @gol
5047 -fpeephole2 @gol
5048 -fschedule-insns  -fschedule-insns2 @gol
5049 -fsched-interblock  -fsched-spec @gol
5050 -fregmove @gol
5051 -fstrict-aliasing -fstrict-overflow @gol
5052 -fdelete-null-pointer-checks @gol
5053 -freorder-blocks  -freorder-functions @gol
5054 -falign-functions  -falign-jumps @gol
5055 -falign-loops  -falign-labels @gol
5056 -ftree-vrp @gol
5057 -ftree-pre}
5058
5059 Please note the warning under @option{-fgcse} about
5060 invoking @option{-O2} on programs that use computed gotos.
5061
5062 @item -O3
5063 @opindex O3
5064 Optimize yet more.  @option{-O3} turns on all optimizations specified by
5065 @option{-O2} and also turns on the @option{-finline-functions},
5066 @option{-funswitch-loops}, @option{-fpredictive-commoning} and
5067 @option{-fgcse-after-reload} options.
5068
5069 @item -O0
5070 @opindex O0
5071 Reduce compilation time and make debugging produce the expected
5072 results.  This is the default.
5073
5074 @item -Os
5075 @opindex Os
5076 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
5077 do not typically increase code size.  It also performs further
5078 optimizations designed to reduce code size.
5079
5080 @option{-Os} disables the following optimization flags:
5081 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
5082 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
5083 -fprefetch-loop-arrays  -ftree-vect-loop-version}
5084
5085 If you use multiple @option{-O} options, with or without level numbers,
5086 the last such option is the one that is effective.
5087 @end table
5088
5089 Options of the form @option{-f@var{flag}} specify machine-independent
5090 flags.  Most flags have both positive and negative forms; the negative
5091 form of @option{-ffoo} would be @option{-fno-foo}.  In the table
5092 below, only one of the forms is listed---the one you typically will
5093 use.  You can figure out the other form by either removing @samp{no-}
5094 or adding it.
5095
5096 The following options control specific optimizations.  They are either
5097 activated by @option{-O} options or are related to ones that are.  You
5098 can use the following flags in the rare cases when ``fine-tuning'' of
5099 optimizations to be performed is desired.
5100
5101 @table @gcctabopt
5102 @item -fno-default-inline
5103 @opindex fno-default-inline
5104 Do not make member functions inline by default merely because they are
5105 defined inside the class scope (C++ only).  Otherwise, when you specify
5106 @w{@option{-O}}, member functions defined inside class scope are compiled
5107 inline by default; i.e., you don't need to add @samp{inline} in front of
5108 the member function name.
5109
5110 @item -fno-defer-pop
5111 @opindex fno-defer-pop
5112 Always pop the arguments to each function call as soon as that function
5113 returns.  For machines which must pop arguments after a function call,
5114 the compiler normally lets arguments accumulate on the stack for several
5115 function calls and pops them all at once.
5116
5117 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5118
5119 @item -fforce-addr
5120 @opindex fforce-addr
5121 Force memory address constants to be copied into registers before
5122 doing arithmetic on them.
5123
5124 @item -fforward-propagate
5125 @opindex fforward-propagate
5126 Perform a forward propagation pass on RTL.  The pass tries to combine two
5127 instructions and checks if the result can be simplified.  If loop unrolling
5128 is active, two passes are performed and the second is scheduled after
5129 loop unrolling.
5130
5131 This option is enabled by default at optimization levels @option{-O2},
5132 @option{-O3}, @option{-Os}.
5133
5134 @item -fomit-frame-pointer
5135 @opindex fomit-frame-pointer
5136 Don't keep the frame pointer in a register for functions that
5137 don't need one.  This avoids the instructions to save, set up and
5138 restore frame pointers; it also makes an extra register available
5139 in many functions.  @strong{It also makes debugging impossible on
5140 some machines.}
5141
5142 On some machines, such as the VAX, this flag has no effect, because
5143 the standard calling sequence automatically handles the frame pointer
5144 and nothing is saved by pretending it doesn't exist.  The
5145 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
5146 whether a target machine supports this flag.  @xref{Registers,,Register
5147 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
5148
5149 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5150
5151 @item -foptimize-sibling-calls
5152 @opindex foptimize-sibling-calls
5153 Optimize sibling and tail recursive calls.
5154
5155 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5156
5157 @item -fno-inline
5158 @opindex fno-inline
5159 Don't pay attention to the @code{inline} keyword.  Normally this option
5160 is used to keep the compiler from expanding any functions inline.
5161 Note that if you are not optimizing, no functions can be expanded inline.
5162
5163 @item -finline-functions
5164 @opindex finline-functions
5165 Integrate all simple functions into their callers.  The compiler
5166 heuristically decides which functions are simple enough to be worth
5167 integrating in this way.
5168
5169 If all calls to a given function are integrated, and the function is
5170 declared @code{static}, then the function is normally not output as
5171 assembler code in its own right.
5172
5173 Enabled at level @option{-O3}.
5174
5175 @item -finline-functions-called-once
5176 @opindex finline-functions-called-once
5177 Consider all @code{static} functions called once for inlining into their
5178 caller even if they are not marked @code{inline}.  If a call to a given
5179 function is integrated, then the function is not output as assembler code
5180 in its own right.
5181
5182 Enabled if @option{-funit-at-a-time} is enabled.
5183
5184 @item -fearly-inlining
5185 @opindex fearly-inlining
5186 Inline functions marked by @code{always_inline} and functions whose body seems
5187 smaller than the function call overhead early before doing
5188 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
5189 makes profiling significantly cheaper and usually inlining faster on programs
5190 having large chains of nested wrapper functions.
5191
5192 Enabled by default.
5193
5194 @item -finline-limit=@var{n}
5195 @opindex finline-limit
5196 By default, GCC limits the size of functions that can be inlined.  This flag
5197 allows the control of this limit for functions that are explicitly marked as
5198 inline (i.e., marked with the inline keyword or defined within the class
5199 definition in c++).  @var{n} is the size of functions that can be inlined in
5200 number of pseudo instructions (not counting parameter handling).  The default
5201 value of @var{n} is 600.
5202 Increasing this value can result in more inlined code at
5203 the cost of compilation time and memory consumption.  Decreasing usually makes
5204 the compilation faster and less code will be inlined (which presumably
5205 means slower programs).  This option is particularly useful for programs that
5206 use inlining heavily such as those based on recursive templates with C++.
5207
5208 Inlining is actually controlled by a number of parameters, which may be
5209 specified individually by using @option{--param @var{name}=@var{value}}.
5210 The @option{-finline-limit=@var{n}} option sets some of these parameters
5211 as follows:
5212
5213 @table @gcctabopt
5214 @item max-inline-insns-single
5215  is set to @var{n}/2.
5216 @item max-inline-insns-auto
5217  is set to @var{n}/2.
5218 @item min-inline-insns
5219  is set to 130 or @var{n}/4, whichever is smaller.
5220 @item max-inline-insns-rtl
5221  is set to @var{n}.
5222 @end table
5223
5224 See below for a documentation of the individual
5225 parameters controlling inlining.
5226
5227 @emph{Note:} pseudo instruction represents, in this particular context, an
5228 abstract measurement of function's size.  In no way does it represent a count
5229 of assembly instructions and as such its exact meaning might change from one
5230 release to an another.
5231
5232 @item -fkeep-inline-functions
5233 @opindex fkeep-inline-functions
5234 In C, emit @code{static} functions that are declared @code{inline}
5235 into the object file, even if the function has been inlined into all
5236 of its callers.  This switch does not affect functions using the
5237 @code{extern inline} extension in GNU C89@.  In C++, emit any and all
5238 inline functions into the object file.
5239
5240 @item -fkeep-static-consts
5241 @opindex fkeep-static-consts
5242 Emit variables declared @code{static const} when optimization isn't turned
5243 on, even if the variables aren't referenced.
5244
5245 GCC enables this option by default.  If you want to force the compiler to
5246 check if the variable was referenced, regardless of whether or not
5247 optimization is turned on, use the @option{-fno-keep-static-consts} option.
5248
5249 @item -fmerge-constants
5250 Attempt to merge identical constants (string constants and floating point
5251 constants) across compilation units.
5252
5253 This option is the default for optimized compilation if the assembler and
5254 linker support it.  Use @option{-fno-merge-constants} to inhibit this
5255 behavior.
5256
5257 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5258
5259 @item -fmerge-all-constants
5260 Attempt to merge identical constants and identical variables.
5261
5262 This option implies @option{-fmerge-constants}.  In addition to
5263 @option{-fmerge-constants} this considers e.g.@: even constant initialized
5264 arrays or initialized constant variables with integral or floating point
5265 types.  Languages like C or C++ require each non-automatic variable to
5266 have distinct location, so using this option will result in non-conforming
5267 behavior.
5268
5269 @item -fmodulo-sched
5270 @opindex fmodulo-sched
5271 Perform swing modulo scheduling immediately before the first scheduling
5272 pass.  This pass looks at innermost loops and reorders their
5273 instructions by overlapping different iterations.
5274
5275 @item -fmodulo-sched-allow-regmoves
5276 @opindex fmodulo-sched-allow-regmoves
5277 Perform more aggressive SMS based modulo scheduling with register moves
5278 allowed.  By setting this flag certain anti-dependences edges will be
5279 deleted which will trigger the generation of reg-moves based on the
5280 life-range analysis.
5281
5282 @item -fno-branch-count-reg
5283 @opindex fno-branch-count-reg
5284 Do not use ``decrement and branch'' instructions on a count register,
5285 but instead generate a sequence of instructions that decrement a
5286 register, compare it against zero, then branch based upon the result.
5287 This option is only meaningful on architectures that support such
5288 instructions, which include x86, PowerPC, IA-64 and S/390.
5289
5290 The default is @option{-fbranch-count-reg}.
5291
5292 @item -fno-function-cse
5293 @opindex fno-function-cse
5294 Do not put function addresses in registers; make each instruction that
5295 calls a constant function contain the function's address explicitly.
5296
5297 This option results in less efficient code, but some strange hacks
5298 that alter the assembler output may be confused by the optimizations
5299 performed when this option is not used.
5300
5301 The default is @option{-ffunction-cse}
5302
5303 @item -fno-zero-initialized-in-bss
5304 @opindex fno-zero-initialized-in-bss
5305 If the target supports a BSS section, GCC by default puts variables that
5306 are initialized to zero into BSS@.  This can save space in the resulting
5307 code.
5308
5309 This option turns off this behavior because some programs explicitly
5310 rely on variables going to the data section.  E.g., so that the
5311 resulting executable can find the beginning of that section and/or make
5312 assumptions based on that.
5313
5314 The default is @option{-fzero-initialized-in-bss}.
5315
5316 @item -fbounds-check
5317 @opindex fbounds-check
5318 For front-ends that support it, generate additional code to check that
5319 indices used to access arrays are within the declared range.  This is
5320 currently only supported by the Java and Fortran front-ends, where
5321 this option defaults to true and false respectively.
5322
5323 @item -fmudflap -fmudflapth -fmudflapir
5324 @opindex fmudflap
5325 @opindex fmudflapth
5326 @opindex fmudflapir
5327 @cindex bounds checking
5328 @cindex mudflap
5329 For front-ends that support it (C and C++), instrument all risky
5330 pointer/array dereferencing operations, some standard library
5331 string/heap functions, and some other associated constructs with
5332 range/validity tests.  Modules so instrumented should be immune to
5333 buffer overflows, invalid heap use, and some other classes of C/C++
5334 programming errors.  The instrumentation relies on a separate runtime
5335 library (@file{libmudflap}), which will be linked into a program if
5336 @option{-fmudflap} is given at link time.  Run-time behavior of the
5337 instrumented program is controlled by the @env{MUDFLAP_OPTIONS}
5338 environment variable.  See @code{env MUDFLAP_OPTIONS=-help a.out}
5339 for its options.
5340
5341 Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to
5342 link if your program is multi-threaded.  Use @option{-fmudflapir}, in
5343 addition to @option{-fmudflap} or @option{-fmudflapth}, if
5344 instrumentation should ignore pointer reads.  This produces less
5345 instrumentation (and therefore faster execution) and still provides
5346 some protection against outright memory corrupting writes, but allows
5347 erroneously read data to propagate within a program.
5348
5349 @item -fthread-jumps
5350 @opindex fthread-jumps
5351 Perform optimizations where we check to see if a jump branches to a
5352 location where another comparison subsumed by the first is found.  If
5353 so, the first branch is redirected to either the destination of the
5354 second branch or a point immediately following it, depending on whether
5355 the condition is known to be true or false.
5356
5357 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5358
5359 @item -fsplit-wide-types
5360 @opindex fsplit-wide-types
5361 When using a type that occupies multiple registers, such as @code{long
5362 long} on a 32-bit system, split the registers apart and allocate them
5363 independently.  This normally generates better code for those types,
5364 but may make debugging more difficult.
5365
5366 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
5367 @option{-Os}.
5368
5369 @item -fcse-follow-jumps
5370 @opindex fcse-follow-jumps
5371 In common subexpression elimination, scan through jump instructions
5372 when the target of the jump is not reached by any other path.  For
5373 example, when CSE encounters an @code{if} statement with an
5374 @code{else} clause, CSE will follow the jump when the condition
5375 tested is false.
5376
5377 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5378
5379 @item -fcse-skip-blocks
5380 @opindex fcse-skip-blocks
5381 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
5382 follow jumps which conditionally skip over blocks.  When CSE
5383 encounters a simple @code{if} statement with no else clause,
5384 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
5385 body of the @code{if}.
5386
5387 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5388
5389 @item -frerun-cse-after-loop
5390 @opindex frerun-cse-after-loop
5391 Re-run common subexpression elimination after loop optimizations has been
5392 performed.
5393
5394 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5395
5396 @item -fgcse
5397 @opindex fgcse
5398 Perform a global common subexpression elimination pass.
5399 This pass also performs global constant and copy propagation.
5400
5401 @emph{Note:} When compiling a program using computed gotos, a GCC
5402 extension, you may get better runtime performance if you disable
5403 the global common subexpression elimination pass by adding
5404 @option{-fno-gcse} to the command line.
5405
5406 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5407
5408 @item -fgcse-lm
5409 @opindex fgcse-lm
5410 When @option{-fgcse-lm} is enabled, global common subexpression elimination will
5411 attempt to move loads which are only killed by stores into themselves.  This
5412 allows a loop containing a load/store sequence to be changed to a load outside
5413 the loop, and a copy/store within the loop.
5414
5415 Enabled by default when gcse is enabled.
5416
5417 @item -fgcse-sm
5418 @opindex fgcse-sm
5419 When @option{-fgcse-sm} is enabled, a store motion pass is run after
5420 global common subexpression elimination.  This pass will attempt to move
5421 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
5422 loops containing a load/store sequence can be changed to a load before
5423 the loop and a store after the loop.
5424
5425 Not enabled at any optimization level.
5426
5427 @item -fgcse-las
5428 @opindex fgcse-las
5429 When @option{-fgcse-las} is enabled, the global common subexpression
5430 elimination pass eliminates redundant loads that come after stores to the
5431 same memory location (both partial and full redundancies).
5432
5433 Not enabled at any optimization level.
5434
5435 @item -fgcse-after-reload
5436 @opindex fgcse-after-reload
5437 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
5438 pass is performed after reload.  The purpose of this pass is to cleanup
5439 redundant spilling.
5440
5441 @item -funsafe-loop-optimizations
5442 @opindex funsafe-loop-optimizations
5443 If given, the loop optimizer will assume that loop indices do not
5444 overflow, and that the loops with nontrivial exit condition are not
5445 infinite.  This enables a wider range of loop optimizations even if
5446 the loop optimizer itself cannot prove that these assumptions are valid.
5447 Using @option{-Wunsafe-loop-optimizations}, the compiler will warn you
5448 if it finds this kind of loop.
5449
5450 @item -fcrossjumping
5451 @opindex crossjumping
5452 Perform cross-jumping transformation.  This transformation unifies equivalent code and save code size.  The
5453 resulting code may or may not perform better than without cross-jumping.
5454
5455 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5456
5457 @item -fif-conversion
5458 @opindex if-conversion
5459 Attempt to transform conditional jumps into branch-less equivalents.  This
5460 include use of conditional moves, min, max, set flags and abs instructions, and
5461 some tricks doable by standard arithmetics.  The use of conditional execution
5462 on chips where it is available is controlled by @code{if-conversion2}.
5463
5464 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5465
5466 @item -fif-conversion2
5467 @opindex if-conversion2
5468 Use conditional execution (where available) to transform conditional jumps into
5469 branch-less equivalents.
5470
5471 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5472
5473 @item -fdelete-null-pointer-checks
5474 @opindex fdelete-null-pointer-checks
5475 Use global dataflow analysis to identify and eliminate useless checks
5476 for null pointers.  The compiler assumes that dereferencing a null
5477 pointer would have halted the program.  If a pointer is checked after
5478 it has already been dereferenced, it cannot be null.
5479
5480 In some environments, this assumption is not true, and programs can
5481 safely dereference null pointers.  Use
5482 @option{-fno-delete-null-pointer-checks} to disable this optimization
5483 for programs which depend on that behavior.
5484
5485 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5486
5487 @item -fexpensive-optimizations
5488 @opindex fexpensive-optimizations
5489 Perform a number of minor optimizations that are relatively expensive.
5490
5491 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5492
5493 @item -foptimize-register-move
5494 @itemx -fregmove
5495 @opindex foptimize-register-move
5496 @opindex fregmove
5497 Attempt to reassign register numbers in move instructions and as
5498 operands of other simple instructions in order to maximize the amount of
5499 register tying.  This is especially helpful on machines with two-operand
5500 instructions.
5501
5502 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
5503 optimization.
5504
5505 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5506
5507 @item -fdelayed-branch
5508 @opindex fdelayed-branch
5509 If supported for the target machine, attempt to reorder instructions
5510 to exploit instruction slots available after delayed branch
5511 instructions.
5512
5513 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5514
5515 @item -fschedule-insns
5516 @opindex fschedule-insns
5517 If supported for the target machine, attempt to reorder instructions to
5518 eliminate execution stalls due to required data being unavailable.  This
5519 helps machines that have slow floating point or memory load instructions
5520 by allowing other instructions to be issued until the result of the load
5521 or floating point instruction is required.
5522
5523 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5524
5525 @item -fschedule-insns2
5526 @opindex fschedule-insns2
5527 Similar to @option{-fschedule-insns}, but requests an additional pass of
5528 instruction scheduling after register allocation has been done.  This is
5529 especially useful on machines with a relatively small number of
5530 registers and where memory load instructions take more than one cycle.
5531
5532 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5533
5534 @item -fno-sched-interblock
5535 @opindex fno-sched-interblock
5536 Don't schedule instructions across basic blocks.  This is normally
5537 enabled by default when scheduling before register allocation, i.e.@:
5538 with @option{-fschedule-insns} or at @option{-O2} or higher.
5539
5540 @item -fno-sched-spec
5541 @opindex fno-sched-spec
5542 Don't allow speculative motion of non-load instructions.  This is normally
5543 enabled by default when scheduling before register allocation, i.e.@:
5544 with @option{-fschedule-insns} or at @option{-O2} or higher.
5545
5546 @item -fsched-spec-load
5547 @opindex fsched-spec-load
5548 Allow speculative motion of some load instructions.  This only makes
5549 sense when scheduling before register allocation, i.e.@: with
5550 @option{-fschedule-insns} or at @option{-O2} or higher.
5551
5552 @item -fsched-spec-load-dangerous
5553 @opindex fsched-spec-load-dangerous
5554 Allow speculative motion of more load instructions.  This only makes
5555 sense when scheduling before register allocation, i.e.@: with
5556 @option{-fschedule-insns} or at @option{-O2} or higher.
5557
5558 @item -fsched-stalled-insns=@var{n}
5559 @opindex fsched-stalled-insns
5560 Define how many insns (if any) can be moved prematurely from the queue
5561 of stalled insns into the ready list, during the second scheduling pass.
5562
5563 @item -fsched-stalled-insns-dep=@var{n}
5564 @opindex fsched-stalled-insns-dep
5565 Define how many insn groups (cycles) will be examined for a dependency
5566 on a stalled insn that is candidate for premature removal from the queue
5567 of stalled insns.  Has an effect only during the second scheduling pass,
5568 and only if @option{-fsched-stalled-insns} is used and its value is not zero.
5569
5570 @item -fsched2-use-superblocks
5571 @opindex fsched2-use-superblocks
5572 When scheduling after register allocation, do use superblock scheduling
5573 algorithm.  Superblock scheduling allows motion across basic block boundaries
5574 resulting on faster schedules.  This option is experimental, as not all machine
5575 descriptions used by GCC model the CPU closely enough to avoid unreliable
5576 results from the algorithm.
5577
5578 This only makes sense when scheduling after register allocation, i.e.@: with
5579 @option{-fschedule-insns2} or at @option{-O2} or higher.
5580
5581 @item -fsched2-use-traces
5582 @opindex fsched2-use-traces
5583 Use @option{-fsched2-use-superblocks} algorithm when scheduling after register
5584 allocation and additionally perform code duplication in order to increase the
5585 size of superblocks using tracer pass.  See @option{-ftracer} for details on
5586 trace formation.
5587
5588 This mode should produce faster but significantly longer programs.  Also
5589 without @option{-fbranch-probabilities} the traces constructed may not
5590 match the reality and hurt the performance.  This only makes
5591 sense when scheduling after register allocation, i.e.@: with
5592 @option{-fschedule-insns2} or at @option{-O2} or higher.
5593
5594 @item -fsee
5595 @opindex fsee
5596 Eliminates redundant extension instructions and move the non redundant
5597 ones to optimal placement using LCM.
5598
5599 @item -freschedule-modulo-scheduled-loops
5600 @opindex fscheduling-in-modulo-scheduled-loops
5601 The modulo scheduling comes before the traditional scheduling, if a loop
5602 was modulo scheduled we may want to prevent the later scheduling passes
5603 from changing its schedule, we use this option to control that.
5604
5605 @item -fcaller-saves
5606 @opindex fcaller-saves
5607 Enable values to be allocated in registers that will be clobbered by
5608 function calls, by emitting extra instructions to save and restore the
5609 registers around such calls.  Such allocation is done only when it
5610 seems to result in better code than would otherwise be produced.
5611
5612 This option is always enabled by default on certain machines, usually
5613 those which have no call-preserved registers to use instead.
5614
5615 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5616
5617 @item -ftree-reassoc
5618 Perform Reassociation on trees  This flag is enabled by default
5619 at @option{-O} and higher.
5620
5621 @item -ftree-pre
5622 Perform Partial Redundancy Elimination (PRE) on trees.  This flag is
5623 enabled by default at @option{-O2} and @option{-O3}.
5624
5625 @item -ftree-fre
5626 Perform Full Redundancy Elimination (FRE) on trees.  The difference
5627 between FRE and PRE is that FRE only considers expressions
5628 that are computed on all paths leading to the redundant computation.
5629 This analysis is faster than PRE, though it exposes fewer redundancies.
5630 This flag is enabled by default at @option{-O} and higher.
5631
5632 @item -ftree-copy-prop
5633 Perform copy propagation on trees.  This pass eliminates unnecessary
5634 copy operations.  This flag is enabled by default at @option{-O} and
5635 higher.
5636
5637 @item -ftree-store-copy-prop
5638 Perform copy propagation of memory loads and stores.  This pass
5639 eliminates unnecessary copy operations in memory references
5640 (structures, global variables, arrays, etc).  This flag is enabled by
5641 default at @option{-O2} and higher.
5642
5643 @item -ftree-salias
5644 Perform structural alias analysis on trees.  This flag
5645 is enabled by default at @option{-O} and higher.
5646
5647 @item -fipa-pta
5648 Perform interprocedural pointer analysis.
5649
5650 @item -ftree-sink
5651 Perform forward store motion  on trees.  This flag is
5652 enabled by default at @option{-O} and higher.
5653
5654 @item -ftree-ccp
5655 Perform sparse conditional constant propagation (CCP) on trees.  This
5656 pass only operates on local scalar variables and is enabled by default
5657 at @option{-O} and higher.
5658
5659 @item -ftree-store-ccp
5660 Perform sparse conditional constant propagation (CCP) on trees.  This
5661 pass operates on both local scalar variables and memory stores and
5662 loads (global variables, structures, arrays, etc).  This flag is
5663 enabled by default at @option{-O2} and higher.
5664
5665 @item -ftree-dce
5666 Perform dead code elimination (DCE) on trees.  This flag is enabled by
5667 default at @option{-O} and higher.
5668
5669 @item -ftree-dominator-opts
5670 Perform a variety of simple scalar cleanups (constant/copy
5671 propagation, redundancy elimination, range propagation and expression
5672 simplification) based on a dominator tree traversal.  This also
5673 performs jump threading (to reduce jumps to jumps). This flag is
5674 enabled by default at @option{-O} and higher.
5675
5676 @item -ftree-ch
5677 Perform loop header copying on trees.  This is beneficial since it increases
5678 effectiveness of code motion optimizations.  It also saves one jump.  This flag
5679 is enabled by default at @option{-O} and higher.  It is not enabled
5680 for @option{-Os}, since it usually increases code size.
5681
5682 @item -ftree-loop-optimize
5683 Perform loop optimizations on trees.  This flag is enabled by default
5684 at @option{-O} and higher.
5685
5686 @item -ftree-loop-linear
5687 Perform linear loop transformations on tree.  This flag can improve cache
5688 performance and allow further loop optimizations to take place.
5689
5690 @item -fcheck-data-deps
5691 Compare the results of several data dependence analyzers.  This option
5692 is used for debugging the data dependence analyzers.
5693
5694 @item -ftree-loop-im
5695 Perform loop invariant motion on trees.  This pass moves only invariants that
5696 would be hard to handle at RTL level (function calls, operations that expand to
5697 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
5698 operands of conditions that are invariant out of the loop, so that we can use
5699 just trivial invariantness analysis in loop unswitching.  The pass also includes
5700 store motion.
5701
5702 @item -ftree-loop-ivcanon
5703 Create a canonical counter for number of iterations in the loop for that
5704 determining number of iterations requires complicated analysis.  Later
5705 optimizations then may determine the number easily.  Useful especially
5706 in connection with unrolling.
5707
5708 @item -fivopts
5709 Perform induction variable optimizations (strength reduction, induction
5710 variable merging and induction variable elimination) on trees.
5711
5712 @item -ftree-sra
5713 Perform scalar replacement of aggregates.  This pass replaces structure
5714 references with scalars to prevent committing structures to memory too
5715 early.  This flag is enabled by default at @option{-O} and higher.
5716
5717 @item -ftree-copyrename
5718 Perform copy renaming on trees.  This pass attempts to rename compiler
5719 temporaries to other variables at copy locations, usually resulting in
5720 variable names which more closely resemble the original variables.  This flag
5721 is enabled by default at @option{-O} and higher.
5722
5723 @item -ftree-ter
5724 Perform temporary expression replacement during the SSA->normal phase.  Single
5725 use/single def temporaries are replaced at their use location with their
5726 defining expression.  This results in non-GIMPLE code, but gives the expanders
5727 much more complex trees to work on resulting in better RTL generation.  This is
5728 enabled by default at @option{-O} and higher.
5729
5730 @item -ftree-vectorize
5731 Perform loop vectorization on trees.
5732
5733 @item -ftree-vect-loop-version
5734 @opindex ftree-vect-loop-version
5735 Perform loop versioning when doing loop vectorization on trees.  When a loop
5736 appears to be vectorizable except that data alignment or data dependence cannot
5737 be determined at compile time then vectorized and non-vectorized versions of
5738 the loop are generated along with runtime checks for alignment or dependence
5739 to control which version is executed.  This option is enabled by default
5740 except at level @option{-Os} where it is disabled.
5741
5742 @item -fvect-cost-model
5743 Enable cost model for vectorization.
5744
5745 @item -ftree-vrp
5746 Perform Value Range Propagation on trees.  This is similar to the
5747 constant propagation pass, but instead of values, ranges of values are
5748 propagated.  This allows the optimizers to remove unnecessary range
5749 checks like array bound checks and null pointer checks.  This is
5750 enabled by default at @option{-O2} and higher.  Null pointer check
5751 elimination is only done if @option{-fdelete-null-pointer-checks} is
5752 enabled.
5753
5754 @item -ftracer
5755 @opindex ftracer
5756 Perform tail duplication to enlarge superblock size.  This transformation
5757 simplifies the control flow of the function allowing other optimizations to do
5758 better job.
5759
5760 @item -funroll-loops
5761 @opindex funroll-loops
5762 Unroll loops whose number of iterations can be determined at compile
5763 time or upon entry to the loop.  @option{-funroll-loops} implies
5764 @option{-frerun-cse-after-loop}.  This option makes code larger,
5765 and may or may not make it run faster.
5766
5767 @item -funroll-all-loops
5768 @opindex funroll-all-loops
5769 Unroll all loops, even if their number of iterations is uncertain when
5770 the loop is entered.  This usually makes programs run more slowly.
5771 @option{-funroll-all-loops} implies the same options as
5772 @option{-funroll-loops},
5773
5774 @item -fsplit-ivs-in-unroller
5775 @opindex fsplit-ivs-in-unroller
5776 Enables expressing of values of induction variables in later iterations
5777 of the unrolled loop using the value in the first iteration.  This breaks
5778 long dependency chains, thus improving efficiency of the scheduling passes.
5779
5780 Combination of @option{-fweb} and CSE is often sufficient to obtain the
5781 same effect.  However in cases the loop body is more complicated than
5782 a single basic block, this is not reliable.  It also does not work at all
5783 on some of the architectures due to restrictions in the CSE pass.
5784
5785 This optimization is enabled by default.
5786
5787 @item -fvariable-expansion-in-unroller
5788 @opindex fvariable-expansion-in-unroller
5789 With this option, the compiler will create multiple copies of some
5790 local variables when unrolling a loop which can result in superior code.
5791
5792 @item -fpredictive-commoning
5793 @opindex fpredictive-commoning
5794 Perform predictive commoning optimization, i.e., reusing computations
5795 (especially memory loads and stores) performed in previous
5796 iterations of loops.
5797
5798 This option is enabled at level @option{-O3}.
5799
5800 @item -fprefetch-loop-arrays
5801 @opindex fprefetch-loop-arrays
5802 If supported by the target machine, generate instructions to prefetch
5803 memory to improve the performance of loops that access large arrays.
5804
5805 This option may generate better or worse code; results are highly
5806 dependent on the structure of loops within the source code.
5807
5808 Disabled at level @option{-Os}.
5809
5810 @item -fno-peephole
5811 @itemx -fno-peephole2
5812 @opindex fno-peephole
5813 @opindex fno-peephole2
5814 Disable any machine-specific peephole optimizations.  The difference
5815 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
5816 are implemented in the compiler; some targets use one, some use the
5817 other, a few use both.
5818
5819 @option{-fpeephole} is enabled by default.
5820 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5821
5822 @item -fno-guess-branch-probability
5823 @opindex fno-guess-branch-probability
5824 Do not guess branch probabilities using heuristics.
5825
5826 GCC will use heuristics to guess branch probabilities if they are
5827 not provided by profiling feedback (@option{-fprofile-arcs}).  These
5828 heuristics are based on the control flow graph.  If some branch probabilities
5829 are specified by @samp{__builtin_expect}, then the heuristics will be
5830 used to guess branch probabilities for the rest of the control flow graph,
5831 taking the @samp{__builtin_expect} info into account.  The interactions
5832 between the heuristics and @samp{__builtin_expect} can be complex, and in
5833 some cases, it may be useful to disable the heuristics so that the effects
5834 of @samp{__builtin_expect} are easier to understand.
5835
5836 The default is @option{-fguess-branch-probability} at levels
5837 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5838
5839 @item -freorder-blocks
5840 @opindex freorder-blocks
5841 Reorder basic blocks in the compiled function in order to reduce number of
5842 taken branches and improve code locality.
5843
5844 Enabled at levels @option{-O2}, @option{-O3}.
5845
5846 @item -freorder-blocks-and-partition
5847 @opindex freorder-blocks-and-partition
5848 In addition to reordering basic blocks in the compiled function, in order
5849 to reduce number of taken branches, partitions hot and cold basic blocks
5850 into separate sections of the assembly and .o files, to improve
5851 paging and cache locality performance.
5852
5853 This optimization is automatically turned off in the presence of
5854 exception handling, for linkonce sections, for functions with a user-defined
5855 section attribute and on any architecture that does not support named
5856 sections.
5857
5858 @item -freorder-functions
5859 @opindex freorder-functions
5860 Reorder functions in the object file in order to
5861 improve code locality.  This is implemented by using special
5862 subsections @code{.text.hot} for most frequently executed functions and
5863 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
5864 the linker so object file format must support named sections and linker must
5865 place them in a reasonable way.
5866
5867 Also profile feedback must be available in to make this option effective.  See
5868 @option{-fprofile-arcs} for details.
5869
5870 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5871
5872 @item -fstrict-aliasing
5873 @opindex fstrict-aliasing
5874 Allows the compiler to assume the strictest aliasing rules applicable to
5875 the language being compiled.  For C (and C++), this activates
5876 optimizations based on the type of expressions.  In particular, an
5877 object of one type is assumed never to reside at the same address as an
5878 object of a different type, unless the types are almost the same.  For
5879 example, an @code{unsigned int} can alias an @code{int}, but not a
5880 @code{void*} or a @code{double}.  A character type may alias any other
5881 type.
5882
5883 Pay special attention to code like this:
5884 @smallexample
5885 union a_union @{
5886   int i;
5887   double d;
5888 @};
5889
5890 int f() @{
5891   a_union t;
5892   t.d = 3.0;
5893   return t.i;
5894 @}
5895 @end smallexample
5896 The practice of reading from a different union member than the one most
5897 recently written to (called ``type-punning'') is common.  Even with
5898 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
5899 is accessed through the union type.  So, the code above will work as
5900 expected.  However, this code might not:
5901 @smallexample
5902 int f() @{
5903   a_union t;
5904   int* ip;
5905   t.d = 3.0;
5906   ip = &t.i;
5907   return *ip;
5908 @}
5909 @end smallexample
5910
5911 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5912
5913 @item -fstrict-overflow
5914 @opindex fstrict-overflow
5915 Allow the compiler to assume strict signed overflow rules, depending
5916 on the language being compiled.  For C (and C++) this means that
5917 overflow when doing arithmetic with signed numbers is undefined, which
5918 means that the compiler may assume that it will not happen.  This
5919 permits various optimizations.  For example, the compiler will assume
5920 that an expression like @code{i + 10 > i} will always be true for
5921 signed @code{i}.  This assumption is only valid if signed overflow is
5922 undefined, as the expression is false if @code{i + 10} overflows when
5923 using twos complement arithmetic.  When this option is in effect any
5924 attempt to determine whether an operation on signed numbers will
5925 overflow must be written carefully to not actually involve overflow.
5926
5927 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
5928 that signed overflow is fully defined: it wraps.  When
5929 @option{-fwrapv} is used, there is no difference between
5930 @option{-fstrict-overflow} and @option{-fno-strict-overflow}.  With
5931 @option{-fwrapv} certain types of overflow are permitted.  For
5932 example, if the compiler gets an overflow when doing arithmetic on
5933 constants, the overflowed value can still be used with
5934 @option{-fwrapv}, but not otherwise.
5935
5936 The @option{-fstrict-overflow} option is enabled at levels
5937 @option{-O2}, @option{-O3}, @option{-Os}.
5938
5939 @item -falign-functions
5940 @itemx -falign-functions=@var{n}
5941 @opindex falign-functions
5942 Align the start of functions to the next power-of-two greater than
5943 @var{n}, skipping up to @var{n} bytes.  For instance,
5944 @option{-falign-functions=32} aligns functions to the next 32-byte
5945 boundary, but @option{-falign-functions=24} would align to the next
5946 32-byte boundary only if this can be done by skipping 23 bytes or less.
5947
5948 @option{-fno-align-functions} and @option{-falign-functions=1} are
5949 equivalent and mean that functions will not be aligned.
5950
5951 Some assemblers only support this flag when @var{n} is a power of two;
5952 in that case, it is rounded up.
5953
5954 If @var{n} is not specified or is zero, use a machine-dependent default.
5955
5956 Enabled at levels @option{-O2}, @option{-O3}.
5957
5958 @item -falign-labels
5959 @itemx -falign-labels=@var{n}
5960 @opindex falign-labels
5961 Align all branch targets to a power-of-two boundary, skipping up to
5962 @var{n} bytes like @option{-falign-functions}.  This option can easily
5963 make code slower, because it must insert dummy operations for when the
5964 branch target is reached in the usual flow of the code.
5965
5966 @option{-fno-align-labels} and @option{-falign-labels=1} are
5967 equivalent and mean that labels will not be aligned.
5968
5969 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
5970 are greater than this value, then their values are used instead.
5971
5972 If @var{n} is not specified or is zero, use a machine-dependent default
5973 which is very likely to be @samp{1}, meaning no alignment.
5974
5975 Enabled at levels @option{-O2}, @option{-O3}.
5976
5977 @item -falign-loops
5978 @itemx -falign-loops=@var{n}
5979 @opindex falign-loops
5980 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
5981 like @option{-falign-functions}.  The hope is that the loop will be
5982 executed many times, which will make up for any execution of the dummy
5983 operations.
5984
5985 @option{-fno-align-loops} and @option{-falign-loops=1} are
5986 equivalent and mean that loops will not be aligned.
5987
5988 If @var{n} is not specified or is zero, use a machine-dependent default.
5989
5990 Enabled at levels @option{-O2}, @option{-O3}.
5991
5992 @item -falign-jumps
5993 @itemx -falign-jumps=@var{n}
5994 @opindex falign-jumps
5995 Align branch targets to a power-of-two boundary, for branch targets
5996 where the targets can only be reached by jumping, skipping up to @var{n}
5997 bytes like @option{-falign-functions}.  In this case, no dummy operations
5998 need be executed.
5999
6000 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
6001 equivalent and mean that loops will not be aligned.
6002
6003 If @var{n} is not specified or is zero, use a machine-dependent default.
6004
6005 Enabled at levels @option{-O2}, @option{-O3}.
6006
6007 @item -funit-at-a-time
6008 @opindex funit-at-a-time
6009 Parse the whole compilation unit before starting to produce code.
6010 This allows some extra optimizations to take place but consumes
6011 more memory (in general).  There are some compatibility issues
6012 with @emph{unit-at-a-time} mode:
6013 @itemize @bullet
6014 @item
6015 enabling @emph{unit-at-a-time} mode may change the order
6016 in which functions, variables, and top-level @code{asm} statements
6017 are emitted, and will likely break code relying on some particular
6018 ordering.  The majority of such top-level @code{asm} statements,
6019 though, can be replaced by @code{section} attributes.  The
6020 @option{fno-toplevel-reorder} option may be used to keep the ordering
6021 used in the input file, at the cost of some optimizations.
6022
6023 @item
6024 @emph{unit-at-a-time} mode removes unreferenced static variables
6025 and functions.  This may result in undefined references
6026 when an @code{asm} statement refers directly to variables or functions
6027 that are otherwise unused.  In that case either the variable/function
6028 shall be listed as an operand of the @code{asm} statement operand or,
6029 in the case of top-level @code{asm} statements the attribute @code{used}
6030 shall be used on the declaration.
6031
6032 @item
6033 Static functions now can use non-standard passing conventions that
6034 may break @code{asm} statements calling functions directly.  Again,
6035 attribute @code{used} will prevent this behavior.
6036 @end itemize
6037
6038 As a temporary workaround, @option{-fno-unit-at-a-time} can be used,
6039 but this scheme may not be supported by future releases of GCC@.
6040
6041 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6042
6043 @item -fno-toplevel-reorder
6044 Do not reorder top-level functions, variables, and @code{asm}
6045 statements.  Output them in the same order that they appear in the
6046 input file.  When this option is used, unreferenced static variables
6047 will not be removed.  This option is intended to support existing code
6048 which relies on a particular ordering.  For new code, it is better to
6049 use attributes.
6050
6051 @item -fweb
6052 @opindex fweb
6053 Constructs webs as commonly used for register allocation purposes and assign
6054 each web individual pseudo register.  This allows the register allocation pass
6055 to operate on pseudos directly, but also strengthens several other optimization
6056 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
6057 however, make debugging impossible, since variables will no longer stay in a
6058 ``home register''.
6059
6060 Enabled by default with @option{-funroll-loops}.
6061
6062 @item -fwhole-program
6063 @opindex fwhole-program
6064 Assume that the current compilation unit represents whole program being
6065 compiled.  All public functions and variables with the exception of @code{main}
6066 and those merged by attribute @code{externally_visible} become static functions
6067 and in a affect gets more aggressively optimized by interprocedural optimizers.
6068 While this option is equivalent to proper use of @code{static} keyword for
6069 programs consisting of single file, in combination with option
6070 @option{--combine} this flag can be used to compile most of smaller scale C
6071 programs since the functions and variables become local for the whole combined
6072 compilation unit, not for the single source file itself.
6073
6074
6075 @item -fno-cprop-registers
6076 @opindex fno-cprop-registers
6077 After register allocation and post-register allocation instruction splitting,
6078 we perform a copy-propagation pass to try to reduce scheduling dependencies
6079 and occasionally eliminate the copy.
6080
6081 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6082
6083 @item -fprofile-generate
6084 @opindex fprofile-generate
6085
6086 Enable options usually used for instrumenting application to produce
6087 profile useful for later recompilation with profile feedback based
6088 optimization.  You must use @option{-fprofile-generate} both when
6089 compiling and when linking your program.
6090
6091 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
6092
6093 @item -fprofile-use
6094 @opindex fprofile-use
6095 Enable profile feedback directed optimizations, and optimizations
6096 generally profitable only with profile feedback available.
6097
6098 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
6099 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}
6100
6101 By default, GCC emits an error message if the feedback profiles do not
6102 match the source code.  This error can be turned into a warning by using
6103 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
6104 code.
6105 @end table
6106
6107 The following options control compiler behavior regarding floating
6108 point arithmetic.  These options trade off between speed and
6109 correctness.  All must be specifically enabled.
6110
6111 @table @gcctabopt
6112 @item -ffloat-store
6113 @opindex ffloat-store
6114 Do not store floating point variables in registers, and inhibit other
6115 options that might change whether a floating point value is taken from a
6116 register or memory.
6117
6118 @cindex floating point precision
6119 This option prevents undesirable excess precision on machines such as
6120 the 68000 where the floating registers (of the 68881) keep more
6121 precision than a @code{double} is supposed to have.  Similarly for the
6122 x86 architecture.  For most programs, the excess precision does only
6123 good, but a few programs rely on the precise definition of IEEE floating
6124 point.  Use @option{-ffloat-store} for such programs, after modifying
6125 them to store all pertinent intermediate computations into variables.
6126
6127 @item -ffast-math
6128 @opindex ffast-math
6129 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations}, @*
6130 @option{-fno-trapping-math}, @option{-ffinite-math-only},
6131 @option{-fno-rounding-math}, @option{-fno-signaling-nans},
6132 @option{-fno-signed-zeros} and @option{fcx-limited-range}.
6133
6134 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
6135
6136 This option is not turned on by any @option{-O} option since
6137 it can result in incorrect output for programs which depend on
6138 an exact implementation of IEEE or ISO rules/specifications for
6139 math functions. It may, however, yield faster code for programs
6140 that do not require the guarantees of these specifications.
6141
6142 @item -fno-math-errno
6143 @opindex fno-math-errno
6144 Do not set ERRNO after calling math functions that are executed
6145 with a single instruction, e.g., sqrt.  A program that relies on
6146 IEEE exceptions for math error handling may want to use this flag
6147 for speed while maintaining IEEE arithmetic compatibility.
6148
6149 This option is not turned on by any @option{-O} option since
6150 it can result in incorrect output for programs which depend on
6151 an exact implementation of IEEE or ISO rules/specifications for
6152 math functions. It may, however, yield faster code for programs
6153 that do not require the guarantees of these specifications.
6154
6155 The default is @option{-fmath-errno}.
6156
6157 On Darwin systems, the math library never sets @code{errno}.  There is
6158 therefore no reason for the compiler to consider the possibility that
6159 it might, and @option{-fno-math-errno} is the default.
6160
6161 @item -funsafe-math-optimizations
6162 @opindex funsafe-math-optimizations
6163 Allow optimizations for floating-point arithmetic that (a) assume
6164 that arguments and results are valid and (b) may violate IEEE or
6165 ANSI standards.  When used at link-time, it may include libraries
6166 or startup files that change the default FPU control word or other
6167 similar optimizations.
6168
6169 This option is not turned on by any @option{-O} option since
6170 it can result in incorrect output for programs which depend on
6171 an exact implementation of IEEE or ISO rules/specifications for
6172 math functions. It may, however, yield faster code for programs
6173 that do not require the guarantees of these specifications.
6174
6175 The default is @option{-fno-unsafe-math-optimizations}.
6176
6177 @item -ffinite-math-only
6178 @opindex ffinite-math-only
6179 Allow optimizations for floating-point arithmetic that assume
6180 that arguments and results are not NaNs or +-Infs.
6181
6182 This option is not turned on by any @option{-O} option since
6183 it can result in incorrect output for programs which depend on
6184 an exact implementation of IEEE or ISO rules/specifications for
6185 math functions. It may, however, yield faster code for programs
6186 that do not require the guarantees of these specifications.
6187
6188 The default is @option{-fno-finite-math-only}.
6189
6190 @item -fno-signed-zeros
6191 @opindex fno-signed-zeros
6192 Allow optimizations for floating point arithmetic that ignore the
6193 signedness of zero.  IEEE arithmetic specifies the behavior of
6194 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
6195 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
6196 This option implies that the sign of a zero result isn't significant.
6197
6198 The default is @option{-fsigned-zeros}.
6199
6200 @item -fno-trapping-math
6201 @opindex fno-trapping-math
6202 Compile code assuming that floating-point operations cannot generate
6203 user-visible traps.  These traps include division by zero, overflow,
6204 underflow, inexact result and invalid operation.  This option implies
6205 @option{-fno-signaling-nans}.  Setting this option may allow faster
6206 code if one relies on ``non-stop'' IEEE arithmetic, for example.
6207
6208 This option should never be turned on by any @option{-O} option since
6209 it can result in incorrect output for programs which depend on
6210 an exact implementation of IEEE or ISO rules/specifications for
6211 math functions.
6212
6213 The default is @option{-ftrapping-math}.
6214
6215 @item -frounding-math
6216 @opindex frounding-math
6217 Disable transformations and optimizations that assume default floating
6218 point rounding behavior.  This is round-to-zero for all floating point
6219 to integer conversions, and round-to-nearest for all other arithmetic
6220 truncations.  This option should be specified for programs that change
6221 the FP rounding mode dynamically, or that may be executed with a
6222 non-default rounding mode.  This option disables constant folding of
6223 floating point expressions at compile-time (which may be affected by
6224 rounding mode) and arithmetic transformations that are unsafe in the
6225 presence of sign-dependent rounding modes.
6226
6227 The default is @option{-fno-rounding-math}.
6228
6229 This option is experimental and does not currently guarantee to
6230 disable all GCC optimizations that are affected by rounding mode.
6231 Future versions of GCC may provide finer control of this setting
6232 using C99's @code{FENV_ACCESS} pragma.  This command line option
6233 will be used to specify the default state for @code{FENV_ACCESS}.
6234
6235 @item -frtl-abstract-sequences
6236 @opindex frtl-abstract-sequences
6237 It is a size optimization method. This option is to find identical
6238 sequences of code, which can be turned into pseudo-procedures  and
6239 then  replace  all  occurrences with  calls to  the  newly created
6240 subroutine. It is kind of an opposite of @option{-finline-functions}.
6241 This optimization runs at RTL level.
6242
6243 @item -fsignaling-nans
6244 @opindex fsignaling-nans
6245 Compile code assuming that IEEE signaling NaNs may generate user-visible
6246 traps during floating-point operations.  Setting this option disables
6247 optimizations that may change the number of exceptions visible with
6248 signaling NaNs.  This option implies @option{-ftrapping-math}.
6249
6250 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
6251 be defined.
6252
6253 The default is @option{-fno-signaling-nans}.
6254
6255 This option is experimental and does not currently guarantee to
6256 disable all GCC optimizations that affect signaling NaN behavior.
6257
6258 @item -fsingle-precision-constant
6259 @opindex fsingle-precision-constant
6260 Treat floating point constant as single precision constant instead of
6261 implicitly converting it to double precision constant.
6262
6263 @item -fcx-limited-range
6264 @itemx -fno-cx-limited-range
6265 @opindex fcx-limited-range
6266 @opindex fno-cx-limited-range
6267 When enabled, this option states that a range reduction step is not
6268 needed when performing complex division.  The default is
6269 @option{-fno-cx-limited-range}, but is enabled by @option{-ffast-math}.
6270
6271 This option controls the default setting of the ISO C99
6272 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
6273 all languages.
6274
6275 @end table
6276
6277 The following options control optimizations that may improve
6278 performance, but are not enabled by any @option{-O} options.  This
6279 section includes experimental options that may produce broken code.
6280
6281 @table @gcctabopt
6282 @item -fbranch-probabilities
6283 @opindex fbranch-probabilities
6284 After running a program compiled with @option{-fprofile-arcs}
6285 (@pxref{Debugging Options,, Options for Debugging Your Program or
6286 @command{gcc}}), you can compile it a second time using
6287 @option{-fbranch-probabilities}, to improve optimizations based on
6288 the number of times each branch was taken.  When the program
6289 compiled with @option{-fprofile-arcs} exits it saves arc execution
6290 counts to a file called @file{@var{sourcename}.gcda} for each source
6291 file.  The information in this data file is very dependent on the
6292 structure of the generated code, so you must use the same source code
6293 and the same optimization options for both compilations.
6294
6295 With @option{-fbranch-probabilities}, GCC puts a
6296 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
6297 These can be used to improve optimization.  Currently, they are only
6298 used in one place: in @file{reorg.c}, instead of guessing which path a
6299 branch is mostly to take, the @samp{REG_BR_PROB} values are used to
6300 exactly determine which path is taken more often.
6301
6302 @item -fprofile-values
6303 @opindex fprofile-values
6304 If combined with @option{-fprofile-arcs}, it adds code so that some
6305 data about values of expressions in the program is gathered.
6306
6307 With @option{-fbranch-probabilities}, it reads back the data gathered
6308 from profiling values of expressions and adds @samp{REG_VALUE_PROFILE}
6309 notes to instructions for their later usage in optimizations.
6310
6311 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
6312
6313 @item -fvpt
6314 @opindex fvpt
6315 If combined with @option{-fprofile-arcs}, it instructs the compiler to add
6316 a code to gather information about values of expressions.
6317
6318 With @option{-fbranch-probabilities}, it reads back the data gathered
6319 and actually performs the optimizations based on them.
6320 Currently the optimizations include specialization of division operation
6321 using the knowledge about the value of the denominator.
6322
6323 @item -frename-registers
6324 @opindex frename-registers
6325 Attempt to avoid false dependencies in scheduled code by making use
6326 of registers left over after register allocation.  This optimization
6327 will most benefit processors with lots of registers.  Depending on the
6328 debug information format adopted by the target, however, it can
6329 make debugging impossible, since variables will no longer stay in
6330 a ``home register''.
6331
6332 Enabled by default with @option{-funroll-loops}.
6333
6334 @item -ftracer
6335 @opindex ftracer
6336 Perform tail duplication to enlarge superblock size.  This transformation
6337 simplifies the control flow of the function allowing other optimizations to do
6338 better job.
6339
6340 Enabled with @option{-fprofile-use}.
6341
6342 @item -funroll-loops
6343 @opindex funroll-loops
6344 Unroll loops whose number of iterations can be determined at compile time or
6345 upon entry to the loop.  @option{-funroll-loops} implies
6346 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
6347 It also turns on complete loop peeling (i.e.@: complete removal of loops with
6348 small constant number of iterations).  This option makes code larger, and may
6349 or may not make it run faster.
6350
6351 Enabled with @option{-fprofile-use}.
6352
6353 @item -funroll-all-loops
6354 @opindex funroll-all-loops
6355 Unroll all loops, even if their number of iterations is uncertain when
6356 the loop is entered.  This usually makes programs run more slowly.
6357 @option{-funroll-all-loops} implies the same options as
6358 @option{-funroll-loops}.
6359
6360 @item -fpeel-loops
6361 @opindex fpeel-loops
6362 Peels the loops for that there is enough information that they do not
6363 roll much (from profile feedback).  It also turns on complete loop peeling
6364 (i.e.@: complete removal of loops with small constant number of iterations).
6365
6366 Enabled with @option{-fprofile-use}.
6367
6368 @item -fmove-loop-invariants
6369 @opindex fmove-loop-invariants
6370 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
6371 at level @option{-O1}
6372
6373 @item -funswitch-loops
6374 @opindex funswitch-loops
6375 Move branches with loop invariant conditions out of the loop, with duplicates
6376 of the loop on both branches (modified according to result of the condition).
6377
6378 @item -ffunction-sections
6379 @itemx -fdata-sections
6380 @opindex ffunction-sections
6381 @opindex fdata-sections
6382 Place each function or data item into its own section in the output
6383 file if the target supports arbitrary sections.  The name of the
6384 function or the name of the data item determines the section's name
6385 in the output file.
6386
6387 Use these options on systems where the linker can perform optimizations
6388 to improve locality of reference in the instruction space.  Most systems
6389 using the ELF object format and SPARC processors running Solaris 2 have
6390 linkers with such optimizations.  AIX may have these optimizations in
6391 the future.
6392
6393 Only use these options when there are significant benefits from doing
6394 so.  When you specify these options, the assembler and linker will
6395 create larger object and executable files and will also be slower.
6396 You will not be able to use @code{gprof} on all systems if you
6397 specify this option and you may have problems with debugging if
6398 you specify both this option and @option{-g}.
6399
6400 @item -fbranch-target-load-optimize
6401 @opindex fbranch-target-load-optimize
6402 Perform branch target register load optimization before prologue / epilogue
6403 threading.
6404 The use of target registers can typically be exposed only during reload,
6405 thus hoisting loads out of loops and doing inter-block scheduling needs
6406 a separate optimization pass.
6407
6408 @item -fbranch-target-load-optimize2
6409 @opindex fbranch-target-load-optimize2
6410 Perform branch target register load optimization after prologue / epilogue
6411 threading.
6412
6413 @item -fbtr-bb-exclusive
6414 @opindex fbtr-bb-exclusive
6415 When performing branch target register load optimization, don't reuse
6416 branch target registers in within any basic block.
6417
6418 @item -fstack-protector
6419 Emit extra code to check for buffer overflows, such as stack smashing
6420 attacks.  This is done by adding a guard variable to functions with
6421 vulnerable objects.  This includes functions that call alloca, and
6422 functions with buffers larger than 8 bytes.  The guards are initialized
6423 when a function is entered and then checked when the function exits.
6424 If a guard check fails, an error message is printed and the program exits.
6425
6426 @item -fstack-protector-all
6427 Like @option{-fstack-protector} except that all functions are protected.
6428
6429 @item -fsection-anchors
6430 @opindex fsection-anchors
6431 Try to reduce the number of symbolic address calculations by using
6432 shared ``anchor'' symbols to address nearby objects.  This transformation
6433 can help to reduce the number of GOT entries and GOT accesses on some
6434 targets.
6435
6436 For example, the implementation of the following function @code{foo}:
6437
6438 @smallexample
6439 static int a, b, c;
6440 int foo (void) @{ return a + b + c; @}
6441 @end smallexample
6442
6443 would usually calculate the addresses of all three variables, but if you
6444 compile it with @option{-fsection-anchors}, it will access the variables
6445 from a common anchor point instead.  The effect is similar to the
6446 following pseudocode (which isn't valid C):
6447
6448 @smallexample
6449 int foo (void)
6450 @{
6451   register int *xr = &x;
6452   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
6453 @}
6454 @end smallexample
6455
6456 Not all targets support this option.
6457
6458 @item --param @var{name}=@var{value}
6459 @opindex param
6460 In some places, GCC uses various constants to control the amount of
6461 optimization that is done.  For example, GCC will not inline functions
6462 that contain more that a certain number of instructions.  You can
6463 control some of these constants on the command-line using the
6464 @option{--param} option.
6465
6466 The names of specific parameters, and the meaning of the values, are
6467 tied to the internals of the compiler, and are subject to change
6468 without notice in future releases.
6469
6470 In each case, the @var{value} is an integer.  The allowable choices for
6471 @var{name} are given in the following table:
6472
6473 @table @gcctabopt
6474 @item salias-max-implicit-fields
6475 The maximum number of fields in a variable without direct
6476 structure accesses for which structure aliasing will consider trying
6477 to track each field.  The default is 5
6478
6479 @item salias-max-array-elements
6480 The maximum number of elements an array can have and its elements
6481 still be tracked individually by structure aliasing. The default is 4
6482
6483 @item sra-max-structure-size
6484 The maximum structure size, in bytes, at which the scalar replacement
6485 of aggregates (SRA) optimization will perform block copies.  The
6486 default value, 0, implies that GCC will select the most appropriate
6487 size itself.
6488
6489 @item sra-field-structure-ratio
6490 The threshold ratio (as a percentage) between instantiated fields and
6491 the complete structure size.  We say that if the ratio of the number
6492 of bytes in instantiated fields to the number of bytes in the complete
6493 structure exceeds this parameter, then block copies are not used.  The
6494 default is 75.
6495
6496 @item max-crossjump-edges
6497 The maximum number of incoming edges to consider for crossjumping.
6498 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
6499 the number of edges incoming to each block.  Increasing values mean
6500 more aggressive optimization, making the compile time increase with
6501 probably small improvement in executable size.
6502
6503 @item min-crossjump-insns
6504 The minimum number of instructions which must be matched at the end
6505 of two blocks before crossjumping will be performed on them.  This
6506 value is ignored in the case where all instructions in the block being
6507 crossjumped from are matched.  The default value is 5.
6508
6509 @item max-grow-copy-bb-insns
6510 The maximum code size expansion factor when copying basic blocks
6511 instead of jumping.  The expansion is relative to a jump instruction.
6512 The default value is 8.
6513
6514 @item max-goto-duplication-insns
6515 The maximum number of instructions to duplicate to a block that jumps
6516 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
6517 passes, GCC factors computed gotos early in the compilation process,
6518 and unfactors them as late as possible.  Only computed jumps at the
6519 end of a basic blocks with no more than max-goto-duplication-insns are
6520 unfactored.  The default value is 8.
6521
6522 @item max-delay-slot-insn-search
6523 The maximum number of instructions to consider when looking for an
6524 instruction to fill a delay slot.  If more than this arbitrary number of
6525 instructions is searched, the time savings from filling the delay slot
6526 will be minimal so stop searching.  Increasing values mean more
6527 aggressive optimization, making the compile time increase with probably
6528 small improvement in executable run time.
6529
6530 @item max-delay-slot-live-search
6531 When trying to fill delay slots, the maximum number of instructions to
6532 consider when searching for a block with valid live register
6533 information.  Increasing this arbitrarily chosen value means more
6534 aggressive optimization, increasing the compile time.  This parameter
6535 should be removed when the delay slot code is rewritten to maintain the
6536 control-flow graph.
6537
6538 @item max-gcse-memory
6539 The approximate maximum amount of memory that will be allocated in
6540 order to perform the global common subexpression elimination
6541 optimization.  If more memory than specified is required, the
6542 optimization will not be done.
6543
6544 @item max-gcse-passes
6545 The maximum number of passes of GCSE to run.  The default is 1.
6546
6547 @item max-pending-list-length
6548 The maximum number of pending dependencies scheduling will allow
6549 before flushing the current state and starting over.  Large functions
6550 with few branches or calls can create excessively large lists which
6551 needlessly consume memory and resources.
6552
6553 @item max-inline-insns-single
6554 Several parameters control the tree inliner used in gcc.
6555 This number sets the maximum number of instructions (counted in GCC's
6556 internal representation) in a single function that the tree inliner
6557 will consider for inlining.  This only affects functions declared
6558 inline and methods implemented in a class declaration (C++).
6559 The default value is 450.
6560
6561 @item max-inline-insns-auto
6562 When you use @option{-finline-functions} (included in @option{-O3}),
6563 a lot of functions that would otherwise not be considered for inlining
6564 by the compiler will be investigated.  To those functions, a different
6565 (more restrictive) limit compared to functions declared inline can
6566 be applied.
6567 The default value is 90.
6568
6569 @item large-function-insns
6570 The limit specifying really large functions.  For functions larger than this
6571 limit after inlining inlining is constrained by
6572 @option{--param large-function-growth}.  This parameter is useful primarily
6573 to avoid extreme compilation time caused by non-linear algorithms used by the
6574 backend.
6575 This parameter is ignored when @option{-funit-at-a-time} is not used.
6576 The default value is 2700.
6577
6578 @item large-function-growth
6579 Specifies maximal growth of large function caused by inlining in percents.
6580 This parameter is ignored when @option{-funit-at-a-time} is not used.
6581 The default value is 100 which limits large function growth to 2.0 times
6582 the original size.
6583
6584 @item large-unit-insns
6585 The limit specifying large translation unit.  Growth caused by inlining of
6586 units larger than this limit is limited by @option{--param inline-unit-growth}.
6587 For small units this might be too tight (consider unit consisting of function A
6588 that is inline and B that just calls A three time.  If B is small relative to
6589 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
6590 large units consisting of small inlininable functions however the overall unit
6591 growth limit is needed to avoid exponential explosion of code size.  Thus for
6592 smaller units, the size is increased to @option{--param large-unit-insns}
6593 before applying @option{--param inline-unit-growth}.  The default is 10000
6594
6595 @item inline-unit-growth
6596 Specifies maximal overall growth of the compilation unit caused by inlining.
6597 This parameter is ignored when @option{-funit-at-a-time} is not used.
6598 The default value is 30 which limits unit growth to 1.3 times the original
6599 size.
6600
6601 @item large-stack-frame
6602 The limit specifying large stack frames.  While inlining the algorithm is trying
6603 to not grow past this limit too much.  Default value is 256 bytes.
6604
6605 @item large-stack-frame-growth
6606 Specifies maximal growth of large stack frames caused by inlining in percents.
6607 The default value is 1000 which limits large stack frame growth to 11 times
6608 the original size.
6609
6610 @item max-inline-insns-recursive
6611 @itemx max-inline-insns-recursive-auto
6612 Specifies maximum number of instructions out-of-line copy of self recursive inline
6613 function can grow into by performing recursive inlining.
6614
6615 For functions declared inline @option{--param max-inline-insns-recursive} is
6616 taken into account.  For function not declared inline, recursive inlining
6617 happens only when @option{-finline-functions} (included in @option{-O3}) is
6618 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
6619 default value is 450.
6620
6621 @item max-inline-recursive-depth
6622 @itemx max-inline-recursive-depth-auto
6623 Specifies maximum recursion depth used by the recursive inlining.
6624
6625 For functions declared inline @option{--param max-inline-recursive-depth} is
6626 taken into account.  For function not declared inline, recursive inlining
6627 happens only when @option{-finline-functions} (included in @option{-O3}) is
6628 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
6629 default value is 450.
6630
6631 @item min-inline-recursive-probability
6632 Recursive inlining is profitable only for function having deep recursion
6633 in average and can hurt for function having little recursion depth by
6634 increasing the prologue size or complexity of function body to other
6635 optimizers.
6636
6637 When profile feedback is available (see @option{-fprofile-generate}) the actual
6638 recursion depth can be guessed from probability that function will recurse via
6639 given call expression.  This parameter limits inlining only to call expression
6640 whose probability exceeds given threshold (in percents).  The default value is
6641 10.
6642
6643 @item inline-call-cost
6644 Specify cost of call instruction relative to simple arithmetics operations
6645 (having cost of 1).  Increasing this cost disqualifies inlining of non-leaf
6646 functions and at the same time increases size of leaf function that is believed to
6647 reduce function size by being inlined.  In effect it increases amount of
6648 inlining for code having large abstraction penalty (many functions that just
6649 pass the arguments to other functions) and decrease inlining for code with low
6650 abstraction penalty.  The default value is 16.
6651
6652 @item min-vect-loop-bound
6653 The minimum number of iterations under which a loop will not get vectorized
6654 when @option{-ftree-vectorize} is used.  The number of iterations after
6655 vectorization needs to be greater than the value specified by this option
6656 to allow vectorization.  The default value is 0.
6657
6658 @item max-unrolled-insns
6659 The maximum number of instructions that a loop should have if that loop
6660 is unrolled, and if the loop is unrolled, it determines how many times
6661 the loop code is unrolled.
6662
6663 @item max-average-unrolled-insns
6664 The maximum number of instructions biased by probabilities of their execution
6665 that a loop should have if that loop is unrolled, and if the loop is unrolled,
6666 it determines how many times the loop code is unrolled.
6667
6668 @item max-unroll-times
6669 The maximum number of unrollings of a single loop.
6670
6671 @item max-peeled-insns
6672 The maximum number of instructions that a loop should have if that loop
6673 is peeled, and if the loop is peeled, it determines how many times
6674 the loop code is peeled.
6675
6676 @item max-peel-times
6677 The maximum number of peelings of a single loop.
6678
6679 @item max-completely-peeled-insns
6680 The maximum number of insns of a completely peeled loop.
6681
6682 @item max-completely-peel-times
6683 The maximum number of iterations of a loop to be suitable for complete peeling.
6684
6685 @item max-unswitch-insns
6686 The maximum number of insns of an unswitched loop.
6687
6688 @item max-unswitch-level
6689 The maximum number of branches unswitched in a single loop.
6690
6691 @item lim-expensive
6692 The minimum cost of an expensive expression in the loop invariant motion.
6693
6694 @item iv-consider-all-candidates-bound
6695 Bound on number of candidates for induction variables below that
6696 all candidates are considered for each use in induction variable
6697 optimizations.  Only the most relevant candidates are considered
6698 if there are more candidates, to avoid quadratic time complexity.
6699
6700 @item iv-max-considered-uses
6701 The induction variable optimizations give up on loops that contain more
6702 induction variable uses.
6703
6704 @item iv-always-prune-cand-set-bound
6705 If number of candidates in the set is smaller than this value,
6706 we always try to remove unnecessary ivs from the set during its
6707 optimization when a new iv is added to the set.
6708
6709 @item scev-max-expr-size
6710 Bound on size of expressions used in the scalar evolutions analyzer.
6711 Large expressions slow the analyzer.
6712
6713 @item omega-max-vars
6714 The maximum number of variables in an Omega constraint system.
6715 The default value is 128.
6716
6717 @item omega-max-geqs
6718 The maximum number of inequalities in an Omega constraint system.
6719 The default value is 256.
6720
6721 @item omega-max-eqs
6722 The maximum number of equalities in an Omega constraint system.
6723 The default value is 128.
6724
6725 @item omega-max-wild-cards
6726 The maximum number of wildcard variables that the Omega solver will
6727 be able to insert.  The default value is 18.
6728
6729 @item omega-hash-table-size
6730 The size of the hash table in the Omega solver.  The default value is
6731 550.
6732
6733 @item omega-max-keys
6734 The maximal number of keys used by the Omega solver.  The default
6735 value is 500.
6736
6737 @item omega-eliminate-redundant-constraints
6738 When set to 1, use expensive methods to eliminate all redundant
6739 constraints.  The default value is 0.
6740
6741 @item vect-max-version-checks
6742 The maximum number of runtime checks that can be performed when doing
6743 loop versioning in the vectorizer.  See option ftree-vect-loop-version
6744 for more information.
6745
6746 @item max-iterations-to-track
6747
6748 The maximum number of iterations of a loop the brute force algorithm
6749 for analysis of # of iterations of the loop tries to evaluate.
6750
6751 @item hot-bb-count-fraction
6752 Select fraction of the maximal count of repetitions of basic block in program
6753 given basic block needs to have to be considered hot.
6754
6755 @item hot-bb-frequency-fraction
6756 Select fraction of the maximal frequency of executions of basic block in
6757 function given basic block needs to have to be considered hot
6758
6759 @item max-predicted-iterations
6760 The maximum number of loop iterations we predict statically.  This is useful
6761 in cases where function contain single loop with known bound and other loop
6762 with unknown.  We predict the known number of iterations correctly, while
6763 the unknown number of iterations average to roughly 10.  This means that the
6764 loop without bounds would appear artificially cold relative to the other one.
6765
6766 @item tracer-dynamic-coverage
6767 @itemx tracer-dynamic-coverage-feedback
6768
6769 This value is used to limit superblock formation once the given percentage of
6770 executed instructions is covered.  This limits unnecessary code size
6771 expansion.
6772
6773 The @option{tracer-dynamic-coverage-feedback} is used only when profile
6774 feedback is available.  The real profiles (as opposed to statically estimated
6775 ones) are much less balanced allowing the threshold to be larger value.
6776
6777 @item tracer-max-code-growth
6778 Stop tail duplication once code growth has reached given percentage.  This is
6779 rather hokey argument, as most of the duplicates will be eliminated later in
6780 cross jumping, so it may be set to much higher values than is the desired code
6781 growth.
6782
6783 @item tracer-min-branch-ratio
6784
6785 Stop reverse growth when the reverse probability of best edge is less than this
6786 threshold (in percent).
6787
6788 @item tracer-min-branch-ratio
6789 @itemx tracer-min-branch-ratio-feedback
6790
6791 Stop forward growth if the best edge do have probability lower than this
6792 threshold.
6793
6794 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
6795 compilation for profile feedback and one for compilation without.  The value
6796 for compilation with profile feedback needs to be more conservative (higher) in
6797 order to make tracer effective.
6798
6799 @item max-cse-path-length
6800
6801 Maximum number of basic blocks on path that cse considers.  The default is 10.
6802
6803 @item max-cse-insns
6804 The maximum instructions CSE process before flushing. The default is 1000.
6805
6806 @item max-aliased-vops
6807
6808 Maximum number of virtual operands per function allowed to represent
6809 aliases before triggering the alias partitioning heuristic.  Alias
6810 partitioning reduces compile times and memory consumption needed for
6811 aliasing at the expense of precision loss in alias information.  The
6812 default value for this parameter is 100 for -O1, 500 for -O2 and 1000
6813 for -O3.
6814
6815 Notice that if a function contains more memory statements than the
6816 value of this parameter, it is not really possible to achieve this
6817 reduction.  In this case, the compiler will use the number of memory
6818 statements as the value for @option{max-aliased-vops}.
6819
6820 @item avg-aliased-vops
6821
6822 Average number of virtual operands per statement allowed to represent
6823 aliases before triggering the alias partitioning heuristic.  This
6824 works in conjunction with @option{max-aliased-vops}.  If a function
6825 contains more than @option{max-aliased-vops} virtual operators, then
6826 memory symbols will be grouped into memory partitions until either the
6827 total number of virtual operators is below @option{max-aliased-vops}
6828 or the average number of virtual operators per memory statement is
6829 below @option{avg-aliased-vops}.  The default value for this parameter
6830 is 1 for -O1 and -O2, and 3 for -O3.
6831
6832 @item ggc-min-expand
6833
6834 GCC uses a garbage collector to manage its own memory allocation.  This
6835 parameter specifies the minimum percentage by which the garbage
6836 collector's heap should be allowed to expand between collections.
6837 Tuning this may improve compilation speed; it has no effect on code
6838 generation.
6839
6840 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
6841 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of "RAM" is
6842 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
6843 GCC is not able to calculate RAM on a particular platform, the lower
6844 bound of 30% is used.  Setting this parameter and
6845 @option{ggc-min-heapsize} to zero causes a full collection to occur at
6846 every opportunity.  This is extremely slow, but can be useful for
6847 debugging.
6848
6849 @item ggc-min-heapsize
6850
6851 Minimum size of the garbage collector's heap before it begins bothering
6852 to collect garbage.  The first collection occurs after the heap expands
6853 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
6854 tuning this may improve compilation speed, and has no effect on code
6855 generation.
6856
6857 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit which
6858 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
6859 with a lower bound of 4096 (four megabytes) and an upper bound of
6860 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
6861 particular platform, the lower bound is used.  Setting this parameter
6862 very large effectively disables garbage collection.  Setting this
6863 parameter and @option{ggc-min-expand} to zero causes a full collection
6864 to occur at every opportunity.
6865
6866 @item max-reload-search-insns
6867 The maximum number of instruction reload should look backward for equivalent
6868 register.  Increasing values mean more aggressive optimization, making the
6869 compile time increase with probably slightly better performance.  The default
6870 value is 100.
6871
6872 @item max-cselib-memory-locations
6873 The maximum number of memory locations cselib should take into account.
6874 Increasing values mean more aggressive optimization, making the compile time
6875 increase with probably slightly better performance.  The default value is 500.
6876
6877 @item max-flow-memory-locations
6878 Similar as @option{max-cselib-memory-locations} but for dataflow liveness.
6879 The default value is 100.
6880
6881 @item reorder-blocks-duplicate
6882 @itemx reorder-blocks-duplicate-feedback
6883
6884 Used by basic block reordering pass to decide whether to use unconditional
6885 branch or duplicate the code on its destination.  Code is duplicated when its
6886 estimated size is smaller than this value multiplied by the estimated size of
6887 unconditional jump in the hot spots of the program.
6888
6889 The @option{reorder-block-duplicate-feedback} is used only when profile
6890 feedback is available and may be set to higher values than
6891 @option{reorder-block-duplicate} since information about the hot spots is more
6892 accurate.
6893
6894 @item max-sched-ready-insns
6895 The maximum number of instructions ready to be issued the scheduler should
6896 consider at any given time during the first scheduling pass.  Increasing
6897 values mean more thorough searches, making the compilation time increase
6898 with probably little benefit.  The default value is 100.
6899
6900 @item max-sched-region-blocks
6901 The maximum number of blocks in a region to be considered for
6902 interblock scheduling.  The default value is 10.
6903
6904 @item max-sched-region-insns
6905 The maximum number of insns in a region to be considered for
6906 interblock scheduling.  The default value is 100.
6907
6908 @item min-spec-prob
6909 The minimum probability (in percents) of reaching a source block
6910 for interblock speculative scheduling.  The default value is 40.
6911
6912 @item max-sched-extend-regions-iters
6913 The maximum number of iterations through CFG to extend regions.
6914 0 - disable region extension,
6915 N - do at most N iterations.
6916 The default value is 0.
6917
6918 @item max-sched-insn-conflict-delay
6919 The maximum conflict delay for an insn to be considered for speculative motion.
6920 The default value is 3.
6921
6922 @item sched-spec-prob-cutoff
6923 The minimal probability of speculation success (in percents), so that
6924 speculative insn will be scheduled.
6925 The default value is 40.
6926
6927 @item max-last-value-rtl
6928
6929 The maximum size measured as number of RTLs that can be recorded in an expression
6930 in combiner for a pseudo register as last known value of that register.  The default
6931 is 10000.
6932
6933 @item integer-share-limit
6934 Small integer constants can use a shared data structure, reducing the
6935 compiler's memory usage and increasing its speed.  This sets the maximum
6936 value of a shared integer constant's.  The default value is 256.
6937
6938 @item min-virtual-mappings
6939 Specifies the minimum number of virtual mappings in the incremental
6940 SSA updater that should be registered to trigger the virtual mappings
6941 heuristic defined by virtual-mappings-ratio.  The default value is
6942 100.
6943
6944 @item virtual-mappings-ratio
6945 If the number of virtual mappings is virtual-mappings-ratio bigger
6946 than the number of virtual symbols to be updated, then the incremental
6947 SSA updater switches to a full update for those symbols.  The default
6948 ratio is 3.
6949
6950 @item ssp-buffer-size
6951 The minimum size of buffers (i.e. arrays) that will receive stack smashing
6952 protection when @option{-fstack-protection} is used.
6953
6954 @item max-jump-thread-duplication-stmts
6955 Maximum number of statements allowed in a block that needs to be
6956 duplicated when threading jumps.
6957
6958 @item max-fields-for-field-sensitive
6959 Maximum number of fields in a structure we will treat in
6960 a field sensitive manner during pointer analysis.
6961
6962 @item prefetch-latency
6963 Estimate on average number of instructions that are executed before
6964 prefetch finishes.  The distance we prefetch ahead is proportional
6965 to this constant.  Increasing this number may also lead to less
6966 streams being prefetched (see @option{simultaneous-prefetches}).
6967
6968 @item simultaneous-prefetches
6969 Maximum number of prefetches that can run at the same time.
6970
6971 @item l1-cache-line-size
6972 The size of cache line in L1 cache, in bytes.
6973
6974 @item l1-cache-size
6975 The size of L1 cache, in kilobytes.
6976
6977 @item l2-cache-size
6978 The size of L2 cache, in kilobytes.
6979
6980 @item use-canonical-types
6981 Whether the compiler should use the ``canonical'' type system.  By
6982 default, this should always be 1, which uses a more efficient internal
6983 mechanism for comparing types in C++ and Objective-C++.  However, if
6984 bugs in the canonical type system are causing compilation failures,
6985 set this value to 0 to disable canonical types.
6986
6987 @end table
6988 @end table
6989
6990 @node Preprocessor Options
6991 @section Options Controlling the Preprocessor
6992 @cindex preprocessor options
6993 @cindex options, preprocessor
6994
6995 These options control the C preprocessor, which is run on each C source
6996 file before actual compilation.
6997
6998 If you use the @option{-E} option, nothing is done except preprocessing.
6999 Some of these options make sense only together with @option{-E} because
7000 they cause the preprocessor output to be unsuitable for actual
7001 compilation.
7002
7003 @table @gcctabopt
7004 @opindex Wp
7005 You can use @option{-Wp,@var{option}} to bypass the compiler driver
7006 and pass @var{option} directly through to the preprocessor.  If
7007 @var{option} contains commas, it is split into multiple options at the
7008 commas.  However, many options are modified, translated or interpreted
7009 by the compiler driver before being passed to the preprocessor, and
7010 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
7011 interface is undocumented and subject to change, so whenever possible
7012 you should avoid using @option{-Wp} and let the driver handle the
7013 options instead.
7014
7015 @item -Xpreprocessor @var{option}
7016 @opindex preprocessor
7017 Pass @var{option} as an option to the preprocessor.  You can use this to
7018 supply system-specific preprocessor options which GCC does not know how to
7019 recognize.
7020
7021 If you want to pass an option that takes an argument, you must use
7022 @option{-Xpreprocessor} twice, once for the option and once for the argument.
7023 @end table
7024
7025 @include cppopts.texi
7026
7027 @node Assembler Options
7028 @section Passing Options to the Assembler
7029
7030 @c prevent bad page break with this line
7031 You can pass options to the assembler.
7032
7033 @table @gcctabopt
7034 @item -Wa,@var{option}
7035 @opindex Wa
7036 Pass @var{option} as an option to the assembler.  If @var{option}
7037 contains commas, it is split into multiple options at the commas.
7038
7039 @item -Xassembler @var{option}
7040 @opindex Xassembler
7041 Pass @var{option} as an option to the assembler.  You can use this to
7042 supply system-specific assembler options which GCC does not know how to
7043 recognize.
7044
7045 If you want to pass an option that takes an argument, you must use
7046 @option{-Xassembler} twice, once for the option and once for the argument.
7047
7048 @end table
7049
7050 @node Link Options
7051 @section Options for Linking
7052 @cindex link options
7053 @cindex options, linking
7054
7055 These options come into play when the compiler links object files into
7056 an executable output file.  They are meaningless if the compiler is
7057 not doing a link step.
7058
7059 @table @gcctabopt
7060 @cindex file names
7061 @item @var{object-file-name}
7062 A file name that does not end in a special recognized suffix is
7063 considered to name an object file or library.  (Object files are
7064 distinguished from libraries by the linker according to the file
7065 contents.)  If linking is done, these object files are used as input
7066 to the linker.
7067
7068 @item -c
7069 @itemx -S
7070 @itemx -E
7071 @opindex c
7072 @opindex S
7073 @opindex E
7074 If any of these options is used, then the linker is not run, and
7075 object file names should not be used as arguments.  @xref{Overall
7076 Options}.
7077
7078 @cindex Libraries
7079 @item -l@var{library}
7080 @itemx -l @var{library}
7081 @opindex l
7082 Search the library named @var{library} when linking.  (The second
7083 alternative with the library as a separate argument is only for
7084 POSIX compliance and is not recommended.)
7085
7086 It makes a difference where in the command you write this option; the
7087 linker searches and processes libraries and object files in the order they
7088 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
7089 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
7090 to functions in @samp{z}, those functions may not be loaded.
7091
7092 The linker searches a standard list of directories for the library,
7093 which is actually a file named @file{lib@var{library}.a}.  The linker
7094 then uses this file as if it had been specified precisely by name.
7095
7096 The directories searched include several standard system directories
7097 plus any that you specify with @option{-L}.
7098
7099 Normally the files found this way are library files---archive files
7100 whose members are object files.  The linker handles an archive file by
7101 scanning through it for members which define symbols that have so far
7102 been referenced but not defined.  But if the file that is found is an
7103 ordinary object file, it is linked in the usual fashion.  The only
7104 difference between using an @option{-l} option and specifying a file name
7105 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
7106 and searches several directories.
7107
7108 @item -lobjc
7109 @opindex lobjc
7110 You need this special case of the @option{-l} option in order to
7111 link an Objective-C or Objective-C++ program.
7112
7113 @item -nostartfiles
7114 @opindex nostartfiles
7115 Do not use the standard system startup files when linking.
7116 The standard system libraries are used normally, unless @option{-nostdlib}
7117 or @option{-nodefaultlibs} is used.
7118
7119 @item -nodefaultlibs
7120 @opindex nodefaultlibs
7121 Do not use the standard system libraries when linking.
7122 Only the libraries you specify will be passed to the linker.
7123 The standard startup files are used normally, unless @option{-nostartfiles}
7124 is used.  The compiler may generate calls to @code{memcmp},
7125 @code{memset}, @code{memcpy} and @code{memmove}.
7126 These entries are usually resolved by entries in
7127 libc.  These entry points should be supplied through some other
7128 mechanism when this option is specified.
7129
7130 @item -nostdlib
7131 @opindex nostdlib
7132 Do not use the standard system startup files or libraries when linking.
7133 No startup files and only the libraries you specify will be passed to
7134 the linker.  The compiler may generate calls to @code{memcmp}, @code{memset},
7135 @code{memcpy} and @code{memmove}.
7136 These entries are usually resolved by entries in
7137 libc.  These entry points should be supplied through some other
7138 mechanism when this option is specified.
7139
7140 @cindex @option{-lgcc}, use with @option{-nostdlib}
7141 @cindex @option{-nostdlib} and unresolved references
7142 @cindex unresolved references and @option{-nostdlib}
7143 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
7144 @cindex @option{-nodefaultlibs} and unresolved references
7145 @cindex unresolved references and @option{-nodefaultlibs}
7146 One of the standard libraries bypassed by @option{-nostdlib} and
7147 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
7148 that GCC uses to overcome shortcomings of particular machines, or special
7149 needs for some languages.
7150 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
7151 Collection (GCC) Internals},
7152 for more discussion of @file{libgcc.a}.)
7153 In most cases, you need @file{libgcc.a} even when you want to avoid
7154 other standard libraries.  In other words, when you specify @option{-nostdlib}
7155 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
7156 This ensures that you have no unresolved references to internal GCC
7157 library subroutines.  (For example, @samp{__main}, used to ensure C++
7158 constructors will be called; @pxref{Collect2,,@code{collect2}, gccint,
7159 GNU Compiler Collection (GCC) Internals}.)
7160
7161 @item -pie
7162 @opindex pie
7163 Produce a position independent executable on targets which support it.
7164 For predictable results, you must also specify the same set of options
7165 that were used to generate code (@option{-fpie}, @option{-fPIE},
7166 or model suboptions) when you specify this option.
7167
7168 @item -rdynamic
7169 @opindex rdynamic
7170 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
7171 that support it. This instructs the linker to add all symbols, not
7172 only used ones, to the dynamic symbol table. This option is needed
7173 for some uses of @code{dlopen} or to allow obtaining backtraces
7174 from within a program.
7175
7176 @item -s
7177 @opindex s
7178 Remove all symbol table and relocation information from the executable.
7179
7180 @item -static
7181 @opindex static
7182 On systems that support dynamic linking, this prevents linking with the shared
7183 libraries.  On other systems, this option has no effect.
7184
7185 @item -shared
7186 @opindex shared
7187 Produce a shared object which can then be linked with other objects to
7188 form an executable.  Not all systems support this option.  For predictable
7189 results, you must also specify the same set of options that were used to
7190 generate code (@option{-fpic}, @option{-fPIC}, or model suboptions)
7191 when you specify this option.@footnote{On some systems, @samp{gcc -shared}
7192 needs to build supplementary stub code for constructors to work.  On
7193 multi-libbed systems, @samp{gcc -shared} must select the correct support
7194 libraries to link against.  Failing to supply the correct flags may lead
7195 to subtle defects.  Supplying them in cases where they are not necessary
7196 is innocuous.}
7197
7198 @item -shared-libgcc
7199 @itemx -static-libgcc
7200 @opindex shared-libgcc
7201 @opindex static-libgcc
7202 On systems that provide @file{libgcc} as a shared library, these options
7203 force the use of either the shared or static version respectively.
7204 If no shared version of @file{libgcc} was built when the compiler was
7205 configured, these options have no effect.
7206
7207 There are several situations in which an application should use the
7208 shared @file{libgcc} instead of the static version.  The most common
7209 of these is when the application wishes to throw and catch exceptions
7210 across different shared libraries.  In that case, each of the libraries
7211 as well as the application itself should use the shared @file{libgcc}.
7212
7213 Therefore, the G++ and GCJ drivers automatically add
7214 @option{-shared-libgcc} whenever you build a shared library or a main
7215 executable, because C++ and Java programs typically use exceptions, so
7216 this is the right thing to do.
7217
7218 If, instead, you use the GCC driver to create shared libraries, you may
7219 find that they will not always be linked with the shared @file{libgcc}.
7220 If GCC finds, at its configuration time, that you have a non-GNU linker
7221 or a GNU linker that does not support option @option{--eh-frame-hdr},
7222 it will link the shared version of @file{libgcc} into shared libraries
7223 by default.  Otherwise, it will take advantage of the linker and optimize
7224 away the linking with the shared version of @file{libgcc}, linking with
7225 the static version of libgcc by default.  This allows exceptions to
7226 propagate through such shared libraries, without incurring relocation
7227 costs at library load time.
7228
7229 However, if a library or main executable is supposed to throw or catch
7230 exceptions, you must link it using the G++ or GCJ driver, as appropriate
7231 for the languages used in the program, or using the option
7232 @option{-shared-libgcc}, such that it is linked with the shared
7233 @file{libgcc}.
7234
7235 @item -symbolic
7236 @opindex symbolic
7237 Bind references to global symbols when building a shared object.  Warn
7238 about any unresolved references (unless overridden by the link editor
7239 option @samp{-Xlinker -z -Xlinker defs}).  Only a few systems support
7240 this option.
7241
7242 @item -Xlinker @var{option}
7243 @opindex Xlinker
7244 Pass @var{option} as an option to the linker.  You can use this to
7245 supply system-specific linker options which GCC does not know how to
7246 recognize.
7247
7248 If you want to pass an option that takes an argument, you must use
7249 @option{-Xlinker} twice, once for the option and once for the argument.
7250 For example, to pass @option{-assert definitions}, you must write
7251 @samp{-Xlinker -assert -Xlinker definitions}.  It does not work to write
7252 @option{-Xlinker "-assert definitions"}, because this passes the entire
7253 string as a single argument, which is not what the linker expects.
7254
7255 @item -Wl,@var{option}
7256 @opindex Wl
7257 Pass @var{option} as an option to the linker.  If @var{option} contains
7258 commas, it is split into multiple options at the commas.
7259
7260 @item -u @var{symbol}
7261 @opindex u
7262 Pretend the symbol @var{symbol} is undefined, to force linking of
7263 library modules to define it.  You can use @option{-u} multiple times with
7264 different symbols to force loading of additional library modules.
7265 @end table
7266
7267 @node Directory Options
7268 @section Options for Directory Search
7269 @cindex directory options
7270 @cindex options, directory search
7271 @cindex search path
7272
7273 These options specify directories to search for header files, for
7274 libraries and for parts of the compiler:
7275
7276 @table @gcctabopt
7277 @item -I@var{dir}
7278 @opindex I
7279 Add the directory @var{dir} to the head of the list of directories to be
7280 searched for header files.  This can be used to override a system header
7281 file, substituting your own version, since these directories are
7282 searched before the system header file directories.  However, you should
7283 not use this option to add directories that contain vendor-supplied
7284 system header files (use @option{-isystem} for that).  If you use more than
7285 one @option{-I} option, the directories are scanned in left-to-right
7286 order; the standard system directories come after.
7287
7288 If a standard system include directory, or a directory specified with
7289 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
7290 option will be ignored.  The directory will still be searched but as a
7291 system directory at its normal position in the system include chain.
7292 This is to ensure that GCC's procedure to fix buggy system headers and
7293 the ordering for the include_next directive are not inadvertently changed.
7294 If you really need to change the search order for system directories,
7295 use the @option{-nostdinc} and/or @option{-isystem} options.
7296
7297 @item -iquote@var{dir}
7298 @opindex iquote
7299 Add the directory @var{dir} to the head of the list of directories to
7300 be searched for header files only for the case of @samp{#include
7301 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
7302 otherwise just like @option{-I}.
7303
7304 @item -L@var{dir}
7305 @opindex L
7306 Add directory @var{dir} to the list of directories to be searched
7307 for @option{-l}.
7308
7309 @item -B@var{prefix}
7310 @opindex B
7311 This option specifies where to find the executables, libraries,
7312 include files, and data files of the compiler itself.
7313
7314 The compiler driver program runs one or more of the subprograms
7315 @file{cpp}, @file{cc1}, @file{as} and @file{ld}.  It tries
7316 @var{prefix} as a prefix for each program it tries to run, both with and
7317 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
7318
7319 For each subprogram to be run, the compiler driver first tries the
7320 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
7321 was not specified, the driver tries two standard prefixes, which are
7322 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
7323 those results in a file name that is found, the unmodified program
7324 name is searched for using the directories specified in your
7325 @env{PATH} environment variable.
7326
7327 The compiler will check to see if the path provided by the @option{-B}
7328 refers to a directory, and if necessary it will add a directory
7329 separator character at the end of the path.
7330
7331 @option{-B} prefixes that effectively specify directory names also apply
7332 to libraries in the linker, because the compiler translates these
7333 options into @option{-L} options for the linker.  They also apply to
7334 includes files in the preprocessor, because the compiler translates these
7335 options into @option{-isystem} options for the preprocessor.  In this case,
7336 the compiler appends @samp{include} to the prefix.
7337
7338 The run-time support file @file{libgcc.a} can also be searched for using
7339 the @option{-B} prefix, if needed.  If it is not found there, the two
7340 standard prefixes above are tried, and that is all.  The file is left
7341 out of the link if it is not found by those means.
7342
7343 Another way to specify a prefix much like the @option{-B} prefix is to use
7344 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
7345 Variables}.
7346
7347 As a special kludge, if the path provided by @option{-B} is
7348 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
7349 9, then it will be replaced by @file{[dir/]include}.  This is to help
7350 with boot-strapping the compiler.
7351
7352 @item -specs=@var{file}
7353 @opindex specs
7354 Process @var{file} after the compiler reads in the standard @file{specs}
7355 file, in order to override the defaults that the @file{gcc} driver
7356 program uses when determining what switches to pass to @file{cc1},
7357 @file{cc1plus}, @file{as}, @file{ld}, etc.  More than one
7358 @option{-specs=@var{file}} can be specified on the command line, and they
7359 are processed in order, from left to right.
7360
7361 @item --sysroot=@var{dir}
7362 @opindex sysroot
7363 Use @var{dir} as the logical root directory for headers and libraries.
7364 For example, if the compiler would normally search for headers in
7365 @file{/usr/include} and libraries in @file{/usr/lib}, it will instead
7366 search @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
7367
7368 If you use both this option and the @option{-isysroot} option, then
7369 the @option{--sysroot} option will apply to libraries, but the
7370 @option{-isysroot} option will apply to header files.
7371
7372 The GNU linker (beginning with version 2.16) has the necessary support
7373 for this option.  If your linker does not support this option, the
7374 header file aspect of @option{--sysroot} will still work, but the
7375 library aspect will not.
7376
7377 @item -I-
7378 @opindex I-
7379 This option has been deprecated.  Please use @option{-iquote} instead for
7380 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
7381 Any directories you specify with @option{-I} options before the @option{-I-}
7382 option are searched only for the case of @samp{#include "@var{file}"};
7383 they are not searched for @samp{#include <@var{file}>}.
7384
7385 If additional directories are specified with @option{-I} options after
7386 the @option{-I-}, these directories are searched for all @samp{#include}
7387 directives.  (Ordinarily @emph{all} @option{-I} directories are used
7388 this way.)
7389
7390 In addition, the @option{-I-} option inhibits the use of the current
7391 directory (where the current input file came from) as the first search
7392 directory for @samp{#include "@var{file}"}.  There is no way to
7393 override this effect of @option{-I-}.  With @option{-I.} you can specify
7394 searching the directory which was current when the compiler was
7395 invoked.  That is not exactly the same as what the preprocessor does
7396 by default, but it is often satisfactory.
7397
7398 @option{-I-} does not inhibit the use of the standard system directories
7399 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
7400 independent.
7401 @end table
7402
7403 @c man end
7404
7405 @node Spec Files
7406 @section Specifying subprocesses and the switches to pass to them
7407 @cindex Spec Files
7408
7409 @command{gcc} is a driver program.  It performs its job by invoking a
7410 sequence of other programs to do the work of compiling, assembling and
7411 linking.  GCC interprets its command-line parameters and uses these to
7412 deduce which programs it should invoke, and which command-line options
7413 it ought to place on their command lines.  This behavior is controlled
7414 by @dfn{spec strings}.  In most cases there is one spec string for each
7415 program that GCC can invoke, but a few programs have multiple spec
7416 strings to control their behavior.  The spec strings built into GCC can
7417 be overridden by using the @option{-specs=} command-line switch to specify
7418 a spec file.
7419
7420 @dfn{Spec files} are plaintext files that are used to construct spec
7421 strings.  They consist of a sequence of directives separated by blank
7422 lines.  The type of directive is determined by the first non-whitespace
7423 character on the line and it can be one of the following:
7424
7425 @table @code
7426 @item %@var{command}
7427 Issues a @var{command} to the spec file processor.  The commands that can
7428 appear here are:
7429
7430 @table @code
7431 @item %include <@var{file}>
7432 @cindex %include
7433 Search for @var{file} and insert its text at the current point in the
7434 specs file.
7435
7436 @item %include_noerr <@var{file}>
7437 @cindex %include_noerr
7438 Just like @samp{%include}, but do not generate an error message if the include
7439 file cannot be found.
7440
7441 @item %rename @var{old_name} @var{new_name}
7442 @cindex %rename
7443 Rename the spec string @var{old_name} to @var{new_name}.
7444
7445 @end table
7446
7447 @item *[@var{spec_name}]:
7448 This tells the compiler to create, override or delete the named spec
7449 string.  All lines after this directive up to the next directive or
7450 blank line are considered to be the text for the spec string.  If this
7451 results in an empty string then the spec will be deleted.  (Or, if the
7452 spec did not exist, then nothing will happened.)  Otherwise, if the spec
7453 does not currently exist a new spec will be created.  If the spec does
7454 exist then its contents will be overridden by the text of this
7455 directive, unless the first character of that text is the @samp{+}
7456 character, in which case the text will be appended to the spec.
7457
7458 @item [@var{suffix}]:
7459 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
7460 and up to the next directive or blank line are considered to make up the
7461 spec string for the indicated suffix.  When the compiler encounters an
7462 input file with the named suffix, it will processes the spec string in
7463 order to work out how to compile that file.  For example:
7464
7465 @smallexample
7466 .ZZ:
7467 z-compile -input %i
7468 @end smallexample
7469
7470 This says that any input file whose name ends in @samp{.ZZ} should be
7471 passed to the program @samp{z-compile}, which should be invoked with the
7472 command-line switch @option{-input} and with the result of performing the
7473 @samp{%i} substitution.  (See below.)
7474
7475 As an alternative to providing a spec string, the text that follows a
7476 suffix directive can be one of the following:
7477
7478 @table @code
7479 @item @@@var{language}
7480 This says that the suffix is an alias for a known @var{language}.  This is
7481 similar to using the @option{-x} command-line switch to GCC to specify a
7482 language explicitly.  For example:
7483
7484 @smallexample
7485 .ZZ:
7486 @@c++
7487 @end smallexample
7488
7489 Says that .ZZ files are, in fact, C++ source files.
7490
7491 @item #@var{name}
7492 This causes an error messages saying:
7493
7494 @smallexample
7495 @var{name} compiler not installed on this system.
7496 @end smallexample
7497 @end table
7498
7499 GCC already has an extensive list of suffixes built into it.
7500 This directive will add an entry to the end of the list of suffixes, but
7501 since the list is searched from the end backwards, it is effectively
7502 possible to override earlier entries using this technique.
7503
7504 @end table
7505
7506 GCC has the following spec strings built into it.  Spec files can
7507 override these strings or create their own.  Note that individual
7508 targets can also add their own spec strings to this list.
7509
7510 @smallexample
7511 asm          Options to pass to the assembler
7512 asm_final    Options to pass to the assembler post-processor
7513 cpp          Options to pass to the C preprocessor
7514 cc1          Options to pass to the C compiler
7515 cc1plus      Options to pass to the C++ compiler
7516 endfile      Object files to include at the end of the link
7517 link         Options to pass to the linker
7518 lib          Libraries to include on the command line to the linker
7519 libgcc       Decides which GCC support library to pass to the linker
7520 linker       Sets the name of the linker
7521 predefines   Defines to be passed to the C preprocessor
7522 signed_char  Defines to pass to CPP to say whether @code{char} is signed
7523              by default
7524 startfile    Object files to include at the start of the link
7525 @end smallexample
7526
7527 Here is a small example of a spec file:
7528
7529 @smallexample
7530 %rename lib                 old_lib
7531
7532 *lib:
7533 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
7534 @end smallexample
7535
7536 This example renames the spec called @samp{lib} to @samp{old_lib} and
7537 then overrides the previous definition of @samp{lib} with a new one.
7538 The new definition adds in some extra command-line options before
7539 including the text of the old definition.
7540
7541 @dfn{Spec strings} are a list of command-line options to be passed to their
7542 corresponding program.  In addition, the spec strings can contain
7543 @samp{%}-prefixed sequences to substitute variable text or to
7544 conditionally insert text into the command line.  Using these constructs
7545 it is possible to generate quite complex command lines.
7546
7547 Here is a table of all defined @samp{%}-sequences for spec
7548 strings.  Note that spaces are not generated automatically around the
7549 results of expanding these sequences.  Therefore you can concatenate them
7550 together or combine them with constant text in a single argument.
7551
7552 @table @code
7553 @item %%
7554 Substitute one @samp{%} into the program name or argument.
7555
7556 @item %i
7557 Substitute the name of the input file being processed.
7558
7559 @item %b
7560 Substitute the basename of the input file being processed.
7561 This is the substring up to (and not including) the last period
7562 and not including the directory.
7563
7564 @item %B
7565 This is the same as @samp{%b}, but include the file suffix (text after
7566 the last period).
7567
7568 @item %d
7569 Marks the argument containing or following the @samp{%d} as a
7570 temporary file name, so that that file will be deleted if GCC exits
7571 successfully.  Unlike @samp{%g}, this contributes no text to the
7572 argument.
7573
7574 @item %g@var{suffix}
7575 Substitute a file name that has suffix @var{suffix} and is chosen
7576 once per compilation, and mark the argument in the same way as
7577 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
7578 name is now chosen in a way that is hard to predict even when previously
7579 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
7580 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
7581 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
7582 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
7583 was simply substituted with a file name chosen once per compilation,
7584 without regard to any appended suffix (which was therefore treated
7585 just like ordinary text), making such attacks more likely to succeed.
7586
7587 @item %u@var{suffix}
7588 Like @samp{%g}, but generates a new temporary file name even if
7589 @samp{%u@var{suffix}} was already seen.
7590
7591 @item %U@var{suffix}
7592 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
7593 new one if there is no such last file name.  In the absence of any
7594 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
7595 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
7596 would involve the generation of two distinct file names, one
7597 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
7598 simply substituted with a file name chosen for the previous @samp{%u},
7599 without regard to any appended suffix.
7600
7601 @item %j@var{suffix}
7602 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
7603 writable, and if save-temps is off; otherwise, substitute the name
7604 of a temporary file, just like @samp{%u}.  This temporary file is not
7605 meant for communication between processes, but rather as a junk
7606 disposal mechanism.
7607
7608 @item %|@var{suffix}
7609 @itemx %m@var{suffix}
7610 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
7611 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
7612 all.  These are the two most common ways to instruct a program that it
7613 should read from standard input or write to standard output.  If you
7614 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
7615 construct: see for example @file{f/lang-specs.h}.
7616
7617 @item %.@var{SUFFIX}
7618 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
7619 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
7620 terminated by the next space or %.
7621
7622 @item %w
7623 Marks the argument containing or following the @samp{%w} as the
7624 designated output file of this compilation.  This puts the argument
7625 into the sequence of arguments that @samp{%o} will substitute later.
7626
7627 @item %o
7628 Substitutes the names of all the output files, with spaces
7629 automatically placed around them.  You should write spaces
7630 around the @samp{%o} as well or the results are undefined.
7631 @samp{%o} is for use in the specs for running the linker.
7632 Input files whose names have no recognized suffix are not compiled
7633 at all, but they are included among the output files, so they will
7634 be linked.
7635
7636 @item %O
7637 Substitutes the suffix for object files.  Note that this is
7638 handled specially when it immediately follows @samp{%g, %u, or %U},
7639 because of the need for those to form complete file names.  The
7640 handling is such that @samp{%O} is treated exactly as if it had already
7641 been substituted, except that @samp{%g, %u, and %U} do not currently
7642 support additional @var{suffix} characters following @samp{%O} as they would
7643 following, for example, @samp{.o}.
7644
7645 @item %p
7646 Substitutes the standard macro predefinitions for the
7647 current target machine.  Use this when running @code{cpp}.
7648
7649 @item %P
7650 Like @samp{%p}, but puts @samp{__} before and after the name of each
7651 predefined macro, except for macros that start with @samp{__} or with
7652 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
7653 C@.
7654
7655 @item %I
7656 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
7657 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
7658 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
7659 and @option{-imultilib} as necessary.
7660
7661 @item %s
7662 Current argument is the name of a library or startup file of some sort.
7663 Search for that file in a standard list of directories and substitute
7664 the full name found.
7665
7666 @item %e@var{str}
7667 Print @var{str} as an error message.  @var{str} is terminated by a newline.
7668 Use this when inconsistent options are detected.
7669
7670 @item %(@var{name})
7671 Substitute the contents of spec string @var{name} at this point.
7672
7673 @item %[@var{name}]
7674 Like @samp{%(@dots{})} but put @samp{__} around @option{-D} arguments.
7675
7676 @item %x@{@var{option}@}
7677 Accumulate an option for @samp{%X}.
7678
7679 @item %X
7680 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
7681 spec string.
7682
7683 @item %Y
7684 Output the accumulated assembler options specified by @option{-Wa}.
7685
7686 @item %Z
7687 Output the accumulated preprocessor options specified by @option{-Wp}.
7688
7689 @item %a
7690 Process the @code{asm} spec.  This is used to compute the
7691 switches to be passed to the assembler.
7692
7693 @item %A
7694 Process the @code{asm_final} spec.  This is a spec string for
7695 passing switches to an assembler post-processor, if such a program is
7696 needed.
7697
7698 @item %l
7699 Process the @code{link} spec.  This is the spec for computing the
7700 command line passed to the linker.  Typically it will make use of the
7701 @samp{%L %G %S %D and %E} sequences.
7702
7703 @item %D
7704 Dump out a @option{-L} option for each directory that GCC believes might
7705 contain startup files.  If the target supports multilibs then the
7706 current multilib directory will be prepended to each of these paths.
7707
7708 @item %L
7709 Process the @code{lib} spec.  This is a spec string for deciding which
7710 libraries should be included on the command line to the linker.
7711
7712 @item %G
7713 Process the @code{libgcc} spec.  This is a spec string for deciding
7714 which GCC support library should be included on the command line to the linker.
7715
7716 @item %S
7717 Process the @code{startfile} spec.  This is a spec for deciding which
7718 object files should be the first ones passed to the linker.  Typically
7719 this might be a file named @file{crt0.o}.
7720
7721 @item %E
7722 Process the @code{endfile} spec.  This is a spec string that specifies
7723 the last object files that will be passed to the linker.
7724
7725 @item %C
7726 Process the @code{cpp} spec.  This is used to construct the arguments
7727 to be passed to the C preprocessor.
7728
7729 @item %1
7730 Process the @code{cc1} spec.  This is used to construct the options to be
7731 passed to the actual C compiler (@samp{cc1}).
7732
7733 @item %2
7734 Process the @code{cc1plus} spec.  This is used to construct the options to be
7735 passed to the actual C++ compiler (@samp{cc1plus}).
7736
7737 @item %*
7738 Substitute the variable part of a matched option.  See below.
7739 Note that each comma in the substituted string is replaced by
7740 a single space.
7741
7742 @item %<@code{S}
7743 Remove all occurrences of @code{-S} from the command line.  Note---this
7744 command is position dependent.  @samp{%} commands in the spec string
7745 before this one will see @code{-S}, @samp{%} commands in the spec string
7746 after this one will not.
7747
7748 @item %:@var{function}(@var{args})
7749 Call the named function @var{function}, passing it @var{args}.
7750 @var{args} is first processed as a nested spec string, then split
7751 into an argument vector in the usual fashion.  The function returns
7752 a string which is processed as if it had appeared literally as part
7753 of the current spec.
7754
7755 The following built-in spec functions are provided:
7756
7757 @table @code
7758 @item @code{getenv}
7759 The @code{getenv} spec function takes two arguments: an environment
7760 variable name and a string.  If the environment variable is not
7761 defined, a fatal error is issued.  Otherwise, the return value is the
7762 value of the environment variable concatenated with the string.  For
7763 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
7764
7765 @smallexample
7766 %:getenv(TOPDIR /include)
7767 @end smallexample
7768
7769 expands to @file{/path/to/top/include}.
7770
7771 @item @code{if-exists}
7772 The @code{if-exists} spec function takes one argument, an absolute
7773 pathname to a file.  If the file exists, @code{if-exists} returns the
7774 pathname.  Here is a small example of its usage:
7775
7776 @smallexample
7777 *startfile:
7778 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
7779 @end smallexample
7780
7781 @item @code{if-exists-else}
7782 The @code{if-exists-else} spec function is similar to the @code{if-exists}
7783 spec function, except that it takes two arguments.  The first argument is
7784 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
7785 returns the pathname.  If it does not exist, it returns the second argument.
7786 This way, @code{if-exists-else} can be used to select one file or another,
7787 based on the existence of the first.  Here is a small example of its usage:
7788
7789 @smallexample
7790 *startfile:
7791 crt0%O%s %:if-exists(crti%O%s) \
7792 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
7793 @end smallexample
7794
7795 @item @code{replace-outfile}
7796 The @code{replace-outfile} spec function takes two arguments.  It looks for the
7797 first argument in the outfiles array and replaces it with the second argument.  Here
7798 is a small example of its usage:
7799
7800 @smallexample
7801 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
7802 @end smallexample
7803
7804 @item @code{print-asm-header}
7805 The @code{print-asm-header} function takes no arguments and simply
7806 prints a banner like:
7807
7808 @smallexample
7809 Assembler options
7810 =================
7811
7812 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
7813 @end smallexample
7814
7815 It is used to separate compiler options from assembler options
7816 in the @option{--target-help} output.
7817 @end table
7818
7819 @item %@{@code{S}@}
7820 Substitutes the @code{-S} switch, if that switch was given to GCC@.
7821 If that switch was not specified, this substitutes nothing.  Note that
7822 the leading dash is omitted when specifying this option, and it is
7823 automatically inserted if the substitution is performed.  Thus the spec
7824 string @samp{%@{foo@}} would match the command-line option @option{-foo}
7825 and would output the command line option @option{-foo}.
7826
7827 @item %W@{@code{S}@}
7828 Like %@{@code{S}@} but mark last argument supplied within as a file to be
7829 deleted on failure.
7830
7831 @item %@{@code{S}*@}
7832 Substitutes all the switches specified to GCC whose names start
7833 with @code{-S}, but which also take an argument.  This is used for
7834 switches like @option{-o}, @option{-D}, @option{-I}, etc.
7835 GCC considers @option{-o foo} as being
7836 one switch whose names starts with @samp{o}.  %@{o*@} would substitute this
7837 text, including the space.  Thus two arguments would be generated.
7838
7839 @item %@{@code{S}*&@code{T}*@}
7840 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
7841 (the order of @code{S} and @code{T} in the spec is not significant).
7842 There can be any number of ampersand-separated variables; for each the
7843 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
7844
7845 @item %@{@code{S}:@code{X}@}
7846 Substitutes @code{X}, if the @samp{-S} switch was given to GCC@.
7847
7848 @item %@{!@code{S}:@code{X}@}
7849 Substitutes @code{X}, if the @samp{-S} switch was @emph{not} given to GCC@.
7850
7851 @item %@{@code{S}*:@code{X}@}
7852 Substitutes @code{X} if one or more switches whose names start with
7853 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
7854 once, no matter how many such switches appeared.  However, if @code{%*}
7855 appears somewhere in @code{X}, then @code{X} will be substituted once
7856 for each matching switch, with the @code{%*} replaced by the part of
7857 that switch that matched the @code{*}.
7858
7859 @item %@{.@code{S}:@code{X}@}
7860 Substitutes @code{X}, if processing a file with suffix @code{S}.
7861
7862 @item %@{!.@code{S}:@code{X}@}
7863 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
7864
7865 @item %@{,@code{S}:@code{X}@}
7866 Substitutes @code{X}, if processing a file for language @code{S}.
7867
7868 @item %@{!,@code{S}:@code{X}@}
7869 Substitutes @code{X}, if not processing a file for language @code{S}.
7870
7871 @item %@{@code{S}|@code{P}:@code{X}@}
7872 Substitutes @code{X} if either @code{-S} or @code{-P} was given to
7873 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
7874 @code{*} sequences as well, although they have a stronger binding than
7875 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
7876 alternatives must be starred, and only the first matching alternative
7877 is substituted.
7878
7879 For example, a spec string like this:
7880
7881 @smallexample
7882 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
7883 @end smallexample
7884
7885 will output the following command-line options from the following input
7886 command-line options:
7887
7888 @smallexample
7889 fred.c        -foo -baz
7890 jim.d         -bar -boggle
7891 -d fred.c     -foo -baz -boggle
7892 -d jim.d      -bar -baz -boggle
7893 @end smallexample
7894
7895 @item %@{S:X; T:Y; :D@}
7896
7897 If @code{S} was given to GCC, substitutes @code{X}; else if @code{T} was
7898 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
7899 be as many clauses as you need.  This may be combined with @code{.},
7900 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
7901
7902
7903 @end table
7904
7905 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
7906 construct may contain other nested @samp{%} constructs or spaces, or
7907 even newlines.  They are processed as usual, as described above.
7908 Trailing white space in @code{X} is ignored.  White space may also
7909 appear anywhere on the left side of the colon in these constructs,
7910 except between @code{.} or @code{*} and the corresponding word.
7911
7912 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
7913 handled specifically in these constructs.  If another value of
7914 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
7915 @option{-W} switch is found later in the command line, the earlier
7916 switch value is ignored, except with @{@code{S}*@} where @code{S} is
7917 just one letter, which passes all matching options.
7918
7919 The character @samp{|} at the beginning of the predicate text is used to
7920 indicate that a command should be piped to the following command, but
7921 only if @option{-pipe} is specified.
7922
7923 It is built into GCC which switches take arguments and which do not.
7924 (You might think it would be useful to generalize this to allow each
7925 compiler's spec to say which switches take arguments.  But this cannot
7926 be done in a consistent fashion.  GCC cannot even decide which input
7927 files have been specified without knowing which switches take arguments,
7928 and it must know which input files to compile in order to tell which
7929 compilers to run).
7930
7931 GCC also knows implicitly that arguments starting in @option{-l} are to be
7932 treated as compiler output files, and passed to the linker in their
7933 proper position among the other output files.
7934
7935 @c man begin OPTIONS
7936
7937 @node Target Options
7938 @section Specifying Target Machine and Compiler Version
7939 @cindex target options
7940 @cindex cross compiling
7941 @cindex specifying machine version
7942 @cindex specifying compiler version and target machine
7943 @cindex compiler version, specifying
7944 @cindex target machine, specifying
7945
7946 The usual way to run GCC is to run the executable called @file{gcc}, or
7947 @file{<machine>-gcc} when cross-compiling, or
7948 @file{<machine>-gcc-<version>} to run a version other than the one that
7949 was installed last.  Sometimes this is inconvenient, so GCC provides
7950 options that will switch to another cross-compiler or version.
7951
7952 @table @gcctabopt
7953 @item -b @var{machine}
7954 @opindex b
7955 The argument @var{machine} specifies the target machine for compilation.
7956
7957 The value to use for @var{machine} is the same as was specified as the
7958 machine type when configuring GCC as a cross-compiler.  For
7959 example, if a cross-compiler was configured with @samp{configure
7960 arm-elf}, meaning to compile for an arm processor with elf binaries,
7961 then you would specify @option{-b arm-elf} to run that cross compiler.
7962 Because there are other options beginning with @option{-b}, the
7963 configuration must contain a hyphen.
7964
7965 @item -V @var{version}
7966 @opindex V
7967 The argument @var{version} specifies which version of GCC to run.
7968 This is useful when multiple versions are installed.  For example,
7969 @var{version} might be @samp{4.0}, meaning to run GCC version 4.0.
7970 @end table
7971
7972 The @option{-V} and @option{-b} options work by running the
7973 @file{<machine>-gcc-<version>} executable, so there's no real reason to
7974 use them if you can just run that directly.
7975
7976 @node Submodel Options
7977 @section Hardware Models and Configurations
7978 @cindex submodel options
7979 @cindex specifying hardware config
7980 @cindex hardware models and configurations, specifying
7981 @cindex machine dependent options
7982
7983 Earlier we discussed the standard option @option{-b} which chooses among
7984 different installed compilers for completely different target
7985 machines, such as VAX vs.@: 68000 vs.@: 80386.
7986
7987 In addition, each of these target machine types can have its own
7988 special options, starting with @samp{-m}, to choose among various
7989 hardware models or configurations---for example, 68010 vs 68020,
7990 floating coprocessor or none.  A single installed version of the
7991 compiler can compile for any model or configuration, according to the
7992 options specified.
7993
7994 Some configurations of the compiler also support additional special
7995 options, usually for compatibility with other compilers on the same
7996 platform.
7997
7998 @c This list is ordered alphanumerically by subsection name.
7999 @c It should be the same order and spelling as these options are listed
8000 @c in Machine Dependent Options
8001
8002 @menu
8003 * ARC Options::
8004 * ARM Options::
8005 * AVR Options::
8006 * Blackfin Options::
8007 * CRIS Options::
8008 * CRX Options::
8009 * Darwin Options::
8010 * DEC Alpha Options::
8011 * DEC Alpha/VMS Options::
8012 * FRV Options::
8013 * GNU/Linux Options::
8014 * H8/300 Options::
8015 * HPPA Options::
8016 * i386 and x86-64 Options::
8017 * IA-64 Options::
8018 * M32C Options::
8019 * M32R/D Options::
8020 * M680x0 Options::
8021 * M68hc1x Options::
8022 * MCore Options::
8023 * MIPS Options::
8024 * MMIX Options::
8025 * MN10300 Options::
8026 * MT Options::
8027 * PDP-11 Options::
8028 * PowerPC Options::
8029 * RS/6000 and PowerPC Options::
8030 * S/390 and zSeries Options::
8031 * Score Options::
8032 * SH Options::
8033 * SPARC Options::
8034 * SPU Options::
8035 * System V Options::
8036 * TMS320C3x/C4x Options::
8037 * V850 Options::
8038 * VAX Options::
8039 * VxWorks Options::
8040 * x86-64 Options::
8041 * Xstormy16 Options::
8042 * Xtensa Options::
8043 * zSeries Options::
8044 @end menu
8045
8046 @node ARC Options
8047 @subsection ARC Options
8048 @cindex ARC Options
8049
8050 These options are defined for ARC implementations:
8051
8052 @table @gcctabopt
8053 @item -EL
8054 @opindex EL
8055 Compile code for little endian mode.  This is the default.
8056
8057 @item -EB
8058 @opindex EB
8059 Compile code for big endian mode.
8060
8061 @item -mmangle-cpu
8062 @opindex mmangle-cpu
8063 Prepend the name of the cpu to all public symbol names.
8064 In multiple-processor systems, there are many ARC variants with different
8065 instruction and register set characteristics.  This flag prevents code
8066 compiled for one cpu to be linked with code compiled for another.
8067 No facility exists for handling variants that are ``almost identical''.
8068 This is an all or nothing option.
8069
8070 @item -mcpu=@var{cpu}
8071 @opindex mcpu
8072 Compile code for ARC variant @var{cpu}.
8073 Which variants are supported depend on the configuration.
8074 All variants support @option{-mcpu=base}, this is the default.
8075
8076 @item -mtext=@var{text-section}
8077 @itemx -mdata=@var{data-section}
8078 @itemx -mrodata=@var{readonly-data-section}
8079 @opindex mtext
8080 @opindex mdata
8081 @opindex mrodata
8082 Put functions, data, and readonly data in @var{text-section},
8083 @var{data-section}, and @var{readonly-data-section} respectively
8084 by default.  This can be overridden with the @code{section} attribute.
8085 @xref{Variable Attributes}.
8086
8087 @end table
8088
8089 @node ARM Options
8090 @subsection ARM Options
8091 @cindex ARM options
8092
8093 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
8094 architectures:
8095
8096 @table @gcctabopt
8097 @item -mabi=@var{name}
8098 @opindex mabi
8099 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
8100 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
8101
8102 @item -mapcs-frame
8103 @opindex mapcs-frame
8104 Generate a stack frame that is compliant with the ARM Procedure Call
8105 Standard for all functions, even if this is not strictly necessary for
8106 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
8107 with this option will cause the stack frames not to be generated for
8108 leaf functions.  The default is @option{-mno-apcs-frame}.
8109
8110 @item -mapcs
8111 @opindex mapcs
8112 This is a synonym for @option{-mapcs-frame}.
8113
8114 @ignore
8115 @c not currently implemented
8116 @item -mapcs-stack-check
8117 @opindex mapcs-stack-check
8118 Generate code to check the amount of stack space available upon entry to
8119 every function (that actually uses some stack space).  If there is
8120 insufficient space available then either the function
8121 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} will be
8122 called, depending upon the amount of stack space required.  The run time
8123 system is required to provide these functions.  The default is
8124 @option{-mno-apcs-stack-check}, since this produces smaller code.
8125
8126 @c not currently implemented
8127 @item -mapcs-float
8128 @opindex mapcs-float
8129 Pass floating point arguments using the float point registers.  This is
8130 one of the variants of the APCS@.  This option is recommended if the
8131 target hardware has a floating point unit or if a lot of floating point
8132 arithmetic is going to be performed by the code.  The default is
8133 @option{-mno-apcs-float}, since integer only code is slightly increased in
8134 size if @option{-mapcs-float} is used.
8135
8136 @c not currently implemented
8137 @item -mapcs-reentrant
8138 @opindex mapcs-reentrant
8139 Generate reentrant, position independent code.  The default is
8140 @option{-mno-apcs-reentrant}.
8141 @end ignore
8142
8143 @item -mthumb-interwork
8144 @opindex mthumb-interwork
8145 Generate code which supports calling between the ARM and Thumb
8146 instruction sets.  Without this option the two instruction sets cannot
8147 be reliably used inside one program.  The default is
8148 @option{-mno-thumb-interwork}, since slightly larger code is generated
8149 when @option{-mthumb-interwork} is specified.
8150
8151 @item -mno-sched-prolog
8152 @opindex mno-sched-prolog
8153 Prevent the reordering of instructions in the function prolog, or the
8154 merging of those instruction with the instructions in the function's
8155 body.  This means that all functions will start with a recognizable set
8156 of instructions (or in fact one of a choice from a small set of
8157 different function prologues), and this information can be used to
8158 locate the start if functions inside an executable piece of code.  The
8159 default is @option{-msched-prolog}.
8160
8161 @item -mhard-float
8162 @opindex mhard-float
8163 Generate output containing floating point instructions.  This is the
8164 default.
8165
8166 @item -msoft-float
8167 @opindex msoft-float
8168 Generate output containing library calls for floating point.
8169 @strong{Warning:} the requisite libraries are not available for all ARM
8170 targets.  Normally the facilities of the machine's usual C compiler are
8171 used, but this cannot be done directly in cross-compilation.  You must make
8172 your own arrangements to provide suitable library functions for
8173 cross-compilation.
8174
8175 @option{-msoft-float} changes the calling convention in the output file;
8176 therefore, it is only useful if you compile @emph{all} of a program with
8177 this option.  In particular, you need to compile @file{libgcc.a}, the
8178 library that comes with GCC, with @option{-msoft-float} in order for
8179 this to work.
8180
8181 @item -mfloat-abi=@var{name}
8182 @opindex mfloat-abi
8183 Specifies which ABI to use for floating point values.  Permissible values
8184 are: @samp{soft}, @samp{softfp} and @samp{hard}.
8185
8186 @samp{soft} and @samp{hard} are equivalent to @option{-msoft-float}
8187 and @option{-mhard-float} respectively.  @samp{softfp} allows the generation
8188 of floating point instructions, but still uses the soft-float calling
8189 conventions.
8190
8191 @item -mlittle-endian
8192 @opindex mlittle-endian
8193 Generate code for a processor running in little-endian mode.  This is
8194 the default for all standard configurations.
8195
8196 @item -mbig-endian
8197 @opindex mbig-endian
8198 Generate code for a processor running in big-endian mode; the default is
8199 to compile code for a little-endian processor.
8200
8201 @item -mwords-little-endian
8202 @opindex mwords-little-endian
8203 This option only applies when generating code for big-endian processors.
8204 Generate code for a little-endian word order but a big-endian byte
8205 order.  That is, a byte order of the form @samp{32107654}.  Note: this
8206 option should only be used if you require compatibility with code for
8207 big-endian ARM processors generated by versions of the compiler prior to
8208 2.8.
8209
8210 @item -mcpu=@var{name}
8211 @opindex mcpu
8212 This specifies the name of the target ARM processor.  GCC uses this name
8213 to determine what kind of instructions it can emit when generating
8214 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
8215 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
8216 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
8217 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
8218 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
8219 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
8220 @samp{arm8}, @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
8221 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
8222 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
8223 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
8224 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
8225 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
8226 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
8227 @samp{arm1156t2-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
8228 @samp{cortex-a8}, @samp{cortex-r4}, @samp{cortex-m3},
8229 @samp{xscale}, @samp{iwmmxt}, @samp{ep9312}.
8230
8231 @itemx -mtune=@var{name}
8232 @opindex mtune
8233 This option is very similar to the @option{-mcpu=} option, except that
8234 instead of specifying the actual target processor type, and hence
8235 restricting which instructions can be used, it specifies that GCC should
8236 tune the performance of the code as if the target were of the type
8237 specified in this option, but still choosing the instructions that it
8238 will generate based on the cpu specified by a @option{-mcpu=} option.
8239 For some ARM implementations better performance can be obtained by using
8240 this option.
8241
8242 @item -march=@var{name}
8243 @opindex march
8244 This specifies the name of the target ARM architecture.  GCC uses this
8245 name to determine what kind of instructions it can emit when generating
8246 assembly code.  This option can be used in conjunction with or instead
8247 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
8248 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
8249 @samp{armv5}, @samp{armv5t}, @samp{armv5te}, @samp{armv6}, @samp{armv6j},
8250 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv7}, @samp{armv7-a},
8251 @samp{armv7-r}, @samp{armv7-m}, @samp{iwmmxt}, @samp{ep9312}.
8252
8253 @item -mfpu=@var{name}
8254 @itemx -mfpe=@var{number}
8255 @itemx -mfp=@var{number}
8256 @opindex mfpu
8257 @opindex mfpe
8258 @opindex mfp
8259 This specifies what floating point hardware (or hardware emulation) is
8260 available on the target.  Permissible names are: @samp{fpa}, @samp{fpe2},
8261 @samp{fpe3}, @samp{maverick}, @samp{vfp}.  @option{-mfp} and @option{-mfpe}
8262 are synonyms for @option{-mfpu}=@samp{fpe}@var{number}, for compatibility
8263 with older versions of GCC@.
8264
8265 If @option{-msoft-float} is specified this specifies the format of
8266 floating point values.
8267
8268 @item -mstructure-size-boundary=@var{n}
8269 @opindex mstructure-size-boundary
8270 The size of all structures and unions will be rounded up to a multiple
8271 of the number of bits set by this option.  Permissible values are 8, 32
8272 and 64.  The default value varies for different toolchains.  For the COFF
8273 targeted toolchain the default value is 8.  A value of 64 is only allowed
8274 if the underlying ABI supports it.
8275
8276 Specifying the larger number can produce faster, more efficient code, but
8277 can also increase the size of the program.  Different values are potentially
8278 incompatible.  Code compiled with one value cannot necessarily expect to
8279 work with code or libraries compiled with another value, if they exchange
8280 information using structures or unions.
8281
8282 @item -mabort-on-noreturn
8283 @opindex mabort-on-noreturn
8284 Generate a call to the function @code{abort} at the end of a
8285 @code{noreturn} function.  It will be executed if the function tries to
8286 return.
8287
8288 @item -mlong-calls
8289 @itemx -mno-long-calls
8290 @opindex mlong-calls
8291 @opindex mno-long-calls
8292 Tells the compiler to perform function calls by first loading the
8293 address of the function into a register and then performing a subroutine
8294 call on this register.  This switch is needed if the target function
8295 will lie outside of the 64 megabyte addressing range of the offset based
8296 version of subroutine call instruction.
8297
8298 Even if this switch is enabled, not all function calls will be turned
8299 into long calls.  The heuristic is that static functions, functions
8300 which have the @samp{short-call} attribute, functions that are inside
8301 the scope of a @samp{#pragma no_long_calls} directive and functions whose
8302 definitions have already been compiled within the current compilation
8303 unit, will not be turned into long calls.  The exception to this rule is
8304 that weak function definitions, functions with the @samp{long-call}
8305 attribute or the @samp{section} attribute, and functions that are within
8306 the scope of a @samp{#pragma long_calls} directive, will always be
8307 turned into long calls.
8308
8309 This feature is not enabled by default.  Specifying
8310 @option{-mno-long-calls} will restore the default behavior, as will
8311 placing the function calls within the scope of a @samp{#pragma
8312 long_calls_off} directive.  Note these switches have no effect on how
8313 the compiler generates code to handle function calls via function
8314 pointers.
8315
8316 @item -mnop-fun-dllimport
8317 @opindex mnop-fun-dllimport
8318 Disable support for the @code{dllimport} attribute.
8319
8320 @item -msingle-pic-base
8321 @opindex msingle-pic-base
8322 Treat the register used for PIC addressing as read-only, rather than
8323 loading it in the prologue for each function.  The run-time system is
8324 responsible for initializing this register with an appropriate value
8325 before execution begins.
8326
8327 @item -mpic-register=@var{reg}
8328 @opindex mpic-register
8329 Specify the register to be used for PIC addressing.  The default is R10
8330 unless stack-checking is enabled, when R9 is used.
8331
8332 @item -mcirrus-fix-invalid-insns
8333 @opindex mcirrus-fix-invalid-insns
8334 @opindex mno-cirrus-fix-invalid-insns
8335 Insert NOPs into the instruction stream to in order to work around
8336 problems with invalid Maverick instruction combinations.  This option
8337 is only valid if the @option{-mcpu=ep9312} option has been used to
8338 enable generation of instructions for the Cirrus Maverick floating
8339 point co-processor.  This option is not enabled by default, since the
8340 problem is only present in older Maverick implementations.  The default
8341 can be re-enabled by use of the @option{-mno-cirrus-fix-invalid-insns}
8342 switch.
8343
8344 @item -mpoke-function-name
8345 @opindex mpoke-function-name
8346 Write the name of each function into the text section, directly
8347 preceding the function prologue.  The generated code is similar to this:
8348
8349 @smallexample
8350      t0
8351          .ascii "arm_poke_function_name", 0
8352          .align
8353      t1
8354          .word 0xff000000 + (t1 - t0)
8355      arm_poke_function_name
8356          mov     ip, sp
8357          stmfd   sp!, @{fp, ip, lr, pc@}
8358          sub     fp, ip, #4
8359 @end smallexample
8360
8361 When performing a stack backtrace, code can inspect the value of
8362 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
8363 location @code{pc - 12} and the top 8 bits are set, then we know that
8364 there is a function name embedded immediately preceding this location
8365 and has length @code{((pc[-3]) & 0xff000000)}.
8366
8367 @item -mthumb
8368 @opindex mthumb
8369 Generate code for the Thumb instruction set.  The default is to
8370 use the 32-bit ARM instruction set.
8371 This option automatically enables either 16-bit Thumb-1 or
8372 mixed 16/32-bit Thumb-2 instructions based on the @option{-mcpu=@var{name}}
8373 and @option{-march=@var{name}} options.
8374
8375 @item -mtpcs-frame
8376 @opindex mtpcs-frame
8377 Generate a stack frame that is compliant with the Thumb Procedure Call
8378 Standard for all non-leaf functions.  (A leaf function is one that does
8379 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
8380
8381 @item -mtpcs-leaf-frame
8382 @opindex mtpcs-leaf-frame
8383 Generate a stack frame that is compliant with the Thumb Procedure Call
8384 Standard for all leaf functions.  (A leaf function is one that does
8385 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
8386
8387 @item -mcallee-super-interworking
8388 @opindex mcallee-super-interworking
8389 Gives all externally visible functions in the file being compiled an ARM
8390 instruction set header which switches to Thumb mode before executing the
8391 rest of the function.  This allows these functions to be called from
8392 non-interworking code.
8393
8394 @item -mcaller-super-interworking
8395 @opindex mcaller-super-interworking
8396 Allows calls via function pointers (including virtual functions) to
8397 execute correctly regardless of whether the target code has been
8398 compiled for interworking or not.  There is a small overhead in the cost
8399 of executing a function pointer if this option is enabled.
8400
8401 @item -mtp=@var{name}
8402 @opindex mtp
8403 Specify the access model for the thread local storage pointer.  The valid
8404 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
8405 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
8406 (supported in the arm6k architecture), and @option{auto}, which uses the
8407 best available method for the selected processor.  The default setting is
8408 @option{auto}.
8409
8410 @end table
8411
8412 @node AVR Options
8413 @subsection AVR Options
8414 @cindex AVR Options
8415
8416 These options are defined for AVR implementations:
8417
8418 @table @gcctabopt
8419 @item -mmcu=@var{mcu}
8420 @opindex mmcu
8421 Specify ATMEL AVR instruction set or MCU type.
8422
8423 Instruction set avr1 is for the minimal AVR core, not supported by the C
8424 compiler, only for assembler programs (MCU types: at90s1200, attiny10,
8425 attiny11, attiny12, attiny15, attiny28).
8426
8427 Instruction set avr2 (default) is for the classic AVR core with up to
8428 8K program memory space (MCU types: at90s2313, at90s2323, attiny22,
8429 at90s2333, at90s2343, at90s4414, at90s4433, at90s4434, at90s8515,
8430 at90c8534, at90s8535).
8431
8432 Instruction set avr3 is for the classic AVR core with up to 128K program
8433 memory space (MCU types: atmega103, atmega603, at43usb320, at76c711).
8434
8435 Instruction set avr4 is for the enhanced AVR core with up to 8K program
8436 memory space (MCU types: atmega8, atmega83, atmega85).
8437
8438 Instruction set avr5 is for the enhanced AVR core with up to 128K program
8439 memory space (MCU types: atmega16, atmega161, atmega163, atmega32, atmega323,
8440 atmega64, atmega128, at43usb355, at94k).
8441
8442 @item -msize
8443 @opindex msize
8444 Output instruction sizes to the asm file.
8445
8446 @item -minit-stack=@var{N}
8447 @opindex minit-stack
8448 Specify the initial stack address, which may be a symbol or numeric value,
8449 @samp{__stack} is the default.
8450
8451 @item -mno-interrupts
8452 @opindex mno-interrupts
8453 Generated code is not compatible with hardware interrupts.
8454 Code size will be smaller.
8455
8456 @item -mcall-prologues
8457 @opindex mcall-prologues
8458 Functions prologues/epilogues expanded as call to appropriate
8459 subroutines.  Code size will be smaller.
8460
8461 @item -mno-tablejump
8462 @opindex mno-tablejump
8463 Do not generate tablejump insns which sometimes increase code size.
8464
8465 @item -mtiny-stack
8466 @opindex mtiny-stack
8467 Change only the low 8 bits of the stack pointer.
8468
8469 @item -mint8
8470 @opindex mint8
8471 Assume int to be 8 bit integer.  This affects the sizes of all types: A
8472 char will be 1 byte, an int will be 1 byte, an long will be 2 bytes
8473 and long long will be 4 bytes.  Please note that this option does not
8474 comply to the C standards, but it will provide you with smaller code
8475 size.
8476 @end table
8477
8478 @node Blackfin Options
8479 @subsection Blackfin Options
8480 @cindex Blackfin Options
8481
8482 @table @gcctabopt
8483 @item -mcpu=@var{cpu}
8484 @opindex mcpu=
8485 Specifies the name of the target Blackfin processor. Currently, @var{cpu}
8486 can be one of @samp{bf531}, @samp{bf532}, @samp{bf533},
8487 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf561}.
8488 Without this option, @samp{bf532} is used as the processor by default.
8489 The corresponding predefined processor macros for @var{cpu} is to
8490 be defined.  For the @samp{bfin-elf} toolchain, this causes the hardware
8491 BSP provided by libgloss to be linked in if @samp{-msim} is not given.
8492 Support for @samp{bf561} is incomplete; only the processor macro is defined.
8493
8494 @item -msim
8495 @opindex msim
8496 Specifies that the program will be run on the simulator.  This causes
8497 the simulator BSP provided by libgloss to be linked in.  This option
8498 has effect only for @samp{bfin-elf} toolchain.
8499
8500 @item -momit-leaf-frame-pointer
8501 @opindex momit-leaf-frame-pointer
8502 Don't keep the frame pointer in a register for leaf functions.  This
8503 avoids the instructions to save, set up and restore frame pointers and
8504 makes an extra register available in leaf functions.  The option
8505 @option{-fomit-frame-pointer} removes the frame pointer for all functions
8506 which might make debugging harder.
8507
8508 @item -mspecld-anomaly
8509 @opindex mspecld-anomaly
8510 When enabled, the compiler will ensure that the generated code does not
8511 contain speculative loads after jump instructions.  This option is enabled
8512 by default.
8513
8514 @item -mno-specld-anomaly
8515 @opindex mno-specld-anomaly
8516 Don't generate extra code to prevent speculative loads from occurring.
8517
8518 @item -mcsync-anomaly
8519 @opindex mcsync-anomaly
8520 When enabled, the compiler will ensure that the generated code does not
8521 contain CSYNC or SSYNC instructions too soon after conditional branches.
8522 This option is enabled by default.
8523
8524 @item -mno-csync-anomaly
8525 @opindex mno-csync-anomaly
8526 Don't generate extra code to prevent CSYNC or SSYNC instructions from
8527 occurring too soon after a conditional branch.
8528
8529 @item -mlow-64k
8530 @opindex mlow-64k
8531 When enabled, the compiler is free to take advantage of the knowledge that
8532 the entire program fits into the low 64k of memory.
8533
8534 @item -mno-low-64k
8535 @opindex mno-low-64k
8536 Assume that the program is arbitrarily large.  This is the default.
8537
8538 @item -mstack-check-l1
8539 @opindex mstack-check-l1
8540 Do stack checking using information placed into L1 scratchpad memory by the
8541 uClinux kernel.
8542
8543 @item -mid-shared-library
8544 @opindex mid-shared-library
8545 Generate code that supports shared libraries via the library ID method.
8546 This allows for execute in place and shared libraries in an environment
8547 without virtual memory management.  This option implies @option{-fPIC}.
8548
8549 @item -mno-id-shared-library
8550 @opindex mno-id-shared-library
8551 Generate code that doesn't assume ID based shared libraries are being used.
8552 This is the default.
8553
8554 @item -mleaf-id-shared-library
8555 @opindex mleaf-id-shared-library
8556 Generate code that supports shared libraries via the library ID method,
8557 but assumes that this library or executable won't link against any other
8558 ID shared libraries.  That allows the compiler to use faster code for jumps
8559 and calls.
8560
8561 @item -mno-leaf-id-shared-library
8562 @opindex mno-leaf-id-shared-library
8563 Do not assume that the code being compiled won't link against any ID shared
8564 libraries.  Slower code will be generated for jump and call insns.
8565
8566 @item -mshared-library-id=n
8567 @opindex mshared-library-id
8568 Specified the identification number of the ID based shared library being
8569 compiled.  Specifying a value of 0 will generate more compact code, specifying
8570 other values will force the allocation of that number to the current
8571 library but is no more space or time efficient than omitting this option.
8572
8573 @item -msep-data
8574 @opindex msep-data
8575 Generate code that allows the data segment to be located in a different
8576 area of memory from the text segment.  This allows for execute in place in
8577 an environment without virtual memory management by eliminating relocations
8578 against the text section.
8579
8580 @item -mno-sep-data
8581 @opindex mno-sep-data
8582 Generate code that assumes that the data segment follows the text segment.
8583 This is the default.
8584
8585 @item -mlong-calls
8586 @itemx -mno-long-calls
8587 @opindex mlong-calls
8588 @opindex mno-long-calls
8589 Tells the compiler to perform function calls by first loading the
8590 address of the function into a register and then performing a subroutine
8591 call on this register.  This switch is needed if the target function
8592 will lie outside of the 24 bit addressing range of the offset based
8593 version of subroutine call instruction.
8594
8595 This feature is not enabled by default.  Specifying
8596 @option{-mno-long-calls} will restore the default behavior.  Note these
8597 switches have no effect on how the compiler generates code to handle
8598 function calls via function pointers.
8599 @end table
8600
8601 @node CRIS Options
8602 @subsection CRIS Options
8603 @cindex CRIS Options
8604
8605 These options are defined specifically for the CRIS ports.
8606
8607 @table @gcctabopt
8608 @item -march=@var{architecture-type}
8609 @itemx -mcpu=@var{architecture-type}
8610 @opindex march
8611 @opindex mcpu
8612 Generate code for the specified architecture.  The choices for
8613 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
8614 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
8615 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
8616 @samp{v10}.
8617
8618 @item -mtune=@var{architecture-type}
8619 @opindex mtune
8620 Tune to @var{architecture-type} everything applicable about the generated
8621 code, except for the ABI and the set of available instructions.  The
8622 choices for @var{architecture-type} are the same as for
8623 @option{-march=@var{architecture-type}}.
8624
8625 @item -mmax-stack-frame=@var{n}
8626 @opindex mmax-stack-frame
8627 Warn when the stack frame of a function exceeds @var{n} bytes.
8628
8629 @item -melinux-stacksize=@var{n}
8630 @opindex melinux-stacksize
8631 Only available with the @samp{cris-axis-aout} target.  Arranges for
8632 indications in the program to the kernel loader that the stack of the
8633 program should be set to @var{n} bytes.
8634
8635 @item -metrax4
8636 @itemx -metrax100
8637 @opindex metrax4
8638 @opindex metrax100
8639 The options @option{-metrax4} and @option{-metrax100} are synonyms for
8640 @option{-march=v3} and @option{-march=v8} respectively.
8641
8642 @item -mmul-bug-workaround
8643 @itemx -mno-mul-bug-workaround
8644 @opindex mmul-bug-workaround
8645 @opindex mno-mul-bug-workaround
8646 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
8647 models where it applies.  This option is active by default.
8648
8649 @item -mpdebug
8650 @opindex mpdebug
8651 Enable CRIS-specific verbose debug-related information in the assembly
8652 code.  This option also has the effect to turn off the @samp{#NO_APP}
8653 formatted-code indicator to the assembler at the beginning of the
8654 assembly file.
8655
8656 @item -mcc-init
8657 @opindex mcc-init
8658 Do not use condition-code results from previous instruction; always emit
8659 compare and test instructions before use of condition codes.
8660
8661 @item -mno-side-effects
8662 @opindex mno-side-effects
8663 Do not emit instructions with side-effects in addressing modes other than
8664 post-increment.
8665
8666 @item -mstack-align
8667 @itemx -mno-stack-align
8668 @itemx -mdata-align
8669 @itemx -mno-data-align
8670 @itemx -mconst-align
8671 @itemx -mno-const-align
8672 @opindex mstack-align
8673 @opindex mno-stack-align
8674 @opindex mdata-align
8675 @opindex mno-data-align
8676 @opindex mconst-align
8677 @opindex mno-const-align
8678 These options (no-options) arranges (eliminate arrangements) for the
8679 stack-frame, individual data and constants to be aligned for the maximum
8680 single data access size for the chosen CPU model.  The default is to
8681 arrange for 32-bit alignment.  ABI details such as structure layout are
8682 not affected by these options.
8683
8684 @item -m32-bit
8685 @itemx -m16-bit
8686 @itemx -m8-bit
8687 @opindex m32-bit
8688 @opindex m16-bit
8689 @opindex m8-bit
8690 Similar to the stack- data- and const-align options above, these options
8691 arrange for stack-frame, writable data and constants to all be 32-bit,
8692 16-bit or 8-bit aligned.  The default is 32-bit alignment.
8693
8694 @item -mno-prologue-epilogue
8695 @itemx -mprologue-epilogue
8696 @opindex mno-prologue-epilogue
8697 @opindex mprologue-epilogue
8698 With @option{-mno-prologue-epilogue}, the normal function prologue and
8699 epilogue that sets up the stack-frame are omitted and no return
8700 instructions or return sequences are generated in the code.  Use this
8701 option only together with visual inspection of the compiled code: no
8702 warnings or errors are generated when call-saved registers must be saved,
8703 or storage for local variable needs to be allocated.
8704
8705 @item -mno-gotplt
8706 @itemx -mgotplt
8707 @opindex mno-gotplt
8708 @opindex mgotplt
8709 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
8710 instruction sequences that load addresses for functions from the PLT part
8711 of the GOT rather than (traditional on other architectures) calls to the
8712 PLT@.  The default is @option{-mgotplt}.
8713
8714 @item -maout
8715 @opindex maout
8716 Legacy no-op option only recognized with the cris-axis-aout target.
8717
8718 @item -melf
8719 @opindex melf
8720 Legacy no-op option only recognized with the cris-axis-elf and
8721 cris-axis-linux-gnu targets.
8722
8723 @item -melinux
8724 @opindex melinux
8725 Only recognized with the cris-axis-aout target, where it selects a
8726 GNU/linux-like multilib, include files and instruction set for
8727 @option{-march=v8}.
8728
8729 @item -mlinux
8730 @opindex mlinux
8731 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
8732
8733 @item -sim
8734 @opindex sim
8735 This option, recognized for the cris-axis-aout and cris-axis-elf arranges
8736 to link with input-output functions from a simulator library.  Code,
8737 initialized data and zero-initialized data are allocated consecutively.
8738
8739 @item -sim2
8740 @opindex sim2
8741 Like @option{-sim}, but pass linker options to locate initialized data at
8742 0x40000000 and zero-initialized data at 0x80000000.
8743 @end table
8744
8745 @node CRX Options
8746 @subsection CRX Options
8747 @cindex CRX Options
8748
8749 These options are defined specifically for the CRX ports.
8750
8751 @table @gcctabopt
8752
8753 @item -mmac
8754 @opindex mmac
8755 Enable the use of multiply-accumulate instructions. Disabled by default.
8756
8757 @item -mpush-args
8758 @opindex mpush-args
8759 Push instructions will be used to pass outgoing arguments when functions
8760 are called. Enabled by default.
8761 @end table
8762
8763 @node Darwin Options
8764 @subsection Darwin Options
8765 @cindex Darwin options
8766
8767 These options are defined for all architectures running the Darwin operating
8768 system.
8769
8770 FSF GCC on Darwin does not create ``fat'' object files; it will create
8771 an object file for the single architecture that it was built to
8772 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
8773 @option{-arch} options are used; it does so by running the compiler or
8774 linker multiple times and joining the results together with
8775 @file{lipo}.
8776
8777 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
8778 @samp{i686}) is determined by the flags that specify the ISA
8779 that GCC is targetting, like @option{-mcpu} or @option{-march}.  The
8780 @option{-force_cpusubtype_ALL} option can be used to override this.
8781
8782 The Darwin tools vary in their behavior when presented with an ISA
8783 mismatch.  The assembler, @file{as}, will only permit instructions to
8784 be used that are valid for the subtype of the file it is generating,
8785 so you cannot put 64-bit instructions in an @samp{ppc750} object file.
8786 The linker for shared libraries, @file{/usr/bin/libtool}, will fail
8787 and print an error if asked to create a shared library with a less
8788 restrictive subtype than its input files (for instance, trying to put
8789 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
8790 for executables, @file{ld}, will quietly give the executable the most
8791 restrictive subtype of any of its input files.
8792
8793 @table @gcctabopt
8794 @item -F@var{dir}
8795 @opindex F
8796 Add the framework directory @var{dir} to the head of the list of
8797 directories to be searched for header files.  These directories are
8798 interleaved with those specified by @option{-I} options and are
8799 scanned in a left-to-right order.
8800
8801 A framework directory is a directory with frameworks in it.  A
8802 framework is a directory with a @samp{"Headers"} and/or
8803 @samp{"PrivateHeaders"} directory contained directly in it that ends
8804 in @samp{".framework"}.  The name of a framework is the name of this
8805 directory excluding the @samp{".framework"}.  Headers associated with
8806 the framework are found in one of those two directories, with
8807 @samp{"Headers"} being searched first.  A subframework is a framework
8808 directory that is in a framework's @samp{"Frameworks"} directory.
8809 Includes of subframework headers can only appear in a header of a
8810 framework that contains the subframework, or in a sibling subframework
8811 header.  Two subframeworks are siblings if they occur in the same
8812 framework.  A subframework should not have the same name as a
8813 framework, a warning will be issued if this is violated.  Currently a
8814 subframework cannot have subframeworks, in the future, the mechanism
8815 may be extended to support this.  The standard frameworks can be found
8816 in @samp{"/System/Library/Frameworks"} and
8817 @samp{"/Library/Frameworks"}.  An example include looks like
8818 @code{#include <Framework/header.h>}, where @samp{Framework} denotes
8819 the name of the framework and header.h is found in the
8820 @samp{"PrivateHeaders"} or @samp{"Headers"} directory.
8821
8822 @item -iframework@var{dir}
8823 @opindex iframework
8824 Like @option{-F} except the directory is a treated as a system
8825 directory.  The main difference between this @option{-iframework} and
8826 @option{-F} is that with @option{-iframework} the compiler does not
8827 warn about constructs contained within header files found via
8828 @var{dir}.  This option is valid only for the C family of languages.
8829
8830 @item -gused
8831 @opindex gused
8832 Emit debugging information for symbols that are used.  For STABS
8833 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
8834 This is by default ON@.
8835
8836 @item -gfull
8837 @opindex gfull
8838 Emit debugging information for all symbols and types.
8839
8840 @item -mmacosx-version-min=@var{version}
8841 The earliest version of MacOS X that this executable will run on
8842 is @var{version}.  Typical values of @var{version} include @code{10.1},
8843 @code{10.2}, and @code{10.3.9}.
8844
8845 If the compiler was built to use the system's headers by default,
8846 then the default for this option is the system version on which the
8847 compiler is running, otherwise the default is to make choices which
8848 are compatible with as many systems and code bases as possible.
8849
8850 @item -mkernel
8851 @opindex mkernel
8852 Enable kernel development mode.  The @option{-mkernel} option sets
8853 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
8854 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
8855 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
8856 applicable.  This mode also sets @option{-mno-altivec},
8857 @option{-msoft-float}, @option{-fno-builtin} and
8858 @option{-mlong-branch} for PowerPC targets.
8859
8860 @item -mone-byte-bool
8861 @opindex mone-byte-bool
8862 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
8863 By default @samp{sizeof(bool)} is @samp{4} when compiling for
8864 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
8865 option has no effect on x86.
8866
8867 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
8868 to generate code that is not binary compatible with code generated
8869 without that switch.  Using this switch may require recompiling all
8870 other modules in a program, including system libraries.  Use this
8871 switch to conform to a non-default data model.
8872
8873 @item -mfix-and-continue
8874 @itemx -ffix-and-continue
8875 @itemx -findirect-data
8876 @opindex mfix-and-continue
8877 @opindex ffix-and-continue
8878 @opindex findirect-data
8879 Generate code suitable for fast turn around development.  Needed to
8880 enable gdb to dynamically load @code{.o} files into already running
8881 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
8882 are provided for backwards compatibility.
8883
8884 @item -all_load
8885 @opindex all_load
8886 Loads all members of static archive libraries.
8887 See man ld(1) for more information.
8888
8889 @item -arch_errors_fatal
8890 @opindex arch_errors_fatal
8891 Cause the errors having to do with files that have the wrong architecture
8892 to be fatal.
8893
8894 @item -bind_at_load
8895 @opindex bind_at_load
8896 Causes the output file to be marked such that the dynamic linker will
8897 bind all undefined references when the file is loaded or launched.
8898
8899 @item -bundle
8900 @opindex bundle
8901 Produce a Mach-o bundle format file.
8902 See man ld(1) for more information.
8903
8904 @item -bundle_loader @var{executable}
8905 @opindex bundle_loader
8906 This option specifies the @var{executable} that will be loading the build
8907 output file being linked.  See man ld(1) for more information.
8908
8909 @item -dynamiclib
8910 @opindex dynamiclib
8911 When passed this option, GCC will produce a dynamic library instead of
8912 an executable when linking, using the Darwin @file{libtool} command.
8913
8914 @item -force_cpusubtype_ALL
8915 @opindex force_cpusubtype_ALL
8916 This causes GCC's output file to have the @var{ALL} subtype, instead of
8917 one controlled by the @option{-mcpu} or @option{-march} option.
8918
8919 @item -allowable_client  @var{client_name}
8920 @itemx -client_name
8921 @itemx -compatibility_version
8922 @itemx -current_version
8923 @itemx -dead_strip
8924 @itemx -dependency-file
8925 @itemx -dylib_file
8926 @itemx -dylinker_install_name
8927 @itemx -dynamic
8928 @itemx -exported_symbols_list
8929 @itemx -filelist
8930 @itemx -flat_namespace
8931 @itemx -force_flat_namespace
8932 @itemx -headerpad_max_install_names
8933 @itemx -image_base
8934 @itemx -init
8935 @itemx -install_name
8936 @itemx -keep_private_externs
8937 @itemx -multi_module
8938 @itemx -multiply_defined
8939 @itemx -multiply_defined_unused
8940 @itemx -noall_load
8941 @itemx -no_dead_strip_inits_and_terms
8942 @itemx -nofixprebinding
8943 @itemx -nomultidefs
8944 @itemx -noprebind
8945 @itemx -noseglinkedit
8946 @itemx -pagezero_size
8947 @itemx -prebind
8948 @itemx -prebind_all_twolevel_modules
8949 @itemx -private_bundle
8950 @itemx -read_only_relocs
8951 @itemx -sectalign
8952 @itemx -sectobjectsymbols
8953 @itemx -whyload
8954 @itemx -seg1addr
8955 @itemx -sectcreate
8956 @itemx -sectobjectsymbols
8957 @itemx -sectorder
8958 @itemx -segaddr
8959 @itemx -segs_read_only_addr
8960 @itemx -segs_read_write_addr
8961 @itemx -seg_addr_table
8962 @itemx -seg_addr_table_filename
8963 @itemx -seglinkedit
8964 @itemx -segprot
8965 @itemx -segs_read_only_addr
8966 @itemx -segs_read_write_addr
8967 @itemx -single_module
8968 @itemx -static
8969 @itemx -sub_library
8970 @itemx -sub_umbrella
8971 @itemx -twolevel_namespace
8972 @itemx -umbrella
8973 @itemx -undefined
8974 @itemx -unexported_symbols_list
8975 @itemx -weak_reference_mismatches
8976 @itemx -whatsloaded
8977
8978 @opindex allowable_client
8979 @opindex client_name
8980 @opindex compatibility_version
8981 @opindex current_version
8982 @opindex dead_strip
8983 @opindex dependency-file
8984 @opindex dylib_file
8985 @opindex dylinker_install_name
8986 @opindex dynamic
8987 @opindex exported_symbols_list
8988 @opindex filelist
8989 @opindex flat_namespace
8990 @opindex force_flat_namespace
8991 @opindex headerpad_max_install_names
8992 @opindex image_base
8993 @opindex init
8994 @opindex install_name
8995 @opindex keep_private_externs
8996 @opindex multi_module
8997 @opindex multiply_defined
8998 @opindex multiply_defined_unused
8999 @opindex noall_load
9000 @opindex no_dead_strip_inits_and_terms
9001 @opindex nofixprebinding
9002 @opindex nomultidefs
9003 @opindex noprebind
9004 @opindex noseglinkedit
9005 @opindex pagezero_size
9006 @opindex prebind
9007 @opindex prebind_all_twolevel_modules
9008 @opindex private_bundle
9009 @opindex read_only_relocs
9010 @opindex sectalign
9011 @opindex sectobjectsymbols
9012 @opindex whyload
9013 @opindex seg1addr
9014 @opindex sectcreate
9015 @opindex sectobjectsymbols
9016 @opindex sectorder
9017 @opindex segaddr
9018 @opindex segs_read_only_addr
9019 @opindex segs_read_write_addr
9020 @opindex seg_addr_table
9021 @opindex seg_addr_table_filename
9022 @opindex seglinkedit
9023 @opindex segprot
9024 @opindex segs_read_only_addr
9025 @opindex segs_read_write_addr
9026 @opindex single_module
9027 @opindex static
9028 @opindex sub_library
9029 @opindex sub_umbrella
9030 @opindex twolevel_namespace
9031 @opindex umbrella
9032 @opindex undefined
9033 @opindex unexported_symbols_list
9034 @opindex weak_reference_mismatches
9035 @opindex whatsloaded
9036
9037 These options are passed to the Darwin linker.  The Darwin linker man page
9038 describes them in detail.
9039 @end table
9040
9041 @node DEC Alpha Options
9042 @subsection DEC Alpha Options
9043
9044 These @samp{-m} options are defined for the DEC Alpha implementations:
9045
9046 @table @gcctabopt
9047 @item -mno-soft-float
9048 @itemx -msoft-float
9049 @opindex mno-soft-float
9050 @opindex msoft-float
9051 Use (do not use) the hardware floating-point instructions for
9052 floating-point operations.  When @option{-msoft-float} is specified,
9053 functions in @file{libgcc.a} will be used to perform floating-point
9054 operations.  Unless they are replaced by routines that emulate the
9055 floating-point operations, or compiled in such a way as to call such
9056 emulations routines, these routines will issue floating-point
9057 operations.   If you are compiling for an Alpha without floating-point
9058 operations, you must ensure that the library is built so as not to call
9059 them.
9060
9061 Note that Alpha implementations without floating-point operations are
9062 required to have floating-point registers.
9063
9064 @item -mfp-reg
9065 @itemx -mno-fp-regs
9066 @opindex mfp-reg
9067 @opindex mno-fp-regs
9068 Generate code that uses (does not use) the floating-point register set.
9069 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
9070 register set is not used, floating point operands are passed in integer
9071 registers as if they were integers and floating-point results are passed
9072 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
9073 so any function with a floating-point argument or return value called by code
9074 compiled with @option{-mno-fp-regs} must also be compiled with that
9075 option.
9076
9077 A typical use of this option is building a kernel that does not use,
9078 and hence need not save and restore, any floating-point registers.
9079
9080 @item -mieee
9081 @opindex mieee
9082 The Alpha architecture implements floating-point hardware optimized for
9083 maximum performance.  It is mostly compliant with the IEEE floating
9084 point standard.  However, for full compliance, software assistance is
9085 required.  This option generates code fully IEEE compliant code
9086 @emph{except} that the @var{inexact-flag} is not maintained (see below).
9087 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
9088 defined during compilation.  The resulting code is less efficient but is
9089 able to correctly support denormalized numbers and exceptional IEEE
9090 values such as not-a-number and plus/minus infinity.  Other Alpha
9091 compilers call this option @option{-ieee_with_no_inexact}.
9092
9093 @item -mieee-with-inexact
9094 @opindex mieee-with-inexact
9095 This is like @option{-mieee} except the generated code also maintains
9096 the IEEE @var{inexact-flag}.  Turning on this option causes the
9097 generated code to implement fully-compliant IEEE math.  In addition to
9098 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
9099 macro.  On some Alpha implementations the resulting code may execute
9100 significantly slower than the code generated by default.  Since there is
9101 very little code that depends on the @var{inexact-flag}, you should
9102 normally not specify this option.  Other Alpha compilers call this
9103 option @option{-ieee_with_inexact}.
9104
9105 @item -mfp-trap-mode=@var{trap-mode}
9106 @opindex mfp-trap-mode
9107 This option controls what floating-point related traps are enabled.
9108 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
9109 The trap mode can be set to one of four values:
9110
9111 @table @samp
9112 @item n
9113 This is the default (normal) setting.  The only traps that are enabled
9114 are the ones that cannot be disabled in software (e.g., division by zero
9115 trap).
9116
9117 @item u
9118 In addition to the traps enabled by @samp{n}, underflow traps are enabled
9119 as well.
9120
9121 @item su
9122 Like @samp{u}, but the instructions are marked to be safe for software
9123 completion (see Alpha architecture manual for details).
9124
9125 @item sui
9126 Like @samp{su}, but inexact traps are enabled as well.
9127 @end table
9128
9129 @item -mfp-rounding-mode=@var{rounding-mode}
9130 @opindex mfp-rounding-mode
9131 Selects the IEEE rounding mode.  Other Alpha compilers call this option
9132 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
9133 of:
9134
9135 @table @samp
9136 @item n
9137 Normal IEEE rounding mode.  Floating point numbers are rounded towards
9138 the nearest machine number or towards the even machine number in case
9139 of a tie.
9140
9141 @item m
9142 Round towards minus infinity.
9143
9144 @item c
9145 Chopped rounding mode.  Floating point numbers are rounded towards zero.
9146
9147 @item d
9148 Dynamic rounding mode.  A field in the floating point control register
9149 (@var{fpcr}, see Alpha architecture reference manual) controls the
9150 rounding mode in effect.  The C library initializes this register for
9151 rounding towards plus infinity.  Thus, unless your program modifies the
9152 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
9153 @end table
9154
9155 @item -mtrap-precision=@var{trap-precision}
9156 @opindex mtrap-precision
9157 In the Alpha architecture, floating point traps are imprecise.  This
9158 means without software assistance it is impossible to recover from a
9159 floating trap and program execution normally needs to be terminated.
9160 GCC can generate code that can assist operating system trap handlers
9161 in determining the exact location that caused a floating point trap.
9162 Depending on the requirements of an application, different levels of
9163 precisions can be selected:
9164
9165 @table @samp
9166 @item p
9167 Program precision.  This option is the default and means a trap handler
9168 can only identify which program caused a floating point exception.
9169
9170 @item f
9171 Function precision.  The trap handler can determine the function that
9172 caused a floating point exception.
9173
9174 @item i
9175 Instruction precision.  The trap handler can determine the exact
9176 instruction that caused a floating point exception.
9177 @end table
9178
9179 Other Alpha compilers provide the equivalent options called
9180 @option{-scope_safe} and @option{-resumption_safe}.
9181
9182 @item -mieee-conformant
9183 @opindex mieee-conformant
9184 This option marks the generated code as IEEE conformant.  You must not
9185 use this option unless you also specify @option{-mtrap-precision=i} and either
9186 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
9187 is to emit the line @samp{.eflag 48} in the function prologue of the
9188 generated assembly file.  Under DEC Unix, this has the effect that
9189 IEEE-conformant math library routines will be linked in.
9190
9191 @item -mbuild-constants
9192 @opindex mbuild-constants
9193 Normally GCC examines a 32- or 64-bit integer constant to
9194 see if it can construct it from smaller constants in two or three
9195 instructions.  If it cannot, it will output the constant as a literal and
9196 generate code to load it from the data segment at runtime.
9197
9198 Use this option to require GCC to construct @emph{all} integer constants
9199 using code, even if it takes more instructions (the maximum is six).
9200
9201 You would typically use this option to build a shared library dynamic
9202 loader.  Itself a shared library, it must relocate itself in memory
9203 before it can find the variables and constants in its own data segment.
9204
9205 @item -malpha-as
9206 @itemx -mgas
9207 @opindex malpha-as
9208 @opindex mgas
9209 Select whether to generate code to be assembled by the vendor-supplied
9210 assembler (@option{-malpha-as}) or by the GNU assembler @option{-mgas}.
9211
9212 @item -mbwx
9213 @itemx -mno-bwx
9214 @itemx -mcix
9215 @itemx -mno-cix
9216 @itemx -mfix
9217 @itemx -mno-fix
9218 @itemx -mmax
9219 @itemx -mno-max
9220 @opindex mbwx
9221 @opindex mno-bwx
9222 @opindex mcix
9223 @opindex mno-cix
9224 @opindex mfix
9225 @opindex mno-fix
9226 @opindex mmax
9227 @opindex mno-max
9228 Indicate whether GCC should generate code to use the optional BWX,
9229 CIX, FIX and MAX instruction sets.  The default is to use the instruction
9230 sets supported by the CPU type specified via @option{-mcpu=} option or that
9231 of the CPU on which GCC was built if none was specified.
9232
9233 @item -mfloat-vax
9234 @itemx -mfloat-ieee
9235 @opindex mfloat-vax
9236 @opindex mfloat-ieee
9237 Generate code that uses (does not use) VAX F and G floating point
9238 arithmetic instead of IEEE single and double precision.
9239
9240 @item -mexplicit-relocs
9241 @itemx -mno-explicit-relocs
9242 @opindex mexplicit-relocs
9243 @opindex mno-explicit-relocs
9244 Older Alpha assemblers provided no way to generate symbol relocations
9245 except via assembler macros.  Use of these macros does not allow
9246 optimal instruction scheduling.  GNU binutils as of version 2.12
9247 supports a new syntax that allows the compiler to explicitly mark
9248 which relocations should apply to which instructions.  This option
9249 is mostly useful for debugging, as GCC detects the capabilities of
9250 the assembler when it is built and sets the default accordingly.
9251
9252 @item -msmall-data
9253 @itemx -mlarge-data
9254 @opindex msmall-data
9255 @opindex mlarge-data
9256 When @option{-mexplicit-relocs} is in effect, static data is
9257 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
9258 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
9259 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
9260 16-bit relocations off of the @code{$gp} register.  This limits the
9261 size of the small data area to 64KB, but allows the variables to be
9262 directly accessed via a single instruction.
9263
9264 The default is @option{-mlarge-data}.  With this option the data area
9265 is limited to just below 2GB@.  Programs that require more than 2GB of
9266 data must use @code{malloc} or @code{mmap} to allocate the data in the
9267 heap instead of in the program's data segment.
9268
9269 When generating code for shared libraries, @option{-fpic} implies
9270 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
9271
9272 @item -msmall-text
9273 @itemx -mlarge-text
9274 @opindex msmall-text
9275 @opindex mlarge-text
9276 When @option{-msmall-text} is used, the compiler assumes that the
9277 code of the entire program (or shared library) fits in 4MB, and is
9278 thus reachable with a branch instruction.  When @option{-msmall-data}
9279 is used, the compiler can assume that all local symbols share the
9280 same @code{$gp} value, and thus reduce the number of instructions
9281 required for a function call from 4 to 1.
9282
9283 The default is @option{-mlarge-text}.
9284
9285 @item -mcpu=@var{cpu_type}
9286 @opindex mcpu
9287 Set the instruction set and instruction scheduling parameters for
9288 machine type @var{cpu_type}.  You can specify either the @samp{EV}
9289 style name or the corresponding chip number.  GCC supports scheduling
9290 parameters for the EV4, EV5 and EV6 family of processors and will
9291 choose the default values for the instruction set from the processor
9292 you specify.  If you do not specify a processor type, GCC will default
9293 to the processor on which the compiler was built.
9294
9295 Supported values for @var{cpu_type} are
9296
9297 @table @samp
9298 @item ev4
9299 @itemx ev45
9300 @itemx 21064
9301 Schedules as an EV4 and has no instruction set extensions.
9302
9303 @item ev5
9304 @itemx 21164
9305 Schedules as an EV5 and has no instruction set extensions.
9306
9307 @item ev56
9308 @itemx 21164a
9309 Schedules as an EV5 and supports the BWX extension.
9310
9311 @item pca56
9312 @itemx 21164pc
9313 @itemx 21164PC
9314 Schedules as an EV5 and supports the BWX and MAX extensions.
9315
9316 @item ev6
9317 @itemx 21264
9318 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
9319
9320 @item ev67
9321 @itemx 21264a
9322 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
9323 @end table
9324
9325 @item -mtune=@var{cpu_type}
9326 @opindex mtune
9327 Set only the instruction scheduling parameters for machine type
9328 @var{cpu_type}.  The instruction set is not changed.
9329
9330 @item -mmemory-latency=@var{time}
9331 @opindex mmemory-latency
9332 Sets the latency the scheduler should assume for typical memory
9333 references as seen by the application.  This number is highly
9334 dependent on the memory access patterns used by the application
9335 and the size of the external cache on the machine.
9336
9337 Valid options for @var{time} are
9338
9339 @table @samp
9340 @item @var{number}
9341 A decimal number representing clock cycles.
9342
9343 @item L1
9344 @itemx L2
9345 @itemx L3
9346 @itemx main
9347 The compiler contains estimates of the number of clock cycles for
9348 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
9349 (also called Dcache, Scache, and Bcache), as well as to main memory.
9350 Note that L3 is only valid for EV5.
9351
9352 @end table
9353 @end table
9354
9355 @node DEC Alpha/VMS Options
9356 @subsection DEC Alpha/VMS Options
9357
9358 These @samp{-m} options are defined for the DEC Alpha/VMS implementations:
9359
9360 @table @gcctabopt
9361 @item -mvms-return-codes
9362 @opindex mvms-return-codes
9363 Return VMS condition codes from main.  The default is to return POSIX
9364 style condition (e.g.@: error) codes.
9365 @end table
9366
9367 @node FRV Options
9368 @subsection FRV Options
9369 @cindex FRV Options
9370
9371 @table @gcctabopt
9372 @item -mgpr-32
9373 @opindex mgpr-32
9374
9375 Only use the first 32 general purpose registers.
9376
9377 @item -mgpr-64
9378 @opindex mgpr-64
9379
9380 Use all 64 general purpose registers.
9381
9382 @item -mfpr-32
9383 @opindex mfpr-32
9384
9385 Use only the first 32 floating point registers.
9386
9387 @item -mfpr-64
9388 @opindex mfpr-64
9389
9390 Use all 64 floating point registers
9391
9392 @item -mhard-float
9393 @opindex mhard-float
9394
9395 Use hardware instructions for floating point operations.
9396
9397 @item -msoft-float
9398 @opindex msoft-float
9399
9400 Use library routines for floating point operations.
9401
9402 @item -malloc-cc
9403 @opindex malloc-cc
9404
9405 Dynamically allocate condition code registers.
9406
9407 @item -mfixed-cc
9408 @opindex mfixed-cc
9409
9410 Do not try to dynamically allocate condition code registers, only
9411 use @code{icc0} and @code{fcc0}.
9412
9413 @item -mdword
9414 @opindex mdword
9415
9416 Change ABI to use double word insns.
9417
9418 @item -mno-dword
9419 @opindex mno-dword
9420
9421 Do not use double word instructions.
9422
9423 @item -mdouble
9424 @opindex mdouble
9425
9426 Use floating point double instructions.
9427
9428 @item -mno-double
9429 @opindex mno-double
9430
9431 Do not use floating point double instructions.
9432
9433 @item -mmedia
9434 @opindex mmedia
9435
9436 Use media instructions.
9437
9438 @item -mno-media
9439 @opindex mno-media
9440
9441 Do not use media instructions.
9442
9443 @item -mmuladd
9444 @opindex mmuladd
9445
9446 Use multiply and add/subtract instructions.
9447
9448 @item -mno-muladd
9449 @opindex mno-muladd
9450
9451 Do not use multiply and add/subtract instructions.
9452
9453 @item -mfdpic
9454 @opindex mfdpic
9455
9456 Select the FDPIC ABI, that uses function descriptors to represent
9457 pointers to functions.  Without any PIC/PIE-related options, it
9458 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
9459 assumes GOT entries and small data are within a 12-bit range from the
9460 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
9461 are computed with 32 bits.
9462
9463 @item -minline-plt
9464 @opindex minline-plt
9465
9466 Enable inlining of PLT entries in function calls to functions that are
9467 not known to bind locally.  It has no effect without @option{-mfdpic}.
9468 It's enabled by default if optimizing for speed and compiling for
9469 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
9470 optimization option such as @option{-O3} or above is present in the
9471 command line.
9472
9473 @item -mTLS
9474 @opindex TLS
9475
9476 Assume a large TLS segment when generating thread-local code.
9477
9478 @item -mtls
9479 @opindex tls
9480
9481 Do not assume a large TLS segment when generating thread-local code.
9482
9483 @item -mgprel-ro
9484 @opindex mgprel-ro
9485
9486 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
9487 that is known to be in read-only sections.  It's enabled by default,
9488 except for @option{-fpic} or @option{-fpie}: even though it may help
9489 make the global offset table smaller, it trades 1 instruction for 4.
9490 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
9491 one of which may be shared by multiple symbols, and it avoids the need
9492 for a GOT entry for the referenced symbol, so it's more likely to be a
9493 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
9494
9495 @item -multilib-library-pic
9496 @opindex multilib-library-pic
9497
9498 Link with the (library, not FD) pic libraries.  It's implied by
9499 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
9500 @option{-fpic} without @option{-mfdpic}.  You should never have to use
9501 it explicitly.
9502
9503 @item -mlinked-fp
9504 @opindex mlinked-fp
9505
9506 Follow the EABI requirement of always creating a frame pointer whenever
9507 a stack frame is allocated.  This option is enabled by default and can
9508 be disabled with @option{-mno-linked-fp}.
9509
9510 @item -mlong-calls
9511 @opindex mlong-calls
9512
9513 Use indirect addressing to call functions outside the current
9514 compilation unit.  This allows the functions to be placed anywhere
9515 within the 32-bit address space.
9516
9517 @item -malign-labels
9518 @opindex malign-labels
9519
9520 Try to align labels to an 8-byte boundary by inserting nops into the
9521 previous packet.  This option only has an effect when VLIW packing
9522 is enabled.  It doesn't create new packets; it merely adds nops to
9523 existing ones.
9524
9525 @item -mlibrary-pic
9526 @opindex mlibrary-pic
9527
9528 Generate position-independent EABI code.
9529
9530 @item -macc-4
9531 @opindex macc-4
9532
9533 Use only the first four media accumulator registers.
9534
9535 @item -macc-8
9536 @opindex macc-8
9537
9538 Use all eight media accumulator registers.
9539
9540 @item -mpack
9541 @opindex mpack
9542
9543 Pack VLIW instructions.
9544
9545 @item -mno-pack
9546 @opindex mno-pack
9547
9548 Do not pack VLIW instructions.
9549
9550 @item -mno-eflags
9551 @opindex mno-eflags
9552
9553 Do not mark ABI switches in e_flags.
9554
9555 @item -mcond-move
9556 @opindex mcond-move
9557
9558 Enable the use of conditional-move instructions (default).
9559
9560 This switch is mainly for debugging the compiler and will likely be removed
9561 in a future version.
9562
9563 @item -mno-cond-move
9564 @opindex mno-cond-move
9565
9566 Disable the use of conditional-move instructions.
9567
9568 This switch is mainly for debugging the compiler and will likely be removed
9569 in a future version.
9570
9571 @item -mscc
9572 @opindex mscc
9573
9574 Enable the use of conditional set instructions (default).
9575
9576 This switch is mainly for debugging the compiler and will likely be removed
9577 in a future version.
9578
9579 @item -mno-scc
9580 @opindex mno-scc
9581
9582 Disable the use of conditional set instructions.
9583
9584 This switch is mainly for debugging the compiler and will likely be removed
9585 in a future version.
9586
9587 @item -mcond-exec
9588 @opindex mcond-exec
9589
9590 Enable the use of conditional execution (default).
9591
9592 This switch is mainly for debugging the compiler and will likely be removed
9593 in a future version.
9594
9595 @item -mno-cond-exec
9596 @opindex mno-cond-exec
9597
9598 Disable the use of conditional execution.
9599
9600 This switch is mainly for debugging the compiler and will likely be removed
9601 in a future version.
9602
9603 @item -mvliw-branch
9604 @opindex mvliw-branch
9605
9606 Run a pass to pack branches into VLIW instructions (default).
9607
9608 This switch is mainly for debugging the compiler and will likely be removed
9609 in a future version.
9610
9611 @item -mno-vliw-branch
9612 @opindex mno-vliw-branch
9613
9614 Do not run a pass to pack branches into VLIW instructions.
9615
9616 This switch is mainly for debugging the compiler and will likely be removed
9617 in a future version.
9618
9619 @item -mmulti-cond-exec
9620 @opindex mmulti-cond-exec
9621
9622 Enable optimization of @code{&&} and @code{||} in conditional execution
9623 (default).
9624
9625 This switch is mainly for debugging the compiler and will likely be removed
9626 in a future version.
9627
9628 @item -mno-multi-cond-exec
9629 @opindex mno-multi-cond-exec
9630
9631 Disable optimization of @code{&&} and @code{||} in conditional execution.
9632
9633 This switch is mainly for debugging the compiler and will likely be removed
9634 in a future version.
9635
9636 @item -mnested-cond-exec
9637 @opindex mnested-cond-exec
9638
9639 Enable nested conditional execution optimizations (default).
9640
9641 This switch is mainly for debugging the compiler and will likely be removed
9642 in a future version.
9643
9644 @item -mno-nested-cond-exec
9645 @opindex mno-nested-cond-exec
9646
9647 Disable nested conditional execution optimizations.
9648
9649 This switch is mainly for debugging the compiler and will likely be removed
9650 in a future version.
9651
9652 @item -moptimize-membar
9653 @opindex moptimize-membar
9654
9655 This switch removes redundant @code{membar} instructions from the
9656 compiler generated code.  It is enabled by default.
9657
9658 @item -mno-optimize-membar
9659 @opindex mno-optimize-membar
9660
9661 This switch disables the automatic removal of redundant @code{membar}
9662 instructions from the generated code.
9663
9664 @item -mtomcat-stats
9665 @opindex mtomcat-stats
9666
9667 Cause gas to print out tomcat statistics.
9668
9669 @item -mcpu=@var{cpu}
9670 @opindex mcpu
9671
9672 Select the processor type for which to generate code.  Possible values are
9673 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
9674 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
9675
9676 @end table
9677
9678 @node GNU/Linux Options
9679 @subsection GNU/Linux Options
9680
9681 These @samp{-m} options are defined for GNU/Linux targets:
9682
9683 @table @gcctabopt
9684 @item -mglibc
9685 @opindex mglibc
9686 Use the GNU C library instead of uClibc.  This is the default except
9687 on @samp{*-*-linux-*uclibc*} targets.
9688
9689 @item -muclibc
9690 @opindex muclibc
9691 Use uClibc instead of the GNU C library.  This is the default on
9692 @samp{*-*-linux-*uclibc*} targets.
9693 @end table
9694
9695 @node H8/300 Options
9696 @subsection H8/300 Options
9697
9698 These @samp{-m} options are defined for the H8/300 implementations:
9699
9700 @table @gcctabopt
9701 @item -mrelax
9702 @opindex mrelax
9703 Shorten some address references at link time, when possible; uses the
9704 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
9705 ld, Using ld}, for a fuller description.
9706
9707 @item -mh
9708 @opindex mh
9709 Generate code for the H8/300H@.
9710
9711 @item -ms
9712 @opindex ms
9713 Generate code for the H8S@.
9714
9715 @item -mn
9716 @opindex mn
9717 Generate code for the H8S and H8/300H in the normal mode.  This switch
9718 must be used either with @option{-mh} or @option{-ms}.
9719
9720 @item -ms2600
9721 @opindex ms2600
9722 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
9723
9724 @item -mint32
9725 @opindex mint32
9726 Make @code{int} data 32 bits by default.
9727
9728 @item -malign-300
9729 @opindex malign-300
9730 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
9731 The default for the H8/300H and H8S is to align longs and floats on 4
9732 byte boundaries.
9733 @option{-malign-300} causes them to be aligned on 2 byte boundaries.
9734 This option has no effect on the H8/300.
9735 @end table
9736
9737 @node HPPA Options
9738 @subsection HPPA Options
9739 @cindex HPPA Options
9740
9741 These @samp{-m} options are defined for the HPPA family of computers:
9742
9743 @table @gcctabopt
9744 @item -march=@var{architecture-type}
9745 @opindex march
9746 Generate code for the specified architecture.  The choices for
9747 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
9748 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
9749 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
9750 architecture option for your machine.  Code compiled for lower numbered
9751 architectures will run on higher numbered architectures, but not the
9752 other way around.
9753
9754 @item -mpa-risc-1-0
9755 @itemx -mpa-risc-1-1
9756 @itemx -mpa-risc-2-0
9757 @opindex mpa-risc-1-0
9758 @opindex mpa-risc-1-1
9759 @opindex mpa-risc-2-0
9760 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
9761
9762 @item -mbig-switch
9763 @opindex mbig-switch
9764 Generate code suitable for big switch tables.  Use this option only if
9765 the assembler/linker complain about out of range branches within a switch
9766 table.
9767
9768 @item -mjump-in-delay
9769 @opindex mjump-in-delay
9770 Fill delay slots of function calls with unconditional jump instructions
9771 by modifying the return pointer for the function call to be the target
9772 of the conditional jump.
9773
9774 @item -mdisable-fpregs
9775 @opindex mdisable-fpregs
9776 Prevent floating point registers from being used in any manner.  This is
9777 necessary for compiling kernels which perform lazy context switching of
9778 floating point registers.  If you use this option and attempt to perform
9779 floating point operations, the compiler will abort.
9780
9781 @item -mdisable-indexing
9782 @opindex mdisable-indexing
9783 Prevent the compiler from using indexing address modes.  This avoids some
9784 rather obscure problems when compiling MIG generated code under MACH@.
9785
9786 @item -mno-space-regs
9787 @opindex mno-space-regs
9788 Generate code that assumes the target has no space registers.  This allows
9789 GCC to generate faster indirect calls and use unscaled index address modes.
9790
9791 Such code is suitable for level 0 PA systems and kernels.
9792
9793 @item -mfast-indirect-calls
9794 @opindex mfast-indirect-calls
9795 Generate code that assumes calls never cross space boundaries.  This
9796 allows GCC to emit code which performs faster indirect calls.
9797
9798 This option will not work in the presence of shared libraries or nested
9799 functions.
9800
9801 @item -mfixed-range=@var{register-range}
9802 @opindex mfixed-range
9803 Generate code treating the given register range as fixed registers.
9804 A fixed register is one that the register allocator can not use.  This is
9805 useful when compiling kernel code.  A register range is specified as
9806 two registers separated by a dash.  Multiple register ranges can be
9807 specified separated by a comma.
9808
9809 @item -mlong-load-store
9810 @opindex mlong-load-store
9811 Generate 3-instruction load and store sequences as sometimes required by
9812 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
9813 the HP compilers.
9814
9815 @item -mportable-runtime
9816 @opindex mportable-runtime
9817 Use the portable calling conventions proposed by HP for ELF systems.
9818
9819 @item -mgas
9820 @opindex mgas
9821 Enable the use of assembler directives only GAS understands.
9822
9823 @item -mschedule=@var{cpu-type}
9824 @opindex mschedule
9825 Schedule code according to the constraints for the machine type
9826 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
9827 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
9828 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
9829 proper scheduling option for your machine.  The default scheduling is
9830 @samp{8000}.
9831
9832 @item -mlinker-opt
9833 @opindex mlinker-opt
9834 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
9835 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
9836 linkers in which they give bogus error messages when linking some programs.
9837
9838 @item -msoft-float
9839 @opindex msoft-float
9840 Generate output containing library calls for floating point.
9841 @strong{Warning:} the requisite libraries are not available for all HPPA
9842 targets.  Normally the facilities of the machine's usual C compiler are
9843 used, but this cannot be done directly in cross-compilation.  You must make
9844 your own arrangements to provide suitable library functions for
9845 cross-compilation.  The embedded target @samp{hppa1.1-*-pro}
9846 does provide software floating point support.
9847
9848 @option{-msoft-float} changes the calling convention in the output file;
9849 therefore, it is only useful if you compile @emph{all} of a program with
9850 this option.  In particular, you need to compile @file{libgcc.a}, the
9851 library that comes with GCC, with @option{-msoft-float} in order for
9852 this to work.
9853
9854 @item -msio
9855 @opindex msio
9856 Generate the predefine, @code{_SIO}, for server IO@.  The default is
9857 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
9858 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
9859 options are available under HP-UX and HI-UX@.
9860
9861 @item -mgnu-ld
9862 @opindex gnu-ld
9863 Use GNU ld specific options.  This passes @option{-shared} to ld when
9864 building a shared library.  It is the default when GCC is configured,
9865 explicitly or implicitly, with the GNU linker.  This option does not
9866 have any affect on which ld is called, it only changes what parameters
9867 are passed to that ld.  The ld that is called is determined by the
9868 @option{--with-ld} configure option, GCC's program search path, and
9869 finally by the user's @env{PATH}.  The linker used by GCC can be printed
9870 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
9871 on the 64 bit HP-UX GCC, i.e. configured with @samp{hppa*64*-*-hpux*}.
9872
9873 @item -mhp-ld
9874 @opindex hp-ld
9875 Use HP ld specific options.  This passes @option{-b} to ld when building
9876 a shared library and passes @option{+Accept TypeMismatch} to ld on all
9877 links.  It is the default when GCC is configured, explicitly or
9878 implicitly, with the HP linker.  This option does not have any affect on
9879 which ld is called, it only changes what parameters are passed to that
9880 ld.  The ld that is called is determined by the @option{--with-ld}
9881 configure option, GCC's program search path, and finally by the user's
9882 @env{PATH}.  The linker used by GCC can be printed using @samp{which
9883 `gcc -print-prog-name=ld`}.  This option is only available on the 64 bit
9884 HP-UX GCC, i.e. configured with @samp{hppa*64*-*-hpux*}.
9885
9886 @item -mlong-calls
9887 @opindex mno-long-calls
9888 Generate code that uses long call sequences.  This ensures that a call
9889 is always able to reach linker generated stubs.  The default is to generate
9890 long calls only when the distance from the call site to the beginning
9891 of the function or translation unit, as the case may be, exceeds a
9892 predefined limit set by the branch type being used.  The limits for
9893 normal calls are 7,600,000 and 240,000 bytes, respectively for the
9894 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
9895 240,000 bytes.
9896
9897 Distances are measured from the beginning of functions when using the
9898 @option{-ffunction-sections} option, or when using the @option{-mgas}
9899 and @option{-mno-portable-runtime} options together under HP-UX with
9900 the SOM linker.
9901
9902 It is normally not desirable to use this option as it will degrade
9903 performance.  However, it may be useful in large applications,
9904 particularly when partial linking is used to build the application.
9905
9906 The types of long calls used depends on the capabilities of the
9907 assembler and linker, and the type of code being generated.  The
9908 impact on systems that support long absolute calls, and long pic
9909 symbol-difference or pc-relative calls should be relatively small.
9910 However, an indirect call is used on 32-bit ELF systems in pic code
9911 and it is quite long.
9912
9913 @item -munix=@var{unix-std}
9914 @opindex march
9915 Generate compiler predefines and select a startfile for the specified
9916 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
9917 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
9918 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
9919 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
9920 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
9921 and later.
9922
9923 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
9924 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
9925 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
9926 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
9927 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
9928 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
9929
9930 It is @emph{important} to note that this option changes the interfaces
9931 for various library routines.  It also affects the operational behavior
9932 of the C library.  Thus, @emph{extreme} care is needed in using this
9933 option.
9934
9935 Library code that is intended to operate with more than one UNIX
9936 standard must test, set and restore the variable @var{__xpg4_extended_mask}
9937 as appropriate.  Most GNU software doesn't provide this capability.
9938
9939 @item -nolibdld
9940 @opindex nolibdld
9941 Suppress the generation of link options to search libdld.sl when the
9942 @option{-static} option is specified on HP-UX 10 and later.
9943
9944 @item -static
9945 @opindex static
9946 The HP-UX implementation of setlocale in libc has a dependency on
9947 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
9948 when the @option{-static} option is specified, special link options
9949 are needed to resolve this dependency.
9950
9951 On HP-UX 10 and later, the GCC driver adds the necessary options to
9952 link with libdld.sl when the @option{-static} option is specified.
9953 This causes the resulting binary to be dynamic.  On the 64-bit port,
9954 the linkers generate dynamic binaries by default in any case.  The
9955 @option{-nolibdld} option can be used to prevent the GCC driver from
9956 adding these link options.
9957
9958 @item -threads
9959 @opindex threads
9960 Add support for multithreading with the @dfn{dce thread} library
9961 under HP-UX@.  This option sets flags for both the preprocessor and
9962 linker.
9963 @end table
9964
9965 @node i386 and x86-64 Options
9966 @subsection Intel 386 and AMD x86-64 Options
9967 @cindex i386 Options
9968 @cindex x86-64 Options
9969 @cindex Intel 386 Options
9970 @cindex AMD x86-64 Options
9971
9972 These @samp{-m} options are defined for the i386 and x86-64 family of
9973 computers:
9974
9975 @table @gcctabopt
9976 @item -mtune=@var{cpu-type}
9977 @opindex mtune
9978 Tune to @var{cpu-type} everything applicable about the generated code, except
9979 for the ABI and the set of available instructions.  The choices for
9980 @var{cpu-type} are:
9981 @table @emph
9982 @item generic
9983 Produce code optimized for the most common IA32/AMD64/EM64T processors.
9984 If you know the CPU on which your code will run, then you should use
9985 the corresponding @option{-mtune} option instead of
9986 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
9987 of your application will have, then you should use this option.
9988
9989 As new processors are deployed in the marketplace, the behavior of this
9990 option will change.  Therefore, if you upgrade to a newer version of
9991 GCC, the code generated option will change to reflect the processors
9992 that were most common when that version of GCC was released.
9993
9994 There is no @option{-march=generic} option because @option{-march}
9995 indicates the instruction set the compiler can use, and there is no
9996 generic instruction set applicable to all processors.  In contrast,
9997 @option{-mtune} indicates the processor (or, in this case, collection of
9998 processors) for which the code is optimized.
9999 @item native
10000 This selects the CPU to tune for at compilation time by determining
10001 the processor type of the compiling machine.  Using @option{-mtune=native}
10002 will produce code optimized for the local machine under the constraints
10003 of the selected instruction set.  Using @option{-march=native} will
10004 enable all instruction subsets supported by the local machine (hence
10005 the result might not run on different machines).
10006 @item i386
10007 Original Intel's i386 CPU@.
10008 @item i486
10009 Intel's i486 CPU@.  (No scheduling is implemented for this chip.)
10010 @item i586, pentium
10011 Intel Pentium CPU with no MMX support.
10012 @item pentium-mmx
10013 Intel PentiumMMX CPU based on Pentium core with MMX instruction set support.
10014 @item pentiumpro
10015 Intel PentiumPro CPU@.
10016 @item i686
10017 Same as @code{generic}, but when used as @code{march} option, PentiumPro
10018 instruction set will be used, so the code will run on all i686 family chips.
10019 @item pentium2
10020 Intel Pentium2 CPU based on PentiumPro core with MMX instruction set support.
10021 @item pentium3, pentium3m
10022 Intel Pentium3 CPU based on PentiumPro core with MMX and SSE instruction set
10023 support.
10024 @item pentium-m
10025 Low power version of Intel Pentium3 CPU with MMX, SSE and SSE2 instruction set
10026 support.  Used by Centrino notebooks.
10027 @item pentium4, pentium4m
10028 Intel Pentium4 CPU with MMX, SSE and SSE2 instruction set support.
10029 @item prescott
10030 Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2 and SSE3 instruction
10031 set support.
10032 @item nocona
10033 Improved version of Intel Pentium4 CPU with 64-bit extensions, MMX, SSE,
10034 SSE2 and SSE3 instruction set support.
10035 @item core2
10036 Intel Core2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
10037 instruction set support.
10038 @item k6
10039 AMD K6 CPU with MMX instruction set support.
10040 @item k6-2, k6-3
10041 Improved versions of AMD K6 CPU with MMX and 3dNOW! instruction set support.
10042 @item athlon, athlon-tbird
10043 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and SSE prefetch instructions
10044 support.
10045 @item athlon-4, athlon-xp, athlon-mp
10046 Improved AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and full SSE
10047 instruction set support.
10048 @item k8, opteron, athlon64, athlon-fx
10049 AMD K8 core based CPUs with x86-64 instruction set support.  (This supersets
10050 MMX, SSE, SSE2, 3dNOW!, enhanced 3dNOW! and 64-bit instruction set extensions.)
10051 @item k8-sse3, opteron-sse3, athlon64-sse3
10052 Improved versions of k8, opteron and athlon64 with SSE3 instruction set support.
10053 @item amdfam10, barcelona
10054 AMD Family 10h core based CPUs with x86-64 instruction set support.  (This
10055 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3dNOW!, enhanced 3dNOW!, ABM and 64-bit
10056 instruction set extensions.)
10057 @item winchip-c6
10058 IDT Winchip C6 CPU, dealt in same way as i486 with additional MMX instruction
10059 set support.
10060 @item winchip2
10061 IDT Winchip2 CPU, dealt in same way as i486 with additional MMX and 3dNOW!
10062 instruction set support.
10063 @item c3
10064 Via C3 CPU with MMX and 3dNOW! instruction set support.  (No scheduling is
10065 implemented for this chip.)
10066 @item c3-2
10067 Via C3-2 CPU with MMX and SSE instruction set support.  (No scheduling is
10068 implemented for this chip.)
10069 @item geode
10070 Embedded AMD CPU with MMX and 3dNOW! instruction set support.
10071 @end table
10072
10073 While picking a specific @var{cpu-type} will schedule things appropriately
10074 for that particular chip, the compiler will not generate any code that
10075 does not run on the i386 without the @option{-march=@var{cpu-type}} option
10076 being used.
10077
10078 @item -march=@var{cpu-type}
10079 @opindex march
10080 Generate instructions for the machine type @var{cpu-type}.  The choices
10081 for @var{cpu-type} are the same as for @option{-mtune}.  Moreover,
10082 specifying @option{-march=@var{cpu-type}} implies @option{-mtune=@var{cpu-type}}.
10083
10084 @item -mcpu=@var{cpu-type}
10085 @opindex mcpu
10086 A deprecated synonym for @option{-mtune}.
10087
10088 @item -mfpmath=@var{unit}
10089 @opindex march
10090 Generate floating point arithmetics for selected unit @var{unit}.  The choices
10091 for @var{unit} are:
10092
10093 @table @samp
10094 @item 387
10095 Use the standard 387 floating point coprocessor present majority of chips and
10096 emulated otherwise.  Code compiled with this option will run almost everywhere.
10097 The temporary results are computed in 80bit precision instead of precision
10098 specified by the type resulting in slightly different results compared to most
10099 of other chips.  See @option{-ffloat-store} for more detailed description.
10100
10101 This is the default choice for i386 compiler.
10102
10103 @item sse
10104 Use scalar floating point instructions present in the SSE instruction set.
10105 This instruction set is supported by Pentium3 and newer chips, in the AMD line
10106 by Athlon-4, Athlon-xp and Athlon-mp chips.  The earlier version of SSE
10107 instruction set supports only single precision arithmetics, thus the double and
10108 extended precision arithmetics is still done using 387.  Later version, present
10109 only in Pentium4 and the future AMD x86-64 chips supports double precision
10110 arithmetics too.
10111
10112 For the i386 compiler, you need to use @option{-march=@var{cpu-type}}, @option{-msse}
10113 or @option{-msse2} switches to enable SSE extensions and make this option
10114 effective.  For the x86-64 compiler, these extensions are enabled by default.
10115
10116 The resulting code should be considerably faster in the majority of cases and avoid
10117 the numerical instability problems of 387 code, but may break some existing
10118 code that expects temporaries to be 80bit.
10119
10120 This is the default choice for the x86-64 compiler.
10121
10122 @item sse,387
10123 Attempt to utilize both instruction sets at once.  This effectively double the
10124 amount of available registers and on chips with separate execution units for
10125 387 and SSE the execution resources too.  Use this option with care, as it is
10126 still experimental, because the GCC register allocator does not model separate
10127 functional units well resulting in instable performance.
10128 @end table
10129
10130 @item -masm=@var{dialect}
10131 @opindex masm=@var{dialect}
10132 Output asm instructions using selected @var{dialect}.  Supported
10133 choices are @samp{intel} or @samp{att} (the default one).  Darwin does
10134 not support @samp{intel}.
10135
10136 @item -mieee-fp
10137 @itemx -mno-ieee-fp
10138 @opindex mieee-fp
10139 @opindex mno-ieee-fp
10140 Control whether or not the compiler uses IEEE floating point
10141 comparisons.  These handle correctly the case where the result of a
10142 comparison is unordered.
10143
10144 @item -msoft-float
10145 @opindex msoft-float
10146 Generate output containing library calls for floating point.
10147 @strong{Warning:} the requisite libraries are not part of GCC@.
10148 Normally the facilities of the machine's usual C compiler are used, but
10149 this can't be done directly in cross-compilation.  You must make your
10150 own arrangements to provide suitable library functions for
10151 cross-compilation.
10152
10153 On machines where a function returns floating point results in the 80387
10154 register stack, some floating point opcodes may be emitted even if
10155 @option{-msoft-float} is used.
10156
10157 @item -mno-fp-ret-in-387
10158 @opindex mno-fp-ret-in-387
10159 Do not use the FPU registers for return values of functions.
10160
10161 The usual calling convention has functions return values of types
10162 @code{float} and @code{double} in an FPU register, even if there
10163 is no FPU@.  The idea is that the operating system should emulate
10164 an FPU@.
10165
10166 The option @option{-mno-fp-ret-in-387} causes such values to be returned
10167 in ordinary CPU registers instead.
10168
10169 @item -mno-fancy-math-387
10170 @opindex mno-fancy-math-387
10171 Some 387 emulators do not support the @code{sin}, @code{cos} and
10172 @code{sqrt} instructions for the 387.  Specify this option to avoid
10173 generating those instructions.  This option is the default on FreeBSD,
10174 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
10175 indicates that the target cpu will always have an FPU and so the
10176 instruction will not need emulation.  As of revision 2.6.1, these
10177 instructions are not generated unless you also use the
10178 @option{-funsafe-math-optimizations} switch.
10179
10180 @item -malign-double
10181 @itemx -mno-align-double
10182 @opindex malign-double
10183 @opindex mno-align-double
10184 Control whether GCC aligns @code{double}, @code{long double}, and
10185 @code{long long} variables on a two word boundary or a one word
10186 boundary.  Aligning @code{double} variables on a two word boundary will
10187 produce code that runs somewhat faster on a @samp{Pentium} at the
10188 expense of more memory.
10189
10190 On x86-64, @option{-malign-double} is enabled by default.
10191
10192 @strong{Warning:} if you use the @option{-malign-double} switch,
10193 structures containing the above types will be aligned differently than
10194 the published application binary interface specifications for the 386
10195 and will not be binary compatible with structures in code compiled
10196 without that switch.
10197
10198 @item -m96bit-long-double
10199 @itemx -m128bit-long-double
10200 @opindex m96bit-long-double
10201 @opindex m128bit-long-double
10202 These switches control the size of @code{long double} type.  The i386
10203 application binary interface specifies the size to be 96 bits,
10204 so @option{-m96bit-long-double} is the default in 32 bit mode.
10205
10206 Modern architectures (Pentium and newer) would prefer @code{long double}
10207 to be aligned to an 8 or 16 byte boundary.  In arrays or structures
10208 conforming to the ABI, this would not be possible.  So specifying a
10209 @option{-m128bit-long-double} will align @code{long double}
10210 to a 16 byte boundary by padding the @code{long double} with an additional
10211 32 bit zero.
10212
10213 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
10214 its ABI specifies that @code{long double} is to be aligned on 16 byte boundary.
10215
10216 Notice that neither of these options enable any extra precision over the x87
10217 standard of 80 bits for a @code{long double}.
10218
10219 @strong{Warning:} if you override the default value for your target ABI, the
10220 structures and arrays containing @code{long double} variables will change
10221 their size as well as function calling convention for function taking
10222 @code{long double} will be modified.  Hence they will not be binary
10223 compatible with arrays or structures in code compiled without that switch.
10224
10225 @item -mmlarge-data-threshold=@var{number}
10226 @opindex mlarge-data-threshold=@var{number}
10227 When @option{-mcmodel=medium} is specified, the data greater than
10228 @var{threshold} are placed in large data section.  This value must be the
10229 same across all object linked into the binary and defaults to 65535.
10230
10231 @item -mrtd
10232 @opindex mrtd
10233 Use a different function-calling convention, in which functions that
10234 take a fixed number of arguments return with the @code{ret} @var{num}
10235 instruction, which pops their arguments while returning.  This saves one
10236 instruction in the caller since there is no need to pop the arguments
10237 there.
10238
10239 You can specify that an individual function is called with this calling
10240 sequence with the function attribute @samp{stdcall}.  You can also
10241 override the @option{-mrtd} option by using the function attribute
10242 @samp{cdecl}.  @xref{Function Attributes}.
10243
10244 @strong{Warning:} this calling convention is incompatible with the one
10245 normally used on Unix, so you cannot use it if you need to call
10246 libraries compiled with the Unix compiler.
10247
10248 Also, you must provide function prototypes for all functions that
10249 take variable numbers of arguments (including @code{printf});
10250 otherwise incorrect code will be generated for calls to those
10251 functions.
10252
10253 In addition, seriously incorrect code will result if you call a
10254 function with too many arguments.  (Normally, extra arguments are
10255 harmlessly ignored.)
10256
10257 @item -mregparm=@var{num}
10258 @opindex mregparm
10259 Control how many registers are used to pass integer arguments.  By
10260 default, no registers are used to pass arguments, and at most 3
10261 registers can be used.  You can control this behavior for a specific
10262 function by using the function attribute @samp{regparm}.
10263 @xref{Function Attributes}.
10264
10265 @strong{Warning:} if you use this switch, and
10266 @var{num} is nonzero, then you must build all modules with the same
10267 value, including any libraries.  This includes the system libraries and
10268 startup modules.
10269
10270 @item -msseregparm
10271 @opindex msseregparm
10272 Use SSE register passing conventions for float and double arguments
10273 and return values.  You can control this behavior for a specific
10274 function by using the function attribute @samp{sseregparm}.
10275 @xref{Function Attributes}.
10276
10277 @strong{Warning:} if you use this switch then you must build all
10278 modules with the same value, including any libraries.  This includes
10279 the system libraries and startup modules.
10280
10281 @item -mpc32
10282 @itemx -mpc64
10283 @itemx -mpc80
10284 @opindex mpc32
10285 @opindex mpc64
10286 @opindex mpc80
10287
10288 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
10289 is specified, the significands of results of floating-point operations are
10290 rounded to 24 bits (single precision); @option{-mpc64} rounds the the
10291 significands of results of floating-point operations to 53 bits (double
10292 precision) and @option{-mpc80} rounds the significands of results of
10293 floating-point operations to 64 bits (extended double precision), which is
10294 the default.  When this option is used, floating-point operations in higher
10295 precisions are not available to the programmer without setting the FPU
10296 control word explicitly.
10297
10298 Setting the rounding of floating-point operations to less than the default
10299 80 bits can speed some programs by 2% or more.  Note that some mathematical
10300 libraries assume that extended precision (80 bit) floating-point operations
10301 are enabled by default; routines in such libraries could suffer significant
10302 loss of accuracy, typically through so-called "catastrophic cancellation",
10303 when this option is used to set the precision to less than extended precision. 
10304
10305 @item -mstackrealign
10306 @opindex mstackrealign
10307 Realign the stack at entry.  On the Intel x86, the
10308 @option{-mstackrealign} option will generate an alternate prologue and
10309 epilogue that realigns the runtime stack.  This supports mixing legacy
10310 codes that keep a 4-byte aligned stack with modern codes that keep a
10311 16-byte stack for SSE compatibility.  The alternate prologue and
10312 epilogue are slower and bigger than the regular ones, and the
10313 alternate prologue requires an extra scratch register; this lowers the
10314 number of registers available if used in conjunction with the
10315 @code{regparm} attribute.  The @option{-mstackrealign} option is
10316 incompatible with the nested function prologue; this is considered a
10317 hard error.  See also the attribute @code{force_align_arg_pointer},
10318 applicable to individual functions.
10319
10320 @item -mpreferred-stack-boundary=@var{num}
10321 @opindex mpreferred-stack-boundary
10322 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
10323 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
10324 the default is 4 (16 bytes or 128 bits).
10325
10326 On Pentium and PentiumPro, @code{double} and @code{long double} values
10327 should be aligned to an 8 byte boundary (see @option{-malign-double}) or
10328 suffer significant run time performance penalties.  On Pentium III, the
10329 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
10330 properly if it is not 16 byte aligned.
10331
10332 To ensure proper alignment of this values on the stack, the stack boundary
10333 must be as aligned as that required by any value stored on the stack.
10334 Further, every function must be generated such that it keeps the stack
10335 aligned.  Thus calling a function compiled with a higher preferred
10336 stack boundary from a function compiled with a lower preferred stack
10337 boundary will most likely misalign the stack.  It is recommended that
10338 libraries that use callbacks always use the default setting.
10339
10340 This extra alignment does consume extra stack space, and generally
10341 increases code size.  Code that is sensitive to stack space usage, such
10342 as embedded systems and operating system kernels, may want to reduce the
10343 preferred alignment to @option{-mpreferred-stack-boundary=2}.
10344
10345 @item -mmmx
10346 @itemx -mno-mmx
10347 @item -msse
10348 @itemx -mno-sse
10349 @item -msse2
10350 @itemx -mno-sse2
10351 @item -msse3
10352 @itemx -mno-sse3
10353 @item -mssse3
10354 @itemx -mno-ssse3
10355 @item -msse4.1
10356 @itemx -mno-sse4.1
10357 @item -msse4.2
10358 @itemx -mno-sse4.2
10359 @item -msse4
10360 @itemx -mno-sse4
10361 @item -msse4a
10362 @item -mno-sse4a
10363 @item -m3dnow
10364 @itemx -mno-3dnow
10365 @item -mpopcnt
10366 @itemx -mno-popcnt
10367 @item -mabm
10368 @itemx -mno-abm
10369 @opindex mmmx
10370 @opindex mno-mmx
10371 @opindex msse
10372 @opindex mno-sse
10373 @opindex m3dnow
10374 @opindex mno-3dnow
10375 These switches enable or disable the use of instructions in the MMX,
10376 SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4A, ABM or 3DNow! extended
10377 instruction sets.
10378 These extensions are also available as built-in functions: see
10379 @ref{X86 Built-in Functions}, for details of the functions enabled and
10380 disabled by these switches.
10381
10382 To have SSE/SSE2 instructions generated automatically from floating-point
10383 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
10384
10385 These options will enable GCC to use these extended instructions in
10386 generated code, even without @option{-mfpmath=sse}.  Applications which
10387 perform runtime CPU detection must compile separate files for each
10388 supported architecture, using the appropriate flags.  In particular,
10389 the file containing the CPU detection code should be compiled without
10390 these options.
10391
10392 @item -mcx16
10393 @opindex mcx16
10394 This option will enable GCC to use CMPXCHG16B instruction in generated code.
10395 CMPXCHG16B allows for atomic operations on 128-bit double quadword (or oword)
10396 data types.  This is useful for high resolution counters that could be updated
10397 by multiple processors (or cores).  This instruction is generated as part of
10398 atomic built-in functions: see @ref{Atomic Builtins} for details.
10399
10400 @item -msahf
10401 @opindex msahf
10402 This option will enable GCC to use SAHF instruction in generated 64-bit code.
10403 Early Intel CPUs with Intel 64 lacked LAHF and SAHF instructions supported
10404 by AMD64 until introduction of Pentium 4 G1 step in December 2005.  LAHF and
10405 SAHF are load and store instructions, respectively, for certain status flags.
10406 In 64-bit mode, SAHF instruction is used to optimize @code{fmod}, @code{drem}
10407 or @code{remainder} built-in functions: see @ref{Other Builtins} for details.
10408
10409 @item -mrecip
10410 @opindex mrecip
10411 This option will enable GCC to use RCPSS and RSQRTSS instructions (and their
10412 vectorized variants RCPPS and RSQRTPS) instead of DIVSS and SQRTSS (and their
10413 vectorized variants).  These instructions will be generated only when
10414 @option{-funsafe-math-optimizations} is enabled.
10415
10416 @item -mpush-args
10417 @itemx -mno-push-args
10418 @opindex mpush-args
10419 @opindex mno-push-args
10420 Use PUSH operations to store outgoing parameters.  This method is shorter
10421 and usually equally fast as method using SUB/MOV operations and is enabled
10422 by default.  In some cases disabling it may improve performance because of
10423 improved scheduling and reduced dependencies.
10424
10425 @item -maccumulate-outgoing-args
10426 @opindex maccumulate-outgoing-args
10427 If enabled, the maximum amount of space required for outgoing arguments will be
10428 computed in the function prologue.  This is faster on most modern CPUs
10429 because of reduced dependencies, improved scheduling and reduced stack usage
10430 when preferred stack boundary is not equal to 2.  The drawback is a notable
10431 increase in code size.  This switch implies @option{-mno-push-args}.
10432
10433 @item -mthreads
10434 @opindex mthreads
10435 Support thread-safe exception handling on @samp{Mingw32}.  Code that relies
10436 on thread-safe exception handling must compile and link all code with the
10437 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
10438 @option{-D_MT}; when linking, it links in a special thread helper library
10439 @option{-lmingwthrd} which cleans up per thread exception handling data.
10440
10441 @item -mno-align-stringops
10442 @opindex mno-align-stringops
10443 Do not align destination of inlined string operations.  This switch reduces
10444 code size and improves performance in case the destination is already aligned,
10445 but GCC doesn't know about it.
10446
10447 @item -minline-all-stringops
10448 @opindex minline-all-stringops
10449 By default GCC inlines string operations only when destination is known to be
10450 aligned at least to 4 byte boundary.  This enables more inlining, increase code
10451 size, but may improve performance of code that depends on fast memcpy, strlen
10452 and memset for short lengths.
10453
10454 @item -minline-stringops-dynamically
10455 @opindex minline-stringops-dynamically
10456 For string operation of unknown size, inline runtime checks so for small
10457 blocks inline code is used, while for large blocks library call is used.
10458
10459 @item -mstringop-strategy=@var{alg}
10460 @opindex mstringop-strategy=@var{alg}
10461 Overwrite internal decision heuristic about particular algorithm to inline
10462 string operation with.  The allowed values are @code{rep_byte},
10463 @code{rep_4byte}, @code{rep_8byte} for expanding using i386 @code{rep} prefix
10464 of specified size, @code{byte_loop}, @code{loop}, @code{unrolled_loop} for
10465 expanding inline loop, @code{libcall} for always expanding library call.
10466
10467 @item -momit-leaf-frame-pointer
10468 @opindex momit-leaf-frame-pointer
10469 Don't keep the frame pointer in a register for leaf functions.  This
10470 avoids the instructions to save, set up and restore frame pointers and
10471 makes an extra register available in leaf functions.  The option
10472 @option{-fomit-frame-pointer} removes the frame pointer for all functions
10473 which might make debugging harder.
10474
10475 @item -mtls-direct-seg-refs
10476 @itemx -mno-tls-direct-seg-refs
10477 @opindex mtls-direct-seg-refs
10478 Controls whether TLS variables may be accessed with offsets from the
10479 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
10480 or whether the thread base pointer must be added.  Whether or not this
10481 is legal depends on the operating system, and whether it maps the
10482 segment to cover the entire TLS area.
10483
10484 For systems that use GNU libc, the default is on.
10485 @end table
10486
10487 These @samp{-m} switches are supported in addition to the above
10488 on AMD x86-64 processors in 64-bit environments.
10489
10490 @table @gcctabopt
10491 @item -m32
10492 @itemx -m64
10493 @opindex m32
10494 @opindex m64
10495 Generate code for a 32-bit or 64-bit environment.
10496 The 32-bit environment sets int, long and pointer to 32 bits and
10497 generates code that runs on any i386 system.
10498 The 64-bit environment sets int to 32 bits and long and pointer
10499 to 64 bits and generates code for AMD's x86-64 architecture. For
10500 darwin only the -m64 option turns off the @option{-fno-pic} and
10501 @option{-mdynamic-no-pic} options.
10502
10503 @item -mno-red-zone
10504 @opindex no-red-zone
10505 Do not use a so called red zone for x86-64 code.  The red zone is mandated
10506 by the x86-64 ABI, it is a 128-byte area beyond the location of the
10507 stack pointer that will not be modified by signal or interrupt handlers
10508 and therefore can be used for temporary data without adjusting the stack
10509 pointer.  The flag @option{-mno-red-zone} disables this red zone.
10510
10511 @item -mcmodel=small
10512 @opindex mcmodel=small
10513 Generate code for the small code model: the program and its symbols must
10514 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
10515 Programs can be statically or dynamically linked.  This is the default
10516 code model.
10517
10518 @item -mcmodel=kernel
10519 @opindex mcmodel=kernel
10520 Generate code for the kernel code model.  The kernel runs in the
10521 negative 2 GB of the address space.
10522 This model has to be used for Linux kernel code.
10523
10524 @item -mcmodel=medium
10525 @opindex mcmodel=medium
10526 Generate code for the medium model: The program is linked in the lower 2
10527 GB of the address space but symbols can be located anywhere in the
10528 address space.  Programs can be statically or dynamically linked, but
10529 building of shared libraries are not supported with the medium model.
10530
10531 @item -mcmodel=large
10532 @opindex mcmodel=large
10533 Generate code for the large model: This model makes no assumptions
10534 about addresses and sizes of sections.
10535 @end table
10536
10537 @node IA-64 Options
10538 @subsection IA-64 Options
10539 @cindex IA-64 Options
10540
10541 These are the @samp{-m} options defined for the Intel IA-64 architecture.
10542
10543 @table @gcctabopt
10544 @item -mbig-endian
10545 @opindex mbig-endian
10546 Generate code for a big endian target.  This is the default for HP-UX@.
10547
10548 @item -mlittle-endian
10549 @opindex mlittle-endian
10550 Generate code for a little endian target.  This is the default for AIX5
10551 and GNU/Linux.
10552
10553 @item -mgnu-as
10554 @itemx -mno-gnu-as
10555 @opindex mgnu-as
10556 @opindex mno-gnu-as
10557 Generate (or don't) code for the GNU assembler.  This is the default.
10558 @c Also, this is the default if the configure option @option{--with-gnu-as}
10559 @c is used.
10560
10561 @item -mgnu-ld
10562 @itemx -mno-gnu-ld
10563 @opindex mgnu-ld
10564 @opindex mno-gnu-ld
10565 Generate (or don't) code for the GNU linker.  This is the default.
10566 @c Also, this is the default if the configure option @option{--with-gnu-ld}
10567 @c is used.
10568
10569 @item -mno-pic
10570 @opindex mno-pic
10571 Generate code that does not use a global pointer register.  The result
10572 is not position independent code, and violates the IA-64 ABI@.
10573
10574 @item -mvolatile-asm-stop
10575 @itemx -mno-volatile-asm-stop
10576 @opindex mvolatile-asm-stop
10577 @opindex mno-volatile-asm-stop
10578 Generate (or don't) a stop bit immediately before and after volatile asm
10579 statements.
10580
10581 @item -mregister-names
10582 @itemx -mno-register-names
10583 @opindex mregister-names
10584 @opindex mno-register-names
10585 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
10586 the stacked registers.  This may make assembler output more readable.
10587
10588 @item -mno-sdata
10589 @itemx -msdata
10590 @opindex mno-sdata
10591 @opindex msdata
10592 Disable (or enable) optimizations that use the small data section.  This may
10593 be useful for working around optimizer bugs.
10594
10595 @item -mconstant-gp
10596 @opindex mconstant-gp
10597 Generate code that uses a single constant global pointer value.  This is
10598 useful when compiling kernel code.
10599
10600 @item -mauto-pic
10601 @opindex mauto-pic
10602 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
10603 This is useful when compiling firmware code.
10604
10605 @item -minline-float-divide-min-latency
10606 @opindex minline-float-divide-min-latency
10607 Generate code for inline divides of floating point values
10608 using the minimum latency algorithm.
10609
10610 @item -minline-float-divide-max-throughput
10611 @opindex minline-float-divide-max-throughput
10612 Generate code for inline divides of floating point values
10613 using the maximum throughput algorithm.
10614
10615 @item -minline-int-divide-min-latency
10616 @opindex minline-int-divide-min-latency
10617 Generate code for inline divides of integer values
10618 using the minimum latency algorithm.
10619
10620 @item -minline-int-divide-max-throughput
10621 @opindex minline-int-divide-max-throughput
10622 Generate code for inline divides of integer values
10623 using the maximum throughput algorithm.
10624
10625 @item -minline-sqrt-min-latency
10626 @opindex minline-sqrt-min-latency
10627 Generate code for inline square roots
10628 using the minimum latency algorithm.
10629
10630 @item -minline-sqrt-max-throughput
10631 @opindex minline-sqrt-max-throughput
10632 Generate code for inline square roots
10633 using the maximum throughput algorithm.
10634
10635 @item -mno-dwarf2-asm
10636 @itemx -mdwarf2-asm
10637 @opindex mno-dwarf2-asm
10638 @opindex mdwarf2-asm
10639 Don't (or do) generate assembler code for the DWARF2 line number debugging
10640 info.  This may be useful when not using the GNU assembler.
10641
10642 @item -mearly-stop-bits
10643 @itemx -mno-early-stop-bits
10644 @opindex mearly-stop-bits
10645 @opindex mno-early-stop-bits
10646 Allow stop bits to be placed earlier than immediately preceding the
10647 instruction that triggered the stop bit.  This can improve instruction
10648 scheduling, but does not always do so.
10649
10650 @item -mfixed-range=@var{register-range}
10651 @opindex mfixed-range
10652 Generate code treating the given register range as fixed registers.
10653 A fixed register is one that the register allocator can not use.  This is
10654 useful when compiling kernel code.  A register range is specified as
10655 two registers separated by a dash.  Multiple register ranges can be
10656 specified separated by a comma.
10657
10658 @item -mtls-size=@var{tls-size}
10659 @opindex mtls-size
10660 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
10661 64.
10662
10663 @item -mtune=@var{cpu-type}
10664 @opindex mtune
10665 Tune the instruction scheduling for a particular CPU, Valid values are
10666 itanium, itanium1, merced, itanium2, and mckinley.
10667
10668 @item -mt
10669 @itemx -pthread
10670 @opindex mt
10671 @opindex pthread
10672 Add support for multithreading using the POSIX threads library.  This
10673 option sets flags for both the preprocessor and linker.  It does
10674 not affect the thread safety of object code produced by the compiler or
10675 that of libraries supplied with it.  These are HP-UX specific flags.
10676
10677 @item -milp32
10678 @itemx -mlp64
10679 @opindex milp32
10680 @opindex mlp64
10681 Generate code for a 32-bit or 64-bit environment.
10682 The 32-bit environment sets int, long and pointer to 32 bits.
10683 The 64-bit environment sets int to 32 bits and long and pointer
10684 to 64 bits.  These are HP-UX specific flags.
10685
10686 @item -mno-sched-br-data-spec
10687 @itemx -msched-br-data-spec
10688 @opindex mno-sched-br-data-spec
10689 @opindex msched-br-data-spec
10690 (Dis/En)able data speculative scheduling before reload.
10691 This will result in generation of the ld.a instructions and
10692 the corresponding check instructions (ld.c / chk.a).
10693 The default is 'disable'.
10694
10695 @item -msched-ar-data-spec
10696 @itemx -mno-sched-ar-data-spec
10697 @opindex msched-ar-data-spec
10698 @opindex mno-sched-ar-data-spec
10699 (En/Dis)able data speculative scheduling after reload.
10700 This will result in generation of the ld.a instructions and
10701 the corresponding check instructions (ld.c / chk.a).
10702 The default is 'enable'.
10703
10704 @item -mno-sched-control-spec
10705 @itemx -msched-control-spec
10706 @opindex mno-sched-control-spec
10707 @opindex msched-control-spec
10708 (Dis/En)able control speculative scheduling.  This feature is
10709 available only during region scheduling (i.e. before reload).
10710 This will result in generation of the ld.s instructions and
10711 the corresponding check instructions chk.s .
10712 The default is 'disable'.
10713
10714 @item -msched-br-in-data-spec
10715 @itemx -mno-sched-br-in-data-spec
10716 @opindex msched-br-in-data-spec
10717 @opindex mno-sched-br-in-data-spec
10718 (En/Dis)able speculative scheduling of the instructions that
10719 are dependent on the data speculative loads before reload.
10720 This is effective only with @option{-msched-br-data-spec} enabled.
10721 The default is 'enable'.
10722
10723 @item -msched-ar-in-data-spec
10724 @itemx -mno-sched-ar-in-data-spec
10725 @opindex msched-ar-in-data-spec
10726 @opindex mno-sched-ar-in-data-spec
10727 (En/Dis)able speculative scheduling of the instructions that
10728 are dependent on the data speculative loads after reload.
10729 This is effective only with @option{-msched-ar-data-spec} enabled.
10730 The default is 'enable'.
10731
10732 @item -msched-in-control-spec
10733 @itemx -mno-sched-in-control-spec
10734 @opindex msched-in-control-spec
10735 @opindex mno-sched-in-control-spec
10736 (En/Dis)able speculative scheduling of the instructions that
10737 are dependent on the control speculative loads.
10738 This is effective only with @option{-msched-control-spec} enabled.
10739 The default is 'enable'.
10740
10741 @item -msched-ldc
10742 @itemx -mno-sched-ldc
10743 @opindex msched-ldc
10744 @opindex mno-sched-ldc
10745 (En/Dis)able use of simple data speculation checks ld.c .
10746 If disabled, only chk.a instructions will be emitted to check
10747 data speculative loads.
10748 The default is 'enable'.
10749
10750 @item -mno-sched-control-ldc
10751 @itemx -msched-control-ldc
10752 @opindex mno-sched-control-ldc
10753 @opindex msched-control-ldc
10754 (Dis/En)able use of ld.c instructions to check control speculative loads.
10755 If enabled, in case of control speculative load with no speculatively
10756 scheduled dependent instructions this load will be emitted as ld.sa and
10757 ld.c will be used to check it.
10758 The default is 'disable'.
10759
10760 @item -mno-sched-spec-verbose
10761 @itemx -msched-spec-verbose
10762 @opindex mno-sched-spec-verbose
10763 @opindex msched-spec-verbose
10764 (Dis/En)able printing of the information about speculative motions.
10765
10766 @item -mno-sched-prefer-non-data-spec-insns
10767 @itemx -msched-prefer-non-data-spec-insns
10768 @opindex mno-sched-prefer-non-data-spec-insns
10769 @opindex msched-prefer-non-data-spec-insns
10770 If enabled, data speculative instructions will be chosen for schedule
10771 only if there are no other choices at the moment.  This will make
10772 the use of the data speculation much more conservative.
10773 The default is 'disable'.
10774
10775 @item -mno-sched-prefer-non-control-spec-insns
10776 @itemx -msched-prefer-non-control-spec-insns
10777 @opindex mno-sched-prefer-non-control-spec-insns
10778 @opindex msched-prefer-non-control-spec-insns
10779 If enabled, control speculative instructions will be chosen for schedule
10780 only if there are no other choices at the moment.  This will make
10781 the use of the control speculation much more conservative.
10782 The default is 'disable'.
10783
10784 @item -mno-sched-count-spec-in-critical-path
10785 @itemx -msched-count-spec-in-critical-path
10786 @opindex mno-sched-count-spec-in-critical-path
10787 @opindex msched-count-spec-in-critical-path
10788 If enabled, speculative dependencies will be considered during
10789 computation of the instructions priorities.  This will make the use of the
10790 speculation a bit more conservative.
10791 The default is 'disable'.
10792
10793 @end table
10794
10795 @node M32C Options
10796 @subsection M32C Options
10797 @cindex M32C options
10798
10799 @table @gcctabopt
10800 @item -mcpu=@var{name}
10801 @opindex mcpu=
10802 Select the CPU for which code is generated.  @var{name} may be one of
10803 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
10804 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
10805 the M32C/80 series.
10806
10807 @item -msim
10808 @opindex msim
10809 Specifies that the program will be run on the simulator.  This causes
10810 an alternate runtime library to be linked in which supports, for
10811 example, file I/O.  You must not use this option when generating
10812 programs that will run on real hardware; you must provide your own
10813 runtime library for whatever I/O functions are needed.
10814
10815 @item -memregs=@var{number}
10816 @opindex memregs=
10817 Specifies the number of memory-based pseudo-registers GCC will use
10818 during code generation.  These pseudo-registers will be used like real
10819 registers, so there is a tradeoff between GCC's ability to fit the
10820 code into available registers, and the performance penalty of using
10821 memory instead of registers.  Note that all modules in a program must
10822 be compiled with the same value for this option.  Because of that, you
10823 must not use this option with the default runtime libraries gcc
10824 builds.
10825
10826 @end table
10827
10828 @node M32R/D Options
10829 @subsection M32R/D Options
10830 @cindex M32R/D options
10831
10832 These @option{-m} options are defined for Renesas M32R/D architectures:
10833
10834 @table @gcctabopt
10835 @item -m32r2
10836 @opindex m32r2
10837 Generate code for the M32R/2@.
10838
10839 @item -m32rx
10840 @opindex m32rx
10841 Generate code for the M32R/X@.
10842
10843 @item -m32r
10844 @opindex m32r
10845 Generate code for the M32R@.  This is the default.
10846
10847 @item -mmodel=small
10848 @opindex mmodel=small
10849 Assume all objects live in the lower 16MB of memory (so that their addresses
10850 can be loaded with the @code{ld24} instruction), and assume all subroutines
10851 are reachable with the @code{bl} instruction.
10852 This is the default.
10853
10854 The addressability of a particular object can be set with the
10855 @code{model} attribute.
10856
10857 @item -mmodel=medium
10858 @opindex mmodel=medium
10859 Assume objects may be anywhere in the 32-bit address space (the compiler
10860 will generate @code{seth/add3} instructions to load their addresses), and
10861 assume all subroutines are reachable with the @code{bl} instruction.
10862
10863 @item -mmodel=large
10864 @opindex mmodel=large
10865 Assume objects may be anywhere in the 32-bit address space (the compiler
10866 will generate @code{seth/add3} instructions to load their addresses), and
10867 assume subroutines may not be reachable with the @code{bl} instruction
10868 (the compiler will generate the much slower @code{seth/add3/jl}
10869 instruction sequence).
10870
10871 @item -msdata=none
10872 @opindex msdata=none
10873 Disable use of the small data area.  Variables will be put into
10874 one of @samp{.data}, @samp{bss}, or @samp{.rodata} (unless the
10875 @code{section} attribute has been specified).
10876 This is the default.
10877
10878 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
10879 Objects may be explicitly put in the small data area with the
10880 @code{section} attribute using one of these sections.
10881
10882 @item -msdata=sdata
10883 @opindex msdata=sdata
10884 Put small global and static data in the small data area, but do not
10885 generate special code to reference them.
10886
10887 @item -msdata=use
10888 @opindex msdata=use
10889 Put small global and static data in the small data area, and generate
10890 special instructions to reference them.
10891
10892 @item -G @var{num}
10893 @opindex G
10894 @cindex smaller data references
10895 Put global and static objects less than or equal to @var{num} bytes
10896 into the small data or bss sections instead of the normal data or bss
10897 sections.  The default value of @var{num} is 8.
10898 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
10899 for this option to have any effect.
10900
10901 All modules should be compiled with the same @option{-G @var{num}} value.
10902 Compiling with different values of @var{num} may or may not work; if it
10903 doesn't the linker will give an error message---incorrect code will not be
10904 generated.
10905
10906 @item -mdebug
10907 @opindex mdebug
10908 Makes the M32R specific code in the compiler display some statistics
10909 that might help in debugging programs.
10910
10911 @item -malign-loops
10912 @opindex malign-loops
10913 Align all loops to a 32-byte boundary.
10914
10915 @item -mno-align-loops
10916 @opindex mno-align-loops
10917 Do not enforce a 32-byte alignment for loops.  This is the default.
10918
10919 @item -missue-rate=@var{number}
10920 @opindex missue-rate=@var{number}
10921 Issue @var{number} instructions per cycle.  @var{number} can only be 1
10922 or 2.
10923
10924 @item -mbranch-cost=@var{number}
10925 @opindex mbranch-cost=@var{number}
10926 @var{number} can only be 1 or 2.  If it is 1 then branches will be
10927 preferred over conditional code, if it is 2, then the opposite will
10928 apply.
10929
10930 @item -mflush-trap=@var{number}
10931 @opindex mflush-trap=@var{number}
10932 Specifies the trap number to use to flush the cache.  The default is
10933 12.  Valid numbers are between 0 and 15 inclusive.
10934
10935 @item -mno-flush-trap
10936 @opindex mno-flush-trap
10937 Specifies that the cache cannot be flushed by using a trap.
10938
10939 @item -mflush-func=@var{name}
10940 @opindex mflush-func=@var{name}
10941 Specifies the name of the operating system function to call to flush
10942 the cache.  The default is @emph{_flush_cache}, but a function call
10943 will only be used if a trap is not available.
10944
10945 @item -mno-flush-func
10946 @opindex mno-flush-func
10947 Indicates that there is no OS function for flushing the cache.
10948
10949 @end table
10950
10951 @node M680x0 Options
10952 @subsection M680x0 Options
10953 @cindex M680x0 options
10954
10955 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
10956 The default settings depend on which architecture was selected when
10957 the compiler was configured; the defaults for the most common choices
10958 are given below.
10959
10960 @table @gcctabopt
10961 @item -march=@var{arch}
10962 @opindex march
10963 Generate code for a specific M680x0 or ColdFire instruction set
10964 architecture.  Permissible values of @var{arch} for M680x0
10965 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
10966 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
10967 architectures are selected according to Freescale's ISA classification
10968 and the permissible values are: @samp{isaa}, @samp{isaaplus},
10969 @samp{isab} and @samp{isac}.
10970
10971 gcc defines a macro @samp{__mcf@var{arch}__} whenever it is generating
10972 code for a ColdFire target.  The @var{arch} in this macro is one of the
10973 @option{-march} arguments given above.
10974
10975 When used together, @option{-march} and @option{-mtune} select code
10976 that runs on a family of similar processors but that is optimized
10977 for a particular microarchitecture.
10978
10979 @item -mcpu=@var{cpu}
10980 @opindex mcpu
10981 Generate code for a specific M680x0 or ColdFire processor.
10982 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
10983 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
10984 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
10985 below, which also classifies the CPUs into families:
10986
10987 @multitable @columnfractions 0.20 0.80
10988 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
10989 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
10990 @item @samp{5206e} @tab @samp{5206e}
10991 @item @samp{5208} @tab @samp{5207} @samp{5208}
10992 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
10993 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
10994 @item @samp{5216} @tab @samp{5214} @samp{5216}
10995 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
10996 @item @samp{5225} @tab @samp{5224} @samp{5225}
10997 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
10998 @item @samp{5249} @tab @samp{5249}
10999 @item @samp{5250} @tab @samp{5250}
11000 @item @samp{5271} @tab @samp{5270} @samp{5271}
11001 @item @samp{5272} @tab @samp{5272}
11002 @item @samp{5275} @tab @samp{5274} @samp{5275}
11003 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
11004 @item @samp{5307} @tab @samp{5307}
11005 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
11006 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
11007 @item @samp{5407} @tab @samp{5407}
11008 @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}
11009 @end multitable
11010
11011 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
11012 @var{arch} is compatible with @var{cpu}.  Other combinations of
11013 @option{-mcpu} and @option{-march} are rejected.
11014
11015 gcc defines the macro @samp{__mcf_cpu_@var{cpu}} when ColdFire target
11016 @var{cpu} is selected.  It also defines @samp{__mcf_family_@var{family}},
11017 where the value of @var{family} is given by the table above.
11018
11019 @item -mtune=@var{tune}
11020 @opindex mtune
11021 Tune the code for a particular microarchitecture, within the
11022 constraints set by @option{-march} and @option{-mcpu}.
11023 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
11024 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
11025 and @samp{cpu32}.  The ColdFire microarchitectures
11026 are: @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
11027
11028 You can also use @option{-mtune=68020-40} for code that needs
11029 to run relatively well on 68020, 68030 and 68040 targets.
11030 @option{-mtune=68020-60} is similar but includes 68060 targets
11031 as well.  These two options select the same tuning decisions as
11032 @option{-m68020-40} and @option{-m68020-60} respectively.
11033
11034 gcc defines the macros @samp{__mc@var{arch}} and @samp{__mc@var{arch}__}
11035 when tuning for 680x0 architecture @var{arch}.  It also defines
11036 @samp{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
11037 option is used.  If gcc is tuning for a range of architectures,
11038 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
11039 it defines the macros for every architecture in the range.
11040
11041 gcc also defines the macro @samp{__m@var{uarch}__} when tuning for
11042 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
11043 of the arguments given above.
11044
11045 @item -m68000
11046 @itemx -mc68000
11047 @opindex m68000
11048 @opindex mc68000
11049 Generate output for a 68000.  This is the default
11050 when the compiler is configured for 68000-based systems.
11051 It is equivalent to @option{-march=68000}.
11052
11053 Use this option for microcontrollers with a 68000 or EC000 core,
11054 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
11055
11056 @item -m68010
11057 @opindex m68010
11058 Generate output for a 68010.  This is the default
11059 when the compiler is configured for 68010-based systems.
11060 It is equivalent to @option{-march=68010}.
11061
11062 @item -m68020
11063 @itemx -mc68020
11064 @opindex m68020
11065 @opindex mc68020
11066 Generate output for a 68020.  This is the default
11067 when the compiler is configured for 68020-based systems.
11068 It is equivalent to @option{-march=68020}.
11069
11070 @item -m68030
11071 @opindex m68030
11072 Generate output for a 68030.  This is the default when the compiler is
11073 configured for 68030-based systems.  It is equivalent to
11074 @option{-march=68030}.
11075
11076 @item -m68040
11077 @opindex m68040
11078 Generate output for a 68040.  This is the default when the compiler is
11079 configured for 68040-based systems.  It is equivalent to
11080 @option{-march=68040}.
11081
11082 This option inhibits the use of 68881/68882 instructions that have to be
11083 emulated by software on the 68040.  Use this option if your 68040 does not
11084 have code to emulate those instructions.
11085
11086 @item -m68060
11087 @opindex m68060
11088 Generate output for a 68060.  This is the default when the compiler is
11089 configured for 68060-based systems.  It is equivalent to
11090 @option{-march=68060}.
11091
11092 This option inhibits the use of 68020 and 68881/68882 instructions that
11093 have to be emulated by software on the 68060.  Use this option if your 68060
11094 does not have code to emulate those instructions.
11095
11096 @item -mcpu32
11097 @opindex mcpu32
11098 Generate output for a CPU32.  This is the default
11099 when the compiler is configured for CPU32-based systems.
11100 It is equivalent to @option{-march=cpu32}.
11101
11102 Use this option for microcontrollers with a
11103 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
11104 68336, 68340, 68341, 68349 and 68360.
11105
11106 @item -m5200
11107 @opindex m5200
11108 Generate output for a 520X ColdFire CPU.  This is the default
11109 when the compiler is configured for 520X-based systems.
11110 It is equivalent to @option{-mcpu=5206}, and is now deprecated
11111 in favor of that option.
11112
11113 Use this option for microcontroller with a 5200 core, including
11114 the MCF5202, MCF5203, MCF5204 and MCF5206.
11115
11116 @item -m5206e
11117 @opindex m5206e
11118 Generate output for a 5206e ColdFire CPU.  The option is now
11119 deprecated in favor of the equivalent @option{-mcpu=5206e}.
11120
11121 @item -m528x
11122 @opindex m528x
11123 Generate output for a member of the ColdFire 528X family.
11124 The option is now deprecated in favor of the equivalent
11125 @option{-mcpu=528x}.
11126
11127 @item -m5307
11128 @opindex m5307
11129 Generate output for a ColdFire 5307 CPU.  The option is now deprecated
11130 in favor of the equivalent @option{-mcpu=5307}.
11131
11132 @item -m5407
11133 @opindex m5407
11134 Generate output for a ColdFire 5407 CPU.  The option is now deprecated
11135 in favor of the equivalent @option{-mcpu=5407}.
11136
11137 @item -mcfv4e
11138 @opindex mcfv4e
11139 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
11140 This includes use of hardware floating point instructions.
11141 The option is equivalent to @option{-mcpu=547x}, and is now
11142 deprecated in favor of that option.
11143
11144 @item -m68020-40
11145 @opindex m68020-40
11146 Generate output for a 68040, without using any of the new instructions.
11147 This results in code which can run relatively efficiently on either a
11148 68020/68881 or a 68030 or a 68040.  The generated code does use the
11149 68881 instructions that are emulated on the 68040.
11150
11151 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
11152
11153 @item -m68020-60
11154 @opindex m68020-60
11155 Generate output for a 68060, without using any of the new instructions.
11156 This results in code which can run relatively efficiently on either a
11157 68020/68881 or a 68030 or a 68040.  The generated code does use the
11158 68881 instructions that are emulated on the 68060.
11159
11160 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
11161
11162 @item -mhard-float
11163 @itemx -m68881
11164 @opindex mhard-float
11165 @opindex m68881
11166 Generate floating-point instructions.  This is the default for 68020
11167 and above, and for ColdFire devices that have an FPU.  It defines the
11168 macro @samp{__HAVE_68881__} on M680x0 targets and @samp{__mcffpu__}
11169 on ColdFire targets.
11170
11171 @item -msoft-float
11172 @opindex msoft-float
11173 Do not generate floating-point instructions; use library calls instead.
11174 This is the default for 68000, 68010, and 68832 targets.  It is also
11175 the default for ColdFire devices that have no FPU.
11176
11177 @item -mdiv
11178 @itemx -mno-div
11179 @opindex mdiv
11180 @opindex mno-div
11181 Generate (do not generate) ColdFire hardware divide and remainder
11182 instructions.  If @option{-march} is used without @option{-mcpu},
11183 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
11184 architectures.  Otherwise, the default is taken from the target CPU
11185 (either the default CPU, or the one specified by @option{-mcpu}).  For
11186 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
11187 @option{-mcpu=5206e}.
11188
11189 gcc defines the macro @samp{__mcfhwdiv__} when this option is enabled.
11190
11191 @item -mshort
11192 @opindex mshort
11193 Consider type @code{int} to be 16 bits wide, like @code{short int}.
11194 Additionally, parameters passed on the stack are also aligned to a
11195 16-bit boundary even on targets whose API mandates promotion to 32-bit.
11196
11197 @item -mno-short
11198 @opindex mno-short
11199 Do not consider type @code{int} to be 16 bits wide.  This is the default.
11200
11201 @item -mnobitfield
11202 @itemx -mno-bitfield
11203 @opindex mnobitfield
11204 @opindex mno-bitfield
11205 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
11206 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
11207
11208 @item -mbitfield
11209 @opindex mbitfield
11210 Do use the bit-field instructions.  The @option{-m68020} option implies
11211 @option{-mbitfield}.  This is the default if you use a configuration
11212 designed for a 68020.
11213
11214 @item -mrtd
11215 @opindex mrtd
11216 Use a different function-calling convention, in which functions
11217 that take a fixed number of arguments return with the @code{rtd}
11218 instruction, which pops their arguments while returning.  This
11219 saves one instruction in the caller since there is no need to pop
11220 the arguments there.
11221
11222 This calling convention is incompatible with the one normally
11223 used on Unix, so you cannot use it if you need to call libraries
11224 compiled with the Unix compiler.
11225
11226 Also, you must provide function prototypes for all functions that
11227 take variable numbers of arguments (including @code{printf});
11228 otherwise incorrect code will be generated for calls to those
11229 functions.
11230
11231 In addition, seriously incorrect code will result if you call a
11232 function with too many arguments.  (Normally, extra arguments are
11233 harmlessly ignored.)
11234
11235 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
11236 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
11237
11238 @item -mno-rtd
11239 @opindex mno-rtd
11240 Do not use the calling conventions selected by @option{-mrtd}.
11241 This is the default.
11242
11243 @item -malign-int
11244 @itemx -mno-align-int
11245 @opindex malign-int
11246 @opindex mno-align-int
11247 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
11248 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
11249 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
11250 Aligning variables on 32-bit boundaries produces code that runs somewhat
11251 faster on processors with 32-bit busses at the expense of more memory.
11252
11253 @strong{Warning:} if you use the @option{-malign-int} switch, GCC will
11254 align structures containing the above types  differently than
11255 most published application binary interface specifications for the m68k.
11256
11257 @item -mpcrel
11258 @opindex mpcrel
11259 Use the pc-relative addressing mode of the 68000 directly, instead of
11260 using a global offset table.  At present, this option implies @option{-fpic},
11261 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
11262 not presently supported with @option{-mpcrel}, though this could be supported for
11263 68020 and higher processors.
11264
11265 @item -mno-strict-align
11266 @itemx -mstrict-align
11267 @opindex mno-strict-align
11268 @opindex mstrict-align
11269 Do not (do) assume that unaligned memory references will be handled by
11270 the system.
11271
11272 @item -msep-data
11273 Generate code that allows the data segment to be located in a different
11274 area of memory from the text segment.  This allows for execute in place in
11275 an environment without virtual memory management.  This option implies
11276 @option{-fPIC}.
11277
11278 @item -mno-sep-data
11279 Generate code that assumes that the data segment follows the text segment.
11280 This is the default.
11281
11282 @item -mid-shared-library
11283 Generate code that supports shared libraries via the library ID method.
11284 This allows for execute in place and shared libraries in an environment
11285 without virtual memory management.  This option implies @option{-fPIC}.
11286
11287 @item -mno-id-shared-library
11288 Generate code that doesn't assume ID based shared libraries are being used.
11289 This is the default.
11290
11291 @item -mshared-library-id=n
11292 Specified the identification number of the ID based shared library being
11293 compiled.  Specifying a value of 0 will generate more compact code, specifying
11294 other values will force the allocation of that number to the current
11295 library but is no more space or time efficient than omitting this option.
11296
11297 @end table
11298
11299 @node M68hc1x Options
11300 @subsection M68hc1x Options
11301 @cindex M68hc1x options
11302
11303 These are the @samp{-m} options defined for the 68hc11 and 68hc12
11304 microcontrollers.  The default values for these options depends on
11305 which style of microcontroller was selected when the compiler was configured;
11306 the defaults for the most common choices are given below.
11307
11308 @table @gcctabopt
11309 @item -m6811
11310 @itemx -m68hc11
11311 @opindex m6811
11312 @opindex m68hc11
11313 Generate output for a 68HC11.  This is the default
11314 when the compiler is configured for 68HC11-based systems.
11315
11316 @item -m6812
11317 @itemx -m68hc12
11318 @opindex m6812
11319 @opindex m68hc12
11320 Generate output for a 68HC12.  This is the default
11321 when the compiler is configured for 68HC12-based systems.
11322
11323 @item -m68S12
11324 @itemx -m68hcs12
11325 @opindex m68S12
11326 @opindex m68hcs12
11327 Generate output for a 68HCS12.
11328
11329 @item -mauto-incdec
11330 @opindex mauto-incdec
11331 Enable the use of 68HC12 pre and post auto-increment and auto-decrement
11332 addressing modes.
11333
11334 @item -minmax
11335 @itemx -nominmax
11336 @opindex minmax
11337 @opindex mnominmax
11338 Enable the use of 68HC12 min and max instructions.
11339
11340 @item -mlong-calls
11341 @itemx -mno-long-calls
11342 @opindex mlong-calls
11343 @opindex mno-long-calls
11344 Treat all calls as being far away (near).  If calls are assumed to be
11345 far away, the compiler will use the @code{call} instruction to
11346 call a function and the @code{rtc} instruction for returning.
11347
11348 @item -mshort
11349 @opindex mshort
11350 Consider type @code{int} to be 16 bits wide, like @code{short int}.
11351
11352 @item -msoft-reg-count=@var{count}
11353 @opindex msoft-reg-count
11354 Specify the number of pseudo-soft registers which are used for the
11355 code generation.  The maximum number is 32.  Using more pseudo-soft
11356 register may or may not result in better code depending on the program.
11357 The default is 4 for 68HC11 and 2 for 68HC12.
11358
11359 @end table
11360
11361 @node MCore Options
11362 @subsection MCore Options
11363 @cindex MCore options
11364
11365 These are the @samp{-m} options defined for the Motorola M*Core
11366 processors.
11367
11368 @table @gcctabopt
11369
11370 @item -mhardlit
11371 @itemx -mno-hardlit
11372 @opindex mhardlit
11373 @opindex mno-hardlit
11374 Inline constants into the code stream if it can be done in two
11375 instructions or less.
11376
11377 @item -mdiv
11378 @itemx -mno-div
11379 @opindex mdiv
11380 @opindex mno-div
11381 Use the divide instruction.  (Enabled by default).
11382
11383 @item -mrelax-immediate
11384 @itemx -mno-relax-immediate
11385 @opindex mrelax-immediate
11386 @opindex mno-relax-immediate
11387 Allow arbitrary sized immediates in bit operations.
11388
11389 @item -mwide-bitfields
11390 @itemx -mno-wide-bitfields
11391 @opindex mwide-bitfields
11392 @opindex mno-wide-bitfields
11393 Always treat bit-fields as int-sized.
11394
11395 @item -m4byte-functions
11396 @itemx -mno-4byte-functions
11397 @opindex m4byte-functions
11398 @opindex mno-4byte-functions
11399 Force all functions to be aligned to a four byte boundary.
11400
11401 @item -mcallgraph-data
11402 @itemx -mno-callgraph-data
11403 @opindex mcallgraph-data
11404 @opindex mno-callgraph-data
11405 Emit callgraph information.
11406
11407 @item -mslow-bytes
11408 @itemx -mno-slow-bytes
11409 @opindex mslow-bytes
11410 @opindex mno-slow-bytes
11411 Prefer word access when reading byte quantities.
11412
11413 @item -mlittle-endian
11414 @itemx -mbig-endian
11415 @opindex mlittle-endian
11416 @opindex mbig-endian
11417 Generate code for a little endian target.
11418
11419 @item -m210
11420 @itemx -m340
11421 @opindex m210
11422 @opindex m340
11423 Generate code for the 210 processor.
11424 @end table
11425
11426 @node MIPS Options
11427 @subsection MIPS Options
11428 @cindex MIPS options
11429
11430 @table @gcctabopt
11431
11432 @item -EB
11433 @opindex EB
11434 Generate big-endian code.
11435
11436 @item -EL
11437 @opindex EL
11438 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
11439 configurations.
11440
11441 @item -march=@var{arch}
11442 @opindex march
11443 Generate code that will run on @var{arch}, which can be the name of a
11444 generic MIPS ISA, or the name of a particular processor.
11445 The ISA names are:
11446 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
11447 @samp{mips32}, @samp{mips32r2}, and @samp{mips64}.
11448 The processor names are:
11449 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
11450 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
11451 @samp{5kc}, @samp{5kf},
11452 @samp{20kc},
11453 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
11454 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
11455 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1},
11456 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
11457 @samp{m4k},
11458 @samp{orion},
11459 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
11460 @samp{r4600}, @samp{r4650}, @samp{r6000}, @samp{r8000},
11461 @samp{rm7000}, @samp{rm9000},
11462 @samp{sb1},
11463 @samp{sr71000},
11464 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
11465 @samp{vr5000}, @samp{vr5400} and @samp{vr5500}.
11466 The special value @samp{from-abi} selects the
11467 most compatible architecture for the selected ABI (that is,
11468 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
11469
11470 In processor names, a final @samp{000} can be abbreviated as @samp{k}
11471 (for example, @samp{-march=r2k}).  Prefixes are optional, and
11472 @samp{vr} may be written @samp{r}.
11473
11474 Names of the form @samp{@var{n}f2_1} refer to processors with
11475 FPUs clocked at half the rate of the core, names of the form
11476 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
11477 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
11478 processors with FPUs clocked a ratio of 3:2 with respect to the core.
11479 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
11480 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
11481 accepted as synonyms for @samp{@var{n}f1_1}.
11482
11483 GCC defines two macros based on the value of this option.  The first
11484 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
11485 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
11486 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
11487 For example, @samp{-march=r2000} will set @samp{_MIPS_ARCH}
11488 to @samp{"r2000"} and define the macro @samp{_MIPS_ARCH_R2000}.
11489
11490 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
11491 above.  In other words, it will have the full prefix and will not
11492 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
11493 the macro names the resolved architecture (either @samp{"mips1"} or
11494 @samp{"mips3"}).  It names the default architecture when no
11495 @option{-march} option is given.
11496
11497 @item -mtune=@var{arch}
11498 @opindex mtune
11499 Optimize for @var{arch}.  Among other things, this option controls
11500 the way instructions are scheduled, and the perceived cost of arithmetic
11501 operations.  The list of @var{arch} values is the same as for
11502 @option{-march}.
11503
11504 When this option is not used, GCC will optimize for the processor
11505 specified by @option{-march}.  By using @option{-march} and
11506 @option{-mtune} together, it is possible to generate code that will
11507 run on a family of processors, but optimize the code for one
11508 particular member of that family.
11509
11510 @samp{-mtune} defines the macros @samp{_MIPS_TUNE} and
11511 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
11512 @samp{-march} ones described above.
11513
11514 @item -mips1
11515 @opindex mips1
11516 Equivalent to @samp{-march=mips1}.
11517
11518 @item -mips2
11519 @opindex mips2
11520 Equivalent to @samp{-march=mips2}.
11521
11522 @item -mips3
11523 @opindex mips3
11524 Equivalent to @samp{-march=mips3}.
11525
11526 @item -mips4
11527 @opindex mips4
11528 Equivalent to @samp{-march=mips4}.
11529
11530 @item -mips32
11531 @opindex mips32
11532 Equivalent to @samp{-march=mips32}.
11533
11534 @item -mips32r2
11535 @opindex mips32r2
11536 Equivalent to @samp{-march=mips32r2}.
11537
11538 @item -mips64
11539 @opindex mips64
11540 Equivalent to @samp{-march=mips64}.
11541
11542 @item -mips16
11543 @itemx -mno-mips16
11544 @opindex mips16
11545 @opindex mno-mips16
11546 Generate (do not generate) MIPS16 code.  If GCC is targetting a
11547 MIPS32 or MIPS64 architecture, it will make use of the MIPS16e ASE@.
11548
11549 @item -mabi=32
11550 @itemx -mabi=o64
11551 @itemx -mabi=n32
11552 @itemx -mabi=64
11553 @itemx -mabi=eabi
11554 @opindex mabi=32
11555 @opindex mabi=o64
11556 @opindex mabi=n32
11557 @opindex mabi=64
11558 @opindex mabi=eabi
11559 Generate code for the given ABI@.
11560
11561 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
11562 generates 64-bit code when you select a 64-bit architecture, but you
11563 can use @option{-mgp32} to get 32-bit code instead.
11564
11565 For information about the O64 ABI, see
11566 @w{@uref{http://gcc.gnu.org/projects/mipso64-abi.html}}.
11567
11568 GCC supports a variant of the o32 ABI in which floating-point registers
11569 are 64 rather than 32 bits wide.  You can select this combination with
11570 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @samp{mthc1}
11571 and @samp{mfhc1} instructions and is therefore only supported for
11572 MIPS32R2 processors.
11573
11574 The register assignments for arguments and return values remain the
11575 same, but each scalar value is passed in a single 64-bit register
11576 rather than a pair of 32-bit registers.  For example, scalar
11577 floating-point values are returned in @samp{$f0} only, not a
11578 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
11579 remains the same, but all 64 bits are saved.
11580
11581 @item -mabicalls
11582 @itemx -mno-abicalls
11583 @opindex mabicalls
11584 @opindex mno-abicalls
11585 Generate (do not generate) code that is suitable for SVR4-style
11586 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
11587 systems.
11588
11589 @item -mshared
11590 @itemx -mno-shared
11591 Generate (do not generate) code that is fully position-independent,
11592 and that can therefore be linked into shared libraries.  This option
11593 only affects @option{-mabicalls}.
11594
11595 All @option{-mabicalls} code has traditionally been position-independent,
11596 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
11597 as an extension, the GNU toolchain allows executables to use absolute
11598 accesses for locally-binding symbols.  It can also use shorter GP
11599 initialization sequences and generate direct calls to locally-defined
11600 functions.  This mode is selected by @option{-mno-shared}.
11601
11602 @option{-mno-shared} depends on binutils 2.16 or higher and generates
11603 objects that can only be linked by the GNU linker.  However, the option
11604 does not affect the ABI of the final executable; it only affects the ABI
11605 of relocatable objects.  Using @option{-mno-shared} will generally make
11606 executables both smaller and quicker.
11607
11608 @option{-mshared} is the default.
11609
11610 @item -mxgot
11611 @itemx -mno-xgot
11612 @opindex mxgot
11613 @opindex mno-xgot
11614 Lift (do not lift) the usual restrictions on the size of the global
11615 offset table.
11616
11617 GCC normally uses a single instruction to load values from the GOT@.
11618 While this is relatively efficient, it will only work if the GOT
11619 is smaller than about 64k.  Anything larger will cause the linker
11620 to report an error such as:
11621
11622 @cindex relocation truncated to fit (MIPS)
11623 @smallexample
11624 relocation truncated to fit: R_MIPS_GOT16 foobar
11625 @end smallexample
11626
11627 If this happens, you should recompile your code with @option{-mxgot}.
11628 It should then work with very large GOTs, although it will also be
11629 less efficient, since it will take three instructions to fetch the
11630 value of a global symbol.
11631
11632 Note that some linkers can create multiple GOTs.  If you have such a
11633 linker, you should only need to use @option{-mxgot} when a single object
11634 file accesses more than 64k's worth of GOT entries.  Very few do.
11635
11636 These options have no effect unless GCC is generating position
11637 independent code.
11638
11639 @item -mgp32
11640 @opindex mgp32
11641 Assume that general-purpose registers are 32 bits wide.
11642
11643 @item -mgp64
11644 @opindex mgp64
11645 Assume that general-purpose registers are 64 bits wide.
11646
11647 @item -mfp32
11648 @opindex mfp32
11649 Assume that floating-point registers are 32 bits wide.
11650
11651 @item -mfp64
11652 @opindex mfp64
11653 Assume that floating-point registers are 64 bits wide.
11654
11655 @item -mhard-float
11656 @opindex mhard-float
11657 Use floating-point coprocessor instructions.
11658
11659 @item -msoft-float
11660 @opindex msoft-float
11661 Do not use floating-point coprocessor instructions.  Implement
11662 floating-point calculations using library calls instead.
11663
11664 @item -msingle-float
11665 @opindex msingle-float
11666 Assume that the floating-point coprocessor only supports single-precision
11667 operations.
11668
11669 @item -mdouble-float
11670 @opindex mdouble-float
11671 Assume that the floating-point coprocessor supports double-precision
11672 operations.  This is the default.
11673
11674 @item -mdsp
11675 @itemx -mno-dsp
11676 @opindex mdsp
11677 @opindex mno-dsp
11678 Use (do not use) revision 1 of the MIPS DSP ASE.
11679 @xref{MIPS DSP Built-in Functions}.  This option defines the
11680 preprocessor macro @samp{__mips_dsp}.  It also defines
11681 @samp{__mips_dsp_rev} to 1.
11682
11683 @item -mdspr2
11684 @itemx -mno-dspr2
11685 @opindex mdspr2
11686 @opindex mno-dspr2
11687 Use (do not use) revision 2 of the MIPS DSP ASE.
11688 @xref{MIPS DSP Built-in Functions}.  This option defines the
11689 preprocessor macros @samp{__mips_dsp} and @samp{__mips_dspr2}.
11690 It also defines @samp{__mips_dsp_rev} to 2.
11691
11692 @item -msmartmips
11693 @itemx -mno-smartmips
11694 @opindex msmartmips
11695 @opindex mno-smartmips
11696 Use (do not use) the MIPS SmartMIPS ASE.
11697
11698 @item -mpaired-single
11699 @itemx -mno-paired-single
11700 @opindex mpaired-single
11701 @opindex mno-paired-single
11702 Use (do not use) paired-single floating-point instructions.
11703 @xref{MIPS Paired-Single Support}.  This option can only be used
11704 when generating 64-bit code and requires hardware floating-point
11705 support to be enabled.
11706
11707 @item -mdmx
11708 @itemx -mno-mdmx
11709 @opindex mdmx
11710 @opindex mno-mdmx
11711 Use (do not use) MIPS Digital Media Extension instructions.
11712 This option can only be used when generating 64-bit code and requires
11713 hardware floating-point support to be enabled.
11714
11715 @item -mips3d
11716 @itemx -mno-mips3d
11717 @opindex mips3d
11718 @opindex mno-mips3d
11719 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
11720 The option @option{-mips3d} implies @option{-mpaired-single}.
11721
11722 @item -mmt
11723 @itemx -mno-mt
11724 @opindex mmt
11725 @opindex mno-mt
11726 Use (do not use) MT Multithreading instructions.
11727
11728 @item -mlong64
11729 @opindex mlong64
11730 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
11731 an explanation of the default and the way that the pointer size is
11732 determined.
11733
11734 @item -mlong32
11735 @opindex mlong32
11736 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
11737
11738 The default size of @code{int}s, @code{long}s and pointers depends on
11739 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
11740 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
11741 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
11742 or the same size as integer registers, whichever is smaller.
11743
11744 @item -msym32
11745 @itemx -mno-sym32
11746 @opindex msym32
11747 @opindex mno-sym32
11748 Assume (do not assume) that all symbols have 32-bit values, regardless
11749 of the selected ABI@.  This option is useful in combination with
11750 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
11751 to generate shorter and faster references to symbolic addresses.
11752
11753 @item -G @var{num}
11754 @opindex G
11755 @cindex smaller data references (MIPS)
11756 @cindex gp-relative references (MIPS)
11757 Put global and static items less than or equal to @var{num} bytes into
11758 the small data or bss section instead of the normal data or bss section.
11759 This allows the data to be accessed using a single instruction.
11760
11761 All modules should be compiled with the same @option{-G @var{num}}
11762 value.
11763
11764 @item -membedded-data
11765 @itemx -mno-embedded-data
11766 @opindex membedded-data
11767 @opindex mno-embedded-data
11768 Allocate variables to the read-only data section first if possible, then
11769 next in the small data section if possible, otherwise in data.  This gives
11770 slightly slower code than the default, but reduces the amount of RAM required
11771 when executing, and thus may be preferred for some embedded systems.
11772
11773 @item -muninit-const-in-rodata
11774 @itemx -mno-uninit-const-in-rodata
11775 @opindex muninit-const-in-rodata
11776 @opindex mno-uninit-const-in-rodata
11777 Put uninitialized @code{const} variables in the read-only data section.
11778 This option is only meaningful in conjunction with @option{-membedded-data}.
11779
11780 @item -msplit-addresses
11781 @itemx -mno-split-addresses
11782 @opindex msplit-addresses
11783 @opindex mno-split-addresses
11784 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
11785 relocation operators.  This option has been superseded by
11786 @option{-mexplicit-relocs} but is retained for backwards compatibility.
11787
11788 @item -mexplicit-relocs
11789 @itemx -mno-explicit-relocs
11790 @opindex mexplicit-relocs
11791 @opindex mno-explicit-relocs
11792 Use (do not use) assembler relocation operators when dealing with symbolic
11793 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
11794 is to use assembler macros instead.
11795
11796 @option{-mexplicit-relocs} is the default if GCC was configured
11797 to use an assembler that supports relocation operators.
11798
11799 @item -mcheck-zero-division
11800 @itemx -mno-check-zero-division
11801 @opindex mcheck-zero-division
11802 @opindex mno-check-zero-division
11803 Trap (do not trap) on integer division by zero.
11804
11805 The default is @option{-mcheck-zero-division}.
11806
11807 @item -mdivide-traps
11808 @itemx -mdivide-breaks
11809 @opindex mdivide-traps
11810 @opindex mdivide-breaks
11811 MIPS systems check for division by zero by generating either a
11812 conditional trap or a break instruction.  Using traps results in
11813 smaller code, but is only supported on MIPS II and later.  Also, some
11814 versions of the Linux kernel have a bug that prevents trap from
11815 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
11816 allow conditional traps on architectures that support them and
11817 @option{-mdivide-breaks} to force the use of breaks.
11818
11819 The default is usually @option{-mdivide-traps}, but this can be
11820 overridden at configure time using @option{--with-divide=breaks}.
11821 Divide-by-zero checks can be completely disabled using
11822 @option{-mno-check-zero-division}.
11823
11824 @item -mmemcpy
11825 @itemx -mno-memcpy
11826 @opindex mmemcpy
11827 @opindex mno-memcpy
11828 Force (do not force) the use of @code{memcpy()} for non-trivial block
11829 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
11830 most constant-sized copies.
11831
11832 @item -mlong-calls
11833 @itemx -mno-long-calls
11834 @opindex mlong-calls
11835 @opindex mno-long-calls
11836 Disable (do not disable) use of the @code{jal} instruction.  Calling
11837 functions using @code{jal} is more efficient but requires the caller
11838 and callee to be in the same 256 megabyte segment.
11839
11840 This option has no effect on abicalls code.  The default is
11841 @option{-mno-long-calls}.
11842
11843 @item -mmad
11844 @itemx -mno-mad
11845 @opindex mmad
11846 @opindex mno-mad
11847 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
11848 instructions, as provided by the R4650 ISA@.
11849
11850 @item -mfused-madd
11851 @itemx -mno-fused-madd
11852 @opindex mfused-madd
11853 @opindex mno-fused-madd
11854 Enable (disable) use of the floating point multiply-accumulate
11855 instructions, when they are available.  The default is
11856 @option{-mfused-madd}.
11857
11858 When multiply-accumulate instructions are used, the intermediate
11859 product is calculated to infinite precision and is not subject to
11860 the FCSR Flush to Zero bit.  This may be undesirable in some
11861 circumstances.
11862
11863 @item -nocpp
11864 @opindex nocpp
11865 Tell the MIPS assembler to not run its preprocessor over user
11866 assembler files (with a @samp{.s} suffix) when assembling them.
11867
11868 @item -mfix-r4000
11869 @itemx -mno-fix-r4000
11870 @opindex mfix-r4000
11871 @opindex mno-fix-r4000
11872 Work around certain R4000 CPU errata:
11873 @itemize @minus
11874 @item
11875 A double-word or a variable shift may give an incorrect result if executed
11876 immediately after starting an integer division.
11877 @item
11878 A double-word or a variable shift may give an incorrect result if executed
11879 while an integer multiplication is in progress.
11880 @item
11881 An integer division may give an incorrect result if started in a delay slot
11882 of a taken branch or a jump.
11883 @end itemize
11884
11885 @item -mfix-r4400
11886 @itemx -mno-fix-r4400
11887 @opindex mfix-r4400
11888 @opindex mno-fix-r4400
11889 Work around certain R4400 CPU errata:
11890 @itemize @minus
11891 @item
11892 A double-word or a variable shift may give an incorrect result if executed
11893 immediately after starting an integer division.
11894 @end itemize
11895
11896 @item -mfix-vr4120
11897 @itemx -mno-fix-vr4120
11898 @opindex mfix-vr4120
11899 Work around certain VR4120 errata:
11900 @itemize @minus
11901 @item
11902 @code{dmultu} does not always produce the correct result.
11903 @item
11904 @code{div} and @code{ddiv} do not always produce the correct result if one
11905 of the operands is negative.
11906 @end itemize
11907 The workarounds for the division errata rely on special functions in
11908 @file{libgcc.a}.  At present, these functions are only provided by
11909 the @code{mips64vr*-elf} configurations.
11910
11911 Other VR4120 errata require a nop to be inserted between certain pairs of
11912 instructions.  These errata are handled by the assembler, not by GCC itself.
11913
11914 @item -mfix-vr4130
11915 @opindex mfix-vr4130
11916 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
11917 workarounds are implemented by the assembler rather than by GCC,
11918 although GCC will avoid using @code{mflo} and @code{mfhi} if the
11919 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
11920 instructions are available instead.
11921
11922 @item -mfix-sb1
11923 @itemx -mno-fix-sb1
11924 @opindex mfix-sb1
11925 Work around certain SB-1 CPU core errata.
11926 (This flag currently works around the SB-1 revision 2
11927 ``F1'' and ``F2'' floating point errata.)
11928
11929 @item -mflush-func=@var{func}
11930 @itemx -mno-flush-func
11931 @opindex mflush-func
11932 Specifies the function to call to flush the I and D caches, or to not
11933 call any such function.  If called, the function must take the same
11934 arguments as the common @code{_flush_func()}, that is, the address of the
11935 memory range for which the cache is being flushed, the size of the
11936 memory range, and the number 3 (to flush both caches).  The default
11937 depends on the target GCC was configured for, but commonly is either
11938 @samp{_flush_func} or @samp{__cpu_flush}.
11939
11940 @item mbranch-cost=@var{num}
11941 @opindex mbranch-cost
11942 Set the cost of branches to roughly @var{num} ``simple'' instructions.
11943 This cost is only a heuristic and is not guaranteed to produce
11944 consistent results across releases.  A zero cost redundantly selects
11945 the default, which is based on the @option{-mtune} setting.
11946
11947 @item -mbranch-likely
11948 @itemx -mno-branch-likely
11949 @opindex mbranch-likely
11950 @opindex mno-branch-likely
11951 Enable or disable use of Branch Likely instructions, regardless of the
11952 default for the selected architecture.  By default, Branch Likely
11953 instructions may be generated if they are supported by the selected
11954 architecture.  An exception is for the MIPS32 and MIPS64 architectures
11955 and processors which implement those architectures; for those, Branch
11956 Likely instructions will not be generated by default because the MIPS32
11957 and MIPS64 architectures specifically deprecate their use.
11958
11959 @item -mfp-exceptions
11960 @itemx -mno-fp-exceptions
11961 @opindex mfp-exceptions
11962 Specifies whether FP exceptions are enabled.  This affects how we schedule
11963 FP instructions for some processors.  The default is that FP exceptions are
11964 enabled.
11965
11966 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
11967 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
11968 FP pipe.
11969
11970 @item -mvr4130-align
11971 @itemx -mno-vr4130-align
11972 @opindex mvr4130-align
11973 The VR4130 pipeline is two-way superscalar, but can only issue two
11974 instructions together if the first one is 8-byte aligned.  When this
11975 option is enabled, GCC will align pairs of instructions that it
11976 thinks should execute in parallel.
11977
11978 This option only has an effect when optimizing for the VR4130.
11979 It normally makes code faster, but at the expense of making it bigger.
11980 It is enabled by default at optimization level @option{-O3}.
11981 @end table
11982
11983 @node MMIX Options
11984 @subsection MMIX Options
11985 @cindex MMIX Options
11986
11987 These options are defined for the MMIX:
11988
11989 @table @gcctabopt
11990 @item -mlibfuncs
11991 @itemx -mno-libfuncs
11992 @opindex mlibfuncs
11993 @opindex mno-libfuncs
11994 Specify that intrinsic library functions are being compiled, passing all
11995 values in registers, no matter the size.
11996
11997 @item -mepsilon
11998 @itemx -mno-epsilon
11999 @opindex mepsilon
12000 @opindex mno-epsilon
12001 Generate floating-point comparison instructions that compare with respect
12002 to the @code{rE} epsilon register.
12003
12004 @item -mabi=mmixware
12005 @itemx -mabi=gnu
12006 @opindex mabi-mmixware
12007 @opindex mabi=gnu
12008 Generate code that passes function parameters and return values that (in
12009 the called function) are seen as registers @code{$0} and up, as opposed to
12010 the GNU ABI which uses global registers @code{$231} and up.
12011
12012 @item -mzero-extend
12013 @itemx -mno-zero-extend
12014 @opindex mzero-extend
12015 @opindex mno-zero-extend
12016 When reading data from memory in sizes shorter than 64 bits, use (do not
12017 use) zero-extending load instructions by default, rather than
12018 sign-extending ones.
12019
12020 @item -mknuthdiv
12021 @itemx -mno-knuthdiv
12022 @opindex mknuthdiv
12023 @opindex mno-knuthdiv
12024 Make the result of a division yielding a remainder have the same sign as
12025 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
12026 remainder follows the sign of the dividend.  Both methods are
12027 arithmetically valid, the latter being almost exclusively used.
12028
12029 @item -mtoplevel-symbols
12030 @itemx -mno-toplevel-symbols
12031 @opindex mtoplevel-symbols
12032 @opindex mno-toplevel-symbols
12033 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
12034 code can be used with the @code{PREFIX} assembly directive.
12035
12036 @item -melf
12037 @opindex melf
12038 Generate an executable in the ELF format, rather than the default
12039 @samp{mmo} format used by the @command{mmix} simulator.
12040
12041 @item -mbranch-predict
12042 @itemx -mno-branch-predict
12043 @opindex mbranch-predict
12044 @opindex mno-branch-predict
12045 Use (do not use) the probable-branch instructions, when static branch
12046 prediction indicates a probable branch.
12047
12048 @item -mbase-addresses
12049 @itemx -mno-base-addresses
12050 @opindex mbase-addresses
12051 @opindex mno-base-addresses
12052 Generate (do not generate) code that uses @emph{base addresses}.  Using a
12053 base address automatically generates a request (handled by the assembler
12054 and the linker) for a constant to be set up in a global register.  The
12055 register is used for one or more base address requests within the range 0
12056 to 255 from the value held in the register.  The generally leads to short
12057 and fast code, but the number of different data items that can be
12058 addressed is limited.  This means that a program that uses lots of static
12059 data may require @option{-mno-base-addresses}.
12060
12061 @item -msingle-exit
12062 @itemx -mno-single-exit
12063 @opindex msingle-exit
12064 @opindex mno-single-exit
12065 Force (do not force) generated code to have a single exit point in each
12066 function.
12067 @end table
12068
12069 @node MN10300 Options
12070 @subsection MN10300 Options
12071 @cindex MN10300 options
12072
12073 These @option{-m} options are defined for Matsushita MN10300 architectures:
12074
12075 @table @gcctabopt
12076 @item -mmult-bug
12077 @opindex mmult-bug
12078 Generate code to avoid bugs in the multiply instructions for the MN10300
12079 processors.  This is the default.
12080
12081 @item -mno-mult-bug
12082 @opindex mno-mult-bug
12083 Do not generate code to avoid bugs in the multiply instructions for the
12084 MN10300 processors.
12085
12086 @item -mam33
12087 @opindex mam33
12088 Generate code which uses features specific to the AM33 processor.
12089
12090 @item -mno-am33
12091 @opindex mno-am33
12092 Do not generate code which uses features specific to the AM33 processor.  This
12093 is the default.
12094
12095 @item -mreturn-pointer-on-d0
12096 @opindex mreturn-pointer-on-d0
12097 When generating a function which returns a pointer, return the pointer
12098 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
12099 only in a0, and attempts to call such functions without a prototype
12100 would result in errors.  Note that this option is on by default; use
12101 @option{-mno-return-pointer-on-d0} to disable it.
12102
12103 @item -mno-crt0
12104 @opindex mno-crt0
12105 Do not link in the C run-time initialization object file.
12106
12107 @item -mrelax
12108 @opindex mrelax
12109 Indicate to the linker that it should perform a relaxation optimization pass
12110 to shorten branches, calls and absolute memory addresses.  This option only
12111 has an effect when used on the command line for the final link step.
12112
12113 This option makes symbolic debugging impossible.
12114 @end table
12115
12116 @node MT Options
12117 @subsection MT Options
12118 @cindex MT options
12119
12120 These @option{-m} options are defined for Morpho MT architectures:
12121
12122 @table @gcctabopt
12123
12124 @item -march=@var{cpu-type}
12125 @opindex march
12126 Generate code that will run on @var{cpu-type}, which is the name of a system
12127 representing a certain processor type.  Possible values for
12128 @var{cpu-type} are @samp{ms1-64-001}, @samp{ms1-16-002},
12129 @samp{ms1-16-003} and @samp{ms2}.
12130
12131 When this option is not used, the default is @option{-march=ms1-16-002}.
12132
12133 @item -mbacc
12134 @opindex mbacc
12135 Use byte loads and stores when generating code.
12136
12137 @item -mno-bacc
12138 @opindex mno-bacc
12139 Do not use byte loads and stores when generating code.
12140
12141 @item -msim
12142 @opindex msim
12143 Use simulator runtime
12144
12145 @item -mno-crt0
12146 @opindex mno-crt0
12147 Do not link in the C run-time initialization object file
12148 @file{crti.o}.  Other run-time initialization and termination files
12149 such as @file{startup.o} and @file{exit.o} are still included on the
12150 linker command line.
12151
12152 @end table
12153
12154 @node PDP-11 Options
12155 @subsection PDP-11 Options
12156 @cindex PDP-11 Options
12157
12158 These options are defined for the PDP-11:
12159
12160 @table @gcctabopt
12161 @item -mfpu
12162 @opindex mfpu
12163 Use hardware FPP floating point.  This is the default.  (FIS floating
12164 point on the PDP-11/40 is not supported.)
12165
12166 @item -msoft-float
12167 @opindex msoft-float
12168 Do not use hardware floating point.
12169
12170 @item -mac0
12171 @opindex mac0
12172 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
12173
12174 @item -mno-ac0
12175 @opindex mno-ac0
12176 Return floating-point results in memory.  This is the default.
12177
12178 @item -m40
12179 @opindex m40
12180 Generate code for a PDP-11/40.
12181
12182 @item -m45
12183 @opindex m45
12184 Generate code for a PDP-11/45.  This is the default.
12185
12186 @item -m10
12187 @opindex m10
12188 Generate code for a PDP-11/10.
12189
12190 @item -mbcopy-builtin
12191 @opindex bcopy-builtin
12192 Use inline @code{movmemhi} patterns for copying memory.  This is the
12193 default.
12194
12195 @item -mbcopy
12196 @opindex mbcopy
12197 Do not use inline @code{movmemhi} patterns for copying memory.
12198
12199 @item -mint16
12200 @itemx -mno-int32
12201 @opindex mint16
12202 @opindex mno-int32
12203 Use 16-bit @code{int}.  This is the default.
12204
12205 @item -mint32
12206 @itemx -mno-int16
12207 @opindex mint32
12208 @opindex mno-int16
12209 Use 32-bit @code{int}.
12210
12211 @item -mfloat64
12212 @itemx -mno-float32
12213 @opindex mfloat64
12214 @opindex mno-float32
12215 Use 64-bit @code{float}.  This is the default.
12216
12217 @item -mfloat32
12218 @itemx -mno-float64
12219 @opindex mfloat32
12220 @opindex mno-float64
12221 Use 32-bit @code{float}.
12222
12223 @item -mabshi
12224 @opindex mabshi
12225 Use @code{abshi2} pattern.  This is the default.
12226
12227 @item -mno-abshi
12228 @opindex mno-abshi
12229 Do not use @code{abshi2} pattern.
12230
12231 @item -mbranch-expensive
12232 @opindex mbranch-expensive
12233 Pretend that branches are expensive.  This is for experimenting with
12234 code generation only.
12235
12236 @item -mbranch-cheap
12237 @opindex mbranch-cheap
12238 Do not pretend that branches are expensive.  This is the default.
12239
12240 @item -msplit
12241 @opindex msplit
12242 Generate code for a system with split I&D@.
12243
12244 @item -mno-split
12245 @opindex mno-split
12246 Generate code for a system without split I&D@.  This is the default.
12247
12248 @item -munix-asm
12249 @opindex munix-asm
12250 Use Unix assembler syntax.  This is the default when configured for
12251 @samp{pdp11-*-bsd}.
12252
12253 @item -mdec-asm
12254 @opindex mdec-asm
12255 Use DEC assembler syntax.  This is the default when configured for any
12256 PDP-11 target other than @samp{pdp11-*-bsd}.
12257 @end table
12258
12259 @node PowerPC Options
12260 @subsection PowerPC Options
12261 @cindex PowerPC options
12262
12263 These are listed under @xref{RS/6000 and PowerPC Options}.
12264
12265 @node RS/6000 and PowerPC Options
12266 @subsection IBM RS/6000 and PowerPC Options
12267 @cindex RS/6000 and PowerPC Options
12268 @cindex IBM RS/6000 and PowerPC Options
12269
12270 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
12271 @table @gcctabopt
12272 @item -mpower
12273 @itemx -mno-power
12274 @itemx -mpower2
12275 @itemx -mno-power2
12276 @itemx -mpowerpc
12277 @itemx -mno-powerpc
12278 @itemx -mpowerpc-gpopt
12279 @itemx -mno-powerpc-gpopt
12280 @itemx -mpowerpc-gfxopt
12281 @itemx -mno-powerpc-gfxopt
12282 @itemx -mpowerpc64
12283 @itemx -mno-powerpc64
12284 @itemx -mmfcrf
12285 @itemx -mno-mfcrf
12286 @itemx -mpopcntb
12287 @itemx -mno-popcntb
12288 @itemx -mfprnd
12289 @itemx -mno-fprnd
12290 @itemx -mcmpb
12291 @itemx -mno-cmpb
12292 @itemx -mmfpgpr
12293 @itemx -mno-mfpgpr
12294 @itemx -mdfp
12295 @itemx -mno-dfp
12296 @opindex mpower
12297 @opindex mno-power
12298 @opindex mpower2
12299 @opindex mno-power2
12300 @opindex mpowerpc
12301 @opindex mno-powerpc
12302 @opindex mpowerpc-gpopt
12303 @opindex mno-powerpc-gpopt
12304 @opindex mpowerpc-gfxopt
12305 @opindex mno-powerpc-gfxopt
12306 @opindex mpowerpc64
12307 @opindex mno-powerpc64
12308 @opindex mmfcrf
12309 @opindex mno-mfcrf
12310 @opindex mpopcntb
12311 @opindex mno-popcntb
12312 @opindex mfprnd
12313 @opindex mno-fprnd
12314 @opindex mcmpb
12315 @opindex mno-cmpb
12316 @opindex mmfpgpr
12317 @opindex mno-mfpgpr
12318 @opindex mdfp
12319 @opindex mno-dfp
12320 GCC supports two related instruction set architectures for the
12321 RS/6000 and PowerPC@.  The @dfn{POWER} instruction set are those
12322 instructions supported by the @samp{rios} chip set used in the original
12323 RS/6000 systems and the @dfn{PowerPC} instruction set is the
12324 architecture of the Freescale MPC5xx, MPC6xx, MPC8xx microprocessors, and
12325 the IBM 4xx, 6xx, and follow-on microprocessors.
12326
12327 Neither architecture is a subset of the other.  However there is a
12328 large common subset of instructions supported by both.  An MQ
12329 register is included in processors supporting the POWER architecture.
12330
12331 You use these options to specify which instructions are available on the
12332 processor you are using.  The default value of these options is
12333 determined when configuring GCC@.  Specifying the
12334 @option{-mcpu=@var{cpu_type}} overrides the specification of these
12335 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
12336 rather than the options listed above.
12337
12338 The @option{-mpower} option allows GCC to generate instructions that
12339 are found only in the POWER architecture and to use the MQ register.
12340 Specifying @option{-mpower2} implies @option{-power} and also allows GCC
12341 to generate instructions that are present in the POWER2 architecture but
12342 not the original POWER architecture.
12343
12344 The @option{-mpowerpc} option allows GCC to generate instructions that
12345 are found only in the 32-bit subset of the PowerPC architecture.
12346 Specifying @option{-mpowerpc-gpopt} implies @option{-mpowerpc} and also allows
12347 GCC to use the optional PowerPC architecture instructions in the
12348 General Purpose group, including floating-point square root.  Specifying
12349 @option{-mpowerpc-gfxopt} implies @option{-mpowerpc} and also allows GCC to
12350 use the optional PowerPC architecture instructions in the Graphics
12351 group, including floating-point select.
12352
12353 The @option{-mmfcrf} option allows GCC to generate the move from
12354 condition register field instruction implemented on the POWER4
12355 processor and other processors that support the PowerPC V2.01
12356 architecture.
12357 The @option{-mpopcntb} option allows GCC to generate the popcount and
12358 double precision FP reciprocal estimate instruction implemented on the
12359 POWER5 processor and other processors that support the PowerPC V2.02
12360 architecture.
12361 The @option{-mfprnd} option allows GCC to generate the FP round to
12362 integer instructions implemented on the POWER5+ processor and other
12363 processors that support the PowerPC V2.03 architecture.
12364 The @option{-mcmpb} option allows GCC to generate the compare bytes
12365 instruction implemented on the POWER6 processor and other processors
12366 that support the PowerPC V2.05 architecture.
12367 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
12368 general purpose register instructions implemented on the POWER6X
12369 processor and other processors that support the extended PowerPC V2.05
12370 architecture.
12371 The @option{-mdfp} option allows GCC to generate the decimal floating
12372 point instructions implemented on some POWER processors.
12373
12374 The @option{-mpowerpc64} option allows GCC to generate the additional
12375 64-bit instructions that are found in the full PowerPC64 architecture
12376 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
12377 @option{-mno-powerpc64}.
12378
12379 If you specify both @option{-mno-power} and @option{-mno-powerpc}, GCC
12380 will use only the instructions in the common subset of both
12381 architectures plus some special AIX common-mode calls, and will not use
12382 the MQ register.  Specifying both @option{-mpower} and @option{-mpowerpc}
12383 permits GCC to use any instruction from either architecture and to
12384 allow use of the MQ register; specify this for the Motorola MPC601.
12385
12386 @item -mnew-mnemonics
12387 @itemx -mold-mnemonics
12388 @opindex mnew-mnemonics
12389 @opindex mold-mnemonics
12390 Select which mnemonics to use in the generated assembler code.  With
12391 @option{-mnew-mnemonics}, GCC uses the assembler mnemonics defined for
12392 the PowerPC architecture.  With @option{-mold-mnemonics} it uses the
12393 assembler mnemonics defined for the POWER architecture.  Instructions
12394 defined in only one architecture have only one mnemonic; GCC uses that
12395 mnemonic irrespective of which of these options is specified.
12396
12397 GCC defaults to the mnemonics appropriate for the architecture in
12398 use.  Specifying @option{-mcpu=@var{cpu_type}} sometimes overrides the
12399 value of these option.  Unless you are building a cross-compiler, you
12400 should normally not specify either @option{-mnew-mnemonics} or
12401 @option{-mold-mnemonics}, but should instead accept the default.
12402
12403 @item -mcpu=@var{cpu_type}
12404 @opindex mcpu
12405 Set architecture type, register usage, choice of mnemonics, and
12406 instruction scheduling parameters for machine type @var{cpu_type}.
12407 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
12408 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{505},
12409 @samp{601}, @samp{602}, @samp{603}, @samp{603e}, @samp{604},
12410 @samp{604e}, @samp{620}, @samp{630}, @samp{740}, @samp{7400},
12411 @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
12412 @samp{860}, @samp{970}, @samp{8540}, @samp{ec603e}, @samp{G3},
12413 @samp{G4}, @samp{G5}, @samp{power}, @samp{power2}, @samp{power3},
12414 @samp{power4}, @samp{power5}, @samp{power5+}, @samp{power6},
12415 @samp{power6x}, @samp{common}, @samp{powerpc}, @samp{powerpc64},
12416 @samp{rios}, @samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64}.
12417
12418 @option{-mcpu=common} selects a completely generic processor.  Code
12419 generated under this option will run on any POWER or PowerPC processor.
12420 GCC will use only the instructions in the common subset of both
12421 architectures, and will not use the MQ register.  GCC assumes a generic
12422 processor model for scheduling purposes.
12423
12424 @option{-mcpu=power}, @option{-mcpu=power2}, @option{-mcpu=powerpc}, and
12425 @option{-mcpu=powerpc64} specify generic POWER, POWER2, pure 32-bit
12426 PowerPC (i.e., not MPC601), and 64-bit PowerPC architecture machine
12427 types, with an appropriate, generic processor model assumed for
12428 scheduling purposes.
12429
12430 The other options specify a specific processor.  Code generated under
12431 those options will run best on that processor, and may not run at all on
12432 others.
12433
12434 The @option{-mcpu} options automatically enable or disable the
12435 following options:
12436
12437 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
12438 -mnew-mnemonics  -mpopcntb  -mpower  -mpower2  -mpowerpc64 @gol
12439 -mpowerpc-gpopt  -mpowerpc-gfxopt  -mstring  -mmulhw  -mdlmzb  -mmfpgpr}
12440
12441 The particular options set for any particular CPU will vary between
12442 compiler versions, depending on what setting seems to produce optimal
12443 code for that CPU; it doesn't necessarily reflect the actual hardware's
12444 capabilities.  If you wish to set an individual option to a particular
12445 value, you may specify it after the @option{-mcpu} option, like
12446 @samp{-mcpu=970 -mno-altivec}.
12447
12448 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
12449 not enabled or disabled by the @option{-mcpu} option at present because
12450 AIX does not have full support for these options.  You may still
12451 enable or disable them individually if you're sure it'll work in your
12452 environment.
12453
12454 @item -mtune=@var{cpu_type}
12455 @opindex mtune
12456 Set the instruction scheduling parameters for machine type
12457 @var{cpu_type}, but do not set the architecture type, register usage, or
12458 choice of mnemonics, as @option{-mcpu=@var{cpu_type}} would.  The same
12459 values for @var{cpu_type} are used for @option{-mtune} as for
12460 @option{-mcpu}.  If both are specified, the code generated will use the
12461 architecture, registers, and mnemonics set by @option{-mcpu}, but the
12462 scheduling parameters set by @option{-mtune}.
12463
12464 @item -mswdiv
12465 @itemx -mno-swdiv
12466 @opindex mswdiv
12467 @opindex mno-swdiv
12468 Generate code to compute division as reciprocal estimate and iterative
12469 refinement, creating opportunities for increased throughput.  This
12470 feature requires: optional PowerPC Graphics instruction set for single
12471 precision and FRE instruction for double precision, assuming divides
12472 cannot generate user-visible traps, and the domain values not include
12473 Infinities, denormals or zero denominator.
12474
12475 @item -maltivec
12476 @itemx -mno-altivec
12477 @opindex maltivec
12478 @opindex mno-altivec
12479 Generate code that uses (does not use) AltiVec instructions, and also
12480 enable the use of built-in functions that allow more direct access to
12481 the AltiVec instruction set.  You may also need to set
12482 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
12483 enhancements.
12484
12485 @item -mvrsave
12486 @item -mno-vrsave
12487 @opindex mvrsave
12488 @opindex mno-vrsave
12489 Generate VRSAVE instructions when generating AltiVec code.
12490
12491 @item -msecure-plt
12492 @opindex msecure-plt
12493 Generate code that allows ld and ld.so to build executables and shared
12494 libraries with non-exec .plt and .got sections.  This is a PowerPC
12495 32-bit SYSV ABI option.
12496
12497 @item -mbss-plt
12498 @opindex mbss-plt
12499 Generate code that uses a BSS .plt section that ld.so fills in, and
12500 requires .plt and .got sections that are both writable and executable.
12501 This is a PowerPC 32-bit SYSV ABI option.
12502
12503 @item -misel
12504 @itemx -mno-isel
12505 @opindex misel
12506 @opindex mno-isel
12507 This switch enables or disables the generation of ISEL instructions.
12508
12509 @item -misel=@var{yes/no}
12510 This switch has been deprecated.  Use @option{-misel} and
12511 @option{-mno-isel} instead.
12512
12513 @item -mspe
12514 @itemx -mno-spe
12515 @opindex mspe
12516 @opindex mno-spe
12517 This switch enables or disables the generation of SPE simd
12518 instructions.
12519
12520 @item -mspe=@var{yes/no}
12521 This option has been deprecated.  Use @option{-mspe} and
12522 @option{-mno-spe} instead.
12523
12524 @item -mfloat-gprs=@var{yes/single/double/no}
12525 @itemx -mfloat-gprs
12526 @opindex mfloat-gprs
12527 This switch enables or disables the generation of floating point
12528 operations on the general purpose registers for architectures that
12529 support it.
12530
12531 The argument @var{yes} or @var{single} enables the use of
12532 single-precision floating point operations.
12533
12534 The argument @var{double} enables the use of single and
12535 double-precision floating point operations.
12536
12537 The argument @var{no} disables floating point operations on the
12538 general purpose registers.
12539
12540 This option is currently only available on the MPC854x.
12541
12542 @item -m32
12543 @itemx -m64
12544 @opindex m32
12545 @opindex m64
12546 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
12547 targets (including GNU/Linux).  The 32-bit environment sets int, long
12548 and pointer to 32 bits and generates code that runs on any PowerPC
12549 variant.  The 64-bit environment sets int to 32 bits and long and
12550 pointer to 64 bits, and generates code for PowerPC64, as for
12551 @option{-mpowerpc64}.
12552
12553 @item -mfull-toc
12554 @itemx -mno-fp-in-toc
12555 @itemx -mno-sum-in-toc
12556 @itemx -mminimal-toc
12557 @opindex mfull-toc
12558 @opindex mno-fp-in-toc
12559 @opindex mno-sum-in-toc
12560 @opindex mminimal-toc
12561 Modify generation of the TOC (Table Of Contents), which is created for
12562 every executable file.  The @option{-mfull-toc} option is selected by
12563 default.  In that case, GCC will allocate at least one TOC entry for
12564 each unique non-automatic variable reference in your program.  GCC
12565 will also place floating-point constants in the TOC@.  However, only
12566 16,384 entries are available in the TOC@.
12567
12568 If you receive a linker error message that saying you have overflowed
12569 the available TOC space, you can reduce the amount of TOC space used
12570 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
12571 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
12572 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
12573 generate code to calculate the sum of an address and a constant at
12574 run-time instead of putting that sum into the TOC@.  You may specify one
12575 or both of these options.  Each causes GCC to produce very slightly
12576 slower and larger code at the expense of conserving TOC space.
12577
12578 If you still run out of space in the TOC even when you specify both of
12579 these options, specify @option{-mminimal-toc} instead.  This option causes
12580 GCC to make only one TOC entry for every file.  When you specify this
12581 option, GCC will produce code that is slower and larger but which
12582 uses extremely little TOC space.  You may wish to use this option
12583 only on files that contain less frequently executed code.
12584
12585 @item -maix64
12586 @itemx -maix32
12587 @opindex maix64
12588 @opindex maix32
12589 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
12590 @code{long} type, and the infrastructure needed to support them.
12591 Specifying @option{-maix64} implies @option{-mpowerpc64} and
12592 @option{-mpowerpc}, while @option{-maix32} disables the 64-bit ABI and
12593 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
12594
12595 @item -mxl-compat
12596 @itemx -mno-xl-compat
12597 @opindex mxl-compat
12598 @opindex mno-xl-compat
12599 Produce code that conforms more closely to IBM XL compiler semantics
12600 when using AIX-compatible ABI.  Pass floating-point arguments to
12601 prototyped functions beyond the register save area (RSA) on the stack
12602 in addition to argument FPRs.  Do not assume that most significant
12603 double in 128-bit long double value is properly rounded when comparing
12604 values and converting to double.  Use XL symbol names for long double
12605 support routines.
12606
12607 The AIX calling convention was extended but not initially documented to
12608 handle an obscure K&R C case of calling a function that takes the
12609 address of its arguments with fewer arguments than declared.  IBM XL
12610 compilers access floating point arguments which do not fit in the
12611 RSA from the stack when a subroutine is compiled without
12612 optimization.  Because always storing floating-point arguments on the
12613 stack is inefficient and rarely needed, this option is not enabled by
12614 default and only is necessary when calling subroutines compiled by IBM
12615 XL compilers without optimization.
12616
12617 @item -mpe
12618 @opindex mpe
12619 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
12620 application written to use message passing with special startup code to
12621 enable the application to run.  The system must have PE installed in the
12622 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
12623 must be overridden with the @option{-specs=} option to specify the
12624 appropriate directory location.  The Parallel Environment does not
12625 support threads, so the @option{-mpe} option and the @option{-pthread}
12626 option are incompatible.
12627
12628 @item -malign-natural
12629 @itemx -malign-power
12630 @opindex malign-natural
12631 @opindex malign-power
12632 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
12633 @option{-malign-natural} overrides the ABI-defined alignment of larger
12634 types, such as floating-point doubles, on their natural size-based boundary.
12635 The option @option{-malign-power} instructs GCC to follow the ABI-specified
12636 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
12637
12638 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
12639 is not supported.
12640
12641 @item -msoft-float
12642 @itemx -mhard-float
12643 @opindex msoft-float
12644 @opindex mhard-float
12645 Generate code that does not use (uses) the floating-point register set.
12646 Software floating point emulation is provided if you use the
12647 @option{-msoft-float} option, and pass the option to GCC when linking.
12648
12649 @item -mmultiple
12650 @itemx -mno-multiple
12651 @opindex mmultiple
12652 @opindex mno-multiple
12653 Generate code that uses (does not use) the load multiple word
12654 instructions and the store multiple word instructions.  These
12655 instructions are generated by default on POWER systems, and not
12656 generated on PowerPC systems.  Do not use @option{-mmultiple} on little
12657 endian PowerPC systems, since those instructions do not work when the
12658 processor is in little endian mode.  The exceptions are PPC740 and
12659 PPC750 which permit the instructions usage in little endian mode.
12660
12661 @item -mstring
12662 @itemx -mno-string
12663 @opindex mstring
12664 @opindex mno-string
12665 Generate code that uses (does not use) the load string instructions
12666 and the store string word instructions to save multiple registers and
12667 do small block moves.  These instructions are generated by default on
12668 POWER systems, and not generated on PowerPC systems.  Do not use
12669 @option{-mstring} on little endian PowerPC systems, since those
12670 instructions do not work when the processor is in little endian mode.
12671 The exceptions are PPC740 and PPC750 which permit the instructions
12672 usage in little endian mode.
12673
12674 @item -mupdate
12675 @itemx -mno-update
12676 @opindex mupdate
12677 @opindex mno-update
12678 Generate code that uses (does not use) the load or store instructions
12679 that update the base register to the address of the calculated memory
12680 location.  These instructions are generated by default.  If you use
12681 @option{-mno-update}, there is a small window between the time that the
12682 stack pointer is updated and the address of the previous frame is
12683 stored, which means code that walks the stack frame across interrupts or
12684 signals may get corrupted data.
12685
12686 @item -mfused-madd
12687 @itemx -mno-fused-madd
12688 @opindex mfused-madd
12689 @opindex mno-fused-madd
12690 Generate code that uses (does not use) the floating point multiply and
12691 accumulate instructions.  These instructions are generated by default if
12692 hardware floating is used.
12693
12694 @item -mmulhw
12695 @itemx -mno-mulhw
12696 @opindex mmulhw
12697 @opindex mno-mulhw
12698 Generate code that uses (does not use) the half-word multiply and
12699 multiply-accumulate instructions on the IBM 405 and 440 processors.
12700 These instructions are generated by default when targetting those
12701 processors.
12702
12703 @item -mdlmzb
12704 @itemx -mno-dlmzb
12705 @opindex mdlmzb
12706 @opindex mno-dlmzb
12707 Generate code that uses (does not use) the string-search @samp{dlmzb}
12708 instruction on the IBM 405 and 440 processors.  This instruction is
12709 generated by default when targetting those processors.
12710
12711 @item -mno-bit-align
12712 @itemx -mbit-align
12713 @opindex mno-bit-align
12714 @opindex mbit-align
12715 On System V.4 and embedded PowerPC systems do not (do) force structures
12716 and unions that contain bit-fields to be aligned to the base type of the
12717 bit-field.
12718
12719 For example, by default a structure containing nothing but 8
12720 @code{unsigned} bit-fields of length 1 would be aligned to a 4 byte
12721 boundary and have a size of 4 bytes.  By using @option{-mno-bit-align},
12722 the structure would be aligned to a 1 byte boundary and be one byte in
12723 size.
12724
12725 @item -mno-strict-align
12726 @itemx -mstrict-align
12727 @opindex mno-strict-align
12728 @opindex mstrict-align
12729 On System V.4 and embedded PowerPC systems do not (do) assume that
12730 unaligned memory references will be handled by the system.
12731
12732 @item -mrelocatable
12733 @itemx -mno-relocatable
12734 @opindex mrelocatable
12735 @opindex mno-relocatable
12736 On embedded PowerPC systems generate code that allows (does not allow)
12737 the program to be relocated to a different address at runtime.  If you
12738 use @option{-mrelocatable} on any module, all objects linked together must
12739 be compiled with @option{-mrelocatable} or @option{-mrelocatable-lib}.
12740
12741 @item -mrelocatable-lib
12742 @itemx -mno-relocatable-lib
12743 @opindex mrelocatable-lib
12744 @opindex mno-relocatable-lib
12745 On embedded PowerPC systems generate code that allows (does not allow)
12746 the program to be relocated to a different address at runtime.  Modules
12747 compiled with @option{-mrelocatable-lib} can be linked with either modules
12748 compiled without @option{-mrelocatable} and @option{-mrelocatable-lib} or
12749 with modules compiled with the @option{-mrelocatable} options.
12750
12751 @item -mno-toc
12752 @itemx -mtoc
12753 @opindex mno-toc
12754 @opindex mtoc
12755 On System V.4 and embedded PowerPC systems do not (do) assume that
12756 register 2 contains a pointer to a global area pointing to the addresses
12757 used in the program.
12758
12759 @item -mlittle
12760 @itemx -mlittle-endian
12761 @opindex mlittle
12762 @opindex mlittle-endian
12763 On System V.4 and embedded PowerPC systems compile code for the
12764 processor in little endian mode.  The @option{-mlittle-endian} option is
12765 the same as @option{-mlittle}.
12766
12767 @item -mbig
12768 @itemx -mbig-endian
12769 @opindex mbig
12770 @opindex mbig-endian
12771 On System V.4 and embedded PowerPC systems compile code for the
12772 processor in big endian mode.  The @option{-mbig-endian} option is
12773 the same as @option{-mbig}.
12774
12775 @item -mdynamic-no-pic
12776 @opindex mdynamic-no-pic
12777 On Darwin and Mac OS X systems, compile code so that it is not
12778 relocatable, but that its external references are relocatable.  The
12779 resulting code is suitable for applications, but not shared
12780 libraries.
12781
12782 @item -mprioritize-restricted-insns=@var{priority}
12783 @opindex mprioritize-restricted-insns
12784 This option controls the priority that is assigned to
12785 dispatch-slot restricted instructions during the second scheduling
12786 pass.  The argument @var{priority} takes the value @var{0/1/2} to assign
12787 @var{no/highest/second-highest} priority to dispatch slot restricted
12788 instructions.
12789
12790 @item -msched-costly-dep=@var{dependence_type}
12791 @opindex msched-costly-dep
12792 This option controls which dependences are considered costly
12793 by the target during instruction scheduling.  The argument
12794 @var{dependence_type} takes one of the following values:
12795 @var{no}: no dependence is costly,
12796 @var{all}: all dependences are costly,
12797 @var{true_store_to_load}: a true dependence from store to load is costly,
12798 @var{store_to_load}: any dependence from store to load is costly,
12799 @var{number}: any dependence which latency >= @var{number} is costly.
12800
12801 @item -minsert-sched-nops=@var{scheme}
12802 @opindex minsert-sched-nops
12803 This option controls which nop insertion scheme will be used during
12804 the second scheduling pass.  The argument @var{scheme} takes one of the
12805 following values:
12806 @var{no}: Don't insert nops.
12807 @var{pad}: Pad with nops any dispatch group which has vacant issue slots,
12808 according to the scheduler's grouping.
12809 @var{regroup_exact}: Insert nops to force costly dependent insns into
12810 separate groups.  Insert exactly as many nops as needed to force an insn
12811 to a new group, according to the estimated processor grouping.
12812 @var{number}: Insert nops to force costly dependent insns into
12813 separate groups.  Insert @var{number} nops to force an insn to a new group.
12814
12815 @item -mcall-sysv
12816 @opindex mcall-sysv
12817 On System V.4 and embedded PowerPC systems compile code using calling
12818 conventions that adheres to the March 1995 draft of the System V
12819 Application Binary Interface, PowerPC processor supplement.  This is the
12820 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
12821
12822 @item -mcall-sysv-eabi
12823 @opindex mcall-sysv-eabi
12824 Specify both @option{-mcall-sysv} and @option{-meabi} options.
12825
12826 @item -mcall-sysv-noeabi
12827 @opindex mcall-sysv-noeabi
12828 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
12829
12830 @item -mcall-solaris
12831 @opindex mcall-solaris
12832 On System V.4 and embedded PowerPC systems compile code for the Solaris
12833 operating system.
12834
12835 @item -mcall-linux
12836 @opindex mcall-linux
12837 On System V.4 and embedded PowerPC systems compile code for the
12838 Linux-based GNU system.
12839
12840 @item -mcall-gnu
12841 @opindex mcall-gnu
12842 On System V.4 and embedded PowerPC systems compile code for the
12843 Hurd-based GNU system.
12844
12845 @item -mcall-netbsd
12846 @opindex mcall-netbsd
12847 On System V.4 and embedded PowerPC systems compile code for the
12848 NetBSD operating system.
12849
12850 @item -maix-struct-return
12851 @opindex maix-struct-return
12852 Return all structures in memory (as specified by the AIX ABI)@.
12853
12854 @item -msvr4-struct-return
12855 @opindex msvr4-struct-return
12856 Return structures smaller than 8 bytes in registers (as specified by the
12857 SVR4 ABI)@.
12858
12859 @item -mabi=@var{abi-type}
12860 @opindex mabi
12861 Extend the current ABI with a particular extension, or remove such extension.
12862 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
12863 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble}@.
12864
12865 @item -mabi=spe
12866 @opindex mabi=spe
12867 Extend the current ABI with SPE ABI extensions.  This does not change
12868 the default ABI, instead it adds the SPE ABI extensions to the current
12869 ABI@.
12870
12871 @item -mabi=no-spe
12872 @opindex mabi=no-spe
12873 Disable Booke SPE ABI extensions for the current ABI@.
12874
12875 @item -mabi=ibmlongdouble
12876 @opindex mabi=ibmlongdouble
12877 Change the current ABI to use IBM extended precision long double.
12878 This is a PowerPC 32-bit SYSV ABI option.
12879
12880 @item -mabi=ieeelongdouble
12881 @opindex mabi=ieeelongdouble
12882 Change the current ABI to use IEEE extended precision long double.
12883 This is a PowerPC 32-bit Linux ABI option.
12884
12885 @item -mprototype
12886 @itemx -mno-prototype
12887 @opindex mprototype
12888 @opindex mno-prototype
12889 On System V.4 and embedded PowerPC systems assume that all calls to
12890 variable argument functions are properly prototyped.  Otherwise, the
12891 compiler must insert an instruction before every non prototyped call to
12892 set or clear bit 6 of the condition code register (@var{CR}) to
12893 indicate whether floating point values were passed in the floating point
12894 registers in case the function takes a variable arguments.  With
12895 @option{-mprototype}, only calls to prototyped variable argument functions
12896 will set or clear the bit.
12897
12898 @item -msim
12899 @opindex msim
12900 On embedded PowerPC systems, assume that the startup module is called
12901 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
12902 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}.
12903 configurations.
12904
12905 @item -mmvme
12906 @opindex mmvme
12907 On embedded PowerPC systems, assume that the startup module is called
12908 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
12909 @file{libc.a}.
12910
12911 @item -mads
12912 @opindex mads
12913 On embedded PowerPC systems, assume that the startup module is called
12914 @file{crt0.o} and the standard C libraries are @file{libads.a} and
12915 @file{libc.a}.
12916
12917 @item -myellowknife
12918 @opindex myellowknife
12919 On embedded PowerPC systems, assume that the startup module is called
12920 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
12921 @file{libc.a}.
12922
12923 @item -mvxworks
12924 @opindex mvxworks
12925 On System V.4 and embedded PowerPC systems, specify that you are
12926 compiling for a VxWorks system.
12927
12928 @item -mwindiss
12929 @opindex mwindiss
12930 Specify that you are compiling for the WindISS simulation environment.
12931
12932 @item -memb
12933 @opindex memb
12934 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
12935 header to indicate that @samp{eabi} extended relocations are used.
12936
12937 @item -meabi
12938 @itemx -mno-eabi
12939 @opindex meabi
12940 @opindex mno-eabi
12941 On System V.4 and embedded PowerPC systems do (do not) adhere to the
12942 Embedded Applications Binary Interface (eabi) which is a set of
12943 modifications to the System V.4 specifications.  Selecting @option{-meabi}
12944 means that the stack is aligned to an 8 byte boundary, a function
12945 @code{__eabi} is called to from @code{main} to set up the eabi
12946 environment, and the @option{-msdata} option can use both @code{r2} and
12947 @code{r13} to point to two separate small data areas.  Selecting
12948 @option{-mno-eabi} means that the stack is aligned to a 16 byte boundary,
12949 do not call an initialization function from @code{main}, and the
12950 @option{-msdata} option will only use @code{r13} to point to a single
12951 small data area.  The @option{-meabi} option is on by default if you
12952 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
12953
12954 @item -msdata=eabi
12955 @opindex msdata=eabi
12956 On System V.4 and embedded PowerPC systems, put small initialized
12957 @code{const} global and static data in the @samp{.sdata2} section, which
12958 is pointed to by register @code{r2}.  Put small initialized
12959 non-@code{const} global and static data in the @samp{.sdata} section,
12960 which is pointed to by register @code{r13}.  Put small uninitialized
12961 global and static data in the @samp{.sbss} section, which is adjacent to
12962 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
12963 incompatible with the @option{-mrelocatable} option.  The
12964 @option{-msdata=eabi} option also sets the @option{-memb} option.
12965
12966 @item -msdata=sysv
12967 @opindex msdata=sysv
12968 On System V.4 and embedded PowerPC systems, put small global and static
12969 data in the @samp{.sdata} section, which is pointed to by register
12970 @code{r13}.  Put small uninitialized global and static data in the
12971 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
12972 The @option{-msdata=sysv} option is incompatible with the
12973 @option{-mrelocatable} option.
12974
12975 @item -msdata=default
12976 @itemx -msdata
12977 @opindex msdata=default
12978 @opindex msdata
12979 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
12980 compile code the same as @option{-msdata=eabi}, otherwise compile code the
12981 same as @option{-msdata=sysv}.
12982
12983 @item -msdata-data
12984 @opindex msdata-data
12985 On System V.4 and embedded PowerPC systems, put small global
12986 data in the @samp{.sdata} section.  Put small uninitialized global
12987 data in the @samp{.sbss} section.  Do not use register @code{r13}
12988 to address small data however.  This is the default behavior unless
12989 other @option{-msdata} options are used.
12990
12991 @item -msdata=none
12992 @itemx -mno-sdata
12993 @opindex msdata=none
12994 @opindex mno-sdata
12995 On embedded PowerPC systems, put all initialized global and static data
12996 in the @samp{.data} section, and all uninitialized data in the
12997 @samp{.bss} section.
12998
12999 @item -G @var{num}
13000 @opindex G
13001 @cindex smaller data references (PowerPC)
13002 @cindex .sdata/.sdata2 references (PowerPC)
13003 On embedded PowerPC systems, put global and static items less than or
13004 equal to @var{num} bytes into the small data or bss sections instead of
13005 the normal data or bss section.  By default, @var{num} is 8.  The
13006 @option{-G @var{num}} switch is also passed to the linker.
13007 All modules should be compiled with the same @option{-G @var{num}} value.
13008
13009 @item -mregnames
13010 @itemx -mno-regnames
13011 @opindex mregnames
13012 @opindex mno-regnames
13013 On System V.4 and embedded PowerPC systems do (do not) emit register
13014 names in the assembly language output using symbolic forms.
13015
13016 @item -mlongcall
13017 @itemx -mno-longcall
13018 @opindex mlongcall
13019 @opindex mno-longcall
13020 By default assume that all calls are far away so that a longer more
13021 expensive calling sequence is required.  This is required for calls
13022 further than 32 megabytes (33,554,432 bytes) from the current location.
13023 A short call will be generated if the compiler knows
13024 the call cannot be that far away.  This setting can be overridden by
13025 the @code{shortcall} function attribute, or by @code{#pragma
13026 longcall(0)}.
13027
13028 Some linkers are capable of detecting out-of-range calls and generating
13029 glue code on the fly.  On these systems, long calls are unnecessary and
13030 generate slower code.  As of this writing, the AIX linker can do this,
13031 as can the GNU linker for PowerPC/64.  It is planned to add this feature
13032 to the GNU linker for 32-bit PowerPC systems as well.
13033
13034 On Darwin/PPC systems, @code{#pragma longcall} will generate ``jbsr
13035 callee, L42'', plus a ``branch island'' (glue code).  The two target
13036 addresses represent the callee and the ``branch island''.  The
13037 Darwin/PPC linker will prefer the first address and generate a ``bl
13038 callee'' if the PPC ``bl'' instruction will reach the callee directly;
13039 otherwise, the linker will generate ``bl L42'' to call the ``branch
13040 island''.  The ``branch island'' is appended to the body of the
13041 calling function; it computes the full 32-bit address of the callee
13042 and jumps to it.
13043
13044 On Mach-O (Darwin) systems, this option directs the compiler emit to
13045 the glue for every direct call, and the Darwin linker decides whether
13046 to use or discard it.
13047
13048 In the future, we may cause GCC to ignore all longcall specifications
13049 when the linker is known to generate glue.
13050
13051 @item -pthread
13052 @opindex pthread
13053 Adds support for multithreading with the @dfn{pthreads} library.
13054 This option sets flags for both the preprocessor and linker.
13055
13056 @end table
13057
13058 @node S/390 and zSeries Options
13059 @subsection S/390 and zSeries Options
13060 @cindex S/390 and zSeries Options
13061
13062 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
13063
13064 @table @gcctabopt
13065 @item -mhard-float
13066 @itemx -msoft-float
13067 @opindex mhard-float
13068 @opindex msoft-float
13069 Use (do not use) the hardware floating-point instructions and registers
13070 for floating-point operations.  When @option{-msoft-float} is specified,
13071 functions in @file{libgcc.a} will be used to perform floating-point
13072 operations.  When @option{-mhard-float} is specified, the compiler
13073 generates IEEE floating-point instructions.  This is the default.
13074
13075 @item -mlong-double-64
13076 @itemx -mlong-double-128
13077 @opindex mlong-double-64
13078 @opindex mlong-double-128
13079 These switches control the size of @code{long double} type. A size
13080 of 64bit makes the @code{long double} type equivalent to the @code{double}
13081 type. This is the default.
13082
13083 @item -mbackchain
13084 @itemx -mno-backchain
13085 @opindex mbackchain
13086 @opindex mno-backchain
13087 Store (do not store) the address of the caller's frame as backchain pointer
13088 into the callee's stack frame.
13089 A backchain may be needed to allow debugging using tools that do not understand
13090 DWARF-2 call frame information.
13091 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
13092 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
13093 the backchain is placed into the topmost word of the 96/160 byte register
13094 save area.
13095
13096 In general, code compiled with @option{-mbackchain} is call-compatible with
13097 code compiled with @option{-mmo-backchain}; however, use of the backchain
13098 for debugging purposes usually requires that the whole binary is built with
13099 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
13100 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
13101 to build a linux kernel use @option{-msoft-float}.
13102
13103 The default is to not maintain the backchain.
13104
13105 @item -mpacked-stack
13106 @item -mno-packed-stack
13107 @opindex mpacked-stack
13108 @opindex mno-packed-stack
13109 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
13110 specified, the compiler uses the all fields of the 96/160 byte register save
13111 area only for their default purpose; unused fields still take up stack space.
13112 When @option{-mpacked-stack} is specified, register save slots are densely
13113 packed at the top of the register save area; unused space is reused for other
13114 purposes, allowing for more efficient use of the available stack space.
13115 However, when @option{-mbackchain} is also in effect, the topmost word of
13116 the save area is always used to store the backchain, and the return address
13117 register is always saved two words below the backchain.
13118
13119 As long as the stack frame backchain is not used, code generated with
13120 @option{-mpacked-stack} is call-compatible with code generated with
13121 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
13122 S/390 or zSeries generated code that uses the stack frame backchain at run
13123 time, not just for debugging purposes.  Such code is not call-compatible
13124 with code compiled with @option{-mpacked-stack}.  Also, note that the
13125 combination of @option{-mbackchain},
13126 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
13127 to build a linux kernel use @option{-msoft-float}.
13128
13129 The default is to not use the packed stack layout.
13130
13131 @item -msmall-exec
13132 @itemx -mno-small-exec
13133 @opindex msmall-exec
13134 @opindex mno-small-exec
13135 Generate (or do not generate) code using the @code{bras} instruction
13136 to do subroutine calls.
13137 This only works reliably if the total executable size does not
13138 exceed 64k.  The default is to use the @code{basr} instruction instead,
13139 which does not have this limitation.
13140
13141 @item -m64
13142 @itemx -m31
13143 @opindex m64
13144 @opindex m31
13145 When @option{-m31} is specified, generate code compliant to the
13146 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
13147 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
13148 particular to generate 64-bit instructions.  For the @samp{s390}
13149 targets, the default is @option{-m31}, while the @samp{s390x}
13150 targets default to @option{-m64}.
13151
13152 @item -mzarch
13153 @itemx -mesa
13154 @opindex mzarch
13155 @opindex mesa
13156 When @option{-mzarch} is specified, generate code using the
13157 instructions available on z/Architecture.
13158 When @option{-mesa} is specified, generate code using the
13159 instructions available on ESA/390.  Note that @option{-mesa} is
13160 not possible with @option{-m64}.
13161 When generating code compliant to the GNU/Linux for S/390 ABI,
13162 the default is @option{-mesa}.  When generating code compliant
13163 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
13164
13165 @item -mmvcle
13166 @itemx -mno-mvcle
13167 @opindex mmvcle
13168 @opindex mno-mvcle
13169 Generate (or do not generate) code using the @code{mvcle} instruction
13170 to perform block moves.  When @option{-mno-mvcle} is specified,
13171 use a @code{mvc} loop instead.  This is the default unless optimizing for
13172 size.
13173
13174 @item -mdebug
13175 @itemx -mno-debug
13176 @opindex mdebug
13177 @opindex mno-debug
13178 Print (or do not print) additional debug information when compiling.
13179 The default is to not print debug information.
13180
13181 @item -march=@var{cpu-type}
13182 @opindex march
13183 Generate code that will run on @var{cpu-type}, which is the name of a system
13184 representing a certain processor type.  Possible values for
13185 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, and @samp{z990}.
13186 When generating code using the instructions available on z/Architecture,
13187 the default is @option{-march=z900}.  Otherwise, the default is
13188 @option{-march=g5}.
13189
13190 @item -mtune=@var{cpu-type}
13191 @opindex mtune
13192 Tune to @var{cpu-type} everything applicable about the generated code,
13193 except for the ABI and the set of available instructions.
13194 The list of @var{cpu-type} values is the same as for @option{-march}.
13195 The default is the value used for @option{-march}.
13196
13197 @item -mtpf-trace
13198 @itemx -mno-tpf-trace
13199 @opindex mtpf-trace
13200 @opindex mno-tpf-trace
13201 Generate code that adds (does not add) in TPF OS specific branches to trace
13202 routines in the operating system.  This option is off by default, even
13203 when compiling for the TPF OS@.
13204
13205 @item -mfused-madd
13206 @itemx -mno-fused-madd
13207 @opindex mfused-madd
13208 @opindex mno-fused-madd
13209 Generate code that uses (does not use) the floating point multiply and
13210 accumulate instructions.  These instructions are generated by default if
13211 hardware floating point is used.
13212
13213 @item -mwarn-framesize=@var{framesize}
13214 @opindex mwarn-framesize
13215 Emit a warning if the current function exceeds the given frame size.  Because
13216 this is a compile time check it doesn't need to be a real problem when the program
13217 runs.  It is intended to identify functions which most probably cause
13218 a stack overflow.  It is useful to be used in an environment with limited stack
13219 size e.g.@: the linux kernel.
13220
13221 @item -mwarn-dynamicstack
13222 @opindex mwarn-dynamicstack
13223 Emit a warning if the function calls alloca or uses dynamically
13224 sized arrays.  This is generally a bad idea with a limited stack size.
13225
13226 @item -mstack-guard=@var{stack-guard}
13227 @item -mstack-size=@var{stack-size}
13228 @opindex mstack-guard
13229 @opindex mstack-size
13230 If these options are provided the s390 back end emits additional instructions in
13231 the function prologue which trigger a trap if the stack size is @var{stack-guard}
13232 bytes above the @var{stack-size} (remember that the stack on s390 grows downward).
13233 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
13234 the frame size of the compiled function is chosen.
13235 These options are intended to be used to help debugging stack overflow problems.
13236 The additionally emitted code causes only little overhead and hence can also be
13237 used in production like systems without greater performance degradation.  The given
13238 values have to be exact powers of 2 and @var{stack-size} has to be greater than
13239 @var{stack-guard} without exceeding 64k.
13240 In order to be efficient the extra code makes the assumption that the stack starts
13241 at an address aligned to the value given by @var{stack-size}.
13242 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
13243 @end table
13244
13245 @node Score Options
13246 @subsection Score Options
13247 @cindex Score Options
13248
13249 These options are defined for Score implementations:
13250
13251 @table @gcctabopt
13252 @item -meb
13253 @opindex meb
13254 Compile code for big endian mode.  This is the default.
13255
13256 @item -mel
13257 @opindex mel
13258 Compile code for little endian mode. 
13259
13260 @item -mnhwloop
13261 @opindex mnhwloop
13262 Disable generate bcnz instruction.
13263
13264 @item -muls
13265 @opindex muls
13266 Enable generate unaligned load and store instruction.
13267
13268 @item -mmac
13269 @opindex mmac
13270 Enable the use of multiply-accumulate instructions. Disabled by default. 
13271
13272 @item -mscore5
13273 @opindex mscore5
13274 Specify the SCORE5 as the target architecture.
13275
13276 @item -mscore5u
13277 @opindex mscore5u
13278 Specify the SCORE5U of the target architecture.
13279
13280 @item -mscore7
13281 @opindex mscore7
13282 Specify the SCORE7 as the target architecture. This is the default.
13283
13284 @item -mscore7d
13285 @opindex mscore7d
13286 Specify the SCORE7D as the target architecture.
13287 @end table
13288
13289 @node SH Options
13290 @subsection SH Options
13291
13292 These @samp{-m} options are defined for the SH implementations:
13293
13294 @table @gcctabopt
13295 @item -m1
13296 @opindex m1
13297 Generate code for the SH1.
13298
13299 @item -m2
13300 @opindex m2
13301 Generate code for the SH2.
13302
13303 @item -m2e
13304 Generate code for the SH2e.
13305
13306 @item -m3
13307 @opindex m3
13308 Generate code for the SH3.
13309
13310 @item -m3e
13311 @opindex m3e
13312 Generate code for the SH3e.
13313
13314 @item -m4-nofpu
13315 @opindex m4-nofpu
13316 Generate code for the SH4 without a floating-point unit.
13317
13318 @item -m4-single-only
13319 @opindex m4-single-only
13320 Generate code for the SH4 with a floating-point unit that only
13321 supports single-precision arithmetic.
13322
13323 @item -m4-single
13324 @opindex m4-single
13325 Generate code for the SH4 assuming the floating-point unit is in
13326 single-precision mode by default.
13327
13328 @item -m4
13329 @opindex m4
13330 Generate code for the SH4.
13331
13332 @item -m4a-nofpu
13333 @opindex m4a-nofpu
13334 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
13335 floating-point unit is not used.
13336
13337 @item -m4a-single-only
13338 @opindex m4a-single-only
13339 Generate code for the SH4a, in such a way that no double-precision
13340 floating point operations are used.
13341
13342 @item -m4a-single
13343 @opindex m4a-single
13344 Generate code for the SH4a assuming the floating-point unit is in
13345 single-precision mode by default.
13346
13347 @item -m4a
13348 @opindex m4a
13349 Generate code for the SH4a.
13350
13351 @item -m4al
13352 @opindex m4al
13353 Same as @option{-m4a-nofpu}, except that it implicitly passes
13354 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
13355 instructions at the moment.
13356
13357 @item -mb
13358 @opindex mb
13359 Compile code for the processor in big endian mode.
13360
13361 @item -ml
13362 @opindex ml
13363 Compile code for the processor in little endian mode.
13364
13365 @item -mdalign
13366 @opindex mdalign
13367 Align doubles at 64-bit boundaries.  Note that this changes the calling
13368 conventions, and thus some functions from the standard C library will
13369 not work unless you recompile it first with @option{-mdalign}.
13370
13371 @item -mrelax
13372 @opindex mrelax
13373 Shorten some address references at link time, when possible; uses the
13374 linker option @option{-relax}.
13375
13376 @item -mbigtable
13377 @opindex mbigtable
13378 Use 32-bit offsets in @code{switch} tables.  The default is to use
13379 16-bit offsets.
13380
13381 @item -mfmovd
13382 @opindex mfmovd
13383 Enable the use of the instruction @code{fmovd}.
13384
13385 @item -mhitachi
13386 @opindex mhitachi
13387 Comply with the calling conventions defined by Renesas.
13388
13389 @item -mrenesas
13390 @opindex mhitachi
13391 Comply with the calling conventions defined by Renesas.
13392
13393 @item -mno-renesas
13394 @opindex mhitachi
13395 Comply with the calling conventions defined for GCC before the Renesas
13396 conventions were available.  This option is the default for all
13397 targets of the SH toolchain except for @samp{sh-symbianelf}.
13398
13399 @item -mnomacsave
13400 @opindex mnomacsave
13401 Mark the @code{MAC} register as call-clobbered, even if
13402 @option{-mhitachi} is given.
13403
13404 @item -mieee
13405 @opindex mieee
13406 Increase IEEE-compliance of floating-point code.
13407 At the moment, this is equivalent to @option{-fno-finite-math-only}.
13408 When generating 16 bit SH opcodes, getting IEEE-conforming results for
13409 comparisons of NANs / infinities incurs extra overhead in every
13410 floating point comparison, therefore the default is set to
13411 @option{-ffinite-math-only}.
13412
13413 @item -minline-ic_invalidate
13414 @opindex minline-ic_invalidate
13415 Inline code to invalidate instruction cache entries after setting up
13416 nested function trampolines.
13417 This option has no effect if -musermode is in effect and the selected
13418 code generation option (e.g. -m4) does not allow the use of the icbi
13419 instruction.
13420 If the selected code generation option does not allow the use of the icbi
13421 instruction, and -musermode is not in effect, the inlined code will
13422 manipulate the instruction cache address array directly with an associative
13423 write.  This not only requires privileged mode, but it will also
13424 fail if the cache line had been mapped via the TLB and has become unmapped.
13425
13426 @item -misize
13427 @opindex misize
13428 Dump instruction size and location in the assembly code.
13429
13430 @item -mpadstruct
13431 @opindex mpadstruct
13432 This option is deprecated.  It pads structures to multiple of 4 bytes,
13433 which is incompatible with the SH ABI@.
13434
13435 @item -mspace
13436 @opindex mspace
13437 Optimize for space instead of speed.  Implied by @option{-Os}.
13438
13439 @item -mprefergot
13440 @opindex mprefergot
13441 When generating position-independent code, emit function calls using
13442 the Global Offset Table instead of the Procedure Linkage Table.
13443
13444 @item -musermode
13445 @opindex musermode
13446 Don't generate privileged mode only code; implies -mno-inline-ic_invalidate
13447 if the inlined code would not work in user mode.
13448 This is the default when the target is @code{sh-*-linux*}.
13449
13450 @item -multcost=@var{number}
13451 @opindex multcost=@var{number}
13452 Set the cost to assume for a multiply insn.
13453
13454 @item -mdiv=@var{strategy}
13455 @opindex mdiv=@var{strategy}
13456 Set the division strategy to use for SHmedia code.  @var{strategy} must be
13457 one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, inv:call,
13458 inv:call2, inv:fp .
13459 "fp" performs the operation in floating point.  This has a very high latency,
13460 but needs only a few instructions, so it might be a good choice if
13461 your code has enough easily exploitable ILP to allow the compiler to
13462 schedule the floating point instructions together with other instructions.
13463 Division by zero causes a floating point exception.
13464 "inv" uses integer operations to calculate the inverse of the divisor,
13465 and then multiplies the dividend with the inverse.  This strategy allows
13466 cse and hoisting of the inverse calculation.  Division by zero calculates
13467 an unspecified result, but does not trap.
13468 "inv:minlat" is a variant of "inv" where if no cse / hoisting opportunities
13469 have been found, or if the entire operation has been hoisted to the same
13470 place, the last stages of the inverse calculation are intertwined with the
13471 final multiply to reduce the overall latency, at the expense of using a few
13472 more instructions, and thus offering fewer scheduling opportunities with
13473 other code.
13474 "call" calls a library function that usually implements the inv:minlat
13475 strategy.
13476 This gives high code density for m5-*media-nofpu compilations.
13477 "call2" uses a different entry point of the same library function, where it
13478 assumes that a pointer to a lookup table has already been set up, which
13479 exposes the pointer load to cse / code hoisting optimizations.
13480 "inv:call", "inv:call2" and "inv:fp" all use the "inv" algorithm for initial
13481 code generation, but if the code stays unoptimized, revert to the "call",
13482 "call2", or "fp" strategies, respectively.  Note that the
13483 potentially-trapping side effect of division by zero is carried by a
13484 separate instruction, so it is possible that all the integer instructions
13485 are hoisted out, but the marker for the side effect stays where it is.
13486 A recombination to fp operations or a call is not possible in that case.
13487 "inv20u" and "inv20l" are variants of the "inv:minlat" strategy.  In the case
13488 that the inverse calculation was nor separated from the multiply, they speed
13489 up division where the dividend fits into 20 bits (plus sign where applicable),
13490 by inserting a test to skip a number of operations in this case; this test
13491 slows down the case of larger dividends.  inv20u assumes the case of a such
13492 a small dividend to be unlikely, and inv20l assumes it to be likely.
13493
13494 @item -mdivsi3_libfunc=@var{name}
13495 @opindex mdivsi3_libfunc=@var{name}
13496 Set the name of the library function used for 32 bit signed division to
13497 @var{name}.  This only affect the name used in the call and inv:call
13498 division strategies, and the compiler will still expect the same
13499 sets of input/output/clobbered registers as if this option was not present.
13500
13501 @item -madjust-unroll
13502 @opindex madjust-unroll
13503 Throttle unrolling to avoid thrashing target registers.
13504 This option only has an effect if the gcc code base supports the
13505 TARGET_ADJUST_UNROLL_MAX target hook.
13506
13507 @item -mindexed-addressing
13508 @opindex mindexed-addressing
13509 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
13510 This is only safe if the hardware and/or OS implement 32 bit wrap-around
13511 semantics for the indexed addressing mode.  The architecture allows the
13512 implementation of processors with 64 bit MMU, which the OS could use to
13513 get 32 bit addressing, but since no current hardware implementation supports
13514 this or any other way to make the indexed addressing mode safe to use in
13515 the 32 bit ABI, the default is -mno-indexed-addressing.
13516
13517 @item -mgettrcost=@var{number}
13518 @opindex mgettrcost=@var{number}
13519 Set the cost assumed for the gettr instruction to @var{number}.
13520 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
13521
13522 @item -mpt-fixed
13523 @opindex mpt-fixed
13524 Assume pt* instructions won't trap.  This will generally generate better
13525 scheduled code, but is unsafe on current hardware.  The current architecture
13526 definition says that ptabs and ptrel trap when the target anded with 3 is 3.
13527 This has the unintentional effect of making it unsafe to schedule ptabs /
13528 ptrel before a branch, or hoist it out of a loop.  For example,
13529 __do_global_ctors, a part of libgcc that runs constructors at program
13530 startup, calls functions in a list which is delimited by @minus{}1.  With the
13531 -mpt-fixed option, the ptabs will be done before testing against @minus{}1.
13532 That means that all the constructors will be run a bit quicker, but when
13533 the loop comes to the end of the list, the program crashes because ptabs
13534 loads @minus{}1 into a target register.  Since this option is unsafe for any
13535 hardware implementing the current architecture specification, the default
13536 is -mno-pt-fixed.  Unless the user specifies a specific cost with
13537 @option{-mgettrcost}, -mno-pt-fixed also implies @option{-mgettrcost=100};
13538 this deters register allocation using target registers for storing
13539 ordinary integers.
13540
13541 @item -minvalid-symbols
13542 @opindex minvalid-symbols
13543 Assume symbols might be invalid.  Ordinary function symbols generated by
13544 the compiler will always be valid to load with movi/shori/ptabs or
13545 movi/shori/ptrel, but with assembler and/or linker tricks it is possible
13546 to generate symbols that will cause ptabs / ptrel to trap.
13547 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
13548 It will then prevent cross-basic-block cse, hoisting and most scheduling
13549 of symbol loads.  The default is @option{-mno-invalid-symbols}.
13550 @end table
13551
13552 @node SPARC Options
13553 @subsection SPARC Options
13554 @cindex SPARC options
13555
13556 These @samp{-m} options are supported on the SPARC:
13557
13558 @table @gcctabopt
13559 @item -mno-app-regs
13560 @itemx -mapp-regs
13561 @opindex mno-app-regs
13562 @opindex mapp-regs
13563 Specify @option{-mapp-regs} to generate output using the global registers
13564 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
13565 is the default.
13566
13567 To be fully SVR4 ABI compliant at the cost of some performance loss,
13568 specify @option{-mno-app-regs}.  You should compile libraries and system
13569 software with this option.
13570
13571 @item -mfpu
13572 @itemx -mhard-float
13573 @opindex mfpu
13574 @opindex mhard-float
13575 Generate output containing floating point instructions.  This is the
13576 default.
13577
13578 @item -mno-fpu
13579 @itemx -msoft-float
13580 @opindex mno-fpu
13581 @opindex msoft-float
13582 Generate output containing library calls for floating point.
13583 @strong{Warning:} the requisite libraries are not available for all SPARC
13584 targets.  Normally the facilities of the machine's usual C compiler are
13585 used, but this cannot be done directly in cross-compilation.  You must make
13586 your own arrangements to provide suitable library functions for
13587 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
13588 @samp{sparclite-*-*} do provide software floating point support.
13589
13590 @option{-msoft-float} changes the calling convention in the output file;
13591 therefore, it is only useful if you compile @emph{all} of a program with
13592 this option.  In particular, you need to compile @file{libgcc.a}, the
13593 library that comes with GCC, with @option{-msoft-float} in order for
13594 this to work.
13595
13596 @item -mhard-quad-float
13597 @opindex mhard-quad-float
13598 Generate output containing quad-word (long double) floating point
13599 instructions.
13600
13601 @item -msoft-quad-float
13602 @opindex msoft-quad-float
13603 Generate output containing library calls for quad-word (long double)
13604 floating point instructions.  The functions called are those specified
13605 in the SPARC ABI@.  This is the default.
13606
13607 As of this writing, there are no SPARC implementations that have hardware
13608 support for the quad-word floating point instructions.  They all invoke
13609 a trap handler for one of these instructions, and then the trap handler
13610 emulates the effect of the instruction.  Because of the trap handler overhead,
13611 this is much slower than calling the ABI library routines.  Thus the
13612 @option{-msoft-quad-float} option is the default.
13613
13614 @item -mno-unaligned-doubles
13615 @itemx -munaligned-doubles
13616 @opindex mno-unaligned-doubles
13617 @opindex munaligned-doubles
13618 Assume that doubles have 8 byte alignment.  This is the default.
13619
13620 With @option{-munaligned-doubles}, GCC assumes that doubles have 8 byte
13621 alignment only if they are contained in another type, or if they have an
13622 absolute address.  Otherwise, it assumes they have 4 byte alignment.
13623 Specifying this option avoids some rare compatibility problems with code
13624 generated by other compilers.  It is not the default because it results
13625 in a performance loss, especially for floating point code.
13626
13627 @item -mno-faster-structs
13628 @itemx -mfaster-structs
13629 @opindex mno-faster-structs
13630 @opindex mfaster-structs
13631 With @option{-mfaster-structs}, the compiler assumes that structures
13632 should have 8 byte alignment.  This enables the use of pairs of
13633 @code{ldd} and @code{std} instructions for copies in structure
13634 assignment, in place of twice as many @code{ld} and @code{st} pairs.
13635 However, the use of this changed alignment directly violates the SPARC
13636 ABI@.  Thus, it's intended only for use on targets where the developer
13637 acknowledges that their resulting code will not be directly in line with
13638 the rules of the ABI@.
13639
13640 @item -mimpure-text
13641 @opindex mimpure-text
13642 @option{-mimpure-text}, used in addition to @option{-shared}, tells
13643 the compiler to not pass @option{-z text} to the linker when linking a
13644 shared object.  Using this option, you can link position-dependent
13645 code into a shared object.
13646
13647 @option{-mimpure-text} suppresses the ``relocations remain against
13648 allocatable but non-writable sections'' linker error message.
13649 However, the necessary relocations will trigger copy-on-write, and the
13650 shared object is not actually shared across processes.  Instead of
13651 using @option{-mimpure-text}, you should compile all source code with
13652 @option{-fpic} or @option{-fPIC}.
13653
13654 This option is only available on SunOS and Solaris.
13655
13656 @item -mcpu=@var{cpu_type}
13657 @opindex mcpu
13658 Set the instruction set, register set, and instruction scheduling parameters
13659 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
13660 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{sparclite},
13661 @samp{f930}, @samp{f934}, @samp{hypersparc}, @samp{sparclite86x},
13662 @samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc},
13663 @samp{ultrasparc3}, and @samp{niagara}.
13664
13665 Default instruction scheduling parameters are used for values that select
13666 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
13667 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
13668
13669 Here is a list of each supported architecture and their supported
13670 implementations.
13671
13672 @smallexample
13673     v7:             cypress
13674     v8:             supersparc, hypersparc
13675     sparclite:      f930, f934, sparclite86x
13676     sparclet:       tsc701
13677     v9:             ultrasparc, ultrasparc3, niagara
13678 @end smallexample
13679
13680 By default (unless configured otherwise), GCC generates code for the V7
13681 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
13682 additionally optimizes it for the Cypress CY7C602 chip, as used in the
13683 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
13684 SPARCStation 1, 2, IPX etc.
13685
13686 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
13687 architecture.  The only difference from V7 code is that the compiler emits
13688 the integer multiply and integer divide instructions which exist in SPARC-V8
13689 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
13690 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
13691 2000 series.
13692
13693 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
13694 the SPARC architecture.  This adds the integer multiply, integer divide step
13695 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
13696 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
13697 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
13698 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
13699 MB86934 chip, which is the more recent SPARClite with FPU@.
13700
13701 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
13702 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
13703 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
13704 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
13705 optimizes it for the TEMIC SPARClet chip.
13706
13707 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
13708 architecture.  This adds 64-bit integer and floating-point move instructions,
13709 3 additional floating-point condition code registers and conditional move
13710 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
13711 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
13712 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
13713 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
13714 @option{-mcpu=niagara}, the compiler additionally optimizes it for
13715 Sun UltraSPARC T1 chips.
13716
13717 @item -mtune=@var{cpu_type}
13718 @opindex mtune
13719 Set the instruction scheduling parameters for machine type
13720 @var{cpu_type}, but do not set the instruction set or register set that the
13721 option @option{-mcpu=@var{cpu_type}} would.
13722
13723 The same values for @option{-mcpu=@var{cpu_type}} can be used for
13724 @option{-mtune=@var{cpu_type}}, but the only useful values are those
13725 that select a particular cpu implementation.  Those are @samp{cypress},
13726 @samp{supersparc}, @samp{hypersparc}, @samp{f930}, @samp{f934},
13727 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
13728 @samp{ultrasparc3}, and @samp{niagara}.
13729
13730 @item -mv8plus
13731 @itemx -mno-v8plus
13732 @opindex mv8plus
13733 @opindex mno-v8plus
13734 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
13735 difference from the V8 ABI is that the global and out registers are
13736 considered 64-bit wide.  This is enabled by default on Solaris in 32-bit
13737 mode for all SPARC-V9 processors.
13738
13739 @item -mvis
13740 @itemx -mno-vis
13741 @opindex mvis
13742 @opindex mno-vis
13743 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
13744 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
13745 @end table
13746
13747 These @samp{-m} options are supported in addition to the above
13748 on SPARC-V9 processors in 64-bit environments:
13749
13750 @table @gcctabopt
13751 @item -mlittle-endian
13752 @opindex mlittle-endian
13753 Generate code for a processor running in little-endian mode.  It is only
13754 available for a few configurations and most notably not on Solaris and Linux.
13755
13756 @item -m32
13757 @itemx -m64
13758 @opindex m32
13759 @opindex m64
13760 Generate code for a 32-bit or 64-bit environment.
13761 The 32-bit environment sets int, long and pointer to 32 bits.
13762 The 64-bit environment sets int to 32 bits and long and pointer
13763 to 64 bits.
13764
13765 @item -mcmodel=medlow
13766 @opindex mcmodel=medlow
13767 Generate code for the Medium/Low code model: 64-bit addresses, programs
13768 must be linked in the low 32 bits of memory.  Programs can be statically
13769 or dynamically linked.
13770
13771 @item -mcmodel=medmid
13772 @opindex mcmodel=medmid
13773 Generate code for the Medium/Middle code model: 64-bit addresses, programs
13774 must be linked in the low 44 bits of memory, the text and data segments must
13775 be less than 2GB in size and the data segment must be located within 2GB of
13776 the text segment.
13777
13778 @item -mcmodel=medany
13779 @opindex mcmodel=medany
13780 Generate code for the Medium/Anywhere code model: 64-bit addresses, programs
13781 may be linked anywhere in memory, the text and data segments must be less
13782 than 2GB in size and the data segment must be located within 2GB of the
13783 text segment.
13784
13785 @item -mcmodel=embmedany
13786 @opindex mcmodel=embmedany
13787 Generate code for the Medium/Anywhere code model for embedded systems:
13788 64-bit addresses, the text and data segments must be less than 2GB in
13789 size, both starting anywhere in memory (determined at link time).  The
13790 global register %g4 points to the base of the data segment.  Programs
13791 are statically linked and PIC is not supported.
13792
13793 @item -mstack-bias
13794 @itemx -mno-stack-bias
13795 @opindex mstack-bias
13796 @opindex mno-stack-bias
13797 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
13798 frame pointer if present, are offset by @minus{}2047 which must be added back
13799 when making stack frame references.  This is the default in 64-bit mode.
13800 Otherwise, assume no such offset is present.
13801 @end table
13802
13803 These switches are supported in addition to the above on Solaris:
13804
13805 @table @gcctabopt
13806 @item -threads
13807 @opindex threads
13808 Add support for multithreading using the Solaris threads library.  This
13809 option sets flags for both the preprocessor and linker.  This option does
13810 not affect the thread safety of object code produced by the compiler or
13811 that of libraries supplied with it.
13812
13813 @item -pthreads
13814 @opindex pthreads
13815 Add support for multithreading using the POSIX threads library.  This
13816 option sets flags for both the preprocessor and linker.  This option does
13817 not affect the thread safety of object code produced  by the compiler or
13818 that of libraries supplied with it.
13819
13820 @item -pthread
13821 @opindex pthread
13822 This is a synonym for @option{-pthreads}.
13823 @end table
13824
13825 @node SPU Options
13826 @subsection SPU Options
13827 @cindex SPU options
13828
13829 These @samp{-m} options are supported on the SPU:
13830
13831 @table @gcctabopt
13832 @item -mwarn-reloc
13833 @itemx -merror-reloc
13834 @opindex mwarn-reloc
13835 @opindex merror-reloc
13836
13837 The loader for SPU does not handle dynamic relocations.  By default, GCC
13838 will give an error when it generates code that requires a dynamic
13839 relocation.  @option{-mno-error-reloc} disables the error,
13840 @option{-mwarn-reloc} will generate a warning instead.
13841
13842 @item -msafe-dma
13843 @itemx -munsafe-dma
13844 @opindex msafe-dma
13845 @opindex munsafe-dma
13846
13847 Instructions which initiate or test completion of DMA must not be
13848 reordered with respect to loads and stores of the memory which is being
13849 accessed.  Users typically address this problem using the volatile
13850 keyword, but that can lead to inefficient code in places where the
13851 memory is known to not change.  Rather than mark the memory as volatile
13852 we treat the DMA instructions as potentially effecting all memory.  With
13853 @option{-munsafe-dma} users must use the volatile keyword to protect
13854 memory accesses.
13855
13856 @item -mbranch-hints
13857 @opindex mbranch-hints
13858
13859 By default, GCC will generate a branch hint instruction to avoid
13860 pipeline stalls for always taken or probably taken branches.  A hint
13861 will not be generated closer than 8 instructions away from its branch.
13862 There is little reason to disable them, except for debugging purposes,
13863 or to make an object a little bit smaller.
13864
13865 @item -msmall-mem
13866 @itemx -mlarge-mem
13867 @opindex msmall-mem
13868 @opindex mlarge-mem
13869
13870 By default, GCC generates code assuming that addresses are never larger
13871 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
13872 a full 32 bit address.
13873
13874 @item -mstdmain
13875 @opindex mstdmain
13876
13877 By default, GCC links against startup code that assumes the SPU-style
13878 main function interface (which has an unconventional parameter list).
13879 With @option{-mstdmain}, GCC will link your program against startup
13880 code that assumes a C99-style interface to @code{main}, including a
13881 local copy of @code{argv} strings.
13882
13883 @item -mfixed-range=@var{register-range}
13884 @opindex mfixed-range
13885 Generate code treating the given register range as fixed registers.
13886 A fixed register is one that the register allocator can not use.  This is
13887 useful when compiling kernel code.  A register range is specified as
13888 two registers separated by a dash.  Multiple register ranges can be
13889 specified separated by a comma.
13890
13891 @end table
13892
13893 @node System V Options
13894 @subsection Options for System V
13895
13896 These additional options are available on System V Release 4 for
13897 compatibility with other compilers on those systems:
13898
13899 @table @gcctabopt
13900 @item -G
13901 @opindex G
13902 Create a shared object.
13903 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
13904
13905 @item -Qy
13906 @opindex Qy
13907 Identify the versions of each tool used by the compiler, in a
13908 @code{.ident} assembler directive in the output.
13909
13910 @item -Qn
13911 @opindex Qn
13912 Refrain from adding @code{.ident} directives to the output file (this is
13913 the default).
13914
13915 @item -YP,@var{dirs}
13916 @opindex YP
13917 Search the directories @var{dirs}, and no others, for libraries
13918 specified with @option{-l}.
13919
13920 @item -Ym,@var{dir}
13921 @opindex Ym
13922 Look in the directory @var{dir} to find the M4 preprocessor.
13923 The assembler uses this option.
13924 @c This is supposed to go with a -Yd for predefined M4 macro files, but
13925 @c the generic assembler that comes with Solaris takes just -Ym.
13926 @end table
13927
13928 @node TMS320C3x/C4x Options
13929 @subsection TMS320C3x/C4x Options
13930 @cindex TMS320C3x/C4x Options
13931
13932 These @samp{-m} options are defined for TMS320C3x/C4x implementations:
13933
13934 @table @gcctabopt
13935
13936 @item -mcpu=@var{cpu_type}
13937 @opindex mcpu
13938 Set the instruction set, register set, and instruction scheduling
13939 parameters for machine type @var{cpu_type}.  Supported values for
13940 @var{cpu_type} are @samp{c30}, @samp{c31}, @samp{c32}, @samp{c40}, and
13941 @samp{c44}.  The default is @samp{c40} to generate code for the
13942 TMS320C40.
13943
13944 @item -mbig-memory
13945 @itemx -mbig
13946 @itemx -msmall-memory
13947 @itemx -msmall
13948 @opindex mbig-memory
13949 @opindex mbig
13950 @opindex msmall-memory
13951 @opindex msmall
13952 Generates code for the big or small memory model.  The small memory
13953 model assumed that all data fits into one 64K word page.  At run-time
13954 the data page (DP) register must be set to point to the 64K page
13955 containing the .bss and .data program sections.  The big memory model is
13956 the default and requires reloading of the DP register for every direct
13957 memory access.
13958
13959 @item -mbk
13960 @itemx -mno-bk
13961 @opindex mbk
13962 @opindex mno-bk
13963 Allow (disallow) allocation of general integer operands into the block
13964 count register BK@.
13965
13966 @item -mdb
13967 @itemx -mno-db
13968 @opindex mdb
13969 @opindex mno-db
13970 Enable (disable) generation of code using decrement and branch,
13971 DBcond(D), instructions.  This is enabled by default for the C4x.  To be
13972 on the safe side, this is disabled for the C3x, since the maximum
13973 iteration count on the C3x is @math{2^{23} + 1} (but who iterates loops more than
13974 @math{2^{23}} times on the C3x?).  Note that GCC will try to reverse a loop so
13975 that it can utilize the decrement and branch instruction, but will give
13976 up if there is more than one memory reference in the loop.  Thus a loop
13977 where the loop counter is decremented can generate slightly more
13978 efficient code, in cases where the RPTB instruction cannot be utilized.
13979
13980 @item -mdp-isr-reload
13981 @itemx -mparanoid
13982 @opindex mdp-isr-reload
13983 @opindex mparanoid
13984 Force the DP register to be saved on entry to an interrupt service
13985 routine (ISR), reloaded to point to the data section, and restored on
13986 exit from the ISR@.  This should not be required unless someone has
13987 violated the small memory model by modifying the DP register, say within
13988 an object library.
13989
13990 @item -mmpyi
13991 @itemx -mno-mpyi
13992 @opindex mmpyi
13993 @opindex mno-mpyi
13994 For the C3x use the 24-bit MPYI instruction for integer multiplies
13995 instead of a library call to guarantee 32-bit results.  Note that if one
13996 of the operands is a constant, then the multiplication will be performed
13997 using shifts and adds.  If the @option{-mmpyi} option is not specified for the C3x,
13998 then squaring operations are performed inline instead of a library call.
13999
14000 @item -mfast-fix
14001 @itemx -mno-fast-fix
14002 @opindex mfast-fix
14003 @opindex mno-fast-fix
14004 The C3x/C4x FIX instruction to convert a floating point value to an
14005 integer value chooses the nearest integer less than or equal to the
14006 floating point value rather than to the nearest integer.  Thus if the
14007 floating point number is negative, the result will be incorrectly
14008 truncated an additional code is necessary to detect and correct this
14009 case.  This option can be used to disable generation of the additional
14010 code required to correct the result.
14011
14012 @item -mrptb
14013 @itemx -mno-rptb
14014 @opindex mrptb
14015 @opindex mno-rptb
14016 Enable (disable) generation of repeat block sequences using the RPTB
14017 instruction for zero overhead looping.  The RPTB construct is only used
14018 for innermost loops that do not call functions or jump across the loop
14019 boundaries.  There is no advantage having nested RPTB loops due to the
14020 overhead required to save and restore the RC, RS, and RE registers.
14021 This is enabled by default with @option{-O2}.
14022
14023 @item -mrpts=@var{count}
14024 @itemx -mno-rpts
14025 @opindex mrpts
14026 @opindex mno-rpts
14027 Enable (disable) the use of the single instruction repeat instruction
14028 RPTS@.  If a repeat block contains a single instruction, and the loop
14029 count can be guaranteed to be less than the value @var{count}, GCC will
14030 emit a RPTS instruction instead of a RPTB@.  If no value is specified,
14031 then a RPTS will be emitted even if the loop count cannot be determined
14032 at compile time.  Note that the repeated instruction following RPTS does
14033 not have to be reloaded from memory each iteration, thus freeing up the
14034 CPU buses for operands.  However, since interrupts are blocked by this
14035 instruction, it is disabled by default.
14036
14037 @item -mloop-unsigned
14038 @itemx -mno-loop-unsigned
14039 @opindex mloop-unsigned
14040 @opindex mno-loop-unsigned
14041 The maximum iteration count when using RPTS and RPTB (and DB on the C40)
14042 is @math{2^{31} + 1} since these instructions test if the iteration count is
14043 negative to terminate the loop.  If the iteration count is unsigned
14044 there is a possibility than the @math{2^{31} + 1} maximum iteration count may be
14045 exceeded.  This switch allows an unsigned iteration count.
14046
14047 @item -mti
14048 @opindex mti
14049 Try to emit an assembler syntax that the TI assembler (asm30) is happy
14050 with.  This also enforces compatibility with the API employed by the TI
14051 C3x C compiler.  For example, long doubles are passed as structures
14052 rather than in floating point registers.
14053
14054 @item -mregparm
14055 @itemx -mmemparm
14056 @opindex mregparm
14057 @opindex mmemparm
14058 Generate code that uses registers (stack) for passing arguments to functions.
14059 By default, arguments are passed in registers where possible rather
14060 than by pushing arguments on to the stack.
14061
14062 @item -mparallel-insns
14063 @itemx -mno-parallel-insns
14064 @opindex mparallel-insns
14065 @opindex mno-parallel-insns
14066 Allow the generation of parallel instructions.  This is enabled by
14067 default with @option{-O2}.
14068
14069 @item -mparallel-mpy
14070 @itemx -mno-parallel-mpy
14071 @opindex mparallel-mpy
14072 @opindex mno-parallel-mpy
14073 Allow the generation of MPY||ADD and MPY||SUB parallel instructions,
14074 provided @option{-mparallel-insns} is also specified.  These instructions have
14075 tight register constraints which can pessimize the code generation
14076 of large functions.
14077
14078 @end table
14079
14080 @node V850 Options
14081 @subsection V850 Options
14082 @cindex V850 Options
14083
14084 These @samp{-m} options are defined for V850 implementations:
14085
14086 @table @gcctabopt
14087 @item -mlong-calls
14088 @itemx -mno-long-calls
14089 @opindex mlong-calls
14090 @opindex mno-long-calls
14091 Treat all calls as being far away (near).  If calls are assumed to be
14092 far away, the compiler will always load the functions address up into a
14093 register, and call indirect through the pointer.
14094
14095 @item -mno-ep
14096 @itemx -mep
14097 @opindex mno-ep
14098 @opindex mep
14099 Do not optimize (do optimize) basic blocks that use the same index
14100 pointer 4 or more times to copy pointer into the @code{ep} register, and
14101 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
14102 option is on by default if you optimize.
14103
14104 @item -mno-prolog-function
14105 @itemx -mprolog-function
14106 @opindex mno-prolog-function
14107 @opindex mprolog-function
14108 Do not use (do use) external functions to save and restore registers
14109 at the prologue and epilogue of a function.  The external functions
14110 are slower, but use less code space if more than one function saves
14111 the same number of registers.  The @option{-mprolog-function} option
14112 is on by default if you optimize.
14113
14114 @item -mspace
14115 @opindex mspace
14116 Try to make the code as small as possible.  At present, this just turns
14117 on the @option{-mep} and @option{-mprolog-function} options.
14118
14119 @item -mtda=@var{n}
14120 @opindex mtda
14121 Put static or global variables whose size is @var{n} bytes or less into
14122 the tiny data area that register @code{ep} points to.  The tiny data
14123 area can hold up to 256 bytes in total (128 bytes for byte references).
14124
14125 @item -msda=@var{n}
14126 @opindex msda
14127 Put static or global variables whose size is @var{n} bytes or less into
14128 the small data area that register @code{gp} points to.  The small data
14129 area can hold up to 64 kilobytes.
14130
14131 @item -mzda=@var{n}
14132 @opindex mzda
14133 Put static or global variables whose size is @var{n} bytes or less into
14134 the first 32 kilobytes of memory.
14135
14136 @item -mv850
14137 @opindex mv850
14138 Specify that the target processor is the V850.
14139
14140 @item -mbig-switch
14141 @opindex mbig-switch
14142 Generate code suitable for big switch tables.  Use this option only if
14143 the assembler/linker complain about out of range branches within a switch
14144 table.
14145
14146 @item -mapp-regs
14147 @opindex mapp-regs
14148 This option will cause r2 and r5 to be used in the code generated by
14149 the compiler.  This setting is the default.
14150
14151 @item -mno-app-regs
14152 @opindex mno-app-regs
14153 This option will cause r2 and r5 to be treated as fixed registers.
14154
14155 @item -mv850e1
14156 @opindex mv850e1
14157 Specify that the target processor is the V850E1.  The preprocessor
14158 constants @samp{__v850e1__} and @samp{__v850e__} will be defined if
14159 this option is used.
14160
14161 @item -mv850e
14162 @opindex mv850e
14163 Specify that the target processor is the V850E@.  The preprocessor
14164 constant @samp{__v850e__} will be defined if this option is used.
14165
14166 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
14167 are defined then a default target processor will be chosen and the
14168 relevant @samp{__v850*__} preprocessor constant will be defined.
14169
14170 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
14171 defined, regardless of which processor variant is the target.
14172
14173 @item -mdisable-callt
14174 @opindex mdisable-callt
14175 This option will suppress generation of the CALLT instruction for the
14176 v850e and v850e1 flavors of the v850 architecture.  The default is
14177 @option{-mno-disable-callt} which allows the CALLT instruction to be used.
14178
14179 @end table
14180
14181 @node VAX Options
14182 @subsection VAX Options
14183 @cindex VAX options
14184
14185 These @samp{-m} options are defined for the VAX:
14186
14187 @table @gcctabopt
14188 @item -munix
14189 @opindex munix
14190 Do not output certain jump instructions (@code{aobleq} and so on)
14191 that the Unix assembler for the VAX cannot handle across long
14192 ranges.
14193
14194 @item -mgnu
14195 @opindex mgnu
14196 Do output those jump instructions, on the assumption that you
14197 will assemble with the GNU assembler.
14198
14199 @item -mg
14200 @opindex mg
14201 Output code for g-format floating point numbers instead of d-format.
14202 @end table
14203
14204 @node VxWorks Options
14205 @subsection VxWorks Options
14206 @cindex VxWorks Options
14207
14208 The options in this section are defined for all VxWorks targets.
14209 Options specific to the target hardware are listed with the other
14210 options for that target.
14211
14212 @table @gcctabopt
14213 @item -mrtp
14214 @opindex mrtp
14215 GCC can generate code for both VxWorks kernels and real time processes
14216 (RTPs).  This option switches from the former to the latter.  It also
14217 defines the preprocessor macro @code{__RTP__}.
14218
14219 @item -non-static
14220 @opindex non-static
14221 Link an RTP executable against shared libraries rather than static
14222 libraries.  The options @option{-static} and @option{-shared} can
14223 also be used for RTPs (@pxref{Link Options}); @option{-static}
14224 is the default.
14225
14226 @item -Bstatic
14227 @itemx -Bdynamic
14228 @opindex Bstatic
14229 @opindex Bdynamic
14230 These options are passed down to the linker.  They are defined for
14231 compatibility with Diab.
14232
14233 @item -Xbind-lazy
14234 @opindex Xbind-lazy
14235 Enable lazy binding of function calls.  This option is equivalent to
14236 @option{-Wl,-z,now} and is defined for compatibility with Diab.
14237
14238 @item -Xbind-now
14239 @opindex Xbind-now
14240 Disable lazy binding of function calls.  This option is the default and
14241 is defined for compatibility with Diab.
14242 @end table
14243
14244 @node x86-64 Options
14245 @subsection x86-64 Options
14246 @cindex x86-64 options
14247
14248 These are listed under @xref{i386 and x86-64 Options}.
14249
14250 @node Xstormy16 Options
14251 @subsection Xstormy16 Options
14252 @cindex Xstormy16 Options
14253
14254 These options are defined for Xstormy16:
14255
14256 @table @gcctabopt
14257 @item -msim
14258 @opindex msim
14259 Choose startup files and linker script suitable for the simulator.
14260 @end table
14261
14262 @node Xtensa Options
14263 @subsection Xtensa Options
14264 @cindex Xtensa Options
14265
14266 These options are supported for Xtensa targets:
14267
14268 @table @gcctabopt
14269 @item -mconst16
14270 @itemx -mno-const16
14271 @opindex mconst16
14272 @opindex mno-const16
14273 Enable or disable use of @code{CONST16} instructions for loading
14274 constant values.  The @code{CONST16} instruction is currently not a
14275 standard option from Tensilica.  When enabled, @code{CONST16}
14276 instructions are always used in place of the standard @code{L32R}
14277 instructions.  The use of @code{CONST16} is enabled by default only if
14278 the @code{L32R} instruction is not available.
14279
14280 @item -mfused-madd
14281 @itemx -mno-fused-madd
14282 @opindex mfused-madd
14283 @opindex mno-fused-madd
14284 Enable or disable use of fused multiply/add and multiply/subtract
14285 instructions in the floating-point option.  This has no effect if the
14286 floating-point option is not also enabled.  Disabling fused multiply/add
14287 and multiply/subtract instructions forces the compiler to use separate
14288 instructions for the multiply and add/subtract operations.  This may be
14289 desirable in some cases where strict IEEE 754-compliant results are
14290 required: the fused multiply add/subtract instructions do not round the
14291 intermediate result, thereby producing results with @emph{more} bits of
14292 precision than specified by the IEEE standard.  Disabling fused multiply
14293 add/subtract instructions also ensures that the program output is not
14294 sensitive to the compiler's ability to combine multiply and add/subtract
14295 operations.
14296
14297 @item -mtext-section-literals
14298 @itemx -mno-text-section-literals
14299 @opindex mtext-section-literals
14300 @opindex mno-text-section-literals
14301 Control the treatment of literal pools.  The default is
14302 @option{-mno-text-section-literals}, which places literals in a separate
14303 section in the output file.  This allows the literal pool to be placed
14304 in a data RAM/ROM, and it also allows the linker to combine literal
14305 pools from separate object files to remove redundant literals and
14306 improve code size.  With @option{-mtext-section-literals}, the literals
14307 are interspersed in the text section in order to keep them as close as
14308 possible to their references.  This may be necessary for large assembly
14309 files.
14310
14311 @item -mtarget-align
14312 @itemx -mno-target-align
14313 @opindex mtarget-align
14314 @opindex mno-target-align
14315 When this option is enabled, GCC instructs the assembler to
14316 automatically align instructions to reduce branch penalties at the
14317 expense of some code density.  The assembler attempts to widen density
14318 instructions to align branch targets and the instructions following call
14319 instructions.  If there are not enough preceding safe density
14320 instructions to align a target, no widening will be performed.  The
14321 default is @option{-mtarget-align}.  These options do not affect the
14322 treatment of auto-aligned instructions like @code{LOOP}, which the
14323 assembler will always align, either by widening density instructions or
14324 by inserting no-op instructions.
14325
14326 @item -mlongcalls
14327 @itemx -mno-longcalls
14328 @opindex mlongcalls
14329 @opindex mno-longcalls
14330 When this option is enabled, GCC instructs the assembler to translate
14331 direct calls to indirect calls unless it can determine that the target
14332 of a direct call is in the range allowed by the call instruction.  This
14333 translation typically occurs for calls to functions in other source
14334 files.  Specifically, the assembler translates a direct @code{CALL}
14335 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
14336 The default is @option{-mno-longcalls}.  This option should be used in
14337 programs where the call target can potentially be out of range.  This
14338 option is implemented in the assembler, not the compiler, so the
14339 assembly code generated by GCC will still show direct call
14340 instructions---look at the disassembled object code to see the actual
14341 instructions.  Note that the assembler will use an indirect call for
14342 every cross-file call, not just those that really will be out of range.
14343 @end table
14344
14345 @node zSeries Options
14346 @subsection zSeries Options
14347 @cindex zSeries options
14348
14349 These are listed under @xref{S/390 and zSeries Options}.
14350
14351 @node Code Gen Options
14352 @section Options for Code Generation Conventions
14353 @cindex code generation conventions
14354 @cindex options, code generation
14355 @cindex run-time options
14356
14357 These machine-independent options control the interface conventions
14358 used in code generation.
14359
14360 Most of them have both positive and negative forms; the negative form
14361 of @option{-ffoo} would be @option{-fno-foo}.  In the table below, only
14362 one of the forms is listed---the one which is not the default.  You
14363 can figure out the other form by either removing @samp{no-} or adding
14364 it.
14365
14366 @table @gcctabopt
14367 @item -fbounds-check
14368 @opindex fbounds-check
14369 For front-ends that support it, generate additional code to check that
14370 indices used to access arrays are within the declared range.  This is
14371 currently only supported by the Java and Fortran front-ends, where
14372 this option defaults to true and false respectively.
14373
14374 @item -ftrapv
14375 @opindex ftrapv
14376 This option generates traps for signed overflow on addition, subtraction,
14377 multiplication operations.
14378
14379 @item -fwrapv
14380 @opindex fwrapv
14381 This option instructs the compiler to assume that signed arithmetic
14382 overflow of addition, subtraction and multiplication wraps around
14383 using twos-complement representation.  This flag enables some optimizations
14384 and disables others.  This option is enabled by default for the Java
14385 front-end, as required by the Java language specification.
14386
14387 @item -fexceptions
14388 @opindex fexceptions
14389 Enable exception handling.  Generates extra code needed to propagate
14390 exceptions.  For some targets, this implies GCC will generate frame
14391 unwind information for all functions, which can produce significant data
14392 size overhead, although it does not affect execution.  If you do not
14393 specify this option, GCC will enable it by default for languages like
14394 C++ which normally require exception handling, and disable it for
14395 languages like C that do not normally require it.  However, you may need
14396 to enable this option when compiling C code that needs to interoperate
14397 properly with exception handlers written in C++.  You may also wish to
14398 disable this option if you are compiling older C++ programs that don't
14399 use exception handling.
14400
14401 @item -fnon-call-exceptions
14402 @opindex fnon-call-exceptions
14403 Generate code that allows trapping instructions to throw exceptions.
14404 Note that this requires platform-specific runtime support that does
14405 not exist everywhere.  Moreover, it only allows @emph{trapping}
14406 instructions to throw exceptions, i.e.@: memory references or floating
14407 point instructions.  It does not allow exceptions to be thrown from
14408 arbitrary signal handlers such as @code{SIGALRM}.
14409
14410 @item -funwind-tables
14411 @opindex funwind-tables
14412 Similar to @option{-fexceptions}, except that it will just generate any needed
14413 static data, but will not affect the generated code in any other way.
14414 You will normally not enable this option; instead, a language processor
14415 that needs this handling would enable it on your behalf.
14416
14417 @item -fasynchronous-unwind-tables
14418 @opindex fasynchronous-unwind-tables
14419 Generate unwind table in dwarf2 format, if supported by target machine.  The
14420 table is exact at each instruction boundary, so it can be used for stack
14421 unwinding from asynchronous events (such as debugger or garbage collector).
14422
14423 @item -fpcc-struct-return
14424 @opindex fpcc-struct-return
14425 Return ``short'' @code{struct} and @code{union} values in memory like
14426 longer ones, rather than in registers.  This convention is less
14427 efficient, but it has the advantage of allowing intercallability between
14428 GCC-compiled files and files compiled with other compilers, particularly
14429 the Portable C Compiler (pcc).
14430
14431 The precise convention for returning structures in memory depends
14432 on the target configuration macros.
14433
14434 Short structures and unions are those whose size and alignment match
14435 that of some integer type.
14436
14437 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
14438 switch is not binary compatible with code compiled with the
14439 @option{-freg-struct-return} switch.
14440 Use it to conform to a non-default application binary interface.
14441
14442 @item -freg-struct-return
14443 @opindex freg-struct-return
14444 Return @code{struct} and @code{union} values in registers when possible.
14445 This is more efficient for small structures than
14446 @option{-fpcc-struct-return}.
14447
14448 If you specify neither @option{-fpcc-struct-return} nor
14449 @option{-freg-struct-return}, GCC defaults to whichever convention is
14450 standard for the target.  If there is no standard convention, GCC
14451 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
14452 the principal compiler.  In those cases, we can choose the standard, and
14453 we chose the more efficient register return alternative.
14454
14455 @strong{Warning:} code compiled with the @option{-freg-struct-return}
14456 switch is not binary compatible with code compiled with the
14457 @option{-fpcc-struct-return} switch.
14458 Use it to conform to a non-default application binary interface.
14459
14460 @item -fshort-enums
14461 @opindex fshort-enums
14462 Allocate to an @code{enum} type only as many bytes as it needs for the
14463 declared range of possible values.  Specifically, the @code{enum} type
14464 will be equivalent to the smallest integer type which has enough room.
14465
14466 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
14467 code that is not binary compatible with code generated without that switch.
14468 Use it to conform to a non-default application binary interface.
14469
14470 @item -fshort-double
14471 @opindex fshort-double
14472 Use the same size for @code{double} as for @code{float}.
14473
14474 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
14475 code that is not binary compatible with code generated without that switch.
14476 Use it to conform to a non-default application binary interface.
14477
14478 @item -fshort-wchar
14479 @opindex fshort-wchar
14480 Override the underlying type for @samp{wchar_t} to be @samp{short
14481 unsigned int} instead of the default for the target.  This option is
14482 useful for building programs to run under WINE@.
14483
14484 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
14485 code that is not binary compatible with code generated without that switch.
14486 Use it to conform to a non-default application binary interface.
14487
14488 @item -fno-common
14489 @opindex fno-common
14490 In C, allocate even uninitialized global variables in the data section of the
14491 object file, rather than generating them as common blocks.  This has the
14492 effect that if the same variable is declared (without @code{extern}) in
14493 two different compilations, you will get an error when you link them.
14494 The only reason this might be useful is if you wish to verify that the
14495 program will work on other systems which always work this way.
14496
14497 @item -fno-ident
14498 @opindex fno-ident
14499 Ignore the @samp{#ident} directive.
14500
14501 @item -finhibit-size-directive
14502 @opindex finhibit-size-directive
14503 Don't output a @code{.size} assembler directive, or anything else that
14504 would cause trouble if the function is split in the middle, and the
14505 two halves are placed at locations far apart in memory.  This option is
14506 used when compiling @file{crtstuff.c}; you should not need to use it
14507 for anything else.
14508
14509 @item -fverbose-asm
14510 @opindex fverbose-asm
14511 Put extra commentary information in the generated assembly code to
14512 make it more readable.  This option is generally only of use to those
14513 who actually need to read the generated assembly code (perhaps while
14514 debugging the compiler itself).
14515
14516 @option{-fno-verbose-asm}, the default, causes the
14517 extra information to be omitted and is useful when comparing two assembler
14518 files.
14519
14520 @item -frecord-gcc-switches
14521 @opindex frecord-gcc-switches
14522 This switch causes the command line that was used to invoke the
14523 compiler to be recorded into the object file that is being created.
14524 This switch is only implemented on some targets and the exact format
14525 of the recording is target and binary file format dependent, but it
14526 usually takes the form of a section containing ASCII text.  This
14527 switch is related to the @option{-fverbose-asm} switch, but that
14528 switch only records information in the assembler output file as
14529 comments, so it never reaches the object file.
14530
14531 @item -fpic
14532 @opindex fpic
14533 @cindex global offset table
14534 @cindex PIC
14535 Generate position-independent code (PIC) suitable for use in a shared
14536 library, if supported for the target machine.  Such code accesses all
14537 constant addresses through a global offset table (GOT)@.  The dynamic
14538 loader resolves the GOT entries when the program starts (the dynamic
14539 loader is not part of GCC; it is part of the operating system).  If
14540 the GOT size for the linked executable exceeds a machine-specific
14541 maximum size, you get an error message from the linker indicating that
14542 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
14543 instead.  (These maximums are 8k on the SPARC and 32k
14544 on the m68k and RS/6000.  The 386 has no such limit.)
14545
14546 Position-independent code requires special support, and therefore works
14547 only on certain machines.  For the 386, GCC supports PIC for System V
14548 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
14549 position-independent.
14550
14551 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
14552 are defined to 1.
14553
14554 @item -fPIC
14555 @opindex fPIC
14556 If supported for the target machine, emit position-independent code,
14557 suitable for dynamic linking and avoiding any limit on the size of the
14558 global offset table.  This option makes a difference on the m68k,
14559 PowerPC and SPARC@.
14560
14561 Position-independent code requires special support, and therefore works
14562 only on certain machines.
14563
14564 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
14565 are defined to 2.
14566
14567 @item -fpie
14568 @itemx -fPIE
14569 @opindex fpie
14570 @opindex fPIE
14571 These options are similar to @option{-fpic} and @option{-fPIC}, but
14572 generated position independent code can be only linked into executables.
14573 Usually these options are used when @option{-pie} GCC option will be
14574 used during linking.
14575
14576 @option{-fpie} and @option{-fPIE} both define the macros
14577 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
14578 for @option{-fpie} and 2 for @option{-fPIE}.
14579
14580 @item -fno-jump-tables
14581 @opindex fno-jump-tables
14582 Do not use jump tables for switch statements even where it would be
14583 more efficient than other code generation strategies.  This option is
14584 of use in conjunction with @option{-fpic} or @option{-fPIC} for
14585 building code which forms part of a dynamic linker and cannot
14586 reference the address of a jump table.  On some targets, jump tables
14587 do not require a GOT and this option is not needed.
14588
14589 @item -ffixed-@var{reg}
14590 @opindex ffixed
14591 Treat the register named @var{reg} as a fixed register; generated code
14592 should never refer to it (except perhaps as a stack pointer, frame
14593 pointer or in some other fixed role).
14594
14595 @var{reg} must be the name of a register.  The register names accepted
14596 are machine-specific and are defined in the @code{REGISTER_NAMES}
14597 macro in the machine description macro file.
14598
14599 This flag does not have a negative form, because it specifies a
14600 three-way choice.
14601
14602 @item -fcall-used-@var{reg}
14603 @opindex fcall-used
14604 Treat the register named @var{reg} as an allocable register that is
14605 clobbered by function calls.  It may be allocated for temporaries or
14606 variables that do not live across a call.  Functions compiled this way
14607 will not save and restore the register @var{reg}.
14608
14609 It is an error to used this flag with the frame pointer or stack pointer.
14610 Use of this flag for other registers that have fixed pervasive roles in
14611 the machine's execution model will produce disastrous results.
14612
14613 This flag does not have a negative form, because it specifies a
14614 three-way choice.
14615
14616 @item -fcall-saved-@var{reg}
14617 @opindex fcall-saved
14618 Treat the register named @var{reg} as an allocable register saved by
14619 functions.  It may be allocated even for temporaries or variables that
14620 live across a call.  Functions compiled this way will save and restore
14621 the register @var{reg} if they use it.
14622
14623 It is an error to used this flag with the frame pointer or stack pointer.
14624 Use of this flag for other registers that have fixed pervasive roles in
14625 the machine's execution model will produce disastrous results.
14626
14627 A different sort of disaster will result from the use of this flag for
14628 a register in which function values may be returned.
14629
14630 This flag does not have a negative form, because it specifies a
14631 three-way choice.
14632
14633 @item -fpack-struct[=@var{n}]
14634 @opindex fpack-struct
14635 Without a value specified, pack all structure members together without
14636 holes.  When a value is specified (which must be a small power of two), pack
14637 structure members according to this value, representing the maximum
14638 alignment (that is, objects with default alignment requirements larger than
14639 this will be output potentially unaligned at the next fitting location.
14640
14641 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
14642 code that is not binary compatible with code generated without that switch.
14643 Additionally, it makes the code suboptimal.
14644 Use it to conform to a non-default application binary interface.
14645
14646 @item -finstrument-functions
14647 @opindex finstrument-functions
14648 Generate instrumentation calls for entry and exit to functions.  Just
14649 after function entry and just before function exit, the following
14650 profiling functions will be called with the address of the current
14651 function and its call site.  (On some platforms,
14652 @code{__builtin_return_address} does not work beyond the current
14653 function, so the call site information may not be available to the
14654 profiling functions otherwise.)
14655
14656 @smallexample
14657 void __cyg_profile_func_enter (void *this_fn,
14658                                void *call_site);
14659 void __cyg_profile_func_exit  (void *this_fn,
14660                                void *call_site);
14661 @end smallexample
14662
14663 The first argument is the address of the start of the current function,
14664 which may be looked up exactly in the symbol table.
14665
14666 This instrumentation is also done for functions expanded inline in other
14667 functions.  The profiling calls will indicate where, conceptually, the
14668 inline function is entered and exited.  This means that addressable
14669 versions of such functions must be available.  If all your uses of a
14670 function are expanded inline, this may mean an additional expansion of
14671 code size.  If you use @samp{extern inline} in your C code, an
14672 addressable version of such functions must be provided.  (This is
14673 normally the case anyways, but if you get lucky and the optimizer always
14674 expands the functions inline, you might have gotten away without
14675 providing static copies.)
14676
14677 A function may be given the attribute @code{no_instrument_function}, in
14678 which case this instrumentation will not be done.  This can be used, for
14679 example, for the profiling functions listed above, high-priority
14680 interrupt routines, and any functions from which the profiling functions
14681 cannot safely be called (perhaps signal handlers, if the profiling
14682 routines generate output or allocate memory).
14683
14684 @item -fstack-check
14685 @opindex fstack-check
14686 Generate code to verify that you do not go beyond the boundary of the
14687 stack.  You should specify this flag if you are running in an
14688 environment with multiple threads, but only rarely need to specify it in
14689 a single-threaded environment since stack overflow is automatically
14690 detected on nearly all systems if there is only one stack.
14691
14692 Note that this switch does not actually cause checking to be done; the
14693 operating system must do that.  The switch causes generation of code
14694 to ensure that the operating system sees the stack being extended.
14695
14696 @item -fstack-limit-register=@var{reg}
14697 @itemx -fstack-limit-symbol=@var{sym}
14698 @itemx -fno-stack-limit
14699 @opindex fstack-limit-register
14700 @opindex fstack-limit-symbol
14701 @opindex fno-stack-limit
14702 Generate code to ensure that the stack does not grow beyond a certain value,
14703 either the value of a register or the address of a symbol.  If the stack
14704 would grow beyond the value, a signal is raised.  For most targets,
14705 the signal is raised before the stack overruns the boundary, so
14706 it is possible to catch the signal without taking special precautions.
14707
14708 For instance, if the stack starts at absolute address @samp{0x80000000}
14709 and grows downwards, you can use the flags
14710 @option{-fstack-limit-symbol=__stack_limit} and
14711 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
14712 of 128KB@.  Note that this may only work with the GNU linker.
14713
14714 @cindex aliasing of parameters
14715 @cindex parameters, aliased
14716 @item -fargument-alias
14717 @itemx -fargument-noalias
14718 @itemx -fargument-noalias-global
14719 @itemx -fargument-noalias-anything
14720 @opindex fargument-alias
14721 @opindex fargument-noalias
14722 @opindex fargument-noalias-global
14723 @opindex fargument-noalias-anything
14724 Specify the possible relationships among parameters and between
14725 parameters and global data.
14726
14727 @option{-fargument-alias} specifies that arguments (parameters) may
14728 alias each other and may alias global storage.@*
14729 @option{-fargument-noalias} specifies that arguments do not alias
14730 each other, but may alias global storage.@*
14731 @option{-fargument-noalias-global} specifies that arguments do not
14732 alias each other and do not alias global storage.
14733 @option{-fargument-noalias-anything} specifies that arguments do not
14734 alias any other storage.
14735
14736 Each language will automatically use whatever option is required by
14737 the language standard.  You should not need to use these options yourself.
14738
14739 @item -fleading-underscore
14740 @opindex fleading-underscore
14741 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
14742 change the way C symbols are represented in the object file.  One use
14743 is to help link with legacy assembly code.
14744
14745 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
14746 generate code that is not binary compatible with code generated without that
14747 switch.  Use it to conform to a non-default application binary interface.
14748 Not all targets provide complete support for this switch.
14749
14750 @item -ftls-model=@var{model}
14751 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
14752 The @var{model} argument should be one of @code{global-dynamic},
14753 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
14754
14755 The default without @option{-fpic} is @code{initial-exec}; with
14756 @option{-fpic} the default is @code{global-dynamic}.
14757
14758 @item -fvisibility=@var{default|internal|hidden|protected}
14759 @opindex fvisibility
14760 Set the default ELF image symbol visibility to the specified option---all
14761 symbols will be marked with this unless overridden within the code.
14762 Using this feature can very substantially improve linking and
14763 load times of shared object libraries, produce more optimized
14764 code, provide near-perfect API export and prevent symbol clashes.
14765 It is @strong{strongly} recommended that you use this in any shared objects
14766 you distribute.
14767
14768 Despite the nomenclature, @code{default} always means public ie;
14769 available to be linked against from outside the shared object.
14770 @code{protected} and @code{internal} are pretty useless in real-world
14771 usage so the only other commonly used option will be @code{hidden}.
14772 The default if @option{-fvisibility} isn't specified is
14773 @code{default}, i.e., make every
14774 symbol public---this causes the same behavior as previous versions of
14775 GCC@.
14776
14777 A good explanation of the benefits offered by ensuring ELF
14778 symbols have the correct visibility is given by ``How To Write
14779 Shared Libraries'' by Ulrich Drepper (which can be found at
14780 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
14781 solution made possible by this option to marking things hidden when
14782 the default is public is to make the default hidden and mark things
14783 public.  This is the norm with DLL's on Windows and with @option{-fvisibility=hidden}
14784 and @code{__attribute__ ((visibility("default")))} instead of
14785 @code{__declspec(dllexport)} you get almost identical semantics with
14786 identical syntax.  This is a great boon to those working with
14787 cross-platform projects.
14788
14789 For those adding visibility support to existing code, you may find
14790 @samp{#pragma GCC visibility} of use.  This works by you enclosing
14791 the declarations you wish to set visibility for with (for example)
14792 @samp{#pragma GCC visibility push(hidden)} and
14793 @samp{#pragma GCC visibility pop}.
14794 Bear in mind that symbol visibility should be viewed @strong{as
14795 part of the API interface contract} and thus all new code should
14796 always specify visibility when it is not the default ie; declarations
14797 only for use within the local DSO should @strong{always} be marked explicitly
14798 as hidden as so to avoid PLT indirection overheads---making this
14799 abundantly clear also aids readability and self-documentation of the code.
14800 Note that due to ISO C++ specification requirements, operator new and
14801 operator delete must always be of default visibility.
14802
14803 Be aware that headers from outside your project, in particular system
14804 headers and headers from any other library you use, may not be
14805 expecting to be compiled with visibility other than the default.  You
14806 may need to explicitly say @samp{#pragma GCC visibility push(default)}
14807 before including any such headers.
14808
14809 @samp{extern} declarations are not affected by @samp{-fvisibility}, so
14810 a lot of code can be recompiled with @samp{-fvisibility=hidden} with
14811 no modifications.  However, this means that calls to @samp{extern}
14812 functions with no explicit visibility will use the PLT, so it is more
14813 effective to use @samp{__attribute ((visibility))} and/or
14814 @samp{#pragma GCC visibility} to tell the compiler which @samp{extern}
14815 declarations should be treated as hidden.
14816
14817 Note that @samp{-fvisibility} does affect C++ vague linkage
14818 entities. This means that, for instance, an exception class that will
14819 be thrown between DSOs must be explicitly marked with default
14820 visibility so that the @samp{type_info} nodes will be unified between
14821 the DSOs.
14822
14823 An overview of these techniques, their benefits and how to use them
14824 is at @w{@uref{http://gcc.gnu.org/wiki/Visibility}}.
14825
14826 @end table
14827
14828 @c man end
14829
14830 @node Environment Variables
14831 @section Environment Variables Affecting GCC
14832 @cindex environment variables
14833
14834 @c man begin ENVIRONMENT
14835 This section describes several environment variables that affect how GCC
14836 operates.  Some of them work by specifying directories or prefixes to use
14837 when searching for various kinds of files.  Some are used to specify other
14838 aspects of the compilation environment.
14839
14840 Note that you can also specify places to search using options such as
14841 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
14842 take precedence over places specified using environment variables, which
14843 in turn take precedence over those specified by the configuration of GCC@.
14844 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
14845 GNU Compiler Collection (GCC) Internals}.
14846
14847 @table @env
14848 @item LANG
14849 @itemx LC_CTYPE
14850 @c @itemx LC_COLLATE
14851 @itemx LC_MESSAGES
14852 @c @itemx LC_MONETARY
14853 @c @itemx LC_NUMERIC
14854 @c @itemx LC_TIME
14855 @itemx LC_ALL
14856 @findex LANG
14857 @findex LC_CTYPE
14858 @c @findex LC_COLLATE
14859 @findex LC_MESSAGES
14860 @c @findex LC_MONETARY
14861 @c @findex LC_NUMERIC
14862 @c @findex LC_TIME
14863 @findex LC_ALL
14864 @cindex locale
14865 These environment variables control the way that GCC uses
14866 localization information that allow GCC to work with different
14867 national conventions.  GCC inspects the locale categories
14868 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
14869 so.  These locale categories can be set to any value supported by your
14870 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
14871 Kingdom encoded in UTF-8.
14872
14873 The @env{LC_CTYPE} environment variable specifies character
14874 classification.  GCC uses it to determine the character boundaries in
14875 a string; this is needed for some multibyte encodings that contain quote
14876 and escape characters that would otherwise be interpreted as a string
14877 end or escape.
14878
14879 The @env{LC_MESSAGES} environment variable specifies the language to
14880 use in diagnostic messages.
14881
14882 If the @env{LC_ALL} environment variable is set, it overrides the value
14883 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
14884 and @env{LC_MESSAGES} default to the value of the @env{LANG}
14885 environment variable.  If none of these variables are set, GCC
14886 defaults to traditional C English behavior.
14887
14888 @item TMPDIR
14889 @findex TMPDIR
14890 If @env{TMPDIR} is set, it specifies the directory to use for temporary
14891 files.  GCC uses temporary files to hold the output of one stage of
14892 compilation which is to be used as input to the next stage: for example,
14893 the output of the preprocessor, which is the input to the compiler
14894 proper.
14895
14896 @item GCC_EXEC_PREFIX
14897 @findex GCC_EXEC_PREFIX
14898 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
14899 names of the subprograms executed by the compiler.  No slash is added
14900 when this prefix is combined with the name of a subprogram, but you can
14901 specify a prefix that ends with a slash if you wish.
14902
14903 If @env{GCC_EXEC_PREFIX} is not set, GCC will attempt to figure out
14904 an appropriate prefix to use based on the pathname it was invoked with.
14905
14906 If GCC cannot find the subprogram using the specified prefix, it
14907 tries looking in the usual places for the subprogram.
14908
14909 The default value of @env{GCC_EXEC_PREFIX} is
14910 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
14911 the installed compiler. In many cases @var{prefix} is the value
14912 of @code{prefix} when you ran the @file{configure} script.
14913
14914 Other prefixes specified with @option{-B} take precedence over this prefix.
14915
14916 This prefix is also used for finding files such as @file{crt0.o} that are
14917 used for linking.
14918
14919 In addition, the prefix is used in an unusual way in finding the
14920 directories to search for header files.  For each of the standard
14921 directories whose name normally begins with @samp{/usr/local/lib/gcc}
14922 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
14923 replacing that beginning with the specified prefix to produce an
14924 alternate directory name.  Thus, with @option{-Bfoo/}, GCC will search
14925 @file{foo/bar} where it would normally search @file{/usr/local/lib/bar}.
14926 These alternate directories are searched first; the standard directories
14927 come next. If a standard directory begins with the configured
14928 @var{prefix} then the value of @var{prefix} is replaced by
14929 @env{GCC_EXEC_PREFIX} when looking for header files.
14930
14931 @item COMPILER_PATH
14932 @findex COMPILER_PATH
14933 The value of @env{COMPILER_PATH} is a colon-separated list of
14934 directories, much like @env{PATH}.  GCC tries the directories thus
14935 specified when searching for subprograms, if it can't find the
14936 subprograms using @env{GCC_EXEC_PREFIX}.
14937
14938 @item LIBRARY_PATH
14939 @findex LIBRARY_PATH
14940 The value of @env{LIBRARY_PATH} is a colon-separated list of
14941 directories, much like @env{PATH}.  When configured as a native compiler,
14942 GCC tries the directories thus specified when searching for special
14943 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
14944 using GCC also uses these directories when searching for ordinary
14945 libraries for the @option{-l} option (but directories specified with
14946 @option{-L} come first).
14947
14948 @item LANG
14949 @findex LANG
14950 @cindex locale definition
14951 This variable is used to pass locale information to the compiler.  One way in
14952 which this information is used is to determine the character set to be used
14953 when character literals, string literals and comments are parsed in C and C++.
14954 When the compiler is configured to allow multibyte characters,
14955 the following values for @env{LANG} are recognized:
14956
14957 @table @samp
14958 @item C-JIS
14959 Recognize JIS characters.
14960 @item C-SJIS
14961 Recognize SJIS characters.
14962 @item C-EUCJP
14963 Recognize EUCJP characters.
14964 @end table
14965
14966 If @env{LANG} is not defined, or if it has some other value, then the
14967 compiler will use mblen and mbtowc as defined by the default locale to
14968 recognize and translate multibyte characters.
14969 @end table
14970
14971 @noindent
14972 Some additional environments variables affect the behavior of the
14973 preprocessor.
14974
14975 @include cppenv.texi
14976
14977 @c man end
14978
14979 @node Precompiled Headers
14980 @section Using Precompiled Headers
14981 @cindex precompiled headers
14982 @cindex speed of compilation
14983
14984 Often large projects have many header files that are included in every
14985 source file.  The time the compiler takes to process these header files
14986 over and over again can account for nearly all of the time required to
14987 build the project.  To make builds faster, GCC allows users to
14988 `precompile' a header file; then, if builds can use the precompiled
14989 header file they will be much faster.
14990
14991 To create a precompiled header file, simply compile it as you would any
14992 other file, if necessary using the @option{-x} option to make the driver
14993 treat it as a C or C++ header file.  You will probably want to use a
14994 tool like @command{make} to keep the precompiled header up-to-date when
14995 the headers it contains change.
14996
14997 A precompiled header file will be searched for when @code{#include} is
14998 seen in the compilation.  As it searches for the included file
14999 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
15000 compiler looks for a precompiled header in each directory just before it
15001 looks for the include file in that directory.  The name searched for is
15002 the name specified in the @code{#include} with @samp{.gch} appended.  If
15003 the precompiled header file can't be used, it is ignored.
15004
15005 For instance, if you have @code{#include "all.h"}, and you have
15006 @file{all.h.gch} in the same directory as @file{all.h}, then the
15007 precompiled header file will be used if possible, and the original
15008 header will be used otherwise.
15009
15010 Alternatively, you might decide to put the precompiled header file in a
15011 directory and use @option{-I} to ensure that directory is searched
15012 before (or instead of) the directory containing the original header.
15013 Then, if you want to check that the precompiled header file is always
15014 used, you can put a file of the same name as the original header in this
15015 directory containing an @code{#error} command.
15016
15017 This also works with @option{-include}.  So yet another way to use
15018 precompiled headers, good for projects not designed with precompiled
15019 header files in mind, is to simply take most of the header files used by
15020 a project, include them from another header file, precompile that header
15021 file, and @option{-include} the precompiled header.  If the header files
15022 have guards against multiple inclusion, they will be skipped because
15023 they've already been included (in the precompiled header).
15024
15025 If you need to precompile the same header file for different
15026 languages, targets, or compiler options, you can instead make a
15027 @emph{directory} named like @file{all.h.gch}, and put each precompiled
15028 header in the directory, perhaps using @option{-o}.  It doesn't matter
15029 what you call the files in the directory, every precompiled header in
15030 the directory will be considered.  The first precompiled header
15031 encountered in the directory that is valid for this compilation will
15032 be used; they're searched in no particular order.
15033
15034 There are many other possibilities, limited only by your imagination,
15035 good sense, and the constraints of your build system.
15036
15037 A precompiled header file can be used only when these conditions apply:
15038
15039 @itemize
15040 @item
15041 Only one precompiled header can be used in a particular compilation.
15042
15043 @item
15044 A precompiled header can't be used once the first C token is seen.  You
15045 can have preprocessor directives before a precompiled header; you can
15046 even include a precompiled header from inside another header, so long as
15047 there are no C tokens before the @code{#include}.
15048
15049 @item
15050 The precompiled header file must be produced for the same language as
15051 the current compilation.  You can't use a C precompiled header for a C++
15052 compilation.
15053
15054 @item
15055 The precompiled header file must have been produced by the same compiler
15056 binary as the current compilation is using.
15057
15058 @item
15059 Any macros defined before the precompiled header is included must
15060 either be defined in the same way as when the precompiled header was
15061 generated, or must not affect the precompiled header, which usually
15062 means that they don't appear in the precompiled header at all.
15063
15064 The @option{-D} option is one way to define a macro before a
15065 precompiled header is included; using a @code{#define} can also do it.
15066 There are also some options that define macros implicitly, like
15067 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
15068 defined this way.
15069
15070 @item If debugging information is output when using the precompiled
15071 header, using @option{-g} or similar, the same kind of debugging information
15072 must have been output when building the precompiled header.  However,
15073 a precompiled header built using @option{-g} can be used in a compilation
15074 when no debugging information is being output.
15075
15076 @item The same @option{-m} options must generally be used when building
15077 and using the precompiled header.  @xref{Submodel Options},
15078 for any cases where this rule is relaxed.
15079
15080 @item Each of the following options must be the same when building and using
15081 the precompiled header:
15082
15083 @gccoptlist{-fexceptions -funit-at-a-time}
15084
15085 @item
15086 Some other command-line options starting with @option{-f},
15087 @option{-p}, or @option{-O} must be defined in the same way as when
15088 the precompiled header was generated.  At present, it's not clear
15089 which options are safe to change and which are not; the safest choice
15090 is to use exactly the same options when generating and using the
15091 precompiled header.  The following are known to be safe:
15092
15093 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
15094 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
15095 -fsched-verbose=<number>  -fschedule-insns  -fvisibility= @gol
15096 -pedantic-errors}
15097
15098 @end itemize
15099
15100 For all of these except the last, the compiler will automatically
15101 ignore the precompiled header if the conditions aren't met.  If you
15102 find an option combination that doesn't work and doesn't cause the
15103 precompiled header to be ignored, please consider filing a bug report,
15104 see @ref{Bugs}.
15105
15106 If you do use differing options when generating and using the
15107 precompiled header, the actual behavior will be a mixture of the
15108 behavior for the options.  For instance, if you use @option{-g} to
15109 generate the precompiled header but not when using it, you may or may
15110 not get debugging information for routines in the precompiled header.
15111
15112 @node Running Protoize
15113 @section Running Protoize
15114
15115 The program @code{protoize} is an optional part of GCC@.  You can use
15116 it to add prototypes to a program, thus converting the program to ISO
15117 C in one respect.  The companion program @code{unprotoize} does the
15118 reverse: it removes argument types from any prototypes that are found.
15119
15120 When you run these programs, you must specify a set of source files as
15121 command line arguments.  The conversion programs start out by compiling
15122 these files to see what functions they define.  The information gathered
15123 about a file @var{foo} is saved in a file named @file{@var{foo}.X}.
15124
15125 After scanning comes actual conversion.  The specified files are all
15126 eligible to be converted; any files they include (whether sources or
15127 just headers) are eligible as well.
15128
15129 But not all the eligible files are converted.  By default,
15130 @code{protoize} and @code{unprotoize} convert only source and header
15131 files in the current directory.  You can specify additional directories
15132 whose files should be converted with the @option{-d @var{directory}}
15133 option.  You can also specify particular files to exclude with the
15134 @option{-x @var{file}} option.  A file is converted if it is eligible, its
15135 directory name matches one of the specified directory names, and its
15136 name within the directory has not been excluded.
15137
15138 Basic conversion with @code{protoize} consists of rewriting most
15139 function definitions and function declarations to specify the types of
15140 the arguments.  The only ones not rewritten are those for varargs
15141 functions.
15142
15143 @code{protoize} optionally inserts prototype declarations at the
15144 beginning of the source file, to make them available for any calls that
15145 precede the function's definition.  Or it can insert prototype
15146 declarations with block scope in the blocks where undeclared functions
15147 are called.
15148
15149 Basic conversion with @code{unprotoize} consists of rewriting most
15150 function declarations to remove any argument types, and rewriting
15151 function definitions to the old-style pre-ISO form.
15152
15153 Both conversion programs print a warning for any function declaration or
15154 definition that they can't convert.  You can suppress these warnings
15155 with @option{-q}.
15156
15157 The output from @code{protoize} or @code{unprotoize} replaces the
15158 original source file.  The original file is renamed to a name ending
15159 with @samp{.save} (for DOS, the saved filename ends in @samp{.sav}
15160 without the original @samp{.c} suffix).  If the @samp{.save} (@samp{.sav}
15161 for DOS) file already exists, then the source file is simply discarded.
15162
15163 @code{protoize} and @code{unprotoize} both depend on GCC itself to
15164 scan the program and collect information about the functions it uses.
15165 So neither of these programs will work until GCC is installed.
15166
15167 Here is a table of the options you can use with @code{protoize} and
15168 @code{unprotoize}.  Each option works with both programs unless
15169 otherwise stated.
15170
15171 @table @code
15172 @item -B @var{directory}
15173 Look for the file @file{SYSCALLS.c.X} in @var{directory}, instead of the
15174 usual directory (normally @file{/usr/local/lib}).  This file contains
15175 prototype information about standard system functions.  This option
15176 applies only to @code{protoize}.
15177
15178 @item -c @var{compilation-options}
15179 Use @var{compilation-options} as the options when running @command{gcc} to
15180 produce the @samp{.X} files.  The special option @option{-aux-info} is
15181 always passed in addition, to tell @command{gcc} to write a @samp{.X} file.
15182
15183 Note that the compilation options must be given as a single argument to
15184 @code{protoize} or @code{unprotoize}.  If you want to specify several
15185 @command{gcc} options, you must quote the entire set of compilation options
15186 to make them a single word in the shell.
15187
15188 There are certain @command{gcc} arguments that you cannot use, because they
15189 would produce the wrong kind of output.  These include @option{-g},
15190 @option{-O}, @option{-c}, @option{-S}, and @option{-o} If you include these in
15191 the @var{compilation-options}, they are ignored.
15192
15193 @item -C
15194 Rename files to end in @samp{.C} (@samp{.cc} for DOS-based file
15195 systems) instead of @samp{.c}.  This is convenient if you are converting
15196 a C program to C++.  This option applies only to @code{protoize}.
15197
15198 @item -g
15199 Add explicit global declarations.  This means inserting explicit
15200 declarations at the beginning of each source file for each function
15201 that is called in the file and was not declared.  These declarations
15202 precede the first function definition that contains a call to an
15203 undeclared function.  This option applies only to @code{protoize}.
15204
15205 @item -i @var{string}
15206 Indent old-style parameter declarations with the string @var{string}.
15207 This option applies only to @code{protoize}.
15208
15209 @code{unprotoize} converts prototyped function definitions to old-style
15210 function definitions, where the arguments are declared between the
15211 argument list and the initial @samp{@{}.  By default, @code{unprotoize}
15212 uses five spaces as the indentation.  If you want to indent with just
15213 one space instead, use @option{-i " "}.
15214
15215 @item -k
15216 Keep the @samp{.X} files.  Normally, they are deleted after conversion
15217 is finished.
15218
15219 @item -l
15220 Add explicit local declarations.  @code{protoize} with @option{-l} inserts
15221 a prototype declaration for each function in each block which calls the
15222 function without any declaration.  This option applies only to
15223 @code{protoize}.
15224
15225 @item -n
15226 Make no real changes.  This mode just prints information about the conversions
15227 that would have been done without @option{-n}.
15228
15229 @item -N
15230 Make no @samp{.save} files.  The original files are simply deleted.
15231 Use this option with caution.
15232
15233 @item -p @var{program}
15234 Use the program @var{program} as the compiler.  Normally, the name
15235 @file{gcc} is used.
15236
15237 @item -q
15238 Work quietly.  Most warnings are suppressed.
15239
15240 @item -v
15241 Print the version number, just like @option{-v} for @command{gcc}.
15242 @end table
15243
15244 If you need special compiler options to compile one of your program's
15245 source files, then you should generate that file's @samp{.X} file
15246 specially, by running @command{gcc} on that source file with the
15247 appropriate options and the option @option{-aux-info}.  Then run
15248 @code{protoize} on the entire set of files.  @code{protoize} will use
15249 the existing @samp{.X} file because it is newer than the source file.
15250 For example:
15251
15252 @smallexample
15253 gcc -Dfoo=bar file1.c -aux-info file1.X
15254 protoize *.c
15255 @end smallexample
15256
15257 @noindent
15258 You need to include the special files along with the rest in the
15259 @code{protoize} command, even though their @samp{.X} files already
15260 exist, because otherwise they won't get converted.
15261
15262 @xref{Protoize Caveats}, for more information on how to use
15263 @code{protoize} successfully.