OSDN Git Service

* doc/invoke.texi (Option Summary, optimizations): Remove
[pf3gnuchains/gcc-fork.git] / gcc / doc / invoke.texi
1 @c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2 @c 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
3 @c Free Software Foundation, Inc.
4 @c This is part of the GCC manual.
5 @c For copying conditions, see the file gcc.texi.
6
7 @ignore
8 @c man begin INCLUDE
9 @include gcc-vers.texi
10 @c man end
11
12 @c man begin COPYRIGHT
13 Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
14 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
15 2007 Free Software Foundation, Inc.
16
17 Permission is granted to copy, distribute and/or modify this document
18 under the terms of the GNU Free Documentation License, Version 1.2 or
19 any later version published by the Free Software Foundation; with the
20 Invariant Sections being ``GNU General Public License'' and ``Funding
21 Free Software'', the Front-Cover texts being (a) (see below), and with
22 the Back-Cover Texts being (b) (see below).  A copy of the license is
23 included in the gfdl(7) man page.
24
25 (a) The FSF's Front-Cover Text is:
26
27      A GNU Manual
28
29 (b) The FSF's Back-Cover Text is:
30
31      You have freedom to copy and modify this GNU Manual, like GNU
32      software.  Copies published by the Free Software Foundation raise
33      funds for GNU development.
34 @c man end
35 @c Set file name and title for the man page.
36 @setfilename gcc
37 @settitle GNU project C and C++ compiler
38 @c man begin SYNOPSIS
39 gcc [@option{-c}|@option{-S}|@option{-E}] [@option{-std=}@var{standard}]
40     [@option{-g}] [@option{-pg}] [@option{-O}@var{level}]
41     [@option{-W}@var{warn}@dots{}] [@option{-pedantic}]
42     [@option{-I}@var{dir}@dots{}] [@option{-L}@var{dir}@dots{}]
43     [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}]
44     [@option{-f}@var{option}@dots{}] [@option{-m}@var{machine-option}@dots{}]
45     [@option{-o} @var{outfile}] [@@@var{file}] @var{infile}@dots{}
46
47 Only the most useful options are listed here; see below for the
48 remainder.  @samp{g++} accepts mostly the same options as @samp{gcc}.
49 @c man end
50 @c man begin SEEALSO
51 gpl(7), gfdl(7), fsf-funding(7),
52 cpp(1), gcov(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1)
53 and the Info entries for @file{gcc}, @file{cpp}, @file{as},
54 @file{ld}, @file{binutils} and @file{gdb}.
55 @c man end
56 @c man begin BUGS
57 For instructions on reporting bugs, see
58 @w{@value{BUGURL}}.
59 @c man end
60 @c man begin AUTHOR
61 See the Info entry for @command{gcc}, or
62 @w{@uref{http://gcc.gnu.org/onlinedocs/gcc/Contributors.html}},
63 for contributors to GCC@.
64 @c man end
65 @end ignore
66
67 @node Invoking GCC
68 @chapter GCC Command Options
69 @cindex GCC command options
70 @cindex command options
71 @cindex options, GCC command
72
73 @c man begin DESCRIPTION
74 When you invoke GCC, it normally does preprocessing, compilation,
75 assembly and linking.  The ``overall options'' allow you to stop this
76 process at an intermediate stage.  For example, the @option{-c} option
77 says not to run the linker.  Then the output consists of object files
78 output by the assembler.
79
80 Other options are passed on to one stage of processing.  Some options
81 control the preprocessor and others the compiler itself.  Yet other
82 options control the assembler and linker; most of these are not
83 documented here, since you rarely need to use any of them.
84
85 @cindex C compilation options
86 Most of the command line options that you can use with GCC are useful
87 for C programs; when an option is only useful with another language
88 (usually C++), the explanation says so explicitly.  If the description
89 for a particular option does not mention a source language, you can use
90 that option with all supported languages.
91
92 @cindex C++ compilation options
93 @xref{Invoking G++,,Compiling C++ Programs}, for a summary of special
94 options for compiling C++ programs.
95
96 @cindex grouping options
97 @cindex options, grouping
98 The @command{gcc} program accepts options and file names as operands.  Many
99 options have multi-letter names; therefore multiple single-letter options
100 may @emph{not} be grouped: @option{-dr} is very different from @w{@samp{-d
101 -r}}.
102
103 @cindex order of options
104 @cindex options, order
105 You can mix options and other arguments.  For the most part, the order
106 you use doesn't matter.  Order does matter when you use several
107 options of the same kind; for example, if you specify @option{-L} more
108 than once, the directories are searched in the order specified.  Also,
109 the placement of the @option{-l} option is significant.
110
111 Many options have long names starting with @samp{-f} or with
112 @samp{-W}---for example,
113 @option{-fmove-loop-invariants}, @option{-Wformat} and so on.  Most of
114 these have both positive and negative forms; the negative form of
115 @option{-ffoo} would be @option{-fno-foo}.  This manual documents
116 only one of these two forms, whichever one is not the default.
117
118 @c man end
119
120 @xref{Option Index}, for an index to GCC's options.
121
122 @menu
123 * Option Summary::      Brief list of all options, without explanations.
124 * Overall Options::     Controlling the kind of output:
125                         an executable, object files, assembler files,
126                         or preprocessed source.
127 * Invoking G++::        Compiling C++ programs.
128 * C Dialect Options::   Controlling the variant of C language compiled.
129 * C++ Dialect Options:: Variations on C++.
130 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
131                         and Objective-C++.
132 * Language Independent Options:: Controlling how diagnostics should be
133                         formatted.
134 * Warning Options::     How picky should the compiler be?
135 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
136 * Optimize Options::    How much optimization?
137 * Preprocessor Options:: Controlling header files and macro definitions.
138                          Also, getting dependency information for Make.
139 * Assembler Options::   Passing options to the assembler.
140 * Link Options::        Specifying libraries and so on.
141 * Directory Options::   Where to find header files and libraries.
142                         Where to find the compiler executable files.
143 * Spec Files::          How to pass switches to sub-processes.
144 * Target Options::      Running a cross-compiler, or an old version of GCC.
145 * Submodel Options::    Specifying minor hardware or convention variations,
146                         such as 68010 vs 68020.
147 * Code Gen Options::    Specifying conventions for function calls, data layout
148                         and register usage.
149 * Environment Variables:: Env vars that affect GCC.
150 * Precompiled Headers:: Compiling a header once, and using it many times.
151 * Running Protoize::    Automatically adding or removing function prototypes.
152 @end menu
153
154 @c man begin OPTIONS
155
156 @node Option Summary
157 @section Option Summary
158
159 Here is a summary of all the options, grouped by type.  Explanations are
160 in the following sections.
161
162 @table @emph
163 @item Overall Options
164 @xref{Overall Options,,Options Controlling the Kind of Output}.
165 @gccoptlist{-c  -S  -E  -o @var{file}  -combine  -pipe  -pass-exit-codes  @gol
166 -x @var{language}  -v  -###  --help@r{[}=@var{class}@r{]}  --target-help  @gol
167 --version @@@var{file}}
168
169 @item C Language Options
170 @xref{C Dialect Options,,Options Controlling C Dialect}.
171 @gccoptlist{-ansi  -std=@var{standard}  -fgnu89-inline @gol
172 -aux-info @var{filename} @gol
173 -fno-asm  -fno-builtin  -fno-builtin-@var{function} @gol
174 -fhosted  -ffreestanding -fopenmp -fms-extensions @gol
175 -trigraphs  -no-integrated-cpp  -traditional  -traditional-cpp @gol
176 -fallow-single-precision  -fcond-mismatch -flax-vector-conversions @gol
177 -fsigned-bitfields  -fsigned-char @gol
178 -funsigned-bitfields  -funsigned-char}
179
180 @item C++ Language Options
181 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
182 @gccoptlist{-fabi-version=@var{n}  -fno-access-control  -fcheck-new @gol
183 -fconserve-space  -ffriend-injection @gol
184 -fno-elide-constructors @gol
185 -fno-enforce-eh-specs @gol
186 -ffor-scope  -fno-for-scope  -fno-gnu-keywords @gol
187 -fno-implicit-templates @gol
188 -fno-implicit-inline-templates @gol
189 -fno-implement-inlines  -fms-extensions @gol
190 -fno-nonansi-builtins  -fno-operator-names @gol
191 -fno-optional-diags  -fpermissive @gol
192 -frepo  -fno-rtti  -fstats  -ftemplate-depth-@var{n} @gol
193 -fno-threadsafe-statics -fuse-cxa-atexit  -fno-weak  -nostdinc++ @gol
194 -fno-default-inline  -fvisibility-inlines-hidden @gol
195 -fvisibility-ms-compat @gol
196 -Wabi  -Wctor-dtor-privacy @gol
197 -Wnon-virtual-dtor  -Wreorder @gol
198 -Weffc++  -Wno-deprecated  -Wstrict-null-sentinel @gol
199 -Wno-non-template-friend  -Wold-style-cast @gol
200 -Woverloaded-virtual  -Wno-pmf-conversions @gol
201 -Wsign-promo}
202
203 @item Objective-C and Objective-C++ Language Options
204 @xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling
205 Objective-C and Objective-C++ Dialects}.
206 @gccoptlist{-fconstant-string-class=@var{class-name} @gol
207 -fgnu-runtime  -fnext-runtime @gol
208 -fno-nil-receivers @gol
209 -fobjc-call-cxx-cdtors @gol
210 -fobjc-direct-dispatch @gol
211 -fobjc-exceptions @gol
212 -fobjc-gc @gol
213 -freplace-objc-classes @gol
214 -fzero-link @gol
215 -gen-decls @gol
216 -Wassign-intercept @gol
217 -Wno-protocol  -Wselector @gol
218 -Wstrict-selector-match @gol
219 -Wundeclared-selector}
220
221 @item Language Independent Options
222 @xref{Language Independent Options,,Options to Control Diagnostic Messages Formatting}.
223 @gccoptlist{-fmessage-length=@var{n}  @gol
224 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol
225 -fdiagnostics-show-option}
226
227 @item Warning Options
228 @xref{Warning Options,,Options to Request or Suppress Warnings}.
229 @gccoptlist{-fsyntax-only  -pedantic  -pedantic-errors @gol
230 -w  -Wextra  -Wall  -Waddress  -Waggregate-return  -Warray-bounds @gol
231 -Wno-attributes -Wc++-compat -Wc++0x-compat -Wcast-align  -Wcast-qual  @gol
232 -Wchar-subscripts -Wclobbered  -Wcomment @gol
233 -Wconversion  -Wcoverage-mismatch  -Wno-deprecated-declarations @gol
234 -Wdisabled-optimization  -Wno-div-by-zero  @gol
235 -Wempty-body  -Wno-endif-labels @gol
236 -Werror  -Werror=* @gol
237 -Wfatal-errors  -Wfloat-equal  -Wformat  -Wformat=2 @gol
238 -Wno-format-extra-args -Wformat-nonliteral @gol
239 -Wformat-security  -Wformat-y2k @gol
240 -Wimplicit  -Wimplicit-function-declaration  -Wimplicit-int @gol
241 -Wimport  -Wno-import  -Winit-self  -Winline @gol
242 -Wno-int-to-pointer-cast -Wno-invalid-offsetof @gol
243 -Winvalid-pch -Wlarger-than-@var{len}  -Wunsafe-loop-optimizations @gol
244 -Wlogical-op -Wlong-long @gol
245 -Wmain  -Wmissing-braces  -Wmissing-field-initializers @gol
246 -Wmissing-format-attribute  -Wmissing-include-dirs @gol
247 -Wmissing-noreturn @gol
248 -Wno-multichar  -Wnonnull  -Wno-overflow @gol
249 -Woverlength-strings  -Wpacked  -Wpadded @gol
250 -Wparentheses  -Wpointer-arith  -Wno-pointer-to-int-cast @gol
251 -Wredundant-decls @gol
252 -Wreturn-type  -Wsequence-point  -Wshadow @gol
253 -Wsign-compare  -Wsign-conversion  -Wstack-protector @gol
254 -Wstrict-aliasing -Wstrict-aliasing=n @gol
255 -Wstrict-overflow -Wstrict-overflow=@var{n} @gol
256 -Wswitch  -Wswitch-default  -Wswitch-enum @gol
257 -Wsystem-headers  -Wtrigraphs  -Wtype-limits  -Wundef  -Wuninitialized @gol
258 -Wunknown-pragmas  -Wno-pragmas -Wunreachable-code @gol
259 -Wunused  -Wunused-function  -Wunused-label  -Wunused-parameter @gol
260 -Wunused-value  -Wunused-variable @gol
261 -Wvariadic-macros -Wvla @gol
262 -Wvolatile-register-var  -Wwrite-strings}
263
264 @item C-only Warning Options
265 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
266 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
267 -Wold-style-declaration  -Wold-style-definition @gol
268 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
269 -Wdeclaration-after-statement -Wpointer-sign}
270
271 @item Debugging Options
272 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
273 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
274 -fdbg-cnt-list -fdbg-cnt=@var{counter-value-list} @gol
275 -fdump-noaddr -fdump-unnumbered  -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
276 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
277 -fdump-ipa-all -fdump-ipa-cgraph @gol
278 -fdump-tree-all @gol
279 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
280 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
281 -fdump-tree-inlined@r{[}-@var{n}@r{]} @gol
282 -fdump-tree-cfg -fdump-tree-vcg -fdump-tree-alias @gol
283 -fdump-tree-ch @gol
284 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
285 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
286 -fdump-tree-gimple@r{[}-raw@r{]} -fdump-tree-mudflap@r{[}-@var{n}@r{]} @gol
287 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
288 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
289 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
290 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
291 -fdump-tree-copyrename@r{[}-@var{n}@r{]} @gol
292 -fdump-tree-nrv -fdump-tree-vect @gol
293 -fdump-tree-sink @gol
294 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
295 -fdump-tree-salias @gol
296 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
297 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
298 -ftree-vectorizer-verbose=@var{n} @gol
299 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
300 -feliminate-dwarf2-dups -feliminate-unused-debug-types @gol
301 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
302 -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
303 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
304 -ftest-coverage  -ftime-report -fvar-tracking @gol
305 -g  -g@var{level}  -gcoff -gdwarf-2 @gol
306 -ggdb  -gstabs  -gstabs+  -gvms  -gxcoff  -gxcoff+ @gol
307 -fdebug-prefix-map=@var{old}=@var{new} @gol
308 -femit-struct-debug-baseonly -femit-struct-debug-reduced @gol
309 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
310 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
311 -print-multi-directory  -print-multi-lib @gol
312 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
313 -print-sysroot-headers-suffix @gol
314 -save-temps  -time}
315
316 @item Optimization Options
317 @xref{Optimize Options,,Options that Control Optimization}.
318 @gccoptlist{-falign-functions[=@var{n}]  -falign-jumps[=@var{n}] @gol
319 -falign-labels[=@var{n}]  -falign-loops[=@var{n}]  @gol
320 -fassociative-math  -freciprocal-math @gol
321 -fmudflap -fmudflapth -fmudflapir @gol
322 -fbranch-probabilities -fprofile-values -fvpt  @gol
323 -fbranch-target-load-optimize @gol
324 -fbranch-target-load-optimize2 -fbtr-bb-exclusive @gol
325 -fcaller-saves  -fcprop-registers  -fcse-follow-jumps @gol
326 -fcse-skip-blocks  -fcx-limited-range  -fdata-sections @gol
327 -fdelayed-branch  -fdelete-null-pointer-checks -fearly-inlining @gol
328 -fexpensive-optimizations  -ffast-math  -ffloat-store @gol
329 -fforce-addr  -fforward-propagate  -ffunction-sections @gol
330 -fgcse  -fgcse-lm  -fgcse-sm  -fgcse-las  -fgcse-after-reload @gol
331 -fcrossjumping  -fif-conversion  -fif-conversion2 @gol
332 -finline-functions  -finline-functions-called-once @gol
333 -finline-small-functions -finline-limit=@var{n}  -fkeep-inline-functions @gol
334 -fkeep-static-consts  -fmerge-constants  -fmerge-all-constants @gol
335 -fmodulo-sched -fmodulo-sched-allow-regmoves -fno-branch-count-reg @gol
336 -fno-default-inline  -fno-defer-pop -fmove-loop-invariants @gol
337 -fno-function-cse  -fno-guess-branch-probability @gol
338 -fno-inline  -fno-math-errno  -fno-peephole  -fno-peephole2 @gol
339 -funsafe-math-optimizations  -funsafe-loop-optimizations @gol
340 -ffinite-math-only  -fno-signed-zeros @gol
341 -fno-toplevel-reorder -fno-trapping-math  -fno-zero-initialized-in-bss @gol
342 -fomit-frame-pointer  -foptimize-register-move @gol
343 -foptimize-sibling-calls  -fpredictive-commoning -fprefetch-loop-arrays @gol
344 -fprofile-generate -fprofile-use @gol
345 -fregmove  -frename-registers @gol
346 -freorder-blocks  -freorder-blocks-and-partition -freorder-functions @gol
347 -frerun-cse-after-loop @gol
348 -frounding-math -frtl-abstract-sequences @gol
349 -fschedule-insns  -fschedule-insns2 @gol
350 -fno-sched-interblock  -fno-sched-spec  -fsched-spec-load @gol
351 -fsched-spec-load-dangerous  @gol
352 -fsched-stalled-insns[=@var{n}] -fsched-stalled-insns-dep[=@var{n}] @gol
353 -fsched2-use-superblocks @gol
354 -fsched2-use-traces -fsee -freschedule-modulo-scheduled-loops @gol
355 -fsection-anchors  -fsignaling-nans  -fsingle-precision-constant @gol
356 -fsplit-wide-types -fstack-protector  -fstack-protector-all @gol
357 -fstrict-aliasing  -fstrict-overflow  -ftracer  -fthread-jumps @gol
358 -funroll-all-loops  -funroll-loops  -fpeel-loops @gol
359 -fsplit-ivs-in-unroller -funswitch-loops @gol
360 -fvariable-expansion-in-unroller -ftree-reassoc @gol
361 -ftree-pre  -ftree-ccp  -ftree-dce -ftree-loop-optimize @gol
362 -ftree-loop-linear -ftree-loop-im -ftree-loop-ivcanon -fivopts @gol
363 -fcheck-data-deps -ftree-parallelize-loops=@var{n} @gol
364 -ftree-dominator-opts -ftree-dse -ftree-copyrename -ftree-sink @gol
365 -ftree-ch -ftree-sra -ftree-ter -ftree-fre -ftree-vectorize @gol
366 -ftree-vect-loop-version -fvect-cost-model -ftree-salias -fipa-pta -fweb @gol
367 -ftree-copy-prop -ftree-store-ccp -ftree-store-copy-prop -ftree-vrp @gol
368 -funit-at-a-time -fwhole-program @gol
369 --param @var{name}=@var{value}
370 -O  -O0  -O1  -O2  -O3  -Os}
371
372 @item Preprocessor Options
373 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
374 @gccoptlist{-A@var{question}=@var{answer} @gol
375 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
376 -C  -dD  -dI  -dM  -dN @gol
377 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
378 -idirafter @var{dir} @gol
379 -include @var{file}  -imacros @var{file} @gol
380 -iprefix @var{file}  -iwithprefix @var{dir} @gol
381 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
382 -imultilib @var{dir} -isysroot @var{dir} @gol
383 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
384 -P  -fworking-directory  -remap @gol
385 -trigraphs  -undef  -U@var{macro}  -Wp,@var{option} @gol
386 -Xpreprocessor @var{option}}
387
388 @item Assembler Option
389 @xref{Assembler Options,,Passing Options to the Assembler}.
390 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
391
392 @item Linker Options
393 @xref{Link Options,,Options for Linking}.
394 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
395 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
396 -s  -static  -static-libgcc  -shared  -shared-libgcc  -symbolic @gol
397 -Wl,@var{option}  -Xlinker @var{option} @gol
398 -u @var{symbol}}
399
400 @item Directory Options
401 @xref{Directory Options,,Options for Directory Search}.
402 @gccoptlist{-B@var{prefix}  -I@var{dir}  -iquote@var{dir}  -L@var{dir}
403 -specs=@var{file}  -I- --sysroot=@var{dir}}
404
405 @item Target Options
406 @c I wrote this xref this way to avoid overfull hbox. -- rms
407 @xref{Target Options}.
408 @gccoptlist{-V @var{version}  -b @var{machine}}
409
410 @item Machine Dependent Options
411 @xref{Submodel Options,,Hardware Models and Configurations}.
412 @c This list is ordered alphanumerically by subsection name.
413 @c Try and put the significant identifier (CPU or system) first,
414 @c so users have a clue at guessing where the ones they want will be.
415
416 @emph{ARC Options}
417 @gccoptlist{-EB  -EL @gol
418 -mmangle-cpu  -mcpu=@var{cpu}  -mtext=@var{text-section} @gol
419 -mdata=@var{data-section}  -mrodata=@var{readonly-data-section}}
420
421 @emph{ARM Options}
422 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
423 -mabi=@var{name} @gol
424 -mapcs-stack-check  -mno-apcs-stack-check @gol
425 -mapcs-float  -mno-apcs-float @gol
426 -mapcs-reentrant  -mno-apcs-reentrant @gol
427 -msched-prolog  -mno-sched-prolog @gol
428 -mlittle-endian  -mbig-endian  -mwords-little-endian @gol
429 -mfloat-abi=@var{name}  -msoft-float  -mhard-float  -mfpe @gol
430 -mthumb-interwork  -mno-thumb-interwork @gol
431 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
432 -mstructure-size-boundary=@var{n} @gol
433 -mabort-on-noreturn @gol
434 -mlong-calls  -mno-long-calls @gol
435 -msingle-pic-base  -mno-single-pic-base @gol
436 -mpic-register=@var{reg} @gol
437 -mnop-fun-dllimport @gol
438 -mcirrus-fix-invalid-insns -mno-cirrus-fix-invalid-insns @gol
439 -mpoke-function-name @gol
440 -mthumb  -marm @gol
441 -mtpcs-frame  -mtpcs-leaf-frame @gol
442 -mcaller-super-interworking  -mcallee-super-interworking @gol
443 -mtp=@var{name}}
444
445 @emph{AVR Options}
446 @gccoptlist{-mmcu=@var{mcu}  -msize  -minit-stack=@var{n}  -mno-interrupts @gol
447 -mcall-prologues  -mno-tablejump  -mtiny-stack  -mint8}
448
449 @emph{Blackfin Options}
450 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
451 -msim -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
452 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
453 -mlow-64k -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
454 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
455 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
456 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
457 -mfast-fp -minline-plt}
458
459 @emph{CRIS Options}
460 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
461 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
462 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
463 -mstack-align  -mdata-align  -mconst-align @gol
464 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
465 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
466 -mmul-bug-workaround  -mno-mul-bug-workaround}
467
468 @emph{CRX Options}
469 @gccoptlist{-mmac -mpush-args}
470
471 @emph{Darwin Options}
472 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
473 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
474 -client_name  -compatibility_version  -current_version @gol
475 -dead_strip @gol
476 -dependency-file  -dylib_file  -dylinker_install_name @gol
477 -dynamic  -dynamiclib  -exported_symbols_list @gol
478 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
479 -force_flat_namespace  -headerpad_max_install_names @gol
480 -iframework @gol
481 -image_base  -init  -install_name  -keep_private_externs @gol
482 -multi_module  -multiply_defined  -multiply_defined_unused @gol
483 -noall_load   -no_dead_strip_inits_and_terms @gol
484 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
485 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
486 -private_bundle  -read_only_relocs  -sectalign @gol
487 -sectobjectsymbols  -whyload  -seg1addr @gol
488 -sectcreate  -sectobjectsymbols  -sectorder @gol
489 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
490 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
491 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
492 -single_module  -static  -sub_library  -sub_umbrella @gol
493 -twolevel_namespace  -umbrella  -undefined @gol
494 -unexported_symbols_list  -weak_reference_mismatches @gol
495 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
496 -mkernel -mone-byte-bool}
497
498 @emph{DEC Alpha Options}
499 @gccoptlist{-mno-fp-regs  -msoft-float  -malpha-as  -mgas @gol
500 -mieee  -mieee-with-inexact  -mieee-conformant @gol
501 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
502 -mtrap-precision=@var{mode}  -mbuild-constants @gol
503 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
504 -mbwx  -mmax  -mfix  -mcix @gol
505 -mfloat-vax  -mfloat-ieee @gol
506 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
507 -msmall-text  -mlarge-text @gol
508 -mmemory-latency=@var{time}}
509
510 @emph{DEC Alpha/VMS Options}
511 @gccoptlist{-mvms-return-codes}
512
513 @emph{FRV Options}
514 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
515 -mhard-float  -msoft-float @gol
516 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
517 -mdouble  -mno-double @gol
518 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
519 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
520 -mlinked-fp  -mlong-calls  -malign-labels @gol
521 -mlibrary-pic  -macc-4  -macc-8 @gol
522 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
523 -moptimize-membar -mno-optimize-membar @gol
524 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
525 -mvliw-branch  -mno-vliw-branch @gol
526 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
527 -mno-nested-cond-exec  -mtomcat-stats @gol
528 -mTLS -mtls @gol
529 -mcpu=@var{cpu}}
530
531 @emph{GNU/Linux Options}
532 @gccoptlist{-muclibc}
533
534 @emph{H8/300 Options}
535 @gccoptlist{-mrelax  -mh  -ms  -mn  -mint32  -malign-300}
536
537 @emph{HPPA Options}
538 @gccoptlist{-march=@var{architecture-type} @gol
539 -mbig-switch  -mdisable-fpregs  -mdisable-indexing @gol
540 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
541 -mfixed-range=@var{register-range} @gol
542 -mjump-in-delay -mlinker-opt -mlong-calls @gol
543 -mlong-load-store  -mno-big-switch  -mno-disable-fpregs @gol
544 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
545 -mno-jump-in-delay  -mno-long-load-store @gol
546 -mno-portable-runtime  -mno-soft-float @gol
547 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
548 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
549 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
550 -munix=@var{unix-std}  -nolibdld  -static  -threads}
551
552 @emph{i386 and x86-64 Options}
553 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
554 -mfpmath=@var{unit} @gol
555 -masm=@var{dialect}  -mno-fancy-math-387 @gol
556 -mno-fp-ret-in-387  -msoft-float @gol
557 -mno-wide-multiply  -mrtd  -malign-double @gol
558 -mpreferred-stack-boundary=@var{num} -mcx16 -msahf -mrecip @gol
559 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 @gol
560 -msse4a -m3dnow -mpopcnt -mabm -msse5 @gol
561 -mthreads  -mno-align-stringops  -minline-all-stringops @gol
562 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
563 -m96bit-long-double  -mregparm=@var{num}  -msseregparm @gol
564 -mveclibabi=@var{type} -mpc32 -mpc64 -mpc80 -mstackrealign @gol
565 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
566 -mcmodel=@var{code-model} @gol
567 -m32  -m64 -mlarge-data-threshold=@var{num} @gol
568 -mfused-madd -mno-fused-madd}
569
570 @emph{IA-64 Options}
571 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
572 -mvolatile-asm-stop  -mregister-names  -mno-sdata @gol
573 -mconstant-gp  -mauto-pic  -minline-float-divide-min-latency @gol
574 -minline-float-divide-max-throughput @gol
575 -minline-int-divide-min-latency @gol
576 -minline-int-divide-max-throughput  @gol
577 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
578 -mno-dwarf2-asm -mearly-stop-bits @gol
579 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
580 -mtune=@var{cpu-type} -mt -pthread -milp32 -mlp64 @gol
581 -mno-sched-br-data-spec -msched-ar-data-spec -mno-sched-control-spec @gol
582 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
583 -msched-ldc -mno-sched-control-ldc -mno-sched-spec-verbose @gol
584 -mno-sched-prefer-non-data-spec-insns @gol
585 -mno-sched-prefer-non-control-spec-insns @gol
586 -mno-sched-count-spec-in-critical-path}
587
588 @emph{M32R/D Options}
589 @gccoptlist{-m32r2 -m32rx -m32r @gol
590 -mdebug @gol
591 -malign-loops -mno-align-loops @gol
592 -missue-rate=@var{number} @gol
593 -mbranch-cost=@var{number} @gol
594 -mmodel=@var{code-size-model-type} @gol
595 -msdata=@var{sdata-type} @gol
596 -mno-flush-func -mflush-func=@var{name} @gol
597 -mno-flush-trap -mflush-trap=@var{number} @gol
598 -G @var{num}}
599
600 @emph{M32C Options}
601 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
602
603 @emph{M680x0 Options}
604 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune}
605 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
606 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
607 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
608 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
609 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
610 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
611 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library}
612
613 @emph{M68hc1x Options}
614 @gccoptlist{-m6811  -m6812  -m68hc11  -m68hc12   -m68hcs12 @gol
615 -mauto-incdec  -minmax  -mlong-calls  -mshort @gol
616 -msoft-reg-count=@var{count}}
617
618 @emph{MCore Options}
619 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
620 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
621 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
622 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
623 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
624
625 @emph{MIPS Options}
626 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
627 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2  -mips64 @gol
628 -mips16  -mno-mips16  -mflip-mips16 @gol
629 -minterlink-mips16  -mno-interlink-mips16 @gol
630 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
631 -mshared  -mno-shared  -mxgot  -mno-xgot  -mgp32  -mgp64 @gol
632 -mfp32  -mfp64  -mhard-float  -msoft-float @gol
633 -msingle-float  -mdouble-float  -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
634 -msmartmips  -mno-smartmips @gol
635 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
636 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
637 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
638 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
639 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
640 -membedded-data  -mno-embedded-data @gol
641 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
642 -mcode-readable=@var{setting} @gol
643 -msplit-addresses  -mno-split-addresses @gol
644 -mexplicit-relocs  -mno-explicit-relocs @gol
645 -mcheck-zero-division  -mno-check-zero-division @gol
646 -mdivide-traps  -mdivide-breaks @gol
647 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
648 -mmad  -mno-mad  -mfused-madd  -mno-fused-madd  -nocpp @gol
649 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
650 -mfix-vr4120  -mno-fix-vr4120  -mfix-vr4130  -mno-fix-vr4130 @gol
651 -mfix-sb1  -mno-fix-sb1 @gol
652 -mflush-func=@var{func}  -mno-flush-func @gol
653 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
654 -mfp-exceptions -mno-fp-exceptions @gol
655 -mvr4130-align -mno-vr4130-align}
656
657 @emph{MMIX Options}
658 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
659 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
660 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
661 -mno-base-addresses  -msingle-exit  -mno-single-exit}
662
663 @emph{MN10300 Options}
664 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
665 -mam33  -mno-am33 @gol
666 -mam33-2  -mno-am33-2 @gol
667 -mreturn-pointer-on-d0 @gol
668 -mno-crt0  -mrelax}
669
670 @emph{MT Options}
671 @gccoptlist{-mno-crt0 -mbacc -msim @gol
672 -march=@var{cpu-type} }
673
674 @emph{PDP-11 Options}
675 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
676 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
677 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
678 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
679 -mbranch-expensive  -mbranch-cheap @gol
680 -msplit  -mno-split  -munix-asm  -mdec-asm}
681
682 @emph{PowerPC Options}
683 See RS/6000 and PowerPC Options.
684
685 @emph{RS/6000 and PowerPC Options}
686 @gccoptlist{-mcpu=@var{cpu-type} @gol
687 -mtune=@var{cpu-type} @gol
688 -mpower  -mno-power  -mpower2  -mno-power2 @gol
689 -mpowerpc  -mpowerpc64  -mno-powerpc @gol
690 -maltivec  -mno-altivec @gol
691 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
692 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
693 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb  -mfprnd  -mno-fprnd @gol
694 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mdfp -mno-dfp @gol
695 -mnew-mnemonics  -mold-mnemonics @gol
696 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
697 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
698 -malign-power  -malign-natural @gol
699 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
700 -mstring  -mno-string  -mupdate  -mno-update @gol
701 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
702 -mstrict-align  -mno-strict-align  -mrelocatable @gol
703 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
704 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
705 -mdynamic-no-pic  -maltivec  -mswdiv @gol
706 -mprioritize-restricted-insns=@var{priority} @gol
707 -msched-costly-dep=@var{dependence_type} @gol
708 -minsert-sched-nops=@var{scheme} @gol
709 -mcall-sysv  -mcall-netbsd @gol
710 -maix-struct-return  -msvr4-struct-return @gol
711 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
712 -misel -mno-isel @gol
713 -misel=yes  -misel=no @gol
714 -mspe -mno-spe @gol
715 -mspe=yes  -mspe=no @gol
716 -mpaired @gol
717 -mvrsave -mno-vrsave @gol
718 -mmulhw -mno-mulhw @gol
719 -mdlmzb -mno-dlmzb @gol
720 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
721 -mprototype  -mno-prototype @gol
722 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
723 -msdata=@var{opt}  -mvxworks  -mwindiss  -G @var{num}  -pthread}
724
725 @emph{S/390 and zSeries Options}
726 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
727 -mhard-float  -msoft-float -mlong-double-64 -mlong-double-128 @gol
728 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
729 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
730 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
731 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
732 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard}
733
734 @emph{Score Options}
735 @gccoptlist{-meb -mel @gol
736 -mnhwloop @gol
737 -muls @gol
738 -mmac @gol
739 -mscore5 -mscore5u -mscore7 -mscore7d}
740
741 @emph{SH Options}
742 @gccoptlist{-m1  -m2  -m2e  -m3  -m3e @gol
743 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
744 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
745 -m5-64media  -m5-64media-nofpu @gol
746 -m5-32media  -m5-32media-nofpu @gol
747 -m5-compact  -m5-compact-nofpu @gol
748 -mb  -ml  -mdalign  -mrelax @gol
749 -mbigtable  -mfmovd  -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
750 -mieee  -misize  -minline-ic_invalidate -mpadstruct  -mspace @gol
751 -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
752 -mdivsi3_libfunc=@var{name}  @gol
753 -madjust-unroll -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
754  -minvalid-symbols}
755
756 @emph{SPARC Options}
757 @gccoptlist{-mcpu=@var{cpu-type} @gol
758 -mtune=@var{cpu-type} @gol
759 -mcmodel=@var{code-model} @gol
760 -m32  -m64  -mapp-regs  -mno-app-regs @gol
761 -mfaster-structs  -mno-faster-structs @gol
762 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
763 -mhard-quad-float  -msoft-quad-float @gol
764 -mimpure-text  -mno-impure-text  -mlittle-endian @gol
765 -mstack-bias  -mno-stack-bias @gol
766 -munaligned-doubles  -mno-unaligned-doubles @gol
767 -mv8plus  -mno-v8plus  -mvis  -mno-vis
768 -threads -pthreads -pthread}
769
770 @emph{SPU Options}
771 @gccoptlist{-mwarn-reloc -merror-reloc @gol
772 -msafe-dma -munsafe-dma @gol
773 -mbranch-hints @gol
774 -msmall-mem -mlarge-mem -mstdmain @gol
775 -mfixed-range=@var{register-range}}
776
777 @emph{System V Options}
778 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
779
780 @emph{TMS320C3x/C4x Options}
781 @gccoptlist{-mcpu=@var{cpu}  -mbig  -msmall  -mregparm  -mmemparm @gol
782 -mfast-fix  -mmpyi  -mbk  -mti  -mdp-isr-reload @gol
783 -mrpts=@var{count}  -mrptb  -mdb  -mloop-unsigned @gol
784 -mparallel-insns  -mparallel-mpy  -mpreserve-float}
785
786 @emph{V850 Options}
787 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
788 -mprolog-function  -mno-prolog-function  -mspace @gol
789 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
790 -mapp-regs  -mno-app-regs @gol
791 -mdisable-callt  -mno-disable-callt @gol
792 -mv850e1 @gol
793 -mv850e @gol
794 -mv850  -mbig-switch}
795
796 @emph{VAX Options}
797 @gccoptlist{-mg  -mgnu  -munix}
798
799 @emph{VxWorks Options}
800 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
801 -Xbind-lazy  -Xbind-now}
802
803 @emph{x86-64 Options}
804 See i386 and x86-64 Options.
805
806 @emph{Xstormy16 Options}
807 @gccoptlist{-msim}
808
809 @emph{Xtensa Options}
810 @gccoptlist{-mconst16 -mno-const16 @gol
811 -mfused-madd  -mno-fused-madd @gol
812 -mtext-section-literals  -mno-text-section-literals @gol
813 -mtarget-align  -mno-target-align @gol
814 -mlongcalls  -mno-longcalls}
815
816 @emph{zSeries Options}
817 See S/390 and zSeries Options.
818
819 @item Code Generation Options
820 @xref{Code Gen Options,,Options for Code Generation Conventions}.
821 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
822 -ffixed-@var{reg}  -fexceptions @gol
823 -fnon-call-exceptions  -funwind-tables @gol
824 -fasynchronous-unwind-tables @gol
825 -finhibit-size-directive  -finstrument-functions @gol
826 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
827 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol
828 -fno-common  -fno-ident @gol
829 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
830 -fno-jump-tables @gol
831 -frecord-gcc-switches @gol
832 -freg-struct-return  -fshort-enums @gol
833 -fshort-double  -fshort-wchar @gol
834 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
835 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
836 -fno-stack-limit  -fargument-alias  -fargument-noalias @gol
837 -fargument-noalias-global  -fargument-noalias-anything @gol
838 -fleading-underscore  -ftls-model=@var{model} @gol
839 -ftrapv  -fwrapv  -fbounds-check @gol
840 -fvisibility}
841 @end table
842
843 @menu
844 * Overall Options::     Controlling the kind of output:
845                         an executable, object files, assembler files,
846                         or preprocessed source.
847 * C Dialect Options::   Controlling the variant of C language compiled.
848 * C++ Dialect Options:: Variations on C++.
849 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
850                         and Objective-C++.
851 * Language Independent Options:: Controlling how diagnostics should be
852                         formatted.
853 * Warning Options::     How picky should the compiler be?
854 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
855 * Optimize Options::    How much optimization?
856 * Preprocessor Options:: Controlling header files and macro definitions.
857                          Also, getting dependency information for Make.
858 * Assembler Options::   Passing options to the assembler.
859 * Link Options::        Specifying libraries and so on.
860 * Directory Options::   Where to find header files and libraries.
861                         Where to find the compiler executable files.
862 * Spec Files::          How to pass switches to sub-processes.
863 * Target Options::      Running a cross-compiler, or an old version of GCC.
864 @end menu
865
866 @node Overall Options
867 @section Options Controlling the Kind of Output
868
869 Compilation can involve up to four stages: preprocessing, compilation
870 proper, assembly and linking, always in that order.  GCC is capable of
871 preprocessing and compiling several files either into several
872 assembler input files, or into one assembler input file; then each
873 assembler input file produces an object file, and linking combines all
874 the object files (those newly compiled, and those specified as input)
875 into an executable file.
876
877 @cindex file name suffix
878 For any given input file, the file name suffix determines what kind of
879 compilation is done:
880
881 @table @gcctabopt
882 @item @var{file}.c
883 C source code which must be preprocessed.
884
885 @item @var{file}.i
886 C source code which should not be preprocessed.
887
888 @item @var{file}.ii
889 C++ source code which should not be preprocessed.
890
891 @item @var{file}.m
892 Objective-C source code.  Note that you must link with the @file{libobjc}
893 library to make an Objective-C program work.
894
895 @item @var{file}.mi
896 Objective-C source code which should not be preprocessed.
897
898 @item @var{file}.mm
899 @itemx @var{file}.M
900 Objective-C++ source code.  Note that you must link with the @file{libobjc}
901 library to make an Objective-C++ program work.  Note that @samp{.M} refers
902 to a literal capital M@.
903
904 @item @var{file}.mii
905 Objective-C++ source code which should not be preprocessed.
906
907 @item @var{file}.h
908 C, C++, Objective-C or Objective-C++ header file to be turned into a
909 precompiled header.
910
911 @item @var{file}.cc
912 @itemx @var{file}.cp
913 @itemx @var{file}.cxx
914 @itemx @var{file}.cpp
915 @itemx @var{file}.CPP
916 @itemx @var{file}.c++
917 @itemx @var{file}.C
918 C++ source code which must be preprocessed.  Note that in @samp{.cxx},
919 the last two letters must both be literally @samp{x}.  Likewise,
920 @samp{.C} refers to a literal capital C@.
921
922 @item @var{file}.mm
923 @itemx @var{file}.M
924 Objective-C++ source code which must be preprocessed.
925
926 @item @var{file}.mii
927 Objective-C++ source code which should not be preprocessed.
928
929 @item @var{file}.hh
930 @itemx @var{file}.H
931 @itemx @var{file}.hp
932 @itemx @var{file}.hxx
933 @itemx @var{file}.hpp
934 @itemx @var{file}.HPP
935 @itemx @var{file}.h++
936 @itemx @var{file}.tcc
937 C++ header file to be turned into a precompiled header.
938
939 @item @var{file}.f
940 @itemx @var{file}.for
941 @itemx @var{file}.FOR
942 Fixed form Fortran source code which should not be preprocessed.
943
944 @item @var{file}.F
945 @itemx @var{file}.fpp
946 @itemx @var{file}.FPP
947 Fixed form Fortran source code which must be preprocessed (with the traditional
948 preprocessor).
949
950 @item @var{file}.f90
951 @itemx @var{file}.f95
952 Free form Fortran source code which should not be preprocessed.
953
954 @item @var{file}.F90
955 @itemx @var{file}.F95
956 Free form Fortran source code which must be preprocessed (with the
957 traditional preprocessor).
958
959 @c FIXME: Descriptions of Java file types.
960 @c @var{file}.java
961 @c @var{file}.class
962 @c @var{file}.zip
963 @c @var{file}.jar
964
965 @item @var{file}.ads
966 Ada source code file which contains a library unit declaration (a
967 declaration of a package, subprogram, or generic, or a generic
968 instantiation), or a library unit renaming declaration (a package,
969 generic, or subprogram renaming declaration).  Such files are also
970 called @dfn{specs}.
971
972 @itemx @var{file}.adb
973 Ada source code file containing a library unit body (a subprogram or
974 package body).  Such files are also called @dfn{bodies}.
975
976 @c GCC also knows about some suffixes for languages not yet included:
977 @c Pascal:
978 @c @var{file}.p
979 @c @var{file}.pas
980 @c Ratfor:
981 @c @var{file}.r
982
983 @item @var{file}.s
984 Assembler code.
985
986 @item @var{file}.S
987 @itemx @var{file}.sx
988 Assembler code which must be preprocessed.
989
990 @item @var{other}
991 An object file to be fed straight into linking.
992 Any file name with no recognized suffix is treated this way.
993 @end table
994
995 @opindex x
996 You can specify the input language explicitly with the @option{-x} option:
997
998 @table @gcctabopt
999 @item -x @var{language}
1000 Specify explicitly the @var{language} for the following input files
1001 (rather than letting the compiler choose a default based on the file
1002 name suffix).  This option applies to all following input files until
1003 the next @option{-x} option.  Possible values for @var{language} are:
1004 @smallexample
1005 c  c-header  c-cpp-output
1006 c++  c++-header  c++-cpp-output
1007 objective-c  objective-c-header  objective-c-cpp-output
1008 objective-c++ objective-c++-header objective-c++-cpp-output
1009 assembler  assembler-with-cpp
1010 ada
1011 f95  f95-cpp-input
1012 java
1013 treelang
1014 @end smallexample
1015
1016 @item -x none
1017 Turn off any specification of a language, so that subsequent files are
1018 handled according to their file name suffixes (as they are if @option{-x}
1019 has not been used at all).
1020
1021 @item -pass-exit-codes
1022 @opindex pass-exit-codes
1023 Normally the @command{gcc} program will exit with the code of 1 if any
1024 phase of the compiler returns a non-success return code.  If you specify
1025 @option{-pass-exit-codes}, the @command{gcc} program will instead return with
1026 numerically highest error produced by any phase that returned an error
1027 indication.  The C, C++, and Fortran frontends return 4, if an internal
1028 compiler error is encountered.
1029 @end table
1030
1031 If you only want some of the stages of compilation, you can use
1032 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1033 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1034 @command{gcc} is to stop.  Note that some combinations (for example,
1035 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1036
1037 @table @gcctabopt
1038 @item -c
1039 @opindex c
1040 Compile or assemble the source files, but do not link.  The linking
1041 stage simply is not done.  The ultimate output is in the form of an
1042 object file for each source file.
1043
1044 By default, the object file name for a source file is made by replacing
1045 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1046
1047 Unrecognized input files, not requiring compilation or assembly, are
1048 ignored.
1049
1050 @item -S
1051 @opindex S
1052 Stop after the stage of compilation proper; do not assemble.  The output
1053 is in the form of an assembler code file for each non-assembler input
1054 file specified.
1055
1056 By default, the assembler file name for a source file is made by
1057 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1058
1059 Input files that don't require compilation are ignored.
1060
1061 @item -E
1062 @opindex E
1063 Stop after the preprocessing stage; do not run the compiler proper.  The
1064 output is in the form of preprocessed source code, which is sent to the
1065 standard output.
1066
1067 Input files which don't require preprocessing are ignored.
1068
1069 @cindex output file option
1070 @item -o @var{file}
1071 @opindex o
1072 Place output in file @var{file}.  This applies regardless to whatever
1073 sort of output is being produced, whether it be an executable file,
1074 an object file, an assembler file or preprocessed C code.
1075
1076 If @option{-o} is not specified, the default is to put an executable
1077 file in @file{a.out}, the object file for
1078 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1079 assembler file in @file{@var{source}.s}, a precompiled header file in
1080 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1081 standard output.
1082
1083 @item -v
1084 @opindex v
1085 Print (on standard error output) the commands executed to run the stages
1086 of compilation.  Also print the version number of the compiler driver
1087 program and of the preprocessor and the compiler proper.
1088
1089 @item -###
1090 @opindex ###
1091 Like @option{-v} except the commands are not executed and all command
1092 arguments are quoted.  This is useful for shell scripts to capture the
1093 driver-generated command lines.
1094
1095 @item -pipe
1096 @opindex pipe
1097 Use pipes rather than temporary files for communication between the
1098 various stages of compilation.  This fails to work on some systems where
1099 the assembler is unable to read from a pipe; but the GNU assembler has
1100 no trouble.
1101
1102 @item -combine
1103 @opindex combine
1104 If you are compiling multiple source files, this option tells the driver
1105 to pass all the source files to the compiler at once (for those
1106 languages for which the compiler can handle this).  This will allow
1107 intermodule analysis (IMA) to be performed by the compiler.  Currently the only
1108 language for which this is supported is C@.  If you pass source files for
1109 multiple languages to the driver, using this option, the driver will invoke
1110 the compiler(s) that support IMA once each, passing each compiler all the
1111 source files appropriate for it.  For those languages that do not support
1112 IMA this option will be ignored, and the compiler will be invoked once for
1113 each source file in that language.  If you use this option in conjunction
1114 with @option{-save-temps}, the compiler will generate multiple
1115 pre-processed files
1116 (one for each source file), but only one (combined) @file{.o} or
1117 @file{.s} file.
1118
1119 @item --help
1120 @opindex help
1121 Print (on the standard output) a description of the command line options
1122 understood by @command{gcc}.  If the @option{-v} option is also specified
1123 then @option{--help} will also be passed on to the various processes
1124 invoked by @command{gcc}, so that they can display the command line options
1125 they accept.  If the @option{-Wextra} option has also been specified
1126 (prior to the @option{--help} option), then command line options which
1127 have no documentation associated with them will also be displayed.
1128
1129 @item --target-help
1130 @opindex target-help
1131 Print (on the standard output) a description of target-specific command
1132 line options for each tool.  For some targets extra target-specific
1133 information may also be printed.
1134
1135 @item --help=@var{class}@r{[},@var{qualifier}@r{]}
1136 Print (on the standard output) a description of the command line
1137 options understood by the compiler that fit into a specific class.
1138 The class can be one of @samp{optimizers}, @samp{warnings}, @samp{target},
1139 @samp{params}, or @var{language}:
1140
1141 @table @asis
1142 @item @samp{optimizers}
1143 This will display all of the optimization options supported by the
1144 compiler.
1145
1146 @item @samp{warnings}
1147 This will display all of the options controlling warning messages
1148 produced by the compiler.
1149
1150 @item @samp{target}
1151 This will display target-specific options.  Unlike the
1152 @option{--target-help} option however, target-specific options of the
1153 linker and assembler will not be displayed.  This is because those
1154 tools do not currently support the extended @option{--help=} syntax.
1155
1156 @item @samp{params}
1157 This will display the values recognized by the @option{--param}
1158 option.
1159
1160 @item @var{language}
1161 This will display the options supported for @var{language}, where 
1162 @var{language} is the name of one of the languages supported in this 
1163 version of GCC.
1164
1165 @item @samp{common}
1166 This will display the options that are common to all languages.
1167 @end table
1168
1169 It is possible to further refine the output of the @option{--help=}
1170 option by adding a comma separated list of qualifiers after the
1171 class.  These can be any from the following list:
1172
1173 @table @asis
1174 @item @samp{undocumented}
1175 Display only those options which are undocumented.
1176
1177 @item @samp{joined}
1178 Display options which take an argument that appears after an equal
1179 sign in the same continuous piece of text, such as:
1180 @samp{--help=target}.
1181
1182 @item @samp{separate}
1183 Display options which take an argument that appears as a separate word
1184 following the original option, such as: @samp{-o output-file}.
1185 @end table
1186
1187 Thus for example to display all the undocumented target-specific
1188 switches supported by the compiler the following can be used:
1189
1190 @smallexample
1191 --help=target,undocumented
1192 @end smallexample
1193
1194 The sense of a qualifier can be inverted by prefixing it with the
1195 @var{^} character, so for example to display all binary warning
1196 options (i.e. ones that are either on or off and that do not take an
1197 argument), which have a description the following can be used:
1198
1199 @smallexample
1200 --help=warnings,^joined,^undocumented
1201 @end smallexample
1202
1203 A class can also be used as a qualifier, although this usually
1204 restricts the output by so much that there is nothing to display.  One
1205 case where it does work however is when one of the classes is
1206 @var{target}.  So for example to display all the target-specific
1207 optimization options the following can be used:
1208
1209 @smallexample
1210 --help=target,optimizers
1211 @end smallexample
1212
1213 The @option{--help=} option can be repeated on the command line.  Each
1214 successive use will display its requested class of options, skipping
1215 those that have already been displayed.
1216
1217 If the @option{-Q} option appears on the command line before the
1218 @option{--help=} option, then the descriptive text displayed by
1219 @option{--help=} is changed.  Instead of describing the displayed
1220 options, an indication is given as to whether the option is enabled,
1221 disabled or set to a specific value (assuming that the compiler
1222 knows this at the point where the @option{--help=} option is used).
1223
1224 Here is a truncated example from the ARM port of @command{gcc}:
1225
1226 @smallexample
1227   % gcc -Q -mabi=2 --help=target -c
1228   The following options are target specific:
1229   -mabi=                                2
1230   -mabort-on-noreturn                   [disabled]
1231   -mapcs                                [disabled]
1232 @end smallexample
1233
1234 The output is sensitive to the effects of previous command line
1235 options, so for example it is possible to find out which optimizations
1236 are enabled at @option{-O2} by using:
1237
1238 @smallexample
1239 -O2 --help=optimizers
1240 @end smallexample
1241
1242 Alternatively you can discover which binary optimizations are enabled
1243 by @option{-O3} by using:
1244
1245 @smallexample
1246 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1247 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1248 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1249 @end smallexample
1250
1251 @item --version
1252 @opindex version
1253 Display the version number and copyrights of the invoked GCC@.
1254
1255 @include @value{srcdir}/../libiberty/at-file.texi
1256 @end table
1257
1258 @node Invoking G++
1259 @section Compiling C++ Programs
1260
1261 @cindex suffixes for C++ source
1262 @cindex C++ source file suffixes
1263 C++ source files conventionally use one of the suffixes @samp{.C},
1264 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1265 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1266 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1267 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1268 files with these names and compiles them as C++ programs even if you
1269 call the compiler the same way as for compiling C programs (usually
1270 with the name @command{gcc}).
1271
1272 @findex g++
1273 @findex c++
1274 However, the use of @command{gcc} does not add the C++ library.
1275 @command{g++} is a program that calls GCC and treats @samp{.c},
1276 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1277 files unless @option{-x} is used, and automatically specifies linking
1278 against the C++ library.  This program is also useful when
1279 precompiling a C header file with a @samp{.h} extension for use in C++
1280 compilations.  On many systems, @command{g++} is also installed with
1281 the name @command{c++}.
1282
1283 @cindex invoking @command{g++}
1284 When you compile C++ programs, you may specify many of the same
1285 command-line options that you use for compiling programs in any
1286 language; or command-line options meaningful for C and related
1287 languages; or options that are meaningful only for C++ programs.
1288 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1289 explanations of options for languages related to C@.
1290 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1291 explanations of options that are meaningful only for C++ programs.
1292
1293 @node C Dialect Options
1294 @section Options Controlling C Dialect
1295 @cindex dialect options
1296 @cindex language dialect options
1297 @cindex options, dialect
1298
1299 The following options control the dialect of C (or languages derived
1300 from C, such as C++, Objective-C and Objective-C++) that the compiler
1301 accepts:
1302
1303 @table @gcctabopt
1304 @cindex ANSI support
1305 @cindex ISO support
1306 @item -ansi
1307 @opindex ansi
1308 In C mode, support all ISO C90 programs.  In C++ mode,
1309 remove GNU extensions that conflict with ISO C++.
1310
1311 This turns off certain features of GCC that are incompatible with ISO
1312 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1313 such as the @code{asm} and @code{typeof} keywords, and
1314 predefined macros such as @code{unix} and @code{vax} that identify the
1315 type of system you are using.  It also enables the undesirable and
1316 rarely used ISO trigraph feature.  For the C compiler,
1317 it disables recognition of C++ style @samp{//} comments as well as
1318 the @code{inline} keyword.
1319
1320 The alternate keywords @code{__asm__}, @code{__extension__},
1321 @code{__inline__} and @code{__typeof__} continue to work despite
1322 @option{-ansi}.  You would not want to use them in an ISO C program, of
1323 course, but it is useful to put them in header files that might be included
1324 in compilations done with @option{-ansi}.  Alternate predefined macros
1325 such as @code{__unix__} and @code{__vax__} are also available, with or
1326 without @option{-ansi}.
1327
1328 The @option{-ansi} option does not cause non-ISO programs to be
1329 rejected gratuitously.  For that, @option{-pedantic} is required in
1330 addition to @option{-ansi}.  @xref{Warning Options}.
1331
1332 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1333 option is used.  Some header files may notice this macro and refrain
1334 from declaring certain functions or defining certain macros that the
1335 ISO standard doesn't call for; this is to avoid interfering with any
1336 programs that might use these names for other things.
1337
1338 Functions which would normally be built in but do not have semantics
1339 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1340 functions with @option{-ansi} is used.  @xref{Other Builtins,,Other
1341 built-in functions provided by GCC}, for details of the functions
1342 affected.
1343
1344 @item -std=
1345 @opindex std
1346 Determine the language standard.  This option is currently only
1347 supported when compiling C or C++.  A value for this option must be
1348 provided; possible values are
1349
1350 @table @samp
1351 @item c89
1352 @itemx iso9899:1990
1353 ISO C90 (same as @option{-ansi}).
1354
1355 @item iso9899:199409
1356 ISO C90 as modified in amendment 1.
1357
1358 @item c99
1359 @itemx c9x
1360 @itemx iso9899:1999
1361 @itemx iso9899:199x
1362 ISO C99.  Note that this standard is not yet fully supported; see
1363 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1364 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1365
1366 @item gnu89
1367 Default, ISO C90 plus GNU extensions (including some C99 features).
1368
1369 @item gnu99
1370 @itemx gnu9x
1371 ISO C99 plus GNU extensions.  When ISO C99 is fully implemented in GCC,
1372 this will become the default.  The name @samp{gnu9x} is deprecated.
1373
1374 @item c++98
1375 The 1998 ISO C++ standard plus amendments.
1376
1377 @item gnu++98
1378 The same as @option{-std=c++98} plus GNU extensions.  This is the
1379 default for C++ code.
1380
1381 @item c++0x
1382 The working draft of the upcoming ISO C++0x standard. This option
1383 enables experimental features that are likely to be included in
1384 C++0x. The working draft is constantly changing, and any feature that is
1385 enabled by this flag may be removed from future versions of GCC if it is
1386 not part of the C++0x standard.
1387
1388 @item gnu++0x
1389 The same as @option{-std=c++0x} plus GNU extensions. As with
1390 @option{-std=c++0x}, this option enables experimental features that may
1391 be removed in future versions of GCC.
1392 @end table
1393
1394 Even when this option is not specified, you can still use some of the
1395 features of newer standards in so far as they do not conflict with
1396 previous C standards.  For example, you may use @code{__restrict__} even
1397 when @option{-std=c99} is not specified.
1398
1399 The @option{-std} options specifying some version of ISO C have the same
1400 effects as @option{-ansi}, except that features that were not in ISO C90
1401 but are in the specified version (for example, @samp{//} comments and
1402 the @code{inline} keyword in ISO C99) are not disabled.
1403
1404 @xref{Standards,,Language Standards Supported by GCC}, for details of
1405 these standard versions.
1406
1407 @item -fgnu89-inline
1408 @opindex fgnu89-inline
1409 The option @option{-fgnu89-inline} tells GCC to use the traditional
1410 GNU semantics for @code{inline} functions when in C99 mode.
1411 @xref{Inline,,An Inline Function is As Fast As a Macro}.  This option
1412 is accepted and ignored by GCC versions 4.1.3 up to but not including
1413 4.3.  In GCC versions 4.3 and later it changes the behavior of GCC in
1414 C99 mode.  Using this option is roughly equivalent to adding the
1415 @code{gnu_inline} function attribute to all inline functions
1416 (@pxref{Function Attributes}).
1417
1418 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1419 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1420 specifies the default behavior).  This option was first supported in
1421 GCC 4.3.  This option is not supported in C89 or gnu89 mode.
1422
1423 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1424 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1425 in effect for @code{inline} functions.  @xref{Common Predefined
1426 Macros,,,cpp,The C Preprocessor}.
1427
1428 @item -aux-info @var{filename}
1429 @opindex aux-info
1430 Output to the given filename prototyped declarations for all functions
1431 declared and/or defined in a translation unit, including those in header
1432 files.  This option is silently ignored in any language other than C@.
1433
1434 Besides declarations, the file indicates, in comments, the origin of
1435 each declaration (source file and line), whether the declaration was
1436 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1437 @samp{O} for old, respectively, in the first character after the line
1438 number and the colon), and whether it came from a declaration or a
1439 definition (@samp{C} or @samp{F}, respectively, in the following
1440 character).  In the case of function definitions, a K&R-style list of
1441 arguments followed by their declarations is also provided, inside
1442 comments, after the declaration.
1443
1444 @item -fno-asm
1445 @opindex fno-asm
1446 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1447 keyword, so that code can use these words as identifiers.  You can use
1448 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1449 instead.  @option{-ansi} implies @option{-fno-asm}.
1450
1451 In C++, this switch only affects the @code{typeof} keyword, since
1452 @code{asm} and @code{inline} are standard keywords.  You may want to
1453 use the @option{-fno-gnu-keywords} flag instead, which has the same
1454 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1455 switch only affects the @code{asm} and @code{typeof} keywords, since
1456 @code{inline} is a standard keyword in ISO C99.
1457
1458 @item -fno-builtin
1459 @itemx -fno-builtin-@var{function}
1460 @opindex fno-builtin
1461 @cindex built-in functions
1462 Don't recognize built-in functions that do not begin with
1463 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1464 functions provided by GCC}, for details of the functions affected,
1465 including those which are not built-in functions when @option{-ansi} or
1466 @option{-std} options for strict ISO C conformance are used because they
1467 do not have an ISO standard meaning.
1468
1469 GCC normally generates special code to handle certain built-in functions
1470 more efficiently; for instance, calls to @code{alloca} may become single
1471 instructions that adjust the stack directly, and calls to @code{memcpy}
1472 may become inline copy loops.  The resulting code is often both smaller
1473 and faster, but since the function calls no longer appear as such, you
1474 cannot set a breakpoint on those calls, nor can you change the behavior
1475 of the functions by linking with a different library.  In addition,
1476 when a function is recognized as a built-in function, GCC may use
1477 information about that function to warn about problems with calls to
1478 that function, or to generate more efficient code, even if the
1479 resulting code still contains calls to that function.  For example,
1480 warnings are given with @option{-Wformat} for bad calls to
1481 @code{printf}, when @code{printf} is built in, and @code{strlen} is
1482 known not to modify global memory.
1483
1484 With the @option{-fno-builtin-@var{function}} option
1485 only the built-in function @var{function} is
1486 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1487 function is named this is not built-in in this version of GCC, this
1488 option is ignored.  There is no corresponding
1489 @option{-fbuiltin-@var{function}} option; if you wish to enable
1490 built-in functions selectively when using @option{-fno-builtin} or
1491 @option{-ffreestanding}, you may define macros such as:
1492
1493 @smallexample
1494 #define abs(n)          __builtin_abs ((n))
1495 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1496 @end smallexample
1497
1498 @item -fhosted
1499 @opindex fhosted
1500 @cindex hosted environment
1501
1502 Assert that compilation takes place in a hosted environment.  This implies
1503 @option{-fbuiltin}.  A hosted environment is one in which the
1504 entire standard library is available, and in which @code{main} has a return
1505 type of @code{int}.  Examples are nearly everything except a kernel.
1506 This is equivalent to @option{-fno-freestanding}.
1507
1508 @item -ffreestanding
1509 @opindex ffreestanding
1510 @cindex hosted environment
1511
1512 Assert that compilation takes place in a freestanding environment.  This
1513 implies @option{-fno-builtin}.  A freestanding environment
1514 is one in which the standard library may not exist, and program startup may
1515 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1516 This is equivalent to @option{-fno-hosted}.
1517
1518 @xref{Standards,,Language Standards Supported by GCC}, for details of
1519 freestanding and hosted environments.
1520
1521 @item -fopenmp
1522 @opindex fopenmp
1523 @cindex openmp parallel
1524 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1525 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1526 compiler generates parallel code according to the OpenMP Application
1527 Program Interface v2.5 @w{@uref{http://www.openmp.org/}}.
1528
1529 @item -fms-extensions
1530 @opindex fms-extensions
1531 Accept some non-standard constructs used in Microsoft header files.
1532
1533 Some cases of unnamed fields in structures and unions are only
1534 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1535 fields within structs/unions}, for details.
1536
1537 @item -trigraphs
1538 @opindex trigraphs
1539 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1540 options for strict ISO C conformance) implies @option{-trigraphs}.
1541
1542 @item -no-integrated-cpp
1543 @opindex no-integrated-cpp
1544 Performs a compilation in two passes: preprocessing and compiling.  This
1545 option allows a user supplied "cc1", "cc1plus", or "cc1obj" via the
1546 @option{-B} option.  The user supplied compilation step can then add in
1547 an additional preprocessing step after normal preprocessing but before
1548 compiling.  The default is to use the integrated cpp (internal cpp)
1549
1550 The semantics of this option will change if "cc1", "cc1plus", and
1551 "cc1obj" are merged.
1552
1553 @cindex traditional C language
1554 @cindex C language, traditional
1555 @item -traditional
1556 @itemx -traditional-cpp
1557 @opindex traditional-cpp
1558 @opindex traditional
1559 Formerly, these options caused GCC to attempt to emulate a pre-standard
1560 C compiler.  They are now only supported with the @option{-E} switch.
1561 The preprocessor continues to support a pre-standard mode.  See the GNU
1562 CPP manual for details.
1563
1564 @item -fcond-mismatch
1565 @opindex fcond-mismatch
1566 Allow conditional expressions with mismatched types in the second and
1567 third arguments.  The value of such an expression is void.  This option
1568 is not supported for C++.
1569
1570 @item -flax-vector-conversions
1571 @opindex flax-vector-conversions
1572 Allow implicit conversions between vectors with differing numbers of
1573 elements and/or incompatible element types.  This option should not be
1574 used for new code.
1575
1576 @item -funsigned-char
1577 @opindex funsigned-char
1578 Let the type @code{char} be unsigned, like @code{unsigned char}.
1579
1580 Each kind of machine has a default for what @code{char} should
1581 be.  It is either like @code{unsigned char} by default or like
1582 @code{signed char} by default.
1583
1584 Ideally, a portable program should always use @code{signed char} or
1585 @code{unsigned char} when it depends on the signedness of an object.
1586 But many programs have been written to use plain @code{char} and
1587 expect it to be signed, or expect it to be unsigned, depending on the
1588 machines they were written for.  This option, and its inverse, let you
1589 make such a program work with the opposite default.
1590
1591 The type @code{char} is always a distinct type from each of
1592 @code{signed char} or @code{unsigned char}, even though its behavior
1593 is always just like one of those two.
1594
1595 @item -fsigned-char
1596 @opindex fsigned-char
1597 Let the type @code{char} be signed, like @code{signed char}.
1598
1599 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1600 the negative form of @option{-funsigned-char}.  Likewise, the option
1601 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1602
1603 @item -fsigned-bitfields
1604 @itemx -funsigned-bitfields
1605 @itemx -fno-signed-bitfields
1606 @itemx -fno-unsigned-bitfields
1607 @opindex fsigned-bitfields
1608 @opindex funsigned-bitfields
1609 @opindex fno-signed-bitfields
1610 @opindex fno-unsigned-bitfields
1611 These options control whether a bit-field is signed or unsigned, when the
1612 declaration does not use either @code{signed} or @code{unsigned}.  By
1613 default, such a bit-field is signed, because this is consistent: the
1614 basic integer types such as @code{int} are signed types.
1615 @end table
1616
1617 @node C++ Dialect Options
1618 @section Options Controlling C++ Dialect
1619
1620 @cindex compiler options, C++
1621 @cindex C++ options, command line
1622 @cindex options, C++
1623 This section describes the command-line options that are only meaningful
1624 for C++ programs; but you can also use most of the GNU compiler options
1625 regardless of what language your program is in.  For example, you
1626 might compile a file @code{firstClass.C} like this:
1627
1628 @smallexample
1629 g++ -g -frepo -O -c firstClass.C
1630 @end smallexample
1631
1632 @noindent
1633 In this example, only @option{-frepo} is an option meant
1634 only for C++ programs; you can use the other options with any
1635 language supported by GCC@.
1636
1637 Here is a list of options that are @emph{only} for compiling C++ programs:
1638
1639 @table @gcctabopt
1640
1641 @item -fabi-version=@var{n}
1642 @opindex fabi-version
1643 Use version @var{n} of the C++ ABI@.  Version 2 is the version of the
1644 C++ ABI that first appeared in G++ 3.4.  Version 1 is the version of
1645 the C++ ABI that first appeared in G++ 3.2.  Version 0 will always be
1646 the version that conforms most closely to the C++ ABI specification.
1647 Therefore, the ABI obtained using version 0 will change as ABI bugs
1648 are fixed.
1649
1650 The default is version 2.
1651
1652 @item -fno-access-control
1653 @opindex fno-access-control
1654 Turn off all access checking.  This switch is mainly useful for working
1655 around bugs in the access control code.
1656
1657 @item -fcheck-new
1658 @opindex fcheck-new
1659 Check that the pointer returned by @code{operator new} is non-null
1660 before attempting to modify the storage allocated.  This check is
1661 normally unnecessary because the C++ standard specifies that
1662 @code{operator new} will only return @code{0} if it is declared
1663 @samp{throw()}, in which case the compiler will always check the
1664 return value even without this option.  In all other cases, when
1665 @code{operator new} has a non-empty exception specification, memory
1666 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
1667 @samp{new (nothrow)}.
1668
1669 @item -fconserve-space
1670 @opindex fconserve-space
1671 Put uninitialized or runtime-initialized global variables into the
1672 common segment, as C does.  This saves space in the executable at the
1673 cost of not diagnosing duplicate definitions.  If you compile with this
1674 flag and your program mysteriously crashes after @code{main()} has
1675 completed, you may have an object that is being destroyed twice because
1676 two definitions were merged.
1677
1678 This option is no longer useful on most targets, now that support has
1679 been added for putting variables into BSS without making them common.
1680
1681 @item -ffriend-injection
1682 @opindex ffriend-injection
1683 Inject friend functions into the enclosing namespace, so that they are
1684 visible outside the scope of the class in which they are declared.
1685 Friend functions were documented to work this way in the old Annotated
1686 C++ Reference Manual, and versions of G++ before 4.1 always worked
1687 that way.  However, in ISO C++ a friend function which is not declared
1688 in an enclosing scope can only be found using argument dependent
1689 lookup.  This option causes friends to be injected as they were in
1690 earlier releases.
1691
1692 This option is for compatibility, and may be removed in a future
1693 release of G++.
1694
1695 @item -fno-elide-constructors
1696 @opindex fno-elide-constructors
1697 The C++ standard allows an implementation to omit creating a temporary
1698 which is only used to initialize another object of the same type.
1699 Specifying this option disables that optimization, and forces G++ to
1700 call the copy constructor in all cases.
1701
1702 @item -fno-enforce-eh-specs
1703 @opindex fno-enforce-eh-specs
1704 Don't generate code to check for violation of exception specifications
1705 at runtime.  This option violates the C++ standard, but may be useful
1706 for reducing code size in production builds, much like defining
1707 @samp{NDEBUG}.  This does not give user code permission to throw
1708 exceptions in violation of the exception specifications; the compiler
1709 will still optimize based on the specifications, so throwing an
1710 unexpected exception will result in undefined behavior.
1711
1712 @item -ffor-scope
1713 @itemx -fno-for-scope
1714 @opindex ffor-scope
1715 @opindex fno-for-scope
1716 If @option{-ffor-scope} is specified, the scope of variables declared in
1717 a @i{for-init-statement} is limited to the @samp{for} loop itself,
1718 as specified by the C++ standard.
1719 If @option{-fno-for-scope} is specified, the scope of variables declared in
1720 a @i{for-init-statement} extends to the end of the enclosing scope,
1721 as was the case in old versions of G++, and other (traditional)
1722 implementations of C++.
1723
1724 The default if neither flag is given to follow the standard,
1725 but to allow and give a warning for old-style code that would
1726 otherwise be invalid, or have different behavior.
1727
1728 @item -fno-gnu-keywords
1729 @opindex fno-gnu-keywords
1730 Do not recognize @code{typeof} as a keyword, so that code can use this
1731 word as an identifier.  You can use the keyword @code{__typeof__} instead.
1732 @option{-ansi} implies @option{-fno-gnu-keywords}.
1733
1734 @item -fno-implicit-templates
1735 @opindex fno-implicit-templates
1736 Never emit code for non-inline templates which are instantiated
1737 implicitly (i.e.@: by use); only emit code for explicit instantiations.
1738 @xref{Template Instantiation}, for more information.
1739
1740 @item -fno-implicit-inline-templates
1741 @opindex fno-implicit-inline-templates
1742 Don't emit code for implicit instantiations of inline templates, either.
1743 The default is to handle inlines differently so that compiles with and
1744 without optimization will need the same set of explicit instantiations.
1745
1746 @item -fno-implement-inlines
1747 @opindex fno-implement-inlines
1748 To save space, do not emit out-of-line copies of inline functions
1749 controlled by @samp{#pragma implementation}.  This will cause linker
1750 errors if these functions are not inlined everywhere they are called.
1751
1752 @item -fms-extensions
1753 @opindex fms-extensions
1754 Disable pedantic warnings about constructs used in MFC, such as implicit
1755 int and getting a pointer to member function via non-standard syntax.
1756
1757 @item -fno-nonansi-builtins
1758 @opindex fno-nonansi-builtins
1759 Disable built-in declarations of functions that are not mandated by
1760 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
1761 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
1762
1763 @item -fno-operator-names
1764 @opindex fno-operator-names
1765 Do not treat the operator name keywords @code{and}, @code{bitand},
1766 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
1767 synonyms as keywords.
1768
1769 @item -fno-optional-diags
1770 @opindex fno-optional-diags
1771 Disable diagnostics that the standard says a compiler does not need to
1772 issue.  Currently, the only such diagnostic issued by G++ is the one for
1773 a name having multiple meanings within a class.
1774
1775 @item -fpermissive
1776 @opindex fpermissive
1777 Downgrade some diagnostics about nonconformant code from errors to
1778 warnings.  Thus, using @option{-fpermissive} will allow some
1779 nonconforming code to compile.
1780
1781 @item -frepo
1782 @opindex frepo
1783 Enable automatic template instantiation at link time.  This option also
1784 implies @option{-fno-implicit-templates}.  @xref{Template
1785 Instantiation}, for more information.
1786
1787 @item -fno-rtti
1788 @opindex fno-rtti
1789 Disable generation of information about every class with virtual
1790 functions for use by the C++ runtime type identification features
1791 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
1792 of the language, you can save some space by using this flag.  Note that
1793 exception handling uses the same information, but it will generate it as
1794 needed. The @samp{dynamic_cast} operator can still be used for casts that
1795 do not require runtime type information, i.e. casts to @code{void *} or to
1796 unambiguous base classes.
1797
1798 @item -fstats
1799 @opindex fstats
1800 Emit statistics about front-end processing at the end of the compilation.
1801 This information is generally only useful to the G++ development team.
1802
1803 @item -ftemplate-depth-@var{n}
1804 @opindex ftemplate-depth
1805 Set the maximum instantiation depth for template classes to @var{n}.
1806 A limit on the template instantiation depth is needed to detect
1807 endless recursions during template class instantiation.  ANSI/ISO C++
1808 conforming programs must not rely on a maximum depth greater than 17.
1809
1810 @item -fno-threadsafe-statics
1811 @opindex fno-threadsafe-statics
1812 Do not emit the extra code to use the routines specified in the C++
1813 ABI for thread-safe initialization of local statics.  You can use this
1814 option to reduce code size slightly in code that doesn't need to be
1815 thread-safe.
1816
1817 @item -fuse-cxa-atexit
1818 @opindex fuse-cxa-atexit
1819 Register destructors for objects with static storage duration with the
1820 @code{__cxa_atexit} function rather than the @code{atexit} function.
1821 This option is required for fully standards-compliant handling of static
1822 destructors, but will only work if your C library supports
1823 @code{__cxa_atexit}.
1824
1825 @item -fno-use-cxa-get-exception-ptr
1826 @opindex fno-use-cxa-get-exception-ptr
1827 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
1828 will cause @code{std::uncaught_exception} to be incorrect, but is necessary
1829 if the runtime routine is not available.
1830
1831 @item -fvisibility-inlines-hidden
1832 @opindex fvisibility-inlines-hidden
1833 This switch declares that the user does not attempt to compare
1834 pointers to inline methods where the addresses of the two functions
1835 were taken in different shared objects.
1836
1837 The effect of this is that GCC may, effectively, mark inline methods with
1838 @code{__attribute__ ((visibility ("hidden")))} so that they do not
1839 appear in the export table of a DSO and do not require a PLT indirection
1840 when used within the DSO@.  Enabling this option can have a dramatic effect
1841 on load and link times of a DSO as it massively reduces the size of the
1842 dynamic export table when the library makes heavy use of templates.
1843
1844 The behavior of this switch is not quite the same as marking the
1845 methods as hidden directly, because it does not affect static variables
1846 local to the function or cause the compiler to deduce that
1847 the function is defined in only one shared object.
1848
1849 You may mark a method as having a visibility explicitly to negate the
1850 effect of the switch for that method.  For example, if you do want to
1851 compare pointers to a particular inline method, you might mark it as
1852 having default visibility.  Marking the enclosing class with explicit
1853 visibility will have no effect.
1854
1855 Explicitly instantiated inline methods are unaffected by this option
1856 as their linkage might otherwise cross a shared library boundary.
1857 @xref{Template Instantiation}.
1858
1859 @item -fvisibility-ms-compat
1860 @opindex fvisibility-ms-compat
1861 This flag attempts to use visibility settings to make GCC's C++
1862 linkage model compatible with that of Microsoft Visual Studio.
1863
1864 The flag makes these changes to GCC's linkage model:
1865
1866 @enumerate
1867 @item
1868 It sets the default visibility to @code{hidden}, like
1869 @option{-fvisibility=hidden}.
1870
1871 @item
1872 Types, but not their members, are not hidden by default.
1873
1874 @item
1875 The One Definition Rule is relaxed for types without explicit
1876 visibility specifications which are defined in more than one different
1877 shared object: those declarations are permitted if they would have
1878 been permitted when this option was not used.
1879 @end enumerate
1880
1881 In new code it is better to use @option{-fvisibility=hidden} and
1882 export those classes which are intended to be externally visible.
1883 Unfortunately it is possible for code to rely, perhaps accidentally,
1884 on the Visual Studio behavior.
1885
1886 Among the consequences of these changes are that static data members
1887 of the same type with the same name but defined in different shared
1888 objects will be different, so changing one will not change the other;
1889 and that pointers to function members defined in different shared
1890 objects may not compare equal.  When this flag is given, it is a
1891 violation of the ODR to define types with the same name differently.
1892
1893 @item -fno-weak
1894 @opindex fno-weak
1895 Do not use weak symbol support, even if it is provided by the linker.
1896 By default, G++ will use weak symbols if they are available.  This
1897 option exists only for testing, and should not be used by end-users;
1898 it will result in inferior code and has no benefits.  This option may
1899 be removed in a future release of G++.
1900
1901 @item -nostdinc++
1902 @opindex nostdinc++
1903 Do not search for header files in the standard directories specific to
1904 C++, but do still search the other standard directories.  (This option
1905 is used when building the C++ library.)
1906 @end table
1907
1908 In addition, these optimization, warning, and code generation options
1909 have meanings only for C++ programs:
1910
1911 @table @gcctabopt
1912 @item -fno-default-inline
1913 @opindex fno-default-inline
1914 Do not assume @samp{inline} for functions defined inside a class scope.
1915 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
1916 functions will have linkage like inline functions; they just won't be
1917 inlined by default.
1918
1919 @item -Wabi @r{(C++ only)}
1920 @opindex Wabi
1921 Warn when G++ generates code that is probably not compatible with the
1922 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
1923 all such cases, there are probably some cases that are not warned about,
1924 even though G++ is generating incompatible code.  There may also be
1925 cases where warnings are emitted even though the code that is generated
1926 will be compatible.
1927
1928 You should rewrite your code to avoid these warnings if you are
1929 concerned about the fact that code generated by G++ may not be binary
1930 compatible with code generated by other compilers.
1931
1932 The known incompatibilities at this point include:
1933
1934 @itemize @bullet
1935
1936 @item
1937 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
1938 pack data into the same byte as a base class.  For example:
1939
1940 @smallexample
1941 struct A @{ virtual void f(); int f1 : 1; @};
1942 struct B : public A @{ int f2 : 1; @};
1943 @end smallexample
1944
1945 @noindent
1946 In this case, G++ will place @code{B::f2} into the same byte
1947 as@code{A::f1}; other compilers will not.  You can avoid this problem
1948 by explicitly padding @code{A} so that its size is a multiple of the
1949 byte size on your platform; that will cause G++ and other compilers to
1950 layout @code{B} identically.
1951
1952 @item
1953 Incorrect handling of tail-padding for virtual bases.  G++ does not use
1954 tail padding when laying out virtual bases.  For example:
1955
1956 @smallexample
1957 struct A @{ virtual void f(); char c1; @};
1958 struct B @{ B(); char c2; @};
1959 struct C : public A, public virtual B @{@};
1960 @end smallexample
1961
1962 @noindent
1963 In this case, G++ will not place @code{B} into the tail-padding for
1964 @code{A}; other compilers will.  You can avoid this problem by
1965 explicitly padding @code{A} so that its size is a multiple of its
1966 alignment (ignoring virtual base classes); that will cause G++ and other
1967 compilers to layout @code{C} identically.
1968
1969 @item
1970 Incorrect handling of bit-fields with declared widths greater than that
1971 of their underlying types, when the bit-fields appear in a union.  For
1972 example:
1973
1974 @smallexample
1975 union U @{ int i : 4096; @};
1976 @end smallexample
1977
1978 @noindent
1979 Assuming that an @code{int} does not have 4096 bits, G++ will make the
1980 union too small by the number of bits in an @code{int}.
1981
1982 @item
1983 Empty classes can be placed at incorrect offsets.  For example:
1984
1985 @smallexample
1986 struct A @{@};
1987
1988 struct B @{
1989   A a;
1990   virtual void f ();
1991 @};
1992
1993 struct C : public B, public A @{@};
1994 @end smallexample
1995
1996 @noindent
1997 G++ will place the @code{A} base class of @code{C} at a nonzero offset;
1998 it should be placed at offset zero.  G++ mistakenly believes that the
1999 @code{A} data member of @code{B} is already at offset zero.
2000
2001 @item
2002 Names of template functions whose types involve @code{typename} or
2003 template template parameters can be mangled incorrectly.
2004
2005 @smallexample
2006 template <typename Q>
2007 void f(typename Q::X) @{@}
2008
2009 template <template <typename> class Q>
2010 void f(typename Q<int>::X) @{@}
2011 @end smallexample
2012
2013 @noindent
2014 Instantiations of these templates may be mangled incorrectly.
2015
2016 @end itemize
2017
2018 @item -Wctor-dtor-privacy @r{(C++ only)}
2019 @opindex Wctor-dtor-privacy
2020 Warn when a class seems unusable because all the constructors or
2021 destructors in that class are private, and it has neither friends nor
2022 public static member functions.
2023
2024 @item -Wnon-virtual-dtor @r{(C++ only)}
2025 @opindex Wnon-virtual-dtor
2026 Warn when a class has virtual functions and accessible non-virtual
2027 destructor, in which case it would be possible but unsafe to delete
2028 an instance of a derived class through a pointer to the base class.
2029 This warning is also enabled if -Weffc++ is specified.
2030
2031 @item -Wreorder @r{(C++ only)}
2032 @opindex Wreorder
2033 @cindex reordering, warning
2034 @cindex warning for reordering of member initializers
2035 Warn when the order of member initializers given in the code does not
2036 match the order in which they must be executed.  For instance:
2037
2038 @smallexample
2039 struct A @{
2040   int i;
2041   int j;
2042   A(): j (0), i (1) @{ @}
2043 @};
2044 @end smallexample
2045
2046 The compiler will rearrange the member initializers for @samp{i}
2047 and @samp{j} to match the declaration order of the members, emitting
2048 a warning to that effect.  This warning is enabled by @option{-Wall}.
2049 @end table
2050
2051 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
2052
2053 @table @gcctabopt
2054 @item -Weffc++ @r{(C++ only)}
2055 @opindex Weffc++
2056 Warn about violations of the following style guidelines from Scott Meyers'
2057 @cite{Effective C++} book:
2058
2059 @itemize @bullet
2060 @item
2061 Item 11:  Define a copy constructor and an assignment operator for classes
2062 with dynamically allocated memory.
2063
2064 @item
2065 Item 12:  Prefer initialization to assignment in constructors.
2066
2067 @item
2068 Item 14:  Make destructors virtual in base classes.
2069
2070 @item
2071 Item 15:  Have @code{operator=} return a reference to @code{*this}.
2072
2073 @item
2074 Item 23:  Don't try to return a reference when you must return an object.
2075
2076 @end itemize
2077
2078 Also warn about violations of the following style guidelines from
2079 Scott Meyers' @cite{More Effective C++} book:
2080
2081 @itemize @bullet
2082 @item
2083 Item 6:  Distinguish between prefix and postfix forms of increment and
2084 decrement operators.
2085
2086 @item
2087 Item 7:  Never overload @code{&&}, @code{||}, or @code{,}.
2088
2089 @end itemize
2090
2091 When selecting this option, be aware that the standard library
2092 headers do not obey all of these guidelines; use @samp{grep -v}
2093 to filter out those warnings.
2094
2095 @item -Wno-deprecated @r{(C++ only)}
2096 @opindex Wno-deprecated
2097 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
2098
2099 @item -Wstrict-null-sentinel @r{(C++ only)}
2100 @opindex Wstrict-null-sentinel
2101 Warn also about the use of an uncasted @code{NULL} as sentinel.  When
2102 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2103 to @code{__null}.  Although it is a null pointer constant not a null pointer,
2104 it is guaranteed to of the same size as a pointer.  But this use is
2105 not portable across different compilers.
2106
2107 @item -Wno-non-template-friend @r{(C++ only)}
2108 @opindex Wno-non-template-friend
2109 Disable warnings when non-templatized friend functions are declared
2110 within a template.  Since the advent of explicit template specification
2111 support in G++, if the name of the friend is an unqualified-id (i.e.,
2112 @samp{friend foo(int)}), the C++ language specification demands that the
2113 friend declare or define an ordinary, nontemplate function.  (Section
2114 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2115 could be interpreted as a particular specialization of a templatized
2116 function.  Because this non-conforming behavior is no longer the default
2117 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2118 check existing code for potential trouble spots and is on by default.
2119 This new compiler behavior can be turned off with
2120 @option{-Wno-non-template-friend} which keeps the conformant compiler code
2121 but disables the helpful warning.
2122
2123 @item -Wold-style-cast @r{(C++ only)}
2124 @opindex Wold-style-cast
2125 Warn if an old-style (C-style) cast to a non-void type is used within
2126 a C++ program.  The new-style casts (@samp{dynamic_cast},
2127 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
2128 less vulnerable to unintended effects and much easier to search for.
2129
2130 @item -Woverloaded-virtual @r{(C++ only)}
2131 @opindex Woverloaded-virtual
2132 @cindex overloaded virtual fn, warning
2133 @cindex warning for overloaded virtual fn
2134 Warn when a function declaration hides virtual functions from a
2135 base class.  For example, in:
2136
2137 @smallexample
2138 struct A @{
2139   virtual void f();
2140 @};
2141
2142 struct B: public A @{
2143   void f(int);
2144 @};
2145 @end smallexample
2146
2147 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2148 like:
2149
2150 @smallexample
2151 B* b;
2152 b->f();
2153 @end smallexample
2154
2155 will fail to compile.
2156
2157 @item -Wno-pmf-conversions @r{(C++ only)}
2158 @opindex Wno-pmf-conversions
2159 Disable the diagnostic for converting a bound pointer to member function
2160 to a plain pointer.
2161
2162 @item -Wsign-promo @r{(C++ only)}
2163 @opindex Wsign-promo
2164 Warn when overload resolution chooses a promotion from unsigned or
2165 enumerated type to a signed type, over a conversion to an unsigned type of
2166 the same size.  Previous versions of G++ would try to preserve
2167 unsignedness, but the standard mandates the current behavior.
2168
2169 @smallexample
2170 struct A @{
2171   operator int ();
2172   A& operator = (int);
2173 @};
2174
2175 main ()
2176 @{
2177   A a,b;
2178   a = b;
2179 @}
2180 @end smallexample
2181
2182 In this example, G++ will synthesize a default @samp{A& operator =
2183 (const A&);}, while cfront will use the user-defined @samp{operator =}.
2184 @end table
2185
2186 @node Objective-C and Objective-C++ Dialect Options
2187 @section Options Controlling Objective-C and Objective-C++ Dialects
2188
2189 @cindex compiler options, Objective-C and Objective-C++
2190 @cindex Objective-C and Objective-C++ options, command line
2191 @cindex options, Objective-C and Objective-C++
2192 (NOTE: This manual does not describe the Objective-C and Objective-C++
2193 languages themselves.  See @xref{Standards,,Language Standards
2194 Supported by GCC}, for references.)
2195
2196 This section describes the command-line options that are only meaningful
2197 for Objective-C and Objective-C++ programs, but you can also use most of
2198 the language-independent GNU compiler options.
2199 For example, you might compile a file @code{some_class.m} like this:
2200
2201 @smallexample
2202 gcc -g -fgnu-runtime -O -c some_class.m
2203 @end smallexample
2204
2205 @noindent
2206 In this example, @option{-fgnu-runtime} is an option meant only for
2207 Objective-C and Objective-C++ programs; you can use the other options with
2208 any language supported by GCC@.
2209
2210 Note that since Objective-C is an extension of the C language, Objective-C
2211 compilations may also use options specific to the C front-end (e.g.,
2212 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2213 C++-specific options (e.g., @option{-Wabi}).
2214
2215 Here is a list of options that are @emph{only} for compiling Objective-C
2216 and Objective-C++ programs:
2217
2218 @table @gcctabopt
2219 @item -fconstant-string-class=@var{class-name}
2220 @opindex fconstant-string-class
2221 Use @var{class-name} as the name of the class to instantiate for each
2222 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2223 class name is @code{NXConstantString} if the GNU runtime is being used, and
2224 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2225 @option{-fconstant-cfstrings} option, if also present, will override the
2226 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2227 to be laid out as constant CoreFoundation strings.
2228
2229 @item -fgnu-runtime
2230 @opindex fgnu-runtime
2231 Generate object code compatible with the standard GNU Objective-C
2232 runtime.  This is the default for most types of systems.
2233
2234 @item -fnext-runtime
2235 @opindex fnext-runtime
2236 Generate output compatible with the NeXT runtime.  This is the default
2237 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2238 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2239 used.
2240
2241 @item -fno-nil-receivers
2242 @opindex fno-nil-receivers
2243 Assume that all Objective-C message dispatches (e.g.,
2244 @code{[receiver message:arg]}) in this translation unit ensure that the receiver
2245 is not @code{nil}.  This allows for more efficient entry points in the runtime
2246 to be used.  Currently, this option is only available in conjunction with
2247 the NeXT runtime on Mac OS X 10.3 and later.
2248
2249 @item -fobjc-call-cxx-cdtors
2250 @opindex fobjc-call-cxx-cdtors
2251 For each Objective-C class, check if any of its instance variables is a
2252 C++ object with a non-trivial default constructor.  If so, synthesize a
2253 special @code{- (id) .cxx_construct} instance method that will run
2254 non-trivial default constructors on any such instance variables, in order,
2255 and then return @code{self}.  Similarly, check if any instance variable
2256 is a C++ object with a non-trivial destructor, and if so, synthesize a
2257 special @code{- (void) .cxx_destruct} method that will run
2258 all such default destructors, in reverse order.
2259
2260 The @code{- (id) .cxx_construct} and/or @code{- (void) .cxx_destruct} methods
2261 thusly generated will only operate on instance variables declared in the
2262 current Objective-C class, and not those inherited from superclasses.  It
2263 is the responsibility of the Objective-C runtime to invoke all such methods
2264 in an object's inheritance hierarchy.  The @code{- (id) .cxx_construct} methods
2265 will be invoked by the runtime immediately after a new object
2266 instance is allocated; the @code{- (void) .cxx_destruct} methods will
2267 be invoked immediately before the runtime deallocates an object instance.
2268
2269 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2270 support for invoking the @code{- (id) .cxx_construct} and
2271 @code{- (void) .cxx_destruct} methods.
2272
2273 @item -fobjc-direct-dispatch
2274 @opindex fobjc-direct-dispatch
2275 Allow fast jumps to the message dispatcher.  On Darwin this is
2276 accomplished via the comm page.
2277
2278 @item -fobjc-exceptions
2279 @opindex fobjc-exceptions
2280 Enable syntactic support for structured exception handling in Objective-C,
2281 similar to what is offered by C++ and Java.  This option is
2282 unavailable in conjunction with the NeXT runtime on Mac OS X 10.2 and
2283 earlier.
2284
2285 @smallexample
2286   @@try @{
2287     @dots{}
2288        @@throw expr;
2289     @dots{}
2290   @}
2291   @@catch (AnObjCClass *exc) @{
2292     @dots{}
2293       @@throw expr;
2294     @dots{}
2295       @@throw;
2296     @dots{}
2297   @}
2298   @@catch (AnotherClass *exc) @{
2299     @dots{}
2300   @}
2301   @@catch (id allOthers) @{
2302     @dots{}
2303   @}
2304   @@finally @{
2305     @dots{}
2306       @@throw expr;
2307     @dots{}
2308   @}
2309 @end smallexample
2310
2311 The @code{@@throw} statement may appear anywhere in an Objective-C or
2312 Objective-C++ program; when used inside of a @code{@@catch} block, the
2313 @code{@@throw} may appear without an argument (as shown above), in which case
2314 the object caught by the @code{@@catch} will be rethrown.
2315
2316 Note that only (pointers to) Objective-C objects may be thrown and
2317 caught using this scheme.  When an object is thrown, it will be caught
2318 by the nearest @code{@@catch} clause capable of handling objects of that type,
2319 analogously to how @code{catch} blocks work in C++ and Java.  A
2320 @code{@@catch(id @dots{})} clause (as shown above) may also be provided to catch
2321 any and all Objective-C exceptions not caught by previous @code{@@catch}
2322 clauses (if any).
2323
2324 The @code{@@finally} clause, if present, will be executed upon exit from the
2325 immediately preceding @code{@@try @dots{} @@catch} section.  This will happen
2326 regardless of whether any exceptions are thrown, caught or rethrown
2327 inside the @code{@@try @dots{} @@catch} section, analogously to the behavior
2328 of the @code{finally} clause in Java.
2329
2330 There are several caveats to using the new exception mechanism:
2331
2332 @itemize @bullet
2333 @item
2334 Although currently designed to be binary compatible with @code{NS_HANDLER}-style
2335 idioms provided by the @code{NSException} class, the new
2336 exceptions can only be used on Mac OS X 10.3 (Panther) and later
2337 systems, due to additional functionality needed in the (NeXT) Objective-C
2338 runtime.
2339
2340 @item
2341 As mentioned above, the new exceptions do not support handling
2342 types other than Objective-C objects.   Furthermore, when used from
2343 Objective-C++, the Objective-C exception model does not interoperate with C++
2344 exceptions at this time.  This means you cannot @code{@@throw} an exception
2345 from Objective-C and @code{catch} it in C++, or vice versa
2346 (i.e., @code{throw @dots{} @@catch}).
2347 @end itemize
2348
2349 The @option{-fobjc-exceptions} switch also enables the use of synchronization
2350 blocks for thread-safe execution:
2351
2352 @smallexample
2353   @@synchronized (ObjCClass *guard) @{
2354     @dots{}
2355   @}
2356 @end smallexample
2357
2358 Upon entering the @code{@@synchronized} block, a thread of execution shall
2359 first check whether a lock has been placed on the corresponding @code{guard}
2360 object by another thread.  If it has, the current thread shall wait until
2361 the other thread relinquishes its lock.  Once @code{guard} becomes available,
2362 the current thread will place its own lock on it, execute the code contained in
2363 the @code{@@synchronized} block, and finally relinquish the lock (thereby
2364 making @code{guard} available to other threads).
2365
2366 Unlike Java, Objective-C does not allow for entire methods to be marked
2367 @code{@@synchronized}.  Note that throwing exceptions out of
2368 @code{@@synchronized} blocks is allowed, and will cause the guarding object
2369 to be unlocked properly.
2370
2371 @item -fobjc-gc
2372 @opindex fobjc-gc
2373 Enable garbage collection (GC) in Objective-C and Objective-C++ programs.
2374
2375 @item -freplace-objc-classes
2376 @opindex freplace-objc-classes
2377 Emit a special marker instructing @command{ld(1)} not to statically link in
2378 the resulting object file, and allow @command{dyld(1)} to load it in at
2379 run time instead.  This is used in conjunction with the Fix-and-Continue
2380 debugging mode, where the object file in question may be recompiled and
2381 dynamically reloaded in the course of program execution, without the need
2382 to restart the program itself.  Currently, Fix-and-Continue functionality
2383 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2384 and later.
2385
2386 @item -fzero-link
2387 @opindex fzero-link
2388 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2389 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2390 compile time) with static class references that get initialized at load time,
2391 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2392 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2393 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2394 for individual class implementations to be modified during program execution.
2395
2396 @item -gen-decls
2397 @opindex gen-decls
2398 Dump interface declarations for all classes seen in the source file to a
2399 file named @file{@var{sourcename}.decl}.
2400
2401 @item -Wassign-intercept
2402 @opindex Wassign-intercept
2403 Warn whenever an Objective-C assignment is being intercepted by the
2404 garbage collector.
2405
2406 @item -Wno-protocol
2407 @opindex Wno-protocol
2408 If a class is declared to implement a protocol, a warning is issued for
2409 every method in the protocol that is not implemented by the class.  The
2410 default behavior is to issue a warning for every method not explicitly
2411 implemented in the class, even if a method implementation is inherited
2412 from the superclass.  If you use the @option{-Wno-protocol} option, then
2413 methods inherited from the superclass are considered to be implemented,
2414 and no warning is issued for them.
2415
2416 @item -Wselector
2417 @opindex Wselector
2418 Warn if multiple methods of different types for the same selector are
2419 found during compilation.  The check is performed on the list of methods
2420 in the final stage of compilation.  Additionally, a check is performed
2421 for each selector appearing in a @code{@@selector(@dots{})}
2422 expression, and a corresponding method for that selector has been found
2423 during compilation.  Because these checks scan the method table only at
2424 the end of compilation, these warnings are not produced if the final
2425 stage of compilation is not reached, for example because an error is
2426 found during compilation, or because the @option{-fsyntax-only} option is
2427 being used.
2428
2429 @item -Wstrict-selector-match
2430 @opindex Wstrict-selector-match
2431 Warn if multiple methods with differing argument and/or return types are
2432 found for a given selector when attempting to send a message using this
2433 selector to a receiver of type @code{id} or @code{Class}.  When this flag
2434 is off (which is the default behavior), the compiler will omit such warnings
2435 if any differences found are confined to types which share the same size
2436 and alignment.
2437
2438 @item -Wundeclared-selector
2439 @opindex Wundeclared-selector
2440 Warn if a @code{@@selector(@dots{})} expression referring to an
2441 undeclared selector is found.  A selector is considered undeclared if no
2442 method with that name has been declared before the
2443 @code{@@selector(@dots{})} expression, either explicitly in an
2444 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
2445 an @code{@@implementation} section.  This option always performs its
2446 checks as soon as a @code{@@selector(@dots{})} expression is found,
2447 while @option{-Wselector} only performs its checks in the final stage of
2448 compilation.  This also enforces the coding style convention
2449 that methods and selectors must be declared before being used.
2450
2451 @item -print-objc-runtime-info
2452 @opindex print-objc-runtime-info
2453 Generate C header describing the largest structure that is passed by
2454 value, if any.
2455
2456 @end table
2457
2458 @node Language Independent Options
2459 @section Options to Control Diagnostic Messages Formatting
2460 @cindex options to control diagnostics formatting
2461 @cindex diagnostic messages
2462 @cindex message formatting
2463
2464 Traditionally, diagnostic messages have been formatted irrespective of
2465 the output device's aspect (e.g.@: its width, @dots{}).  The options described
2466 below can be used to control the diagnostic messages formatting
2467 algorithm, e.g.@: how many characters per line, how often source location
2468 information should be reported.  Right now, only the C++ front end can
2469 honor these options.  However it is expected, in the near future, that
2470 the remaining front ends would be able to digest them correctly.
2471
2472 @table @gcctabopt
2473 @item -fmessage-length=@var{n}
2474 @opindex fmessage-length
2475 Try to format error messages so that they fit on lines of about @var{n}
2476 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
2477 the front ends supported by GCC@.  If @var{n} is zero, then no
2478 line-wrapping will be done; each error message will appear on a single
2479 line.
2480
2481 @opindex fdiagnostics-show-location
2482 @item -fdiagnostics-show-location=once
2483 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
2484 reporter to emit @emph{once} source location information; that is, in
2485 case the message is too long to fit on a single physical line and has to
2486 be wrapped, the source location won't be emitted (as prefix) again,
2487 over and over, in subsequent continuation lines.  This is the default
2488 behavior.
2489
2490 @item -fdiagnostics-show-location=every-line
2491 Only meaningful in line-wrapping mode.  Instructs the diagnostic
2492 messages reporter to emit the same source location information (as
2493 prefix) for physical lines that result from the process of breaking
2494 a message which is too long to fit on a single line.
2495
2496 @item -fdiagnostics-show-option
2497 @opindex fdiagnostics-show-option
2498 This option instructs the diagnostic machinery to add text to each
2499 diagnostic emitted, which indicates which command line option directly
2500 controls that diagnostic, when such an option is known to the
2501 diagnostic machinery.
2502
2503 @item -Wcoverage-mismatch
2504 @opindex Wcoverage-mismatch
2505 Warn if feedback profiles do not match when using the
2506 @option{-fprofile-use} option.
2507 If a source file was changed between @option{-fprofile-gen} and
2508 @option{-fprofile-use}, the files with the profile feedback can fail
2509 to match the source file and GCC can not use the profile feedback
2510 information.  By default, GCC emits an error message in this case.
2511 The option @option{-Wcoverage-mismatch} emits a warning instead of an
2512 error.  GCC does not use appropriate feedback profiles, so using this
2513 option can result in poorly optimized code.  This option is useful
2514 only in the case of very minor changes such as bug fixes to an
2515 existing code-base.
2516
2517 @end table
2518
2519 @node Warning Options
2520 @section Options to Request or Suppress Warnings
2521 @cindex options to control warnings
2522 @cindex warning messages
2523 @cindex messages, warning
2524 @cindex suppressing warnings
2525
2526 Warnings are diagnostic messages that report constructions which
2527 are not inherently erroneous but which are risky or suggest there
2528 may have been an error.
2529
2530 The following language-independent options do not enable specific
2531 warnings but control the kinds of diagnostics produced by GCC.
2532
2533 @table @gcctabopt
2534 @cindex syntax checking
2535 @item -fsyntax-only
2536 @opindex fsyntax-only
2537 Check the code for syntax errors, but don't do anything beyond that.
2538
2539 @item -w
2540 @opindex w
2541 Inhibit all warning messages.
2542
2543 @item -Werror
2544 @opindex Werror
2545 Make all warnings into errors.
2546
2547 @item -Werror=
2548 @opindex Werror=
2549 Make the specified warning into an error.  The specifier for a warning
2550 is appended, for example @option{-Werror=switch} turns the warnings
2551 controlled by @option{-Wswitch} into errors.  This switch takes a
2552 negative form, to be used to negate @option{-Werror} for specific
2553 warnings, for example @option{-Wno-error=switch} makes
2554 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
2555 is in effect.  You can use the @option{-fdiagnostics-show-option}
2556 option to have each controllable warning amended with the option which
2557 controls it, to determine what to use with this option.
2558
2559 Note that specifying @option{-Werror=}@var{foo} automatically implies
2560 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
2561 imply anything.
2562
2563 @item -Wfatal-errors
2564 @opindex Wfatal-errors
2565 This option causes the compiler to abort compilation on the first error
2566 occurred rather than trying to keep going and printing further error
2567 messages.
2568
2569 @end table
2570
2571 You can request many specific warnings with options beginning
2572 @samp{-W}, for example @option{-Wimplicit} to request warnings on
2573 implicit declarations.  Each of these specific warning options also
2574 has a negative form beginning @samp{-Wno-} to turn off warnings; for
2575 example, @option{-Wno-implicit}.  This manual lists only one of the
2576 two forms, whichever is not the default.  For further,
2577 language-specific options also refer to @ref{C++ Dialect Options} and
2578 @ref{Objective-C and Objective-C++ Dialect Options}.
2579
2580 @table @gcctabopt
2581 @item -pedantic
2582 @opindex pedantic
2583 Issue all the warnings demanded by strict ISO C and ISO C++;
2584 reject all programs that use forbidden extensions, and some other
2585 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
2586 version of the ISO C standard specified by any @option{-std} option used.
2587
2588 Valid ISO C and ISO C++ programs should compile properly with or without
2589 this option (though a rare few will require @option{-ansi} or a
2590 @option{-std} option specifying the required version of ISO C)@.  However,
2591 without this option, certain GNU extensions and traditional C and C++
2592 features are supported as well.  With this option, they are rejected.
2593
2594 @option{-pedantic} does not cause warning messages for use of the
2595 alternate keywords whose names begin and end with @samp{__}.  Pedantic
2596 warnings are also disabled in the expression that follows
2597 @code{__extension__}.  However, only system header files should use
2598 these escape routes; application programs should avoid them.
2599 @xref{Alternate Keywords}.
2600
2601 Some users try to use @option{-pedantic} to check programs for strict ISO
2602 C conformance.  They soon find that it does not do quite what they want:
2603 it finds some non-ISO practices, but not all---only those for which
2604 ISO C @emph{requires} a diagnostic, and some others for which
2605 diagnostics have been added.
2606
2607 A feature to report any failure to conform to ISO C might be useful in
2608 some instances, but would require considerable additional work and would
2609 be quite different from @option{-pedantic}.  We don't have plans to
2610 support such a feature in the near future.
2611
2612 Where the standard specified with @option{-std} represents a GNU
2613 extended dialect of C, such as @samp{gnu89} or @samp{gnu99}, there is a
2614 corresponding @dfn{base standard}, the version of ISO C on which the GNU
2615 extended dialect is based.  Warnings from @option{-pedantic} are given
2616 where they are required by the base standard.  (It would not make sense
2617 for such warnings to be given only for features not in the specified GNU
2618 C dialect, since by definition the GNU dialects of C include all
2619 features the compiler supports with the given option, and there would be
2620 nothing to warn about.)
2621
2622 @item -pedantic-errors
2623 @opindex pedantic-errors
2624 Like @option{-pedantic}, except that errors are produced rather than
2625 warnings.
2626
2627 @item -Wall
2628 @opindex Wall
2629 This enables all the warnings about constructions that some users
2630 consider questionable, and that are easy to avoid (or modify to
2631 prevent the warning), even in conjunction with macros.  This also
2632 enables some language-specific warnings described in @ref{C++ Dialect
2633 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
2634
2635 @option{-Wall} turns on the following warning flags:
2636
2637 @gccoptlist{-Waddress   @gol
2638 -Warray-bounds @r{(only with} @option{-O2}@r{)}  @gol
2639 -Wc++0x-compat  @gol
2640 -Wchar-subscripts  @gol
2641 -Wimplicit-int  @gol
2642 -Wimplicit-function-declaration  @gol
2643 -Wcomment  @gol
2644 -Wformat   @gol
2645 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
2646 -Wmissing-braces  @gol
2647 -Wnonnull  @gol
2648 -Wparentheses  @gol
2649 -Wpointer-sign  @gol
2650 -Wreorder   @gol
2651 -Wreturn-type  @gol
2652 -Wsequence-point  @gol
2653 -Wsign-compare @r{(only in C++)}  @gol
2654 -Wstrict-aliasing  @gol
2655 -Wstrict-overflow  @gol
2656 -Wswitch  @gol
2657 -Wtrigraphs  @gol
2658 -Wuninitialized @r{(only with} @option{-O1} @r{and above)}  @gol
2659 -Wunknown-pragmas  @gol
2660 -Wunused-function  @gol
2661 -Wunused-label     @gol
2662 -Wunused-value     @gol
2663 -Wunused-variable  @gol
2664 }
2665
2666 Note that some warning flags are not implied by @option{-Wall}.  Some of
2667 them warn about constructions that users generally do not consider
2668 questionable, but which occasionally you might wish to check for;
2669 others warn about constructions that are necessary or hard to avoid in
2670 some cases, and there is no simple way to modify the code to suppress
2671 the warning. Some of them are enabled by @option{-Wextra} but many of
2672 them must be enabled individually.
2673
2674 @item -Wextra
2675 @opindex W
2676 @opindex Wextra
2677 This enables some extra warning flags that are not enabled by
2678 @option{-Wall}. (This option used to be called @option{-W}.  The older
2679 name is still supported, but the newer name is more descriptive.)
2680
2681 @gccoptlist{-Wclobbered  @gol
2682 -Wempty-body  @gol
2683 -Wmissing-field-initializers  @gol
2684 -Wmissing-parameter-type @r{(C only)}  @gol
2685 -Wold-style-declaration @r{(C only)}  @gol
2686 -Woverride-init  @gol
2687 -Wsign-compare  @gol
2688 -Wtype-limits  @gol
2689 -Wuninitialized @r{(only with} @option{-O1} @r{and above)}  @gol
2690 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}  @gol
2691 }
2692
2693 The option @option{-Wextra} also prints warning messages for the
2694 following cases:
2695
2696 @itemize @bullet
2697
2698 @item
2699 A pointer is compared against integer zero with @samp{<}, @samp{<=},
2700 @samp{>}, or @samp{>=}.
2701
2702 @item 
2703 (C++ only) An enumerator and a non-enumerator both appear in a
2704 conditional expression.
2705
2706 @item 
2707 (C++ only) A non-static reference or non-static @samp{const} member
2708 appears in a class without constructors.
2709
2710 @item 
2711 (C++ only) Ambiguous virtual bases.
2712
2713 @item 
2714 (C++ only) Subscripting an array which has been declared @samp{register}.
2715
2716 @item 
2717 (C++ only) Taking the address of a variable which has been declared
2718 @samp{register}.
2719
2720 @item 
2721 (C++ only) A base class is not initialized in a derived class' copy
2722 constructor.
2723
2724 @end itemize
2725
2726 @item -Wno-import
2727 @opindex Wno-import
2728 Inhibit warning messages about the use of @samp{#import}.
2729
2730 @item -Wchar-subscripts
2731 @opindex Wchar-subscripts
2732 Warn if an array subscript has type @code{char}.  This is a common cause
2733 of error, as programmers often forget that this type is signed on some
2734 machines.
2735 This warning is enabled by @option{-Wall}.
2736
2737 @item -Wcomment
2738 @opindex Wcomment
2739 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
2740 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
2741 This warning is enabled by @option{-Wall}.
2742
2743 @item -Wformat
2744 @opindex Wformat
2745 @opindex ffreestanding
2746 @opindex fno-builtin
2747 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
2748 the arguments supplied have types appropriate to the format string
2749 specified, and that the conversions specified in the format string make
2750 sense.  This includes standard functions, and others specified by format
2751 attributes (@pxref{Function Attributes}), in the @code{printf},
2752 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
2753 not in the C standard) families (or other target-specific families).
2754 Which functions are checked without format attributes having been
2755 specified depends on the standard version selected, and such checks of
2756 functions without the attribute specified are disabled by
2757 @option{-ffreestanding} or @option{-fno-builtin}.
2758
2759 The formats are checked against the format features supported by GNU
2760 libc version 2.2.  These include all ISO C90 and C99 features, as well
2761 as features from the Single Unix Specification and some BSD and GNU
2762 extensions.  Other library implementations may not support all these
2763 features; GCC does not support warning about features that go beyond a
2764 particular library's limitations.  However, if @option{-pedantic} is used
2765 with @option{-Wformat}, warnings will be given about format features not
2766 in the selected standard version (but not for @code{strfmon} formats,
2767 since those are not in any version of the C standard).  @xref{C Dialect
2768 Options,,Options Controlling C Dialect}.
2769
2770 Since @option{-Wformat} also checks for null format arguments for
2771 several functions, @option{-Wformat} also implies @option{-Wnonnull}.
2772
2773 @option{-Wformat} is included in @option{-Wall}.  For more control over some
2774 aspects of format checking, the options @option{-Wformat-y2k},
2775 @option{-Wno-format-extra-args}, @option{-Wno-format-zero-length},
2776 @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
2777 @option{-Wformat=2} are available, but are not included in @option{-Wall}.
2778
2779 @item -Wformat-y2k
2780 @opindex Wformat-y2k
2781 If @option{-Wformat} is specified, also warn about @code{strftime}
2782 formats which may yield only a two-digit year.
2783
2784 @item -Wno-format-extra-args
2785 @opindex Wno-format-extra-args
2786 If @option{-Wformat} is specified, do not warn about excess arguments to a
2787 @code{printf} or @code{scanf} format function.  The C standard specifies
2788 that such arguments are ignored.
2789
2790 Where the unused arguments lie between used arguments that are
2791 specified with @samp{$} operand number specifications, normally
2792 warnings are still given, since the implementation could not know what
2793 type to pass to @code{va_arg} to skip the unused arguments.  However,
2794 in the case of @code{scanf} formats, this option will suppress the
2795 warning if the unused arguments are all pointers, since the Single
2796 Unix Specification says that such unused arguments are allowed.
2797
2798 @item -Wno-format-zero-length
2799 @opindex Wno-format-zero-length
2800 If @option{-Wformat} is specified, do not warn about zero-length formats.
2801 The C standard specifies that zero-length formats are allowed.
2802
2803 @item -Wformat-nonliteral
2804 @opindex Wformat-nonliteral
2805 If @option{-Wformat} is specified, also warn if the format string is not a
2806 string literal and so cannot be checked, unless the format function
2807 takes its format arguments as a @code{va_list}.
2808
2809 @item -Wformat-security
2810 @opindex Wformat-security
2811 If @option{-Wformat} is specified, also warn about uses of format
2812 functions that represent possible security problems.  At present, this
2813 warns about calls to @code{printf} and @code{scanf} functions where the
2814 format string is not a string literal and there are no format arguments,
2815 as in @code{printf (foo);}.  This may be a security hole if the format
2816 string came from untrusted input and contains @samp{%n}.  (This is
2817 currently a subset of what @option{-Wformat-nonliteral} warns about, but
2818 in future warnings may be added to @option{-Wformat-security} that are not
2819 included in @option{-Wformat-nonliteral}.)
2820
2821 @item -Wformat=2
2822 @opindex Wformat=2
2823 Enable @option{-Wformat} plus format checks not included in
2824 @option{-Wformat}.  Currently equivalent to @samp{-Wformat
2825 -Wformat-nonliteral -Wformat-security -Wformat-y2k}.
2826
2827 @item -Wnonnull
2828 @opindex Wnonnull
2829 Warn about passing a null pointer for arguments marked as
2830 requiring a non-null value by the @code{nonnull} function attribute.
2831
2832 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
2833 can be disabled with the @option{-Wno-nonnull} option.
2834
2835 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
2836 @opindex Winit-self
2837 Warn about uninitialized variables which are initialized with themselves.
2838 Note this option can only be used with the @option{-Wuninitialized} option,
2839 which in turn only works with @option{-O1} and above.
2840
2841 For example, GCC will warn about @code{i} being uninitialized in the
2842 following snippet only when @option{-Winit-self} has been specified:
2843 @smallexample
2844 @group
2845 int f()
2846 @{
2847   int i = i;
2848   return i;
2849 @}
2850 @end group
2851 @end smallexample
2852
2853 @item -Wimplicit-int
2854 @opindex Wimplicit-int
2855 Warn when a declaration does not specify a type.
2856 This warning is enabled by @option{-Wall}.
2857
2858 @item -Wimplicit-function-declaration
2859 @opindex Wimplicit-function-declaration
2860 @opindex Wno-implicit-function-declaration
2861 Give a warning whenever a function is used before being declared. In
2862 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
2863 enabled by default and it is made into an error by
2864 @option{-pedantic-errors}. This warning is also enabled by
2865 @option{-Wall}.
2866
2867 @item -Wimplicit
2868 @opindex Wimplicit
2869 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
2870 This warning is enabled by @option{-Wall}.
2871
2872 @item -Wmain
2873 @opindex Wmain
2874 Warn if the type of @samp{main} is suspicious.  @samp{main} should be a
2875 function with external linkage, returning int, taking either zero
2876 arguments, two, or three arguments of appropriate types.
2877 This warning is enabled by @option{-Wall}.
2878
2879 @item -Wmissing-braces
2880 @opindex Wmissing-braces
2881 Warn if an aggregate or union initializer is not fully bracketed.  In
2882 the following example, the initializer for @samp{a} is not fully
2883 bracketed, but that for @samp{b} is fully bracketed.
2884
2885 @smallexample
2886 int a[2][2] = @{ 0, 1, 2, 3 @};
2887 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
2888 @end smallexample
2889
2890 This warning is enabled by @option{-Wall}.
2891
2892 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
2893 @opindex Wmissing-include-dirs
2894 Warn if a user-supplied include directory does not exist.
2895
2896 @item -Wparentheses
2897 @opindex Wparentheses
2898 Warn if parentheses are omitted in certain contexts, such
2899 as when there is an assignment in a context where a truth value
2900 is expected, or when operators are nested whose precedence people
2901 often get confused about.
2902
2903 Also warn if a comparison like @samp{x<=y<=z} appears; this is
2904 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
2905 interpretation from that of ordinary mathematical notation.
2906
2907 Also warn about constructions where there may be confusion to which
2908 @code{if} statement an @code{else} branch belongs.  Here is an example of
2909 such a case:
2910
2911 @smallexample
2912 @group
2913 @{
2914   if (a)
2915     if (b)
2916       foo ();
2917   else
2918     bar ();
2919 @}
2920 @end group
2921 @end smallexample
2922
2923 In C/C++, every @code{else} branch belongs to the innermost possible
2924 @code{if} statement, which in this example is @code{if (b)}.  This is
2925 often not what the programmer expected, as illustrated in the above
2926 example by indentation the programmer chose.  When there is the
2927 potential for this confusion, GCC will issue a warning when this flag
2928 is specified.  To eliminate the warning, add explicit braces around
2929 the innermost @code{if} statement so there is no way the @code{else}
2930 could belong to the enclosing @code{if}.  The resulting code would
2931 look like this:
2932
2933 @smallexample
2934 @group
2935 @{
2936   if (a)
2937     @{
2938       if (b)
2939         foo ();
2940       else
2941         bar ();
2942     @}
2943 @}
2944 @end group
2945 @end smallexample
2946
2947 This warning is enabled by @option{-Wall}.
2948
2949 @item -Wsequence-point
2950 @opindex Wsequence-point
2951 Warn about code that may have undefined semantics because of violations
2952 of sequence point rules in the C and C++ standards.
2953
2954 The C and C++ standards defines the order in which expressions in a C/C++
2955 program are evaluated in terms of @dfn{sequence points}, which represent
2956 a partial ordering between the execution of parts of the program: those
2957 executed before the sequence point, and those executed after it.  These
2958 occur after the evaluation of a full expression (one which is not part
2959 of a larger expression), after the evaluation of the first operand of a
2960 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
2961 function is called (but after the evaluation of its arguments and the
2962 expression denoting the called function), and in certain other places.
2963 Other than as expressed by the sequence point rules, the order of
2964 evaluation of subexpressions of an expression is not specified.  All
2965 these rules describe only a partial order rather than a total order,
2966 since, for example, if two functions are called within one expression
2967 with no sequence point between them, the order in which the functions
2968 are called is not specified.  However, the standards committee have
2969 ruled that function calls do not overlap.
2970
2971 It is not specified when between sequence points modifications to the
2972 values of objects take effect.  Programs whose behavior depends on this
2973 have undefined behavior; the C and C++ standards specify that ``Between
2974 the previous and next sequence point an object shall have its stored
2975 value modified at most once by the evaluation of an expression.
2976 Furthermore, the prior value shall be read only to determine the value
2977 to be stored.''.  If a program breaks these rules, the results on any
2978 particular implementation are entirely unpredictable.
2979
2980 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
2981 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
2982 diagnosed by this option, and it may give an occasional false positive
2983 result, but in general it has been found fairly effective at detecting
2984 this sort of problem in programs.
2985
2986 The standard is worded confusingly, therefore there is some debate
2987 over the precise meaning of the sequence point rules in subtle cases.
2988 Links to discussions of the problem, including proposed formal
2989 definitions, may be found on the GCC readings page, at
2990 @w{@uref{http://gcc.gnu.org/readings.html}}.
2991
2992 This warning is enabled by @option{-Wall} for C and C++.
2993
2994 @item -Wreturn-type
2995 @opindex Wreturn-type
2996 @opindex Wno-return-type
2997 Warn whenever a function is defined with a return-type that defaults
2998 to @code{int}.  Also warn about any @code{return} statement with no
2999 return-value in a function whose return-type is not @code{void}
3000 (falling off the end of the function body is considered returning
3001 without a value), and about a @code{return} statement with a
3002 expression in a function whose return-type is @code{void}.
3003
3004 Also warn if the return type of a function has a type qualifier
3005 such as @code{const}.  For ISO C such a type qualifier has no effect,
3006 since the value returned by a function is not an lvalue.
3007 For C++, the warning is only emitted for scalar types or @code{void}.
3008 ISO C prohibits qualified @code{void} return types on function
3009 definitions, so such return types always receive a warning
3010 even without this option.
3011
3012 For C++, a function without return type always produces a diagnostic
3013 message, even when @option{-Wno-return-type} is specified.  The only
3014 exceptions are @samp{main} and functions defined in system headers.
3015
3016 This warning is enabled by @option{-Wall}.
3017
3018 @item -Wswitch
3019 @opindex Wswitch
3020 Warn whenever a @code{switch} statement has an index of enumerated type
3021 and lacks a @code{case} for one or more of the named codes of that
3022 enumeration.  (The presence of a @code{default} label prevents this
3023 warning.)  @code{case} labels outside the enumeration range also
3024 provoke warnings when this option is used.
3025 This warning is enabled by @option{-Wall}.
3026
3027 @item -Wswitch-default
3028 @opindex Wswitch-switch
3029 Warn whenever a @code{switch} statement does not have a @code{default}
3030 case.
3031
3032 @item -Wswitch-enum
3033 @opindex Wswitch-enum
3034 Warn whenever a @code{switch} statement has an index of enumerated type
3035 and lacks a @code{case} for one or more of the named codes of that
3036 enumeration.  @code{case} labels outside the enumeration range also
3037 provoke warnings when this option is used.
3038
3039 @item -Wtrigraphs
3040 @opindex Wtrigraphs
3041 Warn if any trigraphs are encountered that might change the meaning of
3042 the program (trigraphs within comments are not warned about).
3043 This warning is enabled by @option{-Wall}.
3044
3045 @item -Wunused-function
3046 @opindex Wunused-function
3047 Warn whenever a static function is declared but not defined or a
3048 non-inline static function is unused.
3049 This warning is enabled by @option{-Wall}.
3050
3051 @item -Wunused-label
3052 @opindex Wunused-label
3053 Warn whenever a label is declared but not used.
3054 This warning is enabled by @option{-Wall}.
3055
3056 To suppress this warning use the @samp{unused} attribute
3057 (@pxref{Variable Attributes}).
3058
3059 @item -Wunused-parameter
3060 @opindex Wunused-parameter
3061 Warn whenever a function parameter is unused aside from its declaration.
3062
3063 To suppress this warning use the @samp{unused} attribute
3064 (@pxref{Variable Attributes}).
3065
3066 @item -Wunused-variable
3067 @opindex Wunused-variable
3068 Warn whenever a local variable or non-constant static variable is unused
3069 aside from its declaration.
3070 This warning is enabled by @option{-Wall}.
3071
3072 To suppress this warning use the @samp{unused} attribute
3073 (@pxref{Variable Attributes}).
3074
3075 @item -Wunused-value
3076 @opindex Wunused-value
3077 Warn whenever a statement computes a result that is explicitly not
3078 used. To suppress this warning cast the unused expression to
3079 @samp{void}. This includes an expression-statement or the left-hand
3080 side of a comma expression that contains no side effects. For example,
3081 an expression such as @samp{x[i,j]} will cause a warning, while
3082 @samp{x[(void)i,j]} will not.
3083
3084 This warning is enabled by @option{-Wall}.
3085
3086 @item -Wunused
3087 @opindex Wunused
3088 All the above @option{-Wunused} options combined.
3089
3090 In order to get a warning about an unused function parameter, you must
3091 either specify @samp{-Wextra -Wunused} (note that @samp{-Wall} implies
3092 @samp{-Wunused}), or separately specify @option{-Wunused-parameter}.
3093
3094 @item -Wuninitialized
3095 @opindex Wuninitialized
3096 Warn if an automatic variable is used without first being initialized or
3097 if a variable may be clobbered by a @code{setjmp} call.
3098
3099 These warnings are possible only in optimizing compilation,
3100 because they require data flow information that is computed only
3101 when optimizing.  If you do not specify @option{-O}, you will not get
3102 these warnings. Instead, GCC will issue a warning about @option{-Wuninitialized}
3103 requiring @option{-O}.
3104
3105 If you want to warn about code which uses the uninitialized value of the
3106 variable in its own initializer, use the @option{-Winit-self} option.
3107
3108 These warnings occur for individual uninitialized or clobbered
3109 elements of structure, union or array variables as well as for
3110 variables which are uninitialized or clobbered as a whole.  They do
3111 not occur for variables or elements declared @code{volatile}.  Because
3112 these warnings depend on optimization, the exact variables or elements
3113 for which there are warnings will depend on the precise optimization
3114 options and version of GCC used.
3115
3116 Note that there may be no warning about a variable that is used only
3117 to compute a value that itself is never used, because such
3118 computations may be deleted by data flow analysis before the warnings
3119 are printed.
3120
3121 These warnings are made optional because GCC is not smart
3122 enough to see all the reasons why the code might be correct
3123 despite appearing to have an error.  Here is one example of how
3124 this can happen:
3125
3126 @smallexample
3127 @group
3128 @{
3129   int x;
3130   switch (y)
3131     @{
3132     case 1: x = 1;
3133       break;
3134     case 2: x = 4;
3135       break;
3136     case 3: x = 5;
3137     @}
3138   foo (x);
3139 @}
3140 @end group
3141 @end smallexample
3142
3143 @noindent
3144 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
3145 always initialized, but GCC doesn't know this.  Here is
3146 another common case:
3147
3148 @smallexample
3149 @{
3150   int save_y;
3151   if (change_y) save_y = y, y = new_y;
3152   @dots{}
3153   if (change_y) y = save_y;
3154 @}
3155 @end smallexample
3156
3157 @noindent
3158 This has no bug because @code{save_y} is used only if it is set.
3159
3160 @cindex @code{longjmp} warnings
3161 This option also warns when a non-volatile automatic variable might be
3162 changed by a call to @code{longjmp}.  These warnings as well are possible
3163 only in optimizing compilation.
3164
3165 The compiler sees only the calls to @code{setjmp}.  It cannot know
3166 where @code{longjmp} will be called; in fact, a signal handler could
3167 call it at any point in the code.  As a result, you may get a warning
3168 even when there is in fact no problem because @code{longjmp} cannot
3169 in fact be called at the place which would cause a problem.
3170
3171 Some spurious warnings can be avoided if you declare all the functions
3172 you use that never return as @code{noreturn}.  @xref{Function
3173 Attributes}.
3174
3175 This warning is enabled by @option{-Wall} or @option{-Wextra} in
3176 optimizing compilations (@option{-O1} and above).
3177
3178 @item -Wunknown-pragmas
3179 @opindex Wunknown-pragmas
3180 @cindex warning for unknown pragmas
3181 @cindex unknown pragmas, warning
3182 @cindex pragmas, warning of unknown
3183 Warn when a #pragma directive is encountered which is not understood by
3184 GCC@.  If this command line option is used, warnings will even be issued
3185 for unknown pragmas in system header files.  This is not the case if
3186 the warnings were only enabled by the @option{-Wall} command line option.
3187
3188 @item -Wno-pragmas
3189 @opindex Wno-pragmas
3190 @opindex Wpragmas
3191 Do not warn about misuses of pragmas, such as incorrect parameters,
3192 invalid syntax, or conflicts between pragmas.  See also
3193 @samp{-Wunknown-pragmas}.
3194
3195 @item -Wstrict-aliasing
3196 @opindex Wstrict-aliasing
3197 This option is only active when @option{-fstrict-aliasing} is active.
3198 It warns about code which might break the strict aliasing rules that the
3199 compiler is using for optimization.  The warning does not catch all
3200 cases, but does attempt to catch the more common pitfalls.  It is
3201 included in @option{-Wall}.
3202 It is equivalent to @option{-Wstrict-aliasing=3}
3203
3204 @item -Wstrict-aliasing=n
3205 @opindex Wstrict-aliasing=n
3206 This option is only active when @option{-fstrict-aliasing} is active.
3207 It warns about code which might break the strict aliasing rules that the
3208 compiler is using for optimization.
3209 Higher levels correspond to higher accuracy (fewer false positives).
3210 Higher levels also correspond to more effort, similar to the way -O works.
3211 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=n},
3212 with n=3.
3213
3214 Level 1: Most aggressive, quick, least accurate.
3215 Possibly useful when higher levels
3216 do not warn but -fstrict-aliasing still breaks the code, as it has very few 
3217 false negatives.  However, it has many false positives.
3218 Warns for all pointer conversions between possibly incompatible types, 
3219 even if never dereferenced.  Runs in the frontend only.
3220
3221 Level 2: Aggressive, quick, not too precise.
3222 May still have many false positives (not as many as level 1 though),
3223 and few false negatives (but possibly more than level 1).
3224 Unlike level 1, it only warns when an address is taken.  Warns about
3225 incomplete types.  Runs in the frontend only.
3226
3227 Level 3 (default for @option{-Wstrict-aliasing}): 
3228 Should have very few false positives and few false 
3229 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
3230 Takes care of the common punn+dereference pattern in the frontend:
3231 @code{*(int*)&some_float}.
3232 If optimization is enabled, it also runs in the backend, where it deals 
3233 with multiple statement cases using flow-sensitive points-to information.
3234 Only warns when the converted pointer is dereferenced.
3235 Does not warn about incomplete types.
3236
3237 @item -Wstrict-overflow
3238 @item -Wstrict-overflow=@var{n}
3239 @opindex Wstrict-overflow
3240 This option is only active when @option{-fstrict-overflow} is active.
3241 It warns about cases where the compiler optimizes based on the
3242 assumption that signed overflow does not occur.  Note that it does not
3243 warn about all cases where the code might overflow: it only warns
3244 about cases where the compiler implements some optimization.  Thus
3245 this warning depends on the optimization level.
3246
3247 An optimization which assumes that signed overflow does not occur is
3248 perfectly safe if the values of the variables involved are such that
3249 overflow never does, in fact, occur.  Therefore this warning can
3250 easily give a false positive: a warning about code which is not
3251 actually a problem.  To help focus on important issues, several
3252 warning levels are defined.  No warnings are issued for the use of
3253 undefined signed overflow when estimating how many iterations a loop
3254 will require, in particular when determining whether a loop will be
3255 executed at all.
3256
3257 @table @gcctabopt
3258 @item -Wstrict-overflow=1
3259 Warn about cases which are both questionable and easy to avoid.  For
3260 example: @code{x + 1 > x}; with @option{-fstrict-overflow}, the
3261 compiler will simplify this to @code{1}.  This level of
3262 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
3263 are not, and must be explicitly requested.
3264
3265 @item -Wstrict-overflow=2
3266 Also warn about other cases where a comparison is simplified to a
3267 constant.  For example: @code{abs (x) >= 0}.  This can only be
3268 simplified when @option{-fstrict-overflow} is in effect, because
3269 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
3270 zero.  @option{-Wstrict-overflow} (with no level) is the same as
3271 @option{-Wstrict-overflow=2}.
3272
3273 @item -Wstrict-overflow=3
3274 Also warn about other cases where a comparison is simplified.  For
3275 example: @code{x + 1 > 1} will be simplified to @code{x > 0}.
3276
3277 @item -Wstrict-overflow=4
3278 Also warn about other simplifications not covered by the above cases.
3279 For example: @code{(x * 10) / 5} will be simplified to @code{x * 2}.
3280
3281 @item -Wstrict-overflow=5
3282 Also warn about cases where the compiler reduces the magnitude of a
3283 constant involved in a comparison.  For example: @code{x + 2 > y} will
3284 be simplified to @code{x + 1 >= y}.  This is reported only at the
3285 highest warning level because this simplification applies to many
3286 comparisons, so this warning level will give a very large number of
3287 false positives.
3288 @end table
3289
3290 @item -Warray-bounds
3291 @opindex Wno-array-bounds
3292 @opindex Warray-bounds
3293 This option is only active when @option{-ftree-vrp} is active
3294 (default for -O2 and above). It warns about subscripts to arrays
3295 that are always out of bounds. This warning is enabled by @option{-Wall}.
3296
3297 @item -Wno-div-by-zero
3298 @opindex Wno-div-by-zero
3299 @opindex Wdiv-by-zero
3300 Do not warn about compile-time integer division by zero.  Floating point
3301 division by zero is not warned about, as it can be a legitimate way of
3302 obtaining infinities and NaNs.
3303
3304 @item -Wsystem-headers
3305 @opindex Wsystem-headers
3306 @cindex warnings from system headers
3307 @cindex system headers, warnings from
3308 Print warning messages for constructs found in system header files.
3309 Warnings from system headers are normally suppressed, on the assumption
3310 that they usually do not indicate real problems and would only make the
3311 compiler output harder to read.  Using this command line option tells
3312 GCC to emit warnings from system headers as if they occurred in user
3313 code.  However, note that using @option{-Wall} in conjunction with this
3314 option will @emph{not} warn about unknown pragmas in system
3315 headers---for that, @option{-Wunknown-pragmas} must also be used.
3316
3317 @item -Wfloat-equal
3318 @opindex Wfloat-equal
3319 Warn if floating point values are used in equality comparisons.
3320
3321 The idea behind this is that sometimes it is convenient (for the
3322 programmer) to consider floating-point values as approximations to
3323 infinitely precise real numbers.  If you are doing this, then you need
3324 to compute (by analyzing the code, or in some other way) the maximum or
3325 likely maximum error that the computation introduces, and allow for it
3326 when performing comparisons (and when producing output, but that's a
3327 different problem).  In particular, instead of testing for equality, you
3328 would check to see whether the two values have ranges that overlap; and
3329 this is done with the relational operators, so equality comparisons are
3330 probably mistaken.
3331
3332 @item -Wtraditional @r{(C only)}
3333 @opindex Wtraditional
3334 Warn about certain constructs that behave differently in traditional and
3335 ISO C@.  Also warn about ISO C constructs that have no traditional C
3336 equivalent, and/or problematic constructs which should be avoided.
3337
3338 @itemize @bullet
3339 @item
3340 Macro parameters that appear within string literals in the macro body.
3341 In traditional C macro replacement takes place within string literals,
3342 but does not in ISO C@.
3343
3344 @item
3345 In traditional C, some preprocessor directives did not exist.
3346 Traditional preprocessors would only consider a line to be a directive
3347 if the @samp{#} appeared in column 1 on the line.  Therefore
3348 @option{-Wtraditional} warns about directives that traditional C
3349 understands but would ignore because the @samp{#} does not appear as the
3350 first character on the line.  It also suggests you hide directives like
3351 @samp{#pragma} not understood by traditional C by indenting them.  Some
3352 traditional implementations would not recognize @samp{#elif}, so it
3353 suggests avoiding it altogether.
3354
3355 @item
3356 A function-like macro that appears without arguments.
3357
3358 @item
3359 The unary plus operator.
3360
3361 @item
3362 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating point
3363 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
3364 constants.)  Note, these suffixes appear in macros defined in the system
3365 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
3366 Use of these macros in user code might normally lead to spurious
3367 warnings, however GCC's integrated preprocessor has enough context to
3368 avoid warning in these cases.
3369
3370 @item
3371 A function declared external in one block and then used after the end of
3372 the block.
3373
3374 @item
3375 A @code{switch} statement has an operand of type @code{long}.
3376
3377 @item
3378 A non-@code{static} function declaration follows a @code{static} one.
3379 This construct is not accepted by some traditional C compilers.
3380
3381 @item
3382 The ISO type of an integer constant has a different width or
3383 signedness from its traditional type.  This warning is only issued if
3384 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
3385 typically represent bit patterns, are not warned about.
3386
3387 @item
3388 Usage of ISO string concatenation is detected.
3389
3390 @item
3391 Initialization of automatic aggregates.
3392
3393 @item
3394 Identifier conflicts with labels.  Traditional C lacks a separate
3395 namespace for labels.
3396
3397 @item
3398 Initialization of unions.  If the initializer is zero, the warning is
3399 omitted.  This is done under the assumption that the zero initializer in
3400 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
3401 initializer warnings and relies on default initialization to zero in the
3402 traditional C case.
3403
3404 @item
3405 Conversions by prototypes between fixed/floating point values and vice
3406 versa.  The absence of these prototypes when compiling with traditional
3407 C would cause serious problems.  This is a subset of the possible
3408 conversion warnings, for the full set use @option{-Wtraditional-conversion}.
3409
3410 @item
3411 Use of ISO C style function definitions.  This warning intentionally is
3412 @emph{not} issued for prototype declarations or variadic functions
3413 because these ISO C features will appear in your code when using
3414 libiberty's traditional C compatibility macros, @code{PARAMS} and
3415 @code{VPARAMS}.  This warning is also bypassed for nested functions
3416 because that feature is already a GCC extension and thus not relevant to
3417 traditional C compatibility.
3418 @end itemize
3419
3420 @item -Wtraditional-conversion @r{(C only)}
3421 @opindex Wtraditional-conversion
3422 Warn if a prototype causes a type conversion that is different from what
3423 would happen to the same argument in the absence of a prototype.  This
3424 includes conversions of fixed point to floating and vice versa, and
3425 conversions changing the width or signedness of a fixed point argument
3426 except when the same as the default promotion.
3427
3428 @item -Wdeclaration-after-statement @r{(C only)}
3429 @opindex Wdeclaration-after-statement
3430 Warn when a declaration is found after a statement in a block.  This
3431 construct, known from C++, was introduced with ISO C99 and is by default
3432 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
3433 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
3434
3435 @item -Wundef
3436 @opindex Wundef
3437 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
3438
3439 @item -Wno-endif-labels
3440 @opindex Wno-endif-labels
3441 @opindex Wendif-labels
3442 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
3443
3444 @item -Wshadow
3445 @opindex Wshadow
3446 Warn whenever a local variable shadows another local variable, parameter or
3447 global variable or whenever a built-in function is shadowed.
3448
3449 @item -Wlarger-than-@var{len}
3450 @opindex Wlarger-than
3451 Warn whenever an object of larger than @var{len} bytes is defined.
3452
3453 @item -Wunsafe-loop-optimizations
3454 @opindex Wunsafe-loop-optimizations
3455 Warn if the loop cannot be optimized because the compiler could not
3456 assume anything on the bounds of the loop indices.  With
3457 @option{-funsafe-loop-optimizations} warn if the compiler made
3458 such assumptions.
3459
3460 @item -Wpointer-arith
3461 @opindex Wpointer-arith
3462 Warn about anything that depends on the ``size of'' a function type or
3463 of @code{void}.  GNU C assigns these types a size of 1, for
3464 convenience in calculations with @code{void *} pointers and pointers
3465 to functions.  In C++, warn also when an arithmetic operation involves
3466 @code{NULL}.  This warning is also enabled by @option{-pedantic}.
3467
3468 @item -Wtype-limits
3469 @opindex Wtype-limits
3470 @opindex Wno-type-limits
3471 Warn if a comparison is always true or always false due to the limited
3472 range of the data type, but do not warn for constant expressions.  For
3473 example, warn if an unsigned variable is compared against zero with
3474 @samp{<} or @samp{>=}.  This warning is also enabled by
3475 @option{-Wextra}.
3476
3477 @item -Wbad-function-cast @r{(C only)}
3478 @opindex Wbad-function-cast
3479 Warn whenever a function call is cast to a non-matching type.
3480 For example, warn if @code{int malloc()} is cast to @code{anything *}.
3481
3482 @item -Wc++-compat
3483 Warn about ISO C constructs that are outside of the common subset of
3484 ISO C and ISO C++, e.g.@: request for implicit conversion from
3485 @code{void *} to a pointer to non-@code{void} type.
3486
3487 @item -Wc++0x-compat @r{(C++ and Objective-C++ only)}
3488 Warn about C++ constructs whose meaning differs between ISO C++ 1998 and
3489 ISO C++ 200x, e.g., identifiers in ISO C++ 1998 that will become keywords
3490 in ISO C++ 200x.  This warning is enabled by @option{-Wall}.
3491
3492 @item -Wcast-qual
3493 @opindex Wcast-qual
3494 Warn whenever a pointer is cast so as to remove a type qualifier from
3495 the target type.  For example, warn if a @code{const char *} is cast
3496 to an ordinary @code{char *}.
3497
3498 @item -Wcast-align
3499 @opindex Wcast-align
3500 Warn whenever a pointer is cast such that the required alignment of the
3501 target is increased.  For example, warn if a @code{char *} is cast to
3502 an @code{int *} on machines where integers can only be accessed at
3503 two- or four-byte boundaries.
3504
3505 @item -Wwrite-strings
3506 @opindex Wwrite-strings
3507 When compiling C, give string constants the type @code{const
3508 char[@var{length}]} so that
3509 copying the address of one into a non-@code{const} @code{char *}
3510 pointer will get a warning; when compiling C++, warn about the
3511 deprecated conversion from string literals to @code{char *}.  This
3512 warning, by default, is enabled for C++ programs.
3513 These warnings will help you find at
3514 compile time code that can try to write into a string constant, but
3515 only if you have been very careful about using @code{const} in
3516 declarations and prototypes.  Otherwise, it will just be a nuisance;
3517 this is why we did not make @option{-Wall} request these warnings.
3518
3519 @item -Wclobbered
3520 @opindex Wclobbered
3521 Warn for variables that might be changed by @samp{longjmp} or
3522 @samp{vfork}.  This warning is also enabled by @option{-Wextra}.
3523
3524 @item -Wconversion
3525 @opindex Wconversion
3526 @opindex Wno-conversion
3527 Warn for implicit conversions that may alter a value. This includes
3528 conversions between real and integer, like @code{abs (x)} when
3529 @code{x} is @code{double}; conversions between signed and unsigned,
3530 like @code{unsigned ui = -1}; and conversions to smaller types, like
3531 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
3532 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
3533 changed by the conversion like in @code{abs (2.0)}.  Warnings about
3534 conversions between signed and unsigned integers can be disabled by
3535 using @option{-Wno-sign-conversion}.
3536
3537 For C++, also warn for conversions between @code{NULL} and non-pointer
3538 types; confusing overload resolution for user-defined conversions; and
3539 conversions that will never use a type conversion operator:
3540 conversions to @code{void}, the same type, a base class or a reference
3541 to them. Warnings about conversions between signed and unsigned
3542 integers are disabled by default in C++ unless
3543 @option{-Wsign-conversion} is explicitly enabled.
3544
3545 @item -Wempty-body
3546 @opindex Wempty-body
3547 Warn if an empty body occurs in an @samp{if}, @samp{else} or @samp{do
3548 while} statement.  Additionally, in C++, warn when an empty body occurs
3549 in a @samp{while} or @samp{for} statement with no whitespacing before
3550 the semicolon.  This warning is also enabled by @option{-Wextra}.
3551
3552 @item -Wsign-compare
3553 @opindex Wsign-compare
3554 @cindex warning for comparison of signed and unsigned values
3555 @cindex comparison of signed and unsigned values, warning
3556 @cindex signed and unsigned values, comparison warning
3557 Warn when a comparison between signed and unsigned values could produce
3558 an incorrect result when the signed value is converted to unsigned.
3559 This warning is also enabled by @option{-Wextra}; to get the other warnings
3560 of @option{-Wextra} without this warning, use @samp{-Wextra -Wno-sign-compare}.
3561
3562 @item -Wsign-conversion
3563 @opindex Wsign-conversion
3564 @opindex Wno-sign-conversion
3565 Warn for implicit conversions that may change the sign of an integer
3566 value, like assigning a signed integer expression to an unsigned
3567 integer variable. An explicit cast silences the warning. In C, this
3568 option is enabled also by @option{-Wconversion}.
3569
3570 @item -Waddress
3571 @opindex Waddress
3572 @opindex Wno-address
3573 Warn about suspicious uses of memory addresses. These include using
3574 the address of a function in a conditional expression, such as
3575 @code{void func(void); if (func)}, and comparisons against the memory
3576 address of a string literal, such as @code{if (x == "abc")}.  Such
3577 uses typically indicate a programmer error: the address of a function
3578 always evaluates to true, so their use in a conditional usually
3579 indicate that the programmer forgot the parentheses in a function
3580 call; and comparisons against string literals result in unspecified
3581 behavior and are not portable in C, so they usually indicate that the
3582 programmer intended to use @code{strcmp}.  This warning is enabled by
3583 @option{-Wall}.
3584
3585 @item -Wlogical-op
3586 @opindex Wlogical-op
3587 @opindex Wno-logical-op
3588 Warn about suspicious uses of logical operators in expressions.
3589 This includes using logical operators in contexts where a
3590 bit-wise operator is likely to be expected.
3591
3592 @item -Waggregate-return
3593 @opindex Waggregate-return
3594 Warn if any functions that return structures or unions are defined or
3595 called.  (In languages where you can return an array, this also elicits
3596 a warning.)
3597
3598 @item -Wno-attributes
3599 @opindex Wno-attributes
3600 @opindex Wattributes
3601 Do not warn if an unexpected @code{__attribute__} is used, such as
3602 unrecognized attributes, function attributes applied to variables,
3603 etc.  This will not stop errors for incorrect use of supported
3604 attributes.
3605
3606 @item -Wstrict-prototypes @r{(C only)}
3607 @opindex Wstrict-prototypes
3608 Warn if a function is declared or defined without specifying the
3609 argument types.  (An old-style function definition is permitted without
3610 a warning if preceded by a declaration which specifies the argument
3611 types.)
3612
3613 @item -Wold-style-declaration @r{(C only)}
3614 @opindex Wold-style-declaration
3615 Warn for obsolescent usages, according to the C Standard, in a
3616 declaration. For example, warn if storage-class specifiers like
3617 @code{static} are not the first things in a declaration.  This warning
3618 is also enabled by @option{-Wextra}.
3619
3620 @item -Wold-style-definition @r{(C only)}
3621 @opindex Wold-style-definition
3622 Warn if an old-style function definition is used.  A warning is given
3623 even if there is a previous prototype.
3624
3625 @item -Wmissing-parameter-type @r{(C only)}
3626 @opindex Wmissing-parameter-type
3627 A function parameter is declared without a type specifier in K&R-style
3628 functions:
3629
3630 @smallexample
3631 void foo(bar) @{ @}
3632 @end smallexample
3633
3634 This warning is also enabled by @option{-Wextra}.
3635
3636 @item -Wmissing-prototypes @r{(C only)}
3637 @opindex Wmissing-prototypes
3638 Warn if a global function is defined without a previous prototype
3639 declaration.  This warning is issued even if the definition itself
3640 provides a prototype.  The aim is to detect global functions that fail
3641 to be declared in header files.
3642
3643 @item -Wmissing-declarations @r{(C and C++ only)}
3644 @opindex Wmissing-declarations
3645 Warn if a global function is defined without a previous declaration.
3646 Do so even if the definition itself provides a prototype.
3647 Use this option to detect global functions that are not declared in
3648 header files.  In C++, no warnings are issued for function templates,
3649 or for inline functions, or for functions in anonymous namespaces.
3650
3651 @item -Wmissing-field-initializers
3652 @opindex Wmissing-field-initializers
3653 @opindex W
3654 @opindex Wextra
3655 Warn if a structure's initializer has some fields missing.  For
3656 example, the following code would cause such a warning, because
3657 @code{x.h} is implicitly zero:
3658
3659 @smallexample
3660 struct s @{ int f, g, h; @};
3661 struct s x = @{ 3, 4 @};
3662 @end smallexample
3663
3664 This option does not warn about designated initializers, so the following
3665 modification would not trigger a warning:
3666
3667 @smallexample
3668 struct s @{ int f, g, h; @};
3669 struct s x = @{ .f = 3, .g = 4 @};
3670 @end smallexample
3671
3672 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
3673 warnings without this one, use @samp{-Wextra -Wno-missing-field-initializers}.
3674
3675 @item -Wmissing-noreturn
3676 @opindex Wmissing-noreturn
3677 Warn about functions which might be candidates for attribute @code{noreturn}.
3678 Note these are only possible candidates, not absolute ones.  Care should
3679 be taken to manually verify functions actually do not ever return before
3680 adding the @code{noreturn} attribute, otherwise subtle code generation
3681 bugs could be introduced.  You will not get a warning for @code{main} in
3682 hosted C environments.
3683
3684 @item -Wmissing-format-attribute
3685 @opindex Wmissing-format-attribute
3686 @opindex Wformat
3687 Warn about function pointers which might be candidates for @code{format}
3688 attributes.  Note these are only possible candidates, not absolute ones.
3689 GCC will guess that function pointers with @code{format} attributes that
3690 are used in assignment, initialization, parameter passing or return
3691 statements should have a corresponding @code{format} attribute in the
3692 resulting type.  I.e.@: the left-hand side of the assignment or
3693 initialization, the type of the parameter variable, or the return type
3694 of the containing function respectively should also have a @code{format}
3695 attribute to avoid the warning.
3696
3697 GCC will also warn about function definitions which might be
3698 candidates for @code{format} attributes.  Again, these are only
3699 possible candidates.  GCC will guess that @code{format} attributes
3700 might be appropriate for any function that calls a function like
3701 @code{vprintf} or @code{vscanf}, but this might not always be the
3702 case, and some functions for which @code{format} attributes are
3703 appropriate may not be detected.
3704
3705 @item -Wno-multichar
3706 @opindex Wno-multichar
3707 @opindex Wmultichar
3708 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
3709 Usually they indicate a typo in the user's code, as they have
3710 implementation-defined values, and should not be used in portable code.
3711
3712 @item -Wnormalized=<none|id|nfc|nfkc>
3713 @opindex Wnormalized
3714 @cindex NFC
3715 @cindex NFKC
3716 @cindex character set, input normalization
3717 In ISO C and ISO C++, two identifiers are different if they are
3718 different sequences of characters.  However, sometimes when characters
3719 outside the basic ASCII character set are used, you can have two
3720 different character sequences that look the same.  To avoid confusion,
3721 the ISO 10646 standard sets out some @dfn{normalization rules} which
3722 when applied ensure that two sequences that look the same are turned into
3723 the same sequence.  GCC can warn you if you are using identifiers which
3724 have not been normalized; this option controls that warning.
3725
3726 There are four levels of warning that GCC supports.  The default is
3727 @option{-Wnormalized=nfc}, which warns about any identifier which is
3728 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
3729 recommended form for most uses.
3730
3731 Unfortunately, there are some characters which ISO C and ISO C++ allow
3732 in identifiers that when turned into NFC aren't allowable as
3733 identifiers.  That is, there's no way to use these symbols in portable
3734 ISO C or C++ and have all your identifiers in NFC.
3735 @option{-Wnormalized=id} suppresses the warning for these characters.
3736 It is hoped that future versions of the standards involved will correct
3737 this, which is why this option is not the default.
3738
3739 You can switch the warning off for all characters by writing
3740 @option{-Wnormalized=none}.  You would only want to do this if you
3741 were using some other normalization scheme (like ``D''), because
3742 otherwise you can easily create bugs that are literally impossible to see.
3743
3744 Some characters in ISO 10646 have distinct meanings but look identical
3745 in some fonts or display methodologies, especially once formatting has
3746 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
3747 LETTER N'', will display just like a regular @code{n} which has been
3748 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
3749 normalization scheme to convert all these into a standard form as
3750 well, and GCC will warn if your code is not in NFKC if you use
3751 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
3752 about every identifier that contains the letter O because it might be
3753 confused with the digit 0, and so is not the default, but may be
3754 useful as a local coding convention if the programming environment is
3755 unable to be fixed to display these characters distinctly.
3756
3757 @item -Wno-deprecated-declarations
3758 @opindex Wno-deprecated-declarations
3759 Do not warn about uses of functions (@pxref{Function Attributes}),
3760 variables (@pxref{Variable Attributes}), and types (@pxref{Type
3761 Attributes}) marked as deprecated by using the @code{deprecated}
3762 attribute.
3763
3764 @item -Wno-overflow
3765 @opindex Wno-overflow
3766 Do not warn about compile-time overflow in constant expressions.
3767
3768 @item -Woverride-init
3769 @opindex Woverride-init
3770 @opindex W
3771 @opindex Wextra
3772 Warn if an initialized field without side effects is overridden when
3773 using designated initializers (@pxref{Designated Inits, , Designated
3774 Initializers}).
3775
3776 This warning is included in @option{-Wextra}.  To get other
3777 @option{-Wextra} warnings without this one, use @samp{-Wextra
3778 -Wno-override-init}.
3779
3780 @item -Wpacked
3781 @opindex Wpacked
3782 Warn if a structure is given the packed attribute, but the packed
3783 attribute has no effect on the layout or size of the structure.
3784 Such structures may be mis-aligned for little benefit.  For
3785 instance, in this code, the variable @code{f.x} in @code{struct bar}
3786 will be misaligned even though @code{struct bar} does not itself
3787 have the packed attribute:
3788
3789 @smallexample
3790 @group
3791 struct foo @{
3792   int x;
3793   char a, b, c, d;
3794 @} __attribute__((packed));
3795 struct bar @{
3796   char z;
3797   struct foo f;
3798 @};
3799 @end group
3800 @end smallexample
3801
3802 @item -Wpadded
3803 @opindex Wpadded
3804 Warn if padding is included in a structure, either to align an element
3805 of the structure or to align the whole structure.  Sometimes when this
3806 happens it is possible to rearrange the fields of the structure to
3807 reduce the padding and so make the structure smaller.
3808
3809 @item -Wredundant-decls
3810 @opindex Wredundant-decls
3811 Warn if anything is declared more than once in the same scope, even in
3812 cases where multiple declaration is valid and changes nothing.
3813
3814 @item -Wnested-externs @r{(C only)}
3815 @opindex Wnested-externs
3816 Warn if an @code{extern} declaration is encountered within a function.
3817
3818 @item -Wunreachable-code
3819 @opindex Wunreachable-code
3820 Warn if the compiler detects that code will never be executed.
3821
3822 This option is intended to warn when the compiler detects that at
3823 least a whole line of source code will never be executed, because
3824 some condition is never satisfied or because it is after a
3825 procedure that never returns.
3826
3827 It is possible for this option to produce a warning even though there
3828 are circumstances under which part of the affected line can be executed,
3829 so care should be taken when removing apparently-unreachable code.
3830
3831 For instance, when a function is inlined, a warning may mean that the
3832 line is unreachable in only one inlined copy of the function.
3833
3834 This option is not made part of @option{-Wall} because in a debugging
3835 version of a program there is often substantial code which checks
3836 correct functioning of the program and is, hopefully, unreachable
3837 because the program does work.  Another common use of unreachable
3838 code is to provide behavior which is selectable at compile-time.
3839
3840 @item -Winline
3841 @opindex Winline
3842 Warn if a function can not be inlined and it was declared as inline.
3843 Even with this option, the compiler will not warn about failures to
3844 inline functions declared in system headers.
3845
3846 The compiler uses a variety of heuristics to determine whether or not
3847 to inline a function.  For example, the compiler takes into account
3848 the size of the function being inlined and the amount of inlining
3849 that has already been done in the current function.  Therefore,
3850 seemingly insignificant changes in the source program can cause the
3851 warnings produced by @option{-Winline} to appear or disappear.
3852
3853 @item -Wno-invalid-offsetof @r{(C++ only)}
3854 @opindex Wno-invalid-offsetof
3855 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
3856 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
3857 to a non-POD type is undefined.  In existing C++ implementations,
3858 however, @samp{offsetof} typically gives meaningful results even when
3859 applied to certain kinds of non-POD types. (Such as a simple
3860 @samp{struct} that fails to be a POD type only by virtue of having a
3861 constructor.)  This flag is for users who are aware that they are
3862 writing nonportable code and who have deliberately chosen to ignore the
3863 warning about it.
3864
3865 The restrictions on @samp{offsetof} may be relaxed in a future version
3866 of the C++ standard.
3867
3868 @item -Wno-int-to-pointer-cast @r{(C only)}
3869 @opindex Wno-int-to-pointer-cast
3870 Suppress warnings from casts to pointer type of an integer of a
3871 different size.
3872
3873 @item -Wno-pointer-to-int-cast @r{(C only)}
3874 @opindex Wno-pointer-to-int-cast
3875 Suppress warnings from casts from a pointer to an integer type of a
3876 different size.
3877
3878 @item -Winvalid-pch
3879 @opindex Winvalid-pch
3880 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
3881 the search path but can't be used.
3882
3883 @item -Wlong-long
3884 @opindex Wlong-long
3885 @opindex Wno-long-long
3886 Warn if @samp{long long} type is used.  This is default.  To inhibit
3887 the warning messages, use @option{-Wno-long-long}.  Flags
3888 @option{-Wlong-long} and @option{-Wno-long-long} are taken into account
3889 only when @option{-pedantic} flag is used.
3890
3891 @item -Wvariadic-macros
3892 @opindex Wvariadic-macros
3893 @opindex Wno-variadic-macros
3894 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
3895 alternate syntax when in pedantic ISO C99 mode.  This is default.
3896 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
3897
3898 @item -Wvla
3899 @opindex Wvla
3900 @opindex Wno-vla
3901 Warn if variable length array is used in the code.
3902 @option{-Wno-vla} will prevent the @option{-pedantic} warning of
3903 the variable length array.
3904
3905 @item -Wvolatile-register-var
3906 @opindex Wvolatile-register-var
3907 @opindex Wno-volatile-register-var
3908 Warn if a register variable is declared volatile.  The volatile
3909 modifier does not inhibit all optimizations that may eliminate reads
3910 and/or writes to register variables.
3911
3912 @item -Wdisabled-optimization
3913 @opindex Wdisabled-optimization
3914 Warn if a requested optimization pass is disabled.  This warning does
3915 not generally indicate that there is anything wrong with your code; it
3916 merely indicates that GCC's optimizers were unable to handle the code
3917 effectively.  Often, the problem is that your code is too big or too
3918 complex; GCC will refuse to optimize programs when the optimization
3919 itself is likely to take inordinate amounts of time.
3920
3921 @item -Wpointer-sign
3922 @opindex Wpointer-sign
3923 @opindex Wno-pointer-sign
3924 Warn for pointer argument passing or assignment with different signedness.
3925 This option is only supported for C and Objective-C@.  It is implied by
3926 @option{-Wall} and by @option{-pedantic}, which can be disabled with
3927 @option{-Wno-pointer-sign}.
3928
3929 @item -Wstack-protector
3930 @opindex Wstack-protector
3931 This option is only active when @option{-fstack-protector} is active.  It
3932 warns about functions that will not be protected against stack smashing.
3933
3934 @item -Woverlength-strings
3935 @opindex Woverlength-strings
3936 Warn about string constants which are longer than the ``minimum
3937 maximum'' length specified in the C standard.  Modern compilers
3938 generally allow string constants which are much longer than the
3939 standard's minimum limit, but very portable programs should avoid
3940 using longer strings.
3941
3942 The limit applies @emph{after} string constant concatenation, and does
3943 not count the trailing NUL@.  In C89, the limit was 509 characters; in
3944 C99, it was raised to 4095.  C++98 does not specify a normative
3945 minimum maximum, so we do not diagnose overlength strings in C++@.
3946
3947 This option is implied by @option{-pedantic}, and can be disabled with
3948 @option{-Wno-overlength-strings}.
3949 @end table
3950
3951 @node Debugging Options
3952 @section Options for Debugging Your Program or GCC
3953 @cindex options, debugging
3954 @cindex debugging information options
3955
3956 GCC has various special options that are used for debugging
3957 either your program or GCC:
3958
3959 @table @gcctabopt
3960 @item -g
3961 @opindex g
3962 Produce debugging information in the operating system's native format
3963 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
3964 information.
3965
3966 On most systems that use stabs format, @option{-g} enables use of extra
3967 debugging information that only GDB can use; this extra information
3968 makes debugging work better in GDB but will probably make other debuggers
3969 crash or
3970 refuse to read the program.  If you want to control for certain whether
3971 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
3972 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
3973
3974 GCC allows you to use @option{-g} with
3975 @option{-O}.  The shortcuts taken by optimized code may occasionally
3976 produce surprising results: some variables you declared may not exist
3977 at all; flow of control may briefly move where you did not expect it;
3978 some statements may not be executed because they compute constant
3979 results or their values were already at hand; some statements may
3980 execute in different places because they were moved out of loops.
3981
3982 Nevertheless it proves possible to debug optimized output.  This makes
3983 it reasonable to use the optimizer for programs that might have bugs.
3984
3985 The following options are useful when GCC is generated with the
3986 capability for more than one debugging format.
3987
3988 @item -ggdb
3989 @opindex ggdb
3990 Produce debugging information for use by GDB@.  This means to use the
3991 most expressive format available (DWARF 2, stabs, or the native format
3992 if neither of those are supported), including GDB extensions if at all
3993 possible.
3994
3995 @item -gstabs
3996 @opindex gstabs
3997 Produce debugging information in stabs format (if that is supported),
3998 without GDB extensions.  This is the format used by DBX on most BSD
3999 systems.  On MIPS, Alpha and System V Release 4 systems this option
4000 produces stabs debugging output which is not understood by DBX or SDB@.
4001 On System V Release 4 systems this option requires the GNU assembler.
4002
4003 @item -feliminate-unused-debug-symbols
4004 @opindex feliminate-unused-debug-symbols
4005 Produce debugging information in stabs format (if that is supported),
4006 for only symbols that are actually used.
4007
4008 @item -femit-class-debug-always
4009 Instead of emitting debugging information for a C++ class in only one
4010 object file, emit it in all object files using the class.  This option
4011 should be used only with debuggers that are unable to handle the way GCC
4012 normally emits debugging information for classes because using this
4013 option will increase the size of debugging information by as much as a
4014 factor of two.
4015
4016 @item -gstabs+
4017 @opindex gstabs+
4018 Produce debugging information in stabs format (if that is supported),
4019 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4020 use of these extensions is likely to make other debuggers crash or
4021 refuse to read the program.
4022
4023 @item -gcoff
4024 @opindex gcoff
4025 Produce debugging information in COFF format (if that is supported).
4026 This is the format used by SDB on most System V systems prior to
4027 System V Release 4.
4028
4029 @item -gxcoff
4030 @opindex gxcoff
4031 Produce debugging information in XCOFF format (if that is supported).
4032 This is the format used by the DBX debugger on IBM RS/6000 systems.
4033
4034 @item -gxcoff+
4035 @opindex gxcoff+
4036 Produce debugging information in XCOFF format (if that is supported),
4037 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4038 use of these extensions is likely to make other debuggers crash or
4039 refuse to read the program, and may cause assemblers other than the GNU
4040 assembler (GAS) to fail with an error.
4041
4042 @item -gdwarf-2
4043 @opindex gdwarf-2
4044 Produce debugging information in DWARF version 2 format (if that is
4045 supported).  This is the format used by DBX on IRIX 6.  With this
4046 option, GCC uses features of DWARF version 3 when they are useful;
4047 version 3 is upward compatible with version 2, but may still cause
4048 problems for older debuggers.
4049
4050 @item -gvms
4051 @opindex gvms
4052 Produce debugging information in VMS debug format (if that is
4053 supported).  This is the format used by DEBUG on VMS systems.
4054
4055 @item -g@var{level}
4056 @itemx -ggdb@var{level}
4057 @itemx -gstabs@var{level}
4058 @itemx -gcoff@var{level}
4059 @itemx -gxcoff@var{level}
4060 @itemx -gvms@var{level}
4061 Request debugging information and also use @var{level} to specify how
4062 much information.  The default level is 2.
4063
4064 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
4065 @option{-g}.
4066
4067 Level 1 produces minimal information, enough for making backtraces in
4068 parts of the program that you don't plan to debug.  This includes
4069 descriptions of functions and external variables, but no information
4070 about local variables and no line numbers.
4071
4072 Level 3 includes extra information, such as all the macro definitions
4073 present in the program.  Some debuggers support macro expansion when
4074 you use @option{-g3}.
4075
4076 @option{-gdwarf-2} does not accept a concatenated debug level, because
4077 GCC used to support an option @option{-gdwarf} that meant to generate
4078 debug information in version 1 of the DWARF format (which is very
4079 different from version 2), and it would have been too confusing.  That
4080 debug format is long obsolete, but the option cannot be changed now.
4081 Instead use an additional @option{-g@var{level}} option to change the
4082 debug level for DWARF2.
4083
4084 @item -feliminate-dwarf2-dups
4085 @opindex feliminate-dwarf2-dups
4086 Compress DWARF2 debugging information by eliminating duplicated
4087 information about each symbol.  This option only makes sense when
4088 generating DWARF2 debugging information with @option{-gdwarf-2}.
4089
4090 @item -femit-struct-debug-baseonly
4091 Emit debug information for struct-like types
4092 only when the base name of the compilation source file
4093 matches the base name of file in which the struct was defined.
4094
4095 This option substantially reduces the size of debugging information,
4096 but at significant potential loss in type information to the debugger.
4097 See @option{-femit-struct-debug-reduced} for a less aggressive option.
4098 See @option{-femit-struct-debug-detailed} for more detailed control.
4099
4100 This option works only with DWARF 2.
4101
4102 @item -femit-struct-debug-reduced
4103 Emit debug information for struct-like types
4104 only when the base name of the compilation source file
4105 matches the base name of file in which the type was defined,
4106 unless the struct is a template or defined in a system header.
4107
4108 This option significantly reduces the size of debugging information,
4109 with some potential loss in type information to the debugger.
4110 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
4111 See @option{-femit-struct-debug-detailed} for more detailed control.
4112
4113 This option works only with DWARF 2.
4114
4115 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
4116 Specify the struct-like types
4117 for which the compiler will generate debug information.
4118 The intent is to reduce duplicate struct debug information
4119 between different object files within the same program.
4120
4121 This option is a detailed version of
4122 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
4123 which will serve for most needs.
4124
4125 A specification has the syntax
4126 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
4127
4128 The optional first word limits the specification to
4129 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
4130 A struct type is used directly when it is the type of a variable, member.
4131 Indirect uses arise through pointers to structs.
4132 That is, when use of an incomplete struct would be legal, the use is indirect.
4133 An example is
4134 @samp{struct one direct; struct two * indirect;}.
4135
4136 The optional second word limits the specification to
4137 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
4138 Generic structs are a bit complicated to explain.
4139 For C++, these are non-explicit specializations of template classes,
4140 or non-template classes within the above.
4141 Other programming languages have generics,
4142 but @samp{-femit-struct-debug-detailed} does not yet implement them.
4143
4144 The third word specifies the source files for those
4145 structs for which the compiler will emit debug information.
4146 The values @samp{none} and @samp{any} have the normal meaning.
4147 The value @samp{base} means that
4148 the base of name of the file in which the type declaration appears
4149 must match the base of the name of the main compilation file.
4150 In practice, this means that
4151 types declared in @file{foo.c} and @file{foo.h} will have debug information,
4152 but types declared in other header will not.
4153 The value @samp{sys} means those types satisfying @samp{base}
4154 or declared in system or compiler headers.
4155
4156 You may need to experiment to determine the best settings for your application.
4157
4158 The default is @samp{-femit-struct-debug-detailed=all}.
4159
4160 This option works only with DWARF 2.
4161
4162 @item -fdebug-prefix-map=@var{old}=@var{new}
4163 @opindex fdebug-prefix-map
4164 When compiling files in directory @file{@var{old}}, record debugging
4165 information describing them as in @file{@var{new}} instead.
4166
4167 @cindex @command{prof}
4168 @item -p
4169 @opindex p
4170 Generate extra code to write profile information suitable for the
4171 analysis program @command{prof}.  You must use this option when compiling
4172 the source files you want data about, and you must also use it when
4173 linking.
4174
4175 @cindex @command{gprof}
4176 @item -pg
4177 @opindex pg
4178 Generate extra code to write profile information suitable for the
4179 analysis program @command{gprof}.  You must use this option when compiling
4180 the source files you want data about, and you must also use it when
4181 linking.
4182
4183 @item -Q
4184 @opindex Q
4185 Makes the compiler print out each function name as it is compiled, and
4186 print some statistics about each pass when it finishes.
4187
4188 @item -ftime-report
4189 @opindex ftime-report
4190 Makes the compiler print some statistics about the time consumed by each
4191 pass when it finishes.
4192
4193 @item -fmem-report
4194 @opindex fmem-report
4195 Makes the compiler print some statistics about permanent memory
4196 allocation when it finishes.
4197
4198 @item -fpre-ipa-mem-report
4199 @opindex fpre-ipa-mem-report
4200 @item -fpost-ipa-mem-report
4201 @opindex fpost-ipa-mem-report
4202 Makes the compiler print some statistics about permanent memory
4203 allocation before or after interprocedural optimization.
4204
4205 @item -fprofile-arcs
4206 @opindex fprofile-arcs
4207 Add code so that program flow @dfn{arcs} are instrumented.  During
4208 execution the program records how many times each branch and call is
4209 executed and how many times it is taken or returns.  When the compiled
4210 program exits it saves this data to a file called
4211 @file{@var{auxname}.gcda} for each source file.  The data may be used for
4212 profile-directed optimizations (@option{-fbranch-probabilities}), or for
4213 test coverage analysis (@option{-ftest-coverage}).  Each object file's
4214 @var{auxname} is generated from the name of the output file, if
4215 explicitly specified and it is not the final executable, otherwise it is
4216 the basename of the source file.  In both cases any suffix is removed
4217 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
4218 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
4219 @xref{Cross-profiling}.
4220
4221 @cindex @command{gcov}
4222 @item --coverage
4223 @opindex coverage
4224
4225 This option is used to compile and link code instrumented for coverage
4226 analysis.  The option is a synonym for @option{-fprofile-arcs}
4227 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
4228 linking).  See the documentation for those options for more details.
4229
4230 @itemize
4231
4232 @item
4233 Compile the source files with @option{-fprofile-arcs} plus optimization
4234 and code generation options.  For test coverage analysis, use the
4235 additional @option{-ftest-coverage} option.  You do not need to profile
4236 every source file in a program.
4237
4238 @item
4239 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
4240 (the latter implies the former).
4241
4242 @item
4243 Run the program on a representative workload to generate the arc profile
4244 information.  This may be repeated any number of times.  You can run
4245 concurrent instances of your program, and provided that the file system
4246 supports locking, the data files will be correctly updated.  Also
4247 @code{fork} calls are detected and correctly handled (double counting
4248 will not happen).
4249
4250 @item
4251 For profile-directed optimizations, compile the source files again with
4252 the same optimization and code generation options plus
4253 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
4254 Control Optimization}).
4255
4256 @item
4257 For test coverage analysis, use @command{gcov} to produce human readable
4258 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
4259 @command{gcov} documentation for further information.
4260
4261 @end itemize
4262
4263 With @option{-fprofile-arcs}, for each function of your program GCC
4264 creates a program flow graph, then finds a spanning tree for the graph.
4265 Only arcs that are not on the spanning tree have to be instrumented: the
4266 compiler adds code to count the number of times that these arcs are
4267 executed.  When an arc is the only exit or only entrance to a block, the
4268 instrumentation code can be added to the block; otherwise, a new basic
4269 block must be created to hold the instrumentation code.
4270
4271 @need 2000
4272 @item -ftest-coverage
4273 @opindex ftest-coverage
4274 Produce a notes file that the @command{gcov} code-coverage utility
4275 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
4276 show program coverage.  Each source file's note file is called
4277 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
4278 above for a description of @var{auxname} and instructions on how to
4279 generate test coverage data.  Coverage data will match the source files
4280 more closely, if you do not optimize.
4281
4282 @item -fdbg-cnt-list
4283 @opindex fdbg-cnt-list
4284 Print the name and the counter upperbound for all debug counters.
4285
4286 @item -fdbg-cnt=@var{counter-value-list}
4287 @opindex fdbg-cnt
4288 Set the internal debug counter upperbound. @var{counter-value-list} 
4289 is a comma-separated list of @var{name}:@var{value} pairs
4290 which sets the upperbound of each debug counter @var{name} to @var{value}.
4291 All debug counters have the initial upperbound of @var{UINT_MAX},
4292 thus dbg_cnt() returns true always unless the upperbound is set by this option.
4293 e.g. With -fdbg-cnt=dce:10,tail_call:0
4294 dbg_cnt(dce) will return true only for first 10 invocations
4295 and dbg_cnt(tail_call) will return false always.
4296
4297 @item -d@var{letters}
4298 @item -fdump-rtl-@var{pass}
4299 @opindex d
4300 Says to make debugging dumps during compilation at times specified by
4301 @var{letters}.    This is used for debugging the RTL-based passes of the
4302 compiler.  The file names for most of the dumps are made by appending a
4303 pass number and a word to the @var{dumpname}.  @var{dumpname} is generated
4304 from the name of the output file, if explicitly specified and it is not
4305 an executable, otherwise it is the basename of the source file. These
4306 switches may have different effects when @option{-E} is used for
4307 preprocessing.
4308
4309 Most debug dumps can be enabled either passing a letter to the @option{-d}
4310 option, or with a long @option{-fdump-rtl} switch; here are the possible
4311 letters for use in @var{letters} and @var{pass}, and their meanings:
4312
4313 @table @gcctabopt
4314 @item -dA
4315 @opindex dA
4316 Annotate the assembler output with miscellaneous debugging information.
4317
4318 @item -dB
4319 @itemx -fdump-rtl-bbro
4320 @opindex dB
4321 @opindex fdump-rtl-bbro
4322 Dump after block reordering, to @file{@var{file}.148r.bbro}.
4323
4324 @item -dc
4325 @itemx -fdump-rtl-combine
4326 @opindex dc
4327 @opindex fdump-rtl-combine
4328 Dump after the RTL instruction combination pass, to the file
4329 @file{@var{file}.129r.combine}.
4330
4331 @item -dC
4332 @itemx -fdump-rtl-ce1
4333 @itemx -fdump-rtl-ce2
4334 @opindex dC
4335 @opindex fdump-rtl-ce1
4336 @opindex fdump-rtl-ce2
4337 @option{-dC} and @option{-fdump-rtl-ce1} enable dumping after the
4338 first if conversion, to the file @file{@var{file}.117r.ce1}.  @option{-dC}
4339 and @option{-fdump-rtl-ce2} enable dumping after the second if
4340 conversion, to the file @file{@var{file}.130r.ce2}.
4341
4342 @item -dd
4343 @itemx -fdump-rtl-btl
4344 @itemx -fdump-rtl-dbr
4345 @opindex dd
4346 @opindex fdump-rtl-btl
4347 @opindex fdump-rtl-dbr
4348 @option{-dd} and @option{-fdump-rtl-btl} enable dumping after branch
4349 target load optimization, to @file{@var{file}.31.btl}.  @option{-dd}
4350 and @option{-fdump-rtl-dbr} enable dumping after delayed branch
4351 scheduling, to @file{@var{file}.36.dbr}.
4352
4353 @item -dD
4354 @opindex dD
4355 Dump all macro definitions, at the end of preprocessing, in addition to
4356 normal output.
4357
4358 @item -dE
4359 @itemx -fdump-rtl-ce3
4360 @opindex dE
4361 @opindex fdump-rtl-ce3
4362 Dump after the third if conversion, to @file{@var{file}.146r.ce3}.
4363
4364 @item -df
4365 @itemx -fdump-rtl-cfg
4366 @itemx -fdump-rtl-life
4367 @opindex df
4368 @opindex fdump-rtl-cfg
4369 @opindex fdump-rtl-life
4370 @option{-df} and @option{-fdump-rtl-cfg} enable dumping after control
4371 and data flow analysis, to @file{@var{file}.116r.cfg}.  @option{-df}
4372 and @option{-fdump-rtl-cfg} enable dumping dump after life analysis,
4373 to @file{@var{file}.128r.life1} and @file{@var{file}.135r.life2}.
4374
4375 @item -dg
4376 @itemx -fdump-rtl-greg
4377 @opindex dg
4378 @opindex fdump-rtl-greg
4379 Dump after global register allocation, to @file{@var{file}.139r.greg}.
4380
4381 @item -dG
4382 @itemx -fdump-rtl-gcse
4383 @itemx -fdump-rtl-bypass
4384 @opindex dG
4385 @opindex fdump-rtl-gcse
4386 @opindex fdump-rtl-bypass
4387 @option{-dG} and @option{-fdump-rtl-gcse} enable dumping after GCSE, to
4388 @file{@var{file}.114r.gcse}.  @option{-dG} and @option{-fdump-rtl-bypass}
4389 enable dumping after jump bypassing and control flow optimizations, to
4390 @file{@var{file}.115r.bypass}.
4391
4392 @item -dh
4393 @itemx -fdump-rtl-eh
4394 @opindex dh
4395 @opindex fdump-rtl-eh
4396 Dump after finalization of EH handling code, to @file{@var{file}.02.eh}.
4397
4398 @item -di
4399 @itemx -fdump-rtl-sibling
4400 @opindex di
4401 @opindex fdump-rtl-sibling
4402 Dump after sibling call optimizations, to @file{@var{file}.106r.sibling}.
4403
4404 @item -dj
4405 @itemx -fdump-rtl-jump
4406 @opindex dj
4407 @opindex fdump-rtl-jump
4408 Dump after the first jump optimization, to @file{@var{file}.112r.jump}.
4409
4410 @item -dk
4411 @itemx -fdump-rtl-stack
4412 @opindex dk
4413 @opindex fdump-rtl-stack
4414 Dump after conversion from GCC's "flat register file" registers to the
4415 x87's stack-like registers, to @file{@var{file}.152r.stack}.
4416
4417 @item -dl
4418 @itemx -fdump-rtl-lreg
4419 @opindex dl
4420 @opindex fdump-rtl-lreg
4421 Dump after local register allocation, to @file{@var{file}.138r.lreg}.
4422
4423 @item -dL
4424 @itemx -fdump-rtl-loop2
4425 @opindex dL
4426 @opindex fdump-rtl-loop2
4427 @option{-dL} and @option{-fdump-rtl-loop2} enable dumping after the
4428 loop optimization pass, to @file{@var{file}.119r.loop2},
4429 @file{@var{file}.120r.loop2_init},
4430 @file{@var{file}.121r.loop2_invariant}, and
4431 @file{@var{file}.125r.loop2_done}.
4432
4433 @item -dm
4434 @itemx -fdump-rtl-sms
4435 @opindex dm
4436 @opindex fdump-rtl-sms
4437 Dump after modulo scheduling, to @file{@var{file}.136r.sms}.
4438
4439 @item -dM
4440 @itemx -fdump-rtl-mach
4441 @opindex dM
4442 @opindex fdump-rtl-mach
4443 Dump after performing the machine dependent reorganization pass, to
4444 @file{@var{file}.155r.mach} if that pass exists.
4445
4446 @item -dn
4447 @itemx -fdump-rtl-rnreg
4448 @opindex dn
4449 @opindex fdump-rtl-rnreg
4450 Dump after register renumbering, to @file{@var{file}.147r.rnreg}.
4451
4452 @item -dN
4453 @itemx -fdump-rtl-regmove
4454 @opindex dN
4455 @opindex fdump-rtl-regmove
4456 Dump after the register move pass, to @file{@var{file}.132r.regmove}.
4457
4458 @item -do
4459 @itemx -fdump-rtl-postreload
4460 @opindex do
4461 @opindex fdump-rtl-postreload
4462 Dump after post-reload optimizations, to @file{@var{file}.24.postreload}.
4463
4464 @item -dr
4465 @itemx -fdump-rtl-expand
4466 @opindex dr
4467 @opindex fdump-rtl-expand
4468 Dump after RTL generation, to @file{@var{file}.104r.expand}.
4469
4470 @item -dR
4471 @itemx -fdump-rtl-sched2
4472 @opindex dR
4473 @opindex fdump-rtl-sched2
4474 Dump after the second scheduling pass, to @file{@var{file}.149r.sched2}.
4475
4476 @item -ds
4477 @itemx -fdump-rtl-cse
4478 @opindex ds
4479 @opindex fdump-rtl-cse
4480 Dump after CSE (including the jump optimization that sometimes follows
4481 CSE), to @file{@var{file}.113r.cse}.
4482
4483 @item -dS
4484 @itemx -fdump-rtl-sched1
4485 @opindex dS
4486 @opindex fdump-rtl-sched1
4487 Dump after the first scheduling pass, to @file{@var{file}.136r.sched1}.
4488
4489 @item -dt
4490 @itemx -fdump-rtl-cse2
4491 @opindex dt
4492 @opindex fdump-rtl-cse2
4493 Dump after the second CSE pass (including the jump optimization that
4494 sometimes follows CSE), to @file{@var{file}.127r.cse2}.
4495
4496 @item -dT
4497 @itemx -fdump-rtl-tracer
4498 @opindex dT
4499 @opindex fdump-rtl-tracer
4500 Dump after running tracer, to @file{@var{file}.118r.tracer}.
4501
4502 @item -dV
4503 @itemx -fdump-rtl-vpt
4504 @itemx -fdump-rtl-vartrack
4505 @opindex dV
4506 @opindex fdump-rtl-vpt
4507 @opindex fdump-rtl-vartrack
4508 @option{-dV} and @option{-fdump-rtl-vpt} enable dumping after the value
4509 profile transformations, to @file{@var{file}.10.vpt}.  @option{-dV}
4510 and @option{-fdump-rtl-vartrack} enable dumping after variable tracking,
4511 to @file{@var{file}.154r.vartrack}.
4512
4513 @item -dw
4514 @itemx -fdump-rtl-flow2
4515 @opindex dw
4516 @opindex fdump-rtl-flow2
4517 Dump after the second flow pass, to @file{@var{file}.142r.flow2}.
4518
4519 @item -dz
4520 @itemx -fdump-rtl-peephole2
4521 @opindex dz
4522 @opindex fdump-rtl-peephole2
4523 Dump after the peephole pass, to @file{@var{file}.145r.peephole2}.
4524
4525 @item -dZ
4526 @itemx -fdump-rtl-web
4527 @opindex dZ
4528 @opindex fdump-rtl-web
4529 Dump after live range splitting, to @file{@var{file}.126r.web}.
4530
4531 @item -da
4532 @itemx -fdump-rtl-all
4533 @opindex da
4534 @opindex fdump-rtl-all
4535 Produce all the dumps listed above.
4536
4537 @item -dH
4538 @opindex dH
4539 Produce a core dump whenever an error occurs.
4540
4541 @item -dm
4542 @opindex dm
4543 Print statistics on memory usage, at the end of the run, to
4544 standard error.
4545
4546 @item -dp
4547 @opindex dp
4548 Annotate the assembler output with a comment indicating which
4549 pattern and alternative was used.  The length of each instruction is
4550 also printed.
4551
4552 @item -dP
4553 @opindex dP
4554 Dump the RTL in the assembler output as a comment before each instruction.
4555 Also turns on @option{-dp} annotation.
4556
4557 @item -dv
4558 @opindex dv
4559 For each of the other indicated dump files (either with @option{-d} or
4560 @option{-fdump-rtl-@var{pass}}), dump a representation of the control flow
4561 graph suitable for viewing with VCG to @file{@var{file}.@var{pass}.vcg}.
4562
4563 @item -dx
4564 @opindex dx
4565 Just generate RTL for a function instead of compiling it.  Usually used
4566 with @samp{r} (@option{-fdump-rtl-expand}).
4567
4568 @item -dy
4569 @opindex dy
4570 Dump debugging information during parsing, to standard error.
4571 @end table
4572
4573 @item -fdump-noaddr
4574 @opindex fdump-noaddr
4575 When doing debugging dumps (see @option{-d} option above), suppress
4576 address output.  This makes it more feasible to use diff on debugging
4577 dumps for compiler invocations with different compiler binaries and/or
4578 different text / bss / data / heap / stack / dso start locations.
4579
4580 @item -fdump-unnumbered
4581 @opindex fdump-unnumbered
4582 When doing debugging dumps (see @option{-d} option above), suppress instruction
4583 numbers and address output.  This makes it more feasible to
4584 use diff on debugging dumps for compiler invocations with different
4585 options, in particular with and without @option{-g}.
4586
4587 @item -fdump-translation-unit @r{(C++ only)}
4588 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
4589 @opindex fdump-translation-unit
4590 Dump a representation of the tree structure for the entire translation
4591 unit to a file.  The file name is made by appending @file{.tu} to the
4592 source file name.  If the @samp{-@var{options}} form is used, @var{options}
4593 controls the details of the dump as described for the
4594 @option{-fdump-tree} options.
4595
4596 @item -fdump-class-hierarchy @r{(C++ only)}
4597 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
4598 @opindex fdump-class-hierarchy
4599 Dump a representation of each class's hierarchy and virtual function
4600 table layout to a file.  The file name is made by appending @file{.class}
4601 to the source file name.  If the @samp{-@var{options}} form is used,
4602 @var{options} controls the details of the dump as described for the
4603 @option{-fdump-tree} options.
4604
4605 @item -fdump-ipa-@var{switch}
4606 @opindex fdump-ipa
4607 Control the dumping at various stages of inter-procedural analysis
4608 language tree to a file.  The file name is generated by appending a switch
4609 specific suffix to the source file name.  The following dumps are possible:
4610
4611 @table @samp
4612 @item all
4613 Enables all inter-procedural analysis dumps; currently the only produced
4614 dump is the @samp{cgraph} dump.
4615
4616 @item cgraph
4617 Dumps information about call-graph optimization, unused function removal,
4618 and inlining decisions.
4619 @end table
4620
4621 @item -fdump-tree-@var{switch}
4622 @itemx -fdump-tree-@var{switch}-@var{options}
4623 @opindex fdump-tree
4624 Control the dumping at various stages of processing the intermediate
4625 language tree to a file.  The file name is generated by appending a switch
4626 specific suffix to the source file name.  If the @samp{-@var{options}}
4627 form is used, @var{options} is a list of @samp{-} separated options that
4628 control the details of the dump.  Not all options are applicable to all
4629 dumps, those which are not meaningful will be ignored.  The following
4630 options are available
4631
4632 @table @samp
4633 @item address
4634 Print the address of each node.  Usually this is not meaningful as it
4635 changes according to the environment and source file.  Its primary use
4636 is for tying up a dump file with a debug environment.
4637 @item slim
4638 Inhibit dumping of members of a scope or body of a function merely
4639 because that scope has been reached.  Only dump such items when they
4640 are directly reachable by some other path.  When dumping pretty-printed
4641 trees, this option inhibits dumping the bodies of control structures.
4642 @item raw
4643 Print a raw representation of the tree.  By default, trees are
4644 pretty-printed into a C-like representation.
4645 @item details
4646 Enable more detailed dumps (not honored by every dump option).
4647 @item stats
4648 Enable dumping various statistics about the pass (not honored by every dump
4649 option).
4650 @item blocks
4651 Enable showing basic block boundaries (disabled in raw dumps).
4652 @item vops
4653 Enable showing virtual operands for every statement.
4654 @item lineno
4655 Enable showing line numbers for statements.
4656 @item uid
4657 Enable showing the unique ID (@code{DECL_UID}) for each variable.
4658 @item all
4659 Turn on all options, except @option{raw}, @option{slim} and @option{lineno}.
4660 @end table
4661
4662 The following tree dumps are possible:
4663 @table @samp
4664
4665 @item original
4666 Dump before any tree based optimization, to @file{@var{file}.original}.
4667
4668 @item optimized
4669 Dump after all tree based optimization, to @file{@var{file}.optimized}.
4670
4671 @item inlined
4672 Dump after function inlining, to @file{@var{file}.inlined}.
4673
4674 @item gimple
4675 @opindex fdump-tree-gimple
4676 Dump each function before and after the gimplification pass to a file.  The
4677 file name is made by appending @file{.gimple} to the source file name.
4678
4679 @item cfg
4680 @opindex fdump-tree-cfg
4681 Dump the control flow graph of each function to a file.  The file name is
4682 made by appending @file{.cfg} to the source file name.
4683
4684 @item vcg
4685 @opindex fdump-tree-vcg
4686 Dump the control flow graph of each function to a file in VCG format.  The
4687 file name is made by appending @file{.vcg} to the source file name.  Note
4688 that if the file contains more than one function, the generated file cannot
4689 be used directly by VCG@.  You will need to cut and paste each function's
4690 graph into its own separate file first.
4691
4692 @item ch
4693 @opindex fdump-tree-ch
4694 Dump each function after copying loop headers.  The file name is made by
4695 appending @file{.ch} to the source file name.
4696
4697 @item ssa
4698 @opindex fdump-tree-ssa
4699 Dump SSA related information to a file.  The file name is made by appending
4700 @file{.ssa} to the source file name.
4701
4702 @item salias
4703 @opindex fdump-tree-salias
4704 Dump structure aliasing variable information to a file.  This file name
4705 is made by appending @file{.salias} to the source file name.
4706
4707 @item alias
4708 @opindex fdump-tree-alias
4709 Dump aliasing information for each function.  The file name is made by
4710 appending @file{.alias} to the source file name.
4711
4712 @item ccp
4713 @opindex fdump-tree-ccp
4714 Dump each function after CCP@.  The file name is made by appending
4715 @file{.ccp} to the source file name.
4716
4717 @item storeccp
4718 @opindex fdump-tree-storeccp
4719 Dump each function after STORE-CCP.  The file name is made by appending
4720 @file{.storeccp} to the source file name.
4721
4722 @item pre
4723 @opindex fdump-tree-pre
4724 Dump trees after partial redundancy elimination.  The file name is made
4725 by appending @file{.pre} to the source file name.
4726
4727 @item fre
4728 @opindex fdump-tree-fre
4729 Dump trees after full redundancy elimination.  The file name is made
4730 by appending @file{.fre} to the source file name.
4731
4732 @item copyprop
4733 @opindex fdump-tree-copyprop
4734 Dump trees after copy propagation.  The file name is made
4735 by appending @file{.copyprop} to the source file name.
4736
4737 @item store_copyprop
4738 @opindex fdump-tree-store_copyprop
4739 Dump trees after store copy-propagation.  The file name is made
4740 by appending @file{.store_copyprop} to the source file name.
4741
4742 @item dce
4743 @opindex fdump-tree-dce
4744 Dump each function after dead code elimination.  The file name is made by
4745 appending @file{.dce} to the source file name.
4746
4747 @item mudflap
4748 @opindex fdump-tree-mudflap
4749 Dump each function after adding mudflap instrumentation.  The file name is
4750 made by appending @file{.mudflap} to the source file name.
4751
4752 @item sra
4753 @opindex fdump-tree-sra
4754 Dump each function after performing scalar replacement of aggregates.  The
4755 file name is made by appending @file{.sra} to the source file name.
4756
4757 @item sink
4758 @opindex fdump-tree-sink
4759 Dump each function after performing code sinking.  The file name is made
4760 by appending @file{.sink} to the source file name.
4761
4762 @item dom
4763 @opindex fdump-tree-dom
4764 Dump each function after applying dominator tree optimizations.  The file
4765 name is made by appending @file{.dom} to the source file name.
4766
4767 @item dse
4768 @opindex fdump-tree-dse
4769 Dump each function after applying dead store elimination.  The file
4770 name is made by appending @file{.dse} to the source file name.
4771
4772 @item phiopt
4773 @opindex fdump-tree-phiopt
4774 Dump each function after optimizing PHI nodes into straightline code.  The file
4775 name is made by appending @file{.phiopt} to the source file name.
4776
4777 @item forwprop
4778 @opindex fdump-tree-forwprop
4779 Dump each function after forward propagating single use variables.  The file
4780 name is made by appending @file{.forwprop} to the source file name.
4781
4782 @item copyrename
4783 @opindex fdump-tree-copyrename
4784 Dump each function after applying the copy rename optimization.  The file
4785 name is made by appending @file{.copyrename} to the source file name.
4786
4787 @item nrv
4788 @opindex fdump-tree-nrv
4789 Dump each function after applying the named return value optimization on
4790 generic trees.  The file name is made by appending @file{.nrv} to the source
4791 file name.
4792
4793 @item vect
4794 @opindex fdump-tree-vect
4795 Dump each function after applying vectorization of loops.  The file name is
4796 made by appending @file{.vect} to the source file name.
4797
4798 @item vrp
4799 @opindex fdump-tree-vrp
4800 Dump each function after Value Range Propagation (VRP).  The file name
4801 is made by appending @file{.vrp} to the source file name.
4802
4803 @item all
4804 @opindex fdump-tree-all
4805 Enable all the available tree dumps with the flags provided in this option.
4806 @end table
4807
4808 @item -ftree-vectorizer-verbose=@var{n}
4809 @opindex ftree-vectorizer-verbose
4810 This option controls the amount of debugging output the vectorizer prints.
4811 This information is written to standard error, unless
4812 @option{-fdump-tree-all} or @option{-fdump-tree-vect} is specified,
4813 in which case it is output to the usual dump listing file, @file{.vect}.
4814 For @var{n}=0 no diagnostic information is reported.
4815 If @var{n}=1 the vectorizer reports each loop that got vectorized,
4816 and the total number of loops that got vectorized.
4817 If @var{n}=2 the vectorizer also reports non-vectorized loops that passed
4818 the first analysis phase (vect_analyze_loop_form) - i.e. countable,
4819 inner-most, single-bb, single-entry/exit loops.  This is the same verbosity
4820 level that @option{-fdump-tree-vect-stats} uses.
4821 Higher verbosity levels mean either more information dumped for each
4822 reported loop, or same amount of information reported for more loops:
4823 If @var{n}=3, alignment related information is added to the reports.
4824 If @var{n}=4, data-references related information (e.g. memory dependences,
4825 memory access-patterns) is added to the reports.
4826 If @var{n}=5, the vectorizer reports also non-vectorized inner-most loops
4827 that did not pass the first analysis phase (i.e. may not be countable, or
4828 may have complicated control-flow).
4829 If @var{n}=6, the vectorizer reports also non-vectorized nested loops.
4830 For @var{n}=7, all the information the vectorizer generates during its
4831 analysis and transformation is reported.  This is the same verbosity level
4832 that @option{-fdump-tree-vect-details} uses.
4833
4834 @item -frandom-seed=@var{string}
4835 @opindex frandom-string
4836 This option provides a seed that GCC uses when it would otherwise use
4837 random numbers.  It is used to generate certain symbol names
4838 that have to be different in every compiled file.  It is also used to
4839 place unique stamps in coverage data files and the object files that
4840 produce them.  You can use the @option{-frandom-seed} option to produce
4841 reproducibly identical object files.
4842
4843 The @var{string} should be different for every file you compile.
4844
4845 @item -fsched-verbose=@var{n}
4846 @opindex fsched-verbose
4847 On targets that use instruction scheduling, this option controls the
4848 amount of debugging output the scheduler prints.  This information is
4849 written to standard error, unless @option{-dS} or @option{-dR} is
4850 specified, in which case it is output to the usual dump
4851 listing file, @file{.sched} or @file{.sched2} respectively.  However
4852 for @var{n} greater than nine, the output is always printed to standard
4853 error.
4854
4855 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
4856 same information as @option{-dRS}.  For @var{n} greater than one, it
4857 also output basic block probabilities, detailed ready list information
4858 and unit/insn info.  For @var{n} greater than two, it includes RTL
4859 at abort point, control-flow and regions info.  And for @var{n} over
4860 four, @option{-fsched-verbose} also includes dependence info.
4861
4862 @item -save-temps
4863 @opindex save-temps
4864 Store the usual ``temporary'' intermediate files permanently; place them
4865 in the current directory and name them based on the source file.  Thus,
4866 compiling @file{foo.c} with @samp{-c -save-temps} would produce files
4867 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
4868 preprocessed @file{foo.i} output file even though the compiler now
4869 normally uses an integrated preprocessor.
4870
4871 When used in combination with the @option{-x} command line option,
4872 @option{-save-temps} is sensible enough to avoid over writing an
4873 input source file with the same extension as an intermediate file.
4874 The corresponding intermediate file may be obtained by renaming the
4875 source file before using @option{-save-temps}.
4876
4877 @item -time
4878 @opindex time
4879 Report the CPU time taken by each subprocess in the compilation
4880 sequence.  For C source files, this is the compiler proper and assembler
4881 (plus the linker if linking is done).  The output looks like this:
4882
4883 @smallexample
4884 # cc1 0.12 0.01
4885 # as 0.00 0.01
4886 @end smallexample
4887
4888 The first number on each line is the ``user time'', that is time spent
4889 executing the program itself.  The second number is ``system time'',
4890 time spent executing operating system routines on behalf of the program.
4891 Both numbers are in seconds.
4892
4893 @item -fvar-tracking
4894 @opindex fvar-tracking
4895 Run variable tracking pass.  It computes where variables are stored at each
4896 position in code.  Better debugging information is then generated
4897 (if the debugging information format supports this information).
4898
4899 It is enabled by default when compiling with optimization (@option{-Os},
4900 @option{-O}, @option{-O2}, ...), debugging information (@option{-g}) and
4901 the debug info format supports it.
4902
4903 @item -print-file-name=@var{library}
4904 @opindex print-file-name
4905 Print the full absolute name of the library file @var{library} that
4906 would be used when linking---and don't do anything else.  With this
4907 option, GCC does not compile or link anything; it just prints the
4908 file name.
4909
4910 @item -print-multi-directory
4911 @opindex print-multi-directory
4912 Print the directory name corresponding to the multilib selected by any
4913 other switches present in the command line.  This directory is supposed
4914 to exist in @env{GCC_EXEC_PREFIX}.
4915
4916 @item -print-multi-lib
4917 @opindex print-multi-lib
4918 Print the mapping from multilib directory names to compiler switches
4919 that enable them.  The directory name is separated from the switches by
4920 @samp{;}, and each switch starts with an @samp{@@} instead of the
4921 @samp{-}, without spaces between multiple switches.  This is supposed to
4922 ease shell-processing.
4923
4924 @item -print-prog-name=@var{program}
4925 @opindex print-prog-name
4926 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
4927
4928 @item -print-libgcc-file-name
4929 @opindex print-libgcc-file-name
4930 Same as @option{-print-file-name=libgcc.a}.
4931
4932 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
4933 but you do want to link with @file{libgcc.a}.  You can do
4934
4935 @smallexample
4936 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
4937 @end smallexample
4938
4939 @item -print-search-dirs
4940 @opindex print-search-dirs
4941 Print the name of the configured installation directory and a list of
4942 program and library directories @command{gcc} will search---and don't do anything else.
4943
4944 This is useful when @command{gcc} prints the error message
4945 @samp{installation problem, cannot exec cpp0: No such file or directory}.
4946 To resolve this you either need to put @file{cpp0} and the other compiler
4947 components where @command{gcc} expects to find them, or you can set the environment
4948 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
4949 Don't forget the trailing @samp{/}.
4950 @xref{Environment Variables}.
4951
4952 @item -print-sysroot-headers-suffix
4953 @opindex print-sysroot-headers-suffix
4954 Print the suffix added to the target sysroot when searching for
4955 headers, or give an error if the compiler is not configured with such
4956 a suffix---and don't do anything else.
4957
4958 @item -dumpmachine
4959 @opindex dumpmachine
4960 Print the compiler's target machine (for example,
4961 @samp{i686-pc-linux-gnu})---and don't do anything else.
4962
4963 @item -dumpversion
4964 @opindex dumpversion
4965 Print the compiler version (for example, @samp{3.0})---and don't do
4966 anything else.
4967
4968 @item -dumpspecs
4969 @opindex dumpspecs
4970 Print the compiler's built-in specs---and don't do anything else.  (This
4971 is used when GCC itself is being built.)  @xref{Spec Files}.
4972
4973 @item -feliminate-unused-debug-types
4974 @opindex feliminate-unused-debug-types
4975 Normally, when producing DWARF2 output, GCC will emit debugging
4976 information for all types declared in a compilation
4977 unit, regardless of whether or not they are actually used
4978 in that compilation unit.  Sometimes this is useful, such as
4979 if, in the debugger, you want to cast a value to a type that is
4980 not actually used in your program (but is declared).  More often,
4981 however, this results in a significant amount of wasted space.
4982 With this option, GCC will avoid producing debug symbol output
4983 for types that are nowhere used in the source file being compiled.
4984 @end table
4985
4986 @node Optimize Options
4987 @section Options That Control Optimization
4988 @cindex optimize options
4989 @cindex options, optimization
4990
4991 These options control various sorts of optimizations.
4992
4993 Without any optimization option, the compiler's goal is to reduce the
4994 cost of compilation and to make debugging produce the expected
4995 results.  Statements are independent: if you stop the program with a
4996 breakpoint between statements, you can then assign a new value to any
4997 variable or change the program counter to any other statement in the
4998 function and get exactly the results you would expect from the source
4999 code.
5000
5001 Turning on optimization flags makes the compiler attempt to improve
5002 the performance and/or code size at the expense of compilation time
5003 and possibly the ability to debug the program.
5004
5005 The compiler performs optimization based on the knowledge it has of
5006 the program.  Optimization levels @option{-O} and above, in
5007 particular, enable @emph{unit-at-a-time} mode, which allows the
5008 compiler to consider information gained from later functions in
5009 the file when compiling a function.  Compiling multiple files at
5010 once to a single output file in @emph{unit-at-a-time} mode allows
5011 the compiler to use information gained from all of the files when
5012 compiling each of them.
5013
5014 Not all optimizations are controlled directly by a flag.  Only
5015 optimizations that have a flag are listed.
5016
5017 @table @gcctabopt
5018 @item -O
5019 @itemx -O1
5020 @opindex O
5021 @opindex O1
5022 Optimize.  Optimizing compilation takes somewhat more time, and a lot
5023 more memory for a large function.
5024
5025 With @option{-O}, the compiler tries to reduce code size and execution
5026 time, without performing any optimizations that take a great deal of
5027 compilation time.
5028
5029 @option{-O} turns on the following optimization flags:
5030 @gccoptlist{-fdefer-pop @gol
5031 -fdelayed-branch @gol
5032 -fguess-branch-probability @gol
5033 -fcprop-registers @gol
5034 -fif-conversion @gol
5035 -fif-conversion2 @gol
5036 -fsplit-wide-types @gol
5037 -ftree-ccp @gol
5038 -ftree-dce @gol
5039 -ftree-dominator-opts @gol
5040 -ftree-dse @gol
5041 -ftree-ter @gol
5042 -ftree-sra @gol
5043 -ftree-copyrename @gol
5044 -ftree-fre @gol
5045 -ftree-ch @gol
5046 -funit-at-a-time @gol
5047 -finline-small-functions @gol
5048 -fmerge-constants}
5049
5050 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
5051 where doing so does not interfere with debugging.
5052
5053 @item -O2
5054 @opindex O2
5055 Optimize even more.  GCC performs nearly all supported optimizations
5056 that do not involve a space-speed tradeoff.  The compiler does not
5057 perform loop unrolling or function inlining when you specify @option{-O2}.
5058 As compared to @option{-O}, this option increases both compilation time
5059 and the performance of the generated code.
5060
5061 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
5062 also turns on the following optimization flags:
5063 @gccoptlist{-fthread-jumps @gol
5064 -fcrossjumping @gol
5065 -foptimize-sibling-calls @gol
5066 -fcse-follow-jumps  -fcse-skip-blocks @gol
5067 -fgcse  -fgcse-lm  @gol
5068 -fexpensive-optimizations @gol
5069 -frerun-cse-after-loop  @gol
5070 -fcaller-saves @gol
5071 -fpeephole2 @gol
5072 -fschedule-insns  -fschedule-insns2 @gol
5073 -fsched-interblock  -fsched-spec @gol
5074 -fregmove @gol
5075 -fstrict-aliasing -fstrict-overflow @gol
5076 -fdelete-null-pointer-checks @gol
5077 -freorder-blocks  -freorder-functions @gol
5078 -falign-functions  -falign-jumps @gol
5079 -falign-loops  -falign-labels @gol
5080 -ftree-vrp @gol
5081 -ftree-pre}
5082
5083 Please note the warning under @option{-fgcse} about
5084 invoking @option{-O2} on programs that use computed gotos.
5085
5086 @item -O3
5087 @opindex O3
5088 Optimize yet more.  @option{-O3} turns on all optimizations specified by
5089 @option{-O2} and also turns on the @option{-finline-functions},
5090 @option{-funswitch-loops}, @option{-fpredictive-commoning} and
5091 @option{-fgcse-after-reload} options.
5092
5093 @item -O0
5094 @opindex O0
5095 Reduce compilation time and make debugging produce the expected
5096 results.  This is the default.
5097
5098 @item -Os
5099 @opindex Os
5100 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
5101 do not typically increase code size.  It also performs further
5102 optimizations designed to reduce code size.
5103
5104 @option{-Os} disables the following optimization flags:
5105 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
5106 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
5107 -fprefetch-loop-arrays  -ftree-vect-loop-version}
5108
5109 If you use multiple @option{-O} options, with or without level numbers,
5110 the last such option is the one that is effective.
5111 @end table
5112
5113 Options of the form @option{-f@var{flag}} specify machine-independent
5114 flags.  Most flags have both positive and negative forms; the negative
5115 form of @option{-ffoo} would be @option{-fno-foo}.  In the table
5116 below, only one of the forms is listed---the one you typically will
5117 use.  You can figure out the other form by either removing @samp{no-}
5118 or adding it.
5119
5120 The following options control specific optimizations.  They are either
5121 activated by @option{-O} options or are related to ones that are.  You
5122 can use the following flags in the rare cases when ``fine-tuning'' of
5123 optimizations to be performed is desired.
5124
5125 @table @gcctabopt
5126 @item -fno-default-inline
5127 @opindex fno-default-inline
5128 Do not make member functions inline by default merely because they are
5129 defined inside the class scope (C++ only).  Otherwise, when you specify
5130 @w{@option{-O}}, member functions defined inside class scope are compiled
5131 inline by default; i.e., you don't need to add @samp{inline} in front of
5132 the member function name.
5133
5134 @item -fno-defer-pop
5135 @opindex fno-defer-pop
5136 Always pop the arguments to each function call as soon as that function
5137 returns.  For machines which must pop arguments after a function call,
5138 the compiler normally lets arguments accumulate on the stack for several
5139 function calls and pops them all at once.
5140
5141 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5142
5143 @item -fforce-addr
5144 @opindex fforce-addr
5145 Force memory address constants to be copied into registers before
5146 doing arithmetic on them.
5147
5148 @item -fforward-propagate
5149 @opindex fforward-propagate
5150 Perform a forward propagation pass on RTL.  The pass tries to combine two
5151 instructions and checks if the result can be simplified.  If loop unrolling
5152 is active, two passes are performed and the second is scheduled after
5153 loop unrolling.
5154
5155 This option is enabled by default at optimization levels @option{-O2},
5156 @option{-O3}, @option{-Os}.
5157
5158 @item -fomit-frame-pointer
5159 @opindex fomit-frame-pointer
5160 Don't keep the frame pointer in a register for functions that
5161 don't need one.  This avoids the instructions to save, set up and
5162 restore frame pointers; it also makes an extra register available
5163 in many functions.  @strong{It also makes debugging impossible on
5164 some machines.}
5165
5166 On some machines, such as the VAX, this flag has no effect, because
5167 the standard calling sequence automatically handles the frame pointer
5168 and nothing is saved by pretending it doesn't exist.  The
5169 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
5170 whether a target machine supports this flag.  @xref{Registers,,Register
5171 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
5172
5173 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5174
5175 @item -foptimize-sibling-calls
5176 @opindex foptimize-sibling-calls
5177 Optimize sibling and tail recursive calls.
5178
5179 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5180
5181 @item -fno-inline
5182 @opindex fno-inline
5183 Don't pay attention to the @code{inline} keyword.  Normally this option
5184 is used to keep the compiler from expanding any functions inline.
5185 Note that if you are not optimizing, no functions can be expanded inline.
5186
5187 @item -finline-small-functions
5188 @opindex finline-small-functions
5189 Integrate functions into their callers when their body is smaller than expected
5190 function call code (so overall size of program gets smaller).  The compiler
5191 heuristically decides which functions are simple enough to be worth integrating
5192 in this way.
5193
5194 Enabled at level @option{-O2}.
5195
5196 @item -finline-functions
5197 @opindex finline-functions
5198 Integrate all simple functions into their callers.  The compiler
5199 heuristically decides which functions are simple enough to be worth
5200 integrating in this way.
5201
5202 If all calls to a given function are integrated, and the function is
5203 declared @code{static}, then the function is normally not output as
5204 assembler code in its own right.
5205
5206 Enabled at level @option{-O3}.
5207
5208 @item -finline-functions-called-once
5209 @opindex finline-functions-called-once
5210 Consider all @code{static} functions called once for inlining into their
5211 caller even if they are not marked @code{inline}.  If a call to a given
5212 function is integrated, then the function is not output as assembler code
5213 in its own right.
5214
5215 Enabled if @option{-funit-at-a-time} is enabled.
5216
5217 @item -fearly-inlining
5218 @opindex fearly-inlining
5219 Inline functions marked by @code{always_inline} and functions whose body seems
5220 smaller than the function call overhead early before doing
5221 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
5222 makes profiling significantly cheaper and usually inlining faster on programs
5223 having large chains of nested wrapper functions.
5224
5225 Enabled by default.
5226
5227 @item -finline-limit=@var{n}
5228 @opindex finline-limit
5229 By default, GCC limits the size of functions that can be inlined.  This flag
5230 allows the control of this limit for functions that are explicitly marked as
5231 inline (i.e., marked with the inline keyword or defined within the class
5232 definition in c++).  @var{n} is the size of functions that can be inlined in
5233 number of pseudo instructions (not counting parameter handling).  The default
5234 value of @var{n} is 600.
5235 Increasing this value can result in more inlined code at
5236 the cost of compilation time and memory consumption.  Decreasing usually makes
5237 the compilation faster and less code will be inlined (which presumably
5238 means slower programs).  This option is particularly useful for programs that
5239 use inlining heavily such as those based on recursive templates with C++.
5240
5241 Inlining is actually controlled by a number of parameters, which may be
5242 specified individually by using @option{--param @var{name}=@var{value}}.
5243 The @option{-finline-limit=@var{n}} option sets some of these parameters
5244 as follows:
5245
5246 @table @gcctabopt
5247 @item max-inline-insns-single
5248  is set to @var{n}/2.
5249 @item max-inline-insns-auto
5250  is set to @var{n}/2.
5251 @item min-inline-insns
5252  is set to 130 or @var{n}/4, whichever is smaller.
5253 @item max-inline-insns-rtl
5254  is set to @var{n}.
5255 @end table
5256
5257 See below for a documentation of the individual
5258 parameters controlling inlining.
5259
5260 @emph{Note:} pseudo instruction represents, in this particular context, an
5261 abstract measurement of function's size.  In no way does it represent a count
5262 of assembly instructions and as such its exact meaning might change from one
5263 release to an another.
5264
5265 @item -fkeep-inline-functions
5266 @opindex fkeep-inline-functions
5267 In C, emit @code{static} functions that are declared @code{inline}
5268 into the object file, even if the function has been inlined into all
5269 of its callers.  This switch does not affect functions using the
5270 @code{extern inline} extension in GNU C89@.  In C++, emit any and all
5271 inline functions into the object file.
5272
5273 @item -fkeep-static-consts
5274 @opindex fkeep-static-consts
5275 Emit variables declared @code{static const} when optimization isn't turned
5276 on, even if the variables aren't referenced.
5277
5278 GCC enables this option by default.  If you want to force the compiler to
5279 check if the variable was referenced, regardless of whether or not
5280 optimization is turned on, use the @option{-fno-keep-static-consts} option.
5281
5282 @item -fmerge-constants
5283 @opindex fmerge-constants
5284 Attempt to merge identical constants (string constants and floating point
5285 constants) across compilation units.
5286
5287 This option is the default for optimized compilation if the assembler and
5288 linker support it.  Use @option{-fno-merge-constants} to inhibit this
5289 behavior.
5290
5291 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5292
5293 @item -fmerge-all-constants
5294 @opindex fmerge-all-constants
5295 Attempt to merge identical constants and identical variables.
5296
5297 This option implies @option{-fmerge-constants}.  In addition to
5298 @option{-fmerge-constants} this considers e.g.@: even constant initialized
5299 arrays or initialized constant variables with integral or floating point
5300 types.  Languages like C or C++ require each non-automatic variable to
5301 have distinct location, so using this option will result in non-conforming
5302 behavior.
5303
5304 @item -fmodulo-sched
5305 @opindex fmodulo-sched
5306 Perform swing modulo scheduling immediately before the first scheduling
5307 pass.  This pass looks at innermost loops and reorders their
5308 instructions by overlapping different iterations.
5309
5310 @item -fmodulo-sched-allow-regmoves
5311 @opindex fmodulo-sched-allow-regmoves
5312 Perform more aggressive SMS based modulo scheduling with register moves
5313 allowed.  By setting this flag certain anti-dependences edges will be
5314 deleted which will trigger the generation of reg-moves based on the
5315 life-range analysis.  This option is effective only with
5316 @option{-fmodulo-sched} enabled.
5317
5318 @item -fno-branch-count-reg
5319 @opindex fno-branch-count-reg
5320 Do not use ``decrement and branch'' instructions on a count register,
5321 but instead generate a sequence of instructions that decrement a
5322 register, compare it against zero, then branch based upon the result.
5323 This option is only meaningful on architectures that support such
5324 instructions, which include x86, PowerPC, IA-64 and S/390.
5325
5326 The default is @option{-fbranch-count-reg}.
5327
5328 @item -fno-function-cse
5329 @opindex fno-function-cse
5330 Do not put function addresses in registers; make each instruction that
5331 calls a constant function contain the function's address explicitly.
5332
5333 This option results in less efficient code, but some strange hacks
5334 that alter the assembler output may be confused by the optimizations
5335 performed when this option is not used.
5336
5337 The default is @option{-ffunction-cse}
5338
5339 @item -fno-zero-initialized-in-bss
5340 @opindex fno-zero-initialized-in-bss
5341 If the target supports a BSS section, GCC by default puts variables that
5342 are initialized to zero into BSS@.  This can save space in the resulting
5343 code.
5344
5345 This option turns off this behavior because some programs explicitly
5346 rely on variables going to the data section.  E.g., so that the
5347 resulting executable can find the beginning of that section and/or make
5348 assumptions based on that.
5349
5350 The default is @option{-fzero-initialized-in-bss}.
5351
5352 @item -fmudflap -fmudflapth -fmudflapir
5353 @opindex fmudflap
5354 @opindex fmudflapth
5355 @opindex fmudflapir
5356 @cindex bounds checking
5357 @cindex mudflap
5358 For front-ends that support it (C and C++), instrument all risky
5359 pointer/array dereferencing operations, some standard library
5360 string/heap functions, and some other associated constructs with
5361 range/validity tests.  Modules so instrumented should be immune to
5362 buffer overflows, invalid heap use, and some other classes of C/C++
5363 programming errors.  The instrumentation relies on a separate runtime
5364 library (@file{libmudflap}), which will be linked into a program if
5365 @option{-fmudflap} is given at link time.  Run-time behavior of the
5366 instrumented program is controlled by the @env{MUDFLAP_OPTIONS}
5367 environment variable.  See @code{env MUDFLAP_OPTIONS=-help a.out}
5368 for its options.
5369
5370 Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to
5371 link if your program is multi-threaded.  Use @option{-fmudflapir}, in
5372 addition to @option{-fmudflap} or @option{-fmudflapth}, if
5373 instrumentation should ignore pointer reads.  This produces less
5374 instrumentation (and therefore faster execution) and still provides
5375 some protection against outright memory corrupting writes, but allows
5376 erroneously read data to propagate within a program.
5377
5378 @item -fthread-jumps
5379 @opindex fthread-jumps
5380 Perform optimizations where we check to see if a jump branches to a
5381 location where another comparison subsumed by the first is found.  If
5382 so, the first branch is redirected to either the destination of the
5383 second branch or a point immediately following it, depending on whether
5384 the condition is known to be true or false.
5385
5386 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5387
5388 @item -fsplit-wide-types
5389 @opindex fsplit-wide-types
5390 When using a type that occupies multiple registers, such as @code{long
5391 long} on a 32-bit system, split the registers apart and allocate them
5392 independently.  This normally generates better code for those types,
5393 but may make debugging more difficult.
5394
5395 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
5396 @option{-Os}.
5397
5398 @item -fcse-follow-jumps
5399 @opindex fcse-follow-jumps
5400 In common subexpression elimination, scan through jump instructions
5401 when the target of the jump is not reached by any other path.  For
5402 example, when CSE encounters an @code{if} statement with an
5403 @code{else} clause, CSE will follow the jump when the condition
5404 tested is false.
5405
5406 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5407
5408 @item -fcse-skip-blocks
5409 @opindex fcse-skip-blocks
5410 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
5411 follow jumps which conditionally skip over blocks.  When CSE
5412 encounters a simple @code{if} statement with no else clause,
5413 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
5414 body of the @code{if}.
5415
5416 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5417
5418 @item -frerun-cse-after-loop
5419 @opindex frerun-cse-after-loop
5420 Re-run common subexpression elimination after loop optimizations has been
5421 performed.
5422
5423 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5424
5425 @item -fgcse
5426 @opindex fgcse
5427 Perform a global common subexpression elimination pass.
5428 This pass also performs global constant and copy propagation.
5429
5430 @emph{Note:} When compiling a program using computed gotos, a GCC
5431 extension, you may get better runtime performance if you disable
5432 the global common subexpression elimination pass by adding
5433 @option{-fno-gcse} to the command line.
5434
5435 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5436
5437 @item -fgcse-lm
5438 @opindex fgcse-lm
5439 When @option{-fgcse-lm} is enabled, global common subexpression elimination will
5440 attempt to move loads which are only killed by stores into themselves.  This
5441 allows a loop containing a load/store sequence to be changed to a load outside
5442 the loop, and a copy/store within the loop.
5443
5444 Enabled by default when gcse is enabled.
5445
5446 @item -fgcse-sm
5447 @opindex fgcse-sm
5448 When @option{-fgcse-sm} is enabled, a store motion pass is run after
5449 global common subexpression elimination.  This pass will attempt to move
5450 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
5451 loops containing a load/store sequence can be changed to a load before
5452 the loop and a store after the loop.
5453
5454 Not enabled at any optimization level.
5455
5456 @item -fgcse-las
5457 @opindex fgcse-las
5458 When @option{-fgcse-las} is enabled, the global common subexpression
5459 elimination pass eliminates redundant loads that come after stores to the
5460 same memory location (both partial and full redundancies).
5461
5462 Not enabled at any optimization level.
5463
5464 @item -fgcse-after-reload
5465 @opindex fgcse-after-reload
5466 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
5467 pass is performed after reload.  The purpose of this pass is to cleanup
5468 redundant spilling.
5469
5470 @item -funsafe-loop-optimizations
5471 @opindex funsafe-loop-optimizations
5472 If given, the loop optimizer will assume that loop indices do not
5473 overflow, and that the loops with nontrivial exit condition are not
5474 infinite.  This enables a wider range of loop optimizations even if
5475 the loop optimizer itself cannot prove that these assumptions are valid.
5476 Using @option{-Wunsafe-loop-optimizations}, the compiler will warn you
5477 if it finds this kind of loop.
5478
5479 @item -fcrossjumping
5480 @opindex fcrossjumping
5481 Perform cross-jumping transformation.  This transformation unifies equivalent code and save code size.  The
5482 resulting code may or may not perform better than without cross-jumping.
5483
5484 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5485
5486 @item -fif-conversion
5487 @opindex fif-conversion
5488 Attempt to transform conditional jumps into branch-less equivalents.  This
5489 include use of conditional moves, min, max, set flags and abs instructions, and
5490 some tricks doable by standard arithmetics.  The use of conditional execution
5491 on chips where it is available is controlled by @code{if-conversion2}.
5492
5493 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5494
5495 @item -fif-conversion2
5496 @opindex fif-conversion2
5497 Use conditional execution (where available) to transform conditional jumps into
5498 branch-less equivalents.
5499
5500 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5501
5502 @item -fdelete-null-pointer-checks
5503 @opindex fdelete-null-pointer-checks
5504 Use global dataflow analysis to identify and eliminate useless checks
5505 for null pointers.  The compiler assumes that dereferencing a null
5506 pointer would have halted the program.  If a pointer is checked after
5507 it has already been dereferenced, it cannot be null.
5508
5509 In some environments, this assumption is not true, and programs can
5510 safely dereference null pointers.  Use
5511 @option{-fno-delete-null-pointer-checks} to disable this optimization
5512 for programs which depend on that behavior.
5513
5514 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5515
5516 @item -fexpensive-optimizations
5517 @opindex fexpensive-optimizations
5518 Perform a number of minor optimizations that are relatively expensive.
5519
5520 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5521
5522 @item -foptimize-register-move
5523 @itemx -fregmove
5524 @opindex foptimize-register-move
5525 @opindex fregmove
5526 Attempt to reassign register numbers in move instructions and as
5527 operands of other simple instructions in order to maximize the amount of
5528 register tying.  This is especially helpful on machines with two-operand
5529 instructions.
5530
5531 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
5532 optimization.
5533
5534 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5535
5536 @item -fdelayed-branch
5537 @opindex fdelayed-branch
5538 If supported for the target machine, attempt to reorder instructions
5539 to exploit instruction slots available after delayed branch
5540 instructions.
5541
5542 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5543
5544 @item -fschedule-insns
5545 @opindex fschedule-insns
5546 If supported for the target machine, attempt to reorder instructions to
5547 eliminate execution stalls due to required data being unavailable.  This
5548 helps machines that have slow floating point or memory load instructions
5549 by allowing other instructions to be issued until the result of the load
5550 or floating point instruction is required.
5551
5552 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5553
5554 @item -fschedule-insns2
5555 @opindex fschedule-insns2
5556 Similar to @option{-fschedule-insns}, but requests an additional pass of
5557 instruction scheduling after register allocation has been done.  This is
5558 especially useful on machines with a relatively small number of
5559 registers and where memory load instructions take more than one cycle.
5560
5561 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5562
5563 @item -fno-sched-interblock
5564 @opindex fno-sched-interblock
5565 Don't schedule instructions across basic blocks.  This is normally
5566 enabled by default when scheduling before register allocation, i.e.@:
5567 with @option{-fschedule-insns} or at @option{-O2} or higher.
5568
5569 @item -fno-sched-spec
5570 @opindex fno-sched-spec
5571 Don't allow speculative motion of non-load instructions.  This is normally
5572 enabled by default when scheduling before register allocation, i.e.@:
5573 with @option{-fschedule-insns} or at @option{-O2} or higher.
5574
5575 @item -fsched-spec-load
5576 @opindex fsched-spec-load
5577 Allow speculative motion of some load instructions.  This only makes
5578 sense when scheduling before register allocation, i.e.@: with
5579 @option{-fschedule-insns} or at @option{-O2} or higher.
5580
5581 @item -fsched-spec-load-dangerous
5582 @opindex fsched-spec-load-dangerous
5583 Allow speculative motion of more load instructions.  This only makes
5584 sense when scheduling before register allocation, i.e.@: with
5585 @option{-fschedule-insns} or at @option{-O2} or higher.
5586
5587 @item -fsched-stalled-insns
5588 @itemx -fsched-stalled-insns=@var{n}
5589 @opindex fsched-stalled-insns
5590 Define how many insns (if any) can be moved prematurely from the queue
5591 of stalled insns into the ready list, during the second scheduling pass.
5592 @option{-fno-fsched-stalled-insns} and @option{-fsched-stalled-insns=0}
5593 are equivalent and mean that no insns will be moved prematurely.
5594 If @var{n} is unspecified then there is no limit on how many queued
5595 insns can be moved prematurely.
5596
5597 @item -fsched-stalled-insns-dep
5598 @itemx -fsched-stalled-insns-dep=@var{n}
5599 @opindex fsched-stalled-insns-dep
5600 Define how many insn groups (cycles) will be examined for a dependency
5601 on a stalled insn that is candidate for premature removal from the queue
5602 of stalled insns.  This has an effect only during the second scheduling pass,
5603 and only if @option{-fsched-stalled-insns} is used and its value is not zero.
5604 @option{-fno-sched-stalled-insns-dep} is equivalent to
5605 @option{-fsched-stalled-insns-dep=0}.
5606 @option{-fsched-stalled-insns-dep} without a value is equivalent to
5607 @option{-fsched-stalled-insns-dep=1}.
5608
5609 @item -fsched2-use-superblocks
5610 @opindex fsched2-use-superblocks
5611 When scheduling after register allocation, do use superblock scheduling
5612 algorithm.  Superblock scheduling allows motion across basic block boundaries
5613 resulting on faster schedules.  This option is experimental, as not all machine
5614 descriptions used by GCC model the CPU closely enough to avoid unreliable
5615 results from the algorithm.
5616
5617 This only makes sense when scheduling after register allocation, i.e.@: with
5618 @option{-fschedule-insns2} or at @option{-O2} or higher.
5619
5620 @item -fsched2-use-traces
5621 @opindex fsched2-use-traces
5622 Use @option{-fsched2-use-superblocks} algorithm when scheduling after register
5623 allocation and additionally perform code duplication in order to increase the
5624 size of superblocks using tracer pass.  See @option{-ftracer} for details on
5625 trace formation.
5626
5627 This mode should produce faster but significantly longer programs.  Also
5628 without @option{-fbranch-probabilities} the traces constructed may not
5629 match the reality and hurt the performance.  This only makes
5630 sense when scheduling after register allocation, i.e.@: with
5631 @option{-fschedule-insns2} or at @option{-O2} or higher.
5632
5633 @item -fsee
5634 @opindex fsee
5635 Eliminates redundant extension instructions and move the non redundant
5636 ones to optimal placement using LCM.
5637
5638 @item -freschedule-modulo-scheduled-loops
5639 @opindex freschedule-modulo-scheduled-loops
5640 The modulo scheduling comes before the traditional scheduling, if a loop
5641 was modulo scheduled we may want to prevent the later scheduling passes
5642 from changing its schedule, we use this option to control that.
5643
5644 @item -fcaller-saves
5645 @opindex fcaller-saves
5646 Enable values to be allocated in registers that will be clobbered by
5647 function calls, by emitting extra instructions to save and restore the
5648 registers around such calls.  Such allocation is done only when it
5649 seems to result in better code than would otherwise be produced.
5650
5651 This option is always enabled by default on certain machines, usually
5652 those which have no call-preserved registers to use instead.
5653
5654 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5655
5656 @item -ftree-reassoc
5657 @opindex ftree-reassoc
5658 Perform Reassociation on trees  This flag is enabled by default
5659 at @option{-O} and higher.
5660
5661 @item -ftree-pre
5662 @opindex ftree-pre
5663 Perform Partial Redundancy Elimination (PRE) on trees.  This flag is
5664 enabled by default at @option{-O2} and @option{-O3}.
5665
5666 @item -ftree-fre
5667 @opindex ftree-fre
5668 Perform Full Redundancy Elimination (FRE) on trees.  The difference
5669 between FRE and PRE is that FRE only considers expressions
5670 that are computed on all paths leading to the redundant computation.
5671 This analysis is faster than PRE, though it exposes fewer redundancies.
5672 This flag is enabled by default at @option{-O} and higher.
5673
5674 @item -ftree-copy-prop
5675 @opindex ftree-copy-prop
5676 Perform copy propagation on trees.  This pass eliminates unnecessary
5677 copy operations.  This flag is enabled by default at @option{-O} and
5678 higher.
5679
5680 @item -ftree-store-copy-prop
5681 @opindex ftree-store-copy-prop
5682 Perform copy propagation of memory loads and stores.  This pass
5683 eliminates unnecessary copy operations in memory references
5684 (structures, global variables, arrays, etc).  This flag is enabled by
5685 default at @option{-O2} and higher.
5686
5687 @item -ftree-salias
5688 @opindex ftree-salias
5689 Perform structural alias analysis on trees.  This flag
5690 is enabled by default at @option{-O} and higher.
5691
5692 @item -fipa-pta
5693 @opindex fipa-pta
5694 Perform interprocedural pointer analysis.
5695
5696 @item -ftree-sink
5697 @opindex ftree-sink
5698 Perform forward store motion  on trees.  This flag is
5699 enabled by default at @option{-O} and higher.
5700
5701 @item -ftree-ccp
5702 @opindex ftree-ccp
5703 Perform sparse conditional constant propagation (CCP) on trees.  This
5704 pass only operates on local scalar variables and is enabled by default
5705 at @option{-O} and higher.
5706
5707 @item -ftree-store-ccp
5708 @opindex ftree-store-ccp
5709 Perform sparse conditional constant propagation (CCP) on trees.  This
5710 pass operates on both local scalar variables and memory stores and
5711 loads (global variables, structures, arrays, etc).  This flag is
5712 enabled by default at @option{-O2} and higher.
5713
5714 @item -ftree-dce
5715 @opindex ftree-dce
5716 Perform dead code elimination (DCE) on trees.  This flag is enabled by
5717 default at @option{-O} and higher.
5718
5719 @item -ftree-dominator-opts
5720 @opindex ftree-dominator-opts
5721 Perform a variety of simple scalar cleanups (constant/copy
5722 propagation, redundancy elimination, range propagation and expression
5723 simplification) based on a dominator tree traversal.  This also
5724 performs jump threading (to reduce jumps to jumps). This flag is
5725 enabled by default at @option{-O} and higher.
5726
5727 @item -ftree-dse
5728 @opindex ftree-dse
5729 Perform dead store elimination (DSE) on trees.  A dead store is a store into
5730 a memory location which will later be overwritten by another store without
5731 any intervening loads.  In this case the earlier store can be deleted.  This
5732 flag is enabled by default at @option{-O} and higher.
5733
5734 @item -ftree-ch
5735 @opindex ftree-ch
5736 Perform loop header copying on trees.  This is beneficial since it increases
5737 effectiveness of code motion optimizations.  It also saves one jump.  This flag
5738 is enabled by default at @option{-O} and higher.  It is not enabled
5739 for @option{-Os}, since it usually increases code size.
5740
5741 @item -ftree-loop-optimize
5742 @opindex ftree-loop-optimize
5743 Perform loop optimizations on trees.  This flag is enabled by default
5744 at @option{-O} and higher.
5745
5746 @item -ftree-loop-linear
5747 @opindex ftree-loop-linear
5748 Perform linear loop transformations on tree.  This flag can improve cache
5749 performance and allow further loop optimizations to take place.
5750
5751 @item -fcheck-data-deps
5752 @opindex fcheck-data-deps
5753 Compare the results of several data dependence analyzers.  This option
5754 is used for debugging the data dependence analyzers.
5755
5756 @item -ftree-loop-im
5757 @opindex ftree-loop-im
5758 Perform loop invariant motion on trees.  This pass moves only invariants that
5759 would be hard to handle at RTL level (function calls, operations that expand to
5760 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
5761 operands of conditions that are invariant out of the loop, so that we can use
5762 just trivial invariantness analysis in loop unswitching.  The pass also includes
5763 store motion.
5764
5765 @item -ftree-loop-ivcanon
5766 @opindex ftree-loop-ivcanon
5767 Create a canonical counter for number of iterations in the loop for that
5768 determining number of iterations requires complicated analysis.  Later
5769 optimizations then may determine the number easily.  Useful especially
5770 in connection with unrolling.
5771
5772 @item -fivopts
5773 @opindex fivopts
5774 Perform induction variable optimizations (strength reduction, induction
5775 variable merging and induction variable elimination) on trees.
5776
5777 @item -ftree-parallelize-loops=n
5778 @opindex ftree-parallelize-loops
5779 Parallelize loops, i.e., split their iteration space to run in n threads.
5780 This is only possible for loops whose iterations are independent
5781 and can be arbitrarily reordered.  The optimization is only
5782 profitable on multiprocessor machines, for loops that are CPU-intensive,
5783 rather than constrained e.g. by memory bandwidth.
5784
5785 @item -ftree-sra
5786 @opindex ftree-sra
5787 Perform scalar replacement of aggregates.  This pass replaces structure
5788 references with scalars to prevent committing structures to memory too
5789 early.  This flag is enabled by default at @option{-O} and higher.
5790
5791 @item -ftree-copyrename
5792 @opindex ftree-copyrename
5793 Perform copy renaming on trees.  This pass attempts to rename compiler
5794 temporaries to other variables at copy locations, usually resulting in
5795 variable names which more closely resemble the original variables.  This flag
5796 is enabled by default at @option{-O} and higher.
5797
5798 @item -ftree-ter
5799 @opindex ftree-ter
5800 Perform temporary expression replacement during the SSA->normal phase.  Single
5801 use/single def temporaries are replaced at their use location with their
5802 defining expression.  This results in non-GIMPLE code, but gives the expanders
5803 much more complex trees to work on resulting in better RTL generation.  This is
5804 enabled by default at @option{-O} and higher.
5805
5806 @item -ftree-vectorize
5807 @opindex ftree-vectorize
5808 Perform loop vectorization on trees.
5809
5810 @item -ftree-vect-loop-version
5811 @opindex ftree-vect-loop-version
5812 Perform loop versioning when doing loop vectorization on trees.  When a loop
5813 appears to be vectorizable except that data alignment or data dependence cannot
5814 be determined at compile time then vectorized and non-vectorized versions of
5815 the loop are generated along with runtime checks for alignment or dependence
5816 to control which version is executed.  This option is enabled by default
5817 except at level @option{-Os} where it is disabled.
5818
5819 @item -fvect-cost-model
5820 @opindex fvect-cost-model
5821 Enable cost model for vectorization.
5822
5823 @item -ftree-vrp
5824 @opindex ftree-vrp
5825 Perform Value Range Propagation on trees.  This is similar to the
5826 constant propagation pass, but instead of values, ranges of values are
5827 propagated.  This allows the optimizers to remove unnecessary range
5828 checks like array bound checks and null pointer checks.  This is
5829 enabled by default at @option{-O2} and higher.  Null pointer check
5830 elimination is only done if @option{-fdelete-null-pointer-checks} is
5831 enabled.
5832
5833 @item -ftracer
5834 @opindex ftracer
5835 Perform tail duplication to enlarge superblock size.  This transformation
5836 simplifies the control flow of the function allowing other optimizations to do
5837 better job.
5838
5839 @item -funroll-loops
5840 @opindex funroll-loops
5841 Unroll loops whose number of iterations can be determined at compile
5842 time or upon entry to the loop.  @option{-funroll-loops} implies
5843 @option{-frerun-cse-after-loop}.  This option makes code larger,
5844 and may or may not make it run faster.
5845
5846 @item -funroll-all-loops
5847 @opindex funroll-all-loops
5848 Unroll all loops, even if their number of iterations is uncertain when
5849 the loop is entered.  This usually makes programs run more slowly.
5850 @option{-funroll-all-loops} implies the same options as
5851 @option{-funroll-loops},
5852
5853 @item -fsplit-ivs-in-unroller
5854 @opindex fsplit-ivs-in-unroller
5855 Enables expressing of values of induction variables in later iterations
5856 of the unrolled loop using the value in the first iteration.  This breaks
5857 long dependency chains, thus improving efficiency of the scheduling passes.
5858
5859 Combination of @option{-fweb} and CSE is often sufficient to obtain the
5860 same effect.  However in cases the loop body is more complicated than
5861 a single basic block, this is not reliable.  It also does not work at all
5862 on some of the architectures due to restrictions in the CSE pass.
5863
5864 This optimization is enabled by default.
5865
5866 @item -fvariable-expansion-in-unroller
5867 @opindex fvariable-expansion-in-unroller
5868 With this option, the compiler will create multiple copies of some
5869 local variables when unrolling a loop which can result in superior code.
5870
5871 @item -fpredictive-commoning
5872 @opindex fpredictive-commoning
5873 Perform predictive commoning optimization, i.e., reusing computations
5874 (especially memory loads and stores) performed in previous
5875 iterations of loops.
5876
5877 This option is enabled at level @option{-O3}.
5878
5879 @item -fprefetch-loop-arrays
5880 @opindex fprefetch-loop-arrays
5881 If supported by the target machine, generate instructions to prefetch
5882 memory to improve the performance of loops that access large arrays.
5883
5884 This option may generate better or worse code; results are highly
5885 dependent on the structure of loops within the source code.
5886
5887 Disabled at level @option{-Os}.
5888
5889 @item -fno-peephole
5890 @itemx -fno-peephole2
5891 @opindex fno-peephole
5892 @opindex fno-peephole2
5893 Disable any machine-specific peephole optimizations.  The difference
5894 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
5895 are implemented in the compiler; some targets use one, some use the
5896 other, a few use both.
5897
5898 @option{-fpeephole} is enabled by default.
5899 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5900
5901 @item -fno-guess-branch-probability
5902 @opindex fno-guess-branch-probability
5903 Do not guess branch probabilities using heuristics.
5904
5905 GCC will use heuristics to guess branch probabilities if they are
5906 not provided by profiling feedback (@option{-fprofile-arcs}).  These
5907 heuristics are based on the control flow graph.  If some branch probabilities
5908 are specified by @samp{__builtin_expect}, then the heuristics will be
5909 used to guess branch probabilities for the rest of the control flow graph,
5910 taking the @samp{__builtin_expect} info into account.  The interactions
5911 between the heuristics and @samp{__builtin_expect} can be complex, and in
5912 some cases, it may be useful to disable the heuristics so that the effects
5913 of @samp{__builtin_expect} are easier to understand.
5914
5915 The default is @option{-fguess-branch-probability} at levels
5916 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5917
5918 @item -freorder-blocks
5919 @opindex freorder-blocks
5920 Reorder basic blocks in the compiled function in order to reduce number of
5921 taken branches and improve code locality.
5922
5923 Enabled at levels @option{-O2}, @option{-O3}.
5924
5925 @item -freorder-blocks-and-partition
5926 @opindex freorder-blocks-and-partition
5927 In addition to reordering basic blocks in the compiled function, in order
5928 to reduce number of taken branches, partitions hot and cold basic blocks
5929 into separate sections of the assembly and .o files, to improve
5930 paging and cache locality performance.
5931
5932 This optimization is automatically turned off in the presence of
5933 exception handling, for linkonce sections, for functions with a user-defined
5934 section attribute and on any architecture that does not support named
5935 sections.
5936
5937 @item -freorder-functions
5938 @opindex freorder-functions
5939 Reorder functions in the object file in order to
5940 improve code locality.  This is implemented by using special
5941 subsections @code{.text.hot} for most frequently executed functions and
5942 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
5943 the linker so object file format must support named sections and linker must
5944 place them in a reasonable way.
5945
5946 Also profile feedback must be available in to make this option effective.  See
5947 @option{-fprofile-arcs} for details.
5948
5949 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5950
5951 @item -fstrict-aliasing
5952 @opindex fstrict-aliasing
5953 Allows the compiler to assume the strictest aliasing rules applicable to
5954 the language being compiled.  For C (and C++), this activates
5955 optimizations based on the type of expressions.  In particular, an
5956 object of one type is assumed never to reside at the same address as an
5957 object of a different type, unless the types are almost the same.  For
5958 example, an @code{unsigned int} can alias an @code{int}, but not a
5959 @code{void*} or a @code{double}.  A character type may alias any other
5960 type.
5961
5962 Pay special attention to code like this:
5963 @smallexample
5964 union a_union @{
5965   int i;
5966   double d;
5967 @};
5968
5969 int f() @{
5970   a_union t;
5971   t.d = 3.0;
5972   return t.i;
5973 @}
5974 @end smallexample
5975 The practice of reading from a different union member than the one most
5976 recently written to (called ``type-punning'') is common.  Even with
5977 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
5978 is accessed through the union type.  So, the code above will work as
5979 expected.  However, this code might not:
5980 @smallexample
5981 int f() @{
5982   a_union t;
5983   int* ip;
5984   t.d = 3.0;
5985   ip = &t.i;
5986   return *ip;
5987 @}
5988 @end smallexample
5989
5990 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5991
5992 @item -fstrict-overflow
5993 @opindex fstrict-overflow
5994 Allow the compiler to assume strict signed overflow rules, depending
5995 on the language being compiled.  For C (and C++) this means that
5996 overflow when doing arithmetic with signed numbers is undefined, which
5997 means that the compiler may assume that it will not happen.  This
5998 permits various optimizations.  For example, the compiler will assume
5999 that an expression like @code{i + 10 > i} will always be true for
6000 signed @code{i}.  This assumption is only valid if signed overflow is
6001 undefined, as the expression is false if @code{i + 10} overflows when
6002 using twos complement arithmetic.  When this option is in effect any
6003 attempt to determine whether an operation on signed numbers will
6004 overflow must be written carefully to not actually involve overflow.
6005
6006 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
6007 that signed overflow is fully defined: it wraps.  When
6008 @option{-fwrapv} is used, there is no difference between
6009 @option{-fstrict-overflow} and @option{-fno-strict-overflow}.  With
6010 @option{-fwrapv} certain types of overflow are permitted.  For
6011 example, if the compiler gets an overflow when doing arithmetic on
6012 constants, the overflowed value can still be used with
6013 @option{-fwrapv}, but not otherwise.
6014
6015 The @option{-fstrict-overflow} option is enabled at levels
6016 @option{-O2}, @option{-O3}, @option{-Os}.
6017
6018 @item -falign-functions
6019 @itemx -falign-functions=@var{n}
6020 @opindex falign-functions
6021 Align the start of functions to the next power-of-two greater than
6022 @var{n}, skipping up to @var{n} bytes.  For instance,
6023 @option{-falign-functions=32} aligns functions to the next 32-byte
6024 boundary, but @option{-falign-functions=24} would align to the next
6025 32-byte boundary only if this can be done by skipping 23 bytes or less.
6026
6027 @option{-fno-align-functions} and @option{-falign-functions=1} are
6028 equivalent and mean that functions will not be aligned.
6029
6030 Some assemblers only support this flag when @var{n} is a power of two;
6031 in that case, it is rounded up.
6032
6033 If @var{n} is not specified or is zero, use a machine-dependent default.
6034
6035 Enabled at levels @option{-O2}, @option{-O3}.
6036
6037 @item -falign-labels
6038 @itemx -falign-labels=@var{n}
6039 @opindex falign-labels
6040 Align all branch targets to a power-of-two boundary, skipping up to
6041 @var{n} bytes like @option{-falign-functions}.  This option can easily
6042 make code slower, because it must insert dummy operations for when the
6043 branch target is reached in the usual flow of the code.
6044
6045 @option{-fno-align-labels} and @option{-falign-labels=1} are
6046 equivalent and mean that labels will not be aligned.
6047
6048 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
6049 are greater than this value, then their values are used instead.
6050
6051 If @var{n} is not specified or is zero, use a machine-dependent default
6052 which is very likely to be @samp{1}, meaning no alignment.
6053
6054 Enabled at levels @option{-O2}, @option{-O3}.
6055
6056 @item -falign-loops
6057 @itemx -falign-loops=@var{n}
6058 @opindex falign-loops
6059 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
6060 like @option{-falign-functions}.  The hope is that the loop will be
6061 executed many times, which will make up for any execution of the dummy
6062 operations.
6063
6064 @option{-fno-align-loops} and @option{-falign-loops=1} are
6065 equivalent and mean that loops will not be aligned.
6066
6067 If @var{n} is not specified or is zero, use a machine-dependent default.
6068
6069 Enabled at levels @option{-O2}, @option{-O3}.
6070
6071 @item -falign-jumps
6072 @itemx -falign-jumps=@var{n}
6073 @opindex falign-jumps
6074 Align branch targets to a power-of-two boundary, for branch targets
6075 where the targets can only be reached by jumping, skipping up to @var{n}
6076 bytes like @option{-falign-functions}.  In this case, no dummy operations
6077 need be executed.
6078
6079 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
6080 equivalent and mean that loops will not be aligned.
6081
6082 If @var{n} is not specified or is zero, use a machine-dependent default.
6083
6084 Enabled at levels @option{-O2}, @option{-O3}.
6085
6086 @item -funit-at-a-time
6087 @opindex funit-at-a-time
6088 Parse the whole compilation unit before starting to produce code.
6089 This allows some extra optimizations to take place but consumes
6090 more memory (in general).  There are some compatibility issues
6091 with @emph{unit-at-a-time} mode:
6092 @itemize @bullet
6093 @item
6094 enabling @emph{unit-at-a-time} mode may change the order
6095 in which functions, variables, and top-level @code{asm} statements
6096 are emitted, and will likely break code relying on some particular
6097 ordering.  The majority of such top-level @code{asm} statements,
6098 though, can be replaced by @code{section} attributes.  The
6099 @option{fno-toplevel-reorder} option may be used to keep the ordering
6100 used in the input file, at the cost of some optimizations.
6101
6102 @item
6103 @emph{unit-at-a-time} mode removes unreferenced static variables
6104 and functions.  This may result in undefined references
6105 when an @code{asm} statement refers directly to variables or functions
6106 that are otherwise unused.  In that case either the variable/function
6107 shall be listed as an operand of the @code{asm} statement operand or,
6108 in the case of top-level @code{asm} statements the attribute @code{used}
6109 shall be used on the declaration.
6110
6111 @item
6112 Static functions now can use non-standard passing conventions that
6113 may break @code{asm} statements calling functions directly.  Again,
6114 attribute @code{used} will prevent this behavior.
6115 @end itemize
6116
6117 As a temporary workaround, @option{-fno-unit-at-a-time} can be used,
6118 but this scheme may not be supported by future releases of GCC@.
6119
6120 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6121
6122 @item -fno-toplevel-reorder
6123 Do not reorder top-level functions, variables, and @code{asm}
6124 statements.  Output them in the same order that they appear in the
6125 input file.  When this option is used, unreferenced static variables
6126 will not be removed.  This option is intended to support existing code
6127 which relies on a particular ordering.  For new code, it is better to
6128 use attributes.
6129
6130 @item -fweb
6131 @opindex fweb
6132 Constructs webs as commonly used for register allocation purposes and assign
6133 each web individual pseudo register.  This allows the register allocation pass
6134 to operate on pseudos directly, but also strengthens several other optimization
6135 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
6136 however, make debugging impossible, since variables will no longer stay in a
6137 ``home register''.
6138
6139 Enabled by default with @option{-funroll-loops}.
6140
6141 @item -fwhole-program
6142 @opindex fwhole-program
6143 Assume that the current compilation unit represents whole program being
6144 compiled.  All public functions and variables with the exception of @code{main}
6145 and those merged by attribute @code{externally_visible} become static functions
6146 and in a affect gets more aggressively optimized by interprocedural optimizers.
6147 While this option is equivalent to proper use of @code{static} keyword for
6148 programs consisting of single file, in combination with option
6149 @option{--combine} this flag can be used to compile most of smaller scale C
6150 programs since the functions and variables become local for the whole combined
6151 compilation unit, not for the single source file itself.
6152
6153 This option is not supported for Fortran programs.
6154
6155 @item -fcprop-registers
6156 @opindex fcprop-registers
6157 After register allocation and post-register allocation instruction splitting,
6158 we perform a copy-propagation pass to try to reduce scheduling dependencies
6159 and occasionally eliminate the copy.
6160
6161 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6162
6163 @item -fprofile-generate
6164 @opindex fprofile-generate
6165
6166 Enable options usually used for instrumenting application to produce
6167 profile useful for later recompilation with profile feedback based
6168 optimization.  You must use @option{-fprofile-generate} both when
6169 compiling and when linking your program.
6170
6171 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
6172
6173 @item -fprofile-use
6174 @opindex fprofile-use
6175 Enable profile feedback directed optimizations, and optimizations
6176 generally profitable only with profile feedback available.
6177
6178 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
6179 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}
6180
6181 By default, GCC emits an error message if the feedback profiles do not
6182 match the source code.  This error can be turned into a warning by using
6183 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
6184 code.
6185 @end table
6186
6187 The following options control compiler behavior regarding floating
6188 point arithmetic.  These options trade off between speed and
6189 correctness.  All must be specifically enabled.
6190
6191 @table @gcctabopt
6192 @item -ffloat-store
6193 @opindex ffloat-store
6194 Do not store floating point variables in registers, and inhibit other
6195 options that might change whether a floating point value is taken from a
6196 register or memory.
6197
6198 @cindex floating point precision
6199 This option prevents undesirable excess precision on machines such as
6200 the 68000 where the floating registers (of the 68881) keep more
6201 precision than a @code{double} is supposed to have.  Similarly for the
6202 x86 architecture.  For most programs, the excess precision does only
6203 good, but a few programs rely on the precise definition of IEEE floating
6204 point.  Use @option{-ffloat-store} for such programs, after modifying
6205 them to store all pertinent intermediate computations into variables.
6206
6207 @item -ffast-math
6208 @opindex ffast-math
6209 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations}, @*
6210 @option{-fno-trapping-math}, @option{-ffinite-math-only},
6211 @option{-fno-rounding-math}, @option{-fno-signaling-nans},
6212 @option{-fno-signed-zeros} and @option{fcx-limited-range}.
6213
6214 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
6215
6216 This option is not turned on by any @option{-O} option since
6217 it can result in incorrect output for programs which depend on
6218 an exact implementation of IEEE or ISO rules/specifications for
6219 math functions. It may, however, yield faster code for programs
6220 that do not require the guarantees of these specifications.
6221
6222 @item -fno-math-errno
6223 @opindex fno-math-errno
6224 Do not set ERRNO after calling math functions that are executed
6225 with a single instruction, e.g., sqrt.  A program that relies on
6226 IEEE exceptions for math error handling may want to use this flag
6227 for speed while maintaining IEEE arithmetic compatibility.
6228
6229 This option is not turned on by any @option{-O} option since
6230 it can result in incorrect output for programs which depend on
6231 an exact implementation of IEEE or ISO rules/specifications for
6232 math functions. It may, however, yield faster code for programs
6233 that do not require the guarantees of these specifications.
6234
6235 The default is @option{-fmath-errno}.
6236
6237 On Darwin systems, the math library never sets @code{errno}.  There is
6238 therefore no reason for the compiler to consider the possibility that
6239 it might, and @option{-fno-math-errno} is the default.
6240
6241 @item -funsafe-math-optimizations
6242 @opindex funsafe-math-optimizations
6243
6244 Allow optimizations for floating-point arithmetic that (a) assume
6245 that arguments and results are valid and (b) may violate IEEE or
6246 ANSI standards.  When used at link-time, it may include libraries
6247 or startup files that change the default FPU control word or other
6248 similar optimizations.
6249
6250 This option is not turned on by any @option{-O} option since
6251 it can result in incorrect output for programs which depend on
6252 an exact implementation of IEEE or ISO rules/specifications for
6253 math functions. It may, however, yield faster code for programs
6254 that do not require the guarantees of these specifications.
6255 Enables @option{-freciprocal-math} and @option{-fassociative-math}.
6256
6257 The default is @option{-fno-unsafe-math-optimizations}.
6258
6259 @item -fassociative-math
6260 @opindex fassociative-math
6261
6262 Allow re-association of operands in series of floating-point operations.
6263 This violates the ISO C and C++ language standard by possibly changing
6264 computation result.  NOTE: re-ordering may change the sign of zero as
6265 well as ignore NaNs and inhibit or create underflow or overflow (and
6266 thus cannot be used on a code which relies on rounding behavior like
6267 @code{(x + 2**52) - 2**52)}.  May also reorder floating-point comparisons
6268 and thus may not be used when ordered comparisons are required.
6269 This flag doesn't make much sense without @option{-fno-signed-zeros}
6270 or @option{-fno-trapping-math} or with @option{-frounding-math}.
6271
6272 The default is @option{-fno-associative-math}.
6273
6274 @item -freciprocal-math
6275 @opindex freciprocal-math
6276
6277 Allow the reciprocal of a value to be used instead of dividing by
6278 the value if this enables optimizations.  For example @code{x / y}
6279 can be replaced with @code{x * (1/y)} which is useful if @code{(1/y)}
6280 is subject to common subexpression elimination.  Note that this loses
6281 precision and increases the number of flops operating on the value.
6282
6283 The default is @option{-fno-reciprocal-math}.
6284
6285 @item -ffinite-math-only
6286 @opindex ffinite-math-only
6287 Allow optimizations for floating-point arithmetic that assume
6288 that arguments and results are not NaNs or +-Infs.
6289
6290 This option is not turned on by any @option{-O} option since
6291 it can result in incorrect output for programs which depend on
6292 an exact implementation of IEEE or ISO rules/specifications for
6293 math functions. It may, however, yield faster code for programs
6294 that do not require the guarantees of these specifications.
6295
6296 The default is @option{-fno-finite-math-only}.
6297
6298 @item -fno-signed-zeros
6299 @opindex fno-signed-zeros
6300 Allow optimizations for floating point arithmetic that ignore the
6301 signedness of zero.  IEEE arithmetic specifies the behavior of
6302 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
6303 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
6304 This option implies that the sign of a zero result isn't significant.
6305
6306 The default is @option{-fsigned-zeros}.
6307
6308 @item -fno-trapping-math
6309 @opindex fno-trapping-math
6310 Compile code assuming that floating-point operations cannot generate
6311 user-visible traps.  These traps include division by zero, overflow,
6312 underflow, inexact result and invalid operation.  This option implies
6313 @option{-fno-signaling-nans}.  Setting this option may allow faster
6314 code if one relies on ``non-stop'' IEEE arithmetic, for example.
6315
6316 This option should never be turned on by any @option{-O} option since
6317 it can result in incorrect output for programs which depend on
6318 an exact implementation of IEEE or ISO rules/specifications for
6319 math functions.
6320
6321 The default is @option{-ftrapping-math}.
6322
6323 @item -frounding-math
6324 @opindex frounding-math
6325 Disable transformations and optimizations that assume default floating
6326 point rounding behavior.  This is round-to-zero for all floating point
6327 to integer conversions, and round-to-nearest for all other arithmetic
6328 truncations.  This option should be specified for programs that change
6329 the FP rounding mode dynamically, or that may be executed with a
6330 non-default rounding mode.  This option disables constant folding of
6331 floating point expressions at compile-time (which may be affected by
6332 rounding mode) and arithmetic transformations that are unsafe in the
6333 presence of sign-dependent rounding modes.
6334
6335 The default is @option{-fno-rounding-math}.
6336
6337 This option is experimental and does not currently guarantee to
6338 disable all GCC optimizations that are affected by rounding mode.
6339 Future versions of GCC may provide finer control of this setting
6340 using C99's @code{FENV_ACCESS} pragma.  This command line option
6341 will be used to specify the default state for @code{FENV_ACCESS}.
6342
6343 @item -frtl-abstract-sequences
6344 @opindex frtl-abstract-sequences
6345 It is a size optimization method. This option is to find identical
6346 sequences of code, which can be turned into pseudo-procedures  and
6347 then  replace  all  occurrences with  calls to  the  newly created
6348 subroutine. It is kind of an opposite of @option{-finline-functions}.
6349 This optimization runs at RTL level.
6350
6351 @item -fsignaling-nans
6352 @opindex fsignaling-nans
6353 Compile code assuming that IEEE signaling NaNs may generate user-visible
6354 traps during floating-point operations.  Setting this option disables
6355 optimizations that may change the number of exceptions visible with
6356 signaling NaNs.  This option implies @option{-ftrapping-math}.
6357
6358 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
6359 be defined.
6360
6361 The default is @option{-fno-signaling-nans}.
6362
6363 This option is experimental and does not currently guarantee to
6364 disable all GCC optimizations that affect signaling NaN behavior.
6365
6366 @item -fsingle-precision-constant
6367 @opindex fsingle-precision-constant
6368 Treat floating point constant as single precision constant instead of
6369 implicitly converting it to double precision constant.
6370
6371 @item -fcx-limited-range
6372 @opindex fcx-limited-range
6373 When enabled, this option states that a range reduction step is not
6374 needed when performing complex division.  The default is
6375 @option{-fno-cx-limited-range}, but is enabled by @option{-ffast-math}.
6376
6377 This option controls the default setting of the ISO C99
6378 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
6379 all languages.
6380
6381 @end table
6382
6383 The following options control optimizations that may improve
6384 performance, but are not enabled by any @option{-O} options.  This
6385 section includes experimental options that may produce broken code.
6386
6387 @table @gcctabopt
6388 @item -fbranch-probabilities
6389 @opindex fbranch-probabilities
6390 After running a program compiled with @option{-fprofile-arcs}
6391 (@pxref{Debugging Options,, Options for Debugging Your Program or
6392 @command{gcc}}), you can compile it a second time using
6393 @option{-fbranch-probabilities}, to improve optimizations based on
6394 the number of times each branch was taken.  When the program
6395 compiled with @option{-fprofile-arcs} exits it saves arc execution
6396 counts to a file called @file{@var{sourcename}.gcda} for each source
6397 file.  The information in this data file is very dependent on the
6398 structure of the generated code, so you must use the same source code
6399 and the same optimization options for both compilations.
6400
6401 With @option{-fbranch-probabilities}, GCC puts a
6402 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
6403 These can be used to improve optimization.  Currently, they are only
6404 used in one place: in @file{reorg.c}, instead of guessing which path a
6405 branch is mostly to take, the @samp{REG_BR_PROB} values are used to
6406 exactly determine which path is taken more often.
6407
6408 @item -fprofile-values
6409 @opindex fprofile-values
6410 If combined with @option{-fprofile-arcs}, it adds code so that some
6411 data about values of expressions in the program is gathered.
6412
6413 With @option{-fbranch-probabilities}, it reads back the data gathered
6414 from profiling values of expressions and adds @samp{REG_VALUE_PROFILE}
6415 notes to instructions for their later usage in optimizations.
6416
6417 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
6418
6419 @item -fvpt
6420 @opindex fvpt
6421 If combined with @option{-fprofile-arcs}, it instructs the compiler to add
6422 a code to gather information about values of expressions.
6423
6424 With @option{-fbranch-probabilities}, it reads back the data gathered
6425 and actually performs the optimizations based on them.
6426 Currently the optimizations include specialization of division operation
6427 using the knowledge about the value of the denominator.
6428
6429 @item -frename-registers
6430 @opindex frename-registers
6431 Attempt to avoid false dependencies in scheduled code by making use
6432 of registers left over after register allocation.  This optimization
6433 will most benefit processors with lots of registers.  Depending on the
6434 debug information format adopted by the target, however, it can
6435 make debugging impossible, since variables will no longer stay in
6436 a ``home register''.
6437
6438 Enabled by default with @option{-funroll-loops}.
6439
6440 @item -ftracer
6441 @opindex ftracer
6442 Perform tail duplication to enlarge superblock size.  This transformation
6443 simplifies the control flow of the function allowing other optimizations to do
6444 better job.
6445
6446 Enabled with @option{-fprofile-use}.
6447
6448 @item -funroll-loops
6449 @opindex funroll-loops
6450 Unroll loops whose number of iterations can be determined at compile time or
6451 upon entry to the loop.  @option{-funroll-loops} implies
6452 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
6453 It also turns on complete loop peeling (i.e.@: complete removal of loops with
6454 small constant number of iterations).  This option makes code larger, and may
6455 or may not make it run faster.
6456
6457 Enabled with @option{-fprofile-use}.
6458
6459 @item -funroll-all-loops
6460 @opindex funroll-all-loops
6461 Unroll all loops, even if their number of iterations is uncertain when
6462 the loop is entered.  This usually makes programs run more slowly.
6463 @option{-funroll-all-loops} implies the same options as
6464 @option{-funroll-loops}.
6465
6466 @item -fpeel-loops
6467 @opindex fpeel-loops
6468 Peels the loops for that there is enough information that they do not
6469 roll much (from profile feedback).  It also turns on complete loop peeling
6470 (i.e.@: complete removal of loops with small constant number of iterations).
6471
6472 Enabled with @option{-fprofile-use}.
6473
6474 @item -fmove-loop-invariants
6475 @opindex fmove-loop-invariants
6476 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
6477 at level @option{-O1}
6478
6479 @item -funswitch-loops
6480 @opindex funswitch-loops
6481 Move branches with loop invariant conditions out of the loop, with duplicates
6482 of the loop on both branches (modified according to result of the condition).
6483
6484 @item -ffunction-sections
6485 @itemx -fdata-sections
6486 @opindex ffunction-sections
6487 @opindex fdata-sections
6488 Place each function or data item into its own section in the output
6489 file if the target supports arbitrary sections.  The name of the
6490 function or the name of the data item determines the section's name
6491 in the output file.
6492
6493 Use these options on systems where the linker can perform optimizations
6494 to improve locality of reference in the instruction space.  Most systems
6495 using the ELF object format and SPARC processors running Solaris 2 have
6496 linkers with such optimizations.  AIX may have these optimizations in
6497 the future.
6498
6499 Only use these options when there are significant benefits from doing
6500 so.  When you specify these options, the assembler and linker will
6501 create larger object and executable files and will also be slower.
6502 You will not be able to use @code{gprof} on all systems if you
6503 specify this option and you may have problems with debugging if
6504 you specify both this option and @option{-g}.
6505
6506 @item -fbranch-target-load-optimize
6507 @opindex fbranch-target-load-optimize
6508 Perform branch target register load optimization before prologue / epilogue
6509 threading.
6510 The use of target registers can typically be exposed only during reload,
6511 thus hoisting loads out of loops and doing inter-block scheduling needs
6512 a separate optimization pass.
6513
6514 @item -fbranch-target-load-optimize2
6515 @opindex fbranch-target-load-optimize2
6516 Perform branch target register load optimization after prologue / epilogue
6517 threading.
6518
6519 @item -fbtr-bb-exclusive
6520 @opindex fbtr-bb-exclusive
6521 When performing branch target register load optimization, don't reuse
6522 branch target registers in within any basic block.
6523
6524 @item -fstack-protector
6525 @opindex fstack-protector
6526 Emit extra code to check for buffer overflows, such as stack smashing
6527 attacks.  This is done by adding a guard variable to functions with
6528 vulnerable objects.  This includes functions that call alloca, and
6529 functions with buffers larger than 8 bytes.  The guards are initialized
6530 when a function is entered and then checked when the function exits.
6531 If a guard check fails, an error message is printed and the program exits.
6532
6533 @item -fstack-protector-all
6534 @opindex fstack-protector-all
6535 Like @option{-fstack-protector} except that all functions are protected.
6536
6537 @item -fsection-anchors
6538 @opindex fsection-anchors
6539 Try to reduce the number of symbolic address calculations by using
6540 shared ``anchor'' symbols to address nearby objects.  This transformation
6541 can help to reduce the number of GOT entries and GOT accesses on some
6542 targets.
6543
6544 For example, the implementation of the following function @code{foo}:
6545
6546 @smallexample
6547 static int a, b, c;
6548 int foo (void) @{ return a + b + c; @}
6549 @end smallexample
6550
6551 would usually calculate the addresses of all three variables, but if you
6552 compile it with @option{-fsection-anchors}, it will access the variables
6553 from a common anchor point instead.  The effect is similar to the
6554 following pseudocode (which isn't valid C):
6555
6556 @smallexample
6557 int foo (void)
6558 @{
6559   register int *xr = &x;
6560   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
6561 @}
6562 @end smallexample
6563
6564 Not all targets support this option.
6565
6566 @item --param @var{name}=@var{value}
6567 @opindex param
6568 In some places, GCC uses various constants to control the amount of
6569 optimization that is done.  For example, GCC will not inline functions
6570 that contain more that a certain number of instructions.  You can
6571 control some of these constants on the command-line using the
6572 @option{--param} option.
6573
6574 The names of specific parameters, and the meaning of the values, are
6575 tied to the internals of the compiler, and are subject to change
6576 without notice in future releases.
6577
6578 In each case, the @var{value} is an integer.  The allowable choices for
6579 @var{name} are given in the following table:
6580
6581 @table @gcctabopt
6582 @item salias-max-implicit-fields
6583 The maximum number of fields in a variable without direct
6584 structure accesses for which structure aliasing will consider trying
6585 to track each field.  The default is 5
6586
6587 @item salias-max-array-elements
6588 The maximum number of elements an array can have and its elements
6589 still be tracked individually by structure aliasing. The default is 4
6590
6591 @item sra-max-structure-size
6592 The maximum structure size, in bytes, at which the scalar replacement
6593 of aggregates (SRA) optimization will perform block copies.  The
6594 default value, 0, implies that GCC will select the most appropriate
6595 size itself.
6596
6597 @item sra-field-structure-ratio
6598 The threshold ratio (as a percentage) between instantiated fields and
6599 the complete structure size.  We say that if the ratio of the number
6600 of bytes in instantiated fields to the number of bytes in the complete
6601 structure exceeds this parameter, then block copies are not used.  The
6602 default is 75.
6603
6604 @item max-crossjump-edges
6605 The maximum number of incoming edges to consider for crossjumping.
6606 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
6607 the number of edges incoming to each block.  Increasing values mean
6608 more aggressive optimization, making the compile time increase with
6609 probably small improvement in executable size.
6610
6611 @item min-crossjump-insns
6612 The minimum number of instructions which must be matched at the end
6613 of two blocks before crossjumping will be performed on them.  This
6614 value is ignored in the case where all instructions in the block being
6615 crossjumped from are matched.  The default value is 5.
6616
6617 @item max-grow-copy-bb-insns
6618 The maximum code size expansion factor when copying basic blocks
6619 instead of jumping.  The expansion is relative to a jump instruction.
6620 The default value is 8.
6621
6622 @item max-goto-duplication-insns
6623 The maximum number of instructions to duplicate to a block that jumps
6624 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
6625 passes, GCC factors computed gotos early in the compilation process,
6626 and unfactors them as late as possible.  Only computed jumps at the
6627 end of a basic blocks with no more than max-goto-duplication-insns are
6628 unfactored.  The default value is 8.
6629
6630 @item max-delay-slot-insn-search
6631 The maximum number of instructions to consider when looking for an
6632 instruction to fill a delay slot.  If more than this arbitrary number of
6633 instructions is searched, the time savings from filling the delay slot
6634 will be minimal so stop searching.  Increasing values mean more
6635 aggressive optimization, making the compile time increase with probably
6636 small improvement in executable run time.
6637
6638 @item max-delay-slot-live-search
6639 When trying to fill delay slots, the maximum number of instructions to
6640 consider when searching for a block with valid live register
6641 information.  Increasing this arbitrarily chosen value means more
6642 aggressive optimization, increasing the compile time.  This parameter
6643 should be removed when the delay slot code is rewritten to maintain the
6644 control-flow graph.
6645
6646 @item max-gcse-memory
6647 The approximate maximum amount of memory that will be allocated in
6648 order to perform the global common subexpression elimination
6649 optimization.  If more memory than specified is required, the
6650 optimization will not be done.
6651
6652 @item max-gcse-passes
6653 The maximum number of passes of GCSE to run.  The default is 1.
6654
6655 @item max-pending-list-length
6656 The maximum number of pending dependencies scheduling will allow
6657 before flushing the current state and starting over.  Large functions
6658 with few branches or calls can create excessively large lists which
6659 needlessly consume memory and resources.
6660
6661 @item max-inline-insns-single
6662 Several parameters control the tree inliner used in gcc.
6663 This number sets the maximum number of instructions (counted in GCC's
6664 internal representation) in a single function that the tree inliner
6665 will consider for inlining.  This only affects functions declared
6666 inline and methods implemented in a class declaration (C++).
6667 The default value is 450.
6668
6669 @item max-inline-insns-auto
6670 When you use @option{-finline-functions} (included in @option{-O3}),
6671 a lot of functions that would otherwise not be considered for inlining
6672 by the compiler will be investigated.  To those functions, a different
6673 (more restrictive) limit compared to functions declared inline can
6674 be applied.
6675 The default value is 90.
6676
6677 @item large-function-insns
6678 The limit specifying really large functions.  For functions larger than this
6679 limit after inlining inlining is constrained by
6680 @option{--param large-function-growth}.  This parameter is useful primarily
6681 to avoid extreme compilation time caused by non-linear algorithms used by the
6682 backend.
6683 This parameter is ignored when @option{-funit-at-a-time} is not used.
6684 The default value is 2700.
6685
6686 @item large-function-growth
6687 Specifies maximal growth of large function caused by inlining in percents.
6688 This parameter is ignored when @option{-funit-at-a-time} is not used.
6689 The default value is 100 which limits large function growth to 2.0 times
6690 the original size.
6691
6692 @item large-unit-insns
6693 The limit specifying large translation unit.  Growth caused by inlining of
6694 units larger than this limit is limited by @option{--param inline-unit-growth}.
6695 For small units this might be too tight (consider unit consisting of function A
6696 that is inline and B that just calls A three time.  If B is small relative to
6697 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
6698 large units consisting of small inlininable functions however the overall unit
6699 growth limit is needed to avoid exponential explosion of code size.  Thus for
6700 smaller units, the size is increased to @option{--param large-unit-insns}
6701 before applying @option{--param inline-unit-growth}.  The default is 10000
6702
6703 @item inline-unit-growth
6704 Specifies maximal overall growth of the compilation unit caused by inlining.
6705 This parameter is ignored when @option{-funit-at-a-time} is not used.
6706 The default value is 30 which limits unit growth to 1.3 times the original
6707 size.
6708
6709 @item large-stack-frame
6710 The limit specifying large stack frames.  While inlining the algorithm is trying
6711 to not grow past this limit too much.  Default value is 256 bytes.
6712
6713 @item large-stack-frame-growth
6714 Specifies maximal growth of large stack frames caused by inlining in percents.
6715 The default value is 1000 which limits large stack frame growth to 11 times
6716 the original size.
6717
6718 @item max-inline-insns-recursive
6719 @itemx max-inline-insns-recursive-auto
6720 Specifies maximum number of instructions out-of-line copy of self recursive inline
6721 function can grow into by performing recursive inlining.
6722
6723 For functions declared inline @option{--param max-inline-insns-recursive} is
6724 taken into account.  For function not declared inline, recursive inlining
6725 happens only when @option{-finline-functions} (included in @option{-O3}) is
6726 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
6727 default value is 450.
6728
6729 @item max-inline-recursive-depth
6730 @itemx max-inline-recursive-depth-auto
6731 Specifies maximum recursion depth used by the recursive inlining.
6732
6733 For functions declared inline @option{--param max-inline-recursive-depth} is
6734 taken into account.  For function not declared inline, recursive inlining
6735 happens only when @option{-finline-functions} (included in @option{-O3}) is
6736 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
6737 default value is 450.
6738
6739 @item min-inline-recursive-probability
6740 Recursive inlining is profitable only for function having deep recursion
6741 in average and can hurt for function having little recursion depth by
6742 increasing the prologue size or complexity of function body to other
6743 optimizers.
6744
6745 When profile feedback is available (see @option{-fprofile-generate}) the actual
6746 recursion depth can be guessed from probability that function will recurse via
6747 given call expression.  This parameter limits inlining only to call expression
6748 whose probability exceeds given threshold (in percents).  The default value is
6749 10.
6750
6751 @item inline-call-cost
6752 Specify cost of call instruction relative to simple arithmetics operations
6753 (having cost of 1).  Increasing this cost disqualifies inlining of non-leaf
6754 functions and at the same time increases size of leaf function that is believed to
6755 reduce function size by being inlined.  In effect it increases amount of
6756 inlining for code having large abstraction penalty (many functions that just
6757 pass the arguments to other functions) and decrease inlining for code with low
6758 abstraction penalty.  The default value is 12.
6759
6760 @item min-vect-loop-bound
6761 The minimum number of iterations under which a loop will not get vectorized
6762 when @option{-ftree-vectorize} is used.  The number of iterations after
6763 vectorization needs to be greater than the value specified by this option
6764 to allow vectorization.  The default value is 0.
6765
6766 @item max-unrolled-insns
6767 The maximum number of instructions that a loop should have if that loop
6768 is unrolled, and if the loop is unrolled, it determines how many times
6769 the loop code is unrolled.
6770
6771 @item max-average-unrolled-insns
6772 The maximum number of instructions biased by probabilities of their execution
6773 that a loop should have if that loop is unrolled, and if the loop is unrolled,
6774 it determines how many times the loop code is unrolled.
6775
6776 @item max-unroll-times
6777 The maximum number of unrollings of a single loop.
6778
6779 @item max-peeled-insns
6780 The maximum number of instructions that a loop should have if that loop
6781 is peeled, and if the loop is peeled, it determines how many times
6782 the loop code is peeled.
6783
6784 @item max-peel-times
6785 The maximum number of peelings of a single loop.
6786
6787 @item max-completely-peeled-insns
6788 The maximum number of insns of a completely peeled loop.
6789
6790 @item max-completely-peel-times
6791 The maximum number of iterations of a loop to be suitable for complete peeling.
6792
6793 @item max-unswitch-insns
6794 The maximum number of insns of an unswitched loop.
6795
6796 @item max-unswitch-level
6797 The maximum number of branches unswitched in a single loop.
6798
6799 @item lim-expensive
6800 The minimum cost of an expensive expression in the loop invariant motion.
6801
6802 @item iv-consider-all-candidates-bound
6803 Bound on number of candidates for induction variables below that
6804 all candidates are considered for each use in induction variable
6805 optimizations.  Only the most relevant candidates are considered
6806 if there are more candidates, to avoid quadratic time complexity.
6807
6808 @item iv-max-considered-uses
6809 The induction variable optimizations give up on loops that contain more
6810 induction variable uses.
6811
6812 @item iv-always-prune-cand-set-bound
6813 If number of candidates in the set is smaller than this value,
6814 we always try to remove unnecessary ivs from the set during its
6815 optimization when a new iv is added to the set.
6816
6817 @item scev-max-expr-size
6818 Bound on size of expressions used in the scalar evolutions analyzer.
6819 Large expressions slow the analyzer.
6820
6821 @item omega-max-vars
6822 The maximum number of variables in an Omega constraint system.
6823 The default value is 128.
6824
6825 @item omega-max-geqs
6826 The maximum number of inequalities in an Omega constraint system.
6827 The default value is 256.
6828
6829 @item omega-max-eqs
6830 The maximum number of equalities in an Omega constraint system.
6831 The default value is 128.
6832
6833 @item omega-max-wild-cards
6834 The maximum number of wildcard variables that the Omega solver will
6835 be able to insert.  The default value is 18.
6836
6837 @item omega-hash-table-size
6838 The size of the hash table in the Omega solver.  The default value is
6839 550.
6840
6841 @item omega-max-keys
6842 The maximal number of keys used by the Omega solver.  The default
6843 value is 500.
6844
6845 @item omega-eliminate-redundant-constraints
6846 When set to 1, use expensive methods to eliminate all redundant
6847 constraints.  The default value is 0.
6848
6849 @item vect-max-version-for-alignment-checks
6850 The maximum number of runtime checks that can be performed when
6851 doing loop versioning for alignment in the vectorizer.  See option
6852 ftree-vect-loop-version for more information.
6853
6854 @item vect-max-version-for-alias-checks
6855 The maximum number of runtime checks that can be performed when
6856 doing loop versioning for alias in the vectorizer.  See option
6857 ftree-vect-loop-version for more information.
6858
6859 @item max-iterations-to-track
6860
6861 The maximum number of iterations of a loop the brute force algorithm
6862 for analysis of # of iterations of the loop tries to evaluate.
6863
6864 @item hot-bb-count-fraction
6865 Select fraction of the maximal count of repetitions of basic block in program
6866 given basic block needs to have to be considered hot.
6867
6868 @item hot-bb-frequency-fraction
6869 Select fraction of the maximal frequency of executions of basic block in
6870 function given basic block needs to have to be considered hot
6871
6872 @item max-predicted-iterations
6873 The maximum number of loop iterations we predict statically.  This is useful
6874 in cases where function contain single loop with known bound and other loop
6875 with unknown.  We predict the known number of iterations correctly, while
6876 the unknown number of iterations average to roughly 10.  This means that the
6877 loop without bounds would appear artificially cold relative to the other one.
6878
6879 @item align-threshold
6880
6881 Select fraction of the maximal frequency of executions of basic block in
6882 function given basic block will get aligned.
6883
6884 @item align-loop-iterations
6885
6886 A loop expected to iterate at lest the selected number of iterations will get
6887 aligned.
6888
6889 @item tracer-dynamic-coverage
6890 @itemx tracer-dynamic-coverage-feedback
6891
6892 This value is used to limit superblock formation once the given percentage of
6893 executed instructions is covered.  This limits unnecessary code size
6894 expansion.
6895
6896 The @option{tracer-dynamic-coverage-feedback} is used only when profile
6897 feedback is available.  The real profiles (as opposed to statically estimated
6898 ones) are much less balanced allowing the threshold to be larger value.
6899
6900 @item tracer-max-code-growth
6901 Stop tail duplication once code growth has reached given percentage.  This is
6902 rather hokey argument, as most of the duplicates will be eliminated later in
6903 cross jumping, so it may be set to much higher values than is the desired code
6904 growth.
6905
6906 @item tracer-min-branch-ratio
6907
6908 Stop reverse growth when the reverse probability of best edge is less than this
6909 threshold (in percent).
6910
6911 @item tracer-min-branch-ratio
6912 @itemx tracer-min-branch-ratio-feedback
6913
6914 Stop forward growth if the best edge do have probability lower than this
6915 threshold.
6916
6917 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
6918 compilation for profile feedback and one for compilation without.  The value
6919 for compilation with profile feedback needs to be more conservative (higher) in
6920 order to make tracer effective.
6921
6922 @item max-cse-path-length
6923
6924 Maximum number of basic blocks on path that cse considers.  The default is 10.
6925
6926 @item max-cse-insns
6927 The maximum instructions CSE process before flushing. The default is 1000.
6928
6929 @item max-aliased-vops
6930
6931 Maximum number of virtual operands per function allowed to represent
6932 aliases before triggering the alias partitioning heuristic.  Alias
6933 partitioning reduces compile times and memory consumption needed for
6934 aliasing at the expense of precision loss in alias information.  The
6935 default value for this parameter is 100 for -O1, 500 for -O2 and 1000
6936 for -O3.
6937
6938 Notice that if a function contains more memory statements than the
6939 value of this parameter, it is not really possible to achieve this
6940 reduction.  In this case, the compiler will use the number of memory
6941 statements as the value for @option{max-aliased-vops}.
6942
6943 @item avg-aliased-vops
6944
6945 Average number of virtual operands per statement allowed to represent
6946 aliases before triggering the alias partitioning heuristic.  This
6947 works in conjunction with @option{max-aliased-vops}.  If a function
6948 contains more than @option{max-aliased-vops} virtual operators, then
6949 memory symbols will be grouped into memory partitions until either the
6950 total number of virtual operators is below @option{max-aliased-vops}
6951 or the average number of virtual operators per memory statement is
6952 below @option{avg-aliased-vops}.  The default value for this parameter
6953 is 1 for -O1 and -O2, and 3 for -O3.
6954
6955 @item ggc-min-expand
6956
6957 GCC uses a garbage collector to manage its own memory allocation.  This
6958 parameter specifies the minimum percentage by which the garbage
6959 collector's heap should be allowed to expand between collections.
6960 Tuning this may improve compilation speed; it has no effect on code
6961 generation.
6962
6963 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
6964 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of "RAM" is
6965 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
6966 GCC is not able to calculate RAM on a particular platform, the lower
6967 bound of 30% is used.  Setting this parameter and
6968 @option{ggc-min-heapsize} to zero causes a full collection to occur at
6969 every opportunity.  This is extremely slow, but can be useful for
6970 debugging.
6971
6972 @item ggc-min-heapsize
6973
6974 Minimum size of the garbage collector's heap before it begins bothering
6975 to collect garbage.  The first collection occurs after the heap expands
6976 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
6977 tuning this may improve compilation speed, and has no effect on code
6978 generation.
6979
6980 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit which
6981 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
6982 with a lower bound of 4096 (four megabytes) and an upper bound of
6983 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
6984 particular platform, the lower bound is used.  Setting this parameter
6985 very large effectively disables garbage collection.  Setting this
6986 parameter and @option{ggc-min-expand} to zero causes a full collection
6987 to occur at every opportunity.
6988
6989 @item max-reload-search-insns
6990 The maximum number of instruction reload should look backward for equivalent
6991 register.  Increasing values mean more aggressive optimization, making the
6992 compile time increase with probably slightly better performance.  The default
6993 value is 100.
6994
6995 @item max-cselib-memory-locations
6996 The maximum number of memory locations cselib should take into account.
6997 Increasing values mean more aggressive optimization, making the compile time
6998 increase with probably slightly better performance.  The default value is 500.
6999
7000 @item max-flow-memory-locations
7001 Similar as @option{max-cselib-memory-locations} but for dataflow liveness.
7002 The default value is 100.
7003
7004 @item reorder-blocks-duplicate
7005 @itemx reorder-blocks-duplicate-feedback
7006
7007 Used by basic block reordering pass to decide whether to use unconditional
7008 branch or duplicate the code on its destination.  Code is duplicated when its
7009 estimated size is smaller than this value multiplied by the estimated size of
7010 unconditional jump in the hot spots of the program.
7011
7012 The @option{reorder-block-duplicate-feedback} is used only when profile
7013 feedback is available and may be set to higher values than
7014 @option{reorder-block-duplicate} since information about the hot spots is more
7015 accurate.
7016
7017 @item max-sched-ready-insns
7018 The maximum number of instructions ready to be issued the scheduler should
7019 consider at any given time during the first scheduling pass.  Increasing
7020 values mean more thorough searches, making the compilation time increase
7021 with probably little benefit.  The default value is 100.
7022
7023 @item max-sched-region-blocks
7024 The maximum number of blocks in a region to be considered for
7025 interblock scheduling.  The default value is 10.
7026
7027 @item max-sched-region-insns
7028 The maximum number of insns in a region to be considered for
7029 interblock scheduling.  The default value is 100.
7030
7031 @item min-spec-prob
7032 The minimum probability (in percents) of reaching a source block
7033 for interblock speculative scheduling.  The default value is 40.
7034
7035 @item max-sched-extend-regions-iters
7036 The maximum number of iterations through CFG to extend regions.
7037 0 - disable region extension,
7038 N - do at most N iterations.
7039 The default value is 0.
7040
7041 @item max-sched-insn-conflict-delay
7042 The maximum conflict delay for an insn to be considered for speculative motion.
7043 The default value is 3.
7044
7045 @item sched-spec-prob-cutoff
7046 The minimal probability of speculation success (in percents), so that
7047 speculative insn will be scheduled.
7048 The default value is 40.
7049
7050 @item max-last-value-rtl
7051
7052 The maximum size measured as number of RTLs that can be recorded in an expression
7053 in combiner for a pseudo register as last known value of that register.  The default
7054 is 10000.
7055
7056 @item integer-share-limit
7057 Small integer constants can use a shared data structure, reducing the
7058 compiler's memory usage and increasing its speed.  This sets the maximum
7059 value of a shared integer constant's.  The default value is 256.
7060
7061 @item min-virtual-mappings
7062 Specifies the minimum number of virtual mappings in the incremental
7063 SSA updater that should be registered to trigger the virtual mappings
7064 heuristic defined by virtual-mappings-ratio.  The default value is
7065 100.
7066
7067 @item virtual-mappings-ratio
7068 If the number of virtual mappings is virtual-mappings-ratio bigger
7069 than the number of virtual symbols to be updated, then the incremental
7070 SSA updater switches to a full update for those symbols.  The default
7071 ratio is 3.
7072
7073 @item ssp-buffer-size
7074 The minimum size of buffers (i.e. arrays) that will receive stack smashing
7075 protection when @option{-fstack-protection} is used.
7076
7077 @item max-jump-thread-duplication-stmts
7078 Maximum number of statements allowed in a block that needs to be
7079 duplicated when threading jumps.
7080
7081 @item max-fields-for-field-sensitive
7082 Maximum number of fields in a structure we will treat in
7083 a field sensitive manner during pointer analysis.
7084
7085 @item prefetch-latency
7086 Estimate on average number of instructions that are executed before
7087 prefetch finishes.  The distance we prefetch ahead is proportional
7088 to this constant.  Increasing this number may also lead to less
7089 streams being prefetched (see @option{simultaneous-prefetches}).
7090
7091 @item simultaneous-prefetches
7092 Maximum number of prefetches that can run at the same time.
7093
7094 @item l1-cache-line-size
7095 The size of cache line in L1 cache, in bytes.
7096
7097 @item l1-cache-size
7098 The size of L1 cache, in kilobytes.
7099
7100 @item l2-cache-size
7101 The size of L2 cache, in kilobytes.
7102
7103 @item use-canonical-types
7104 Whether the compiler should use the ``canonical'' type system.  By
7105 default, this should always be 1, which uses a more efficient internal
7106 mechanism for comparing types in C++ and Objective-C++.  However, if
7107 bugs in the canonical type system are causing compilation failures,
7108 set this value to 0 to disable canonical types.
7109
7110 @end table
7111 @end table
7112
7113 @node Preprocessor Options
7114 @section Options Controlling the Preprocessor
7115 @cindex preprocessor options
7116 @cindex options, preprocessor
7117
7118 These options control the C preprocessor, which is run on each C source
7119 file before actual compilation.
7120
7121 If you use the @option{-E} option, nothing is done except preprocessing.
7122 Some of these options make sense only together with @option{-E} because
7123 they cause the preprocessor output to be unsuitable for actual
7124 compilation.
7125
7126 @table @gcctabopt
7127 @opindex Wp
7128 You can use @option{-Wp,@var{option}} to bypass the compiler driver
7129 and pass @var{option} directly through to the preprocessor.  If
7130 @var{option} contains commas, it is split into multiple options at the
7131 commas.  However, many options are modified, translated or interpreted
7132 by the compiler driver before being passed to the preprocessor, and
7133 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
7134 interface is undocumented and subject to change, so whenever possible
7135 you should avoid using @option{-Wp} and let the driver handle the
7136 options instead.
7137
7138 @item -Xpreprocessor @var{option}
7139 @opindex preprocessor
7140 Pass @var{option} as an option to the preprocessor.  You can use this to
7141 supply system-specific preprocessor options which GCC does not know how to
7142 recognize.
7143
7144 If you want to pass an option that takes an argument, you must use
7145 @option{-Xpreprocessor} twice, once for the option and once for the argument.
7146 @end table
7147
7148 @include cppopts.texi
7149
7150 @node Assembler Options
7151 @section Passing Options to the Assembler
7152
7153 @c prevent bad page break with this line
7154 You can pass options to the assembler.
7155
7156 @table @gcctabopt
7157 @item -Wa,@var{option}
7158 @opindex Wa
7159 Pass @var{option} as an option to the assembler.  If @var{option}
7160 contains commas, it is split into multiple options at the commas.
7161
7162 @item -Xassembler @var{option}
7163 @opindex Xassembler
7164 Pass @var{option} as an option to the assembler.  You can use this to
7165 supply system-specific assembler options which GCC does not know how to
7166 recognize.
7167
7168 If you want to pass an option that takes an argument, you must use
7169 @option{-Xassembler} twice, once for the option and once for the argument.
7170
7171 @end table
7172
7173 @node Link Options
7174 @section Options for Linking
7175 @cindex link options
7176 @cindex options, linking
7177
7178 These options come into play when the compiler links object files into
7179 an executable output file.  They are meaningless if the compiler is
7180 not doing a link step.
7181
7182 @table @gcctabopt
7183 @cindex file names
7184 @item @var{object-file-name}
7185 A file name that does not end in a special recognized suffix is
7186 considered to name an object file or library.  (Object files are
7187 distinguished from libraries by the linker according to the file
7188 contents.)  If linking is done, these object files are used as input
7189 to the linker.
7190
7191 @item -c
7192 @itemx -S
7193 @itemx -E
7194 @opindex c
7195 @opindex S
7196 @opindex E
7197 If any of these options is used, then the linker is not run, and
7198 object file names should not be used as arguments.  @xref{Overall
7199 Options}.
7200
7201 @cindex Libraries
7202 @item -l@var{library}
7203 @itemx -l @var{library}
7204 @opindex l
7205 Search the library named @var{library} when linking.  (The second
7206 alternative with the library as a separate argument is only for
7207 POSIX compliance and is not recommended.)
7208
7209 It makes a difference where in the command you write this option; the
7210 linker searches and processes libraries and object files in the order they
7211 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
7212 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
7213 to functions in @samp{z}, those functions may not be loaded.
7214
7215 The linker searches a standard list of directories for the library,
7216 which is actually a file named @file{lib@var{library}.a}.  The linker
7217 then uses this file as if it had been specified precisely by name.
7218
7219 The directories searched include several standard system directories
7220 plus any that you specify with @option{-L}.
7221
7222 Normally the files found this way are library files---archive files
7223 whose members are object files.  The linker handles an archive file by
7224 scanning through it for members which define symbols that have so far
7225 been referenced but not defined.  But if the file that is found is an
7226 ordinary object file, it is linked in the usual fashion.  The only
7227 difference between using an @option{-l} option and specifying a file name
7228 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
7229 and searches several directories.
7230
7231 @item -lobjc
7232 @opindex lobjc
7233 You need this special case of the @option{-l} option in order to
7234 link an Objective-C or Objective-C++ program.
7235
7236 @item -nostartfiles
7237 @opindex nostartfiles
7238 Do not use the standard system startup files when linking.
7239 The standard system libraries are used normally, unless @option{-nostdlib}
7240 or @option{-nodefaultlibs} is used.
7241
7242 @item -nodefaultlibs
7243 @opindex nodefaultlibs
7244 Do not use the standard system libraries when linking.
7245 Only the libraries you specify will be passed to the linker.
7246 The standard startup files are used normally, unless @option{-nostartfiles}
7247 is used.  The compiler may generate calls to @code{memcmp},
7248 @code{memset}, @code{memcpy} and @code{memmove}.
7249 These entries are usually resolved by entries in
7250 libc.  These entry points should be supplied through some other
7251 mechanism when this option is specified.
7252
7253 @item -nostdlib
7254 @opindex nostdlib
7255 Do not use the standard system startup files or libraries when linking.
7256 No startup files and only the libraries you specify will be passed to
7257 the linker.  The compiler may generate calls to @code{memcmp}, @code{memset},
7258 @code{memcpy} and @code{memmove}.
7259 These entries are usually resolved by entries in
7260 libc.  These entry points should be supplied through some other
7261 mechanism when this option is specified.
7262
7263 @cindex @option{-lgcc}, use with @option{-nostdlib}
7264 @cindex @option{-nostdlib} and unresolved references
7265 @cindex unresolved references and @option{-nostdlib}
7266 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
7267 @cindex @option{-nodefaultlibs} and unresolved references
7268 @cindex unresolved references and @option{-nodefaultlibs}
7269 One of the standard libraries bypassed by @option{-nostdlib} and
7270 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
7271 that GCC uses to overcome shortcomings of particular machines, or special
7272 needs for some languages.
7273 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
7274 Collection (GCC) Internals},
7275 for more discussion of @file{libgcc.a}.)
7276 In most cases, you need @file{libgcc.a} even when you want to avoid
7277 other standard libraries.  In other words, when you specify @option{-nostdlib}
7278 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
7279 This ensures that you have no unresolved references to internal GCC
7280 library subroutines.  (For example, @samp{__main}, used to ensure C++
7281 constructors will be called; @pxref{Collect2,,@code{collect2}, gccint,
7282 GNU Compiler Collection (GCC) Internals}.)
7283
7284 @item -pie
7285 @opindex pie
7286 Produce a position independent executable on targets which support it.
7287 For predictable results, you must also specify the same set of options
7288 that were used to generate code (@option{-fpie}, @option{-fPIE},
7289 or model suboptions) when you specify this option.
7290
7291 @item -rdynamic
7292 @opindex rdynamic
7293 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
7294 that support it. This instructs the linker to add all symbols, not
7295 only used ones, to the dynamic symbol table. This option is needed
7296 for some uses of @code{dlopen} or to allow obtaining backtraces
7297 from within a program.
7298
7299 @item -s
7300 @opindex s
7301 Remove all symbol table and relocation information from the executable.
7302
7303 @item -static
7304 @opindex static
7305 On systems that support dynamic linking, this prevents linking with the shared
7306 libraries.  On other systems, this option has no effect.
7307
7308 @item -shared
7309 @opindex shared
7310 Produce a shared object which can then be linked with other objects to
7311 form an executable.  Not all systems support this option.  For predictable
7312 results, you must also specify the same set of options that were used to
7313 generate code (@option{-fpic}, @option{-fPIC}, or model suboptions)
7314 when you specify this option.@footnote{On some systems, @samp{gcc -shared}
7315 needs to build supplementary stub code for constructors to work.  On
7316 multi-libbed systems, @samp{gcc -shared} must select the correct support
7317 libraries to link against.  Failing to supply the correct flags may lead
7318 to subtle defects.  Supplying them in cases where they are not necessary
7319 is innocuous.}
7320
7321 @item -shared-libgcc
7322 @itemx -static-libgcc
7323 @opindex shared-libgcc
7324 @opindex static-libgcc
7325 On systems that provide @file{libgcc} as a shared library, these options
7326 force the use of either the shared or static version respectively.
7327 If no shared version of @file{libgcc} was built when the compiler was
7328 configured, these options have no effect.
7329
7330 There are several situations in which an application should use the
7331 shared @file{libgcc} instead of the static version.  The most common
7332 of these is when the application wishes to throw and catch exceptions
7333 across different shared libraries.  In that case, each of the libraries
7334 as well as the application itself should use the shared @file{libgcc}.
7335
7336 Therefore, the G++ and GCJ drivers automatically add
7337 @option{-shared-libgcc} whenever you build a shared library or a main
7338 executable, because C++ and Java programs typically use exceptions, so
7339 this is the right thing to do.
7340
7341 If, instead, you use the GCC driver to create shared libraries, you may
7342 find that they will not always be linked with the shared @file{libgcc}.
7343 If GCC finds, at its configuration time, that you have a non-GNU linker
7344 or a GNU linker that does not support option @option{--eh-frame-hdr},
7345 it will link the shared version of @file{libgcc} into shared libraries
7346 by default.  Otherwise, it will take advantage of the linker and optimize
7347 away the linking with the shared version of @file{libgcc}, linking with
7348 the static version of libgcc by default.  This allows exceptions to
7349 propagate through such shared libraries, without incurring relocation
7350 costs at library load time.
7351
7352 However, if a library or main executable is supposed to throw or catch
7353 exceptions, you must link it using the G++ or GCJ driver, as appropriate
7354 for the languages used in the program, or using the option
7355 @option{-shared-libgcc}, such that it is linked with the shared
7356 @file{libgcc}.
7357
7358 @item -symbolic
7359 @opindex symbolic
7360 Bind references to global symbols when building a shared object.  Warn
7361 about any unresolved references (unless overridden by the link editor
7362 option @samp{-Xlinker -z -Xlinker defs}).  Only a few systems support
7363 this option.
7364
7365 @item -Xlinker @var{option}
7366 @opindex Xlinker
7367 Pass @var{option} as an option to the linker.  You can use this to
7368 supply system-specific linker options which GCC does not know how to
7369 recognize.
7370
7371 If you want to pass an option that takes an argument, you must use
7372 @option{-Xlinker} twice, once for the option and once for the argument.
7373 For example, to pass @option{-assert definitions}, you must write
7374 @samp{-Xlinker -assert -Xlinker definitions}.  It does not work to write
7375 @option{-Xlinker "-assert definitions"}, because this passes the entire
7376 string as a single argument, which is not what the linker expects.
7377
7378 @item -Wl,@var{option}
7379 @opindex Wl
7380 Pass @var{option} as an option to the linker.  If @var{option} contains
7381 commas, it is split into multiple options at the commas.
7382
7383 @item -u @var{symbol}
7384 @opindex u
7385 Pretend the symbol @var{symbol} is undefined, to force linking of
7386 library modules to define it.  You can use @option{-u} multiple times with
7387 different symbols to force loading of additional library modules.
7388 @end table
7389
7390 @node Directory Options
7391 @section Options for Directory Search
7392 @cindex directory options
7393 @cindex options, directory search
7394 @cindex search path
7395
7396 These options specify directories to search for header files, for
7397 libraries and for parts of the compiler:
7398
7399 @table @gcctabopt
7400 @item -I@var{dir}
7401 @opindex I
7402 Add the directory @var{dir} to the head of the list of directories to be
7403 searched for header files.  This can be used to override a system header
7404 file, substituting your own version, since these directories are
7405 searched before the system header file directories.  However, you should
7406 not use this option to add directories that contain vendor-supplied
7407 system header files (use @option{-isystem} for that).  If you use more than
7408 one @option{-I} option, the directories are scanned in left-to-right
7409 order; the standard system directories come after.
7410
7411 If a standard system include directory, or a directory specified with
7412 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
7413 option will be ignored.  The directory will still be searched but as a
7414 system directory at its normal position in the system include chain.
7415 This is to ensure that GCC's procedure to fix buggy system headers and
7416 the ordering for the include_next directive are not inadvertently changed.
7417 If you really need to change the search order for system directories,
7418 use the @option{-nostdinc} and/or @option{-isystem} options.
7419
7420 @item -iquote@var{dir}
7421 @opindex iquote
7422 Add the directory @var{dir} to the head of the list of directories to
7423 be searched for header files only for the case of @samp{#include
7424 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
7425 otherwise just like @option{-I}.
7426
7427 @item -L@var{dir}
7428 @opindex L
7429 Add directory @var{dir} to the list of directories to be searched
7430 for @option{-l}.
7431
7432 @item -B@var{prefix}
7433 @opindex B
7434 This option specifies where to find the executables, libraries,
7435 include files, and data files of the compiler itself.
7436
7437 The compiler driver program runs one or more of the subprograms
7438 @file{cpp}, @file{cc1}, @file{as} and @file{ld}.  It tries
7439 @var{prefix} as a prefix for each program it tries to run, both with and
7440 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
7441
7442 For each subprogram to be run, the compiler driver first tries the
7443 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
7444 was not specified, the driver tries two standard prefixes, which are
7445 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
7446 those results in a file name that is found, the unmodified program
7447 name is searched for using the directories specified in your
7448 @env{PATH} environment variable.
7449
7450 The compiler will check to see if the path provided by the @option{-B}
7451 refers to a directory, and if necessary it will add a directory
7452 separator character at the end of the path.
7453
7454 @option{-B} prefixes that effectively specify directory names also apply
7455 to libraries in the linker, because the compiler translates these
7456 options into @option{-L} options for the linker.  They also apply to
7457 includes files in the preprocessor, because the compiler translates these
7458 options into @option{-isystem} options for the preprocessor.  In this case,
7459 the compiler appends @samp{include} to the prefix.
7460
7461 The run-time support file @file{libgcc.a} can also be searched for using
7462 the @option{-B} prefix, if needed.  If it is not found there, the two
7463 standard prefixes above are tried, and that is all.  The file is left
7464 out of the link if it is not found by those means.
7465
7466 Another way to specify a prefix much like the @option{-B} prefix is to use
7467 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
7468 Variables}.
7469
7470 As a special kludge, if the path provided by @option{-B} is
7471 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
7472 9, then it will be replaced by @file{[dir/]include}.  This is to help
7473 with boot-strapping the compiler.
7474
7475 @item -specs=@var{file}
7476 @opindex specs
7477 Process @var{file} after the compiler reads in the standard @file{specs}
7478 file, in order to override the defaults that the @file{gcc} driver
7479 program uses when determining what switches to pass to @file{cc1},
7480 @file{cc1plus}, @file{as}, @file{ld}, etc.  More than one
7481 @option{-specs=@var{file}} can be specified on the command line, and they
7482 are processed in order, from left to right.
7483
7484 @item --sysroot=@var{dir}
7485 @opindex sysroot
7486 Use @var{dir} as the logical root directory for headers and libraries.
7487 For example, if the compiler would normally search for headers in
7488 @file{/usr/include} and libraries in @file{/usr/lib}, it will instead
7489 search @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
7490
7491 If you use both this option and the @option{-isysroot} option, then
7492 the @option{--sysroot} option will apply to libraries, but the
7493 @option{-isysroot} option will apply to header files.
7494
7495 The GNU linker (beginning with version 2.16) has the necessary support
7496 for this option.  If your linker does not support this option, the
7497 header file aspect of @option{--sysroot} will still work, but the
7498 library aspect will not.
7499
7500 @item -I-
7501 @opindex I-
7502 This option has been deprecated.  Please use @option{-iquote} instead for
7503 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
7504 Any directories you specify with @option{-I} options before the @option{-I-}
7505 option are searched only for the case of @samp{#include "@var{file}"};
7506 they are not searched for @samp{#include <@var{file}>}.
7507
7508 If additional directories are specified with @option{-I} options after
7509 the @option{-I-}, these directories are searched for all @samp{#include}
7510 directives.  (Ordinarily @emph{all} @option{-I} directories are used
7511 this way.)
7512
7513 In addition, the @option{-I-} option inhibits the use of the current
7514 directory (where the current input file came from) as the first search
7515 directory for @samp{#include "@var{file}"}.  There is no way to
7516 override this effect of @option{-I-}.  With @option{-I.} you can specify
7517 searching the directory which was current when the compiler was
7518 invoked.  That is not exactly the same as what the preprocessor does
7519 by default, but it is often satisfactory.
7520
7521 @option{-I-} does not inhibit the use of the standard system directories
7522 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
7523 independent.
7524 @end table
7525
7526 @c man end
7527
7528 @node Spec Files
7529 @section Specifying subprocesses and the switches to pass to them
7530 @cindex Spec Files
7531
7532 @command{gcc} is a driver program.  It performs its job by invoking a
7533 sequence of other programs to do the work of compiling, assembling and
7534 linking.  GCC interprets its command-line parameters and uses these to
7535 deduce which programs it should invoke, and which command-line options
7536 it ought to place on their command lines.  This behavior is controlled
7537 by @dfn{spec strings}.  In most cases there is one spec string for each
7538 program that GCC can invoke, but a few programs have multiple spec
7539 strings to control their behavior.  The spec strings built into GCC can
7540 be overridden by using the @option{-specs=} command-line switch to specify
7541 a spec file.
7542
7543 @dfn{Spec files} are plaintext files that are used to construct spec
7544 strings.  They consist of a sequence of directives separated by blank
7545 lines.  The type of directive is determined by the first non-whitespace
7546 character on the line and it can be one of the following:
7547
7548 @table @code
7549 @item %@var{command}
7550 Issues a @var{command} to the spec file processor.  The commands that can
7551 appear here are:
7552
7553 @table @code
7554 @item %include <@var{file}>
7555 @cindex %include
7556 Search for @var{file} and insert its text at the current point in the
7557 specs file.
7558
7559 @item %include_noerr <@var{file}>
7560 @cindex %include_noerr
7561 Just like @samp{%include}, but do not generate an error message if the include
7562 file cannot be found.
7563
7564 @item %rename @var{old_name} @var{new_name}
7565 @cindex %rename
7566 Rename the spec string @var{old_name} to @var{new_name}.
7567
7568 @end table
7569
7570 @item *[@var{spec_name}]:
7571 This tells the compiler to create, override or delete the named spec
7572 string.  All lines after this directive up to the next directive or
7573 blank line are considered to be the text for the spec string.  If this
7574 results in an empty string then the spec will be deleted.  (Or, if the
7575 spec did not exist, then nothing will happened.)  Otherwise, if the spec
7576 does not currently exist a new spec will be created.  If the spec does
7577 exist then its contents will be overridden by the text of this
7578 directive, unless the first character of that text is the @samp{+}
7579 character, in which case the text will be appended to the spec.
7580
7581 @item [@var{suffix}]:
7582 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
7583 and up to the next directive or blank line are considered to make up the
7584 spec string for the indicated suffix.  When the compiler encounters an
7585 input file with the named suffix, it will processes the spec string in
7586 order to work out how to compile that file.  For example:
7587
7588 @smallexample
7589 .ZZ:
7590 z-compile -input %i
7591 @end smallexample
7592
7593 This says that any input file whose name ends in @samp{.ZZ} should be
7594 passed to the program @samp{z-compile}, which should be invoked with the
7595 command-line switch @option{-input} and with the result of performing the
7596 @samp{%i} substitution.  (See below.)
7597
7598 As an alternative to providing a spec string, the text that follows a
7599 suffix directive can be one of the following:
7600
7601 @table @code
7602 @item @@@var{language}
7603 This says that the suffix is an alias for a known @var{language}.  This is
7604 similar to using the @option{-x} command-line switch to GCC to specify a
7605 language explicitly.  For example:
7606
7607 @smallexample
7608 .ZZ:
7609 @@c++
7610 @end smallexample
7611
7612 Says that .ZZ files are, in fact, C++ source files.
7613
7614 @item #@var{name}
7615 This causes an error messages saying:
7616
7617 @smallexample
7618 @var{name} compiler not installed on this system.
7619 @end smallexample
7620 @end table
7621
7622 GCC already has an extensive list of suffixes built into it.
7623 This directive will add an entry to the end of the list of suffixes, but
7624 since the list is searched from the end backwards, it is effectively
7625 possible to override earlier entries using this technique.
7626
7627 @end table
7628
7629 GCC has the following spec strings built into it.  Spec files can
7630 override these strings or create their own.  Note that individual
7631 targets can also add their own spec strings to this list.
7632
7633 @smallexample
7634 asm          Options to pass to the assembler
7635 asm_final    Options to pass to the assembler post-processor
7636 cpp          Options to pass to the C preprocessor
7637 cc1          Options to pass to the C compiler
7638 cc1plus      Options to pass to the C++ compiler
7639 endfile      Object files to include at the end of the link
7640 link         Options to pass to the linker
7641 lib          Libraries to include on the command line to the linker
7642 libgcc       Decides which GCC support library to pass to the linker
7643 linker       Sets the name of the linker
7644 predefines   Defines to be passed to the C preprocessor
7645 signed_char  Defines to pass to CPP to say whether @code{char} is signed
7646              by default
7647 startfile    Object files to include at the start of the link
7648 @end smallexample
7649
7650 Here is a small example of a spec file:
7651
7652 @smallexample
7653 %rename lib                 old_lib
7654
7655 *lib:
7656 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
7657 @end smallexample
7658
7659 This example renames the spec called @samp{lib} to @samp{old_lib} and
7660 then overrides the previous definition of @samp{lib} with a new one.
7661 The new definition adds in some extra command-line options before
7662 including the text of the old definition.
7663
7664 @dfn{Spec strings} are a list of command-line options to be passed to their
7665 corresponding program.  In addition, the spec strings can contain
7666 @samp{%}-prefixed sequences to substitute variable text or to
7667 conditionally insert text into the command line.  Using these constructs
7668 it is possible to generate quite complex command lines.
7669
7670 Here is a table of all defined @samp{%}-sequences for spec
7671 strings.  Note that spaces are not generated automatically around the
7672 results of expanding these sequences.  Therefore you can concatenate them
7673 together or combine them with constant text in a single argument.
7674
7675 @table @code
7676 @item %%
7677 Substitute one @samp{%} into the program name or argument.
7678
7679 @item %i
7680 Substitute the name of the input file being processed.
7681
7682 @item %b
7683 Substitute the basename of the input file being processed.
7684 This is the substring up to (and not including) the last period
7685 and not including the directory.
7686
7687 @item %B
7688 This is the same as @samp{%b}, but include the file suffix (text after
7689 the last period).
7690
7691 @item %d
7692 Marks the argument containing or following the @samp{%d} as a
7693 temporary file name, so that that file will be deleted if GCC exits
7694 successfully.  Unlike @samp{%g}, this contributes no text to the
7695 argument.
7696
7697 @item %g@var{suffix}
7698 Substitute a file name that has suffix @var{suffix} and is chosen
7699 once per compilation, and mark the argument in the same way as
7700 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
7701 name is now chosen in a way that is hard to predict even when previously
7702 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
7703 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
7704 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
7705 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
7706 was simply substituted with a file name chosen once per compilation,
7707 without regard to any appended suffix (which was therefore treated
7708 just like ordinary text), making such attacks more likely to succeed.
7709
7710 @item %u@var{suffix}
7711 Like @samp{%g}, but generates a new temporary file name even if
7712 @samp{%u@var{suffix}} was already seen.
7713
7714 @item %U@var{suffix}
7715 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
7716 new one if there is no such last file name.  In the absence of any
7717 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
7718 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
7719 would involve the generation of two distinct file names, one
7720 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
7721 simply substituted with a file name chosen for the previous @samp{%u},
7722 without regard to any appended suffix.
7723
7724 @item %j@var{suffix}
7725 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
7726 writable, and if save-temps is off; otherwise, substitute the name
7727 of a temporary file, just like @samp{%u}.  This temporary file is not
7728 meant for communication between processes, but rather as a junk
7729 disposal mechanism.
7730
7731 @item %|@var{suffix}
7732 @itemx %m@var{suffix}
7733 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
7734 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
7735 all.  These are the two most common ways to instruct a program that it
7736 should read from standard input or write to standard output.  If you
7737 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
7738 construct: see for example @file{f/lang-specs.h}.
7739
7740 @item %.@var{SUFFIX}
7741 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
7742 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
7743 terminated by the next space or %.
7744
7745 @item %w
7746 Marks the argument containing or following the @samp{%w} as the
7747 designated output file of this compilation.  This puts the argument
7748 into the sequence of arguments that @samp{%o} will substitute later.
7749
7750 @item %o
7751 Substitutes the names of all the output files, with spaces
7752 automatically placed around them.  You should write spaces
7753 around the @samp{%o} as well or the results are undefined.
7754 @samp{%o} is for use in the specs for running the linker.
7755 Input files whose names have no recognized suffix are not compiled
7756 at all, but they are included among the output files, so they will
7757 be linked.
7758
7759 @item %O
7760 Substitutes the suffix for object files.  Note that this is
7761 handled specially when it immediately follows @samp{%g, %u, or %U},
7762 because of the need for those to form complete file names.  The
7763 handling is such that @samp{%O} is treated exactly as if it had already
7764 been substituted, except that @samp{%g, %u, and %U} do not currently
7765 support additional @var{suffix} characters following @samp{%O} as they would
7766 following, for example, @samp{.o}.
7767
7768 @item %p
7769 Substitutes the standard macro predefinitions for the
7770 current target machine.  Use this when running @code{cpp}.
7771
7772 @item %P
7773 Like @samp{%p}, but puts @samp{__} before and after the name of each
7774 predefined macro, except for macros that start with @samp{__} or with
7775 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
7776 C@.
7777
7778 @item %I
7779 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
7780 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
7781 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
7782 and @option{-imultilib} as necessary.
7783
7784 @item %s
7785 Current argument is the name of a library or startup file of some sort.
7786 Search for that file in a standard list of directories and substitute
7787 the full name found.
7788
7789 @item %e@var{str}
7790 Print @var{str} as an error message.  @var{str} is terminated by a newline.
7791 Use this when inconsistent options are detected.
7792
7793 @item %(@var{name})
7794 Substitute the contents of spec string @var{name} at this point.
7795
7796 @item %[@var{name}]
7797 Like @samp{%(@dots{})} but put @samp{__} around @option{-D} arguments.
7798
7799 @item %x@{@var{option}@}
7800 Accumulate an option for @samp{%X}.
7801
7802 @item %X
7803 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
7804 spec string.
7805
7806 @item %Y
7807 Output the accumulated assembler options specified by @option{-Wa}.
7808
7809 @item %Z
7810 Output the accumulated preprocessor options specified by @option{-Wp}.
7811
7812 @item %a
7813 Process the @code{asm} spec.  This is used to compute the
7814 switches to be passed to the assembler.
7815
7816 @item %A
7817 Process the @code{asm_final} spec.  This is a spec string for
7818 passing switches to an assembler post-processor, if such a program is
7819 needed.
7820
7821 @item %l
7822 Process the @code{link} spec.  This is the spec for computing the
7823 command line passed to the linker.  Typically it will make use of the
7824 @samp{%L %G %S %D and %E} sequences.
7825
7826 @item %D
7827 Dump out a @option{-L} option for each directory that GCC believes might
7828 contain startup files.  If the target supports multilibs then the
7829 current multilib directory will be prepended to each of these paths.
7830
7831 @item %L
7832 Process the @code{lib} spec.  This is a spec string for deciding which
7833 libraries should be included on the command line to the linker.
7834
7835 @item %G
7836 Process the @code{libgcc} spec.  This is a spec string for deciding
7837 which GCC support library should be included on the command line to the linker.
7838
7839 @item %S
7840 Process the @code{startfile} spec.  This is a spec for deciding which
7841 object files should be the first ones passed to the linker.  Typically
7842 this might be a file named @file{crt0.o}.
7843
7844 @item %E
7845 Process the @code{endfile} spec.  This is a spec string that specifies
7846 the last object files that will be passed to the linker.
7847
7848 @item %C
7849 Process the @code{cpp} spec.  This is used to construct the arguments
7850 to be passed to the C preprocessor.
7851
7852 @item %1
7853 Process the @code{cc1} spec.  This is used to construct the options to be
7854 passed to the actual C compiler (@samp{cc1}).
7855
7856 @item %2
7857 Process the @code{cc1plus} spec.  This is used to construct the options to be
7858 passed to the actual C++ compiler (@samp{cc1plus}).
7859
7860 @item %*
7861 Substitute the variable part of a matched option.  See below.
7862 Note that each comma in the substituted string is replaced by
7863 a single space.
7864
7865 @item %<@code{S}
7866 Remove all occurrences of @code{-S} from the command line.  Note---this
7867 command is position dependent.  @samp{%} commands in the spec string
7868 before this one will see @code{-S}, @samp{%} commands in the spec string
7869 after this one will not.
7870
7871 @item %:@var{function}(@var{args})
7872 Call the named function @var{function}, passing it @var{args}.
7873 @var{args} is first processed as a nested spec string, then split
7874 into an argument vector in the usual fashion.  The function returns
7875 a string which is processed as if it had appeared literally as part
7876 of the current spec.
7877
7878 The following built-in spec functions are provided:
7879
7880 @table @code
7881 @item @code{getenv}
7882 The @code{getenv} spec function takes two arguments: an environment
7883 variable name and a string.  If the environment variable is not
7884 defined, a fatal error is issued.  Otherwise, the return value is the
7885 value of the environment variable concatenated with the string.  For
7886 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
7887
7888 @smallexample
7889 %:getenv(TOPDIR /include)
7890 @end smallexample
7891
7892 expands to @file{/path/to/top/include}.
7893
7894 @item @code{if-exists}
7895 The @code{if-exists} spec function takes one argument, an absolute
7896 pathname to a file.  If the file exists, @code{if-exists} returns the
7897 pathname.  Here is a small example of its usage:
7898
7899 @smallexample
7900 *startfile:
7901 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
7902 @end smallexample
7903
7904 @item @code{if-exists-else}
7905 The @code{if-exists-else} spec function is similar to the @code{if-exists}
7906 spec function, except that it takes two arguments.  The first argument is
7907 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
7908 returns the pathname.  If it does not exist, it returns the second argument.
7909 This way, @code{if-exists-else} can be used to select one file or another,
7910 based on the existence of the first.  Here is a small example of its usage:
7911
7912 @smallexample
7913 *startfile:
7914 crt0%O%s %:if-exists(crti%O%s) \
7915 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
7916 @end smallexample
7917
7918 @item @code{replace-outfile}
7919 The @code{replace-outfile} spec function takes two arguments.  It looks for the
7920 first argument in the outfiles array and replaces it with the second argument.  Here
7921 is a small example of its usage:
7922
7923 @smallexample
7924 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
7925 @end smallexample
7926
7927 @item @code{print-asm-header}
7928 The @code{print-asm-header} function takes no arguments and simply
7929 prints a banner like:
7930
7931 @smallexample
7932 Assembler options
7933 =================
7934
7935 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
7936 @end smallexample
7937
7938 It is used to separate compiler options from assembler options
7939 in the @option{--target-help} output.
7940 @end table
7941
7942 @item %@{@code{S}@}
7943 Substitutes the @code{-S} switch, if that switch was given to GCC@.
7944 If that switch was not specified, this substitutes nothing.  Note that
7945 the leading dash is omitted when specifying this option, and it is
7946 automatically inserted if the substitution is performed.  Thus the spec
7947 string @samp{%@{foo@}} would match the command-line option @option{-foo}
7948 and would output the command line option @option{-foo}.
7949
7950 @item %W@{@code{S}@}
7951 Like %@{@code{S}@} but mark last argument supplied within as a file to be
7952 deleted on failure.
7953
7954 @item %@{@code{S}*@}
7955 Substitutes all the switches specified to GCC whose names start
7956 with @code{-S}, but which also take an argument.  This is used for
7957 switches like @option{-o}, @option{-D}, @option{-I}, etc.
7958 GCC considers @option{-o foo} as being
7959 one switch whose names starts with @samp{o}.  %@{o*@} would substitute this
7960 text, including the space.  Thus two arguments would be generated.
7961
7962 @item %@{@code{S}*&@code{T}*@}
7963 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
7964 (the order of @code{S} and @code{T} in the spec is not significant).
7965 There can be any number of ampersand-separated variables; for each the
7966 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
7967
7968 @item %@{@code{S}:@code{X}@}
7969 Substitutes @code{X}, if the @samp{-S} switch was given to GCC@.
7970
7971 @item %@{!@code{S}:@code{X}@}
7972 Substitutes @code{X}, if the @samp{-S} switch was @emph{not} given to GCC@.
7973
7974 @item %@{@code{S}*:@code{X}@}
7975 Substitutes @code{X} if one or more switches whose names start with
7976 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
7977 once, no matter how many such switches appeared.  However, if @code{%*}
7978 appears somewhere in @code{X}, then @code{X} will be substituted once
7979 for each matching switch, with the @code{%*} replaced by the part of
7980 that switch that matched the @code{*}.
7981
7982 @item %@{.@code{S}:@code{X}@}
7983 Substitutes @code{X}, if processing a file with suffix @code{S}.
7984
7985 @item %@{!.@code{S}:@code{X}@}
7986 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
7987
7988 @item %@{,@code{S}:@code{X}@}
7989 Substitutes @code{X}, if processing a file for language @code{S}.
7990
7991 @item %@{!,@code{S}:@code{X}@}
7992 Substitutes @code{X}, if not processing a file for language @code{S}.
7993
7994 @item %@{@code{S}|@code{P}:@code{X}@}
7995 Substitutes @code{X} if either @code{-S} or @code{-P} was given to
7996 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
7997 @code{*} sequences as well, although they have a stronger binding than
7998 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
7999 alternatives must be starred, and only the first matching alternative
8000 is substituted.
8001
8002 For example, a spec string like this:
8003
8004 @smallexample
8005 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
8006 @end smallexample
8007
8008 will output the following command-line options from the following input
8009 command-line options:
8010
8011 @smallexample
8012 fred.c        -foo -baz
8013 jim.d         -bar -boggle
8014 -d fred.c     -foo -baz -boggle
8015 -d jim.d      -bar -baz -boggle
8016 @end smallexample
8017
8018 @item %@{S:X; T:Y; :D@}
8019
8020 If @code{S} was given to GCC, substitutes @code{X}; else if @code{T} was
8021 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
8022 be as many clauses as you need.  This may be combined with @code{.},
8023 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
8024
8025
8026 @end table
8027
8028 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
8029 construct may contain other nested @samp{%} constructs or spaces, or
8030 even newlines.  They are processed as usual, as described above.
8031 Trailing white space in @code{X} is ignored.  White space may also
8032 appear anywhere on the left side of the colon in these constructs,
8033 except between @code{.} or @code{*} and the corresponding word.
8034
8035 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
8036 handled specifically in these constructs.  If another value of
8037 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
8038 @option{-W} switch is found later in the command line, the earlier
8039 switch value is ignored, except with @{@code{S}*@} where @code{S} is
8040 just one letter, which passes all matching options.
8041
8042 The character @samp{|} at the beginning of the predicate text is used to
8043 indicate that a command should be piped to the following command, but
8044 only if @option{-pipe} is specified.
8045
8046 It is built into GCC which switches take arguments and which do not.
8047 (You might think it would be useful to generalize this to allow each
8048 compiler's spec to say which switches take arguments.  But this cannot
8049 be done in a consistent fashion.  GCC cannot even decide which input
8050 files have been specified without knowing which switches take arguments,
8051 and it must know which input files to compile in order to tell which
8052 compilers to run).
8053
8054 GCC also knows implicitly that arguments starting in @option{-l} are to be
8055 treated as compiler output files, and passed to the linker in their
8056 proper position among the other output files.
8057
8058 @c man begin OPTIONS
8059
8060 @node Target Options
8061 @section Specifying Target Machine and Compiler Version
8062 @cindex target options
8063 @cindex cross compiling
8064 @cindex specifying machine version
8065 @cindex specifying compiler version and target machine
8066 @cindex compiler version, specifying
8067 @cindex target machine, specifying
8068
8069 The usual way to run GCC is to run the executable called @file{gcc}, or
8070 @file{<machine>-gcc} when cross-compiling, or
8071 @file{<machine>-gcc-<version>} to run a version other than the one that
8072 was installed last.  Sometimes this is inconvenient, so GCC provides
8073 options that will switch to another cross-compiler or version.
8074
8075 @table @gcctabopt
8076 @item -b @var{machine}
8077 @opindex b
8078 The argument @var{machine} specifies the target machine for compilation.
8079
8080 The value to use for @var{machine} is the same as was specified as the
8081 machine type when configuring GCC as a cross-compiler.  For
8082 example, if a cross-compiler was configured with @samp{configure
8083 arm-elf}, meaning to compile for an arm processor with elf binaries,
8084 then you would specify @option{-b arm-elf} to run that cross compiler.
8085 Because there are other options beginning with @option{-b}, the
8086 configuration must contain a hyphen.
8087
8088 @item -V @var{version}
8089 @opindex V
8090 The argument @var{version} specifies which version of GCC to run.
8091 This is useful when multiple versions are installed.  For example,
8092 @var{version} might be @samp{4.0}, meaning to run GCC version 4.0.
8093 @end table
8094
8095 The @option{-V} and @option{-b} options work by running the
8096 @file{<machine>-gcc-<version>} executable, so there's no real reason to
8097 use them if you can just run that directly.
8098
8099 @node Submodel Options
8100 @section Hardware Models and Configurations
8101 @cindex submodel options
8102 @cindex specifying hardware config
8103 @cindex hardware models and configurations, specifying
8104 @cindex machine dependent options
8105
8106 Earlier we discussed the standard option @option{-b} which chooses among
8107 different installed compilers for completely different target
8108 machines, such as VAX vs.@: 68000 vs.@: 80386.
8109
8110 In addition, each of these target machine types can have its own
8111 special options, starting with @samp{-m}, to choose among various
8112 hardware models or configurations---for example, 68010 vs 68020,
8113 floating coprocessor or none.  A single installed version of the
8114 compiler can compile for any model or configuration, according to the
8115 options specified.
8116
8117 Some configurations of the compiler also support additional special
8118 options, usually for compatibility with other compilers on the same
8119 platform.
8120
8121 @c This list is ordered alphanumerically by subsection name.
8122 @c It should be the same order and spelling as these options are listed
8123 @c in Machine Dependent Options
8124
8125 @menu
8126 * ARC Options::
8127 * ARM Options::
8128 * AVR Options::
8129 * Blackfin Options::
8130 * CRIS Options::
8131 * CRX Options::
8132 * Darwin Options::
8133 * DEC Alpha Options::
8134 * DEC Alpha/VMS Options::
8135 * FRV Options::
8136 * GNU/Linux Options::
8137 * H8/300 Options::
8138 * HPPA Options::
8139 * i386 and x86-64 Options::
8140 * IA-64 Options::
8141 * M32C Options::
8142 * M32R/D Options::
8143 * M680x0 Options::
8144 * M68hc1x Options::
8145 * MCore Options::
8146 * MIPS Options::
8147 * MMIX Options::
8148 * MN10300 Options::
8149 * MT Options::
8150 * PDP-11 Options::
8151 * PowerPC Options::
8152 * RS/6000 and PowerPC Options::
8153 * S/390 and zSeries Options::
8154 * Score Options::
8155 * SH Options::
8156 * SPARC Options::
8157 * SPU Options::
8158 * System V Options::
8159 * TMS320C3x/C4x Options::
8160 * V850 Options::
8161 * VAX Options::
8162 * VxWorks Options::
8163 * x86-64 Options::
8164 * Xstormy16 Options::
8165 * Xtensa Options::
8166 * zSeries Options::
8167 @end menu
8168
8169 @node ARC Options
8170 @subsection ARC Options
8171 @cindex ARC Options
8172
8173 These options are defined for ARC implementations:
8174
8175 @table @gcctabopt
8176 @item -EL
8177 @opindex EL
8178 Compile code for little endian mode.  This is the default.
8179
8180 @item -EB
8181 @opindex EB
8182 Compile code for big endian mode.
8183
8184 @item -mmangle-cpu
8185 @opindex mmangle-cpu
8186 Prepend the name of the cpu to all public symbol names.
8187 In multiple-processor systems, there are many ARC variants with different
8188 instruction and register set characteristics.  This flag prevents code
8189 compiled for one cpu to be linked with code compiled for another.
8190 No facility exists for handling variants that are ``almost identical''.
8191 This is an all or nothing option.
8192
8193 @item -mcpu=@var{cpu}
8194 @opindex mcpu
8195 Compile code for ARC variant @var{cpu}.
8196 Which variants are supported depend on the configuration.
8197 All variants support @option{-mcpu=base}, this is the default.
8198
8199 @item -mtext=@var{text-section}
8200 @itemx -mdata=@var{data-section}
8201 @itemx -mrodata=@var{readonly-data-section}
8202 @opindex mtext
8203 @opindex mdata
8204 @opindex mrodata
8205 Put functions, data, and readonly data in @var{text-section},
8206 @var{data-section}, and @var{readonly-data-section} respectively
8207 by default.  This can be overridden with the @code{section} attribute.
8208 @xref{Variable Attributes}.
8209
8210 @end table
8211
8212 @node ARM Options
8213 @subsection ARM Options
8214 @cindex ARM options
8215
8216 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
8217 architectures:
8218
8219 @table @gcctabopt
8220 @item -mabi=@var{name}
8221 @opindex mabi
8222 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
8223 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
8224
8225 @item -mapcs-frame
8226 @opindex mapcs-frame
8227 Generate a stack frame that is compliant with the ARM Procedure Call
8228 Standard for all functions, even if this is not strictly necessary for
8229 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
8230 with this option will cause the stack frames not to be generated for
8231 leaf functions.  The default is @option{-mno-apcs-frame}.
8232
8233 @item -mapcs
8234 @opindex mapcs
8235 This is a synonym for @option{-mapcs-frame}.
8236
8237 @ignore
8238 @c not currently implemented
8239 @item -mapcs-stack-check
8240 @opindex mapcs-stack-check
8241 Generate code to check the amount of stack space available upon entry to
8242 every function (that actually uses some stack space).  If there is
8243 insufficient space available then either the function
8244 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} will be
8245 called, depending upon the amount of stack space required.  The run time
8246 system is required to provide these functions.  The default is
8247 @option{-mno-apcs-stack-check}, since this produces smaller code.
8248
8249 @c not currently implemented
8250 @item -mapcs-float
8251 @opindex mapcs-float
8252 Pass floating point arguments using the float point registers.  This is
8253 one of the variants of the APCS@.  This option is recommended if the
8254 target hardware has a floating point unit or if a lot of floating point
8255 arithmetic is going to be performed by the code.  The default is
8256 @option{-mno-apcs-float}, since integer only code is slightly increased in
8257 size if @option{-mapcs-float} is used.
8258
8259 @c not currently implemented
8260 @item -mapcs-reentrant
8261 @opindex mapcs-reentrant
8262 Generate reentrant, position independent code.  The default is
8263 @option{-mno-apcs-reentrant}.
8264 @end ignore
8265
8266 @item -mthumb-interwork
8267 @opindex mthumb-interwork
8268 Generate code which supports calling between the ARM and Thumb
8269 instruction sets.  Without this option the two instruction sets cannot
8270 be reliably used inside one program.  The default is
8271 @option{-mno-thumb-interwork}, since slightly larger code is generated
8272 when @option{-mthumb-interwork} is specified.
8273
8274 @item -mno-sched-prolog
8275 @opindex mno-sched-prolog
8276 Prevent the reordering of instructions in the function prolog, or the
8277 merging of those instruction with the instructions in the function's
8278 body.  This means that all functions will start with a recognizable set
8279 of instructions (or in fact one of a choice from a small set of
8280 different function prologues), and this information can be used to
8281 locate the start if functions inside an executable piece of code.  The
8282 default is @option{-msched-prolog}.
8283
8284 @item -mhard-float
8285 @opindex mhard-float
8286 Generate output containing floating point instructions.  This is the
8287 default.
8288
8289 @item -msoft-float
8290 @opindex msoft-float
8291 Generate output containing library calls for floating point.
8292 @strong{Warning:} the requisite libraries are not available for all ARM
8293 targets.  Normally the facilities of the machine's usual C compiler are
8294 used, but this cannot be done directly in cross-compilation.  You must make
8295 your own arrangements to provide suitable library functions for
8296 cross-compilation.
8297
8298 @option{-msoft-float} changes the calling convention in the output file;
8299 therefore, it is only useful if you compile @emph{all} of a program with
8300 this option.  In particular, you need to compile @file{libgcc.a}, the
8301 library that comes with GCC, with @option{-msoft-float} in order for
8302 this to work.
8303
8304 @item -mfloat-abi=@var{name}
8305 @opindex mfloat-abi
8306 Specifies which ABI to use for floating point values.  Permissible values
8307 are: @samp{soft}, @samp{softfp} and @samp{hard}.
8308
8309 @samp{soft} and @samp{hard} are equivalent to @option{-msoft-float}
8310 and @option{-mhard-float} respectively.  @samp{softfp} allows the generation
8311 of floating point instructions, but still uses the soft-float calling
8312 conventions.
8313
8314 @item -mlittle-endian
8315 @opindex mlittle-endian
8316 Generate code for a processor running in little-endian mode.  This is
8317 the default for all standard configurations.
8318
8319 @item -mbig-endian
8320 @opindex mbig-endian
8321 Generate code for a processor running in big-endian mode; the default is
8322 to compile code for a little-endian processor.
8323
8324 @item -mwords-little-endian
8325 @opindex mwords-little-endian
8326 This option only applies when generating code for big-endian processors.
8327 Generate code for a little-endian word order but a big-endian byte
8328 order.  That is, a byte order of the form @samp{32107654}.  Note: this
8329 option should only be used if you require compatibility with code for
8330 big-endian ARM processors generated by versions of the compiler prior to
8331 2.8.
8332
8333 @item -mcpu=@var{name}
8334 @opindex mcpu
8335 This specifies the name of the target ARM processor.  GCC uses this name
8336 to determine what kind of instructions it can emit when generating
8337 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
8338 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
8339 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
8340 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
8341 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
8342 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
8343 @samp{arm8}, @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
8344 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
8345 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
8346 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
8347 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
8348 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
8349 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
8350 @samp{arm1156t2-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
8351 @samp{cortex-a8}, @samp{cortex-r4}, @samp{cortex-m3},
8352 @samp{xscale}, @samp{iwmmxt}, @samp{ep9312}.
8353
8354 @itemx -mtune=@var{name}
8355 @opindex mtune
8356 This option is very similar to the @option{-mcpu=} option, except that
8357 instead of specifying the actual target processor type, and hence
8358 restricting which instructions can be used, it specifies that GCC should
8359 tune the performance of the code as if the target were of the type
8360 specified in this option, but still choosing the instructions that it
8361 will generate based on the cpu specified by a @option{-mcpu=} option.
8362 For some ARM implementations better performance can be obtained by using
8363 this option.
8364
8365 @item -march=@var{name}
8366 @opindex march
8367 This specifies the name of the target ARM architecture.  GCC uses this
8368 name to determine what kind of instructions it can emit when generating
8369 assembly code.  This option can be used in conjunction with or instead
8370 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
8371 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
8372 @samp{armv5}, @samp{armv5t}, @samp{armv5te}, @samp{armv6}, @samp{armv6j},
8373 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv7}, @samp{armv7-a},
8374 @samp{armv7-r}, @samp{armv7-m}, @samp{iwmmxt}, @samp{ep9312}.
8375
8376 @item -mfpu=@var{name}
8377 @itemx -mfpe=@var{number}
8378 @itemx -mfp=@var{number}
8379 @opindex mfpu
8380 @opindex mfpe
8381 @opindex mfp
8382 This specifies what floating point hardware (or hardware emulation) is
8383 available on the target.  Permissible names are: @samp{fpa}, @samp{fpe2},
8384 @samp{fpe3}, @samp{maverick}, @samp{vfp}.  @option{-mfp} and @option{-mfpe}
8385 are synonyms for @option{-mfpu}=@samp{fpe}@var{number}, for compatibility
8386 with older versions of GCC@.
8387
8388 If @option{-msoft-float} is specified this specifies the format of
8389 floating point values.
8390
8391 @item -mstructure-size-boundary=@var{n}
8392 @opindex mstructure-size-boundary
8393 The size of all structures and unions will be rounded up to a multiple
8394 of the number of bits set by this option.  Permissible values are 8, 32
8395 and 64.  The default value varies for different toolchains.  For the COFF
8396 targeted toolchain the default value is 8.  A value of 64 is only allowed
8397 if the underlying ABI supports it.
8398
8399 Specifying the larger number can produce faster, more efficient code, but
8400 can also increase the size of the program.  Different values are potentially
8401 incompatible.  Code compiled with one value cannot necessarily expect to
8402 work with code or libraries compiled with another value, if they exchange
8403 information using structures or unions.
8404
8405 @item -mabort-on-noreturn
8406 @opindex mabort-on-noreturn
8407 Generate a call to the function @code{abort} at the end of a
8408 @code{noreturn} function.  It will be executed if the function tries to
8409 return.
8410
8411 @item -mlong-calls
8412 @itemx -mno-long-calls
8413 @opindex mlong-calls
8414 @opindex mno-long-calls
8415 Tells the compiler to perform function calls by first loading the
8416 address of the function into a register and then performing a subroutine
8417 call on this register.  This switch is needed if the target function
8418 will lie outside of the 64 megabyte addressing range of the offset based
8419 version of subroutine call instruction.
8420
8421 Even if this switch is enabled, not all function calls will be turned
8422 into long calls.  The heuristic is that static functions, functions
8423 which have the @samp{short-call} attribute, functions that are inside
8424 the scope of a @samp{#pragma no_long_calls} directive and functions whose
8425 definitions have already been compiled within the current compilation
8426 unit, will not be turned into long calls.  The exception to this rule is
8427 that weak function definitions, functions with the @samp{long-call}
8428 attribute or the @samp{section} attribute, and functions that are within
8429 the scope of a @samp{#pragma long_calls} directive, will always be
8430 turned into long calls.
8431
8432 This feature is not enabled by default.  Specifying
8433 @option{-mno-long-calls} will restore the default behavior, as will
8434 placing the function calls within the scope of a @samp{#pragma
8435 long_calls_off} directive.  Note these switches have no effect on how
8436 the compiler generates code to handle function calls via function
8437 pointers.
8438
8439 @item -mnop-fun-dllimport
8440 @opindex mnop-fun-dllimport
8441 Disable support for the @code{dllimport} attribute.
8442
8443 @item -msingle-pic-base
8444 @opindex msingle-pic-base
8445 Treat the register used for PIC addressing as read-only, rather than
8446 loading it in the prologue for each function.  The run-time system is
8447 responsible for initializing this register with an appropriate value
8448 before execution begins.
8449
8450 @item -mpic-register=@var{reg}
8451 @opindex mpic-register
8452 Specify the register to be used for PIC addressing.  The default is R10
8453 unless stack-checking is enabled, when R9 is used.
8454
8455 @item -mcirrus-fix-invalid-insns
8456 @opindex mcirrus-fix-invalid-insns
8457 @opindex mno-cirrus-fix-invalid-insns
8458 Insert NOPs into the instruction stream to in order to work around
8459 problems with invalid Maverick instruction combinations.  This option
8460 is only valid if the @option{-mcpu=ep9312} option has been used to
8461 enable generation of instructions for the Cirrus Maverick floating
8462 point co-processor.  This option is not enabled by default, since the
8463 problem is only present in older Maverick implementations.  The default
8464 can be re-enabled by use of the @option{-mno-cirrus-fix-invalid-insns}
8465 switch.
8466
8467 @item -mpoke-function-name
8468 @opindex mpoke-function-name
8469 Write the name of each function into the text section, directly
8470 preceding the function prologue.  The generated code is similar to this:
8471
8472 @smallexample
8473      t0
8474          .ascii "arm_poke_function_name", 0
8475          .align
8476      t1
8477          .word 0xff000000 + (t1 - t0)
8478      arm_poke_function_name
8479          mov     ip, sp
8480          stmfd   sp!, @{fp, ip, lr, pc@}
8481          sub     fp, ip, #4
8482 @end smallexample
8483
8484 When performing a stack backtrace, code can inspect the value of
8485 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
8486 location @code{pc - 12} and the top 8 bits are set, then we know that
8487 there is a function name embedded immediately preceding this location
8488 and has length @code{((pc[-3]) & 0xff000000)}.
8489
8490 @item -mthumb
8491 @opindex mthumb
8492 Generate code for the Thumb instruction set.  The default is to
8493 use the 32-bit ARM instruction set.
8494 This option automatically enables either 16-bit Thumb-1 or
8495 mixed 16/32-bit Thumb-2 instructions based on the @option{-mcpu=@var{name}}
8496 and @option{-march=@var{name}} options.
8497
8498 @item -mtpcs-frame
8499 @opindex mtpcs-frame
8500 Generate a stack frame that is compliant with the Thumb Procedure Call
8501 Standard for all non-leaf functions.  (A leaf function is one that does
8502 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
8503
8504 @item -mtpcs-leaf-frame
8505 @opindex mtpcs-leaf-frame
8506 Generate a stack frame that is compliant with the Thumb Procedure Call
8507 Standard for all leaf functions.  (A leaf function is one that does
8508 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
8509
8510 @item -mcallee-super-interworking
8511 @opindex mcallee-super-interworking
8512 Gives all externally visible functions in the file being compiled an ARM
8513 instruction set header which switches to Thumb mode before executing the
8514 rest of the function.  This allows these functions to be called from
8515 non-interworking code.
8516
8517 @item -mcaller-super-interworking
8518 @opindex mcaller-super-interworking
8519 Allows calls via function pointers (including virtual functions) to
8520 execute correctly regardless of whether the target code has been
8521 compiled for interworking or not.  There is a small overhead in the cost
8522 of executing a function pointer if this option is enabled.
8523
8524 @item -mtp=@var{name}
8525 @opindex mtp
8526 Specify the access model for the thread local storage pointer.  The valid
8527 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
8528 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
8529 (supported in the arm6k architecture), and @option{auto}, which uses the
8530 best available method for the selected processor.  The default setting is
8531 @option{auto}.
8532
8533 @end table
8534
8535 @node AVR Options
8536 @subsection AVR Options
8537 @cindex AVR Options
8538
8539 These options are defined for AVR implementations:
8540
8541 @table @gcctabopt
8542 @item -mmcu=@var{mcu}
8543 @opindex mmcu
8544 Specify ATMEL AVR instruction set or MCU type.
8545
8546 Instruction set avr1 is for the minimal AVR core, not supported by the C
8547 compiler, only for assembler programs (MCU types: at90s1200, attiny10,
8548 attiny11, attiny12, attiny15, attiny28).
8549
8550 Instruction set avr2 (default) is for the classic AVR core with up to
8551 8K program memory space (MCU types: at90s2313, at90s2323, attiny22,
8552 at90s2333, at90s2343, at90s4414, at90s4433, at90s4434, at90s8515,
8553 at90c8534, at90s8535).
8554
8555 Instruction set avr3 is for the classic AVR core with up to 128K program
8556 memory space (MCU types: atmega103, atmega603, at43usb320, at76c711).
8557
8558 Instruction set avr4 is for the enhanced AVR core with up to 8K program
8559 memory space (MCU types: atmega8, atmega83, atmega85).
8560
8561 Instruction set avr5 is for the enhanced AVR core with up to 128K program
8562 memory space (MCU types: atmega16, atmega161, atmega163, atmega32, atmega323,
8563 atmega64, atmega128, at43usb355, at94k).
8564
8565 @item -msize
8566 @opindex msize
8567 Output instruction sizes to the asm file.
8568
8569 @item -minit-stack=@var{N}
8570 @opindex minit-stack
8571 Specify the initial stack address, which may be a symbol or numeric value,
8572 @samp{__stack} is the default.
8573
8574 @item -mno-interrupts
8575 @opindex mno-interrupts
8576 Generated code is not compatible with hardware interrupts.
8577 Code size will be smaller.
8578
8579 @item -mcall-prologues
8580 @opindex mcall-prologues
8581 Functions prologues/epilogues expanded as call to appropriate
8582 subroutines.  Code size will be smaller.
8583
8584 @item -mno-tablejump
8585 @opindex mno-tablejump
8586 Do not generate tablejump insns which sometimes increase code size.
8587
8588 @item -mtiny-stack
8589 @opindex mtiny-stack
8590 Change only the low 8 bits of the stack pointer.
8591
8592 @item -mint8
8593 @opindex mint8
8594 Assume int to be 8 bit integer.  This affects the sizes of all types: A
8595 char will be 1 byte, an int will be 1 byte, an long will be 2 bytes
8596 and long long will be 4 bytes.  Please note that this option does not
8597 comply to the C standards, but it will provide you with smaller code
8598 size.
8599 @end table
8600
8601 @node Blackfin Options
8602 @subsection Blackfin Options
8603 @cindex Blackfin Options
8604
8605 @table @gcctabopt
8606 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
8607 @opindex mcpu=
8608 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
8609 can be one of @samp{bf522}, @samp{bf525}, @samp{bf527},
8610 @samp{bf531}, @samp{bf532}, @samp{bf533}, @samp{bf534},
8611 @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
8612 @samp{bf542}, @samp{bf544}, @samp{bf548}, @samp{bf549},
8613 @samp{bf561}.
8614 The optional @var{sirevision} specifies the silicon revision of the target
8615 Blackfin processor.  Any workarounds available for the targeted silicon revision
8616 will be enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
8617 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
8618 will be enabled.  The @code{__SILICON_REVISION__} macro is defined to two
8619 hexadecimal digits representing the major and minor numbers in the silicon
8620 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
8621 is not defined.  If @var{sirevision} is @samp{any}, the
8622 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
8623 If this optional @var{sirevision} is not used, GCC assumes the latest known
8624 silicon revision of the targeted Blackfin processor.
8625
8626 Support for @samp{bf561} is incomplete.  For @samp{bf561},
8627 Only the processor macro is defined.
8628 Without this option, @samp{bf532} is used as the processor by default.
8629 The corresponding predefined processor macros for @var{cpu} is to
8630 be defined.  And for @samp{bfin-elf} toolchain, this causes the hardware BSP
8631 provided by libgloss to be linked in if @option{-msim} is not given.
8632
8633 @item -msim
8634 @opindex msim
8635 Specifies that the program will be run on the simulator.  This causes
8636 the simulator BSP provided by libgloss to be linked in.  This option
8637 has effect only for @samp{bfin-elf} toolchain.
8638
8639 @item -momit-leaf-frame-pointer
8640 @opindex momit-leaf-frame-pointer
8641 Don't keep the frame pointer in a register for leaf functions.  This
8642 avoids the instructions to save, set up and restore frame pointers and
8643 makes an extra register available in leaf functions.  The option
8644 @option{-fomit-frame-pointer} removes the frame pointer for all functions
8645 which might make debugging harder.
8646
8647 @item -mspecld-anomaly
8648 @opindex mspecld-anomaly
8649 When enabled, the compiler will ensure that the generated code does not
8650 contain speculative loads after jump instructions. If this option is used,
8651 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
8652
8653 @item -mno-specld-anomaly
8654 @opindex mno-specld-anomaly
8655 Don't generate extra code to prevent speculative loads from occurring.
8656
8657 @item -mcsync-anomaly
8658 @opindex mcsync-anomaly
8659 When enabled, the compiler will ensure that the generated code does not
8660 contain CSYNC or SSYNC instructions too soon after conditional branches.
8661 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
8662
8663 @item -mno-csync-anomaly
8664 @opindex mno-csync-anomaly
8665 Don't generate extra code to prevent CSYNC or SSYNC instructions from
8666 occurring too soon after a conditional branch.
8667
8668 @item -mlow-64k
8669 @opindex mlow-64k
8670 When enabled, the compiler is free to take advantage of the knowledge that
8671 the entire program fits into the low 64k of memory.
8672
8673 @item -mno-low-64k
8674 @opindex mno-low-64k
8675 Assume that the program is arbitrarily large.  This is the default.
8676
8677 @item -mstack-check-l1
8678 @opindex mstack-check-l1
8679 Do stack checking using information placed into L1 scratchpad memory by the
8680 uClinux kernel.
8681
8682 @item -mid-shared-library
8683 @opindex mid-shared-library
8684 Generate code that supports shared libraries via the library ID method.
8685 This allows for execute in place and shared libraries in an environment
8686 without virtual memory management.  This option implies @option{-fPIC}.
8687
8688 @item -mno-id-shared-library
8689 @opindex mno-id-shared-library
8690 Generate code that doesn't assume ID based shared libraries are being used.
8691 This is the default.
8692
8693 @item -mleaf-id-shared-library
8694 @opindex mleaf-id-shared-library
8695 Generate code that supports shared libraries via the library ID method,
8696 but assumes that this library or executable won't link against any other
8697 ID shared libraries.  That allows the compiler to use faster code for jumps
8698 and calls.
8699
8700 @item -mno-leaf-id-shared-library
8701 @opindex mno-leaf-id-shared-library
8702 Do not assume that the code being compiled won't link against any ID shared
8703 libraries.  Slower code will be generated for jump and call insns.
8704
8705 @item -mshared-library-id=n
8706 @opindex mshared-library-id
8707 Specified the identification number of the ID based shared library being
8708 compiled.  Specifying a value of 0 will generate more compact code, specifying
8709 other values will force the allocation of that number to the current
8710 library but is no more space or time efficient than omitting this option.
8711
8712 @item -msep-data
8713 @opindex msep-data
8714 Generate code that allows the data segment to be located in a different
8715 area of memory from the text segment.  This allows for execute in place in
8716 an environment without virtual memory management by eliminating relocations
8717 against the text section.
8718
8719 @item -mno-sep-data
8720 @opindex mno-sep-data
8721 Generate code that assumes that the data segment follows the text segment.
8722 This is the default.
8723
8724 @item -mlong-calls
8725 @itemx -mno-long-calls
8726 @opindex mlong-calls
8727 @opindex mno-long-calls
8728 Tells the compiler to perform function calls by first loading the
8729 address of the function into a register and then performing a subroutine
8730 call on this register.  This switch is needed if the target function
8731 will lie outside of the 24 bit addressing range of the offset based
8732 version of subroutine call instruction.
8733
8734 This feature is not enabled by default.  Specifying
8735 @option{-mno-long-calls} will restore the default behavior.  Note these
8736 switches have no effect on how the compiler generates code to handle
8737 function calls via function pointers.
8738
8739 @item -mfast-fp
8740 @opindex mfast-fp
8741 Link with the fast floating-point library. This library relaxes some of
8742 the IEEE floating-point standard's rules for checking inputs against
8743 Not-a-Number (NAN), in the interest of performance.
8744
8745 @item -minline-plt
8746 @opindex minline-plt
8747 Enable inlining of PLT entries in function calls to functions that are
8748 not known to bind locally.  It has no effect without @option{-mfdpic}.
8749 @end table
8750
8751 @node CRIS Options
8752 @subsection CRIS Options
8753 @cindex CRIS Options
8754
8755 These options are defined specifically for the CRIS ports.
8756
8757 @table @gcctabopt
8758 @item -march=@var{architecture-type}
8759 @itemx -mcpu=@var{architecture-type}
8760 @opindex march
8761 @opindex mcpu
8762 Generate code for the specified architecture.  The choices for
8763 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
8764 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
8765 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
8766 @samp{v10}.
8767
8768 @item -mtune=@var{architecture-type}
8769 @opindex mtune
8770 Tune to @var{architecture-type} everything applicable about the generated
8771 code, except for the ABI and the set of available instructions.  The
8772 choices for @var{architecture-type} are the same as for
8773 @option{-march=@var{architecture-type}}.
8774
8775 @item -mmax-stack-frame=@var{n}
8776 @opindex mmax-stack-frame
8777 Warn when the stack frame of a function exceeds @var{n} bytes.
8778
8779 @item -melinux-stacksize=@var{n}
8780 @opindex melinux-stacksize
8781 Only available with the @samp{cris-axis-aout} target.  Arranges for
8782 indications in the program to the kernel loader that the stack of the
8783 program should be set to @var{n} bytes.
8784
8785 @item -metrax4
8786 @itemx -metrax100
8787 @opindex metrax4
8788 @opindex metrax100
8789 The options @option{-metrax4} and @option{-metrax100} are synonyms for
8790 @option{-march=v3} and @option{-march=v8} respectively.
8791
8792 @item -mmul-bug-workaround
8793 @itemx -mno-mul-bug-workaround
8794 @opindex mmul-bug-workaround
8795 @opindex mno-mul-bug-workaround
8796 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
8797 models where it applies.  This option is active by default.
8798
8799 @item -mpdebug
8800 @opindex mpdebug
8801 Enable CRIS-specific verbose debug-related information in the assembly
8802 code.  This option also has the effect to turn off the @samp{#NO_APP}
8803 formatted-code indicator to the assembler at the beginning of the
8804 assembly file.
8805
8806 @item -mcc-init
8807 @opindex mcc-init
8808 Do not use condition-code results from previous instruction; always emit
8809 compare and test instructions before use of condition codes.
8810
8811 @item -mno-side-effects
8812 @opindex mno-side-effects
8813 Do not emit instructions with side-effects in addressing modes other than
8814 post-increment.
8815
8816 @item -mstack-align
8817 @itemx -mno-stack-align
8818 @itemx -mdata-align
8819 @itemx -mno-data-align
8820 @itemx -mconst-align
8821 @itemx -mno-const-align
8822 @opindex mstack-align
8823 @opindex mno-stack-align
8824 @opindex mdata-align
8825 @opindex mno-data-align
8826 @opindex mconst-align
8827 @opindex mno-const-align
8828 These options (no-options) arranges (eliminate arrangements) for the
8829 stack-frame, individual data and constants to be aligned for the maximum
8830 single data access size for the chosen CPU model.  The default is to
8831 arrange for 32-bit alignment.  ABI details such as structure layout are
8832 not affected by these options.
8833
8834 @item -m32-bit
8835 @itemx -m16-bit
8836 @itemx -m8-bit
8837 @opindex m32-bit
8838 @opindex m16-bit
8839 @opindex m8-bit
8840 Similar to the stack- data- and const-align options above, these options
8841 arrange for stack-frame, writable data and constants to all be 32-bit,
8842 16-bit or 8-bit aligned.  The default is 32-bit alignment.
8843
8844 @item -mno-prologue-epilogue
8845 @itemx -mprologue-epilogue
8846 @opindex mno-prologue-epilogue
8847 @opindex mprologue-epilogue
8848 With @option{-mno-prologue-epilogue}, the normal function prologue and
8849 epilogue that sets up the stack-frame are omitted and no return
8850 instructions or return sequences are generated in the code.  Use this
8851 option only together with visual inspection of the compiled code: no
8852 warnings or errors are generated when call-saved registers must be saved,
8853 or storage for local variable needs to be allocated.
8854
8855 @item -mno-gotplt
8856 @itemx -mgotplt
8857 @opindex mno-gotplt
8858 @opindex mgotplt
8859 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
8860 instruction sequences that load addresses for functions from the PLT part
8861 of the GOT rather than (traditional on other architectures) calls to the
8862 PLT@.  The default is @option{-mgotplt}.
8863
8864 @item -maout
8865 @opindex maout
8866 Legacy no-op option only recognized with the cris-axis-aout target.
8867
8868 @item -melf
8869 @opindex melf
8870 Legacy no-op option only recognized with the cris-axis-elf and
8871 cris-axis-linux-gnu targets.
8872
8873 @item -melinux
8874 @opindex melinux
8875 Only recognized with the cris-axis-aout target, where it selects a
8876 GNU/linux-like multilib, include files and instruction set for
8877 @option{-march=v8}.
8878
8879 @item -mlinux
8880 @opindex mlinux
8881 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
8882
8883 @item -sim
8884 @opindex sim
8885 This option, recognized for the cris-axis-aout and cris-axis-elf arranges
8886 to link with input-output functions from a simulator library.  Code,
8887 initialized data and zero-initialized data are allocated consecutively.
8888
8889 @item -sim2
8890 @opindex sim2
8891 Like @option{-sim}, but pass linker options to locate initialized data at
8892 0x40000000 and zero-initialized data at 0x80000000.
8893 @end table
8894
8895 @node CRX Options
8896 @subsection CRX Options
8897 @cindex CRX Options
8898
8899 These options are defined specifically for the CRX ports.
8900
8901 @table @gcctabopt
8902
8903 @item -mmac
8904 @opindex mmac
8905 Enable the use of multiply-accumulate instructions. Disabled by default.
8906
8907 @item -mpush-args
8908 @opindex mpush-args
8909 Push instructions will be used to pass outgoing arguments when functions
8910 are called. Enabled by default.
8911 @end table
8912
8913 @node Darwin Options
8914 @subsection Darwin Options
8915 @cindex Darwin options
8916
8917 These options are defined for all architectures running the Darwin operating
8918 system.
8919
8920 FSF GCC on Darwin does not create ``fat'' object files; it will create
8921 an object file for the single architecture that it was built to
8922 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
8923 @option{-arch} options are used; it does so by running the compiler or
8924 linker multiple times and joining the results together with
8925 @file{lipo}.
8926
8927 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
8928 @samp{i686}) is determined by the flags that specify the ISA
8929 that GCC is targetting, like @option{-mcpu} or @option{-march}.  The
8930 @option{-force_cpusubtype_ALL} option can be used to override this.
8931
8932 The Darwin tools vary in their behavior when presented with an ISA
8933 mismatch.  The assembler, @file{as}, will only permit instructions to
8934 be used that are valid for the subtype of the file it is generating,
8935 so you cannot put 64-bit instructions in an @samp{ppc750} object file.
8936 The linker for shared libraries, @file{/usr/bin/libtool}, will fail
8937 and print an error if asked to create a shared library with a less
8938 restrictive subtype than its input files (for instance, trying to put
8939 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
8940 for executables, @file{ld}, will quietly give the executable the most
8941 restrictive subtype of any of its input files.
8942
8943 @table @gcctabopt
8944 @item -F@var{dir}
8945 @opindex F
8946 Add the framework directory @var{dir} to the head of the list of
8947 directories to be searched for header files.  These directories are
8948 interleaved with those specified by @option{-I} options and are
8949 scanned in a left-to-right order.
8950
8951 A framework directory is a directory with frameworks in it.  A
8952 framework is a directory with a @samp{"Headers"} and/or
8953 @samp{"PrivateHeaders"} directory contained directly in it that ends
8954 in @samp{".framework"}.  The name of a framework is the name of this
8955 directory excluding the @samp{".framework"}.  Headers associated with
8956 the framework are found in one of those two directories, with
8957 @samp{"Headers"} being searched first.  A subframework is a framework
8958 directory that is in a framework's @samp{"Frameworks"} directory.
8959 Includes of subframework headers can only appear in a header of a
8960 framework that contains the subframework, or in a sibling subframework
8961 header.  Two subframeworks are siblings if they occur in the same
8962 framework.  A subframework should not have the same name as a
8963 framework, a warning will be issued if this is violated.  Currently a
8964 subframework cannot have subframeworks, in the future, the mechanism
8965 may be extended to support this.  The standard frameworks can be found
8966 in @samp{"/System/Library/Frameworks"} and
8967 @samp{"/Library/Frameworks"}.  An example include looks like
8968 @code{#include <Framework/header.h>}, where @samp{Framework} denotes
8969 the name of the framework and header.h is found in the
8970 @samp{"PrivateHeaders"} or @samp{"Headers"} directory.
8971
8972 @item -iframework@var{dir}
8973 @opindex iframework
8974 Like @option{-F} except the directory is a treated as a system
8975 directory.  The main difference between this @option{-iframework} and
8976 @option{-F} is that with @option{-iframework} the compiler does not
8977 warn about constructs contained within header files found via
8978 @var{dir}.  This option is valid only for the C family of languages.
8979
8980 @item -gused
8981 @opindex gused
8982 Emit debugging information for symbols that are used.  For STABS
8983 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
8984 This is by default ON@.
8985
8986 @item -gfull
8987 @opindex gfull
8988 Emit debugging information for all symbols and types.
8989
8990 @item -mmacosx-version-min=@var{version}
8991 The earliest version of MacOS X that this executable will run on
8992 is @var{version}.  Typical values of @var{version} include @code{10.1},
8993 @code{10.2}, and @code{10.3.9}.
8994
8995 If the compiler was built to use the system's headers by default,
8996 then the default for this option is the system version on which the
8997 compiler is running, otherwise the default is to make choices which
8998 are compatible with as many systems and code bases as possible.
8999
9000 @item -mkernel
9001 @opindex mkernel
9002 Enable kernel development mode.  The @option{-mkernel} option sets
9003 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
9004 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
9005 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
9006 applicable.  This mode also sets @option{-mno-altivec},
9007 @option{-msoft-float}, @option{-fno-builtin} and
9008 @option{-mlong-branch} for PowerPC targets.
9009
9010 @item -mone-byte-bool
9011 @opindex mone-byte-bool
9012 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
9013 By default @samp{sizeof(bool)} is @samp{4} when compiling for
9014 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
9015 option has no effect on x86.
9016
9017 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
9018 to generate code that is not binary compatible with code generated
9019 without that switch.  Using this switch may require recompiling all
9020 other modules in a program, including system libraries.  Use this
9021 switch to conform to a non-default data model.
9022
9023 @item -mfix-and-continue
9024 @itemx -ffix-and-continue
9025 @itemx -findirect-data
9026 @opindex mfix-and-continue
9027 @opindex ffix-and-continue
9028 @opindex findirect-data
9029 Generate code suitable for fast turn around development.  Needed to
9030 enable gdb to dynamically load @code{.o} files into already running
9031 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
9032 are provided for backwards compatibility.
9033
9034 @item -all_load
9035 @opindex all_load
9036 Loads all members of static archive libraries.
9037 See man ld(1) for more information.
9038
9039 @item -arch_errors_fatal
9040 @opindex arch_errors_fatal
9041 Cause the errors having to do with files that have the wrong architecture
9042 to be fatal.
9043
9044 @item -bind_at_load
9045 @opindex bind_at_load
9046 Causes the output file to be marked such that the dynamic linker will
9047 bind all undefined references when the file is loaded or launched.
9048
9049 @item -bundle
9050 @opindex bundle
9051 Produce a Mach-o bundle format file.
9052 See man ld(1) for more information.
9053
9054 @item -bundle_loader @var{executable}
9055 @opindex bundle_loader
9056 This option specifies the @var{executable} that will be loading the build
9057 output file being linked.  See man ld(1) for more information.
9058
9059 @item -dynamiclib
9060 @opindex dynamiclib
9061 When passed this option, GCC will produce a dynamic library instead of
9062 an executable when linking, using the Darwin @file{libtool} command.
9063
9064 @item -force_cpusubtype_ALL
9065 @opindex force_cpusubtype_ALL
9066 This causes GCC's output file to have the @var{ALL} subtype, instead of
9067 one controlled by the @option{-mcpu} or @option{-march} option.
9068
9069 @item -allowable_client  @var{client_name}
9070 @itemx -client_name
9071 @itemx -compatibility_version
9072 @itemx -current_version
9073 @itemx -dead_strip
9074 @itemx -dependency-file
9075 @itemx -dylib_file
9076 @itemx -dylinker_install_name
9077 @itemx -dynamic
9078 @itemx -exported_symbols_list
9079 @itemx -filelist
9080 @itemx -flat_namespace
9081 @itemx -force_flat_namespace
9082 @itemx -headerpad_max_install_names
9083 @itemx -image_base
9084 @itemx -init
9085 @itemx -install_name
9086 @itemx -keep_private_externs
9087 @itemx -multi_module
9088 @itemx -multiply_defined
9089 @itemx -multiply_defined_unused
9090 @itemx -noall_load
9091 @itemx -no_dead_strip_inits_and_terms
9092 @itemx -nofixprebinding
9093 @itemx -nomultidefs
9094 @itemx -noprebind
9095 @itemx -noseglinkedit
9096 @itemx -pagezero_size
9097 @itemx -prebind
9098 @itemx -prebind_all_twolevel_modules
9099 @itemx -private_bundle
9100 @itemx -read_only_relocs
9101 @itemx -sectalign
9102 @itemx -sectobjectsymbols
9103 @itemx -whyload
9104 @itemx -seg1addr
9105 @itemx -sectcreate
9106 @itemx -sectobjectsymbols
9107 @itemx -sectorder
9108 @itemx -segaddr
9109 @itemx -segs_read_only_addr
9110 @itemx -segs_read_write_addr
9111 @itemx -seg_addr_table
9112 @itemx -seg_addr_table_filename
9113 @itemx -seglinkedit
9114 @itemx -segprot
9115 @itemx -segs_read_only_addr
9116 @itemx -segs_read_write_addr
9117 @itemx -single_module
9118 @itemx -static
9119 @itemx -sub_library
9120 @itemx -sub_umbrella
9121 @itemx -twolevel_namespace
9122 @itemx -umbrella
9123 @itemx -undefined
9124 @itemx -unexported_symbols_list
9125 @itemx -weak_reference_mismatches
9126 @itemx -whatsloaded
9127
9128 @opindex allowable_client
9129 @opindex client_name
9130 @opindex compatibility_version
9131 @opindex current_version
9132 @opindex dead_strip
9133 @opindex dependency-file
9134 @opindex dylib_file
9135 @opindex dylinker_install_name
9136 @opindex dynamic
9137 @opindex exported_symbols_list
9138 @opindex filelist
9139 @opindex flat_namespace
9140 @opindex force_flat_namespace
9141 @opindex headerpad_max_install_names
9142 @opindex image_base
9143 @opindex init
9144 @opindex install_name
9145 @opindex keep_private_externs
9146 @opindex multi_module
9147 @opindex multiply_defined
9148 @opindex multiply_defined_unused
9149 @opindex noall_load
9150 @opindex no_dead_strip_inits_and_terms
9151 @opindex nofixprebinding
9152 @opindex nomultidefs
9153 @opindex noprebind
9154 @opindex noseglinkedit
9155 @opindex pagezero_size
9156 @opindex prebind
9157 @opindex prebind_all_twolevel_modules
9158 @opindex private_bundle
9159 @opindex read_only_relocs
9160 @opindex sectalign
9161 @opindex sectobjectsymbols
9162 @opindex whyload
9163 @opindex seg1addr
9164 @opindex sectcreate
9165 @opindex sectobjectsymbols
9166 @opindex sectorder
9167 @opindex segaddr
9168 @opindex segs_read_only_addr
9169 @opindex segs_read_write_addr
9170 @opindex seg_addr_table
9171 @opindex seg_addr_table_filename
9172 @opindex seglinkedit
9173 @opindex segprot
9174 @opindex segs_read_only_addr
9175 @opindex segs_read_write_addr
9176 @opindex single_module
9177 @opindex static
9178 @opindex sub_library
9179 @opindex sub_umbrella
9180 @opindex twolevel_namespace
9181 @opindex umbrella
9182 @opindex undefined
9183 @opindex unexported_symbols_list
9184 @opindex weak_reference_mismatches
9185 @opindex whatsloaded
9186
9187 These options are passed to the Darwin linker.  The Darwin linker man page
9188 describes them in detail.
9189 @end table
9190
9191 @node DEC Alpha Options
9192 @subsection DEC Alpha Options
9193
9194 These @samp{-m} options are defined for the DEC Alpha implementations:
9195
9196 @table @gcctabopt
9197 @item -mno-soft-float
9198 @itemx -msoft-float
9199 @opindex mno-soft-float
9200 @opindex msoft-float
9201 Use (do not use) the hardware floating-point instructions for
9202 floating-point operations.  When @option{-msoft-float} is specified,
9203 functions in @file{libgcc.a} will be used to perform floating-point
9204 operations.  Unless they are replaced by routines that emulate the
9205 floating-point operations, or compiled in such a way as to call such
9206 emulations routines, these routines will issue floating-point
9207 operations.   If you are compiling for an Alpha without floating-point
9208 operations, you must ensure that the library is built so as not to call
9209 them.
9210
9211 Note that Alpha implementations without floating-point operations are
9212 required to have floating-point registers.
9213
9214 @item -mfp-reg
9215 @itemx -mno-fp-regs
9216 @opindex mfp-reg
9217 @opindex mno-fp-regs
9218 Generate code that uses (does not use) the floating-point register set.
9219 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
9220 register set is not used, floating point operands are passed in integer
9221 registers as if they were integers and floating-point results are passed
9222 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
9223 so any function with a floating-point argument or return value called by code
9224 compiled with @option{-mno-fp-regs} must also be compiled with that
9225 option.
9226
9227 A typical use of this option is building a kernel that does not use,
9228 and hence need not save and restore, any floating-point registers.
9229
9230 @item -mieee
9231 @opindex mieee
9232 The Alpha architecture implements floating-point hardware optimized for
9233 maximum performance.  It is mostly compliant with the IEEE floating
9234 point standard.  However, for full compliance, software assistance is
9235 required.  This option generates code fully IEEE compliant code
9236 @emph{except} that the @var{inexact-flag} is not maintained (see below).
9237 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
9238 defined during compilation.  The resulting code is less efficient but is
9239 able to correctly support denormalized numbers and exceptional IEEE
9240 values such as not-a-number and plus/minus infinity.  Other Alpha
9241 compilers call this option @option{-ieee_with_no_inexact}.
9242
9243 @item -mieee-with-inexact
9244 @opindex mieee-with-inexact
9245 This is like @option{-mieee} except the generated code also maintains
9246 the IEEE @var{inexact-flag}.  Turning on this option causes the
9247 generated code to implement fully-compliant IEEE math.  In addition to
9248 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
9249 macro.  On some Alpha implementations the resulting code may execute
9250 significantly slower than the code generated by default.  Since there is
9251 very little code that depends on the @var{inexact-flag}, you should
9252 normally not specify this option.  Other Alpha compilers call this
9253 option @option{-ieee_with_inexact}.
9254
9255 @item -mfp-trap-mode=@var{trap-mode}
9256 @opindex mfp-trap-mode
9257 This option controls what floating-point related traps are enabled.
9258 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
9259 The trap mode can be set to one of four values:
9260
9261 @table @samp
9262 @item n
9263 This is the default (normal) setting.  The only traps that are enabled
9264 are the ones that cannot be disabled in software (e.g., division by zero
9265 trap).
9266
9267 @item u
9268 In addition to the traps enabled by @samp{n}, underflow traps are enabled
9269 as well.
9270
9271 @item su
9272 Like @samp{u}, but the instructions are marked to be safe for software
9273 completion (see Alpha architecture manual for details).
9274
9275 @item sui
9276 Like @samp{su}, but inexact traps are enabled as well.
9277 @end table
9278
9279 @item -mfp-rounding-mode=@var{rounding-mode}
9280 @opindex mfp-rounding-mode
9281 Selects the IEEE rounding mode.  Other Alpha compilers call this option
9282 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
9283 of:
9284
9285 @table @samp
9286 @item n
9287 Normal IEEE rounding mode.  Floating point numbers are rounded towards
9288 the nearest machine number or towards the even machine number in case
9289 of a tie.
9290
9291 @item m
9292 Round towards minus infinity.
9293
9294 @item c
9295 Chopped rounding mode.  Floating point numbers are rounded towards zero.
9296
9297 @item d
9298 Dynamic rounding mode.  A field in the floating point control register
9299 (@var{fpcr}, see Alpha architecture reference manual) controls the
9300 rounding mode in effect.  The C library initializes this register for
9301 rounding towards plus infinity.  Thus, unless your program modifies the
9302 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
9303 @end table
9304
9305 @item -mtrap-precision=@var{trap-precision}
9306 @opindex mtrap-precision
9307 In the Alpha architecture, floating point traps are imprecise.  This
9308 means without software assistance it is impossible to recover from a
9309 floating trap and program execution normally needs to be terminated.
9310 GCC can generate code that can assist operating system trap handlers
9311 in determining the exact location that caused a floating point trap.
9312 Depending on the requirements of an application, different levels of
9313 precisions can be selected:
9314
9315 @table @samp
9316 @item p
9317 Program precision.  This option is the default and means a trap handler
9318 can only identify which program caused a floating point exception.
9319
9320 @item f
9321 Function precision.  The trap handler can determine the function that
9322 caused a floating point exception.
9323
9324 @item i
9325 Instruction precision.  The trap handler can determine the exact
9326 instruction that caused a floating point exception.
9327 @end table
9328
9329 Other Alpha compilers provide the equivalent options called
9330 @option{-scope_safe} and @option{-resumption_safe}.
9331
9332 @item -mieee-conformant
9333 @opindex mieee-conformant
9334 This option marks the generated code as IEEE conformant.  You must not
9335 use this option unless you also specify @option{-mtrap-precision=i} and either
9336 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
9337 is to emit the line @samp{.eflag 48} in the function prologue of the
9338 generated assembly file.  Under DEC Unix, this has the effect that
9339 IEEE-conformant math library routines will be linked in.
9340
9341 @item -mbuild-constants
9342 @opindex mbuild-constants
9343 Normally GCC examines a 32- or 64-bit integer constant to
9344 see if it can construct it from smaller constants in two or three
9345 instructions.  If it cannot, it will output the constant as a literal and
9346 generate code to load it from the data segment at runtime.
9347
9348 Use this option to require GCC to construct @emph{all} integer constants
9349 using code, even if it takes more instructions (the maximum is six).
9350
9351 You would typically use this option to build a shared library dynamic
9352 loader.  Itself a shared library, it must relocate itself in memory
9353 before it can find the variables and constants in its own data segment.
9354
9355 @item -malpha-as
9356 @itemx -mgas
9357 @opindex malpha-as
9358 @opindex mgas
9359 Select whether to generate code to be assembled by the vendor-supplied
9360 assembler (@option{-malpha-as}) or by the GNU assembler @option{-mgas}.
9361
9362 @item -mbwx
9363 @itemx -mno-bwx
9364 @itemx -mcix
9365 @itemx -mno-cix
9366 @itemx -mfix
9367 @itemx -mno-fix
9368 @itemx -mmax
9369 @itemx -mno-max
9370 @opindex mbwx
9371 @opindex mno-bwx
9372 @opindex mcix
9373 @opindex mno-cix
9374 @opindex mfix
9375 @opindex mno-fix
9376 @opindex mmax
9377 @opindex mno-max
9378 Indicate whether GCC should generate code to use the optional BWX,
9379 CIX, FIX and MAX instruction sets.  The default is to use the instruction
9380 sets supported by the CPU type specified via @option{-mcpu=} option or that
9381 of the CPU on which GCC was built if none was specified.
9382
9383 @item -mfloat-vax
9384 @itemx -mfloat-ieee
9385 @opindex mfloat-vax
9386 @opindex mfloat-ieee
9387 Generate code that uses (does not use) VAX F and G floating point
9388 arithmetic instead of IEEE single and double precision.
9389
9390 @item -mexplicit-relocs
9391 @itemx -mno-explicit-relocs
9392 @opindex mexplicit-relocs
9393 @opindex mno-explicit-relocs
9394 Older Alpha assemblers provided no way to generate symbol relocations
9395 except via assembler macros.  Use of these macros does not allow
9396 optimal instruction scheduling.  GNU binutils as of version 2.12
9397 supports a new syntax that allows the compiler to explicitly mark
9398 which relocations should apply to which instructions.  This option
9399 is mostly useful for debugging, as GCC detects the capabilities of
9400 the assembler when it is built and sets the default accordingly.
9401
9402 @item -msmall-data
9403 @itemx -mlarge-data
9404 @opindex msmall-data
9405 @opindex mlarge-data
9406 When @option{-mexplicit-relocs} is in effect, static data is
9407 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
9408 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
9409 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
9410 16-bit relocations off of the @code{$gp} register.  This limits the
9411 size of the small data area to 64KB, but allows the variables to be
9412 directly accessed via a single instruction.
9413
9414 The default is @option{-mlarge-data}.  With this option the data area
9415 is limited to just below 2GB@.  Programs that require more than 2GB of
9416 data must use @code{malloc} or @code{mmap} to allocate the data in the
9417 heap instead of in the program's data segment.
9418
9419 When generating code for shared libraries, @option{-fpic} implies
9420 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
9421
9422 @item -msmall-text
9423 @itemx -mlarge-text
9424 @opindex msmall-text
9425 @opindex mlarge-text
9426 When @option{-msmall-text} is used, the compiler assumes that the
9427 code of the entire program (or shared library) fits in 4MB, and is
9428 thus reachable with a branch instruction.  When @option{-msmall-data}
9429 is used, the compiler can assume that all local symbols share the
9430 same @code{$gp} value, and thus reduce the number of instructions
9431 required for a function call from 4 to 1.
9432
9433 The default is @option{-mlarge-text}.
9434
9435 @item -mcpu=@var{cpu_type}
9436 @opindex mcpu
9437 Set the instruction set and instruction scheduling parameters for
9438 machine type @var{cpu_type}.  You can specify either the @samp{EV}
9439 style name or the corresponding chip number.  GCC supports scheduling
9440 parameters for the EV4, EV5 and EV6 family of processors and will
9441 choose the default values for the instruction set from the processor
9442 you specify.  If you do not specify a processor type, GCC will default
9443 to the processor on which the compiler was built.
9444
9445 Supported values for @var{cpu_type} are
9446
9447 @table @samp
9448 @item ev4
9449 @itemx ev45
9450 @itemx 21064
9451 Schedules as an EV4 and has no instruction set extensions.
9452
9453 @item ev5
9454 @itemx 21164
9455 Schedules as an EV5 and has no instruction set extensions.
9456
9457 @item ev56
9458 @itemx 21164a
9459 Schedules as an EV5 and supports the BWX extension.
9460
9461 @item pca56
9462 @itemx 21164pc
9463 @itemx 21164PC
9464 Schedules as an EV5 and supports the BWX and MAX extensions.
9465
9466 @item ev6
9467 @itemx 21264
9468 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
9469
9470 @item ev67
9471 @itemx 21264a
9472 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
9473 @end table
9474
9475 @item -mtune=@var{cpu_type}
9476 @opindex mtune
9477 Set only the instruction scheduling parameters for machine type
9478 @var{cpu_type}.  The instruction set is not changed.
9479
9480 @item -mmemory-latency=@var{time}
9481 @opindex mmemory-latency
9482 Sets the latency the scheduler should assume for typical memory
9483 references as seen by the application.  This number is highly
9484 dependent on the memory access patterns used by the application
9485 and the size of the external cache on the machine.
9486
9487 Valid options for @var{time} are
9488
9489 @table @samp
9490 @item @var{number}
9491 A decimal number representing clock cycles.
9492
9493 @item L1
9494 @itemx L2
9495 @itemx L3
9496 @itemx main
9497 The compiler contains estimates of the number of clock cycles for
9498 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
9499 (also called Dcache, Scache, and Bcache), as well as to main memory.
9500 Note that L3 is only valid for EV5.
9501
9502 @end table
9503 @end table
9504
9505 @node DEC Alpha/VMS Options
9506 @subsection DEC Alpha/VMS Options
9507
9508 These @samp{-m} options are defined for the DEC Alpha/VMS implementations:
9509
9510 @table @gcctabopt
9511 @item -mvms-return-codes
9512 @opindex mvms-return-codes
9513 Return VMS condition codes from main.  The default is to return POSIX
9514 style condition (e.g.@: error) codes.
9515 @end table
9516
9517 @node FRV Options
9518 @subsection FRV Options
9519 @cindex FRV Options
9520
9521 @table @gcctabopt
9522 @item -mgpr-32
9523 @opindex mgpr-32
9524
9525 Only use the first 32 general purpose registers.
9526
9527 @item -mgpr-64
9528 @opindex mgpr-64
9529
9530 Use all 64 general purpose registers.
9531
9532 @item -mfpr-32
9533 @opindex mfpr-32
9534
9535 Use only the first 32 floating point registers.
9536
9537 @item -mfpr-64
9538 @opindex mfpr-64
9539
9540 Use all 64 floating point registers
9541
9542 @item -mhard-float
9543 @opindex mhard-float
9544
9545 Use hardware instructions for floating point operations.
9546
9547 @item -msoft-float
9548 @opindex msoft-float
9549
9550 Use library routines for floating point operations.
9551
9552 @item -malloc-cc
9553 @opindex malloc-cc
9554
9555 Dynamically allocate condition code registers.
9556
9557 @item -mfixed-cc
9558 @opindex mfixed-cc
9559
9560 Do not try to dynamically allocate condition code registers, only
9561 use @code{icc0} and @code{fcc0}.
9562
9563 @item -mdword
9564 @opindex mdword
9565
9566 Change ABI to use double word insns.
9567
9568 @item -mno-dword
9569 @opindex mno-dword
9570
9571 Do not use double word instructions.
9572
9573 @item -mdouble
9574 @opindex mdouble
9575
9576 Use floating point double instructions.
9577
9578 @item -mno-double
9579 @opindex mno-double
9580
9581 Do not use floating point double instructions.
9582
9583 @item -mmedia
9584 @opindex mmedia
9585
9586 Use media instructions.
9587
9588 @item -mno-media
9589 @opindex mno-media
9590
9591 Do not use media instructions.
9592
9593 @item -mmuladd
9594 @opindex mmuladd
9595
9596 Use multiply and add/subtract instructions.
9597
9598 @item -mno-muladd
9599 @opindex mno-muladd
9600
9601 Do not use multiply and add/subtract instructions.
9602
9603 @item -mfdpic
9604 @opindex mfdpic
9605
9606 Select the FDPIC ABI, that uses function descriptors to represent
9607 pointers to functions.  Without any PIC/PIE-related options, it
9608 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
9609 assumes GOT entries and small data are within a 12-bit range from the
9610 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
9611 are computed with 32 bits.
9612
9613 @item -minline-plt
9614 @opindex minline-plt
9615
9616 Enable inlining of PLT entries in function calls to functions that are
9617 not known to bind locally.  It has no effect without @option{-mfdpic}.
9618 It's enabled by default if optimizing for speed and compiling for
9619 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
9620 optimization option such as @option{-O3} or above is present in the
9621 command line.
9622
9623 @item -mTLS
9624 @opindex TLS
9625
9626 Assume a large TLS segment when generating thread-local code.
9627
9628 @item -mtls
9629 @opindex tls
9630
9631 Do not assume a large TLS segment when generating thread-local code.
9632
9633 @item -mgprel-ro
9634 @opindex mgprel-ro
9635
9636 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
9637 that is known to be in read-only sections.  It's enabled by default,
9638 except for @option{-fpic} or @option{-fpie}: even though it may help
9639 make the global offset table smaller, it trades 1 instruction for 4.
9640 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
9641 one of which may be shared by multiple symbols, and it avoids the need
9642 for a GOT entry for the referenced symbol, so it's more likely to be a
9643 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
9644
9645 @item -multilib-library-pic
9646 @opindex multilib-library-pic
9647
9648 Link with the (library, not FD) pic libraries.  It's implied by
9649 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
9650 @option{-fpic} without @option{-mfdpic}.  You should never have to use
9651 it explicitly.
9652
9653 @item -mlinked-fp
9654 @opindex mlinked-fp
9655
9656 Follow the EABI requirement of always creating a frame pointer whenever
9657 a stack frame is allocated.  This option is enabled by default and can
9658 be disabled with @option{-mno-linked-fp}.
9659
9660 @item -mlong-calls
9661 @opindex mlong-calls
9662
9663 Use indirect addressing to call functions outside the current
9664 compilation unit.  This allows the functions to be placed anywhere
9665 within the 32-bit address space.
9666
9667 @item -malign-labels
9668 @opindex malign-labels
9669
9670 Try to align labels to an 8-byte boundary by inserting nops into the
9671 previous packet.  This option only has an effect when VLIW packing
9672 is enabled.  It doesn't create new packets; it merely adds nops to
9673 existing ones.
9674
9675 @item -mlibrary-pic
9676 @opindex mlibrary-pic
9677
9678 Generate position-independent EABI code.
9679
9680 @item -macc-4
9681 @opindex macc-4
9682
9683 Use only the first four media accumulator registers.
9684
9685 @item -macc-8
9686 @opindex macc-8
9687
9688 Use all eight media accumulator registers.
9689
9690 @item -mpack
9691 @opindex mpack
9692
9693 Pack VLIW instructions.
9694
9695 @item -mno-pack
9696 @opindex mno-pack
9697
9698 Do not pack VLIW instructions.
9699
9700 @item -mno-eflags
9701 @opindex mno-eflags
9702
9703 Do not mark ABI switches in e_flags.
9704
9705 @item -mcond-move
9706 @opindex mcond-move
9707
9708 Enable the use of conditional-move instructions (default).
9709
9710 This switch is mainly for debugging the compiler and will likely be removed
9711 in a future version.
9712
9713 @item -mno-cond-move
9714 @opindex mno-cond-move
9715
9716 Disable the use of conditional-move instructions.
9717
9718 This switch is mainly for debugging the compiler and will likely be removed
9719 in a future version.
9720
9721 @item -mscc
9722 @opindex mscc
9723
9724 Enable the use of conditional set instructions (default).
9725
9726 This switch is mainly for debugging the compiler and will likely be removed
9727 in a future version.
9728
9729 @item -mno-scc
9730 @opindex mno-scc
9731
9732 Disable the use of conditional set instructions.
9733
9734 This switch is mainly for debugging the compiler and will likely be removed
9735 in a future version.
9736
9737 @item -mcond-exec
9738 @opindex mcond-exec
9739
9740 Enable the use of conditional execution (default).
9741
9742 This switch is mainly for debugging the compiler and will likely be removed
9743 in a future version.
9744
9745 @item -mno-cond-exec
9746 @opindex mno-cond-exec
9747
9748 Disable the use of conditional execution.
9749
9750 This switch is mainly for debugging the compiler and will likely be removed
9751 in a future version.
9752
9753 @item -mvliw-branch
9754 @opindex mvliw-branch
9755
9756 Run a pass to pack branches into VLIW instructions (default).
9757
9758 This switch is mainly for debugging the compiler and will likely be removed
9759 in a future version.
9760
9761 @item -mno-vliw-branch
9762 @opindex mno-vliw-branch
9763
9764 Do not run a pass to pack branches into VLIW instructions.
9765
9766 This switch is mainly for debugging the compiler and will likely be removed
9767 in a future version.
9768
9769 @item -mmulti-cond-exec
9770 @opindex mmulti-cond-exec
9771
9772 Enable optimization of @code{&&} and @code{||} in conditional execution
9773 (default).
9774
9775 This switch is mainly for debugging the compiler and will likely be removed
9776 in a future version.
9777
9778 @item -mno-multi-cond-exec
9779 @opindex mno-multi-cond-exec
9780
9781 Disable optimization of @code{&&} and @code{||} in conditional execution.
9782
9783 This switch is mainly for debugging the compiler and will likely be removed
9784 in a future version.
9785
9786 @item -mnested-cond-exec
9787 @opindex mnested-cond-exec
9788
9789 Enable nested conditional execution optimizations (default).
9790
9791 This switch is mainly for debugging the compiler and will likely be removed
9792 in a future version.
9793
9794 @item -mno-nested-cond-exec
9795 @opindex mno-nested-cond-exec
9796
9797 Disable nested conditional execution optimizations.
9798
9799 This switch is mainly for debugging the compiler and will likely be removed
9800 in a future version.
9801
9802 @item -moptimize-membar
9803 @opindex moptimize-membar
9804
9805 This switch removes redundant @code{membar} instructions from the
9806 compiler generated code.  It is enabled by default.
9807
9808 @item -mno-optimize-membar
9809 @opindex mno-optimize-membar
9810
9811 This switch disables the automatic removal of redundant @code{membar}
9812 instructions from the generated code.
9813
9814 @item -mtomcat-stats
9815 @opindex mtomcat-stats
9816
9817 Cause gas to print out tomcat statistics.
9818
9819 @item -mcpu=@var{cpu}
9820 @opindex mcpu
9821
9822 Select the processor type for which to generate code.  Possible values are
9823 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
9824 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
9825
9826 @end table
9827
9828 @node GNU/Linux Options
9829 @subsection GNU/Linux Options
9830
9831 These @samp{-m} options are defined for GNU/Linux targets:
9832
9833 @table @gcctabopt
9834 @item -mglibc
9835 @opindex mglibc
9836 Use the GNU C library instead of uClibc.  This is the default except
9837 on @samp{*-*-linux-*uclibc*} targets.
9838
9839 @item -muclibc
9840 @opindex muclibc
9841 Use uClibc instead of the GNU C library.  This is the default on
9842 @samp{*-*-linux-*uclibc*} targets.
9843 @end table
9844
9845 @node H8/300 Options
9846 @subsection H8/300 Options
9847
9848 These @samp{-m} options are defined for the H8/300 implementations:
9849
9850 @table @gcctabopt
9851 @item -mrelax
9852 @opindex mrelax
9853 Shorten some address references at link time, when possible; uses the
9854 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
9855 ld, Using ld}, for a fuller description.
9856
9857 @item -mh
9858 @opindex mh
9859 Generate code for the H8/300H@.
9860
9861 @item -ms
9862 @opindex ms
9863 Generate code for the H8S@.
9864
9865 @item -mn
9866 @opindex mn
9867 Generate code for the H8S and H8/300H in the normal mode.  This switch
9868 must be used either with @option{-mh} or @option{-ms}.
9869
9870 @item -ms2600
9871 @opindex ms2600
9872 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
9873
9874 @item -mint32
9875 @opindex mint32
9876 Make @code{int} data 32 bits by default.
9877
9878 @item -malign-300
9879 @opindex malign-300
9880 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
9881 The default for the H8/300H and H8S is to align longs and floats on 4
9882 byte boundaries.
9883 @option{-malign-300} causes them to be aligned on 2 byte boundaries.
9884 This option has no effect on the H8/300.
9885 @end table
9886
9887 @node HPPA Options
9888 @subsection HPPA Options
9889 @cindex HPPA Options
9890
9891 These @samp{-m} options are defined for the HPPA family of computers:
9892
9893 @table @gcctabopt
9894 @item -march=@var{architecture-type}
9895 @opindex march
9896 Generate code for the specified architecture.  The choices for
9897 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
9898 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
9899 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
9900 architecture option for your machine.  Code compiled for lower numbered
9901 architectures will run on higher numbered architectures, but not the
9902 other way around.
9903
9904 @item -mpa-risc-1-0
9905 @itemx -mpa-risc-1-1
9906 @itemx -mpa-risc-2-0
9907 @opindex mpa-risc-1-0
9908 @opindex mpa-risc-1-1
9909 @opindex mpa-risc-2-0
9910 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
9911
9912 @item -mbig-switch
9913 @opindex mbig-switch
9914 Generate code suitable for big switch tables.  Use this option only if
9915 the assembler/linker complain about out of range branches within a switch
9916 table.
9917
9918 @item -mjump-in-delay
9919 @opindex mjump-in-delay
9920 Fill delay slots of function calls with unconditional jump instructions
9921 by modifying the return pointer for the function call to be the target
9922 of the conditional jump.
9923
9924 @item -mdisable-fpregs
9925 @opindex mdisable-fpregs
9926 Prevent floating point registers from being used in any manner.  This is
9927 necessary for compiling kernels which perform lazy context switching of
9928 floating point registers.  If you use this option and attempt to perform
9929 floating point operations, the compiler will abort.
9930
9931 @item -mdisable-indexing
9932 @opindex mdisable-indexing
9933 Prevent the compiler from using indexing address modes.  This avoids some
9934 rather obscure problems when compiling MIG generated code under MACH@.
9935
9936 @item -mno-space-regs
9937 @opindex mno-space-regs
9938 Generate code that assumes the target has no space registers.  This allows
9939 GCC to generate faster indirect calls and use unscaled index address modes.
9940
9941 Such code is suitable for level 0 PA systems and kernels.
9942
9943 @item -mfast-indirect-calls
9944 @opindex mfast-indirect-calls
9945 Generate code that assumes calls never cross space boundaries.  This
9946 allows GCC to emit code which performs faster indirect calls.
9947
9948 This option will not work in the presence of shared libraries or nested
9949 functions.
9950
9951 @item -mfixed-range=@var{register-range}
9952 @opindex mfixed-range
9953 Generate code treating the given register range as fixed registers.
9954 A fixed register is one that the register allocator can not use.  This is
9955 useful when compiling kernel code.  A register range is specified as
9956 two registers separated by a dash.  Multiple register ranges can be
9957 specified separated by a comma.
9958
9959 @item -mlong-load-store
9960 @opindex mlong-load-store
9961 Generate 3-instruction load and store sequences as sometimes required by
9962 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
9963 the HP compilers.
9964
9965 @item -mportable-runtime
9966 @opindex mportable-runtime
9967 Use the portable calling conventions proposed by HP for ELF systems.
9968
9969 @item -mgas
9970 @opindex mgas
9971 Enable the use of assembler directives only GAS understands.
9972
9973 @item -mschedule=@var{cpu-type}
9974 @opindex mschedule
9975 Schedule code according to the constraints for the machine type
9976 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
9977 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
9978 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
9979 proper scheduling option for your machine.  The default scheduling is
9980 @samp{8000}.
9981
9982 @item -mlinker-opt
9983 @opindex mlinker-opt
9984 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
9985 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
9986 linkers in which they give bogus error messages when linking some programs.
9987
9988 @item -msoft-float
9989 @opindex msoft-float
9990 Generate output containing library calls for floating point.
9991 @strong{Warning:} the requisite libraries are not available for all HPPA
9992 targets.  Normally the facilities of the machine's usual C compiler are
9993 used, but this cannot be done directly in cross-compilation.  You must make
9994 your own arrangements to provide suitable library functions for
9995 cross-compilation.  The embedded target @samp{hppa1.1-*-pro}
9996 does provide software floating point support.
9997
9998 @option{-msoft-float} changes the calling convention in the output file;
9999 therefore, it is only useful if you compile @emph{all} of a program with
10000 this option.  In particular, you need to compile @file{libgcc.a}, the
10001 library that comes with GCC, with @option{-msoft-float} in order for
10002 this to work.
10003
10004 @item -msio
10005 @opindex msio
10006 Generate the predefine, @code{_SIO}, for server IO@.  The default is
10007 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
10008 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
10009 options are available under HP-UX and HI-UX@.
10010
10011 @item -mgnu-ld
10012 @opindex gnu-ld
10013 Use GNU ld specific options.  This passes @option{-shared} to ld when
10014 building a shared library.  It is the default when GCC is configured,
10015 explicitly or implicitly, with the GNU linker.  This option does not
10016 have any affect on which ld is called, it only changes what parameters
10017 are passed to that ld.  The ld that is called is determined by the
10018 @option{--with-ld} configure option, GCC's program search path, and
10019 finally by the user's @env{PATH}.  The linker used by GCC can be printed
10020 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
10021 on the 64 bit HP-UX GCC, i.e. configured with @samp{hppa*64*-*-hpux*}.
10022
10023 @item -mhp-ld
10024 @opindex hp-ld
10025 Use HP ld specific options.  This passes @option{-b} to ld when building
10026 a shared library and passes @option{+Accept TypeMismatch} to ld on all
10027 links.  It is the default when GCC is configured, explicitly or
10028 implicitly, with the HP linker.  This option does not have any affect on
10029 which ld is called, it only changes what parameters are passed to that
10030 ld.  The ld that is called is determined by the @option{--with-ld}
10031 configure option, GCC's program search path, and finally by the user's
10032 @env{PATH}.  The linker used by GCC can be printed using @samp{which
10033 `gcc -print-prog-name=ld`}.  This option is only available on the 64 bit
10034 HP-UX GCC, i.e. configured with @samp{hppa*64*-*-hpux*}.
10035
10036 @item -mlong-calls
10037 @opindex mno-long-calls
10038 Generate code that uses long call sequences.  This ensures that a call
10039 is always able to reach linker generated stubs.  The default is to generate
10040 long calls only when the distance from the call site to the beginning
10041 of the function or translation unit, as the case may be, exceeds a
10042 predefined limit set by the branch type being used.  The limits for
10043 normal calls are 7,600,000 and 240,000 bytes, respectively for the
10044 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
10045 240,000 bytes.
10046
10047 Distances are measured from the beginning of functions when using the
10048 @option{-ffunction-sections} option, or when using the @option{-mgas}
10049 and @option{-mno-portable-runtime} options together under HP-UX with
10050 the SOM linker.
10051
10052 It is normally not desirable to use this option as it will degrade
10053 performance.  However, it may be useful in large applications,
10054 particularly when partial linking is used to build the application.
10055
10056 The types of long calls used depends on the capabilities of the
10057 assembler and linker, and the type of code being generated.  The
10058 impact on systems that support long absolute calls, and long pic
10059 symbol-difference or pc-relative calls should be relatively small.
10060 However, an indirect call is used on 32-bit ELF systems in pic code
10061 and it is quite long.
10062
10063 @item -munix=@var{unix-std}
10064 @opindex march
10065 Generate compiler predefines and select a startfile for the specified
10066 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
10067 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
10068 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
10069 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
10070 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
10071 and later.
10072
10073 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
10074 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
10075 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
10076 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
10077 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
10078 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
10079
10080 It is @emph{important} to note that this option changes the interfaces
10081 for various library routines.  It also affects the operational behavior
10082 of the C library.  Thus, @emph{extreme} care is needed in using this
10083 option.
10084
10085 Library code that is intended to operate with more than one UNIX
10086 standard must test, set and restore the variable @var{__xpg4_extended_mask}
10087 as appropriate.  Most GNU software doesn't provide this capability.
10088
10089 @item -nolibdld
10090 @opindex nolibdld
10091 Suppress the generation of link options to search libdld.sl when the
10092 @option{-static} option is specified on HP-UX 10 and later.
10093
10094 @item -static
10095 @opindex static
10096 The HP-UX implementation of setlocale in libc has a dependency on
10097 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
10098 when the @option{-static} option is specified, special link options
10099 are needed to resolve this dependency.
10100
10101 On HP-UX 10 and later, the GCC driver adds the necessary options to
10102 link with libdld.sl when the @option{-static} option is specified.
10103 This causes the resulting binary to be dynamic.  On the 64-bit port,
10104 the linkers generate dynamic binaries by default in any case.  The
10105 @option{-nolibdld} option can be used to prevent the GCC driver from
10106 adding these link options.
10107
10108 @item -threads
10109 @opindex threads
10110 Add support for multithreading with the @dfn{dce thread} library
10111 under HP-UX@.  This option sets flags for both the preprocessor and
10112 linker.
10113 @end table
10114
10115 @node i386 and x86-64 Options
10116 @subsection Intel 386 and AMD x86-64 Options
10117 @cindex i386 Options
10118 @cindex x86-64 Options
10119 @cindex Intel 386 Options
10120 @cindex AMD x86-64 Options
10121
10122 These @samp{-m} options are defined for the i386 and x86-64 family of
10123 computers:
10124
10125 @table @gcctabopt
10126 @item -mtune=@var{cpu-type}
10127 @opindex mtune
10128 Tune to @var{cpu-type} everything applicable about the generated code, except
10129 for the ABI and the set of available instructions.  The choices for
10130 @var{cpu-type} are:
10131 @table @emph
10132 @item generic
10133 Produce code optimized for the most common IA32/AMD64/EM64T processors.
10134 If you know the CPU on which your code will run, then you should use
10135 the corresponding @option{-mtune} option instead of
10136 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
10137 of your application will have, then you should use this option.
10138
10139 As new processors are deployed in the marketplace, the behavior of this
10140 option will change.  Therefore, if you upgrade to a newer version of
10141 GCC, the code generated option will change to reflect the processors
10142 that were most common when that version of GCC was released.
10143
10144 There is no @option{-march=generic} option because @option{-march}
10145 indicates the instruction set the compiler can use, and there is no
10146 generic instruction set applicable to all processors.  In contrast,
10147 @option{-mtune} indicates the processor (or, in this case, collection of
10148 processors) for which the code is optimized.
10149 @item native
10150 This selects the CPU to tune for at compilation time by determining
10151 the processor type of the compiling machine.  Using @option{-mtune=native}
10152 will produce code optimized for the local machine under the constraints
10153 of the selected instruction set.  Using @option{-march=native} will
10154 enable all instruction subsets supported by the local machine (hence
10155 the result might not run on different machines).
10156 @item i386
10157 Original Intel's i386 CPU@.
10158 @item i486
10159 Intel's i486 CPU@.  (No scheduling is implemented for this chip.)
10160 @item i586, pentium
10161 Intel Pentium CPU with no MMX support.
10162 @item pentium-mmx
10163 Intel PentiumMMX CPU based on Pentium core with MMX instruction set support.
10164 @item pentiumpro
10165 Intel PentiumPro CPU@.
10166 @item i686
10167 Same as @code{generic}, but when used as @code{march} option, PentiumPro
10168 instruction set will be used, so the code will run on all i686 family chips.
10169 @item pentium2
10170 Intel Pentium2 CPU based on PentiumPro core with MMX instruction set support.
10171 @item pentium3, pentium3m
10172 Intel Pentium3 CPU based on PentiumPro core with MMX and SSE instruction set
10173 support.
10174 @item pentium-m
10175 Low power version of Intel Pentium3 CPU with MMX, SSE and SSE2 instruction set
10176 support.  Used by Centrino notebooks.
10177 @item pentium4, pentium4m
10178 Intel Pentium4 CPU with MMX, SSE and SSE2 instruction set support.
10179 @item prescott
10180 Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2 and SSE3 instruction
10181 set support.
10182 @item nocona
10183 Improved version of Intel Pentium4 CPU with 64-bit extensions, MMX, SSE,
10184 SSE2 and SSE3 instruction set support.
10185 @item core2
10186 Intel Core2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
10187 instruction set support.
10188 @item k6
10189 AMD K6 CPU with MMX instruction set support.
10190 @item k6-2, k6-3
10191 Improved versions of AMD K6 CPU with MMX and 3dNOW! instruction set support.
10192 @item athlon, athlon-tbird
10193 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and SSE prefetch instructions
10194 support.
10195 @item athlon-4, athlon-xp, athlon-mp
10196 Improved AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and full SSE
10197 instruction set support.
10198 @item k8, opteron, athlon64, athlon-fx
10199 AMD K8 core based CPUs with x86-64 instruction set support.  (This supersets
10200 MMX, SSE, SSE2, 3dNOW!, enhanced 3dNOW! and 64-bit instruction set extensions.)
10201 @item k8-sse3, opteron-sse3, athlon64-sse3
10202 Improved versions of k8, opteron and athlon64 with SSE3 instruction set support.
10203 @item amdfam10, barcelona
10204 AMD Family 10h core based CPUs with x86-64 instruction set support.  (This
10205 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3dNOW!, enhanced 3dNOW!, ABM and 64-bit
10206 instruction set extensions.)
10207 @item winchip-c6
10208 IDT Winchip C6 CPU, dealt in same way as i486 with additional MMX instruction
10209 set support.
10210 @item winchip2
10211 IDT Winchip2 CPU, dealt in same way as i486 with additional MMX and 3dNOW!
10212 instruction set support.
10213 @item c3
10214 Via C3 CPU with MMX and 3dNOW! instruction set support.  (No scheduling is
10215 implemented for this chip.)
10216 @item c3-2
10217 Via C3-2 CPU with MMX and SSE instruction set support.  (No scheduling is
10218 implemented for this chip.)
10219 @item geode
10220 Embedded AMD CPU with MMX and 3dNOW! instruction set support.
10221 @end table
10222
10223 While picking a specific @var{cpu-type} will schedule things appropriately
10224 for that particular chip, the compiler will not generate any code that
10225 does not run on the i386 without the @option{-march=@var{cpu-type}} option
10226 being used.
10227
10228 @item -march=@var{cpu-type}
10229 @opindex march
10230 Generate instructions for the machine type @var{cpu-type}.  The choices
10231 for @var{cpu-type} are the same as for @option{-mtune}.  Moreover,
10232 specifying @option{-march=@var{cpu-type}} implies @option{-mtune=@var{cpu-type}}.
10233
10234 @item -mcpu=@var{cpu-type}
10235 @opindex mcpu
10236 A deprecated synonym for @option{-mtune}.
10237
10238 @item -mfpmath=@var{unit}
10239 @opindex march
10240 Generate floating point arithmetics for selected unit @var{unit}.  The choices
10241 for @var{unit} are:
10242
10243 @table @samp
10244 @item 387
10245 Use the standard 387 floating point coprocessor present majority of chips and
10246 emulated otherwise.  Code compiled with this option will run almost everywhere.
10247 The temporary results are computed in 80bit precision instead of precision
10248 specified by the type resulting in slightly different results compared to most
10249 of other chips.  See @option{-ffloat-store} for more detailed description.
10250
10251 This is the default choice for i386 compiler.
10252
10253 @item sse
10254 Use scalar floating point instructions present in the SSE instruction set.
10255 This instruction set is supported by Pentium3 and newer chips, in the AMD line
10256 by Athlon-4, Athlon-xp and Athlon-mp chips.  The earlier version of SSE
10257 instruction set supports only single precision arithmetics, thus the double and
10258 extended precision arithmetics is still done using 387.  Later version, present
10259 only in Pentium4 and the future AMD x86-64 chips supports double precision
10260 arithmetics too.
10261
10262 For the i386 compiler, you need to use @option{-march=@var{cpu-type}}, @option{-msse}
10263 or @option{-msse2} switches to enable SSE extensions and make this option
10264 effective.  For the x86-64 compiler, these extensions are enabled by default.
10265
10266 The resulting code should be considerably faster in the majority of cases and avoid
10267 the numerical instability problems of 387 code, but may break some existing
10268 code that expects temporaries to be 80bit.
10269
10270 This is the default choice for the x86-64 compiler.
10271
10272 @item sse,387
10273 Attempt to utilize both instruction sets at once.  This effectively double the
10274 amount of available registers and on chips with separate execution units for
10275 387 and SSE the execution resources too.  Use this option with care, as it is
10276 still experimental, because the GCC register allocator does not model separate
10277 functional units well resulting in instable performance.
10278 @end table
10279
10280 @item -masm=@var{dialect}
10281 @opindex masm=@var{dialect}
10282 Output asm instructions using selected @var{dialect}.  Supported
10283 choices are @samp{intel} or @samp{att} (the default one).  Darwin does
10284 not support @samp{intel}.
10285
10286 @item -mieee-fp
10287 @itemx -mno-ieee-fp
10288 @opindex mieee-fp
10289 @opindex mno-ieee-fp
10290 Control whether or not the compiler uses IEEE floating point
10291 comparisons.  These handle correctly the case where the result of a
10292 comparison is unordered.
10293
10294 @item -msoft-float
10295 @opindex msoft-float
10296 Generate output containing library calls for floating point.
10297 @strong{Warning:} the requisite libraries are not part of GCC@.
10298 Normally the facilities of the machine's usual C compiler are used, but
10299 this can't be done directly in cross-compilation.  You must make your
10300 own arrangements to provide suitable library functions for
10301 cross-compilation.
10302
10303 On machines where a function returns floating point results in the 80387
10304 register stack, some floating point opcodes may be emitted even if
10305 @option{-msoft-float} is used.
10306
10307 @item -mno-fp-ret-in-387
10308 @opindex mno-fp-ret-in-387
10309 Do not use the FPU registers for return values of functions.
10310
10311 The usual calling convention has functions return values of types
10312 @code{float} and @code{double} in an FPU register, even if there
10313 is no FPU@.  The idea is that the operating system should emulate
10314 an FPU@.
10315
10316 The option @option{-mno-fp-ret-in-387} causes such values to be returned
10317 in ordinary CPU registers instead.
10318
10319 @item -mno-fancy-math-387
10320 @opindex mno-fancy-math-387
10321 Some 387 emulators do not support the @code{sin}, @code{cos} and
10322 @code{sqrt} instructions for the 387.  Specify this option to avoid
10323 generating those instructions.  This option is the default on FreeBSD,
10324 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
10325 indicates that the target cpu will always have an FPU and so the
10326 instruction will not need emulation.  As of revision 2.6.1, these
10327 instructions are not generated unless you also use the
10328 @option{-funsafe-math-optimizations} switch.
10329
10330 @item -malign-double
10331 @itemx -mno-align-double
10332 @opindex malign-double
10333 @opindex mno-align-double
10334 Control whether GCC aligns @code{double}, @code{long double}, and
10335 @code{long long} variables on a two word boundary or a one word
10336 boundary.  Aligning @code{double} variables on a two word boundary will
10337 produce code that runs somewhat faster on a @samp{Pentium} at the
10338 expense of more memory.
10339
10340 On x86-64, @option{-malign-double} is enabled by default.
10341
10342 @strong{Warning:} if you use the @option{-malign-double} switch,
10343 structures containing the above types will be aligned differently than
10344 the published application binary interface specifications for the 386
10345 and will not be binary compatible with structures in code compiled
10346 without that switch.
10347
10348 @item -m96bit-long-double
10349 @itemx -m128bit-long-double
10350 @opindex m96bit-long-double
10351 @opindex m128bit-long-double
10352 These switches control the size of @code{long double} type.  The i386
10353 application binary interface specifies the size to be 96 bits,
10354 so @option{-m96bit-long-double} is the default in 32 bit mode.
10355
10356 Modern architectures (Pentium and newer) would prefer @code{long double}
10357 to be aligned to an 8 or 16 byte boundary.  In arrays or structures
10358 conforming to the ABI, this would not be possible.  So specifying a
10359 @option{-m128bit-long-double} will align @code{long double}
10360 to a 16 byte boundary by padding the @code{long double} with an additional
10361 32 bit zero.
10362
10363 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
10364 its ABI specifies that @code{long double} is to be aligned on 16 byte boundary.
10365
10366 Notice that neither of these options enable any extra precision over the x87
10367 standard of 80 bits for a @code{long double}.
10368
10369 @strong{Warning:} if you override the default value for your target ABI, the
10370 structures and arrays containing @code{long double} variables will change
10371 their size as well as function calling convention for function taking
10372 @code{long double} will be modified.  Hence they will not be binary
10373 compatible with arrays or structures in code compiled without that switch.
10374
10375 @item -mmlarge-data-threshold=@var{number}
10376 @opindex mlarge-data-threshold=@var{number}
10377 When @option{-mcmodel=medium} is specified, the data greater than
10378 @var{threshold} are placed in large data section.  This value must be the
10379 same across all object linked into the binary and defaults to 65535.
10380
10381 @item -mrtd
10382 @opindex mrtd
10383 Use a different function-calling convention, in which functions that
10384 take a fixed number of arguments return with the @code{ret} @var{num}
10385 instruction, which pops their arguments while returning.  This saves one
10386 instruction in the caller since there is no need to pop the arguments
10387 there.
10388
10389 You can specify that an individual function is called with this calling
10390 sequence with the function attribute @samp{stdcall}.  You can also
10391 override the @option{-mrtd} option by using the function attribute
10392 @samp{cdecl}.  @xref{Function Attributes}.
10393
10394 @strong{Warning:} this calling convention is incompatible with the one
10395 normally used on Unix, so you cannot use it if you need to call
10396 libraries compiled with the Unix compiler.
10397
10398 Also, you must provide function prototypes for all functions that
10399 take variable numbers of arguments (including @code{printf});
10400 otherwise incorrect code will be generated for calls to those
10401 functions.
10402
10403 In addition, seriously incorrect code will result if you call a
10404 function with too many arguments.  (Normally, extra arguments are
10405 harmlessly ignored.)
10406
10407 @item -mregparm=@var{num}
10408 @opindex mregparm
10409 Control how many registers are used to pass integer arguments.  By
10410 default, no registers are used to pass arguments, and at most 3
10411 registers can be used.  You can control this behavior for a specific
10412 function by using the function attribute @samp{regparm}.
10413 @xref{Function Attributes}.
10414
10415 @strong{Warning:} if you use this switch, and
10416 @var{num} is nonzero, then you must build all modules with the same
10417 value, including any libraries.  This includes the system libraries and
10418 startup modules.
10419
10420 @item -msseregparm
10421 @opindex msseregparm
10422 Use SSE register passing conventions for float and double arguments
10423 and return values.  You can control this behavior for a specific
10424 function by using the function attribute @samp{sseregparm}.
10425 @xref{Function Attributes}.
10426
10427 @strong{Warning:} if you use this switch then you must build all
10428 modules with the same value, including any libraries.  This includes
10429 the system libraries and startup modules.
10430
10431 @item -mpc32
10432 @itemx -mpc64
10433 @itemx -mpc80
10434 @opindex mpc32
10435 @opindex mpc64
10436 @opindex mpc80
10437
10438 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
10439 is specified, the significands of results of floating-point operations are
10440 rounded to 24 bits (single precision); @option{-mpc64} rounds the the
10441 significands of results of floating-point operations to 53 bits (double
10442 precision) and @option{-mpc80} rounds the significands of results of
10443 floating-point operations to 64 bits (extended double precision), which is
10444 the default.  When this option is used, floating-point operations in higher
10445 precisions are not available to the programmer without setting the FPU
10446 control word explicitly.
10447
10448 Setting the rounding of floating-point operations to less than the default
10449 80 bits can speed some programs by 2% or more.  Note that some mathematical
10450 libraries assume that extended precision (80 bit) floating-point operations
10451 are enabled by default; routines in such libraries could suffer significant
10452 loss of accuracy, typically through so-called "catastrophic cancellation",
10453 when this option is used to set the precision to less than extended precision. 
10454
10455 @item -mstackrealign
10456 @opindex mstackrealign
10457 Realign the stack at entry.  On the Intel x86, the
10458 @option{-mstackrealign} option will generate an alternate prologue and
10459 epilogue that realigns the runtime stack.  This supports mixing legacy
10460 codes that keep a 4-byte aligned stack with modern codes that keep a
10461 16-byte stack for SSE compatibility.  The alternate prologue and
10462 epilogue are slower and bigger than the regular ones, and the
10463 alternate prologue requires an extra scratch register; this lowers the
10464 number of registers available if used in conjunction with the
10465 @code{regparm} attribute.  The @option{-mstackrealign} option is
10466 incompatible with the nested function prologue; this is considered a
10467 hard error.  See also the attribute @code{force_align_arg_pointer},
10468 applicable to individual functions.
10469
10470 @item -mpreferred-stack-boundary=@var{num}
10471 @opindex mpreferred-stack-boundary
10472 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
10473 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
10474 the default is 4 (16 bytes or 128 bits).
10475
10476 On Pentium and PentiumPro, @code{double} and @code{long double} values
10477 should be aligned to an 8 byte boundary (see @option{-malign-double}) or
10478 suffer significant run time performance penalties.  On Pentium III, the
10479 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
10480 properly if it is not 16 byte aligned.
10481
10482 To ensure proper alignment of this values on the stack, the stack boundary
10483 must be as aligned as that required by any value stored on the stack.
10484 Further, every function must be generated such that it keeps the stack
10485 aligned.  Thus calling a function compiled with a higher preferred
10486 stack boundary from a function compiled with a lower preferred stack
10487 boundary will most likely misalign the stack.  It is recommended that
10488 libraries that use callbacks always use the default setting.
10489
10490 This extra alignment does consume extra stack space, and generally
10491 increases code size.  Code that is sensitive to stack space usage, such
10492 as embedded systems and operating system kernels, may want to reduce the
10493 preferred alignment to @option{-mpreferred-stack-boundary=2}.
10494
10495 @item -mmmx
10496 @itemx -mno-mmx
10497 @item -msse
10498 @itemx -mno-sse
10499 @item -msse2
10500 @itemx -mno-sse2
10501 @item -msse3
10502 @itemx -mno-sse3
10503 @item -mssse3
10504 @itemx -mno-ssse3
10505 @item -msse4.1
10506 @itemx -mno-sse4.1
10507 @item -msse4.2
10508 @itemx -mno-sse4.2
10509 @item -msse4
10510 @itemx -mno-sse4
10511 @item -msse4a
10512 @item -mno-sse4a
10513 @item -msse5
10514 @itemx -mno-sse5
10515 @item -m3dnow
10516 @itemx -mno-3dnow
10517 @item -mpopcnt
10518 @itemx -mno-popcnt
10519 @item -mabm
10520 @itemx -mno-abm
10521 @opindex mmmx
10522 @opindex mno-mmx
10523 @opindex msse
10524 @opindex mno-sse
10525 @opindex m3dnow
10526 @opindex mno-3dnow
10527 These switches enable or disable the use of instructions in the MMX,
10528 SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4A, SSE5, ABM or 3DNow! extended
10529 instruction sets.
10530 These extensions are also available as built-in functions: see
10531 @ref{X86 Built-in Functions}, for details of the functions enabled and
10532 disabled by these switches.
10533
10534 To have SSE/SSE2 instructions generated automatically from floating-point
10535 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
10536
10537 These options will enable GCC to use these extended instructions in
10538 generated code, even without @option{-mfpmath=sse}.  Applications which
10539 perform runtime CPU detection must compile separate files for each
10540 supported architecture, using the appropriate flags.  In particular,
10541 the file containing the CPU detection code should be compiled without
10542 these options.
10543
10544 @item -mcx16
10545 @opindex mcx16
10546 This option will enable GCC to use CMPXCHG16B instruction in generated code.
10547 CMPXCHG16B allows for atomic operations on 128-bit double quadword (or oword)
10548 data types.  This is useful for high resolution counters that could be updated
10549 by multiple processors (or cores).  This instruction is generated as part of
10550 atomic built-in functions: see @ref{Atomic Builtins} for details.
10551
10552 @item -msahf
10553 @opindex msahf
10554 This option will enable GCC to use SAHF instruction in generated 64-bit code.
10555 Early Intel CPUs with Intel 64 lacked LAHF and SAHF instructions supported
10556 by AMD64 until introduction of Pentium 4 G1 step in December 2005.  LAHF and
10557 SAHF are load and store instructions, respectively, for certain status flags.
10558 In 64-bit mode, SAHF instruction is used to optimize @code{fmod}, @code{drem}
10559 or @code{remainder} built-in functions: see @ref{Other Builtins} for details.
10560
10561 @item -mrecip
10562 @opindex mrecip
10563 This option will enable GCC to use RCPSS and RSQRTSS instructions (and their
10564 vectorized variants RCPPS and RSQRTPS) instead of DIVSS and SQRTSS (and their
10565 vectorized variants).  These instructions will be generated only when
10566 @option{-funsafe-math-optimizations} is enabled.
10567
10568 @item -mveclibabi=@var{type}
10569 @opindex mveclibabi
10570 Specifies the ABI type to use for vectorizing intrinsics using an
10571 external library.  Supported types are @code{acml} for the AMD
10572 math core library style of interfacing.  GCC will currently emit
10573 calls to @code{__vrd2_sin}, @code{__vrd2_cos}, @code{__vrd2_exp},
10574 @code{__vrd2_log}, @code{__vrd2_log2}, @code{__vrd2_log10},
10575 @code{__vrs4_sinf}, @code{__vrs4_cosf}, @code{__vrs4_expf},
10576 @code{__vrs4_logf}, @code{__vrs4_log2f}, @code{__vrs4_log10f}
10577 and @code{__vrs4_powf} when using this type and @option{-ftree-vectorize}
10578 is enabled.  A ACML ABI compatible library will have to be specified
10579 at link time.
10580
10581 @item -mpush-args
10582 @itemx -mno-push-args
10583 @opindex mpush-args
10584 @opindex mno-push-args
10585 Use PUSH operations to store outgoing parameters.  This method is shorter
10586 and usually equally fast as method using SUB/MOV operations and is enabled
10587 by default.  In some cases disabling it may improve performance because of
10588 improved scheduling and reduced dependencies.
10589
10590 @item -maccumulate-outgoing-args
10591 @opindex maccumulate-outgoing-args
10592 If enabled, the maximum amount of space required for outgoing arguments will be
10593 computed in the function prologue.  This is faster on most modern CPUs
10594 because of reduced dependencies, improved scheduling and reduced stack usage
10595 when preferred stack boundary is not equal to 2.  The drawback is a notable
10596 increase in code size.  This switch implies @option{-mno-push-args}.
10597
10598 @item -mthreads
10599 @opindex mthreads
10600 Support thread-safe exception handling on @samp{Mingw32}.  Code that relies
10601 on thread-safe exception handling must compile and link all code with the
10602 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
10603 @option{-D_MT}; when linking, it links in a special thread helper library
10604 @option{-lmingwthrd} which cleans up per thread exception handling data.
10605
10606 @item -mno-align-stringops
10607 @opindex mno-align-stringops
10608 Do not align destination of inlined string operations.  This switch reduces
10609 code size and improves performance in case the destination is already aligned,
10610 but GCC doesn't know about it.
10611
10612 @item -minline-all-stringops
10613 @opindex minline-all-stringops
10614 By default GCC inlines string operations only when destination is known to be
10615 aligned at least to 4 byte boundary.  This enables more inlining, increase code
10616 size, but may improve performance of code that depends on fast memcpy, strlen
10617 and memset for short lengths.
10618
10619 @item -minline-stringops-dynamically
10620 @opindex minline-stringops-dynamically
10621 For string operation of unknown size, inline runtime checks so for small
10622 blocks inline code is used, while for large blocks library call is used.
10623
10624 @item -mstringop-strategy=@var{alg}
10625 @opindex mstringop-strategy=@var{alg}
10626 Overwrite internal decision heuristic about particular algorithm to inline
10627 string operation with.  The allowed values are @code{rep_byte},
10628 @code{rep_4byte}, @code{rep_8byte} for expanding using i386 @code{rep} prefix
10629 of specified size, @code{byte_loop}, @code{loop}, @code{unrolled_loop} for
10630 expanding inline loop, @code{libcall} for always expanding library call.
10631
10632 @item -momit-leaf-frame-pointer
10633 @opindex momit-leaf-frame-pointer
10634 Don't keep the frame pointer in a register for leaf functions.  This
10635 avoids the instructions to save, set up and restore frame pointers and
10636 makes an extra register available in leaf functions.  The option
10637 @option{-fomit-frame-pointer} removes the frame pointer for all functions
10638 which might make debugging harder.
10639
10640 @item -mtls-direct-seg-refs
10641 @itemx -mno-tls-direct-seg-refs
10642 @opindex mtls-direct-seg-refs
10643 Controls whether TLS variables may be accessed with offsets from the
10644 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
10645 or whether the thread base pointer must be added.  Whether or not this
10646 is legal depends on the operating system, and whether it maps the
10647 segment to cover the entire TLS area.
10648
10649 For systems that use GNU libc, the default is on.
10650
10651 @item -mfused-madd
10652 @itemx -mno-fused-madd
10653 @opindex mfused-madd
10654 Enable automatic generation of fused floating point multiply-add instructions
10655 if the ISA supports such instructions.  The -mfused-madd option is on by
10656 default.  The fused multiply-add instructions have a different
10657 rounding behavior compared to executing a multiply followed by an add.
10658 @end table
10659
10660 These @samp{-m} switches are supported in addition to the above
10661 on AMD x86-64 processors in 64-bit environments.
10662
10663 @table @gcctabopt
10664 @item -m32
10665 @itemx -m64
10666 @opindex m32
10667 @opindex m64
10668 Generate code for a 32-bit or 64-bit environment.
10669 The 32-bit environment sets int, long and pointer to 32 bits and
10670 generates code that runs on any i386 system.
10671 The 64-bit environment sets int to 32 bits and long and pointer
10672 to 64 bits and generates code for AMD's x86-64 architecture. For
10673 darwin only the -m64 option turns off the @option{-fno-pic} and
10674 @option{-mdynamic-no-pic} options.
10675
10676 @item -mno-red-zone
10677 @opindex no-red-zone
10678 Do not use a so called red zone for x86-64 code.  The red zone is mandated
10679 by the x86-64 ABI, it is a 128-byte area beyond the location of the
10680 stack pointer that will not be modified by signal or interrupt handlers
10681 and therefore can be used for temporary data without adjusting the stack
10682 pointer.  The flag @option{-mno-red-zone} disables this red zone.
10683
10684 @item -mcmodel=small
10685 @opindex mcmodel=small
10686 Generate code for the small code model: the program and its symbols must
10687 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
10688 Programs can be statically or dynamically linked.  This is the default
10689 code model.
10690
10691 @item -mcmodel=kernel
10692 @opindex mcmodel=kernel
10693 Generate code for the kernel code model.  The kernel runs in the
10694 negative 2 GB of the address space.
10695 This model has to be used for Linux kernel code.
10696
10697 @item -mcmodel=medium
10698 @opindex mcmodel=medium
10699 Generate code for the medium model: The program is linked in the lower 2
10700 GB of the address space but symbols can be located anywhere in the
10701 address space.  Programs can be statically or dynamically linked, but
10702 building of shared libraries are not supported with the medium model.
10703
10704 @item -mcmodel=large
10705 @opindex mcmodel=large
10706 Generate code for the large model: This model makes no assumptions
10707 about addresses and sizes of sections.
10708 @end table
10709
10710 @node IA-64 Options
10711 @subsection IA-64 Options
10712 @cindex IA-64 Options
10713
10714 These are the @samp{-m} options defined for the Intel IA-64 architecture.
10715
10716 @table @gcctabopt
10717 @item -mbig-endian
10718 @opindex mbig-endian
10719 Generate code for a big endian target.  This is the default for HP-UX@.
10720
10721 @item -mlittle-endian
10722 @opindex mlittle-endian
10723 Generate code for a little endian target.  This is the default for AIX5
10724 and GNU/Linux.
10725
10726 @item -mgnu-as
10727 @itemx -mno-gnu-as
10728 @opindex mgnu-as
10729 @opindex mno-gnu-as
10730 Generate (or don't) code for the GNU assembler.  This is the default.
10731 @c Also, this is the default if the configure option @option{--with-gnu-as}
10732 @c is used.
10733
10734 @item -mgnu-ld
10735 @itemx -mno-gnu-ld
10736 @opindex mgnu-ld
10737 @opindex mno-gnu-ld
10738 Generate (or don't) code for the GNU linker.  This is the default.
10739 @c Also, this is the default if the configure option @option{--with-gnu-ld}
10740 @c is used.
10741
10742 @item -mno-pic
10743 @opindex mno-pic
10744 Generate code that does not use a global pointer register.  The result
10745 is not position independent code, and violates the IA-64 ABI@.
10746
10747 @item -mvolatile-asm-stop
10748 @itemx -mno-volatile-asm-stop
10749 @opindex mvolatile-asm-stop
10750 @opindex mno-volatile-asm-stop
10751 Generate (or don't) a stop bit immediately before and after volatile asm
10752 statements.
10753
10754 @item -mregister-names
10755 @itemx -mno-register-names
10756 @opindex mregister-names
10757 @opindex mno-register-names
10758 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
10759 the stacked registers.  This may make assembler output more readable.
10760
10761 @item -mno-sdata
10762 @itemx -msdata
10763 @opindex mno-sdata
10764 @opindex msdata
10765 Disable (or enable) optimizations that use the small data section.  This may
10766 be useful for working around optimizer bugs.
10767
10768 @item -mconstant-gp
10769 @opindex mconstant-gp
10770 Generate code that uses a single constant global pointer value.  This is
10771 useful when compiling kernel code.
10772
10773 @item -mauto-pic
10774 @opindex mauto-pic
10775 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
10776 This is useful when compiling firmware code.
10777
10778 @item -minline-float-divide-min-latency
10779 @opindex minline-float-divide-min-latency
10780 Generate code for inline divides of floating point values
10781 using the minimum latency algorithm.
10782
10783 @item -minline-float-divide-max-throughput
10784 @opindex minline-float-divide-max-throughput
10785 Generate code for inline divides of floating point values
10786 using the maximum throughput algorithm.
10787
10788 @item -minline-int-divide-min-latency
10789 @opindex minline-int-divide-min-latency
10790 Generate code for inline divides of integer values
10791 using the minimum latency algorithm.
10792
10793 @item -minline-int-divide-max-throughput
10794 @opindex minline-int-divide-max-throughput
10795 Generate code for inline divides of integer values
10796 using the maximum throughput algorithm.
10797
10798 @item -minline-sqrt-min-latency
10799 @opindex minline-sqrt-min-latency
10800 Generate code for inline square roots
10801 using the minimum latency algorithm.
10802
10803 @item -minline-sqrt-max-throughput
10804 @opindex minline-sqrt-max-throughput
10805 Generate code for inline square roots
10806 using the maximum throughput algorithm.
10807
10808 @item -mno-dwarf2-asm
10809 @itemx -mdwarf2-asm
10810 @opindex mno-dwarf2-asm
10811 @opindex mdwarf2-asm
10812 Don't (or do) generate assembler code for the DWARF2 line number debugging
10813 info.  This may be useful when not using the GNU assembler.
10814
10815 @item -mearly-stop-bits
10816 @itemx -mno-early-stop-bits
10817 @opindex mearly-stop-bits
10818 @opindex mno-early-stop-bits
10819 Allow stop bits to be placed earlier than immediately preceding the
10820 instruction that triggered the stop bit.  This can improve instruction
10821 scheduling, but does not always do so.
10822
10823 @item -mfixed-range=@var{register-range}
10824 @opindex mfixed-range
10825 Generate code treating the given register range as fixed registers.
10826 A fixed register is one that the register allocator can not use.  This is
10827 useful when compiling kernel code.  A register range is specified as
10828 two registers separated by a dash.  Multiple register ranges can be
10829 specified separated by a comma.
10830
10831 @item -mtls-size=@var{tls-size}
10832 @opindex mtls-size
10833 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
10834 64.
10835
10836 @item -mtune=@var{cpu-type}
10837 @opindex mtune
10838 Tune the instruction scheduling for a particular CPU, Valid values are
10839 itanium, itanium1, merced, itanium2, and mckinley.
10840
10841 @item -mt
10842 @itemx -pthread
10843 @opindex mt
10844 @opindex pthread
10845 Add support for multithreading using the POSIX threads library.  This
10846 option sets flags for both the preprocessor and linker.  It does
10847 not affect the thread safety of object code produced by the compiler or
10848 that of libraries supplied with it.  These are HP-UX specific flags.
10849
10850 @item -milp32
10851 @itemx -mlp64
10852 @opindex milp32
10853 @opindex mlp64
10854 Generate code for a 32-bit or 64-bit environment.
10855 The 32-bit environment sets int, long and pointer to 32 bits.
10856 The 64-bit environment sets int to 32 bits and long and pointer
10857 to 64 bits.  These are HP-UX specific flags.
10858
10859 @item -mno-sched-br-data-spec
10860 @itemx -msched-br-data-spec
10861 @opindex mno-sched-br-data-spec
10862 @opindex msched-br-data-spec
10863 (Dis/En)able data speculative scheduling before reload.
10864 This will result in generation of the ld.a instructions and
10865 the corresponding check instructions (ld.c / chk.a).
10866 The default is 'disable'.
10867
10868 @item -msched-ar-data-spec
10869 @itemx -mno-sched-ar-data-spec
10870 @opindex msched-ar-data-spec
10871 @opindex mno-sched-ar-data-spec
10872 (En/Dis)able data speculative scheduling after reload.
10873 This will result in generation of the ld.a instructions and
10874 the corresponding check instructions (ld.c / chk.a).
10875 The default is 'enable'.
10876
10877 @item -mno-sched-control-spec
10878 @itemx -msched-control-spec
10879 @opindex mno-sched-control-spec
10880 @opindex msched-control-spec
10881 (Dis/En)able control speculative scheduling.  This feature is
10882 available only during region scheduling (i.e. before reload).
10883 This will result in generation of the ld.s instructions and
10884 the corresponding check instructions chk.s .
10885 The default is 'disable'.
10886
10887 @item -msched-br-in-data-spec
10888 @itemx -mno-sched-br-in-data-spec
10889 @opindex msched-br-in-data-spec
10890 @opindex mno-sched-br-in-data-spec
10891 (En/Dis)able speculative scheduling of the instructions that
10892 are dependent on the data speculative loads before reload.
10893 This is effective only with @option{-msched-br-data-spec} enabled.
10894 The default is 'enable'.
10895
10896 @item -msched-ar-in-data-spec
10897 @itemx -mno-sched-ar-in-data-spec
10898 @opindex msched-ar-in-data-spec
10899 @opindex mno-sched-ar-in-data-spec
10900 (En/Dis)able speculative scheduling of the instructions that
10901 are dependent on the data speculative loads after reload.
10902 This is effective only with @option{-msched-ar-data-spec} enabled.
10903 The default is 'enable'.
10904
10905 @item -msched-in-control-spec
10906 @itemx -mno-sched-in-control-spec
10907 @opindex msched-in-control-spec
10908 @opindex mno-sched-in-control-spec
10909 (En/Dis)able speculative scheduling of the instructions that
10910 are dependent on the control speculative loads.
10911 This is effective only with @option{-msched-control-spec} enabled.
10912 The default is 'enable'.
10913
10914 @item -msched-ldc
10915 @itemx -mno-sched-ldc
10916 @opindex msched-ldc
10917 @opindex mno-sched-ldc
10918 (En/Dis)able use of simple data speculation checks ld.c .
10919 If disabled, only chk.a instructions will be emitted to check
10920 data speculative loads.
10921 The default is 'enable'.
10922
10923 @item -mno-sched-control-ldc
10924 @itemx -msched-control-ldc
10925 @opindex mno-sched-control-ldc
10926 @opindex msched-control-ldc
10927 (Dis/En)able use of ld.c instructions to check control speculative loads.
10928 If enabled, in case of control speculative load with no speculatively
10929 scheduled dependent instructions this load will be emitted as ld.sa and
10930 ld.c will be used to check it.
10931 The default is 'disable'.
10932
10933 @item -mno-sched-spec-verbose
10934 @itemx -msched-spec-verbose
10935 @opindex mno-sched-spec-verbose
10936 @opindex msched-spec-verbose
10937 (Dis/En)able printing of the information about speculative motions.
10938
10939 @item -mno-sched-prefer-non-data-spec-insns
10940 @itemx -msched-prefer-non-data-spec-insns
10941 @opindex mno-sched-prefer-non-data-spec-insns
10942 @opindex msched-prefer-non-data-spec-insns
10943 If enabled, data speculative instructions will be chosen for schedule
10944 only if there are no other choices at the moment.  This will make
10945 the use of the data speculation much more conservative.
10946 The default is 'disable'.
10947
10948 @item -mno-sched-prefer-non-control-spec-insns
10949 @itemx -msched-prefer-non-control-spec-insns
10950 @opindex mno-sched-prefer-non-control-spec-insns
10951 @opindex msched-prefer-non-control-spec-insns
10952 If enabled, control speculative instructions will be chosen for schedule
10953 only if there are no other choices at the moment.  This will make
10954 the use of the control speculation much more conservative.
10955 The default is 'disable'.
10956
10957 @item -mno-sched-count-spec-in-critical-path
10958 @itemx -msched-count-spec-in-critical-path
10959 @opindex mno-sched-count-spec-in-critical-path
10960 @opindex msched-count-spec-in-critical-path
10961 If enabled, speculative dependencies will be considered during
10962 computation of the instructions priorities.  This will make the use of the
10963 speculation a bit more conservative.
10964 The default is 'disable'.
10965
10966 @end table
10967
10968 @node M32C Options
10969 @subsection M32C Options
10970 @cindex M32C options
10971
10972 @table @gcctabopt
10973 @item -mcpu=@var{name}
10974 @opindex mcpu=
10975 Select the CPU for which code is generated.  @var{name} may be one of
10976 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
10977 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
10978 the M32C/80 series.
10979
10980 @item -msim
10981 @opindex msim
10982 Specifies that the program will be run on the simulator.  This causes
10983 an alternate runtime library to be linked in which supports, for
10984 example, file I/O.  You must not use this option when generating
10985 programs that will run on real hardware; you must provide your own
10986 runtime library for whatever I/O functions are needed.
10987
10988 @item -memregs=@var{number}
10989 @opindex memregs=
10990 Specifies the number of memory-based pseudo-registers GCC will use
10991 during code generation.  These pseudo-registers will be used like real
10992 registers, so there is a tradeoff between GCC's ability to fit the
10993 code into available registers, and the performance penalty of using
10994 memory instead of registers.  Note that all modules in a program must
10995 be compiled with the same value for this option.  Because of that, you
10996 must not use this option with the default runtime libraries gcc
10997 builds.
10998
10999 @end table
11000
11001 @node M32R/D Options
11002 @subsection M32R/D Options
11003 @cindex M32R/D options
11004
11005 These @option{-m} options are defined for Renesas M32R/D architectures:
11006
11007 @table @gcctabopt
11008 @item -m32r2
11009 @opindex m32r2
11010 Generate code for the M32R/2@.
11011
11012 @item -m32rx
11013 @opindex m32rx
11014 Generate code for the M32R/X@.
11015
11016 @item -m32r
11017 @opindex m32r
11018 Generate code for the M32R@.  This is the default.
11019
11020 @item -mmodel=small
11021 @opindex mmodel=small
11022 Assume all objects live in the lower 16MB of memory (so that their addresses
11023 can be loaded with the @code{ld24} instruction), and assume all subroutines
11024 are reachable with the @code{bl} instruction.
11025 This is the default.
11026
11027 The addressability of a particular object can be set with the
11028 @code{model} attribute.
11029
11030 @item -mmodel=medium
11031 @opindex mmodel=medium
11032 Assume objects may be anywhere in the 32-bit address space (the compiler
11033 will generate @code{seth/add3} instructions to load their addresses), and
11034 assume all subroutines are reachable with the @code{bl} instruction.
11035
11036 @item -mmodel=large
11037 @opindex mmodel=large
11038 Assume objects may be anywhere in the 32-bit address space (the compiler
11039 will generate @code{seth/add3} instructions to load their addresses), and
11040 assume subroutines may not be reachable with the @code{bl} instruction
11041 (the compiler will generate the much slower @code{seth/add3/jl}
11042 instruction sequence).
11043
11044 @item -msdata=none
11045 @opindex msdata=none
11046 Disable use of the small data area.  Variables will be put into
11047 one of @samp{.data}, @samp{bss}, or @samp{.rodata} (unless the
11048 @code{section} attribute has been specified).
11049 This is the default.
11050
11051 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
11052 Objects may be explicitly put in the small data area with the
11053 @code{section} attribute using one of these sections.
11054
11055 @item -msdata=sdata
11056 @opindex msdata=sdata
11057 Put small global and static data in the small data area, but do not
11058 generate special code to reference them.
11059
11060 @item -msdata=use
11061 @opindex msdata=use
11062 Put small global and static data in the small data area, and generate
11063 special instructions to reference them.
11064
11065 @item -G @var{num}
11066 @opindex G
11067 @cindex smaller data references
11068 Put global and static objects less than or equal to @var{num} bytes
11069 into the small data or bss sections instead of the normal data or bss
11070 sections.  The default value of @var{num} is 8.
11071 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
11072 for this option to have any effect.
11073
11074 All modules should be compiled with the same @option{-G @var{num}} value.
11075 Compiling with different values of @var{num} may or may not work; if it
11076 doesn't the linker will give an error message---incorrect code will not be
11077 generated.
11078
11079 @item -mdebug
11080 @opindex mdebug
11081 Makes the M32R specific code in the compiler display some statistics
11082 that might help in debugging programs.
11083
11084 @item -malign-loops
11085 @opindex malign-loops
11086 Align all loops to a 32-byte boundary.
11087
11088 @item -mno-align-loops
11089 @opindex mno-align-loops
11090 Do not enforce a 32-byte alignment for loops.  This is the default.
11091
11092 @item -missue-rate=@var{number}
11093 @opindex missue-rate=@var{number}
11094 Issue @var{number} instructions per cycle.  @var{number} can only be 1
11095 or 2.
11096
11097 @item -mbranch-cost=@var{number}
11098 @opindex mbranch-cost=@var{number}
11099 @var{number} can only be 1 or 2.  If it is 1 then branches will be
11100 preferred over conditional code, if it is 2, then the opposite will
11101 apply.
11102
11103 @item -mflush-trap=@var{number}
11104 @opindex mflush-trap=@var{number}
11105 Specifies the trap number to use to flush the cache.  The default is
11106 12.  Valid numbers are between 0 and 15 inclusive.
11107
11108 @item -mno-flush-trap
11109 @opindex mno-flush-trap
11110 Specifies that the cache cannot be flushed by using a trap.
11111
11112 @item -mflush-func=@var{name}
11113 @opindex mflush-func=@var{name}
11114 Specifies the name of the operating system function to call to flush
11115 the cache.  The default is @emph{_flush_cache}, but a function call
11116 will only be used if a trap is not available.
11117
11118 @item -mno-flush-func
11119 @opindex mno-flush-func
11120 Indicates that there is no OS function for flushing the cache.
11121
11122 @end table
11123
11124 @node M680x0 Options
11125 @subsection M680x0 Options
11126 @cindex M680x0 options
11127
11128 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
11129 The default settings depend on which architecture was selected when
11130 the compiler was configured; the defaults for the most common choices
11131 are given below.
11132
11133 @table @gcctabopt
11134 @item -march=@var{arch}
11135 @opindex march
11136 Generate code for a specific M680x0 or ColdFire instruction set
11137 architecture.  Permissible values of @var{arch} for M680x0
11138 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
11139 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
11140 architectures are selected according to Freescale's ISA classification
11141 and the permissible values are: @samp{isaa}, @samp{isaaplus},
11142 @samp{isab} and @samp{isac}.
11143
11144 gcc defines a macro @samp{__mcf@var{arch}__} whenever it is generating
11145 code for a ColdFire target.  The @var{arch} in this macro is one of the
11146 @option{-march} arguments given above.
11147
11148 When used together, @option{-march} and @option{-mtune} select code
11149 that runs on a family of similar processors but that is optimized
11150 for a particular microarchitecture.
11151
11152 @item -mcpu=@var{cpu}
11153 @opindex mcpu
11154 Generate code for a specific M680x0 or ColdFire processor.
11155 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
11156 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
11157 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
11158 below, which also classifies the CPUs into families:
11159
11160 @multitable @columnfractions 0.20 0.80
11161 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
11162 @item @samp{51qe} @tab @samp{51qe}
11163 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
11164 @item @samp{5206e} @tab @samp{5206e}
11165 @item @samp{5208} @tab @samp{5207} @samp{5208}
11166 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
11167 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
11168 @item @samp{5216} @tab @samp{5214} @samp{5216}
11169 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
11170 @item @samp{5225} @tab @samp{5224} @samp{5225}
11171 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
11172 @item @samp{5249} @tab @samp{5249}
11173 @item @samp{5250} @tab @samp{5250}
11174 @item @samp{5271} @tab @samp{5270} @samp{5271}
11175 @item @samp{5272} @tab @samp{5272}
11176 @item @samp{5275} @tab @samp{5274} @samp{5275}
11177 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
11178 @item @samp{5307} @tab @samp{5307}
11179 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
11180 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
11181 @item @samp{5407} @tab @samp{5407}
11182 @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}
11183 @end multitable
11184
11185 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
11186 @var{arch} is compatible with @var{cpu}.  Other combinations of
11187 @option{-mcpu} and @option{-march} are rejected.
11188
11189 gcc defines the macro @samp{__mcf_cpu_@var{cpu}} when ColdFire target
11190 @var{cpu} is selected.  It also defines @samp{__mcf_family_@var{family}},
11191 where the value of @var{family} is given by the table above.
11192
11193 @item -mtune=@var{tune}
11194 @opindex mtune
11195 Tune the code for a particular microarchitecture, within the
11196 constraints set by @option{-march} and @option{-mcpu}.
11197 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
11198 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
11199 and @samp{cpu32}.  The ColdFire microarchitectures
11200 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
11201
11202 You can also use @option{-mtune=68020-40} for code that needs
11203 to run relatively well on 68020, 68030 and 68040 targets.
11204 @option{-mtune=68020-60} is similar but includes 68060 targets
11205 as well.  These two options select the same tuning decisions as
11206 @option{-m68020-40} and @option{-m68020-60} respectively.
11207
11208 gcc defines the macros @samp{__mc@var{arch}} and @samp{__mc@var{arch}__}
11209 when tuning for 680x0 architecture @var{arch}.  It also defines
11210 @samp{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
11211 option is used.  If gcc is tuning for a range of architectures,
11212 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
11213 it defines the macros for every architecture in the range.
11214
11215 gcc also defines the macro @samp{__m@var{uarch}__} when tuning for
11216 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
11217 of the arguments given above.
11218
11219 @item -m68000
11220 @itemx -mc68000
11221 @opindex m68000
11222 @opindex mc68000
11223 Generate output for a 68000.  This is the default
11224 when the compiler is configured for 68000-based systems.
11225 It is equivalent to @option{-march=68000}.
11226
11227 Use this option for microcontrollers with a 68000 or EC000 core,
11228 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
11229
11230 @item -m68010
11231 @opindex m68010
11232 Generate output for a 68010.  This is the default
11233 when the compiler is configured for 68010-based systems.
11234 It is equivalent to @option{-march=68010}.
11235
11236 @item -m68020
11237 @itemx -mc68020
11238 @opindex m68020
11239 @opindex mc68020
11240 Generate output for a 68020.  This is the default
11241 when the compiler is configured for 68020-based systems.
11242 It is equivalent to @option{-march=68020}.
11243
11244 @item -m68030
11245 @opindex m68030
11246 Generate output for a 68030.  This is the default when the compiler is
11247 configured for 68030-based systems.  It is equivalent to
11248 @option{-march=68030}.
11249
11250 @item -m68040
11251 @opindex m68040
11252 Generate output for a 68040.  This is the default when the compiler is
11253 configured for 68040-based systems.  It is equivalent to
11254 @option{-march=68040}.
11255
11256 This option inhibits the use of 68881/68882 instructions that have to be
11257 emulated by software on the 68040.  Use this option if your 68040 does not
11258 have code to emulate those instructions.
11259
11260 @item -m68060
11261 @opindex m68060
11262 Generate output for a 68060.  This is the default when the compiler is
11263 configured for 68060-based systems.  It is equivalent to
11264 @option{-march=68060}.
11265
11266 This option inhibits the use of 68020 and 68881/68882 instructions that
11267 have to be emulated by software on the 68060.  Use this option if your 68060
11268 does not have code to emulate those instructions.
11269
11270 @item -mcpu32
11271 @opindex mcpu32
11272 Generate output for a CPU32.  This is the default
11273 when the compiler is configured for CPU32-based systems.
11274 It is equivalent to @option{-march=cpu32}.
11275
11276 Use this option for microcontrollers with a
11277 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
11278 68336, 68340, 68341, 68349 and 68360.
11279
11280 @item -m5200
11281 @opindex m5200
11282 Generate output for a 520X ColdFire CPU.  This is the default
11283 when the compiler is configured for 520X-based systems.
11284 It is equivalent to @option{-mcpu=5206}, and is now deprecated
11285 in favor of that option.
11286
11287 Use this option for microcontroller with a 5200 core, including
11288 the MCF5202, MCF5203, MCF5204 and MCF5206.
11289
11290 @item -m5206e
11291 @opindex m5206e
11292 Generate output for a 5206e ColdFire CPU.  The option is now
11293 deprecated in favor of the equivalent @option{-mcpu=5206e}.
11294
11295 @item -m528x
11296 @opindex m528x
11297 Generate output for a member of the ColdFire 528X family.
11298 The option is now deprecated in favor of the equivalent
11299 @option{-mcpu=528x}.
11300
11301 @item -m5307
11302 @opindex m5307
11303 Generate output for a ColdFire 5307 CPU.  The option is now deprecated
11304 in favor of the equivalent @option{-mcpu=5307}.
11305
11306 @item -m5407
11307 @opindex m5407
11308 Generate output for a ColdFire 5407 CPU.  The option is now deprecated
11309 in favor of the equivalent @option{-mcpu=5407}.
11310
11311 @item -mcfv4e
11312 @opindex mcfv4e
11313 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
11314 This includes use of hardware floating point instructions.
11315 The option is equivalent to @option{-mcpu=547x}, and is now
11316 deprecated in favor of that option.
11317
11318 @item -m68020-40
11319 @opindex m68020-40
11320 Generate output for a 68040, without using any of the new instructions.
11321 This results in code which can run relatively efficiently on either a
11322 68020/68881 or a 68030 or a 68040.  The generated code does use the
11323 68881 instructions that are emulated on the 68040.
11324
11325 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
11326
11327 @item -m68020-60
11328 @opindex m68020-60
11329 Generate output for a 68060, without using any of the new instructions.
11330 This results in code which can run relatively efficiently on either a
11331 68020/68881 or a 68030 or a 68040.  The generated code does use the
11332 68881 instructions that are emulated on the 68060.
11333
11334 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
11335
11336 @item -mhard-float
11337 @itemx -m68881
11338 @opindex mhard-float
11339 @opindex m68881
11340 Generate floating-point instructions.  This is the default for 68020
11341 and above, and for ColdFire devices that have an FPU.  It defines the
11342 macro @samp{__HAVE_68881__} on M680x0 targets and @samp{__mcffpu__}
11343 on ColdFire targets.
11344
11345 @item -msoft-float
11346 @opindex msoft-float
11347 Do not generate floating-point instructions; use library calls instead.
11348 This is the default for 68000, 68010, and 68832 targets.  It is also
11349 the default for ColdFire devices that have no FPU.
11350
11351 @item -mdiv
11352 @itemx -mno-div
11353 @opindex mdiv
11354 @opindex mno-div
11355 Generate (do not generate) ColdFire hardware divide and remainder
11356 instructions.  If @option{-march} is used without @option{-mcpu},
11357 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
11358 architectures.  Otherwise, the default is taken from the target CPU
11359 (either the default CPU, or the one specified by @option{-mcpu}).  For
11360 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
11361 @option{-mcpu=5206e}.
11362
11363 gcc defines the macro @samp{__mcfhwdiv__} when this option is enabled.
11364
11365 @item -mshort
11366 @opindex mshort
11367 Consider type @code{int} to be 16 bits wide, like @code{short int}.
11368 Additionally, parameters passed on the stack are also aligned to a
11369 16-bit boundary even on targets whose API mandates promotion to 32-bit.
11370
11371 @item -mno-short
11372 @opindex mno-short
11373 Do not consider type @code{int} to be 16 bits wide.  This is the default.
11374
11375 @item -mnobitfield
11376 @itemx -mno-bitfield
11377 @opindex mnobitfield
11378 @opindex mno-bitfield
11379 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
11380 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
11381
11382 @item -mbitfield
11383 @opindex mbitfield
11384 Do use the bit-field instructions.  The @option{-m68020} option implies
11385 @option{-mbitfield}.  This is the default if you use a configuration
11386 designed for a 68020.
11387
11388 @item -mrtd
11389 @opindex mrtd
11390 Use a different function-calling convention, in which functions
11391 that take a fixed number of arguments return with the @code{rtd}
11392 instruction, which pops their arguments while returning.  This
11393 saves one instruction in the caller since there is no need to pop
11394 the arguments there.
11395
11396 This calling convention is incompatible with the one normally
11397 used on Unix, so you cannot use it if you need to call libraries
11398 compiled with the Unix compiler.
11399
11400 Also, you must provide function prototypes for all functions that
11401 take variable numbers of arguments (including @code{printf});
11402 otherwise incorrect code will be generated for calls to those
11403 functions.
11404
11405 In addition, seriously incorrect code will result if you call a
11406 function with too many arguments.  (Normally, extra arguments are
11407 harmlessly ignored.)
11408
11409 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
11410 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
11411
11412 @item -mno-rtd
11413 @opindex mno-rtd
11414 Do not use the calling conventions selected by @option{-mrtd}.
11415 This is the default.
11416
11417 @item -malign-int
11418 @itemx -mno-align-int
11419 @opindex malign-int
11420 @opindex mno-align-int
11421 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
11422 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
11423 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
11424 Aligning variables on 32-bit boundaries produces code that runs somewhat
11425 faster on processors with 32-bit busses at the expense of more memory.
11426
11427 @strong{Warning:} if you use the @option{-malign-int} switch, GCC will
11428 align structures containing the above types  differently than
11429 most published application binary interface specifications for the m68k.
11430
11431 @item -mpcrel
11432 @opindex mpcrel
11433 Use the pc-relative addressing mode of the 68000 directly, instead of
11434 using a global offset table.  At present, this option implies @option{-fpic},
11435 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
11436 not presently supported with @option{-mpcrel}, though this could be supported for
11437 68020 and higher processors.
11438
11439 @item -mno-strict-align
11440 @itemx -mstrict-align
11441 @opindex mno-strict-align
11442 @opindex mstrict-align
11443 Do not (do) assume that unaligned memory references will be handled by
11444 the system.
11445
11446 @item -msep-data
11447 Generate code that allows the data segment to be located in a different
11448 area of memory from the text segment.  This allows for execute in place in
11449 an environment without virtual memory management.  This option implies
11450 @option{-fPIC}.
11451
11452 @item -mno-sep-data
11453 Generate code that assumes that the data segment follows the text segment.
11454 This is the default.
11455
11456 @item -mid-shared-library
11457 Generate code that supports shared libraries via the library ID method.
11458 This allows for execute in place and shared libraries in an environment
11459 without virtual memory management.  This option implies @option{-fPIC}.
11460
11461 @item -mno-id-shared-library
11462 Generate code that doesn't assume ID based shared libraries are being used.
11463 This is the default.
11464
11465 @item -mshared-library-id=n
11466 Specified the identification number of the ID based shared library being
11467 compiled.  Specifying a value of 0 will generate more compact code, specifying
11468 other values will force the allocation of that number to the current
11469 library but is no more space or time efficient than omitting this option.
11470
11471 @end table
11472
11473 @node M68hc1x Options
11474 @subsection M68hc1x Options
11475 @cindex M68hc1x options
11476
11477 These are the @samp{-m} options defined for the 68hc11 and 68hc12
11478 microcontrollers.  The default values for these options depends on
11479 which style of microcontroller was selected when the compiler was configured;
11480 the defaults for the most common choices are given below.
11481
11482 @table @gcctabopt
11483 @item -m6811
11484 @itemx -m68hc11
11485 @opindex m6811
11486 @opindex m68hc11
11487 Generate output for a 68HC11.  This is the default
11488 when the compiler is configured for 68HC11-based systems.
11489
11490 @item -m6812
11491 @itemx -m68hc12
11492 @opindex m6812
11493 @opindex m68hc12
11494 Generate output for a 68HC12.  This is the default
11495 when the compiler is configured for 68HC12-based systems.
11496
11497 @item -m68S12
11498 @itemx -m68hcs12
11499 @opindex m68S12
11500 @opindex m68hcs12
11501 Generate output for a 68HCS12.
11502
11503 @item -mauto-incdec
11504 @opindex mauto-incdec
11505 Enable the use of 68HC12 pre and post auto-increment and auto-decrement
11506 addressing modes.
11507
11508 @item -minmax
11509 @itemx -nominmax
11510 @opindex minmax
11511 @opindex mnominmax
11512 Enable the use of 68HC12 min and max instructions.
11513
11514 @item -mlong-calls
11515 @itemx -mno-long-calls
11516 @opindex mlong-calls
11517 @opindex mno-long-calls
11518 Treat all calls as being far away (near).  If calls are assumed to be
11519 far away, the compiler will use the @code{call} instruction to
11520 call a function and the @code{rtc} instruction for returning.
11521
11522 @item -mshort
11523 @opindex mshort
11524 Consider type @code{int} to be 16 bits wide, like @code{short int}.
11525
11526 @item -msoft-reg-count=@var{count}
11527 @opindex msoft-reg-count
11528 Specify the number of pseudo-soft registers which are used for the
11529 code generation.  The maximum number is 32.  Using more pseudo-soft
11530 register may or may not result in better code depending on the program.
11531 The default is 4 for 68HC11 and 2 for 68HC12.
11532
11533 @end table
11534
11535 @node MCore Options
11536 @subsection MCore Options
11537 @cindex MCore options
11538
11539 These are the @samp{-m} options defined for the Motorola M*Core
11540 processors.
11541
11542 @table @gcctabopt
11543
11544 @item -mhardlit
11545 @itemx -mno-hardlit
11546 @opindex mhardlit
11547 @opindex mno-hardlit
11548 Inline constants into the code stream if it can be done in two
11549 instructions or less.
11550
11551 @item -mdiv
11552 @itemx -mno-div
11553 @opindex mdiv
11554 @opindex mno-div
11555 Use the divide instruction.  (Enabled by default).
11556
11557 @item -mrelax-immediate
11558 @itemx -mno-relax-immediate
11559 @opindex mrelax-immediate
11560 @opindex mno-relax-immediate
11561 Allow arbitrary sized immediates in bit operations.
11562
11563 @item -mwide-bitfields
11564 @itemx -mno-wide-bitfields
11565 @opindex mwide-bitfields
11566 @opindex mno-wide-bitfields
11567 Always treat bit-fields as int-sized.
11568
11569 @item -m4byte-functions
11570 @itemx -mno-4byte-functions
11571 @opindex m4byte-functions
11572 @opindex mno-4byte-functions
11573 Force all functions to be aligned to a four byte boundary.
11574
11575 @item -mcallgraph-data
11576 @itemx -mno-callgraph-data
11577 @opindex mcallgraph-data
11578 @opindex mno-callgraph-data
11579 Emit callgraph information.
11580
11581 @item -mslow-bytes
11582 @itemx -mno-slow-bytes
11583 @opindex mslow-bytes
11584 @opindex mno-slow-bytes
11585 Prefer word access when reading byte quantities.
11586
11587 @item -mlittle-endian
11588 @itemx -mbig-endian
11589 @opindex mlittle-endian
11590 @opindex mbig-endian
11591 Generate code for a little endian target.
11592
11593 @item -m210
11594 @itemx -m340
11595 @opindex m210
11596 @opindex m340
11597 Generate code for the 210 processor.
11598 @end table
11599
11600 @node MIPS Options
11601 @subsection MIPS Options
11602 @cindex MIPS options
11603
11604 @table @gcctabopt
11605
11606 @item -EB
11607 @opindex EB
11608 Generate big-endian code.
11609
11610 @item -EL
11611 @opindex EL
11612 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
11613 configurations.
11614
11615 @item -march=@var{arch}
11616 @opindex march
11617 Generate code that will run on @var{arch}, which can be the name of a
11618 generic MIPS ISA, or the name of a particular processor.
11619 The ISA names are:
11620 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
11621 @samp{mips32}, @samp{mips32r2}, and @samp{mips64}.
11622 The processor names are:
11623 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
11624 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
11625 @samp{5kc}, @samp{5kf},
11626 @samp{20kc},
11627 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
11628 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
11629 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1},
11630 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
11631 @samp{m4k},
11632 @samp{orion},
11633 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
11634 @samp{r4600}, @samp{r4650}, @samp{r6000}, @samp{r8000},
11635 @samp{rm7000}, @samp{rm9000},
11636 @samp{sb1},
11637 @samp{sr71000},
11638 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
11639 @samp{vr5000}, @samp{vr5400} and @samp{vr5500}.
11640 The special value @samp{from-abi} selects the
11641 most compatible architecture for the selected ABI (that is,
11642 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
11643
11644 In processor names, a final @samp{000} can be abbreviated as @samp{k}
11645 (for example, @samp{-march=r2k}).  Prefixes are optional, and
11646 @samp{vr} may be written @samp{r}.
11647
11648 Names of the form @samp{@var{n}f2_1} refer to processors with
11649 FPUs clocked at half the rate of the core, names of the form
11650 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
11651 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
11652 processors with FPUs clocked a ratio of 3:2 with respect to the core.
11653 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
11654 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
11655 accepted as synonyms for @samp{@var{n}f1_1}.
11656
11657 GCC defines two macros based on the value of this option.  The first
11658 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
11659 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
11660 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
11661 For example, @samp{-march=r2000} will set @samp{_MIPS_ARCH}
11662 to @samp{"r2000"} and define the macro @samp{_MIPS_ARCH_R2000}.
11663
11664 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
11665 above.  In other words, it will have the full prefix and will not
11666 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
11667 the macro names the resolved architecture (either @samp{"mips1"} or
11668 @samp{"mips3"}).  It names the default architecture when no
11669 @option{-march} option is given.
11670
11671 @item -mtune=@var{arch}
11672 @opindex mtune
11673 Optimize for @var{arch}.  Among other things, this option controls
11674 the way instructions are scheduled, and the perceived cost of arithmetic
11675 operations.  The list of @var{arch} values is the same as for
11676 @option{-march}.
11677
11678 When this option is not used, GCC will optimize for the processor
11679 specified by @option{-march}.  By using @option{-march} and
11680 @option{-mtune} together, it is possible to generate code that will
11681 run on a family of processors, but optimize the code for one
11682 particular member of that family.
11683
11684 @samp{-mtune} defines the macros @samp{_MIPS_TUNE} and
11685 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
11686 @samp{-march} ones described above.
11687
11688 @item -mips1
11689 @opindex mips1
11690 Equivalent to @samp{-march=mips1}.
11691
11692 @item -mips2
11693 @opindex mips2
11694 Equivalent to @samp{-march=mips2}.
11695
11696 @item -mips3
11697 @opindex mips3
11698 Equivalent to @samp{-march=mips3}.
11699
11700 @item -mips4
11701 @opindex mips4
11702 Equivalent to @samp{-march=mips4}.
11703
11704 @item -mips32
11705 @opindex mips32
11706 Equivalent to @samp{-march=mips32}.
11707
11708 @item -mips32r2
11709 @opindex mips32r2
11710 Equivalent to @samp{-march=mips32r2}.
11711
11712 @item -mips64
11713 @opindex mips64
11714 Equivalent to @samp{-march=mips64}.
11715
11716 @item -mips16
11717 @itemx -mno-mips16
11718 @opindex mips16
11719 @opindex mno-mips16
11720 Generate (do not generate) MIPS16 code.  If GCC is targetting a
11721 MIPS32 or MIPS64 architecture, it will make use of the MIPS16e ASE@.
11722
11723 MIPS16 code generation can also be controlled on a per-function basis
11724 by means of @code{mips16} and @code{nomips16} attributes.  
11725 @xref{Function Attributes}, for more information.
11726
11727 @item -mflip-mips16
11728 @opindex mflip-mips16
11729 Generate MIPS16 code on alternating functions.  This option is provided
11730 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
11731 not intended for ordinary use in compiling user code.
11732
11733 @item -minterlink-mips16
11734 @itemx -mno-interlink-mips16
11735 @opindex minterlink-mips16
11736 @opindex mno-interlink-mips16
11737 Require (do not require) that non-MIPS16 code be link-compatible with
11738 MIPS16 code.
11739
11740 For example, non-MIPS16 code cannot jump directly to MIPS16 code;
11741 it must either use a call or an indirect jump.  @option{-minterlink-mips16}
11742 therefore disables direct jumps unless GCC knows that the target of the
11743 jump is not MIPS16.
11744
11745 @item -mabi=32
11746 @itemx -mabi=o64
11747 @itemx -mabi=n32
11748 @itemx -mabi=64
11749 @itemx -mabi=eabi
11750 @opindex mabi=32
11751 @opindex mabi=o64
11752 @opindex mabi=n32
11753 @opindex mabi=64
11754 @opindex mabi=eabi
11755 Generate code for the given ABI@.
11756
11757 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
11758 generates 64-bit code when you select a 64-bit architecture, but you
11759 can use @option{-mgp32} to get 32-bit code instead.
11760
11761 For information about the O64 ABI, see
11762 @w{@uref{http://gcc.gnu.org/projects/mipso64-abi.html}}.
11763
11764 GCC supports a variant of the o32 ABI in which floating-point registers
11765 are 64 rather than 32 bits wide.  You can select this combination with
11766 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @samp{mthc1}
11767 and @samp{mfhc1} instructions and is therefore only supported for
11768 MIPS32R2 processors.
11769
11770 The register assignments for arguments and return values remain the
11771 same, but each scalar value is passed in a single 64-bit register
11772 rather than a pair of 32-bit registers.  For example, scalar
11773 floating-point values are returned in @samp{$f0} only, not a
11774 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
11775 remains the same, but all 64 bits are saved.
11776
11777 @item -mabicalls
11778 @itemx -mno-abicalls
11779 @opindex mabicalls
11780 @opindex mno-abicalls
11781 Generate (do not generate) code that is suitable for SVR4-style
11782 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
11783 systems.
11784
11785 @item -mshared
11786 @itemx -mno-shared
11787 Generate (do not generate) code that is fully position-independent,
11788 and that can therefore be linked into shared libraries.  This option
11789 only affects @option{-mabicalls}.
11790
11791 All @option{-mabicalls} code has traditionally been position-independent,
11792 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
11793 as an extension, the GNU toolchain allows executables to use absolute
11794 accesses for locally-binding symbols.  It can also use shorter GP
11795 initialization sequences and generate direct calls to locally-defined
11796 functions.  This mode is selected by @option{-mno-shared}.
11797
11798 @option{-mno-shared} depends on binutils 2.16 or higher and generates
11799 objects that can only be linked by the GNU linker.  However, the option
11800 does not affect the ABI of the final executable; it only affects the ABI
11801 of relocatable objects.  Using @option{-mno-shared} will generally make
11802 executables both smaller and quicker.
11803
11804 @option{-mshared} is the default.
11805
11806 @item -mxgot
11807 @itemx -mno-xgot
11808 @opindex mxgot
11809 @opindex mno-xgot
11810 Lift (do not lift) the usual restrictions on the size of the global
11811 offset table.
11812
11813 GCC normally uses a single instruction to load values from the GOT@.
11814 While this is relatively efficient, it will only work if the GOT
11815 is smaller than about 64k.  Anything larger will cause the linker
11816 to report an error such as:
11817
11818 @cindex relocation truncated to fit (MIPS)
11819 @smallexample
11820 relocation truncated to fit: R_MIPS_GOT16 foobar
11821 @end smallexample
11822
11823 If this happens, you should recompile your code with @option{-mxgot}.
11824 It should then work with very large GOTs, although it will also be
11825 less efficient, since it will take three instructions to fetch the
11826 value of a global symbol.
11827
11828 Note that some linkers can create multiple GOTs.  If you have such a
11829 linker, you should only need to use @option{-mxgot} when a single object
11830 file accesses more than 64k's worth of GOT entries.  Very few do.
11831
11832 These options have no effect unless GCC is generating position
11833 independent code.
11834
11835 @item -mgp32
11836 @opindex mgp32
11837 Assume that general-purpose registers are 32 bits wide.
11838
11839 @item -mgp64
11840 @opindex mgp64
11841 Assume that general-purpose registers are 64 bits wide.
11842
11843 @item -mfp32
11844 @opindex mfp32
11845 Assume that floating-point registers are 32 bits wide.
11846
11847 @item -mfp64
11848 @opindex mfp64
11849 Assume that floating-point registers are 64 bits wide.
11850
11851 @item -mhard-float
11852 @opindex mhard-float
11853 Use floating-point coprocessor instructions.
11854
11855 @item -msoft-float
11856 @opindex msoft-float
11857 Do not use floating-point coprocessor instructions.  Implement
11858 floating-point calculations using library calls instead.
11859
11860 @item -msingle-float
11861 @opindex msingle-float
11862 Assume that the floating-point coprocessor only supports single-precision
11863 operations.
11864
11865 @item -mdouble-float
11866 @opindex mdouble-float
11867 Assume that the floating-point coprocessor supports double-precision
11868 operations.  This is the default.
11869
11870 @item -mllsc
11871 @itemx -mno-llsc
11872 @opindex mllsc
11873 @opindex mno-llsc
11874 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
11875 implement atomic memory built-in functions.  When neither option is
11876 specified, GCC will use the instructions if the target architecture
11877 supports them.
11878
11879 @option{-mllsc} is useful if the runtime environment can emulate the
11880 instructions and @option{-mno-llsc} can be useful when compiling for
11881 nonstandard ISAs.  You can make either option the default by
11882 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
11883 respectively.  @option{--with-llsc} is the default for some
11884 configurations; see the installation documentation for details.
11885
11886 @item -mdsp
11887 @itemx -mno-dsp
11888 @opindex mdsp
11889 @opindex mno-dsp
11890 Use (do not use) revision 1 of the MIPS DSP ASE.
11891 @xref{MIPS DSP Built-in Functions}.  This option defines the
11892 preprocessor macro @samp{__mips_dsp}.  It also defines
11893 @samp{__mips_dsp_rev} to 1.
11894
11895 @item -mdspr2
11896 @itemx -mno-dspr2
11897 @opindex mdspr2
11898 @opindex mno-dspr2
11899 Use (do not use) revision 2 of the MIPS DSP ASE.
11900 @xref{MIPS DSP Built-in Functions}.  This option defines the
11901 preprocessor macros @samp{__mips_dsp} and @samp{__mips_dspr2}.
11902 It also defines @samp{__mips_dsp_rev} to 2.
11903
11904 @item -msmartmips
11905 @itemx -mno-smartmips
11906 @opindex msmartmips
11907 @opindex mno-smartmips
11908 Use (do not use) the MIPS SmartMIPS ASE.
11909
11910 @item -mpaired-single
11911 @itemx -mno-paired-single
11912 @opindex mpaired-single
11913 @opindex mno-paired-single
11914 Use (do not use) paired-single floating-point instructions.
11915 @xref{MIPS Paired-Single Support}.  This option requires
11916 hardware floating-point support to be enabled.
11917
11918 @item -mdmx
11919 @itemx -mno-mdmx
11920 @opindex mdmx
11921 @opindex mno-mdmx
11922 Use (do not use) MIPS Digital Media Extension instructions.
11923 This option can only be used when generating 64-bit code and requires
11924 hardware floating-point support to be enabled.
11925
11926 @item -mips3d
11927 @itemx -mno-mips3d
11928 @opindex mips3d
11929 @opindex mno-mips3d
11930 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
11931 The option @option{-mips3d} implies @option{-mpaired-single}.
11932
11933 @item -mmt
11934 @itemx -mno-mt
11935 @opindex mmt
11936 @opindex mno-mt
11937 Use (do not use) MT Multithreading instructions.
11938
11939 @item -mlong64
11940 @opindex mlong64
11941 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
11942 an explanation of the default and the way that the pointer size is
11943 determined.
11944
11945 @item -mlong32
11946 @opindex mlong32
11947 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
11948
11949 The default size of @code{int}s, @code{long}s and pointers depends on
11950 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
11951 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
11952 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
11953 or the same size as integer registers, whichever is smaller.
11954
11955 @item -msym32
11956 @itemx -mno-sym32
11957 @opindex msym32
11958 @opindex mno-sym32
11959 Assume (do not assume) that all symbols have 32-bit values, regardless
11960 of the selected ABI@.  This option is useful in combination with
11961 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
11962 to generate shorter and faster references to symbolic addresses.
11963
11964 @item -G @var{num}
11965 @opindex G
11966 Put definitions of externally-visible data in a small data section
11967 if that data is no bigger than @var{num} bytes.  GCC can then access
11968 the data more efficiently; see @option{-mgpopt} for details.
11969
11970 The default @option{-G} option depends on the configuration.
11971
11972 @item -mlocal-sdata
11973 @itemx -mno-local-sdata
11974 @opindex mlocal-sdata
11975 @opindex mno-local-sdata
11976 Extend (do not extend) the @option{-G} behavior to local data too,
11977 such as to static variables in C.  @option{-mlocal-sdata} is the
11978 default for all configurations.
11979
11980 If the linker complains that an application is using too much small data,
11981 you might want to try rebuilding the less performance-critical parts with
11982 @option{-mno-local-sdata}.  You might also want to build large
11983 libraries with @option{-mno-local-sdata}, so that the libraries leave
11984 more room for the main program.
11985
11986 @item -mextern-sdata
11987 @itemx -mno-extern-sdata
11988 @opindex mextern-sdata
11989 @opindex mno-extern-sdata
11990 Assume (do not assume) that externally-defined data will be in
11991 a small data section if that data is within the @option{-G} limit.
11992 @option{-mextern-sdata} is the default for all configurations.
11993
11994 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
11995 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
11996 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
11997 is placed in a small data section.  If @var{Var} is defined by another
11998 module, you must either compile that module with a high-enough
11999 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
12000 definition.  If @var{Var} is common, you must link the application
12001 with a high-enough @option{-G} setting.
12002
12003 The easiest way of satisfying these restrictions is to compile
12004 and link every module with the same @option{-G} option.  However,
12005 you may wish to build a library that supports several different
12006 small data limits.  You can do this by compiling the library with
12007 the highest supported @option{-G} setting and additionally using
12008 @option{-mno-extern-sdata} to stop the library from making assumptions
12009 about externally-defined data.
12010
12011 @item -mgpopt
12012 @itemx -mno-gpopt
12013 @opindex mgpopt
12014 @opindex mno-gpopt
12015 Use (do not use) GP-relative accesses for symbols that are known to be
12016 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
12017 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
12018 configurations.
12019
12020 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
12021 might not hold the value of @code{_gp}.  For example, if the code is
12022 part of a library that might be used in a boot monitor, programs that
12023 call boot monitor routines will pass an unknown value in @code{$gp}.
12024 (In such situations, the boot monitor itself would usually be compiled
12025 with @option{-G0}.)
12026
12027 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
12028 @option{-mno-extern-sdata}.
12029
12030 @item -membedded-data
12031 @itemx -mno-embedded-data
12032 @opindex membedded-data
12033 @opindex mno-embedded-data
12034 Allocate variables to the read-only data section first if possible, then
12035 next in the small data section if possible, otherwise in data.  This gives
12036 slightly slower code than the default, but reduces the amount of RAM required
12037 when executing, and thus may be preferred for some embedded systems.
12038
12039 @item -muninit-const-in-rodata
12040 @itemx -mno-uninit-const-in-rodata
12041 @opindex muninit-const-in-rodata
12042 @opindex mno-uninit-const-in-rodata
12043 Put uninitialized @code{const} variables in the read-only data section.
12044 This option is only meaningful in conjunction with @option{-membedded-data}.
12045
12046 @item -mcode-readable=@var{setting}
12047 @opindex mcode-readable
12048 Specify whether GCC may generate code that reads from executable sections.
12049 There are three possible settings:
12050
12051 @table @gcctabopt
12052 @item -mcode-readable=yes
12053 Instructions may freely access executable sections.  This is the
12054 default setting.
12055
12056 @item -mcode-readable=pcrel
12057 MIPS16 PC-relative load instructions can access executable sections,
12058 but other instructions must not do so.  This option is useful on 4KSc
12059 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
12060 It is also useful on processors that can be configured to have a dual
12061 instruction/data SRAM interface and that, like the M4K, automatically
12062 redirect PC-relative loads to the instruction RAM.
12063
12064 @item -mcode-readable=no
12065 Instructions must not access executable sections.  This option can be
12066 useful on targets that are configured to have a dual instruction/data
12067 SRAM interface but that (unlike the M4K) do not automatically redirect
12068 PC-relative loads to the instruction RAM.
12069 @end table
12070
12071 @item -msplit-addresses
12072 @itemx -mno-split-addresses
12073 @opindex msplit-addresses
12074 @opindex mno-split-addresses
12075 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
12076 relocation operators.  This option has been superseded by
12077 @option{-mexplicit-relocs} but is retained for backwards compatibility.
12078
12079 @item -mexplicit-relocs
12080 @itemx -mno-explicit-relocs
12081 @opindex mexplicit-relocs
12082 @opindex mno-explicit-relocs
12083 Use (do not use) assembler relocation operators when dealing with symbolic
12084 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
12085 is to use assembler macros instead.
12086
12087 @option{-mexplicit-relocs} is the default if GCC was configured
12088 to use an assembler that supports relocation operators.
12089
12090 @item -mcheck-zero-division
12091 @itemx -mno-check-zero-division
12092 @opindex mcheck-zero-division
12093 @opindex mno-check-zero-division
12094 Trap (do not trap) on integer division by zero.
12095
12096 The default is @option{-mcheck-zero-division}.
12097
12098 @item -mdivide-traps
12099 @itemx -mdivide-breaks
12100 @opindex mdivide-traps
12101 @opindex mdivide-breaks
12102 MIPS systems check for division by zero by generating either a
12103 conditional trap or a break instruction.  Using traps results in
12104 smaller code, but is only supported on MIPS II and later.  Also, some
12105 versions of the Linux kernel have a bug that prevents trap from
12106 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
12107 allow conditional traps on architectures that support them and
12108 @option{-mdivide-breaks} to force the use of breaks.
12109
12110 The default is usually @option{-mdivide-traps}, but this can be
12111 overridden at configure time using @option{--with-divide=breaks}.
12112 Divide-by-zero checks can be completely disabled using
12113 @option{-mno-check-zero-division}.
12114
12115 @item -mmemcpy
12116 @itemx -mno-memcpy
12117 @opindex mmemcpy
12118 @opindex mno-memcpy
12119 Force (do not force) the use of @code{memcpy()} for non-trivial block
12120 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
12121 most constant-sized copies.
12122
12123 @item -mlong-calls
12124 @itemx -mno-long-calls
12125 @opindex mlong-calls
12126 @opindex mno-long-calls
12127 Disable (do not disable) use of the @code{jal} instruction.  Calling
12128 functions using @code{jal} is more efficient but requires the caller
12129 and callee to be in the same 256 megabyte segment.
12130
12131 This option has no effect on abicalls code.  The default is
12132 @option{-mno-long-calls}.
12133
12134 @item -mmad
12135 @itemx -mno-mad
12136 @opindex mmad
12137 @opindex mno-mad
12138 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
12139 instructions, as provided by the R4650 ISA@.
12140
12141 @item -mfused-madd
12142 @itemx -mno-fused-madd
12143 @opindex mfused-madd
12144 @opindex mno-fused-madd
12145 Enable (disable) use of the floating point multiply-accumulate
12146 instructions, when they are available.  The default is
12147 @option{-mfused-madd}.
12148
12149 When multiply-accumulate instructions are used, the intermediate
12150 product is calculated to infinite precision and is not subject to
12151 the FCSR Flush to Zero bit.  This may be undesirable in some
12152 circumstances.
12153
12154 @item -nocpp
12155 @opindex nocpp
12156 Tell the MIPS assembler to not run its preprocessor over user
12157 assembler files (with a @samp{.s} suffix) when assembling them.
12158
12159 @item -mfix-r4000
12160 @itemx -mno-fix-r4000
12161 @opindex mfix-r4000
12162 @opindex mno-fix-r4000
12163 Work around certain R4000 CPU errata:
12164 @itemize @minus
12165 @item
12166 A double-word or a variable shift may give an incorrect result if executed
12167 immediately after starting an integer division.
12168 @item
12169 A double-word or a variable shift may give an incorrect result if executed
12170 while an integer multiplication is in progress.
12171 @item
12172 An integer division may give an incorrect result if started in a delay slot
12173 of a taken branch or a jump.
12174 @end itemize
12175
12176 @item -mfix-r4400
12177 @itemx -mno-fix-r4400
12178 @opindex mfix-r4400
12179 @opindex mno-fix-r4400
12180 Work around certain R4400 CPU errata:
12181 @itemize @minus
12182 @item
12183 A double-word or a variable shift may give an incorrect result if executed
12184 immediately after starting an integer division.
12185 @end itemize
12186
12187 @item -mfix-vr4120
12188 @itemx -mno-fix-vr4120
12189 @opindex mfix-vr4120
12190 Work around certain VR4120 errata:
12191 @itemize @minus
12192 @item
12193 @code{dmultu} does not always produce the correct result.
12194 @item
12195 @code{div} and @code{ddiv} do not always produce the correct result if one
12196 of the operands is negative.
12197 @end itemize
12198 The workarounds for the division errata rely on special functions in
12199 @file{libgcc.a}.  At present, these functions are only provided by
12200 the @code{mips64vr*-elf} configurations.
12201
12202 Other VR4120 errata require a nop to be inserted between certain pairs of
12203 instructions.  These errata are handled by the assembler, not by GCC itself.
12204
12205 @item -mfix-vr4130
12206 @opindex mfix-vr4130
12207 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
12208 workarounds are implemented by the assembler rather than by GCC,
12209 although GCC will avoid using @code{mflo} and @code{mfhi} if the
12210 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
12211 instructions are available instead.
12212
12213 @item -mfix-sb1
12214 @itemx -mno-fix-sb1
12215 @opindex mfix-sb1
12216 Work around certain SB-1 CPU core errata.
12217 (This flag currently works around the SB-1 revision 2
12218 ``F1'' and ``F2'' floating point errata.)
12219
12220 @item -mflush-func=@var{func}
12221 @itemx -mno-flush-func
12222 @opindex mflush-func
12223 Specifies the function to call to flush the I and D caches, or to not
12224 call any such function.  If called, the function must take the same
12225 arguments as the common @code{_flush_func()}, that is, the address of the
12226 memory range for which the cache is being flushed, the size of the
12227 memory range, and the number 3 (to flush both caches).  The default
12228 depends on the target GCC was configured for, but commonly is either
12229 @samp{_flush_func} or @samp{__cpu_flush}.
12230
12231 @item mbranch-cost=@var{num}
12232 @opindex mbranch-cost
12233 Set the cost of branches to roughly @var{num} ``simple'' instructions.
12234 This cost is only a heuristic and is not guaranteed to produce
12235 consistent results across releases.  A zero cost redundantly selects
12236 the default, which is based on the @option{-mtune} setting.
12237
12238 @item -mbranch-likely
12239 @itemx -mno-branch-likely
12240 @opindex mbranch-likely
12241 @opindex mno-branch-likely
12242 Enable or disable use of Branch Likely instructions, regardless of the
12243 default for the selected architecture.  By default, Branch Likely
12244 instructions may be generated if they are supported by the selected
12245 architecture.  An exception is for the MIPS32 and MIPS64 architectures
12246 and processors which implement those architectures; for those, Branch
12247 Likely instructions will not be generated by default because the MIPS32
12248 and MIPS64 architectures specifically deprecate their use.
12249
12250 @item -mfp-exceptions
12251 @itemx -mno-fp-exceptions
12252 @opindex mfp-exceptions
12253 Specifies whether FP exceptions are enabled.  This affects how we schedule
12254 FP instructions for some processors.  The default is that FP exceptions are
12255 enabled.
12256
12257 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
12258 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
12259 FP pipe.
12260
12261 @item -mvr4130-align
12262 @itemx -mno-vr4130-align
12263 @opindex mvr4130-align
12264 The VR4130 pipeline is two-way superscalar, but can only issue two
12265 instructions together if the first one is 8-byte aligned.  When this
12266 option is enabled, GCC will align pairs of instructions that it
12267 thinks should execute in parallel.
12268
12269 This option only has an effect when optimizing for the VR4130.
12270 It normally makes code faster, but at the expense of making it bigger.
12271 It is enabled by default at optimization level @option{-O3}.
12272 @end table
12273
12274 @node MMIX Options
12275 @subsection MMIX Options
12276 @cindex MMIX Options
12277
12278 These options are defined for the MMIX:
12279
12280 @table @gcctabopt
12281 @item -mlibfuncs
12282 @itemx -mno-libfuncs
12283 @opindex mlibfuncs
12284 @opindex mno-libfuncs
12285 Specify that intrinsic library functions are being compiled, passing all
12286 values in registers, no matter the size.
12287
12288 @item -mepsilon
12289 @itemx -mno-epsilon
12290 @opindex mepsilon
12291 @opindex mno-epsilon
12292 Generate floating-point comparison instructions that compare with respect
12293 to the @code{rE} epsilon register.
12294
12295 @item -mabi=mmixware
12296 @itemx -mabi=gnu
12297 @opindex mabi-mmixware
12298 @opindex mabi=gnu
12299 Generate code that passes function parameters and return values that (in
12300 the called function) are seen as registers @code{$0} and up, as opposed to
12301 the GNU ABI which uses global registers @code{$231} and up.
12302
12303 @item -mzero-extend
12304 @itemx -mno-zero-extend
12305 @opindex mzero-extend
12306 @opindex mno-zero-extend
12307 When reading data from memory in sizes shorter than 64 bits, use (do not
12308 use) zero-extending load instructions by default, rather than
12309 sign-extending ones.
12310
12311 @item -mknuthdiv
12312 @itemx -mno-knuthdiv
12313 @opindex mknuthdiv
12314 @opindex mno-knuthdiv
12315 Make the result of a division yielding a remainder have the same sign as
12316 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
12317 remainder follows the sign of the dividend.  Both methods are
12318 arithmetically valid, the latter being almost exclusively used.
12319
12320 @item -mtoplevel-symbols
12321 @itemx -mno-toplevel-symbols
12322 @opindex mtoplevel-symbols
12323 @opindex mno-toplevel-symbols
12324 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
12325 code can be used with the @code{PREFIX} assembly directive.
12326
12327 @item -melf
12328 @opindex melf
12329 Generate an executable in the ELF format, rather than the default
12330 @samp{mmo} format used by the @command{mmix} simulator.
12331
12332 @item -mbranch-predict
12333 @itemx -mno-branch-predict
12334 @opindex mbranch-predict
12335 @opindex mno-branch-predict
12336 Use (do not use) the probable-branch instructions, when static branch
12337 prediction indicates a probable branch.
12338
12339 @item -mbase-addresses
12340 @itemx -mno-base-addresses
12341 @opindex mbase-addresses
12342 @opindex mno-base-addresses
12343 Generate (do not generate) code that uses @emph{base addresses}.  Using a
12344 base address automatically generates a request (handled by the assembler
12345 and the linker) for a constant to be set up in a global register.  The
12346 register is used for one or more base address requests within the range 0
12347 to 255 from the value held in the register.  The generally leads to short
12348 and fast code, but the number of different data items that can be
12349 addressed is limited.  This means that a program that uses lots of static
12350 data may require @option{-mno-base-addresses}.
12351
12352 @item -msingle-exit
12353 @itemx -mno-single-exit
12354 @opindex msingle-exit
12355 @opindex mno-single-exit
12356 Force (do not force) generated code to have a single exit point in each
12357 function.
12358 @end table
12359
12360 @node MN10300 Options
12361 @subsection MN10300 Options
12362 @cindex MN10300 options
12363
12364 These @option{-m} options are defined for Matsushita MN10300 architectures:
12365
12366 @table @gcctabopt
12367 @item -mmult-bug
12368 @opindex mmult-bug
12369 Generate code to avoid bugs in the multiply instructions for the MN10300
12370 processors.  This is the default.
12371
12372 @item -mno-mult-bug
12373 @opindex mno-mult-bug
12374 Do not generate code to avoid bugs in the multiply instructions for the
12375 MN10300 processors.
12376
12377 @item -mam33
12378 @opindex mam33
12379 Generate code which uses features specific to the AM33 processor.
12380
12381 @item -mno-am33
12382 @opindex mno-am33
12383 Do not generate code which uses features specific to the AM33 processor.  This
12384 is the default.
12385
12386 @item -mreturn-pointer-on-d0
12387 @opindex mreturn-pointer-on-d0
12388 When generating a function which returns a pointer, return the pointer
12389 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
12390 only in a0, and attempts to call such functions without a prototype
12391 would result in errors.  Note that this option is on by default; use
12392 @option{-mno-return-pointer-on-d0} to disable it.
12393
12394 @item -mno-crt0
12395 @opindex mno-crt0
12396 Do not link in the C run-time initialization object file.
12397
12398 @item -mrelax
12399 @opindex mrelax
12400 Indicate to the linker that it should perform a relaxation optimization pass
12401 to shorten branches, calls and absolute memory addresses.  This option only
12402 has an effect when used on the command line for the final link step.
12403
12404 This option makes symbolic debugging impossible.
12405 @end table
12406
12407 @node MT Options
12408 @subsection MT Options
12409 @cindex MT options
12410
12411 These @option{-m} options are defined for Morpho MT architectures:
12412
12413 @table @gcctabopt
12414
12415 @item -march=@var{cpu-type}
12416 @opindex march
12417 Generate code that will run on @var{cpu-type}, which is the name of a system
12418 representing a certain processor type.  Possible values for
12419 @var{cpu-type} are @samp{ms1-64-001}, @samp{ms1-16-002},
12420 @samp{ms1-16-003} and @samp{ms2}.
12421
12422 When this option is not used, the default is @option{-march=ms1-16-002}.
12423
12424 @item -mbacc
12425 @opindex mbacc
12426 Use byte loads and stores when generating code.
12427
12428 @item -mno-bacc
12429 @opindex mno-bacc
12430 Do not use byte loads and stores when generating code.
12431
12432 @item -msim
12433 @opindex msim
12434 Use simulator runtime
12435
12436 @item -mno-crt0
12437 @opindex mno-crt0
12438 Do not link in the C run-time initialization object file
12439 @file{crti.o}.  Other run-time initialization and termination files
12440 such as @file{startup.o} and @file{exit.o} are still included on the
12441 linker command line.
12442
12443 @end table
12444
12445 @node PDP-11 Options
12446 @subsection PDP-11 Options
12447 @cindex PDP-11 Options
12448
12449 These options are defined for the PDP-11:
12450
12451 @table @gcctabopt
12452 @item -mfpu
12453 @opindex mfpu
12454 Use hardware FPP floating point.  This is the default.  (FIS floating
12455 point on the PDP-11/40 is not supported.)
12456
12457 @item -msoft-float
12458 @opindex msoft-float
12459 Do not use hardware floating point.
12460
12461 @item -mac0
12462 @opindex mac0
12463 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
12464
12465 @item -mno-ac0
12466 @opindex mno-ac0
12467 Return floating-point results in memory.  This is the default.
12468
12469 @item -m40
12470 @opindex m40
12471 Generate code for a PDP-11/40.
12472
12473 @item -m45
12474 @opindex m45
12475 Generate code for a PDP-11/45.  This is the default.
12476
12477 @item -m10
12478 @opindex m10
12479 Generate code for a PDP-11/10.
12480
12481 @item -mbcopy-builtin
12482 @opindex bcopy-builtin
12483 Use inline @code{movmemhi} patterns for copying memory.  This is the
12484 default.
12485
12486 @item -mbcopy
12487 @opindex mbcopy
12488 Do not use inline @code{movmemhi} patterns for copying memory.
12489
12490 @item -mint16
12491 @itemx -mno-int32
12492 @opindex mint16
12493 @opindex mno-int32
12494 Use 16-bit @code{int}.  This is the default.
12495
12496 @item -mint32
12497 @itemx -mno-int16
12498 @opindex mint32
12499 @opindex mno-int16
12500 Use 32-bit @code{int}.
12501
12502 @item -mfloat64
12503 @itemx -mno-float32
12504 @opindex mfloat64
12505 @opindex mno-float32
12506 Use 64-bit @code{float}.  This is the default.
12507
12508 @item -mfloat32
12509 @itemx -mno-float64
12510 @opindex mfloat32
12511 @opindex mno-float64
12512 Use 32-bit @code{float}.
12513
12514 @item -mabshi
12515 @opindex mabshi
12516 Use @code{abshi2} pattern.  This is the default.
12517
12518 @item -mno-abshi
12519 @opindex mno-abshi
12520 Do not use @code{abshi2} pattern.
12521
12522 @item -mbranch-expensive
12523 @opindex mbranch-expensive
12524 Pretend that branches are expensive.  This is for experimenting with
12525 code generation only.
12526
12527 @item -mbranch-cheap
12528 @opindex mbranch-cheap
12529 Do not pretend that branches are expensive.  This is the default.
12530
12531 @item -msplit
12532 @opindex msplit
12533 Generate code for a system with split I&D@.
12534
12535 @item -mno-split
12536 @opindex mno-split
12537 Generate code for a system without split I&D@.  This is the default.
12538
12539 @item -munix-asm
12540 @opindex munix-asm
12541 Use Unix assembler syntax.  This is the default when configured for
12542 @samp{pdp11-*-bsd}.
12543
12544 @item -mdec-asm
12545 @opindex mdec-asm
12546 Use DEC assembler syntax.  This is the default when configured for any
12547 PDP-11 target other than @samp{pdp11-*-bsd}.
12548 @end table
12549
12550 @node PowerPC Options
12551 @subsection PowerPC Options
12552 @cindex PowerPC options
12553
12554 These are listed under @xref{RS/6000 and PowerPC Options}.
12555
12556 @node RS/6000 and PowerPC Options
12557 @subsection IBM RS/6000 and PowerPC Options
12558 @cindex RS/6000 and PowerPC Options
12559 @cindex IBM RS/6000 and PowerPC Options
12560
12561 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
12562 @table @gcctabopt
12563 @item -mpower
12564 @itemx -mno-power
12565 @itemx -mpower2
12566 @itemx -mno-power2
12567 @itemx -mpowerpc
12568 @itemx -mno-powerpc
12569 @itemx -mpowerpc-gpopt
12570 @itemx -mno-powerpc-gpopt
12571 @itemx -mpowerpc-gfxopt
12572 @itemx -mno-powerpc-gfxopt
12573 @itemx -mpowerpc64
12574 @itemx -mno-powerpc64
12575 @itemx -mmfcrf
12576 @itemx -mno-mfcrf
12577 @itemx -mpopcntb
12578 @itemx -mno-popcntb
12579 @itemx -mfprnd
12580 @itemx -mno-fprnd
12581 @itemx -mcmpb
12582 @itemx -mno-cmpb
12583 @itemx -mmfpgpr
12584 @itemx -mno-mfpgpr
12585 @itemx -mdfp
12586 @itemx -mno-dfp
12587 @opindex mpower
12588 @opindex mno-power
12589 @opindex mpower2
12590 @opindex mno-power2
12591 @opindex mpowerpc
12592 @opindex mno-powerpc
12593 @opindex mpowerpc-gpopt
12594 @opindex mno-powerpc-gpopt
12595 @opindex mpowerpc-gfxopt
12596 @opindex mno-powerpc-gfxopt
12597 @opindex mpowerpc64
12598 @opindex mno-powerpc64
12599 @opindex mmfcrf
12600 @opindex mno-mfcrf
12601 @opindex mpopcntb
12602 @opindex mno-popcntb
12603 @opindex mfprnd
12604 @opindex mno-fprnd
12605 @opindex mcmpb
12606 @opindex mno-cmpb
12607 @opindex mmfpgpr
12608 @opindex mno-mfpgpr
12609 @opindex mdfp
12610 @opindex mno-dfp
12611 GCC supports two related instruction set architectures for the
12612 RS/6000 and PowerPC@.  The @dfn{POWER} instruction set are those
12613 instructions supported by the @samp{rios} chip set used in the original
12614 RS/6000 systems and the @dfn{PowerPC} instruction set is the
12615 architecture of the Freescale MPC5xx, MPC6xx, MPC8xx microprocessors, and
12616 the IBM 4xx, 6xx, and follow-on microprocessors.
12617
12618 Neither architecture is a subset of the other.  However there is a
12619 large common subset of instructions supported by both.  An MQ
12620 register is included in processors supporting the POWER architecture.
12621
12622 You use these options to specify which instructions are available on the
12623 processor you are using.  The default value of these options is
12624 determined when configuring GCC@.  Specifying the
12625 @option{-mcpu=@var{cpu_type}} overrides the specification of these
12626 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
12627 rather than the options listed above.
12628
12629 The @option{-mpower} option allows GCC to generate instructions that
12630 are found only in the POWER architecture and to use the MQ register.
12631 Specifying @option{-mpower2} implies @option{-power} and also allows GCC
12632 to generate instructions that are present in the POWER2 architecture but
12633 not the original POWER architecture.
12634
12635 The @option{-mpowerpc} option allows GCC to generate instructions that
12636 are found only in the 32-bit subset of the PowerPC architecture.
12637 Specifying @option{-mpowerpc-gpopt} implies @option{-mpowerpc} and also allows
12638 GCC to use the optional PowerPC architecture instructions in the
12639 General Purpose group, including floating-point square root.  Specifying
12640 @option{-mpowerpc-gfxopt} implies @option{-mpowerpc} and also allows GCC to
12641 use the optional PowerPC architecture instructions in the Graphics
12642 group, including floating-point select.
12643
12644 The @option{-mmfcrf} option allows GCC to generate the move from
12645 condition register field instruction implemented on the POWER4
12646 processor and other processors that support the PowerPC V2.01
12647 architecture.
12648 The @option{-mpopcntb} option allows GCC to generate the popcount and
12649 double precision FP reciprocal estimate instruction implemented on the
12650 POWER5 processor and other processors that support the PowerPC V2.02
12651 architecture.
12652 The @option{-mfprnd} option allows GCC to generate the FP round to
12653 integer instructions implemented on the POWER5+ processor and other
12654 processors that support the PowerPC V2.03 architecture.
12655 The @option{-mcmpb} option allows GCC to generate the compare bytes
12656 instruction implemented on the POWER6 processor and other processors
12657 that support the PowerPC V2.05 architecture.
12658 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
12659 general purpose register instructions implemented on the POWER6X
12660 processor and other processors that support the extended PowerPC V2.05
12661 architecture.
12662 The @option{-mdfp} option allows GCC to generate the decimal floating
12663 point instructions implemented on some POWER processors.
12664
12665 The @option{-mpowerpc64} option allows GCC to generate the additional
12666 64-bit instructions that are found in the full PowerPC64 architecture
12667 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
12668 @option{-mno-powerpc64}.
12669
12670 If you specify both @option{-mno-power} and @option{-mno-powerpc}, GCC
12671 will use only the instructions in the common subset of both
12672 architectures plus some special AIX common-mode calls, and will not use
12673 the MQ register.  Specifying both @option{-mpower} and @option{-mpowerpc}
12674 permits GCC to use any instruction from either architecture and to
12675 allow use of the MQ register; specify this for the Motorola MPC601.
12676
12677 @item -mnew-mnemonics
12678 @itemx -mold-mnemonics
12679 @opindex mnew-mnemonics
12680 @opindex mold-mnemonics
12681 Select which mnemonics to use in the generated assembler code.  With
12682 @option{-mnew-mnemonics}, GCC uses the assembler mnemonics defined for
12683 the PowerPC architecture.  With @option{-mold-mnemonics} it uses the
12684 assembler mnemonics defined for the POWER architecture.  Instructions
12685 defined in only one architecture have only one mnemonic; GCC uses that
12686 mnemonic irrespective of which of these options is specified.
12687
12688 GCC defaults to the mnemonics appropriate for the architecture in
12689 use.  Specifying @option{-mcpu=@var{cpu_type}} sometimes overrides the
12690 value of these option.  Unless you are building a cross-compiler, you
12691 should normally not specify either @option{-mnew-mnemonics} or
12692 @option{-mold-mnemonics}, but should instead accept the default.
12693
12694 @item -mcpu=@var{cpu_type}
12695 @opindex mcpu
12696 Set architecture type, register usage, choice of mnemonics, and
12697 instruction scheduling parameters for machine type @var{cpu_type}.
12698 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
12699 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{505},
12700 @samp{601}, @samp{602}, @samp{603}, @samp{603e}, @samp{604},
12701 @samp{604e}, @samp{620}, @samp{630}, @samp{740}, @samp{7400},
12702 @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
12703 @samp{860}, @samp{970}, @samp{8540}, @samp{ec603e}, @samp{G3},
12704 @samp{G4}, @samp{G5}, @samp{power}, @samp{power2}, @samp{power3},
12705 @samp{power4}, @samp{power5}, @samp{power5+}, @samp{power6},
12706 @samp{power6x}, @samp{common}, @samp{powerpc}, @samp{powerpc64},
12707 @samp{rios}, @samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64}.
12708
12709 @option{-mcpu=common} selects a completely generic processor.  Code
12710 generated under this option will run on any POWER or PowerPC processor.
12711 GCC will use only the instructions in the common subset of both
12712 architectures, and will not use the MQ register.  GCC assumes a generic
12713 processor model for scheduling purposes.
12714
12715 @option{-mcpu=power}, @option{-mcpu=power2}, @option{-mcpu=powerpc}, and
12716 @option{-mcpu=powerpc64} specify generic POWER, POWER2, pure 32-bit
12717 PowerPC (i.e., not MPC601), and 64-bit PowerPC architecture machine
12718 types, with an appropriate, generic processor model assumed for
12719 scheduling purposes.
12720
12721 The other options specify a specific processor.  Code generated under
12722 those options will run best on that processor, and may not run at all on
12723 others.
12724
12725 The @option{-mcpu} options automatically enable or disable the
12726 following options:
12727
12728 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
12729 -mnew-mnemonics  -mpopcntb  -mpower  -mpower2  -mpowerpc64 @gol
12730 -mpowerpc-gpopt  -mpowerpc-gfxopt  -mstring  -mmulhw  -mdlmzb  -mmfpgpr}
12731
12732 The particular options set for any particular CPU will vary between
12733 compiler versions, depending on what setting seems to produce optimal
12734 code for that CPU; it doesn't necessarily reflect the actual hardware's
12735 capabilities.  If you wish to set an individual option to a particular
12736 value, you may specify it after the @option{-mcpu} option, like
12737 @samp{-mcpu=970 -mno-altivec}.
12738
12739 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
12740 not enabled or disabled by the @option{-mcpu} option at present because
12741 AIX does not have full support for these options.  You may still
12742 enable or disable them individually if you're sure it'll work in your
12743 environment.
12744
12745 @item -mtune=@var{cpu_type}
12746 @opindex mtune
12747 Set the instruction scheduling parameters for machine type
12748 @var{cpu_type}, but do not set the architecture type, register usage, or
12749 choice of mnemonics, as @option{-mcpu=@var{cpu_type}} would.  The same
12750 values for @var{cpu_type} are used for @option{-mtune} as for
12751 @option{-mcpu}.  If both are specified, the code generated will use the
12752 architecture, registers, and mnemonics set by @option{-mcpu}, but the
12753 scheduling parameters set by @option{-mtune}.
12754
12755 @item -mswdiv
12756 @itemx -mno-swdiv
12757 @opindex mswdiv
12758 @opindex mno-swdiv
12759 Generate code to compute division as reciprocal estimate and iterative
12760 refinement, creating opportunities for increased throughput.  This
12761 feature requires: optional PowerPC Graphics instruction set for single
12762 precision and FRE instruction for double precision, assuming divides
12763 cannot generate user-visible traps, and the domain values not include
12764 Infinities, denormals or zero denominator.
12765
12766 @item -maltivec
12767 @itemx -mno-altivec
12768 @opindex maltivec
12769 @opindex mno-altivec
12770 Generate code that uses (does not use) AltiVec instructions, and also
12771 enable the use of built-in functions that allow more direct access to
12772 the AltiVec instruction set.  You may also need to set
12773 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
12774 enhancements.
12775
12776 @item -mvrsave
12777 @item -mno-vrsave
12778 @opindex mvrsave
12779 @opindex mno-vrsave
12780 Generate VRSAVE instructions when generating AltiVec code.
12781
12782 @item -msecure-plt
12783 @opindex msecure-plt
12784 Generate code that allows ld and ld.so to build executables and shared
12785 libraries with non-exec .plt and .got sections.  This is a PowerPC
12786 32-bit SYSV ABI option.
12787
12788 @item -mbss-plt
12789 @opindex mbss-plt
12790 Generate code that uses a BSS .plt section that ld.so fills in, and
12791 requires .plt and .got sections that are both writable and executable.
12792 This is a PowerPC 32-bit SYSV ABI option.
12793
12794 @item -misel
12795 @itemx -mno-isel
12796 @opindex misel
12797 @opindex mno-isel
12798 This switch enables or disables the generation of ISEL instructions.
12799
12800 @item -misel=@var{yes/no}
12801 This switch has been deprecated.  Use @option{-misel} and
12802 @option{-mno-isel} instead.
12803
12804 @item -mspe
12805 @itemx -mno-spe
12806 @opindex mspe
12807 @opindex mno-spe
12808 This switch enables or disables the generation of SPE simd
12809 instructions.
12810
12811 @item -mpaired
12812 @itemx -mno-paired
12813 @opindex mpaired
12814 @opindex mno-paired
12815 This switch enables or disables the generation of PAIRED simd
12816 instructions.
12817
12818 @item -mspe=@var{yes/no}
12819 This option has been deprecated.  Use @option{-mspe} and
12820 @option{-mno-spe} instead.
12821
12822 @item -mfloat-gprs=@var{yes/single/double/no}
12823 @itemx -mfloat-gprs
12824 @opindex mfloat-gprs
12825 This switch enables or disables the generation of floating point
12826 operations on the general purpose registers for architectures that
12827 support it.
12828
12829 The argument @var{yes} or @var{single} enables the use of
12830 single-precision floating point operations.
12831
12832 The argument @var{double} enables the use of single and
12833 double-precision floating point operations.
12834
12835 The argument @var{no} disables floating point operations on the
12836 general purpose registers.
12837
12838 This option is currently only available on the MPC854x.
12839
12840 @item -m32
12841 @itemx -m64
12842 @opindex m32
12843 @opindex m64
12844 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
12845 targets (including GNU/Linux).  The 32-bit environment sets int, long
12846 and pointer to 32 bits and generates code that runs on any PowerPC
12847 variant.  The 64-bit environment sets int to 32 bits and long and
12848 pointer to 64 bits, and generates code for PowerPC64, as for
12849 @option{-mpowerpc64}.
12850
12851 @item -mfull-toc
12852 @itemx -mno-fp-in-toc
12853 @itemx -mno-sum-in-toc
12854 @itemx -mminimal-toc
12855 @opindex mfull-toc
12856 @opindex mno-fp-in-toc
12857 @opindex mno-sum-in-toc
12858 @opindex mminimal-toc
12859 Modify generation of the TOC (Table Of Contents), which is created for
12860 every executable file.  The @option{-mfull-toc} option is selected by
12861 default.  In that case, GCC will allocate at least one TOC entry for
12862 each unique non-automatic variable reference in your program.  GCC
12863 will also place floating-point constants in the TOC@.  However, only
12864 16,384 entries are available in the TOC@.
12865
12866 If you receive a linker error message that saying you have overflowed
12867 the available TOC space, you can reduce the amount of TOC space used
12868 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
12869 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
12870 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
12871 generate code to calculate the sum of an address and a constant at
12872 run-time instead of putting that sum into the TOC@.  You may specify one
12873 or both of these options.  Each causes GCC to produce very slightly
12874 slower and larger code at the expense of conserving TOC space.
12875
12876 If you still run out of space in the TOC even when you specify both of
12877 these options, specify @option{-mminimal-toc} instead.  This option causes
12878 GCC to make only one TOC entry for every file.  When you specify this
12879 option, GCC will produce code that is slower and larger but which
12880 uses extremely little TOC space.  You may wish to use this option
12881 only on files that contain less frequently executed code.
12882
12883 @item -maix64
12884 @itemx -maix32
12885 @opindex maix64
12886 @opindex maix32
12887 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
12888 @code{long} type, and the infrastructure needed to support them.
12889 Specifying @option{-maix64} implies @option{-mpowerpc64} and
12890 @option{-mpowerpc}, while @option{-maix32} disables the 64-bit ABI and
12891 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
12892
12893 @item -mxl-compat
12894 @itemx -mno-xl-compat
12895 @opindex mxl-compat
12896 @opindex mno-xl-compat
12897 Produce code that conforms more closely to IBM XL compiler semantics
12898 when using AIX-compatible ABI.  Pass floating-point arguments to
12899 prototyped functions beyond the register save area (RSA) on the stack
12900 in addition to argument FPRs.  Do not assume that most significant
12901 double in 128-bit long double value is properly rounded when comparing
12902 values and converting to double.  Use XL symbol names for long double
12903 support routines.
12904
12905 The AIX calling convention was extended but not initially documented to
12906 handle an obscure K&R C case of calling a function that takes the
12907 address of its arguments with fewer arguments than declared.  IBM XL
12908 compilers access floating point arguments which do not fit in the
12909 RSA from the stack when a subroutine is compiled without
12910 optimization.  Because always storing floating-point arguments on the
12911 stack is inefficient and rarely needed, this option is not enabled by
12912 default and only is necessary when calling subroutines compiled by IBM
12913 XL compilers without optimization.
12914
12915 @item -mpe
12916 @opindex mpe
12917 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
12918 application written to use message passing with special startup code to
12919 enable the application to run.  The system must have PE installed in the
12920 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
12921 must be overridden with the @option{-specs=} option to specify the
12922 appropriate directory location.  The Parallel Environment does not
12923 support threads, so the @option{-mpe} option and the @option{-pthread}
12924 option are incompatible.
12925
12926 @item -malign-natural
12927 @itemx -malign-power
12928 @opindex malign-natural
12929 @opindex malign-power
12930 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
12931 @option{-malign-natural} overrides the ABI-defined alignment of larger
12932 types, such as floating-point doubles, on their natural size-based boundary.
12933 The option @option{-malign-power} instructs GCC to follow the ABI-specified
12934 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
12935
12936 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
12937 is not supported.
12938
12939 @item -msoft-float
12940 @itemx -mhard-float
12941 @opindex msoft-float
12942 @opindex mhard-float
12943 Generate code that does not use (uses) the floating-point register set.
12944 Software floating point emulation is provided if you use the
12945 @option{-msoft-float} option, and pass the option to GCC when linking.
12946
12947 @item -mmultiple
12948 @itemx -mno-multiple
12949 @opindex mmultiple
12950 @opindex mno-multiple
12951 Generate code that uses (does not use) the load multiple word
12952 instructions and the store multiple word instructions.  These
12953 instructions are generated by default on POWER systems, and not
12954 generated on PowerPC systems.  Do not use @option{-mmultiple} on little
12955 endian PowerPC systems, since those instructions do not work when the
12956 processor is in little endian mode.  The exceptions are PPC740 and
12957 PPC750 which permit the instructions usage in little endian mode.
12958
12959 @item -mstring
12960 @itemx -mno-string
12961 @opindex mstring
12962 @opindex mno-string
12963 Generate code that uses (does not use) the load string instructions
12964 and the store string word instructions to save multiple registers and
12965 do small block moves.  These instructions are generated by default on
12966 POWER systems, and not generated on PowerPC systems.  Do not use
12967 @option{-mstring} on little endian PowerPC systems, since those
12968 instructions do not work when the processor is in little endian mode.
12969 The exceptions are PPC740 and PPC750 which permit the instructions
12970 usage in little endian mode.
12971
12972 @item -mupdate
12973 @itemx -mno-update
12974 @opindex mupdate
12975 @opindex mno-update
12976 Generate code that uses (does not use) the load or store instructions
12977 that update the base register to the address of the calculated memory
12978 location.  These instructions are generated by default.  If you use
12979 @option{-mno-update}, there is a small window between the time that the
12980 stack pointer is updated and the address of the previous frame is
12981 stored, which means code that walks the stack frame across interrupts or
12982 signals may get corrupted data.
12983
12984 @item -mfused-madd
12985 @itemx -mno-fused-madd
12986 @opindex mfused-madd
12987 @opindex mno-fused-madd
12988 Generate code that uses (does not use) the floating point multiply and
12989 accumulate instructions.  These instructions are generated by default if
12990 hardware floating is used.
12991
12992 @item -mmulhw
12993 @itemx -mno-mulhw
12994 @opindex mmulhw
12995 @opindex mno-mulhw
12996 Generate code that uses (does not use) the half-word multiply and
12997 multiply-accumulate instructions on the IBM 405 and 440 processors.
12998 These instructions are generated by default when targetting those
12999 processors.
13000
13001 @item -mdlmzb
13002 @itemx -mno-dlmzb
13003 @opindex mdlmzb
13004 @opindex mno-dlmzb
13005 Generate code that uses (does not use) the string-search @samp{dlmzb}
13006 instruction on the IBM 405 and 440 processors.  This instruction is
13007 generated by default when targetting those processors.
13008
13009 @item -mno-bit-align
13010 @itemx -mbit-align
13011 @opindex mno-bit-align
13012 @opindex mbit-align
13013 On System V.4 and embedded PowerPC systems do not (do) force structures
13014 and unions that contain bit-fields to be aligned to the base type of the
13015 bit-field.
13016
13017 For example, by default a structure containing nothing but 8
13018 @code{unsigned} bit-fields of length 1 would be aligned to a 4 byte
13019 boundary and have a size of 4 bytes.  By using @option{-mno-bit-align},
13020 the structure would be aligned to a 1 byte boundary and be one byte in
13021 size.
13022
13023 @item -mno-strict-align
13024 @itemx -mstrict-align
13025 @opindex mno-strict-align
13026 @opindex mstrict-align
13027 On System V.4 and embedded PowerPC systems do not (do) assume that
13028 unaligned memory references will be handled by the system.
13029
13030 @item -mrelocatable
13031 @itemx -mno-relocatable
13032 @opindex mrelocatable
13033 @opindex mno-relocatable
13034 On embedded PowerPC systems generate code that allows (does not allow)
13035 the program to be relocated to a different address at runtime.  If you
13036 use @option{-mrelocatable} on any module, all objects linked together must
13037 be compiled with @option{-mrelocatable} or @option{-mrelocatable-lib}.
13038
13039 @item -mrelocatable-lib
13040 @itemx -mno-relocatable-lib
13041 @opindex mrelocatable-lib
13042 @opindex mno-relocatable-lib
13043 On embedded PowerPC systems generate code that allows (does not allow)
13044 the program to be relocated to a different address at runtime.  Modules
13045 compiled with @option{-mrelocatable-lib} can be linked with either modules
13046 compiled without @option{-mrelocatable} and @option{-mrelocatable-lib} or
13047 with modules compiled with the @option{-mrelocatable} options.
13048
13049 @item -mno-toc
13050 @itemx -mtoc
13051 @opindex mno-toc
13052 @opindex mtoc
13053 On System V.4 and embedded PowerPC systems do not (do) assume that
13054 register 2 contains a pointer to a global area pointing to the addresses
13055 used in the program.
13056
13057 @item -mlittle
13058 @itemx -mlittle-endian
13059 @opindex mlittle
13060 @opindex mlittle-endian
13061 On System V.4 and embedded PowerPC systems compile code for the
13062 processor in little endian mode.  The @option{-mlittle-endian} option is
13063 the same as @option{-mlittle}.
13064
13065 @item -mbig
13066 @itemx -mbig-endian
13067 @opindex mbig
13068 @opindex mbig-endian
13069 On System V.4 and embedded PowerPC systems compile code for the
13070 processor in big endian mode.  The @option{-mbig-endian} option is
13071 the same as @option{-mbig}.
13072
13073 @item -mdynamic-no-pic
13074 @opindex mdynamic-no-pic
13075 On Darwin and Mac OS X systems, compile code so that it is not
13076 relocatable, but that its external references are relocatable.  The
13077 resulting code is suitable for applications, but not shared
13078 libraries.
13079
13080 @item -mprioritize-restricted-insns=@var{priority}
13081 @opindex mprioritize-restricted-insns
13082 This option controls the priority that is assigned to
13083 dispatch-slot restricted instructions during the second scheduling
13084 pass.  The argument @var{priority} takes the value @var{0/1/2} to assign
13085 @var{no/highest/second-highest} priority to dispatch slot restricted
13086 instructions.
13087
13088 @item -msched-costly-dep=@var{dependence_type}
13089 @opindex msched-costly-dep
13090 This option controls which dependences are considered costly
13091 by the target during instruction scheduling.  The argument
13092 @var{dependence_type} takes one of the following values:
13093 @var{no}: no dependence is costly,
13094 @var{all}: all dependences are costly,
13095 @var{true_store_to_load}: a true dependence from store to load is costly,
13096 @var{store_to_load}: any dependence from store to load is costly,
13097 @var{number}: any dependence which latency >= @var{number} is costly.
13098
13099 @item -minsert-sched-nops=@var{scheme}
13100 @opindex minsert-sched-nops
13101 This option controls which nop insertion scheme will be used during
13102 the second scheduling pass.  The argument @var{scheme} takes one of the
13103 following values:
13104 @var{no}: Don't insert nops.
13105 @var{pad}: Pad with nops any dispatch group which has vacant issue slots,
13106 according to the scheduler's grouping.
13107 @var{regroup_exact}: Insert nops to force costly dependent insns into
13108 separate groups.  Insert exactly as many nops as needed to force an insn
13109 to a new group, according to the estimated processor grouping.
13110 @var{number}: Insert nops to force costly dependent insns into
13111 separate groups.  Insert @var{number} nops to force an insn to a new group.
13112
13113 @item -mcall-sysv
13114 @opindex mcall-sysv
13115 On System V.4 and embedded PowerPC systems compile code using calling
13116 conventions that adheres to the March 1995 draft of the System V
13117 Application Binary Interface, PowerPC processor supplement.  This is the
13118 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
13119
13120 @item -mcall-sysv-eabi
13121 @opindex mcall-sysv-eabi
13122 Specify both @option{-mcall-sysv} and @option{-meabi} options.
13123
13124 @item -mcall-sysv-noeabi
13125 @opindex mcall-sysv-noeabi
13126 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
13127
13128 @item -mcall-solaris
13129 @opindex mcall-solaris
13130 On System V.4 and embedded PowerPC systems compile code for the Solaris
13131 operating system.
13132
13133 @item -mcall-linux
13134 @opindex mcall-linux
13135 On System V.4 and embedded PowerPC systems compile code for the
13136 Linux-based GNU system.
13137
13138 @item -mcall-gnu
13139 @opindex mcall-gnu
13140 On System V.4 and embedded PowerPC systems compile code for the
13141 Hurd-based GNU system.
13142
13143 @item -mcall-netbsd
13144 @opindex mcall-netbsd
13145 On System V.4 and embedded PowerPC systems compile code for the
13146 NetBSD operating system.
13147
13148 @item -maix-struct-return
13149 @opindex maix-struct-return
13150 Return all structures in memory (as specified by the AIX ABI)@.
13151
13152 @item -msvr4-struct-return
13153 @opindex msvr4-struct-return
13154 Return structures smaller than 8 bytes in registers (as specified by the
13155 SVR4 ABI)@.
13156
13157 @item -mabi=@var{abi-type}
13158 @opindex mabi
13159 Extend the current ABI with a particular extension, or remove such extension.
13160 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
13161 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble}@.
13162
13163 @item -mabi=spe
13164 @opindex mabi=spe
13165 Extend the current ABI with SPE ABI extensions.  This does not change
13166 the default ABI, instead it adds the SPE ABI extensions to the current
13167 ABI@.
13168
13169 @item -mabi=no-spe
13170 @opindex mabi=no-spe
13171 Disable Booke SPE ABI extensions for the current ABI@.
13172
13173 @item -mabi=ibmlongdouble
13174 @opindex mabi=ibmlongdouble
13175 Change the current ABI to use IBM extended precision long double.
13176 This is a PowerPC 32-bit SYSV ABI option.
13177
13178 @item -mabi=ieeelongdouble
13179 @opindex mabi=ieeelongdouble
13180 Change the current ABI to use IEEE extended precision long double.
13181 This is a PowerPC 32-bit Linux ABI option.
13182
13183 @item -mprototype
13184 @itemx -mno-prototype
13185 @opindex mprototype
13186 @opindex mno-prototype
13187 On System V.4 and embedded PowerPC systems assume that all calls to
13188 variable argument functions are properly prototyped.  Otherwise, the
13189 compiler must insert an instruction before every non prototyped call to
13190 set or clear bit 6 of the condition code register (@var{CR}) to
13191 indicate whether floating point values were passed in the floating point
13192 registers in case the function takes a variable arguments.  With
13193 @option{-mprototype}, only calls to prototyped variable argument functions
13194 will set or clear the bit.
13195
13196 @item -msim
13197 @opindex msim
13198 On embedded PowerPC systems, assume that the startup module is called
13199 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
13200 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}.
13201 configurations.
13202
13203 @item -mmvme
13204 @opindex mmvme
13205 On embedded PowerPC systems, assume that the startup module is called
13206 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
13207 @file{libc.a}.
13208
13209 @item -mads
13210 @opindex mads
13211 On embedded PowerPC systems, assume that the startup module is called
13212 @file{crt0.o} and the standard C libraries are @file{libads.a} and
13213 @file{libc.a}.
13214
13215 @item -myellowknife
13216 @opindex myellowknife
13217 On embedded PowerPC systems, assume that the startup module is called
13218 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
13219 @file{libc.a}.
13220
13221 @item -mvxworks
13222 @opindex mvxworks
13223 On System V.4 and embedded PowerPC systems, specify that you are
13224 compiling for a VxWorks system.
13225
13226 @item -mwindiss
13227 @opindex mwindiss
13228 Specify that you are compiling for the WindISS simulation environment.
13229
13230 @item -memb
13231 @opindex memb
13232 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
13233 header to indicate that @samp{eabi} extended relocations are used.
13234
13235 @item -meabi
13236 @itemx -mno-eabi
13237 @opindex meabi
13238 @opindex mno-eabi
13239 On System V.4 and embedded PowerPC systems do (do not) adhere to the
13240 Embedded Applications Binary Interface (eabi) which is a set of
13241 modifications to the System V.4 specifications.  Selecting @option{-meabi}
13242 means that the stack is aligned to an 8 byte boundary, a function
13243 @code{__eabi} is called to from @code{main} to set up the eabi
13244 environment, and the @option{-msdata} option can use both @code{r2} and
13245 @code{r13} to point to two separate small data areas.  Selecting
13246 @option{-mno-eabi} means that the stack is aligned to a 16 byte boundary,
13247 do not call an initialization function from @code{main}, and the
13248 @option{-msdata} option will only use @code{r13} to point to a single
13249 small data area.  The @option{-meabi} option is on by default if you
13250 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
13251
13252 @item -msdata=eabi
13253 @opindex msdata=eabi
13254 On System V.4 and embedded PowerPC systems, put small initialized
13255 @code{const} global and static data in the @samp{.sdata2} section, which
13256 is pointed to by register @code{r2}.  Put small initialized
13257 non-@code{const} global and static data in the @samp{.sdata} section,
13258 which is pointed to by register @code{r13}.  Put small uninitialized
13259 global and static data in the @samp{.sbss} section, which is adjacent to
13260 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
13261 incompatible with the @option{-mrelocatable} option.  The
13262 @option{-msdata=eabi} option also sets the @option{-memb} option.
13263
13264 @item -msdata=sysv
13265 @opindex msdata=sysv
13266 On System V.4 and embedded PowerPC systems, put small global and static
13267 data in the @samp{.sdata} section, which is pointed to by register
13268 @code{r13}.  Put small uninitialized global and static data in the
13269 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
13270 The @option{-msdata=sysv} option is incompatible with the
13271 @option{-mrelocatable} option.
13272
13273 @item -msdata=default
13274 @itemx -msdata
13275 @opindex msdata=default
13276 @opindex msdata
13277 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
13278 compile code the same as @option{-msdata=eabi}, otherwise compile code the
13279 same as @option{-msdata=sysv}.
13280
13281 @item -msdata-data
13282 @opindex msdata-data
13283 On System V.4 and embedded PowerPC systems, put small global
13284 data in the @samp{.sdata} section.  Put small uninitialized global
13285 data in the @samp{.sbss} section.  Do not use register @code{r13}
13286 to address small data however.  This is the default behavior unless
13287 other @option{-msdata} options are used.
13288
13289 @item -msdata=none
13290 @itemx -mno-sdata
13291 @opindex msdata=none
13292 @opindex mno-sdata
13293 On embedded PowerPC systems, put all initialized global and static data
13294 in the @samp{.data} section, and all uninitialized data in the
13295 @samp{.bss} section.
13296
13297 @item -G @var{num}
13298 @opindex G
13299 @cindex smaller data references (PowerPC)
13300 @cindex .sdata/.sdata2 references (PowerPC)
13301 On embedded PowerPC systems, put global and static items less than or
13302 equal to @var{num} bytes into the small data or bss sections instead of
13303 the normal data or bss section.  By default, @var{num} is 8.  The
13304 @option{-G @var{num}} switch is also passed to the linker.
13305 All modules should be compiled with the same @option{-G @var{num}} value.
13306
13307 @item -mregnames
13308 @itemx -mno-regnames
13309 @opindex mregnames
13310 @opindex mno-regnames
13311 On System V.4 and embedded PowerPC systems do (do not) emit register
13312 names in the assembly language output using symbolic forms.
13313
13314 @item -mlongcall
13315 @itemx -mno-longcall
13316 @opindex mlongcall
13317 @opindex mno-longcall
13318 By default assume that all calls are far away so that a longer more
13319 expensive calling sequence is required.  This is required for calls
13320 further than 32 megabytes (33,554,432 bytes) from the current location.
13321 A short call will be generated if the compiler knows
13322 the call cannot be that far away.  This setting can be overridden by
13323 the @code{shortcall} function attribute, or by @code{#pragma
13324 longcall(0)}.
13325
13326 Some linkers are capable of detecting out-of-range calls and generating
13327 glue code on the fly.  On these systems, long calls are unnecessary and
13328 generate slower code.  As of this writing, the AIX linker can do this,
13329 as can the GNU linker for PowerPC/64.  It is planned to add this feature
13330 to the GNU linker for 32-bit PowerPC systems as well.
13331
13332 On Darwin/PPC systems, @code{#pragma longcall} will generate ``jbsr
13333 callee, L42'', plus a ``branch island'' (glue code).  The two target
13334 addresses represent the callee and the ``branch island''.  The
13335 Darwin/PPC linker will prefer the first address and generate a ``bl
13336 callee'' if the PPC ``bl'' instruction will reach the callee directly;
13337 otherwise, the linker will generate ``bl L42'' to call the ``branch
13338 island''.  The ``branch island'' is appended to the body of the
13339 calling function; it computes the full 32-bit address of the callee
13340 and jumps to it.
13341
13342 On Mach-O (Darwin) systems, this option directs the compiler emit to
13343 the glue for every direct call, and the Darwin linker decides whether
13344 to use or discard it.
13345
13346 In the future, we may cause GCC to ignore all longcall specifications
13347 when the linker is known to generate glue.
13348
13349 @item -pthread
13350 @opindex pthread
13351 Adds support for multithreading with the @dfn{pthreads} library.
13352 This option sets flags for both the preprocessor and linker.
13353
13354 @end table
13355
13356 @node S/390 and zSeries Options
13357 @subsection S/390 and zSeries Options
13358 @cindex S/390 and zSeries Options
13359
13360 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
13361
13362 @table @gcctabopt
13363 @item -mhard-float
13364 @itemx -msoft-float
13365 @opindex mhard-float
13366 @opindex msoft-float
13367 Use (do not use) the hardware floating-point instructions and registers
13368 for floating-point operations.  When @option{-msoft-float} is specified,
13369 functions in @file{libgcc.a} will be used to perform floating-point
13370 operations.  When @option{-mhard-float} is specified, the compiler
13371 generates IEEE floating-point instructions.  This is the default.
13372
13373 @item -mlong-double-64
13374 @itemx -mlong-double-128
13375 @opindex mlong-double-64
13376 @opindex mlong-double-128
13377 These switches control the size of @code{long double} type. A size
13378 of 64bit makes the @code{long double} type equivalent to the @code{double}
13379 type. This is the default.
13380
13381 @item -mbackchain
13382 @itemx -mno-backchain
13383 @opindex mbackchain
13384 @opindex mno-backchain
13385 Store (do not store) the address of the caller's frame as backchain pointer
13386 into the callee's stack frame.
13387 A backchain may be needed to allow debugging using tools that do not understand
13388 DWARF-2 call frame information.
13389 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
13390 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
13391 the backchain is placed into the topmost word of the 96/160 byte register
13392 save area.
13393
13394 In general, code compiled with @option{-mbackchain} is call-compatible with
13395 code compiled with @option{-mmo-backchain}; however, use of the backchain
13396 for debugging purposes usually requires that the whole binary is built with
13397 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
13398 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
13399 to build a linux kernel use @option{-msoft-float}.
13400
13401 The default is to not maintain the backchain.
13402
13403 @item -mpacked-stack
13404 @item -mno-packed-stack
13405 @opindex mpacked-stack
13406 @opindex mno-packed-stack
13407 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
13408 specified, the compiler uses the all fields of the 96/160 byte register save
13409 area only for their default purpose; unused fields still take up stack space.
13410 When @option{-mpacked-stack} is specified, register save slots are densely
13411 packed at the top of the register save area; unused space is reused for other
13412 purposes, allowing for more efficient use of the available stack space.
13413 However, when @option{-mbackchain} is also in effect, the topmost word of
13414 the save area is always used to store the backchain, and the return address
13415 register is always saved two words below the backchain.
13416
13417 As long as the stack frame backchain is not used, code generated with
13418 @option{-mpacked-stack} is call-compatible with code generated with
13419 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
13420 S/390 or zSeries generated code that uses the stack frame backchain at run
13421 time, not just for debugging purposes.  Such code is not call-compatible
13422 with code compiled with @option{-mpacked-stack}.  Also, note that the
13423 combination of @option{-mbackchain},
13424 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
13425 to build a linux kernel use @option{-msoft-float}.
13426
13427 The default is to not use the packed stack layout.
13428
13429 @item -msmall-exec
13430 @itemx -mno-small-exec
13431 @opindex msmall-exec
13432 @opindex mno-small-exec
13433 Generate (or do not generate) code using the @code{bras} instruction
13434 to do subroutine calls.
13435 This only works reliably if the total executable size does not
13436 exceed 64k.  The default is to use the @code{basr} instruction instead,
13437 which does not have this limitation.
13438
13439 @item -m64
13440 @itemx -m31
13441 @opindex m64
13442 @opindex m31
13443 When @option{-m31} is specified, generate code compliant to the
13444 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
13445 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
13446 particular to generate 64-bit instructions.  For the @samp{s390}
13447 targets, the default is @option{-m31}, while the @samp{s390x}
13448 targets default to @option{-m64}.
13449
13450 @item -mzarch
13451 @itemx -mesa
13452 @opindex mzarch
13453 @opindex mesa
13454 When @option{-mzarch} is specified, generate code using the
13455 instructions available on z/Architecture.
13456 When @option{-mesa} is specified, generate code using the
13457 instructions available on ESA/390.  Note that @option{-mesa} is
13458 not possible with @option{-m64}.
13459 When generating code compliant to the GNU/Linux for S/390 ABI,
13460 the default is @option{-mesa}.  When generating code compliant
13461 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
13462
13463 @item -mmvcle
13464 @itemx -mno-mvcle
13465 @opindex mmvcle
13466 @opindex mno-mvcle
13467 Generate (or do not generate) code using the @code{mvcle} instruction
13468 to perform block moves.  When @option{-mno-mvcle} is specified,
13469 use a @code{mvc} loop instead.  This is the default unless optimizing for
13470 size.
13471
13472 @item -mdebug
13473 @itemx -mno-debug
13474 @opindex mdebug
13475 @opindex mno-debug
13476 Print (or do not print) additional debug information when compiling.
13477 The default is to not print debug information.
13478
13479 @item -march=@var{cpu-type}
13480 @opindex march
13481 Generate code that will run on @var{cpu-type}, which is the name of a system
13482 representing a certain processor type.  Possible values for
13483 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, and @samp{z990}.
13484 When generating code using the instructions available on z/Architecture,
13485 the default is @option{-march=z900}.  Otherwise, the default is
13486 @option{-march=g5}.
13487
13488 @item -mtune=@var{cpu-type}
13489 @opindex mtune
13490 Tune to @var{cpu-type} everything applicable about the generated code,
13491 except for the ABI and the set of available instructions.
13492 The list of @var{cpu-type} values is the same as for @option{-march}.
13493 The default is the value used for @option{-march}.
13494
13495 @item -mtpf-trace
13496 @itemx -mno-tpf-trace
13497 @opindex mtpf-trace
13498 @opindex mno-tpf-trace
13499 Generate code that adds (does not add) in TPF OS specific branches to trace
13500 routines in the operating system.  This option is off by default, even
13501 when compiling for the TPF OS@.
13502
13503 @item -mfused-madd
13504 @itemx -mno-fused-madd
13505 @opindex mfused-madd
13506 @opindex mno-fused-madd
13507 Generate code that uses (does not use) the floating point multiply and
13508 accumulate instructions.  These instructions are generated by default if
13509 hardware floating point is used.
13510
13511 @item -mwarn-framesize=@var{framesize}
13512 @opindex mwarn-framesize
13513 Emit a warning if the current function exceeds the given frame size.  Because
13514 this is a compile time check it doesn't need to be a real problem when the program
13515 runs.  It is intended to identify functions which most probably cause
13516 a stack overflow.  It is useful to be used in an environment with limited stack
13517 size e.g.@: the linux kernel.
13518
13519 @item -mwarn-dynamicstack
13520 @opindex mwarn-dynamicstack
13521 Emit a warning if the function calls alloca or uses dynamically
13522 sized arrays.  This is generally a bad idea with a limited stack size.
13523
13524 @item -mstack-guard=@var{stack-guard}
13525 @item -mstack-size=@var{stack-size}
13526 @opindex mstack-guard
13527 @opindex mstack-size
13528 If these options are provided the s390 back end emits additional instructions in
13529 the function prologue which trigger a trap if the stack size is @var{stack-guard}
13530 bytes above the @var{stack-size} (remember that the stack on s390 grows downward).
13531 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
13532 the frame size of the compiled function is chosen.
13533 These options are intended to be used to help debugging stack overflow problems.
13534 The additionally emitted code causes only little overhead and hence can also be
13535 used in production like systems without greater performance degradation.  The given
13536 values have to be exact powers of 2 and @var{stack-size} has to be greater than
13537 @var{stack-guard} without exceeding 64k.
13538 In order to be efficient the extra code makes the assumption that the stack starts
13539 at an address aligned to the value given by @var{stack-size}.
13540 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
13541 @end table
13542
13543 @node Score Options
13544 @subsection Score Options
13545 @cindex Score Options
13546
13547 These options are defined for Score implementations:
13548
13549 @table @gcctabopt
13550 @item -meb
13551 @opindex meb
13552 Compile code for big endian mode.  This is the default.
13553
13554 @item -mel
13555 @opindex mel
13556 Compile code for little endian mode. 
13557
13558 @item -mnhwloop
13559 @opindex mnhwloop
13560 Disable generate bcnz instruction.
13561
13562 @item -muls
13563 @opindex muls
13564 Enable generate unaligned load and store instruction.
13565
13566 @item -mmac
13567 @opindex mmac
13568 Enable the use of multiply-accumulate instructions. Disabled by default. 
13569
13570 @item -mscore5
13571 @opindex mscore5
13572 Specify the SCORE5 as the target architecture.
13573
13574 @item -mscore5u
13575 @opindex mscore5u
13576 Specify the SCORE5U of the target architecture.
13577
13578 @item -mscore7
13579 @opindex mscore7
13580 Specify the SCORE7 as the target architecture. This is the default.
13581
13582 @item -mscore7d
13583 @opindex mscore7d
13584 Specify the SCORE7D as the target architecture.
13585 @end table
13586
13587 @node SH Options
13588 @subsection SH Options
13589
13590 These @samp{-m} options are defined for the SH implementations:
13591
13592 @table @gcctabopt
13593 @item -m1
13594 @opindex m1
13595 Generate code for the SH1.
13596
13597 @item -m2
13598 @opindex m2
13599 Generate code for the SH2.
13600
13601 @item -m2e
13602 Generate code for the SH2e.
13603
13604 @item -m3
13605 @opindex m3
13606 Generate code for the SH3.
13607
13608 @item -m3e
13609 @opindex m3e
13610 Generate code for the SH3e.
13611
13612 @item -m4-nofpu
13613 @opindex m4-nofpu
13614 Generate code for the SH4 without a floating-point unit.
13615
13616 @item -m4-single-only
13617 @opindex m4-single-only
13618 Generate code for the SH4 with a floating-point unit that only
13619 supports single-precision arithmetic.
13620
13621 @item -m4-single
13622 @opindex m4-single
13623 Generate code for the SH4 assuming the floating-point unit is in
13624 single-precision mode by default.
13625
13626 @item -m4
13627 @opindex m4
13628 Generate code for the SH4.
13629
13630 @item -m4a-nofpu
13631 @opindex m4a-nofpu
13632 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
13633 floating-point unit is not used.
13634
13635 @item -m4a-single-only
13636 @opindex m4a-single-only
13637 Generate code for the SH4a, in such a way that no double-precision
13638 floating point operations are used.
13639
13640 @item -m4a-single
13641 @opindex m4a-single
13642 Generate code for the SH4a assuming the floating-point unit is in
13643 single-precision mode by default.
13644
13645 @item -m4a
13646 @opindex m4a
13647 Generate code for the SH4a.
13648
13649 @item -m4al
13650 @opindex m4al
13651 Same as @option{-m4a-nofpu}, except that it implicitly passes
13652 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
13653 instructions at the moment.
13654
13655 @item -mb
13656 @opindex mb
13657 Compile code for the processor in big endian mode.
13658
13659 @item -ml
13660 @opindex ml
13661 Compile code for the processor in little endian mode.
13662
13663 @item -mdalign
13664 @opindex mdalign
13665 Align doubles at 64-bit boundaries.  Note that this changes the calling
13666 conventions, and thus some functions from the standard C library will
13667 not work unless you recompile it first with @option{-mdalign}.
13668
13669 @item -mrelax
13670 @opindex mrelax
13671 Shorten some address references at link time, when possible; uses the
13672 linker option @option{-relax}.
13673
13674 @item -mbigtable
13675 @opindex mbigtable
13676 Use 32-bit offsets in @code{switch} tables.  The default is to use
13677 16-bit offsets.
13678
13679 @item -mfmovd
13680 @opindex mfmovd
13681 Enable the use of the instruction @code{fmovd}.
13682
13683 @item -mhitachi
13684 @opindex mhitachi
13685 Comply with the calling conventions defined by Renesas.
13686
13687 @item -mrenesas
13688 @opindex mhitachi
13689 Comply with the calling conventions defined by Renesas.
13690
13691 @item -mno-renesas
13692 @opindex mhitachi
13693 Comply with the calling conventions defined for GCC before the Renesas
13694 conventions were available.  This option is the default for all
13695 targets of the SH toolchain except for @samp{sh-symbianelf}.
13696
13697 @item -mnomacsave
13698 @opindex mnomacsave
13699 Mark the @code{MAC} register as call-clobbered, even if
13700 @option{-mhitachi} is given.
13701
13702 @item -mieee
13703 @opindex mieee
13704 Increase IEEE-compliance of floating-point code.
13705 At the moment, this is equivalent to @option{-fno-finite-math-only}.
13706 When generating 16 bit SH opcodes, getting IEEE-conforming results for
13707 comparisons of NANs / infinities incurs extra overhead in every
13708 floating point comparison, therefore the default is set to
13709 @option{-ffinite-math-only}.
13710
13711 @item -minline-ic_invalidate
13712 @opindex minline-ic_invalidate
13713 Inline code to invalidate instruction cache entries after setting up
13714 nested function trampolines.
13715 This option has no effect if -musermode is in effect and the selected
13716 code generation option (e.g. -m4) does not allow the use of the icbi
13717 instruction.
13718 If the selected code generation option does not allow the use of the icbi
13719 instruction, and -musermode is not in effect, the inlined code will
13720 manipulate the instruction cache address array directly with an associative
13721 write.  This not only requires privileged mode, but it will also
13722 fail if the cache line had been mapped via the TLB and has become unmapped.
13723
13724 @item -misize
13725 @opindex misize
13726 Dump instruction size and location in the assembly code.
13727
13728 @item -mpadstruct
13729 @opindex mpadstruct
13730 This option is deprecated.  It pads structures to multiple of 4 bytes,
13731 which is incompatible with the SH ABI@.
13732
13733 @item -mspace
13734 @opindex mspace
13735 Optimize for space instead of speed.  Implied by @option{-Os}.
13736
13737 @item -mprefergot
13738 @opindex mprefergot
13739 When generating position-independent code, emit function calls using
13740 the Global Offset Table instead of the Procedure Linkage Table.
13741
13742 @item -musermode
13743 @opindex musermode
13744 Don't generate privileged mode only code; implies -mno-inline-ic_invalidate
13745 if the inlined code would not work in user mode.
13746 This is the default when the target is @code{sh-*-linux*}.
13747
13748 @item -multcost=@var{number}
13749 @opindex multcost=@var{number}
13750 Set the cost to assume for a multiply insn.
13751
13752 @item -mdiv=@var{strategy}
13753 @opindex mdiv=@var{strategy}
13754 Set the division strategy to use for SHmedia code.  @var{strategy} must be
13755 one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, inv:call,
13756 inv:call2, inv:fp .
13757 "fp" performs the operation in floating point.  This has a very high latency,
13758 but needs only a few instructions, so it might be a good choice if
13759 your code has enough easily exploitable ILP to allow the compiler to
13760 schedule the floating point instructions together with other instructions.
13761 Division by zero causes a floating point exception.
13762 "inv" uses integer operations to calculate the inverse of the divisor,
13763 and then multiplies the dividend with the inverse.  This strategy allows
13764 cse and hoisting of the inverse calculation.  Division by zero calculates
13765 an unspecified result, but does not trap.
13766 "inv:minlat" is a variant of "inv" where if no cse / hoisting opportunities
13767 have been found, or if the entire operation has been hoisted to the same
13768 place, the last stages of the inverse calculation are intertwined with the
13769 final multiply to reduce the overall latency, at the expense of using a few
13770 more instructions, and thus offering fewer scheduling opportunities with
13771 other code.
13772 "call" calls a library function that usually implements the inv:minlat
13773 strategy.
13774 This gives high code density for m5-*media-nofpu compilations.
13775 "call2" uses a different entry point of the same library function, where it
13776 assumes that a pointer to a lookup table has already been set up, which
13777 exposes the pointer load to cse / code hoisting optimizations.
13778 "inv:call", "inv:call2" and "inv:fp" all use the "inv" algorithm for initial
13779 code generation, but if the code stays unoptimized, revert to the "call",
13780 "call2", or "fp" strategies, respectively.  Note that the
13781 potentially-trapping side effect of division by zero is carried by a
13782 separate instruction, so it is possible that all the integer instructions
13783 are hoisted out, but the marker for the side effect stays where it is.
13784 A recombination to fp operations or a call is not possible in that case.
13785 "inv20u" and "inv20l" are variants of the "inv:minlat" strategy.  In the case
13786 that the inverse calculation was nor separated from the multiply, they speed
13787 up division where the dividend fits into 20 bits (plus sign where applicable),
13788 by inserting a test to skip a number of operations in this case; this test
13789 slows down the case of larger dividends.  inv20u assumes the case of a such
13790 a small dividend to be unlikely, and inv20l assumes it to be likely.
13791
13792 @item -mdivsi3_libfunc=@var{name}
13793 @opindex mdivsi3_libfunc=@var{name}
13794 Set the name of the library function used for 32 bit signed division to
13795 @var{name}.  This only affect the name used in the call and inv:call
13796 division strategies, and the compiler will still expect the same
13797 sets of input/output/clobbered registers as if this option was not present.
13798
13799 @item -madjust-unroll
13800 @opindex madjust-unroll
13801 Throttle unrolling to avoid thrashing target registers.
13802 This option only has an effect if the gcc code base supports the
13803 TARGET_ADJUST_UNROLL_MAX target hook.
13804
13805 @item -mindexed-addressing
13806 @opindex mindexed-addressing
13807 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
13808 This is only safe if the hardware and/or OS implement 32 bit wrap-around
13809 semantics for the indexed addressing mode.  The architecture allows the
13810 implementation of processors with 64 bit MMU, which the OS could use to
13811 get 32 bit addressing, but since no current hardware implementation supports
13812 this or any other way to make the indexed addressing mode safe to use in
13813 the 32 bit ABI, the default is -mno-indexed-addressing.
13814
13815 @item -mgettrcost=@var{number}
13816 @opindex mgettrcost=@var{number}
13817 Set the cost assumed for the gettr instruction to @var{number}.
13818 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
13819
13820 @item -mpt-fixed
13821 @opindex mpt-fixed
13822 Assume pt* instructions won't trap.  This will generally generate better
13823 scheduled code, but is unsafe on current hardware.  The current architecture
13824 definition says that ptabs and ptrel trap when the target anded with 3 is 3.
13825 This has the unintentional effect of making it unsafe to schedule ptabs /
13826 ptrel before a branch, or hoist it out of a loop.  For example,
13827 __do_global_ctors, a part of libgcc that runs constructors at program
13828 startup, calls functions in a list which is delimited by @minus{}1.  With the
13829 -mpt-fixed option, the ptabs will be done before testing against @minus{}1.
13830 That means that all the constructors will be run a bit quicker, but when
13831 the loop comes to the end of the list, the program crashes because ptabs
13832 loads @minus{}1 into a target register.  Since this option is unsafe for any
13833 hardware implementing the current architecture specification, the default
13834 is -mno-pt-fixed.  Unless the user specifies a specific cost with
13835 @option{-mgettrcost}, -mno-pt-fixed also implies @option{-mgettrcost=100};
13836 this deters register allocation using target registers for storing
13837 ordinary integers.
13838
13839 @item -minvalid-symbols
13840 @opindex minvalid-symbols
13841 Assume symbols might be invalid.  Ordinary function symbols generated by
13842 the compiler will always be valid to load with movi/shori/ptabs or
13843 movi/shori/ptrel, but with assembler and/or linker tricks it is possible
13844 to generate symbols that will cause ptabs / ptrel to trap.
13845 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
13846 It will then prevent cross-basic-block cse, hoisting and most scheduling
13847 of symbol loads.  The default is @option{-mno-invalid-symbols}.
13848 @end table
13849
13850 @node SPARC Options
13851 @subsection SPARC Options
13852 @cindex SPARC options
13853
13854 These @samp{-m} options are supported on the SPARC:
13855
13856 @table @gcctabopt
13857 @item -mno-app-regs
13858 @itemx -mapp-regs
13859 @opindex mno-app-regs
13860 @opindex mapp-regs
13861 Specify @option{-mapp-regs} to generate output using the global registers
13862 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
13863 is the default.
13864
13865 To be fully SVR4 ABI compliant at the cost of some performance loss,
13866 specify @option{-mno-app-regs}.  You should compile libraries and system
13867 software with this option.
13868
13869 @item -mfpu
13870 @itemx -mhard-float
13871 @opindex mfpu
13872 @opindex mhard-float
13873 Generate output containing floating point instructions.  This is the
13874 default.
13875
13876 @item -mno-fpu
13877 @itemx -msoft-float
13878 @opindex mno-fpu
13879 @opindex msoft-float
13880 Generate output containing library calls for floating point.
13881 @strong{Warning:} the requisite libraries are not available for all SPARC
13882 targets.  Normally the facilities of the machine's usual C compiler are
13883 used, but this cannot be done directly in cross-compilation.  You must make
13884 your own arrangements to provide suitable library functions for
13885 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
13886 @samp{sparclite-*-*} do provide software floating point support.
13887
13888 @option{-msoft-float} changes the calling convention in the output file;
13889 therefore, it is only useful if you compile @emph{all} of a program with
13890 this option.  In particular, you need to compile @file{libgcc.a}, the
13891 library that comes with GCC, with @option{-msoft-float} in order for
13892 this to work.
13893
13894 @item -mhard-quad-float
13895 @opindex mhard-quad-float
13896 Generate output containing quad-word (long double) floating point
13897 instructions.
13898
13899 @item -msoft-quad-float
13900 @opindex msoft-quad-float
13901 Generate output containing library calls for quad-word (long double)
13902 floating point instructions.  The functions called are those specified
13903 in the SPARC ABI@.  This is the default.
13904
13905 As of this writing, there are no SPARC implementations that have hardware
13906 support for the quad-word floating point instructions.  They all invoke
13907 a trap handler for one of these instructions, and then the trap handler
13908 emulates the effect of the instruction.  Because of the trap handler overhead,
13909 this is much slower than calling the ABI library routines.  Thus the
13910 @option{-msoft-quad-float} option is the default.
13911
13912 @item -mno-unaligned-doubles
13913 @itemx -munaligned-doubles
13914 @opindex mno-unaligned-doubles
13915 @opindex munaligned-doubles
13916 Assume that doubles have 8 byte alignment.  This is the default.
13917
13918 With @option{-munaligned-doubles}, GCC assumes that doubles have 8 byte
13919 alignment only if they are contained in another type, or if they have an
13920 absolute address.  Otherwise, it assumes they have 4 byte alignment.
13921 Specifying this option avoids some rare compatibility problems with code
13922 generated by other compilers.  It is not the default because it results
13923 in a performance loss, especially for floating point code.
13924
13925 @item -mno-faster-structs
13926 @itemx -mfaster-structs
13927 @opindex mno-faster-structs
13928 @opindex mfaster-structs
13929 With @option{-mfaster-structs}, the compiler assumes that structures
13930 should have 8 byte alignment.  This enables the use of pairs of
13931 @code{ldd} and @code{std} instructions for copies in structure
13932 assignment, in place of twice as many @code{ld} and @code{st} pairs.
13933 However, the use of this changed alignment directly violates the SPARC
13934 ABI@.  Thus, it's intended only for use on targets where the developer
13935 acknowledges that their resulting code will not be directly in line with
13936 the rules of the ABI@.
13937
13938 @item -mimpure-text
13939 @opindex mimpure-text
13940 @option{-mimpure-text}, used in addition to @option{-shared}, tells
13941 the compiler to not pass @option{-z text} to the linker when linking a
13942 shared object.  Using this option, you can link position-dependent
13943 code into a shared object.
13944
13945 @option{-mimpure-text} suppresses the ``relocations remain against
13946 allocatable but non-writable sections'' linker error message.
13947 However, the necessary relocations will trigger copy-on-write, and the
13948 shared object is not actually shared across processes.  Instead of
13949 using @option{-mimpure-text}, you should compile all source code with
13950 @option{-fpic} or @option{-fPIC}.
13951
13952 This option is only available on SunOS and Solaris.
13953
13954 @item -mcpu=@var{cpu_type}
13955 @opindex mcpu
13956 Set the instruction set, register set, and instruction scheduling parameters
13957 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
13958 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{sparclite},
13959 @samp{f930}, @samp{f934}, @samp{hypersparc}, @samp{sparclite86x},
13960 @samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc},
13961 @samp{ultrasparc3}, @samp{niagara} and @samp{niagara2}.
13962
13963 Default instruction scheduling parameters are used for values that select
13964 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
13965 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
13966
13967 Here is a list of each supported architecture and their supported
13968 implementations.
13969
13970 @smallexample
13971     v7:             cypress
13972     v8:             supersparc, hypersparc
13973     sparclite:      f930, f934, sparclite86x
13974     sparclet:       tsc701
13975     v9:             ultrasparc, ultrasparc3, niagara, niagara2
13976 @end smallexample
13977
13978 By default (unless configured otherwise), GCC generates code for the V7
13979 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
13980 additionally optimizes it for the Cypress CY7C602 chip, as used in the
13981 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
13982 SPARCStation 1, 2, IPX etc.
13983
13984 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
13985 architecture.  The only difference from V7 code is that the compiler emits
13986 the integer multiply and integer divide instructions which exist in SPARC-V8
13987 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
13988 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
13989 2000 series.
13990
13991 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
13992 the SPARC architecture.  This adds the integer multiply, integer divide step
13993 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
13994 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
13995 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
13996 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
13997 MB86934 chip, which is the more recent SPARClite with FPU@.
13998
13999 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
14000 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
14001 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
14002 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
14003 optimizes it for the TEMIC SPARClet chip.
14004
14005 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
14006 architecture.  This adds 64-bit integer and floating-point move instructions,
14007 3 additional floating-point condition code registers and conditional move
14008 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
14009 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
14010 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
14011 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
14012 @option{-mcpu=niagara}, the compiler additionally optimizes it for
14013 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
14014 additionally optimizes it for Sun UltraSPARC T2 chips.
14015
14016 @item -mtune=@var{cpu_type}
14017 @opindex mtune
14018 Set the instruction scheduling parameters for machine type
14019 @var{cpu_type}, but do not set the instruction set or register set that the
14020 option @option{-mcpu=@var{cpu_type}} would.
14021
14022 The same values for @option{-mcpu=@var{cpu_type}} can be used for
14023 @option{-mtune=@var{cpu_type}}, but the only useful values are those
14024 that select a particular cpu implementation.  Those are @samp{cypress},
14025 @samp{supersparc}, @samp{hypersparc}, @samp{f930}, @samp{f934},
14026 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
14027 @samp{ultrasparc3}, @samp{niagara}, and @samp{niagara2}.
14028
14029 @item -mv8plus
14030 @itemx -mno-v8plus
14031 @opindex mv8plus
14032 @opindex mno-v8plus
14033 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
14034 difference from the V8 ABI is that the global and out registers are
14035 considered 64-bit wide.  This is enabled by default on Solaris in 32-bit
14036 mode for all SPARC-V9 processors.
14037
14038 @item -mvis
14039 @itemx -mno-vis
14040 @opindex mvis
14041 @opindex mno-vis
14042 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
14043 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
14044 @end table
14045
14046 These @samp{-m} options are supported in addition to the above
14047 on SPARC-V9 processors in 64-bit environments:
14048
14049 @table @gcctabopt
14050 @item -mlittle-endian
14051 @opindex mlittle-endian
14052 Generate code for a processor running in little-endian mode.  It is only
14053 available for a few configurations and most notably not on Solaris and Linux.
14054
14055 @item -m32
14056 @itemx -m64
14057 @opindex m32
14058 @opindex m64
14059 Generate code for a 32-bit or 64-bit environment.
14060 The 32-bit environment sets int, long and pointer to 32 bits.
14061 The 64-bit environment sets int to 32 bits and long and pointer
14062 to 64 bits.
14063
14064 @item -mcmodel=medlow
14065 @opindex mcmodel=medlow
14066 Generate code for the Medium/Low code model: 64-bit addresses, programs
14067 must be linked in the low 32 bits of memory.  Programs can be statically
14068 or dynamically linked.
14069
14070 @item -mcmodel=medmid
14071 @opindex mcmodel=medmid
14072 Generate code for the Medium/Middle code model: 64-bit addresses, programs
14073 must be linked in the low 44 bits of memory, the text and data segments must
14074 be less than 2GB in size and the data segment must be located within 2GB of
14075 the text segment.
14076
14077 @item -mcmodel=medany
14078 @opindex mcmodel=medany
14079 Generate code for the Medium/Anywhere code model: 64-bit addresses, programs
14080 may be linked anywhere in memory, the text and data segments must be less
14081 than 2GB in size and the data segment must be located within 2GB of the
14082 text segment.
14083
14084 @item -mcmodel=embmedany
14085 @opindex mcmodel=embmedany
14086 Generate code for the Medium/Anywhere code model for embedded systems:
14087 64-bit addresses, the text and data segments must be less than 2GB in
14088 size, both starting anywhere in memory (determined at link time).  The
14089 global register %g4 points to the base of the data segment.  Programs
14090 are statically linked and PIC is not supported.
14091
14092 @item -mstack-bias
14093 @itemx -mno-stack-bias
14094 @opindex mstack-bias
14095 @opindex mno-stack-bias
14096 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
14097 frame pointer if present, are offset by @minus{}2047 which must be added back
14098 when making stack frame references.  This is the default in 64-bit mode.
14099 Otherwise, assume no such offset is present.
14100 @end table
14101
14102 These switches are supported in addition to the above on Solaris:
14103
14104 @table @gcctabopt
14105 @item -threads
14106 @opindex threads
14107 Add support for multithreading using the Solaris threads library.  This
14108 option sets flags for both the preprocessor and linker.  This option does
14109 not affect the thread safety of object code produced by the compiler or
14110 that of libraries supplied with it.
14111
14112 @item -pthreads
14113 @opindex pthreads
14114 Add support for multithreading using the POSIX threads library.  This
14115 option sets flags for both the preprocessor and linker.  This option does
14116 not affect the thread safety of object code produced  by the compiler or
14117 that of libraries supplied with it.
14118
14119 @item -pthread
14120 @opindex pthread
14121 This is a synonym for @option{-pthreads}.
14122 @end table
14123
14124 @node SPU Options
14125 @subsection SPU Options
14126 @cindex SPU options
14127
14128 These @samp{-m} options are supported on the SPU:
14129
14130 @table @gcctabopt
14131 @item -mwarn-reloc
14132 @itemx -merror-reloc
14133 @opindex mwarn-reloc
14134 @opindex merror-reloc
14135
14136 The loader for SPU does not handle dynamic relocations.  By default, GCC
14137 will give an error when it generates code that requires a dynamic
14138 relocation.  @option{-mno-error-reloc} disables the error,
14139 @option{-mwarn-reloc} will generate a warning instead.
14140
14141 @item -msafe-dma
14142 @itemx -munsafe-dma
14143 @opindex msafe-dma
14144 @opindex munsafe-dma
14145
14146 Instructions which initiate or test completion of DMA must not be
14147 reordered with respect to loads and stores of the memory which is being
14148 accessed.  Users typically address this problem using the volatile
14149 keyword, but that can lead to inefficient code in places where the
14150 memory is known to not change.  Rather than mark the memory as volatile
14151 we treat the DMA instructions as potentially effecting all memory.  With
14152 @option{-munsafe-dma} users must use the volatile keyword to protect
14153 memory accesses.
14154
14155 @item -mbranch-hints
14156 @opindex mbranch-hints
14157
14158 By default, GCC will generate a branch hint instruction to avoid
14159 pipeline stalls for always taken or probably taken branches.  A hint
14160 will not be generated closer than 8 instructions away from its branch.
14161 There is little reason to disable them, except for debugging purposes,
14162 or to make an object a little bit smaller.
14163
14164 @item -msmall-mem
14165 @itemx -mlarge-mem
14166 @opindex msmall-mem
14167 @opindex mlarge-mem
14168
14169 By default, GCC generates code assuming that addresses are never larger
14170 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
14171 a full 32 bit address.
14172
14173 @item -mstdmain
14174 @opindex mstdmain
14175
14176 By default, GCC links against startup code that assumes the SPU-style
14177 main function interface (which has an unconventional parameter list).
14178 With @option{-mstdmain}, GCC will link your program against startup
14179 code that assumes a C99-style interface to @code{main}, including a
14180 local copy of @code{argv} strings.
14181
14182 @item -mfixed-range=@var{register-range}
14183 @opindex mfixed-range
14184 Generate code treating the given register range as fixed registers.
14185 A fixed register is one that the register allocator can not use.  This is
14186 useful when compiling kernel code.  A register range is specified as
14187 two registers separated by a dash.  Multiple register ranges can be
14188 specified separated by a comma.
14189
14190 @end table
14191
14192 @node System V Options
14193 @subsection Options for System V
14194
14195 These additional options are available on System V Release 4 for
14196 compatibility with other compilers on those systems:
14197
14198 @table @gcctabopt
14199 @item -G
14200 @opindex G
14201 Create a shared object.
14202 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
14203
14204 @item -Qy
14205 @opindex Qy
14206 Identify the versions of each tool used by the compiler, in a
14207 @code{.ident} assembler directive in the output.
14208
14209 @item -Qn
14210 @opindex Qn
14211 Refrain from adding @code{.ident} directives to the output file (this is
14212 the default).
14213
14214 @item -YP,@var{dirs}
14215 @opindex YP
14216 Search the directories @var{dirs}, and no others, for libraries
14217 specified with @option{-l}.
14218
14219 @item -Ym,@var{dir}
14220 @opindex Ym
14221 Look in the directory @var{dir} to find the M4 preprocessor.
14222 The assembler uses this option.
14223 @c This is supposed to go with a -Yd for predefined M4 macro files, but
14224 @c the generic assembler that comes with Solaris takes just -Ym.
14225 @end table
14226
14227 @node TMS320C3x/C4x Options
14228 @subsection TMS320C3x/C4x Options
14229 @cindex TMS320C3x/C4x Options
14230
14231 These @samp{-m} options are defined for TMS320C3x/C4x implementations:
14232
14233 @table @gcctabopt
14234
14235 @item -mcpu=@var{cpu_type}
14236 @opindex mcpu
14237 Set the instruction set, register set, and instruction scheduling
14238 parameters for machine type @var{cpu_type}.  Supported values for
14239 @var{cpu_type} are @samp{c30}, @samp{c31}, @samp{c32}, @samp{c40}, and
14240 @samp{c44}.  The default is @samp{c40} to generate code for the
14241 TMS320C40.
14242
14243 @item -mbig-memory
14244 @itemx -mbig
14245 @itemx -msmall-memory
14246 @itemx -msmall
14247 @opindex mbig-memory
14248 @opindex mbig
14249 @opindex msmall-memory
14250 @opindex msmall
14251 Generates code for the big or small memory model.  The small memory
14252 model assumed that all data fits into one 64K word page.  At run-time
14253 the data page (DP) register must be set to point to the 64K page
14254 containing the .bss and .data program sections.  The big memory model is
14255 the default and requires reloading of the DP register for every direct
14256 memory access.
14257
14258 @item -mbk
14259 @itemx -mno-bk
14260 @opindex mbk
14261 @opindex mno-bk
14262 Allow (disallow) allocation of general integer operands into the block
14263 count register BK@.
14264
14265 @item -mdb
14266 @itemx -mno-db
14267 @opindex mdb
14268 @opindex mno-db
14269 Enable (disable) generation of code using decrement and branch,
14270 DBcond(D), instructions.  This is enabled by default for the C4x.  To be
14271 on the safe side, this is disabled for the C3x, since the maximum
14272 iteration count on the C3x is @math{2^{23} + 1} (but who iterates loops more than
14273 @math{2^{23}} times on the C3x?).  Note that GCC will try to reverse a loop so
14274 that it can utilize the decrement and branch instruction, but will give
14275 up if there is more than one memory reference in the loop.  Thus a loop
14276 where the loop counter is decremented can generate slightly more
14277 efficient code, in cases where the RPTB instruction cannot be utilized.
14278
14279 @item -mdp-isr-reload
14280 @itemx -mparanoid
14281 @opindex mdp-isr-reload
14282 @opindex mparanoid
14283 Force the DP register to be saved on entry to an interrupt service
14284 routine (ISR), reloaded to point to the data section, and restored on
14285 exit from the ISR@.  This should not be required unless someone has
14286 violated the small memory model by modifying the DP register, say within
14287 an object library.
14288
14289 @item -mmpyi
14290 @itemx -mno-mpyi
14291 @opindex mmpyi
14292 @opindex mno-mpyi
14293 For the C3x use the 24-bit MPYI instruction for integer multiplies
14294 instead of a library call to guarantee 32-bit results.  Note that if one
14295 of the operands is a constant, then the multiplication will be performed
14296 using shifts and adds.  If the @option{-mmpyi} option is not specified for the C3x,
14297 then squaring operations are performed inline instead of a library call.
14298
14299 @item -mfast-fix
14300 @itemx -mno-fast-fix
14301 @opindex mfast-fix
14302 @opindex mno-fast-fix
14303 The C3x/C4x FIX instruction to convert a floating point value to an
14304 integer value chooses the nearest integer less than or equal to the
14305 floating point value rather than to the nearest integer.  Thus if the
14306 floating point number is negative, the result will be incorrectly
14307 truncated an additional code is necessary to detect and correct this
14308 case.  This option can be used to disable generation of the additional
14309 code required to correct the result.
14310
14311 @item -mrptb
14312 @itemx -mno-rptb
14313 @opindex mrptb
14314 @opindex mno-rptb
14315 Enable (disable) generation of repeat block sequences using the RPTB
14316 instruction for zero overhead looping.  The RPTB construct is only used
14317 for innermost loops that do not call functions or jump across the loop
14318 boundaries.  There is no advantage having nested RPTB loops due to the
14319 overhead required to save and restore the RC, RS, and RE registers.
14320 This is enabled by default with @option{-O2}.
14321
14322 @item -mrpts=@var{count}
14323 @itemx -mno-rpts
14324 @opindex mrpts
14325 @opindex mno-rpts
14326 Enable (disable) the use of the single instruction repeat instruction
14327 RPTS@.  If a repeat block contains a single instruction, and the loop
14328 count can be guaranteed to be less than the value @var{count}, GCC will
14329 emit a RPTS instruction instead of a RPTB@.  If no value is specified,
14330 then a RPTS will be emitted even if the loop count cannot be determined
14331 at compile time.  Note that the repeated instruction following RPTS does
14332 not have to be reloaded from memory each iteration, thus freeing up the
14333 CPU buses for operands.  However, since interrupts are blocked by this
14334 instruction, it is disabled by default.
14335
14336 @item -mloop-unsigned
14337 @itemx -mno-loop-unsigned
14338 @opindex mloop-unsigned
14339 @opindex mno-loop-unsigned
14340 The maximum iteration count when using RPTS and RPTB (and DB on the C40)
14341 is @math{2^{31} + 1} since these instructions test if the iteration count is
14342 negative to terminate the loop.  If the iteration count is unsigned
14343 there is a possibility than the @math{2^{31} + 1} maximum iteration count may be
14344 exceeded.  This switch allows an unsigned iteration count.
14345
14346 @item -mti
14347 @opindex mti
14348 Try to emit an assembler syntax that the TI assembler (asm30) is happy
14349 with.  This also enforces compatibility with the API employed by the TI
14350 C3x C compiler.  For example, long doubles are passed as structures
14351 rather than in floating point registers.
14352
14353 @item -mregparm
14354 @itemx -mmemparm
14355 @opindex mregparm
14356 @opindex mmemparm
14357 Generate code that uses registers (stack) for passing arguments to functions.
14358 By default, arguments are passed in registers where possible rather
14359 than by pushing arguments on to the stack.
14360
14361 @item -mparallel-insns
14362 @itemx -mno-parallel-insns
14363 @opindex mparallel-insns
14364 @opindex mno-parallel-insns
14365 Allow the generation of parallel instructions.  This is enabled by
14366 default with @option{-O2}.
14367
14368 @item -mparallel-mpy
14369 @itemx -mno-parallel-mpy
14370 @opindex mparallel-mpy
14371 @opindex mno-parallel-mpy
14372 Allow the generation of MPY||ADD and MPY||SUB parallel instructions,
14373 provided @option{-mparallel-insns} is also specified.  These instructions have
14374 tight register constraints which can pessimize the code generation
14375 of large functions.
14376
14377 @end table
14378
14379 @node V850 Options
14380 @subsection V850 Options
14381 @cindex V850 Options
14382
14383 These @samp{-m} options are defined for V850 implementations:
14384
14385 @table @gcctabopt
14386 @item -mlong-calls
14387 @itemx -mno-long-calls
14388 @opindex mlong-calls
14389 @opindex mno-long-calls
14390 Treat all calls as being far away (near).  If calls are assumed to be
14391 far away, the compiler will always load the functions address up into a
14392 register, and call indirect through the pointer.
14393
14394 @item -mno-ep
14395 @itemx -mep
14396 @opindex mno-ep
14397 @opindex mep
14398 Do not optimize (do optimize) basic blocks that use the same index
14399 pointer 4 or more times to copy pointer into the @code{ep} register, and
14400 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
14401 option is on by default if you optimize.
14402
14403 @item -mno-prolog-function
14404 @itemx -mprolog-function
14405 @opindex mno-prolog-function
14406 @opindex mprolog-function
14407 Do not use (do use) external functions to save and restore registers
14408 at the prologue and epilogue of a function.  The external functions
14409 are slower, but use less code space if more than one function saves
14410 the same number of registers.  The @option{-mprolog-function} option
14411 is on by default if you optimize.
14412
14413 @item -mspace
14414 @opindex mspace
14415 Try to make the code as small as possible.  At present, this just turns
14416 on the @option{-mep} and @option{-mprolog-function} options.
14417
14418 @item -mtda=@var{n}
14419 @opindex mtda
14420 Put static or global variables whose size is @var{n} bytes or less into
14421 the tiny data area that register @code{ep} points to.  The tiny data
14422 area can hold up to 256 bytes in total (128 bytes for byte references).
14423
14424 @item -msda=@var{n}
14425 @opindex msda
14426 Put static or global variables whose size is @var{n} bytes or less into
14427 the small data area that register @code{gp} points to.  The small data
14428 area can hold up to 64 kilobytes.
14429
14430 @item -mzda=@var{n}
14431 @opindex mzda
14432 Put static or global variables whose size is @var{n} bytes or less into
14433 the first 32 kilobytes of memory.
14434
14435 @item -mv850
14436 @opindex mv850
14437 Specify that the target processor is the V850.
14438
14439 @item -mbig-switch
14440 @opindex mbig-switch
14441 Generate code suitable for big switch tables.  Use this option only if
14442 the assembler/linker complain about out of range branches within a switch
14443 table.
14444
14445 @item -mapp-regs
14446 @opindex mapp-regs
14447 This option will cause r2 and r5 to be used in the code generated by
14448 the compiler.  This setting is the default.
14449
14450 @item -mno-app-regs
14451 @opindex mno-app-regs
14452 This option will cause r2 and r5 to be treated as fixed registers.
14453
14454 @item -mv850e1
14455 @opindex mv850e1
14456 Specify that the target processor is the V850E1.  The preprocessor
14457 constants @samp{__v850e1__} and @samp{__v850e__} will be defined if
14458 this option is used.
14459
14460 @item -mv850e
14461 @opindex mv850e
14462 Specify that the target processor is the V850E@.  The preprocessor
14463 constant @samp{__v850e__} will be defined if this option is used.
14464
14465 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
14466 are defined then a default target processor will be chosen and the
14467 relevant @samp{__v850*__} preprocessor constant will be defined.
14468
14469 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
14470 defined, regardless of which processor variant is the target.
14471
14472 @item -mdisable-callt
14473 @opindex mdisable-callt
14474 This option will suppress generation of the CALLT instruction for the
14475 v850e and v850e1 flavors of the v850 architecture.  The default is
14476 @option{-mno-disable-callt} which allows the CALLT instruction to be used.
14477
14478 @end table
14479
14480 @node VAX Options
14481 @subsection VAX Options
14482 @cindex VAX options
14483
14484 These @samp{-m} options are defined for the VAX:
14485
14486 @table @gcctabopt
14487 @item -munix
14488 @opindex munix
14489 Do not output certain jump instructions (@code{aobleq} and so on)
14490 that the Unix assembler for the VAX cannot handle across long
14491 ranges.
14492
14493 @item -mgnu
14494 @opindex mgnu
14495 Do output those jump instructions, on the assumption that you
14496 will assemble with the GNU assembler.
14497
14498 @item -mg
14499 @opindex mg
14500 Output code for g-format floating point numbers instead of d-format.
14501 @end table
14502
14503 @node VxWorks Options
14504 @subsection VxWorks Options
14505 @cindex VxWorks Options
14506
14507 The options in this section are defined for all VxWorks targets.
14508 Options specific to the target hardware are listed with the other
14509 options for that target.
14510
14511 @table @gcctabopt
14512 @item -mrtp
14513 @opindex mrtp
14514 GCC can generate code for both VxWorks kernels and real time processes
14515 (RTPs).  This option switches from the former to the latter.  It also
14516 defines the preprocessor macro @code{__RTP__}.
14517
14518 @item -non-static
14519 @opindex non-static
14520 Link an RTP executable against shared libraries rather than static
14521 libraries.  The options @option{-static} and @option{-shared} can
14522 also be used for RTPs (@pxref{Link Options}); @option{-static}
14523 is the default.
14524
14525 @item -Bstatic
14526 @itemx -Bdynamic
14527 @opindex Bstatic
14528 @opindex Bdynamic
14529 These options are passed down to the linker.  They are defined for
14530 compatibility with Diab.
14531
14532 @item -Xbind-lazy
14533 @opindex Xbind-lazy
14534 Enable lazy binding of function calls.  This option is equivalent to
14535 @option{-Wl,-z,now} and is defined for compatibility with Diab.
14536
14537 @item -Xbind-now
14538 @opindex Xbind-now
14539 Disable lazy binding of function calls.  This option is the default and
14540 is defined for compatibility with Diab.
14541 @end table
14542
14543 @node x86-64 Options
14544 @subsection x86-64 Options
14545 @cindex x86-64 options
14546
14547 These are listed under @xref{i386 and x86-64 Options}.
14548
14549 @node Xstormy16 Options
14550 @subsection Xstormy16 Options
14551 @cindex Xstormy16 Options
14552
14553 These options are defined for Xstormy16:
14554
14555 @table @gcctabopt
14556 @item -msim
14557 @opindex msim
14558 Choose startup files and linker script suitable for the simulator.
14559 @end table
14560
14561 @node Xtensa Options
14562 @subsection Xtensa Options
14563 @cindex Xtensa Options
14564
14565 These options are supported for Xtensa targets:
14566
14567 @table @gcctabopt
14568 @item -mconst16
14569 @itemx -mno-const16
14570 @opindex mconst16
14571 @opindex mno-const16
14572 Enable or disable use of @code{CONST16} instructions for loading
14573 constant values.  The @code{CONST16} instruction is currently not a
14574 standard option from Tensilica.  When enabled, @code{CONST16}
14575 instructions are always used in place of the standard @code{L32R}
14576 instructions.  The use of @code{CONST16} is enabled by default only if
14577 the @code{L32R} instruction is not available.
14578
14579 @item -mfused-madd
14580 @itemx -mno-fused-madd
14581 @opindex mfused-madd
14582 @opindex mno-fused-madd
14583 Enable or disable use of fused multiply/add and multiply/subtract
14584 instructions in the floating-point option.  This has no effect if the
14585 floating-point option is not also enabled.  Disabling fused multiply/add
14586 and multiply/subtract instructions forces the compiler to use separate
14587 instructions for the multiply and add/subtract operations.  This may be
14588 desirable in some cases where strict IEEE 754-compliant results are
14589 required: the fused multiply add/subtract instructions do not round the
14590 intermediate result, thereby producing results with @emph{more} bits of
14591 precision than specified by the IEEE standard.  Disabling fused multiply
14592 add/subtract instructions also ensures that the program output is not
14593 sensitive to the compiler's ability to combine multiply and add/subtract
14594 operations.
14595
14596 @item -mtext-section-literals
14597 @itemx -mno-text-section-literals
14598 @opindex mtext-section-literals
14599 @opindex mno-text-section-literals
14600 Control the treatment of literal pools.  The default is
14601 @option{-mno-text-section-literals}, which places literals in a separate
14602 section in the output file.  This allows the literal pool to be placed
14603 in a data RAM/ROM, and it also allows the linker to combine literal
14604 pools from separate object files to remove redundant literals and
14605 improve code size.  With @option{-mtext-section-literals}, the literals
14606 are interspersed in the text section in order to keep them as close as
14607 possible to their references.  This may be necessary for large assembly
14608 files.
14609
14610 @item -mtarget-align
14611 @itemx -mno-target-align
14612 @opindex mtarget-align
14613 @opindex mno-target-align
14614 When this option is enabled, GCC instructs the assembler to
14615 automatically align instructions to reduce branch penalties at the
14616 expense of some code density.  The assembler attempts to widen density
14617 instructions to align branch targets and the instructions following call
14618 instructions.  If there are not enough preceding safe density
14619 instructions to align a target, no widening will be performed.  The
14620 default is @option{-mtarget-align}.  These options do not affect the
14621 treatment of auto-aligned instructions like @code{LOOP}, which the
14622 assembler will always align, either by widening density instructions or
14623 by inserting no-op instructions.
14624
14625 @item -mlongcalls
14626 @itemx -mno-longcalls
14627 @opindex mlongcalls
14628 @opindex mno-longcalls
14629 When this option is enabled, GCC instructs the assembler to translate
14630 direct calls to indirect calls unless it can determine that the target
14631 of a direct call is in the range allowed by the call instruction.  This
14632 translation typically occurs for calls to functions in other source
14633 files.  Specifically, the assembler translates a direct @code{CALL}
14634 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
14635 The default is @option{-mno-longcalls}.  This option should be used in
14636 programs where the call target can potentially be out of range.  This
14637 option is implemented in the assembler, not the compiler, so the
14638 assembly code generated by GCC will still show direct call
14639 instructions---look at the disassembled object code to see the actual
14640 instructions.  Note that the assembler will use an indirect call for
14641 every cross-file call, not just those that really will be out of range.
14642 @end table
14643
14644 @node zSeries Options
14645 @subsection zSeries Options
14646 @cindex zSeries options
14647
14648 These are listed under @xref{S/390 and zSeries Options}.
14649
14650 @node Code Gen Options
14651 @section Options for Code Generation Conventions
14652 @cindex code generation conventions
14653 @cindex options, code generation
14654 @cindex run-time options
14655
14656 These machine-independent options control the interface conventions
14657 used in code generation.
14658
14659 Most of them have both positive and negative forms; the negative form
14660 of @option{-ffoo} would be @option{-fno-foo}.  In the table below, only
14661 one of the forms is listed---the one which is not the default.  You
14662 can figure out the other form by either removing @samp{no-} or adding
14663 it.
14664
14665 @table @gcctabopt
14666 @item -fbounds-check
14667 @opindex fbounds-check
14668 For front-ends that support it, generate additional code to check that
14669 indices used to access arrays are within the declared range.  This is
14670 currently only supported by the Java and Fortran front-ends, where
14671 this option defaults to true and false respectively.
14672
14673 @item -ftrapv
14674 @opindex ftrapv
14675 This option generates traps for signed overflow on addition, subtraction,
14676 multiplication operations.
14677
14678 @item -fwrapv
14679 @opindex fwrapv
14680 This option instructs the compiler to assume that signed arithmetic
14681 overflow of addition, subtraction and multiplication wraps around
14682 using twos-complement representation.  This flag enables some optimizations
14683 and disables others.  This option is enabled by default for the Java
14684 front-end, as required by the Java language specification.
14685
14686 @item -fexceptions
14687 @opindex fexceptions
14688 Enable exception handling.  Generates extra code needed to propagate
14689 exceptions.  For some targets, this implies GCC will generate frame
14690 unwind information for all functions, which can produce significant data
14691 size overhead, although it does not affect execution.  If you do not
14692 specify this option, GCC will enable it by default for languages like
14693 C++ which normally require exception handling, and disable it for
14694 languages like C that do not normally require it.  However, you may need
14695 to enable this option when compiling C code that needs to interoperate
14696 properly with exception handlers written in C++.  You may also wish to
14697 disable this option if you are compiling older C++ programs that don't
14698 use exception handling.
14699
14700 @item -fnon-call-exceptions
14701 @opindex fnon-call-exceptions
14702 Generate code that allows trapping instructions to throw exceptions.
14703 Note that this requires platform-specific runtime support that does
14704 not exist everywhere.  Moreover, it only allows @emph{trapping}
14705 instructions to throw exceptions, i.e.@: memory references or floating
14706 point instructions.  It does not allow exceptions to be thrown from
14707 arbitrary signal handlers such as @code{SIGALRM}.
14708
14709 @item -funwind-tables
14710 @opindex funwind-tables
14711 Similar to @option{-fexceptions}, except that it will just generate any needed
14712 static data, but will not affect the generated code in any other way.
14713 You will normally not enable this option; instead, a language processor
14714 that needs this handling would enable it on your behalf.
14715
14716 @item -fasynchronous-unwind-tables
14717 @opindex fasynchronous-unwind-tables
14718 Generate unwind table in dwarf2 format, if supported by target machine.  The
14719 table is exact at each instruction boundary, so it can be used for stack
14720 unwinding from asynchronous events (such as debugger or garbage collector).
14721
14722 @item -fpcc-struct-return
14723 @opindex fpcc-struct-return
14724 Return ``short'' @code{struct} and @code{union} values in memory like
14725 longer ones, rather than in registers.  This convention is less
14726 efficient, but it has the advantage of allowing intercallability between
14727 GCC-compiled files and files compiled with other compilers, particularly
14728 the Portable C Compiler (pcc).
14729
14730 The precise convention for returning structures in memory depends
14731 on the target configuration macros.
14732
14733 Short structures and unions are those whose size and alignment match
14734 that of some integer type.
14735
14736 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
14737 switch is not binary compatible with code compiled with the
14738 @option{-freg-struct-return} switch.
14739 Use it to conform to a non-default application binary interface.
14740
14741 @item -freg-struct-return
14742 @opindex freg-struct-return
14743 Return @code{struct} and @code{union} values in registers when possible.
14744 This is more efficient for small structures than
14745 @option{-fpcc-struct-return}.
14746
14747 If you specify neither @option{-fpcc-struct-return} nor
14748 @option{-freg-struct-return}, GCC defaults to whichever convention is
14749 standard for the target.  If there is no standard convention, GCC
14750 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
14751 the principal compiler.  In those cases, we can choose the standard, and
14752 we chose the more efficient register return alternative.
14753
14754 @strong{Warning:} code compiled with the @option{-freg-struct-return}
14755 switch is not binary compatible with code compiled with the
14756 @option{-fpcc-struct-return} switch.
14757 Use it to conform to a non-default application binary interface.
14758
14759 @item -fshort-enums
14760 @opindex fshort-enums
14761 Allocate to an @code{enum} type only as many bytes as it needs for the
14762 declared range of possible values.  Specifically, the @code{enum} type
14763 will be equivalent to the smallest integer type which has enough room.
14764
14765 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
14766 code that is not binary compatible with code generated without that switch.
14767 Use it to conform to a non-default application binary interface.
14768
14769 @item -fshort-double
14770 @opindex fshort-double
14771 Use the same size for @code{double} as for @code{float}.
14772
14773 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
14774 code that is not binary compatible with code generated without that switch.
14775 Use it to conform to a non-default application binary interface.
14776
14777 @item -fshort-wchar
14778 @opindex fshort-wchar
14779 Override the underlying type for @samp{wchar_t} to be @samp{short
14780 unsigned int} instead of the default for the target.  This option is
14781 useful for building programs to run under WINE@.
14782
14783 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
14784 code that is not binary compatible with code generated without that switch.
14785 Use it to conform to a non-default application binary interface.
14786
14787 @item -fno-common
14788 @opindex fno-common
14789 In C, allocate even uninitialized global variables in the data section of the
14790 object file, rather than generating them as common blocks.  This has the
14791 effect that if the same variable is declared (without @code{extern}) in
14792 two different compilations, you will get an error when you link them.
14793 The only reason this might be useful is if you wish to verify that the
14794 program will work on other systems which always work this way.
14795
14796 @item -fno-ident
14797 @opindex fno-ident
14798 Ignore the @samp{#ident} directive.
14799
14800 @item -finhibit-size-directive
14801 @opindex finhibit-size-directive
14802 Don't output a @code{.size} assembler directive, or anything else that
14803 would cause trouble if the function is split in the middle, and the
14804 two halves are placed at locations far apart in memory.  This option is
14805 used when compiling @file{crtstuff.c}; you should not need to use it
14806 for anything else.
14807
14808 @item -fverbose-asm
14809 @opindex fverbose-asm
14810 Put extra commentary information in the generated assembly code to
14811 make it more readable.  This option is generally only of use to those
14812 who actually need to read the generated assembly code (perhaps while
14813 debugging the compiler itself).
14814
14815 @option{-fno-verbose-asm}, the default, causes the
14816 extra information to be omitted and is useful when comparing two assembler
14817 files.
14818
14819 @item -frecord-gcc-switches
14820 @opindex frecord-gcc-switches
14821 This switch causes the command line that was used to invoke the
14822 compiler to be recorded into the object file that is being created.
14823 This switch is only implemented on some targets and the exact format
14824 of the recording is target and binary file format dependent, but it
14825 usually takes the form of a section containing ASCII text.  This
14826 switch is related to the @option{-fverbose-asm} switch, but that
14827 switch only records information in the assembler output file as
14828 comments, so it never reaches the object file.
14829
14830 @item -fpic
14831 @opindex fpic
14832 @cindex global offset table
14833 @cindex PIC
14834 Generate position-independent code (PIC) suitable for use in a shared
14835 library, if supported for the target machine.  Such code accesses all
14836 constant addresses through a global offset table (GOT)@.  The dynamic
14837 loader resolves the GOT entries when the program starts (the dynamic
14838 loader is not part of GCC; it is part of the operating system).  If
14839 the GOT size for the linked executable exceeds a machine-specific
14840 maximum size, you get an error message from the linker indicating that
14841 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
14842 instead.  (These maximums are 8k on the SPARC and 32k
14843 on the m68k and RS/6000.  The 386 has no such limit.)
14844
14845 Position-independent code requires special support, and therefore works
14846 only on certain machines.  For the 386, GCC supports PIC for System V
14847 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
14848 position-independent.
14849
14850 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
14851 are defined to 1.
14852
14853 @item -fPIC
14854 @opindex fPIC
14855 If supported for the target machine, emit position-independent code,
14856 suitable for dynamic linking and avoiding any limit on the size of the
14857 global offset table.  This option makes a difference on the m68k,
14858 PowerPC and SPARC@.
14859
14860 Position-independent code requires special support, and therefore works
14861 only on certain machines.
14862
14863 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
14864 are defined to 2.
14865
14866 @item -fpie
14867 @itemx -fPIE
14868 @opindex fpie
14869 @opindex fPIE
14870 These options are similar to @option{-fpic} and @option{-fPIC}, but
14871 generated position independent code can be only linked into executables.
14872 Usually these options are used when @option{-pie} GCC option will be
14873 used during linking.
14874
14875 @option{-fpie} and @option{-fPIE} both define the macros
14876 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
14877 for @option{-fpie} and 2 for @option{-fPIE}.
14878
14879 @item -fno-jump-tables
14880 @opindex fno-jump-tables
14881 Do not use jump tables for switch statements even where it would be
14882 more efficient than other code generation strategies.  This option is
14883 of use in conjunction with @option{-fpic} or @option{-fPIC} for
14884 building code which forms part of a dynamic linker and cannot
14885 reference the address of a jump table.  On some targets, jump tables
14886 do not require a GOT and this option is not needed.
14887
14888 @item -ffixed-@var{reg}
14889 @opindex ffixed
14890 Treat the register named @var{reg} as a fixed register; generated code
14891 should never refer to it (except perhaps as a stack pointer, frame
14892 pointer or in some other fixed role).
14893
14894 @var{reg} must be the name of a register.  The register names accepted
14895 are machine-specific and are defined in the @code{REGISTER_NAMES}
14896 macro in the machine description macro file.
14897
14898 This flag does not have a negative form, because it specifies a
14899 three-way choice.
14900
14901 @item -fcall-used-@var{reg}
14902 @opindex fcall-used
14903 Treat the register named @var{reg} as an allocable register that is
14904 clobbered by function calls.  It may be allocated for temporaries or
14905 variables that do not live across a call.  Functions compiled this way
14906 will not save and restore the register @var{reg}.
14907
14908 It is an error to used this flag with the frame pointer or stack pointer.
14909 Use of this flag for other registers that have fixed pervasive roles in
14910 the machine's execution model will produce disastrous results.
14911
14912 This flag does not have a negative form, because it specifies a
14913 three-way choice.
14914
14915 @item -fcall-saved-@var{reg}
14916 @opindex fcall-saved
14917 Treat the register named @var{reg} as an allocable register saved by
14918 functions.  It may be allocated even for temporaries or variables that
14919 live across a call.  Functions compiled this way will save and restore
14920 the register @var{reg} if they use it.
14921
14922 It is an error to used this flag with the frame pointer or stack pointer.
14923 Use of this flag for other registers that have fixed pervasive roles in
14924 the machine's execution model will produce disastrous results.
14925
14926 A different sort of disaster will result from the use of this flag for
14927 a register in which function values may be returned.
14928
14929 This flag does not have a negative form, because it specifies a
14930 three-way choice.
14931
14932 @item -fpack-struct[=@var{n}]
14933 @opindex fpack-struct
14934 Without a value specified, pack all structure members together without
14935 holes.  When a value is specified (which must be a small power of two), pack
14936 structure members according to this value, representing the maximum
14937 alignment (that is, objects with default alignment requirements larger than
14938 this will be output potentially unaligned at the next fitting location.
14939
14940 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
14941 code that is not binary compatible with code generated without that switch.
14942 Additionally, it makes the code suboptimal.
14943 Use it to conform to a non-default application binary interface.
14944
14945 @item -finstrument-functions
14946 @opindex finstrument-functions
14947 Generate instrumentation calls for entry and exit to functions.  Just
14948 after function entry and just before function exit, the following
14949 profiling functions will be called with the address of the current
14950 function and its call site.  (On some platforms,
14951 @code{__builtin_return_address} does not work beyond the current
14952 function, so the call site information may not be available to the
14953 profiling functions otherwise.)
14954
14955 @smallexample
14956 void __cyg_profile_func_enter (void *this_fn,
14957                                void *call_site);
14958 void __cyg_profile_func_exit  (void *this_fn,
14959                                void *call_site);
14960 @end smallexample
14961
14962 The first argument is the address of the start of the current function,
14963 which may be looked up exactly in the symbol table.
14964
14965 This instrumentation is also done for functions expanded inline in other
14966 functions.  The profiling calls will indicate where, conceptually, the
14967 inline function is entered and exited.  This means that addressable
14968 versions of such functions must be available.  If all your uses of a
14969 function are expanded inline, this may mean an additional expansion of
14970 code size.  If you use @samp{extern inline} in your C code, an
14971 addressable version of such functions must be provided.  (This is
14972 normally the case anyways, but if you get lucky and the optimizer always
14973 expands the functions inline, you might have gotten away without
14974 providing static copies.)
14975
14976 A function may be given the attribute @code{no_instrument_function}, in
14977 which case this instrumentation will not be done.  This can be used, for
14978 example, for the profiling functions listed above, high-priority
14979 interrupt routines, and any functions from which the profiling functions
14980 cannot safely be called (perhaps signal handlers, if the profiling
14981 routines generate output or allocate memory).
14982
14983 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
14984 @opindex finstrument-functions-exclude-file-list
14985
14986 Set the list of functions that are excluded from instrumentation (see
14987 the description of @code{-finstrument-functions}).  If the file that
14988 contains a function definition matches with one of @var{file}, then
14989 that function is not instrumented.  The match is done on substrings:
14990 if the @var{file} parameter is a substring of the file name, it is
14991 considered to be a match.
14992
14993 For example,
14994 @code{-finstrument-functions-exclude-file-list=/bits/stl,include/sys}
14995 will exclude any inline function defined in files whose pathnames
14996 contain @code{/bits/stl} or @code{include/sys}.
14997
14998 If, for some reason, you want to include letter @code{','} in one of
14999 @var{sym}, write @code{'\,'}. For example,
15000 @code{-finstrument-functions-exclude-file-list='\,\,tmp'}
15001 (note the single quote surrounding the option).
15002
15003 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
15004 @opindex finstrument-functions-exclude-function-list
15005
15006 This is similar to @code{-finstrument-functions-exclude-file-list},
15007 but this option sets the list of function names to be excluded from
15008 instrumentation.  The function name to be matched is its user-visible
15009 name, such as @code{vector<int> blah(const vector<int> &)}, not the
15010 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
15011 match is done on substrings: if the @var{sym} parameter is a substring
15012 of the function name, it is considered to be a match.
15013
15014 @item -fstack-check
15015 @opindex fstack-check
15016 Generate code to verify that you do not go beyond the boundary of the
15017 stack.  You should specify this flag if you are running in an
15018 environment with multiple threads, but only rarely need to specify it in
15019 a single-threaded environment since stack overflow is automatically
15020 detected on nearly all systems if there is only one stack.
15021
15022 Note that this switch does not actually cause checking to be done; the
15023 operating system must do that.  The switch causes generation of code
15024 to ensure that the operating system sees the stack being extended.
15025
15026 @item -fstack-limit-register=@var{reg}
15027 @itemx -fstack-limit-symbol=@var{sym}
15028 @itemx -fno-stack-limit
15029 @opindex fstack-limit-register
15030 @opindex fstack-limit-symbol
15031 @opindex fno-stack-limit
15032 Generate code to ensure that the stack does not grow beyond a certain value,
15033 either the value of a register or the address of a symbol.  If the stack
15034 would grow beyond the value, a signal is raised.  For most targets,
15035 the signal is raised before the stack overruns the boundary, so
15036 it is possible to catch the signal without taking special precautions.
15037
15038 For instance, if the stack starts at absolute address @samp{0x80000000}
15039 and grows downwards, you can use the flags
15040 @option{-fstack-limit-symbol=__stack_limit} and
15041 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
15042 of 128KB@.  Note that this may only work with the GNU linker.
15043
15044 @cindex aliasing of parameters
15045 @cindex parameters, aliased
15046 @item -fargument-alias
15047 @itemx -fargument-noalias
15048 @itemx -fargument-noalias-global
15049 @itemx -fargument-noalias-anything
15050 @opindex fargument-alias
15051 @opindex fargument-noalias
15052 @opindex fargument-noalias-global
15053 @opindex fargument-noalias-anything
15054 Specify the possible relationships among parameters and between
15055 parameters and global data.
15056
15057 @option{-fargument-alias} specifies that arguments (parameters) may
15058 alias each other and may alias global storage.@*
15059 @option{-fargument-noalias} specifies that arguments do not alias
15060 each other, but may alias global storage.@*
15061 @option{-fargument-noalias-global} specifies that arguments do not
15062 alias each other and do not alias global storage.
15063 @option{-fargument-noalias-anything} specifies that arguments do not
15064 alias any other storage.
15065
15066 Each language will automatically use whatever option is required by
15067 the language standard.  You should not need to use these options yourself.
15068
15069 @item -fleading-underscore
15070 @opindex fleading-underscore
15071 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
15072 change the way C symbols are represented in the object file.  One use
15073 is to help link with legacy assembly code.
15074
15075 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
15076 generate code that is not binary compatible with code generated without that
15077 switch.  Use it to conform to a non-default application binary interface.
15078 Not all targets provide complete support for this switch.
15079
15080 @item -ftls-model=@var{model}
15081 @opindex ftls-model
15082 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
15083 The @var{model} argument should be one of @code{global-dynamic},
15084 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
15085
15086 The default without @option{-fpic} is @code{initial-exec}; with
15087 @option{-fpic} the default is @code{global-dynamic}.
15088
15089 @item -fvisibility=@var{default|internal|hidden|protected}
15090 @opindex fvisibility
15091 Set the default ELF image symbol visibility to the specified option---all
15092 symbols will be marked with this unless overridden within the code.
15093 Using this feature can very substantially improve linking and
15094 load times of shared object libraries, produce more optimized
15095 code, provide near-perfect API export and prevent symbol clashes.
15096 It is @strong{strongly} recommended that you use this in any shared objects
15097 you distribute.
15098
15099 Despite the nomenclature, @code{default} always means public ie;
15100 available to be linked against from outside the shared object.
15101 @code{protected} and @code{internal} are pretty useless in real-world
15102 usage so the only other commonly used option will be @code{hidden}.
15103 The default if @option{-fvisibility} isn't specified is
15104 @code{default}, i.e., make every
15105 symbol public---this causes the same behavior as previous versions of
15106 GCC@.
15107
15108 A good explanation of the benefits offered by ensuring ELF
15109 symbols have the correct visibility is given by ``How To Write
15110 Shared Libraries'' by Ulrich Drepper (which can be found at
15111 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
15112 solution made possible by this option to marking things hidden when
15113 the default is public is to make the default hidden and mark things
15114 public.  This is the norm with DLL's on Windows and with @option{-fvisibility=hidden}
15115 and @code{__attribute__ ((visibility("default")))} instead of
15116 @code{__declspec(dllexport)} you get almost identical semantics with
15117 identical syntax.  This is a great boon to those working with
15118 cross-platform projects.
15119
15120 For those adding visibility support to existing code, you may find
15121 @samp{#pragma GCC visibility} of use.  This works by you enclosing
15122 the declarations you wish to set visibility for with (for example)
15123 @samp{#pragma GCC visibility push(hidden)} and
15124 @samp{#pragma GCC visibility pop}.
15125 Bear in mind that symbol visibility should be viewed @strong{as
15126 part of the API interface contract} and thus all new code should
15127 always specify visibility when it is not the default ie; declarations
15128 only for use within the local DSO should @strong{always} be marked explicitly
15129 as hidden as so to avoid PLT indirection overheads---making this
15130 abundantly clear also aids readability and self-documentation of the code.
15131 Note that due to ISO C++ specification requirements, operator new and
15132 operator delete must always be of default visibility.
15133
15134 Be aware that headers from outside your project, in particular system
15135 headers and headers from any other library you use, may not be
15136 expecting to be compiled with visibility other than the default.  You
15137 may need to explicitly say @samp{#pragma GCC visibility push(default)}
15138 before including any such headers.
15139
15140 @samp{extern} declarations are not affected by @samp{-fvisibility}, so
15141 a lot of code can be recompiled with @samp{-fvisibility=hidden} with
15142 no modifications.  However, this means that calls to @samp{extern}
15143 functions with no explicit visibility will use the PLT, so it is more
15144 effective to use @samp{__attribute ((visibility))} and/or
15145 @samp{#pragma GCC visibility} to tell the compiler which @samp{extern}
15146 declarations should be treated as hidden.
15147
15148 Note that @samp{-fvisibility} does affect C++ vague linkage
15149 entities. This means that, for instance, an exception class that will
15150 be thrown between DSOs must be explicitly marked with default
15151 visibility so that the @samp{type_info} nodes will be unified between
15152 the DSOs.
15153
15154 An overview of these techniques, their benefits and how to use them
15155 is at @w{@uref{http://gcc.gnu.org/wiki/Visibility}}.
15156
15157 @end table
15158
15159 @c man end
15160
15161 @node Environment Variables
15162 @section Environment Variables Affecting GCC
15163 @cindex environment variables
15164
15165 @c man begin ENVIRONMENT
15166 This section describes several environment variables that affect how GCC
15167 operates.  Some of them work by specifying directories or prefixes to use
15168 when searching for various kinds of files.  Some are used to specify other
15169 aspects of the compilation environment.
15170
15171 Note that you can also specify places to search using options such as
15172 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
15173 take precedence over places specified using environment variables, which
15174 in turn take precedence over those specified by the configuration of GCC@.
15175 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
15176 GNU Compiler Collection (GCC) Internals}.
15177
15178 @table @env
15179 @item LANG
15180 @itemx LC_CTYPE
15181 @c @itemx LC_COLLATE
15182 @itemx LC_MESSAGES
15183 @c @itemx LC_MONETARY
15184 @c @itemx LC_NUMERIC
15185 @c @itemx LC_TIME
15186 @itemx LC_ALL
15187 @findex LANG
15188 @findex LC_CTYPE
15189 @c @findex LC_COLLATE
15190 @findex LC_MESSAGES
15191 @c @findex LC_MONETARY
15192 @c @findex LC_NUMERIC
15193 @c @findex LC_TIME
15194 @findex LC_ALL
15195 @cindex locale
15196 These environment variables control the way that GCC uses
15197 localization information that allow GCC to work with different
15198 national conventions.  GCC inspects the locale categories
15199 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
15200 so.  These locale categories can be set to any value supported by your
15201 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
15202 Kingdom encoded in UTF-8.
15203
15204 The @env{LC_CTYPE} environment variable specifies character
15205 classification.  GCC uses it to determine the character boundaries in
15206 a string; this is needed for some multibyte encodings that contain quote
15207 and escape characters that would otherwise be interpreted as a string
15208 end or escape.
15209
15210 The @env{LC_MESSAGES} environment variable specifies the language to
15211 use in diagnostic messages.
15212
15213 If the @env{LC_ALL} environment variable is set, it overrides the value
15214 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
15215 and @env{LC_MESSAGES} default to the value of the @env{LANG}
15216 environment variable.  If none of these variables are set, GCC
15217 defaults to traditional C English behavior.
15218
15219 @item TMPDIR
15220 @findex TMPDIR
15221 If @env{TMPDIR} is set, it specifies the directory to use for temporary
15222 files.  GCC uses temporary files to hold the output of one stage of
15223 compilation which is to be used as input to the next stage: for example,
15224 the output of the preprocessor, which is the input to the compiler
15225 proper.
15226
15227 @item GCC_EXEC_PREFIX
15228 @findex GCC_EXEC_PREFIX
15229 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
15230 names of the subprograms executed by the compiler.  No slash is added
15231 when this prefix is combined with the name of a subprogram, but you can
15232 specify a prefix that ends with a slash if you wish.
15233
15234 If @env{GCC_EXEC_PREFIX} is not set, GCC will attempt to figure out
15235 an appropriate prefix to use based on the pathname it was invoked with.
15236
15237 If GCC cannot find the subprogram using the specified prefix, it
15238 tries looking in the usual places for the subprogram.
15239
15240 The default value of @env{GCC_EXEC_PREFIX} is
15241 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
15242 the installed compiler. In many cases @var{prefix} is the value
15243 of @code{prefix} when you ran the @file{configure} script.
15244
15245 Other prefixes specified with @option{-B} take precedence over this prefix.
15246
15247 This prefix is also used for finding files such as @file{crt0.o} that are
15248 used for linking.
15249
15250 In addition, the prefix is used in an unusual way in finding the
15251 directories to search for header files.  For each of the standard
15252 directories whose name normally begins with @samp{/usr/local/lib/gcc}
15253 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
15254 replacing that beginning with the specified prefix to produce an
15255 alternate directory name.  Thus, with @option{-Bfoo/}, GCC will search
15256 @file{foo/bar} where it would normally search @file{/usr/local/lib/bar}.
15257 These alternate directories are searched first; the standard directories
15258 come next. If a standard directory begins with the configured
15259 @var{prefix} then the value of @var{prefix} is replaced by
15260 @env{GCC_EXEC_PREFIX} when looking for header files.
15261
15262 @item COMPILER_PATH
15263 @findex COMPILER_PATH
15264 The value of @env{COMPILER_PATH} is a colon-separated list of
15265 directories, much like @env{PATH}.  GCC tries the directories thus
15266 specified when searching for subprograms, if it can't find the
15267 subprograms using @env{GCC_EXEC_PREFIX}.
15268
15269 @item LIBRARY_PATH
15270 @findex LIBRARY_PATH
15271 The value of @env{LIBRARY_PATH} is a colon-separated list of
15272 directories, much like @env{PATH}.  When configured as a native compiler,
15273 GCC tries the directories thus specified when searching for special
15274 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
15275 using GCC also uses these directories when searching for ordinary
15276 libraries for the @option{-l} option (but directories specified with
15277 @option{-L} come first).
15278
15279 @item LANG
15280 @findex LANG
15281 @cindex locale definition
15282 This variable is used to pass locale information to the compiler.  One way in
15283 which this information is used is to determine the character set to be used
15284 when character literals, string literals and comments are parsed in C and C++.
15285 When the compiler is configured to allow multibyte characters,
15286 the following values for @env{LANG} are recognized:
15287
15288 @table @samp
15289 @item C-JIS
15290 Recognize JIS characters.
15291 @item C-SJIS
15292 Recognize SJIS characters.
15293 @item C-EUCJP
15294 Recognize EUCJP characters.
15295 @end table
15296
15297 If @env{LANG} is not defined, or if it has some other value, then the
15298 compiler will use mblen and mbtowc as defined by the default locale to
15299 recognize and translate multibyte characters.
15300 @end table
15301
15302 @noindent
15303 Some additional environments variables affect the behavior of the
15304 preprocessor.
15305
15306 @include cppenv.texi
15307
15308 @c man end
15309
15310 @node Precompiled Headers
15311 @section Using Precompiled Headers
15312 @cindex precompiled headers
15313 @cindex speed of compilation
15314
15315 Often large projects have many header files that are included in every
15316 source file.  The time the compiler takes to process these header files
15317 over and over again can account for nearly all of the time required to
15318 build the project.  To make builds faster, GCC allows users to
15319 `precompile' a header file; then, if builds can use the precompiled
15320 header file they will be much faster.
15321
15322 To create a precompiled header file, simply compile it as you would any
15323 other file, if necessary using the @option{-x} option to make the driver
15324 treat it as a C or C++ header file.  You will probably want to use a
15325 tool like @command{make} to keep the precompiled header up-to-date when
15326 the headers it contains change.
15327
15328 A precompiled header file will be searched for when @code{#include} is
15329 seen in the compilation.  As it searches for the included file
15330 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
15331 compiler looks for a precompiled header in each directory just before it
15332 looks for the include file in that directory.  The name searched for is
15333 the name specified in the @code{#include} with @samp{.gch} appended.  If
15334 the precompiled header file can't be used, it is ignored.
15335
15336 For instance, if you have @code{#include "all.h"}, and you have
15337 @file{all.h.gch} in the same directory as @file{all.h}, then the
15338 precompiled header file will be used if possible, and the original
15339 header will be used otherwise.
15340
15341 Alternatively, you might decide to put the precompiled header file in a
15342 directory and use @option{-I} to ensure that directory is searched
15343 before (or instead of) the directory containing the original header.
15344 Then, if you want to check that the precompiled header file is always
15345 used, you can put a file of the same name as the original header in this
15346 directory containing an @code{#error} command.
15347
15348 This also works with @option{-include}.  So yet another way to use
15349 precompiled headers, good for projects not designed with precompiled
15350 header files in mind, is to simply take most of the header files used by
15351 a project, include them from another header file, precompile that header
15352 file, and @option{-include} the precompiled header.  If the header files
15353 have guards against multiple inclusion, they will be skipped because
15354 they've already been included (in the precompiled header).
15355
15356 If you need to precompile the same header file for different
15357 languages, targets, or compiler options, you can instead make a
15358 @emph{directory} named like @file{all.h.gch}, and put each precompiled
15359 header in the directory, perhaps using @option{-o}.  It doesn't matter
15360 what you call the files in the directory, every precompiled header in
15361 the directory will be considered.  The first precompiled header
15362 encountered in the directory that is valid for this compilation will
15363 be used; they're searched in no particular order.
15364
15365 There are many other possibilities, limited only by your imagination,
15366 good sense, and the constraints of your build system.
15367
15368 A precompiled header file can be used only when these conditions apply:
15369
15370 @itemize
15371 @item
15372 Only one precompiled header can be used in a particular compilation.
15373
15374 @item
15375 A precompiled header can't be used once the first C token is seen.  You
15376 can have preprocessor directives before a precompiled header; you can
15377 even include a precompiled header from inside another header, so long as
15378 there are no C tokens before the @code{#include}.
15379
15380 @item
15381 The precompiled header file must be produced for the same language as
15382 the current compilation.  You can't use a C precompiled header for a C++
15383 compilation.
15384
15385 @item
15386 The precompiled header file must have been produced by the same compiler
15387 binary as the current compilation is using.
15388
15389 @item
15390 Any macros defined before the precompiled header is included must
15391 either be defined in the same way as when the precompiled header was
15392 generated, or must not affect the precompiled header, which usually
15393 means that they don't appear in the precompiled header at all.
15394
15395 The @option{-D} option is one way to define a macro before a
15396 precompiled header is included; using a @code{#define} can also do it.
15397 There are also some options that define macros implicitly, like
15398 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
15399 defined this way.
15400
15401 @item If debugging information is output when using the precompiled
15402 header, using @option{-g} or similar, the same kind of debugging information
15403 must have been output when building the precompiled header.  However,
15404 a precompiled header built using @option{-g} can be used in a compilation
15405 when no debugging information is being output.
15406
15407 @item The same @option{-m} options must generally be used when building
15408 and using the precompiled header.  @xref{Submodel Options},
15409 for any cases where this rule is relaxed.
15410
15411 @item Each of the following options must be the same when building and using
15412 the precompiled header:
15413
15414 @gccoptlist{-fexceptions -funit-at-a-time}
15415
15416 @item
15417 Some other command-line options starting with @option{-f},
15418 @option{-p}, or @option{-O} must be defined in the same way as when
15419 the precompiled header was generated.  At present, it's not clear
15420 which options are safe to change and which are not; the safest choice
15421 is to use exactly the same options when generating and using the
15422 precompiled header.  The following are known to be safe:
15423
15424 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
15425 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
15426 -fsched-verbose=<number>  -fschedule-insns  -fvisibility= @gol
15427 -pedantic-errors}
15428
15429 @end itemize
15430
15431 For all of these except the last, the compiler will automatically
15432 ignore the precompiled header if the conditions aren't met.  If you
15433 find an option combination that doesn't work and doesn't cause the
15434 precompiled header to be ignored, please consider filing a bug report,
15435 see @ref{Bugs}.
15436
15437 If you do use differing options when generating and using the
15438 precompiled header, the actual behavior will be a mixture of the
15439 behavior for the options.  For instance, if you use @option{-g} to
15440 generate the precompiled header but not when using it, you may or may
15441 not get debugging information for routines in the precompiled header.
15442
15443 @node Running Protoize
15444 @section Running Protoize
15445
15446 The program @code{protoize} is an optional part of GCC@.  You can use
15447 it to add prototypes to a program, thus converting the program to ISO
15448 C in one respect.  The companion program @code{unprotoize} does the
15449 reverse: it removes argument types from any prototypes that are found.
15450
15451 When you run these programs, you must specify a set of source files as
15452 command line arguments.  The conversion programs start out by compiling
15453 these files to see what functions they define.  The information gathered
15454 about a file @var{foo} is saved in a file named @file{@var{foo}.X}.
15455
15456 After scanning comes actual conversion.  The specified files are all
15457 eligible to be converted; any files they include (whether sources or
15458 just headers) are eligible as well.
15459
15460 But not all the eligible files are converted.  By default,
15461 @code{protoize} and @code{unprotoize} convert only source and header
15462 files in the current directory.  You can specify additional directories
15463 whose files should be converted with the @option{-d @var{directory}}
15464 option.  You can also specify particular files to exclude with the
15465 @option{-x @var{file}} option.  A file is converted if it is eligible, its
15466 directory name matches one of the specified directory names, and its
15467 name within the directory has not been excluded.
15468
15469 Basic conversion with @code{protoize} consists of rewriting most
15470 function definitions and function declarations to specify the types of
15471 the arguments.  The only ones not rewritten are those for varargs
15472 functions.
15473
15474 @code{protoize} optionally inserts prototype declarations at the
15475 beginning of the source file, to make them available for any calls that
15476 precede the function's definition.  Or it can insert prototype
15477 declarations with block scope in the blocks where undeclared functions
15478 are called.
15479
15480 Basic conversion with @code{unprotoize} consists of rewriting most
15481 function declarations to remove any argument types, and rewriting
15482 function definitions to the old-style pre-ISO form.
15483
15484 Both conversion programs print a warning for any function declaration or
15485 definition that they can't convert.  You can suppress these warnings
15486 with @option{-q}.
15487
15488 The output from @code{protoize} or @code{unprotoize} replaces the
15489 original source file.  The original file is renamed to a name ending
15490 with @samp{.save} (for DOS, the saved filename ends in @samp{.sav}
15491 without the original @samp{.c} suffix).  If the @samp{.save} (@samp{.sav}
15492 for DOS) file already exists, then the source file is simply discarded.
15493
15494 @code{protoize} and @code{unprotoize} both depend on GCC itself to
15495 scan the program and collect information about the functions it uses.
15496 So neither of these programs will work until GCC is installed.
15497
15498 Here is a table of the options you can use with @code{protoize} and
15499 @code{unprotoize}.  Each option works with both programs unless
15500 otherwise stated.
15501
15502 @table @code
15503 @item -B @var{directory}
15504 Look for the file @file{SYSCALLS.c.X} in @var{directory}, instead of the
15505 usual directory (normally @file{/usr/local/lib}).  This file contains
15506 prototype information about standard system functions.  This option
15507 applies only to @code{protoize}.
15508
15509 @item -c @var{compilation-options}
15510 Use @var{compilation-options} as the options when running @command{gcc} to
15511 produce the @samp{.X} files.  The special option @option{-aux-info} is
15512 always passed in addition, to tell @command{gcc} to write a @samp{.X} file.
15513
15514 Note that the compilation options must be given as a single argument to
15515 @code{protoize} or @code{unprotoize}.  If you want to specify several
15516 @command{gcc} options, you must quote the entire set of compilation options
15517 to make them a single word in the shell.
15518
15519 There are certain @command{gcc} arguments that you cannot use, because they
15520 would produce the wrong kind of output.  These include @option{-g},
15521 @option{-O}, @option{-c}, @option{-S}, and @option{-o} If you include these in
15522 the @var{compilation-options}, they are ignored.
15523
15524 @item -C
15525 Rename files to end in @samp{.C} (@samp{.cc} for DOS-based file
15526 systems) instead of @samp{.c}.  This is convenient if you are converting
15527 a C program to C++.  This option applies only to @code{protoize}.
15528
15529 @item -g
15530 Add explicit global declarations.  This means inserting explicit
15531 declarations at the beginning of each source file for each function
15532 that is called in the file and was not declared.  These declarations
15533 precede the first function definition that contains a call to an
15534 undeclared function.  This option applies only to @code{protoize}.
15535
15536 @item -i @var{string}
15537 Indent old-style parameter declarations with the string @var{string}.
15538 This option applies only to @code{protoize}.
15539
15540 @code{unprotoize} converts prototyped function definitions to old-style
15541 function definitions, where the arguments are declared between the
15542 argument list and the initial @samp{@{}.  By default, @code{unprotoize}
15543 uses five spaces as the indentation.  If you want to indent with just
15544 one space instead, use @option{-i " "}.
15545
15546 @item -k
15547 Keep the @samp{.X} files.  Normally, they are deleted after conversion
15548 is finished.
15549
15550 @item -l
15551 Add explicit local declarations.  @code{protoize} with @option{-l} inserts
15552 a prototype declaration for each function in each block which calls the
15553 function without any declaration.  This option applies only to
15554 @code{protoize}.
15555
15556 @item -n
15557 Make no real changes.  This mode just prints information about the conversions
15558 that would have been done without @option{-n}.
15559
15560 @item -N
15561 Make no @samp{.save} files.  The original files are simply deleted.
15562 Use this option with caution.
15563
15564 @item -p @var{program}
15565 Use the program @var{program} as the compiler.  Normally, the name
15566 @file{gcc} is used.
15567
15568 @item -q
15569 Work quietly.  Most warnings are suppressed.
15570
15571 @item -v
15572 Print the version number, just like @option{-v} for @command{gcc}.
15573 @end table
15574
15575 If you need special compiler options to compile one of your program's
15576 source files, then you should generate that file's @samp{.X} file
15577 specially, by running @command{gcc} on that source file with the
15578 appropriate options and the option @option{-aux-info}.  Then run
15579 @code{protoize} on the entire set of files.  @code{protoize} will use
15580 the existing @samp{.X} file because it is newer than the source file.
15581 For example:
15582
15583 @smallexample
15584 gcc -Dfoo=bar file1.c -aux-info file1.X
15585 protoize *.c
15586 @end smallexample
15587
15588 @noindent
15589 You need to include the special files along with the rest in the
15590 @code{protoize} command, even though their @samp{.X} files already
15591 exist, because otherwise they won't get converted.
15592
15593 @xref{Protoize Caveats}, for more information on how to use
15594 @code{protoize} successfully.