OSDN Git Service

220c5f573adbb2d46aea963e5668c5b56d876d1d
[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 -Wabi  -Wctor-dtor-privacy @gol
195 -Wnon-virtual-dtor  -Wreorder @gol
196 -Weffc++  -Wno-deprecated  -Wstrict-null-sentinel @gol
197 -Wno-non-template-friend  -Wold-style-cast @gol
198 -Woverloaded-virtual  -Wno-pmf-conversions @gol
199 -Wsign-promo}
200
201 @item Objective-C and Objective-C++ Language Options
202 @xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling
203 Objective-C and Objective-C++ Dialects}.
204 @gccoptlist{-fconstant-string-class=@var{class-name} @gol
205 -fgnu-runtime  -fnext-runtime @gol
206 -fno-nil-receivers @gol
207 -fobjc-call-cxx-cdtors @gol
208 -fobjc-direct-dispatch @gol
209 -fobjc-exceptions @gol
210 -fobjc-gc @gol
211 -freplace-objc-classes @gol
212 -fzero-link @gol
213 -gen-decls @gol
214 -Wassign-intercept @gol
215 -Wno-protocol  -Wselector @gol
216 -Wstrict-selector-match @gol
217 -Wundeclared-selector}
218
219 @item Language Independent Options
220 @xref{Language Independent Options,,Options to Control Diagnostic Messages Formatting}.
221 @gccoptlist{-fmessage-length=@var{n}  @gol
222 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol
223 -fdiagnostics-show-option}
224
225 @item Warning Options
226 @xref{Warning Options,,Options to Request or Suppress Warnings}.
227 @gccoptlist{-fsyntax-only  -pedantic  -pedantic-errors @gol
228 -w  -Wextra  -Wall  -Waddress  -Waggregate-return  -Warray-bounds @gol
229 -Wno-attributes -Wc++-compat -Wc++0x-compat -Wcast-align  -Wcast-qual  @gol
230 -Wchar-subscripts -Wclobbered  -Wcomment @gol
231 -Wconversion  -Wcoverage-mismatch  -Wno-deprecated-declarations @gol
232 -Wdisabled-optimization  -Wno-div-by-zero  @gol
233 -Wempty-body  -Wno-endif-labels @gol
234 -Werror  -Werror=* @gol
235 -Wfatal-errors  -Wfloat-equal  -Wformat  -Wformat=2 @gol
236 -Wno-format-extra-args -Wformat-nonliteral @gol
237 -Wformat-security  -Wformat-y2k @gol
238 -Wimplicit  -Wimplicit-function-declaration  -Wimplicit-int @gol
239 -Wimport  -Wno-import  -Winit-self  -Winline @gol
240 -Wno-int-to-pointer-cast -Wno-invalid-offsetof @gol
241 -Winvalid-pch -Wlarger-than-@var{len}  -Wunsafe-loop-optimizations @gol
242 -Wlogical-op -Wlong-long @gol
243 -Wmain  -Wmissing-braces  -Wmissing-field-initializers @gol
244 -Wmissing-format-attribute  -Wmissing-include-dirs @gol
245 -Wmissing-noreturn @gol
246 -Wno-multichar  -Wnonnull  -Wno-overflow @gol
247 -Woverlength-strings  -Wpacked  -Wpadded @gol
248 -Wparentheses  -Wpointer-arith  -Wno-pointer-to-int-cast @gol
249 -Wredundant-decls @gol
250 -Wreturn-type  -Wsequence-point  -Wshadow @gol
251 -Wsign-compare  -Wsign-conversion  -Wstack-protector @gol
252 -Wstrict-aliasing -Wstrict-aliasing=n @gol
253 -Wstrict-overflow -Wstrict-overflow=@var{n} @gol
254 -Wswitch  -Wswitch-default  -Wswitch-enum @gol
255 -Wsystem-headers  -Wtrigraphs  -Wtype-limits  -Wundef  -Wuninitialized @gol
256 -Wunknown-pragmas  -Wno-pragmas -Wunreachable-code @gol
257 -Wunused  -Wunused-function  -Wunused-label  -Wunused-parameter @gol
258 -Wunused-value  -Wunused-variable @gol
259 -Wvariadic-macros -Wvla @gol
260 -Wvolatile-register-var  -Wwrite-strings}
261
262 @item C-only Warning Options
263 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
264 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
265 -Wold-style-declaration  -Wold-style-definition @gol
266 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
267 -Wdeclaration-after-statement -Wpointer-sign}
268
269 @item Debugging Options
270 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
271 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
272 -fdump-noaddr -fdump-unnumbered  -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
273 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
274 -fdump-ipa-all -fdump-ipa-cgraph @gol
275 -fdump-tree-all @gol
276 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
277 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
278 -fdump-tree-inlined@r{[}-@var{n}@r{]} @gol
279 -fdump-tree-cfg -fdump-tree-vcg -fdump-tree-alias @gol
280 -fdump-tree-ch @gol
281 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
282 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
283 -fdump-tree-gimple@r{[}-raw@r{]} -fdump-tree-mudflap@r{[}-@var{n}@r{]} @gol
284 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
285 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
286 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
287 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
288 -fdump-tree-copyrename@r{[}-@var{n}@r{]} @gol
289 -fdump-tree-nrv -fdump-tree-vect @gol
290 -fdump-tree-sink @gol
291 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
292 -fdump-tree-salias @gol
293 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
294 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
295 -ftree-vectorizer-verbose=@var{n} @gol
296 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
297 -feliminate-dwarf2-dups -feliminate-unused-debug-types @gol
298 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
299 -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
300 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
301 -ftest-coverage  -ftime-report -fvar-tracking @gol
302 -g  -g@var{level}  -gcoff -gdwarf-2 @gol
303 -ggdb  -gstabs  -gstabs+  -gvms  -gxcoff  -gxcoff+ @gol
304 -femit-struct-debug-baseonly -femit-struct-debug-reduced @gol
305 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
306 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
307 -print-multi-directory  -print-multi-lib @gol
308 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
309 -print-sysroot-headers-suffix @gol
310 -save-temps  -time}
311
312 @item Optimization Options
313 @xref{Optimize Options,,Options that Control Optimization}.
314 @gccoptlist{-falign-functions=@var{n}  -falign-jumps=@var{n} @gol
315 -falign-labels=@var{n}  -falign-loops=@var{n}  @gol
316 -fbounds-check -fmudflap -fmudflapth -fmudflapir @gol
317 -fbranch-probabilities -fprofile-values -fvpt -fbranch-target-load-optimize @gol
318 -fbranch-target-load-optimize2 -fbtr-bb-exclusive @gol
319 -fcaller-saves  -fcprop-registers  -fcse-follow-jumps @gol
320 -fcse-skip-blocks  -fcx-limited-range  -fdata-sections @gol
321 -fdelayed-branch  -fdelete-null-pointer-checks -fearly-inlining @gol
322 -fexpensive-optimizations  -ffast-math  -ffloat-store @gol
323 -fforce-addr  -fforward-propagate  -ffunction-sections @gol
324 -fgcse  -fgcse-lm  -fgcse-sm  -fgcse-las  -fgcse-after-reload @gol
325 -fcrossjumping  -fif-conversion  -fif-conversion2 @gol
326 -finline-functions  -finline-functions-called-once @gol
327 -finline-limit=@var{n}  -fkeep-inline-functions @gol
328 -fkeep-static-consts  -fmerge-constants  -fmerge-all-constants @gol
329 -fmodulo-sched -fno-branch-count-reg @gol
330 -fno-default-inline  -fno-defer-pop -fmove-loop-invariants @gol
331 -fno-function-cse  -fno-guess-branch-probability @gol
332 -fno-inline  -fno-math-errno  -fno-peephole  -fno-peephole2 @gol
333 -funsafe-math-optimizations  -funsafe-loop-optimizations @gol
334 -ffinite-math-only  -fno-signed-zeros @gol
335 -fno-toplevel-reorder -fno-trapping-math  -fno-zero-initialized-in-bss @gol
336 -fomit-frame-pointer  -foptimize-register-move @gol
337 -foptimize-sibling-calls  -fpredictive-commoning -fprefetch-loop-arrays @gol
338 -fprofile-generate -fprofile-use @gol
339 -fregmove  -frename-registers @gol
340 -freorder-blocks  -freorder-blocks-and-partition -freorder-functions @gol
341 -frerun-cse-after-loop @gol
342 -frounding-math -frtl-abstract-sequences @gol
343 -fschedule-insns  -fschedule-insns2 @gol
344 -fno-sched-interblock  -fno-sched-spec  -fsched-spec-load @gol
345 -fsched-spec-load-dangerous  @gol
346 -fsched-stalled-insns=@var{n} -fsched-stalled-insns-dep=@var{n} @gol
347 -fsched2-use-superblocks @gol
348 -fsched2-use-traces -fsee -freschedule-modulo-scheduled-loops @gol
349 -fsection-anchors  -fsignaling-nans  -fsingle-precision-constant @gol
350 -fno-split-wide-types -fstack-protector  -fstack-protector-all @gol
351 -fstrict-aliasing  -fstrict-overflow  -ftracer  -fthread-jumps @gol
352 -funroll-all-loops  -funroll-loops  -fpeel-loops @gol
353 -fsplit-ivs-in-unroller -funswitch-loops @gol
354 -fvariable-expansion-in-unroller @gol
355 -ftree-pre  -ftree-ccp  -ftree-dce -ftree-loop-optimize @gol
356 -ftree-loop-linear -ftree-loop-im -ftree-loop-ivcanon -fivopts @gol
357 -fcheck-data-deps @gol
358 -ftree-dominator-opts -ftree-dse -ftree-copyrename -ftree-sink @gol
359 -ftree-ch -ftree-sra -ftree-ter -ftree-fre -ftree-vectorize @gol
360 -ftree-vect-loop-version -ftree-salias -fipa-pta -fweb @gol
361 -ftree-copy-prop -ftree-store-ccp -ftree-store-copy-prop -fwhole-program @gol
362 --param @var{name}=@var{value}
363 -O  -O0  -O1  -O2  -O3  -Os}
364
365 @item Preprocessor Options
366 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
367 @gccoptlist{-A@var{question}=@var{answer} @gol
368 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
369 -C  -dD  -dI  -dM  -dN @gol
370 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
371 -idirafter @var{dir} @gol
372 -include @var{file}  -imacros @var{file} @gol
373 -iprefix @var{file}  -iwithprefix @var{dir} @gol
374 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
375 -imultilib @var{dir} -isysroot @var{dir} @gol
376 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
377 -P  -fworking-directory  -remap @gol
378 -trigraphs  -undef  -U@var{macro}  -Wp,@var{option} @gol
379 -Xpreprocessor @var{option}}
380
381 @item Assembler Option
382 @xref{Assembler Options,,Passing Options to the Assembler}.
383 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
384
385 @item Linker Options
386 @xref{Link Options,,Options for Linking}.
387 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
388 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
389 -s  -static  -static-libgcc  -shared  -shared-libgcc  -symbolic @gol
390 -Wl,@var{option}  -Xlinker @var{option} @gol
391 -u @var{symbol}}
392
393 @item Directory Options
394 @xref{Directory Options,,Options for Directory Search}.
395 @gccoptlist{-B@var{prefix}  -I@var{dir}  -iquote@var{dir}  -L@var{dir}
396 -specs=@var{file}  -I- --sysroot=@var{dir}}
397
398 @item Target Options
399 @c I wrote this xref this way to avoid overfull hbox. -- rms
400 @xref{Target Options}.
401 @gccoptlist{-V @var{version}  -b @var{machine}}
402
403 @item Machine Dependent Options
404 @xref{Submodel Options,,Hardware Models and Configurations}.
405 @c This list is ordered alphanumerically by subsection name.
406 @c Try and put the significant identifier (CPU or system) first,
407 @c so users have a clue at guessing where the ones they want will be.
408
409 @emph{ARC Options}
410 @gccoptlist{-EB  -EL @gol
411 -mmangle-cpu  -mcpu=@var{cpu}  -mtext=@var{text-section} @gol
412 -mdata=@var{data-section}  -mrodata=@var{readonly-data-section}}
413
414 @emph{ARM Options}
415 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
416 -mabi=@var{name} @gol
417 -mapcs-stack-check  -mno-apcs-stack-check @gol
418 -mapcs-float  -mno-apcs-float @gol
419 -mapcs-reentrant  -mno-apcs-reentrant @gol
420 -msched-prolog  -mno-sched-prolog @gol
421 -mlittle-endian  -mbig-endian  -mwords-little-endian @gol
422 -mfloat-abi=@var{name}  -msoft-float  -mhard-float  -mfpe @gol
423 -mthumb-interwork  -mno-thumb-interwork @gol
424 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
425 -mstructure-size-boundary=@var{n} @gol
426 -mabort-on-noreturn @gol
427 -mlong-calls  -mno-long-calls @gol
428 -msingle-pic-base  -mno-single-pic-base @gol
429 -mpic-register=@var{reg} @gol
430 -mnop-fun-dllimport @gol
431 -mcirrus-fix-invalid-insns -mno-cirrus-fix-invalid-insns @gol
432 -mpoke-function-name @gol
433 -mthumb  -marm @gol
434 -mtpcs-frame  -mtpcs-leaf-frame @gol
435 -mcaller-super-interworking  -mcallee-super-interworking @gol
436 -mtp=@var{name}}
437
438 @emph{AVR Options}
439 @gccoptlist{-mmcu=@var{mcu}  -msize  -minit-stack=@var{n}  -mno-interrupts @gol
440 -mcall-prologues  -mno-tablejump  -mtiny-stack  -mint8}
441
442 @emph{Blackfin Options}
443 @gccoptlist{-mcpu=@var{cpu}  -msim  -momit-leaf-frame-pointer @gol
444 -mno-omit-leaf-frame-pointer  -mspecld-anomaly  -mno-specld-anomaly @gol
445 -mcsync-anomaly  -mno-csync-anomaly  -mlow-64k  -mno-low64k @gol
446 -mstack-check-l1  -mid-shared-library  -mno-id-shared-library @gol
447 -mshared-library-id=@var{n}  -mleaf-id-shared-library @gol
448 -mno-leaf-id-shared-library  -msep-data  -mno-sep-data  -mlong-calls @gol
449 -mno-long-calls}
450
451 @emph{CRIS Options}
452 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
453 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
454 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
455 -mstack-align  -mdata-align  -mconst-align @gol
456 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
457 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
458 -mmul-bug-workaround  -mno-mul-bug-workaround}
459
460 @emph{CRX Options}
461 @gccoptlist{-mmac -mpush-args}
462
463 @emph{Darwin Options}
464 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
465 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
466 -client_name  -compatibility_version  -current_version @gol
467 -dead_strip @gol
468 -dependency-file  -dylib_file  -dylinker_install_name @gol
469 -dynamic  -dynamiclib  -exported_symbols_list @gol
470 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
471 -force_flat_namespace  -headerpad_max_install_names @gol
472 -iframework @gol
473 -image_base  -init  -install_name  -keep_private_externs @gol
474 -multi_module  -multiply_defined  -multiply_defined_unused @gol
475 -noall_load   -no_dead_strip_inits_and_terms @gol
476 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
477 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
478 -private_bundle  -read_only_relocs  -sectalign @gol
479 -sectobjectsymbols  -whyload  -seg1addr @gol
480 -sectcreate  -sectobjectsymbols  -sectorder @gol
481 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
482 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
483 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
484 -single_module  -static  -sub_library  -sub_umbrella @gol
485 -twolevel_namespace  -umbrella  -undefined @gol
486 -unexported_symbols_list  -weak_reference_mismatches @gol
487 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
488 -mkernel -mone-byte-bool}
489
490 @emph{DEC Alpha Options}
491 @gccoptlist{-mno-fp-regs  -msoft-float  -malpha-as  -mgas @gol
492 -mieee  -mieee-with-inexact  -mieee-conformant @gol
493 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
494 -mtrap-precision=@var{mode}  -mbuild-constants @gol
495 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
496 -mbwx  -mmax  -mfix  -mcix @gol
497 -mfloat-vax  -mfloat-ieee @gol
498 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
499 -msmall-text  -mlarge-text @gol
500 -mmemory-latency=@var{time}}
501
502 @emph{DEC Alpha/VMS Options}
503 @gccoptlist{-mvms-return-codes}
504
505 @emph{FRV Options}
506 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
507 -mhard-float  -msoft-float @gol
508 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
509 -mdouble  -mno-double @gol
510 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
511 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
512 -mlinked-fp  -mlong-calls  -malign-labels @gol
513 -mlibrary-pic  -macc-4  -macc-8 @gol
514 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
515 -moptimize-membar -mno-optimize-membar @gol
516 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
517 -mvliw-branch  -mno-vliw-branch @gol
518 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
519 -mno-nested-cond-exec  -mtomcat-stats @gol
520 -mTLS -mtls @gol
521 -mcpu=@var{cpu}}
522
523 @emph{GNU/Linux Options}
524 @gccoptlist{-muclibc}
525
526 @emph{H8/300 Options}
527 @gccoptlist{-mrelax  -mh  -ms  -mn  -mint32  -malign-300}
528
529 @emph{HPPA Options}
530 @gccoptlist{-march=@var{architecture-type} @gol
531 -mbig-switch  -mdisable-fpregs  -mdisable-indexing @gol
532 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
533 -mfixed-range=@var{register-range} @gol
534 -mjump-in-delay -mlinker-opt -mlong-calls @gol
535 -mlong-load-store  -mno-big-switch  -mno-disable-fpregs @gol
536 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
537 -mno-jump-in-delay  -mno-long-load-store @gol
538 -mno-portable-runtime  -mno-soft-float @gol
539 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
540 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
541 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
542 -munix=@var{unix-std}  -nolibdld  -static  -threads}
543
544 @emph{i386 and x86-64 Options}
545 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
546 -mfpmath=@var{unit} @gol
547 -masm=@var{dialect}  -mno-fancy-math-387 @gol
548 -mno-fp-ret-in-387  -msoft-float @gol
549 -mno-wide-multiply  -mrtd  -malign-double @gol
550 -mpreferred-stack-boundary=@var{num} -mcx16 -msahf @gol
551 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 @gol
552 -msse4a -m3dnow -mpopcnt -mabm @gol
553 -mthreads  -mno-align-stringops  -minline-all-stringops @gol
554 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
555 -m96bit-long-double  -mregparm=@var{num}  -msseregparm @gol
556 -mpc32 -mpc64 -mpc80 mstackrealign @gol
557 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
558 -mcmodel=@var{code-model} @gol
559 -m32  -m64 -mlarge-data-threshold=@var{num}}
560
561 @emph{IA-64 Options}
562 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
563 -mvolatile-asm-stop  -mregister-names  -mno-sdata @gol
564 -mconstant-gp  -mauto-pic  -minline-float-divide-min-latency @gol
565 -minline-float-divide-max-throughput @gol
566 -minline-int-divide-min-latency @gol
567 -minline-int-divide-max-throughput  @gol
568 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
569 -mno-dwarf2-asm -mearly-stop-bits @gol
570 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
571 -mtune=@var{cpu-type} -mt -pthread -milp32 -mlp64 @gol
572 -mno-sched-br-data-spec -msched-ar-data-spec -mno-sched-control-spec @gol
573 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
574 -msched-ldc -mno-sched-control-ldc -mno-sched-spec-verbose @gol
575 -mno-sched-prefer-non-data-spec-insns @gol
576 -mno-sched-prefer-non-control-spec-insns @gol
577 -mno-sched-count-spec-in-critical-path}
578
579 @emph{M32R/D Options}
580 @gccoptlist{-m32r2 -m32rx -m32r @gol
581 -mdebug @gol
582 -malign-loops -mno-align-loops @gol
583 -missue-rate=@var{number} @gol
584 -mbranch-cost=@var{number} @gol
585 -mmodel=@var{code-size-model-type} @gol
586 -msdata=@var{sdata-type} @gol
587 -mno-flush-func -mflush-func=@var{name} @gol
588 -mno-flush-trap -mflush-trap=@var{number} @gol
589 -G @var{num}}
590
591 @emph{M32C Options}
592 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
593
594 @emph{M680x0 Options}
595 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune}
596 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
597 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
598 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
599 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
600 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
601 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
602 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library}
603
604 @emph{M68hc1x Options}
605 @gccoptlist{-m6811  -m6812  -m68hc11  -m68hc12   -m68hcs12 @gol
606 -mauto-incdec  -minmax  -mlong-calls  -mshort @gol
607 -msoft-reg-count=@var{count}}
608
609 @emph{MCore Options}
610 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
611 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
612 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
613 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
614 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
615
616 @emph{MIPS Options}
617 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
618 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2  -mips64 @gol
619 -mips16  -mno-mips16  -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
620 -mshared  -mno-shared  -mxgot  -mno-xgot  -mgp32  -mgp64 @gol
621 -mfp32  -mfp64  -mhard-float  -msoft-float @gol
622 -msingle-float  -mdouble-float  -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
623 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
624 -mips3d  -mno-mips3d  -mmt  -mno-mt @gol
625 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
626 -G@var{num}  -membedded-data  -mno-embedded-data @gol
627 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
628 -msplit-addresses  -mno-split-addresses @gol
629 -mexplicit-relocs  -mno-explicit-relocs @gol
630 -mcheck-zero-division  -mno-check-zero-division @gol
631 -mdivide-traps  -mdivide-breaks @gol
632 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
633 -mmad  -mno-mad  -mfused-madd  -mno-fused-madd  -nocpp @gol
634 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
635 -mfix-vr4120  -mno-fix-vr4120  -mfix-vr4130  -mno-fix-vr4130 @gol
636 -mfix-sb1  -mno-fix-sb1 @gol
637 -mflush-func=@var{func}  -mno-flush-func @gol
638 -mbranch-likely  -mno-branch-likely @gol
639 -mfp-exceptions -mno-fp-exceptions @gol
640 -mvr4130-align -mno-vr4130-align}
641
642 @emph{MMIX Options}
643 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
644 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
645 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
646 -mno-base-addresses  -msingle-exit  -mno-single-exit}
647
648 @emph{MN10300 Options}
649 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
650 -mam33  -mno-am33 @gol
651 -mam33-2  -mno-am33-2 @gol
652 -mreturn-pointer-on-d0 @gol
653 -mno-crt0  -mrelax}
654
655 @emph{MT Options}
656 @gccoptlist{-mno-crt0 -mbacc -msim @gol
657 -march=@var{cpu-type} }
658
659 @emph{PDP-11 Options}
660 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
661 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
662 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
663 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
664 -mbranch-expensive  -mbranch-cheap @gol
665 -msplit  -mno-split  -munix-asm  -mdec-asm}
666
667 @emph{PowerPC Options}
668 See RS/6000 and PowerPC Options.
669
670 @emph{RS/6000 and PowerPC Options}
671 @gccoptlist{-mcpu=@var{cpu-type} @gol
672 -mtune=@var{cpu-type} @gol
673 -mpower  -mno-power  -mpower2  -mno-power2 @gol
674 -mpowerpc  -mpowerpc64  -mno-powerpc @gol
675 -maltivec  -mno-altivec @gol
676 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
677 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
678 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb  -mfprnd  -mno-fprnd @gol
679 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mdfp -mno-dfp @gol
680 -mnew-mnemonics  -mold-mnemonics @gol
681 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
682 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
683 -malign-power  -malign-natural @gol
684 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
685 -mstring  -mno-string  -mupdate  -mno-update @gol
686 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
687 -mstrict-align  -mno-strict-align  -mrelocatable @gol
688 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
689 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
690 -mdynamic-no-pic  -maltivec  -mswdiv @gol
691 -mprioritize-restricted-insns=@var{priority} @gol
692 -msched-costly-dep=@var{dependence_type} @gol
693 -minsert-sched-nops=@var{scheme} @gol
694 -mcall-sysv  -mcall-netbsd @gol
695 -maix-struct-return  -msvr4-struct-return @gol
696 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
697 -misel -mno-isel @gol
698 -misel=yes  -misel=no @gol
699 -mspe -mno-spe @gol
700 -mspe=yes  -mspe=no @gol
701 -mvrsave -mno-vrsave @gol
702 -mmulhw -mno-mulhw @gol
703 -mdlmzb -mno-dlmzb @gol
704 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
705 -mprototype  -mno-prototype @gol
706 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
707 -msdata=@var{opt}  -mvxworks  -mwindiss  -G @var{num}  -pthread}
708
709 @emph{S/390 and zSeries Options}
710 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
711 -mhard-float  -msoft-float -mlong-double-64 -mlong-double-128 @gol
712 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
713 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
714 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
715 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
716 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard}
717
718 @emph{Score Options}
719 @gccoptlist{-meb -mel @gol
720 -mnhwloop @gol
721 -muls @gol
722 -mmac @gol
723 -mscore5 -mscore5u -mscore7 -mscore7d}
724
725 @emph{SH Options}
726 @gccoptlist{-m1  -m2  -m2e  -m3  -m3e @gol
727 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
728 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
729 -m5-64media  -m5-64media-nofpu @gol
730 -m5-32media  -m5-32media-nofpu @gol
731 -m5-compact  -m5-compact-nofpu @gol
732 -mb  -ml  -mdalign  -mrelax @gol
733 -mbigtable  -mfmovd  -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
734 -mieee  -misize  -minline-ic_invalidate -mpadstruct  -mspace @gol
735 -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
736 -mdivsi3_libfunc=@var{name}  @gol
737 -madjust-unroll -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
738  -minvalid-symbols}
739
740 @emph{SPARC Options}
741 @gccoptlist{-mcpu=@var{cpu-type} @gol
742 -mtune=@var{cpu-type} @gol
743 -mcmodel=@var{code-model} @gol
744 -m32  -m64  -mapp-regs  -mno-app-regs @gol
745 -mfaster-structs  -mno-faster-structs @gol
746 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
747 -mhard-quad-float  -msoft-quad-float @gol
748 -mimpure-text  -mno-impure-text  -mlittle-endian @gol
749 -mstack-bias  -mno-stack-bias @gol
750 -munaligned-doubles  -mno-unaligned-doubles @gol
751 -mv8plus  -mno-v8plus  -mvis  -mno-vis
752 -threads -pthreads -pthread}
753
754 @emph{SPU Options}
755 @gccoptlist{-mwarn-reloc -merror-reloc @gol
756 -msafe-dma -munsafe-dma @gol
757 -mbranch-hints @gol
758 -msmall-mem -mlarge-mem -mstdmain @gol
759 -mfixed-range=@var{register-range}}
760
761 @emph{System V Options}
762 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
763
764 @emph{TMS320C3x/C4x Options}
765 @gccoptlist{-mcpu=@var{cpu}  -mbig  -msmall  -mregparm  -mmemparm @gol
766 -mfast-fix  -mmpyi  -mbk  -mti  -mdp-isr-reload @gol
767 -mrpts=@var{count}  -mrptb  -mdb  -mloop-unsigned @gol
768 -mparallel-insns  -mparallel-mpy  -mpreserve-float}
769
770 @emph{V850 Options}
771 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
772 -mprolog-function  -mno-prolog-function  -mspace @gol
773 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
774 -mapp-regs  -mno-app-regs @gol
775 -mdisable-callt  -mno-disable-callt @gol
776 -mv850e1 @gol
777 -mv850e @gol
778 -mv850  -mbig-switch}
779
780 @emph{VAX Options}
781 @gccoptlist{-mg  -mgnu  -munix}
782
783 @emph{VxWorks Options}
784 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
785 -Xbind-lazy  -Xbind-now}
786
787 @emph{x86-64 Options}
788 See i386 and x86-64 Options.
789
790 @emph{Xstormy16 Options}
791 @gccoptlist{-msim}
792
793 @emph{Xtensa Options}
794 @gccoptlist{-mconst16 -mno-const16 @gol
795 -mfused-madd  -mno-fused-madd @gol
796 -mtext-section-literals  -mno-text-section-literals @gol
797 -mtarget-align  -mno-target-align @gol
798 -mlongcalls  -mno-longcalls}
799
800 @emph{zSeries Options}
801 See S/390 and zSeries Options.
802
803 @item Code Generation Options
804 @xref{Code Gen Options,,Options for Code Generation Conventions}.
805 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
806 -ffixed-@var{reg}  -fexceptions @gol
807 -fnon-call-exceptions  -funwind-tables @gol
808 -fasynchronous-unwind-tables @gol
809 -finhibit-size-directive  -finstrument-functions @gol
810 -fno-common  -fno-ident @gol
811 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
812 -fno-jump-tables @gol
813 -frecord-gcc-switches @gol
814 -freg-struct-return  -fshort-enums @gol
815 -fshort-double  -fshort-wchar @gol
816 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
817 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
818 -fargument-alias  -fargument-noalias @gol
819 -fargument-noalias-global  -fargument-noalias-anything
820 -fleading-underscore  -ftls-model=@var{model} @gol
821 -ftrapv  -fwrapv  -fbounds-check @gol
822 -fvisibility}
823 @end table
824
825 @menu
826 * Overall Options::     Controlling the kind of output:
827                         an executable, object files, assembler files,
828                         or preprocessed source.
829 * C Dialect Options::   Controlling the variant of C language compiled.
830 * C++ Dialect Options:: Variations on C++.
831 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
832                         and Objective-C++.
833 * Language Independent Options:: Controlling how diagnostics should be
834                         formatted.
835 * Warning Options::     How picky should the compiler be?
836 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
837 * Optimize Options::    How much optimization?
838 * Preprocessor Options:: Controlling header files and macro definitions.
839                          Also, getting dependency information for Make.
840 * Assembler Options::   Passing options to the assembler.
841 * Link Options::        Specifying libraries and so on.
842 * Directory Options::   Where to find header files and libraries.
843                         Where to find the compiler executable files.
844 * Spec Files::          How to pass switches to sub-processes.
845 * Target Options::      Running a cross-compiler, or an old version of GCC.
846 @end menu
847
848 @node Overall Options
849 @section Options Controlling the Kind of Output
850
851 Compilation can involve up to four stages: preprocessing, compilation
852 proper, assembly and linking, always in that order.  GCC is capable of
853 preprocessing and compiling several files either into several
854 assembler input files, or into one assembler input file; then each
855 assembler input file produces an object file, and linking combines all
856 the object files (those newly compiled, and those specified as input)
857 into an executable file.
858
859 @cindex file name suffix
860 For any given input file, the file name suffix determines what kind of
861 compilation is done:
862
863 @table @gcctabopt
864 @item @var{file}.c
865 C source code which must be preprocessed.
866
867 @item @var{file}.i
868 C source code which should not be preprocessed.
869
870 @item @var{file}.ii
871 C++ source code which should not be preprocessed.
872
873 @item @var{file}.m
874 Objective-C source code.  Note that you must link with the @file{libobjc}
875 library to make an Objective-C program work.
876
877 @item @var{file}.mi
878 Objective-C source code which should not be preprocessed.
879
880 @item @var{file}.mm
881 @itemx @var{file}.M
882 Objective-C++ source code.  Note that you must link with the @file{libobjc}
883 library to make an Objective-C++ program work.  Note that @samp{.M} refers
884 to a literal capital M@.
885
886 @item @var{file}.mii
887 Objective-C++ source code which should not be preprocessed.
888
889 @item @var{file}.h
890 C, C++, Objective-C or Objective-C++ header file to be turned into a
891 precompiled header.
892
893 @item @var{file}.cc
894 @itemx @var{file}.cp
895 @itemx @var{file}.cxx
896 @itemx @var{file}.cpp
897 @itemx @var{file}.CPP
898 @itemx @var{file}.c++
899 @itemx @var{file}.C
900 C++ source code which must be preprocessed.  Note that in @samp{.cxx},
901 the last two letters must both be literally @samp{x}.  Likewise,
902 @samp{.C} refers to a literal capital C@.
903
904 @item @var{file}.mm
905 @itemx @var{file}.M
906 Objective-C++ source code which must be preprocessed.
907
908 @item @var{file}.mii
909 Objective-C++ source code which should not be preprocessed.
910
911 @item @var{file}.hh
912 @itemx @var{file}.H
913 C++ header file to be turned into a precompiled header.
914
915 @item @var{file}.f
916 @itemx @var{file}.for
917 @itemx @var{file}.FOR
918 Fixed form Fortran source code which should not be preprocessed.
919
920 @item @var{file}.F
921 @itemx @var{file}.fpp
922 @itemx @var{file}.FPP
923 Fixed form Fortran source code which must be preprocessed (with the traditional
924 preprocessor).
925
926 @item @var{file}.f90
927 @itemx @var{file}.f95
928 Free form Fortran source code which should not be preprocessed.
929
930 @item @var{file}.F90
931 @itemx @var{file}.F95
932 Free form Fortran source code which must be preprocessed (with the
933 traditional preprocessor).
934
935 @c FIXME: Descriptions of Java file types.
936 @c @var{file}.java
937 @c @var{file}.class
938 @c @var{file}.zip
939 @c @var{file}.jar
940
941 @item @var{file}.ads
942 Ada source code file which contains a library unit declaration (a
943 declaration of a package, subprogram, or generic, or a generic
944 instantiation), or a library unit renaming declaration (a package,
945 generic, or subprogram renaming declaration).  Such files are also
946 called @dfn{specs}.
947
948 @itemx @var{file}.adb
949 Ada source code file containing a library unit body (a subprogram or
950 package body).  Such files are also called @dfn{bodies}.
951
952 @c GCC also knows about some suffixes for languages not yet included:
953 @c Pascal:
954 @c @var{file}.p
955 @c @var{file}.pas
956 @c Ratfor:
957 @c @var{file}.r
958
959 @item @var{file}.s
960 Assembler code.
961
962 @item @var{file}.S
963 Assembler code which must be preprocessed.
964
965 @item @var{other}
966 An object file to be fed straight into linking.
967 Any file name with no recognized suffix is treated this way.
968 @end table
969
970 @opindex x
971 You can specify the input language explicitly with the @option{-x} option:
972
973 @table @gcctabopt
974 @item -x @var{language}
975 Specify explicitly the @var{language} for the following input files
976 (rather than letting the compiler choose a default based on the file
977 name suffix).  This option applies to all following input files until
978 the next @option{-x} option.  Possible values for @var{language} are:
979 @smallexample
980 c  c-header  c-cpp-output
981 c++  c++-header  c++-cpp-output
982 objective-c  objective-c-header  objective-c-cpp-output
983 objective-c++ objective-c++-header objective-c++-cpp-output
984 assembler  assembler-with-cpp
985 ada
986 f95  f95-cpp-input
987 java
988 treelang
989 @end smallexample
990
991 @item -x none
992 Turn off any specification of a language, so that subsequent files are
993 handled according to their file name suffixes (as they are if @option{-x}
994 has not been used at all).
995
996 @item -pass-exit-codes
997 @opindex pass-exit-codes
998 Normally the @command{gcc} program will exit with the code of 1 if any
999 phase of the compiler returns a non-success return code.  If you specify
1000 @option{-pass-exit-codes}, the @command{gcc} program will instead return with
1001 numerically highest error produced by any phase that returned an error
1002 indication.  The C, C++, and Fortran frontends return 4, if an internal
1003 compiler error is encountered.
1004 @end table
1005
1006 If you only want some of the stages of compilation, you can use
1007 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1008 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1009 @command{gcc} is to stop.  Note that some combinations (for example,
1010 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1011
1012 @table @gcctabopt
1013 @item -c
1014 @opindex c
1015 Compile or assemble the source files, but do not link.  The linking
1016 stage simply is not done.  The ultimate output is in the form of an
1017 object file for each source file.
1018
1019 By default, the object file name for a source file is made by replacing
1020 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1021
1022 Unrecognized input files, not requiring compilation or assembly, are
1023 ignored.
1024
1025 @item -S
1026 @opindex S
1027 Stop after the stage of compilation proper; do not assemble.  The output
1028 is in the form of an assembler code file for each non-assembler input
1029 file specified.
1030
1031 By default, the assembler file name for a source file is made by
1032 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1033
1034 Input files that don't require compilation are ignored.
1035
1036 @item -E
1037 @opindex E
1038 Stop after the preprocessing stage; do not run the compiler proper.  The
1039 output is in the form of preprocessed source code, which is sent to the
1040 standard output.
1041
1042 Input files which don't require preprocessing are ignored.
1043
1044 @cindex output file option
1045 @item -o @var{file}
1046 @opindex o
1047 Place output in file @var{file}.  This applies regardless to whatever
1048 sort of output is being produced, whether it be an executable file,
1049 an object file, an assembler file or preprocessed C code.
1050
1051 If @option{-o} is not specified, the default is to put an executable
1052 file in @file{a.out}, the object file for
1053 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1054 assembler file in @file{@var{source}.s}, a precompiled header file in
1055 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1056 standard output.
1057
1058 @item -v
1059 @opindex v
1060 Print (on standard error output) the commands executed to run the stages
1061 of compilation.  Also print the version number of the compiler driver
1062 program and of the preprocessor and the compiler proper.
1063
1064 @item -###
1065 @opindex ###
1066 Like @option{-v} except the commands are not executed and all command
1067 arguments are quoted.  This is useful for shell scripts to capture the
1068 driver-generated command lines.
1069
1070 @item -pipe
1071 @opindex pipe
1072 Use pipes rather than temporary files for communication between the
1073 various stages of compilation.  This fails to work on some systems where
1074 the assembler is unable to read from a pipe; but the GNU assembler has
1075 no trouble.
1076
1077 @item -combine
1078 @opindex combine
1079 If you are compiling multiple source files, this option tells the driver
1080 to pass all the source files to the compiler at once (for those
1081 languages for which the compiler can handle this).  This will allow
1082 intermodule analysis (IMA) to be performed by the compiler.  Currently the only
1083 language for which this is supported is C@.  If you pass source files for
1084 multiple languages to the driver, using this option, the driver will invoke
1085 the compiler(s) that support IMA once each, passing each compiler all the
1086 source files appropriate for it.  For those languages that do not support
1087 IMA this option will be ignored, and the compiler will be invoked once for
1088 each source file in that language.  If you use this option in conjunction
1089 with @option{-save-temps}, the compiler will generate multiple
1090 pre-processed files
1091 (one for each source file), but only one (combined) @file{.o} or
1092 @file{.s} file.
1093
1094 @item --help
1095 @opindex help
1096 Print (on the standard output) a description of the command line options
1097 understood by @command{gcc}.  If the @option{-v} option is also specified
1098 then @option{--help} will also be passed on to the various processes
1099 invoked by @command{gcc}, so that they can display the command line options
1100 they accept.  If the @option{-Wextra} option has also been specified
1101 (prior to the @option{--help} option), then command line options which
1102 have no documentation associated with them will also be displayed.
1103
1104 @item --target-help
1105 @opindex target-help
1106 Print (on the standard output) a description of target-specific command
1107 line options for each tool.
1108
1109 @item --help=@var{class}@r{[},@var{qualifier}@r{]}
1110 Print (on the standard output) a description of the command line
1111 options understood by the compiler that fit into a specific class.
1112 The class can be one of @samp{optimizers}, @samp{warnings}, @samp{target},
1113 @samp{params}, or @var{language}:
1114
1115 @table @asis
1116 @item @samp{optimizers}
1117 This will display all of the optimization options supported by the
1118 compiler.
1119
1120 @item @samp{warnings}
1121 This will display all of the options controlling warning messages
1122 produced by the compiler.
1123
1124 @item @samp{target}
1125 This will display target-specific options.  Unlike the
1126 @option{--target-help} option however, target-specific options of the
1127 linker and assembler will not be displayed.  This is because those
1128 tools do not currently support the extended @option{--help=} syntax.
1129
1130 @item @samp{params}
1131 This will display the values recognized by the @option{--param}
1132 option.
1133
1134 @item @var{language}
1135 This will display the options supported for @var{language}, where 
1136 @var{language} is the name of one of the languages supported in this 
1137 version of GCC.
1138
1139 @item @samp{common}
1140 This will display the options that are common to all languages.
1141 @end table
1142
1143 It is possible to further refine the output of the @option{--help=}
1144 option by adding a comma separated list of qualifiers after the
1145 class.  These can be any from the following list:
1146
1147 @table @asis
1148 @item @samp{undocumented}
1149 Display only those options which are undocumented.
1150
1151 @item @samp{joined}
1152 Display options which take an argument that appears after an equal
1153 sign in the same continuous piece of text, such as:
1154 @samp{--help=target}.
1155
1156 @item @samp{separate}
1157 Display options which take an argument that appears as a separate word
1158 following the original option, such as: @samp{-o output-file}.
1159 @end table
1160
1161 Thus for example to display all the undocumented target-specific
1162 switches supported by the compiler the following can be used:
1163
1164 @smallexample
1165 --help=target,undocumented
1166 @end smallexample
1167
1168 The sense of a qualifier can be inverted by prefixing it with the
1169 @var{^} character, so for example to display all binary warning
1170 options (i.e. ones that are either on or off and that do not take an
1171 argument), which have a description the following can be used:
1172
1173 @smallexample
1174 --help=warnings,^joined,^undocumented
1175 @end smallexample
1176
1177 A class can also be used as a qualifier, although this usually
1178 restricts the output by so much that there is nothing to display.  One
1179 case where it does work however is when one of the classes is
1180 @var{target}.  So for example to display all the target-specific
1181 optimization options the following can be used:
1182
1183 @smallexample
1184 --help=target,optimizers
1185 @end smallexample
1186
1187 The @option{--help=} option can be repeated on the command line.  Each
1188 successive use will display its requested class of options, skipping
1189 those that have already been displayed.
1190
1191 If the @option{-Q} option appears on the command line before the
1192 @option{--help=} option, then the descriptive text displayed by
1193 @option{--help=} is changed.  Instead of describing the displayed
1194 options, an indication is given as to whether the option is enabled,
1195 disabled or set to a specific value (assuming that the compiler
1196 knows this at the point where the @option{--help=} option is used).
1197
1198 Here is a truncated example from the ARM port of @command{gcc}:
1199
1200 @smallexample
1201   % gcc -Q -mabi=2 --help=target -c
1202   The following options are target specific:
1203   -mabi=                                2
1204   -mabort-on-noreturn                   [disabled]
1205   -mapcs                                [disabled]
1206 @end smallexample
1207
1208 The output is sensitive to the effects of previous command line
1209 options, so for example it is possible to find out which optimizations
1210 are enabled at @option{-O2} by using:
1211
1212 @smallexample
1213 -O2 --help=optimizers
1214 @end smallexample
1215
1216 Alternatively you can discover which binary optimizations are enabled
1217 by @option{-O3} by using:
1218
1219 @smallexample
1220 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1221 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1222 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1223 @end smallexample
1224
1225 @item --version
1226 @opindex version
1227 Display the version number and copyrights of the invoked GCC@.
1228
1229 @include @value{srcdir}/../libiberty/at-file.texi
1230 @end table
1231
1232 @node Invoking G++
1233 @section Compiling C++ Programs
1234
1235 @cindex suffixes for C++ source
1236 @cindex C++ source file suffixes
1237 C++ source files conventionally use one of the suffixes @samp{.C},
1238 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1239 @samp{.cxx}; C++ header files often use @samp{.hh} or @samp{.H}; and
1240 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1241 files with these names and compiles them as C++ programs even if you
1242 call the compiler the same way as for compiling C programs (usually
1243 with the name @command{gcc}).
1244
1245 @findex g++
1246 @findex c++
1247 However, the use of @command{gcc} does not add the C++ library.
1248 @command{g++} is a program that calls GCC and treats @samp{.c},
1249 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1250 files unless @option{-x} is used, and automatically specifies linking
1251 against the C++ library.  This program is also useful when
1252 precompiling a C header file with a @samp{.h} extension for use in C++
1253 compilations.  On many systems, @command{g++} is also installed with
1254 the name @command{c++}.
1255
1256 @cindex invoking @command{g++}
1257 When you compile C++ programs, you may specify many of the same
1258 command-line options that you use for compiling programs in any
1259 language; or command-line options meaningful for C and related
1260 languages; or options that are meaningful only for C++ programs.
1261 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1262 explanations of options for languages related to C@.
1263 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1264 explanations of options that are meaningful only for C++ programs.
1265
1266 @node C Dialect Options
1267 @section Options Controlling C Dialect
1268 @cindex dialect options
1269 @cindex language dialect options
1270 @cindex options, dialect
1271
1272 The following options control the dialect of C (or languages derived
1273 from C, such as C++, Objective-C and Objective-C++) that the compiler
1274 accepts:
1275
1276 @table @gcctabopt
1277 @cindex ANSI support
1278 @cindex ISO support
1279 @item -ansi
1280 @opindex ansi
1281 In C mode, support all ISO C90 programs.  In C++ mode,
1282 remove GNU extensions that conflict with ISO C++.
1283
1284 This turns off certain features of GCC that are incompatible with ISO
1285 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1286 such as the @code{asm} and @code{typeof} keywords, and
1287 predefined macros such as @code{unix} and @code{vax} that identify the
1288 type of system you are using.  It also enables the undesirable and
1289 rarely used ISO trigraph feature.  For the C compiler,
1290 it disables recognition of C++ style @samp{//} comments as well as
1291 the @code{inline} keyword.
1292
1293 The alternate keywords @code{__asm__}, @code{__extension__},
1294 @code{__inline__} and @code{__typeof__} continue to work despite
1295 @option{-ansi}.  You would not want to use them in an ISO C program, of
1296 course, but it is useful to put them in header files that might be included
1297 in compilations done with @option{-ansi}.  Alternate predefined macros
1298 such as @code{__unix__} and @code{__vax__} are also available, with or
1299 without @option{-ansi}.
1300
1301 The @option{-ansi} option does not cause non-ISO programs to be
1302 rejected gratuitously.  For that, @option{-pedantic} is required in
1303 addition to @option{-ansi}.  @xref{Warning Options}.
1304
1305 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1306 option is used.  Some header files may notice this macro and refrain
1307 from declaring certain functions or defining certain macros that the
1308 ISO standard doesn't call for; this is to avoid interfering with any
1309 programs that might use these names for other things.
1310
1311 Functions which would normally be built in but do not have semantics
1312 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1313 functions with @option{-ansi} is used.  @xref{Other Builtins,,Other
1314 built-in functions provided by GCC}, for details of the functions
1315 affected.
1316
1317 @item -std=
1318 @opindex std
1319 Determine the language standard.  This option is currently only
1320 supported when compiling C or C++.  A value for this option must be
1321 provided; possible values are
1322
1323 @table @samp
1324 @item c89
1325 @itemx iso9899:1990
1326 ISO C90 (same as @option{-ansi}).
1327
1328 @item iso9899:199409
1329 ISO C90 as modified in amendment 1.
1330
1331 @item c99
1332 @itemx c9x
1333 @itemx iso9899:1999
1334 @itemx iso9899:199x
1335 ISO C99.  Note that this standard is not yet fully supported; see
1336 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1337 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1338
1339 @item gnu89
1340 Default, ISO C90 plus GNU extensions (including some C99 features).
1341
1342 @item gnu99
1343 @itemx gnu9x
1344 ISO C99 plus GNU extensions.  When ISO C99 is fully implemented in GCC,
1345 this will become the default.  The name @samp{gnu9x} is deprecated.
1346
1347 @item c++98
1348 The 1998 ISO C++ standard plus amendments.
1349
1350 @item gnu++98
1351 The same as @option{-std=c++98} plus GNU extensions.  This is the
1352 default for C++ code.
1353
1354 @item c++0x
1355 The working draft of the upcoming ISO C++0x standard. This option
1356 enables experimental features that are likely to be included in
1357 C++0x. The working draft is constantly changing, and any feature that is
1358 enabled by this flag may be removed from future versions of GCC if it is
1359 not part of the C++0x standard.
1360
1361 @item gnu++0x
1362 The same as @option{-std=c++0x} plus GNU extensions. As with
1363 @option{-std=c++0x}, this option enables experimental features that may
1364 be removed in future versions of GCC.
1365 @end table
1366
1367 Even when this option is not specified, you can still use some of the
1368 features of newer standards in so far as they do not conflict with
1369 previous C standards.  For example, you may use @code{__restrict__} even
1370 when @option{-std=c99} is not specified.
1371
1372 The @option{-std} options specifying some version of ISO C have the same
1373 effects as @option{-ansi}, except that features that were not in ISO C90
1374 but are in the specified version (for example, @samp{//} comments and
1375 the @code{inline} keyword in ISO C99) are not disabled.
1376
1377 @xref{Standards,,Language Standards Supported by GCC}, for details of
1378 these standard versions.
1379
1380 @item -fgnu89-inline
1381 @opindex fgnu89-inline
1382 The option @option{-fgnu89-inline} tells GCC to use the traditional
1383 GNU semantics for @code{inline} functions when in C99 mode.
1384 @xref{Inline,,An Inline Function is As Fast As a Macro}.  This option
1385 is accepted and ignored by GCC versions 4.1.3 up to but not including
1386 4.3.  In GCC versions 4.3 and later it changes the behavior of GCC in
1387 C99 mode.  Using this option is roughly equivalent to adding the
1388 @code{gnu_inline} function attribute to all inline functions
1389 (@pxref{Function Attributes}).
1390
1391 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1392 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1393 specifies the default behavior).  This option was first supported in
1394 GCC 4.3.  This option is not supported in C89 or gnu89 mode.
1395
1396 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1397 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1398 in effect for @code{inline} functions.  @xref{Common Predefined
1399 Macros,,,cpp,The C Preprocessor}.
1400
1401 @item -aux-info @var{filename}
1402 @opindex aux-info
1403 Output to the given filename prototyped declarations for all functions
1404 declared and/or defined in a translation unit, including those in header
1405 files.  This option is silently ignored in any language other than C@.
1406
1407 Besides declarations, the file indicates, in comments, the origin of
1408 each declaration (source file and line), whether the declaration was
1409 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1410 @samp{O} for old, respectively, in the first character after the line
1411 number and the colon), and whether it came from a declaration or a
1412 definition (@samp{C} or @samp{F}, respectively, in the following
1413 character).  In the case of function definitions, a K&R-style list of
1414 arguments followed by their declarations is also provided, inside
1415 comments, after the declaration.
1416
1417 @item -fno-asm
1418 @opindex fno-asm
1419 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1420 keyword, so that code can use these words as identifiers.  You can use
1421 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1422 instead.  @option{-ansi} implies @option{-fno-asm}.
1423
1424 In C++, this switch only affects the @code{typeof} keyword, since
1425 @code{asm} and @code{inline} are standard keywords.  You may want to
1426 use the @option{-fno-gnu-keywords} flag instead, which has the same
1427 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1428 switch only affects the @code{asm} and @code{typeof} keywords, since
1429 @code{inline} is a standard keyword in ISO C99.
1430
1431 @item -fno-builtin
1432 @itemx -fno-builtin-@var{function}
1433 @opindex fno-builtin
1434 @cindex built-in functions
1435 Don't recognize built-in functions that do not begin with
1436 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1437 functions provided by GCC}, for details of the functions affected,
1438 including those which are not built-in functions when @option{-ansi} or
1439 @option{-std} options for strict ISO C conformance are used because they
1440 do not have an ISO standard meaning.
1441
1442 GCC normally generates special code to handle certain built-in functions
1443 more efficiently; for instance, calls to @code{alloca} may become single
1444 instructions that adjust the stack directly, and calls to @code{memcpy}
1445 may become inline copy loops.  The resulting code is often both smaller
1446 and faster, but since the function calls no longer appear as such, you
1447 cannot set a breakpoint on those calls, nor can you change the behavior
1448 of the functions by linking with a different library.  In addition,
1449 when a function is recognized as a built-in function, GCC may use
1450 information about that function to warn about problems with calls to
1451 that function, or to generate more efficient code, even if the
1452 resulting code still contains calls to that function.  For example,
1453 warnings are given with @option{-Wformat} for bad calls to
1454 @code{printf}, when @code{printf} is built in, and @code{strlen} is
1455 known not to modify global memory.
1456
1457 With the @option{-fno-builtin-@var{function}} option
1458 only the built-in function @var{function} is
1459 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1460 function is named this is not built-in in this version of GCC, this
1461 option is ignored.  There is no corresponding
1462 @option{-fbuiltin-@var{function}} option; if you wish to enable
1463 built-in functions selectively when using @option{-fno-builtin} or
1464 @option{-ffreestanding}, you may define macros such as:
1465
1466 @smallexample
1467 #define abs(n)          __builtin_abs ((n))
1468 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1469 @end smallexample
1470
1471 @item -fhosted
1472 @opindex fhosted
1473 @cindex hosted environment
1474
1475 Assert that compilation takes place in a hosted environment.  This implies
1476 @option{-fbuiltin}.  A hosted environment is one in which the
1477 entire standard library is available, and in which @code{main} has a return
1478 type of @code{int}.  Examples are nearly everything except a kernel.
1479 This is equivalent to @option{-fno-freestanding}.
1480
1481 @item -ffreestanding
1482 @opindex ffreestanding
1483 @cindex hosted environment
1484
1485 Assert that compilation takes place in a freestanding environment.  This
1486 implies @option{-fno-builtin}.  A freestanding environment
1487 is one in which the standard library may not exist, and program startup may
1488 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1489 This is equivalent to @option{-fno-hosted}.
1490
1491 @xref{Standards,,Language Standards Supported by GCC}, for details of
1492 freestanding and hosted environments.
1493
1494 @item -fopenmp
1495 @opindex fopenmp
1496 @cindex openmp parallel
1497 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1498 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1499 compiler generates parallel code according to the OpenMP Application
1500 Program Interface v2.5 @w{@uref{http://www.openmp.org/}}.
1501
1502 @item -fms-extensions
1503 @opindex fms-extensions
1504 Accept some non-standard constructs used in Microsoft header files.
1505
1506 Some cases of unnamed fields in structures and unions are only
1507 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1508 fields within structs/unions}, for details.
1509
1510 @item -trigraphs
1511 @opindex trigraphs
1512 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1513 options for strict ISO C conformance) implies @option{-trigraphs}.
1514
1515 @item -no-integrated-cpp
1516 @opindex no-integrated-cpp
1517 Performs a compilation in two passes: preprocessing and compiling.  This
1518 option allows a user supplied "cc1", "cc1plus", or "cc1obj" via the
1519 @option{-B} option.  The user supplied compilation step can then add in
1520 an additional preprocessing step after normal preprocessing but before
1521 compiling.  The default is to use the integrated cpp (internal cpp)
1522
1523 The semantics of this option will change if "cc1", "cc1plus", and
1524 "cc1obj" are merged.
1525
1526 @cindex traditional C language
1527 @cindex C language, traditional
1528 @item -traditional
1529 @itemx -traditional-cpp
1530 @opindex traditional-cpp
1531 @opindex traditional
1532 Formerly, these options caused GCC to attempt to emulate a pre-standard
1533 C compiler.  They are now only supported with the @option{-E} switch.
1534 The preprocessor continues to support a pre-standard mode.  See the GNU
1535 CPP manual for details.
1536
1537 @item -fcond-mismatch
1538 @opindex fcond-mismatch
1539 Allow conditional expressions with mismatched types in the second and
1540 third arguments.  The value of such an expression is void.  This option
1541 is not supported for C++.
1542
1543 @item -flax-vector-conversions
1544 @opindex flax-vector-conversions
1545 Allow implicit conversions between vectors with differing numbers of
1546 elements and/or incompatible element types.  This option should not be
1547 used for new code.
1548
1549 @item -funsigned-char
1550 @opindex funsigned-char
1551 Let the type @code{char} be unsigned, like @code{unsigned char}.
1552
1553 Each kind of machine has a default for what @code{char} should
1554 be.  It is either like @code{unsigned char} by default or like
1555 @code{signed char} by default.
1556
1557 Ideally, a portable program should always use @code{signed char} or
1558 @code{unsigned char} when it depends on the signedness of an object.
1559 But many programs have been written to use plain @code{char} and
1560 expect it to be signed, or expect it to be unsigned, depending on the
1561 machines they were written for.  This option, and its inverse, let you
1562 make such a program work with the opposite default.
1563
1564 The type @code{char} is always a distinct type from each of
1565 @code{signed char} or @code{unsigned char}, even though its behavior
1566 is always just like one of those two.
1567
1568 @item -fsigned-char
1569 @opindex fsigned-char
1570 Let the type @code{char} be signed, like @code{signed char}.
1571
1572 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1573 the negative form of @option{-funsigned-char}.  Likewise, the option
1574 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1575
1576 @item -fsigned-bitfields
1577 @itemx -funsigned-bitfields
1578 @itemx -fno-signed-bitfields
1579 @itemx -fno-unsigned-bitfields
1580 @opindex fsigned-bitfields
1581 @opindex funsigned-bitfields
1582 @opindex fno-signed-bitfields
1583 @opindex fno-unsigned-bitfields
1584 These options control whether a bit-field is signed or unsigned, when the
1585 declaration does not use either @code{signed} or @code{unsigned}.  By
1586 default, such a bit-field is signed, because this is consistent: the
1587 basic integer types such as @code{int} are signed types.
1588 @end table
1589
1590 @node C++ Dialect Options
1591 @section Options Controlling C++ Dialect
1592
1593 @cindex compiler options, C++
1594 @cindex C++ options, command line
1595 @cindex options, C++
1596 This section describes the command-line options that are only meaningful
1597 for C++ programs; but you can also use most of the GNU compiler options
1598 regardless of what language your program is in.  For example, you
1599 might compile a file @code{firstClass.C} like this:
1600
1601 @smallexample
1602 g++ -g -frepo -O -c firstClass.C
1603 @end smallexample
1604
1605 @noindent
1606 In this example, only @option{-frepo} is an option meant
1607 only for C++ programs; you can use the other options with any
1608 language supported by GCC@.
1609
1610 Here is a list of options that are @emph{only} for compiling C++ programs:
1611
1612 @table @gcctabopt
1613
1614 @item -fabi-version=@var{n}
1615 @opindex fabi-version
1616 Use version @var{n} of the C++ ABI@.  Version 2 is the version of the
1617 C++ ABI that first appeared in G++ 3.4.  Version 1 is the version of
1618 the C++ ABI that first appeared in G++ 3.2.  Version 0 will always be
1619 the version that conforms most closely to the C++ ABI specification.
1620 Therefore, the ABI obtained using version 0 will change as ABI bugs
1621 are fixed.
1622
1623 The default is version 2.
1624
1625 @item -fno-access-control
1626 @opindex fno-access-control
1627 Turn off all access checking.  This switch is mainly useful for working
1628 around bugs in the access control code.
1629
1630 @item -fcheck-new
1631 @opindex fcheck-new
1632 Check that the pointer returned by @code{operator new} is non-null
1633 before attempting to modify the storage allocated.  This check is
1634 normally unnecessary because the C++ standard specifies that
1635 @code{operator new} will only return @code{0} if it is declared
1636 @samp{throw()}, in which case the compiler will always check the
1637 return value even without this option.  In all other cases, when
1638 @code{operator new} has a non-empty exception specification, memory
1639 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
1640 @samp{new (nothrow)}.
1641
1642 @item -fconserve-space
1643 @opindex fconserve-space
1644 Put uninitialized or runtime-initialized global variables into the
1645 common segment, as C does.  This saves space in the executable at the
1646 cost of not diagnosing duplicate definitions.  If you compile with this
1647 flag and your program mysteriously crashes after @code{main()} has
1648 completed, you may have an object that is being destroyed twice because
1649 two definitions were merged.
1650
1651 This option is no longer useful on most targets, now that support has
1652 been added for putting variables into BSS without making them common.
1653
1654 @item -ffriend-injection
1655 @opindex ffriend-injection
1656 Inject friend functions into the enclosing namespace, so that they are
1657 visible outside the scope of the class in which they are declared.
1658 Friend functions were documented to work this way in the old Annotated
1659 C++ Reference Manual, and versions of G++ before 4.1 always worked
1660 that way.  However, in ISO C++ a friend function which is not declared
1661 in an enclosing scope can only be found using argument dependent
1662 lookup.  This option causes friends to be injected as they were in
1663 earlier releases.
1664
1665 This option is for compatibility, and may be removed in a future
1666 release of G++.
1667
1668 @item -fno-elide-constructors
1669 @opindex fno-elide-constructors
1670 The C++ standard allows an implementation to omit creating a temporary
1671 which is only used to initialize another object of the same type.
1672 Specifying this option disables that optimization, and forces G++ to
1673 call the copy constructor in all cases.
1674
1675 @item -fno-enforce-eh-specs
1676 @opindex fno-enforce-eh-specs
1677 Don't generate code to check for violation of exception specifications
1678 at runtime.  This option violates the C++ standard, but may be useful
1679 for reducing code size in production builds, much like defining
1680 @samp{NDEBUG}.  This does not give user code permission to throw
1681 exceptions in violation of the exception specifications; the compiler
1682 will still optimize based on the specifications, so throwing an
1683 unexpected exception will result in undefined behavior.
1684
1685 @item -ffor-scope
1686 @itemx -fno-for-scope
1687 @opindex ffor-scope
1688 @opindex fno-for-scope
1689 If @option{-ffor-scope} is specified, the scope of variables declared in
1690 a @i{for-init-statement} is limited to the @samp{for} loop itself,
1691 as specified by the C++ standard.
1692 If @option{-fno-for-scope} is specified, the scope of variables declared in
1693 a @i{for-init-statement} extends to the end of the enclosing scope,
1694 as was the case in old versions of G++, and other (traditional)
1695 implementations of C++.
1696
1697 The default if neither flag is given to follow the standard,
1698 but to allow and give a warning for old-style code that would
1699 otherwise be invalid, or have different behavior.
1700
1701 @item -fno-gnu-keywords
1702 @opindex fno-gnu-keywords
1703 Do not recognize @code{typeof} as a keyword, so that code can use this
1704 word as an identifier.  You can use the keyword @code{__typeof__} instead.
1705 @option{-ansi} implies @option{-fno-gnu-keywords}.
1706
1707 @item -fno-implicit-templates
1708 @opindex fno-implicit-templates
1709 Never emit code for non-inline templates which are instantiated
1710 implicitly (i.e.@: by use); only emit code for explicit instantiations.
1711 @xref{Template Instantiation}, for more information.
1712
1713 @item -fno-implicit-inline-templates
1714 @opindex fno-implicit-inline-templates
1715 Don't emit code for implicit instantiations of inline templates, either.
1716 The default is to handle inlines differently so that compiles with and
1717 without optimization will need the same set of explicit instantiations.
1718
1719 @item -fno-implement-inlines
1720 @opindex fno-implement-inlines
1721 To save space, do not emit out-of-line copies of inline functions
1722 controlled by @samp{#pragma implementation}.  This will cause linker
1723 errors if these functions are not inlined everywhere they are called.
1724
1725 @item -fms-extensions
1726 @opindex fms-extensions
1727 Disable pedantic warnings about constructs used in MFC, such as implicit
1728 int and getting a pointer to member function via non-standard syntax.
1729
1730 @item -fno-nonansi-builtins
1731 @opindex fno-nonansi-builtins
1732 Disable built-in declarations of functions that are not mandated by
1733 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
1734 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
1735
1736 @item -fno-operator-names
1737 @opindex fno-operator-names
1738 Do not treat the operator name keywords @code{and}, @code{bitand},
1739 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
1740 synonyms as keywords.
1741
1742 @item -fno-optional-diags
1743 @opindex fno-optional-diags
1744 Disable diagnostics that the standard says a compiler does not need to
1745 issue.  Currently, the only such diagnostic issued by G++ is the one for
1746 a name having multiple meanings within a class.
1747
1748 @item -fpermissive
1749 @opindex fpermissive
1750 Downgrade some diagnostics about nonconformant code from errors to
1751 warnings.  Thus, using @option{-fpermissive} will allow some
1752 nonconforming code to compile.
1753
1754 @item -frepo
1755 @opindex frepo
1756 Enable automatic template instantiation at link time.  This option also
1757 implies @option{-fno-implicit-templates}.  @xref{Template
1758 Instantiation}, for more information.
1759
1760 @item -fno-rtti
1761 @opindex fno-rtti
1762 Disable generation of information about every class with virtual
1763 functions for use by the C++ runtime type identification features
1764 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
1765 of the language, you can save some space by using this flag.  Note that
1766 exception handling uses the same information, but it will generate it as
1767 needed. The @samp{dynamic_cast} operator can still be used for casts that
1768 do not require runtime type information, i.e. casts to @code{void *} or to
1769 unambiguous base classes.
1770
1771 @item -fstats
1772 @opindex fstats
1773 Emit statistics about front-end processing at the end of the compilation.
1774 This information is generally only useful to the G++ development team.
1775
1776 @item -ftemplate-depth-@var{n}
1777 @opindex ftemplate-depth
1778 Set the maximum instantiation depth for template classes to @var{n}.
1779 A limit on the template instantiation depth is needed to detect
1780 endless recursions during template class instantiation.  ANSI/ISO C++
1781 conforming programs must not rely on a maximum depth greater than 17.
1782
1783 @item -fno-threadsafe-statics
1784 @opindex fno-threadsafe-statics
1785 Do not emit the extra code to use the routines specified in the C++
1786 ABI for thread-safe initialization of local statics.  You can use this
1787 option to reduce code size slightly in code that doesn't need to be
1788 thread-safe.
1789
1790 @item -fuse-cxa-atexit
1791 @opindex fuse-cxa-atexit
1792 Register destructors for objects with static storage duration with the
1793 @code{__cxa_atexit} function rather than the @code{atexit} function.
1794 This option is required for fully standards-compliant handling of static
1795 destructors, but will only work if your C library supports
1796 @code{__cxa_atexit}.
1797
1798 @item -fno-use-cxa-get-exception-ptr
1799 @opindex fno-use-cxa-get-exception-ptr
1800 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
1801 will cause @code{std::uncaught_exception} to be incorrect, but is necessary
1802 if the runtime routine is not available.
1803
1804 @item -fvisibility-inlines-hidden
1805 @opindex fvisibility-inlines-hidden
1806 This switch declares that the user does not attempt to compare
1807 pointers to inline methods where the addresses of the two functions
1808 were taken in different shared objects.
1809
1810 The effect of this is that GCC may, effectively, mark inline methods with
1811 @code{__attribute__ ((visibility ("hidden")))} so that they do not
1812 appear in the export table of a DSO and do not require a PLT indirection
1813 when used within the DSO@.  Enabling this option can have a dramatic effect
1814 on load and link times of a DSO as it massively reduces the size of the
1815 dynamic export table when the library makes heavy use of templates.
1816
1817 The behavior of this switch is not quite the same as marking the
1818 methods as hidden directly, because it does not affect static variables
1819 local to the function or cause the compiler to deduce that
1820 the function is defined in only one shared object.
1821
1822 You may mark a method as having a visibility explicitly to negate the
1823 effect of the switch for that method.  For example, if you do want to
1824 compare pointers to a particular inline method, you might mark it as
1825 having default visibility.  Marking the enclosing class with explicit
1826 visibility will have no effect.
1827
1828 Explicitly instantiated inline methods are unaffected by this option
1829 as their linkage might otherwise cross a shared library boundary.
1830 @xref{Template Instantiation}.
1831
1832 @item -fno-weak
1833 @opindex fno-weak
1834 Do not use weak symbol support, even if it is provided by the linker.
1835 By default, G++ will use weak symbols if they are available.  This
1836 option exists only for testing, and should not be used by end-users;
1837 it will result in inferior code and has no benefits.  This option may
1838 be removed in a future release of G++.
1839
1840 @item -nostdinc++
1841 @opindex nostdinc++
1842 Do not search for header files in the standard directories specific to
1843 C++, but do still search the other standard directories.  (This option
1844 is used when building the C++ library.)
1845 @end table
1846
1847 In addition, these optimization, warning, and code generation options
1848 have meanings only for C++ programs:
1849
1850 @table @gcctabopt
1851 @item -fno-default-inline
1852 @opindex fno-default-inline
1853 Do not assume @samp{inline} for functions defined inside a class scope.
1854 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
1855 functions will have linkage like inline functions; they just won't be
1856 inlined by default.
1857
1858 @item -Wabi @r{(C++ only)}
1859 @opindex Wabi
1860 Warn when G++ generates code that is probably not compatible with the
1861 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
1862 all such cases, there are probably some cases that are not warned about,
1863 even though G++ is generating incompatible code.  There may also be
1864 cases where warnings are emitted even though the code that is generated
1865 will be compatible.
1866
1867 You should rewrite your code to avoid these warnings if you are
1868 concerned about the fact that code generated by G++ may not be binary
1869 compatible with code generated by other compilers.
1870
1871 The known incompatibilities at this point include:
1872
1873 @itemize @bullet
1874
1875 @item
1876 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
1877 pack data into the same byte as a base class.  For example:
1878
1879 @smallexample
1880 struct A @{ virtual void f(); int f1 : 1; @};
1881 struct B : public A @{ int f2 : 1; @};
1882 @end smallexample
1883
1884 @noindent
1885 In this case, G++ will place @code{B::f2} into the same byte
1886 as@code{A::f1}; other compilers will not.  You can avoid this problem
1887 by explicitly padding @code{A} so that its size is a multiple of the
1888 byte size on your platform; that will cause G++ and other compilers to
1889 layout @code{B} identically.
1890
1891 @item
1892 Incorrect handling of tail-padding for virtual bases.  G++ does not use
1893 tail padding when laying out virtual bases.  For example:
1894
1895 @smallexample
1896 struct A @{ virtual void f(); char c1; @};
1897 struct B @{ B(); char c2; @};
1898 struct C : public A, public virtual B @{@};
1899 @end smallexample
1900
1901 @noindent
1902 In this case, G++ will not place @code{B} into the tail-padding for
1903 @code{A}; other compilers will.  You can avoid this problem by
1904 explicitly padding @code{A} so that its size is a multiple of its
1905 alignment (ignoring virtual base classes); that will cause G++ and other
1906 compilers to layout @code{C} identically.
1907
1908 @item
1909 Incorrect handling of bit-fields with declared widths greater than that
1910 of their underlying types, when the bit-fields appear in a union.  For
1911 example:
1912
1913 @smallexample
1914 union U @{ int i : 4096; @};
1915 @end smallexample
1916
1917 @noindent
1918 Assuming that an @code{int} does not have 4096 bits, G++ will make the
1919 union too small by the number of bits in an @code{int}.
1920
1921 @item
1922 Empty classes can be placed at incorrect offsets.  For example:
1923
1924 @smallexample
1925 struct A @{@};
1926
1927 struct B @{
1928   A a;
1929   virtual void f ();
1930 @};
1931
1932 struct C : public B, public A @{@};
1933 @end smallexample
1934
1935 @noindent
1936 G++ will place the @code{A} base class of @code{C} at a nonzero offset;
1937 it should be placed at offset zero.  G++ mistakenly believes that the
1938 @code{A} data member of @code{B} is already at offset zero.
1939
1940 @item
1941 Names of template functions whose types involve @code{typename} or
1942 template template parameters can be mangled incorrectly.
1943
1944 @smallexample
1945 template <typename Q>
1946 void f(typename Q::X) @{@}
1947
1948 template <template <typename> class Q>
1949 void f(typename Q<int>::X) @{@}
1950 @end smallexample
1951
1952 @noindent
1953 Instantiations of these templates may be mangled incorrectly.
1954
1955 @end itemize
1956
1957 @item -Wctor-dtor-privacy @r{(C++ only)}
1958 @opindex Wctor-dtor-privacy
1959 Warn when a class seems unusable because all the constructors or
1960 destructors in that class are private, and it has neither friends nor
1961 public static member functions.
1962
1963 @item -Wnon-virtual-dtor @r{(C++ only)}
1964 @opindex Wnon-virtual-dtor
1965 Warn when a class appears to be polymorphic, thereby requiring a virtual
1966 destructor, yet it declares a non-virtual one.  This warning is also
1967 enabled if -Weffc++ is specified.
1968
1969 @item -Wreorder @r{(C++ only)}
1970 @opindex Wreorder
1971 @cindex reordering, warning
1972 @cindex warning for reordering of member initializers
1973 Warn when the order of member initializers given in the code does not
1974 match the order in which they must be executed.  For instance:
1975
1976 @smallexample
1977 struct A @{
1978   int i;
1979   int j;
1980   A(): j (0), i (1) @{ @}
1981 @};
1982 @end smallexample
1983
1984 The compiler will rearrange the member initializers for @samp{i}
1985 and @samp{j} to match the declaration order of the members, emitting
1986 a warning to that effect.  This warning is enabled by @option{-Wall}.
1987 @end table
1988
1989 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
1990
1991 @table @gcctabopt
1992 @item -Weffc++ @r{(C++ only)}
1993 @opindex Weffc++
1994 Warn about violations of the following style guidelines from Scott Meyers'
1995 @cite{Effective C++} book:
1996
1997 @itemize @bullet
1998 @item
1999 Item 11:  Define a copy constructor and an assignment operator for classes
2000 with dynamically allocated memory.
2001
2002 @item
2003 Item 12:  Prefer initialization to assignment in constructors.
2004
2005 @item
2006 Item 14:  Make destructors virtual in base classes.
2007
2008 @item
2009 Item 15:  Have @code{operator=} return a reference to @code{*this}.
2010
2011 @item
2012 Item 23:  Don't try to return a reference when you must return an object.
2013
2014 @end itemize
2015
2016 Also warn about violations of the following style guidelines from
2017 Scott Meyers' @cite{More Effective C++} book:
2018
2019 @itemize @bullet
2020 @item
2021 Item 6:  Distinguish between prefix and postfix forms of increment and
2022 decrement operators.
2023
2024 @item
2025 Item 7:  Never overload @code{&&}, @code{||}, or @code{,}.
2026
2027 @end itemize
2028
2029 When selecting this option, be aware that the standard library
2030 headers do not obey all of these guidelines; use @samp{grep -v}
2031 to filter out those warnings.
2032
2033 @item -Wno-deprecated @r{(C++ only)}
2034 @opindex Wno-deprecated
2035 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
2036
2037 @item -Wstrict-null-sentinel @r{(C++ only)}
2038 @opindex Wstrict-null-sentinel
2039 Warn also about the use of an uncasted @code{NULL} as sentinel.  When
2040 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2041 to @code{__null}.  Although it is a null pointer constant not a null pointer,
2042 it is guaranteed to of the same size as a pointer.  But this use is
2043 not portable across different compilers.
2044
2045 @item -Wno-non-template-friend @r{(C++ only)}
2046 @opindex Wno-non-template-friend
2047 Disable warnings when non-templatized friend functions are declared
2048 within a template.  Since the advent of explicit template specification
2049 support in G++, if the name of the friend is an unqualified-id (i.e.,
2050 @samp{friend foo(int)}), the C++ language specification demands that the
2051 friend declare or define an ordinary, nontemplate function.  (Section
2052 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2053 could be interpreted as a particular specialization of a templatized
2054 function.  Because this non-conforming behavior is no longer the default
2055 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2056 check existing code for potential trouble spots and is on by default.
2057 This new compiler behavior can be turned off with
2058 @option{-Wno-non-template-friend} which keeps the conformant compiler code
2059 but disables the helpful warning.
2060
2061 @item -Wold-style-cast @r{(C++ only)}
2062 @opindex Wold-style-cast
2063 Warn if an old-style (C-style) cast to a non-void type is used within
2064 a C++ program.  The new-style casts (@samp{dynamic_cast},
2065 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
2066 less vulnerable to unintended effects and much easier to search for.
2067
2068 @item -Woverloaded-virtual @r{(C++ only)}
2069 @opindex Woverloaded-virtual
2070 @cindex overloaded virtual fn, warning
2071 @cindex warning for overloaded virtual fn
2072 Warn when a function declaration hides virtual functions from a
2073 base class.  For example, in:
2074
2075 @smallexample
2076 struct A @{
2077   virtual void f();
2078 @};
2079
2080 struct B: public A @{
2081   void f(int);
2082 @};
2083 @end smallexample
2084
2085 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2086 like:
2087
2088 @smallexample
2089 B* b;
2090 b->f();
2091 @end smallexample
2092
2093 will fail to compile.
2094
2095 @item -Wno-pmf-conversions @r{(C++ only)}
2096 @opindex Wno-pmf-conversions
2097 Disable the diagnostic for converting a bound pointer to member function
2098 to a plain pointer.
2099
2100 @item -Wsign-promo @r{(C++ only)}
2101 @opindex Wsign-promo
2102 Warn when overload resolution chooses a promotion from unsigned or
2103 enumerated type to a signed type, over a conversion to an unsigned type of
2104 the same size.  Previous versions of G++ would try to preserve
2105 unsignedness, but the standard mandates the current behavior.
2106
2107 @smallexample
2108 struct A @{
2109   operator int ();
2110   A& operator = (int);
2111 @};
2112
2113 main ()
2114 @{
2115   A a,b;
2116   a = b;
2117 @}
2118 @end smallexample
2119
2120 In this example, G++ will synthesize a default @samp{A& operator =
2121 (const A&);}, while cfront will use the user-defined @samp{operator =}.
2122 @end table
2123
2124 @node Objective-C and Objective-C++ Dialect Options
2125 @section Options Controlling Objective-C and Objective-C++ Dialects
2126
2127 @cindex compiler options, Objective-C and Objective-C++
2128 @cindex Objective-C and Objective-C++ options, command line
2129 @cindex options, Objective-C and Objective-C++
2130 (NOTE: This manual does not describe the Objective-C and Objective-C++
2131 languages themselves.  See @xref{Standards,,Language Standards
2132 Supported by GCC}, for references.)
2133
2134 This section describes the command-line options that are only meaningful
2135 for Objective-C and Objective-C++ programs, but you can also use most of
2136 the language-independent GNU compiler options.
2137 For example, you might compile a file @code{some_class.m} like this:
2138
2139 @smallexample
2140 gcc -g -fgnu-runtime -O -c some_class.m
2141 @end smallexample
2142
2143 @noindent
2144 In this example, @option{-fgnu-runtime} is an option meant only for
2145 Objective-C and Objective-C++ programs; you can use the other options with
2146 any language supported by GCC@.
2147
2148 Note that since Objective-C is an extension of the C language, Objective-C
2149 compilations may also use options specific to the C front-end (e.g.,
2150 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2151 C++-specific options (e.g., @option{-Wabi}).
2152
2153 Here is a list of options that are @emph{only} for compiling Objective-C
2154 and Objective-C++ programs:
2155
2156 @table @gcctabopt
2157 @item -fconstant-string-class=@var{class-name}
2158 @opindex fconstant-string-class
2159 Use @var{class-name} as the name of the class to instantiate for each
2160 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2161 class name is @code{NXConstantString} if the GNU runtime is being used, and
2162 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2163 @option{-fconstant-cfstrings} option, if also present, will override the
2164 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2165 to be laid out as constant CoreFoundation strings.
2166
2167 @item -fgnu-runtime
2168 @opindex fgnu-runtime
2169 Generate object code compatible with the standard GNU Objective-C
2170 runtime.  This is the default for most types of systems.
2171
2172 @item -fnext-runtime
2173 @opindex fnext-runtime
2174 Generate output compatible with the NeXT runtime.  This is the default
2175 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2176 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2177 used.
2178
2179 @item -fno-nil-receivers
2180 @opindex fno-nil-receivers
2181 Assume that all Objective-C message dispatches (e.g.,
2182 @code{[receiver message:arg]}) in this translation unit ensure that the receiver
2183 is not @code{nil}.  This allows for more efficient entry points in the runtime
2184 to be used.  Currently, this option is only available in conjunction with
2185 the NeXT runtime on Mac OS X 10.3 and later.
2186
2187 @item -fobjc-call-cxx-cdtors
2188 @opindex fobjc-call-cxx-cdtors
2189 For each Objective-C class, check if any of its instance variables is a
2190 C++ object with a non-trivial default constructor.  If so, synthesize a
2191 special @code{- (id) .cxx_construct} instance method that will run
2192 non-trivial default constructors on any such instance variables, in order,
2193 and then return @code{self}.  Similarly, check if any instance variable
2194 is a C++ object with a non-trivial destructor, and if so, synthesize a
2195 special @code{- (void) .cxx_destruct} method that will run
2196 all such default destructors, in reverse order.
2197
2198 The @code{- (id) .cxx_construct} and/or @code{- (void) .cxx_destruct} methods
2199 thusly generated will only operate on instance variables declared in the
2200 current Objective-C class, and not those inherited from superclasses.  It
2201 is the responsibility of the Objective-C runtime to invoke all such methods
2202 in an object's inheritance hierarchy.  The @code{- (id) .cxx_construct} methods
2203 will be invoked by the runtime immediately after a new object
2204 instance is allocated; the @code{- (void) .cxx_destruct} methods will
2205 be invoked immediately before the runtime deallocates an object instance.
2206
2207 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2208 support for invoking the @code{- (id) .cxx_construct} and
2209 @code{- (void) .cxx_destruct} methods.
2210
2211 @item -fobjc-direct-dispatch
2212 @opindex fobjc-direct-dispatch
2213 Allow fast jumps to the message dispatcher.  On Darwin this is
2214 accomplished via the comm page.
2215
2216 @item -fobjc-exceptions
2217 @opindex fobjc-exceptions
2218 Enable syntactic support for structured exception handling in Objective-C,
2219 similar to what is offered by C++ and Java.  This option is
2220 unavailable in conjunction with the NeXT runtime on Mac OS X 10.2 and
2221 earlier.
2222
2223 @smallexample
2224   @@try @{
2225     @dots{}
2226        @@throw expr;
2227     @dots{}
2228   @}
2229   @@catch (AnObjCClass *exc) @{
2230     @dots{}
2231       @@throw expr;
2232     @dots{}
2233       @@throw;
2234     @dots{}
2235   @}
2236   @@catch (AnotherClass *exc) @{
2237     @dots{}
2238   @}
2239   @@catch (id allOthers) @{
2240     @dots{}
2241   @}
2242   @@finally @{
2243     @dots{}
2244       @@throw expr;
2245     @dots{}
2246   @}
2247 @end smallexample
2248
2249 The @code{@@throw} statement may appear anywhere in an Objective-C or
2250 Objective-C++ program; when used inside of a @code{@@catch} block, the
2251 @code{@@throw} may appear without an argument (as shown above), in which case
2252 the object caught by the @code{@@catch} will be rethrown.
2253
2254 Note that only (pointers to) Objective-C objects may be thrown and
2255 caught using this scheme.  When an object is thrown, it will be caught
2256 by the nearest @code{@@catch} clause capable of handling objects of that type,
2257 analogously to how @code{catch} blocks work in C++ and Java.  A
2258 @code{@@catch(id @dots{})} clause (as shown above) may also be provided to catch
2259 any and all Objective-C exceptions not caught by previous @code{@@catch}
2260 clauses (if any).
2261
2262 The @code{@@finally} clause, if present, will be executed upon exit from the
2263 immediately preceding @code{@@try @dots{} @@catch} section.  This will happen
2264 regardless of whether any exceptions are thrown, caught or rethrown
2265 inside the @code{@@try @dots{} @@catch} section, analogously to the behavior
2266 of the @code{finally} clause in Java.
2267
2268 There are several caveats to using the new exception mechanism:
2269
2270 @itemize @bullet
2271 @item
2272 Although currently designed to be binary compatible with @code{NS_HANDLER}-style
2273 idioms provided by the @code{NSException} class, the new
2274 exceptions can only be used on Mac OS X 10.3 (Panther) and later
2275 systems, due to additional functionality needed in the (NeXT) Objective-C
2276 runtime.
2277
2278 @item
2279 As mentioned above, the new exceptions do not support handling
2280 types other than Objective-C objects.   Furthermore, when used from
2281 Objective-C++, the Objective-C exception model does not interoperate with C++
2282 exceptions at this time.  This means you cannot @code{@@throw} an exception
2283 from Objective-C and @code{catch} it in C++, or vice versa
2284 (i.e., @code{throw @dots{} @@catch}).
2285 @end itemize
2286
2287 The @option{-fobjc-exceptions} switch also enables the use of synchronization
2288 blocks for thread-safe execution:
2289
2290 @smallexample
2291   @@synchronized (ObjCClass *guard) @{
2292     @dots{}
2293   @}
2294 @end smallexample
2295
2296 Upon entering the @code{@@synchronized} block, a thread of execution shall
2297 first check whether a lock has been placed on the corresponding @code{guard}
2298 object by another thread.  If it has, the current thread shall wait until
2299 the other thread relinquishes its lock.  Once @code{guard} becomes available,
2300 the current thread will place its own lock on it, execute the code contained in
2301 the @code{@@synchronized} block, and finally relinquish the lock (thereby
2302 making @code{guard} available to other threads).
2303
2304 Unlike Java, Objective-C does not allow for entire methods to be marked
2305 @code{@@synchronized}.  Note that throwing exceptions out of
2306 @code{@@synchronized} blocks is allowed, and will cause the guarding object
2307 to be unlocked properly.
2308
2309 @item -fobjc-gc
2310 @opindex fobjc-gc
2311 Enable garbage collection (GC) in Objective-C and Objective-C++ programs.
2312
2313 @item -freplace-objc-classes
2314 @opindex freplace-objc-classes
2315 Emit a special marker instructing @command{ld(1)} not to statically link in
2316 the resulting object file, and allow @command{dyld(1)} to load it in at
2317 run time instead.  This is used in conjunction with the Fix-and-Continue
2318 debugging mode, where the object file in question may be recompiled and
2319 dynamically reloaded in the course of program execution, without the need
2320 to restart the program itself.  Currently, Fix-and-Continue functionality
2321 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2322 and later.
2323
2324 @item -fzero-link
2325 @opindex fzero-link
2326 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2327 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2328 compile time) with static class references that get initialized at load time,
2329 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2330 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2331 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2332 for individual class implementations to be modified during program execution.
2333
2334 @item -gen-decls
2335 @opindex gen-decls
2336 Dump interface declarations for all classes seen in the source file to a
2337 file named @file{@var{sourcename}.decl}.
2338
2339 @item -Wassign-intercept
2340 @opindex Wassign-intercept
2341 Warn whenever an Objective-C assignment is being intercepted by the
2342 garbage collector.
2343
2344 @item -Wno-protocol
2345 @opindex Wno-protocol
2346 If a class is declared to implement a protocol, a warning is issued for
2347 every method in the protocol that is not implemented by the class.  The
2348 default behavior is to issue a warning for every method not explicitly
2349 implemented in the class, even if a method implementation is inherited
2350 from the superclass.  If you use the @option{-Wno-protocol} option, then
2351 methods inherited from the superclass are considered to be implemented,
2352 and no warning is issued for them.
2353
2354 @item -Wselector
2355 @opindex Wselector
2356 Warn if multiple methods of different types for the same selector are
2357 found during compilation.  The check is performed on the list of methods
2358 in the final stage of compilation.  Additionally, a check is performed
2359 for each selector appearing in a @code{@@selector(@dots{})}
2360 expression, and a corresponding method for that selector has been found
2361 during compilation.  Because these checks scan the method table only at
2362 the end of compilation, these warnings are not produced if the final
2363 stage of compilation is not reached, for example because an error is
2364 found during compilation, or because the @option{-fsyntax-only} option is
2365 being used.
2366
2367 @item -Wstrict-selector-match
2368 @opindex Wstrict-selector-match
2369 Warn if multiple methods with differing argument and/or return types are
2370 found for a given selector when attempting to send a message using this
2371 selector to a receiver of type @code{id} or @code{Class}.  When this flag
2372 is off (which is the default behavior), the compiler will omit such warnings
2373 if any differences found are confined to types which share the same size
2374 and alignment.
2375
2376 @item -Wundeclared-selector
2377 @opindex Wundeclared-selector
2378 Warn if a @code{@@selector(@dots{})} expression referring to an
2379 undeclared selector is found.  A selector is considered undeclared if no
2380 method with that name has been declared before the
2381 @code{@@selector(@dots{})} expression, either explicitly in an
2382 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
2383 an @code{@@implementation} section.  This option always performs its
2384 checks as soon as a @code{@@selector(@dots{})} expression is found,
2385 while @option{-Wselector} only performs its checks in the final stage of
2386 compilation.  This also enforces the coding style convention
2387 that methods and selectors must be declared before being used.
2388
2389 @item -print-objc-runtime-info
2390 @opindex print-objc-runtime-info
2391 Generate C header describing the largest structure that is passed by
2392 value, if any.
2393
2394 @end table
2395
2396 @node Language Independent Options
2397 @section Options to Control Diagnostic Messages Formatting
2398 @cindex options to control diagnostics formatting
2399 @cindex diagnostic messages
2400 @cindex message formatting
2401
2402 Traditionally, diagnostic messages have been formatted irrespective of
2403 the output device's aspect (e.g.@: its width, @dots{}).  The options described
2404 below can be used to control the diagnostic messages formatting
2405 algorithm, e.g.@: how many characters per line, how often source location
2406 information should be reported.  Right now, only the C++ front end can
2407 honor these options.  However it is expected, in the near future, that
2408 the remaining front ends would be able to digest them correctly.
2409
2410 @table @gcctabopt
2411 @item -fmessage-length=@var{n}
2412 @opindex fmessage-length
2413 Try to format error messages so that they fit on lines of about @var{n}
2414 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
2415 the front ends supported by GCC@.  If @var{n} is zero, then no
2416 line-wrapping will be done; each error message will appear on a single
2417 line.
2418
2419 @opindex fdiagnostics-show-location
2420 @item -fdiagnostics-show-location=once
2421 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
2422 reporter to emit @emph{once} source location information; that is, in
2423 case the message is too long to fit on a single physical line and has to
2424 be wrapped, the source location won't be emitted (as prefix) again,
2425 over and over, in subsequent continuation lines.  This is the default
2426 behavior.
2427
2428 @item -fdiagnostics-show-location=every-line
2429 Only meaningful in line-wrapping mode.  Instructs the diagnostic
2430 messages reporter to emit the same source location information (as
2431 prefix) for physical lines that result from the process of breaking
2432 a message which is too long to fit on a single line.
2433
2434 @item -fdiagnostics-show-option
2435 @opindex fdiagnostics-show-option
2436 This option instructs the diagnostic machinery to add text to each
2437 diagnostic emitted, which indicates which command line option directly
2438 controls that diagnostic, when such an option is known to the
2439 diagnostic machinery.
2440
2441 @item -Wcoverage-mismatch
2442 @opindex Wcoverage-mismatch
2443 Warn if feedback profiles do not match when using the
2444 @option{-fprofile-use} option.
2445 If a source file was changed between @option{-fprofile-gen} and
2446 @option{-fprofile-use}, the files with the profile feedback can fail
2447 to match the source file and GCC can not use the profile feedback
2448 information.  By default, GCC emits an error message in this case.
2449 The option @option{-Wcoverage-mismatch} emits a warning instead of an
2450 error.  GCC does not use appropriate feedback profiles, so using this
2451 option can result in poorly optimized code.  This option is useful
2452 only in the case of very minor changes such as bug fixes to an
2453 existing code-base.
2454
2455 @end table
2456
2457 @node Warning Options
2458 @section Options to Request or Suppress Warnings
2459 @cindex options to control warnings
2460 @cindex warning messages
2461 @cindex messages, warning
2462 @cindex suppressing warnings
2463
2464 Warnings are diagnostic messages that report constructions which
2465 are not inherently erroneous but which are risky or suggest there
2466 may have been an error.
2467
2468 You can request many specific warnings with options beginning @samp{-W},
2469 for example @option{-Wimplicit} to request warnings on implicit
2470 declarations.  Each of these specific warning options also has a
2471 negative form beginning @samp{-Wno-} to turn off warnings;
2472 for example, @option{-Wno-implicit}.  This manual lists only one of the
2473 two forms, whichever is not the default.
2474
2475 The following options control the amount and kinds of warnings produced
2476 by GCC; for further, language-specific options also refer to
2477 @ref{C++ Dialect Options} and @ref{Objective-C and Objective-C++ Dialect
2478 Options}.
2479
2480 @table @gcctabopt
2481 @cindex syntax checking
2482 @item -fsyntax-only
2483 @opindex fsyntax-only
2484 Check the code for syntax errors, but don't do anything beyond that.
2485
2486 @item -pedantic
2487 @opindex pedantic
2488 Issue all the warnings demanded by strict ISO C and ISO C++;
2489 reject all programs that use forbidden extensions, and some other
2490 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
2491 version of the ISO C standard specified by any @option{-std} option used.
2492
2493 Valid ISO C and ISO C++ programs should compile properly with or without
2494 this option (though a rare few will require @option{-ansi} or a
2495 @option{-std} option specifying the required version of ISO C)@.  However,
2496 without this option, certain GNU extensions and traditional C and C++
2497 features are supported as well.  With this option, they are rejected.
2498
2499 @option{-pedantic} does not cause warning messages for use of the
2500 alternate keywords whose names begin and end with @samp{__}.  Pedantic
2501 warnings are also disabled in the expression that follows
2502 @code{__extension__}.  However, only system header files should use
2503 these escape routes; application programs should avoid them.
2504 @xref{Alternate Keywords}.
2505
2506 Some users try to use @option{-pedantic} to check programs for strict ISO
2507 C conformance.  They soon find that it does not do quite what they want:
2508 it finds some non-ISO practices, but not all---only those for which
2509 ISO C @emph{requires} a diagnostic, and some others for which
2510 diagnostics have been added.
2511
2512 A feature to report any failure to conform to ISO C might be useful in
2513 some instances, but would require considerable additional work and would
2514 be quite different from @option{-pedantic}.  We don't have plans to
2515 support such a feature in the near future.
2516
2517 Where the standard specified with @option{-std} represents a GNU
2518 extended dialect of C, such as @samp{gnu89} or @samp{gnu99}, there is a
2519 corresponding @dfn{base standard}, the version of ISO C on which the GNU
2520 extended dialect is based.  Warnings from @option{-pedantic} are given
2521 where they are required by the base standard.  (It would not make sense
2522 for such warnings to be given only for features not in the specified GNU
2523 C dialect, since by definition the GNU dialects of C include all
2524 features the compiler supports with the given option, and there would be
2525 nothing to warn about.)
2526
2527 @item -pedantic-errors
2528 @opindex pedantic-errors
2529 Like @option{-pedantic}, except that errors are produced rather than
2530 warnings.
2531
2532 @item -w
2533 @opindex w
2534 Inhibit all warning messages.
2535
2536 @item -Wno-import
2537 @opindex Wno-import
2538 Inhibit warning messages about the use of @samp{#import}.
2539
2540 @item -Wchar-subscripts
2541 @opindex Wchar-subscripts
2542 Warn if an array subscript has type @code{char}.  This is a common cause
2543 of error, as programmers often forget that this type is signed on some
2544 machines.
2545 This warning is enabled by @option{-Wall}.
2546
2547 @item -Wcomment
2548 @opindex Wcomment
2549 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
2550 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
2551 This warning is enabled by @option{-Wall}.
2552
2553 @item -Wfatal-errors
2554 @opindex Wfatal-errors
2555 This option causes the compiler to abort compilation on the first error
2556 occurred rather than trying to keep going and printing further error
2557 messages.
2558
2559 @item -Wformat
2560 @opindex Wformat
2561 @opindex ffreestanding
2562 @opindex fno-builtin
2563 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
2564 the arguments supplied have types appropriate to the format string
2565 specified, and that the conversions specified in the format string make
2566 sense.  This includes standard functions, and others specified by format
2567 attributes (@pxref{Function Attributes}), in the @code{printf},
2568 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
2569 not in the C standard) families (or other target-specific families).
2570 Which functions are checked without format attributes having been
2571 specified depends on the standard version selected, and such checks of
2572 functions without the attribute specified are disabled by
2573 @option{-ffreestanding} or @option{-fno-builtin}.
2574
2575 The formats are checked against the format features supported by GNU
2576 libc version 2.2.  These include all ISO C90 and C99 features, as well
2577 as features from the Single Unix Specification and some BSD and GNU
2578 extensions.  Other library implementations may not support all these
2579 features; GCC does not support warning about features that go beyond a
2580 particular library's limitations.  However, if @option{-pedantic} is used
2581 with @option{-Wformat}, warnings will be given about format features not
2582 in the selected standard version (but not for @code{strfmon} formats,
2583 since those are not in any version of the C standard).  @xref{C Dialect
2584 Options,,Options Controlling C Dialect}.
2585
2586 Since @option{-Wformat} also checks for null format arguments for
2587 several functions, @option{-Wformat} also implies @option{-Wnonnull}.
2588
2589 @option{-Wformat} is included in @option{-Wall}.  For more control over some
2590 aspects of format checking, the options @option{-Wformat-y2k},
2591 @option{-Wno-format-extra-args}, @option{-Wno-format-zero-length},
2592 @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
2593 @option{-Wformat=2} are available, but are not included in @option{-Wall}.
2594
2595 @item -Wformat-y2k
2596 @opindex Wformat-y2k
2597 If @option{-Wformat} is specified, also warn about @code{strftime}
2598 formats which may yield only a two-digit year.
2599
2600 @item -Wno-format-extra-args
2601 @opindex Wno-format-extra-args
2602 If @option{-Wformat} is specified, do not warn about excess arguments to a
2603 @code{printf} or @code{scanf} format function.  The C standard specifies
2604 that such arguments are ignored.
2605
2606 Where the unused arguments lie between used arguments that are
2607 specified with @samp{$} operand number specifications, normally
2608 warnings are still given, since the implementation could not know what
2609 type to pass to @code{va_arg} to skip the unused arguments.  However,
2610 in the case of @code{scanf} formats, this option will suppress the
2611 warning if the unused arguments are all pointers, since the Single
2612 Unix Specification says that such unused arguments are allowed.
2613
2614 @item -Wno-format-zero-length
2615 @opindex Wno-format-zero-length
2616 If @option{-Wformat} is specified, do not warn about zero-length formats.
2617 The C standard specifies that zero-length formats are allowed.
2618
2619 @item -Wformat-nonliteral
2620 @opindex Wformat-nonliteral
2621 If @option{-Wformat} is specified, also warn if the format string is not a
2622 string literal and so cannot be checked, unless the format function
2623 takes its format arguments as a @code{va_list}.
2624
2625 @item -Wformat-security
2626 @opindex Wformat-security
2627 If @option{-Wformat} is specified, also warn about uses of format
2628 functions that represent possible security problems.  At present, this
2629 warns about calls to @code{printf} and @code{scanf} functions where the
2630 format string is not a string literal and there are no format arguments,
2631 as in @code{printf (foo);}.  This may be a security hole if the format
2632 string came from untrusted input and contains @samp{%n}.  (This is
2633 currently a subset of what @option{-Wformat-nonliteral} warns about, but
2634 in future warnings may be added to @option{-Wformat-security} that are not
2635 included in @option{-Wformat-nonliteral}.)
2636
2637 @item -Wformat=2
2638 @opindex Wformat=2
2639 Enable @option{-Wformat} plus format checks not included in
2640 @option{-Wformat}.  Currently equivalent to @samp{-Wformat
2641 -Wformat-nonliteral -Wformat-security -Wformat-y2k}.
2642
2643 @item -Wnonnull
2644 @opindex Wnonnull
2645 Warn about passing a null pointer for arguments marked as
2646 requiring a non-null value by the @code{nonnull} function attribute.
2647
2648 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
2649 can be disabled with the @option{-Wno-nonnull} option.
2650
2651 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
2652 @opindex Winit-self
2653 Warn about uninitialized variables which are initialized with themselves.
2654 Note this option can only be used with the @option{-Wuninitialized} option,
2655 which in turn only works with @option{-O1} and above.
2656
2657 For example, GCC will warn about @code{i} being uninitialized in the
2658 following snippet only when @option{-Winit-self} has been specified:
2659 @smallexample
2660 @group
2661 int f()
2662 @{
2663   int i = i;
2664   return i;
2665 @}
2666 @end group
2667 @end smallexample
2668
2669 @item -Wimplicit-int
2670 @opindex Wimplicit-int
2671 Warn when a declaration does not specify a type.
2672 This warning is enabled by @option{-Wall}.
2673
2674 @item -Wimplicit-function-declaration
2675 @opindex Wimplicit-function-declaration
2676 @opindex Wno-implicit-function-declaration
2677 Give a warning whenever a function is used before being declared. In
2678 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
2679 enabled by default and it is made into an error by
2680 @option{-pedantic-errors}. This warning is also enabled by
2681 @option{-Wall}.
2682
2683 @item -Wimplicit
2684 @opindex Wimplicit
2685 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
2686 This warning is enabled by @option{-Wall}.
2687
2688 @item -Wmain
2689 @opindex Wmain
2690 Warn if the type of @samp{main} is suspicious.  @samp{main} should be a
2691 function with external linkage, returning int, taking either zero
2692 arguments, two, or three arguments of appropriate types.
2693 This warning is enabled by @option{-Wall}.
2694
2695 @item -Wmissing-braces
2696 @opindex Wmissing-braces
2697 Warn if an aggregate or union initializer is not fully bracketed.  In
2698 the following example, the initializer for @samp{a} is not fully
2699 bracketed, but that for @samp{b} is fully bracketed.
2700
2701 @smallexample
2702 int a[2][2] = @{ 0, 1, 2, 3 @};
2703 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
2704 @end smallexample
2705
2706 This warning is enabled by @option{-Wall}.
2707
2708 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
2709 @opindex Wmissing-include-dirs
2710 Warn if a user-supplied include directory does not exist.
2711
2712 @item -Wparentheses
2713 @opindex Wparentheses
2714 Warn if parentheses are omitted in certain contexts, such
2715 as when there is an assignment in a context where a truth value
2716 is expected, or when operators are nested whose precedence people
2717 often get confused about.
2718
2719 Also warn if a comparison like @samp{x<=y<=z} appears; this is
2720 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
2721 interpretation from that of ordinary mathematical notation.
2722
2723 Also warn about constructions where there may be confusion to which
2724 @code{if} statement an @code{else} branch belongs.  Here is an example of
2725 such a case:
2726
2727 @smallexample
2728 @group
2729 @{
2730   if (a)
2731     if (b)
2732       foo ();
2733   else
2734     bar ();
2735 @}
2736 @end group
2737 @end smallexample
2738
2739 In C/C++, every @code{else} branch belongs to the innermost possible
2740 @code{if} statement, which in this example is @code{if (b)}.  This is
2741 often not what the programmer expected, as illustrated in the above
2742 example by indentation the programmer chose.  When there is the
2743 potential for this confusion, GCC will issue a warning when this flag
2744 is specified.  To eliminate the warning, add explicit braces around
2745 the innermost @code{if} statement so there is no way the @code{else}
2746 could belong to the enclosing @code{if}.  The resulting code would
2747 look like this:
2748
2749 @smallexample
2750 @group
2751 @{
2752   if (a)
2753     @{
2754       if (b)
2755         foo ();
2756       else
2757         bar ();
2758     @}
2759 @}
2760 @end group
2761 @end smallexample
2762
2763 This warning is enabled by @option{-Wall}.
2764
2765 @item -Wsequence-point
2766 @opindex Wsequence-point
2767 Warn about code that may have undefined semantics because of violations
2768 of sequence point rules in the C and C++ standards.
2769
2770 The C and C++ standards defines the order in which expressions in a C/C++
2771 program are evaluated in terms of @dfn{sequence points}, which represent
2772 a partial ordering between the execution of parts of the program: those
2773 executed before the sequence point, and those executed after it.  These
2774 occur after the evaluation of a full expression (one which is not part
2775 of a larger expression), after the evaluation of the first operand of a
2776 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
2777 function is called (but after the evaluation of its arguments and the
2778 expression denoting the called function), and in certain other places.
2779 Other than as expressed by the sequence point rules, the order of
2780 evaluation of subexpressions of an expression is not specified.  All
2781 these rules describe only a partial order rather than a total order,
2782 since, for example, if two functions are called within one expression
2783 with no sequence point between them, the order in which the functions
2784 are called is not specified.  However, the standards committee have
2785 ruled that function calls do not overlap.
2786
2787 It is not specified when between sequence points modifications to the
2788 values of objects take effect.  Programs whose behavior depends on this
2789 have undefined behavior; the C and C++ standards specify that ``Between
2790 the previous and next sequence point an object shall have its stored
2791 value modified at most once by the evaluation of an expression.
2792 Furthermore, the prior value shall be read only to determine the value
2793 to be stored.''.  If a program breaks these rules, the results on any
2794 particular implementation are entirely unpredictable.
2795
2796 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
2797 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
2798 diagnosed by this option, and it may give an occasional false positive
2799 result, but in general it has been found fairly effective at detecting
2800 this sort of problem in programs.
2801
2802 The standard is worded confusingly, therefore there is some debate
2803 over the precise meaning of the sequence point rules in subtle cases.
2804 Links to discussions of the problem, including proposed formal
2805 definitions, may be found on the GCC readings page, at
2806 @w{@uref{http://gcc.gnu.org/readings.html}}.
2807
2808 This warning is enabled by @option{-Wall} for C and C++.
2809
2810 @item -Wreturn-type
2811 @opindex Wreturn-type
2812 @opindex Wno-return-type
2813 Warn whenever a function is defined with a return-type that defaults
2814 to @code{int}.  Also warn about any @code{return} statement with no
2815 return-value in a function whose return-type is not @code{void}
2816 (falling off the end of the function body is considered returning
2817 without a value), and about a @code{return} statement with a
2818 expression in a function whose return-type is @code{void}.
2819
2820 Also warn if the return type of a function has a type qualifier
2821 such as @code{const}.  For ISO C such a type qualifier has no effect,
2822 since the value returned by a function is not an lvalue.
2823 For C++, the warning is only emitted for scalar types or @code{void}.
2824 ISO C prohibits qualified @code{void} return types on function
2825 definitions, so such return types always receive a warning
2826 even without this option.
2827
2828 For C++, a function without return type always produces a diagnostic
2829 message, even when @option{-Wno-return-type} is specified.  The only
2830 exceptions are @samp{main} and functions defined in system headers.
2831
2832 This warning is enabled by @option{-Wall}.
2833
2834 @item -Wswitch
2835 @opindex Wswitch
2836 Warn whenever a @code{switch} statement has an index of enumerated type
2837 and lacks a @code{case} for one or more of the named codes of that
2838 enumeration.  (The presence of a @code{default} label prevents this
2839 warning.)  @code{case} labels outside the enumeration range also
2840 provoke warnings when this option is used.
2841 This warning is enabled by @option{-Wall}.
2842
2843 @item -Wswitch-default
2844 @opindex Wswitch-switch
2845 Warn whenever a @code{switch} statement does not have a @code{default}
2846 case.
2847
2848 @item -Wswitch-enum
2849 @opindex Wswitch-enum
2850 Warn whenever a @code{switch} statement has an index of enumerated type
2851 and lacks a @code{case} for one or more of the named codes of that
2852 enumeration.  @code{case} labels outside the enumeration range also
2853 provoke warnings when this option is used.
2854
2855 @item -Wtrigraphs
2856 @opindex Wtrigraphs
2857 Warn if any trigraphs are encountered that might change the meaning of
2858 the program (trigraphs within comments are not warned about).
2859 This warning is enabled by @option{-Wall}.
2860
2861 @item -Wunused-function
2862 @opindex Wunused-function
2863 Warn whenever a static function is declared but not defined or a
2864 non-inline static function is unused.
2865 This warning is enabled by @option{-Wall}.
2866
2867 @item -Wunused-label
2868 @opindex Wunused-label
2869 Warn whenever a label is declared but not used.
2870 This warning is enabled by @option{-Wall}.
2871
2872 To suppress this warning use the @samp{unused} attribute
2873 (@pxref{Variable Attributes}).
2874
2875 @item -Wunused-parameter
2876 @opindex Wunused-parameter
2877 Warn whenever a function parameter is unused aside from its declaration.
2878
2879 To suppress this warning use the @samp{unused} attribute
2880 (@pxref{Variable Attributes}).
2881
2882 @item -Wunused-variable
2883 @opindex Wunused-variable
2884 Warn whenever a local variable or non-constant static variable is unused
2885 aside from its declaration.
2886 This warning is enabled by @option{-Wall}.
2887
2888 To suppress this warning use the @samp{unused} attribute
2889 (@pxref{Variable Attributes}).
2890
2891 @item -Wunused-value
2892 @opindex Wunused-value
2893 Warn whenever a statement computes a result that is explicitly not
2894 used. To suppress this warning cast the unused expression to
2895 @samp{void}. This includes an expression-statement or the left-hand
2896 side of a comma expression that contains no side effects. For example,
2897 an expression such as @samp{x[i,j]} will cause a warning, while
2898 @samp{x[(void)i,j]} will not.
2899
2900 This warning is enabled by @option{-Wall}.
2901
2902 @item -Wunused
2903 @opindex Wunused
2904 All the above @option{-Wunused} options combined.
2905
2906 In order to get a warning about an unused function parameter, you must
2907 either specify @samp{-Wextra -Wunused} (note that @samp{-Wall} implies
2908 @samp{-Wunused}), or separately specify @option{-Wunused-parameter}.
2909
2910 @item -Wuninitialized
2911 @opindex Wuninitialized
2912 Warn if an automatic variable is used without first being initialized or
2913 if a variable may be clobbered by a @code{setjmp} call.
2914
2915 These warnings are possible only in optimizing compilation,
2916 because they require data flow information that is computed only
2917 when optimizing.  If you do not specify @option{-O}, you will not get
2918 these warnings. Instead, GCC will issue a warning about @option{-Wuninitialized}
2919 requiring @option{-O}.
2920
2921 If you want to warn about code which uses the uninitialized value of the
2922 variable in its own initializer, use the @option{-Winit-self} option.
2923
2924 These warnings occur for individual uninitialized or clobbered
2925 elements of structure, union or array variables as well as for
2926 variables which are uninitialized or clobbered as a whole.  They do
2927 not occur for variables or elements declared @code{volatile}.  Because
2928 these warnings depend on optimization, the exact variables or elements
2929 for which there are warnings will depend on the precise optimization
2930 options and version of GCC used.
2931
2932 Note that there may be no warning about a variable that is used only
2933 to compute a value that itself is never used, because such
2934 computations may be deleted by data flow analysis before the warnings
2935 are printed.
2936
2937 These warnings are made optional because GCC is not smart
2938 enough to see all the reasons why the code might be correct
2939 despite appearing to have an error.  Here is one example of how
2940 this can happen:
2941
2942 @smallexample
2943 @group
2944 @{
2945   int x;
2946   switch (y)
2947     @{
2948     case 1: x = 1;
2949       break;
2950     case 2: x = 4;
2951       break;
2952     case 3: x = 5;
2953     @}
2954   foo (x);
2955 @}
2956 @end group
2957 @end smallexample
2958
2959 @noindent
2960 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
2961 always initialized, but GCC doesn't know this.  Here is
2962 another common case:
2963
2964 @smallexample
2965 @{
2966   int save_y;
2967   if (change_y) save_y = y, y = new_y;
2968   @dots{}
2969   if (change_y) y = save_y;
2970 @}
2971 @end smallexample
2972
2973 @noindent
2974 This has no bug because @code{save_y} is used only if it is set.
2975
2976 @cindex @code{longjmp} warnings
2977 This option also warns when a non-volatile automatic variable might be
2978 changed by a call to @code{longjmp}.  These warnings as well are possible
2979 only in optimizing compilation.
2980
2981 The compiler sees only the calls to @code{setjmp}.  It cannot know
2982 where @code{longjmp} will be called; in fact, a signal handler could
2983 call it at any point in the code.  As a result, you may get a warning
2984 even when there is in fact no problem because @code{longjmp} cannot
2985 in fact be called at the place which would cause a problem.
2986
2987 Some spurious warnings can be avoided if you declare all the functions
2988 you use that never return as @code{noreturn}.  @xref{Function
2989 Attributes}.
2990
2991 This warning is enabled by @option{-Wall}.
2992
2993 @item -Wunknown-pragmas
2994 @opindex Wunknown-pragmas
2995 @cindex warning for unknown pragmas
2996 @cindex unknown pragmas, warning
2997 @cindex pragmas, warning of unknown
2998 Warn when a #pragma directive is encountered which is not understood by
2999 GCC@.  If this command line option is used, warnings will even be issued
3000 for unknown pragmas in system header files.  This is not the case if
3001 the warnings were only enabled by the @option{-Wall} command line option.
3002
3003 @item -Wno-pragmas
3004 @opindex Wno-pragmas
3005 @opindex Wpragmas
3006 Do not warn about misuses of pragmas, such as incorrect parameters,
3007 invalid syntax, or conflicts between pragmas.  See also
3008 @samp{-Wunknown-pragmas}.
3009
3010 @item -Wstrict-aliasing
3011 @opindex Wstrict-aliasing
3012 This option is only active when @option{-fstrict-aliasing} is active.
3013 It warns about code which might break the strict aliasing rules that the
3014 compiler is using for optimization.  The warning does not catch all
3015 cases, but does attempt to catch the more common pitfalls.  It is
3016 included in @option{-Wall}.
3017 It is equivalent to -Wstrict-aliasing=3
3018
3019 @item -Wstrict-aliasing=n
3020 @opindex Wstrict-aliasing=n
3021 This option is only active when @option{-fstrict-aliasing} is active.
3022 It warns about code which might break the strict aliasing rules that the
3023 compiler is using for optimization.
3024 Higher levels correspond to higher accuracy (fewer false positives).
3025 Higher levels also correspond to more effort, similar to the way -O works.
3026 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=n},
3027 with n=3.
3028
3029 Level 1: Most aggressive, quick, least accurate.
3030 Possibly useful when higher levels
3031 do not warn but -fstrict-aliasing still breaks the code, as it has very few 
3032 false negatives.  However, it has many false positives.
3033 Warns for all pointer conversions between possibly incompatible types, 
3034 even if never dereferenced.  Runs in the frontend only.
3035
3036 Level 2: Aggressive, quick, not too precise.
3037 May still have many false positives (not as many as level 1 though),
3038 and few false negatives (but possibly more than level 1).
3039 Unlike level 1, it only warns when an address is taken.  Warns about
3040 incomplete types.  Runs in the frontend only.
3041
3042 Level 3 (default for @option{-Wstrict-aliasing}): 
3043 Should have very few false positives and few false 
3044 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
3045 Takes care of the common punn+dereference pattern in the frontend:
3046 @code{*(int*)&some_float}.
3047 If optimization is enabled, it also runs in the backend, where it deals 
3048 with multiple statement cases using flow-sensitive points-to information.
3049 Only warns when the converted pointer is dereferenced.
3050 Does not warn about incomplete types.
3051
3052 @item -Wstrict-overflow
3053 @item -Wstrict-overflow=@var{n}
3054 @opindex Wstrict-overflow
3055 This option is only active when @option{-fstrict-overflow} is active.
3056 It warns about cases where the compiler optimizes based on the
3057 assumption that signed overflow does not occur.  Note that it does not
3058 warn about all cases where the code might overflow: it only warns
3059 about cases where the compiler implements some optimization.  Thus
3060 this warning depends on the optimization level.
3061
3062 An optimization which assumes that signed overflow does not occur is
3063 perfectly safe if the values of the variables involved are such that
3064 overflow never does, in fact, occur.  Therefore this warning can
3065 easily give a false positive: a warning about code which is not
3066 actually a problem.  To help focus on important issues, several
3067 warning levels are defined.  No warnings are issued for the use of
3068 undefined signed overflow when estimating how many iterations a loop
3069 will require, in particular when determining whether a loop will be
3070 executed at all.
3071
3072 @table @option
3073 @item -Wstrict-overflow=1
3074 Warn about cases which are both questionable and easy to avoid.  For
3075 example: @code{x + 1 > x}; with @option{-fstrict-overflow}, the
3076 compiler will simplify this to @code{1}.  This level of
3077 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
3078 are not, and must be explicitly requested.
3079
3080 @item -Wstrict-overflow=2
3081 Also warn about other cases where a comparison is simplified to a
3082 constant.  For example: @code{abs (x) >= 0}.  This can only be
3083 simplified when @option{-fstrict-overflow} is in effect, because
3084 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
3085 zero.  @option{-Wstrict-overflow} (with no level) is the same as
3086 @option{-Wstrict-overflow=2}.
3087
3088 @item -Wstrict-overflow=3
3089 Also warn about other cases where a comparison is simplified.  For
3090 example: @code{x + 1 > 1} will be simplified to @code{x > 0}.
3091
3092 @item -Wstrict-overflow=4
3093 Also warn about other simplifications not covered by the above cases.
3094 For example: @code{(x * 10) / 5} will be simplified to @code{x * 2}.
3095
3096 @item -Wstrict-overflow=5
3097 Also warn about cases where the compiler reduces the magnitude of a
3098 constant involved in a comparison.  For example: @code{x + 2 > y} will
3099 be simplified to @code{x + 1 >= y}.  This is reported only at the
3100 highest warning level because this simplification applies to many
3101 comparisons, so this warning level will give a very large number of
3102 false positives.
3103 @end table
3104
3105 @item -Warray-bounds
3106 @opindex Wno-array-bounds
3107 @opindex Warray-bounds
3108 This option is only active when @option{-ftree-vrp} is active
3109 (default for -O2 and above). It warns about subscripts to arrays
3110 that are always out of bounds. This warning is enabled by @option{-Wall}.
3111
3112 @item -Wall
3113 @opindex Wall
3114 All of the above @samp{-W} options combined.  This enables all the
3115 warnings about constructions that some users consider questionable, and
3116 that are easy to avoid (or modify to prevent the warning), even in
3117 conjunction with macros.  This also enables some language-specific
3118 warnings described in @ref{C++ Dialect Options} and
3119 @ref{Objective-C and Objective-C++ Dialect Options}.
3120 @end table
3121
3122 The following @option{-W@dots{}} options are not implied by @option{-Wall}.
3123 Some of them warn about constructions that users generally do not
3124 consider questionable, but which occasionally you might wish to check
3125 for; others warn about constructions that are necessary or hard to avoid
3126 in some cases, and there is no simple way to modify the code to suppress
3127 the warning.
3128
3129 @table @gcctabopt
3130 @item -Wextra
3131 @opindex W
3132 @opindex Wextra
3133 (This option used to be called @option{-W}.  The older name is still
3134 supported, but the newer name is more descriptive.)  Print extra warning
3135 messages for these events:
3136
3137 @itemize @bullet
3138 @item
3139 Warn if a comparison is always true or always false due to the limited
3140 range of the data type, but do not warn for constant expressions.  For
3141 example, warn if an unsigned variable is compared against zero with
3142 @samp{<} or @samp{>=}.  This warning can be independently controlled
3143 by @option{-Wtype-limits}.
3144
3145 @item @r{(C only)}
3146 Storage-class specifiers like @code{static} are not the first things
3147 in a declaration.  According to the C Standard, this usage is
3148 obsolescent.  This warning can be independently controlled by
3149 @option{-Wold-style-declaration}.
3150
3151 @item
3152 If @option{-Wall} or @option{-Wunused} is also specified, warn about unused
3153 arguments.
3154
3155 @item
3156 A comparison between signed and unsigned values could produce an
3157 incorrect result when the signed value is converted to unsigned.
3158 (But don't warn if @option{-Wno-sign-compare} is also specified.)
3159
3160 @item
3161 An aggregate has an initializer which does not initialize all members.
3162 This warning can be independently controlled by
3163 @option{-Wmissing-field-initializers}.
3164
3165 @item
3166 An initialized field without side effects is overridden when using
3167 designated initializers (@pxref{Designated Inits, , Designated
3168 Initializers}).  This warning can be independently controlled by
3169 @option{-Woverride-init}.
3170
3171 @item @r{(C only)}
3172 A function parameter is declared without a type specifier in K&R-style
3173 functions.  This warning can be independently controlled by
3174 @option{-Wmissing-parameter-type}.
3175
3176 @item
3177 An empty body occurs in an @samp{if}, @samp{else} or
3178 @samp{do while} statement. This warning can be independently
3179 controlled by @option{-Wempty-body}.
3180
3181 @item @r{(C++ only)}
3182 An empty body occurs in a @samp{while} or @samp{for} statement with no
3183 whitespacing before the semicolon. This warning can be independently
3184 controlled by @option{-Wempty-body}.
3185
3186 @item
3187 A pointer is compared against integer zero with @samp{<}, @samp{<=},
3188 @samp{>}, or @samp{>=}.
3189
3190 @item
3191 A variable might be changed by @samp{longjmp} or @samp{vfork}.
3192 This warning can be independently controlled by @option{-Wclobbered}.
3193
3194 @item @r{(C++ only)}
3195 An enumerator and a non-enumerator both appear in a conditional expression.
3196
3197 @item @r{(C++ only)}
3198 A non-static reference or non-static @samp{const} member appears in a
3199 class without constructors.
3200
3201 @item @r{(C++ only)}
3202 Ambiguous virtual bases.
3203
3204 @item @r{(C++ only)}
3205 Subscripting an array which has been declared @samp{register}.
3206
3207 @item @r{(C++ only)}
3208 Taking the address of a variable which has been declared @samp{register}.
3209
3210 @item @r{(C++ only)}
3211 A base class is not initialized in a derived class' copy constructor.
3212 @end itemize
3213
3214 @item -Wno-div-by-zero
3215 @opindex Wno-div-by-zero
3216 @opindex Wdiv-by-zero
3217 Do not warn about compile-time integer division by zero.  Floating point
3218 division by zero is not warned about, as it can be a legitimate way of
3219 obtaining infinities and NaNs.
3220
3221 @item -Wsystem-headers
3222 @opindex Wsystem-headers
3223 @cindex warnings from system headers
3224 @cindex system headers, warnings from
3225 Print warning messages for constructs found in system header files.
3226 Warnings from system headers are normally suppressed, on the assumption
3227 that they usually do not indicate real problems and would only make the
3228 compiler output harder to read.  Using this command line option tells
3229 GCC to emit warnings from system headers as if they occurred in user
3230 code.  However, note that using @option{-Wall} in conjunction with this
3231 option will @emph{not} warn about unknown pragmas in system
3232 headers---for that, @option{-Wunknown-pragmas} must also be used.
3233
3234 @item -Wfloat-equal
3235 @opindex Wfloat-equal
3236 Warn if floating point values are used in equality comparisons.
3237
3238 The idea behind this is that sometimes it is convenient (for the
3239 programmer) to consider floating-point values as approximations to
3240 infinitely precise real numbers.  If you are doing this, then you need
3241 to compute (by analyzing the code, or in some other way) the maximum or
3242 likely maximum error that the computation introduces, and allow for it
3243 when performing comparisons (and when producing output, but that's a
3244 different problem).  In particular, instead of testing for equality, you
3245 would check to see whether the two values have ranges that overlap; and
3246 this is done with the relational operators, so equality comparisons are
3247 probably mistaken.
3248
3249 @item -Wtraditional @r{(C only)}
3250 @opindex Wtraditional
3251 Warn about certain constructs that behave differently in traditional and
3252 ISO C@.  Also warn about ISO C constructs that have no traditional C
3253 equivalent, and/or problematic constructs which should be avoided.
3254
3255 @itemize @bullet
3256 @item
3257 Macro parameters that appear within string literals in the macro body.
3258 In traditional C macro replacement takes place within string literals,
3259 but does not in ISO C@.
3260
3261 @item
3262 In traditional C, some preprocessor directives did not exist.
3263 Traditional preprocessors would only consider a line to be a directive
3264 if the @samp{#} appeared in column 1 on the line.  Therefore
3265 @option{-Wtraditional} warns about directives that traditional C
3266 understands but would ignore because the @samp{#} does not appear as the
3267 first character on the line.  It also suggests you hide directives like
3268 @samp{#pragma} not understood by traditional C by indenting them.  Some
3269 traditional implementations would not recognize @samp{#elif}, so it
3270 suggests avoiding it altogether.
3271
3272 @item
3273 A function-like macro that appears without arguments.
3274
3275 @item
3276 The unary plus operator.
3277
3278 @item
3279 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating point
3280 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
3281 constants.)  Note, these suffixes appear in macros defined in the system
3282 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
3283 Use of these macros in user code might normally lead to spurious
3284 warnings, however GCC's integrated preprocessor has enough context to
3285 avoid warning in these cases.
3286
3287 @item
3288 A function declared external in one block and then used after the end of
3289 the block.
3290
3291 @item
3292 A @code{switch} statement has an operand of type @code{long}.
3293
3294 @item
3295 A non-@code{static} function declaration follows a @code{static} one.
3296 This construct is not accepted by some traditional C compilers.
3297
3298 @item
3299 The ISO type of an integer constant has a different width or
3300 signedness from its traditional type.  This warning is only issued if
3301 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
3302 typically represent bit patterns, are not warned about.
3303
3304 @item
3305 Usage of ISO string concatenation is detected.
3306
3307 @item
3308 Initialization of automatic aggregates.
3309
3310 @item
3311 Identifier conflicts with labels.  Traditional C lacks a separate
3312 namespace for labels.
3313
3314 @item
3315 Initialization of unions.  If the initializer is zero, the warning is
3316 omitted.  This is done under the assumption that the zero initializer in
3317 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
3318 initializer warnings and relies on default initialization to zero in the
3319 traditional C case.
3320
3321 @item
3322 Conversions by prototypes between fixed/floating point values and vice
3323 versa.  The absence of these prototypes when compiling with traditional
3324 C would cause serious problems.  This is a subset of the possible
3325 conversion warnings, for the full set use @option{-Wtraditional-conversion}.
3326
3327 @item
3328 Use of ISO C style function definitions.  This warning intentionally is
3329 @emph{not} issued for prototype declarations or variadic functions
3330 because these ISO C features will appear in your code when using
3331 libiberty's traditional C compatibility macros, @code{PARAMS} and
3332 @code{VPARAMS}.  This warning is also bypassed for nested functions
3333 because that feature is already a GCC extension and thus not relevant to
3334 traditional C compatibility.
3335 @end itemize
3336
3337 @item -Wtraditional-conversion @r{(C only)}
3338 @opindex Wtraditional-conversion
3339 Warn if a prototype causes a type conversion that is different from what
3340 would happen to the same argument in the absence of a prototype.  This
3341 includes conversions of fixed point to floating and vice versa, and
3342 conversions changing the width or signedness of a fixed point argument
3343 except when the same as the default promotion.
3344
3345 @item -Wdeclaration-after-statement @r{(C only)}
3346 @opindex Wdeclaration-after-statement
3347 Warn when a declaration is found after a statement in a block.  This
3348 construct, known from C++, was introduced with ISO C99 and is by default
3349 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
3350 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
3351
3352 @item -Wundef
3353 @opindex Wundef
3354 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
3355
3356 @item -Wno-endif-labels
3357 @opindex Wno-endif-labels
3358 @opindex Wendif-labels
3359 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
3360
3361 @item -Wshadow
3362 @opindex Wshadow
3363 Warn whenever a local variable shadows another local variable, parameter or
3364 global variable or whenever a built-in function is shadowed.
3365
3366 @item -Wlarger-than-@var{len}
3367 @opindex Wlarger-than
3368 Warn whenever an object of larger than @var{len} bytes is defined.
3369
3370 @item -Wunsafe-loop-optimizations
3371 @opindex Wunsafe-loop-optimizations
3372 Warn if the loop cannot be optimized because the compiler could not
3373 assume anything on the bounds of the loop indices.  With
3374 @option{-funsafe-loop-optimizations} warn if the compiler made
3375 such assumptions.
3376
3377 @item -Wpointer-arith
3378 @opindex Wpointer-arith
3379 Warn about anything that depends on the ``size of'' a function type or
3380 of @code{void}.  GNU C assigns these types a size of 1, for
3381 convenience in calculations with @code{void *} pointers and pointers
3382 to functions.  In C++, warn also when an arithmetic operation involves
3383 @code{NULL}.  This warning is also enabled by @option{-pedantic}.
3384
3385 @item -Wtype-limits
3386 @opindex Wtype-limits
3387 @opindex Wno-type-limits
3388 Warn if a comparison is always true or always false due to the limited
3389 range of the data type, but do not warn for constant expressions.  For
3390 example, warn if an unsigned variable is compared against zero with
3391 @samp{<} or @samp{>=}.  This warning is also enabled by
3392 @option{-Wextra}.
3393
3394 @item -Wbad-function-cast @r{(C only)}
3395 @opindex Wbad-function-cast
3396 Warn whenever a function call is cast to a non-matching type.
3397 For example, warn if @code{int malloc()} is cast to @code{anything *}.
3398
3399 @item -Wc++-compat
3400 Warn about ISO C constructs that are outside of the common subset of
3401 ISO C and ISO C++, e.g.@: request for implicit conversion from
3402 @code{void *} to a pointer to non-@code{void} type.
3403
3404 @item -Wc++0x-compat @r{(C++ and Objective-C++ only)}
3405 Warn about C++ constructs whose meaning differs between ISO C++ 1998 and
3406 ISO C++ 200x, e.g., identifiers in ISO C++ 1998 that will become keywords
3407 in ISO C++ 200x.  This warning is enabled by @option{-Wall}.
3408
3409 @item -Wcast-qual
3410 @opindex Wcast-qual
3411 Warn whenever a pointer is cast so as to remove a type qualifier from
3412 the target type.  For example, warn if a @code{const char *} is cast
3413 to an ordinary @code{char *}.
3414
3415 @item -Wcast-align
3416 @opindex Wcast-align
3417 Warn whenever a pointer is cast such that the required alignment of the
3418 target is increased.  For example, warn if a @code{char *} is cast to
3419 an @code{int *} on machines where integers can only be accessed at
3420 two- or four-byte boundaries.
3421
3422 @item -Wwrite-strings
3423 @opindex Wwrite-strings
3424 When compiling C, give string constants the type @code{const
3425 char[@var{length}]} so that
3426 copying the address of one into a non-@code{const} @code{char *}
3427 pointer will get a warning; when compiling C++, warn about the
3428 deprecated conversion from string literals to @code{char *}.  This
3429 warning, by default, is enabled for C++ programs.
3430 These warnings will help you find at
3431 compile time code that can try to write into a string constant, but
3432 only if you have been very careful about using @code{const} in
3433 declarations and prototypes.  Otherwise, it will just be a nuisance;
3434 this is why we did not make @option{-Wall} request these warnings.
3435
3436 @item -Wclobbered
3437 @opindex Wclobbered
3438 Warn for variables that might be changed by @samp{longjmp} or
3439 @samp{vfork}.  This warning is also enabled by @option{-Wextra}.
3440
3441 @item -Wconversion
3442 @opindex Wconversion
3443 @opindex Wno-conversion
3444 Warn for implicit conversions that may alter a value. This includes
3445 conversions between real and integer, like @code{abs (x)} when
3446 @code{x} is @code{double}; conversions between signed and unsigned,
3447 like @code{unsigned ui = -1}; and conversions to smaller types, like
3448 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
3449 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
3450 changed by the conversion like in @code{abs (2.0)}.  Warnings about
3451 conversions between signed and unsigned integers can be disabled by
3452 using @option{-Wno-sign-conversion}.
3453
3454 For C++, also warn for conversions between @code{NULL} and non-pointer
3455 types; confusing overload resolution for user-defined conversions; and
3456 conversions that will never use a type conversion operator:
3457 conversions to @code{void}, the same type, a base class or a reference
3458 to them. Warnings about conversions between signed and unsigned
3459 integers are disabled by default in C++ unless
3460 @option{-Wsign-conversion} is explicitly enabled.
3461
3462 @item -Wempty-body
3463 @opindex Wempty-body
3464 Warn if an empty body occurs in an @samp{if}, @samp{else} or @samp{do
3465 while} statement.  Additionally, in C++, warn when an empty body occurs
3466 in a @samp{while} or @samp{for} statement with no whitespacing before
3467 the semicolon.  This warning is also enabled by @option{-Wextra}.
3468
3469 @item -Wsign-compare
3470 @opindex Wsign-compare
3471 @cindex warning for comparison of signed and unsigned values
3472 @cindex comparison of signed and unsigned values, warning
3473 @cindex signed and unsigned values, comparison warning
3474 Warn when a comparison between signed and unsigned values could produce
3475 an incorrect result when the signed value is converted to unsigned.
3476 This warning is also enabled by @option{-Wextra}; to get the other warnings
3477 of @option{-Wextra} without this warning, use @samp{-Wextra -Wno-sign-compare}.
3478
3479 @item -Wsign-conversion
3480 @opindex Wsign-conversion
3481 @opindex Wno-sign-conversion
3482 Warn for implicit conversions that may change the sign of an integer
3483 value, like assigning a signed integer expression to an unsigned
3484 integer variable. An explicit cast silences the warning. In C, this
3485 option is enabled also by @option{-Wconversion}.
3486
3487 @item -Waddress
3488 @opindex Waddress
3489 @opindex Wno-address
3490 Warn about suspicious uses of memory addresses. These include using
3491 the address of a function in a conditional expression, such as
3492 @code{void func(void); if (func)}, and comparisons against the memory
3493 address of a string literal, such as @code{if (x == "abc")}.  Such
3494 uses typically indicate a programmer error: the address of a function
3495 always evaluates to true, so their use in a conditional usually
3496 indicate that the programmer forgot the parentheses in a function
3497 call; and comparisons against string literals result in unspecified
3498 behavior and are not portable in C, so they usually indicate that the
3499 programmer intended to use @code{strcmp}.  This warning is enabled by
3500 @option{-Wall}.
3501
3502 @item -Wlogical-op
3503 @opindex Wlogical-op
3504 @opindex Wno-logical-op
3505 Warn about suspicious uses of logical operators in expressions.
3506 This includes using logical operators in contexts where a
3507 bit-wise operator is likely to be expected.
3508
3509 @item -Waggregate-return
3510 @opindex Waggregate-return
3511 Warn if any functions that return structures or unions are defined or
3512 called.  (In languages where you can return an array, this also elicits
3513 a warning.)
3514
3515 @item -Wno-attributes
3516 @opindex Wno-attributes
3517 @opindex Wattributes
3518 Do not warn if an unexpected @code{__attribute__} is used, such as
3519 unrecognized attributes, function attributes applied to variables,
3520 etc.  This will not stop errors for incorrect use of supported
3521 attributes.
3522
3523 @item -Wstrict-prototypes @r{(C only)}
3524 @opindex Wstrict-prototypes
3525 Warn if a function is declared or defined without specifying the
3526 argument types.  (An old-style function definition is permitted without
3527 a warning if preceded by a declaration which specifies the argument
3528 types.)
3529
3530 @item -Wold-style-declaration @r{(C only)}
3531 @opindex Wold-style-declaration
3532 Warn for obsolescent usages, according to the C Standard, in a
3533 declaration. For example, warn if storage-class specifiers like
3534 @code{static} are not the first things in a declaration.  This warning
3535 is also enabled by @option{-Wextra}.
3536
3537 @item -Wold-style-definition @r{(C only)}
3538 @opindex Wold-style-definition
3539 Warn if an old-style function definition is used.  A warning is given
3540 even if there is a previous prototype.
3541
3542 @item -Wmissing-parameter-type @r{(C only)}
3543 @opindex Wmissing-parameter-type
3544 A function parameter is declared without a type specifier in K&R-style
3545 functions:
3546
3547 @smallexample
3548 void foo(bar) @{ @}
3549 @end smallexample
3550
3551 This warning is also enabled by @option{-Wextra}.
3552
3553 @item -Wmissing-prototypes @r{(C only)}
3554 @opindex Wmissing-prototypes
3555 Warn if a global function is defined without a previous prototype
3556 declaration.  This warning is issued even if the definition itself
3557 provides a prototype.  The aim is to detect global functions that fail
3558 to be declared in header files.
3559
3560 @item -Wmissing-declarations @r{(C and C++ only)}
3561 @opindex Wmissing-declarations
3562 Warn if a global function is defined without a previous declaration.
3563 Do so even if the definition itself provides a prototype.
3564 Use this option to detect global functions that are not declared in
3565 header files.  In C++, no warnings are issued for function templates,
3566 or for inline functions, or for functions in anonymous namespaces.
3567
3568 @item -Wmissing-field-initializers
3569 @opindex Wmissing-field-initializers
3570 @opindex W
3571 @opindex Wextra
3572 Warn if a structure's initializer has some fields missing.  For
3573 example, the following code would cause such a warning, because
3574 @code{x.h} is implicitly zero:
3575
3576 @smallexample
3577 struct s @{ int f, g, h; @};
3578 struct s x = @{ 3, 4 @};
3579 @end smallexample
3580
3581 This option does not warn about designated initializers, so the following
3582 modification would not trigger a warning:
3583
3584 @smallexample
3585 struct s @{ int f, g, h; @};
3586 struct s x = @{ .f = 3, .g = 4 @};
3587 @end smallexample
3588
3589 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
3590 warnings without this one, use @samp{-Wextra -Wno-missing-field-initializers}.
3591
3592 @item -Wmissing-noreturn
3593 @opindex Wmissing-noreturn
3594 Warn about functions which might be candidates for attribute @code{noreturn}.
3595 Note these are only possible candidates, not absolute ones.  Care should
3596 be taken to manually verify functions actually do not ever return before
3597 adding the @code{noreturn} attribute, otherwise subtle code generation
3598 bugs could be introduced.  You will not get a warning for @code{main} in
3599 hosted C environments.
3600
3601 @item -Wmissing-format-attribute
3602 @opindex Wmissing-format-attribute
3603 @opindex Wformat
3604 Warn about function pointers which might be candidates for @code{format}
3605 attributes.  Note these are only possible candidates, not absolute ones.
3606 GCC will guess that function pointers with @code{format} attributes that
3607 are used in assignment, initialization, parameter passing or return
3608 statements should have a corresponding @code{format} attribute in the
3609 resulting type.  I.e.@: the left-hand side of the assignment or
3610 initialization, the type of the parameter variable, or the return type
3611 of the containing function respectively should also have a @code{format}
3612 attribute to avoid the warning.
3613
3614 GCC will also warn about function definitions which might be
3615 candidates for @code{format} attributes.  Again, these are only
3616 possible candidates.  GCC will guess that @code{format} attributes
3617 might be appropriate for any function that calls a function like
3618 @code{vprintf} or @code{vscanf}, but this might not always be the
3619 case, and some functions for which @code{format} attributes are
3620 appropriate may not be detected.
3621
3622 @item -Wno-multichar
3623 @opindex Wno-multichar
3624 @opindex Wmultichar
3625 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
3626 Usually they indicate a typo in the user's code, as they have
3627 implementation-defined values, and should not be used in portable code.
3628
3629 @item -Wnormalized=<none|id|nfc|nfkc>
3630 @opindex Wnormalized
3631 @cindex NFC
3632 @cindex NFKC
3633 @cindex character set, input normalization
3634 In ISO C and ISO C++, two identifiers are different if they are
3635 different sequences of characters.  However, sometimes when characters
3636 outside the basic ASCII character set are used, you can have two
3637 different character sequences that look the same.  To avoid confusion,
3638 the ISO 10646 standard sets out some @dfn{normalization rules} which
3639 when applied ensure that two sequences that look the same are turned into
3640 the same sequence.  GCC can warn you if you are using identifiers which
3641 have not been normalized; this option controls that warning.
3642
3643 There are four levels of warning that GCC supports.  The default is
3644 @option{-Wnormalized=nfc}, which warns about any identifier which is
3645 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
3646 recommended form for most uses.
3647
3648 Unfortunately, there are some characters which ISO C and ISO C++ allow
3649 in identifiers that when turned into NFC aren't allowable as
3650 identifiers.  That is, there's no way to use these symbols in portable
3651 ISO C or C++ and have all your identifiers in NFC.
3652 @option{-Wnormalized=id} suppresses the warning for these characters.
3653 It is hoped that future versions of the standards involved will correct
3654 this, which is why this option is not the default.
3655
3656 You can switch the warning off for all characters by writing
3657 @option{-Wnormalized=none}.  You would only want to do this if you
3658 were using some other normalization scheme (like ``D''), because
3659 otherwise you can easily create bugs that are literally impossible to see.
3660
3661 Some characters in ISO 10646 have distinct meanings but look identical
3662 in some fonts or display methodologies, especially once formatting has
3663 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
3664 LETTER N'', will display just like a regular @code{n} which has been
3665 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
3666 normalization scheme to convert all these into a standard form as
3667 well, and GCC will warn if your code is not in NFKC if you use
3668 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
3669 about every identifier that contains the letter O because it might be
3670 confused with the digit 0, and so is not the default, but may be
3671 useful as a local coding convention if the programming environment is
3672 unable to be fixed to display these characters distinctly.
3673
3674 @item -Wno-deprecated-declarations
3675 @opindex Wno-deprecated-declarations
3676 Do not warn about uses of functions (@pxref{Function Attributes}),
3677 variables (@pxref{Variable Attributes}), and types (@pxref{Type
3678 Attributes}) marked as deprecated by using the @code{deprecated}
3679 attribute.
3680
3681 @item -Wno-overflow
3682 @opindex Wno-overflow
3683 Do not warn about compile-time overflow in constant expressions.
3684
3685 @item -Woverride-init
3686 @opindex Woverride-init
3687 @opindex W
3688 @opindex Wextra
3689 Warn if an initialized field without side effects is overridden when
3690 using designated initializers (@pxref{Designated Inits, , Designated
3691 Initializers}).
3692
3693 This warning is included in @option{-Wextra}.  To get other
3694 @option{-Wextra} warnings without this one, use @samp{-Wextra
3695 -Wno-override-init}.
3696
3697 @item -Wpacked
3698 @opindex Wpacked
3699 Warn if a structure is given the packed attribute, but the packed
3700 attribute has no effect on the layout or size of the structure.
3701 Such structures may be mis-aligned for little benefit.  For
3702 instance, in this code, the variable @code{f.x} in @code{struct bar}
3703 will be misaligned even though @code{struct bar} does not itself
3704 have the packed attribute:
3705
3706 @smallexample
3707 @group
3708 struct foo @{
3709   int x;
3710   char a, b, c, d;
3711 @} __attribute__((packed));
3712 struct bar @{
3713   char z;
3714   struct foo f;
3715 @};
3716 @end group
3717 @end smallexample
3718
3719 @item -Wpadded
3720 @opindex Wpadded
3721 Warn if padding is included in a structure, either to align an element
3722 of the structure or to align the whole structure.  Sometimes when this
3723 happens it is possible to rearrange the fields of the structure to
3724 reduce the padding and so make the structure smaller.
3725
3726 @item -Wredundant-decls
3727 @opindex Wredundant-decls
3728 Warn if anything is declared more than once in the same scope, even in
3729 cases where multiple declaration is valid and changes nothing.
3730
3731 @item -Wnested-externs @r{(C only)}
3732 @opindex Wnested-externs
3733 Warn if an @code{extern} declaration is encountered within a function.
3734
3735 @item -Wunreachable-code
3736 @opindex Wunreachable-code
3737 Warn if the compiler detects that code will never be executed.
3738
3739 This option is intended to warn when the compiler detects that at
3740 least a whole line of source code will never be executed, because
3741 some condition is never satisfied or because it is after a
3742 procedure that never returns.
3743
3744 It is possible for this option to produce a warning even though there
3745 are circumstances under which part of the affected line can be executed,
3746 so care should be taken when removing apparently-unreachable code.
3747
3748 For instance, when a function is inlined, a warning may mean that the
3749 line is unreachable in only one inlined copy of the function.
3750
3751 This option is not made part of @option{-Wall} because in a debugging
3752 version of a program there is often substantial code which checks
3753 correct functioning of the program and is, hopefully, unreachable
3754 because the program does work.  Another common use of unreachable
3755 code is to provide behavior which is selectable at compile-time.
3756
3757 @item -Winline
3758 @opindex Winline
3759 Warn if a function can not be inlined and it was declared as inline.
3760 Even with this option, the compiler will not warn about failures to
3761 inline functions declared in system headers.
3762
3763 The compiler uses a variety of heuristics to determine whether or not
3764 to inline a function.  For example, the compiler takes into account
3765 the size of the function being inlined and the amount of inlining
3766 that has already been done in the current function.  Therefore,
3767 seemingly insignificant changes in the source program can cause the
3768 warnings produced by @option{-Winline} to appear or disappear.
3769
3770 @item -Wno-invalid-offsetof @r{(C++ only)}
3771 @opindex Wno-invalid-offsetof
3772 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
3773 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
3774 to a non-POD type is undefined.  In existing C++ implementations,
3775 however, @samp{offsetof} typically gives meaningful results even when
3776 applied to certain kinds of non-POD types. (Such as a simple
3777 @samp{struct} that fails to be a POD type only by virtue of having a
3778 constructor.)  This flag is for users who are aware that they are
3779 writing nonportable code and who have deliberately chosen to ignore the
3780 warning about it.
3781
3782 The restrictions on @samp{offsetof} may be relaxed in a future version
3783 of the C++ standard.
3784
3785 @item -Wno-int-to-pointer-cast @r{(C only)}
3786 @opindex Wno-int-to-pointer-cast
3787 Suppress warnings from casts to pointer type of an integer of a
3788 different size.
3789
3790 @item -Wno-pointer-to-int-cast @r{(C only)}
3791 @opindex Wno-pointer-to-int-cast
3792 Suppress warnings from casts from a pointer to an integer type of a
3793 different size.
3794
3795 @item -Winvalid-pch
3796 @opindex Winvalid-pch
3797 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
3798 the search path but can't be used.
3799
3800 @item -Wlong-long
3801 @opindex Wlong-long
3802 @opindex Wno-long-long
3803 Warn if @samp{long long} type is used.  This is default.  To inhibit
3804 the warning messages, use @option{-Wno-long-long}.  Flags
3805 @option{-Wlong-long} and @option{-Wno-long-long} are taken into account
3806 only when @option{-pedantic} flag is used.
3807
3808 @item -Wvariadic-macros
3809 @opindex Wvariadic-macros
3810 @opindex Wno-variadic-macros
3811 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
3812 alternate syntax when in pedantic ISO C99 mode.  This is default.
3813 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
3814
3815 @item -Wvla
3816 @opindex Wvla
3817 @opindex Wno-vla
3818 Warn if variable length array is used in the code.
3819 @option{-Wno-vla} will prevent the @option{-pedantic} warning of
3820 the variable length array.
3821
3822 @item -Wvolatile-register-var
3823 @opindex Wvolatile-register-var
3824 @opindex Wno-volatile-register-var
3825 Warn if a register variable is declared volatile.  The volatile
3826 modifier does not inhibit all optimizations that may eliminate reads
3827 and/or writes to register variables.
3828
3829 @item -Wdisabled-optimization
3830 @opindex Wdisabled-optimization
3831 Warn if a requested optimization pass is disabled.  This warning does
3832 not generally indicate that there is anything wrong with your code; it
3833 merely indicates that GCC's optimizers were unable to handle the code
3834 effectively.  Often, the problem is that your code is too big or too
3835 complex; GCC will refuse to optimize programs when the optimization
3836 itself is likely to take inordinate amounts of time.
3837
3838 @item -Wpointer-sign
3839 @opindex Wpointer-sign
3840 @opindex Wno-pointer-sign
3841 Warn for pointer argument passing or assignment with different signedness.
3842 This option is only supported for C and Objective-C@.  It is implied by
3843 @option{-Wall} and by @option{-pedantic}, which can be disabled with
3844 @option{-Wno-pointer-sign}.
3845
3846 @item -Werror
3847 @opindex Werror
3848 Make all warnings into errors.
3849
3850 @item -Werror=
3851 @opindex Werror=
3852 Make the specified warning into an errors.  The specifier for a
3853 warning is appended, for example @option{-Werror=switch} turns the
3854 warnings controlled by @option{-Wswitch} into errors.  This switch
3855 takes a negative form, to be used to negate @option{-Werror} for
3856 specific warnings, for example @option{-Wno-error=switch} makes
3857 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
3858 is in effect.  You can use the @option{-fdiagnostics-show-option}
3859 option to have each controllable warning amended with the option which
3860 controls it, to determine what to use with this option.
3861
3862 Note that specifying @option{-Werror=}@var{foo} automatically implies
3863 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
3864 imply anything.
3865
3866 @item -Wstack-protector
3867 @opindex Wstack-protector
3868 This option is only active when @option{-fstack-protector} is active.  It
3869 warns about functions that will not be protected against stack smashing.
3870
3871 @item -Woverlength-strings
3872 @opindex Woverlength-strings
3873 Warn about string constants which are longer than the ``minimum
3874 maximum'' length specified in the C standard.  Modern compilers
3875 generally allow string constants which are much longer than the
3876 standard's minimum limit, but very portable programs should avoid
3877 using longer strings.
3878
3879 The limit applies @emph{after} string constant concatenation, and does
3880 not count the trailing NUL@.  In C89, the limit was 509 characters; in
3881 C99, it was raised to 4095.  C++98 does not specify a normative
3882 minimum maximum, so we do not diagnose overlength strings in C++@.
3883
3884 This option is implied by @option{-pedantic}, and can be disabled with
3885 @option{-Wno-overlength-strings}.
3886 @end table
3887
3888 @node Debugging Options
3889 @section Options for Debugging Your Program or GCC
3890 @cindex options, debugging
3891 @cindex debugging information options
3892
3893 GCC has various special options that are used for debugging
3894 either your program or GCC:
3895
3896 @table @gcctabopt
3897 @item -g
3898 @opindex g
3899 Produce debugging information in the operating system's native format
3900 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
3901 information.
3902
3903 On most systems that use stabs format, @option{-g} enables use of extra
3904 debugging information that only GDB can use; this extra information
3905 makes debugging work better in GDB but will probably make other debuggers
3906 crash or
3907 refuse to read the program.  If you want to control for certain whether
3908 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
3909 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
3910
3911 GCC allows you to use @option{-g} with
3912 @option{-O}.  The shortcuts taken by optimized code may occasionally
3913 produce surprising results: some variables you declared may not exist
3914 at all; flow of control may briefly move where you did not expect it;
3915 some statements may not be executed because they compute constant
3916 results or their values were already at hand; some statements may
3917 execute in different places because they were moved out of loops.
3918
3919 Nevertheless it proves possible to debug optimized output.  This makes
3920 it reasonable to use the optimizer for programs that might have bugs.
3921
3922 The following options are useful when GCC is generated with the
3923 capability for more than one debugging format.
3924
3925 @item -ggdb
3926 @opindex ggdb
3927 Produce debugging information for use by GDB@.  This means to use the
3928 most expressive format available (DWARF 2, stabs, or the native format
3929 if neither of those are supported), including GDB extensions if at all
3930 possible.
3931
3932 @item -gstabs
3933 @opindex gstabs
3934 Produce debugging information in stabs format (if that is supported),
3935 without GDB extensions.  This is the format used by DBX on most BSD
3936 systems.  On MIPS, Alpha and System V Release 4 systems this option
3937 produces stabs debugging output which is not understood by DBX or SDB@.
3938 On System V Release 4 systems this option requires the GNU assembler.
3939
3940 @item -feliminate-unused-debug-symbols
3941 @opindex feliminate-unused-debug-symbols
3942 Produce debugging information in stabs format (if that is supported),
3943 for only symbols that are actually used.
3944
3945 @item -femit-class-debug-always
3946 Instead of emitting debugging information for a C++ class in only one
3947 object file, emit it in all object files using the class.  This option
3948 should be used only with debuggers that are unable to handle the way GCC
3949 normally emits debugging information for classes because using this
3950 option will increase the size of debugging information by as much as a
3951 factor of two.
3952
3953 @item -gstabs+
3954 @opindex gstabs+
3955 Produce debugging information in stabs format (if that is supported),
3956 using GNU extensions understood only by the GNU debugger (GDB)@.  The
3957 use of these extensions is likely to make other debuggers crash or
3958 refuse to read the program.
3959
3960 @item -gcoff
3961 @opindex gcoff
3962 Produce debugging information in COFF format (if that is supported).
3963 This is the format used by SDB on most System V systems prior to
3964 System V Release 4.
3965
3966 @item -gxcoff
3967 @opindex gxcoff
3968 Produce debugging information in XCOFF format (if that is supported).
3969 This is the format used by the DBX debugger on IBM RS/6000 systems.
3970
3971 @item -gxcoff+
3972 @opindex gxcoff+
3973 Produce debugging information in XCOFF format (if that is supported),
3974 using GNU extensions understood only by the GNU debugger (GDB)@.  The
3975 use of these extensions is likely to make other debuggers crash or
3976 refuse to read the program, and may cause assemblers other than the GNU
3977 assembler (GAS) to fail with an error.
3978
3979 @item -gdwarf-2
3980 @opindex gdwarf-2
3981 Produce debugging information in DWARF version 2 format (if that is
3982 supported).  This is the format used by DBX on IRIX 6.  With this
3983 option, GCC uses features of DWARF version 3 when they are useful;
3984 version 3 is upward compatible with version 2, but may still cause
3985 problems for older debuggers.
3986
3987 @item -gvms
3988 @opindex gvms
3989 Produce debugging information in VMS debug format (if that is
3990 supported).  This is the format used by DEBUG on VMS systems.
3991
3992 @item -g@var{level}
3993 @itemx -ggdb@var{level}
3994 @itemx -gstabs@var{level}
3995 @itemx -gcoff@var{level}
3996 @itemx -gxcoff@var{level}
3997 @itemx -gvms@var{level}
3998 Request debugging information and also use @var{level} to specify how
3999 much information.  The default level is 2.
4000
4001 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
4002 @option{-g}.
4003
4004 Level 1 produces minimal information, enough for making backtraces in
4005 parts of the program that you don't plan to debug.  This includes
4006 descriptions of functions and external variables, but no information
4007 about local variables and no line numbers.
4008
4009 Level 3 includes extra information, such as all the macro definitions
4010 present in the program.  Some debuggers support macro expansion when
4011 you use @option{-g3}.
4012
4013 @option{-gdwarf-2} does not accept a concatenated debug level, because
4014 GCC used to support an option @option{-gdwarf} that meant to generate
4015 debug information in version 1 of the DWARF format (which is very
4016 different from version 2), and it would have been too confusing.  That
4017 debug format is long obsolete, but the option cannot be changed now.
4018 Instead use an additional @option{-g@var{level}} option to change the
4019 debug level for DWARF2.
4020
4021 @item -feliminate-dwarf2-dups
4022 @opindex feliminate-dwarf2-dups
4023 Compress DWARF2 debugging information by eliminating duplicated
4024 information about each symbol.  This option only makes sense when
4025 generating DWARF2 debugging information with @option{-gdwarf-2}.
4026
4027 @item -femit-struct-debug-baseonly
4028 Emit debug information for struct-like types
4029 only when the base name of the compilation source file
4030 matches the base name of file in which the struct was defined.
4031
4032 This option substantially reduces the size of debugging information,
4033 but at significant potential loss in type information to the debugger.
4034 See @option{-femit-struct-debug-reduced} for a less aggressive option.
4035 See @option{-femit-struct-debug-detailed} for more detailed control.
4036
4037 This option works only with DWARF 2.
4038
4039 @item -femit-struct-debug-reduced
4040 Emit debug information for struct-like types
4041 only when the base name of the compilation source file
4042 matches the base name of file in which the type was defined,
4043 unless the struct is a template or defined in a system header.
4044
4045 This option significantly reduces the size of debugging information,
4046 with some potential loss in type information to the debugger.
4047 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
4048 See @option{-femit-struct-debug-detailed} for more detailed control.
4049
4050 This option works only with DWARF 2.
4051
4052 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
4053 Specify the struct-like types
4054 for which the compiler will generate debug information.
4055 The intent is to reduce duplicate struct debug information
4056 between different object files within the same program.
4057
4058 This option is a detailed version of
4059 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
4060 which will serve for most needs.
4061
4062 A specification has the syntax
4063 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
4064
4065 The optional first word limits the specification to
4066 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
4067 A struct type is used directly when it is the type of a variable, member.
4068 Indirect uses arise through pointers to structs.
4069 That is, when use of an incomplete struct would be legal, the use is indirect.
4070 An example is
4071 @samp{struct one direct; struct two * indirect;}.
4072
4073 The optional second word limits the specification to
4074 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
4075 Generic structs are a bit complicated to explain.
4076 For C++, these are non-explicit specializations of template classes,
4077 or non-template classes within the above.
4078 Other programming languages have generics,
4079 but @samp{-femit-struct-debug-detailed} does not yet implement them.
4080
4081 The third word specifies the source files for those
4082 structs for which the compiler will emit debug information.
4083 The values @samp{none} and @samp{any} have the normal meaning.
4084 The value @samp{base} means that
4085 the base of name of the file in which the type declaration appears
4086 must match the base of the name of the main compilation file.
4087 In practice, this means that
4088 types declared in @file{foo.c} and @file{foo.h} will have debug information,
4089 but types declared in other header will not.
4090 The value @samp{sys} means those types satisfying @samp{base}
4091 or declared in system or compiler headers.
4092
4093 You may need to experiment to determine the best settings for your application.
4094
4095 The default is @samp{-femit-struct-debug-detailed=all}.
4096
4097 This option works only with DWARF 2.
4098
4099 @cindex @command{prof}
4100 @item -p
4101 @opindex p
4102 Generate extra code to write profile information suitable for the
4103 analysis program @command{prof}.  You must use this option when compiling
4104 the source files you want data about, and you must also use it when
4105 linking.
4106
4107 @cindex @command{gprof}
4108 @item -pg
4109 @opindex pg
4110 Generate extra code to write profile information suitable for the
4111 analysis program @command{gprof}.  You must use this option when compiling
4112 the source files you want data about, and you must also use it when
4113 linking.
4114
4115 @item -Q
4116 @opindex Q
4117 Makes the compiler print out each function name as it is compiled, and
4118 print some statistics about each pass when it finishes.
4119
4120 @item -ftime-report
4121 @opindex ftime-report
4122 Makes the compiler print some statistics about the time consumed by each
4123 pass when it finishes.
4124
4125 @item -fmem-report
4126 @opindex fmem-report
4127 Makes the compiler print some statistics about permanent memory
4128 allocation when it finishes.
4129
4130 @item -fpre-ipa-mem-report
4131 @opindex fpre-ipa-mem-report
4132 @item -fpost-ipa-mem-report
4133 @opindex fpost-ipa-mem-report
4134 Makes the compiler print some statistics about permanent memory
4135 allocation before or after interprocedural optimization.
4136
4137 @item -fprofile-arcs
4138 @opindex fprofile-arcs
4139 Add code so that program flow @dfn{arcs} are instrumented.  During
4140 execution the program records how many times each branch and call is
4141 executed and how many times it is taken or returns.  When the compiled
4142 program exits it saves this data to a file called
4143 @file{@var{auxname}.gcda} for each source file.  The data may be used for
4144 profile-directed optimizations (@option{-fbranch-probabilities}), or for
4145 test coverage analysis (@option{-ftest-coverage}).  Each object file's
4146 @var{auxname} is generated from the name of the output file, if
4147 explicitly specified and it is not the final executable, otherwise it is
4148 the basename of the source file.  In both cases any suffix is removed
4149 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
4150 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
4151 @xref{Cross-profiling}.
4152
4153 @cindex @command{gcov}
4154 @item --coverage
4155 @opindex coverage
4156
4157 This option is used to compile and link code instrumented for coverage
4158 analysis.  The option is a synonym for @option{-fprofile-arcs}
4159 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
4160 linking).  See the documentation for those options for more details.
4161
4162 @itemize
4163
4164 @item
4165 Compile the source files with @option{-fprofile-arcs} plus optimization
4166 and code generation options.  For test coverage analysis, use the
4167 additional @option{-ftest-coverage} option.  You do not need to profile
4168 every source file in a program.
4169
4170 @item
4171 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
4172 (the latter implies the former).
4173
4174 @item
4175 Run the program on a representative workload to generate the arc profile
4176 information.  This may be repeated any number of times.  You can run
4177 concurrent instances of your program, and provided that the file system
4178 supports locking, the data files will be correctly updated.  Also
4179 @code{fork} calls are detected and correctly handled (double counting
4180 will not happen).
4181
4182 @item
4183 For profile-directed optimizations, compile the source files again with
4184 the same optimization and code generation options plus
4185 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
4186 Control Optimization}).
4187
4188 @item
4189 For test coverage analysis, use @command{gcov} to produce human readable
4190 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
4191 @command{gcov} documentation for further information.
4192
4193 @end itemize
4194
4195 With @option{-fprofile-arcs}, for each function of your program GCC
4196 creates a program flow graph, then finds a spanning tree for the graph.
4197 Only arcs that are not on the spanning tree have to be instrumented: the
4198 compiler adds code to count the number of times that these arcs are
4199 executed.  When an arc is the only exit or only entrance to a block, the
4200 instrumentation code can be added to the block; otherwise, a new basic
4201 block must be created to hold the instrumentation code.
4202
4203 @need 2000
4204 @item -ftest-coverage
4205 @opindex ftest-coverage
4206 Produce a notes file that the @command{gcov} code-coverage utility
4207 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
4208 show program coverage.  Each source file's note file is called
4209 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
4210 above for a description of @var{auxname} and instructions on how to
4211 generate test coverage data.  Coverage data will match the source files
4212 more closely, if you do not optimize.
4213
4214 @item -d@var{letters}
4215 @item -fdump-rtl-@var{pass}
4216 @opindex d
4217 Says to make debugging dumps during compilation at times specified by
4218 @var{letters}.    This is used for debugging the RTL-based passes of the
4219 compiler.  The file names for most of the dumps are made by appending a
4220 pass number and a word to the @var{dumpname}.  @var{dumpname} is generated
4221 from the name of the output file, if explicitly specified and it is not
4222 an executable, otherwise it is the basename of the source file.
4223
4224 Most debug dumps can be enabled either passing a letter to the @option{-d}
4225 option, or with a long @option{-fdump-rtl} switch; here are the possible
4226 letters for use in @var{letters} and @var{pass}, and their meanings:
4227
4228 @table @gcctabopt
4229 @item -dA
4230 @opindex dA
4231 Annotate the assembler output with miscellaneous debugging information.
4232
4233 @item -dB
4234 @itemx -fdump-rtl-bbro
4235 @opindex dB
4236 @opindex fdump-rtl-bbro
4237 Dump after block reordering, to @file{@var{file}.148r.bbro}.
4238
4239 @item -dc
4240 @itemx -fdump-rtl-combine
4241 @opindex dc
4242 @opindex fdump-rtl-combine
4243 Dump after the RTL instruction combination pass, to the file
4244 @file{@var{file}.129r.combine}.
4245
4246 @item -dC
4247 @itemx -fdump-rtl-ce1
4248 @itemx -fdump-rtl-ce2
4249 @opindex dC
4250 @opindex fdump-rtl-ce1
4251 @opindex fdump-rtl-ce2
4252 @option{-dC} and @option{-fdump-rtl-ce1} enable dumping after the
4253 first if conversion, to the file @file{@var{file}.117r.ce1}.  @option{-dC}
4254 and @option{-fdump-rtl-ce2} enable dumping after the second if
4255 conversion, to the file @file{@var{file}.130r.ce2}.
4256
4257 @item -dd
4258 @itemx -fdump-rtl-btl
4259 @itemx -fdump-rtl-dbr
4260 @opindex dd
4261 @opindex fdump-rtl-btl
4262 @opindex fdump-rtl-dbr
4263 @option{-dd} and @option{-fdump-rtl-btl} enable dumping after branch
4264 target load optimization, to @file{@var{file}.31.btl}.  @option{-dd}
4265 and @option{-fdump-rtl-dbr} enable dumping after delayed branch
4266 scheduling, to @file{@var{file}.36.dbr}.
4267
4268 @item -dD
4269 @opindex dD
4270 Dump all macro definitions, at the end of preprocessing, in addition to
4271 normal output.
4272
4273 @item -dE
4274 @itemx -fdump-rtl-ce3
4275 @opindex dE
4276 @opindex fdump-rtl-ce3
4277 Dump after the third if conversion, to @file{@var{file}.146r.ce3}.
4278
4279 @item -df
4280 @itemx -fdump-rtl-cfg
4281 @itemx -fdump-rtl-life
4282 @opindex df
4283 @opindex fdump-rtl-cfg
4284 @opindex fdump-rtl-life
4285 @option{-df} and @option{-fdump-rtl-cfg} enable dumping after control
4286 and data flow analysis, to @file{@var{file}.116r.cfg}.  @option{-df}
4287 and @option{-fdump-rtl-cfg} enable dumping dump after life analysis,
4288 to @file{@var{file}.128r.life1} and @file{@var{file}.135r.life2}.
4289
4290 @item -dg
4291 @itemx -fdump-rtl-greg
4292 @opindex dg
4293 @opindex fdump-rtl-greg
4294 Dump after global register allocation, to @file{@var{file}.139r.greg}.
4295
4296 @item -dG
4297 @itemx -fdump-rtl-gcse
4298 @itemx -fdump-rtl-bypass
4299 @opindex dG
4300 @opindex fdump-rtl-gcse
4301 @opindex fdump-rtl-bypass
4302 @option{-dG} and @option{-fdump-rtl-gcse} enable dumping after GCSE, to
4303 @file{@var{file}.114r.gcse}.  @option{-dG} and @option{-fdump-rtl-bypass}
4304 enable dumping after jump bypassing and control flow optimizations, to
4305 @file{@var{file}.115r.bypass}.
4306
4307 @item -dh
4308 @itemx -fdump-rtl-eh
4309 @opindex dh
4310 @opindex fdump-rtl-eh
4311 Dump after finalization of EH handling code, to @file{@var{file}.02.eh}.
4312
4313 @item -di
4314 @itemx -fdump-rtl-sibling
4315 @opindex di
4316 @opindex fdump-rtl-sibling
4317 Dump after sibling call optimizations, to @file{@var{file}.106r.sibling}.
4318
4319 @item -dj
4320 @itemx -fdump-rtl-jump
4321 @opindex dj
4322 @opindex fdump-rtl-jump
4323 Dump after the first jump optimization, to @file{@var{file}.112r.jump}.
4324
4325 @item -dk
4326 @itemx -fdump-rtl-stack
4327 @opindex dk
4328 @opindex fdump-rtl-stack
4329 Dump after conversion from GCC's "flat register file" registers to the
4330 x87's stack-like registers, to @file{@var{file}.152r.stack}.
4331
4332 @item -dl
4333 @itemx -fdump-rtl-lreg
4334 @opindex dl
4335 @opindex fdump-rtl-lreg
4336 Dump after local register allocation, to @file{@var{file}.138r.lreg}.
4337
4338 @item -dL
4339 @itemx -fdump-rtl-loop2
4340 @opindex dL
4341 @opindex fdump-rtl-loop2
4342 @option{-dL} and @option{-fdump-rtl-loop2} enable dumping after the
4343 loop optimization pass, to @file{@var{file}.119r.loop2},
4344 @file{@var{file}.120r.loop2_init},
4345 @file{@var{file}.121r.loop2_invariant}, and
4346 @file{@var{file}.125r.loop2_done}.
4347
4348 @item -dm
4349 @itemx -fdump-rtl-sms
4350 @opindex dm
4351 @opindex fdump-rtl-sms
4352 Dump after modulo scheduling, to @file{@var{file}.136r.sms}.
4353
4354 @item -dM
4355 @itemx -fdump-rtl-mach
4356 @opindex dM
4357 @opindex fdump-rtl-mach
4358 Dump after performing the machine dependent reorganization pass, to
4359 @file{@var{file}.155r.mach}.
4360
4361 @item -dn
4362 @itemx -fdump-rtl-rnreg
4363 @opindex dn
4364 @opindex fdump-rtl-rnreg
4365 Dump after register renumbering, to @file{@var{file}.147r.rnreg}.
4366
4367 @item -dN
4368 @itemx -fdump-rtl-regmove
4369 @opindex dN
4370 @opindex fdump-rtl-regmove
4371 Dump after the register move pass, to @file{@var{file}.132r.regmove}.
4372
4373 @item -do
4374 @itemx -fdump-rtl-postreload
4375 @opindex do
4376 @opindex fdump-rtl-postreload
4377 Dump after post-reload optimizations, to @file{@var{file}.24.postreload}.
4378
4379 @item -dr
4380 @itemx -fdump-rtl-expand
4381 @opindex dr
4382 @opindex fdump-rtl-expand
4383 Dump after RTL generation, to @file{@var{file}.104r.expand}.
4384
4385 @item -dR
4386 @itemx -fdump-rtl-sched2
4387 @opindex dR
4388 @opindex fdump-rtl-sched2
4389 Dump after the second scheduling pass, to @file{@var{file}.149r.sched2}.
4390
4391 @item -ds
4392 @itemx -fdump-rtl-cse
4393 @opindex ds
4394 @opindex fdump-rtl-cse
4395 Dump after CSE (including the jump optimization that sometimes follows
4396 CSE), to @file{@var{file}.113r.cse}.
4397
4398 @item -dS
4399 @itemx -fdump-rtl-sched1
4400 @opindex dS
4401 @opindex fdump-rtl-sched1
4402 Dump after the first scheduling pass, to @file{@var{file}.136r.sched1}.
4403
4404 @item -dt
4405 @itemx -fdump-rtl-cse2
4406 @opindex dt
4407 @opindex fdump-rtl-cse2
4408 Dump after the second CSE pass (including the jump optimization that
4409 sometimes follows CSE), to @file{@var{file}.127r.cse2}.
4410
4411 @item -dT
4412 @itemx -fdump-rtl-tracer
4413 @opindex dT
4414 @opindex fdump-rtl-tracer
4415 Dump after running tracer, to @file{@var{file}.118r.tracer}.
4416
4417 @item -dV
4418 @itemx -fdump-rtl-vpt
4419 @itemx -fdump-rtl-vartrack
4420 @opindex dV
4421 @opindex fdump-rtl-vpt
4422 @opindex fdump-rtl-vartrack
4423 @option{-dV} and @option{-fdump-rtl-vpt} enable dumping after the value
4424 profile transformations, to @file{@var{file}.10.vpt}.  @option{-dV}
4425 and @option{-fdump-rtl-vartrack} enable dumping after variable tracking,
4426 to @file{@var{file}.154r.vartrack}.
4427
4428 @item -dw
4429 @itemx -fdump-rtl-flow2
4430 @opindex dw
4431 @opindex fdump-rtl-flow2
4432 Dump after the second flow pass, to @file{@var{file}.142r.flow2}.
4433
4434 @item -dz
4435 @itemx -fdump-rtl-peephole2
4436 @opindex dz
4437 @opindex fdump-rtl-peephole2
4438 Dump after the peephole pass, to @file{@var{file}.145r.peephole2}.
4439
4440 @item -dZ
4441 @itemx -fdump-rtl-web
4442 @opindex dZ
4443 @opindex fdump-rtl-web
4444 Dump after live range splitting, to @file{@var{file}.126r.web}.
4445
4446 @item -da
4447 @itemx -fdump-rtl-all
4448 @opindex da
4449 @opindex fdump-rtl-all
4450 Produce all the dumps listed above.
4451
4452 @item -dH
4453 @opindex dH
4454 Produce a core dump whenever an error occurs.
4455
4456 @item -dm
4457 @opindex dm
4458 Print statistics on memory usage, at the end of the run, to
4459 standard error.
4460
4461 @item -dp
4462 @opindex dp
4463 Annotate the assembler output with a comment indicating which
4464 pattern and alternative was used.  The length of each instruction is
4465 also printed.
4466
4467 @item -dP
4468 @opindex dP
4469 Dump the RTL in the assembler output as a comment before each instruction.
4470 Also turns on @option{-dp} annotation.
4471
4472 @item -dv
4473 @opindex dv
4474 For each of the other indicated dump files (either with @option{-d} or
4475 @option{-fdump-rtl-@var{pass}}), dump a representation of the control flow
4476 graph suitable for viewing with VCG to @file{@var{file}.@var{pass}.vcg}.
4477
4478 @item -dx
4479 @opindex dx
4480 Just generate RTL for a function instead of compiling it.  Usually used
4481 with @samp{r} (@option{-fdump-rtl-expand}).
4482
4483 @item -dy
4484 @opindex dy
4485 Dump debugging information during parsing, to standard error.
4486 @end table
4487
4488 @item -fdump-noaddr
4489 @opindex fdump-noaddr
4490 When doing debugging dumps (see @option{-d} option above), suppress
4491 address output.  This makes it more feasible to use diff on debugging
4492 dumps for compiler invocations with different compiler binaries and/or
4493 different text / bss / data / heap / stack / dso start locations.
4494
4495 @item -fdump-unnumbered
4496 @opindex fdump-unnumbered
4497 When doing debugging dumps (see @option{-d} option above), suppress instruction
4498 numbers and address output.  This makes it more feasible to
4499 use diff on debugging dumps for compiler invocations with different
4500 options, in particular with and without @option{-g}.
4501
4502 @item -fdump-translation-unit @r{(C++ only)}
4503 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
4504 @opindex fdump-translation-unit
4505 Dump a representation of the tree structure for the entire translation
4506 unit to a file.  The file name is made by appending @file{.tu} to the
4507 source file name.  If the @samp{-@var{options}} form is used, @var{options}
4508 controls the details of the dump as described for the
4509 @option{-fdump-tree} options.
4510
4511 @item -fdump-class-hierarchy @r{(C++ only)}
4512 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
4513 @opindex fdump-class-hierarchy
4514 Dump a representation of each class's hierarchy and virtual function
4515 table layout to a file.  The file name is made by appending @file{.class}
4516 to the source file name.  If the @samp{-@var{options}} form is used,
4517 @var{options} controls the details of the dump as described for the
4518 @option{-fdump-tree} options.
4519
4520 @item -fdump-ipa-@var{switch}
4521 @opindex fdump-ipa
4522 Control the dumping at various stages of inter-procedural analysis
4523 language tree to a file.  The file name is generated by appending a switch
4524 specific suffix to the source file name.  The following dumps are possible:
4525
4526 @table @samp
4527 @item all
4528 Enables all inter-procedural analysis dumps; currently the only produced
4529 dump is the @samp{cgraph} dump.
4530
4531 @item cgraph
4532 Dumps information about call-graph optimization, unused function removal,
4533 and inlining decisions.
4534 @end table
4535
4536 @item -fdump-tree-@var{switch}
4537 @itemx -fdump-tree-@var{switch}-@var{options}
4538 @opindex fdump-tree
4539 Control the dumping at various stages of processing the intermediate
4540 language tree to a file.  The file name is generated by appending a switch
4541 specific suffix to the source file name.  If the @samp{-@var{options}}
4542 form is used, @var{options} is a list of @samp{-} separated options that
4543 control the details of the dump.  Not all options are applicable to all
4544 dumps, those which are not meaningful will be ignored.  The following
4545 options are available
4546
4547 @table @samp
4548 @item address
4549 Print the address of each node.  Usually this is not meaningful as it
4550 changes according to the environment and source file.  Its primary use
4551 is for tying up a dump file with a debug environment.
4552 @item slim
4553 Inhibit dumping of members of a scope or body of a function merely
4554 because that scope has been reached.  Only dump such items when they
4555 are directly reachable by some other path.  When dumping pretty-printed
4556 trees, this option inhibits dumping the bodies of control structures.
4557 @item raw
4558 Print a raw representation of the tree.  By default, trees are
4559 pretty-printed into a C-like representation.
4560 @item details
4561 Enable more detailed dumps (not honored by every dump option).
4562 @item stats
4563 Enable dumping various statistics about the pass (not honored by every dump
4564 option).
4565 @item blocks
4566 Enable showing basic block boundaries (disabled in raw dumps).
4567 @item vops
4568 Enable showing virtual operands for every statement.
4569 @item lineno
4570 Enable showing line numbers for statements.
4571 @item uid
4572 Enable showing the unique ID (@code{DECL_UID}) for each variable.
4573 @item all
4574 Turn on all options, except @option{raw}, @option{slim} and @option{lineno}.
4575 @end table
4576
4577 The following tree dumps are possible:
4578 @table @samp
4579
4580 @item original
4581 Dump before any tree based optimization, to @file{@var{file}.original}.
4582
4583 @item optimized
4584 Dump after all tree based optimization, to @file{@var{file}.optimized}.
4585
4586 @item inlined
4587 Dump after function inlining, to @file{@var{file}.inlined}.
4588
4589 @item gimple
4590 @opindex fdump-tree-gimple
4591 Dump each function before and after the gimplification pass to a file.  The
4592 file name is made by appending @file{.gimple} to the source file name.
4593
4594 @item cfg
4595 @opindex fdump-tree-cfg
4596 Dump the control flow graph of each function to a file.  The file name is
4597 made by appending @file{.cfg} to the source file name.
4598
4599 @item vcg
4600 @opindex fdump-tree-vcg
4601 Dump the control flow graph of each function to a file in VCG format.  The
4602 file name is made by appending @file{.vcg} to the source file name.  Note
4603 that if the file contains more than one function, the generated file cannot
4604 be used directly by VCG@.  You will need to cut and paste each function's
4605 graph into its own separate file first.
4606
4607 @item ch
4608 @opindex fdump-tree-ch
4609 Dump each function after copying loop headers.  The file name is made by
4610 appending @file{.ch} to the source file name.
4611
4612 @item ssa
4613 @opindex fdump-tree-ssa
4614 Dump SSA related information to a file.  The file name is made by appending
4615 @file{.ssa} to the source file name.
4616
4617 @item salias
4618 @opindex fdump-tree-salias
4619 Dump structure aliasing variable information to a file.  This file name
4620 is made by appending @file{.salias} to the source file name.
4621
4622 @item alias
4623 @opindex fdump-tree-alias
4624 Dump aliasing information for each function.  The file name is made by
4625 appending @file{.alias} to the source file name.
4626
4627 @item ccp
4628 @opindex fdump-tree-ccp
4629 Dump each function after CCP@.  The file name is made by appending
4630 @file{.ccp} to the source file name.
4631
4632 @item storeccp
4633 @opindex fdump-tree-storeccp
4634 Dump each function after STORE-CCP.  The file name is made by appending
4635 @file{.storeccp} to the source file name.
4636
4637 @item pre
4638 @opindex fdump-tree-pre
4639 Dump trees after partial redundancy elimination.  The file name is made
4640 by appending @file{.pre} to the source file name.
4641
4642 @item fre
4643 @opindex fdump-tree-fre
4644 Dump trees after full redundancy elimination.  The file name is made
4645 by appending @file{.fre} to the source file name.
4646
4647 @item copyprop
4648 @opindex fdump-tree-copyprop
4649 Dump trees after copy propagation.  The file name is made
4650 by appending @file{.copyprop} to the source file name.
4651
4652 @item store_copyprop
4653 @opindex fdump-tree-store_copyprop
4654 Dump trees after store copy-propagation.  The file name is made
4655 by appending @file{.store_copyprop} to the source file name.
4656
4657 @item dce
4658 @opindex fdump-tree-dce
4659 Dump each function after dead code elimination.  The file name is made by
4660 appending @file{.dce} to the source file name.
4661
4662 @item mudflap
4663 @opindex fdump-tree-mudflap
4664 Dump each function after adding mudflap instrumentation.  The file name is
4665 made by appending @file{.mudflap} to the source file name.
4666
4667 @item sra
4668 @opindex fdump-tree-sra
4669 Dump each function after performing scalar replacement of aggregates.  The
4670 file name is made by appending @file{.sra} to the source file name.
4671
4672 @item sink
4673 @opindex fdump-tree-sink
4674 Dump each function after performing code sinking.  The file name is made
4675 by appending @file{.sink} to the source file name.
4676
4677 @item dom
4678 @opindex fdump-tree-dom
4679 Dump each function after applying dominator tree optimizations.  The file
4680 name is made by appending @file{.dom} to the source file name.
4681
4682 @item dse
4683 @opindex fdump-tree-dse
4684 Dump each function after applying dead store elimination.  The file
4685 name is made by appending @file{.dse} to the source file name.
4686
4687 @item phiopt
4688 @opindex fdump-tree-phiopt
4689 Dump each function after optimizing PHI nodes into straightline code.  The file
4690 name is made by appending @file{.phiopt} to the source file name.
4691
4692 @item forwprop
4693 @opindex fdump-tree-forwprop
4694 Dump each function after forward propagating single use variables.  The file
4695 name is made by appending @file{.forwprop} to the source file name.
4696
4697 @item copyrename
4698 @opindex fdump-tree-copyrename
4699 Dump each function after applying the copy rename optimization.  The file
4700 name is made by appending @file{.copyrename} to the source file name.
4701
4702 @item nrv
4703 @opindex fdump-tree-nrv
4704 Dump each function after applying the named return value optimization on
4705 generic trees.  The file name is made by appending @file{.nrv} to the source
4706 file name.
4707
4708 @item vect
4709 @opindex fdump-tree-vect
4710 Dump each function after applying vectorization of loops.  The file name is
4711 made by appending @file{.vect} to the source file name.
4712
4713 @item vrp
4714 @opindex fdump-tree-vrp
4715 Dump each function after Value Range Propagation (VRP).  The file name
4716 is made by appending @file{.vrp} to the source file name.
4717
4718 @item all
4719 @opindex fdump-tree-all
4720 Enable all the available tree dumps with the flags provided in this option.
4721 @end table
4722
4723 @item -ftree-vectorizer-verbose=@var{n}
4724 @opindex ftree-vectorizer-verbose
4725 This option controls the amount of debugging output the vectorizer prints.
4726 This information is written to standard error, unless
4727 @option{-fdump-tree-all} or @option{-fdump-tree-vect} is specified,
4728 in which case it is output to the usual dump listing file, @file{.vect}.
4729 For @var{n}=0 no diagnostic information is reported.
4730 If @var{n}=1 the vectorizer reports each loop that got vectorized,
4731 and the total number of loops that got vectorized.
4732 If @var{n}=2 the vectorizer also reports non-vectorized loops that passed
4733 the first analysis phase (vect_analyze_loop_form) - i.e. countable,
4734 inner-most, single-bb, single-entry/exit loops.  This is the same verbosity
4735 level that @option{-fdump-tree-vect-stats} uses.
4736 Higher verbosity levels mean either more information dumped for each
4737 reported loop, or same amount of information reported for more loops:
4738 If @var{n}=3, alignment related information is added to the reports.
4739 If @var{n}=4, data-references related information (e.g. memory dependences,
4740 memory access-patterns) is added to the reports.
4741 If @var{n}=5, the vectorizer reports also non-vectorized inner-most loops
4742 that did not pass the first analysis phase (i.e. may not be countable, or
4743 may have complicated control-flow).
4744 If @var{n}=6, the vectorizer reports also non-vectorized nested loops.
4745 For @var{n}=7, all the information the vectorizer generates during its
4746 analysis and transformation is reported.  This is the same verbosity level
4747 that @option{-fdump-tree-vect-details} uses.
4748
4749 @item -frandom-seed=@var{string}
4750 @opindex frandom-string
4751 This option provides a seed that GCC uses when it would otherwise use
4752 random numbers.  It is used to generate certain symbol names
4753 that have to be different in every compiled file.  It is also used to
4754 place unique stamps in coverage data files and the object files that
4755 produce them.  You can use the @option{-frandom-seed} option to produce
4756 reproducibly identical object files.
4757
4758 The @var{string} should be different for every file you compile.
4759
4760 @item -fsched-verbose=@var{n}
4761 @opindex fsched-verbose
4762 On targets that use instruction scheduling, this option controls the
4763 amount of debugging output the scheduler prints.  This information is
4764 written to standard error, unless @option{-dS} or @option{-dR} is
4765 specified, in which case it is output to the usual dump
4766 listing file, @file{.sched} or @file{.sched2} respectively.  However
4767 for @var{n} greater than nine, the output is always printed to standard
4768 error.
4769
4770 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
4771 same information as @option{-dRS}.  For @var{n} greater than one, it
4772 also output basic block probabilities, detailed ready list information
4773 and unit/insn info.  For @var{n} greater than two, it includes RTL
4774 at abort point, control-flow and regions info.  And for @var{n} over
4775 four, @option{-fsched-verbose} also includes dependence info.
4776
4777 @item -save-temps
4778 @opindex save-temps
4779 Store the usual ``temporary'' intermediate files permanently; place them
4780 in the current directory and name them based on the source file.  Thus,
4781 compiling @file{foo.c} with @samp{-c -save-temps} would produce files
4782 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
4783 preprocessed @file{foo.i} output file even though the compiler now
4784 normally uses an integrated preprocessor.
4785
4786 When used in combination with the @option{-x} command line option,
4787 @option{-save-temps} is sensible enough to avoid over writing an
4788 input source file with the same extension as an intermediate file.
4789 The corresponding intermediate file may be obtained by renaming the
4790 source file before using @option{-save-temps}.
4791
4792 @item -time
4793 @opindex time
4794 Report the CPU time taken by each subprocess in the compilation
4795 sequence.  For C source files, this is the compiler proper and assembler
4796 (plus the linker if linking is done).  The output looks like this:
4797
4798 @smallexample
4799 # cc1 0.12 0.01
4800 # as 0.00 0.01
4801 @end smallexample
4802
4803 The first number on each line is the ``user time'', that is time spent
4804 executing the program itself.  The second number is ``system time'',
4805 time spent executing operating system routines on behalf of the program.
4806 Both numbers are in seconds.
4807
4808 @item -fvar-tracking
4809 @opindex fvar-tracking
4810 Run variable tracking pass.  It computes where variables are stored at each
4811 position in code.  Better debugging information is then generated
4812 (if the debugging information format supports this information).
4813
4814 It is enabled by default when compiling with optimization (@option{-Os},
4815 @option{-O}, @option{-O2}, ...), debugging information (@option{-g}) and
4816 the debug info format supports it.
4817
4818 @item -print-file-name=@var{library}
4819 @opindex print-file-name
4820 Print the full absolute name of the library file @var{library} that
4821 would be used when linking---and don't do anything else.  With this
4822 option, GCC does not compile or link anything; it just prints the
4823 file name.
4824
4825 @item -print-multi-directory
4826 @opindex print-multi-directory
4827 Print the directory name corresponding to the multilib selected by any
4828 other switches present in the command line.  This directory is supposed
4829 to exist in @env{GCC_EXEC_PREFIX}.
4830
4831 @item -print-multi-lib
4832 @opindex print-multi-lib
4833 Print the mapping from multilib directory names to compiler switches
4834 that enable them.  The directory name is separated from the switches by
4835 @samp{;}, and each switch starts with an @samp{@@} instead of the
4836 @samp{-}, without spaces between multiple switches.  This is supposed to
4837 ease shell-processing.
4838
4839 @item -print-prog-name=@var{program}
4840 @opindex print-prog-name
4841 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
4842
4843 @item -print-libgcc-file-name
4844 @opindex print-libgcc-file-name
4845 Same as @option{-print-file-name=libgcc.a}.
4846
4847 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
4848 but you do want to link with @file{libgcc.a}.  You can do
4849
4850 @smallexample
4851 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
4852 @end smallexample
4853
4854 @item -print-search-dirs
4855 @opindex print-search-dirs
4856 Print the name of the configured installation directory and a list of
4857 program and library directories @command{gcc} will search---and don't do anything else.
4858
4859 This is useful when @command{gcc} prints the error message
4860 @samp{installation problem, cannot exec cpp0: No such file or directory}.
4861 To resolve this you either need to put @file{cpp0} and the other compiler
4862 components where @command{gcc} expects to find them, or you can set the environment
4863 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
4864 Don't forget the trailing @samp{/}.
4865 @xref{Environment Variables}.
4866
4867 @item -print-sysroot-headers-suffix
4868 @opindex print-sysroot-headers-suffix
4869 Print the suffix added to the target sysroot when searching for
4870 headers, or give an error if the compiler is not configured with such
4871 a suffix---and don't do anything else.
4872
4873 @item -dumpmachine
4874 @opindex dumpmachine
4875 Print the compiler's target machine (for example,
4876 @samp{i686-pc-linux-gnu})---and don't do anything else.
4877
4878 @item -dumpversion
4879 @opindex dumpversion
4880 Print the compiler version (for example, @samp{3.0})---and don't do
4881 anything else.
4882
4883 @item -dumpspecs
4884 @opindex dumpspecs
4885 Print the compiler's built-in specs---and don't do anything else.  (This
4886 is used when GCC itself is being built.)  @xref{Spec Files}.
4887
4888 @item -feliminate-unused-debug-types
4889 @opindex feliminate-unused-debug-types
4890 Normally, when producing DWARF2 output, GCC will emit debugging
4891 information for all types declared in a compilation
4892 unit, regardless of whether or not they are actually used
4893 in that compilation unit.  Sometimes this is useful, such as
4894 if, in the debugger, you want to cast a value to a type that is
4895 not actually used in your program (but is declared).  More often,
4896 however, this results in a significant amount of wasted space.
4897 With this option, GCC will avoid producing debug symbol output
4898 for types that are nowhere used in the source file being compiled.
4899 @end table
4900
4901 @node Optimize Options
4902 @section Options That Control Optimization
4903 @cindex optimize options
4904 @cindex options, optimization
4905
4906 These options control various sorts of optimizations.
4907
4908 Without any optimization option, the compiler's goal is to reduce the
4909 cost of compilation and to make debugging produce the expected
4910 results.  Statements are independent: if you stop the program with a
4911 breakpoint between statements, you can then assign a new value to any
4912 variable or change the program counter to any other statement in the
4913 function and get exactly the results you would expect from the source
4914 code.
4915
4916 Turning on optimization flags makes the compiler attempt to improve
4917 the performance and/or code size at the expense of compilation time
4918 and possibly the ability to debug the program.
4919
4920 The compiler performs optimization based on the knowledge it has of
4921 the program.  Optimization levels @option{-O} and above, in
4922 particular, enable @emph{unit-at-a-time} mode, which allows the
4923 compiler to consider information gained from later functions in
4924 the file when compiling a function.  Compiling multiple files at
4925 once to a single output file in @emph{unit-at-a-time} mode allows
4926 the compiler to use information gained from all of the files when
4927 compiling each of them.
4928
4929 Not all optimizations are controlled directly by a flag.  Only
4930 optimizations that have a flag are listed.
4931
4932 @table @gcctabopt
4933 @item -O
4934 @itemx -O1
4935 @opindex O
4936 @opindex O1
4937 Optimize.  Optimizing compilation takes somewhat more time, and a lot
4938 more memory for a large function.
4939
4940 With @option{-O}, the compiler tries to reduce code size and execution
4941 time, without performing any optimizations that take a great deal of
4942 compilation time.
4943
4944 @option{-O} turns on the following optimization flags:
4945 @gccoptlist{-fdefer-pop @gol
4946 -fdelayed-branch @gol
4947 -fguess-branch-probability @gol
4948 -fcprop-registers @gol
4949 -fif-conversion @gol
4950 -fif-conversion2 @gol
4951 -fsplit-wide-types @gol
4952 -ftree-ccp @gol
4953 -ftree-dce @gol
4954 -ftree-dominator-opts @gol
4955 -ftree-dse @gol
4956 -ftree-ter @gol
4957 -ftree-sra @gol
4958 -ftree-copyrename @gol
4959 -ftree-fre @gol
4960 -ftree-ch @gol
4961 -funit-at-a-time @gol
4962 -fmerge-constants}
4963
4964 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
4965 where doing so does not interfere with debugging.
4966
4967 @item -O2
4968 @opindex O2
4969 Optimize even more.  GCC performs nearly all supported optimizations
4970 that do not involve a space-speed tradeoff.  The compiler does not
4971 perform loop unrolling or function inlining when you specify @option{-O2}.
4972 As compared to @option{-O}, this option increases both compilation time
4973 and the performance of the generated code.
4974
4975 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
4976 also turns on the following optimization flags:
4977 @gccoptlist{-fthread-jumps @gol
4978 -fcrossjumping @gol
4979 -foptimize-sibling-calls @gol
4980 -fcse-follow-jumps  -fcse-skip-blocks @gol
4981 -fgcse  -fgcse-lm  @gol
4982 -fexpensive-optimizations @gol
4983 -frerun-cse-after-loop  @gol
4984 -fcaller-saves @gol
4985 -fpeephole2 @gol
4986 -fschedule-insns  -fschedule-insns2 @gol
4987 -fsched-interblock  -fsched-spec @gol
4988 -fregmove @gol
4989 -fstrict-aliasing -fstrict-overflow @gol
4990 -fdelete-null-pointer-checks @gol
4991 -freorder-blocks  -freorder-functions @gol
4992 -falign-functions  -falign-jumps @gol
4993 -falign-loops  -falign-labels @gol
4994 -ftree-vrp @gol
4995 -ftree-pre}
4996
4997 Please note the warning under @option{-fgcse} about
4998 invoking @option{-O2} on programs that use computed gotos.
4999
5000 @item -O3
5001 @opindex O3
5002 Optimize yet more.  @option{-O3} turns on all optimizations specified by
5003 @option{-O2} and also turns on the @option{-finline-functions},
5004 @option{-funswitch-loops}, @option{-fpredictive-commoning} and
5005 @option{-fgcse-after-reload} options.
5006
5007 @item -O0
5008 @opindex O0
5009 Reduce compilation time and make debugging produce the expected
5010 results.  This is the default.
5011
5012 @item -Os
5013 @opindex Os
5014 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
5015 do not typically increase code size.  It also performs further
5016 optimizations designed to reduce code size.
5017
5018 @option{-Os} disables the following optimization flags:
5019 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
5020 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
5021 -fprefetch-loop-arrays  -ftree-vect-loop-version}
5022
5023 If you use multiple @option{-O} options, with or without level numbers,
5024 the last such option is the one that is effective.
5025 @end table
5026
5027 Options of the form @option{-f@var{flag}} specify machine-independent
5028 flags.  Most flags have both positive and negative forms; the negative
5029 form of @option{-ffoo} would be @option{-fno-foo}.  In the table
5030 below, only one of the forms is listed---the one you typically will
5031 use.  You can figure out the other form by either removing @samp{no-}
5032 or adding it.
5033
5034 The following options control specific optimizations.  They are either
5035 activated by @option{-O} options or are related to ones that are.  You
5036 can use the following flags in the rare cases when ``fine-tuning'' of
5037 optimizations to be performed is desired.
5038
5039 @table @gcctabopt
5040 @item -fno-default-inline
5041 @opindex fno-default-inline
5042 Do not make member functions inline by default merely because they are
5043 defined inside the class scope (C++ only).  Otherwise, when you specify
5044 @w{@option{-O}}, member functions defined inside class scope are compiled
5045 inline by default; i.e., you don't need to add @samp{inline} in front of
5046 the member function name.
5047
5048 @item -fno-defer-pop
5049 @opindex fno-defer-pop
5050 Always pop the arguments to each function call as soon as that function
5051 returns.  For machines which must pop arguments after a function call,
5052 the compiler normally lets arguments accumulate on the stack for several
5053 function calls and pops them all at once.
5054
5055 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5056
5057 @item -fforce-addr
5058 @opindex fforce-addr
5059 Force memory address constants to be copied into registers before
5060 doing arithmetic on them.
5061
5062 @item -fforward-propagate
5063 @opindex fforward-propagate
5064 Perform a forward propagation pass on RTL.  The pass tries to combine two
5065 instructions and checks if the result can be simplified.  If loop unrolling
5066 is active, two passes are performed and the second is scheduled after
5067 loop unrolling.
5068
5069 This option is enabled by default at optimization levels @option{-O2},
5070 @option{-O3}, @option{-Os}.
5071
5072 @item -fomit-frame-pointer
5073 @opindex fomit-frame-pointer
5074 Don't keep the frame pointer in a register for functions that
5075 don't need one.  This avoids the instructions to save, set up and
5076 restore frame pointers; it also makes an extra register available
5077 in many functions.  @strong{It also makes debugging impossible on
5078 some machines.}
5079
5080 On some machines, such as the VAX, this flag has no effect, because
5081 the standard calling sequence automatically handles the frame pointer
5082 and nothing is saved by pretending it doesn't exist.  The
5083 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
5084 whether a target machine supports this flag.  @xref{Registers,,Register
5085 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
5086
5087 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5088
5089 @item -foptimize-sibling-calls
5090 @opindex foptimize-sibling-calls
5091 Optimize sibling and tail recursive calls.
5092
5093 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5094
5095 @item -fno-inline
5096 @opindex fno-inline
5097 Don't pay attention to the @code{inline} keyword.  Normally this option
5098 is used to keep the compiler from expanding any functions inline.
5099 Note that if you are not optimizing, no functions can be expanded inline.
5100
5101 @item -finline-functions
5102 @opindex finline-functions
5103 Integrate all simple functions into their callers.  The compiler
5104 heuristically decides which functions are simple enough to be worth
5105 integrating in this way.
5106
5107 If all calls to a given function are integrated, and the function is
5108 declared @code{static}, then the function is normally not output as
5109 assembler code in its own right.
5110
5111 Enabled at level @option{-O3}.
5112
5113 @item -finline-functions-called-once
5114 @opindex finline-functions-called-once
5115 Consider all @code{static} functions called once for inlining into their
5116 caller even if they are not marked @code{inline}.  If a call to a given
5117 function is integrated, then the function is not output as assembler code
5118 in its own right.
5119
5120 Enabled if @option{-funit-at-a-time} is enabled.
5121
5122 @item -fearly-inlining
5123 @opindex fearly-inlining
5124 Inline functions marked by @code{always_inline} and functions whose body seems
5125 smaller than the function call overhead early before doing
5126 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
5127 makes profiling significantly cheaper and usually inlining faster on programs
5128 having large chains of nested wrapper functions.
5129
5130 Enabled by default.
5131
5132 @item -finline-limit=@var{n}
5133 @opindex finline-limit
5134 By default, GCC limits the size of functions that can be inlined.  This flag
5135 allows the control of this limit for functions that are explicitly marked as
5136 inline (i.e., marked with the inline keyword or defined within the class
5137 definition in c++).  @var{n} is the size of functions that can be inlined in
5138 number of pseudo instructions (not counting parameter handling).  The default
5139 value of @var{n} is 600.
5140 Increasing this value can result in more inlined code at
5141 the cost of compilation time and memory consumption.  Decreasing usually makes
5142 the compilation faster and less code will be inlined (which presumably
5143 means slower programs).  This option is particularly useful for programs that
5144 use inlining heavily such as those based on recursive templates with C++.
5145
5146 Inlining is actually controlled by a number of parameters, which may be
5147 specified individually by using @option{--param @var{name}=@var{value}}.
5148 The @option{-finline-limit=@var{n}} option sets some of these parameters
5149 as follows:
5150
5151 @table @gcctabopt
5152 @item max-inline-insns-single
5153  is set to @var{n}/2.
5154 @item max-inline-insns-auto
5155  is set to @var{n}/2.
5156 @item min-inline-insns
5157  is set to 130 or @var{n}/4, whichever is smaller.
5158 @item max-inline-insns-rtl
5159  is set to @var{n}.
5160 @end table
5161
5162 See below for a documentation of the individual
5163 parameters controlling inlining.
5164
5165 @emph{Note:} pseudo instruction represents, in this particular context, an
5166 abstract measurement of function's size.  In no way does it represent a count
5167 of assembly instructions and as such its exact meaning might change from one
5168 release to an another.
5169
5170 @item -fkeep-inline-functions
5171 @opindex fkeep-inline-functions
5172 In C, emit @code{static} functions that are declared @code{inline}
5173 into the object file, even if the function has been inlined into all
5174 of its callers.  This switch does not affect functions using the
5175 @code{extern inline} extension in GNU C89@.  In C++, emit any and all
5176 inline functions into the object file.
5177
5178 @item -fkeep-static-consts
5179 @opindex fkeep-static-consts
5180 Emit variables declared @code{static const} when optimization isn't turned
5181 on, even if the variables aren't referenced.
5182
5183 GCC enables this option by default.  If you want to force the compiler to
5184 check if the variable was referenced, regardless of whether or not
5185 optimization is turned on, use the @option{-fno-keep-static-consts} option.
5186
5187 @item -fmerge-constants
5188 Attempt to merge identical constants (string constants and floating point
5189 constants) across compilation units.
5190
5191 This option is the default for optimized compilation if the assembler and
5192 linker support it.  Use @option{-fno-merge-constants} to inhibit this
5193 behavior.
5194
5195 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5196
5197 @item -fmerge-all-constants
5198 Attempt to merge identical constants and identical variables.
5199
5200 This option implies @option{-fmerge-constants}.  In addition to
5201 @option{-fmerge-constants} this considers e.g.@: even constant initialized
5202 arrays or initialized constant variables with integral or floating point
5203 types.  Languages like C or C++ require each non-automatic variable to
5204 have distinct location, so using this option will result in non-conforming
5205 behavior.
5206
5207 @item -fmodulo-sched
5208 @opindex fmodulo-sched
5209 Perform swing modulo scheduling immediately before the first scheduling
5210 pass.  This pass looks at innermost loops and reorders their
5211 instructions by overlapping different iterations.
5212
5213 @item -fno-branch-count-reg
5214 @opindex fno-branch-count-reg
5215 Do not use ``decrement and branch'' instructions on a count register,
5216 but instead generate a sequence of instructions that decrement a
5217 register, compare it against zero, then branch based upon the result.
5218 This option is only meaningful on architectures that support such
5219 instructions, which include x86, PowerPC, IA-64 and S/390.
5220
5221 The default is @option{-fbranch-count-reg}.
5222
5223 @item -fno-function-cse
5224 @opindex fno-function-cse
5225 Do not put function addresses in registers; make each instruction that
5226 calls a constant function contain the function's address explicitly.
5227
5228 This option results in less efficient code, but some strange hacks
5229 that alter the assembler output may be confused by the optimizations
5230 performed when this option is not used.
5231
5232 The default is @option{-ffunction-cse}
5233
5234 @item -fno-zero-initialized-in-bss
5235 @opindex fno-zero-initialized-in-bss
5236 If the target supports a BSS section, GCC by default puts variables that
5237 are initialized to zero into BSS@.  This can save space in the resulting
5238 code.
5239
5240 This option turns off this behavior because some programs explicitly
5241 rely on variables going to the data section.  E.g., so that the
5242 resulting executable can find the beginning of that section and/or make
5243 assumptions based on that.
5244
5245 The default is @option{-fzero-initialized-in-bss}.
5246
5247 @item -fbounds-check
5248 @opindex fbounds-check
5249 For front-ends that support it, generate additional code to check that
5250 indices used to access arrays are within the declared range.  This is
5251 currently only supported by the Java and Fortran front-ends, where
5252 this option defaults to true and false respectively.
5253
5254 @item -fmudflap -fmudflapth -fmudflapir
5255 @opindex fmudflap
5256 @opindex fmudflapth
5257 @opindex fmudflapir
5258 @cindex bounds checking
5259 @cindex mudflap
5260 For front-ends that support it (C and C++), instrument all risky
5261 pointer/array dereferencing operations, some standard library
5262 string/heap functions, and some other associated constructs with
5263 range/validity tests.  Modules so instrumented should be immune to
5264 buffer overflows, invalid heap use, and some other classes of C/C++
5265 programming errors.  The instrumentation relies on a separate runtime
5266 library (@file{libmudflap}), which will be linked into a program if
5267 @option{-fmudflap} is given at link time.  Run-time behavior of the
5268 instrumented program is controlled by the @env{MUDFLAP_OPTIONS}
5269 environment variable.  See @code{env MUDFLAP_OPTIONS=-help a.out}
5270 for its options.
5271
5272 Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to
5273 link if your program is multi-threaded.  Use @option{-fmudflapir}, in
5274 addition to @option{-fmudflap} or @option{-fmudflapth}, if
5275 instrumentation should ignore pointer reads.  This produces less
5276 instrumentation (and therefore faster execution) and still provides
5277 some protection against outright memory corrupting writes, but allows
5278 erroneously read data to propagate within a program.
5279
5280 @item -fthread-jumps
5281 @opindex fthread-jumps
5282 Perform optimizations where we check to see if a jump branches to a
5283 location where another comparison subsumed by the first is found.  If
5284 so, the first branch is redirected to either the destination of the
5285 second branch or a point immediately following it, depending on whether
5286 the condition is known to be true or false.
5287
5288 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5289
5290 @item -fsplit-wide-types
5291 @opindex fsplit-wide-types
5292 When using a type that occupies multiple registers, such as @code{long
5293 long} on a 32-bit system, split the registers apart and allocate them
5294 independently.  This normally generates better code for those types,
5295 but may make debugging more difficult.
5296
5297 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
5298 @option{-Os}.
5299
5300 @item -fcse-follow-jumps
5301 @opindex fcse-follow-jumps
5302 In common subexpression elimination, scan through jump instructions
5303 when the target of the jump is not reached by any other path.  For
5304 example, when CSE encounters an @code{if} statement with an
5305 @code{else} clause, CSE will follow the jump when the condition
5306 tested is false.
5307
5308 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5309
5310 @item -fcse-skip-blocks
5311 @opindex fcse-skip-blocks
5312 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
5313 follow jumps which conditionally skip over blocks.  When CSE
5314 encounters a simple @code{if} statement with no else clause,
5315 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
5316 body of the @code{if}.
5317
5318 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5319
5320 @item -frerun-cse-after-loop
5321 @opindex frerun-cse-after-loop
5322 Re-run common subexpression elimination after loop optimizations has been
5323 performed.
5324
5325 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5326
5327 @item -fgcse
5328 @opindex fgcse
5329 Perform a global common subexpression elimination pass.
5330 This pass also performs global constant and copy propagation.
5331
5332 @emph{Note:} When compiling a program using computed gotos, a GCC
5333 extension, you may get better runtime performance if you disable
5334 the global common subexpression elimination pass by adding
5335 @option{-fno-gcse} to the command line.
5336
5337 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5338
5339 @item -fgcse-lm
5340 @opindex fgcse-lm
5341 When @option{-fgcse-lm} is enabled, global common subexpression elimination will
5342 attempt to move loads which are only killed by stores into themselves.  This
5343 allows a loop containing a load/store sequence to be changed to a load outside
5344 the loop, and a copy/store within the loop.
5345
5346 Enabled by default when gcse is enabled.
5347
5348 @item -fgcse-sm
5349 @opindex fgcse-sm
5350 When @option{-fgcse-sm} is enabled, a store motion pass is run after
5351 global common subexpression elimination.  This pass will attempt to move
5352 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
5353 loops containing a load/store sequence can be changed to a load before
5354 the loop and a store after the loop.
5355
5356 Not enabled at any optimization level.
5357
5358 @item -fgcse-las
5359 @opindex fgcse-las
5360 When @option{-fgcse-las} is enabled, the global common subexpression
5361 elimination pass eliminates redundant loads that come after stores to the
5362 same memory location (both partial and full redundancies).
5363
5364 Not enabled at any optimization level.
5365
5366 @item -fgcse-after-reload
5367 @opindex fgcse-after-reload
5368 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
5369 pass is performed after reload.  The purpose of this pass is to cleanup
5370 redundant spilling.
5371
5372 @item -funsafe-loop-optimizations
5373 @opindex funsafe-loop-optimizations
5374 If given, the loop optimizer will assume that loop indices do not
5375 overflow, and that the loops with nontrivial exit condition are not
5376 infinite.  This enables a wider range of loop optimizations even if
5377 the loop optimizer itself cannot prove that these assumptions are valid.
5378 Using @option{-Wunsafe-loop-optimizations}, the compiler will warn you
5379 if it finds this kind of loop.
5380
5381 @item -fcrossjumping
5382 @opindex crossjumping
5383 Perform cross-jumping transformation.  This transformation unifies equivalent code and save code size.  The
5384 resulting code may or may not perform better than without cross-jumping.
5385
5386 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5387
5388 @item -fif-conversion
5389 @opindex if-conversion
5390 Attempt to transform conditional jumps into branch-less equivalents.  This
5391 include use of conditional moves, min, max, set flags and abs instructions, and
5392 some tricks doable by standard arithmetics.  The use of conditional execution
5393 on chips where it is available is controlled by @code{if-conversion2}.
5394
5395 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5396
5397 @item -fif-conversion2
5398 @opindex if-conversion2
5399 Use conditional execution (where available) to transform conditional jumps into
5400 branch-less equivalents.
5401
5402 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5403
5404 @item -fdelete-null-pointer-checks
5405 @opindex fdelete-null-pointer-checks
5406 Use global dataflow analysis to identify and eliminate useless checks
5407 for null pointers.  The compiler assumes that dereferencing a null
5408 pointer would have halted the program.  If a pointer is checked after
5409 it has already been dereferenced, it cannot be null.
5410
5411 In some environments, this assumption is not true, and programs can
5412 safely dereference null pointers.  Use
5413 @option{-fno-delete-null-pointer-checks} to disable this optimization
5414 for programs which depend on that behavior.
5415
5416 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5417
5418 @item -fexpensive-optimizations
5419 @opindex fexpensive-optimizations
5420 Perform a number of minor optimizations that are relatively expensive.
5421
5422 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5423
5424 @item -foptimize-register-move
5425 @itemx -fregmove
5426 @opindex foptimize-register-move
5427 @opindex fregmove
5428 Attempt to reassign register numbers in move instructions and as
5429 operands of other simple instructions in order to maximize the amount of
5430 register tying.  This is especially helpful on machines with two-operand
5431 instructions.
5432
5433 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
5434 optimization.
5435
5436 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5437
5438 @item -fdelayed-branch
5439 @opindex fdelayed-branch
5440 If supported for the target machine, attempt to reorder instructions
5441 to exploit instruction slots available after delayed branch
5442 instructions.
5443
5444 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5445
5446 @item -fschedule-insns
5447 @opindex fschedule-insns
5448 If supported for the target machine, attempt to reorder instructions to
5449 eliminate execution stalls due to required data being unavailable.  This
5450 helps machines that have slow floating point or memory load instructions
5451 by allowing other instructions to be issued until the result of the load
5452 or floating point instruction is required.
5453
5454 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5455
5456 @item -fschedule-insns2
5457 @opindex fschedule-insns2
5458 Similar to @option{-fschedule-insns}, but requests an additional pass of
5459 instruction scheduling after register allocation has been done.  This is
5460 especially useful on machines with a relatively small number of
5461 registers and where memory load instructions take more than one cycle.
5462
5463 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5464
5465 @item -fno-sched-interblock
5466 @opindex fno-sched-interblock
5467 Don't schedule instructions across basic blocks.  This is normally
5468 enabled by default when scheduling before register allocation, i.e.@:
5469 with @option{-fschedule-insns} or at @option{-O2} or higher.
5470
5471 @item -fno-sched-spec
5472 @opindex fno-sched-spec
5473 Don't allow speculative motion of non-load instructions.  This is normally
5474 enabled by default when scheduling before register allocation, i.e.@:
5475 with @option{-fschedule-insns} or at @option{-O2} or higher.
5476
5477 @item -fsched-spec-load
5478 @opindex fsched-spec-load
5479 Allow speculative motion of some load instructions.  This only makes
5480 sense when scheduling before register allocation, i.e.@: with
5481 @option{-fschedule-insns} or at @option{-O2} or higher.
5482
5483 @item -fsched-spec-load-dangerous
5484 @opindex fsched-spec-load-dangerous
5485 Allow speculative motion of more load instructions.  This only makes
5486 sense when scheduling before register allocation, i.e.@: with
5487 @option{-fschedule-insns} or at @option{-O2} or higher.
5488
5489 @item -fsched-stalled-insns=@var{n}
5490 @opindex fsched-stalled-insns
5491 Define how many insns (if any) can be moved prematurely from the queue
5492 of stalled insns into the ready list, during the second scheduling pass.
5493
5494 @item -fsched-stalled-insns-dep=@var{n}
5495 @opindex fsched-stalled-insns-dep
5496 Define how many insn groups (cycles) will be examined for a dependency
5497 on a stalled insn that is candidate for premature removal from the queue
5498 of stalled insns.  Has an effect only during the second scheduling pass,
5499 and only if @option{-fsched-stalled-insns} is used and its value is not zero.
5500
5501 @item -fsched2-use-superblocks
5502 @opindex fsched2-use-superblocks
5503 When scheduling after register allocation, do use superblock scheduling
5504 algorithm.  Superblock scheduling allows motion across basic block boundaries
5505 resulting on faster schedules.  This option is experimental, as not all machine
5506 descriptions used by GCC model the CPU closely enough to avoid unreliable
5507 results from the algorithm.
5508
5509 This only makes sense when scheduling after register allocation, i.e.@: with
5510 @option{-fschedule-insns2} or at @option{-O2} or higher.
5511
5512 @item -fsched2-use-traces
5513 @opindex fsched2-use-traces
5514 Use @option{-fsched2-use-superblocks} algorithm when scheduling after register
5515 allocation and additionally perform code duplication in order to increase the
5516 size of superblocks using tracer pass.  See @option{-ftracer} for details on
5517 trace formation.
5518
5519 This mode should produce faster but significantly longer programs.  Also
5520 without @option{-fbranch-probabilities} the traces constructed may not
5521 match the reality and hurt the performance.  This only makes
5522 sense when scheduling after register allocation, i.e.@: with
5523 @option{-fschedule-insns2} or at @option{-O2} or higher.
5524
5525 @item -fsee
5526 @opindex fsee
5527 Eliminates redundant extension instructions and move the non redundant
5528 ones to optimal placement using LCM.
5529
5530 @item -freschedule-modulo-scheduled-loops
5531 @opindex fscheduling-in-modulo-scheduled-loops
5532 The modulo scheduling comes before the traditional scheduling, if a loop was modulo scheduled
5533 we may want to prevent the later scheduling passes from changing its schedule, we use this
5534 option to control that.
5535
5536 @item -fcaller-saves
5537 @opindex fcaller-saves
5538 Enable values to be allocated in registers that will be clobbered by
5539 function calls, by emitting extra instructions to save and restore the
5540 registers around such calls.  Such allocation is done only when it
5541 seems to result in better code than would otherwise be produced.
5542
5543 This option is always enabled by default on certain machines, usually
5544 those which have no call-preserved registers to use instead.
5545
5546 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5547
5548 @item -ftree-pre
5549 Perform Partial Redundancy Elimination (PRE) on trees.  This flag is
5550 enabled by default at @option{-O2} and @option{-O3}.
5551
5552 @item -ftree-fre
5553 Perform Full Redundancy Elimination (FRE) on trees.  The difference
5554 between FRE and PRE is that FRE only considers expressions
5555 that are computed on all paths leading to the redundant computation.
5556 This analysis is faster than PRE, though it exposes fewer redundancies.
5557 This flag is enabled by default at @option{-O} and higher.
5558
5559 @item -ftree-copy-prop
5560 Perform copy propagation on trees.  This pass eliminates unnecessary
5561 copy operations.  This flag is enabled by default at @option{-O} and
5562 higher.
5563
5564 @item -ftree-store-copy-prop
5565 Perform copy propagation of memory loads and stores.  This pass
5566 eliminates unnecessary copy operations in memory references
5567 (structures, global variables, arrays, etc).  This flag is enabled by
5568 default at @option{-O2} and higher.
5569
5570 @item -ftree-salias
5571 Perform structural alias analysis on trees.  This flag
5572 is enabled by default at @option{-O} and higher.
5573
5574 @item -fipa-pta
5575 Perform interprocedural pointer analysis.
5576
5577 @item -ftree-sink
5578 Perform forward store motion  on trees.  This flag is
5579 enabled by default at @option{-O} and higher.
5580
5581 @item -ftree-ccp
5582 Perform sparse conditional constant propagation (CCP) on trees.  This
5583 pass only operates on local scalar variables and is enabled by default
5584 at @option{-O} and higher.
5585
5586 @item -ftree-store-ccp
5587 Perform sparse conditional constant propagation (CCP) on trees.  This
5588 pass operates on both local scalar variables and memory stores and
5589 loads (global variables, structures, arrays, etc).  This flag is
5590 enabled by default at @option{-O2} and higher.
5591
5592 @item -ftree-dce
5593 Perform dead code elimination (DCE) on trees.  This flag is enabled by
5594 default at @option{-O} and higher.
5595
5596 @item -ftree-dominator-opts
5597 Perform a variety of simple scalar cleanups (constant/copy
5598 propagation, redundancy elimination, range propagation and expression
5599 simplification) based on a dominator tree traversal.  This also
5600 performs jump threading (to reduce jumps to jumps). This flag is
5601 enabled by default at @option{-O} and higher.
5602
5603 @item -ftree-ch
5604 Perform loop header copying on trees.  This is beneficial since it increases
5605 effectiveness of code motion optimizations.  It also saves one jump.  This flag
5606 is enabled by default at @option{-O} and higher.  It is not enabled
5607 for @option{-Os}, since it usually increases code size.
5608
5609 @item -ftree-loop-optimize
5610 Perform loop optimizations on trees.  This flag is enabled by default
5611 at @option{-O} and higher.
5612
5613 @item -ftree-loop-linear
5614 Perform linear loop transformations on tree.  This flag can improve cache
5615 performance and allow further loop optimizations to take place.
5616
5617 @item -fcheck-data-deps
5618 Compare the results of several data dependence analyzers.  This option
5619 is used for debugging the data dependence analyzers.
5620
5621 @item -ftree-loop-im
5622 Perform loop invariant motion on trees.  This pass moves only invariants that
5623 would be hard to handle at RTL level (function calls, operations that expand to
5624 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
5625 operands of conditions that are invariant out of the loop, so that we can use
5626 just trivial invariantness analysis in loop unswitching.  The pass also includes
5627 store motion.
5628
5629 @item -ftree-loop-ivcanon
5630 Create a canonical counter for number of iterations in the loop for that
5631 determining number of iterations requires complicated analysis.  Later
5632 optimizations then may determine the number easily.  Useful especially
5633 in connection with unrolling.
5634
5635 @item -fivopts
5636 Perform induction variable optimizations (strength reduction, induction
5637 variable merging and induction variable elimination) on trees.
5638
5639 @item -ftree-sra
5640 Perform scalar replacement of aggregates.  This pass replaces structure
5641 references with scalars to prevent committing structures to memory too
5642 early.  This flag is enabled by default at @option{-O} and higher.
5643
5644 @item -ftree-copyrename
5645 Perform copy renaming on trees.  This pass attempts to rename compiler
5646 temporaries to other variables at copy locations, usually resulting in
5647 variable names which more closely resemble the original variables.  This flag
5648 is enabled by default at @option{-O} and higher.
5649
5650 @item -ftree-ter
5651 Perform temporary expression replacement during the SSA->normal phase.  Single
5652 use/single def temporaries are replaced at their use location with their
5653 defining expression.  This results in non-GIMPLE code, but gives the expanders
5654 much more complex trees to work on resulting in better RTL generation.  This is
5655 enabled by default at @option{-O} and higher.
5656
5657 @item -ftree-vectorize
5658 Perform loop vectorization on trees.
5659
5660 @item -ftree-vect-loop-version
5661 @opindex ftree-vect-loop-version
5662 Perform loop versioning when doing loop vectorization on trees.  When a loop
5663 appears to be vectorizable except that data alignment or data dependence cannot
5664 be determined at compile time then vectorized and non-vectorized versions of
5665 the loop are generated along with runtime checks for alignment or dependence
5666 to control which version is executed.  This option is enabled by default
5667 except at level @option{-Os} where it is disabled.
5668
5669 @item -ftree-vrp
5670 Perform Value Range Propagation on trees.  This is similar to the
5671 constant propagation pass, but instead of values, ranges of values are
5672 propagated.  This allows the optimizers to remove unnecessary range
5673 checks like array bound checks and null pointer checks.  This is
5674 enabled by default at @option{-O2} and higher.  Null pointer check
5675 elimination is only done if @option{-fdelete-null-pointer-checks} is
5676 enabled.
5677
5678 @item -ftracer
5679 @opindex ftracer
5680 Perform tail duplication to enlarge superblock size.  This transformation
5681 simplifies the control flow of the function allowing other optimizations to do
5682 better job.
5683
5684 @item -funroll-loops
5685 @opindex funroll-loops
5686 Unroll loops whose number of iterations can be determined at compile
5687 time or upon entry to the loop.  @option{-funroll-loops} implies
5688 @option{-frerun-cse-after-loop}.  This option makes code larger,
5689 and may or may not make it run faster.
5690
5691 @item -funroll-all-loops
5692 @opindex funroll-all-loops
5693 Unroll all loops, even if their number of iterations is uncertain when
5694 the loop is entered.  This usually makes programs run more slowly.
5695 @option{-funroll-all-loops} implies the same options as
5696 @option{-funroll-loops},
5697
5698 @item -fsplit-ivs-in-unroller
5699 @opindex fsplit-ivs-in-unroller
5700 Enables expressing of values of induction variables in later iterations
5701 of the unrolled loop using the value in the first iteration.  This breaks
5702 long dependency chains, thus improving efficiency of the scheduling passes.
5703
5704 Combination of @option{-fweb} and CSE is often sufficient to obtain the
5705 same effect.  However in cases the loop body is more complicated than
5706 a single basic block, this is not reliable.  It also does not work at all
5707 on some of the architectures due to restrictions in the CSE pass.
5708
5709 This optimization is enabled by default.
5710
5711 @item -fvariable-expansion-in-unroller
5712 @opindex fvariable-expansion-in-unroller
5713 With this option, the compiler will create multiple copies of some
5714 local variables when unrolling a loop which can result in superior code.
5715
5716 @item -fpredictive-commoning
5717 @opindex fpredictive-commoning
5718 Perform predictive commoning optimization, i.e., reusing computations
5719 (especially memory loads and stores) performed in previous
5720 iterations of loops.
5721
5722 This option is enabled at level @option{-O3}.
5723
5724 @item -fprefetch-loop-arrays
5725 @opindex fprefetch-loop-arrays
5726 If supported by the target machine, generate instructions to prefetch
5727 memory to improve the performance of loops that access large arrays.
5728
5729 This option may generate better or worse code; results are highly
5730 dependent on the structure of loops within the source code.
5731
5732 Disabled at level @option{-Os}.
5733
5734 @item -fno-peephole
5735 @itemx -fno-peephole2
5736 @opindex fno-peephole
5737 @opindex fno-peephole2
5738 Disable any machine-specific peephole optimizations.  The difference
5739 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
5740 are implemented in the compiler; some targets use one, some use the
5741 other, a few use both.
5742
5743 @option{-fpeephole} is enabled by default.
5744 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5745
5746 @item -fno-guess-branch-probability
5747 @opindex fno-guess-branch-probability
5748 Do not guess branch probabilities using heuristics.
5749
5750 GCC will use heuristics to guess branch probabilities if they are
5751 not provided by profiling feedback (@option{-fprofile-arcs}).  These
5752 heuristics are based on the control flow graph.  If some branch probabilities
5753 are specified by @samp{__builtin_expect}, then the heuristics will be
5754 used to guess branch probabilities for the rest of the control flow graph,
5755 taking the @samp{__builtin_expect} info into account.  The interactions
5756 between the heuristics and @samp{__builtin_expect} can be complex, and in
5757 some cases, it may be useful to disable the heuristics so that the effects
5758 of @samp{__builtin_expect} are easier to understand.
5759
5760 The default is @option{-fguess-branch-probability} at levels
5761 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5762
5763 @item -freorder-blocks
5764 @opindex freorder-blocks
5765 Reorder basic blocks in the compiled function in order to reduce number of
5766 taken branches and improve code locality.
5767
5768 Enabled at levels @option{-O2}, @option{-O3}.
5769
5770 @item -freorder-blocks-and-partition
5771 @opindex freorder-blocks-and-partition
5772 In addition to reordering basic blocks in the compiled function, in order
5773 to reduce number of taken branches, partitions hot and cold basic blocks
5774 into separate sections of the assembly and .o files, to improve
5775 paging and cache locality performance.
5776
5777 This optimization is automatically turned off in the presence of
5778 exception handling, for linkonce sections, for functions with a user-defined
5779 section attribute and on any architecture that does not support named
5780 sections.
5781
5782 @item -freorder-functions
5783 @opindex freorder-functions
5784 Reorder functions in the object file in order to
5785 improve code locality.  This is implemented by using special
5786 subsections @code{.text.hot} for most frequently executed functions and
5787 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
5788 the linker so object file format must support named sections and linker must
5789 place them in a reasonable way.
5790
5791 Also profile feedback must be available in to make this option effective.  See
5792 @option{-fprofile-arcs} for details.
5793
5794 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5795
5796 @item -fstrict-aliasing
5797 @opindex fstrict-aliasing
5798 Allows the compiler to assume the strictest aliasing rules applicable to
5799 the language being compiled.  For C (and C++), this activates
5800 optimizations based on the type of expressions.  In particular, an
5801 object of one type is assumed never to reside at the same address as an
5802 object of a different type, unless the types are almost the same.  For
5803 example, an @code{unsigned int} can alias an @code{int}, but not a
5804 @code{void*} or a @code{double}.  A character type may alias any other
5805 type.
5806
5807 Pay special attention to code like this:
5808 @smallexample
5809 union a_union @{
5810   int i;
5811   double d;
5812 @};
5813
5814 int f() @{
5815   a_union t;
5816   t.d = 3.0;
5817   return t.i;
5818 @}
5819 @end smallexample
5820 The practice of reading from a different union member than the one most
5821 recently written to (called ``type-punning'') is common.  Even with
5822 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
5823 is accessed through the union type.  So, the code above will work as
5824 expected.  However, this code might not:
5825 @smallexample
5826 int f() @{
5827   a_union t;
5828   int* ip;
5829   t.d = 3.0;
5830   ip = &t.i;
5831   return *ip;
5832 @}
5833 @end smallexample
5834
5835 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5836
5837 @item -fstrict-overflow
5838 @opindex fstrict-overflow
5839 Allow the compiler to assume strict signed overflow rules, depending
5840 on the language being compiled.  For C (and C++) this means that
5841 overflow when doing arithmetic with signed numbers is undefined, which
5842 means that the compiler may assume that it will not happen.  This
5843 permits various optimizations.  For example, the compiler will assume
5844 that an expression like @code{i + 10 > i} will always be true for
5845 signed @code{i}.  This assumption is only valid if signed overflow is
5846 undefined, as the expression is false if @code{i + 10} overflows when
5847 using twos complement arithmetic.  When this option is in effect any
5848 attempt to determine whether an operation on signed numbers will
5849 overflow must be written carefully to not actually involve overflow.
5850
5851 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
5852 that signed overflow is fully defined: it wraps.  When
5853 @option{-fwrapv} is used, there is no difference between
5854 @option{-fstrict-overflow} and @option{-fno-strict-overflow}.  With
5855 @option{-fwrapv} certain types of overflow are permitted.  For
5856 example, if the compiler gets an overflow when doing arithmetic on
5857 constants, the overflowed value can still be used with
5858 @option{-fwrapv}, but not otherwise.
5859
5860 The @option{-fstrict-overflow} option is enabled at levels
5861 @option{-O2}, @option{-O3}, @option{-Os}.
5862
5863 @item -falign-functions
5864 @itemx -falign-functions=@var{n}
5865 @opindex falign-functions
5866 Align the start of functions to the next power-of-two greater than
5867 @var{n}, skipping up to @var{n} bytes.  For instance,
5868 @option{-falign-functions=32} aligns functions to the next 32-byte
5869 boundary, but @option{-falign-functions=24} would align to the next
5870 32-byte boundary only if this can be done by skipping 23 bytes or less.
5871
5872 @option{-fno-align-functions} and @option{-falign-functions=1} are
5873 equivalent and mean that functions will not be aligned.
5874
5875 Some assemblers only support this flag when @var{n} is a power of two;
5876 in that case, it is rounded up.
5877
5878 If @var{n} is not specified or is zero, use a machine-dependent default.
5879
5880 Enabled at levels @option{-O2}, @option{-O3}.
5881
5882 @item -falign-labels
5883 @itemx -falign-labels=@var{n}
5884 @opindex falign-labels
5885 Align all branch targets to a power-of-two boundary, skipping up to
5886 @var{n} bytes like @option{-falign-functions}.  This option can easily
5887 make code slower, because it must insert dummy operations for when the
5888 branch target is reached in the usual flow of the code.
5889
5890 @option{-fno-align-labels} and @option{-falign-labels=1} are
5891 equivalent and mean that labels will not be aligned.
5892
5893 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
5894 are greater than this value, then their values are used instead.
5895
5896 If @var{n} is not specified or is zero, use a machine-dependent default
5897 which is very likely to be @samp{1}, meaning no alignment.
5898
5899 Enabled at levels @option{-O2}, @option{-O3}.
5900
5901 @item -falign-loops
5902 @itemx -falign-loops=@var{n}
5903 @opindex falign-loops
5904 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
5905 like @option{-falign-functions}.  The hope is that the loop will be
5906 executed many times, which will make up for any execution of the dummy
5907 operations.
5908
5909 @option{-fno-align-loops} and @option{-falign-loops=1} are
5910 equivalent and mean that loops will not be aligned.
5911
5912 If @var{n} is not specified or is zero, use a machine-dependent default.
5913
5914 Enabled at levels @option{-O2}, @option{-O3}.
5915
5916 @item -falign-jumps
5917 @itemx -falign-jumps=@var{n}
5918 @opindex falign-jumps
5919 Align branch targets to a power-of-two boundary, for branch targets
5920 where the targets can only be reached by jumping, skipping up to @var{n}
5921 bytes like @option{-falign-functions}.  In this case, no dummy operations
5922 need be executed.
5923
5924 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
5925 equivalent and mean that loops will not be aligned.
5926
5927 If @var{n} is not specified or is zero, use a machine-dependent default.
5928
5929 Enabled at levels @option{-O2}, @option{-O3}.
5930
5931 @item -funit-at-a-time
5932 @opindex funit-at-a-time
5933 Parse the whole compilation unit before starting to produce code.
5934 This allows some extra optimizations to take place but consumes
5935 more memory (in general).  There are some compatibility issues
5936 with @emph{unit-at-a-time} mode:
5937 @itemize @bullet
5938 @item
5939 enabling @emph{unit-at-a-time} mode may change the order
5940 in which functions, variables, and top-level @code{asm} statements
5941 are emitted, and will likely break code relying on some particular
5942 ordering.  The majority of such top-level @code{asm} statements,
5943 though, can be replaced by @code{section} attributes.  The
5944 @option{fno-toplevel-reorder} option may be used to keep the ordering
5945 used in the input file, at the cost of some optimizations.
5946
5947 @item
5948 @emph{unit-at-a-time} mode removes unreferenced static variables
5949 and functions.  This may result in undefined references
5950 when an @code{asm} statement refers directly to variables or functions
5951 that are otherwise unused.  In that case either the variable/function
5952 shall be listed as an operand of the @code{asm} statement operand or,
5953 in the case of top-level @code{asm} statements the attribute @code{used}
5954 shall be used on the declaration.
5955
5956 @item
5957 Static functions now can use non-standard passing conventions that
5958 may break @code{asm} statements calling functions directly.  Again,
5959 attribute @code{used} will prevent this behavior.
5960 @end itemize
5961
5962 As a temporary workaround, @option{-fno-unit-at-a-time} can be used,
5963 but this scheme may not be supported by future releases of GCC@.
5964
5965 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5966
5967 @item -fno-toplevel-reorder
5968 Do not reorder top-level functions, variables, and @code{asm}
5969 statements.  Output them in the same order that they appear in the
5970 input file.  When this option is used, unreferenced static variables
5971 will not be removed.  This option is intended to support existing code
5972 which relies on a particular ordering.  For new code, it is better to
5973 use attributes.
5974
5975 @item -fweb
5976 @opindex fweb
5977 Constructs webs as commonly used for register allocation purposes and assign
5978 each web individual pseudo register.  This allows the register allocation pass
5979 to operate on pseudos directly, but also strengthens several other optimization
5980 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
5981 however, make debugging impossible, since variables will no longer stay in a
5982 ``home register''.
5983
5984 Enabled by default with @option{-funroll-loops}.
5985
5986 @item -fwhole-program
5987 @opindex fwhole-program
5988 Assume that the current compilation unit represents whole program being
5989 compiled.  All public functions and variables with the exception of @code{main}
5990 and those merged by attribute @code{externally_visible} become static functions
5991 and in a affect gets more aggressively optimized by interprocedural optimizers.
5992 While this option is equivalent to proper use of @code{static} keyword for
5993 programs consisting of single file, in combination with option
5994 @option{--combine} this flag can be used to compile most of smaller scale C
5995 programs since the functions and variables become local for the whole combined
5996 compilation unit, not for the single source file itself.
5997
5998
5999 @item -fno-cprop-registers
6000 @opindex fno-cprop-registers
6001 After register allocation and post-register allocation instruction splitting,
6002 we perform a copy-propagation pass to try to reduce scheduling dependencies
6003 and occasionally eliminate the copy.
6004
6005 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6006
6007 @item -fprofile-generate
6008 @opindex fprofile-generate
6009
6010 Enable options usually used for instrumenting application to produce
6011 profile useful for later recompilation with profile feedback based
6012 optimization.  You must use @option{-fprofile-generate} both when
6013 compiling and when linking your program.
6014
6015 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
6016
6017 @item -fprofile-use
6018 @opindex fprofile-use
6019 Enable profile feedback directed optimizations, and optimizations
6020 generally profitable only with profile feedback available.
6021
6022 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
6023 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}
6024
6025 By default, GCC emits an error message if the feedback profiles do not
6026 match the source code.  This error can be turned into a warning by using
6027 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
6028 code.
6029 @end table
6030
6031 The following options control compiler behavior regarding floating
6032 point arithmetic.  These options trade off between speed and
6033 correctness.  All must be specifically enabled.
6034
6035 @table @gcctabopt
6036 @item -ffloat-store
6037 @opindex ffloat-store
6038 Do not store floating point variables in registers, and inhibit other
6039 options that might change whether a floating point value is taken from a
6040 register or memory.
6041
6042 @cindex floating point precision
6043 This option prevents undesirable excess precision on machines such as
6044 the 68000 where the floating registers (of the 68881) keep more
6045 precision than a @code{double} is supposed to have.  Similarly for the
6046 x86 architecture.  For most programs, the excess precision does only
6047 good, but a few programs rely on the precise definition of IEEE floating
6048 point.  Use @option{-ffloat-store} for such programs, after modifying
6049 them to store all pertinent intermediate computations into variables.
6050
6051 @item -ffast-math
6052 @opindex ffast-math
6053 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations}, @*
6054 @option{-fno-trapping-math}, @option{-ffinite-math-only},
6055 @option{-fno-rounding-math}, @option{-fno-signaling-nans},
6056 @option{-fno-signed-zeros} and @option{fcx-limited-range}.
6057
6058 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
6059
6060 This option is not turned on by any @option{-O} option since
6061 it can result in incorrect output for programs which depend on
6062 an exact implementation of IEEE or ISO rules/specifications for
6063 math functions. It may, however, yield faster code for programs
6064 that do not require the guarantees of these specifications.
6065
6066 @item -fno-math-errno
6067 @opindex fno-math-errno
6068 Do not set ERRNO after calling math functions that are executed
6069 with a single instruction, e.g., sqrt.  A program that relies on
6070 IEEE exceptions for math error handling may want to use this flag
6071 for speed while maintaining IEEE arithmetic compatibility.
6072
6073 This option is not turned on by any @option{-O} option since
6074 it can result in incorrect output for programs which depend on
6075 an exact implementation of IEEE or ISO rules/specifications for
6076 math functions. It may, however, yield faster code for programs
6077 that do not require the guarantees of these specifications.
6078
6079 The default is @option{-fmath-errno}.
6080
6081 On Darwin systems, the math library never sets @code{errno}.  There is
6082 therefore no reason for the compiler to consider the possibility that
6083 it might, and @option{-fno-math-errno} is the default.
6084
6085 @item -funsafe-math-optimizations
6086 @opindex funsafe-math-optimizations
6087 Allow optimizations for floating-point arithmetic that (a) assume
6088 that arguments and results are valid and (b) may violate IEEE or
6089 ANSI standards.  When used at link-time, it may include libraries
6090 or startup files that change the default FPU control word or other
6091 similar optimizations.
6092
6093 This option is not turned on by any @option{-O} option since
6094 it can result in incorrect output for programs which depend on
6095 an exact implementation of IEEE or ISO rules/specifications for
6096 math functions. It may, however, yield faster code for programs
6097 that do not require the guarantees of these specifications.
6098
6099 The default is @option{-fno-unsafe-math-optimizations}.
6100
6101 @item -ffinite-math-only
6102 @opindex ffinite-math-only
6103 Allow optimizations for floating-point arithmetic that assume
6104 that arguments and results are not NaNs or +-Infs.
6105
6106 This option is not turned on by any @option{-O} option since
6107 it can result in incorrect output for programs which depend on
6108 an exact implementation of IEEE or ISO rules/specifications for
6109 math functions. It may, however, yield faster code for programs
6110 that do not require the guarantees of these specifications.
6111
6112 The default is @option{-fno-finite-math-only}.
6113
6114 @item -fno-signed-zeros
6115 @opindex fno-signed-zeros
6116 Allow optimizations for floating point arithmetic that ignore the
6117 signedness of zero.  IEEE arithmetic specifies the behavior of
6118 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
6119 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
6120 This option implies that the sign of a zero result isn't significant.
6121
6122 The default is @option{-fsigned-zeros}.
6123
6124 @item -fno-trapping-math
6125 @opindex fno-trapping-math
6126 Compile code assuming that floating-point operations cannot generate
6127 user-visible traps.  These traps include division by zero, overflow,
6128 underflow, inexact result and invalid operation.  This option implies
6129 @option{-fno-signaling-nans}.  Setting this option may allow faster
6130 code if one relies on ``non-stop'' IEEE arithmetic, for example.
6131
6132 This option should never be turned on by any @option{-O} option since
6133 it can result in incorrect output for programs which depend on
6134 an exact implementation of IEEE or ISO rules/specifications for
6135 math functions.
6136
6137 The default is @option{-ftrapping-math}.
6138
6139 @item -frounding-math
6140 @opindex frounding-math
6141 Disable transformations and optimizations that assume default floating
6142 point rounding behavior.  This is round-to-zero for all floating point
6143 to integer conversions, and round-to-nearest for all other arithmetic
6144 truncations.  This option should be specified for programs that change
6145 the FP rounding mode dynamically, or that may be executed with a
6146 non-default rounding mode.  This option disables constant folding of
6147 floating point expressions at compile-time (which may be affected by
6148 rounding mode) and arithmetic transformations that are unsafe in the
6149 presence of sign-dependent rounding modes.
6150
6151 The default is @option{-fno-rounding-math}.
6152
6153 This option is experimental and does not currently guarantee to
6154 disable all GCC optimizations that are affected by rounding mode.
6155 Future versions of GCC may provide finer control of this setting
6156 using C99's @code{FENV_ACCESS} pragma.  This command line option
6157 will be used to specify the default state for @code{FENV_ACCESS}.
6158
6159 @item -frtl-abstract-sequences
6160 @opindex frtl-abstract-sequences
6161 It is a size optimization method. This option is to find identical
6162 sequences of code, which can be turned into pseudo-procedures  and
6163 then  replace  all  occurrences with  calls to  the  newly created
6164 subroutine. It is kind of an opposite of @option{-finline-functions}.
6165 This optimization runs at RTL level.
6166
6167 @item -fsignaling-nans
6168 @opindex fsignaling-nans
6169 Compile code assuming that IEEE signaling NaNs may generate user-visible
6170 traps during floating-point operations.  Setting this option disables
6171 optimizations that may change the number of exceptions visible with
6172 signaling NaNs.  This option implies @option{-ftrapping-math}.
6173
6174 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
6175 be defined.
6176
6177 The default is @option{-fno-signaling-nans}.
6178
6179 This option is experimental and does not currently guarantee to
6180 disable all GCC optimizations that affect signaling NaN behavior.
6181
6182 @item -fsingle-precision-constant
6183 @opindex fsingle-precision-constant
6184 Treat floating point constant as single precision constant instead of
6185 implicitly converting it to double precision constant.
6186
6187 @item -fcx-limited-range
6188 @itemx -fno-cx-limited-range
6189 @opindex fcx-limited-range
6190 @opindex fno-cx-limited-range
6191 When enabled, this option states that a range reduction step is not
6192 needed when performing complex division.  The default is
6193 @option{-fno-cx-limited-range}, but is enabled by @option{-ffast-math}.
6194
6195 This option controls the default setting of the ISO C99
6196 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
6197 all languages.
6198
6199 @end table
6200
6201 The following options control optimizations that may improve
6202 performance, but are not enabled by any @option{-O} options.  This
6203 section includes experimental options that may produce broken code.
6204
6205 @table @gcctabopt
6206 @item -fbranch-probabilities
6207 @opindex fbranch-probabilities
6208 After running a program compiled with @option{-fprofile-arcs}
6209 (@pxref{Debugging Options,, Options for Debugging Your Program or
6210 @command{gcc}}), you can compile it a second time using
6211 @option{-fbranch-probabilities}, to improve optimizations based on
6212 the number of times each branch was taken.  When the program
6213 compiled with @option{-fprofile-arcs} exits it saves arc execution
6214 counts to a file called @file{@var{sourcename}.gcda} for each source
6215 file.  The information in this data file is very dependent on the
6216 structure of the generated code, so you must use the same source code
6217 and the same optimization options for both compilations.
6218
6219 With @option{-fbranch-probabilities}, GCC puts a
6220 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
6221 These can be used to improve optimization.  Currently, they are only
6222 used in one place: in @file{reorg.c}, instead of guessing which path a
6223 branch is mostly to take, the @samp{REG_BR_PROB} values are used to
6224 exactly determine which path is taken more often.
6225
6226 @item -fprofile-values
6227 @opindex fprofile-values
6228 If combined with @option{-fprofile-arcs}, it adds code so that some
6229 data about values of expressions in the program is gathered.
6230
6231 With @option{-fbranch-probabilities}, it reads back the data gathered
6232 from profiling values of expressions and adds @samp{REG_VALUE_PROFILE}
6233 notes to instructions for their later usage in optimizations.
6234
6235 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
6236
6237 @item -fvpt
6238 @opindex fvpt
6239 If combined with @option{-fprofile-arcs}, it instructs the compiler to add
6240 a code to gather information about values of expressions.
6241
6242 With @option{-fbranch-probabilities}, it reads back the data gathered
6243 and actually performs the optimizations based on them.
6244 Currently the optimizations include specialization of division operation
6245 using the knowledge about the value of the denominator.
6246
6247 @item -frename-registers
6248 @opindex frename-registers
6249 Attempt to avoid false dependencies in scheduled code by making use
6250 of registers left over after register allocation.  This optimization
6251 will most benefit processors with lots of registers.  Depending on the
6252 debug information format adopted by the target, however, it can
6253 make debugging impossible, since variables will no longer stay in
6254 a ``home register''.
6255
6256 Enabled by default with @option{-funroll-loops}.
6257
6258 @item -ftracer
6259 @opindex ftracer
6260 Perform tail duplication to enlarge superblock size.  This transformation
6261 simplifies the control flow of the function allowing other optimizations to do
6262 better job.
6263
6264 Enabled with @option{-fprofile-use}.
6265
6266 @item -funroll-loops
6267 @opindex funroll-loops
6268 Unroll loops whose number of iterations can be determined at compile time or
6269 upon entry to the loop.  @option{-funroll-loops} implies
6270 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
6271 It also turns on complete loop peeling (i.e.@: complete removal of loops with
6272 small constant number of iterations).  This option makes code larger, and may
6273 or may not make it run faster.
6274
6275 Enabled with @option{-fprofile-use}.
6276
6277 @item -funroll-all-loops
6278 @opindex funroll-all-loops
6279 Unroll all loops, even if their number of iterations is uncertain when
6280 the loop is entered.  This usually makes programs run more slowly.
6281 @option{-funroll-all-loops} implies the same options as
6282 @option{-funroll-loops}.
6283
6284 @item -fpeel-loops
6285 @opindex fpeel-loops
6286 Peels the loops for that there is enough information that they do not
6287 roll much (from profile feedback).  It also turns on complete loop peeling
6288 (i.e.@: complete removal of loops with small constant number of iterations).
6289
6290 Enabled with @option{-fprofile-use}.
6291
6292 @item -fmove-loop-invariants
6293 @opindex fmove-loop-invariants
6294 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
6295 at level @option{-O1}
6296
6297 @item -funswitch-loops
6298 @opindex funswitch-loops
6299 Move branches with loop invariant conditions out of the loop, with duplicates
6300 of the loop on both branches (modified according to result of the condition).
6301
6302 @item -ffunction-sections
6303 @itemx -fdata-sections
6304 @opindex ffunction-sections
6305 @opindex fdata-sections
6306 Place each function or data item into its own section in the output
6307 file if the target supports arbitrary sections.  The name of the
6308 function or the name of the data item determines the section's name
6309 in the output file.
6310
6311 Use these options on systems where the linker can perform optimizations
6312 to improve locality of reference in the instruction space.  Most systems
6313 using the ELF object format and SPARC processors running Solaris 2 have
6314 linkers with such optimizations.  AIX may have these optimizations in
6315 the future.
6316
6317 Only use these options when there are significant benefits from doing
6318 so.  When you specify these options, the assembler and linker will
6319 create larger object and executable files and will also be slower.
6320 You will not be able to use @code{gprof} on all systems if you
6321 specify this option and you may have problems with debugging if
6322 you specify both this option and @option{-g}.
6323
6324 @item -fbranch-target-load-optimize
6325 @opindex fbranch-target-load-optimize
6326 Perform branch target register load optimization before prologue / epilogue
6327 threading.
6328 The use of target registers can typically be exposed only during reload,
6329 thus hoisting loads out of loops and doing inter-block scheduling needs
6330 a separate optimization pass.
6331
6332 @item -fbranch-target-load-optimize2
6333 @opindex fbranch-target-load-optimize2
6334 Perform branch target register load optimization after prologue / epilogue
6335 threading.
6336
6337 @item -fbtr-bb-exclusive
6338 @opindex fbtr-bb-exclusive
6339 When performing branch target register load optimization, don't reuse
6340 branch target registers in within any basic block.
6341
6342 @item -fstack-protector
6343 Emit extra code to check for buffer overflows, such as stack smashing
6344 attacks.  This is done by adding a guard variable to functions with
6345 vulnerable objects.  This includes functions that call alloca, and
6346 functions with buffers larger than 8 bytes.  The guards are initialized
6347 when a function is entered and then checked when the function exits.
6348 If a guard check fails, an error message is printed and the program exits.
6349
6350 @item -fstack-protector-all
6351 Like @option{-fstack-protector} except that all functions are protected.
6352
6353 @item -fsection-anchors
6354 @opindex fsection-anchors
6355 Try to reduce the number of symbolic address calculations by using
6356 shared ``anchor'' symbols to address nearby objects.  This transformation
6357 can help to reduce the number of GOT entries and GOT accesses on some
6358 targets.
6359
6360 For example, the implementation of the following function @code{foo}:
6361
6362 @smallexample
6363 static int a, b, c;
6364 int foo (void) @{ return a + b + c; @}
6365 @end smallexample
6366
6367 would usually calculate the addresses of all three variables, but if you
6368 compile it with @option{-fsection-anchors}, it will access the variables
6369 from a common anchor point instead.  The effect is similar to the
6370 following pseudocode (which isn't valid C):
6371
6372 @smallexample
6373 int foo (void)
6374 @{
6375   register int *xr = &x;
6376   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
6377 @}
6378 @end smallexample
6379
6380 Not all targets support this option.
6381
6382 @item --param @var{name}=@var{value}
6383 @opindex param
6384 In some places, GCC uses various constants to control the amount of
6385 optimization that is done.  For example, GCC will not inline functions
6386 that contain more that a certain number of instructions.  You can
6387 control some of these constants on the command-line using the
6388 @option{--param} option.
6389
6390 The names of specific parameters, and the meaning of the values, are
6391 tied to the internals of the compiler, and are subject to change
6392 without notice in future releases.
6393
6394 In each case, the @var{value} is an integer.  The allowable choices for
6395 @var{name} are given in the following table:
6396
6397 @table @gcctabopt
6398 @item salias-max-implicit-fields
6399 The maximum number of fields in a variable without direct
6400 structure accesses for which structure aliasing will consider trying
6401 to track each field.  The default is 5
6402
6403 @item salias-max-array-elements
6404 The maximum number of elements an array can have and its elements
6405 still be tracked individually by structure aliasing. The default is 4
6406
6407 @item sra-max-structure-size
6408 The maximum structure size, in bytes, at which the scalar replacement
6409 of aggregates (SRA) optimization will perform block copies.  The
6410 default value, 0, implies that GCC will select the most appropriate
6411 size itself.
6412
6413 @item sra-field-structure-ratio
6414 The threshold ratio (as a percentage) between instantiated fields and
6415 the complete structure size.  We say that if the ratio of the number
6416 of bytes in instantiated fields to the number of bytes in the complete
6417 structure exceeds this parameter, then block copies are not used.  The
6418 default is 75.
6419
6420 @item max-crossjump-edges
6421 The maximum number of incoming edges to consider for crossjumping.
6422 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
6423 the number of edges incoming to each block.  Increasing values mean
6424 more aggressive optimization, making the compile time increase with
6425 probably small improvement in executable size.
6426
6427 @item min-crossjump-insns
6428 The minimum number of instructions which must be matched at the end
6429 of two blocks before crossjumping will be performed on them.  This
6430 value is ignored in the case where all instructions in the block being
6431 crossjumped from are matched.  The default value is 5.
6432
6433 @item max-grow-copy-bb-insns
6434 The maximum code size expansion factor when copying basic blocks
6435 instead of jumping.  The expansion is relative to a jump instruction.
6436 The default value is 8.
6437
6438 @item max-goto-duplication-insns
6439 The maximum number of instructions to duplicate to a block that jumps
6440 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
6441 passes, GCC factors computed gotos early in the compilation process,
6442 and unfactors them as late as possible.  Only computed jumps at the
6443 end of a basic blocks with no more than max-goto-duplication-insns are
6444 unfactored.  The default value is 8.
6445
6446 @item max-delay-slot-insn-search
6447 The maximum number of instructions to consider when looking for an
6448 instruction to fill a delay slot.  If more than this arbitrary number of
6449 instructions is searched, the time savings from filling the delay slot
6450 will be minimal so stop searching.  Increasing values mean more
6451 aggressive optimization, making the compile time increase with probably
6452 small improvement in executable run time.
6453
6454 @item max-delay-slot-live-search
6455 When trying to fill delay slots, the maximum number of instructions to
6456 consider when searching for a block with valid live register
6457 information.  Increasing this arbitrarily chosen value means more
6458 aggressive optimization, increasing the compile time.  This parameter
6459 should be removed when the delay slot code is rewritten to maintain the
6460 control-flow graph.
6461
6462 @item max-gcse-memory
6463 The approximate maximum amount of memory that will be allocated in
6464 order to perform the global common subexpression elimination
6465 optimization.  If more memory than specified is required, the
6466 optimization will not be done.
6467
6468 @item max-gcse-passes
6469 The maximum number of passes of GCSE to run.  The default is 1.
6470
6471 @item max-pending-list-length
6472 The maximum number of pending dependencies scheduling will allow
6473 before flushing the current state and starting over.  Large functions
6474 with few branches or calls can create excessively large lists which
6475 needlessly consume memory and resources.
6476
6477 @item max-inline-insns-single
6478 Several parameters control the tree inliner used in gcc.
6479 This number sets the maximum number of instructions (counted in GCC's
6480 internal representation) in a single function that the tree inliner
6481 will consider for inlining.  This only affects functions declared
6482 inline and methods implemented in a class declaration (C++).
6483 The default value is 450.
6484
6485 @item max-inline-insns-auto
6486 When you use @option{-finline-functions} (included in @option{-O3}),
6487 a lot of functions that would otherwise not be considered for inlining
6488 by the compiler will be investigated.  To those functions, a different
6489 (more restrictive) limit compared to functions declared inline can
6490 be applied.
6491 The default value is 90.
6492
6493 @item large-function-insns
6494 The limit specifying really large functions.  For functions larger than this
6495 limit after inlining inlining is constrained by
6496 @option{--param large-function-growth}.  This parameter is useful primarily
6497 to avoid extreme compilation time caused by non-linear algorithms used by the
6498 backend.
6499 This parameter is ignored when @option{-funit-at-a-time} is not used.
6500 The default value is 2700.
6501
6502 @item large-function-growth
6503 Specifies maximal growth of large function caused by inlining in percents.
6504 This parameter is ignored when @option{-funit-at-a-time} is not used.
6505 The default value is 100 which limits large function growth to 2.0 times
6506 the original size.
6507
6508 @item large-unit-insns
6509 The limit specifying large translation unit.  Growth caused by inlining of
6510 units larger than this limit is limited by @option{--param inline-unit-growth}.
6511 For small units this might be too tight (consider unit consisting of function A
6512 that is inline and B that just calls A three time.  If B is small relative to
6513 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
6514 large units consisting of small inlininable functions however the overall unit
6515 growth limit is needed to avoid exponential explosion of code size.  Thus for
6516 smaller units, the size is increased to @option{--param large-unit-insns}
6517 before applying @option{--param inline-unit-growth}.  The default is 10000
6518
6519 @item inline-unit-growth
6520 Specifies maximal overall growth of the compilation unit caused by inlining.
6521 This parameter is ignored when @option{-funit-at-a-time} is not used.
6522 The default value is 30 which limits unit growth to 1.3 times the original
6523 size.
6524
6525 @item large-stack-frame
6526 The limit specifying large stack frames.  While inlining the algorithm is trying
6527 to not grow past this limit too much.  Default value is 256 bytes.
6528
6529 @item large-stack-frame-growth
6530 Specifies maximal growth of large stack frames caused by inlining in percents.
6531 The default value is 1000 which limits large stack frame growth to 11 times
6532 the original size.
6533
6534 @item max-inline-insns-recursive
6535 @itemx max-inline-insns-recursive-auto
6536 Specifies maximum number of instructions out-of-line copy of self recursive inline
6537 function can grow into by performing recursive inlining.
6538
6539 For functions declared inline @option{--param max-inline-insns-recursive} is
6540 taken into account.  For function not declared inline, recursive inlining
6541 happens only when @option{-finline-functions} (included in @option{-O3}) is
6542 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
6543 default value is 450.
6544
6545 @item max-inline-recursive-depth
6546 @itemx max-inline-recursive-depth-auto
6547 Specifies maximum recursion depth used by the recursive inlining.
6548
6549 For functions declared inline @option{--param max-inline-recursive-depth} is
6550 taken into account.  For function not declared inline, recursive inlining
6551 happens only when @option{-finline-functions} (included in @option{-O3}) is
6552 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
6553 default value is 450.
6554
6555 @item min-inline-recursive-probability
6556 Recursive inlining is profitable only for function having deep recursion
6557 in average and can hurt for function having little recursion depth by
6558 increasing the prologue size or complexity of function body to other
6559 optimizers.
6560
6561 When profile feedback is available (see @option{-fprofile-generate}) the actual
6562 recursion depth can be guessed from probability that function will recurse via
6563 given call expression.  This parameter limits inlining only to call expression
6564 whose probability exceeds given threshold (in percents).  The default value is
6565 10.
6566
6567 @item inline-call-cost
6568 Specify cost of call instruction relative to simple arithmetics operations
6569 (having cost of 1).  Increasing this cost disqualifies inlining of non-leaf
6570 functions and at the same time increases size of leaf function that is believed to
6571 reduce function size by being inlined.  In effect it increases amount of
6572 inlining for code having large abstraction penalty (many functions that just
6573 pass the arguments to other functions) and decrease inlining for code with low
6574 abstraction penalty.  The default value is 16.
6575
6576 @item min-vect-loop-bound
6577 The minimum number of iterations under which a loop will not get vectorized
6578 when @option{-ftree-vectorize} is used.  The number of iterations after
6579 vectorization needs to be greater than the value specified by this option
6580 to allow vectorization.  The default value is 0.
6581
6582 @item max-unrolled-insns
6583 The maximum number of instructions that a loop should have if that loop
6584 is unrolled, and if the loop is unrolled, it determines how many times
6585 the loop code is unrolled.
6586
6587 @item max-average-unrolled-insns
6588 The maximum number of instructions biased by probabilities of their execution
6589 that a loop should have if that loop is unrolled, and if the loop is unrolled,
6590 it determines how many times the loop code is unrolled.
6591
6592 @item max-unroll-times
6593 The maximum number of unrollings of a single loop.
6594
6595 @item max-peeled-insns
6596 The maximum number of instructions that a loop should have if that loop
6597 is peeled, and if the loop is peeled, it determines how many times
6598 the loop code is peeled.
6599
6600 @item max-peel-times
6601 The maximum number of peelings of a single loop.
6602
6603 @item max-completely-peeled-insns
6604 The maximum number of insns of a completely peeled loop.
6605
6606 @item max-completely-peel-times
6607 The maximum number of iterations of a loop to be suitable for complete peeling.
6608
6609 @item max-unswitch-insns
6610 The maximum number of insns of an unswitched loop.
6611
6612 @item max-unswitch-level
6613 The maximum number of branches unswitched in a single loop.
6614
6615 @item lim-expensive
6616 The minimum cost of an expensive expression in the loop invariant motion.
6617
6618 @item iv-consider-all-candidates-bound
6619 Bound on number of candidates for induction variables below that
6620 all candidates are considered for each use in induction variable
6621 optimizations.  Only the most relevant candidates are considered
6622 if there are more candidates, to avoid quadratic time complexity.
6623
6624 @item iv-max-considered-uses
6625 The induction variable optimizations give up on loops that contain more
6626 induction variable uses.
6627
6628 @item iv-always-prune-cand-set-bound
6629 If number of candidates in the set is smaller than this value,
6630 we always try to remove unnecessary ivs from the set during its
6631 optimization when a new iv is added to the set.
6632
6633 @item scev-max-expr-size
6634 Bound on size of expressions used in the scalar evolutions analyzer.
6635 Large expressions slow the analyzer.
6636
6637 @item omega-max-vars
6638 The maximum number of variables in an Omega constraint system.
6639 The default value is 128.
6640
6641 @item omega-max-geqs
6642 The maximum number of inequalities in an Omega constraint system.
6643 The default value is 256.
6644
6645 @item omega-max-eqs
6646 The maximum number of equalities in an Omega constraint system.
6647 The default value is 128.
6648
6649 @item omega-max-wild-cards
6650 The maximum number of wildcard variables that the Omega solver will
6651 be able to insert.  The default value is 18.
6652
6653 @item omega-hash-table-size
6654 The size of the hash table in the Omega solver.  The default value is
6655 550.
6656
6657 @item omega-max-keys
6658 The maximal number of keys used by the Omega solver.  The default
6659 value is 500.
6660
6661 @item omega-eliminate-redundant-constraints
6662 When set to 1, use expensive methods to eliminate all redundant
6663 constraints.  The default value is 0.
6664
6665 @item vect-max-version-checks
6666 The maximum number of runtime checks that can be performed when doing
6667 loop versioning in the vectorizer.  See option ftree-vect-loop-version
6668 for more information.
6669
6670 @item max-iterations-to-track
6671
6672 The maximum number of iterations of a loop the brute force algorithm
6673 for analysis of # of iterations of the loop tries to evaluate.
6674
6675 @item hot-bb-count-fraction
6676 Select fraction of the maximal count of repetitions of basic block in program
6677 given basic block needs to have to be considered hot.
6678
6679 @item hot-bb-frequency-fraction
6680 Select fraction of the maximal frequency of executions of basic block in
6681 function given basic block needs to have to be considered hot
6682
6683 @item max-predicted-iterations
6684 The maximum number of loop iterations we predict statically.  This is useful
6685 in cases where function contain single loop with known bound and other loop
6686 with unknown.  We predict the known number of iterations correctly, while
6687 the unknown number of iterations average to roughly 10.  This means that the
6688 loop without bounds would appear artificially cold relative to the other one.
6689
6690 @item tracer-dynamic-coverage
6691 @itemx tracer-dynamic-coverage-feedback
6692
6693 This value is used to limit superblock formation once the given percentage of
6694 executed instructions is covered.  This limits unnecessary code size
6695 expansion.
6696
6697 The @option{tracer-dynamic-coverage-feedback} is used only when profile
6698 feedback is available.  The real profiles (as opposed to statically estimated
6699 ones) are much less balanced allowing the threshold to be larger value.
6700
6701 @item tracer-max-code-growth
6702 Stop tail duplication once code growth has reached given percentage.  This is
6703 rather hokey argument, as most of the duplicates will be eliminated later in
6704 cross jumping, so it may be set to much higher values than is the desired code
6705 growth.
6706
6707 @item tracer-min-branch-ratio
6708
6709 Stop reverse growth when the reverse probability of best edge is less than this
6710 threshold (in percent).
6711
6712 @item tracer-min-branch-ratio
6713 @itemx tracer-min-branch-ratio-feedback
6714
6715 Stop forward growth if the best edge do have probability lower than this
6716 threshold.
6717
6718 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
6719 compilation for profile feedback and one for compilation without.  The value
6720 for compilation with profile feedback needs to be more conservative (higher) in
6721 order to make tracer effective.
6722
6723 @item max-cse-path-length
6724
6725 Maximum number of basic blocks on path that cse considers.  The default is 10.
6726
6727 @item max-cse-insns
6728 The maximum instructions CSE process before flushing. The default is 1000.
6729
6730 @item max-aliased-vops
6731
6732 Maximum number of virtual operands per function allowed to represent
6733 aliases before triggering the alias partitioning heuristic.  Alias
6734 partitioning reduces compile times and memory consumption needed for
6735 aliasing at the expense of precision loss in alias information.  The
6736 default value for this parameter is 100 for -O1, 500 for -O2 and 1000
6737 for -O3.
6738
6739 Notice that if a function contains more memory statements than the
6740 value of this parameter, it is not really possible to achieve this
6741 reduction.  In this case, the compiler will use the number of memory
6742 statements as the value for @option{max-aliased-vops}.
6743
6744 @item avg-aliased-vops
6745
6746 Average number of virtual operands per statement allowed to represent
6747 aliases before triggering the alias partitioning heuristic.  This
6748 works in conjunction with @option{max-aliased-vops}.  If a function
6749 contains more than @option{max-aliased-vops} virtual operators, then
6750 memory symbols will be grouped into memory partitions until either the
6751 total number of virtual operators is below @option{max-aliased-vops}
6752 or the average number of virtual operators per memory statement is
6753 below @option{avg-aliased-vops}.  The default value for this parameter
6754 is 1 for -O1 and -O2, and 3 for -O3.
6755
6756 @item ggc-min-expand
6757
6758 GCC uses a garbage collector to manage its own memory allocation.  This
6759 parameter specifies the minimum percentage by which the garbage
6760 collector's heap should be allowed to expand between collections.
6761 Tuning this may improve compilation speed; it has no effect on code
6762 generation.
6763
6764 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
6765 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of "RAM" is
6766 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
6767 GCC is not able to calculate RAM on a particular platform, the lower
6768 bound of 30% is used.  Setting this parameter and
6769 @option{ggc-min-heapsize} to zero causes a full collection to occur at
6770 every opportunity.  This is extremely slow, but can be useful for
6771 debugging.
6772
6773 @item ggc-min-heapsize
6774
6775 Minimum size of the garbage collector's heap before it begins bothering
6776 to collect garbage.  The first collection occurs after the heap expands
6777 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
6778 tuning this may improve compilation speed, and has no effect on code
6779 generation.
6780
6781 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit which
6782 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
6783 with a lower bound of 4096 (four megabytes) and an upper bound of
6784 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
6785 particular platform, the lower bound is used.  Setting this parameter
6786 very large effectively disables garbage collection.  Setting this
6787 parameter and @option{ggc-min-expand} to zero causes a full collection
6788 to occur at every opportunity.
6789
6790 @item max-reload-search-insns
6791 The maximum number of instruction reload should look backward for equivalent
6792 register.  Increasing values mean more aggressive optimization, making the
6793 compile time increase with probably slightly better performance.  The default
6794 value is 100.
6795
6796 @item max-cselib-memory-locations
6797 The maximum number of memory locations cselib should take into account.
6798 Increasing values mean more aggressive optimization, making the compile time
6799 increase with probably slightly better performance.  The default value is 500.
6800
6801 @item max-flow-memory-locations
6802 Similar as @option{max-cselib-memory-locations} but for dataflow liveness.
6803 The default value is 100.
6804
6805 @item reorder-blocks-duplicate
6806 @itemx reorder-blocks-duplicate-feedback
6807
6808 Used by basic block reordering pass to decide whether to use unconditional
6809 branch or duplicate the code on its destination.  Code is duplicated when its
6810 estimated size is smaller than this value multiplied by the estimated size of
6811 unconditional jump in the hot spots of the program.
6812
6813 The @option{reorder-block-duplicate-feedback} is used only when profile
6814 feedback is available and may be set to higher values than
6815 @option{reorder-block-duplicate} since information about the hot spots is more
6816 accurate.
6817
6818 @item max-sched-ready-insns
6819 The maximum number of instructions ready to be issued the scheduler should
6820 consider at any given time during the first scheduling pass.  Increasing
6821 values mean more thorough searches, making the compilation time increase
6822 with probably little benefit.  The default value is 100.
6823
6824 @item max-sched-region-blocks
6825 The maximum number of blocks in a region to be considered for
6826 interblock scheduling.  The default value is 10.
6827
6828 @item max-sched-region-insns
6829 The maximum number of insns in a region to be considered for
6830 interblock scheduling.  The default value is 100.
6831
6832 @item min-spec-prob
6833 The minimum probability (in percents) of reaching a source block
6834 for interblock speculative scheduling.  The default value is 40.
6835
6836 @item max-sched-extend-regions-iters
6837 The maximum number of iterations through CFG to extend regions.
6838 0 - disable region extension,
6839 N - do at most N iterations.
6840 The default value is 0.
6841
6842 @item max-sched-insn-conflict-delay
6843 The maximum conflict delay for an insn to be considered for speculative motion.
6844 The default value is 3.
6845
6846 @item sched-spec-prob-cutoff
6847 The minimal probability of speculation success (in percents), so that
6848 speculative insn will be scheduled.
6849 The default value is 40.
6850
6851 @item max-last-value-rtl
6852
6853 The maximum size measured as number of RTLs that can be recorded in an expression
6854 in combiner for a pseudo register as last known value of that register.  The default
6855 is 10000.
6856
6857 @item integer-share-limit
6858 Small integer constants can use a shared data structure, reducing the
6859 compiler's memory usage and increasing its speed.  This sets the maximum
6860 value of a shared integer constant's.  The default value is 256.
6861
6862 @item min-virtual-mappings
6863 Specifies the minimum number of virtual mappings in the incremental
6864 SSA updater that should be registered to trigger the virtual mappings
6865 heuristic defined by virtual-mappings-ratio.  The default value is
6866 100.
6867
6868 @item virtual-mappings-ratio
6869 If the number of virtual mappings is virtual-mappings-ratio bigger
6870 than the number of virtual symbols to be updated, then the incremental
6871 SSA updater switches to a full update for those symbols.  The default
6872 ratio is 3.
6873
6874 @item ssp-buffer-size
6875 The minimum size of buffers (i.e. arrays) that will receive stack smashing
6876 protection when @option{-fstack-protection} is used.
6877
6878 @item max-jump-thread-duplication-stmts
6879 Maximum number of statements allowed in a block that needs to be
6880 duplicated when threading jumps.
6881
6882 @item max-fields-for-field-sensitive
6883 Maximum number of fields in a structure we will treat in
6884 a field sensitive manner during pointer analysis.
6885
6886 @item prefetch-latency
6887 Estimate on average number of instructions that are executed before
6888 prefetch finishes.  The distance we prefetch ahead is proportional
6889 to this constant.  Increasing this number may also lead to less
6890 streams being prefetched (see @option{simultaneous-prefetches}).
6891
6892 @item simultaneous-prefetches
6893 Maximum number of prefetches that can run at the same time.
6894
6895 @item l1-cache-line-size
6896 The size of cache line in L1 cache, in bytes.
6897
6898 @item l1-cache-size
6899 The number of cache lines in L1 cache.
6900
6901 @item verify-canonical-types
6902 Whether the compiler should verify the ``canonical'' types used for
6903 type equality comparisons within the C++ and Objective-C++ front
6904 ends. Set to 1 (the default when GCC is configured with
6905 --enable-checking) to enable verification, 0 to disable verification
6906 (the default when GCC is configured with --disable-checking).
6907
6908 @end table
6909 @end table
6910
6911 @node Preprocessor Options
6912 @section Options Controlling the Preprocessor
6913 @cindex preprocessor options
6914 @cindex options, preprocessor
6915
6916 These options control the C preprocessor, which is run on each C source
6917 file before actual compilation.
6918
6919 If you use the @option{-E} option, nothing is done except preprocessing.
6920 Some of these options make sense only together with @option{-E} because
6921 they cause the preprocessor output to be unsuitable for actual
6922 compilation.
6923
6924 @table @gcctabopt
6925 @opindex Wp
6926 You can use @option{-Wp,@var{option}} to bypass the compiler driver
6927 and pass @var{option} directly through to the preprocessor.  If
6928 @var{option} contains commas, it is split into multiple options at the
6929 commas.  However, many options are modified, translated or interpreted
6930 by the compiler driver before being passed to the preprocessor, and
6931 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
6932 interface is undocumented and subject to change, so whenever possible
6933 you should avoid using @option{-Wp} and let the driver handle the
6934 options instead.
6935
6936 @item -Xpreprocessor @var{option}
6937 @opindex preprocessor
6938 Pass @var{option} as an option to the preprocessor.  You can use this to
6939 supply system-specific preprocessor options which GCC does not know how to
6940 recognize.
6941
6942 If you want to pass an option that takes an argument, you must use
6943 @option{-Xpreprocessor} twice, once for the option and once for the argument.
6944 @end table
6945
6946 @include cppopts.texi
6947
6948 @node Assembler Options
6949 @section Passing Options to the Assembler
6950
6951 @c prevent bad page break with this line
6952 You can pass options to the assembler.
6953
6954 @table @gcctabopt
6955 @item -Wa,@var{option}
6956 @opindex Wa
6957 Pass @var{option} as an option to the assembler.  If @var{option}
6958 contains commas, it is split into multiple options at the commas.
6959
6960 @item -Xassembler @var{option}
6961 @opindex Xassembler
6962 Pass @var{option} as an option to the assembler.  You can use this to
6963 supply system-specific assembler options which GCC does not know how to
6964 recognize.
6965
6966 If you want to pass an option that takes an argument, you must use
6967 @option{-Xassembler} twice, once for the option and once for the argument.
6968
6969 @end table
6970
6971 @node Link Options
6972 @section Options for Linking
6973 @cindex link options
6974 @cindex options, linking
6975
6976 These options come into play when the compiler links object files into
6977 an executable output file.  They are meaningless if the compiler is
6978 not doing a link step.
6979
6980 @table @gcctabopt
6981 @cindex file names
6982 @item @var{object-file-name}
6983 A file name that does not end in a special recognized suffix is
6984 considered to name an object file or library.  (Object files are
6985 distinguished from libraries by the linker according to the file
6986 contents.)  If linking is done, these object files are used as input
6987 to the linker.
6988
6989 @item -c
6990 @itemx -S
6991 @itemx -E
6992 @opindex c
6993 @opindex S
6994 @opindex E
6995 If any of these options is used, then the linker is not run, and
6996 object file names should not be used as arguments.  @xref{Overall
6997 Options}.
6998
6999 @cindex Libraries
7000 @item -l@var{library}
7001 @itemx -l @var{library}
7002 @opindex l
7003 Search the library named @var{library} when linking.  (The second
7004 alternative with the library as a separate argument is only for
7005 POSIX compliance and is not recommended.)
7006
7007 It makes a difference where in the command you write this option; the
7008 linker searches and processes libraries and object files in the order they
7009 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
7010 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
7011 to functions in @samp{z}, those functions may not be loaded.
7012
7013 The linker searches a standard list of directories for the library,
7014 which is actually a file named @file{lib@var{library}.a}.  The linker
7015 then uses this file as if it had been specified precisely by name.
7016
7017 The directories searched include several standard system directories
7018 plus any that you specify with @option{-L}.
7019
7020 Normally the files found this way are library files---archive files
7021 whose members are object files.  The linker handles an archive file by
7022 scanning through it for members which define symbols that have so far
7023 been referenced but not defined.  But if the file that is found is an
7024 ordinary object file, it is linked in the usual fashion.  The only
7025 difference between using an @option{-l} option and specifying a file name
7026 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
7027 and searches several directories.
7028
7029 @item -lobjc
7030 @opindex lobjc
7031 You need this special case of the @option{-l} option in order to
7032 link an Objective-C or Objective-C++ program.
7033
7034 @item -nostartfiles
7035 @opindex nostartfiles
7036 Do not use the standard system startup files when linking.
7037 The standard system libraries are used normally, unless @option{-nostdlib}
7038 or @option{-nodefaultlibs} is used.
7039
7040 @item -nodefaultlibs
7041 @opindex nodefaultlibs
7042 Do not use the standard system libraries when linking.
7043 Only the libraries you specify will be passed to the linker.
7044 The standard startup files are used normally, unless @option{-nostartfiles}
7045 is used.  The compiler may generate calls to @code{memcmp},
7046 @code{memset}, @code{memcpy} and @code{memmove}.
7047 These entries are usually resolved by entries in
7048 libc.  These entry points should be supplied through some other
7049 mechanism when this option is specified.
7050
7051 @item -nostdlib
7052 @opindex nostdlib
7053 Do not use the standard system startup files or libraries when linking.
7054 No startup files and only the libraries you specify will be passed to
7055 the linker.  The compiler may generate calls to @code{memcmp}, @code{memset},
7056 @code{memcpy} and @code{memmove}.
7057 These entries are usually resolved by entries in
7058 libc.  These entry points should be supplied through some other
7059 mechanism when this option is specified.
7060
7061 @cindex @option{-lgcc}, use with @option{-nostdlib}
7062 @cindex @option{-nostdlib} and unresolved references
7063 @cindex unresolved references and @option{-nostdlib}
7064 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
7065 @cindex @option{-nodefaultlibs} and unresolved references
7066 @cindex unresolved references and @option{-nodefaultlibs}
7067 One of the standard libraries bypassed by @option{-nostdlib} and
7068 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
7069 that GCC uses to overcome shortcomings of particular machines, or special
7070 needs for some languages.
7071 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
7072 Collection (GCC) Internals},
7073 for more discussion of @file{libgcc.a}.)
7074 In most cases, you need @file{libgcc.a} even when you want to avoid
7075 other standard libraries.  In other words, when you specify @option{-nostdlib}
7076 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
7077 This ensures that you have no unresolved references to internal GCC
7078 library subroutines.  (For example, @samp{__main}, used to ensure C++
7079 constructors will be called; @pxref{Collect2,,@code{collect2}, gccint,
7080 GNU Compiler Collection (GCC) Internals}.)
7081
7082 @item -pie
7083 @opindex pie
7084 Produce a position independent executable on targets which support it.
7085 For predictable results, you must also specify the same set of options
7086 that were used to generate code (@option{-fpie}, @option{-fPIE},
7087 or model suboptions) when you specify this option.
7088
7089 @item -rdynamic
7090 @opindex rdynamic
7091 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
7092 that support it. This instructs the linker to add all symbols, not
7093 only used ones, to the dynamic symbol table. This option is needed
7094 for some uses of @code{dlopen} or to allow obtaining backtraces
7095 from within a program.
7096
7097 @item -s
7098 @opindex s
7099 Remove all symbol table and relocation information from the executable.
7100
7101 @item -static
7102 @opindex static
7103 On systems that support dynamic linking, this prevents linking with the shared
7104 libraries.  On other systems, this option has no effect.
7105
7106 @item -shared
7107 @opindex shared
7108 Produce a shared object which can then be linked with other objects to
7109 form an executable.  Not all systems support this option.  For predictable
7110 results, you must also specify the same set of options that were used to
7111 generate code (@option{-fpic}, @option{-fPIC}, or model suboptions)
7112 when you specify this option.@footnote{On some systems, @samp{gcc -shared}
7113 needs to build supplementary stub code for constructors to work.  On
7114 multi-libbed systems, @samp{gcc -shared} must select the correct support
7115 libraries to link against.  Failing to supply the correct flags may lead
7116 to subtle defects.  Supplying them in cases where they are not necessary
7117 is innocuous.}
7118
7119 @item -shared-libgcc
7120 @itemx -static-libgcc
7121 @opindex shared-libgcc
7122 @opindex static-libgcc
7123 On systems that provide @file{libgcc} as a shared library, these options
7124 force the use of either the shared or static version respectively.
7125 If no shared version of @file{libgcc} was built when the compiler was
7126 configured, these options have no effect.
7127
7128 There are several situations in which an application should use the
7129 shared @file{libgcc} instead of the static version.  The most common
7130 of these is when the application wishes to throw and catch exceptions
7131 across different shared libraries.  In that case, each of the libraries
7132 as well as the application itself should use the shared @file{libgcc}.
7133
7134 Therefore, the G++ and GCJ drivers automatically add
7135 @option{-shared-libgcc} whenever you build a shared library or a main
7136 executable, because C++ and Java programs typically use exceptions, so
7137 this is the right thing to do.
7138
7139 If, instead, you use the GCC driver to create shared libraries, you may
7140 find that they will not always be linked with the shared @file{libgcc}.
7141 If GCC finds, at its configuration time, that you have a non-GNU linker
7142 or a GNU linker that does not support option @option{--eh-frame-hdr},
7143 it will link the shared version of @file{libgcc} into shared libraries
7144 by default.  Otherwise, it will take advantage of the linker and optimize
7145 away the linking with the shared version of @file{libgcc}, linking with
7146 the static version of libgcc by default.  This allows exceptions to
7147 propagate through such shared libraries, without incurring relocation
7148 costs at library load time.
7149
7150 However, if a library or main executable is supposed to throw or catch
7151 exceptions, you must link it using the G++ or GCJ driver, as appropriate
7152 for the languages used in the program, or using the option
7153 @option{-shared-libgcc}, such that it is linked with the shared
7154 @file{libgcc}.
7155
7156 @item -symbolic
7157 @opindex symbolic
7158 Bind references to global symbols when building a shared object.  Warn
7159 about any unresolved references (unless overridden by the link editor
7160 option @samp{-Xlinker -z -Xlinker defs}).  Only a few systems support
7161 this option.
7162
7163 @item -Xlinker @var{option}
7164 @opindex Xlinker
7165 Pass @var{option} as an option to the linker.  You can use this to
7166 supply system-specific linker options which GCC does not know how to
7167 recognize.
7168
7169 If you want to pass an option that takes an argument, you must use
7170 @option{-Xlinker} twice, once for the option and once for the argument.
7171 For example, to pass @option{-assert definitions}, you must write
7172 @samp{-Xlinker -assert -Xlinker definitions}.  It does not work to write
7173 @option{-Xlinker "-assert definitions"}, because this passes the entire
7174 string as a single argument, which is not what the linker expects.
7175
7176 @item -Wl,@var{option}
7177 @opindex Wl
7178 Pass @var{option} as an option to the linker.  If @var{option} contains
7179 commas, it is split into multiple options at the commas.
7180
7181 @item -u @var{symbol}
7182 @opindex u
7183 Pretend the symbol @var{symbol} is undefined, to force linking of
7184 library modules to define it.  You can use @option{-u} multiple times with
7185 different symbols to force loading of additional library modules.
7186 @end table
7187
7188 @node Directory Options
7189 @section Options for Directory Search
7190 @cindex directory options
7191 @cindex options, directory search
7192 @cindex search path
7193
7194 These options specify directories to search for header files, for
7195 libraries and for parts of the compiler:
7196
7197 @table @gcctabopt
7198 @item -I@var{dir}
7199 @opindex I
7200 Add the directory @var{dir} to the head of the list of directories to be
7201 searched for header files.  This can be used to override a system header
7202 file, substituting your own version, since these directories are
7203 searched before the system header file directories.  However, you should
7204 not use this option to add directories that contain vendor-supplied
7205 system header files (use @option{-isystem} for that).  If you use more than
7206 one @option{-I} option, the directories are scanned in left-to-right
7207 order; the standard system directories come after.
7208
7209 If a standard system include directory, or a directory specified with
7210 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
7211 option will be ignored.  The directory will still be searched but as a
7212 system directory at its normal position in the system include chain.
7213 This is to ensure that GCC's procedure to fix buggy system headers and
7214 the ordering for the include_next directive are not inadvertently changed.
7215 If you really need to change the search order for system directories,
7216 use the @option{-nostdinc} and/or @option{-isystem} options.
7217
7218 @item -iquote@var{dir}
7219 @opindex iquote
7220 Add the directory @var{dir} to the head of the list of directories to
7221 be searched for header files only for the case of @samp{#include
7222 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
7223 otherwise just like @option{-I}.
7224
7225 @item -L@var{dir}
7226 @opindex L
7227 Add directory @var{dir} to the list of directories to be searched
7228 for @option{-l}.
7229
7230 @item -B@var{prefix}
7231 @opindex B
7232 This option specifies where to find the executables, libraries,
7233 include files, and data files of the compiler itself.
7234
7235 The compiler driver program runs one or more of the subprograms
7236 @file{cpp}, @file{cc1}, @file{as} and @file{ld}.  It tries
7237 @var{prefix} as a prefix for each program it tries to run, both with and
7238 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
7239
7240 For each subprogram to be run, the compiler driver first tries the
7241 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
7242 was not specified, the driver tries two standard prefixes, which are
7243 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
7244 those results in a file name that is found, the unmodified program
7245 name is searched for using the directories specified in your
7246 @env{PATH} environment variable.
7247
7248 The compiler will check to see if the path provided by the @option{-B}
7249 refers to a directory, and if necessary it will add a directory
7250 separator character at the end of the path.
7251
7252 @option{-B} prefixes that effectively specify directory names also apply
7253 to libraries in the linker, because the compiler translates these
7254 options into @option{-L} options for the linker.  They also apply to
7255 includes files in the preprocessor, because the compiler translates these
7256 options into @option{-isystem} options for the preprocessor.  In this case,
7257 the compiler appends @samp{include} to the prefix.
7258
7259 The run-time support file @file{libgcc.a} can also be searched for using
7260 the @option{-B} prefix, if needed.  If it is not found there, the two
7261 standard prefixes above are tried, and that is all.  The file is left
7262 out of the link if it is not found by those means.
7263
7264 Another way to specify a prefix much like the @option{-B} prefix is to use
7265 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
7266 Variables}.
7267
7268 As a special kludge, if the path provided by @option{-B} is
7269 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
7270 9, then it will be replaced by @file{[dir/]include}.  This is to help
7271 with boot-strapping the compiler.
7272
7273 @item -specs=@var{file}
7274 @opindex specs
7275 Process @var{file} after the compiler reads in the standard @file{specs}
7276 file, in order to override the defaults that the @file{gcc} driver
7277 program uses when determining what switches to pass to @file{cc1},
7278 @file{cc1plus}, @file{as}, @file{ld}, etc.  More than one
7279 @option{-specs=@var{file}} can be specified on the command line, and they
7280 are processed in order, from left to right.
7281
7282 @item --sysroot=@var{dir}
7283 @opindex sysroot
7284 Use @var{dir} as the logical root directory for headers and libraries.
7285 For example, if the compiler would normally search for headers in
7286 @file{/usr/include} and libraries in @file{/usr/lib}, it will instead
7287 search @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
7288
7289 If you use both this option and the @option{-isysroot} option, then
7290 the @option{--sysroot} option will apply to libraries, but the
7291 @option{-isysroot} option will apply to header files.
7292
7293 The GNU linker (beginning with version 2.16) has the necessary support
7294 for this option.  If your linker does not support this option, the
7295 header file aspect of @option{--sysroot} will still work, but the
7296 library aspect will not.
7297
7298 @item -I-
7299 @opindex I-
7300 This option has been deprecated.  Please use @option{-iquote} instead for
7301 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
7302 Any directories you specify with @option{-I} options before the @option{-I-}
7303 option are searched only for the case of @samp{#include "@var{file}"};
7304 they are not searched for @samp{#include <@var{file}>}.
7305
7306 If additional directories are specified with @option{-I} options after
7307 the @option{-I-}, these directories are searched for all @samp{#include}
7308 directives.  (Ordinarily @emph{all} @option{-I} directories are used
7309 this way.)
7310
7311 In addition, the @option{-I-} option inhibits the use of the current
7312 directory (where the current input file came from) as the first search
7313 directory for @samp{#include "@var{file}"}.  There is no way to
7314 override this effect of @option{-I-}.  With @option{-I.} you can specify
7315 searching the directory which was current when the compiler was
7316 invoked.  That is not exactly the same as what the preprocessor does
7317 by default, but it is often satisfactory.
7318
7319 @option{-I-} does not inhibit the use of the standard system directories
7320 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
7321 independent.
7322 @end table
7323
7324 @c man end
7325
7326 @node Spec Files
7327 @section Specifying subprocesses and the switches to pass to them
7328 @cindex Spec Files
7329
7330 @command{gcc} is a driver program.  It performs its job by invoking a
7331 sequence of other programs to do the work of compiling, assembling and
7332 linking.  GCC interprets its command-line parameters and uses these to
7333 deduce which programs it should invoke, and which command-line options
7334 it ought to place on their command lines.  This behavior is controlled
7335 by @dfn{spec strings}.  In most cases there is one spec string for each
7336 program that GCC can invoke, but a few programs have multiple spec
7337 strings to control their behavior.  The spec strings built into GCC can
7338 be overridden by using the @option{-specs=} command-line switch to specify
7339 a spec file.
7340
7341 @dfn{Spec files} are plaintext files that are used to construct spec
7342 strings.  They consist of a sequence of directives separated by blank
7343 lines.  The type of directive is determined by the first non-whitespace
7344 character on the line and it can be one of the following:
7345
7346 @table @code
7347 @item %@var{command}
7348 Issues a @var{command} to the spec file processor.  The commands that can
7349 appear here are:
7350
7351 @table @code
7352 @item %include <@var{file}>
7353 @cindex %include
7354 Search for @var{file} and insert its text at the current point in the
7355 specs file.
7356
7357 @item %include_noerr <@var{file}>
7358 @cindex %include_noerr
7359 Just like @samp{%include}, but do not generate an error message if the include
7360 file cannot be found.
7361
7362 @item %rename @var{old_name} @var{new_name}
7363 @cindex %rename
7364 Rename the spec string @var{old_name} to @var{new_name}.
7365
7366 @end table
7367
7368 @item *[@var{spec_name}]:
7369 This tells the compiler to create, override or delete the named spec
7370 string.  All lines after this directive up to the next directive or
7371 blank line are considered to be the text for the spec string.  If this
7372 results in an empty string then the spec will be deleted.  (Or, if the
7373 spec did not exist, then nothing will happened.)  Otherwise, if the spec
7374 does not currently exist a new spec will be created.  If the spec does
7375 exist then its contents will be overridden by the text of this
7376 directive, unless the first character of that text is the @samp{+}
7377 character, in which case the text will be appended to the spec.
7378
7379 @item [@var{suffix}]:
7380 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
7381 and up to the next directive or blank line are considered to make up the
7382 spec string for the indicated suffix.  When the compiler encounters an
7383 input file with the named suffix, it will processes the spec string in
7384 order to work out how to compile that file.  For example:
7385
7386 @smallexample
7387 .ZZ:
7388 z-compile -input %i
7389 @end smallexample
7390
7391 This says that any input file whose name ends in @samp{.ZZ} should be
7392 passed to the program @samp{z-compile}, which should be invoked with the
7393 command-line switch @option{-input} and with the result of performing the
7394 @samp{%i} substitution.  (See below.)
7395
7396 As an alternative to providing a spec string, the text that follows a
7397 suffix directive can be one of the following:
7398
7399 @table @code
7400 @item @@@var{language}
7401 This says that the suffix is an alias for a known @var{language}.  This is
7402 similar to using the @option{-x} command-line switch to GCC to specify a
7403 language explicitly.  For example:
7404
7405 @smallexample
7406 .ZZ:
7407 @@c++
7408 @end smallexample
7409
7410 Says that .ZZ files are, in fact, C++ source files.
7411
7412 @item #@var{name}
7413 This causes an error messages saying:
7414
7415 @smallexample
7416 @var{name} compiler not installed on this system.
7417 @end smallexample
7418 @end table
7419
7420 GCC already has an extensive list of suffixes built into it.
7421 This directive will add an entry to the end of the list of suffixes, but
7422 since the list is searched from the end backwards, it is effectively
7423 possible to override earlier entries using this technique.
7424
7425 @end table
7426
7427 GCC has the following spec strings built into it.  Spec files can
7428 override these strings or create their own.  Note that individual
7429 targets can also add their own spec strings to this list.
7430
7431 @smallexample
7432 asm          Options to pass to the assembler
7433 asm_final    Options to pass to the assembler post-processor
7434 cpp          Options to pass to the C preprocessor
7435 cc1          Options to pass to the C compiler
7436 cc1plus      Options to pass to the C++ compiler
7437 endfile      Object files to include at the end of the link
7438 link         Options to pass to the linker
7439 lib          Libraries to include on the command line to the linker
7440 libgcc       Decides which GCC support library to pass to the linker
7441 linker       Sets the name of the linker
7442 predefines   Defines to be passed to the C preprocessor
7443 signed_char  Defines to pass to CPP to say whether @code{char} is signed
7444              by default
7445 startfile    Object files to include at the start of the link
7446 @end smallexample
7447
7448 Here is a small example of a spec file:
7449
7450 @smallexample
7451 %rename lib                 old_lib
7452
7453 *lib:
7454 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
7455 @end smallexample
7456
7457 This example renames the spec called @samp{lib} to @samp{old_lib} and
7458 then overrides the previous definition of @samp{lib} with a new one.
7459 The new definition adds in some extra command-line options before
7460 including the text of the old definition.
7461
7462 @dfn{Spec strings} are a list of command-line options to be passed to their
7463 corresponding program.  In addition, the spec strings can contain
7464 @samp{%}-prefixed sequences to substitute variable text or to
7465 conditionally insert text into the command line.  Using these constructs
7466 it is possible to generate quite complex command lines.
7467
7468 Here is a table of all defined @samp{%}-sequences for spec
7469 strings.  Note that spaces are not generated automatically around the
7470 results of expanding these sequences.  Therefore you can concatenate them
7471 together or combine them with constant text in a single argument.
7472
7473 @table @code
7474 @item %%
7475 Substitute one @samp{%} into the program name or argument.
7476
7477 @item %i
7478 Substitute the name of the input file being processed.
7479
7480 @item %b
7481 Substitute the basename of the input file being processed.
7482 This is the substring up to (and not including) the last period
7483 and not including the directory.
7484
7485 @item %B
7486 This is the same as @samp{%b}, but include the file suffix (text after
7487 the last period).
7488
7489 @item %d
7490 Marks the argument containing or following the @samp{%d} as a
7491 temporary file name, so that that file will be deleted if GCC exits
7492 successfully.  Unlike @samp{%g}, this contributes no text to the
7493 argument.
7494
7495 @item %g@var{suffix}
7496 Substitute a file name that has suffix @var{suffix} and is chosen
7497 once per compilation, and mark the argument in the same way as
7498 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
7499 name is now chosen in a way that is hard to predict even when previously
7500 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
7501 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
7502 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
7503 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
7504 was simply substituted with a file name chosen once per compilation,
7505 without regard to any appended suffix (which was therefore treated
7506 just like ordinary text), making such attacks more likely to succeed.
7507
7508 @item %u@var{suffix}
7509 Like @samp{%g}, but generates a new temporary file name even if
7510 @samp{%u@var{suffix}} was already seen.
7511
7512 @item %U@var{suffix}
7513 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
7514 new one if there is no such last file name.  In the absence of any
7515 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
7516 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
7517 would involve the generation of two distinct file names, one
7518 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
7519 simply substituted with a file name chosen for the previous @samp{%u},
7520 without regard to any appended suffix.
7521
7522 @item %j@var{suffix}
7523 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
7524 writable, and if save-temps is off; otherwise, substitute the name
7525 of a temporary file, just like @samp{%u}.  This temporary file is not
7526 meant for communication between processes, but rather as a junk
7527 disposal mechanism.
7528
7529 @item %|@var{suffix}
7530 @itemx %m@var{suffix}
7531 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
7532 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
7533 all.  These are the two most common ways to instruct a program that it
7534 should read from standard input or write to standard output.  If you
7535 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
7536 construct: see for example @file{f/lang-specs.h}.
7537
7538 @item %.@var{SUFFIX}
7539 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
7540 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
7541 terminated by the next space or %.
7542
7543 @item %w
7544 Marks the argument containing or following the @samp{%w} as the
7545 designated output file of this compilation.  This puts the argument
7546 into the sequence of arguments that @samp{%o} will substitute later.
7547
7548 @item %o
7549 Substitutes the names of all the output files, with spaces
7550 automatically placed around them.  You should write spaces
7551 around the @samp{%o} as well or the results are undefined.
7552 @samp{%o} is for use in the specs for running the linker.
7553 Input files whose names have no recognized suffix are not compiled
7554 at all, but they are included among the output files, so they will
7555 be linked.
7556
7557 @item %O
7558 Substitutes the suffix for object files.  Note that this is
7559 handled specially when it immediately follows @samp{%g, %u, or %U},
7560 because of the need for those to form complete file names.  The
7561 handling is such that @samp{%O} is treated exactly as if it had already
7562 been substituted, except that @samp{%g, %u, and %U} do not currently
7563 support additional @var{suffix} characters following @samp{%O} as they would
7564 following, for example, @samp{.o}.
7565
7566 @item %p
7567 Substitutes the standard macro predefinitions for the
7568 current target machine.  Use this when running @code{cpp}.
7569
7570 @item %P
7571 Like @samp{%p}, but puts @samp{__} before and after the name of each
7572 predefined macro, except for macros that start with @samp{__} or with
7573 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
7574 C@.
7575
7576 @item %I
7577 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
7578 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
7579 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
7580 and @option{-imultilib} as necessary.
7581
7582 @item %s
7583 Current argument is the name of a library or startup file of some sort.
7584 Search for that file in a standard list of directories and substitute
7585 the full name found.
7586
7587 @item %e@var{str}
7588 Print @var{str} as an error message.  @var{str} is terminated by a newline.
7589 Use this when inconsistent options are detected.
7590
7591 @item %(@var{name})
7592 Substitute the contents of spec string @var{name} at this point.
7593
7594 @item %[@var{name}]
7595 Like @samp{%(@dots{})} but put @samp{__} around @option{-D} arguments.
7596
7597 @item %x@{@var{option}@}
7598 Accumulate an option for @samp{%X}.
7599
7600 @item %X
7601 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
7602 spec string.
7603
7604 @item %Y
7605 Output the accumulated assembler options specified by @option{-Wa}.
7606
7607 @item %Z
7608 Output the accumulated preprocessor options specified by @option{-Wp}.
7609
7610 @item %a
7611 Process the @code{asm} spec.  This is used to compute the
7612 switches to be passed to the assembler.
7613
7614 @item %A
7615 Process the @code{asm_final} spec.  This is a spec string for
7616 passing switches to an assembler post-processor, if such a program is
7617 needed.
7618
7619 @item %l
7620 Process the @code{link} spec.  This is the spec for computing the
7621 command line passed to the linker.  Typically it will make use of the
7622 @samp{%L %G %S %D and %E} sequences.
7623
7624 @item %D
7625 Dump out a @option{-L} option for each directory that GCC believes might
7626 contain startup files.  If the target supports multilibs then the
7627 current multilib directory will be prepended to each of these paths.
7628
7629 @item %L
7630 Process the @code{lib} spec.  This is a spec string for deciding which
7631 libraries should be included on the command line to the linker.
7632
7633 @item %G
7634 Process the @code{libgcc} spec.  This is a spec string for deciding
7635 which GCC support library should be included on the command line to the linker.
7636
7637 @item %S
7638 Process the @code{startfile} spec.  This is a spec for deciding which
7639 object files should be the first ones passed to the linker.  Typically
7640 this might be a file named @file{crt0.o}.
7641
7642 @item %E
7643 Process the @code{endfile} spec.  This is a spec string that specifies
7644 the last object files that will be passed to the linker.
7645
7646 @item %C
7647 Process the @code{cpp} spec.  This is used to construct the arguments
7648 to be passed to the C preprocessor.
7649
7650 @item %1
7651 Process the @code{cc1} spec.  This is used to construct the options to be
7652 passed to the actual C compiler (@samp{cc1}).
7653
7654 @item %2
7655 Process the @code{cc1plus} spec.  This is used to construct the options to be
7656 passed to the actual C++ compiler (@samp{cc1plus}).
7657
7658 @item %*
7659 Substitute the variable part of a matched option.  See below.
7660 Note that each comma in the substituted string is replaced by
7661 a single space.
7662
7663 @item %<@code{S}
7664 Remove all occurrences of @code{-S} from the command line.  Note---this
7665 command is position dependent.  @samp{%} commands in the spec string
7666 before this one will see @code{-S}, @samp{%} commands in the spec string
7667 after this one will not.
7668
7669 @item %:@var{function}(@var{args})
7670 Call the named function @var{function}, passing it @var{args}.
7671 @var{args} is first processed as a nested spec string, then split
7672 into an argument vector in the usual fashion.  The function returns
7673 a string which is processed as if it had appeared literally as part
7674 of the current spec.
7675
7676 The following built-in spec functions are provided:
7677
7678 @table @code
7679 @item @code{getenv}
7680 The @code{getenv} spec function takes two arguments: an environment
7681 variable name and a string.  If the environment variable is not
7682 defined, a fatal error is issued.  Otherwise, the return value is the
7683 value of the environment variable concatenated with the string.  For
7684 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
7685
7686 @smallexample
7687 %:getenv(TOPDIR /include)
7688 @end smallexample
7689
7690 expands to @file{/path/to/top/include}.
7691
7692 @item @code{if-exists}
7693 The @code{if-exists} spec function takes one argument, an absolute
7694 pathname to a file.  If the file exists, @code{if-exists} returns the
7695 pathname.  Here is a small example of its usage:
7696
7697 @smallexample
7698 *startfile:
7699 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
7700 @end smallexample
7701
7702 @item @code{if-exists-else}
7703 The @code{if-exists-else} spec function is similar to the @code{if-exists}
7704 spec function, except that it takes two arguments.  The first argument is
7705 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
7706 returns the pathname.  If it does not exist, it returns the second argument.
7707 This way, @code{if-exists-else} can be used to select one file or another,
7708 based on the existence of the first.  Here is a small example of its usage:
7709
7710 @smallexample
7711 *startfile:
7712 crt0%O%s %:if-exists(crti%O%s) \
7713 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
7714 @end smallexample
7715
7716 @item @code{replace-outfile}
7717 The @code{replace-outfile} spec function takes two arguments.  It looks for the
7718 first argument in the outfiles array and replaces it with the second argument.  Here
7719 is a small example of its usage:
7720
7721 @smallexample
7722 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
7723 @end smallexample
7724
7725 @item @code{print-asm-header}
7726 The @code{print-asm-header} function takes no arguments and simply
7727 prints a banner like:
7728
7729 @smallexample
7730 Assembler options
7731 =================
7732
7733 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
7734 @end smallexample
7735
7736 It is used to separate compiler options from assembler options
7737 in the @option{--target-help} output.
7738 @end table
7739
7740 @item %@{@code{S}@}
7741 Substitutes the @code{-S} switch, if that switch was given to GCC@.
7742 If that switch was not specified, this substitutes nothing.  Note that
7743 the leading dash is omitted when specifying this option, and it is
7744 automatically inserted if the substitution is performed.  Thus the spec
7745 string @samp{%@{foo@}} would match the command-line option @option{-foo}
7746 and would output the command line option @option{-foo}.
7747
7748 @item %W@{@code{S}@}
7749 Like %@{@code{S}@} but mark last argument supplied within as a file to be
7750 deleted on failure.
7751
7752 @item %@{@code{S}*@}
7753 Substitutes all the switches specified to GCC whose names start
7754 with @code{-S}, but which also take an argument.  This is used for
7755 switches like @option{-o}, @option{-D}, @option{-I}, etc.
7756 GCC considers @option{-o foo} as being
7757 one switch whose names starts with @samp{o}.  %@{o*@} would substitute this
7758 text, including the space.  Thus two arguments would be generated.
7759
7760 @item %@{@code{S}*&@code{T}*@}
7761 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
7762 (the order of @code{S} and @code{T} in the spec is not significant).
7763 There can be any number of ampersand-separated variables; for each the
7764 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
7765
7766 @item %@{@code{S}:@code{X}@}
7767 Substitutes @code{X}, if the @samp{-S} switch was given to GCC@.
7768
7769 @item %@{!@code{S}:@code{X}@}
7770 Substitutes @code{X}, if the @samp{-S} switch was @emph{not} given to GCC@.
7771
7772 @item %@{@code{S}*:@code{X}@}
7773 Substitutes @code{X} if one or more switches whose names start with
7774 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
7775 once, no matter how many such switches appeared.  However, if @code{%*}
7776 appears somewhere in @code{X}, then @code{X} will be substituted once
7777 for each matching switch, with the @code{%*} replaced by the part of
7778 that switch that matched the @code{*}.
7779
7780 @item %@{.@code{S}:@code{X}@}
7781 Substitutes @code{X}, if processing a file with suffix @code{S}.
7782
7783 @item %@{!.@code{S}:@code{X}@}
7784 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
7785
7786 @item %@{,@code{S}:@code{X}@}
7787 Substitutes @code{X}, if processing a file for language @code{S}.
7788
7789 @item %@{!,@code{S}:@code{X}@}
7790 Substitutes @code{X}, if not processing a file for language @code{S}.
7791
7792 @item %@{@code{S}|@code{P}:@code{X}@}
7793 Substitutes @code{X} if either @code{-S} or @code{-P} was given to
7794 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
7795 @code{*} sequences as well, although they have a stronger binding than
7796 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
7797 alternatives must be starred, and only the first matching alternative
7798 is substituted.
7799
7800 For example, a spec string like this:
7801
7802 @smallexample
7803 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
7804 @end smallexample
7805
7806 will output the following command-line options from the following input
7807 command-line options:
7808
7809 @smallexample
7810 fred.c        -foo -baz
7811 jim.d         -bar -boggle
7812 -d fred.c     -foo -baz -boggle
7813 -d jim.d      -bar -baz -boggle
7814 @end smallexample
7815
7816 @item %@{S:X; T:Y; :D@}
7817
7818 If @code{S} was given to GCC, substitutes @code{X}; else if @code{T} was
7819 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
7820 be as many clauses as you need.  This may be combined with @code{.},
7821 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
7822
7823
7824 @end table
7825
7826 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
7827 construct may contain other nested @samp{%} constructs or spaces, or
7828 even newlines.  They are processed as usual, as described above.
7829 Trailing white space in @code{X} is ignored.  White space may also
7830 appear anywhere on the left side of the colon in these constructs,
7831 except between @code{.} or @code{*} and the corresponding word.
7832
7833 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
7834 handled specifically in these constructs.  If another value of
7835 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
7836 @option{-W} switch is found later in the command line, the earlier
7837 switch value is ignored, except with @{@code{S}*@} where @code{S} is
7838 just one letter, which passes all matching options.
7839
7840 The character @samp{|} at the beginning of the predicate text is used to
7841 indicate that a command should be piped to the following command, but
7842 only if @option{-pipe} is specified.
7843
7844 It is built into GCC which switches take arguments and which do not.
7845 (You might think it would be useful to generalize this to allow each
7846 compiler's spec to say which switches take arguments.  But this cannot
7847 be done in a consistent fashion.  GCC cannot even decide which input
7848 files have been specified without knowing which switches take arguments,
7849 and it must know which input files to compile in order to tell which
7850 compilers to run).
7851
7852 GCC also knows implicitly that arguments starting in @option{-l} are to be
7853 treated as compiler output files, and passed to the linker in their
7854 proper position among the other output files.
7855
7856 @c man begin OPTIONS
7857
7858 @node Target Options
7859 @section Specifying Target Machine and Compiler Version
7860 @cindex target options
7861 @cindex cross compiling
7862 @cindex specifying machine version
7863 @cindex specifying compiler version and target machine
7864 @cindex compiler version, specifying
7865 @cindex target machine, specifying
7866
7867 The usual way to run GCC is to run the executable called @file{gcc}, or
7868 @file{<machine>-gcc} when cross-compiling, or
7869 @file{<machine>-gcc-<version>} to run a version other than the one that
7870 was installed last.  Sometimes this is inconvenient, so GCC provides
7871 options that will switch to another cross-compiler or version.
7872
7873 @table @gcctabopt
7874 @item -b @var{machine}
7875 @opindex b
7876 The argument @var{machine} specifies the target machine for compilation.
7877
7878 The value to use for @var{machine} is the same as was specified as the
7879 machine type when configuring GCC as a cross-compiler.  For
7880 example, if a cross-compiler was configured with @samp{configure
7881 arm-elf}, meaning to compile for an arm processor with elf binaries,
7882 then you would specify @option{-b arm-elf} to run that cross compiler.
7883 Because there are other options beginning with @option{-b}, the
7884 configuration must contain a hyphen.
7885
7886 @item -V @var{version}
7887 @opindex V
7888 The argument @var{version} specifies which version of GCC to run.
7889 This is useful when multiple versions are installed.  For example,
7890 @var{version} might be @samp{4.0}, meaning to run GCC version 4.0.
7891 @end table
7892
7893 The @option{-V} and @option{-b} options work by running the
7894 @file{<machine>-gcc-<version>} executable, so there's no real reason to
7895 use them if you can just run that directly.
7896
7897 @node Submodel Options
7898 @section Hardware Models and Configurations
7899 @cindex submodel options
7900 @cindex specifying hardware config
7901 @cindex hardware models and configurations, specifying
7902 @cindex machine dependent options
7903
7904 Earlier we discussed the standard option @option{-b} which chooses among
7905 different installed compilers for completely different target
7906 machines, such as VAX vs.@: 68000 vs.@: 80386.
7907
7908 In addition, each of these target machine types can have its own
7909 special options, starting with @samp{-m}, to choose among various
7910 hardware models or configurations---for example, 68010 vs 68020,
7911 floating coprocessor or none.  A single installed version of the
7912 compiler can compile for any model or configuration, according to the
7913 options specified.
7914
7915 Some configurations of the compiler also support additional special
7916 options, usually for compatibility with other compilers on the same
7917 platform.
7918
7919 @c This list is ordered alphanumerically by subsection name.
7920 @c It should be the same order and spelling as these options are listed
7921 @c in Machine Dependent Options
7922
7923 @menu
7924 * ARC Options::
7925 * ARM Options::
7926 * AVR Options::
7927 * Blackfin Options::
7928 * CRIS Options::
7929 * CRX Options::
7930 * Darwin Options::
7931 * DEC Alpha Options::
7932 * DEC Alpha/VMS Options::
7933 * FRV Options::
7934 * GNU/Linux Options::
7935 * H8/300 Options::
7936 * HPPA Options::
7937 * i386 and x86-64 Options::
7938 * IA-64 Options::
7939 * M32C Options::
7940 * M32R/D Options::
7941 * M680x0 Options::
7942 * M68hc1x Options::
7943 * MCore Options::
7944 * MIPS Options::
7945 * MMIX Options::
7946 * MN10300 Options::
7947 * MT Options::
7948 * PDP-11 Options::
7949 * PowerPC Options::
7950 * RS/6000 and PowerPC Options::
7951 * S/390 and zSeries Options::
7952 * Score Options::
7953 * SH Options::
7954 * SPARC Options::
7955 * SPU Options::
7956 * System V Options::
7957 * TMS320C3x/C4x Options::
7958 * V850 Options::
7959 * VAX Options::
7960 * VxWorks Options::
7961 * x86-64 Options::
7962 * Xstormy16 Options::
7963 * Xtensa Options::
7964 * zSeries Options::
7965 @end menu
7966
7967 @node ARC Options
7968 @subsection ARC Options
7969 @cindex ARC Options
7970
7971 These options are defined for ARC implementations:
7972
7973 @table @gcctabopt
7974 @item -EL
7975 @opindex EL
7976 Compile code for little endian mode.  This is the default.
7977
7978 @item -EB
7979 @opindex EB
7980 Compile code for big endian mode.
7981
7982 @item -mmangle-cpu
7983 @opindex mmangle-cpu
7984 Prepend the name of the cpu to all public symbol names.
7985 In multiple-processor systems, there are many ARC variants with different
7986 instruction and register set characteristics.  This flag prevents code
7987 compiled for one cpu to be linked with code compiled for another.
7988 No facility exists for handling variants that are ``almost identical''.
7989 This is an all or nothing option.
7990
7991 @item -mcpu=@var{cpu}
7992 @opindex mcpu
7993 Compile code for ARC variant @var{cpu}.
7994 Which variants are supported depend on the configuration.
7995 All variants support @option{-mcpu=base}, this is the default.
7996
7997 @item -mtext=@var{text-section}
7998 @itemx -mdata=@var{data-section}
7999 @itemx -mrodata=@var{readonly-data-section}
8000 @opindex mtext
8001 @opindex mdata
8002 @opindex mrodata
8003 Put functions, data, and readonly data in @var{text-section},
8004 @var{data-section}, and @var{readonly-data-section} respectively
8005 by default.  This can be overridden with the @code{section} attribute.
8006 @xref{Variable Attributes}.
8007
8008 @end table
8009
8010 @node ARM Options
8011 @subsection ARM Options
8012 @cindex ARM options
8013
8014 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
8015 architectures:
8016
8017 @table @gcctabopt
8018 @item -mabi=@var{name}
8019 @opindex mabi
8020 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
8021 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
8022
8023 @item -mapcs-frame
8024 @opindex mapcs-frame
8025 Generate a stack frame that is compliant with the ARM Procedure Call
8026 Standard for all functions, even if this is not strictly necessary for
8027 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
8028 with this option will cause the stack frames not to be generated for
8029 leaf functions.  The default is @option{-mno-apcs-frame}.
8030
8031 @item -mapcs
8032 @opindex mapcs
8033 This is a synonym for @option{-mapcs-frame}.
8034
8035 @ignore
8036 @c not currently implemented
8037 @item -mapcs-stack-check
8038 @opindex mapcs-stack-check
8039 Generate code to check the amount of stack space available upon entry to
8040 every function (that actually uses some stack space).  If there is
8041 insufficient space available then either the function
8042 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} will be
8043 called, depending upon the amount of stack space required.  The run time
8044 system is required to provide these functions.  The default is
8045 @option{-mno-apcs-stack-check}, since this produces smaller code.
8046
8047 @c not currently implemented
8048 @item -mapcs-float
8049 @opindex mapcs-float
8050 Pass floating point arguments using the float point registers.  This is
8051 one of the variants of the APCS@.  This option is recommended if the
8052 target hardware has a floating point unit or if a lot of floating point
8053 arithmetic is going to be performed by the code.  The default is
8054 @option{-mno-apcs-float}, since integer only code is slightly increased in
8055 size if @option{-mapcs-float} is used.
8056
8057 @c not currently implemented
8058 @item -mapcs-reentrant
8059 @opindex mapcs-reentrant
8060 Generate reentrant, position independent code.  The default is
8061 @option{-mno-apcs-reentrant}.
8062 @end ignore
8063
8064 @item -mthumb-interwork
8065 @opindex mthumb-interwork
8066 Generate code which supports calling between the ARM and Thumb
8067 instruction sets.  Without this option the two instruction sets cannot
8068 be reliably used inside one program.  The default is
8069 @option{-mno-thumb-interwork}, since slightly larger code is generated
8070 when @option{-mthumb-interwork} is specified.
8071
8072 @item -mno-sched-prolog
8073 @opindex mno-sched-prolog
8074 Prevent the reordering of instructions in the function prolog, or the
8075 merging of those instruction with the instructions in the function's
8076 body.  This means that all functions will start with a recognizable set
8077 of instructions (or in fact one of a choice from a small set of
8078 different function prologues), and this information can be used to
8079 locate the start if functions inside an executable piece of code.  The
8080 default is @option{-msched-prolog}.
8081
8082 @item -mhard-float
8083 @opindex mhard-float
8084 Generate output containing floating point instructions.  This is the
8085 default.
8086
8087 @item -msoft-float
8088 @opindex msoft-float
8089 Generate output containing library calls for floating point.
8090 @strong{Warning:} the requisite libraries are not available for all ARM
8091 targets.  Normally the facilities of the machine's usual C compiler are
8092 used, but this cannot be done directly in cross-compilation.  You must make
8093 your own arrangements to provide suitable library functions for
8094 cross-compilation.
8095
8096 @option{-msoft-float} changes the calling convention in the output file;
8097 therefore, it is only useful if you compile @emph{all} of a program with
8098 this option.  In particular, you need to compile @file{libgcc.a}, the
8099 library that comes with GCC, with @option{-msoft-float} in order for
8100 this to work.
8101
8102 @item -mfloat-abi=@var{name}
8103 @opindex mfloat-abi
8104 Specifies which ABI to use for floating point values.  Permissible values
8105 are: @samp{soft}, @samp{softfp} and @samp{hard}.
8106
8107 @samp{soft} and @samp{hard} are equivalent to @option{-msoft-float}
8108 and @option{-mhard-float} respectively.  @samp{softfp} allows the generation
8109 of floating point instructions, but still uses the soft-float calling
8110 conventions.
8111
8112 @item -mlittle-endian
8113 @opindex mlittle-endian
8114 Generate code for a processor running in little-endian mode.  This is
8115 the default for all standard configurations.
8116
8117 @item -mbig-endian
8118 @opindex mbig-endian
8119 Generate code for a processor running in big-endian mode; the default is
8120 to compile code for a little-endian processor.
8121
8122 @item -mwords-little-endian
8123 @opindex mwords-little-endian
8124 This option only applies when generating code for big-endian processors.
8125 Generate code for a little-endian word order but a big-endian byte
8126 order.  That is, a byte order of the form @samp{32107654}.  Note: this
8127 option should only be used if you require compatibility with code for
8128 big-endian ARM processors generated by versions of the compiler prior to
8129 2.8.
8130
8131 @item -mcpu=@var{name}
8132 @opindex mcpu
8133 This specifies the name of the target ARM processor.  GCC uses this name
8134 to determine what kind of instructions it can emit when generating
8135 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
8136 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
8137 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
8138 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
8139 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
8140 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
8141 @samp{arm8}, @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
8142 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
8143 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
8144 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
8145 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
8146 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
8147 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
8148 @samp{arm1156t2-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
8149 @samp{cortex-a8}, @samp{cortex-r4}, @samp{cortex-m3},
8150 @samp{xscale}, @samp{iwmmxt}, @samp{ep9312}.
8151
8152 @itemx -mtune=@var{name}
8153 @opindex mtune
8154 This option is very similar to the @option{-mcpu=} option, except that
8155 instead of specifying the actual target processor type, and hence
8156 restricting which instructions can be used, it specifies that GCC should
8157 tune the performance of the code as if the target were of the type
8158 specified in this option, but still choosing the instructions that it
8159 will generate based on the cpu specified by a @option{-mcpu=} option.
8160 For some ARM implementations better performance can be obtained by using
8161 this option.
8162
8163 @item -march=@var{name}
8164 @opindex march
8165 This specifies the name of the target ARM architecture.  GCC uses this
8166 name to determine what kind of instructions it can emit when generating
8167 assembly code.  This option can be used in conjunction with or instead
8168 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
8169 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
8170 @samp{armv5}, @samp{armv5t}, @samp{armv5te}, @samp{armv6}, @samp{armv6j},
8171 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv7}, @samp{armv7-a},
8172 @samp{armv7-r}, @samp{armv7-m}, @samp{iwmmxt}, @samp{ep9312}.
8173
8174 @item -mfpu=@var{name}
8175 @itemx -mfpe=@var{number}
8176 @itemx -mfp=@var{number}
8177 @opindex mfpu
8178 @opindex mfpe
8179 @opindex mfp
8180 This specifies what floating point hardware (or hardware emulation) is
8181 available on the target.  Permissible names are: @samp{fpa}, @samp{fpe2},
8182 @samp{fpe3}, @samp{maverick}, @samp{vfp}.  @option{-mfp} and @option{-mfpe}
8183 are synonyms for @option{-mfpu}=@samp{fpe}@var{number}, for compatibility
8184 with older versions of GCC@.
8185
8186 If @option{-msoft-float} is specified this specifies the format of
8187 floating point values.
8188
8189 @item -mstructure-size-boundary=@var{n}
8190 @opindex mstructure-size-boundary
8191 The size of all structures and unions will be rounded up to a multiple
8192 of the number of bits set by this option.  Permissible values are 8, 32
8193 and 64.  The default value varies for different toolchains.  For the COFF
8194 targeted toolchain the default value is 8.  A value of 64 is only allowed
8195 if the underlying ABI supports it.
8196
8197 Specifying the larger number can produce faster, more efficient code, but
8198 can also increase the size of the program.  Different values are potentially
8199 incompatible.  Code compiled with one value cannot necessarily expect to
8200 work with code or libraries compiled with another value, if they exchange
8201 information using structures or unions.
8202
8203 @item -mabort-on-noreturn
8204 @opindex mabort-on-noreturn
8205 Generate a call to the function @code{abort} at the end of a
8206 @code{noreturn} function.  It will be executed if the function tries to
8207 return.
8208
8209 @item -mlong-calls
8210 @itemx -mno-long-calls
8211 @opindex mlong-calls
8212 @opindex mno-long-calls
8213 Tells the compiler to perform function calls by first loading the
8214 address of the function into a register and then performing a subroutine
8215 call on this register.  This switch is needed if the target function
8216 will lie outside of the 64 megabyte addressing range of the offset based
8217 version of subroutine call instruction.
8218
8219 Even if this switch is enabled, not all function calls will be turned
8220 into long calls.  The heuristic is that static functions, functions
8221 which have the @samp{short-call} attribute, functions that are inside
8222 the scope of a @samp{#pragma no_long_calls} directive and functions whose
8223 definitions have already been compiled within the current compilation
8224 unit, will not be turned into long calls.  The exception to this rule is
8225 that weak function definitions, functions with the @samp{long-call}
8226 attribute or the @samp{section} attribute, and functions that are within
8227 the scope of a @samp{#pragma long_calls} directive, will always be
8228 turned into long calls.
8229
8230 This feature is not enabled by default.  Specifying
8231 @option{-mno-long-calls} will restore the default behavior, as will
8232 placing the function calls within the scope of a @samp{#pragma
8233 long_calls_off} directive.  Note these switches have no effect on how
8234 the compiler generates code to handle function calls via function
8235 pointers.
8236
8237 @item -mnop-fun-dllimport
8238 @opindex mnop-fun-dllimport
8239 Disable support for the @code{dllimport} attribute.
8240
8241 @item -msingle-pic-base
8242 @opindex msingle-pic-base
8243 Treat the register used for PIC addressing as read-only, rather than
8244 loading it in the prologue for each function.  The run-time system is
8245 responsible for initializing this register with an appropriate value
8246 before execution begins.
8247
8248 @item -mpic-register=@var{reg}
8249 @opindex mpic-register
8250 Specify the register to be used for PIC addressing.  The default is R10
8251 unless stack-checking is enabled, when R9 is used.
8252
8253 @item -mcirrus-fix-invalid-insns
8254 @opindex mcirrus-fix-invalid-insns
8255 @opindex mno-cirrus-fix-invalid-insns
8256 Insert NOPs into the instruction stream to in order to work around
8257 problems with invalid Maverick instruction combinations.  This option
8258 is only valid if the @option{-mcpu=ep9312} option has been used to
8259 enable generation of instructions for the Cirrus Maverick floating
8260 point co-processor.  This option is not enabled by default, since the
8261 problem is only present in older Maverick implementations.  The default
8262 can be re-enabled by use of the @option{-mno-cirrus-fix-invalid-insns}
8263 switch.
8264
8265 @item -mpoke-function-name
8266 @opindex mpoke-function-name
8267 Write the name of each function into the text section, directly
8268 preceding the function prologue.  The generated code is similar to this:
8269
8270 @smallexample
8271      t0
8272          .ascii "arm_poke_function_name", 0
8273          .align
8274      t1
8275          .word 0xff000000 + (t1 - t0)
8276      arm_poke_function_name
8277          mov     ip, sp
8278          stmfd   sp!, @{fp, ip, lr, pc@}
8279          sub     fp, ip, #4
8280 @end smallexample
8281
8282 When performing a stack backtrace, code can inspect the value of
8283 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
8284 location @code{pc - 12} and the top 8 bits are set, then we know that
8285 there is a function name embedded immediately preceding this location
8286 and has length @code{((pc[-3]) & 0xff000000)}.
8287
8288 @item -mthumb
8289 @opindex mthumb
8290 Generate code for the Thumb instruction set.  The default is to
8291 use the 32-bit ARM instruction set.
8292 This option automatically enables either 16-bit Thumb-1 or
8293 mixed 16/32-bit Thumb-2 instructions based on the @option{-mcpu=@var{name}}
8294 and @option{-march=@var{name}} options.
8295
8296 @item -mtpcs-frame
8297 @opindex mtpcs-frame
8298 Generate a stack frame that is compliant with the Thumb Procedure Call
8299 Standard for all non-leaf functions.  (A leaf function is one that does
8300 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
8301
8302 @item -mtpcs-leaf-frame
8303 @opindex mtpcs-leaf-frame
8304 Generate a stack frame that is compliant with the Thumb Procedure Call
8305 Standard for all leaf functions.  (A leaf function is one that does
8306 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
8307
8308 @item -mcallee-super-interworking
8309 @opindex mcallee-super-interworking
8310 Gives all externally visible functions in the file being compiled an ARM
8311 instruction set header which switches to Thumb mode before executing the
8312 rest of the function.  This allows these functions to be called from
8313 non-interworking code.
8314
8315 @item -mcaller-super-interworking
8316 @opindex mcaller-super-interworking
8317 Allows calls via function pointers (including virtual functions) to
8318 execute correctly regardless of whether the target code has been
8319 compiled for interworking or not.  There is a small overhead in the cost
8320 of executing a function pointer if this option is enabled.
8321
8322 @item -mtp=@var{name}
8323 @opindex mtp
8324 Specify the access model for the thread local storage pointer.  The valid
8325 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
8326 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
8327 (supported in the arm6k architecture), and @option{auto}, which uses the
8328 best available method for the selected processor.  The default setting is
8329 @option{auto}.
8330
8331 @end table
8332
8333 @node AVR Options
8334 @subsection AVR Options
8335 @cindex AVR Options
8336
8337 These options are defined for AVR implementations:
8338
8339 @table @gcctabopt
8340 @item -mmcu=@var{mcu}
8341 @opindex mmcu
8342 Specify ATMEL AVR instruction set or MCU type.
8343
8344 Instruction set avr1 is for the minimal AVR core, not supported by the C
8345 compiler, only for assembler programs (MCU types: at90s1200, attiny10,
8346 attiny11, attiny12, attiny15, attiny28).
8347
8348 Instruction set avr2 (default) is for the classic AVR core with up to
8349 8K program memory space (MCU types: at90s2313, at90s2323, attiny22,
8350 at90s2333, at90s2343, at90s4414, at90s4433, at90s4434, at90s8515,
8351 at90c8534, at90s8535).
8352
8353 Instruction set avr3 is for the classic AVR core with up to 128K program
8354 memory space (MCU types: atmega103, atmega603, at43usb320, at76c711).
8355
8356 Instruction set avr4 is for the enhanced AVR core with up to 8K program
8357 memory space (MCU types: atmega8, atmega83, atmega85).
8358
8359 Instruction set avr5 is for the enhanced AVR core with up to 128K program
8360 memory space (MCU types: atmega16, atmega161, atmega163, atmega32, atmega323,
8361 atmega64, atmega128, at43usb355, at94k).
8362
8363 @item -msize
8364 @opindex msize
8365 Output instruction sizes to the asm file.
8366
8367 @item -minit-stack=@var{N}
8368 @opindex minit-stack
8369 Specify the initial stack address, which may be a symbol or numeric value,
8370 @samp{__stack} is the default.
8371
8372 @item -mno-interrupts
8373 @opindex mno-interrupts
8374 Generated code is not compatible with hardware interrupts.
8375 Code size will be smaller.
8376
8377 @item -mcall-prologues
8378 @opindex mcall-prologues
8379 Functions prologues/epilogues expanded as call to appropriate
8380 subroutines.  Code size will be smaller.
8381
8382 @item -mno-tablejump
8383 @opindex mno-tablejump
8384 Do not generate tablejump insns which sometimes increase code size.
8385
8386 @item -mtiny-stack
8387 @opindex mtiny-stack
8388 Change only the low 8 bits of the stack pointer.
8389
8390 @item -mint8
8391 @opindex mint8
8392 Assume int to be 8 bit integer.  This affects the sizes of all types: A
8393 char will be 1 byte, an int will be 1 byte, an long will be 2 bytes
8394 and long long will be 4 bytes.  Please note that this option does not
8395 comply to the C standards, but it will provide you with smaller code
8396 size.
8397 @end table
8398
8399 @node Blackfin Options
8400 @subsection Blackfin Options
8401 @cindex Blackfin Options
8402
8403 @table @gcctabopt
8404 @item -mcpu=@var{cpu}
8405 @opindex mcpu=
8406 Specifies the name of the target Blackfin processor. Currently, @var{cpu}
8407 can be one of @samp{bf531}, @samp{bf532}, @samp{bf533},
8408 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf561}.
8409 Without this option, @samp{bf532} is used as the processor by default.
8410 The corresponding predefined processor macros for @var{cpu} is to
8411 be defined.  For the @samp{bfin-elf} toolchain, this causes the hardware
8412 BSP provided by libgloss to be linked in if @samp{-msim} is not given.
8413 Support for @samp{bf561} is incomplete; only the processor macro is defined.
8414
8415 @item -msim
8416 @opindex msim
8417 Specifies that the program will be run on the simulator.  This causes
8418 the simulator BSP provided by libgloss to be linked in.  This option
8419 has effect only for @samp{bfin-elf} toolchain.
8420
8421 @item -momit-leaf-frame-pointer
8422 @opindex momit-leaf-frame-pointer
8423 Don't keep the frame pointer in a register for leaf functions.  This
8424 avoids the instructions to save, set up and restore frame pointers and
8425 makes an extra register available in leaf functions.  The option
8426 @option{-fomit-frame-pointer} removes the frame pointer for all functions
8427 which might make debugging harder.
8428
8429 @item -mspecld-anomaly
8430 @opindex mspecld-anomaly
8431 When enabled, the compiler will ensure that the generated code does not
8432 contain speculative loads after jump instructions.  This option is enabled
8433 by default.
8434
8435 @item -mno-specld-anomaly
8436 @opindex mno-specld-anomaly
8437 Don't generate extra code to prevent speculative loads from occurring.
8438
8439 @item -mcsync-anomaly
8440 @opindex mcsync-anomaly
8441 When enabled, the compiler will ensure that the generated code does not
8442 contain CSYNC or SSYNC instructions too soon after conditional branches.
8443 This option is enabled by default.
8444
8445 @item -mno-csync-anomaly
8446 @opindex mno-csync-anomaly
8447 Don't generate extra code to prevent CSYNC or SSYNC instructions from
8448 occurring too soon after a conditional branch.
8449
8450 @item -mlow-64k
8451 @opindex mlow-64k
8452 When enabled, the compiler is free to take advantage of the knowledge that
8453 the entire program fits into the low 64k of memory.
8454
8455 @item -mno-low-64k
8456 @opindex mno-low-64k
8457 Assume that the program is arbitrarily large.  This is the default.
8458
8459 @item -mstack-check-l1
8460 @opindex mstack-check-l1
8461 Do stack checking using information placed into L1 scratchpad memory by the
8462 uClinux kernel.
8463
8464 @item -mid-shared-library
8465 @opindex mid-shared-library
8466 Generate code that supports shared libraries via the library ID method.
8467 This allows for execute in place and shared libraries in an environment
8468 without virtual memory management.  This option implies @option{-fPIC}.
8469
8470 @item -mno-id-shared-library
8471 @opindex mno-id-shared-library
8472 Generate code that doesn't assume ID based shared libraries are being used.
8473 This is the default.
8474
8475 @item -mleaf-id-shared-library
8476 @opindex mleaf-id-shared-library
8477 Generate code that supports shared libraries via the library ID method,
8478 but assumes that this library or executable won't link against any other
8479 ID shared libraries.  That allows the compiler to use faster code for jumps
8480 and calls.
8481
8482 @item -mno-leaf-id-shared-library
8483 @opindex mno-leaf-id-shared-library
8484 Do not assume that the code being compiled won't link against any ID shared
8485 libraries.  Slower code will be generated for jump and call insns.
8486
8487 @item -mshared-library-id=n
8488 @opindex mshared-library-id
8489 Specified the identification number of the ID based shared library being
8490 compiled.  Specifying a value of 0 will generate more compact code, specifying
8491 other values will force the allocation of that number to the current
8492 library but is no more space or time efficient than omitting this option.
8493
8494 @item -msep-data
8495 @opindex msep-data
8496 Generate code that allows the data segment to be located in a different
8497 area of memory from the text segment.  This allows for execute in place in
8498 an environment without virtual memory management by eliminating relocations
8499 against the text section.
8500
8501 @item -mno-sep-data
8502 @opindex mno-sep-data
8503 Generate code that assumes that the data segment follows the text segment.
8504 This is the default.
8505
8506 @item -mlong-calls
8507 @itemx -mno-long-calls
8508 @opindex mlong-calls
8509 @opindex mno-long-calls
8510 Tells the compiler to perform function calls by first loading the
8511 address of the function into a register and then performing a subroutine
8512 call on this register.  This switch is needed if the target function
8513 will lie outside of the 24 bit addressing range of the offset based
8514 version of subroutine call instruction.
8515
8516 This feature is not enabled by default.  Specifying
8517 @option{-mno-long-calls} will restore the default behavior.  Note these
8518 switches have no effect on how the compiler generates code to handle
8519 function calls via function pointers.
8520 @end table
8521
8522 @node CRIS Options
8523 @subsection CRIS Options
8524 @cindex CRIS Options
8525
8526 These options are defined specifically for the CRIS ports.
8527
8528 @table @gcctabopt
8529 @item -march=@var{architecture-type}
8530 @itemx -mcpu=@var{architecture-type}
8531 @opindex march
8532 @opindex mcpu
8533 Generate code for the specified architecture.  The choices for
8534 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
8535 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
8536 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
8537 @samp{v10}.
8538
8539 @item -mtune=@var{architecture-type}
8540 @opindex mtune
8541 Tune to @var{architecture-type} everything applicable about the generated
8542 code, except for the ABI and the set of available instructions.  The
8543 choices for @var{architecture-type} are the same as for
8544 @option{-march=@var{architecture-type}}.
8545
8546 @item -mmax-stack-frame=@var{n}
8547 @opindex mmax-stack-frame
8548 Warn when the stack frame of a function exceeds @var{n} bytes.
8549
8550 @item -melinux-stacksize=@var{n}
8551 @opindex melinux-stacksize
8552 Only available with the @samp{cris-axis-aout} target.  Arranges for
8553 indications in the program to the kernel loader that the stack of the
8554 program should be set to @var{n} bytes.
8555
8556 @item -metrax4
8557 @itemx -metrax100
8558 @opindex metrax4
8559 @opindex metrax100
8560 The options @option{-metrax4} and @option{-metrax100} are synonyms for
8561 @option{-march=v3} and @option{-march=v8} respectively.
8562
8563 @item -mmul-bug-workaround
8564 @itemx -mno-mul-bug-workaround
8565 @opindex mmul-bug-workaround
8566 @opindex mno-mul-bug-workaround
8567 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
8568 models where it applies.  This option is active by default.
8569
8570 @item -mpdebug
8571 @opindex mpdebug
8572 Enable CRIS-specific verbose debug-related information in the assembly
8573 code.  This option also has the effect to turn off the @samp{#NO_APP}
8574 formatted-code indicator to the assembler at the beginning of the
8575 assembly file.
8576
8577 @item -mcc-init
8578 @opindex mcc-init
8579 Do not use condition-code results from previous instruction; always emit
8580 compare and test instructions before use of condition codes.
8581
8582 @item -mno-side-effects
8583 @opindex mno-side-effects
8584 Do not emit instructions with side-effects in addressing modes other than
8585 post-increment.
8586
8587 @item -mstack-align
8588 @itemx -mno-stack-align
8589 @itemx -mdata-align
8590 @itemx -mno-data-align
8591 @itemx -mconst-align
8592 @itemx -mno-const-align
8593 @opindex mstack-align
8594 @opindex mno-stack-align
8595 @opindex mdata-align
8596 @opindex mno-data-align
8597 @opindex mconst-align
8598 @opindex mno-const-align
8599 These options (no-options) arranges (eliminate arrangements) for the
8600 stack-frame, individual data and constants to be aligned for the maximum
8601 single data access size for the chosen CPU model.  The default is to
8602 arrange for 32-bit alignment.  ABI details such as structure layout are
8603 not affected by these options.
8604
8605 @item -m32-bit
8606 @itemx -m16-bit
8607 @itemx -m8-bit
8608 @opindex m32-bit
8609 @opindex m16-bit
8610 @opindex m8-bit
8611 Similar to the stack- data- and const-align options above, these options
8612 arrange for stack-frame, writable data and constants to all be 32-bit,
8613 16-bit or 8-bit aligned.  The default is 32-bit alignment.
8614
8615 @item -mno-prologue-epilogue
8616 @itemx -mprologue-epilogue
8617 @opindex mno-prologue-epilogue
8618 @opindex mprologue-epilogue
8619 With @option{-mno-prologue-epilogue}, the normal function prologue and
8620 epilogue that sets up the stack-frame are omitted and no return
8621 instructions or return sequences are generated in the code.  Use this
8622 option only together with visual inspection of the compiled code: no
8623 warnings or errors are generated when call-saved registers must be saved,
8624 or storage for local variable needs to be allocated.
8625
8626 @item -mno-gotplt
8627 @itemx -mgotplt
8628 @opindex mno-gotplt
8629 @opindex mgotplt
8630 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
8631 instruction sequences that load addresses for functions from the PLT part
8632 of the GOT rather than (traditional on other architectures) calls to the
8633 PLT@.  The default is @option{-mgotplt}.
8634
8635 @item -maout
8636 @opindex maout
8637 Legacy no-op option only recognized with the cris-axis-aout target.
8638
8639 @item -melf
8640 @opindex melf
8641 Legacy no-op option only recognized with the cris-axis-elf and
8642 cris-axis-linux-gnu targets.
8643
8644 @item -melinux
8645 @opindex melinux
8646 Only recognized with the cris-axis-aout target, where it selects a
8647 GNU/linux-like multilib, include files and instruction set for
8648 @option{-march=v8}.
8649
8650 @item -mlinux
8651 @opindex mlinux
8652 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
8653
8654 @item -sim
8655 @opindex sim
8656 This option, recognized for the cris-axis-aout and cris-axis-elf arranges
8657 to link with input-output functions from a simulator library.  Code,
8658 initialized data and zero-initialized data are allocated consecutively.
8659
8660 @item -sim2
8661 @opindex sim2
8662 Like @option{-sim}, but pass linker options to locate initialized data at
8663 0x40000000 and zero-initialized data at 0x80000000.
8664 @end table
8665
8666 @node CRX Options
8667 @subsection CRX Options
8668 @cindex CRX Options
8669
8670 These options are defined specifically for the CRX ports.
8671
8672 @table @gcctabopt
8673
8674 @item -mmac
8675 @opindex mmac
8676 Enable the use of multiply-accumulate instructions. Disabled by default.
8677
8678 @item -mpush-args
8679 @opindex mpush-args
8680 Push instructions will be used to pass outgoing arguments when functions
8681 are called. Enabled by default.
8682 @end table
8683
8684 @node Darwin Options
8685 @subsection Darwin Options
8686 @cindex Darwin options
8687
8688 These options are defined for all architectures running the Darwin operating
8689 system.
8690
8691 FSF GCC on Darwin does not create ``fat'' object files; it will create
8692 an object file for the single architecture that it was built to
8693 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
8694 @option{-arch} options are used; it does so by running the compiler or
8695 linker multiple times and joining the results together with
8696 @file{lipo}.
8697
8698 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
8699 @samp{i686}) is determined by the flags that specify the ISA
8700 that GCC is targetting, like @option{-mcpu} or @option{-march}.  The
8701 @option{-force_cpusubtype_ALL} option can be used to override this.
8702
8703 The Darwin tools vary in their behavior when presented with an ISA
8704 mismatch.  The assembler, @file{as}, will only permit instructions to
8705 be used that are valid for the subtype of the file it is generating,
8706 so you cannot put 64-bit instructions in an @samp{ppc750} object file.
8707 The linker for shared libraries, @file{/usr/bin/libtool}, will fail
8708 and print an error if asked to create a shared library with a less
8709 restrictive subtype than its input files (for instance, trying to put
8710 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
8711 for executables, @file{ld}, will quietly give the executable the most
8712 restrictive subtype of any of its input files.
8713
8714 @table @gcctabopt
8715 @item -F@var{dir}
8716 @opindex F
8717 Add the framework directory @var{dir} to the head of the list of
8718 directories to be searched for header files.  These directories are
8719 interleaved with those specified by @option{-I} options and are
8720 scanned in a left-to-right order.
8721
8722 A framework directory is a directory with frameworks in it.  A
8723 framework is a directory with a @samp{"Headers"} and/or
8724 @samp{"PrivateHeaders"} directory contained directly in it that ends
8725 in @samp{".framework"}.  The name of a framework is the name of this
8726 directory excluding the @samp{".framework"}.  Headers associated with
8727 the framework are found in one of those two directories, with
8728 @samp{"Headers"} being searched first.  A subframework is a framework
8729 directory that is in a framework's @samp{"Frameworks"} directory.
8730 Includes of subframework headers can only appear in a header of a
8731 framework that contains the subframework, or in a sibling subframework
8732 header.  Two subframeworks are siblings if they occur in the same
8733 framework.  A subframework should not have the same name as a
8734 framework, a warning will be issued if this is violated.  Currently a
8735 subframework cannot have subframeworks, in the future, the mechanism
8736 may be extended to support this.  The standard frameworks can be found
8737 in @samp{"/System/Library/Frameworks"} and
8738 @samp{"/Library/Frameworks"}.  An example include looks like
8739 @code{#include <Framework/header.h>}, where @samp{Framework} denotes
8740 the name of the framework and header.h is found in the
8741 @samp{"PrivateHeaders"} or @samp{"Headers"} directory.
8742
8743 @item -iframework@var{dir}
8744 @opindex iframework
8745 Like @option{-F} except the directory is a treated as a system
8746 directory.  The main difference between this @option{-iframework} and
8747 @option{-F} is that with @option{-iframework} the compiler does not
8748 warn about constructs contained within header files found via
8749 @var{dir}.  This option is valid only for the C family of languages.
8750
8751 @item -gused
8752 @opindex gused
8753 Emit debugging information for symbols that are used.  For STABS
8754 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
8755 This is by default ON@.
8756
8757 @item -gfull
8758 @opindex gfull
8759 Emit debugging information for all symbols and types.
8760
8761 @item -mmacosx-version-min=@var{version}
8762 The earliest version of MacOS X that this executable will run on
8763 is @var{version}.  Typical values of @var{version} include @code{10.1},
8764 @code{10.2}, and @code{10.3.9}.
8765
8766 If the compiler was built to use the system's headers by default,
8767 then the default for this option is the system version on which the
8768 compiler is running, otherwise the default is to make choices which
8769 are compatible with as many systems and code bases as possible.
8770
8771 @item -mkernel
8772 @opindex mkernel
8773 Enable kernel development mode.  The @option{-mkernel} option sets
8774 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
8775 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
8776 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
8777 applicable.  This mode also sets @option{-mno-altivec},
8778 @option{-msoft-float}, @option{-fno-builtin} and
8779 @option{-mlong-branch} for PowerPC targets.
8780
8781 @item -mone-byte-bool
8782 @opindex mone-byte-bool
8783 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
8784 By default @samp{sizeof(bool)} is @samp{4} when compiling for
8785 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
8786 option has no effect on x86.
8787
8788 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
8789 to generate code that is not binary compatible with code generated
8790 without that switch.  Using this switch may require recompiling all
8791 other modules in a program, including system libraries.  Use this
8792 switch to conform to a non-default data model.
8793
8794 @item -mfix-and-continue
8795 @itemx -ffix-and-continue
8796 @itemx -findirect-data
8797 @opindex mfix-and-continue
8798 @opindex ffix-and-continue
8799 @opindex findirect-data
8800 Generate code suitable for fast turn around development.  Needed to
8801 enable gdb to dynamically load @code{.o} files into already running
8802 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
8803 are provided for backwards compatibility.
8804
8805 @item -all_load
8806 @opindex all_load
8807 Loads all members of static archive libraries.
8808 See man ld(1) for more information.
8809
8810 @item -arch_errors_fatal
8811 @opindex arch_errors_fatal
8812 Cause the errors having to do with files that have the wrong architecture
8813 to be fatal.
8814
8815 @item -bind_at_load
8816 @opindex bind_at_load
8817 Causes the output file to be marked such that the dynamic linker will
8818 bind all undefined references when the file is loaded or launched.
8819
8820 @item -bundle
8821 @opindex bundle
8822 Produce a Mach-o bundle format file.
8823 See man ld(1) for more information.
8824
8825 @item -bundle_loader @var{executable}
8826 @opindex bundle_loader
8827 This option specifies the @var{executable} that will be loading the build
8828 output file being linked.  See man ld(1) for more information.
8829
8830 @item -dynamiclib
8831 @opindex dynamiclib
8832 When passed this option, GCC will produce a dynamic library instead of
8833 an executable when linking, using the Darwin @file{libtool} command.
8834
8835 @item -force_cpusubtype_ALL
8836 @opindex force_cpusubtype_ALL
8837 This causes GCC's output file to have the @var{ALL} subtype, instead of
8838 one controlled by the @option{-mcpu} or @option{-march} option.
8839
8840 @item -allowable_client  @var{client_name}
8841 @itemx -client_name
8842 @itemx -compatibility_version
8843 @itemx -current_version
8844 @itemx -dead_strip
8845 @itemx -dependency-file
8846 @itemx -dylib_file
8847 @itemx -dylinker_install_name
8848 @itemx -dynamic
8849 @itemx -exported_symbols_list
8850 @itemx -filelist
8851 @itemx -flat_namespace
8852 @itemx -force_flat_namespace
8853 @itemx -headerpad_max_install_names
8854 @itemx -image_base
8855 @itemx -init
8856 @itemx -install_name
8857 @itemx -keep_private_externs
8858 @itemx -multi_module
8859 @itemx -multiply_defined
8860 @itemx -multiply_defined_unused
8861 @itemx -noall_load
8862 @itemx -no_dead_strip_inits_and_terms
8863 @itemx -nofixprebinding
8864 @itemx -nomultidefs
8865 @itemx -noprebind
8866 @itemx -noseglinkedit
8867 @itemx -pagezero_size
8868 @itemx -prebind
8869 @itemx -prebind_all_twolevel_modules
8870 @itemx -private_bundle
8871 @itemx -read_only_relocs
8872 @itemx -sectalign
8873 @itemx -sectobjectsymbols
8874 @itemx -whyload
8875 @itemx -seg1addr
8876 @itemx -sectcreate
8877 @itemx -sectobjectsymbols
8878 @itemx -sectorder
8879 @itemx -segaddr
8880 @itemx -segs_read_only_addr
8881 @itemx -segs_read_write_addr
8882 @itemx -seg_addr_table
8883 @itemx -seg_addr_table_filename
8884 @itemx -seglinkedit
8885 @itemx -segprot
8886 @itemx -segs_read_only_addr
8887 @itemx -segs_read_write_addr
8888 @itemx -single_module
8889 @itemx -static
8890 @itemx -sub_library
8891 @itemx -sub_umbrella
8892 @itemx -twolevel_namespace
8893 @itemx -umbrella
8894 @itemx -undefined
8895 @itemx -unexported_symbols_list
8896 @itemx -weak_reference_mismatches
8897 @itemx -whatsloaded
8898
8899 @opindex allowable_client
8900 @opindex client_name
8901 @opindex compatibility_version
8902 @opindex current_version
8903 @opindex dead_strip
8904 @opindex dependency-file
8905 @opindex dylib_file
8906 @opindex dylinker_install_name
8907 @opindex dynamic
8908 @opindex exported_symbols_list
8909 @opindex filelist
8910 @opindex flat_namespace
8911 @opindex force_flat_namespace
8912 @opindex headerpad_max_install_names
8913 @opindex image_base
8914 @opindex init
8915 @opindex install_name
8916 @opindex keep_private_externs
8917 @opindex multi_module
8918 @opindex multiply_defined
8919 @opindex multiply_defined_unused
8920 @opindex noall_load
8921 @opindex no_dead_strip_inits_and_terms
8922 @opindex nofixprebinding
8923 @opindex nomultidefs
8924 @opindex noprebind
8925 @opindex noseglinkedit
8926 @opindex pagezero_size
8927 @opindex prebind
8928 @opindex prebind_all_twolevel_modules
8929 @opindex private_bundle
8930 @opindex read_only_relocs
8931 @opindex sectalign
8932 @opindex sectobjectsymbols
8933 @opindex whyload
8934 @opindex seg1addr
8935 @opindex sectcreate
8936 @opindex sectobjectsymbols
8937 @opindex sectorder
8938 @opindex segaddr
8939 @opindex segs_read_only_addr
8940 @opindex segs_read_write_addr
8941 @opindex seg_addr_table
8942 @opindex seg_addr_table_filename
8943 @opindex seglinkedit
8944 @opindex segprot
8945 @opindex segs_read_only_addr
8946 @opindex segs_read_write_addr
8947 @opindex single_module
8948 @opindex static
8949 @opindex sub_library
8950 @opindex sub_umbrella
8951 @opindex twolevel_namespace
8952 @opindex umbrella
8953 @opindex undefined
8954 @opindex unexported_symbols_list
8955 @opindex weak_reference_mismatches
8956 @opindex whatsloaded
8957
8958 These options are passed to the Darwin linker.  The Darwin linker man page
8959 describes them in detail.
8960 @end table
8961
8962 @node DEC Alpha Options
8963 @subsection DEC Alpha Options
8964
8965 These @samp{-m} options are defined for the DEC Alpha implementations:
8966
8967 @table @gcctabopt
8968 @item -mno-soft-float
8969 @itemx -msoft-float
8970 @opindex mno-soft-float
8971 @opindex msoft-float
8972 Use (do not use) the hardware floating-point instructions for
8973 floating-point operations.  When @option{-msoft-float} is specified,
8974 functions in @file{libgcc.a} will be used to perform floating-point
8975 operations.  Unless they are replaced by routines that emulate the
8976 floating-point operations, or compiled in such a way as to call such
8977 emulations routines, these routines will issue floating-point
8978 operations.   If you are compiling for an Alpha without floating-point
8979 operations, you must ensure that the library is built so as not to call
8980 them.
8981
8982 Note that Alpha implementations without floating-point operations are
8983 required to have floating-point registers.
8984
8985 @item -mfp-reg
8986 @itemx -mno-fp-regs
8987 @opindex mfp-reg
8988 @opindex mno-fp-regs
8989 Generate code that uses (does not use) the floating-point register set.
8990 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
8991 register set is not used, floating point operands are passed in integer
8992 registers as if they were integers and floating-point results are passed
8993 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
8994 so any function with a floating-point argument or return value called by code
8995 compiled with @option{-mno-fp-regs} must also be compiled with that
8996 option.
8997
8998 A typical use of this option is building a kernel that does not use,
8999 and hence need not save and restore, any floating-point registers.
9000
9001 @item -mieee
9002 @opindex mieee
9003 The Alpha architecture implements floating-point hardware optimized for
9004 maximum performance.  It is mostly compliant with the IEEE floating
9005 point standard.  However, for full compliance, software assistance is
9006 required.  This option generates code fully IEEE compliant code
9007 @emph{except} that the @var{inexact-flag} is not maintained (see below).
9008 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
9009 defined during compilation.  The resulting code is less efficient but is
9010 able to correctly support denormalized numbers and exceptional IEEE
9011 values such as not-a-number and plus/minus infinity.  Other Alpha
9012 compilers call this option @option{-ieee_with_no_inexact}.
9013
9014 @item -mieee-with-inexact
9015 @opindex mieee-with-inexact
9016 This is like @option{-mieee} except the generated code also maintains
9017 the IEEE @var{inexact-flag}.  Turning on this option causes the
9018 generated code to implement fully-compliant IEEE math.  In addition to
9019 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
9020 macro.  On some Alpha implementations the resulting code may execute
9021 significantly slower than the code generated by default.  Since there is
9022 very little code that depends on the @var{inexact-flag}, you should
9023 normally not specify this option.  Other Alpha compilers call this
9024 option @option{-ieee_with_inexact}.
9025
9026 @item -mfp-trap-mode=@var{trap-mode}
9027 @opindex mfp-trap-mode
9028 This option controls what floating-point related traps are enabled.
9029 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
9030 The trap mode can be set to one of four values:
9031
9032 @table @samp
9033 @item n
9034 This is the default (normal) setting.  The only traps that are enabled
9035 are the ones that cannot be disabled in software (e.g., division by zero
9036 trap).
9037
9038 @item u
9039 In addition to the traps enabled by @samp{n}, underflow traps are enabled
9040 as well.
9041
9042 @item su
9043 Like @samp{u}, but the instructions are marked to be safe for software
9044 completion (see Alpha architecture manual for details).
9045
9046 @item sui
9047 Like @samp{su}, but inexact traps are enabled as well.
9048 @end table
9049
9050 @item -mfp-rounding-mode=@var{rounding-mode}
9051 @opindex mfp-rounding-mode
9052 Selects the IEEE rounding mode.  Other Alpha compilers call this option
9053 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
9054 of:
9055
9056 @table @samp
9057 @item n
9058 Normal IEEE rounding mode.  Floating point numbers are rounded towards
9059 the nearest machine number or towards the even machine number in case
9060 of a tie.
9061
9062 @item m
9063 Round towards minus infinity.
9064
9065 @item c
9066 Chopped rounding mode.  Floating point numbers are rounded towards zero.
9067
9068 @item d
9069 Dynamic rounding mode.  A field in the floating point control register
9070 (@var{fpcr}, see Alpha architecture reference manual) controls the
9071 rounding mode in effect.  The C library initializes this register for
9072 rounding towards plus infinity.  Thus, unless your program modifies the
9073 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
9074 @end table
9075
9076 @item -mtrap-precision=@var{trap-precision}
9077 @opindex mtrap-precision
9078 In the Alpha architecture, floating point traps are imprecise.  This
9079 means without software assistance it is impossible to recover from a
9080 floating trap and program execution normally needs to be terminated.
9081 GCC can generate code that can assist operating system trap handlers
9082 in determining the exact location that caused a floating point trap.
9083 Depending on the requirements of an application, different levels of
9084 precisions can be selected:
9085
9086 @table @samp
9087 @item p
9088 Program precision.  This option is the default and means a trap handler
9089 can only identify which program caused a floating point exception.
9090
9091 @item f
9092 Function precision.  The trap handler can determine the function that
9093 caused a floating point exception.
9094
9095 @item i
9096 Instruction precision.  The trap handler can determine the exact
9097 instruction that caused a floating point exception.
9098 @end table
9099
9100 Other Alpha compilers provide the equivalent options called
9101 @option{-scope_safe} and @option{-resumption_safe}.
9102
9103 @item -mieee-conformant
9104 @opindex mieee-conformant
9105 This option marks the generated code as IEEE conformant.  You must not
9106 use this option unless you also specify @option{-mtrap-precision=i} and either
9107 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
9108 is to emit the line @samp{.eflag 48} in the function prologue of the
9109 generated assembly file.  Under DEC Unix, this has the effect that
9110 IEEE-conformant math library routines will be linked in.
9111
9112 @item -mbuild-constants
9113 @opindex mbuild-constants
9114 Normally GCC examines a 32- or 64-bit integer constant to
9115 see if it can construct it from smaller constants in two or three
9116 instructions.  If it cannot, it will output the constant as a literal and
9117 generate code to load it from the data segment at runtime.
9118
9119 Use this option to require GCC to construct @emph{all} integer constants
9120 using code, even if it takes more instructions (the maximum is six).
9121
9122 You would typically use this option to build a shared library dynamic
9123 loader.  Itself a shared library, it must relocate itself in memory
9124 before it can find the variables and constants in its own data segment.
9125
9126 @item -malpha-as
9127 @itemx -mgas
9128 @opindex malpha-as
9129 @opindex mgas
9130 Select whether to generate code to be assembled by the vendor-supplied
9131 assembler (@option{-malpha-as}) or by the GNU assembler @option{-mgas}.
9132
9133 @item -mbwx
9134 @itemx -mno-bwx
9135 @itemx -mcix
9136 @itemx -mno-cix
9137 @itemx -mfix
9138 @itemx -mno-fix
9139 @itemx -mmax
9140 @itemx -mno-max
9141 @opindex mbwx
9142 @opindex mno-bwx
9143 @opindex mcix
9144 @opindex mno-cix
9145 @opindex mfix
9146 @opindex mno-fix
9147 @opindex mmax
9148 @opindex mno-max
9149 Indicate whether GCC should generate code to use the optional BWX,
9150 CIX, FIX and MAX instruction sets.  The default is to use the instruction
9151 sets supported by the CPU type specified via @option{-mcpu=} option or that
9152 of the CPU on which GCC was built if none was specified.
9153
9154 @item -mfloat-vax
9155 @itemx -mfloat-ieee
9156 @opindex mfloat-vax
9157 @opindex mfloat-ieee
9158 Generate code that uses (does not use) VAX F and G floating point
9159 arithmetic instead of IEEE single and double precision.
9160
9161 @item -mexplicit-relocs
9162 @itemx -mno-explicit-relocs
9163 @opindex mexplicit-relocs
9164 @opindex mno-explicit-relocs
9165 Older Alpha assemblers provided no way to generate symbol relocations
9166 except via assembler macros.  Use of these macros does not allow
9167 optimal instruction scheduling.  GNU binutils as of version 2.12
9168 supports a new syntax that allows the compiler to explicitly mark
9169 which relocations should apply to which instructions.  This option
9170 is mostly useful for debugging, as GCC detects the capabilities of
9171 the assembler when it is built and sets the default accordingly.
9172
9173 @item -msmall-data
9174 @itemx -mlarge-data
9175 @opindex msmall-data
9176 @opindex mlarge-data
9177 When @option{-mexplicit-relocs} is in effect, static data is
9178 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
9179 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
9180 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
9181 16-bit relocations off of the @code{$gp} register.  This limits the
9182 size of the small data area to 64KB, but allows the variables to be
9183 directly accessed via a single instruction.
9184
9185 The default is @option{-mlarge-data}.  With this option the data area
9186 is limited to just below 2GB@.  Programs that require more than 2GB of
9187 data must use @code{malloc} or @code{mmap} to allocate the data in the
9188 heap instead of in the program's data segment.
9189
9190 When generating code for shared libraries, @option{-fpic} implies
9191 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
9192
9193 @item -msmall-text
9194 @itemx -mlarge-text
9195 @opindex msmall-text
9196 @opindex mlarge-text
9197 When @option{-msmall-text} is used, the compiler assumes that the
9198 code of the entire program (or shared library) fits in 4MB, and is
9199 thus reachable with a branch instruction.  When @option{-msmall-data}
9200 is used, the compiler can assume that all local symbols share the
9201 same @code{$gp} value, and thus reduce the number of instructions
9202 required for a function call from 4 to 1.
9203
9204 The default is @option{-mlarge-text}.
9205
9206 @item -mcpu=@var{cpu_type}
9207 @opindex mcpu
9208 Set the instruction set and instruction scheduling parameters for
9209 machine type @var{cpu_type}.  You can specify either the @samp{EV}
9210 style name or the corresponding chip number.  GCC supports scheduling
9211 parameters for the EV4, EV5 and EV6 family of processors and will
9212 choose the default values for the instruction set from the processor
9213 you specify.  If you do not specify a processor type, GCC will default
9214 to the processor on which the compiler was built.
9215
9216 Supported values for @var{cpu_type} are
9217
9218 @table @samp
9219 @item ev4
9220 @itemx ev45
9221 @itemx 21064
9222 Schedules as an EV4 and has no instruction set extensions.
9223
9224 @item ev5
9225 @itemx 21164
9226 Schedules as an EV5 and has no instruction set extensions.
9227
9228 @item ev56
9229 @itemx 21164a
9230 Schedules as an EV5 and supports the BWX extension.
9231
9232 @item pca56
9233 @itemx 21164pc
9234 @itemx 21164PC
9235 Schedules as an EV5 and supports the BWX and MAX extensions.
9236
9237 @item ev6
9238 @itemx 21264
9239 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
9240
9241 @item ev67
9242 @itemx 21264a
9243 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
9244 @end table
9245
9246 @item -mtune=@var{cpu_type}
9247 @opindex mtune
9248 Set only the instruction scheduling parameters for machine type
9249 @var{cpu_type}.  The instruction set is not changed.
9250
9251 @item -mmemory-latency=@var{time}
9252 @opindex mmemory-latency
9253 Sets the latency the scheduler should assume for typical memory
9254 references as seen by the application.  This number is highly
9255 dependent on the memory access patterns used by the application
9256 and the size of the external cache on the machine.
9257
9258 Valid options for @var{time} are
9259
9260 @table @samp
9261 @item @var{number}
9262 A decimal number representing clock cycles.
9263
9264 @item L1
9265 @itemx L2
9266 @itemx L3
9267 @itemx main
9268 The compiler contains estimates of the number of clock cycles for
9269 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
9270 (also called Dcache, Scache, and Bcache), as well as to main memory.
9271 Note that L3 is only valid for EV5.
9272
9273 @end table
9274 @end table
9275
9276 @node DEC Alpha/VMS Options
9277 @subsection DEC Alpha/VMS Options
9278
9279 These @samp{-m} options are defined for the DEC Alpha/VMS implementations:
9280
9281 @table @gcctabopt
9282 @item -mvms-return-codes
9283 @opindex mvms-return-codes
9284 Return VMS condition codes from main.  The default is to return POSIX
9285 style condition (e.g.@ error) codes.
9286 @end table
9287
9288 @node FRV Options
9289 @subsection FRV Options
9290 @cindex FRV Options
9291
9292 @table @gcctabopt
9293 @item -mgpr-32
9294 @opindex mgpr-32
9295
9296 Only use the first 32 general purpose registers.
9297
9298 @item -mgpr-64
9299 @opindex mgpr-64
9300
9301 Use all 64 general purpose registers.
9302
9303 @item -mfpr-32
9304 @opindex mfpr-32
9305
9306 Use only the first 32 floating point registers.
9307
9308 @item -mfpr-64
9309 @opindex mfpr-64
9310
9311 Use all 64 floating point registers
9312
9313 @item -mhard-float
9314 @opindex mhard-float
9315
9316 Use hardware instructions for floating point operations.
9317
9318 @item -msoft-float
9319 @opindex msoft-float
9320
9321 Use library routines for floating point operations.
9322
9323 @item -malloc-cc
9324 @opindex malloc-cc
9325
9326 Dynamically allocate condition code registers.
9327
9328 @item -mfixed-cc
9329 @opindex mfixed-cc
9330
9331 Do not try to dynamically allocate condition code registers, only
9332 use @code{icc0} and @code{fcc0}.
9333
9334 @item -mdword
9335 @opindex mdword
9336
9337 Change ABI to use double word insns.
9338
9339 @item -mno-dword
9340 @opindex mno-dword
9341
9342 Do not use double word instructions.
9343
9344 @item -mdouble
9345 @opindex mdouble
9346
9347 Use floating point double instructions.
9348
9349 @item -mno-double
9350 @opindex mno-double
9351
9352 Do not use floating point double instructions.
9353
9354 @item -mmedia
9355 @opindex mmedia
9356
9357 Use media instructions.
9358
9359 @item -mno-media
9360 @opindex mno-media
9361
9362 Do not use media instructions.
9363
9364 @item -mmuladd
9365 @opindex mmuladd
9366
9367 Use multiply and add/subtract instructions.
9368
9369 @item -mno-muladd
9370 @opindex mno-muladd
9371
9372 Do not use multiply and add/subtract instructions.
9373
9374 @item -mfdpic
9375 @opindex mfdpic
9376
9377 Select the FDPIC ABI, that uses function descriptors to represent
9378 pointers to functions.  Without any PIC/PIE-related options, it
9379 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
9380 assumes GOT entries and small data are within a 12-bit range from the
9381 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
9382 are computed with 32 bits.
9383
9384 @item -minline-plt
9385 @opindex minline-plt
9386
9387 Enable inlining of PLT entries in function calls to functions that are
9388 not known to bind locally.  It has no effect without @option{-mfdpic}.
9389 It's enabled by default if optimizing for speed and compiling for
9390 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
9391 optimization option such as @option{-O3} or above is present in the
9392 command line.
9393
9394 @item -mTLS
9395 @opindex TLS
9396
9397 Assume a large TLS segment when generating thread-local code.
9398
9399 @item -mtls
9400 @opindex tls
9401
9402 Do not assume a large TLS segment when generating thread-local code.
9403
9404 @item -mgprel-ro
9405 @opindex mgprel-ro
9406
9407 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
9408 that is known to be in read-only sections.  It's enabled by default,
9409 except for @option{-fpic} or @option{-fpie}: even though it may help
9410 make the global offset table smaller, it trades 1 instruction for 4.
9411 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
9412 one of which may be shared by multiple symbols, and it avoids the need
9413 for a GOT entry for the referenced symbol, so it's more likely to be a
9414 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
9415
9416 @item -multilib-library-pic
9417 @opindex multilib-library-pic
9418
9419 Link with the (library, not FD) pic libraries.  It's implied by
9420 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
9421 @option{-fpic} without @option{-mfdpic}.  You should never have to use
9422 it explicitly.
9423
9424 @item -mlinked-fp
9425 @opindex mlinked-fp
9426
9427 Follow the EABI requirement of always creating a frame pointer whenever
9428 a stack frame is allocated.  This option is enabled by default and can
9429 be disabled with @option{-mno-linked-fp}.
9430
9431 @item -mlong-calls
9432 @opindex mlong-calls
9433
9434 Use indirect addressing to call functions outside the current
9435 compilation unit.  This allows the functions to be placed anywhere
9436 within the 32-bit address space.
9437
9438 @item -malign-labels
9439 @opindex malign-labels
9440
9441 Try to align labels to an 8-byte boundary by inserting nops into the
9442 previous packet.  This option only has an effect when VLIW packing
9443 is enabled.  It doesn't create new packets; it merely adds nops to
9444 existing ones.
9445
9446 @item -mlibrary-pic
9447 @opindex mlibrary-pic
9448
9449 Generate position-independent EABI code.
9450
9451 @item -macc-4
9452 @opindex macc-4
9453
9454 Use only the first four media accumulator registers.
9455
9456 @item -macc-8
9457 @opindex macc-8
9458
9459 Use all eight media accumulator registers.
9460
9461 @item -mpack
9462 @opindex mpack
9463
9464 Pack VLIW instructions.
9465
9466 @item -mno-pack
9467 @opindex mno-pack
9468
9469 Do not pack VLIW instructions.
9470
9471 @item -mno-eflags
9472 @opindex mno-eflags
9473
9474 Do not mark ABI switches in e_flags.
9475
9476 @item -mcond-move
9477 @opindex mcond-move
9478
9479 Enable the use of conditional-move instructions (default).
9480
9481 This switch is mainly for debugging the compiler and will likely be removed
9482 in a future version.
9483
9484 @item -mno-cond-move
9485 @opindex mno-cond-move
9486
9487 Disable the use of conditional-move instructions.
9488
9489 This switch is mainly for debugging the compiler and will likely be removed
9490 in a future version.
9491
9492 @item -mscc
9493 @opindex mscc
9494
9495 Enable the use of conditional set instructions (default).
9496
9497 This switch is mainly for debugging the compiler and will likely be removed
9498 in a future version.
9499
9500 @item -mno-scc
9501 @opindex mno-scc
9502
9503 Disable the use of conditional set instructions.
9504
9505 This switch is mainly for debugging the compiler and will likely be removed
9506 in a future version.
9507
9508 @item -mcond-exec
9509 @opindex mcond-exec
9510
9511 Enable the use of conditional execution (default).
9512
9513 This switch is mainly for debugging the compiler and will likely be removed
9514 in a future version.
9515
9516 @item -mno-cond-exec
9517 @opindex mno-cond-exec
9518
9519 Disable the use of conditional execution.
9520
9521 This switch is mainly for debugging the compiler and will likely be removed
9522 in a future version.
9523
9524 @item -mvliw-branch
9525 @opindex mvliw-branch
9526
9527 Run a pass to pack branches into VLIW instructions (default).
9528
9529 This switch is mainly for debugging the compiler and will likely be removed
9530 in a future version.
9531
9532 @item -mno-vliw-branch
9533 @opindex mno-vliw-branch
9534
9535 Do not run a pass to pack branches into VLIW instructions.
9536
9537 This switch is mainly for debugging the compiler and will likely be removed
9538 in a future version.
9539
9540 @item -mmulti-cond-exec
9541 @opindex mmulti-cond-exec
9542
9543 Enable optimization of @code{&&} and @code{||} in conditional execution
9544 (default).
9545
9546 This switch is mainly for debugging the compiler and will likely be removed
9547 in a future version.
9548
9549 @item -mno-multi-cond-exec
9550 @opindex mno-multi-cond-exec
9551
9552 Disable optimization of @code{&&} and @code{||} in conditional execution.
9553
9554 This switch is mainly for debugging the compiler and will likely be removed
9555 in a future version.
9556
9557 @item -mnested-cond-exec
9558 @opindex mnested-cond-exec
9559
9560 Enable nested conditional execution optimizations (default).
9561
9562 This switch is mainly for debugging the compiler and will likely be removed
9563 in a future version.
9564
9565 @item -mno-nested-cond-exec
9566 @opindex mno-nested-cond-exec
9567
9568 Disable nested conditional execution optimizations.
9569
9570 This switch is mainly for debugging the compiler and will likely be removed
9571 in a future version.
9572
9573 @item -moptimize-membar
9574 @opindex moptimize-membar
9575
9576 This switch removes redundant @code{membar} instructions from the
9577 compiler generated code.  It is enabled by default.
9578
9579 @item -mno-optimize-membar
9580 @opindex mno-optimize-membar
9581
9582 This switch disables the automatic removal of redundant @code{membar}
9583 instructions from the generated code.
9584
9585 @item -mtomcat-stats
9586 @opindex mtomcat-stats
9587
9588 Cause gas to print out tomcat statistics.
9589
9590 @item -mcpu=@var{cpu}
9591 @opindex mcpu
9592
9593 Select the processor type for which to generate code.  Possible values are
9594 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
9595 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
9596
9597 @end table
9598
9599 @node GNU/Linux Options
9600 @subsection GNU/Linux Options
9601
9602 These @samp{-m} options are defined for GNU/Linux targets:
9603
9604 @table @gcctabopt
9605 @item -mglibc
9606 @opindex mglibc
9607 Use the GNU C library instead of uClibc.  This is the default except
9608 on @samp{*-*-linux-*uclibc*} targets.
9609
9610 @item -muclibc
9611 @opindex muclibc
9612 Use uClibc instead of the GNU C library.  This is the default on
9613 @samp{*-*-linux-*uclibc*} targets.
9614 @end table
9615
9616 @node H8/300 Options
9617 @subsection H8/300 Options
9618
9619 These @samp{-m} options are defined for the H8/300 implementations:
9620
9621 @table @gcctabopt
9622 @item -mrelax
9623 @opindex mrelax
9624 Shorten some address references at link time, when possible; uses the
9625 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
9626 ld, Using ld}, for a fuller description.
9627
9628 @item -mh
9629 @opindex mh
9630 Generate code for the H8/300H@.
9631
9632 @item -ms
9633 @opindex ms
9634 Generate code for the H8S@.
9635
9636 @item -mn
9637 @opindex mn
9638 Generate code for the H8S and H8/300H in the normal mode.  This switch
9639 must be used either with @option{-mh} or @option{-ms}.
9640
9641 @item -ms2600
9642 @opindex ms2600
9643 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
9644
9645 @item -mint32
9646 @opindex mint32
9647 Make @code{int} data 32 bits by default.
9648
9649 @item -malign-300
9650 @opindex malign-300
9651 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
9652 The default for the H8/300H and H8S is to align longs and floats on 4
9653 byte boundaries.
9654 @option{-malign-300} causes them to be aligned on 2 byte boundaries.
9655 This option has no effect on the H8/300.
9656 @end table
9657
9658 @node HPPA Options
9659 @subsection HPPA Options
9660 @cindex HPPA Options
9661
9662 These @samp{-m} options are defined for the HPPA family of computers:
9663
9664 @table @gcctabopt
9665 @item -march=@var{architecture-type}
9666 @opindex march
9667 Generate code for the specified architecture.  The choices for
9668 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
9669 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
9670 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
9671 architecture option for your machine.  Code compiled for lower numbered
9672 architectures will run on higher numbered architectures, but not the
9673 other way around.
9674
9675 @item -mpa-risc-1-0
9676 @itemx -mpa-risc-1-1
9677 @itemx -mpa-risc-2-0
9678 @opindex mpa-risc-1-0
9679 @opindex mpa-risc-1-1
9680 @opindex mpa-risc-2-0
9681 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
9682
9683 @item -mbig-switch
9684 @opindex mbig-switch
9685 Generate code suitable for big switch tables.  Use this option only if
9686 the assembler/linker complain about out of range branches within a switch
9687 table.
9688
9689 @item -mjump-in-delay
9690 @opindex mjump-in-delay
9691 Fill delay slots of function calls with unconditional jump instructions
9692 by modifying the return pointer for the function call to be the target
9693 of the conditional jump.
9694
9695 @item -mdisable-fpregs
9696 @opindex mdisable-fpregs
9697 Prevent floating point registers from being used in any manner.  This is
9698 necessary for compiling kernels which perform lazy context switching of
9699 floating point registers.  If you use this option and attempt to perform
9700 floating point operations, the compiler will abort.
9701
9702 @item -mdisable-indexing
9703 @opindex mdisable-indexing
9704 Prevent the compiler from using indexing address modes.  This avoids some
9705 rather obscure problems when compiling MIG generated code under MACH@.
9706
9707 @item -mno-space-regs
9708 @opindex mno-space-regs
9709 Generate code that assumes the target has no space registers.  This allows
9710 GCC to generate faster indirect calls and use unscaled index address modes.
9711
9712 Such code is suitable for level 0 PA systems and kernels.
9713
9714 @item -mfast-indirect-calls
9715 @opindex mfast-indirect-calls
9716 Generate code that assumes calls never cross space boundaries.  This
9717 allows GCC to emit code which performs faster indirect calls.
9718
9719 This option will not work in the presence of shared libraries or nested
9720 functions.
9721
9722 @item -mfixed-range=@var{register-range}
9723 @opindex mfixed-range
9724 Generate code treating the given register range as fixed registers.
9725 A fixed register is one that the register allocator can not use.  This is
9726 useful when compiling kernel code.  A register range is specified as
9727 two registers separated by a dash.  Multiple register ranges can be
9728 specified separated by a comma.
9729
9730 @item -mlong-load-store
9731 @opindex mlong-load-store
9732 Generate 3-instruction load and store sequences as sometimes required by
9733 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
9734 the HP compilers.
9735
9736 @item -mportable-runtime
9737 @opindex mportable-runtime
9738 Use the portable calling conventions proposed by HP for ELF systems.
9739
9740 @item -mgas
9741 @opindex mgas
9742 Enable the use of assembler directives only GAS understands.
9743
9744 @item -mschedule=@var{cpu-type}
9745 @opindex mschedule
9746 Schedule code according to the constraints for the machine type
9747 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
9748 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
9749 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
9750 proper scheduling option for your machine.  The default scheduling is
9751 @samp{8000}.
9752
9753 @item -mlinker-opt
9754 @opindex mlinker-opt
9755 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
9756 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
9757 linkers in which they give bogus error messages when linking some programs.
9758
9759 @item -msoft-float
9760 @opindex msoft-float
9761 Generate output containing library calls for floating point.
9762 @strong{Warning:} the requisite libraries are not available for all HPPA
9763 targets.  Normally the facilities of the machine's usual C compiler are
9764 used, but this cannot be done directly in cross-compilation.  You must make
9765 your own arrangements to provide suitable library functions for
9766 cross-compilation.  The embedded target @samp{hppa1.1-*-pro}
9767 does provide software floating point support.
9768
9769 @option{-msoft-float} changes the calling convention in the output file;
9770 therefore, it is only useful if you compile @emph{all} of a program with
9771 this option.  In particular, you need to compile @file{libgcc.a}, the
9772 library that comes with GCC, with @option{-msoft-float} in order for
9773 this to work.
9774
9775 @item -msio
9776 @opindex msio
9777 Generate the predefine, @code{_SIO}, for server IO@.  The default is
9778 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
9779 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
9780 options are available under HP-UX and HI-UX@.
9781
9782 @item -mgnu-ld
9783 @opindex gnu-ld
9784 Use GNU ld specific options.  This passes @option{-shared} to ld when
9785 building a shared library.  It is the default when GCC is configured,
9786 explicitly or implicitly, with the GNU linker.  This option does not
9787 have any affect on which ld is called, it only changes what parameters
9788 are passed to that ld.  The ld that is called is determined by the
9789 @option{--with-ld} configure option, GCC's program search path, and
9790 finally by the user's @env{PATH}.  The linker used by GCC can be printed
9791 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
9792 on the 64 bit HP-UX GCC, i.e. configured with @samp{hppa*64*-*-hpux*}.
9793
9794 @item -mhp-ld
9795 @opindex hp-ld
9796 Use HP ld specific options.  This passes @option{-b} to ld when building
9797 a shared library and passes @option{+Accept TypeMismatch} to ld on all
9798 links.  It is the default when GCC is configured, explicitly or
9799 implicitly, with the HP linker.  This option does not have any affect on
9800 which ld is called, it only changes what parameters are passed to that
9801 ld.  The ld that is called is determined by the @option{--with-ld}
9802 configure option, GCC's program search path, and finally by the user's
9803 @env{PATH}.  The linker used by GCC can be printed using @samp{which
9804 `gcc -print-prog-name=ld`}.  This option is only available on the 64 bit
9805 HP-UX GCC, i.e. configured with @samp{hppa*64*-*-hpux*}.
9806
9807 @item -mlong-calls
9808 @opindex mno-long-calls
9809 Generate code that uses long call sequences.  This ensures that a call
9810 is always able to reach linker generated stubs.  The default is to generate
9811 long calls only when the distance from the call site to the beginning
9812 of the function or translation unit, as the case may be, exceeds a
9813 predefined limit set by the branch type being used.  The limits for
9814 normal calls are 7,600,000 and 240,000 bytes, respectively for the
9815 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
9816 240,000 bytes.
9817
9818 Distances are measured from the beginning of functions when using the
9819 @option{-ffunction-sections} option, or when using the @option{-mgas}
9820 and @option{-mno-portable-runtime} options together under HP-UX with
9821 the SOM linker.
9822
9823 It is normally not desirable to use this option as it will degrade
9824 performance.  However, it may be useful in large applications,
9825 particularly when partial linking is used to build the application.
9826
9827 The types of long calls used depends on the capabilities of the
9828 assembler and linker, and the type of code being generated.  The
9829 impact on systems that support long absolute calls, and long pic
9830 symbol-difference or pc-relative calls should be relatively small.
9831 However, an indirect call is used on 32-bit ELF systems in pic code
9832 and it is quite long.
9833
9834 @item -munix=@var{unix-std}
9835 @opindex march
9836 Generate compiler predefines and select a startfile for the specified
9837 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
9838 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
9839 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
9840 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
9841 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
9842 and later.
9843
9844 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
9845 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
9846 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
9847 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
9848 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
9849 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
9850
9851 It is @emph{important} to note that this option changes the interfaces
9852 for various library routines.  It also affects the operational behavior
9853 of the C library.  Thus, @emph{extreme} care is needed in using this
9854 option.
9855
9856 Library code that is intended to operate with more than one UNIX
9857 standard must test, set and restore the variable @var{__xpg4_extended_mask}
9858 as appropriate.  Most GNU software doesn't provide this capability.
9859
9860 @item -nolibdld
9861 @opindex nolibdld
9862 Suppress the generation of link options to search libdld.sl when the
9863 @option{-static} option is specified on HP-UX 10 and later.
9864
9865 @item -static
9866 @opindex static
9867 The HP-UX implementation of setlocale in libc has a dependency on
9868 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
9869 when the @option{-static} option is specified, special link options
9870 are needed to resolve this dependency.
9871
9872 On HP-UX 10 and later, the GCC driver adds the necessary options to
9873 link with libdld.sl when the @option{-static} option is specified.
9874 This causes the resulting binary to be dynamic.  On the 64-bit port,
9875 the linkers generate dynamic binaries by default in any case.  The
9876 @option{-nolibdld} option can be used to prevent the GCC driver from
9877 adding these link options.
9878
9879 @item -threads
9880 @opindex threads
9881 Add support for multithreading with the @dfn{dce thread} library
9882 under HP-UX@.  This option sets flags for both the preprocessor and
9883 linker.
9884 @end table
9885
9886 @node i386 and x86-64 Options
9887 @subsection Intel 386 and AMD x86-64 Options
9888 @cindex i386 Options
9889 @cindex x86-64 Options
9890 @cindex Intel 386 Options
9891 @cindex AMD x86-64 Options
9892
9893 These @samp{-m} options are defined for the i386 and x86-64 family of
9894 computers:
9895
9896 @table @gcctabopt
9897 @item -mtune=@var{cpu-type}
9898 @opindex mtune
9899 Tune to @var{cpu-type} everything applicable about the generated code, except
9900 for the ABI and the set of available instructions.  The choices for
9901 @var{cpu-type} are:
9902 @table @emph
9903 @item generic
9904 Produce code optimized for the most common IA32/AMD64/EM64T processors.
9905 If you know the CPU on which your code will run, then you should use
9906 the corresponding @option{-mtune} option instead of
9907 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
9908 of your application will have, then you should use this option.
9909
9910 As new processors are deployed in the marketplace, the behavior of this
9911 option will change.  Therefore, if you upgrade to a newer version of
9912 GCC, the code generated option will change to reflect the processors
9913 that were most common when that version of GCC was released.
9914
9915 There is no @option{-march=generic} option because @option{-march}
9916 indicates the instruction set the compiler can use, and there is no
9917 generic instruction set applicable to all processors.  In contrast,
9918 @option{-mtune} indicates the processor (or, in this case, collection of
9919 processors) for which the code is optimized.
9920 @item native
9921 This selects the CPU to tune for at compilation time by determining
9922 the processor type of the compiling machine.  Using @option{-mtune=native}
9923 will produce code optimized for the local machine under the constraints
9924 of the selected instruction set.  Using @option{-march=native} will
9925 enable all instruction subsets supported by the local machine (hence
9926 the result might not run on different machines).
9927 @item i386
9928 Original Intel's i386 CPU@.
9929 @item i486
9930 Intel's i486 CPU@.  (No scheduling is implemented for this chip.)
9931 @item i586, pentium
9932 Intel Pentium CPU with no MMX support.
9933 @item pentium-mmx
9934 Intel PentiumMMX CPU based on Pentium core with MMX instruction set support.
9935 @item pentiumpro
9936 Intel PentiumPro CPU@.
9937 @item i686
9938 Same as @code{generic}, but when used as @code{march} option, PentiumPro
9939 instruction set will be used, so the code will run on all i686 family chips.
9940 @item pentium2
9941 Intel Pentium2 CPU based on PentiumPro core with MMX instruction set support.
9942 @item pentium3, pentium3m
9943 Intel Pentium3 CPU based on PentiumPro core with MMX and SSE instruction set
9944 support.
9945 @item pentium-m
9946 Low power version of Intel Pentium3 CPU with MMX, SSE and SSE2 instruction set
9947 support.  Used by Centrino notebooks.
9948 @item pentium4, pentium4m
9949 Intel Pentium4 CPU with MMX, SSE and SSE2 instruction set support.
9950 @item prescott
9951 Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2 and SSE3 instruction
9952 set support.
9953 @item nocona
9954 Improved version of Intel Pentium4 CPU with 64-bit extensions, MMX, SSE,
9955 SSE2 and SSE3 instruction set support.
9956 @item core2
9957 Intel Core2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
9958 instruction set support.
9959 @item k6
9960 AMD K6 CPU with MMX instruction set support.
9961 @item k6-2, k6-3
9962 Improved versions of AMD K6 CPU with MMX and 3dNOW! instruction set support.
9963 @item athlon, athlon-tbird
9964 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and SSE prefetch instructions
9965 support.
9966 @item athlon-4, athlon-xp, athlon-mp
9967 Improved AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and full SSE
9968 instruction set support.
9969 @item k8, opteron, athlon64, athlon-fx
9970 AMD K8 core based CPUs with x86-64 instruction set support.  (This supersets
9971 MMX, SSE, SSE2, 3dNOW!, enhanced 3dNOW! and 64-bit instruction set extensions.)
9972 @item k8-sse3, opteron-sse3, athlon64-sse3
9973 Improved versions of k8, opteron and athlon64 with SSE3 instruction set support.
9974 @item amdfam10, barcelona
9975 AMD Family 10h core based CPUs with x86-64 instruction set support.  (This
9976 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3dNOW!, enhanced 3dNOW!, ABM and 64-bit
9977 instruction set extensions.)
9978 @item winchip-c6
9979 IDT Winchip C6 CPU, dealt in same way as i486 with additional MMX instruction
9980 set support.
9981 @item winchip2
9982 IDT Winchip2 CPU, dealt in same way as i486 with additional MMX and 3dNOW!
9983 instruction set support.
9984 @item c3
9985 Via C3 CPU with MMX and 3dNOW! instruction set support.  (No scheduling is
9986 implemented for this chip.)
9987 @item c3-2
9988 Via C3-2 CPU with MMX and SSE instruction set support.  (No scheduling is
9989 implemented for this chip.)
9990 @item geode
9991 Embedded AMD CPU with MMX and 3dNOW! instruction set support.
9992 @end table
9993
9994 While picking a specific @var{cpu-type} will schedule things appropriately
9995 for that particular chip, the compiler will not generate any code that
9996 does not run on the i386 without the @option{-march=@var{cpu-type}} option
9997 being used.
9998
9999 @item -march=@var{cpu-type}
10000 @opindex march
10001 Generate instructions for the machine type @var{cpu-type}.  The choices
10002 for @var{cpu-type} are the same as for @option{-mtune}.  Moreover,
10003 specifying @option{-march=@var{cpu-type}} implies @option{-mtune=@var{cpu-type}}.
10004
10005 @item -mcpu=@var{cpu-type}
10006 @opindex mcpu
10007 A deprecated synonym for @option{-mtune}.
10008
10009 @item -mfpmath=@var{unit}
10010 @opindex march
10011 Generate floating point arithmetics for selected unit @var{unit}.  The choices
10012 for @var{unit} are:
10013
10014 @table @samp
10015 @item 387
10016 Use the standard 387 floating point coprocessor present majority of chips and
10017 emulated otherwise.  Code compiled with this option will run almost everywhere.
10018 The temporary results are computed in 80bit precision instead of precision
10019 specified by the type resulting in slightly different results compared to most
10020 of other chips.  See @option{-ffloat-store} for more detailed description.
10021
10022 This is the default choice for i386 compiler.
10023
10024 @item sse
10025 Use scalar floating point instructions present in the SSE instruction set.
10026 This instruction set is supported by Pentium3 and newer chips, in the AMD line
10027 by Athlon-4, Athlon-xp and Athlon-mp chips.  The earlier version of SSE
10028 instruction set supports only single precision arithmetics, thus the double and
10029 extended precision arithmetics is still done using 387.  Later version, present
10030 only in Pentium4 and the future AMD x86-64 chips supports double precision
10031 arithmetics too.
10032
10033 For the i386 compiler, you need to use @option{-march=@var{cpu-type}}, @option{-msse}
10034 or @option{-msse2} switches to enable SSE extensions and make this option
10035 effective.  For the x86-64 compiler, these extensions are enabled by default.
10036
10037 The resulting code should be considerably faster in the majority of cases and avoid
10038 the numerical instability problems of 387 code, but may break some existing
10039 code that expects temporaries to be 80bit.
10040
10041 This is the default choice for the x86-64 compiler.
10042
10043 @item sse,387
10044 Attempt to utilize both instruction sets at once.  This effectively double the
10045 amount of available registers and on chips with separate execution units for
10046 387 and SSE the execution resources too.  Use this option with care, as it is
10047 still experimental, because the GCC register allocator does not model separate
10048 functional units well resulting in instable performance.
10049 @end table
10050
10051 @item -masm=@var{dialect}
10052 @opindex masm=@var{dialect}
10053 Output asm instructions using selected @var{dialect}.  Supported
10054 choices are @samp{intel} or @samp{att} (the default one).  Darwin does
10055 not support @samp{intel}.
10056
10057 @item -mieee-fp
10058 @itemx -mno-ieee-fp
10059 @opindex mieee-fp
10060 @opindex mno-ieee-fp
10061 Control whether or not the compiler uses IEEE floating point
10062 comparisons.  These handle correctly the case where the result of a
10063 comparison is unordered.
10064
10065 @item -msoft-float
10066 @opindex msoft-float
10067 Generate output containing library calls for floating point.
10068 @strong{Warning:} the requisite libraries are not part of GCC@.
10069 Normally the facilities of the machine's usual C compiler are used, but
10070 this can't be done directly in cross-compilation.  You must make your
10071 own arrangements to provide suitable library functions for
10072 cross-compilation.
10073
10074 On machines where a function returns floating point results in the 80387
10075 register stack, some floating point opcodes may be emitted even if
10076 @option{-msoft-float} is used.
10077
10078 @item -mno-fp-ret-in-387
10079 @opindex mno-fp-ret-in-387
10080 Do not use the FPU registers for return values of functions.
10081
10082 The usual calling convention has functions return values of types
10083 @code{float} and @code{double} in an FPU register, even if there
10084 is no FPU@.  The idea is that the operating system should emulate
10085 an FPU@.
10086
10087 The option @option{-mno-fp-ret-in-387} causes such values to be returned
10088 in ordinary CPU registers instead.
10089
10090 @item -mno-fancy-math-387
10091 @opindex mno-fancy-math-387
10092 Some 387 emulators do not support the @code{sin}, @code{cos} and
10093 @code{sqrt} instructions for the 387.  Specify this option to avoid
10094 generating those instructions.  This option is the default on FreeBSD,
10095 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
10096 indicates that the target cpu will always have an FPU and so the
10097 instruction will not need emulation.  As of revision 2.6.1, these
10098 instructions are not generated unless you also use the
10099 @option{-funsafe-math-optimizations} switch.
10100
10101 @item -malign-double
10102 @itemx -mno-align-double
10103 @opindex malign-double
10104 @opindex mno-align-double
10105 Control whether GCC aligns @code{double}, @code{long double}, and
10106 @code{long long} variables on a two word boundary or a one word
10107 boundary.  Aligning @code{double} variables on a two word boundary will
10108 produce code that runs somewhat faster on a @samp{Pentium} at the
10109 expense of more memory.
10110
10111 On x86-64, @option{-malign-double} is enabled by default.
10112
10113 @strong{Warning:} if you use the @option{-malign-double} switch,
10114 structures containing the above types will be aligned differently than
10115 the published application binary interface specifications for the 386
10116 and will not be binary compatible with structures in code compiled
10117 without that switch.
10118
10119 @item -m96bit-long-double
10120 @itemx -m128bit-long-double
10121 @opindex m96bit-long-double
10122 @opindex m128bit-long-double
10123 These switches control the size of @code{long double} type.  The i386
10124 application binary interface specifies the size to be 96 bits,
10125 so @option{-m96bit-long-double} is the default in 32 bit mode.
10126
10127 Modern architectures (Pentium and newer) would prefer @code{long double}
10128 to be aligned to an 8 or 16 byte boundary.  In arrays or structures
10129 conforming to the ABI, this would not be possible.  So specifying a
10130 @option{-m128bit-long-double} will align @code{long double}
10131 to a 16 byte boundary by padding the @code{long double} with an additional
10132 32 bit zero.
10133
10134 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
10135 its ABI specifies that @code{long double} is to be aligned on 16 byte boundary.
10136
10137 Notice that neither of these options enable any extra precision over the x87
10138 standard of 80 bits for a @code{long double}.
10139
10140 @strong{Warning:} if you override the default value for your target ABI, the
10141 structures and arrays containing @code{long double} variables will change
10142 their size as well as function calling convention for function taking
10143 @code{long double} will be modified.  Hence they will not be binary
10144 compatible with arrays or structures in code compiled without that switch.
10145
10146 @item -mmlarge-data-threshold=@var{number}
10147 @opindex mlarge-data-threshold=@var{number}
10148 When @option{-mcmodel=medium} is specified, the data greater than
10149 @var{threshold} are placed in large data section.  This value must be the
10150 same across all object linked into the binary and defaults to 65535.
10151
10152 @item -mrtd
10153 @opindex mrtd
10154 Use a different function-calling convention, in which functions that
10155 take a fixed number of arguments return with the @code{ret} @var{num}
10156 instruction, which pops their arguments while returning.  This saves one
10157 instruction in the caller since there is no need to pop the arguments
10158 there.
10159
10160 You can specify that an individual function is called with this calling
10161 sequence with the function attribute @samp{stdcall}.  You can also
10162 override the @option{-mrtd} option by using the function attribute
10163 @samp{cdecl}.  @xref{Function Attributes}.
10164
10165 @strong{Warning:} this calling convention is incompatible with the one
10166 normally used on Unix, so you cannot use it if you need to call
10167 libraries compiled with the Unix compiler.
10168
10169 Also, you must provide function prototypes for all functions that
10170 take variable numbers of arguments (including @code{printf});
10171 otherwise incorrect code will be generated for calls to those
10172 functions.
10173
10174 In addition, seriously incorrect code will result if you call a
10175 function with too many arguments.  (Normally, extra arguments are
10176 harmlessly ignored.)
10177
10178 @item -mregparm=@var{num}
10179 @opindex mregparm
10180 Control how many registers are used to pass integer arguments.  By
10181 default, no registers are used to pass arguments, and at most 3
10182 registers can be used.  You can control this behavior for a specific
10183 function by using the function attribute @samp{regparm}.
10184 @xref{Function Attributes}.
10185
10186 @strong{Warning:} if you use this switch, and
10187 @var{num} is nonzero, then you must build all modules with the same
10188 value, including any libraries.  This includes the system libraries and
10189 startup modules.
10190
10191 @item -msseregparm
10192 @opindex msseregparm
10193 Use SSE register passing conventions for float and double arguments
10194 and return values.  You can control this behavior for a specific
10195 function by using the function attribute @samp{sseregparm}.
10196 @xref{Function Attributes}.
10197
10198 @strong{Warning:} if you use this switch then you must build all
10199 modules with the same value, including any libraries.  This includes
10200 the system libraries and startup modules.
10201
10202 @item -mpc32
10203 @itemx -mpc64
10204 @itemx -mpc80
10205 @opindex mpc32
10206 @opindex mpc64
10207 @opindex mpc80
10208
10209 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
10210 is specified, the significands of results of floating-point operations are
10211 rounded to 24 bits (single precision); @option{-mpc64} rounds the the
10212 significands of results of floating-point operations to 53 bits (double
10213 precision) and @option{-mpc80} rounds the significands of results of
10214 floating-point operations to 64 bits (extended double precision), which is
10215 the default.  When this option is used, floating-point operations in higher
10216 precisions are not available to the programmer without setting the FPU
10217 control word explicitly.
10218
10219 Setting the rounding of floating-point operations to less than the default
10220 80 bits can speed some programs by 2% or more.  Note that some mathematical
10221 libraries assume that extended precision (80 bit) floating-point operations
10222 are enabled by default; routines in such libraries could suffer significant
10223 loss of accuracy, typically through so-called "catastrophic cancellation",
10224 when this option is used to set the precision to less than extended precision. 
10225
10226 @item -mstackrealign
10227 @opindex mstackrealign
10228 Realign the stack at entry.  On the Intel x86, the
10229 @option{-mstackrealign} option will generate an alternate prologue and
10230 epilogue that realigns the runtime stack.  This supports mixing legacy
10231 codes that keep a 4-byte aligned stack with modern codes that keep a
10232 16-byte stack for SSE compatibility.  The alternate prologue and
10233 epilogue are slower and bigger than the regular ones, and the
10234 alternate prologue requires an extra scratch register; this lowers the
10235 number of registers available if used in conjunction with the
10236 @code{regparm} attribute.  The @option{-mstackrealign} option is
10237 incompatible with the nested function prologue; this is considered a
10238 hard error.  See also the attribute @code{force_align_arg_pointer},
10239 applicable to individual functions.
10240
10241 @item -mpreferred-stack-boundary=@var{num}
10242 @opindex mpreferred-stack-boundary
10243 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
10244 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
10245 the default is 4 (16 bytes or 128 bits).
10246
10247 On Pentium and PentiumPro, @code{double} and @code{long double} values
10248 should be aligned to an 8 byte boundary (see @option{-malign-double}) or
10249 suffer significant run time performance penalties.  On Pentium III, the
10250 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
10251 properly if it is not 16 byte aligned.
10252
10253 To ensure proper alignment of this values on the stack, the stack boundary
10254 must be as aligned as that required by any value stored on the stack.
10255 Further, every function must be generated such that it keeps the stack
10256 aligned.  Thus calling a function compiled with a higher preferred
10257 stack boundary from a function compiled with a lower preferred stack
10258 boundary will most likely misalign the stack.  It is recommended that
10259 libraries that use callbacks always use the default setting.
10260
10261 This extra alignment does consume extra stack space, and generally
10262 increases code size.  Code that is sensitive to stack space usage, such
10263 as embedded systems and operating system kernels, may want to reduce the
10264 preferred alignment to @option{-mpreferred-stack-boundary=2}.
10265
10266 @item -mmmx
10267 @itemx -mno-mmx
10268 @item -msse
10269 @itemx -mno-sse
10270 @item -msse2
10271 @itemx -mno-sse2
10272 @item -msse3
10273 @itemx -mno-sse3
10274 @item -mssse3
10275 @itemx -mno-ssse3
10276 @item -msse4.1
10277 @itemx -mno-sse4.1
10278 @item -msse4.2
10279 @itemx -mno-sse4.2
10280 @item -msse4
10281 @itemx -mno-sse4
10282 @item -msse4a
10283 @item -mno-sse4a
10284 @item -m3dnow
10285 @itemx -mno-3dnow
10286 @item -mpopcnt
10287 @itemx -mno-popcnt
10288 @item -mabm
10289 @itemx -mno-abm
10290 @opindex mmmx
10291 @opindex mno-mmx
10292 @opindex msse
10293 @opindex mno-sse
10294 @opindex m3dnow
10295 @opindex mno-3dnow
10296 These switches enable or disable the use of instructions in the MMX,
10297 SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4A, ABM or 3DNow! extended
10298 instruction sets.
10299 These extensions are also available as built-in functions: see
10300 @ref{X86 Built-in Functions}, for details of the functions enabled and
10301 disabled by these switches.
10302
10303 To have SSE/SSE2 instructions generated automatically from floating-point
10304 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
10305
10306 These options will enable GCC to use these extended instructions in
10307 generated code, even without @option{-mfpmath=sse}.  Applications which
10308 perform runtime CPU detection must compile separate files for each
10309 supported architecture, using the appropriate flags.  In particular,
10310 the file containing the CPU detection code should be compiled without
10311 these options.
10312
10313 @item -mcx16
10314 @opindex mcx16
10315 This option will enable GCC to use CMPXCHG16B instruction in generated code.
10316 CMPXCHG16B allows for atomic operations on 128-bit double quadword (or oword)
10317 data types.  This is useful for high resolution counters that could be updated
10318 by multiple processors (or cores).  This instruction is generated as part of
10319 atomic built-in functions: see @ref{Atomic Builtins} for details.
10320
10321 @item -msahf
10322 @opindex msahf
10323 This option will enable GCC to use SAHF instruction in generated 64-bit code.
10324 Early Intel CPUs with Intel 64 lacked LAHF and SAHF instructions supported
10325 by AMD64 until introduction of Pentium 4 G1 step in December 2005.  LAHF and
10326 SAHF are load and store instructions, respectively, for certain status flags.
10327 In 64-bit mode, SAHF instruction is used to optimize @code{fmod}, @code{drem}
10328 or @code{remainder} built-in functions: see @ref{Other Builtins} for details.
10329
10330 @item -mpush-args
10331 @itemx -mno-push-args
10332 @opindex mpush-args
10333 @opindex mno-push-args
10334 Use PUSH operations to store outgoing parameters.  This method is shorter
10335 and usually equally fast as method using SUB/MOV operations and is enabled
10336 by default.  In some cases disabling it may improve performance because of
10337 improved scheduling and reduced dependencies.
10338
10339 @item -maccumulate-outgoing-args
10340 @opindex maccumulate-outgoing-args
10341 If enabled, the maximum amount of space required for outgoing arguments will be
10342 computed in the function prologue.  This is faster on most modern CPUs
10343 because of reduced dependencies, improved scheduling and reduced stack usage
10344 when preferred stack boundary is not equal to 2.  The drawback is a notable
10345 increase in code size.  This switch implies @option{-mno-push-args}.
10346
10347 @item -mthreads
10348 @opindex mthreads
10349 Support thread-safe exception handling on @samp{Mingw32}.  Code that relies
10350 on thread-safe exception handling must compile and link all code with the
10351 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
10352 @option{-D_MT}; when linking, it links in a special thread helper library
10353 @option{-lmingwthrd} which cleans up per thread exception handling data.
10354
10355 @item -mno-align-stringops
10356 @opindex mno-align-stringops
10357 Do not align destination of inlined string operations.  This switch reduces
10358 code size and improves performance in case the destination is already aligned,
10359 but GCC doesn't know about it.
10360
10361 @item -minline-all-stringops
10362 @opindex minline-all-stringops
10363 By default GCC inlines string operations only when destination is known to be
10364 aligned at least to 4 byte boundary.  This enables more inlining, increase code
10365 size, but may improve performance of code that depends on fast memcpy, strlen
10366 and memset for short lengths.
10367
10368 @item -minline-stringops-dynamically
10369 @opindex minline-stringops-dynamically
10370 For string operation of unknown size, inline runtime checks so for small
10371 blocks inline code is used, while for large blocks library call is used.
10372
10373 @item -mstringop-strategy=@var{alg}
10374 @opindex mstringop-strategy=@var{alg}
10375 Overwrite internal decision heuristic about particular algorithm to inline
10376 string operation with.  The allowed values are @code{rep_byte},
10377 @code{rep_4byte}, @code{rep_8byte} for expanding using i386 @code{rep} prefix
10378 of specified size, @code{byte_loop}, @code{loop}, @code{unrolled_loop} for
10379 expanding inline loop, @code{libcall} for always expanding library call.
10380
10381 @item -momit-leaf-frame-pointer
10382 @opindex momit-leaf-frame-pointer
10383 Don't keep the frame pointer in a register for leaf functions.  This
10384 avoids the instructions to save, set up and restore frame pointers and
10385 makes an extra register available in leaf functions.  The option
10386 @option{-fomit-frame-pointer} removes the frame pointer for all functions
10387 which might make debugging harder.
10388
10389 @item -mtls-direct-seg-refs
10390 @itemx -mno-tls-direct-seg-refs
10391 @opindex mtls-direct-seg-refs
10392 Controls whether TLS variables may be accessed with offsets from the
10393 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
10394 or whether the thread base pointer must be added.  Whether or not this
10395 is legal depends on the operating system, and whether it maps the
10396 segment to cover the entire TLS area.
10397
10398 For systems that use GNU libc, the default is on.
10399 @end table
10400
10401 These @samp{-m} switches are supported in addition to the above
10402 on AMD x86-64 processors in 64-bit environments.
10403
10404 @table @gcctabopt
10405 @item -m32
10406 @itemx -m64
10407 @opindex m32
10408 @opindex m64
10409 Generate code for a 32-bit or 64-bit environment.
10410 The 32-bit environment sets int, long and pointer to 32 bits and
10411 generates code that runs on any i386 system.
10412 The 64-bit environment sets int to 32 bits and long and pointer
10413 to 64 bits and generates code for AMD's x86-64 architecture. For
10414 darwin only the -m64 option turns off the @option{-fno-pic} and
10415 @option{-mdynamic-no-pic} options.
10416
10417 @item -mno-red-zone
10418 @opindex no-red-zone
10419 Do not use a so called red zone for x86-64 code.  The red zone is mandated
10420 by the x86-64 ABI, it is a 128-byte area beyond the location of the
10421 stack pointer that will not be modified by signal or interrupt handlers
10422 and therefore can be used for temporary data without adjusting the stack
10423 pointer.  The flag @option{-mno-red-zone} disables this red zone.
10424
10425 @item -mcmodel=small
10426 @opindex mcmodel=small
10427 Generate code for the small code model: the program and its symbols must
10428 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
10429 Programs can be statically or dynamically linked.  This is the default
10430 code model.
10431
10432 @item -mcmodel=kernel
10433 @opindex mcmodel=kernel
10434 Generate code for the kernel code model.  The kernel runs in the
10435 negative 2 GB of the address space.
10436 This model has to be used for Linux kernel code.
10437
10438 @item -mcmodel=medium
10439 @opindex mcmodel=medium
10440 Generate code for the medium model: The program is linked in the lower 2
10441 GB of the address space but symbols can be located anywhere in the
10442 address space.  Programs can be statically or dynamically linked, but
10443 building of shared libraries are not supported with the medium model.
10444
10445 @item -mcmodel=large
10446 @opindex mcmodel=large
10447 Generate code for the large model: This model makes no assumptions
10448 about addresses and sizes of sections.
10449 @end table
10450
10451 @node IA-64 Options
10452 @subsection IA-64 Options
10453 @cindex IA-64 Options
10454
10455 These are the @samp{-m} options defined for the Intel IA-64 architecture.
10456
10457 @table @gcctabopt
10458 @item -mbig-endian
10459 @opindex mbig-endian
10460 Generate code for a big endian target.  This is the default for HP-UX@.
10461
10462 @item -mlittle-endian
10463 @opindex mlittle-endian
10464 Generate code for a little endian target.  This is the default for AIX5
10465 and GNU/Linux.
10466
10467 @item -mgnu-as
10468 @itemx -mno-gnu-as
10469 @opindex mgnu-as
10470 @opindex mno-gnu-as
10471 Generate (or don't) code for the GNU assembler.  This is the default.
10472 @c Also, this is the default if the configure option @option{--with-gnu-as}
10473 @c is used.
10474
10475 @item -mgnu-ld
10476 @itemx -mno-gnu-ld
10477 @opindex mgnu-ld
10478 @opindex mno-gnu-ld
10479 Generate (or don't) code for the GNU linker.  This is the default.
10480 @c Also, this is the default if the configure option @option{--with-gnu-ld}
10481 @c is used.
10482
10483 @item -mno-pic
10484 @opindex mno-pic
10485 Generate code that does not use a global pointer register.  The result
10486 is not position independent code, and violates the IA-64 ABI@.
10487
10488 @item -mvolatile-asm-stop
10489 @itemx -mno-volatile-asm-stop
10490 @opindex mvolatile-asm-stop
10491 @opindex mno-volatile-asm-stop
10492 Generate (or don't) a stop bit immediately before and after volatile asm
10493 statements.
10494
10495 @item -mregister-names
10496 @itemx -mno-register-names
10497 @opindex mregister-names
10498 @opindex mno-register-names
10499 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
10500 the stacked registers.  This may make assembler output more readable.
10501
10502 @item -mno-sdata
10503 @itemx -msdata
10504 @opindex mno-sdata
10505 @opindex msdata
10506 Disable (or enable) optimizations that use the small data section.  This may
10507 be useful for working around optimizer bugs.
10508
10509 @item -mconstant-gp
10510 @opindex mconstant-gp
10511 Generate code that uses a single constant global pointer value.  This is
10512 useful when compiling kernel code.
10513
10514 @item -mauto-pic
10515 @opindex mauto-pic
10516 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
10517 This is useful when compiling firmware code.
10518
10519 @item -minline-float-divide-min-latency
10520 @opindex minline-float-divide-min-latency
10521 Generate code for inline divides of floating point values
10522 using the minimum latency algorithm.
10523
10524 @item -minline-float-divide-max-throughput
10525 @opindex minline-float-divide-max-throughput
10526 Generate code for inline divides of floating point values
10527 using the maximum throughput algorithm.
10528
10529 @item -minline-int-divide-min-latency
10530 @opindex minline-int-divide-min-latency
10531 Generate code for inline divides of integer values
10532 using the minimum latency algorithm.
10533
10534 @item -minline-int-divide-max-throughput
10535 @opindex minline-int-divide-max-throughput
10536 Generate code for inline divides of integer values
10537 using the maximum throughput algorithm.
10538
10539 @item -minline-sqrt-min-latency
10540 @opindex minline-sqrt-min-latency
10541 Generate code for inline square roots
10542 using the minimum latency algorithm.
10543
10544 @item -minline-sqrt-max-throughput
10545 @opindex minline-sqrt-max-throughput
10546 Generate code for inline square roots
10547 using the maximum throughput algorithm.
10548
10549 @item -mno-dwarf2-asm
10550 @itemx -mdwarf2-asm
10551 @opindex mno-dwarf2-asm
10552 @opindex mdwarf2-asm
10553 Don't (or do) generate assembler code for the DWARF2 line number debugging
10554 info.  This may be useful when not using the GNU assembler.
10555
10556 @item -mearly-stop-bits
10557 @itemx -mno-early-stop-bits
10558 @opindex mearly-stop-bits
10559 @opindex mno-early-stop-bits
10560 Allow stop bits to be placed earlier than immediately preceding the
10561 instruction that triggered the stop bit.  This can improve instruction
10562 scheduling, but does not always do so.
10563
10564 @item -mfixed-range=@var{register-range}
10565 @opindex mfixed-range
10566 Generate code treating the given register range as fixed registers.
10567 A fixed register is one that the register allocator can not use.  This is
10568 useful when compiling kernel code.  A register range is specified as
10569 two registers separated by a dash.  Multiple register ranges can be
10570 specified separated by a comma.
10571
10572 @item -mtls-size=@var{tls-size}
10573 @opindex mtls-size
10574 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
10575 64.
10576
10577 @item -mtune=@var{cpu-type}
10578 @opindex mtune
10579 Tune the instruction scheduling for a particular CPU, Valid values are
10580 itanium, itanium1, merced, itanium2, and mckinley.
10581
10582 @item -mt
10583 @itemx -pthread
10584 @opindex mt
10585 @opindex pthread
10586 Add support for multithreading using the POSIX threads library.  This
10587 option sets flags for both the preprocessor and linker.  It does
10588 not affect the thread safety of object code produced by the compiler or
10589 that of libraries supplied with it.  These are HP-UX specific flags.
10590
10591 @item -milp32
10592 @itemx -mlp64
10593 @opindex milp32
10594 @opindex mlp64
10595 Generate code for a 32-bit or 64-bit environment.
10596 The 32-bit environment sets int, long and pointer to 32 bits.
10597 The 64-bit environment sets int to 32 bits and long and pointer
10598 to 64 bits.  These are HP-UX specific flags.
10599
10600 @item -mno-sched-br-data-spec
10601 @itemx -msched-br-data-spec
10602 @opindex mno-sched-br-data-spec
10603 @opindex msched-br-data-spec
10604 (Dis/En)able data speculative scheduling before reload.
10605 This will result in generation of the ld.a instructions and
10606 the corresponding check instructions (ld.c / chk.a).
10607 The default is 'disable'.
10608
10609 @item -msched-ar-data-spec
10610 @itemx -mno-sched-ar-data-spec
10611 @opindex msched-ar-data-spec
10612 @opindex mno-sched-ar-data-spec
10613 (En/Dis)able data speculative scheduling after reload.
10614 This will result in generation of the ld.a instructions and
10615 the corresponding check instructions (ld.c / chk.a).
10616 The default is 'enable'.
10617
10618 @item -mno-sched-control-spec
10619 @itemx -msched-control-spec
10620 @opindex mno-sched-control-spec
10621 @opindex msched-control-spec
10622 (Dis/En)able control speculative scheduling.  This feature is
10623 available only during region scheduling (i.e. before reload).
10624 This will result in generation of the ld.s instructions and
10625 the corresponding check instructions chk.s .
10626 The default is 'disable'.
10627
10628 @item -msched-br-in-data-spec
10629 @itemx -mno-sched-br-in-data-spec
10630 @opindex msched-br-in-data-spec
10631 @opindex mno-sched-br-in-data-spec
10632 (En/Dis)able speculative scheduling of the instructions that
10633 are dependent on the data speculative loads before reload.
10634 This is effective only with @option{-msched-br-data-spec} enabled.
10635 The default is 'enable'.
10636
10637 @item -msched-ar-in-data-spec
10638 @itemx -mno-sched-ar-in-data-spec
10639 @opindex msched-ar-in-data-spec
10640 @opindex mno-sched-ar-in-data-spec
10641 (En/Dis)able speculative scheduling of the instructions that
10642 are dependent on the data speculative loads after reload.
10643 This is effective only with @option{-msched-ar-data-spec} enabled.
10644 The default is 'enable'.
10645
10646 @item -msched-in-control-spec
10647 @itemx -mno-sched-in-control-spec
10648 @opindex msched-in-control-spec
10649 @opindex mno-sched-in-control-spec
10650 (En/Dis)able speculative scheduling of the instructions that
10651 are dependent on the control speculative loads.
10652 This is effective only with @option{-msched-control-spec} enabled.
10653 The default is 'enable'.
10654
10655 @item -msched-ldc
10656 @itemx -mno-sched-ldc
10657 @opindex msched-ldc
10658 @opindex mno-sched-ldc
10659 (En/Dis)able use of simple data speculation checks ld.c .
10660 If disabled, only chk.a instructions will be emitted to check
10661 data speculative loads.
10662 The default is 'enable'.
10663
10664 @item -mno-sched-control-ldc
10665 @itemx -msched-control-ldc
10666 @opindex mno-sched-control-ldc
10667 @opindex msched-control-ldc
10668 (Dis/En)able use of ld.c instructions to check control speculative loads.
10669 If enabled, in case of control speculative load with no speculatively
10670 scheduled dependent instructions this load will be emitted as ld.sa and
10671 ld.c will be used to check it.
10672 The default is 'disable'.
10673
10674 @item -mno-sched-spec-verbose
10675 @itemx -msched-spec-verbose
10676 @opindex mno-sched-spec-verbose
10677 @opindex msched-spec-verbose
10678 (Dis/En)able printing of the information about speculative motions.
10679
10680 @item -mno-sched-prefer-non-data-spec-insns
10681 @itemx -msched-prefer-non-data-spec-insns
10682 @opindex mno-sched-prefer-non-data-spec-insns
10683 @opindex msched-prefer-non-data-spec-insns
10684 If enabled, data speculative instructions will be chosen for schedule
10685 only if there are no other choices at the moment.  This will make
10686 the use of the data speculation much more conservative.
10687 The default is 'disable'.
10688
10689 @item -mno-sched-prefer-non-control-spec-insns
10690 @itemx -msched-prefer-non-control-spec-insns
10691 @opindex mno-sched-prefer-non-control-spec-insns
10692 @opindex msched-prefer-non-control-spec-insns
10693 If enabled, control speculative instructions will be chosen for schedule
10694 only if there are no other choices at the moment.  This will make
10695 the use of the control speculation much more conservative.
10696 The default is 'disable'.
10697
10698 @item -mno-sched-count-spec-in-critical-path
10699 @itemx -msched-count-spec-in-critical-path
10700 @opindex mno-sched-count-spec-in-critical-path
10701 @opindex msched-count-spec-in-critical-path
10702 If enabled, speculative dependencies will be considered during
10703 computation of the instructions priorities.  This will make the use of the
10704 speculation a bit more conservative.
10705 The default is 'disable'.
10706
10707 @end table
10708
10709 @node M32C Options
10710 @subsection M32C Options
10711 @cindex M32C options
10712
10713 @table @gcctabopt
10714 @item -mcpu=@var{name}
10715 @opindex mcpu=
10716 Select the CPU for which code is generated.  @var{name} may be one of
10717 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
10718 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
10719 the M32C/80 series.
10720
10721 @item -msim
10722 @opindex msim
10723 Specifies that the program will be run on the simulator.  This causes
10724 an alternate runtime library to be linked in which supports, for
10725 example, file I/O.  You must not use this option when generating
10726 programs that will run on real hardware; you must provide your own
10727 runtime library for whatever I/O functions are needed.
10728
10729 @item -memregs=@var{number}
10730 @opindex memregs=
10731 Specifies the number of memory-based pseudo-registers GCC will use
10732 during code generation.  These pseudo-registers will be used like real
10733 registers, so there is a tradeoff between GCC's ability to fit the
10734 code into available registers, and the performance penalty of using
10735 memory instead of registers.  Note that all modules in a program must
10736 be compiled with the same value for this option.  Because of that, you
10737 must not use this option with the default runtime libraries gcc
10738 builds.
10739
10740 @end table
10741
10742 @node M32R/D Options
10743 @subsection M32R/D Options
10744 @cindex M32R/D options
10745
10746 These @option{-m} options are defined for Renesas M32R/D architectures:
10747
10748 @table @gcctabopt
10749 @item -m32r2
10750 @opindex m32r2
10751 Generate code for the M32R/2@.
10752
10753 @item -m32rx
10754 @opindex m32rx
10755 Generate code for the M32R/X@.
10756
10757 @item -m32r
10758 @opindex m32r
10759 Generate code for the M32R@.  This is the default.
10760
10761 @item -mmodel=small
10762 @opindex mmodel=small
10763 Assume all objects live in the lower 16MB of memory (so that their addresses
10764 can be loaded with the @code{ld24} instruction), and assume all subroutines
10765 are reachable with the @code{bl} instruction.
10766 This is the default.
10767
10768 The addressability of a particular object can be set with the
10769 @code{model} attribute.
10770
10771 @item -mmodel=medium
10772 @opindex mmodel=medium
10773 Assume objects may be anywhere in the 32-bit address space (the compiler
10774 will generate @code{seth/add3} instructions to load their addresses), and
10775 assume all subroutines are reachable with the @code{bl} instruction.
10776
10777 @item -mmodel=large
10778 @opindex mmodel=large
10779 Assume objects may be anywhere in the 32-bit address space (the compiler
10780 will generate @code{seth/add3} instructions to load their addresses), and
10781 assume subroutines may not be reachable with the @code{bl} instruction
10782 (the compiler will generate the much slower @code{seth/add3/jl}
10783 instruction sequence).
10784
10785 @item -msdata=none
10786 @opindex msdata=none
10787 Disable use of the small data area.  Variables will be put into
10788 one of @samp{.data}, @samp{bss}, or @samp{.rodata} (unless the
10789 @code{section} attribute has been specified).
10790 This is the default.
10791
10792 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
10793 Objects may be explicitly put in the small data area with the
10794 @code{section} attribute using one of these sections.
10795
10796 @item -msdata=sdata
10797 @opindex msdata=sdata
10798 Put small global and static data in the small data area, but do not
10799 generate special code to reference them.
10800
10801 @item -msdata=use
10802 @opindex msdata=use
10803 Put small global and static data in the small data area, and generate
10804 special instructions to reference them.
10805
10806 @item -G @var{num}
10807 @opindex G
10808 @cindex smaller data references
10809 Put global and static objects less than or equal to @var{num} bytes
10810 into the small data or bss sections instead of the normal data or bss
10811 sections.  The default value of @var{num} is 8.
10812 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
10813 for this option to have any effect.
10814
10815 All modules should be compiled with the same @option{-G @var{num}} value.
10816 Compiling with different values of @var{num} may or may not work; if it
10817 doesn't the linker will give an error message---incorrect code will not be
10818 generated.
10819
10820 @item -mdebug
10821 @opindex mdebug
10822 Makes the M32R specific code in the compiler display some statistics
10823 that might help in debugging programs.
10824
10825 @item -malign-loops
10826 @opindex malign-loops
10827 Align all loops to a 32-byte boundary.
10828
10829 @item -mno-align-loops
10830 @opindex mno-align-loops
10831 Do not enforce a 32-byte alignment for loops.  This is the default.
10832
10833 @item -missue-rate=@var{number}
10834 @opindex missue-rate=@var{number}
10835 Issue @var{number} instructions per cycle.  @var{number} can only be 1
10836 or 2.
10837
10838 @item -mbranch-cost=@var{number}
10839 @opindex mbranch-cost=@var{number}
10840 @var{number} can only be 1 or 2.  If it is 1 then branches will be
10841 preferred over conditional code, if it is 2, then the opposite will
10842 apply.
10843
10844 @item -mflush-trap=@var{number}
10845 @opindex mflush-trap=@var{number}
10846 Specifies the trap number to use to flush the cache.  The default is
10847 12.  Valid numbers are between 0 and 15 inclusive.
10848
10849 @item -mno-flush-trap
10850 @opindex mno-flush-trap
10851 Specifies that the cache cannot be flushed by using a trap.
10852
10853 @item -mflush-func=@var{name}
10854 @opindex mflush-func=@var{name}
10855 Specifies the name of the operating system function to call to flush
10856 the cache.  The default is @emph{_flush_cache}, but a function call
10857 will only be used if a trap is not available.
10858
10859 @item -mno-flush-func
10860 @opindex mno-flush-func
10861 Indicates that there is no OS function for flushing the cache.
10862
10863 @end table
10864
10865 @node M680x0 Options
10866 @subsection M680x0 Options
10867 @cindex M680x0 options
10868
10869 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
10870 The default settings depend on which architecture was selected when
10871 the compiler was configured; the defaults for the most common choices
10872 are given below.
10873
10874 @table @gcctabopt
10875 @item -march=@var{arch}
10876 @opindex march
10877 Generate code for a specific M680x0 or ColdFire instruction set
10878 architecture.  Permissible values of @var{arch} for M680x0
10879 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
10880 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
10881 architectures are selected according to Freescale's ISA classification
10882 and the permissible values are: @samp{isaa}, @samp{isaaplus},
10883 @samp{isab} and @samp{isac}.
10884
10885 gcc defines a macro @samp{__mcf@var{arch}__} whenever it is generating
10886 code for a ColdFire target.  The @var{arch} in this macro is one of the
10887 @option{-march} arguments given above.
10888
10889 When used together, @option{-march} and @option{-mtune} select code
10890 that runs on a family of similar processors but that is optimized
10891 for a particular microarchitecture.
10892
10893 @item -mcpu=@var{cpu}
10894 @opindex mcpu
10895 Generate code for a specific M680x0 or ColdFire processor.
10896 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
10897 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
10898 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
10899 below, which also classifies the CPUs into families:
10900
10901 @multitable @columnfractions 0.20 0.80
10902 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
10903 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
10904 @item @samp{5206e} @tab @samp{5206e}
10905 @item @samp{5208} @tab @samp{5207} @samp{5208}
10906 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
10907 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
10908 @item @samp{5216} @tab @samp{5214} @samp{5216}
10909 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
10910 @item @samp{5225} @tab @samp{5224} @samp{5225}
10911 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
10912 @item @samp{5249} @tab @samp{5249}
10913 @item @samp{5250} @tab @samp{5250}
10914 @item @samp{5271} @tab @samp{5270} @samp{5271}
10915 @item @samp{5272} @tab @samp{5272}
10916 @item @samp{5275} @tab @samp{5274} @samp{5275}
10917 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
10918 @item @samp{5307} @tab @samp{5307}
10919 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
10920 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
10921 @item @samp{5407} @tab @samp{5407}
10922 @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}
10923 @end multitable
10924
10925 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
10926 @var{arch} is compatible with @var{cpu}.  Other combinations of
10927 @option{-mcpu} and @option{-march} are rejected.
10928
10929 gcc defines the macro @samp{__mcf_cpu_@var{cpu}} when ColdFire target
10930 @var{cpu} is selected.  It also defines @samp{__mcf_family_@var{family}},
10931 where the value of @var{family} is given by the table above.
10932
10933 @item -mtune=@var{tune}
10934 @opindex mtune
10935 Tune the code for a particular microarchitecture, within the
10936 constraints set by @option{-march} and @option{-mcpu}.
10937 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
10938 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
10939 and @samp{cpu32}.  The ColdFire microarchitectures
10940 are: @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
10941
10942 You can also use @option{-mtune=68020-40} for code that needs
10943 to run relatively well on 68020, 68030 and 68040 targets.
10944 @option{-mtune=68020-60} is similar but includes 68060 targets
10945 as well.  These two options select the same tuning decisions as
10946 @option{-m68020-40} and @option{-m68020-60} respectively.
10947
10948 gcc defines the macros @samp{__mc@var{arch}} and @samp{__mc@var{arch}__}
10949 when tuning for 680x0 architecture @var{arch}.  It also defines
10950 @samp{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
10951 option is used.  If gcc is tuning for a range of architectures,
10952 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
10953 it defines the macros for every architecture in the range.
10954
10955 gcc also defines the macro @samp{__m@var{uarch}__} when tuning for
10956 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
10957 of the arguments given above.
10958
10959 @item -m68000
10960 @itemx -mc68000
10961 @opindex m68000
10962 @opindex mc68000
10963 Generate output for a 68000.  This is the default
10964 when the compiler is configured for 68000-based systems.
10965 It is equivalent to @option{-march=68000}.
10966
10967 Use this option for microcontrollers with a 68000 or EC000 core,
10968 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
10969
10970 @item -m68010
10971 @opindex m68010
10972 Generate output for a 68010.  This is the default
10973 when the compiler is configured for 68010-based systems.
10974 It is equivalent to @option{-march=68010}.
10975
10976 @item -m68020
10977 @itemx -mc68020
10978 @opindex m68020
10979 @opindex mc68020
10980 Generate output for a 68020.  This is the default
10981 when the compiler is configured for 68020-based systems.
10982 It is equivalent to @option{-march=68020}.
10983
10984 @item -m68030
10985 @opindex m68030
10986 Generate output for a 68030.  This is the default when the compiler is
10987 configured for 68030-based systems.  It is equivalent to
10988 @option{-march=68030}.
10989
10990 @item -m68040
10991 @opindex m68040
10992 Generate output for a 68040.  This is the default when the compiler is
10993 configured for 68040-based systems.  It is equivalent to
10994 @option{-march=68040}.
10995
10996 This option inhibits the use of 68881/68882 instructions that have to be
10997 emulated by software on the 68040.  Use this option if your 68040 does not
10998 have code to emulate those instructions.
10999
11000 @item -m68060
11001 @opindex m68060
11002 Generate output for a 68060.  This is the default when the compiler is
11003 configured for 68060-based systems.  It is equivalent to
11004 @option{-march=68060}.
11005
11006 This option inhibits the use of 68020 and 68881/68882 instructions that
11007 have to be emulated by software on the 68060.  Use this option if your 68060
11008 does not have code to emulate those instructions.
11009
11010 @item -mcpu32
11011 @opindex mcpu32
11012 Generate output for a CPU32.  This is the default
11013 when the compiler is configured for CPU32-based systems.
11014 It is equivalent to @option{-march=cpu32}.
11015
11016 Use this option for microcontrollers with a
11017 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
11018 68336, 68340, 68341, 68349 and 68360.
11019
11020 @item -m5200
11021 @opindex m5200
11022 Generate output for a 520X ColdFire CPU.  This is the default
11023 when the compiler is configured for 520X-based systems.
11024 It is equivalent to @option{-mcpu=5206}, and is now deprecated
11025 in favor of that option.
11026
11027 Use this option for microcontroller with a 5200 core, including
11028 the MCF5202, MCF5203, MCF5204 and MCF5206.
11029
11030 @item -m5206e
11031 @opindex m5206e
11032 Generate output for a 5206e ColdFire CPU.  The option is now
11033 deprecated in favor of the equivalent @option{-mcpu=5206e}.
11034
11035 @item -m528x
11036 @opindex m528x
11037 Generate output for a member of the ColdFire 528X family.
11038 The option is now deprecated in favor of the equivalent
11039 @option{-mcpu=528x}.
11040
11041 @item -m5307
11042 @opindex m5307
11043 Generate output for a ColdFire 5307 CPU.  The option is now deprecated
11044 in favor of the equivalent @option{-mcpu=5307}.
11045
11046 @item -m5407
11047 @opindex m5407
11048 Generate output for a ColdFire 5407 CPU.  The option is now deprecated
11049 in favor of the equivalent @option{-mcpu=5407}.
11050
11051 @item -mcfv4e
11052 @opindex mcfv4e
11053 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
11054 This includes use of hardware floating point instructions.
11055 The option is equivalent to @option{-mcpu=547x}, and is now
11056 deprecated in favor of that option.
11057
11058 @item -m68020-40
11059 @opindex m68020-40
11060 Generate output for a 68040, without using any of the new instructions.
11061 This results in code which can run relatively efficiently on either a
11062 68020/68881 or a 68030 or a 68040.  The generated code does use the
11063 68881 instructions that are emulated on the 68040.
11064
11065 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
11066
11067 @item -m68020-60
11068 @opindex m68020-60
11069 Generate output for a 68060, without using any of the new instructions.
11070 This results in code which can run relatively efficiently on either a
11071 68020/68881 or a 68030 or a 68040.  The generated code does use the
11072 68881 instructions that are emulated on the 68060.
11073
11074 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
11075
11076 @item -mhard-float
11077 @itemx -m68881
11078 @opindex mhard-float
11079 @opindex m68881
11080 Generate floating-point instructions.  This is the default for 68020
11081 and above, and for ColdFire devices that have an FPU.  It defines the
11082 macro @samp{__HAVE_68881__} on M680x0 targets and @samp{__mcffpu__}
11083 on ColdFire targets.
11084
11085 @item -msoft-float
11086 @opindex msoft-float
11087 Do not generate floating-point instructions; use library calls instead.
11088 This is the default for 68000, 68010, and 68832 targets.  It is also
11089 the default for ColdFire devices that have no FPU.
11090
11091 @item -mdiv
11092 @itemx -mno-div
11093 @opindex mdiv
11094 @opindex mno-div
11095 Generate (do not generate) ColdFire hardware divide and remainder
11096 instructions.  If @option{-march} is used without @option{-mcpu},
11097 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
11098 architectures.  Otherwise, the default is taken from the target CPU
11099 (either the default CPU, or the one specified by @option{-mcpu}).  For
11100 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
11101 @option{-mcpu=5206e}.
11102
11103 gcc defines the macro @samp{__mcfhwdiv__} when this option is enabled.
11104
11105 @item -mshort
11106 @opindex mshort
11107 Consider type @code{int} to be 16 bits wide, like @code{short int}.
11108 Additionally, parameters passed on the stack are also aligned to a
11109 16-bit boundary even on targets whose API mandates promotion to 32-bit.
11110
11111 @item -mno-short
11112 @opindex mno-short
11113 Do not consider type @code{int} to be 16 bits wide.  This is the default.
11114
11115 @item -mnobitfield
11116 @itemx -mno-bitfield
11117 @opindex mnobitfield
11118 @opindex mno-bitfield
11119 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
11120 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
11121
11122 @item -mbitfield
11123 @opindex mbitfield
11124 Do use the bit-field instructions.  The @option{-m68020} option implies
11125 @option{-mbitfield}.  This is the default if you use a configuration
11126 designed for a 68020.
11127
11128 @item -mrtd
11129 @opindex mrtd
11130 Use a different function-calling convention, in which functions
11131 that take a fixed number of arguments return with the @code{rtd}
11132 instruction, which pops their arguments while returning.  This
11133 saves one instruction in the caller since there is no need to pop
11134 the arguments there.
11135
11136 This calling convention is incompatible with the one normally
11137 used on Unix, so you cannot use it if you need to call libraries
11138 compiled with the Unix compiler.
11139
11140 Also, you must provide function prototypes for all functions that
11141 take variable numbers of arguments (including @code{printf});
11142 otherwise incorrect code will be generated for calls to those
11143 functions.
11144
11145 In addition, seriously incorrect code will result if you call a
11146 function with too many arguments.  (Normally, extra arguments are
11147 harmlessly ignored.)
11148
11149 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
11150 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
11151
11152 @item -mno-rtd
11153 @opindex mno-rtd
11154 Do not use the calling conventions selected by @option{-mrtd}.
11155 This is the default.
11156
11157 @item -malign-int
11158 @itemx -mno-align-int
11159 @opindex malign-int
11160 @opindex mno-align-int
11161 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
11162 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
11163 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
11164 Aligning variables on 32-bit boundaries produces code that runs somewhat
11165 faster on processors with 32-bit busses at the expense of more memory.
11166
11167 @strong{Warning:} if you use the @option{-malign-int} switch, GCC will
11168 align structures containing the above types  differently than
11169 most published application binary interface specifications for the m68k.
11170
11171 @item -mpcrel
11172 @opindex mpcrel
11173 Use the pc-relative addressing mode of the 68000 directly, instead of
11174 using a global offset table.  At present, this option implies @option{-fpic},
11175 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
11176 not presently supported with @option{-mpcrel}, though this could be supported for
11177 68020 and higher processors.
11178
11179 @item -mno-strict-align
11180 @itemx -mstrict-align
11181 @opindex mno-strict-align
11182 @opindex mstrict-align
11183 Do not (do) assume that unaligned memory references will be handled by
11184 the system.
11185
11186 @item -msep-data
11187 Generate code that allows the data segment to be located in a different
11188 area of memory from the text segment.  This allows for execute in place in
11189 an environment without virtual memory management.  This option implies
11190 @option{-fPIC}.
11191
11192 @item -mno-sep-data
11193 Generate code that assumes that the data segment follows the text segment.
11194 This is the default.
11195
11196 @item -mid-shared-library
11197 Generate code that supports shared libraries via the library ID method.
11198 This allows for execute in place and shared libraries in an environment
11199 without virtual memory management.  This option implies @option{-fPIC}.
11200
11201 @item -mno-id-shared-library
11202 Generate code that doesn't assume ID based shared libraries are being used.
11203 This is the default.
11204
11205 @item -mshared-library-id=n
11206 Specified the identification number of the ID based shared library being
11207 compiled.  Specifying a value of 0 will generate more compact code, specifying
11208 other values will force the allocation of that number to the current
11209 library but is no more space or time efficient than omitting this option.
11210
11211 @end table
11212
11213 @node M68hc1x Options
11214 @subsection M68hc1x Options
11215 @cindex M68hc1x options
11216
11217 These are the @samp{-m} options defined for the 68hc11 and 68hc12
11218 microcontrollers.  The default values for these options depends on
11219 which style of microcontroller was selected when the compiler was configured;
11220 the defaults for the most common choices are given below.
11221
11222 @table @gcctabopt
11223 @item -m6811
11224 @itemx -m68hc11
11225 @opindex m6811
11226 @opindex m68hc11
11227 Generate output for a 68HC11.  This is the default
11228 when the compiler is configured for 68HC11-based systems.
11229
11230 @item -m6812
11231 @itemx -m68hc12
11232 @opindex m6812
11233 @opindex m68hc12
11234 Generate output for a 68HC12.  This is the default
11235 when the compiler is configured for 68HC12-based systems.
11236
11237 @item -m68S12
11238 @itemx -m68hcs12
11239 @opindex m68S12
11240 @opindex m68hcs12
11241 Generate output for a 68HCS12.
11242
11243 @item -mauto-incdec
11244 @opindex mauto-incdec
11245 Enable the use of 68HC12 pre and post auto-increment and auto-decrement
11246 addressing modes.
11247
11248 @item -minmax
11249 @itemx -nominmax
11250 @opindex minmax
11251 @opindex mnominmax
11252 Enable the use of 68HC12 min and max instructions.
11253
11254 @item -mlong-calls
11255 @itemx -mno-long-calls
11256 @opindex mlong-calls
11257 @opindex mno-long-calls
11258 Treat all calls as being far away (near).  If calls are assumed to be
11259 far away, the compiler will use the @code{call} instruction to
11260 call a function and the @code{rtc} instruction for returning.
11261
11262 @item -mshort
11263 @opindex mshort
11264 Consider type @code{int} to be 16 bits wide, like @code{short int}.
11265
11266 @item -msoft-reg-count=@var{count}
11267 @opindex msoft-reg-count
11268 Specify the number of pseudo-soft registers which are used for the
11269 code generation.  The maximum number is 32.  Using more pseudo-soft
11270 register may or may not result in better code depending on the program.
11271 The default is 4 for 68HC11 and 2 for 68HC12.
11272
11273 @end table
11274
11275 @node MCore Options
11276 @subsection MCore Options
11277 @cindex MCore options
11278
11279 These are the @samp{-m} options defined for the Motorola M*Core
11280 processors.
11281
11282 @table @gcctabopt
11283
11284 @item -mhardlit
11285 @itemx -mno-hardlit
11286 @opindex mhardlit
11287 @opindex mno-hardlit
11288 Inline constants into the code stream if it can be done in two
11289 instructions or less.
11290
11291 @item -mdiv
11292 @itemx -mno-div
11293 @opindex mdiv
11294 @opindex mno-div
11295 Use the divide instruction.  (Enabled by default).
11296
11297 @item -mrelax-immediate
11298 @itemx -mno-relax-immediate
11299 @opindex mrelax-immediate
11300 @opindex mno-relax-immediate
11301 Allow arbitrary sized immediates in bit operations.
11302
11303 @item -mwide-bitfields
11304 @itemx -mno-wide-bitfields
11305 @opindex mwide-bitfields
11306 @opindex mno-wide-bitfields
11307 Always treat bit-fields as int-sized.
11308
11309 @item -m4byte-functions
11310 @itemx -mno-4byte-functions
11311 @opindex m4byte-functions
11312 @opindex mno-4byte-functions
11313 Force all functions to be aligned to a four byte boundary.
11314
11315 @item -mcallgraph-data
11316 @itemx -mno-callgraph-data
11317 @opindex mcallgraph-data
11318 @opindex mno-callgraph-data
11319 Emit callgraph information.
11320
11321 @item -mslow-bytes
11322 @itemx -mno-slow-bytes
11323 @opindex mslow-bytes
11324 @opindex mno-slow-bytes
11325 Prefer word access when reading byte quantities.
11326
11327 @item -mlittle-endian
11328 @itemx -mbig-endian
11329 @opindex mlittle-endian
11330 @opindex mbig-endian
11331 Generate code for a little endian target.
11332
11333 @item -m210
11334 @itemx -m340
11335 @opindex m210
11336 @opindex m340
11337 Generate code for the 210 processor.
11338 @end table
11339
11340 @node MIPS Options
11341 @subsection MIPS Options
11342 @cindex MIPS options
11343
11344 @table @gcctabopt
11345
11346 @item -EB
11347 @opindex EB
11348 Generate big-endian code.
11349
11350 @item -EL
11351 @opindex EL
11352 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
11353 configurations.
11354
11355 @item -march=@var{arch}
11356 @opindex march
11357 Generate code that will run on @var{arch}, which can be the name of a
11358 generic MIPS ISA, or the name of a particular processor.
11359 The ISA names are:
11360 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
11361 @samp{mips32}, @samp{mips32r2}, and @samp{mips64}.
11362 The processor names are:
11363 @samp{4kc}, @samp{4km}, @samp{4kp},
11364 @samp{4kec}, @samp{4kem}, @samp{4kep},
11365 @samp{5kc}, @samp{5kf},
11366 @samp{20kc},
11367 @samp{24kc}, @samp{24kf}, @samp{24kx},
11368 @samp{24kec}, @samp{24kef}, @samp{24kex},
11369 @samp{34kc}, @samp{34kf}, @samp{34kx},
11370 @samp{74kc}, @samp{74kf}, @samp{74kx},
11371 @samp{m4k},
11372 @samp{orion},
11373 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
11374 @samp{r4600}, @samp{r4650}, @samp{r6000}, @samp{r8000},
11375 @samp{rm7000}, @samp{rm9000},
11376 @samp{sb1},
11377 @samp{sr71000},
11378 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
11379 @samp{vr5000}, @samp{vr5400} and @samp{vr5500}.
11380 The special value @samp{from-abi} selects the
11381 most compatible architecture for the selected ABI (that is,
11382 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
11383
11384 In processor names, a final @samp{000} can be abbreviated as @samp{k}
11385 (for example, @samp{-march=r2k}).  Prefixes are optional, and
11386 @samp{vr} may be written @samp{r}.
11387
11388 GCC defines two macros based on the value of this option.  The first
11389 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
11390 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
11391 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
11392 For example, @samp{-march=r2000} will set @samp{_MIPS_ARCH}
11393 to @samp{"r2000"} and define the macro @samp{_MIPS_ARCH_R2000}.
11394
11395 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
11396 above.  In other words, it will have the full prefix and will not
11397 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
11398 the macro names the resolved architecture (either @samp{"mips1"} or
11399 @samp{"mips3"}).  It names the default architecture when no
11400 @option{-march} option is given.
11401
11402 @item -mtune=@var{arch}
11403 @opindex mtune
11404 Optimize for @var{arch}.  Among other things, this option controls
11405 the way instructions are scheduled, and the perceived cost of arithmetic
11406 operations.  The list of @var{arch} values is the same as for
11407 @option{-march}.
11408
11409 When this option is not used, GCC will optimize for the processor
11410 specified by @option{-march}.  By using @option{-march} and
11411 @option{-mtune} together, it is possible to generate code that will
11412 run on a family of processors, but optimize the code for one
11413 particular member of that family.
11414
11415 @samp{-mtune} defines the macros @samp{_MIPS_TUNE} and
11416 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
11417 @samp{-march} ones described above.
11418
11419 @item -mips1
11420 @opindex mips1
11421 Equivalent to @samp{-march=mips1}.
11422
11423 @item -mips2
11424 @opindex mips2
11425 Equivalent to @samp{-march=mips2}.
11426
11427 @item -mips3
11428 @opindex mips3
11429 Equivalent to @samp{-march=mips3}.
11430
11431 @item -mips4
11432 @opindex mips4
11433 Equivalent to @samp{-march=mips4}.
11434
11435 @item -mips32
11436 @opindex mips32
11437 Equivalent to @samp{-march=mips32}.
11438
11439 @item -mips32r2
11440 @opindex mips32r2
11441 Equivalent to @samp{-march=mips32r2}.
11442
11443 @item -mips64
11444 @opindex mips64
11445 Equivalent to @samp{-march=mips64}.
11446
11447 @item -mips16
11448 @itemx -mno-mips16
11449 @opindex mips16
11450 @opindex mno-mips16
11451 Generate (do not generate) MIPS16 code.  If GCC is targetting a
11452 MIPS32 or MIPS64 architecture, it will make use of the MIPS16e ASE@.
11453
11454 @item -mabi=32
11455 @itemx -mabi=o64
11456 @itemx -mabi=n32
11457 @itemx -mabi=64
11458 @itemx -mabi=eabi
11459 @opindex mabi=32
11460 @opindex mabi=o64
11461 @opindex mabi=n32
11462 @opindex mabi=64
11463 @opindex mabi=eabi
11464 Generate code for the given ABI@.
11465
11466 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
11467 generates 64-bit code when you select a 64-bit architecture, but you
11468 can use @option{-mgp32} to get 32-bit code instead.
11469
11470 For information about the O64 ABI, see
11471 @w{@uref{http://gcc.gnu.org/projects/mipso64-abi.html}}.
11472
11473 GCC supports a variant of the o32 ABI in which floating-point registers
11474 are 64 rather than 32 bits wide.  You can select this combination with
11475 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @samp{mthc1}
11476 and @samp{mfhc1} instructions and is therefore only supported for
11477 MIPS32R2 processors.
11478
11479 The register assignments for arguments and return values remain the
11480 same, but each scalar value is passed in a single 64-bit register
11481 rather than a pair of 32-bit registers.  For example, scalar
11482 floating-point values are returned in @samp{$f0} only, not a
11483 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
11484 remains the same, but all 64 bits are saved.
11485
11486 @item -mabicalls
11487 @itemx -mno-abicalls
11488 @opindex mabicalls
11489 @opindex mno-abicalls
11490 Generate (do not generate) code that is suitable for SVR4-style
11491 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
11492 systems.
11493
11494 @item -mshared
11495 @itemx -mno-shared
11496 Generate (do not generate) code that is fully position-independent,
11497 and that can therefore be linked into shared libraries.  This option
11498 only affects @option{-mabicalls}.
11499
11500 All @option{-mabicalls} code has traditionally been position-independent,
11501 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
11502 as an extension, the GNU toolchain allows executables to use absolute
11503 accesses for locally-binding symbols.  It can also use shorter GP
11504 initialization sequences and generate direct calls to locally-defined
11505 functions.  This mode is selected by @option{-mno-shared}.
11506
11507 @option{-mno-shared} depends on binutils 2.16 or higher and generates
11508 objects that can only be linked by the GNU linker.  However, the option
11509 does not affect the ABI of the final executable; it only affects the ABI
11510 of relocatable objects.  Using @option{-mno-shared} will generally make
11511 executables both smaller and quicker.
11512
11513 @option{-mshared} is the default.
11514
11515 @item -mxgot
11516 @itemx -mno-xgot
11517 @opindex mxgot
11518 @opindex mno-xgot
11519 Lift (do not lift) the usual restrictions on the size of the global
11520 offset table.
11521
11522 GCC normally uses a single instruction to load values from the GOT@.
11523 While this is relatively efficient, it will only work if the GOT
11524 is smaller than about 64k.  Anything larger will cause the linker
11525 to report an error such as:
11526
11527 @cindex relocation truncated to fit (MIPS)
11528 @smallexample
11529 relocation truncated to fit: R_MIPS_GOT16 foobar
11530 @end smallexample
11531
11532 If this happens, you should recompile your code with @option{-mxgot}.
11533 It should then work with very large GOTs, although it will also be
11534 less efficient, since it will take three instructions to fetch the
11535 value of a global symbol.
11536
11537 Note that some linkers can create multiple GOTs.  If you have such a
11538 linker, you should only need to use @option{-mxgot} when a single object
11539 file accesses more than 64k's worth of GOT entries.  Very few do.
11540
11541 These options have no effect unless GCC is generating position
11542 independent code.
11543
11544 @item -mgp32
11545 @opindex mgp32
11546 Assume that general-purpose registers are 32 bits wide.
11547
11548 @item -mgp64
11549 @opindex mgp64
11550 Assume that general-purpose registers are 64 bits wide.
11551
11552 @item -mfp32
11553 @opindex mfp32
11554 Assume that floating-point registers are 32 bits wide.
11555
11556 @item -mfp64
11557 @opindex mfp64
11558 Assume that floating-point registers are 64 bits wide.
11559
11560 @item -mhard-float
11561 @opindex mhard-float
11562 Use floating-point coprocessor instructions.
11563
11564 @item -msoft-float
11565 @opindex msoft-float
11566 Do not use floating-point coprocessor instructions.  Implement
11567 floating-point calculations using library calls instead.
11568
11569 @item -msingle-float
11570 @opindex msingle-float
11571 Assume that the floating-point coprocessor only supports single-precision
11572 operations.
11573
11574 @item -mdouble-float
11575 @opindex mdouble-float
11576 Assume that the floating-point coprocessor supports double-precision
11577 operations.  This is the default.
11578
11579 @item -mdsp
11580 @itemx -mno-dsp
11581 @opindex mdsp
11582 @opindex mno-dsp
11583 Use (do not use) the MIPS DSP ASE.  @xref{MIPS DSP Built-in Functions}.
11584
11585 @item -mdspr2
11586 @itemx -mno-dspr2
11587 @opindex mdspr2
11588 @opindex mno-dspr2
11589 Use (do not use) the MIPS DSP ASE REV 2.  @xref{MIPS DSP Built-in Functions}.
11590 The option @option{-mdspr2} implies @option{-mdsp}.
11591
11592 @item -mpaired-single
11593 @itemx -mno-paired-single
11594 @opindex mpaired-single
11595 @opindex mno-paired-single
11596 Use (do not use) paired-single floating-point instructions.
11597 @xref{MIPS Paired-Single Support}.  This option can only be used
11598 when generating 64-bit code and requires hardware floating-point
11599 support to be enabled.
11600
11601 @item -mdmx
11602 @itemx -mno-mdmx
11603 @opindex mdmx
11604 @opindex mno-mdmx
11605 Use (do not use) MIPS Digital Media Extension instructions.
11606 This option can only be used when generating 64-bit code and requires
11607 hardware floating-point support to be enabled.
11608
11609 @item -mips3d
11610 @itemx -mno-mips3d
11611 @opindex mips3d
11612 @opindex mno-mips3d
11613 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
11614 The option @option{-mips3d} implies @option{-mpaired-single}.
11615
11616 @item -mmt
11617 @itemx -mno-mt
11618 @opindex mmt
11619 @opindex mno-mt
11620 Use (do not use) MT Multithreading instructions.
11621
11622 @item -mlong64
11623 @opindex mlong64
11624 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
11625 an explanation of the default and the way that the pointer size is
11626 determined.
11627
11628 @item -mlong32
11629 @opindex mlong32
11630 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
11631
11632 The default size of @code{int}s, @code{long}s and pointers depends on
11633 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
11634 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
11635 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
11636 or the same size as integer registers, whichever is smaller.
11637
11638 @item -msym32
11639 @itemx -mno-sym32
11640 @opindex msym32
11641 @opindex mno-sym32
11642 Assume (do not assume) that all symbols have 32-bit values, regardless
11643 of the selected ABI@.  This option is useful in combination with
11644 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
11645 to generate shorter and faster references to symbolic addresses.
11646
11647 @item -G @var{num}
11648 @opindex G
11649 @cindex smaller data references (MIPS)
11650 @cindex gp-relative references (MIPS)
11651 Put global and static items less than or equal to @var{num} bytes into
11652 the small data or bss section instead of the normal data or bss section.
11653 This allows the data to be accessed using a single instruction.
11654
11655 All modules should be compiled with the same @option{-G @var{num}}
11656 value.
11657
11658 @item -membedded-data
11659 @itemx -mno-embedded-data
11660 @opindex membedded-data
11661 @opindex mno-embedded-data
11662 Allocate variables to the read-only data section first if possible, then
11663 next in the small data section if possible, otherwise in data.  This gives
11664 slightly slower code than the default, but reduces the amount of RAM required
11665 when executing, and thus may be preferred for some embedded systems.
11666
11667 @item -muninit-const-in-rodata
11668 @itemx -mno-uninit-const-in-rodata
11669 @opindex muninit-const-in-rodata
11670 @opindex mno-uninit-const-in-rodata
11671 Put uninitialized @code{const} variables in the read-only data section.
11672 This option is only meaningful in conjunction with @option{-membedded-data}.
11673
11674 @item -msplit-addresses
11675 @itemx -mno-split-addresses
11676 @opindex msplit-addresses
11677 @opindex mno-split-addresses
11678 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
11679 relocation operators.  This option has been superseded by
11680 @option{-mexplicit-relocs} but is retained for backwards compatibility.
11681
11682 @item -mexplicit-relocs
11683 @itemx -mno-explicit-relocs
11684 @opindex mexplicit-relocs
11685 @opindex mno-explicit-relocs
11686 Use (do not use) assembler relocation operators when dealing with symbolic
11687 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
11688 is to use assembler macros instead.
11689
11690 @option{-mexplicit-relocs} is the default if GCC was configured
11691 to use an assembler that supports relocation operators.
11692
11693 @item -mcheck-zero-division
11694 @itemx -mno-check-zero-division
11695 @opindex mcheck-zero-division
11696 @opindex mno-check-zero-division
11697 Trap (do not trap) on integer division by zero.
11698
11699 The default is @option{-mcheck-zero-division}.
11700
11701 @item -mdivide-traps
11702 @itemx -mdivide-breaks
11703 @opindex mdivide-traps
11704 @opindex mdivide-breaks
11705 MIPS systems check for division by zero by generating either a
11706 conditional trap or a break instruction.  Using traps results in
11707 smaller code, but is only supported on MIPS II and later.  Also, some
11708 versions of the Linux kernel have a bug that prevents trap from
11709 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
11710 allow conditional traps on architectures that support them and
11711 @option{-mdivide-breaks} to force the use of breaks.
11712
11713 The default is usually @option{-mdivide-traps}, but this can be
11714 overridden at configure time using @option{--with-divide=breaks}.
11715 Divide-by-zero checks can be completely disabled using
11716 @option{-mno-check-zero-division}.
11717
11718 @item -mmemcpy
11719 @itemx -mno-memcpy
11720 @opindex mmemcpy
11721 @opindex mno-memcpy
11722 Force (do not force) the use of @code{memcpy()} for non-trivial block
11723 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
11724 most constant-sized copies.
11725
11726 @item -mlong-calls
11727 @itemx -mno-long-calls
11728 @opindex mlong-calls
11729 @opindex mno-long-calls
11730 Disable (do not disable) use of the @code{jal} instruction.  Calling
11731 functions using @code{jal} is more efficient but requires the caller
11732 and callee to be in the same 256 megabyte segment.
11733
11734 This option has no effect on abicalls code.  The default is
11735 @option{-mno-long-calls}.
11736
11737 @item -mmad
11738 @itemx -mno-mad
11739 @opindex mmad
11740 @opindex mno-mad
11741 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
11742 instructions, as provided by the R4650 ISA@.
11743
11744 @item -mfused-madd
11745 @itemx -mno-fused-madd
11746 @opindex mfused-madd
11747 @opindex mno-fused-madd
11748 Enable (disable) use of the floating point multiply-accumulate
11749 instructions, when they are available.  The default is
11750 @option{-mfused-madd}.
11751
11752 When multiply-accumulate instructions are used, the intermediate
11753 product is calculated to infinite precision and is not subject to
11754 the FCSR Flush to Zero bit.  This may be undesirable in some
11755 circumstances.
11756
11757 @item -nocpp
11758 @opindex nocpp
11759 Tell the MIPS assembler to not run its preprocessor over user
11760 assembler files (with a @samp{.s} suffix) when assembling them.
11761
11762 @item -mfix-r4000
11763 @itemx -mno-fix-r4000
11764 @opindex mfix-r4000
11765 @opindex mno-fix-r4000
11766 Work around certain R4000 CPU errata:
11767 @itemize @minus
11768 @item
11769 A double-word or a variable shift may give an incorrect result if executed
11770 immediately after starting an integer division.
11771 @item
11772 A double-word or a variable shift may give an incorrect result if executed
11773 while an integer multiplication is in progress.
11774 @item
11775 An integer division may give an incorrect result if started in a delay slot
11776 of a taken branch or a jump.
11777 @end itemize
11778
11779 @item -mfix-r4400
11780 @itemx -mno-fix-r4400
11781 @opindex mfix-r4400
11782 @opindex mno-fix-r4400
11783 Work around certain R4400 CPU errata:
11784 @itemize @minus
11785 @item
11786 A double-word or a variable shift may give an incorrect result if executed
11787 immediately after starting an integer division.
11788 @end itemize
11789
11790 @item -mfix-vr4120
11791 @itemx -mno-fix-vr4120
11792 @opindex mfix-vr4120
11793 Work around certain VR4120 errata:
11794 @itemize @minus
11795 @item
11796 @code{dmultu} does not always produce the correct result.
11797 @item
11798 @code{div} and @code{ddiv} do not always produce the correct result if one
11799 of the operands is negative.
11800 @end itemize
11801 The workarounds for the division errata rely on special functions in
11802 @file{libgcc.a}.  At present, these functions are only provided by
11803 the @code{mips64vr*-elf} configurations.
11804
11805 Other VR4120 errata require a nop to be inserted between certain pairs of
11806 instructions.  These errata are handled by the assembler, not by GCC itself.
11807
11808 @item -mfix-vr4130
11809 @opindex mfix-vr4130
11810 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
11811 workarounds are implemented by the assembler rather than by GCC,
11812 although GCC will avoid using @code{mflo} and @code{mfhi} if the
11813 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
11814 instructions are available instead.
11815
11816 @item -mfix-sb1
11817 @itemx -mno-fix-sb1
11818 @opindex mfix-sb1
11819 Work around certain SB-1 CPU core errata.
11820 (This flag currently works around the SB-1 revision 2
11821 ``F1'' and ``F2'' floating point errata.)
11822
11823 @item -mflush-func=@var{func}
11824 @itemx -mno-flush-func
11825 @opindex mflush-func
11826 Specifies the function to call to flush the I and D caches, or to not
11827 call any such function.  If called, the function must take the same
11828 arguments as the common @code{_flush_func()}, that is, the address of the
11829 memory range for which the cache is being flushed, the size of the
11830 memory range, and the number 3 (to flush both caches).  The default
11831 depends on the target GCC was configured for, but commonly is either
11832 @samp{_flush_func} or @samp{__cpu_flush}.
11833
11834 @item -mbranch-likely
11835 @itemx -mno-branch-likely
11836 @opindex mbranch-likely
11837 @opindex mno-branch-likely
11838 Enable or disable use of Branch Likely instructions, regardless of the
11839 default for the selected architecture.  By default, Branch Likely
11840 instructions may be generated if they are supported by the selected
11841 architecture.  An exception is for the MIPS32 and MIPS64 architectures
11842 and processors which implement those architectures; for those, Branch
11843 Likely instructions will not be generated by default because the MIPS32
11844 and MIPS64 architectures specifically deprecate their use.
11845
11846 @item -mfp-exceptions
11847 @itemx -mno-fp-exceptions
11848 @opindex mfp-exceptions
11849 Specifies whether FP exceptions are enabled.  This affects how we schedule
11850 FP instructions for some processors.  The default is that FP exceptions are
11851 enabled.
11852
11853 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
11854 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
11855 FP pipe.
11856
11857 @item -mvr4130-align
11858 @itemx -mno-vr4130-align
11859 @opindex mvr4130-align
11860 The VR4130 pipeline is two-way superscalar, but can only issue two
11861 instructions together if the first one is 8-byte aligned.  When this
11862 option is enabled, GCC will align pairs of instructions that it
11863 thinks should execute in parallel.
11864
11865 This option only has an effect when optimizing for the VR4130.
11866 It normally makes code faster, but at the expense of making it bigger.
11867 It is enabled by default at optimization level @option{-O3}.
11868 @end table
11869
11870 @node MMIX Options
11871 @subsection MMIX Options
11872 @cindex MMIX Options
11873
11874 These options are defined for the MMIX:
11875
11876 @table @gcctabopt
11877 @item -mlibfuncs
11878 @itemx -mno-libfuncs
11879 @opindex mlibfuncs
11880 @opindex mno-libfuncs
11881 Specify that intrinsic library functions are being compiled, passing all
11882 values in registers, no matter the size.
11883
11884 @item -mepsilon
11885 @itemx -mno-epsilon
11886 @opindex mepsilon
11887 @opindex mno-epsilon
11888 Generate floating-point comparison instructions that compare with respect
11889 to the @code{rE} epsilon register.
11890
11891 @item -mabi=mmixware
11892 @itemx -mabi=gnu
11893 @opindex mabi-mmixware
11894 @opindex mabi=gnu
11895 Generate code that passes function parameters and return values that (in
11896 the called function) are seen as registers @code{$0} and up, as opposed to
11897 the GNU ABI which uses global registers @code{$231} and up.
11898
11899 @item -mzero-extend
11900 @itemx -mno-zero-extend
11901 @opindex mzero-extend
11902 @opindex mno-zero-extend
11903 When reading data from memory in sizes shorter than 64 bits, use (do not
11904 use) zero-extending load instructions by default, rather than
11905 sign-extending ones.
11906
11907 @item -mknuthdiv
11908 @itemx -mno-knuthdiv
11909 @opindex mknuthdiv
11910 @opindex mno-knuthdiv
11911 Make the result of a division yielding a remainder have the same sign as
11912 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
11913 remainder follows the sign of the dividend.  Both methods are
11914 arithmetically valid, the latter being almost exclusively used.
11915
11916 @item -mtoplevel-symbols
11917 @itemx -mno-toplevel-symbols
11918 @opindex mtoplevel-symbols
11919 @opindex mno-toplevel-symbols
11920 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
11921 code can be used with the @code{PREFIX} assembly directive.
11922
11923 @item -melf
11924 @opindex melf
11925 Generate an executable in the ELF format, rather than the default
11926 @samp{mmo} format used by the @command{mmix} simulator.
11927
11928 @item -mbranch-predict
11929 @itemx -mno-branch-predict
11930 @opindex mbranch-predict
11931 @opindex mno-branch-predict
11932 Use (do not use) the probable-branch instructions, when static branch
11933 prediction indicates a probable branch.
11934
11935 @item -mbase-addresses
11936 @itemx -mno-base-addresses
11937 @opindex mbase-addresses
11938 @opindex mno-base-addresses
11939 Generate (do not generate) code that uses @emph{base addresses}.  Using a
11940 base address automatically generates a request (handled by the assembler
11941 and the linker) for a constant to be set up in a global register.  The
11942 register is used for one or more base address requests within the range 0
11943 to 255 from the value held in the register.  The generally leads to short
11944 and fast code, but the number of different data items that can be
11945 addressed is limited.  This means that a program that uses lots of static
11946 data may require @option{-mno-base-addresses}.
11947
11948 @item -msingle-exit
11949 @itemx -mno-single-exit
11950 @opindex msingle-exit
11951 @opindex mno-single-exit
11952 Force (do not force) generated code to have a single exit point in each
11953 function.
11954 @end table
11955
11956 @node MN10300 Options
11957 @subsection MN10300 Options
11958 @cindex MN10300 options
11959
11960 These @option{-m} options are defined for Matsushita MN10300 architectures:
11961
11962 @table @gcctabopt
11963 @item -mmult-bug
11964 @opindex mmult-bug
11965 Generate code to avoid bugs in the multiply instructions for the MN10300
11966 processors.  This is the default.
11967
11968 @item -mno-mult-bug
11969 @opindex mno-mult-bug
11970 Do not generate code to avoid bugs in the multiply instructions for the
11971 MN10300 processors.
11972
11973 @item -mam33
11974 @opindex mam33
11975 Generate code which uses features specific to the AM33 processor.
11976
11977 @item -mno-am33
11978 @opindex mno-am33
11979 Do not generate code which uses features specific to the AM33 processor.  This
11980 is the default.
11981
11982 @item -mreturn-pointer-on-d0
11983 @opindex mreturn-pointer-on-d0
11984 When generating a function which returns a pointer, return the pointer
11985 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
11986 only in a0, and attempts to call such functions without a prototype
11987 would result in errors.  Note that this option is on by default; use
11988 @option{-mno-return-pointer-on-d0} to disable it.
11989
11990 @item -mno-crt0
11991 @opindex mno-crt0
11992 Do not link in the C run-time initialization object file.
11993
11994 @item -mrelax
11995 @opindex mrelax
11996 Indicate to the linker that it should perform a relaxation optimization pass
11997 to shorten branches, calls and absolute memory addresses.  This option only
11998 has an effect when used on the command line for the final link step.
11999
12000 This option makes symbolic debugging impossible.
12001 @end table
12002
12003 @node MT Options
12004 @subsection MT Options
12005 @cindex MT options
12006
12007 These @option{-m} options are defined for Morpho MT architectures:
12008
12009 @table @gcctabopt
12010
12011 @item -march=@var{cpu-type}
12012 @opindex march
12013 Generate code that will run on @var{cpu-type}, which is the name of a system
12014 representing a certain processor type.  Possible values for
12015 @var{cpu-type} are @samp{ms1-64-001}, @samp{ms1-16-002},
12016 @samp{ms1-16-003} and @samp{ms2}.
12017
12018 When this option is not used, the default is @option{-march=ms1-16-002}.
12019
12020 @item -mbacc
12021 @opindex mbacc
12022 Use byte loads and stores when generating code.
12023
12024 @item -mno-bacc
12025 @opindex mno-bacc
12026 Do not use byte loads and stores when generating code.
12027
12028 @item -msim
12029 @opindex msim
12030 Use simulator runtime
12031
12032 @item -mno-crt0
12033 @opindex mno-crt0
12034 Do not link in the C run-time initialization object file
12035 @file{crti.o}.  Other run-time initialization and termination files
12036 such as @file{startup.o} and @file{exit.o} are still included on the
12037 linker command line.
12038
12039 @end table
12040
12041 @node PDP-11 Options
12042 @subsection PDP-11 Options
12043 @cindex PDP-11 Options
12044
12045 These options are defined for the PDP-11:
12046
12047 @table @gcctabopt
12048 @item -mfpu
12049 @opindex mfpu
12050 Use hardware FPP floating point.  This is the default.  (FIS floating
12051 point on the PDP-11/40 is not supported.)
12052
12053 @item -msoft-float
12054 @opindex msoft-float
12055 Do not use hardware floating point.
12056
12057 @item -mac0
12058 @opindex mac0
12059 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
12060
12061 @item -mno-ac0
12062 @opindex mno-ac0
12063 Return floating-point results in memory.  This is the default.
12064
12065 @item -m40
12066 @opindex m40
12067 Generate code for a PDP-11/40.
12068
12069 @item -m45
12070 @opindex m45
12071 Generate code for a PDP-11/45.  This is the default.
12072
12073 @item -m10
12074 @opindex m10
12075 Generate code for a PDP-11/10.
12076
12077 @item -mbcopy-builtin
12078 @opindex bcopy-builtin
12079 Use inline @code{movmemhi} patterns for copying memory.  This is the
12080 default.
12081
12082 @item -mbcopy
12083 @opindex mbcopy
12084 Do not use inline @code{movmemhi} patterns for copying memory.
12085
12086 @item -mint16
12087 @itemx -mno-int32
12088 @opindex mint16
12089 @opindex mno-int32
12090 Use 16-bit @code{int}.  This is the default.
12091
12092 @item -mint32
12093 @itemx -mno-int16
12094 @opindex mint32
12095 @opindex mno-int16
12096 Use 32-bit @code{int}.
12097
12098 @item -mfloat64
12099 @itemx -mno-float32
12100 @opindex mfloat64
12101 @opindex mno-float32
12102 Use 64-bit @code{float}.  This is the default.
12103
12104 @item -mfloat32
12105 @itemx -mno-float64
12106 @opindex mfloat32
12107 @opindex mno-float64
12108 Use 32-bit @code{float}.
12109
12110 @item -mabshi
12111 @opindex mabshi
12112 Use @code{abshi2} pattern.  This is the default.
12113
12114 @item -mno-abshi
12115 @opindex mno-abshi
12116 Do not use @code{abshi2} pattern.
12117
12118 @item -mbranch-expensive
12119 @opindex mbranch-expensive
12120 Pretend that branches are expensive.  This is for experimenting with
12121 code generation only.
12122
12123 @item -mbranch-cheap
12124 @opindex mbranch-cheap
12125 Do not pretend that branches are expensive.  This is the default.
12126
12127 @item -msplit
12128 @opindex msplit
12129 Generate code for a system with split I&D@.
12130
12131 @item -mno-split
12132 @opindex mno-split
12133 Generate code for a system without split I&D@.  This is the default.
12134
12135 @item -munix-asm
12136 @opindex munix-asm
12137 Use Unix assembler syntax.  This is the default when configured for
12138 @samp{pdp11-*-bsd}.
12139
12140 @item -mdec-asm
12141 @opindex mdec-asm
12142 Use DEC assembler syntax.  This is the default when configured for any
12143 PDP-11 target other than @samp{pdp11-*-bsd}.
12144 @end table
12145
12146 @node PowerPC Options
12147 @subsection PowerPC Options
12148 @cindex PowerPC options
12149
12150 These are listed under @xref{RS/6000 and PowerPC Options}.
12151
12152 @node RS/6000 and PowerPC Options
12153 @subsection IBM RS/6000 and PowerPC Options
12154 @cindex RS/6000 and PowerPC Options
12155 @cindex IBM RS/6000 and PowerPC Options
12156
12157 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
12158 @table @gcctabopt
12159 @item -mpower
12160 @itemx -mno-power
12161 @itemx -mpower2
12162 @itemx -mno-power2
12163 @itemx -mpowerpc
12164 @itemx -mno-powerpc
12165 @itemx -mpowerpc-gpopt
12166 @itemx -mno-powerpc-gpopt
12167 @itemx -mpowerpc-gfxopt
12168 @itemx -mno-powerpc-gfxopt
12169 @itemx -mpowerpc64
12170 @itemx -mno-powerpc64
12171 @itemx -mmfcrf
12172 @itemx -mno-mfcrf
12173 @itemx -mpopcntb
12174 @itemx -mno-popcntb
12175 @itemx -mfprnd
12176 @itemx -mno-fprnd
12177 @itemx -mcmpb
12178 @itemx -mno-cmpb
12179 @itemx -mmfpgpr
12180 @itemx -mno-mfpgpr
12181 @itemx -mdfp
12182 @itemx -mno-dfp
12183 @opindex mpower
12184 @opindex mno-power
12185 @opindex mpower2
12186 @opindex mno-power2
12187 @opindex mpowerpc
12188 @opindex mno-powerpc
12189 @opindex mpowerpc-gpopt
12190 @opindex mno-powerpc-gpopt
12191 @opindex mpowerpc-gfxopt
12192 @opindex mno-powerpc-gfxopt
12193 @opindex mpowerpc64
12194 @opindex mno-powerpc64
12195 @opindex mmfcrf
12196 @opindex mno-mfcrf
12197 @opindex mpopcntb
12198 @opindex mno-popcntb
12199 @opindex mfprnd
12200 @opindex mno-fprnd
12201 @opindex mcmpb
12202 @opindex mno-cmpb
12203 @opindex mmfpgpr
12204 @opindex mno-mfpgpr
12205 @opindex mdfp
12206 @opindex mno-dfp
12207 GCC supports two related instruction set architectures for the
12208 RS/6000 and PowerPC@.  The @dfn{POWER} instruction set are those
12209 instructions supported by the @samp{rios} chip set used in the original
12210 RS/6000 systems and the @dfn{PowerPC} instruction set is the
12211 architecture of the Freescale MPC5xx, MPC6xx, MPC8xx microprocessors, and
12212 the IBM 4xx, 6xx, and follow-on microprocessors.
12213
12214 Neither architecture is a subset of the other.  However there is a
12215 large common subset of instructions supported by both.  An MQ
12216 register is included in processors supporting the POWER architecture.
12217
12218 You use these options to specify which instructions are available on the
12219 processor you are using.  The default value of these options is
12220 determined when configuring GCC@.  Specifying the
12221 @option{-mcpu=@var{cpu_type}} overrides the specification of these
12222 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
12223 rather than the options listed above.
12224
12225 The @option{-mpower} option allows GCC to generate instructions that
12226 are found only in the POWER architecture and to use the MQ register.
12227 Specifying @option{-mpower2} implies @option{-power} and also allows GCC
12228 to generate instructions that are present in the POWER2 architecture but
12229 not the original POWER architecture.
12230
12231 The @option{-mpowerpc} option allows GCC to generate instructions that
12232 are found only in the 32-bit subset of the PowerPC architecture.
12233 Specifying @option{-mpowerpc-gpopt} implies @option{-mpowerpc} and also allows
12234 GCC to use the optional PowerPC architecture instructions in the
12235 General Purpose group, including floating-point square root.  Specifying
12236 @option{-mpowerpc-gfxopt} implies @option{-mpowerpc} and also allows GCC to
12237 use the optional PowerPC architecture instructions in the Graphics
12238 group, including floating-point select.
12239
12240 The @option{-mmfcrf} option allows GCC to generate the move from
12241 condition register field instruction implemented on the POWER4
12242 processor and other processors that support the PowerPC V2.01
12243 architecture.
12244 The @option{-mpopcntb} option allows GCC to generate the popcount and
12245 double precision FP reciprocal estimate instruction implemented on the
12246 POWER5 processor and other processors that support the PowerPC V2.02
12247 architecture.
12248 The @option{-mfprnd} option allows GCC to generate the FP round to
12249 integer instructions implemented on the POWER5+ processor and other
12250 processors that support the PowerPC V2.03 architecture.
12251 The @option{-mcmpb} option allows GCC to generate the compare bytes
12252 instruction implemented on the POWER6 processor and other processors
12253 that support the PowerPC V2.05 architecture.
12254 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
12255 general purpose register instructions implemented on the POWER6X
12256 processor and other processors that support the extended PowerPC V2.05
12257 architecture.
12258 The @option{-mdfp} option allows GCC to generate the decimal floating
12259 point instructions implemented on some POWER processors.
12260
12261 The @option{-mpowerpc64} option allows GCC to generate the additional
12262 64-bit instructions that are found in the full PowerPC64 architecture
12263 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
12264 @option{-mno-powerpc64}.
12265
12266 If you specify both @option{-mno-power} and @option{-mno-powerpc}, GCC
12267 will use only the instructions in the common subset of both
12268 architectures plus some special AIX common-mode calls, and will not use
12269 the MQ register.  Specifying both @option{-mpower} and @option{-mpowerpc}
12270 permits GCC to use any instruction from either architecture and to
12271 allow use of the MQ register; specify this for the Motorola MPC601.
12272
12273 @item -mnew-mnemonics
12274 @itemx -mold-mnemonics
12275 @opindex mnew-mnemonics
12276 @opindex mold-mnemonics
12277 Select which mnemonics to use in the generated assembler code.  With
12278 @option{-mnew-mnemonics}, GCC uses the assembler mnemonics defined for
12279 the PowerPC architecture.  With @option{-mold-mnemonics} it uses the
12280 assembler mnemonics defined for the POWER architecture.  Instructions
12281 defined in only one architecture have only one mnemonic; GCC uses that
12282 mnemonic irrespective of which of these options is specified.
12283
12284 GCC defaults to the mnemonics appropriate for the architecture in
12285 use.  Specifying @option{-mcpu=@var{cpu_type}} sometimes overrides the
12286 value of these option.  Unless you are building a cross-compiler, you
12287 should normally not specify either @option{-mnew-mnemonics} or
12288 @option{-mold-mnemonics}, but should instead accept the default.
12289
12290 @item -mcpu=@var{cpu_type}
12291 @opindex mcpu
12292 Set architecture type, register usage, choice of mnemonics, and
12293 instruction scheduling parameters for machine type @var{cpu_type}.
12294 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
12295 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{505},
12296 @samp{601}, @samp{602}, @samp{603}, @samp{603e}, @samp{604},
12297 @samp{604e}, @samp{620}, @samp{630}, @samp{740}, @samp{7400},
12298 @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
12299 @samp{860}, @samp{970}, @samp{8540}, @samp{ec603e}, @samp{G3},
12300 @samp{G4}, @samp{G5}, @samp{power}, @samp{power2}, @samp{power3},
12301 @samp{power4}, @samp{power5}, @samp{power5+}, @samp{power6},
12302 @samp{power6x}, @samp{common}, @samp{powerpc}, @samp{powerpc64},
12303 @samp{rios}, @samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64}.
12304
12305 @option{-mcpu=common} selects a completely generic processor.  Code
12306 generated under this option will run on any POWER or PowerPC processor.
12307 GCC will use only the instructions in the common subset of both
12308 architectures, and will not use the MQ register.  GCC assumes a generic
12309 processor model for scheduling purposes.
12310
12311 @option{-mcpu=power}, @option{-mcpu=power2}, @option{-mcpu=powerpc}, and
12312 @option{-mcpu=powerpc64} specify generic POWER, POWER2, pure 32-bit
12313 PowerPC (i.e., not MPC601), and 64-bit PowerPC architecture machine
12314 types, with an appropriate, generic processor model assumed for
12315 scheduling purposes.
12316
12317 The other options specify a specific processor.  Code generated under
12318 those options will run best on that processor, and may not run at all on
12319 others.
12320
12321 The @option{-mcpu} options automatically enable or disable the
12322 following options:
12323
12324 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
12325 -mnew-mnemonics  -mpopcntb  -mpower  -mpower2  -mpowerpc64 @gol
12326 -mpowerpc-gpopt  -mpowerpc-gfxopt  -mstring  -mmulhw  -mdlmzb  -mmfpgpr}
12327
12328 The particular options set for any particular CPU will vary between
12329 compiler versions, depending on what setting seems to produce optimal
12330 code for that CPU; it doesn't necessarily reflect the actual hardware's
12331 capabilities.  If you wish to set an individual option to a particular
12332 value, you may specify it after the @option{-mcpu} option, like
12333 @samp{-mcpu=970 -mno-altivec}.
12334
12335 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
12336 not enabled or disabled by the @option{-mcpu} option at present because
12337 AIX does not have full support for these options.  You may still
12338 enable or disable them individually if you're sure it'll work in your
12339 environment.
12340
12341 @item -mtune=@var{cpu_type}
12342 @opindex mtune
12343 Set the instruction scheduling parameters for machine type
12344 @var{cpu_type}, but do not set the architecture type, register usage, or
12345 choice of mnemonics, as @option{-mcpu=@var{cpu_type}} would.  The same
12346 values for @var{cpu_type} are used for @option{-mtune} as for
12347 @option{-mcpu}.  If both are specified, the code generated will use the
12348 architecture, registers, and mnemonics set by @option{-mcpu}, but the
12349 scheduling parameters set by @option{-mtune}.
12350
12351 @item -mswdiv
12352 @itemx -mno-swdiv
12353 @opindex mswdiv
12354 @opindex mno-swdiv
12355 Generate code to compute division as reciprocal estimate and iterative
12356 refinement, creating opportunities for increased throughput.  This
12357 feature requires: optional PowerPC Graphics instruction set for single
12358 precision and FRE instruction for double precision, assuming divides
12359 cannot generate user-visible traps, and the domain values not include
12360 Infinities, denormals or zero denominator.
12361
12362 @item -maltivec
12363 @itemx -mno-altivec
12364 @opindex maltivec
12365 @opindex mno-altivec
12366 Generate code that uses (does not use) AltiVec instructions, and also
12367 enable the use of built-in functions that allow more direct access to
12368 the AltiVec instruction set.  You may also need to set
12369 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
12370 enhancements.
12371
12372 @item -mvrsave
12373 @item -mno-vrsave
12374 @opindex mvrsave
12375 @opindex mno-vrsave
12376 Generate VRSAVE instructions when generating AltiVec code.
12377
12378 @item -msecure-plt
12379 @opindex msecure-plt
12380 Generate code that allows ld and ld.so to build executables and shared
12381 libraries with non-exec .plt and .got sections.  This is a PowerPC
12382 32-bit SYSV ABI option.
12383
12384 @item -mbss-plt
12385 @opindex mbss-plt
12386 Generate code that uses a BSS .plt section that ld.so fills in, and
12387 requires .plt and .got sections that are both writable and executable.
12388 This is a PowerPC 32-bit SYSV ABI option.
12389
12390 @item -misel
12391 @itemx -mno-isel
12392 @opindex misel
12393 @opindex mno-isel
12394 This switch enables or disables the generation of ISEL instructions.
12395
12396 @item -misel=@var{yes/no}
12397 This switch has been deprecated.  Use @option{-misel} and
12398 @option{-mno-isel} instead.
12399
12400 @item -mspe
12401 @itemx -mno-spe
12402 @opindex mspe
12403 @opindex mno-spe
12404 This switch enables or disables the generation of SPE simd
12405 instructions.
12406
12407 @item -mspe=@var{yes/no}
12408 This option has been deprecated.  Use @option{-mspe} and
12409 @option{-mno-spe} instead.
12410
12411 @item -mfloat-gprs=@var{yes/single/double/no}
12412 @itemx -mfloat-gprs
12413 @opindex mfloat-gprs
12414 This switch enables or disables the generation of floating point
12415 operations on the general purpose registers for architectures that
12416 support it.
12417
12418 The argument @var{yes} or @var{single} enables the use of
12419 single-precision floating point operations.
12420
12421 The argument @var{double} enables the use of single and
12422 double-precision floating point operations.
12423
12424 The argument @var{no} disables floating point operations on the
12425 general purpose registers.
12426
12427 This option is currently only available on the MPC854x.
12428
12429 @item -m32
12430 @itemx -m64
12431 @opindex m32
12432 @opindex m64
12433 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
12434 targets (including GNU/Linux).  The 32-bit environment sets int, long
12435 and pointer to 32 bits and generates code that runs on any PowerPC
12436 variant.  The 64-bit environment sets int to 32 bits and long and
12437 pointer to 64 bits, and generates code for PowerPC64, as for
12438 @option{-mpowerpc64}.
12439
12440 @item -mfull-toc
12441 @itemx -mno-fp-in-toc
12442 @itemx -mno-sum-in-toc
12443 @itemx -mminimal-toc
12444 @opindex mfull-toc
12445 @opindex mno-fp-in-toc
12446 @opindex mno-sum-in-toc
12447 @opindex mminimal-toc
12448 Modify generation of the TOC (Table Of Contents), which is created for
12449 every executable file.  The @option{-mfull-toc} option is selected by
12450 default.  In that case, GCC will allocate at least one TOC entry for
12451 each unique non-automatic variable reference in your program.  GCC
12452 will also place floating-point constants in the TOC@.  However, only
12453 16,384 entries are available in the TOC@.
12454
12455 If you receive a linker error message that saying you have overflowed
12456 the available TOC space, you can reduce the amount of TOC space used
12457 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
12458 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
12459 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
12460 generate code to calculate the sum of an address and a constant at
12461 run-time instead of putting that sum into the TOC@.  You may specify one
12462 or both of these options.  Each causes GCC to produce very slightly
12463 slower and larger code at the expense of conserving TOC space.
12464
12465 If you still run out of space in the TOC even when you specify both of
12466 these options, specify @option{-mminimal-toc} instead.  This option causes
12467 GCC to make only one TOC entry for every file.  When you specify this
12468 option, GCC will produce code that is slower and larger but which
12469 uses extremely little TOC space.  You may wish to use this option
12470 only on files that contain less frequently executed code.
12471
12472 @item -maix64
12473 @itemx -maix32
12474 @opindex maix64
12475 @opindex maix32
12476 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
12477 @code{long} type, and the infrastructure needed to support them.
12478 Specifying @option{-maix64} implies @option{-mpowerpc64} and
12479 @option{-mpowerpc}, while @option{-maix32} disables the 64-bit ABI and
12480 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
12481
12482 @item -mxl-compat
12483 @itemx -mno-xl-compat
12484 @opindex mxl-compat
12485 @opindex mno-xl-compat
12486 Produce code that conforms more closely to IBM XL compiler semantics
12487 when using AIX-compatible ABI.  Pass floating-point arguments to
12488 prototyped functions beyond the register save area (RSA) on the stack
12489 in addition to argument FPRs.  Do not assume that most significant
12490 double in 128-bit long double value is properly rounded when comparing
12491 values and converting to double.  Use XL symbol names for long double
12492 support routines.
12493
12494 The AIX calling convention was extended but not initially documented to
12495 handle an obscure K&R C case of calling a function that takes the
12496 address of its arguments with fewer arguments than declared.  IBM XL
12497 compilers access floating point arguments which do not fit in the
12498 RSA from the stack when a subroutine is compiled without
12499 optimization.  Because always storing floating-point arguments on the
12500 stack is inefficient and rarely needed, this option is not enabled by
12501 default and only is necessary when calling subroutines compiled by IBM
12502 XL compilers without optimization.
12503
12504 @item -mpe
12505 @opindex mpe
12506 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
12507 application written to use message passing with special startup code to
12508 enable the application to run.  The system must have PE installed in the
12509 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
12510 must be overridden with the @option{-specs=} option to specify the
12511 appropriate directory location.  The Parallel Environment does not
12512 support threads, so the @option{-mpe} option and the @option{-pthread}
12513 option are incompatible.
12514
12515 @item -malign-natural
12516 @itemx -malign-power
12517 @opindex malign-natural
12518 @opindex malign-power
12519 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
12520 @option{-malign-natural} overrides the ABI-defined alignment of larger
12521 types, such as floating-point doubles, on their natural size-based boundary.
12522 The option @option{-malign-power} instructs GCC to follow the ABI-specified
12523 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
12524
12525 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
12526 is not supported.
12527
12528 @item -msoft-float
12529 @itemx -mhard-float
12530 @opindex msoft-float
12531 @opindex mhard-float
12532 Generate code that does not use (uses) the floating-point register set.
12533 Software floating point emulation is provided if you use the
12534 @option{-msoft-float} option, and pass the option to GCC when linking.
12535
12536 @item -mmultiple
12537 @itemx -mno-multiple
12538 @opindex mmultiple
12539 @opindex mno-multiple
12540 Generate code that uses (does not use) the load multiple word
12541 instructions and the store multiple word instructions.  These
12542 instructions are generated by default on POWER systems, and not
12543 generated on PowerPC systems.  Do not use @option{-mmultiple} on little
12544 endian PowerPC systems, since those instructions do not work when the
12545 processor is in little endian mode.  The exceptions are PPC740 and
12546 PPC750 which permit the instructions usage in little endian mode.
12547
12548 @item -mstring
12549 @itemx -mno-string
12550 @opindex mstring
12551 @opindex mno-string
12552 Generate code that uses (does not use) the load string instructions
12553 and the store string word instructions to save multiple registers and
12554 do small block moves.  These instructions are generated by default on
12555 POWER systems, and not generated on PowerPC systems.  Do not use
12556 @option{-mstring} on little endian PowerPC systems, since those
12557 instructions do not work when the processor is in little endian mode.
12558 The exceptions are PPC740 and PPC750 which permit the instructions
12559 usage in little endian mode.
12560
12561 @item -mupdate
12562 @itemx -mno-update
12563 @opindex mupdate
12564 @opindex mno-update
12565 Generate code that uses (does not use) the load or store instructions
12566 that update the base register to the address of the calculated memory
12567 location.  These instructions are generated by default.  If you use
12568 @option{-mno-update}, there is a small window between the time that the
12569 stack pointer is updated and the address of the previous frame is
12570 stored, which means code that walks the stack frame across interrupts or
12571 signals may get corrupted data.
12572
12573 @item -mfused-madd
12574 @itemx -mno-fused-madd
12575 @opindex mfused-madd
12576 @opindex mno-fused-madd
12577 Generate code that uses (does not use) the floating point multiply and
12578 accumulate instructions.  These instructions are generated by default if
12579 hardware floating is used.
12580
12581 @item -mmulhw
12582 @itemx -mno-mulhw
12583 @opindex mmulhw
12584 @opindex mno-mulhw
12585 Generate code that uses (does not use) the half-word multiply and
12586 multiply-accumulate instructions on the IBM 405 and 440 processors.
12587 These instructions are generated by default when targetting those
12588 processors.
12589
12590 @item -mdlmzb
12591 @itemx -mno-dlmzb
12592 @opindex mdlmzb
12593 @opindex mno-dlmzb
12594 Generate code that uses (does not use) the string-search @samp{dlmzb}
12595 instruction on the IBM 405 and 440 processors.  This instruction is
12596 generated by default when targetting those processors.
12597
12598 @item -mno-bit-align
12599 @itemx -mbit-align
12600 @opindex mno-bit-align
12601 @opindex mbit-align
12602 On System V.4 and embedded PowerPC systems do not (do) force structures
12603 and unions that contain bit-fields to be aligned to the base type of the
12604 bit-field.
12605
12606 For example, by default a structure containing nothing but 8
12607 @code{unsigned} bit-fields of length 1 would be aligned to a 4 byte
12608 boundary and have a size of 4 bytes.  By using @option{-mno-bit-align},
12609 the structure would be aligned to a 1 byte boundary and be one byte in
12610 size.
12611
12612 @item -mno-strict-align
12613 @itemx -mstrict-align
12614 @opindex mno-strict-align
12615 @opindex mstrict-align
12616 On System V.4 and embedded PowerPC systems do not (do) assume that
12617 unaligned memory references will be handled by the system.
12618
12619 @item -mrelocatable
12620 @itemx -mno-relocatable
12621 @opindex mrelocatable
12622 @opindex mno-relocatable
12623 On embedded PowerPC systems generate code that allows (does not allow)
12624 the program to be relocated to a different address at runtime.  If you
12625 use @option{-mrelocatable} on any module, all objects linked together must
12626 be compiled with @option{-mrelocatable} or @option{-mrelocatable-lib}.
12627
12628 @item -mrelocatable-lib
12629 @itemx -mno-relocatable-lib
12630 @opindex mrelocatable-lib
12631 @opindex mno-relocatable-lib
12632 On embedded PowerPC systems generate code that allows (does not allow)
12633 the program to be relocated to a different address at runtime.  Modules
12634 compiled with @option{-mrelocatable-lib} can be linked with either modules
12635 compiled without @option{-mrelocatable} and @option{-mrelocatable-lib} or
12636 with modules compiled with the @option{-mrelocatable} options.
12637
12638 @item -mno-toc
12639 @itemx -mtoc
12640 @opindex mno-toc
12641 @opindex mtoc
12642 On System V.4 and embedded PowerPC systems do not (do) assume that
12643 register 2 contains a pointer to a global area pointing to the addresses
12644 used in the program.
12645
12646 @item -mlittle
12647 @itemx -mlittle-endian
12648 @opindex mlittle
12649 @opindex mlittle-endian
12650 On System V.4 and embedded PowerPC systems compile code for the
12651 processor in little endian mode.  The @option{-mlittle-endian} option is
12652 the same as @option{-mlittle}.
12653
12654 @item -mbig
12655 @itemx -mbig-endian
12656 @opindex mbig
12657 @opindex mbig-endian
12658 On System V.4 and embedded PowerPC systems compile code for the
12659 processor in big endian mode.  The @option{-mbig-endian} option is
12660 the same as @option{-mbig}.
12661
12662 @item -mdynamic-no-pic
12663 @opindex mdynamic-no-pic
12664 On Darwin and Mac OS X systems, compile code so that it is not
12665 relocatable, but that its external references are relocatable.  The
12666 resulting code is suitable for applications, but not shared
12667 libraries.
12668
12669 @item -mprioritize-restricted-insns=@var{priority}
12670 @opindex mprioritize-restricted-insns
12671 This option controls the priority that is assigned to
12672 dispatch-slot restricted instructions during the second scheduling
12673 pass.  The argument @var{priority} takes the value @var{0/1/2} to assign
12674 @var{no/highest/second-highest} priority to dispatch slot restricted
12675 instructions.
12676
12677 @item -msched-costly-dep=@var{dependence_type}
12678 @opindex msched-costly-dep
12679 This option controls which dependences are considered costly
12680 by the target during instruction scheduling.  The argument
12681 @var{dependence_type} takes one of the following values:
12682 @var{no}: no dependence is costly,
12683 @var{all}: all dependences are costly,
12684 @var{true_store_to_load}: a true dependence from store to load is costly,
12685 @var{store_to_load}: any dependence from store to load is costly,
12686 @var{number}: any dependence which latency >= @var{number} is costly.
12687
12688 @item -minsert-sched-nops=@var{scheme}
12689 @opindex minsert-sched-nops
12690 This option controls which nop insertion scheme will be used during
12691 the second scheduling pass.  The argument @var{scheme} takes one of the
12692 following values:
12693 @var{no}: Don't insert nops.
12694 @var{pad}: Pad with nops any dispatch group which has vacant issue slots,
12695 according to the scheduler's grouping.
12696 @var{regroup_exact}: Insert nops to force costly dependent insns into
12697 separate groups.  Insert exactly as many nops as needed to force an insn
12698 to a new group, according to the estimated processor grouping.
12699 @var{number}: Insert nops to force costly dependent insns into
12700 separate groups.  Insert @var{number} nops to force an insn to a new group.
12701
12702 @item -mcall-sysv
12703 @opindex mcall-sysv
12704 On System V.4 and embedded PowerPC systems compile code using calling
12705 conventions that adheres to the March 1995 draft of the System V
12706 Application Binary Interface, PowerPC processor supplement.  This is the
12707 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
12708
12709 @item -mcall-sysv-eabi
12710 @opindex mcall-sysv-eabi
12711 Specify both @option{-mcall-sysv} and @option{-meabi} options.
12712
12713 @item -mcall-sysv-noeabi
12714 @opindex mcall-sysv-noeabi
12715 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
12716
12717 @item -mcall-solaris
12718 @opindex mcall-solaris
12719 On System V.4 and embedded PowerPC systems compile code for the Solaris
12720 operating system.
12721
12722 @item -mcall-linux
12723 @opindex mcall-linux
12724 On System V.4 and embedded PowerPC systems compile code for the
12725 Linux-based GNU system.
12726
12727 @item -mcall-gnu
12728 @opindex mcall-gnu
12729 On System V.4 and embedded PowerPC systems compile code for the
12730 Hurd-based GNU system.
12731
12732 @item -mcall-netbsd
12733 @opindex mcall-netbsd
12734 On System V.4 and embedded PowerPC systems compile code for the
12735 NetBSD operating system.
12736
12737 @item -maix-struct-return
12738 @opindex maix-struct-return
12739 Return all structures in memory (as specified by the AIX ABI)@.
12740
12741 @item -msvr4-struct-return
12742 @opindex msvr4-struct-return
12743 Return structures smaller than 8 bytes in registers (as specified by the
12744 SVR4 ABI)@.
12745
12746 @item -mabi=@var{abi-type}
12747 @opindex mabi
12748 Extend the current ABI with a particular extension, or remove such extension.
12749 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
12750 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble}@.
12751
12752 @item -mabi=spe
12753 @opindex mabi=spe
12754 Extend the current ABI with SPE ABI extensions.  This does not change
12755 the default ABI, instead it adds the SPE ABI extensions to the current
12756 ABI@.
12757
12758 @item -mabi=no-spe
12759 @opindex mabi=no-spe
12760 Disable Booke SPE ABI extensions for the current ABI@.
12761
12762 @item -mabi=ibmlongdouble
12763 @opindex mabi=ibmlongdouble
12764 Change the current ABI to use IBM extended precision long double.
12765 This is a PowerPC 32-bit SYSV ABI option.
12766
12767 @item -mabi=ieeelongdouble
12768 @opindex mabi=ieeelongdouble
12769 Change the current ABI to use IEEE extended precision long double.
12770 This is a PowerPC 32-bit Linux ABI option.
12771
12772 @item -mprototype
12773 @itemx -mno-prototype
12774 @opindex mprototype
12775 @opindex mno-prototype
12776 On System V.4 and embedded PowerPC systems assume that all calls to
12777 variable argument functions are properly prototyped.  Otherwise, the
12778 compiler must insert an instruction before every non prototyped call to
12779 set or clear bit 6 of the condition code register (@var{CR}) to
12780 indicate whether floating point values were passed in the floating point
12781 registers in case the function takes a variable arguments.  With
12782 @option{-mprototype}, only calls to prototyped variable argument functions
12783 will set or clear the bit.
12784
12785 @item -msim
12786 @opindex msim
12787 On embedded PowerPC systems, assume that the startup module is called
12788 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
12789 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}.
12790 configurations.
12791
12792 @item -mmvme
12793 @opindex mmvme
12794 On embedded PowerPC systems, assume that the startup module is called
12795 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
12796 @file{libc.a}.
12797
12798 @item -mads
12799 @opindex mads
12800 On embedded PowerPC systems, assume that the startup module is called
12801 @file{crt0.o} and the standard C libraries are @file{libads.a} and
12802 @file{libc.a}.
12803
12804 @item -myellowknife
12805 @opindex myellowknife
12806 On embedded PowerPC systems, assume that the startup module is called
12807 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
12808 @file{libc.a}.
12809
12810 @item -mvxworks
12811 @opindex mvxworks
12812 On System V.4 and embedded PowerPC systems, specify that you are
12813 compiling for a VxWorks system.
12814
12815 @item -mwindiss
12816 @opindex mwindiss
12817 Specify that you are compiling for the WindISS simulation environment.
12818
12819 @item -memb
12820 @opindex memb
12821 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
12822 header to indicate that @samp{eabi} extended relocations are used.
12823
12824 @item -meabi
12825 @itemx -mno-eabi
12826 @opindex meabi
12827 @opindex mno-eabi
12828 On System V.4 and embedded PowerPC systems do (do not) adhere to the
12829 Embedded Applications Binary Interface (eabi) which is a set of
12830 modifications to the System V.4 specifications.  Selecting @option{-meabi}
12831 means that the stack is aligned to an 8 byte boundary, a function
12832 @code{__eabi} is called to from @code{main} to set up the eabi
12833 environment, and the @option{-msdata} option can use both @code{r2} and
12834 @code{r13} to point to two separate small data areas.  Selecting
12835 @option{-mno-eabi} means that the stack is aligned to a 16 byte boundary,
12836 do not call an initialization function from @code{main}, and the
12837 @option{-msdata} option will only use @code{r13} to point to a single
12838 small data area.  The @option{-meabi} option is on by default if you
12839 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
12840
12841 @item -msdata=eabi
12842 @opindex msdata=eabi
12843 On System V.4 and embedded PowerPC systems, put small initialized
12844 @code{const} global and static data in the @samp{.sdata2} section, which
12845 is pointed to by register @code{r2}.  Put small initialized
12846 non-@code{const} global and static data in the @samp{.sdata} section,
12847 which is pointed to by register @code{r13}.  Put small uninitialized
12848 global and static data in the @samp{.sbss} section, which is adjacent to
12849 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
12850 incompatible with the @option{-mrelocatable} option.  The
12851 @option{-msdata=eabi} option also sets the @option{-memb} option.
12852
12853 @item -msdata=sysv
12854 @opindex msdata=sysv
12855 On System V.4 and embedded PowerPC systems, put small global and static
12856 data in the @samp{.sdata} section, which is pointed to by register
12857 @code{r13}.  Put small uninitialized global and static data in the
12858 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
12859 The @option{-msdata=sysv} option is incompatible with the
12860 @option{-mrelocatable} option.
12861
12862 @item -msdata=default
12863 @itemx -msdata
12864 @opindex msdata=default
12865 @opindex msdata
12866 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
12867 compile code the same as @option{-msdata=eabi}, otherwise compile code the
12868 same as @option{-msdata=sysv}.
12869
12870 @item -msdata-data
12871 @opindex msdata-data
12872 On System V.4 and embedded PowerPC systems, put small global
12873 data in the @samp{.sdata} section.  Put small uninitialized global
12874 data in the @samp{.sbss} section.  Do not use register @code{r13}
12875 to address small data however.  This is the default behavior unless
12876 other @option{-msdata} options are used.
12877
12878 @item -msdata=none
12879 @itemx -mno-sdata
12880 @opindex msdata=none
12881 @opindex mno-sdata
12882 On embedded PowerPC systems, put all initialized global and static data
12883 in the @samp{.data} section, and all uninitialized data in the
12884 @samp{.bss} section.
12885
12886 @item -G @var{num}
12887 @opindex G
12888 @cindex smaller data references (PowerPC)
12889 @cindex .sdata/.sdata2 references (PowerPC)
12890 On embedded PowerPC systems, put global and static items less than or
12891 equal to @var{num} bytes into the small data or bss sections instead of
12892 the normal data or bss section.  By default, @var{num} is 8.  The
12893 @option{-G @var{num}} switch is also passed to the linker.
12894 All modules should be compiled with the same @option{-G @var{num}} value.
12895
12896 @item -mregnames
12897 @itemx -mno-regnames
12898 @opindex mregnames
12899 @opindex mno-regnames
12900 On System V.4 and embedded PowerPC systems do (do not) emit register
12901 names in the assembly language output using symbolic forms.
12902
12903 @item -mlongcall
12904 @itemx -mno-longcall
12905 @opindex mlongcall
12906 @opindex mno-longcall
12907 By default assume that all calls are far away so that a longer more
12908 expensive calling sequence is required.  This is required for calls
12909 further than 32 megabytes (33,554,432 bytes) from the current location.
12910 A short call will be generated if the compiler knows
12911 the call cannot be that far away.  This setting can be overridden by
12912 the @code{shortcall} function attribute, or by @code{#pragma
12913 longcall(0)}.
12914
12915 Some linkers are capable of detecting out-of-range calls and generating
12916 glue code on the fly.  On these systems, long calls are unnecessary and
12917 generate slower code.  As of this writing, the AIX linker can do this,
12918 as can the GNU linker for PowerPC/64.  It is planned to add this feature
12919 to the GNU linker for 32-bit PowerPC systems as well.
12920
12921 On Darwin/PPC systems, @code{#pragma longcall} will generate ``jbsr
12922 callee, L42'', plus a ``branch island'' (glue code).  The two target
12923 addresses represent the callee and the ``branch island''.  The
12924 Darwin/PPC linker will prefer the first address and generate a ``bl
12925 callee'' if the PPC ``bl'' instruction will reach the callee directly;
12926 otherwise, the linker will generate ``bl L42'' to call the ``branch
12927 island''.  The ``branch island'' is appended to the body of the
12928 calling function; it computes the full 32-bit address of the callee
12929 and jumps to it.
12930
12931 On Mach-O (Darwin) systems, this option directs the compiler emit to
12932 the glue for every direct call, and the Darwin linker decides whether
12933 to use or discard it.
12934
12935 In the future, we may cause GCC to ignore all longcall specifications
12936 when the linker is known to generate glue.
12937
12938 @item -pthread
12939 @opindex pthread
12940 Adds support for multithreading with the @dfn{pthreads} library.
12941 This option sets flags for both the preprocessor and linker.
12942
12943 @end table
12944
12945 @node S/390 and zSeries Options
12946 @subsection S/390 and zSeries Options
12947 @cindex S/390 and zSeries Options
12948
12949 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
12950
12951 @table @gcctabopt
12952 @item -mhard-float
12953 @itemx -msoft-float
12954 @opindex mhard-float
12955 @opindex msoft-float
12956 Use (do not use) the hardware floating-point instructions and registers
12957 for floating-point operations.  When @option{-msoft-float} is specified,
12958 functions in @file{libgcc.a} will be used to perform floating-point
12959 operations.  When @option{-mhard-float} is specified, the compiler
12960 generates IEEE floating-point instructions.  This is the default.
12961
12962 @item -mlong-double-64
12963 @itemx -mlong-double-128
12964 @opindex mlong-double-64
12965 @opindex mlong-double-128
12966 These switches control the size of @code{long double} type. A size
12967 of 64bit makes the @code{long double} type equivalent to the @code{double}
12968 type. This is the default.
12969
12970 @item -mbackchain
12971 @itemx -mno-backchain
12972 @opindex mbackchain
12973 @opindex mno-backchain
12974 Store (do not store) the address of the caller's frame as backchain pointer
12975 into the callee's stack frame.
12976 A backchain may be needed to allow debugging using tools that do not understand
12977 DWARF-2 call frame information.
12978 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
12979 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
12980 the backchain is placed into the topmost word of the 96/160 byte register
12981 save area.
12982
12983 In general, code compiled with @option{-mbackchain} is call-compatible with
12984 code compiled with @option{-mmo-backchain}; however, use of the backchain
12985 for debugging purposes usually requires that the whole binary is built with
12986 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
12987 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
12988 to build a linux kernel use @option{-msoft-float}.
12989
12990 The default is to not maintain the backchain.
12991
12992 @item -mpacked-stack
12993 @item -mno-packed-stack
12994 @opindex mpacked-stack
12995 @opindex mno-packed-stack
12996 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
12997 specified, the compiler uses the all fields of the 96/160 byte register save
12998 area only for their default purpose; unused fields still take up stack space.
12999 When @option{-mpacked-stack} is specified, register save slots are densely
13000 packed at the top of the register save area; unused space is reused for other
13001 purposes, allowing for more efficient use of the available stack space.
13002 However, when @option{-mbackchain} is also in effect, the topmost word of
13003 the save area is always used to store the backchain, and the return address
13004 register is always saved two words below the backchain.
13005
13006 As long as the stack frame backchain is not used, code generated with
13007 @option{-mpacked-stack} is call-compatible with code generated with
13008 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
13009 S/390 or zSeries generated code that uses the stack frame backchain at run
13010 time, not just for debugging purposes.  Such code is not call-compatible
13011 with code compiled with @option{-mpacked-stack}.  Also, note that the
13012 combination of @option{-mbackchain},
13013 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
13014 to build a linux kernel use @option{-msoft-float}.
13015
13016 The default is to not use the packed stack layout.
13017
13018 @item -msmall-exec
13019 @itemx -mno-small-exec
13020 @opindex msmall-exec
13021 @opindex mno-small-exec
13022 Generate (or do not generate) code using the @code{bras} instruction
13023 to do subroutine calls.
13024 This only works reliably if the total executable size does not
13025 exceed 64k.  The default is to use the @code{basr} instruction instead,
13026 which does not have this limitation.
13027
13028 @item -m64
13029 @itemx -m31
13030 @opindex m64
13031 @opindex m31
13032 When @option{-m31} is specified, generate code compliant to the
13033 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
13034 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
13035 particular to generate 64-bit instructions.  For the @samp{s390}
13036 targets, the default is @option{-m31}, while the @samp{s390x}
13037 targets default to @option{-m64}.
13038
13039 @item -mzarch
13040 @itemx -mesa
13041 @opindex mzarch
13042 @opindex mesa
13043 When @option{-mzarch} is specified, generate code using the
13044 instructions available on z/Architecture.
13045 When @option{-mesa} is specified, generate code using the
13046 instructions available on ESA/390.  Note that @option{-mesa} is
13047 not possible with @option{-m64}.
13048 When generating code compliant to the GNU/Linux for S/390 ABI,
13049 the default is @option{-mesa}.  When generating code compliant
13050 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
13051
13052 @item -mmvcle
13053 @itemx -mno-mvcle
13054 @opindex mmvcle
13055 @opindex mno-mvcle
13056 Generate (or do not generate) code using the @code{mvcle} instruction
13057 to perform block moves.  When @option{-mno-mvcle} is specified,
13058 use a @code{mvc} loop instead.  This is the default unless optimizing for
13059 size.
13060
13061 @item -mdebug
13062 @itemx -mno-debug
13063 @opindex mdebug
13064 @opindex mno-debug
13065 Print (or do not print) additional debug information when compiling.
13066 The default is to not print debug information.
13067
13068 @item -march=@var{cpu-type}
13069 @opindex march
13070 Generate code that will run on @var{cpu-type}, which is the name of a system
13071 representing a certain processor type.  Possible values for
13072 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, and @samp{z990}.
13073 When generating code using the instructions available on z/Architecture,
13074 the default is @option{-march=z900}.  Otherwise, the default is
13075 @option{-march=g5}.
13076
13077 @item -mtune=@var{cpu-type}
13078 @opindex mtune
13079 Tune to @var{cpu-type} everything applicable about the generated code,
13080 except for the ABI and the set of available instructions.
13081 The list of @var{cpu-type} values is the same as for @option{-march}.
13082 The default is the value used for @option{-march}.
13083
13084 @item -mtpf-trace
13085 @itemx -mno-tpf-trace
13086 @opindex mtpf-trace
13087 @opindex mno-tpf-trace
13088 Generate code that adds (does not add) in TPF OS specific branches to trace
13089 routines in the operating system.  This option is off by default, even
13090 when compiling for the TPF OS@.
13091
13092 @item -mfused-madd
13093 @itemx -mno-fused-madd
13094 @opindex mfused-madd
13095 @opindex mno-fused-madd
13096 Generate code that uses (does not use) the floating point multiply and
13097 accumulate instructions.  These instructions are generated by default if
13098 hardware floating point is used.
13099
13100 @item -mwarn-framesize=@var{framesize}
13101 @opindex mwarn-framesize
13102 Emit a warning if the current function exceeds the given frame size.  Because
13103 this is a compile time check it doesn't need to be a real problem when the program
13104 runs.  It is intended to identify functions which most probably cause
13105 a stack overflow.  It is useful to be used in an environment with limited stack
13106 size e.g.@: the linux kernel.
13107
13108 @item -mwarn-dynamicstack
13109 @opindex mwarn-dynamicstack
13110 Emit a warning if the function calls alloca or uses dynamically
13111 sized arrays.  This is generally a bad idea with a limited stack size.
13112
13113 @item -mstack-guard=@var{stack-guard}
13114 @item -mstack-size=@var{stack-size}
13115 @opindex mstack-guard
13116 @opindex mstack-size
13117 If these options are provided the s390 back end emits additional instructions in
13118 the function prologue which trigger a trap if the stack size is @var{stack-guard}
13119 bytes above the @var{stack-size} (remember that the stack on s390 grows downward).
13120 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
13121 the frame size of the compiled function is chosen.
13122 These options are intended to be used to help debugging stack overflow problems.
13123 The additionally emitted code causes only little overhead and hence can also be
13124 used in production like systems without greater performance degradation.  The given
13125 values have to be exact powers of 2 and @var{stack-size} has to be greater than
13126 @var{stack-guard} without exceeding 64k.
13127 In order to be efficient the extra code makes the assumption that the stack starts
13128 at an address aligned to the value given by @var{stack-size}.
13129 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
13130 @end table
13131
13132 @node Score Options
13133 @subsection Score Options
13134 @cindex Score Options
13135
13136 These options are defined for Score implementations:
13137
13138 @table @gcctabopt
13139 @item -meb
13140 @opindex meb
13141 Compile code for big endian mode.  This is the default.
13142
13143 @item -mel
13144 @opindex mel
13145 Compile code for little endian mode. 
13146
13147 @item -mnhwloop
13148 @opindex mnhwloop
13149 Disable generate bcnz instruction.
13150
13151 @item -muls
13152 @opindex muls
13153 Enable generate unaligned load and store instruction.
13154
13155 @item -mmac
13156 @opindex mmac
13157 Enable the use of multiply-accumulate instructions. Disabled by default. 
13158
13159 @item -mscore5
13160 @opindex mscore5
13161 Specify the SCORE5 as the target architecture.
13162
13163 @item -mscore5u
13164 @opindex mscore5u
13165 Specify the SCORE5U of the target architecture.
13166
13167 @item -mscore7
13168 @opindex mscore7
13169 Specify the SCORE7 as the target architecture. This is the default.
13170
13171 @item -mscore7d
13172 @opindex mscore7d
13173 Specify the SCORE7D as the target architecture.
13174 @end table
13175
13176 @node SH Options
13177 @subsection SH Options
13178
13179 These @samp{-m} options are defined for the SH implementations:
13180
13181 @table @gcctabopt
13182 @item -m1
13183 @opindex m1
13184 Generate code for the SH1.
13185
13186 @item -m2
13187 @opindex m2
13188 Generate code for the SH2.
13189
13190 @item -m2e
13191 Generate code for the SH2e.
13192
13193 @item -m3
13194 @opindex m3
13195 Generate code for the SH3.
13196
13197 @item -m3e
13198 @opindex m3e
13199 Generate code for the SH3e.
13200
13201 @item -m4-nofpu
13202 @opindex m4-nofpu
13203 Generate code for the SH4 without a floating-point unit.
13204
13205 @item -m4-single-only
13206 @opindex m4-single-only
13207 Generate code for the SH4 with a floating-point unit that only
13208 supports single-precision arithmetic.
13209
13210 @item -m4-single
13211 @opindex m4-single
13212 Generate code for the SH4 assuming the floating-point unit is in
13213 single-precision mode by default.
13214
13215 @item -m4
13216 @opindex m4
13217 Generate code for the SH4.
13218
13219 @item -m4a-nofpu
13220 @opindex m4a-nofpu
13221 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
13222 floating-point unit is not used.
13223
13224 @item -m4a-single-only
13225 @opindex m4a-single-only
13226 Generate code for the SH4a, in such a way that no double-precision
13227 floating point operations are used.
13228
13229 @item -m4a-single
13230 @opindex m4a-single
13231 Generate code for the SH4a assuming the floating-point unit is in
13232 single-precision mode by default.
13233
13234 @item -m4a
13235 @opindex m4a
13236 Generate code for the SH4a.
13237
13238 @item -m4al
13239 @opindex m4al
13240 Same as @option{-m4a-nofpu}, except that it implicitly passes
13241 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
13242 instructions at the moment.
13243
13244 @item -mb
13245 @opindex mb
13246 Compile code for the processor in big endian mode.
13247
13248 @item -ml
13249 @opindex ml
13250 Compile code for the processor in little endian mode.
13251
13252 @item -mdalign
13253 @opindex mdalign
13254 Align doubles at 64-bit boundaries.  Note that this changes the calling
13255 conventions, and thus some functions from the standard C library will
13256 not work unless you recompile it first with @option{-mdalign}.
13257
13258 @item -mrelax
13259 @opindex mrelax
13260 Shorten some address references at link time, when possible; uses the
13261 linker option @option{-relax}.
13262
13263 @item -mbigtable
13264 @opindex mbigtable
13265 Use 32-bit offsets in @code{switch} tables.  The default is to use
13266 16-bit offsets.
13267
13268 @item -mfmovd
13269 @opindex mfmovd
13270 Enable the use of the instruction @code{fmovd}.
13271
13272 @item -mhitachi
13273 @opindex mhitachi
13274 Comply with the calling conventions defined by Renesas.
13275
13276 @item -mrenesas
13277 @opindex mhitachi
13278 Comply with the calling conventions defined by Renesas.
13279
13280 @item -mno-renesas
13281 @opindex mhitachi
13282 Comply with the calling conventions defined for GCC before the Renesas
13283 conventions were available.  This option is the default for all
13284 targets of the SH toolchain except for @samp{sh-symbianelf}.
13285
13286 @item -mnomacsave
13287 @opindex mnomacsave
13288 Mark the @code{MAC} register as call-clobbered, even if
13289 @option{-mhitachi} is given.
13290
13291 @item -mieee
13292 @opindex mieee
13293 Increase IEEE-compliance of floating-point code.
13294 At the moment, this is equivalent to @option{-fno-finite-math-only}.
13295 When generating 16 bit SH opcodes, getting IEEE-conforming results for
13296 comparisons of NANs / infinities incurs extra overhead in every
13297 floating point comparison, therefore the default is set to
13298 @option{-ffinite-math-only}.
13299
13300 @item -minline-ic_invalidate
13301 @opindex minline-ic_invalidate
13302 Inline code to invalidate instruction cache entries after setting up
13303 nested function trampolines.
13304 This option has no effect if -musermode is in effect and the selected
13305 code generation option (e.g. -m4) does not allow the use of the icbi
13306 instruction.
13307 If the selected code generation option does not allow the use of the icbi
13308 instruction, and -musermode is not in effect, the inlined code will
13309 manipulate the instruction cache address array directly with an associative
13310 write.  This not only requires privileged mode, but it will also
13311 fail if the cache line had been mapped via the TLB and has become unmapped.
13312
13313 @item -misize
13314 @opindex misize
13315 Dump instruction size and location in the assembly code.
13316
13317 @item -mpadstruct
13318 @opindex mpadstruct
13319 This option is deprecated.  It pads structures to multiple of 4 bytes,
13320 which is incompatible with the SH ABI@.
13321
13322 @item -mspace
13323 @opindex mspace
13324 Optimize for space instead of speed.  Implied by @option{-Os}.
13325
13326 @item -mprefergot
13327 @opindex mprefergot
13328 When generating position-independent code, emit function calls using
13329 the Global Offset Table instead of the Procedure Linkage Table.
13330
13331 @item -musermode
13332 @opindex musermode
13333 Don't generate privileged mode only code; implies -mno-inline-ic_invalidate
13334 if the inlined code would not work in user mode.
13335 This is the default when the target is @code{sh-*-linux*}.
13336
13337 @item -multcost=@var{number}
13338 @opindex multcost=@var{number}
13339 Set the cost to assume for a multiply insn.
13340
13341 @item -mdiv=@var{strategy}
13342 @opindex mdiv=@var{strategy}
13343 Set the division strategy to use for SHmedia code.  @var{strategy} must be
13344 one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, inv:call,
13345 inv:call2, inv:fp .
13346 "fp" performs the operation in floating point.  This has a very high latency,
13347 but needs only a few instructions, so it might be a good choice if
13348 your code has enough easily exploitable ILP to allow the compiler to
13349 schedule the floating point instructions together with other instructions.
13350 Division by zero causes a floating point exception.
13351 "inv" uses integer operations to calculate the inverse of the divisor,
13352 and then multiplies the dividend with the inverse.  This strategy allows
13353 cse and hoisting of the inverse calculation.  Division by zero calculates
13354 an unspecified result, but does not trap.
13355 "inv:minlat" is a variant of "inv" where if no cse / hoisting opportunities
13356 have been found, or if the entire operation has been hoisted to the same
13357 place, the last stages of the inverse calculation are intertwined with the
13358 final multiply to reduce the overall latency, at the expense of using a few
13359 more instructions, and thus offering fewer scheduling opportunities with
13360 other code.
13361 "call" calls a library function that usually implements the inv:minlat
13362 strategy.
13363 This gives high code density for m5-*media-nofpu compilations.
13364 "call2" uses a different entry point of the same library function, where it
13365 assumes that a pointer to a lookup table has already been set up, which
13366 exposes the pointer load to cse / code hoisting optimizations.
13367 "inv:call", "inv:call2" and "inv:fp" all use the "inv" algorithm for initial
13368 code generation, but if the code stays unoptimized, revert to the "call",
13369 "call2", or "fp" strategies, respectively.  Note that the
13370 potentially-trapping side effect of division by zero is carried by a
13371 separate instruction, so it is possible that all the integer instructions
13372 are hoisted out, but the marker for the side effect stays where it is.
13373 A recombination to fp operations or a call is not possible in that case.
13374 "inv20u" and "inv20l" are variants of the "inv:minlat" strategy.  In the case
13375 that the inverse calculation was nor separated from the multiply, they speed
13376 up division where the dividend fits into 20 bits (plus sign where applicable),
13377 by inserting a test to skip a number of operations in this case; this test
13378 slows down the case of larger dividends.  inv20u assumes the case of a such
13379 a small dividend to be unlikely, and inv20l assumes it to be likely.
13380
13381 @item -mdivsi3_libfunc=@var{name}
13382 @opindex mdivsi3_libfunc=@var{name}
13383 Set the name of the library function used for 32 bit signed division to
13384 @var{name}.  This only affect the name used in the call and inv:call
13385 division strategies, and the compiler will still expect the same
13386 sets of input/output/clobbered registers as if this option was not present.
13387
13388 @item -madjust-unroll
13389 @opindex madjust-unroll
13390 Throttle unrolling to avoid thrashing target registers.
13391 This option only has an effect if the gcc code base supports the
13392 TARGET_ADJUST_UNROLL_MAX target hook.
13393
13394 @item -mindexed-addressing
13395 @opindex mindexed-addressing
13396 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
13397 This is only safe if the hardware and/or OS implement 32 bit wrap-around
13398 semantics for the indexed addressing mode.  The architecture allows the
13399 implementation of processors with 64 bit MMU, which the OS could use to
13400 get 32 bit addressing, but since no current hardware implementation supports
13401 this or any other way to make the indexed addressing mode safe to use in
13402 the 32 bit ABI, the default is -mno-indexed-addressing.
13403
13404 @item -mgettrcost=@var{number}
13405 @opindex mgettrcost=@var{number}
13406 Set the cost assumed for the gettr instruction to @var{number}.
13407 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
13408
13409 @item -mpt-fixed
13410 @opindex mpt-fixed
13411 Assume pt* instructions won't trap.  This will generally generate better
13412 scheduled code, but is unsafe on current hardware.  The current architecture
13413 definition says that ptabs and ptrel trap when the target anded with 3 is 3.
13414 This has the unintentional effect of making it unsafe to schedule ptabs /
13415 ptrel before a branch, or hoist it out of a loop.  For example,
13416 __do_global_ctors, a part of libgcc that runs constructors at program
13417 startup, calls functions in a list which is delimited by @minus{}1.  With the
13418 -mpt-fixed option, the ptabs will be done before testing against @minus{}1.
13419 That means that all the constructors will be run a bit quicker, but when
13420 the loop comes to the end of the list, the program crashes because ptabs
13421 loads @minus{}1 into a target register.  Since this option is unsafe for any
13422 hardware implementing the current architecture specification, the default
13423 is -mno-pt-fixed.  Unless the user specifies a specific cost with
13424 @option{-mgettrcost}, -mno-pt-fixed also implies @option{-mgettrcost=100};
13425 this deters register allocation using target registers for storing
13426 ordinary integers.
13427
13428 @item -minvalid-symbols
13429 @opindex minvalid-symbols
13430 Assume symbols might be invalid.  Ordinary function symbols generated by
13431 the compiler will always be valid to load with movi/shori/ptabs or
13432 movi/shori/ptrel, but with assembler and/or linker tricks it is possible
13433 to generate symbols that will cause ptabs / ptrel to trap.
13434 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
13435 It will then prevent cross-basic-block cse, hoisting and most scheduling
13436 of symbol loads.  The default is @option{-mno-invalid-symbols}.
13437 @end table
13438
13439 @node SPARC Options
13440 @subsection SPARC Options
13441 @cindex SPARC options
13442
13443 These @samp{-m} options are supported on the SPARC:
13444
13445 @table @gcctabopt
13446 @item -mno-app-regs
13447 @itemx -mapp-regs
13448 @opindex mno-app-regs
13449 @opindex mapp-regs
13450 Specify @option{-mapp-regs} to generate output using the global registers
13451 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
13452 is the default.
13453
13454 To be fully SVR4 ABI compliant at the cost of some performance loss,
13455 specify @option{-mno-app-regs}.  You should compile libraries and system
13456 software with this option.
13457
13458 @item -mfpu
13459 @itemx -mhard-float
13460 @opindex mfpu
13461 @opindex mhard-float
13462 Generate output containing floating point instructions.  This is the
13463 default.
13464
13465 @item -mno-fpu
13466 @itemx -msoft-float
13467 @opindex mno-fpu
13468 @opindex msoft-float
13469 Generate output containing library calls for floating point.
13470 @strong{Warning:} the requisite libraries are not available for all SPARC
13471 targets.  Normally the facilities of the machine's usual C compiler are
13472 used, but this cannot be done directly in cross-compilation.  You must make
13473 your own arrangements to provide suitable library functions for
13474 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
13475 @samp{sparclite-*-*} do provide software floating point support.
13476
13477 @option{-msoft-float} changes the calling convention in the output file;
13478 therefore, it is only useful if you compile @emph{all} of a program with
13479 this option.  In particular, you need to compile @file{libgcc.a}, the
13480 library that comes with GCC, with @option{-msoft-float} in order for
13481 this to work.
13482
13483 @item -mhard-quad-float
13484 @opindex mhard-quad-float
13485 Generate output containing quad-word (long double) floating point
13486 instructions.
13487
13488 @item -msoft-quad-float
13489 @opindex msoft-quad-float
13490 Generate output containing library calls for quad-word (long double)
13491 floating point instructions.  The functions called are those specified
13492 in the SPARC ABI@.  This is the default.
13493
13494 As of this writing, there are no SPARC implementations that have hardware
13495 support for the quad-word floating point instructions.  They all invoke
13496 a trap handler for one of these instructions, and then the trap handler
13497 emulates the effect of the instruction.  Because of the trap handler overhead,
13498 this is much slower than calling the ABI library routines.  Thus the
13499 @option{-msoft-quad-float} option is the default.
13500
13501 @item -mno-unaligned-doubles
13502 @itemx -munaligned-doubles
13503 @opindex mno-unaligned-doubles
13504 @opindex munaligned-doubles
13505 Assume that doubles have 8 byte alignment.  This is the default.
13506
13507 With @option{-munaligned-doubles}, GCC assumes that doubles have 8 byte
13508 alignment only if they are contained in another type, or if they have an
13509 absolute address.  Otherwise, it assumes they have 4 byte alignment.
13510 Specifying this option avoids some rare compatibility problems with code
13511 generated by other compilers.  It is not the default because it results
13512 in a performance loss, especially for floating point code.
13513
13514 @item -mno-faster-structs
13515 @itemx -mfaster-structs
13516 @opindex mno-faster-structs
13517 @opindex mfaster-structs
13518 With @option{-mfaster-structs}, the compiler assumes that structures
13519 should have 8 byte alignment.  This enables the use of pairs of
13520 @code{ldd} and @code{std} instructions for copies in structure
13521 assignment, in place of twice as many @code{ld} and @code{st} pairs.
13522 However, the use of this changed alignment directly violates the SPARC
13523 ABI@.  Thus, it's intended only for use on targets where the developer
13524 acknowledges that their resulting code will not be directly in line with
13525 the rules of the ABI@.
13526
13527 @item -mimpure-text
13528 @opindex mimpure-text
13529 @option{-mimpure-text}, used in addition to @option{-shared}, tells
13530 the compiler to not pass @option{-z text} to the linker when linking a
13531 shared object.  Using this option, you can link position-dependent
13532 code into a shared object.
13533
13534 @option{-mimpure-text} suppresses the ``relocations remain against
13535 allocatable but non-writable sections'' linker error message.
13536 However, the necessary relocations will trigger copy-on-write, and the
13537 shared object is not actually shared across processes.  Instead of
13538 using @option{-mimpure-text}, you should compile all source code with
13539 @option{-fpic} or @option{-fPIC}.
13540
13541 This option is only available on SunOS and Solaris.
13542
13543 @item -mcpu=@var{cpu_type}
13544 @opindex mcpu
13545 Set the instruction set, register set, and instruction scheduling parameters
13546 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
13547 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{sparclite},
13548 @samp{f930}, @samp{f934}, @samp{hypersparc}, @samp{sparclite86x},
13549 @samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc},
13550 @samp{ultrasparc3}, and @samp{niagara}.
13551
13552 Default instruction scheduling parameters are used for values that select
13553 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
13554 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
13555
13556 Here is a list of each supported architecture and their supported
13557 implementations.
13558
13559 @smallexample
13560     v7:             cypress
13561     v8:             supersparc, hypersparc
13562     sparclite:      f930, f934, sparclite86x
13563     sparclet:       tsc701
13564     v9:             ultrasparc, ultrasparc3, niagara
13565 @end smallexample
13566
13567 By default (unless configured otherwise), GCC generates code for the V7
13568 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
13569 additionally optimizes it for the Cypress CY7C602 chip, as used in the
13570 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
13571 SPARCStation 1, 2, IPX etc.
13572
13573 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
13574 architecture.  The only difference from V7 code is that the compiler emits
13575 the integer multiply and integer divide instructions which exist in SPARC-V8
13576 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
13577 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
13578 2000 series.
13579
13580 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
13581 the SPARC architecture.  This adds the integer multiply, integer divide step
13582 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
13583 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
13584 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
13585 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
13586 MB86934 chip, which is the more recent SPARClite with FPU@.
13587
13588 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
13589 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
13590 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
13591 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
13592 optimizes it for the TEMIC SPARClet chip.
13593
13594 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
13595 architecture.  This adds 64-bit integer and floating-point move instructions,
13596 3 additional floating-point condition code registers and conditional move
13597 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
13598 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
13599 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
13600 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
13601 @option{-mcpu=niagara}, the compiler additionally optimizes it for
13602 Sun UltraSPARC T1 chips.
13603
13604 @item -mtune=@var{cpu_type}
13605 @opindex mtune
13606 Set the instruction scheduling parameters for machine type
13607 @var{cpu_type}, but do not set the instruction set or register set that the
13608 option @option{-mcpu=@var{cpu_type}} would.
13609
13610 The same values for @option{-mcpu=@var{cpu_type}} can be used for
13611 @option{-mtune=@var{cpu_type}}, but the only useful values are those
13612 that select a particular cpu implementation.  Those are @samp{cypress},
13613 @samp{supersparc}, @samp{hypersparc}, @samp{f930}, @samp{f934},
13614 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
13615 @samp{ultrasparc3}, and @samp{niagara}.
13616
13617 @item -mv8plus
13618 @itemx -mno-v8plus
13619 @opindex mv8plus
13620 @opindex mno-v8plus
13621 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
13622 difference from the V8 ABI is that the global and out registers are
13623 considered 64-bit wide.  This is enabled by default on Solaris in 32-bit
13624 mode for all SPARC-V9 processors.
13625
13626 @item -mvis
13627 @itemx -mno-vis
13628 @opindex mvis
13629 @opindex mno-vis
13630 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
13631 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
13632 @end table
13633
13634 These @samp{-m} options are supported in addition to the above
13635 on SPARC-V9 processors in 64-bit environments:
13636
13637 @table @gcctabopt
13638 @item -mlittle-endian
13639 @opindex mlittle-endian
13640 Generate code for a processor running in little-endian mode.  It is only
13641 available for a few configurations and most notably not on Solaris and Linux.
13642
13643 @item -m32
13644 @itemx -m64
13645 @opindex m32
13646 @opindex m64
13647 Generate code for a 32-bit or 64-bit environment.
13648 The 32-bit environment sets int, long and pointer to 32 bits.
13649 The 64-bit environment sets int to 32 bits and long and pointer
13650 to 64 bits.
13651
13652 @item -mcmodel=medlow
13653 @opindex mcmodel=medlow
13654 Generate code for the Medium/Low code model: 64-bit addresses, programs
13655 must be linked in the low 32 bits of memory.  Programs can be statically
13656 or dynamically linked.
13657
13658 @item -mcmodel=medmid
13659 @opindex mcmodel=medmid
13660 Generate code for the Medium/Middle code model: 64-bit addresses, programs
13661 must be linked in the low 44 bits of memory, the text and data segments must
13662 be less than 2GB in size and the data segment must be located within 2GB of
13663 the text segment.
13664
13665 @item -mcmodel=medany
13666 @opindex mcmodel=medany
13667 Generate code for the Medium/Anywhere code model: 64-bit addresses, programs
13668 may be linked anywhere in memory, the text and data segments must be less
13669 than 2GB in size and the data segment must be located within 2GB of the
13670 text segment.
13671
13672 @item -mcmodel=embmedany
13673 @opindex mcmodel=embmedany
13674 Generate code for the Medium/Anywhere code model for embedded systems:
13675 64-bit addresses, the text and data segments must be less than 2GB in
13676 size, both starting anywhere in memory (determined at link time).  The
13677 global register %g4 points to the base of the data segment.  Programs
13678 are statically linked and PIC is not supported.
13679
13680 @item -mstack-bias
13681 @itemx -mno-stack-bias
13682 @opindex mstack-bias
13683 @opindex mno-stack-bias
13684 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
13685 frame pointer if present, are offset by @minus{}2047 which must be added back
13686 when making stack frame references.  This is the default in 64-bit mode.
13687 Otherwise, assume no such offset is present.
13688 @end table
13689
13690 These switches are supported in addition to the above on Solaris:
13691
13692 @table @gcctabopt
13693 @item -threads
13694 @opindex threads
13695 Add support for multithreading using the Solaris threads library.  This
13696 option sets flags for both the preprocessor and linker.  This option does
13697 not affect the thread safety of object code produced by the compiler or
13698 that of libraries supplied with it.
13699
13700 @item -pthreads
13701 @opindex pthreads
13702 Add support for multithreading using the POSIX threads library.  This
13703 option sets flags for both the preprocessor and linker.  This option does
13704 not affect the thread safety of object code produced  by the compiler or
13705 that of libraries supplied with it.
13706
13707 @item -pthread
13708 @opindex pthread
13709 This is a synonym for @option{-pthreads}.
13710 @end table
13711
13712 @node SPU Options
13713 @subsection SPU Options
13714 @cindex SPU options
13715
13716 These @samp{-m} options are supported on the SPU:
13717
13718 @table @gcctabopt
13719 @item -mwarn-reloc
13720 @itemx -merror-reloc
13721 @opindex mwarn-reloc
13722 @opindex merror-reloc
13723
13724 The loader for SPU does not handle dynamic relocations.  By default, GCC
13725 will give an error when it generates code that requires a dynamic
13726 relocation.  @option{-mno-error-reloc} disables the error,
13727 @option{-mwarn-reloc} will generate a warning instead.
13728
13729 @item -msafe-dma
13730 @itemx -munsafe-dma
13731 @opindex msafe-dma
13732 @opindex munsafe-dma
13733
13734 Instructions which initiate or test completion of DMA must not be
13735 reordered with respect to loads and stores of the memory which is being
13736 accessed.  Users typically address this problem using the volatile
13737 keyword, but that can lead to inefficient code in places where the
13738 memory is known to not change.  Rather than mark the memory as volatile
13739 we treat the DMA instructions as potentially effecting all memory.  With
13740 @option{-munsafe-dma} users must use the volatile keyword to protect
13741 memory accesses.
13742
13743 @item -mbranch-hints
13744 @opindex mbranch-hints
13745
13746 By default, GCC will generate a branch hint instruction to avoid
13747 pipeline stalls for always taken or probably taken branches.  A hint
13748 will not be generated closer than 8 instructions away from its branch.
13749 There is little reason to disable them, except for debugging purposes,
13750 or to make an object a little bit smaller.
13751
13752 @item -msmall-mem
13753 @itemx -mlarge-mem
13754 @opindex msmall-mem
13755 @opindex mlarge-mem
13756
13757 By default, GCC generates code assuming that addresses are never larger
13758 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
13759 a full 32 bit address.
13760
13761 @item -mstdmain
13762 @opindex mstdmain
13763
13764 By default, GCC links against startup code that assumes the SPU-style
13765 main function interface (which has an unconventional parameter list).
13766 With @option{-mstdmain}, GCC will link your program against startup
13767 code that assumes a C99-style interface to @code{main}, including a
13768 local copy of @code{argv} strings.
13769
13770 @item -mfixed-range=@var{register-range}
13771 @opindex mfixed-range
13772 Generate code treating the given register range as fixed registers.
13773 A fixed register is one that the register allocator can not use.  This is
13774 useful when compiling kernel code.  A register range is specified as
13775 two registers separated by a dash.  Multiple register ranges can be
13776 specified separated by a comma.
13777
13778 @end table
13779
13780 @node System V Options
13781 @subsection Options for System V
13782
13783 These additional options are available on System V Release 4 for
13784 compatibility with other compilers on those systems:
13785
13786 @table @gcctabopt
13787 @item -G
13788 @opindex G
13789 Create a shared object.
13790 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
13791
13792 @item -Qy
13793 @opindex Qy
13794 Identify the versions of each tool used by the compiler, in a
13795 @code{.ident} assembler directive in the output.
13796
13797 @item -Qn
13798 @opindex Qn
13799 Refrain from adding @code{.ident} directives to the output file (this is
13800 the default).
13801
13802 @item -YP,@var{dirs}
13803 @opindex YP
13804 Search the directories @var{dirs}, and no others, for libraries
13805 specified with @option{-l}.
13806
13807 @item -Ym,@var{dir}
13808 @opindex Ym
13809 Look in the directory @var{dir} to find the M4 preprocessor.
13810 The assembler uses this option.
13811 @c This is supposed to go with a -Yd for predefined M4 macro files, but
13812 @c the generic assembler that comes with Solaris takes just -Ym.
13813 @end table
13814
13815 @node TMS320C3x/C4x Options
13816 @subsection TMS320C3x/C4x Options
13817 @cindex TMS320C3x/C4x Options
13818
13819 These @samp{-m} options are defined for TMS320C3x/C4x implementations:
13820
13821 @table @gcctabopt
13822
13823 @item -mcpu=@var{cpu_type}
13824 @opindex mcpu
13825 Set the instruction set, register set, and instruction scheduling
13826 parameters for machine type @var{cpu_type}.  Supported values for
13827 @var{cpu_type} are @samp{c30}, @samp{c31}, @samp{c32}, @samp{c40}, and
13828 @samp{c44}.  The default is @samp{c40} to generate code for the
13829 TMS320C40.
13830
13831 @item -mbig-memory
13832 @itemx -mbig
13833 @itemx -msmall-memory
13834 @itemx -msmall
13835 @opindex mbig-memory
13836 @opindex mbig
13837 @opindex msmall-memory
13838 @opindex msmall
13839 Generates code for the big or small memory model.  The small memory
13840 model assumed that all data fits into one 64K word page.  At run-time
13841 the data page (DP) register must be set to point to the 64K page
13842 containing the .bss and .data program sections.  The big memory model is
13843 the default and requires reloading of the DP register for every direct
13844 memory access.
13845
13846 @item -mbk
13847 @itemx -mno-bk
13848 @opindex mbk
13849 @opindex mno-bk
13850 Allow (disallow) allocation of general integer operands into the block
13851 count register BK@.
13852
13853 @item -mdb
13854 @itemx -mno-db
13855 @opindex mdb
13856 @opindex mno-db
13857 Enable (disable) generation of code using decrement and branch,
13858 DBcond(D), instructions.  This is enabled by default for the C4x.  To be
13859 on the safe side, this is disabled for the C3x, since the maximum
13860 iteration count on the C3x is @math{2^{23} + 1} (but who iterates loops more than
13861 @math{2^{23}} times on the C3x?).  Note that GCC will try to reverse a loop so
13862 that it can utilize the decrement and branch instruction, but will give
13863 up if there is more than one memory reference in the loop.  Thus a loop
13864 where the loop counter is decremented can generate slightly more
13865 efficient code, in cases where the RPTB instruction cannot be utilized.
13866
13867 @item -mdp-isr-reload
13868 @itemx -mparanoid
13869 @opindex mdp-isr-reload
13870 @opindex mparanoid
13871 Force the DP register to be saved on entry to an interrupt service
13872 routine (ISR), reloaded to point to the data section, and restored on
13873 exit from the ISR@.  This should not be required unless someone has
13874 violated the small memory model by modifying the DP register, say within
13875 an object library.
13876
13877 @item -mmpyi
13878 @itemx -mno-mpyi
13879 @opindex mmpyi
13880 @opindex mno-mpyi
13881 For the C3x use the 24-bit MPYI instruction for integer multiplies
13882 instead of a library call to guarantee 32-bit results.  Note that if one
13883 of the operands is a constant, then the multiplication will be performed
13884 using shifts and adds.  If the @option{-mmpyi} option is not specified for the C3x,
13885 then squaring operations are performed inline instead of a library call.
13886
13887 @item -mfast-fix
13888 @itemx -mno-fast-fix
13889 @opindex mfast-fix
13890 @opindex mno-fast-fix
13891 The C3x/C4x FIX instruction to convert a floating point value to an
13892 integer value chooses the nearest integer less than or equal to the
13893 floating point value rather than to the nearest integer.  Thus if the
13894 floating point number is negative, the result will be incorrectly
13895 truncated an additional code is necessary to detect and correct this
13896 case.  This option can be used to disable generation of the additional
13897 code required to correct the result.
13898
13899 @item -mrptb
13900 @itemx -mno-rptb
13901 @opindex mrptb
13902 @opindex mno-rptb
13903 Enable (disable) generation of repeat block sequences using the RPTB
13904 instruction for zero overhead looping.  The RPTB construct is only used
13905 for innermost loops that do not call functions or jump across the loop
13906 boundaries.  There is no advantage having nested RPTB loops due to the
13907 overhead required to save and restore the RC, RS, and RE registers.
13908 This is enabled by default with @option{-O2}.
13909
13910 @item -mrpts=@var{count}
13911 @itemx -mno-rpts
13912 @opindex mrpts
13913 @opindex mno-rpts
13914 Enable (disable) the use of the single instruction repeat instruction
13915 RPTS@.  If a repeat block contains a single instruction, and the loop
13916 count can be guaranteed to be less than the value @var{count}, GCC will
13917 emit a RPTS instruction instead of a RPTB@.  If no value is specified,
13918 then a RPTS will be emitted even if the loop count cannot be determined
13919 at compile time.  Note that the repeated instruction following RPTS does
13920 not have to be reloaded from memory each iteration, thus freeing up the
13921 CPU buses for operands.  However, since interrupts are blocked by this
13922 instruction, it is disabled by default.
13923
13924 @item -mloop-unsigned
13925 @itemx -mno-loop-unsigned
13926 @opindex mloop-unsigned
13927 @opindex mno-loop-unsigned
13928 The maximum iteration count when using RPTS and RPTB (and DB on the C40)
13929 is @math{2^{31} + 1} since these instructions test if the iteration count is
13930 negative to terminate the loop.  If the iteration count is unsigned
13931 there is a possibility than the @math{2^{31} + 1} maximum iteration count may be
13932 exceeded.  This switch allows an unsigned iteration count.
13933
13934 @item -mti
13935 @opindex mti
13936 Try to emit an assembler syntax that the TI assembler (asm30) is happy
13937 with.  This also enforces compatibility with the API employed by the TI
13938 C3x C compiler.  For example, long doubles are passed as structures
13939 rather than in floating point registers.
13940
13941 @item -mregparm
13942 @itemx -mmemparm
13943 @opindex mregparm
13944 @opindex mmemparm
13945 Generate code that uses registers (stack) for passing arguments to functions.
13946 By default, arguments are passed in registers where possible rather
13947 than by pushing arguments on to the stack.
13948
13949 @item -mparallel-insns
13950 @itemx -mno-parallel-insns
13951 @opindex mparallel-insns
13952 @opindex mno-parallel-insns
13953 Allow the generation of parallel instructions.  This is enabled by
13954 default with @option{-O2}.
13955
13956 @item -mparallel-mpy
13957 @itemx -mno-parallel-mpy
13958 @opindex mparallel-mpy
13959 @opindex mno-parallel-mpy
13960 Allow the generation of MPY||ADD and MPY||SUB parallel instructions,
13961 provided @option{-mparallel-insns} is also specified.  These instructions have
13962 tight register constraints which can pessimize the code generation
13963 of large functions.
13964
13965 @end table
13966
13967 @node V850 Options
13968 @subsection V850 Options
13969 @cindex V850 Options
13970
13971 These @samp{-m} options are defined for V850 implementations:
13972
13973 @table @gcctabopt
13974 @item -mlong-calls
13975 @itemx -mno-long-calls
13976 @opindex mlong-calls
13977 @opindex mno-long-calls
13978 Treat all calls as being far away (near).  If calls are assumed to be
13979 far away, the compiler will always load the functions address up into a
13980 register, and call indirect through the pointer.
13981
13982 @item -mno-ep
13983 @itemx -mep
13984 @opindex mno-ep
13985 @opindex mep
13986 Do not optimize (do optimize) basic blocks that use the same index
13987 pointer 4 or more times to copy pointer into the @code{ep} register, and
13988 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
13989 option is on by default if you optimize.
13990
13991 @item -mno-prolog-function
13992 @itemx -mprolog-function
13993 @opindex mno-prolog-function
13994 @opindex mprolog-function
13995 Do not use (do use) external functions to save and restore registers
13996 at the prologue and epilogue of a function.  The external functions
13997 are slower, but use less code space if more than one function saves
13998 the same number of registers.  The @option{-mprolog-function} option
13999 is on by default if you optimize.
14000
14001 @item -mspace
14002 @opindex mspace
14003 Try to make the code as small as possible.  At present, this just turns
14004 on the @option{-mep} and @option{-mprolog-function} options.
14005
14006 @item -mtda=@var{n}
14007 @opindex mtda
14008 Put static or global variables whose size is @var{n} bytes or less into
14009 the tiny data area that register @code{ep} points to.  The tiny data
14010 area can hold up to 256 bytes in total (128 bytes for byte references).
14011
14012 @item -msda=@var{n}
14013 @opindex msda
14014 Put static or global variables whose size is @var{n} bytes or less into
14015 the small data area that register @code{gp} points to.  The small data
14016 area can hold up to 64 kilobytes.
14017
14018 @item -mzda=@var{n}
14019 @opindex mzda
14020 Put static or global variables whose size is @var{n} bytes or less into
14021 the first 32 kilobytes of memory.
14022
14023 @item -mv850
14024 @opindex mv850
14025 Specify that the target processor is the V850.
14026
14027 @item -mbig-switch
14028 @opindex mbig-switch
14029 Generate code suitable for big switch tables.  Use this option only if
14030 the assembler/linker complain about out of range branches within a switch
14031 table.
14032
14033 @item -mapp-regs
14034 @opindex mapp-regs
14035 This option will cause r2 and r5 to be used in the code generated by
14036 the compiler.  This setting is the default.
14037
14038 @item -mno-app-regs
14039 @opindex mno-app-regs
14040 This option will cause r2 and r5 to be treated as fixed registers.
14041
14042 @item -mv850e1
14043 @opindex mv850e1
14044 Specify that the target processor is the V850E1.  The preprocessor
14045 constants @samp{__v850e1__} and @samp{__v850e__} will be defined if
14046 this option is used.
14047
14048 @item -mv850e
14049 @opindex mv850e
14050 Specify that the target processor is the V850E@.  The preprocessor
14051 constant @samp{__v850e__} will be defined if this option is used.
14052
14053 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
14054 are defined then a default target processor will be chosen and the
14055 relevant @samp{__v850*__} preprocessor constant will be defined.
14056
14057 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
14058 defined, regardless of which processor variant is the target.
14059
14060 @item -mdisable-callt
14061 @opindex mdisable-callt
14062 This option will suppress generation of the CALLT instruction for the
14063 v850e and v850e1 flavors of the v850 architecture.  The default is
14064 @option{-mno-disable-callt} which allows the CALLT instruction to be used.
14065
14066 @end table
14067
14068 @node VAX Options
14069 @subsection VAX Options
14070 @cindex VAX options
14071
14072 These @samp{-m} options are defined for the VAX:
14073
14074 @table @gcctabopt
14075 @item -munix
14076 @opindex munix
14077 Do not output certain jump instructions (@code{aobleq} and so on)
14078 that the Unix assembler for the VAX cannot handle across long
14079 ranges.
14080
14081 @item -mgnu
14082 @opindex mgnu
14083 Do output those jump instructions, on the assumption that you
14084 will assemble with the GNU assembler.
14085
14086 @item -mg
14087 @opindex mg
14088 Output code for g-format floating point numbers instead of d-format.
14089 @end table
14090
14091 @node VxWorks Options
14092 @subsection VxWorks Options
14093 @cindex VxWorks Options
14094
14095 The options in this section are defined for all VxWorks targets.
14096 Options specific to the target hardware are listed with the other
14097 options for that target.
14098
14099 @table @gcctabopt
14100 @item -mrtp
14101 @opindex mrtp
14102 GCC can generate code for both VxWorks kernels and real time processes
14103 (RTPs).  This option switches from the former to the latter.  It also
14104 defines the preprocessor macro @code{__RTP__}.
14105
14106 @item -non-static
14107 @opindex non-static
14108 Link an RTP executable against shared libraries rather than static
14109 libraries.  The options @option{-static} and @option{-shared} can
14110 also be used for RTPs (@pxref{Link Options}); @option{-static}
14111 is the default.
14112
14113 @item -Bstatic
14114 @itemx -Bdynamic
14115 @opindex Bstatic
14116 @opindex Bdynamic
14117 These options are passed down to the linker.  They are defined for
14118 compatibility with Diab.
14119
14120 @item -Xbind-lazy
14121 @opindex Xbind-lazy
14122 Enable lazy binding of function calls.  This option is equivalent to
14123 @option{-Wl,-z,now} and is defined for compatibility with Diab.
14124
14125 @item -Xbind-now
14126 @opindex Xbind-now
14127 Disable lazy binding of function calls.  This option is the default and
14128 is defined for compatibility with Diab.
14129 @end table
14130
14131 @node x86-64 Options
14132 @subsection x86-64 Options
14133 @cindex x86-64 options
14134
14135 These are listed under @xref{i386 and x86-64 Options}.
14136
14137 @node Xstormy16 Options
14138 @subsection Xstormy16 Options
14139 @cindex Xstormy16 Options
14140
14141 These options are defined for Xstormy16:
14142
14143 @table @gcctabopt
14144 @item -msim
14145 @opindex msim
14146 Choose startup files and linker script suitable for the simulator.
14147 @end table
14148
14149 @node Xtensa Options
14150 @subsection Xtensa Options
14151 @cindex Xtensa Options
14152
14153 These options are supported for Xtensa targets:
14154
14155 @table @gcctabopt
14156 @item -mconst16
14157 @itemx -mno-const16
14158 @opindex mconst16
14159 @opindex mno-const16
14160 Enable or disable use of @code{CONST16} instructions for loading
14161 constant values.  The @code{CONST16} instruction is currently not a
14162 standard option from Tensilica.  When enabled, @code{CONST16}
14163 instructions are always used in place of the standard @code{L32R}
14164 instructions.  The use of @code{CONST16} is enabled by default only if
14165 the @code{L32R} instruction is not available.
14166
14167 @item -mfused-madd
14168 @itemx -mno-fused-madd
14169 @opindex mfused-madd
14170 @opindex mno-fused-madd
14171 Enable or disable use of fused multiply/add and multiply/subtract
14172 instructions in the floating-point option.  This has no effect if the
14173 floating-point option is not also enabled.  Disabling fused multiply/add
14174 and multiply/subtract instructions forces the compiler to use separate
14175 instructions for the multiply and add/subtract operations.  This may be
14176 desirable in some cases where strict IEEE 754-compliant results are
14177 required: the fused multiply add/subtract instructions do not round the
14178 intermediate result, thereby producing results with @emph{more} bits of
14179 precision than specified by the IEEE standard.  Disabling fused multiply
14180 add/subtract instructions also ensures that the program output is not
14181 sensitive to the compiler's ability to combine multiply and add/subtract
14182 operations.
14183
14184 @item -mtext-section-literals
14185 @itemx -mno-text-section-literals
14186 @opindex mtext-section-literals
14187 @opindex mno-text-section-literals
14188 Control the treatment of literal pools.  The default is
14189 @option{-mno-text-section-literals}, which places literals in a separate
14190 section in the output file.  This allows the literal pool to be placed
14191 in a data RAM/ROM, and it also allows the linker to combine literal
14192 pools from separate object files to remove redundant literals and
14193 improve code size.  With @option{-mtext-section-literals}, the literals
14194 are interspersed in the text section in order to keep them as close as
14195 possible to their references.  This may be necessary for large assembly
14196 files.
14197
14198 @item -mtarget-align
14199 @itemx -mno-target-align
14200 @opindex mtarget-align
14201 @opindex mno-target-align
14202 When this option is enabled, GCC instructs the assembler to
14203 automatically align instructions to reduce branch penalties at the
14204 expense of some code density.  The assembler attempts to widen density
14205 instructions to align branch targets and the instructions following call
14206 instructions.  If there are not enough preceding safe density
14207 instructions to align a target, no widening will be performed.  The
14208 default is @option{-mtarget-align}.  These options do not affect the
14209 treatment of auto-aligned instructions like @code{LOOP}, which the
14210 assembler will always align, either by widening density instructions or
14211 by inserting no-op instructions.
14212
14213 @item -mlongcalls
14214 @itemx -mno-longcalls
14215 @opindex mlongcalls
14216 @opindex mno-longcalls
14217 When this option is enabled, GCC instructs the assembler to translate
14218 direct calls to indirect calls unless it can determine that the target
14219 of a direct call is in the range allowed by the call instruction.  This
14220 translation typically occurs for calls to functions in other source
14221 files.  Specifically, the assembler translates a direct @code{CALL}
14222 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
14223 The default is @option{-mno-longcalls}.  This option should be used in
14224 programs where the call target can potentially be out of range.  This
14225 option is implemented in the assembler, not the compiler, so the
14226 assembly code generated by GCC will still show direct call
14227 instructions---look at the disassembled object code to see the actual
14228 instructions.  Note that the assembler will use an indirect call for
14229 every cross-file call, not just those that really will be out of range.
14230 @end table
14231
14232 @node zSeries Options
14233 @subsection zSeries Options
14234 @cindex zSeries options
14235
14236 These are listed under @xref{S/390 and zSeries Options}.
14237
14238 @node Code Gen Options
14239 @section Options for Code Generation Conventions
14240 @cindex code generation conventions
14241 @cindex options, code generation
14242 @cindex run-time options
14243
14244 These machine-independent options control the interface conventions
14245 used in code generation.
14246
14247 Most of them have both positive and negative forms; the negative form
14248 of @option{-ffoo} would be @option{-fno-foo}.  In the table below, only
14249 one of the forms is listed---the one which is not the default.  You
14250 can figure out the other form by either removing @samp{no-} or adding
14251 it.
14252
14253 @table @gcctabopt
14254 @item -fbounds-check
14255 @opindex fbounds-check
14256 For front-ends that support it, generate additional code to check that
14257 indices used to access arrays are within the declared range.  This is
14258 currently only supported by the Java and Fortran front-ends, where
14259 this option defaults to true and false respectively.
14260
14261 @item -ftrapv
14262 @opindex ftrapv
14263 This option generates traps for signed overflow on addition, subtraction,
14264 multiplication operations.
14265
14266 @item -fwrapv
14267 @opindex fwrapv
14268 This option instructs the compiler to assume that signed arithmetic
14269 overflow of addition, subtraction and multiplication wraps around
14270 using twos-complement representation.  This flag enables some optimizations
14271 and disables others.  This option is enabled by default for the Java
14272 front-end, as required by the Java language specification.
14273
14274 @item -fexceptions
14275 @opindex fexceptions
14276 Enable exception handling.  Generates extra code needed to propagate
14277 exceptions.  For some targets, this implies GCC will generate frame
14278 unwind information for all functions, which can produce significant data
14279 size overhead, although it does not affect execution.  If you do not
14280 specify this option, GCC will enable it by default for languages like
14281 C++ which normally require exception handling, and disable it for
14282 languages like C that do not normally require it.  However, you may need
14283 to enable this option when compiling C code that needs to interoperate
14284 properly with exception handlers written in C++.  You may also wish to
14285 disable this option if you are compiling older C++ programs that don't
14286 use exception handling.
14287
14288 @item -fnon-call-exceptions
14289 @opindex fnon-call-exceptions
14290 Generate code that allows trapping instructions to throw exceptions.
14291 Note that this requires platform-specific runtime support that does
14292 not exist everywhere.  Moreover, it only allows @emph{trapping}
14293 instructions to throw exceptions, i.e.@: memory references or floating
14294 point instructions.  It does not allow exceptions to be thrown from
14295 arbitrary signal handlers such as @code{SIGALRM}.
14296
14297 @item -funwind-tables
14298 @opindex funwind-tables
14299 Similar to @option{-fexceptions}, except that it will just generate any needed
14300 static data, but will not affect the generated code in any other way.
14301 You will normally not enable this option; instead, a language processor
14302 that needs this handling would enable it on your behalf.
14303
14304 @item -fasynchronous-unwind-tables
14305 @opindex fasynchronous-unwind-tables
14306 Generate unwind table in dwarf2 format, if supported by target machine.  The
14307 table is exact at each instruction boundary, so it can be used for stack
14308 unwinding from asynchronous events (such as debugger or garbage collector).
14309
14310 @item -fpcc-struct-return
14311 @opindex fpcc-struct-return
14312 Return ``short'' @code{struct} and @code{union} values in memory like
14313 longer ones, rather than in registers.  This convention is less
14314 efficient, but it has the advantage of allowing intercallability between
14315 GCC-compiled files and files compiled with other compilers, particularly
14316 the Portable C Compiler (pcc).
14317
14318 The precise convention for returning structures in memory depends
14319 on the target configuration macros.
14320
14321 Short structures and unions are those whose size and alignment match
14322 that of some integer type.
14323
14324 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
14325 switch is not binary compatible with code compiled with the
14326 @option{-freg-struct-return} switch.
14327 Use it to conform to a non-default application binary interface.
14328
14329 @item -freg-struct-return
14330 @opindex freg-struct-return
14331 Return @code{struct} and @code{union} values in registers when possible.
14332 This is more efficient for small structures than
14333 @option{-fpcc-struct-return}.
14334
14335 If you specify neither @option{-fpcc-struct-return} nor
14336 @option{-freg-struct-return}, GCC defaults to whichever convention is
14337 standard for the target.  If there is no standard convention, GCC
14338 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
14339 the principal compiler.  In those cases, we can choose the standard, and
14340 we chose the more efficient register return alternative.
14341
14342 @strong{Warning:} code compiled with the @option{-freg-struct-return}
14343 switch is not binary compatible with code compiled with the
14344 @option{-fpcc-struct-return} switch.
14345 Use it to conform to a non-default application binary interface.
14346
14347 @item -fshort-enums
14348 @opindex fshort-enums
14349 Allocate to an @code{enum} type only as many bytes as it needs for the
14350 declared range of possible values.  Specifically, the @code{enum} type
14351 will be equivalent to the smallest integer type which has enough room.
14352
14353 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
14354 code that is not binary compatible with code generated without that switch.
14355 Use it to conform to a non-default application binary interface.
14356
14357 @item -fshort-double
14358 @opindex fshort-double
14359 Use the same size for @code{double} as for @code{float}.
14360
14361 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
14362 code that is not binary compatible with code generated without that switch.
14363 Use it to conform to a non-default application binary interface.
14364
14365 @item -fshort-wchar
14366 @opindex fshort-wchar
14367 Override the underlying type for @samp{wchar_t} to be @samp{short
14368 unsigned int} instead of the default for the target.  This option is
14369 useful for building programs to run under WINE@.
14370
14371 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
14372 code that is not binary compatible with code generated without that switch.
14373 Use it to conform to a non-default application binary interface.
14374
14375 @item -fno-common
14376 @opindex fno-common
14377 In C, allocate even uninitialized global variables in the data section of the
14378 object file, rather than generating them as common blocks.  This has the
14379 effect that if the same variable is declared (without @code{extern}) in
14380 two different compilations, you will get an error when you link them.
14381 The only reason this might be useful is if you wish to verify that the
14382 program will work on other systems which always work this way.
14383
14384 @item -fno-ident
14385 @opindex fno-ident
14386 Ignore the @samp{#ident} directive.
14387
14388 @item -finhibit-size-directive
14389 @opindex finhibit-size-directive
14390 Don't output a @code{.size} assembler directive, or anything else that
14391 would cause trouble if the function is split in the middle, and the
14392 two halves are placed at locations far apart in memory.  This option is
14393 used when compiling @file{crtstuff.c}; you should not need to use it
14394 for anything else.
14395
14396 @item -fverbose-asm
14397 @opindex fverbose-asm
14398 Put extra commentary information in the generated assembly code to
14399 make it more readable.  This option is generally only of use to those
14400 who actually need to read the generated assembly code (perhaps while
14401 debugging the compiler itself).
14402
14403 @option{-fno-verbose-asm}, the default, causes the
14404 extra information to be omitted and is useful when comparing two assembler
14405 files.
14406
14407 @item -frecord-gcc-switches
14408 @opindex frecord-gcc-switches
14409 This switch causes the command line that was used to invoke the
14410 compiler to be recorded into the object file that is being created.
14411 This switch is only implemented on some targets and the exact format
14412 of the recording is target and binary file format dependent, but it
14413 usually takes the form of a section containing ASCII text.  This
14414 switch is related to the @option{-fverbose-asm} switch, but that
14415 switch only records information in the assembler output file as
14416 comments, so it never reaches the object file.
14417
14418 @item -fpic
14419 @opindex fpic
14420 @cindex global offset table
14421 @cindex PIC
14422 Generate position-independent code (PIC) suitable for use in a shared
14423 library, if supported for the target machine.  Such code accesses all
14424 constant addresses through a global offset table (GOT)@.  The dynamic
14425 loader resolves the GOT entries when the program starts (the dynamic
14426 loader is not part of GCC; it is part of the operating system).  If
14427 the GOT size for the linked executable exceeds a machine-specific
14428 maximum size, you get an error message from the linker indicating that
14429 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
14430 instead.  (These maximums are 8k on the SPARC and 32k
14431 on the m68k and RS/6000.  The 386 has no such limit.)
14432
14433 Position-independent code requires special support, and therefore works
14434 only on certain machines.  For the 386, GCC supports PIC for System V
14435 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
14436 position-independent.
14437
14438 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
14439 are defined to 1.
14440
14441 @item -fPIC
14442 @opindex fPIC
14443 If supported for the target machine, emit position-independent code,
14444 suitable for dynamic linking and avoiding any limit on the size of the
14445 global offset table.  This option makes a difference on the m68k,
14446 PowerPC and SPARC@.
14447
14448 Position-independent code requires special support, and therefore works
14449 only on certain machines.
14450
14451 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
14452 are defined to 2.
14453
14454 @item -fpie
14455 @itemx -fPIE
14456 @opindex fpie
14457 @opindex fPIE
14458 These options are similar to @option{-fpic} and @option{-fPIC}, but
14459 generated position independent code can be only linked into executables.
14460 Usually these options are used when @option{-pie} GCC option will be
14461 used during linking.
14462
14463 @option{-fpie} and @option{-fPIE} both define the macros
14464 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
14465 for @option{-fpie} and 2 for @option{-fPIE}.
14466
14467 @item -fno-jump-tables
14468 @opindex fno-jump-tables
14469 Do not use jump tables for switch statements even where it would be
14470 more efficient than other code generation strategies.  This option is
14471 of use in conjunction with @option{-fpic} or @option{-fPIC} for
14472 building code which forms part of a dynamic linker and cannot
14473 reference the address of a jump table.  On some targets, jump tables
14474 do not require a GOT and this option is not needed.
14475
14476 @item -ffixed-@var{reg}
14477 @opindex ffixed
14478 Treat the register named @var{reg} as a fixed register; generated code
14479 should never refer to it (except perhaps as a stack pointer, frame
14480 pointer or in some other fixed role).
14481
14482 @var{reg} must be the name of a register.  The register names accepted
14483 are machine-specific and are defined in the @code{REGISTER_NAMES}
14484 macro in the machine description macro file.
14485
14486 This flag does not have a negative form, because it specifies a
14487 three-way choice.
14488
14489 @item -fcall-used-@var{reg}
14490 @opindex fcall-used
14491 Treat the register named @var{reg} as an allocable register that is
14492 clobbered by function calls.  It may be allocated for temporaries or
14493 variables that do not live across a call.  Functions compiled this way
14494 will not save and restore the register @var{reg}.
14495
14496 It is an error to used this flag with the frame pointer or stack pointer.
14497 Use of this flag for other registers that have fixed pervasive roles in
14498 the machine's execution model will produce disastrous results.
14499
14500 This flag does not have a negative form, because it specifies a
14501 three-way choice.
14502
14503 @item -fcall-saved-@var{reg}
14504 @opindex fcall-saved
14505 Treat the register named @var{reg} as an allocable register saved by
14506 functions.  It may be allocated even for temporaries or variables that
14507 live across a call.  Functions compiled this way will save and restore
14508 the register @var{reg} if they use it.
14509
14510 It is an error to used this flag with the frame pointer or stack pointer.
14511 Use of this flag for other registers that have fixed pervasive roles in
14512 the machine's execution model will produce disastrous results.
14513
14514 A different sort of disaster will result from the use of this flag for
14515 a register in which function values may be returned.
14516
14517 This flag does not have a negative form, because it specifies a
14518 three-way choice.
14519
14520 @item -fpack-struct[=@var{n}]
14521 @opindex fpack-struct
14522 Without a value specified, pack all structure members together without
14523 holes.  When a value is specified (which must be a small power of two), pack
14524 structure members according to this value, representing the maximum
14525 alignment (that is, objects with default alignment requirements larger than
14526 this will be output potentially unaligned at the next fitting location.
14527
14528 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
14529 code that is not binary compatible with code generated without that switch.
14530 Additionally, it makes the code suboptimal.
14531 Use it to conform to a non-default application binary interface.
14532
14533 @item -finstrument-functions
14534 @opindex finstrument-functions
14535 Generate instrumentation calls for entry and exit to functions.  Just
14536 after function entry and just before function exit, the following
14537 profiling functions will be called with the address of the current
14538 function and its call site.  (On some platforms,
14539 @code{__builtin_return_address} does not work beyond the current
14540 function, so the call site information may not be available to the
14541 profiling functions otherwise.)
14542
14543 @smallexample
14544 void __cyg_profile_func_enter (void *this_fn,
14545                                void *call_site);
14546 void __cyg_profile_func_exit  (void *this_fn,
14547                                void *call_site);
14548 @end smallexample
14549
14550 The first argument is the address of the start of the current function,
14551 which may be looked up exactly in the symbol table.
14552
14553 This instrumentation is also done for functions expanded inline in other
14554 functions.  The profiling calls will indicate where, conceptually, the
14555 inline function is entered and exited.  This means that addressable
14556 versions of such functions must be available.  If all your uses of a
14557 function are expanded inline, this may mean an additional expansion of
14558 code size.  If you use @samp{extern inline} in your C code, an
14559 addressable version of such functions must be provided.  (This is
14560 normally the case anyways, but if you get lucky and the optimizer always
14561 expands the functions inline, you might have gotten away without
14562 providing static copies.)
14563
14564 A function may be given the attribute @code{no_instrument_function}, in
14565 which case this instrumentation will not be done.  This can be used, for
14566 example, for the profiling functions listed above, high-priority
14567 interrupt routines, and any functions from which the profiling functions
14568 cannot safely be called (perhaps signal handlers, if the profiling
14569 routines generate output or allocate memory).
14570
14571 @item -fstack-check
14572 @opindex fstack-check
14573 Generate code to verify that you do not go beyond the boundary of the
14574 stack.  You should specify this flag if you are running in an
14575 environment with multiple threads, but only rarely need to specify it in
14576 a single-threaded environment since stack overflow is automatically
14577 detected on nearly all systems if there is only one stack.
14578
14579 Note that this switch does not actually cause checking to be done; the
14580 operating system must do that.  The switch causes generation of code
14581 to ensure that the operating system sees the stack being extended.
14582
14583 @item -fstack-limit-register=@var{reg}
14584 @itemx -fstack-limit-symbol=@var{sym}
14585 @itemx -fno-stack-limit
14586 @opindex fstack-limit-register
14587 @opindex fstack-limit-symbol
14588 @opindex fno-stack-limit
14589 Generate code to ensure that the stack does not grow beyond a certain value,
14590 either the value of a register or the address of a symbol.  If the stack
14591 would grow beyond the value, a signal is raised.  For most targets,
14592 the signal is raised before the stack overruns the boundary, so
14593 it is possible to catch the signal without taking special precautions.
14594
14595 For instance, if the stack starts at absolute address @samp{0x80000000}
14596 and grows downwards, you can use the flags
14597 @option{-fstack-limit-symbol=__stack_limit} and
14598 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
14599 of 128KB@.  Note that this may only work with the GNU linker.
14600
14601 @cindex aliasing of parameters
14602 @cindex parameters, aliased
14603 @item -fargument-alias
14604 @itemx -fargument-noalias
14605 @itemx -fargument-noalias-global
14606 @itemx -fargument-noalias-anything
14607 @opindex fargument-alias
14608 @opindex fargument-noalias
14609 @opindex fargument-noalias-global
14610 @opindex fargument-noalias-anything
14611 Specify the possible relationships among parameters and between
14612 parameters and global data.
14613
14614 @option{-fargument-alias} specifies that arguments (parameters) may
14615 alias each other and may alias global storage.@*
14616 @option{-fargument-noalias} specifies that arguments do not alias
14617 each other, but may alias global storage.@*
14618 @option{-fargument-noalias-global} specifies that arguments do not
14619 alias each other and do not alias global storage.
14620 @option{-fargument-noalias-anything} specifies that arguments do not
14621 alias any other storage.
14622
14623 Each language will automatically use whatever option is required by
14624 the language standard.  You should not need to use these options yourself.
14625
14626 @item -fleading-underscore
14627 @opindex fleading-underscore
14628 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
14629 change the way C symbols are represented in the object file.  One use
14630 is to help link with legacy assembly code.
14631
14632 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
14633 generate code that is not binary compatible with code generated without that
14634 switch.  Use it to conform to a non-default application binary interface.
14635 Not all targets provide complete support for this switch.
14636
14637 @item -ftls-model=@var{model}
14638 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
14639 The @var{model} argument should be one of @code{global-dynamic},
14640 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
14641
14642 The default without @option{-fpic} is @code{initial-exec}; with
14643 @option{-fpic} the default is @code{global-dynamic}.
14644
14645 @item -fvisibility=@var{default|internal|hidden|protected}
14646 @opindex fvisibility
14647 Set the default ELF image symbol visibility to the specified option---all
14648 symbols will be marked with this unless overridden within the code.
14649 Using this feature can very substantially improve linking and
14650 load times of shared object libraries, produce more optimized
14651 code, provide near-perfect API export and prevent symbol clashes.
14652 It is @strong{strongly} recommended that you use this in any shared objects
14653 you distribute.
14654
14655 Despite the nomenclature, @code{default} always means public ie;
14656 available to be linked against from outside the shared object.
14657 @code{protected} and @code{internal} are pretty useless in real-world
14658 usage so the only other commonly used option will be @code{hidden}.
14659 The default if @option{-fvisibility} isn't specified is
14660 @code{default}, i.e., make every
14661 symbol public---this causes the same behavior as previous versions of
14662 GCC@.
14663
14664 A good explanation of the benefits offered by ensuring ELF
14665 symbols have the correct visibility is given by ``How To Write
14666 Shared Libraries'' by Ulrich Drepper (which can be found at
14667 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
14668 solution made possible by this option to marking things hidden when
14669 the default is public is to make the default hidden and mark things
14670 public.  This is the norm with DLL's on Windows and with @option{-fvisibility=hidden}
14671 and @code{__attribute__ ((visibility("default")))} instead of
14672 @code{__declspec(dllexport)} you get almost identical semantics with
14673 identical syntax.  This is a great boon to those working with
14674 cross-platform projects.
14675
14676 For those adding visibility support to existing code, you may find
14677 @samp{#pragma GCC visibility} of use.  This works by you enclosing
14678 the declarations you wish to set visibility for with (for example)
14679 @samp{#pragma GCC visibility push(hidden)} and
14680 @samp{#pragma GCC visibility pop}.
14681 Bear in mind that symbol visibility should be viewed @strong{as
14682 part of the API interface contract} and thus all new code should
14683 always specify visibility when it is not the default ie; declarations
14684 only for use within the local DSO should @strong{always} be marked explicitly
14685 as hidden as so to avoid PLT indirection overheads---making this
14686 abundantly clear also aids readability and self-documentation of the code.
14687 Note that due to ISO C++ specification requirements, operator new and
14688 operator delete must always be of default visibility.
14689
14690 Be aware that headers from outside your project, in particular system
14691 headers and headers from any other library you use, may not be
14692 expecting to be compiled with visibility other than the default.  You
14693 may need to explicitly say @samp{#pragma GCC visibility push(default)}
14694 before including any such headers.
14695
14696 @samp{extern} declarations are not affected by @samp{-fvisibility}, so
14697 a lot of code can be recompiled with @samp{-fvisibility=hidden} with
14698 no modifications.  However, this means that calls to @samp{extern}
14699 functions with no explicit visibility will use the PLT, so it is more
14700 effective to use @samp{__attribute ((visibility))} and/or
14701 @samp{#pragma GCC visibility} to tell the compiler which @samp{extern}
14702 declarations should be treated as hidden.
14703
14704 Note that @samp{-fvisibility} does affect C++ vague linkage
14705 entities. This means that, for instance, an exception class that will
14706 be thrown between DSOs must be explicitly marked with default
14707 visibility so that the @samp{type_info} nodes will be unified between
14708 the DSOs.
14709
14710 An overview of these techniques, their benefits and how to use them
14711 is at @w{@uref{http://gcc.gnu.org/wiki/Visibility}}.
14712
14713 @end table
14714
14715 @c man end
14716
14717 @node Environment Variables
14718 @section Environment Variables Affecting GCC
14719 @cindex environment variables
14720
14721 @c man begin ENVIRONMENT
14722 This section describes several environment variables that affect how GCC
14723 operates.  Some of them work by specifying directories or prefixes to use
14724 when searching for various kinds of files.  Some are used to specify other
14725 aspects of the compilation environment.
14726
14727 Note that you can also specify places to search using options such as
14728 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
14729 take precedence over places specified using environment variables, which
14730 in turn take precedence over those specified by the configuration of GCC@.
14731 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
14732 GNU Compiler Collection (GCC) Internals}.
14733
14734 @table @env
14735 @item LANG
14736 @itemx LC_CTYPE
14737 @c @itemx LC_COLLATE
14738 @itemx LC_MESSAGES
14739 @c @itemx LC_MONETARY
14740 @c @itemx LC_NUMERIC
14741 @c @itemx LC_TIME
14742 @itemx LC_ALL
14743 @findex LANG
14744 @findex LC_CTYPE
14745 @c @findex LC_COLLATE
14746 @findex LC_MESSAGES
14747 @c @findex LC_MONETARY
14748 @c @findex LC_NUMERIC
14749 @c @findex LC_TIME
14750 @findex LC_ALL
14751 @cindex locale
14752 These environment variables control the way that GCC uses
14753 localization information that allow GCC to work with different
14754 national conventions.  GCC inspects the locale categories
14755 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
14756 so.  These locale categories can be set to any value supported by your
14757 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
14758 Kingdom encoded in UTF-8.
14759
14760 The @env{LC_CTYPE} environment variable specifies character
14761 classification.  GCC uses it to determine the character boundaries in
14762 a string; this is needed for some multibyte encodings that contain quote
14763 and escape characters that would otherwise be interpreted as a string
14764 end or escape.
14765
14766 The @env{LC_MESSAGES} environment variable specifies the language to
14767 use in diagnostic messages.
14768
14769 If the @env{LC_ALL} environment variable is set, it overrides the value
14770 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
14771 and @env{LC_MESSAGES} default to the value of the @env{LANG}
14772 environment variable.  If none of these variables are set, GCC
14773 defaults to traditional C English behavior.
14774
14775 @item TMPDIR
14776 @findex TMPDIR
14777 If @env{TMPDIR} is set, it specifies the directory to use for temporary
14778 files.  GCC uses temporary files to hold the output of one stage of
14779 compilation which is to be used as input to the next stage: for example,
14780 the output of the preprocessor, which is the input to the compiler
14781 proper.
14782
14783 @item GCC_EXEC_PREFIX
14784 @findex GCC_EXEC_PREFIX
14785 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
14786 names of the subprograms executed by the compiler.  No slash is added
14787 when this prefix is combined with the name of a subprogram, but you can
14788 specify a prefix that ends with a slash if you wish.
14789
14790 If @env{GCC_EXEC_PREFIX} is not set, GCC will attempt to figure out
14791 an appropriate prefix to use based on the pathname it was invoked with.
14792
14793 If GCC cannot find the subprogram using the specified prefix, it
14794 tries looking in the usual places for the subprogram.
14795
14796 The default value of @env{GCC_EXEC_PREFIX} is
14797 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
14798 the installed compiler. In many cases @var{prefix} is the value
14799 of @code{prefix} when you ran the @file{configure} script.
14800
14801 Other prefixes specified with @option{-B} take precedence over this prefix.
14802
14803 This prefix is also used for finding files such as @file{crt0.o} that are
14804 used for linking.
14805
14806 In addition, the prefix is used in an unusual way in finding the
14807 directories to search for header files.  For each of the standard
14808 directories whose name normally begins with @samp{/usr/local/lib/gcc}
14809 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
14810 replacing that beginning with the specified prefix to produce an
14811 alternate directory name.  Thus, with @option{-Bfoo/}, GCC will search
14812 @file{foo/bar} where it would normally search @file{/usr/local/lib/bar}.
14813 These alternate directories are searched first; the standard directories
14814 come next. If a standard directory begins with the configured
14815 @var{prefix} then the value of @var{prefix} is replaced by
14816 @env{GCC_EXEC_PREFIX} when looking for header files.
14817
14818 @item COMPILER_PATH
14819 @findex COMPILER_PATH
14820 The value of @env{COMPILER_PATH} is a colon-separated list of
14821 directories, much like @env{PATH}.  GCC tries the directories thus
14822 specified when searching for subprograms, if it can't find the
14823 subprograms using @env{GCC_EXEC_PREFIX}.
14824
14825 @item LIBRARY_PATH
14826 @findex LIBRARY_PATH
14827 The value of @env{LIBRARY_PATH} is a colon-separated list of
14828 directories, much like @env{PATH}.  When configured as a native compiler,
14829 GCC tries the directories thus specified when searching for special
14830 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
14831 using GCC also uses these directories when searching for ordinary
14832 libraries for the @option{-l} option (but directories specified with
14833 @option{-L} come first).
14834
14835 @item LANG
14836 @findex LANG
14837 @cindex locale definition
14838 This variable is used to pass locale information to the compiler.  One way in
14839 which this information is used is to determine the character set to be used
14840 when character literals, string literals and comments are parsed in C and C++.
14841 When the compiler is configured to allow multibyte characters,
14842 the following values for @env{LANG} are recognized:
14843
14844 @table @samp
14845 @item C-JIS
14846 Recognize JIS characters.
14847 @item C-SJIS
14848 Recognize SJIS characters.
14849 @item C-EUCJP
14850 Recognize EUCJP characters.
14851 @end table
14852
14853 If @env{LANG} is not defined, or if it has some other value, then the
14854 compiler will use mblen and mbtowc as defined by the default locale to
14855 recognize and translate multibyte characters.
14856 @end table
14857
14858 @noindent
14859 Some additional environments variables affect the behavior of the
14860 preprocessor.
14861
14862 @include cppenv.texi
14863
14864 @c man end
14865
14866 @node Precompiled Headers
14867 @section Using Precompiled Headers
14868 @cindex precompiled headers
14869 @cindex speed of compilation
14870
14871 Often large projects have many header files that are included in every
14872 source file.  The time the compiler takes to process these header files
14873 over and over again can account for nearly all of the time required to
14874 build the project.  To make builds faster, GCC allows users to
14875 `precompile' a header file; then, if builds can use the precompiled
14876 header file they will be much faster.
14877
14878 To create a precompiled header file, simply compile it as you would any
14879 other file, if necessary using the @option{-x} option to make the driver
14880 treat it as a C or C++ header file.  You will probably want to use a
14881 tool like @command{make} to keep the precompiled header up-to-date when
14882 the headers it contains change.
14883
14884 A precompiled header file will be searched for when @code{#include} is
14885 seen in the compilation.  As it searches for the included file
14886 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
14887 compiler looks for a precompiled header in each directory just before it
14888 looks for the include file in that directory.  The name searched for is
14889 the name specified in the @code{#include} with @samp{.gch} appended.  If
14890 the precompiled header file can't be used, it is ignored.
14891
14892 For instance, if you have @code{#include "all.h"}, and you have
14893 @file{all.h.gch} in the same directory as @file{all.h}, then the
14894 precompiled header file will be used if possible, and the original
14895 header will be used otherwise.
14896
14897 Alternatively, you might decide to put the precompiled header file in a
14898 directory and use @option{-I} to ensure that directory is searched
14899 before (or instead of) the directory containing the original header.
14900 Then, if you want to check that the precompiled header file is always
14901 used, you can put a file of the same name as the original header in this
14902 directory containing an @code{#error} command.
14903
14904 This also works with @option{-include}.  So yet another way to use
14905 precompiled headers, good for projects not designed with precompiled
14906 header files in mind, is to simply take most of the header files used by
14907 a project, include them from another header file, precompile that header
14908 file, and @option{-include} the precompiled header.  If the header files
14909 have guards against multiple inclusion, they will be skipped because
14910 they've already been included (in the precompiled header).
14911
14912 If you need to precompile the same header file for different
14913 languages, targets, or compiler options, you can instead make a
14914 @emph{directory} named like @file{all.h.gch}, and put each precompiled
14915 header in the directory, perhaps using @option{-o}.  It doesn't matter
14916 what you call the files in the directory, every precompiled header in
14917 the directory will be considered.  The first precompiled header
14918 encountered in the directory that is valid for this compilation will
14919 be used; they're searched in no particular order.
14920
14921 There are many other possibilities, limited only by your imagination,
14922 good sense, and the constraints of your build system.
14923
14924 A precompiled header file can be used only when these conditions apply:
14925
14926 @itemize
14927 @item
14928 Only one precompiled header can be used in a particular compilation.
14929
14930 @item
14931 A precompiled header can't be used once the first C token is seen.  You
14932 can have preprocessor directives before a precompiled header; you can
14933 even include a precompiled header from inside another header, so long as
14934 there are no C tokens before the @code{#include}.
14935
14936 @item
14937 The precompiled header file must be produced for the same language as
14938 the current compilation.  You can't use a C precompiled header for a C++
14939 compilation.
14940
14941 @item
14942 The precompiled header file must have been produced by the same compiler
14943 binary as the current compilation is using.
14944
14945 @item
14946 Any macros defined before the precompiled header is included must
14947 either be defined in the same way as when the precompiled header was
14948 generated, or must not affect the precompiled header, which usually
14949 means that they don't appear in the precompiled header at all.
14950
14951 The @option{-D} option is one way to define a macro before a
14952 precompiled header is included; using a @code{#define} can also do it.
14953 There are also some options that define macros implicitly, like
14954 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
14955 defined this way.
14956
14957 @item If debugging information is output when using the precompiled
14958 header, using @option{-g} or similar, the same kind of debugging information
14959 must have been output when building the precompiled header.  However,
14960 a precompiled header built using @option{-g} can be used in a compilation
14961 when no debugging information is being output.
14962
14963 @item The same @option{-m} options must generally be used when building
14964 and using the precompiled header.  @xref{Submodel Options},
14965 for any cases where this rule is relaxed.
14966
14967 @item Each of the following options must be the same when building and using
14968 the precompiled header:
14969
14970 @gccoptlist{-fexceptions -funit-at-a-time}
14971
14972 @item
14973 Some other command-line options starting with @option{-f},
14974 @option{-p}, or @option{-O} must be defined in the same way as when
14975 the precompiled header was generated.  At present, it's not clear
14976 which options are safe to change and which are not; the safest choice
14977 is to use exactly the same options when generating and using the
14978 precompiled header.  The following are known to be safe:
14979
14980 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
14981 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
14982 -fsched-verbose=<number>  -fschedule-insns  -fvisibility= @gol
14983 -pedantic-errors}
14984
14985 @end itemize
14986
14987 For all of these except the last, the compiler will automatically
14988 ignore the precompiled header if the conditions aren't met.  If you
14989 find an option combination that doesn't work and doesn't cause the
14990 precompiled header to be ignored, please consider filing a bug report,
14991 see @ref{Bugs}.
14992
14993 If you do use differing options when generating and using the
14994 precompiled header, the actual behavior will be a mixture of the
14995 behavior for the options.  For instance, if you use @option{-g} to
14996 generate the precompiled header but not when using it, you may or may
14997 not get debugging information for routines in the precompiled header.
14998
14999 @node Running Protoize
15000 @section Running Protoize
15001
15002 The program @code{protoize} is an optional part of GCC@.  You can use
15003 it to add prototypes to a program, thus converting the program to ISO
15004 C in one respect.  The companion program @code{unprotoize} does the
15005 reverse: it removes argument types from any prototypes that are found.
15006
15007 When you run these programs, you must specify a set of source files as
15008 command line arguments.  The conversion programs start out by compiling
15009 these files to see what functions they define.  The information gathered
15010 about a file @var{foo} is saved in a file named @file{@var{foo}.X}.
15011
15012 After scanning comes actual conversion.  The specified files are all
15013 eligible to be converted; any files they include (whether sources or
15014 just headers) are eligible as well.
15015
15016 But not all the eligible files are converted.  By default,
15017 @code{protoize} and @code{unprotoize} convert only source and header
15018 files in the current directory.  You can specify additional directories
15019 whose files should be converted with the @option{-d @var{directory}}
15020 option.  You can also specify particular files to exclude with the
15021 @option{-x @var{file}} option.  A file is converted if it is eligible, its
15022 directory name matches one of the specified directory names, and its
15023 name within the directory has not been excluded.
15024
15025 Basic conversion with @code{protoize} consists of rewriting most
15026 function definitions and function declarations to specify the types of
15027 the arguments.  The only ones not rewritten are those for varargs
15028 functions.
15029
15030 @code{protoize} optionally inserts prototype declarations at the
15031 beginning of the source file, to make them available for any calls that
15032 precede the function's definition.  Or it can insert prototype
15033 declarations with block scope in the blocks where undeclared functions
15034 are called.
15035
15036 Basic conversion with @code{unprotoize} consists of rewriting most
15037 function declarations to remove any argument types, and rewriting
15038 function definitions to the old-style pre-ISO form.
15039
15040 Both conversion programs print a warning for any function declaration or
15041 definition that they can't convert.  You can suppress these warnings
15042 with @option{-q}.
15043
15044 The output from @code{protoize} or @code{unprotoize} replaces the
15045 original source file.  The original file is renamed to a name ending
15046 with @samp{.save} (for DOS, the saved filename ends in @samp{.sav}
15047 without the original @samp{.c} suffix).  If the @samp{.save} (@samp{.sav}
15048 for DOS) file already exists, then the source file is simply discarded.
15049
15050 @code{protoize} and @code{unprotoize} both depend on GCC itself to
15051 scan the program and collect information about the functions it uses.
15052 So neither of these programs will work until GCC is installed.
15053
15054 Here is a table of the options you can use with @code{protoize} and
15055 @code{unprotoize}.  Each option works with both programs unless
15056 otherwise stated.
15057
15058 @table @code
15059 @item -B @var{directory}
15060 Look for the file @file{SYSCALLS.c.X} in @var{directory}, instead of the
15061 usual directory (normally @file{/usr/local/lib}).  This file contains
15062 prototype information about standard system functions.  This option
15063 applies only to @code{protoize}.
15064
15065 @item -c @var{compilation-options}
15066 Use @var{compilation-options} as the options when running @command{gcc} to
15067 produce the @samp{.X} files.  The special option @option{-aux-info} is
15068 always passed in addition, to tell @command{gcc} to write a @samp{.X} file.
15069
15070 Note that the compilation options must be given as a single argument to
15071 @code{protoize} or @code{unprotoize}.  If you want to specify several
15072 @command{gcc} options, you must quote the entire set of compilation options
15073 to make them a single word in the shell.
15074
15075 There are certain @command{gcc} arguments that you cannot use, because they
15076 would produce the wrong kind of output.  These include @option{-g},
15077 @option{-O}, @option{-c}, @option{-S}, and @option{-o} If you include these in
15078 the @var{compilation-options}, they are ignored.
15079
15080 @item -C
15081 Rename files to end in @samp{.C} (@samp{.cc} for DOS-based file
15082 systems) instead of @samp{.c}.  This is convenient if you are converting
15083 a C program to C++.  This option applies only to @code{protoize}.
15084
15085 @item -g
15086 Add explicit global declarations.  This means inserting explicit
15087 declarations at the beginning of each source file for each function
15088 that is called in the file and was not declared.  These declarations
15089 precede the first function definition that contains a call to an
15090 undeclared function.  This option applies only to @code{protoize}.
15091
15092 @item -i @var{string}
15093 Indent old-style parameter declarations with the string @var{string}.
15094 This option applies only to @code{protoize}.
15095
15096 @code{unprotoize} converts prototyped function definitions to old-style
15097 function definitions, where the arguments are declared between the
15098 argument list and the initial @samp{@{}.  By default, @code{unprotoize}
15099 uses five spaces as the indentation.  If you want to indent with just
15100 one space instead, use @option{-i " "}.
15101
15102 @item -k
15103 Keep the @samp{.X} files.  Normally, they are deleted after conversion
15104 is finished.
15105
15106 @item -l
15107 Add explicit local declarations.  @code{protoize} with @option{-l} inserts
15108 a prototype declaration for each function in each block which calls the
15109 function without any declaration.  This option applies only to
15110 @code{protoize}.
15111
15112 @item -n
15113 Make no real changes.  This mode just prints information about the conversions
15114 that would have been done without @option{-n}.
15115
15116 @item -N
15117 Make no @samp{.save} files.  The original files are simply deleted.
15118 Use this option with caution.
15119
15120 @item -p @var{program}
15121 Use the program @var{program} as the compiler.  Normally, the name
15122 @file{gcc} is used.
15123
15124 @item -q
15125 Work quietly.  Most warnings are suppressed.
15126
15127 @item -v
15128 Print the version number, just like @option{-v} for @command{gcc}.
15129 @end table
15130
15131 If you need special compiler options to compile one of your program's
15132 source files, then you should generate that file's @samp{.X} file
15133 specially, by running @command{gcc} on that source file with the
15134 appropriate options and the option @option{-aux-info}.  Then run
15135 @code{protoize} on the entire set of files.  @code{protoize} will use
15136 the existing @samp{.X} file because it is newer than the source file.
15137 For example:
15138
15139 @smallexample
15140 gcc -Dfoo=bar file1.c -aux-info file1.X
15141 protoize *.c
15142 @end smallexample
15143
15144 @noindent
15145 You need to include the special files along with the rest in the
15146 @code{protoize} command, even though their @samp{.X} files already
15147 exist, because otherwise they won't get converted.
15148
15149 @xref{Protoize Caveats}, for more information on how to use
15150 @code{protoize} successfully.