OSDN Git Service

* doc/invoke.text (--help): Document --help=common.
[pf3gnuchains/gcc-fork.git] / gcc / doc / invoke.texi
1 @c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2 @c 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
3 @c Free Software Foundation, Inc.
4 @c This is part of the GCC manual.
5 @c For copying conditions, see the file gcc.texi.
6
7 @ignore
8 @c man begin INCLUDE
9 @include gcc-vers.texi
10 @c man end
11
12 @c man begin COPYRIGHT
13 Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
14 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
15
16 Permission is granted to copy, distribute and/or modify this document
17 under the terms of the GNU Free Documentation License, Version 1.2 or
18 any later version published by the Free Software Foundation; with the
19 Invariant Sections being ``GNU General Public License'' and ``Funding
20 Free Software'', the Front-Cover texts being (a) (see below), and with
21 the Back-Cover Texts being (b) (see below).  A copy of the license is
22 included in the gfdl(7) man page.
23
24 (a) The FSF's Front-Cover Text is:
25
26      A GNU Manual
27
28 (b) The FSF's Back-Cover Text is:
29
30      You have freedom to copy and modify this GNU Manual, like GNU
31      software.  Copies published by the Free Software Foundation raise
32      funds for GNU development.
33 @c man end
34 @c Set file name and title for the man page.
35 @setfilename gcc
36 @settitle GNU project C and C++ compiler
37 @c man begin SYNOPSIS
38 gcc [@option{-c}|@option{-S}|@option{-E}] [@option{-std=}@var{standard}]
39     [@option{-g}] [@option{-pg}] [@option{-O}@var{level}]
40     [@option{-W}@var{warn}@dots{}] [@option{-pedantic}]
41     [@option{-I}@var{dir}@dots{}] [@option{-L}@var{dir}@dots{}]
42     [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}]
43     [@option{-f}@var{option}@dots{}] [@option{-m}@var{machine-option}@dots{}]
44     [@option{-o} @var{outfile}] [@@@var{file}] @var{infile}@dots{}
45
46 Only the most useful options are listed here; see below for the
47 remainder.  @samp{g++} accepts mostly the same options as @samp{gcc}.
48 @c man end
49 @c man begin SEEALSO
50 gpl(7), gfdl(7), fsf-funding(7),
51 cpp(1), gcov(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1)
52 and the Info entries for @file{gcc}, @file{cpp}, @file{as},
53 @file{ld}, @file{binutils} and @file{gdb}.
54 @c man end
55 @c man begin BUGS
56 For instructions on reporting bugs, see
57 @w{@uref{http://gcc.gnu.org/bugs.html}}.
58 @c man end
59 @c man begin AUTHOR
60 See the Info entry for @command{gcc}, or
61 @w{@uref{http://gcc.gnu.org/onlinedocs/gcc/Contributors.html}},
62 for contributors to GCC@.
63 @c man end
64 @end ignore
65
66 @node Invoking GCC
67 @chapter GCC Command Options
68 @cindex GCC command options
69 @cindex command options
70 @cindex options, GCC command
71
72 @c man begin DESCRIPTION
73 When you invoke GCC, it normally does preprocessing, compilation,
74 assembly and linking.  The ``overall options'' allow you to stop this
75 process at an intermediate stage.  For example, the @option{-c} option
76 says not to run the linker.  Then the output consists of object files
77 output by the assembler.
78
79 Other options are passed on to one stage of processing.  Some options
80 control the preprocessor and others the compiler itself.  Yet other
81 options control the assembler and linker; most of these are not
82 documented here, since you rarely need to use any of them.
83
84 @cindex C compilation options
85 Most of the command line options that you can use with GCC are useful
86 for C programs; when an option is only useful with another language
87 (usually C++), the explanation says so explicitly.  If the description
88 for a particular option does not mention a source language, you can use
89 that option with all supported languages.
90
91 @cindex C++ compilation options
92 @xref{Invoking G++,,Compiling C++ Programs}, for a summary of special
93 options for compiling C++ programs.
94
95 @cindex grouping options
96 @cindex options, grouping
97 The @command{gcc} program accepts options and file names as operands.  Many
98 options have multi-letter names; therefore multiple single-letter options
99 may @emph{not} be grouped: @option{-dr} is very different from @w{@samp{-d
100 -r}}.
101
102 @cindex order of options
103 @cindex options, order
104 You can mix options and other arguments.  For the most part, the order
105 you use doesn't matter.  Order does matter when you use several options
106 of the same kind; for example, if you specify @option{-L} more than once,
107 the directories are searched in the order specified.
108
109 Many options have long names starting with @samp{-f} or with
110 @samp{-W}---for example,
111 @option{-fmove-loop-invariants}, @option{-Wformat} and so on.  Most of
112 these have both positive and negative forms; the negative form of
113 @option{-ffoo} would be @option{-fno-foo}.  This manual documents
114 only one of these two forms, whichever one is not the default.
115
116 @c man end
117
118 @xref{Option Index}, for an index to GCC's options.
119
120 @menu
121 * Option Summary::      Brief list of all options, without explanations.
122 * Overall Options::     Controlling the kind of output:
123                         an executable, object files, assembler files,
124                         or preprocessed source.
125 * Invoking G++::        Compiling C++ programs.
126 * C Dialect Options::   Controlling the variant of C language compiled.
127 * C++ Dialect Options:: Variations on C++.
128 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
129                         and Objective-C++.
130 * Language Independent Options:: Controlling how diagnostics should be
131                         formatted.
132 * Warning Options::     How picky should the compiler be?
133 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
134 * Optimize Options::    How much optimization?
135 * Preprocessor Options:: Controlling header files and macro definitions.
136                          Also, getting dependency information for Make.
137 * Assembler Options::   Passing options to the assembler.
138 * Link Options::        Specifying libraries and so on.
139 * Directory Options::   Where to find header files and libraries.
140                         Where to find the compiler executable files.
141 * Spec Files::          How to pass switches to sub-processes.
142 * Target Options::      Running a cross-compiler, or an old version of GCC.
143 * Submodel Options::    Specifying minor hardware or convention variations,
144                         such as 68010 vs 68020.
145 * Code Gen Options::    Specifying conventions for function calls, data layout
146                         and register usage.
147 * Environment Variables:: Env vars that affect GCC.
148 * Precompiled Headers:: Compiling a header once, and using it many times.
149 * Running Protoize::    Automatically adding or removing function prototypes.
150 @end menu
151
152 @c man begin OPTIONS
153
154 @node Option Summary
155 @section Option Summary
156
157 Here is a summary of all the options, grouped by type.  Explanations are
158 in the following sections.
159
160 @table @emph
161 @item Overall Options
162 @xref{Overall Options,,Options Controlling the Kind of Output}.
163 @gccoptlist{-c  -S  -E  -o @var{file}  -combine  -pipe  -pass-exit-codes  @gol
164 -x @var{language}  -v  -###  --help@r{[}=@var{class}@r{]}  --target-help  @gol
165 --version @@@var{file}}
166
167 @item C Language Options
168 @xref{C Dialect Options,,Options Controlling C Dialect}.
169 @gccoptlist{-ansi  -std=@var{standard}  -fgnu89-inline @gol
170 -aux-info @var{filename} @gol
171 -fno-asm  -fno-builtin  -fno-builtin-@var{function} @gol
172 -fhosted  -ffreestanding -fopenmp -fms-extensions @gol
173 -trigraphs  -no-integrated-cpp  -traditional  -traditional-cpp @gol
174 -fallow-single-precision  -fcond-mismatch -flax-vector-conversions @gol
175 -fsigned-bitfields  -fsigned-char @gol
176 -funsigned-bitfields  -funsigned-char}
177
178 @item C++ Language Options
179 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
180 @gccoptlist{-fabi-version=@var{n}  -fno-access-control  -fcheck-new @gol
181 -fconserve-space  -ffriend-injection @gol
182 -fno-elide-constructors @gol
183 -fno-enforce-eh-specs @gol
184 -ffor-scope  -fno-for-scope  -fno-gnu-keywords @gol
185 -fno-implicit-templates @gol
186 -fno-implicit-inline-templates @gol
187 -fno-implement-inlines  -fms-extensions @gol
188 -fno-nonansi-builtins  -fno-operator-names @gol
189 -fno-optional-diags  -fpermissive @gol
190 -frepo  -fno-rtti  -fstats  -ftemplate-depth-@var{n} @gol
191 -fno-threadsafe-statics -fuse-cxa-atexit  -fno-weak  -nostdinc++ @gol
192 -fno-default-inline  -fvisibility-inlines-hidden @gol
193 -Wabi  -Wctor-dtor-privacy @gol
194 -Wnon-virtual-dtor  -Wreorder @gol
195 -Weffc++  -Wno-deprecated  -Wstrict-null-sentinel @gol
196 -Wno-non-template-friend  -Wold-style-cast @gol
197 -Woverloaded-virtual  -Wno-pmf-conversions @gol
198 -Wsign-promo}
199
200 @item Objective-C and Objective-C++ Language Options
201 @xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling
202 Objective-C and Objective-C++ Dialects}.
203 @gccoptlist{-fconstant-string-class=@var{class-name} @gol
204 -fgnu-runtime  -fnext-runtime @gol
205 -fno-nil-receivers @gol
206 -fobjc-call-cxx-cdtors @gol
207 -fobjc-direct-dispatch @gol
208 -fobjc-exceptions @gol
209 -fobjc-gc @gol
210 -freplace-objc-classes @gol
211 -fzero-link @gol
212 -gen-decls @gol
213 -Wassign-intercept @gol
214 -Wno-protocol  -Wselector @gol
215 -Wstrict-selector-match @gol
216 -Wundeclared-selector}
217
218 @item Language Independent Options
219 @xref{Language Independent Options,,Options to Control Diagnostic Messages Formatting}.
220 @gccoptlist{-fmessage-length=@var{n}  @gol
221 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol
222 -fdiagnostics-show-option}
223
224 @item Warning Options
225 @xref{Warning Options,,Options to Request or Suppress Warnings}.
226 @gccoptlist{-fsyntax-only  -pedantic  -pedantic-errors @gol
227 -w  -Wextra  -Wall  -Waddress  -Waggregate-return -Warray-bounds @gol
228 -Wno-attributes -Wc++-compat -Wc++0x-compat -Wcast-align  -Wcast-qual  @gol
229 -Wchar-subscripts -Wclobbered  -Wcomment @gol
230 -Wconversion -Wcoverage-mismatch -Wno-deprecated-declarations @gol
231 -Wdisabled-optimization  -Wno-div-by-zero  @gol
232 -Wempty-body  -Wno-endif-labels @gol
233 -Werror  -Werror=* @gol
234 -Wfatal-errors  -Wfloat-equal  -Wformat  -Wformat=2 @gol
235 -Wno-format-extra-args -Wformat-nonliteral @gol
236 -Wformat-security  -Wformat-y2k @gol
237 -Wimplicit  -Wimplicit-function-declaration  -Wimplicit-int @gol
238 -Wimport  -Wno-import  -Winit-self  -Winline @gol
239 -Wno-int-to-pointer-cast -Wno-invalid-offsetof @gol
240 -Winvalid-pch -Wlarger-than-@var{len}  -Wunsafe-loop-optimizations @gol
241 -Wlogical-op -Wlong-long @gol
242 -Wmain  -Wmissing-braces  -Wmissing-field-initializers @gol
243 -Wmissing-format-attribute  -Wmissing-include-dirs @gol
244 -Wmissing-noreturn @gol
245 -Wno-multichar  -Wnonnull  -Wno-overflow @gol
246 -Woverlength-strings  -Wpacked  -Wpadded @gol
247 -Wparentheses  -Wpointer-arith  -Wno-pointer-to-int-cast @gol
248 -Wredundant-decls @gol
249 -Wreturn-type  -Wsequence-point  -Wshadow @gol
250 -Wsign-compare  -Wstack-protector @gol
251 -Wstrict-aliasing -Wstrict-aliasing=2 @gol
252 -Wstrict-overflow -Wstrict-overflow=@var{n} @gol
253 -Wswitch  -Wswitch-default  -Wswitch-enum @gol
254 -Wsystem-headers  -Wtrigraphs  -Wundef  -Wuninitialized @gol
255 -Wunknown-pragmas  -Wno-pragmas -Wunreachable-code @gol
256 -Wunused  -Wunused-function  -Wunused-label  -Wunused-parameter @gol
257 -Wunused-value  -Wunused-variable @gol
258 -Wvariadic-macros -Wvla @gol
259 -Wvolatile-register-var  -Wwrite-strings}
260
261 @item C-only Warning Options
262 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
263 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
264 -Wold-style-declaration  -Wold-style-definition @gol
265 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
266 -Wdeclaration-after-statement -Wpointer-sign}
267
268 @item Debugging Options
269 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
270 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
271 -fdump-noaddr -fdump-unnumbered  -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
272 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
273 -fdump-ipa-all -fdump-ipa-cgraph @gol
274 -fdump-tree-all @gol
275 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
276 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
277 -fdump-tree-inlined@r{[}-@var{n}@r{]} @gol
278 -fdump-tree-cfg -fdump-tree-vcg -fdump-tree-alias @gol
279 -fdump-tree-ch @gol
280 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
281 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
282 -fdump-tree-gimple@r{[}-raw@r{]} -fdump-tree-mudflap@r{[}-@var{n}@r{]} @gol
283 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
284 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
285 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
286 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
287 -fdump-tree-copyrename@r{[}-@var{n}@r{]} @gol
288 -fdump-tree-nrv -fdump-tree-vect @gol
289 -fdump-tree-sink @gol
290 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
291 -fdump-tree-salias @gol
292 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
293 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
294 -ftree-vectorizer-verbose=@var{n} @gol
295 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
296 -feliminate-dwarf2-dups -feliminate-unused-debug-types @gol
297 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
298 -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
299 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
300 -ftest-coverage  -ftime-report -fvar-tracking @gol
301 -g  -g@var{level}  -gcoff -gdwarf-2 @gol
302 -ggdb  -gstabs  -gstabs+  -gvms  -gxcoff  -gxcoff+ @gol
303 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
304 -print-multi-directory  -print-multi-lib @gol
305 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
306 -print-sysroot-headers-suffix @gol
307 -save-temps  -time}
308
309 @item Optimization Options
310 @xref{Optimize Options,,Options that Control Optimization}.
311 @gccoptlist{-falign-functions=@var{n}  -falign-jumps=@var{n} @gol
312 -falign-labels=@var{n}  -falign-loops=@var{n}  @gol
313 -fbounds-check -fmudflap -fmudflapth -fmudflapir @gol
314 -fbranch-probabilities -fprofile-values -fvpt -fbranch-target-load-optimize @gol
315 -fbranch-target-load-optimize2 -fbtr-bb-exclusive @gol
316 -fcaller-saves  -fcprop-registers  -fcse-follow-jumps @gol
317 -fcse-skip-blocks  -fcx-limited-range  -fdata-sections @gol
318 -fdelayed-branch  -fdelete-null-pointer-checks -fearly-inlining @gol
319 -fexpensive-optimizations  -ffast-math  -ffloat-store @gol
320 -fforce-addr  -fforward-propagate  -ffunction-sections @gol
321 -fgcse  -fgcse-lm  -fgcse-sm  -fgcse-las  -fgcse-after-reload @gol
322 -fcrossjumping  -fif-conversion  -fif-conversion2 @gol
323 -finline-functions  -finline-functions-called-once @gol
324 -finline-limit=@var{n}  -fkeep-inline-functions @gol
325 -fkeep-static-consts  -fmerge-constants  -fmerge-all-constants @gol
326 -fmodulo-sched -fno-branch-count-reg @gol
327 -fno-default-inline  -fno-defer-pop -fmove-loop-invariants @gol
328 -fno-function-cse  -fno-guess-branch-probability @gol
329 -fno-inline  -fno-math-errno  -fno-peephole  -fno-peephole2 @gol
330 -funsafe-math-optimizations  -funsafe-loop-optimizations @gol
331 -ffinite-math-only  -fno-signed-zeros @gol
332 -fno-toplevel-reorder -fno-trapping-math  -fno-zero-initialized-in-bss @gol
333 -fomit-frame-pointer  -foptimize-register-move @gol
334 -foptimize-sibling-calls  -fprefetch-loop-arrays @gol
335 -fprofile-generate -fprofile-use @gol
336 -fregmove  -frename-registers @gol
337 -freorder-blocks  -freorder-blocks-and-partition -freorder-functions @gol
338 -frerun-cse-after-loop @gol
339 -frounding-math -frtl-abstract-sequences @gol
340 -fschedule-insns  -fschedule-insns2 @gol
341 -fno-sched-interblock  -fno-sched-spec  -fsched-spec-load @gol
342 -fsched-spec-load-dangerous  @gol
343 -fsched-stalled-insns=@var{n} -fsched-stalled-insns-dep=@var{n} @gol
344 -fsched2-use-superblocks @gol
345 -fsched2-use-traces -fsee -freschedule-modulo-scheduled-loops @gol
346 -fsection-anchors  -fsignaling-nans  -fsingle-precision-constant @gol
347 -fno-split-wide-types -fstack-protector  -fstack-protector-all @gol
348 -fstrict-aliasing  -fstrict-overflow  -ftracer  -fthread-jumps @gol
349 -funroll-all-loops  -funroll-loops  -fpeel-loops @gol
350 -fsplit-ivs-in-unroller -funswitch-loops @gol
351 -fvariable-expansion-in-unroller @gol
352 -ftree-pre  -ftree-ccp  -ftree-dce -ftree-loop-optimize @gol
353 -ftree-loop-linear -ftree-loop-im -ftree-loop-ivcanon -fivopts @gol
354 -fcheck-data-deps @gol
355 -ftree-dominator-opts -ftree-dse -ftree-copyrename -ftree-sink @gol
356 -ftree-ch -ftree-sra -ftree-ter -ftree-fre -ftree-vectorize @gol
357 -ftree-vect-loop-version -ftree-salias -fipa-pta -fweb @gol
358 -ftree-copy-prop -ftree-store-ccp -ftree-store-copy-prop -fwhole-program @gol
359 --param @var{name}=@var{value}
360 -O  -O0  -O1  -O2  -O3  -Os}
361
362 @item Preprocessor Options
363 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
364 @gccoptlist{-A@var{question}=@var{answer} @gol
365 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
366 -C  -dD  -dI  -dM  -dN @gol
367 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
368 -idirafter @var{dir} @gol
369 -include @var{file}  -imacros @var{file} @gol
370 -iprefix @var{file}  -iwithprefix @var{dir} @gol
371 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
372 -imultilib @var{dir} -isysroot @var{dir} @gol
373 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
374 -P  -fworking-directory  -remap @gol
375 -trigraphs  -undef  -U@var{macro}  -Wp,@var{option} @gol
376 -Xpreprocessor @var{option}}
377
378 @item Assembler Option
379 @xref{Assembler Options,,Passing Options to the Assembler}.
380 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
381
382 @item Linker Options
383 @xref{Link Options,,Options for Linking}.
384 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
385 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
386 -s  -static  -static-libgcc  -shared  -shared-libgcc  -symbolic @gol
387 -Wl,@var{option}  -Xlinker @var{option} @gol
388 -u @var{symbol}}
389
390 @item Directory Options
391 @xref{Directory Options,,Options for Directory Search}.
392 @gccoptlist{-B@var{prefix}  -I@var{dir}  -iquote@var{dir}  -L@var{dir}
393 -specs=@var{file}  -I- --sysroot=@var{dir}}
394
395 @item Target Options
396 @c I wrote this xref this way to avoid overfull hbox. -- rms
397 @xref{Target Options}.
398 @gccoptlist{-V @var{version}  -b @var{machine}}
399
400 @item Machine Dependent Options
401 @xref{Submodel Options,,Hardware Models and Configurations}.
402 @c This list is ordered alphanumerically by subsection name.
403 @c Try and put the significant identifier (CPU or system) first,
404 @c so users have a clue at guessing where the ones they want will be.
405
406 @emph{ARC Options}
407 @gccoptlist{-EB  -EL @gol
408 -mmangle-cpu  -mcpu=@var{cpu}  -mtext=@var{text-section} @gol
409 -mdata=@var{data-section}  -mrodata=@var{readonly-data-section}}
410
411 @emph{ARM Options}
412 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
413 -mabi=@var{name} @gol
414 -mapcs-stack-check  -mno-apcs-stack-check @gol
415 -mapcs-float  -mno-apcs-float @gol
416 -mapcs-reentrant  -mno-apcs-reentrant @gol
417 -msched-prolog  -mno-sched-prolog @gol
418 -mlittle-endian  -mbig-endian  -mwords-little-endian @gol
419 -mfloat-abi=@var{name}  -msoft-float  -mhard-float  -mfpe @gol
420 -mthumb-interwork  -mno-thumb-interwork @gol
421 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
422 -mstructure-size-boundary=@var{n} @gol
423 -mabort-on-noreturn @gol
424 -mlong-calls  -mno-long-calls @gol
425 -msingle-pic-base  -mno-single-pic-base @gol
426 -mpic-register=@var{reg} @gol
427 -mnop-fun-dllimport @gol
428 -mcirrus-fix-invalid-insns -mno-cirrus-fix-invalid-insns @gol
429 -mpoke-function-name @gol
430 -mthumb  -marm @gol
431 -mtpcs-frame  -mtpcs-leaf-frame @gol
432 -mcaller-super-interworking  -mcallee-super-interworking @gol
433 -mtp=@var{name}}
434
435 @emph{AVR Options}
436 @gccoptlist{-mmcu=@var{mcu}  -msize  -minit-stack=@var{n}  -mno-interrupts @gol
437 -mcall-prologues  -mno-tablejump  -mtiny-stack  -mint8}
438
439 @emph{Blackfin Options}
440 @gccoptlist{-momit-leaf-frame-pointer -mno-omit-leaf-frame-pointer @gol
441 -mspecld-anomaly -mno-specld-anomaly -mcsync-anomaly -mno-csync-anomaly @gol
442 -mlow-64k  -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
443 -mno-id-shared-library -mshared-library-id=@var{n} @gol
444 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
445 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls}
446
447 @emph{CRIS Options}
448 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
449 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
450 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
451 -mstack-align  -mdata-align  -mconst-align @gol
452 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
453 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
454 -mmul-bug-workaround  -mno-mul-bug-workaround}
455
456 @emph{CRX Options}
457 @gccoptlist{-mmac -mpush-args}
458
459 @emph{Darwin Options}
460 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
461 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
462 -client_name  -compatibility_version  -current_version @gol
463 -dead_strip @gol
464 -dependency-file  -dylib_file  -dylinker_install_name @gol
465 -dynamic  -dynamiclib  -exported_symbols_list @gol
466 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
467 -force_flat_namespace  -headerpad_max_install_names @gol
468 -iframework @gol
469 -image_base  -init  -install_name  -keep_private_externs @gol
470 -multi_module  -multiply_defined  -multiply_defined_unused @gol
471 -noall_load   -no_dead_strip_inits_and_terms @gol
472 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
473 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
474 -private_bundle  -read_only_relocs  -sectalign @gol
475 -sectobjectsymbols  -whyload  -seg1addr @gol
476 -sectcreate  -sectobjectsymbols  -sectorder @gol
477 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
478 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
479 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
480 -single_module  -static  -sub_library  -sub_umbrella @gol
481 -twolevel_namespace  -umbrella  -undefined @gol
482 -unexported_symbols_list  -weak_reference_mismatches @gol
483 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
484 -mkernel -mone-byte-bool}
485
486 @emph{DEC Alpha Options}
487 @gccoptlist{-mno-fp-regs  -msoft-float  -malpha-as  -mgas @gol
488 -mieee  -mieee-with-inexact  -mieee-conformant @gol
489 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
490 -mtrap-precision=@var{mode}  -mbuild-constants @gol
491 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
492 -mbwx  -mmax  -mfix  -mcix @gol
493 -mfloat-vax  -mfloat-ieee @gol
494 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
495 -msmall-text  -mlarge-text @gol
496 -mmemory-latency=@var{time}}
497
498 @emph{DEC Alpha/VMS Options}
499 @gccoptlist{-mvms-return-codes}
500
501 @emph{FRV Options}
502 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
503 -mhard-float  -msoft-float @gol
504 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
505 -mdouble  -mno-double @gol
506 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
507 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
508 -mlinked-fp  -mlong-calls  -malign-labels @gol
509 -mlibrary-pic  -macc-4  -macc-8 @gol
510 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
511 -moptimize-membar -mno-optimize-membar @gol
512 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
513 -mvliw-branch  -mno-vliw-branch @gol
514 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
515 -mno-nested-cond-exec  -mtomcat-stats @gol
516 -mTLS -mtls @gol
517 -mcpu=@var{cpu}}
518
519 @emph{GNU/Linux Options}
520 @gccoptlist{-muclibc}
521
522 @emph{H8/300 Options}
523 @gccoptlist{-mrelax  -mh  -ms  -mn  -mint32  -malign-300}
524
525 @emph{HPPA Options}
526 @gccoptlist{-march=@var{architecture-type} @gol
527 -mbig-switch  -mdisable-fpregs  -mdisable-indexing @gol
528 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
529 -mfixed-range=@var{register-range} @gol
530 -mjump-in-delay -mlinker-opt -mlong-calls @gol
531 -mlong-load-store  -mno-big-switch  -mno-disable-fpregs @gol
532 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
533 -mno-jump-in-delay  -mno-long-load-store @gol
534 -mno-portable-runtime  -mno-soft-float @gol
535 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
536 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
537 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
538 -munix=@var{unix-std}  -nolibdld  -static  -threads}
539
540 @emph{i386 and x86-64 Options}
541 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
542 -mfpmath=@var{unit} @gol
543 -masm=@var{dialect}  -mno-fancy-math-387 @gol
544 -mno-fp-ret-in-387  -msoft-float  -msvr3-shlib @gol
545 -mno-wide-multiply  -mrtd  -malign-double @gol
546 -mpreferred-stack-boundary=@var{num} -mcx16 -msahf @gol
547 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4a -m3dnow -mpopcnt -mabm @gol
548 -mthreads  -mno-align-stringops  -minline-all-stringops @gol
549 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
550 -m96bit-long-double  -mregparm=@var{num}  -msseregparm @gol
551 -mpc32 -mpc64 -mpc80 mstackrealign @gol
552 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
553 -mcmodel=@var{code-model} @gol
554 -m32  -m64 -mlarge-data-threshold=@var{num}}
555
556 @emph{IA-64 Options}
557 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
558 -mvolatile-asm-stop  -mregister-names  -mno-sdata @gol
559 -mconstant-gp  -mauto-pic  -minline-float-divide-min-latency @gol
560 -minline-float-divide-max-throughput @gol
561 -minline-int-divide-min-latency @gol
562 -minline-int-divide-max-throughput  @gol
563 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
564 -mno-dwarf2-asm -mearly-stop-bits @gol
565 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
566 -mtune=@var{cpu-type} -mt -pthread -milp32 -mlp64 @gol
567 -mno-sched-br-data-spec -msched-ar-data-spec -mno-sched-control-spec @gol
568 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
569 -msched-ldc -mno-sched-control-ldc -mno-sched-spec-verbose @gol
570 -mno-sched-prefer-non-data-spec-insns @gol
571 -mno-sched-prefer-non-control-spec-insns @gol
572 -mno-sched-count-spec-in-critical-path}
573
574 @emph{M32R/D Options}
575 @gccoptlist{-m32r2 -m32rx -m32r @gol
576 -mdebug @gol
577 -malign-loops -mno-align-loops @gol
578 -missue-rate=@var{number} @gol
579 -mbranch-cost=@var{number} @gol
580 -mmodel=@var{code-size-model-type} @gol
581 -msdata=@var{sdata-type} @gol
582 -mno-flush-func -mflush-func=@var{name} @gol
583 -mno-flush-trap -mflush-trap=@var{number} @gol
584 -G @var{num}}
585
586 @emph{M32C Options}
587 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
588
589 @emph{M680x0 Options}
590 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune}
591 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
592 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
593 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
594 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
595 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
596 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
597 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library}
598
599 @emph{M68hc1x Options}
600 @gccoptlist{-m6811  -m6812  -m68hc11  -m68hc12   -m68hcs12 @gol
601 -mauto-incdec  -minmax  -mlong-calls  -mshort @gol
602 -msoft-reg-count=@var{count}}
603
604 @emph{MCore Options}
605 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
606 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
607 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
608 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
609 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
610
611 @emph{MIPS Options}
612 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
613 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2  -mips64 @gol
614 -mips16  -mno-mips16  -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
615 -mshared  -mno-shared  -mxgot  -mno-xgot  -mgp32  -mgp64  @gol
616 -mfp32  -mfp64  -mhard-float  -msoft-float  @gol
617 -msingle-float  -mdouble-float  -mdsp  -mdspr2  -mpaired-single  -mips3d @gol
618 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
619 -G@var{num}  -membedded-data  -mno-embedded-data @gol
620 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
621 -msplit-addresses  -mno-split-addresses  @gol
622 -mexplicit-relocs  -mno-explicit-relocs  @gol
623 -mcheck-zero-division  -mno-check-zero-division @gol
624 -mdivide-traps  -mdivide-breaks @gol
625 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
626 -mmad  -mno-mad  -mfused-madd  -mno-fused-madd  -nocpp @gol
627 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
628 -mfix-vr4120  -mno-fix-vr4120  -mfix-vr4130 @gol
629 -mfix-sb1  -mno-fix-sb1 @gol
630 -mflush-func=@var{func}  -mno-flush-func @gol
631 -mbranch-likely  -mno-branch-likely @gol
632 -mfp-exceptions -mno-fp-exceptions @gol
633 -mvr4130-align -mno-vr4130-align}
634
635 @emph{MMIX Options}
636 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
637 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
638 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
639 -mno-base-addresses  -msingle-exit  -mno-single-exit}
640
641 @emph{MN10300 Options}
642 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
643 -mam33  -mno-am33 @gol
644 -mam33-2  -mno-am33-2 @gol
645 -mreturn-pointer-on-d0 @gol
646 -mno-crt0  -mrelax}
647
648 @emph{MT Options}
649 @gccoptlist{-mno-crt0 -mbacc -msim @gol
650 -march=@var{cpu-type} }
651
652 @emph{PDP-11 Options}
653 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
654 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
655 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
656 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
657 -mbranch-expensive  -mbranch-cheap @gol
658 -msplit  -mno-split  -munix-asm  -mdec-asm}
659
660 @emph{PowerPC Options}
661 See RS/6000 and PowerPC Options.
662
663 @emph{RS/6000 and PowerPC Options}
664 @gccoptlist{-mcpu=@var{cpu-type} @gol
665 -mtune=@var{cpu-type} @gol
666 -mpower  -mno-power  -mpower2  -mno-power2 @gol
667 -mpowerpc  -mpowerpc64  -mno-powerpc @gol
668 -maltivec  -mno-altivec @gol
669 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
670 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
671 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb  -mfprnd  -mno-fprnd @gol
672 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mdfp -mno-dfp @gol
673 -mnew-mnemonics  -mold-mnemonics @gol
674 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
675 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
676 -malign-power  -malign-natural @gol
677 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
678 -mstring  -mno-string  -mupdate  -mno-update @gol
679 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
680 -mstrict-align  -mno-strict-align  -mrelocatable @gol
681 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
682 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
683 -mdynamic-no-pic  -maltivec  -mswdiv @gol
684 -mprioritize-restricted-insns=@var{priority} @gol
685 -msched-costly-dep=@var{dependence_type} @gol
686 -minsert-sched-nops=@var{scheme} @gol
687 -mcall-sysv  -mcall-netbsd @gol
688 -maix-struct-return  -msvr4-struct-return @gol
689 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
690 -misel -mno-isel @gol
691 -misel=yes  -misel=no @gol
692 -mspe -mno-spe @gol
693 -mspe=yes  -mspe=no @gol
694 -mvrsave -mno-vrsave @gol
695 -mmulhw -mno-mulhw @gol
696 -mdlmzb -mno-dlmzb @gol
697 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
698 -mprototype  -mno-prototype @gol
699 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
700 -msdata=@var{opt}  -mvxworks  -mwindiss  -G @var{num}  -pthread}
701
702 @emph{S/390 and zSeries Options}
703 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
704 -mhard-float  -msoft-float -mlong-double-64 -mlong-double-128 @gol
705 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
706 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
707 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
708 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
709 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard}
710
711 @emph{Score Options}
712 @gccoptlist{-meb -mel @gol
713 -mnhwloop @gol
714 -muls @gol
715 -mmac @gol
716 -mscore5 -mscore5u -mscore7 -mscore7d}
717
718 @emph{SH Options}
719 @gccoptlist{-m1  -m2  -m2e  -m3  -m3e @gol
720 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
721 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
722 -m5-64media  -m5-64media-nofpu @gol
723 -m5-32media  -m5-32media-nofpu @gol
724 -m5-compact  -m5-compact-nofpu @gol
725 -mb  -ml  -mdalign  -mrelax @gol
726 -mbigtable  -mfmovd  -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
727 -mieee  -misize  -minline-ic_invalidate -mpadstruct  -mspace @gol
728 -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
729 -mdivsi3_libfunc=@var{name}  @gol
730 -madjust-unroll -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
731  -minvalid-symbols}
732
733 @emph{SPARC Options}
734 @gccoptlist{-mcpu=@var{cpu-type} @gol
735 -mtune=@var{cpu-type} @gol
736 -mcmodel=@var{code-model} @gol
737 -m32  -m64  -mapp-regs  -mno-app-regs @gol
738 -mfaster-structs  -mno-faster-structs @gol
739 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
740 -mhard-quad-float  -msoft-quad-float @gol
741 -mimpure-text  -mno-impure-text  -mlittle-endian @gol
742 -mstack-bias  -mno-stack-bias @gol
743 -munaligned-doubles  -mno-unaligned-doubles @gol
744 -mv8plus  -mno-v8plus  -mvis  -mno-vis
745 -threads -pthreads -pthread}
746
747 @emph{SPU Options}
748 @gccoptlist{-mwarn-reloc -merror-reloc @gol
749 -msafe-dma -munsafe-dma @gol
750 -mbranch-hints @gol
751 -msmall-mem -mlarge-mem -mstdmain @gol
752 -mfixed-range=@var{register-range}}
753
754 @emph{System V Options}
755 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
756
757 @emph{TMS320C3x/C4x Options}
758 @gccoptlist{-mcpu=@var{cpu}  -mbig  -msmall  -mregparm  -mmemparm @gol
759 -mfast-fix  -mmpyi  -mbk  -mti  -mdp-isr-reload @gol
760 -mrpts=@var{count}  -mrptb  -mdb  -mloop-unsigned @gol
761 -mparallel-insns  -mparallel-mpy  -mpreserve-float}
762
763 @emph{V850 Options}
764 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
765 -mprolog-function  -mno-prolog-function  -mspace @gol
766 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
767 -mapp-regs  -mno-app-regs @gol
768 -mdisable-callt  -mno-disable-callt @gol
769 -mv850e1 @gol
770 -mv850e @gol
771 -mv850  -mbig-switch}
772
773 @emph{VAX Options}
774 @gccoptlist{-mg  -mgnu  -munix}
775
776 @emph{VxWorks Options}
777 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
778 -Xbind-lazy  -Xbind-now}
779
780 @emph{x86-64 Options}
781 See i386 and x86-64 Options.
782
783 @emph{Xstormy16 Options}
784 @gccoptlist{-msim}
785
786 @emph{Xtensa Options}
787 @gccoptlist{-mconst16 -mno-const16 @gol
788 -mfused-madd  -mno-fused-madd @gol
789 -mtext-section-literals  -mno-text-section-literals @gol
790 -mtarget-align  -mno-target-align @gol
791 -mlongcalls  -mno-longcalls}
792
793 @emph{zSeries Options}
794 See S/390 and zSeries Options.
795
796 @item Code Generation Options
797 @xref{Code Gen Options,,Options for Code Generation Conventions}.
798 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
799 -ffixed-@var{reg}  -fexceptions @gol
800 -fnon-call-exceptions  -funwind-tables @gol
801 -fasynchronous-unwind-tables @gol
802 -finhibit-size-directive  -finstrument-functions @gol
803 -fno-common  -fno-ident @gol
804 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
805 -fno-jump-tables @gol
806 -frecord-gcc-switches @gol
807 -freg-struct-return  -fshort-enums @gol
808 -fshort-double  -fshort-wchar @gol
809 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
810 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
811 -fargument-alias  -fargument-noalias @gol
812 -fargument-noalias-global  -fargument-noalias-anything
813 -fleading-underscore  -ftls-model=@var{model} @gol
814 -ftrapv  -fwrapv  -fbounds-check @gol
815 -fvisibility}
816 @end table
817
818 @menu
819 * Overall Options::     Controlling the kind of output:
820                         an executable, object files, assembler files,
821                         or preprocessed source.
822 * C Dialect Options::   Controlling the variant of C language compiled.
823 * C++ Dialect Options:: Variations on C++.
824 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
825                         and Objective-C++.
826 * Language Independent Options:: Controlling how diagnostics should be
827                         formatted.
828 * Warning Options::     How picky should the compiler be?
829 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
830 * Optimize Options::    How much optimization?
831 * Preprocessor Options:: Controlling header files and macro definitions.
832                          Also, getting dependency information for Make.
833 * Assembler Options::   Passing options to the assembler.
834 * Link Options::        Specifying libraries and so on.
835 * Directory Options::   Where to find header files and libraries.
836                         Where to find the compiler executable files.
837 * Spec Files::          How to pass switches to sub-processes.
838 * Target Options::      Running a cross-compiler, or an old version of GCC.
839 @end menu
840
841 @node Overall Options
842 @section Options Controlling the Kind of Output
843
844 Compilation can involve up to four stages: preprocessing, compilation
845 proper, assembly and linking, always in that order.  GCC is capable of
846 preprocessing and compiling several files either into several
847 assembler input files, or into one assembler input file; then each
848 assembler input file produces an object file, and linking combines all
849 the object files (those newly compiled, and those specified as input)
850 into an executable file.
851
852 @cindex file name suffix
853 For any given input file, the file name suffix determines what kind of
854 compilation is done:
855
856 @table @gcctabopt
857 @item @var{file}.c
858 C source code which must be preprocessed.
859
860 @item @var{file}.i
861 C source code which should not be preprocessed.
862
863 @item @var{file}.ii
864 C++ source code which should not be preprocessed.
865
866 @item @var{file}.m
867 Objective-C source code.  Note that you must link with the @file{libobjc}
868 library to make an Objective-C program work.
869
870 @item @var{file}.mi
871 Objective-C source code which should not be preprocessed.
872
873 @item @var{file}.mm
874 @itemx @var{file}.M
875 Objective-C++ source code.  Note that you must link with the @file{libobjc}
876 library to make an Objective-C++ program work.  Note that @samp{.M} refers
877 to a literal capital M@.
878
879 @item @var{file}.mii
880 Objective-C++ source code which should not be preprocessed.
881
882 @item @var{file}.h
883 C, C++, Objective-C or Objective-C++ header file to be turned into a
884 precompiled header.
885
886 @item @var{file}.cc
887 @itemx @var{file}.cp
888 @itemx @var{file}.cxx
889 @itemx @var{file}.cpp
890 @itemx @var{file}.CPP
891 @itemx @var{file}.c++
892 @itemx @var{file}.C
893 C++ source code which must be preprocessed.  Note that in @samp{.cxx},
894 the last two letters must both be literally @samp{x}.  Likewise,
895 @samp{.C} refers to a literal capital C@.
896
897 @item @var{file}.mm
898 @itemx @var{file}.M
899 Objective-C++ source code which must be preprocessed.
900
901 @item @var{file}.mii
902 Objective-C++ source code which should not be preprocessed.
903
904 @item @var{file}.hh
905 @itemx @var{file}.H
906 C++ header file to be turned into a precompiled header.
907
908 @item @var{file}.f
909 @itemx @var{file}.for
910 @itemx @var{file}.FOR
911 Fixed form Fortran source code which should not be preprocessed.
912
913 @item @var{file}.F
914 @itemx @var{file}.fpp
915 @itemx @var{file}.FPP
916 Fixed form Fortran source code which must be preprocessed (with the traditional
917 preprocessor).
918
919 @item @var{file}.f90
920 @itemx @var{file}.f95
921 Free form Fortran source code which should not be preprocessed.
922
923 @item @var{file}.F90
924 @itemx @var{file}.F95
925 Free form Fortran source code which must be preprocessed (with the
926 traditional preprocessor).
927
928 @c FIXME: Descriptions of Java file types.
929 @c @var{file}.java
930 @c @var{file}.class
931 @c @var{file}.zip
932 @c @var{file}.jar
933
934 @item @var{file}.ads
935 Ada source code file which contains a library unit declaration (a
936 declaration of a package, subprogram, or generic, or a generic
937 instantiation), or a library unit renaming declaration (a package,
938 generic, or subprogram renaming declaration).  Such files are also
939 called @dfn{specs}.
940
941 @itemx @var{file}.adb
942 Ada source code file containing a library unit body (a subprogram or
943 package body).  Such files are also called @dfn{bodies}.
944
945 @c GCC also knows about some suffixes for languages not yet included:
946 @c Pascal:
947 @c @var{file}.p
948 @c @var{file}.pas
949 @c Ratfor:
950 @c @var{file}.r
951
952 @item @var{file}.s
953 Assembler code.
954
955 @item @var{file}.S
956 Assembler code which must be preprocessed.
957
958 @item @var{other}
959 An object file to be fed straight into linking.
960 Any file name with no recognized suffix is treated this way.
961 @end table
962
963 @opindex x
964 You can specify the input language explicitly with the @option{-x} option:
965
966 @table @gcctabopt
967 @item -x @var{language}
968 Specify explicitly the @var{language} for the following input files
969 (rather than letting the compiler choose a default based on the file
970 name suffix).  This option applies to all following input files until
971 the next @option{-x} option.  Possible values for @var{language} are:
972 @smallexample
973 c  c-header  c-cpp-output
974 c++  c++-header  c++-cpp-output
975 objective-c  objective-c-header  objective-c-cpp-output
976 objective-c++ objective-c++-header objective-c++-cpp-output
977 assembler  assembler-with-cpp
978 ada
979 f95  f95-cpp-input
980 java
981 treelang
982 @end smallexample
983
984 @item -x none
985 Turn off any specification of a language, so that subsequent files are
986 handled according to their file name suffixes (as they are if @option{-x}
987 has not been used at all).
988
989 @item -pass-exit-codes
990 @opindex pass-exit-codes
991 Normally the @command{gcc} program will exit with the code of 1 if any
992 phase of the compiler returns a non-success return code.  If you specify
993 @option{-pass-exit-codes}, the @command{gcc} program will instead return with
994 numerically highest error produced by any phase that returned an error
995 indication.  The C, C++, and Fortran frontends return 4, if an internal
996 compiler error is encountered.
997 @end table
998
999 If you only want some of the stages of compilation, you can use
1000 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1001 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1002 @command{gcc} is to stop.  Note that some combinations (for example,
1003 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1004
1005 @table @gcctabopt
1006 @item -c
1007 @opindex c
1008 Compile or assemble the source files, but do not link.  The linking
1009 stage simply is not done.  The ultimate output is in the form of an
1010 object file for each source file.
1011
1012 By default, the object file name for a source file is made by replacing
1013 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1014
1015 Unrecognized input files, not requiring compilation or assembly, are
1016 ignored.
1017
1018 @item -S
1019 @opindex S
1020 Stop after the stage of compilation proper; do not assemble.  The output
1021 is in the form of an assembler code file for each non-assembler input
1022 file specified.
1023
1024 By default, the assembler file name for a source file is made by
1025 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1026
1027 Input files that don't require compilation are ignored.
1028
1029 @item -E
1030 @opindex E
1031 Stop after the preprocessing stage; do not run the compiler proper.  The
1032 output is in the form of preprocessed source code, which is sent to the
1033 standard output.
1034
1035 Input files which don't require preprocessing are ignored.
1036
1037 @cindex output file option
1038 @item -o @var{file}
1039 @opindex o
1040 Place output in file @var{file}.  This applies regardless to whatever
1041 sort of output is being produced, whether it be an executable file,
1042 an object file, an assembler file or preprocessed C code.
1043
1044 If @option{-o} is not specified, the default is to put an executable
1045 file in @file{a.out}, the object file for
1046 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1047 assembler file in @file{@var{source}.s}, a precompiled header file in
1048 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1049 standard output.
1050
1051 @item -v
1052 @opindex v
1053 Print (on standard error output) the commands executed to run the stages
1054 of compilation.  Also print the version number of the compiler driver
1055 program and of the preprocessor and the compiler proper.
1056
1057 @item -###
1058 @opindex ###
1059 Like @option{-v} except the commands are not executed and all command
1060 arguments are quoted.  This is useful for shell scripts to capture the
1061 driver-generated command lines.
1062
1063 @item -pipe
1064 @opindex pipe
1065 Use pipes rather than temporary files for communication between the
1066 various stages of compilation.  This fails to work on some systems where
1067 the assembler is unable to read from a pipe; but the GNU assembler has
1068 no trouble.
1069
1070 @item -combine
1071 @opindex combine
1072 If you are compiling multiple source files, this option tells the driver
1073 to pass all the source files to the compiler at once (for those
1074 languages for which the compiler can handle this).  This will allow
1075 intermodule analysis (IMA) to be performed by the compiler.  Currently the only
1076 language for which this is supported is C@.  If you pass source files for
1077 multiple languages to the driver, using this option, the driver will invoke
1078 the compiler(s) that support IMA once each, passing each compiler all the
1079 source files appropriate for it.  For those languages that do not support
1080 IMA this option will be ignored, and the compiler will be invoked once for
1081 each source file in that language.  If you use this option in conjunction
1082 with @option{-save-temps}, the compiler will generate multiple
1083 pre-processed files
1084 (one for each source file), but only one (combined) @file{.o} or
1085 @file{.s} file.
1086
1087 @item --help
1088 @opindex help
1089 Print (on the standard output) a description of the command line options
1090 understood by @command{gcc}.  If the @option{-v} option is also specified
1091 then @option{--help} will also be passed on to the various processes
1092 invoked by @command{gcc}, so that they can display the command line options
1093 they accept.  If the @option{-Wextra} option has also been specified
1094 (prior to the @option{--help} option), then command line options which
1095 have no documentation associated with them will also be displayed.
1096
1097 @item --target-help
1098 @opindex target-help
1099 Print (on the standard output) a description of target-specific command
1100 line options for each tool.
1101
1102 @item --help=@var{class}@r{[},@var{qualifier}@r{]}
1103 Print (on the standard output) a description of the command line
1104 options understood by the compiler that fit into a specific class.
1105 The class can be one of @samp{optimizers}, @samp{warnings}, @samp{target},
1106 @samp{params}, or @var{language}:
1107
1108 @table @asis
1109 @item @samp{optimizers}
1110 This will display all of the optimization options supported by the
1111 compiler.
1112
1113 @item @samp{warnings}
1114 This will display all of the options controlling warning messages
1115 produced by the compiler.
1116
1117 @item @samp{target}
1118 This will display target-specific options.  Unlike the
1119 @option{--target-help} option however, target-specific options of the
1120 linker and assembler will not be displayed.  This is because those
1121 tools do not currently support the extended @option{--help=} syntax.
1122
1123 @item @samp{params}
1124 This will display the values recognized by the @option{--param}
1125 option.
1126
1127 @item @var{language}
1128 This will display the options supported for @var{language}, where 
1129 @var{language} is the name of one of the languages supported in this 
1130 version of GCC.
1131
1132 @item @samp{common}
1133 This will display the options that are common to all languages.
1134 @end table
1135
1136 It is possible to further refine the output of the @option{--help=}
1137 option by adding a comma separated list of qualifiers after the
1138 class.  These can be any from the following list:
1139
1140 @table @asis
1141 @item @samp{undocumented}
1142 Display only those options which are undocumented.
1143
1144 @item @samp{joined}
1145 Display options which take an argument that appears after an equal
1146 sign in the same continuous piece of text, such as:
1147 @samp{--help=target}.
1148
1149 @item @samp{separate}
1150 Display options which take an argument that appears as a separate word
1151 following the original option, such as: @samp{-o output-file}.
1152 @end table
1153
1154 Thus for example to display all the undocumented target-specific
1155 switches supported by the compiler the following can be used:
1156
1157 @smallexample
1158 --help=target,undocumented
1159 @end smallexample
1160
1161 The sense of a qualifier can be inverted by prefixing it with the
1162 @var{^} character, so for example to display all binary warning
1163 options (i.e. ones that are either on or off and that do not take an
1164 argument), which have a description the following can be used:
1165
1166 @smallexample
1167 --help=warnings,^joined,^undocumented
1168 @end smallexample
1169
1170 A class can also be used as a qualifier, although this usually
1171 restricts the output by so much that there is nothing to display.  One
1172 case where it does work however is when one of the classes is
1173 @var{target}.  So for example to display all the target-specific
1174 optimization options the following can be used:
1175
1176 @smallexample
1177 --help=target,optimizers
1178 @end smallexample
1179
1180 The @option{--help=} option can be repeated on the command line.  Each
1181 successive use will display its requested class of options, skipping
1182 those that have already been displayed.
1183
1184 If the @option{-Q} option appears on the command line before the
1185 @option{--help=} option, then the descriptive text displayed by
1186 @option{--help=} is changed.  Instead of describing the displayed
1187 options, an indication is given as to whether the option is enabled,
1188 disabled or set to a specific value (assuming that the compiler
1189 knows this at the point where the @option{--help=} option is used).
1190
1191 Here is a truncated example from the ARM port of @command{gcc}:
1192
1193 @smallexample
1194   % gcc -Q -mabi=2 --help=target -c
1195   The following options are target specific:
1196   -mabi=                                2
1197   -mabort-on-noreturn                   [disabled]
1198   -mapcs                                [disabled]
1199 @end smallexample
1200
1201 The output is sensitive to the effects of previous command line
1202 options, so for example it is possible to find out which optimizations
1203 are enabled at @option{-O2} by using:
1204
1205 @smallexample
1206 -O2 --help=optimizers
1207 @end smallexample
1208
1209 Alternatively you can discover which binary optimizations are enabled
1210 by @option{-O3} by using:
1211
1212 @smallexample
1213 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1214 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1215 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1216 @end smallexample
1217
1218 @item --version
1219 @opindex version
1220 Display the version number and copyrights of the invoked GCC@.
1221
1222 @include @value{srcdir}/../libiberty/at-file.texi
1223 @end table
1224
1225 @node Invoking G++
1226 @section Compiling C++ Programs
1227
1228 @cindex suffixes for C++ source
1229 @cindex C++ source file suffixes
1230 C++ source files conventionally use one of the suffixes @samp{.C},
1231 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1232 @samp{.cxx}; C++ header files often use @samp{.hh} or @samp{.H}; and
1233 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1234 files with these names and compiles them as C++ programs even if you
1235 call the compiler the same way as for compiling C programs (usually
1236 with the name @command{gcc}).
1237
1238 @findex g++
1239 @findex c++
1240 However, the use of @command{gcc} does not add the C++ library.
1241 @command{g++} is a program that calls GCC and treats @samp{.c},
1242 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1243 files unless @option{-x} is used, and automatically specifies linking
1244 against the C++ library.  This program is also useful when
1245 precompiling a C header file with a @samp{.h} extension for use in C++
1246 compilations.  On many systems, @command{g++} is also installed with
1247 the name @command{c++}.
1248
1249 @cindex invoking @command{g++}
1250 When you compile C++ programs, you may specify many of the same
1251 command-line options that you use for compiling programs in any
1252 language; or command-line options meaningful for C and related
1253 languages; or options that are meaningful only for C++ programs.
1254 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1255 explanations of options for languages related to C@.
1256 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1257 explanations of options that are meaningful only for C++ programs.
1258
1259 @node C Dialect Options
1260 @section Options Controlling C Dialect
1261 @cindex dialect options
1262 @cindex language dialect options
1263 @cindex options, dialect
1264
1265 The following options control the dialect of C (or languages derived
1266 from C, such as C++, Objective-C and Objective-C++) that the compiler
1267 accepts:
1268
1269 @table @gcctabopt
1270 @cindex ANSI support
1271 @cindex ISO support
1272 @item -ansi
1273 @opindex ansi
1274 In C mode, support all ISO C90 programs.  In C++ mode,
1275 remove GNU extensions that conflict with ISO C++.
1276
1277 This turns off certain features of GCC that are incompatible with ISO
1278 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1279 such as the @code{asm} and @code{typeof} keywords, and
1280 predefined macros such as @code{unix} and @code{vax} that identify the
1281 type of system you are using.  It also enables the undesirable and
1282 rarely used ISO trigraph feature.  For the C compiler,
1283 it disables recognition of C++ style @samp{//} comments as well as
1284 the @code{inline} keyword.
1285
1286 The alternate keywords @code{__asm__}, @code{__extension__},
1287 @code{__inline__} and @code{__typeof__} continue to work despite
1288 @option{-ansi}.  You would not want to use them in an ISO C program, of
1289 course, but it is useful to put them in header files that might be included
1290 in compilations done with @option{-ansi}.  Alternate predefined macros
1291 such as @code{__unix__} and @code{__vax__} are also available, with or
1292 without @option{-ansi}.
1293
1294 The @option{-ansi} option does not cause non-ISO programs to be
1295 rejected gratuitously.  For that, @option{-pedantic} is required in
1296 addition to @option{-ansi}.  @xref{Warning Options}.
1297
1298 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1299 option is used.  Some header files may notice this macro and refrain
1300 from declaring certain functions or defining certain macros that the
1301 ISO standard doesn't call for; this is to avoid interfering with any
1302 programs that might use these names for other things.
1303
1304 Functions which would normally be built in but do not have semantics
1305 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1306 functions with @option{-ansi} is used.  @xref{Other Builtins,,Other
1307 built-in functions provided by GCC}, for details of the functions
1308 affected.
1309
1310 @item -std=
1311 @opindex std
1312 Determine the language standard.  This option is currently only
1313 supported when compiling C or C++.  A value for this option must be
1314 provided; possible values are
1315
1316 @table @samp
1317 @item c89
1318 @itemx iso9899:1990
1319 ISO C90 (same as @option{-ansi}).
1320
1321 @item iso9899:199409
1322 ISO C90 as modified in amendment 1.
1323
1324 @item c99
1325 @itemx c9x
1326 @itemx iso9899:1999
1327 @itemx iso9899:199x
1328 ISO C99.  Note that this standard is not yet fully supported; see
1329 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1330 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1331
1332 @item gnu89
1333 Default, ISO C90 plus GNU extensions (including some C99 features).
1334
1335 @item gnu99
1336 @itemx gnu9x
1337 ISO C99 plus GNU extensions.  When ISO C99 is fully implemented in GCC,
1338 this will become the default.  The name @samp{gnu9x} is deprecated.
1339
1340 @item c++98
1341 The 1998 ISO C++ standard plus amendments.
1342
1343 @item gnu++98
1344 The same as @option{-std=c++98} plus GNU extensions.  This is the
1345 default for C++ code.
1346
1347 @item c++0x
1348 The working draft of the upcoming ISO C++0x standard. This option
1349 enables experimental features that are likely to be included in
1350 C++0x. The working draft is constantly changing, and any feature that is
1351 enabled by this flag may be removed from future versions of GCC if it is
1352 not part of the C++0x standard.
1353
1354 @item gnu++0x
1355 The same as @option{-std=c++0x} plus GNU extensions. As with
1356 @option{-std=c++0x}, this option enables experimental features that may
1357 be removed in future versions of GCC.
1358 @end table
1359
1360 Even when this option is not specified, you can still use some of the
1361 features of newer standards in so far as they do not conflict with
1362 previous C standards.  For example, you may use @code{__restrict__} even
1363 when @option{-std=c99} is not specified.
1364
1365 The @option{-std} options specifying some version of ISO C have the same
1366 effects as @option{-ansi}, except that features that were not in ISO C90
1367 but are in the specified version (for example, @samp{//} comments and
1368 the @code{inline} keyword in ISO C99) are not disabled.
1369
1370 @xref{Standards,,Language Standards Supported by GCC}, for details of
1371 these standard versions.
1372
1373 @item -fgnu89-inline
1374 @opindex fgnu89-inline
1375 The option @option{-fgnu89-inline} tells GCC to use the traditional
1376 GNU semantics for @code{inline} functions when in C99 mode.
1377 @xref{Inline,,An Inline Function is As Fast As a Macro}.  This option
1378 is accepted and ignored by GCC versions 4.1.3 up to but not including
1379 4.3.  In GCC versions 4.3 and later it changes the behavior of GCC in
1380 C99 mode.  Using this option is roughly equivalent to adding the
1381 @code{gnu_inline} function attribute to all inline functions
1382 (@pxref{Function Attributes}).
1383
1384 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1385 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1386 specifies the default behavior).  This option was first supported in
1387 GCC 4.3.  This option is not supported in C89 or gnu89 mode.
1388
1389 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1390 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1391 in effect for @code{inline} functions.  @xref{Common Predefined
1392 Macros,,,cpp,The C Preprocessor}.
1393
1394 @item -aux-info @var{filename}
1395 @opindex aux-info
1396 Output to the given filename prototyped declarations for all functions
1397 declared and/or defined in a translation unit, including those in header
1398 files.  This option is silently ignored in any language other than C@.
1399
1400 Besides declarations, the file indicates, in comments, the origin of
1401 each declaration (source file and line), whether the declaration was
1402 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1403 @samp{O} for old, respectively, in the first character after the line
1404 number and the colon), and whether it came from a declaration or a
1405 definition (@samp{C} or @samp{F}, respectively, in the following
1406 character).  In the case of function definitions, a K&R-style list of
1407 arguments followed by their declarations is also provided, inside
1408 comments, after the declaration.
1409
1410 @item -fno-asm
1411 @opindex fno-asm
1412 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1413 keyword, so that code can use these words as identifiers.  You can use
1414 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1415 instead.  @option{-ansi} implies @option{-fno-asm}.
1416
1417 In C++, this switch only affects the @code{typeof} keyword, since
1418 @code{asm} and @code{inline} are standard keywords.  You may want to
1419 use the @option{-fno-gnu-keywords} flag instead, which has the same
1420 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1421 switch only affects the @code{asm} and @code{typeof} keywords, since
1422 @code{inline} is a standard keyword in ISO C99.
1423
1424 @item -fno-builtin
1425 @itemx -fno-builtin-@var{function}
1426 @opindex fno-builtin
1427 @cindex built-in functions
1428 Don't recognize built-in functions that do not begin with
1429 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1430 functions provided by GCC}, for details of the functions affected,
1431 including those which are not built-in functions when @option{-ansi} or
1432 @option{-std} options for strict ISO C conformance are used because they
1433 do not have an ISO standard meaning.
1434
1435 GCC normally generates special code to handle certain built-in functions
1436 more efficiently; for instance, calls to @code{alloca} may become single
1437 instructions that adjust the stack directly, and calls to @code{memcpy}
1438 may become inline copy loops.  The resulting code is often both smaller
1439 and faster, but since the function calls no longer appear as such, you
1440 cannot set a breakpoint on those calls, nor can you change the behavior
1441 of the functions by linking with a different library.  In addition,
1442 when a function is recognized as a built-in function, GCC may use
1443 information about that function to warn about problems with calls to
1444 that function, or to generate more efficient code, even if the
1445 resulting code still contains calls to that function.  For example,
1446 warnings are given with @option{-Wformat} for bad calls to
1447 @code{printf}, when @code{printf} is built in, and @code{strlen} is
1448 known not to modify global memory.
1449
1450 With the @option{-fno-builtin-@var{function}} option
1451 only the built-in function @var{function} is
1452 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1453 function is named this is not built-in in this version of GCC, this
1454 option is ignored.  There is no corresponding
1455 @option{-fbuiltin-@var{function}} option; if you wish to enable
1456 built-in functions selectively when using @option{-fno-builtin} or
1457 @option{-ffreestanding}, you may define macros such as:
1458
1459 @smallexample
1460 #define abs(n)          __builtin_abs ((n))
1461 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1462 @end smallexample
1463
1464 @item -fhosted
1465 @opindex fhosted
1466 @cindex hosted environment
1467
1468 Assert that compilation takes place in a hosted environment.  This implies
1469 @option{-fbuiltin}.  A hosted environment is one in which the
1470 entire standard library is available, and in which @code{main} has a return
1471 type of @code{int}.  Examples are nearly everything except a kernel.
1472 This is equivalent to @option{-fno-freestanding}.
1473
1474 @item -ffreestanding
1475 @opindex ffreestanding
1476 @cindex hosted environment
1477
1478 Assert that compilation takes place in a freestanding environment.  This
1479 implies @option{-fno-builtin}.  A freestanding environment
1480 is one in which the standard library may not exist, and program startup may
1481 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1482 This is equivalent to @option{-fno-hosted}.
1483
1484 @xref{Standards,,Language Standards Supported by GCC}, for details of
1485 freestanding and hosted environments.
1486
1487 @item -fopenmp
1488 @opindex fopenmp
1489 @cindex openmp parallel
1490 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1491 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1492 compiler generates parallel code according to the OpenMP Application
1493 Program Interface v2.5 @w{@uref{http://www.openmp.org/}}.
1494
1495 @item -fms-extensions
1496 @opindex fms-extensions
1497 Accept some non-standard constructs used in Microsoft header files.
1498
1499 Some cases of unnamed fields in structures and unions are only
1500 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1501 fields within structs/unions}, for details.
1502
1503 @item -trigraphs
1504 @opindex trigraphs
1505 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1506 options for strict ISO C conformance) implies @option{-trigraphs}.
1507
1508 @item -no-integrated-cpp
1509 @opindex no-integrated-cpp
1510 Performs a compilation in two passes: preprocessing and compiling.  This
1511 option allows a user supplied "cc1", "cc1plus", or "cc1obj" via the
1512 @option{-B} option.  The user supplied compilation step can then add in
1513 an additional preprocessing step after normal preprocessing but before
1514 compiling.  The default is to use the integrated cpp (internal cpp)
1515
1516 The semantics of this option will change if "cc1", "cc1plus", and
1517 "cc1obj" are merged.
1518
1519 @cindex traditional C language
1520 @cindex C language, traditional
1521 @item -traditional
1522 @itemx -traditional-cpp
1523 @opindex traditional-cpp
1524 @opindex traditional
1525 Formerly, these options caused GCC to attempt to emulate a pre-standard
1526 C compiler.  They are now only supported with the @option{-E} switch.
1527 The preprocessor continues to support a pre-standard mode.  See the GNU
1528 CPP manual for details.
1529
1530 @item -fcond-mismatch
1531 @opindex fcond-mismatch
1532 Allow conditional expressions with mismatched types in the second and
1533 third arguments.  The value of such an expression is void.  This option
1534 is not supported for C++.
1535
1536 @item -flax-vector-conversions
1537 @opindex flax-vector-conversions
1538 Allow implicit conversions between vectors with differing numbers of
1539 elements and/or incompatible element types.  This option should not be
1540 used for new code.
1541
1542 @item -funsigned-char
1543 @opindex funsigned-char
1544 Let the type @code{char} be unsigned, like @code{unsigned char}.
1545
1546 Each kind of machine has a default for what @code{char} should
1547 be.  It is either like @code{unsigned char} by default or like
1548 @code{signed char} by default.
1549
1550 Ideally, a portable program should always use @code{signed char} or
1551 @code{unsigned char} when it depends on the signedness of an object.
1552 But many programs have been written to use plain @code{char} and
1553 expect it to be signed, or expect it to be unsigned, depending on the
1554 machines they were written for.  This option, and its inverse, let you
1555 make such a program work with the opposite default.
1556
1557 The type @code{char} is always a distinct type from each of
1558 @code{signed char} or @code{unsigned char}, even though its behavior
1559 is always just like one of those two.
1560
1561 @item -fsigned-char
1562 @opindex fsigned-char
1563 Let the type @code{char} be signed, like @code{signed char}.
1564
1565 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1566 the negative form of @option{-funsigned-char}.  Likewise, the option
1567 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1568
1569 @item -fsigned-bitfields
1570 @itemx -funsigned-bitfields
1571 @itemx -fno-signed-bitfields
1572 @itemx -fno-unsigned-bitfields
1573 @opindex fsigned-bitfields
1574 @opindex funsigned-bitfields
1575 @opindex fno-signed-bitfields
1576 @opindex fno-unsigned-bitfields
1577 These options control whether a bit-field is signed or unsigned, when the
1578 declaration does not use either @code{signed} or @code{unsigned}.  By
1579 default, such a bit-field is signed, because this is consistent: the
1580 basic integer types such as @code{int} are signed types.
1581 @end table
1582
1583 @node C++ Dialect Options
1584 @section Options Controlling C++ Dialect
1585
1586 @cindex compiler options, C++
1587 @cindex C++ options, command line
1588 @cindex options, C++
1589 This section describes the command-line options that are only meaningful
1590 for C++ programs; but you can also use most of the GNU compiler options
1591 regardless of what language your program is in.  For example, you
1592 might compile a file @code{firstClass.C} like this:
1593
1594 @smallexample
1595 g++ -g -frepo -O -c firstClass.C
1596 @end smallexample
1597
1598 @noindent
1599 In this example, only @option{-frepo} is an option meant
1600 only for C++ programs; you can use the other options with any
1601 language supported by GCC@.
1602
1603 Here is a list of options that are @emph{only} for compiling C++ programs:
1604
1605 @table @gcctabopt
1606
1607 @item -fabi-version=@var{n}
1608 @opindex fabi-version
1609 Use version @var{n} of the C++ ABI@.  Version 2 is the version of the
1610 C++ ABI that first appeared in G++ 3.4.  Version 1 is the version of
1611 the C++ ABI that first appeared in G++ 3.2.  Version 0 will always be
1612 the version that conforms most closely to the C++ ABI specification.
1613 Therefore, the ABI obtained using version 0 will change as ABI bugs
1614 are fixed.
1615
1616 The default is version 2.
1617
1618 @item -fno-access-control
1619 @opindex fno-access-control
1620 Turn off all access checking.  This switch is mainly useful for working
1621 around bugs in the access control code.
1622
1623 @item -fcheck-new
1624 @opindex fcheck-new
1625 Check that the pointer returned by @code{operator new} is non-null
1626 before attempting to modify the storage allocated.  This check is
1627 normally unnecessary because the C++ standard specifies that
1628 @code{operator new} will only return @code{0} if it is declared
1629 @samp{throw()}, in which case the compiler will always check the
1630 return value even without this option.  In all other cases, when
1631 @code{operator new} has a non-empty exception specification, memory
1632 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
1633 @samp{new (nothrow)}.
1634
1635 @item -fconserve-space
1636 @opindex fconserve-space
1637 Put uninitialized or runtime-initialized global variables into the
1638 common segment, as C does.  This saves space in the executable at the
1639 cost of not diagnosing duplicate definitions.  If you compile with this
1640 flag and your program mysteriously crashes after @code{main()} has
1641 completed, you may have an object that is being destroyed twice because
1642 two definitions were merged.
1643
1644 This option is no longer useful on most targets, now that support has
1645 been added for putting variables into BSS without making them common.
1646
1647 @item -ffriend-injection
1648 @opindex ffriend-injection
1649 Inject friend functions into the enclosing namespace, so that they are
1650 visible outside the scope of the class in which they are declared.
1651 Friend functions were documented to work this way in the old Annotated
1652 C++ Reference Manual, and versions of G++ before 4.1 always worked
1653 that way.  However, in ISO C++ a friend function which is not declared
1654 in an enclosing scope can only be found using argument dependent
1655 lookup.  This option causes friends to be injected as they were in
1656 earlier releases.
1657
1658 This option is for compatibility, and may be removed in a future
1659 release of G++.
1660
1661 @item -fno-elide-constructors
1662 @opindex fno-elide-constructors
1663 The C++ standard allows an implementation to omit creating a temporary
1664 which is only used to initialize another object of the same type.
1665 Specifying this option disables that optimization, and forces G++ to
1666 call the copy constructor in all cases.
1667
1668 @item -fno-enforce-eh-specs
1669 @opindex fno-enforce-eh-specs
1670 Don't generate code to check for violation of exception specifications
1671 at runtime.  This option violates the C++ standard, but may be useful
1672 for reducing code size in production builds, much like defining
1673 @samp{NDEBUG}.  This does not give user code permission to throw
1674 exceptions in violation of the exception specifications; the compiler
1675 will still optimize based on the specifications, so throwing an
1676 unexpected exception will result in undefined behavior.
1677
1678 @item -ffor-scope
1679 @itemx -fno-for-scope
1680 @opindex ffor-scope
1681 @opindex fno-for-scope
1682 If @option{-ffor-scope} is specified, the scope of variables declared in
1683 a @i{for-init-statement} is limited to the @samp{for} loop itself,
1684 as specified by the C++ standard.
1685 If @option{-fno-for-scope} is specified, the scope of variables declared in
1686 a @i{for-init-statement} extends to the end of the enclosing scope,
1687 as was the case in old versions of G++, and other (traditional)
1688 implementations of C++.
1689
1690 The default if neither flag is given to follow the standard,
1691 but to allow and give a warning for old-style code that would
1692 otherwise be invalid, or have different behavior.
1693
1694 @item -fno-gnu-keywords
1695 @opindex fno-gnu-keywords
1696 Do not recognize @code{typeof} as a keyword, so that code can use this
1697 word as an identifier.  You can use the keyword @code{__typeof__} instead.
1698 @option{-ansi} implies @option{-fno-gnu-keywords}.
1699
1700 @item -fno-implicit-templates
1701 @opindex fno-implicit-templates
1702 Never emit code for non-inline templates which are instantiated
1703 implicitly (i.e.@: by use); only emit code for explicit instantiations.
1704 @xref{Template Instantiation}, for more information.
1705
1706 @item -fno-implicit-inline-templates
1707 @opindex fno-implicit-inline-templates
1708 Don't emit code for implicit instantiations of inline templates, either.
1709 The default is to handle inlines differently so that compiles with and
1710 without optimization will need the same set of explicit instantiations.
1711
1712 @item -fno-implement-inlines
1713 @opindex fno-implement-inlines
1714 To save space, do not emit out-of-line copies of inline functions
1715 controlled by @samp{#pragma implementation}.  This will cause linker
1716 errors if these functions are not inlined everywhere they are called.
1717
1718 @item -fms-extensions
1719 @opindex fms-extensions
1720 Disable pedantic warnings about constructs used in MFC, such as implicit
1721 int and getting a pointer to member function via non-standard syntax.
1722
1723 @item -fno-nonansi-builtins
1724 @opindex fno-nonansi-builtins
1725 Disable built-in declarations of functions that are not mandated by
1726 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
1727 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
1728
1729 @item -fno-operator-names
1730 @opindex fno-operator-names
1731 Do not treat the operator name keywords @code{and}, @code{bitand},
1732 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
1733 synonyms as keywords.
1734
1735 @item -fno-optional-diags
1736 @opindex fno-optional-diags
1737 Disable diagnostics that the standard says a compiler does not need to
1738 issue.  Currently, the only such diagnostic issued by G++ is the one for
1739 a name having multiple meanings within a class.
1740
1741 @item -fpermissive
1742 @opindex fpermissive
1743 Downgrade some diagnostics about nonconformant code from errors to
1744 warnings.  Thus, using @option{-fpermissive} will allow some
1745 nonconforming code to compile.
1746
1747 @item -frepo
1748 @opindex frepo
1749 Enable automatic template instantiation at link time.  This option also
1750 implies @option{-fno-implicit-templates}.  @xref{Template
1751 Instantiation}, for more information.
1752
1753 @item -fno-rtti
1754 @opindex fno-rtti
1755 Disable generation of information about every class with virtual
1756 functions for use by the C++ runtime type identification features
1757 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
1758 of the language, you can save some space by using this flag.  Note that
1759 exception handling uses the same information, but it will generate it as
1760 needed. The @samp{dynamic_cast} operator can still be used for casts that
1761 do not require runtime type information, i.e. casts to @code{void *} or to
1762 unambiguous base classes.
1763
1764 @item -fstats
1765 @opindex fstats
1766 Emit statistics about front-end processing at the end of the compilation.
1767 This information is generally only useful to the G++ development team.
1768
1769 @item -ftemplate-depth-@var{n}
1770 @opindex ftemplate-depth
1771 Set the maximum instantiation depth for template classes to @var{n}.
1772 A limit on the template instantiation depth is needed to detect
1773 endless recursions during template class instantiation.  ANSI/ISO C++
1774 conforming programs must not rely on a maximum depth greater than 17.
1775
1776 @item -fno-threadsafe-statics
1777 @opindex fno-threadsafe-statics
1778 Do not emit the extra code to use the routines specified in the C++
1779 ABI for thread-safe initialization of local statics.  You can use this
1780 option to reduce code size slightly in code that doesn't need to be
1781 thread-safe.
1782
1783 @item -fuse-cxa-atexit
1784 @opindex fuse-cxa-atexit
1785 Register destructors for objects with static storage duration with the
1786 @code{__cxa_atexit} function rather than the @code{atexit} function.
1787 This option is required for fully standards-compliant handling of static
1788 destructors, but will only work if your C library supports
1789 @code{__cxa_atexit}.
1790
1791 @item -fno-use-cxa-get-exception-ptr
1792 @opindex fno-use-cxa-get-exception-ptr
1793 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
1794 will cause @code{std::uncaught_exception} to be incorrect, but is necessary
1795 if the runtime routine is not available.
1796
1797 @item -fvisibility-inlines-hidden
1798 @opindex fvisibility-inlines-hidden
1799 This switch declares that the user does not attempt to compare
1800 pointers to inline methods where the addresses of the two functions
1801 were taken in different shared objects.
1802
1803 The effect of this is that GCC may, effectively, mark inline methods with
1804 @code{__attribute__ ((visibility ("hidden")))} so that they do not
1805 appear in the export table of a DSO and do not require a PLT indirection
1806 when used within the DSO@.  Enabling this option can have a dramatic effect
1807 on load and link times of a DSO as it massively reduces the size of the
1808 dynamic export table when the library makes heavy use of templates.
1809
1810 The behavior of this switch is not quite the same as marking the
1811 methods as hidden directly, because it does not affect static variables
1812 local to the function or cause the compiler to deduce that
1813 the function is defined in only one shared object.
1814
1815 You may mark a method as having a visibility explicitly to negate the
1816 effect of the switch for that method.  For example, if you do want to
1817 compare pointers to a particular inline method, you might mark it as
1818 having default visibility.  Marking the enclosing class with explicit
1819 visibility will have no effect.
1820
1821 Explicitly instantiated inline methods are unaffected by this option
1822 as their linkage might otherwise cross a shared library boundary.
1823 @xref{Template Instantiation}.
1824
1825 @item -fno-weak
1826 @opindex fno-weak
1827 Do not use weak symbol support, even if it is provided by the linker.
1828 By default, G++ will use weak symbols if they are available.  This
1829 option exists only for testing, and should not be used by end-users;
1830 it will result in inferior code and has no benefits.  This option may
1831 be removed in a future release of G++.
1832
1833 @item -nostdinc++
1834 @opindex nostdinc++
1835 Do not search for header files in the standard directories specific to
1836 C++, but do still search the other standard directories.  (This option
1837 is used when building the C++ library.)
1838 @end table
1839
1840 In addition, these optimization, warning, and code generation options
1841 have meanings only for C++ programs:
1842
1843 @table @gcctabopt
1844 @item -fno-default-inline
1845 @opindex fno-default-inline
1846 Do not assume @samp{inline} for functions defined inside a class scope.
1847 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
1848 functions will have linkage like inline functions; they just won't be
1849 inlined by default.
1850
1851 @item -Wabi @r{(C++ only)}
1852 @opindex Wabi
1853 Warn when G++ generates code that is probably not compatible with the
1854 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
1855 all such cases, there are probably some cases that are not warned about,
1856 even though G++ is generating incompatible code.  There may also be
1857 cases where warnings are emitted even though the code that is generated
1858 will be compatible.
1859
1860 You should rewrite your code to avoid these warnings if you are
1861 concerned about the fact that code generated by G++ may not be binary
1862 compatible with code generated by other compilers.
1863
1864 The known incompatibilities at this point include:
1865
1866 @itemize @bullet
1867
1868 @item
1869 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
1870 pack data into the same byte as a base class.  For example:
1871
1872 @smallexample
1873 struct A @{ virtual void f(); int f1 : 1; @};
1874 struct B : public A @{ int f2 : 1; @};
1875 @end smallexample
1876
1877 @noindent
1878 In this case, G++ will place @code{B::f2} into the same byte
1879 as@code{A::f1}; other compilers will not.  You can avoid this problem
1880 by explicitly padding @code{A} so that its size is a multiple of the
1881 byte size on your platform; that will cause G++ and other compilers to
1882 layout @code{B} identically.
1883
1884 @item
1885 Incorrect handling of tail-padding for virtual bases.  G++ does not use
1886 tail padding when laying out virtual bases.  For example:
1887
1888 @smallexample
1889 struct A @{ virtual void f(); char c1; @};
1890 struct B @{ B(); char c2; @};
1891 struct C : public A, public virtual B @{@};
1892 @end smallexample
1893
1894 @noindent
1895 In this case, G++ will not place @code{B} into the tail-padding for
1896 @code{A}; other compilers will.  You can avoid this problem by
1897 explicitly padding @code{A} so that its size is a multiple of its
1898 alignment (ignoring virtual base classes); that will cause G++ and other
1899 compilers to layout @code{C} identically.
1900
1901 @item
1902 Incorrect handling of bit-fields with declared widths greater than that
1903 of their underlying types, when the bit-fields appear in a union.  For
1904 example:
1905
1906 @smallexample
1907 union U @{ int i : 4096; @};
1908 @end smallexample
1909
1910 @noindent
1911 Assuming that an @code{int} does not have 4096 bits, G++ will make the
1912 union too small by the number of bits in an @code{int}.
1913
1914 @item
1915 Empty classes can be placed at incorrect offsets.  For example:
1916
1917 @smallexample
1918 struct A @{@};
1919
1920 struct B @{
1921   A a;
1922   virtual void f ();
1923 @};
1924
1925 struct C : public B, public A @{@};
1926 @end smallexample
1927
1928 @noindent
1929 G++ will place the @code{A} base class of @code{C} at a nonzero offset;
1930 it should be placed at offset zero.  G++ mistakenly believes that the
1931 @code{A} data member of @code{B} is already at offset zero.
1932
1933 @item
1934 Names of template functions whose types involve @code{typename} or
1935 template template parameters can be mangled incorrectly.
1936
1937 @smallexample
1938 template <typename Q>
1939 void f(typename Q::X) @{@}
1940
1941 template <template <typename> class Q>
1942 void f(typename Q<int>::X) @{@}
1943 @end smallexample
1944
1945 @noindent
1946 Instantiations of these templates may be mangled incorrectly.
1947
1948 @end itemize
1949
1950 @item -Wctor-dtor-privacy @r{(C++ only)}
1951 @opindex Wctor-dtor-privacy
1952 Warn when a class seems unusable because all the constructors or
1953 destructors in that class are private, and it has neither friends nor
1954 public static member functions.
1955
1956 @item -Wnon-virtual-dtor @r{(C++ only)}
1957 @opindex Wnon-virtual-dtor
1958 Warn when a class appears to be polymorphic, thereby requiring a virtual
1959 destructor, yet it declares a non-virtual one.  This warning is also
1960 enabled if -Weffc++ is specified.
1961
1962 @item -Wreorder @r{(C++ only)}
1963 @opindex Wreorder
1964 @cindex reordering, warning
1965 @cindex warning for reordering of member initializers
1966 Warn when the order of member initializers given in the code does not
1967 match the order in which they must be executed.  For instance:
1968
1969 @smallexample
1970 struct A @{
1971   int i;
1972   int j;
1973   A(): j (0), i (1) @{ @}
1974 @};
1975 @end smallexample
1976
1977 The compiler will rearrange the member initializers for @samp{i}
1978 and @samp{j} to match the declaration order of the members, emitting
1979 a warning to that effect.  This warning is enabled by @option{-Wall}.
1980 @end table
1981
1982 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
1983
1984 @table @gcctabopt
1985 @item -Weffc++ @r{(C++ only)}
1986 @opindex Weffc++
1987 Warn about violations of the following style guidelines from Scott Meyers'
1988 @cite{Effective C++} book:
1989
1990 @itemize @bullet
1991 @item
1992 Item 11:  Define a copy constructor and an assignment operator for classes
1993 with dynamically allocated memory.
1994
1995 @item
1996 Item 12:  Prefer initialization to assignment in constructors.
1997
1998 @item
1999 Item 14:  Make destructors virtual in base classes.
2000
2001 @item
2002 Item 15:  Have @code{operator=} return a reference to @code{*this}.
2003
2004 @item
2005 Item 23:  Don't try to return a reference when you must return an object.
2006
2007 @end itemize
2008
2009 Also warn about violations of the following style guidelines from
2010 Scott Meyers' @cite{More Effective C++} book:
2011
2012 @itemize @bullet
2013 @item
2014 Item 6:  Distinguish between prefix and postfix forms of increment and
2015 decrement operators.
2016
2017 @item
2018 Item 7:  Never overload @code{&&}, @code{||}, or @code{,}.
2019
2020 @end itemize
2021
2022 When selecting this option, be aware that the standard library
2023 headers do not obey all of these guidelines; use @samp{grep -v}
2024 to filter out those warnings.
2025
2026 @item -Wno-deprecated @r{(C++ only)}
2027 @opindex Wno-deprecated
2028 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
2029
2030 @item -Wstrict-null-sentinel @r{(C++ only)}
2031 @opindex Wstrict-null-sentinel
2032 Warn also about the use of an uncasted @code{NULL} as sentinel.  When
2033 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2034 to @code{__null}.  Although it is a null pointer constant not a null pointer,
2035 it is guaranteed to of the same size as a pointer.  But this use is
2036 not portable across different compilers.
2037
2038 @item -Wno-non-template-friend @r{(C++ only)}
2039 @opindex Wno-non-template-friend
2040 Disable warnings when non-templatized friend functions are declared
2041 within a template.  Since the advent of explicit template specification
2042 support in G++, if the name of the friend is an unqualified-id (i.e.,
2043 @samp{friend foo(int)}), the C++ language specification demands that the
2044 friend declare or define an ordinary, nontemplate function.  (Section
2045 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2046 could be interpreted as a particular specialization of a templatized
2047 function.  Because this non-conforming behavior is no longer the default
2048 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2049 check existing code for potential trouble spots and is on by default.
2050 This new compiler behavior can be turned off with
2051 @option{-Wno-non-template-friend} which keeps the conformant compiler code
2052 but disables the helpful warning.
2053
2054 @item -Wold-style-cast @r{(C++ only)}
2055 @opindex Wold-style-cast
2056 Warn if an old-style (C-style) cast to a non-void type is used within
2057 a C++ program.  The new-style casts (@samp{dynamic_cast},
2058 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
2059 less vulnerable to unintended effects and much easier to search for.
2060
2061 @item -Woverloaded-virtual @r{(C++ only)}
2062 @opindex Woverloaded-virtual
2063 @cindex overloaded virtual fn, warning
2064 @cindex warning for overloaded virtual fn
2065 Warn when a function declaration hides virtual functions from a
2066 base class.  For example, in:
2067
2068 @smallexample
2069 struct A @{
2070   virtual void f();
2071 @};
2072
2073 struct B: public A @{
2074   void f(int);
2075 @};
2076 @end smallexample
2077
2078 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2079 like:
2080
2081 @smallexample
2082 B* b;
2083 b->f();
2084 @end smallexample
2085
2086 will fail to compile.
2087
2088 @item -Wno-pmf-conversions @r{(C++ only)}
2089 @opindex Wno-pmf-conversions
2090 Disable the diagnostic for converting a bound pointer to member function
2091 to a plain pointer.
2092
2093 @item -Wsign-promo @r{(C++ only)}
2094 @opindex Wsign-promo
2095 Warn when overload resolution chooses a promotion from unsigned or
2096 enumerated type to a signed type, over a conversion to an unsigned type of
2097 the same size.  Previous versions of G++ would try to preserve
2098 unsignedness, but the standard mandates the current behavior.
2099
2100 @smallexample
2101 struct A @{
2102   operator int ();
2103   A& operator = (int);
2104 @};
2105
2106 main ()
2107 @{
2108   A a,b;
2109   a = b;
2110 @}
2111 @end smallexample
2112
2113 In this example, G++ will synthesize a default @samp{A& operator =
2114 (const A&);}, while cfront will use the user-defined @samp{operator =}.
2115 @end table
2116
2117 @node Objective-C and Objective-C++ Dialect Options
2118 @section Options Controlling Objective-C and Objective-C++ Dialects
2119
2120 @cindex compiler options, Objective-C and Objective-C++
2121 @cindex Objective-C and Objective-C++ options, command line
2122 @cindex options, Objective-C and Objective-C++
2123 (NOTE: This manual does not describe the Objective-C and Objective-C++
2124 languages themselves.  See @xref{Standards,,Language Standards
2125 Supported by GCC}, for references.)
2126
2127 This section describes the command-line options that are only meaningful
2128 for Objective-C and Objective-C++ programs, but you can also use most of
2129 the language-independent GNU compiler options.
2130 For example, you might compile a file @code{some_class.m} like this:
2131
2132 @smallexample
2133 gcc -g -fgnu-runtime -O -c some_class.m
2134 @end smallexample
2135
2136 @noindent
2137 In this example, @option{-fgnu-runtime} is an option meant only for
2138 Objective-C and Objective-C++ programs; you can use the other options with
2139 any language supported by GCC@.
2140
2141 Note that since Objective-C is an extension of the C language, Objective-C
2142 compilations may also use options specific to the C front-end (e.g.,
2143 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2144 C++-specific options (e.g., @option{-Wabi}).
2145
2146 Here is a list of options that are @emph{only} for compiling Objective-C
2147 and Objective-C++ programs:
2148
2149 @table @gcctabopt
2150 @item -fconstant-string-class=@var{class-name}
2151 @opindex fconstant-string-class
2152 Use @var{class-name} as the name of the class to instantiate for each
2153 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2154 class name is @code{NXConstantString} if the GNU runtime is being used, and
2155 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2156 @option{-fconstant-cfstrings} option, if also present, will override the
2157 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2158 to be laid out as constant CoreFoundation strings.
2159
2160 @item -fgnu-runtime
2161 @opindex fgnu-runtime
2162 Generate object code compatible with the standard GNU Objective-C
2163 runtime.  This is the default for most types of systems.
2164
2165 @item -fnext-runtime
2166 @opindex fnext-runtime
2167 Generate output compatible with the NeXT runtime.  This is the default
2168 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2169 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2170 used.
2171
2172 @item -fno-nil-receivers
2173 @opindex fno-nil-receivers
2174 Assume that all Objective-C message dispatches (e.g.,
2175 @code{[receiver message:arg]}) in this translation unit ensure that the receiver
2176 is not @code{nil}.  This allows for more efficient entry points in the runtime
2177 to be used.  Currently, this option is only available in conjunction with
2178 the NeXT runtime on Mac OS X 10.3 and later.
2179
2180 @item -fobjc-call-cxx-cdtors
2181 @opindex fobjc-call-cxx-cdtors
2182 For each Objective-C class, check if any of its instance variables is a
2183 C++ object with a non-trivial default constructor.  If so, synthesize a
2184 special @code{- (id) .cxx_construct} instance method that will run
2185 non-trivial default constructors on any such instance variables, in order,
2186 and then return @code{self}.  Similarly, check if any instance variable
2187 is a C++ object with a non-trivial destructor, and if so, synthesize a
2188 special @code{- (void) .cxx_destruct} method that will run
2189 all such default destructors, in reverse order.
2190
2191 The @code{- (id) .cxx_construct} and/or @code{- (void) .cxx_destruct} methods
2192 thusly generated will only operate on instance variables declared in the
2193 current Objective-C class, and not those inherited from superclasses.  It
2194 is the responsibility of the Objective-C runtime to invoke all such methods
2195 in an object's inheritance hierarchy.  The @code{- (id) .cxx_construct} methods
2196 will be invoked by the runtime immediately after a new object
2197 instance is allocated; the @code{- (void) .cxx_destruct} methods will
2198 be invoked immediately before the runtime deallocates an object instance.
2199
2200 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2201 support for invoking the @code{- (id) .cxx_construct} and
2202 @code{- (void) .cxx_destruct} methods.
2203
2204 @item -fobjc-direct-dispatch
2205 @opindex fobjc-direct-dispatch
2206 Allow fast jumps to the message dispatcher.  On Darwin this is
2207 accomplished via the comm page.
2208
2209 @item -fobjc-exceptions
2210 @opindex fobjc-exceptions
2211 Enable syntactic support for structured exception handling in Objective-C,
2212 similar to what is offered by C++ and Java.  This option is
2213 unavailable in conjunction with the NeXT runtime on Mac OS X 10.2 and
2214 earlier.
2215
2216 @smallexample
2217   @@try @{
2218     @dots{}
2219        @@throw expr;
2220     @dots{}
2221   @}
2222   @@catch (AnObjCClass *exc) @{
2223     @dots{}
2224       @@throw expr;
2225     @dots{}
2226       @@throw;
2227     @dots{}
2228   @}
2229   @@catch (AnotherClass *exc) @{
2230     @dots{}
2231   @}
2232   @@catch (id allOthers) @{
2233     @dots{}
2234   @}
2235   @@finally @{
2236     @dots{}
2237       @@throw expr;
2238     @dots{}
2239   @}
2240 @end smallexample
2241
2242 The @code{@@throw} statement may appear anywhere in an Objective-C or
2243 Objective-C++ program; when used inside of a @code{@@catch} block, the
2244 @code{@@throw} may appear without an argument (as shown above), in which case
2245 the object caught by the @code{@@catch} will be rethrown.
2246
2247 Note that only (pointers to) Objective-C objects may be thrown and
2248 caught using this scheme.  When an object is thrown, it will be caught
2249 by the nearest @code{@@catch} clause capable of handling objects of that type,
2250 analogously to how @code{catch} blocks work in C++ and Java.  A
2251 @code{@@catch(id @dots{})} clause (as shown above) may also be provided to catch
2252 any and all Objective-C exceptions not caught by previous @code{@@catch}
2253 clauses (if any).
2254
2255 The @code{@@finally} clause, if present, will be executed upon exit from the
2256 immediately preceding @code{@@try @dots{} @@catch} section.  This will happen
2257 regardless of whether any exceptions are thrown, caught or rethrown
2258 inside the @code{@@try @dots{} @@catch} section, analogously to the behavior
2259 of the @code{finally} clause in Java.
2260
2261 There are several caveats to using the new exception mechanism:
2262
2263 @itemize @bullet
2264 @item
2265 Although currently designed to be binary compatible with @code{NS_HANDLER}-style
2266 idioms provided by the @code{NSException} class, the new
2267 exceptions can only be used on Mac OS X 10.3 (Panther) and later
2268 systems, due to additional functionality needed in the (NeXT) Objective-C
2269 runtime.
2270
2271 @item
2272 As mentioned above, the new exceptions do not support handling
2273 types other than Objective-C objects.   Furthermore, when used from
2274 Objective-C++, the Objective-C exception model does not interoperate with C++
2275 exceptions at this time.  This means you cannot @code{@@throw} an exception
2276 from Objective-C and @code{catch} it in C++, or vice versa
2277 (i.e., @code{throw @dots{} @@catch}).
2278 @end itemize
2279
2280 The @option{-fobjc-exceptions} switch also enables the use of synchronization
2281 blocks for thread-safe execution:
2282
2283 @smallexample
2284   @@synchronized (ObjCClass *guard) @{
2285     @dots{}
2286   @}
2287 @end smallexample
2288
2289 Upon entering the @code{@@synchronized} block, a thread of execution shall
2290 first check whether a lock has been placed on the corresponding @code{guard}
2291 object by another thread.  If it has, the current thread shall wait until
2292 the other thread relinquishes its lock.  Once @code{guard} becomes available,
2293 the current thread will place its own lock on it, execute the code contained in
2294 the @code{@@synchronized} block, and finally relinquish the lock (thereby
2295 making @code{guard} available to other threads).
2296
2297 Unlike Java, Objective-C does not allow for entire methods to be marked
2298 @code{@@synchronized}.  Note that throwing exceptions out of
2299 @code{@@synchronized} blocks is allowed, and will cause the guarding object
2300 to be unlocked properly.
2301
2302 @item -fobjc-gc
2303 @opindex fobjc-gc
2304 Enable garbage collection (GC) in Objective-C and Objective-C++ programs.
2305
2306 @item -freplace-objc-classes
2307 @opindex freplace-objc-classes
2308 Emit a special marker instructing @command{ld(1)} not to statically link in
2309 the resulting object file, and allow @command{dyld(1)} to load it in at
2310 run time instead.  This is used in conjunction with the Fix-and-Continue
2311 debugging mode, where the object file in question may be recompiled and
2312 dynamically reloaded in the course of program execution, without the need
2313 to restart the program itself.  Currently, Fix-and-Continue functionality
2314 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2315 and later.
2316
2317 @item -fzero-link
2318 @opindex fzero-link
2319 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2320 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2321 compile time) with static class references that get initialized at load time,
2322 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2323 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2324 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2325 for individual class implementations to be modified during program execution.
2326
2327 @item -gen-decls
2328 @opindex gen-decls
2329 Dump interface declarations for all classes seen in the source file to a
2330 file named @file{@var{sourcename}.decl}.
2331
2332 @item -Wassign-intercept
2333 @opindex Wassign-intercept
2334 Warn whenever an Objective-C assignment is being intercepted by the
2335 garbage collector.
2336
2337 @item -Wno-protocol
2338 @opindex Wno-protocol
2339 If a class is declared to implement a protocol, a warning is issued for
2340 every method in the protocol that is not implemented by the class.  The
2341 default behavior is to issue a warning for every method not explicitly
2342 implemented in the class, even if a method implementation is inherited
2343 from the superclass.  If you use the @option{-Wno-protocol} option, then
2344 methods inherited from the superclass are considered to be implemented,
2345 and no warning is issued for them.
2346
2347 @item -Wselector
2348 @opindex Wselector
2349 Warn if multiple methods of different types for the same selector are
2350 found during compilation.  The check is performed on the list of methods
2351 in the final stage of compilation.  Additionally, a check is performed
2352 for each selector appearing in a @code{@@selector(@dots{})}
2353 expression, and a corresponding method for that selector has been found
2354 during compilation.  Because these checks scan the method table only at
2355 the end of compilation, these warnings are not produced if the final
2356 stage of compilation is not reached, for example because an error is
2357 found during compilation, or because the @option{-fsyntax-only} option is
2358 being used.
2359
2360 @item -Wstrict-selector-match
2361 @opindex Wstrict-selector-match
2362 Warn if multiple methods with differing argument and/or return types are
2363 found for a given selector when attempting to send a message using this
2364 selector to a receiver of type @code{id} or @code{Class}.  When this flag
2365 is off (which is the default behavior), the compiler will omit such warnings
2366 if any differences found are confined to types which share the same size
2367 and alignment.
2368
2369 @item -Wundeclared-selector
2370 @opindex Wundeclared-selector
2371 Warn if a @code{@@selector(@dots{})} expression referring to an
2372 undeclared selector is found.  A selector is considered undeclared if no
2373 method with that name has been declared before the
2374 @code{@@selector(@dots{})} expression, either explicitly in an
2375 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
2376 an @code{@@implementation} section.  This option always performs its
2377 checks as soon as a @code{@@selector(@dots{})} expression is found,
2378 while @option{-Wselector} only performs its checks in the final stage of
2379 compilation.  This also enforces the coding style convention
2380 that methods and selectors must be declared before being used.
2381
2382 @item -print-objc-runtime-info
2383 @opindex print-objc-runtime-info
2384 Generate C header describing the largest structure that is passed by
2385 value, if any.
2386
2387 @end table
2388
2389 @node Language Independent Options
2390 @section Options to Control Diagnostic Messages Formatting
2391 @cindex options to control diagnostics formatting
2392 @cindex diagnostic messages
2393 @cindex message formatting
2394
2395 Traditionally, diagnostic messages have been formatted irrespective of
2396 the output device's aspect (e.g.@: its width, @dots{}).  The options described
2397 below can be used to control the diagnostic messages formatting
2398 algorithm, e.g.@: how many characters per line, how often source location
2399 information should be reported.  Right now, only the C++ front end can
2400 honor these options.  However it is expected, in the near future, that
2401 the remaining front ends would be able to digest them correctly.
2402
2403 @table @gcctabopt
2404 @item -fmessage-length=@var{n}
2405 @opindex fmessage-length
2406 Try to format error messages so that they fit on lines of about @var{n}
2407 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
2408 the front ends supported by GCC@.  If @var{n} is zero, then no
2409 line-wrapping will be done; each error message will appear on a single
2410 line.
2411
2412 @opindex fdiagnostics-show-location
2413 @item -fdiagnostics-show-location=once
2414 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
2415 reporter to emit @emph{once} source location information; that is, in
2416 case the message is too long to fit on a single physical line and has to
2417 be wrapped, the source location won't be emitted (as prefix) again,
2418 over and over, in subsequent continuation lines.  This is the default
2419 behavior.
2420
2421 @item -fdiagnostics-show-location=every-line
2422 Only meaningful in line-wrapping mode.  Instructs the diagnostic
2423 messages reporter to emit the same source location information (as
2424 prefix) for physical lines that result from the process of breaking
2425 a message which is too long to fit on a single line.
2426
2427 @item -fdiagnostics-show-option
2428 @opindex fdiagnostics-show-option
2429 This option instructs the diagnostic machinery to add text to each
2430 diagnostic emitted, which indicates which command line option directly
2431 controls that diagnostic, when such an option is known to the
2432 diagnostic machinery.
2433
2434 @item -Wcoverage-mismatch
2435 @opindex Wcoverage-mismatch
2436 Warn if feedback profiles do not match when using the
2437 @option{-fprofile-use} option.
2438 If a source file was changed between @option{-fprofile-gen} and
2439 @option{-fprofile-use}, the files with the profile feedback can fail
2440 to match the source file and GCC can not use the profile feedback
2441 information.  By default, GCC emits an error message in this case.
2442 The option @option{-Wcoverage-mismatch} emits a warning instead of an
2443 error.  GCC does not use appropriate feedback profiles, so using this
2444 option can result in poorly optimized code.  This option is useful
2445 only in the case of very minor changes such as bug fixes to an
2446 existing code-base.
2447
2448 @end table
2449
2450 @node Warning Options
2451 @section Options to Request or Suppress Warnings
2452 @cindex options to control warnings
2453 @cindex warning messages
2454 @cindex messages, warning
2455 @cindex suppressing warnings
2456
2457 Warnings are diagnostic messages that report constructions which
2458 are not inherently erroneous but which are risky or suggest there
2459 may have been an error.
2460
2461 You can request many specific warnings with options beginning @samp{-W},
2462 for example @option{-Wimplicit} to request warnings on implicit
2463 declarations.  Each of these specific warning options also has a
2464 negative form beginning @samp{-Wno-} to turn off warnings;
2465 for example, @option{-Wno-implicit}.  This manual lists only one of the
2466 two forms, whichever is not the default.
2467
2468 The following options control the amount and kinds of warnings produced
2469 by GCC; for further, language-specific options also refer to
2470 @ref{C++ Dialect Options} and @ref{Objective-C and Objective-C++ Dialect
2471 Options}.
2472
2473 @table @gcctabopt
2474 @cindex syntax checking
2475 @item -fsyntax-only
2476 @opindex fsyntax-only
2477 Check the code for syntax errors, but don't do anything beyond that.
2478
2479 @item -pedantic
2480 @opindex pedantic
2481 Issue all the warnings demanded by strict ISO C and ISO C++;
2482 reject all programs that use forbidden extensions, and some other
2483 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
2484 version of the ISO C standard specified by any @option{-std} option used.
2485
2486 Valid ISO C and ISO C++ programs should compile properly with or without
2487 this option (though a rare few will require @option{-ansi} or a
2488 @option{-std} option specifying the required version of ISO C)@.  However,
2489 without this option, certain GNU extensions and traditional C and C++
2490 features are supported as well.  With this option, they are rejected.
2491
2492 @option{-pedantic} does not cause warning messages for use of the
2493 alternate keywords whose names begin and end with @samp{__}.  Pedantic
2494 warnings are also disabled in the expression that follows
2495 @code{__extension__}.  However, only system header files should use
2496 these escape routes; application programs should avoid them.
2497 @xref{Alternate Keywords}.
2498
2499 Some users try to use @option{-pedantic} to check programs for strict ISO
2500 C conformance.  They soon find that it does not do quite what they want:
2501 it finds some non-ISO practices, but not all---only those for which
2502 ISO C @emph{requires} a diagnostic, and some others for which
2503 diagnostics have been added.
2504
2505 A feature to report any failure to conform to ISO C might be useful in
2506 some instances, but would require considerable additional work and would
2507 be quite different from @option{-pedantic}.  We don't have plans to
2508 support such a feature in the near future.
2509
2510 Where the standard specified with @option{-std} represents a GNU
2511 extended dialect of C, such as @samp{gnu89} or @samp{gnu99}, there is a
2512 corresponding @dfn{base standard}, the version of ISO C on which the GNU
2513 extended dialect is based.  Warnings from @option{-pedantic} are given
2514 where they are required by the base standard.  (It would not make sense
2515 for such warnings to be given only for features not in the specified GNU
2516 C dialect, since by definition the GNU dialects of C include all
2517 features the compiler supports with the given option, and there would be
2518 nothing to warn about.)
2519
2520 @item -pedantic-errors
2521 @opindex pedantic-errors
2522 Like @option{-pedantic}, except that errors are produced rather than
2523 warnings.
2524
2525 @item -w
2526 @opindex w
2527 Inhibit all warning messages.
2528
2529 @item -Wno-import
2530 @opindex Wno-import
2531 Inhibit warning messages about the use of @samp{#import}.
2532
2533 @item -Wchar-subscripts
2534 @opindex Wchar-subscripts
2535 Warn if an array subscript has type @code{char}.  This is a common cause
2536 of error, as programmers often forget that this type is signed on some
2537 machines.
2538 This warning is enabled by @option{-Wall}.
2539
2540 @item -Wcomment
2541 @opindex Wcomment
2542 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
2543 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
2544 This warning is enabled by @option{-Wall}.
2545
2546 @item -Wfatal-errors
2547 @opindex Wfatal-errors
2548 This option causes the compiler to abort compilation on the first error
2549 occurred rather than trying to keep going and printing further error
2550 messages.
2551
2552 @item -Wformat
2553 @opindex Wformat
2554 @opindex ffreestanding
2555 @opindex fno-builtin
2556 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
2557 the arguments supplied have types appropriate to the format string
2558 specified, and that the conversions specified in the format string make
2559 sense.  This includes standard functions, and others specified by format
2560 attributes (@pxref{Function Attributes}), in the @code{printf},
2561 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
2562 not in the C standard) families (or other target-specific families).
2563 Which functions are checked without format attributes having been
2564 specified depends on the standard version selected, and such checks of
2565 functions without the attribute specified are disabled by
2566 @option{-ffreestanding} or @option{-fno-builtin}.
2567
2568 The formats are checked against the format features supported by GNU
2569 libc version 2.2.  These include all ISO C90 and C99 features, as well
2570 as features from the Single Unix Specification and some BSD and GNU
2571 extensions.  Other library implementations may not support all these
2572 features; GCC does not support warning about features that go beyond a
2573 particular library's limitations.  However, if @option{-pedantic} is used
2574 with @option{-Wformat}, warnings will be given about format features not
2575 in the selected standard version (but not for @code{strfmon} formats,
2576 since those are not in any version of the C standard).  @xref{C Dialect
2577 Options,,Options Controlling C Dialect}.
2578
2579 Since @option{-Wformat} also checks for null format arguments for
2580 several functions, @option{-Wformat} also implies @option{-Wnonnull}.
2581
2582 @option{-Wformat} is included in @option{-Wall}.  For more control over some
2583 aspects of format checking, the options @option{-Wformat-y2k},
2584 @option{-Wno-format-extra-args}, @option{-Wno-format-zero-length},
2585 @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
2586 @option{-Wformat=2} are available, but are not included in @option{-Wall}.
2587
2588 @item -Wformat-y2k
2589 @opindex Wformat-y2k
2590 If @option{-Wformat} is specified, also warn about @code{strftime}
2591 formats which may yield only a two-digit year.
2592
2593 @item -Wno-format-extra-args
2594 @opindex Wno-format-extra-args
2595 If @option{-Wformat} is specified, do not warn about excess arguments to a
2596 @code{printf} or @code{scanf} format function.  The C standard specifies
2597 that such arguments are ignored.
2598
2599 Where the unused arguments lie between used arguments that are
2600 specified with @samp{$} operand number specifications, normally
2601 warnings are still given, since the implementation could not know what
2602 type to pass to @code{va_arg} to skip the unused arguments.  However,
2603 in the case of @code{scanf} formats, this option will suppress the
2604 warning if the unused arguments are all pointers, since the Single
2605 Unix Specification says that such unused arguments are allowed.
2606
2607 @item -Wno-format-zero-length
2608 @opindex Wno-format-zero-length
2609 If @option{-Wformat} is specified, do not warn about zero-length formats.
2610 The C standard specifies that zero-length formats are allowed.
2611
2612 @item -Wformat-nonliteral
2613 @opindex Wformat-nonliteral
2614 If @option{-Wformat} is specified, also warn if the format string is not a
2615 string literal and so cannot be checked, unless the format function
2616 takes its format arguments as a @code{va_list}.
2617
2618 @item -Wformat-security
2619 @opindex Wformat-security
2620 If @option{-Wformat} is specified, also warn about uses of format
2621 functions that represent possible security problems.  At present, this
2622 warns about calls to @code{printf} and @code{scanf} functions where the
2623 format string is not a string literal and there are no format arguments,
2624 as in @code{printf (foo);}.  This may be a security hole if the format
2625 string came from untrusted input and contains @samp{%n}.  (This is
2626 currently a subset of what @option{-Wformat-nonliteral} warns about, but
2627 in future warnings may be added to @option{-Wformat-security} that are not
2628 included in @option{-Wformat-nonliteral}.)
2629
2630 @item -Wformat=2
2631 @opindex Wformat=2
2632 Enable @option{-Wformat} plus format checks not included in
2633 @option{-Wformat}.  Currently equivalent to @samp{-Wformat
2634 -Wformat-nonliteral -Wformat-security -Wformat-y2k}.
2635
2636 @item -Wnonnull
2637 @opindex Wnonnull
2638 Warn about passing a null pointer for arguments marked as
2639 requiring a non-null value by the @code{nonnull} function attribute.
2640
2641 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
2642 can be disabled with the @option{-Wno-nonnull} option.
2643
2644 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
2645 @opindex Winit-self
2646 Warn about uninitialized variables which are initialized with themselves.
2647 Note this option can only be used with the @option{-Wuninitialized} option,
2648 which in turn only works with @option{-O1} and above.
2649
2650 For example, GCC will warn about @code{i} being uninitialized in the
2651 following snippet only when @option{-Winit-self} has been specified:
2652 @smallexample
2653 @group
2654 int f()
2655 @{
2656   int i = i;
2657   return i;
2658 @}
2659 @end group
2660 @end smallexample
2661
2662 @item -Wimplicit-int
2663 @opindex Wimplicit-int
2664 Warn when a declaration does not specify a type.
2665 This warning is enabled by @option{-Wall}.
2666
2667 @item -Wimplicit-function-declaration
2668 @opindex Wimplicit-function-declaration
2669 @opindex Wno-implicit-function-declaration
2670 Give a warning whenever a function is used before being declared. In
2671 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
2672 enabled by default and it is made into an error by
2673 @option{-pedantic-errors}. This warning is also enabled by
2674 @option{-Wall}.
2675
2676 @item -Wimplicit
2677 @opindex Wimplicit
2678 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
2679 This warning is enabled by @option{-Wall}.
2680
2681 @item -Wmain
2682 @opindex Wmain
2683 Warn if the type of @samp{main} is suspicious.  @samp{main} should be a
2684 function with external linkage, returning int, taking either zero
2685 arguments, two, or three arguments of appropriate types.
2686 This warning is enabled by @option{-Wall}.
2687
2688 @item -Wmissing-braces
2689 @opindex Wmissing-braces
2690 Warn if an aggregate or union initializer is not fully bracketed.  In
2691 the following example, the initializer for @samp{a} is not fully
2692 bracketed, but that for @samp{b} is fully bracketed.
2693
2694 @smallexample
2695 int a[2][2] = @{ 0, 1, 2, 3 @};
2696 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
2697 @end smallexample
2698
2699 This warning is enabled by @option{-Wall}.
2700
2701 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
2702 @opindex Wmissing-include-dirs
2703 Warn if a user-supplied include directory does not exist.
2704
2705 @item -Wparentheses
2706 @opindex Wparentheses
2707 Warn if parentheses are omitted in certain contexts, such
2708 as when there is an assignment in a context where a truth value
2709 is expected, or when operators are nested whose precedence people
2710 often get confused about.
2711
2712 Also warn if a comparison like @samp{x<=y<=z} appears; this is
2713 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
2714 interpretation from that of ordinary mathematical notation.
2715
2716 Also warn about constructions where there may be confusion to which
2717 @code{if} statement an @code{else} branch belongs.  Here is an example of
2718 such a case:
2719
2720 @smallexample
2721 @group
2722 @{
2723   if (a)
2724     if (b)
2725       foo ();
2726   else
2727     bar ();
2728 @}
2729 @end group
2730 @end smallexample
2731
2732 In C/C++, every @code{else} branch belongs to the innermost possible
2733 @code{if} statement, which in this example is @code{if (b)}.  This is
2734 often not what the programmer expected, as illustrated in the above
2735 example by indentation the programmer chose.  When there is the
2736 potential for this confusion, GCC will issue a warning when this flag
2737 is specified.  To eliminate the warning, add explicit braces around
2738 the innermost @code{if} statement so there is no way the @code{else}
2739 could belong to the enclosing @code{if}.  The resulting code would
2740 look like this:
2741
2742 @smallexample
2743 @group
2744 @{
2745   if (a)
2746     @{
2747       if (b)
2748         foo ();
2749       else
2750         bar ();
2751     @}
2752 @}
2753 @end group
2754 @end smallexample
2755
2756 This warning is enabled by @option{-Wall}.
2757
2758 @item -Wsequence-point
2759 @opindex Wsequence-point
2760 Warn about code that may have undefined semantics because of violations
2761 of sequence point rules in the C and C++ standards.
2762
2763 The C and C++ standards defines the order in which expressions in a C/C++
2764 program are evaluated in terms of @dfn{sequence points}, which represent
2765 a partial ordering between the execution of parts of the program: those
2766 executed before the sequence point, and those executed after it.  These
2767 occur after the evaluation of a full expression (one which is not part
2768 of a larger expression), after the evaluation of the first operand of a
2769 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
2770 function is called (but after the evaluation of its arguments and the
2771 expression denoting the called function), and in certain other places.
2772 Other than as expressed by the sequence point rules, the order of
2773 evaluation of subexpressions of an expression is not specified.  All
2774 these rules describe only a partial order rather than a total order,
2775 since, for example, if two functions are called within one expression
2776 with no sequence point between them, the order in which the functions
2777 are called is not specified.  However, the standards committee have
2778 ruled that function calls do not overlap.
2779
2780 It is not specified when between sequence points modifications to the
2781 values of objects take effect.  Programs whose behavior depends on this
2782 have undefined behavior; the C and C++ standards specify that ``Between
2783 the previous and next sequence point an object shall have its stored
2784 value modified at most once by the evaluation of an expression.
2785 Furthermore, the prior value shall be read only to determine the value
2786 to be stored.''.  If a program breaks these rules, the results on any
2787 particular implementation are entirely unpredictable.
2788
2789 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
2790 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
2791 diagnosed by this option, and it may give an occasional false positive
2792 result, but in general it has been found fairly effective at detecting
2793 this sort of problem in programs.
2794
2795 The standard is worded confusingly, therefore there is some debate
2796 over the precise meaning of the sequence point rules in subtle cases.
2797 Links to discussions of the problem, including proposed formal
2798 definitions, may be found on the GCC readings page, at
2799 @w{@uref{http://gcc.gnu.org/readings.html}}.
2800
2801 This warning is enabled by @option{-Wall} for C and C++.
2802
2803 @item -Wreturn-type
2804 @opindex Wreturn-type
2805 Warn whenever a function is defined with a return-type that defaults to
2806 @code{int}.  Also warn about any @code{return} statement with no
2807 return-value in a function whose return-type is not @code{void}.
2808
2809 Also warn if the return type of a function has a type qualifier
2810 such as @code{const}.  For ISO C such a type qualifier has no effect,
2811 since the value returned by a function is not an lvalue.
2812 For C++, the warning is only emitted for scalar types or @code{void}.
2813 ISO C prohibits qualified @code{void} return types on function
2814 definitions, so such return types always receive a warning
2815 even without this option.
2816
2817 For C++, a function without return type always produces a diagnostic
2818 message, even when @option{-Wno-return-type} is specified.  The only
2819 exceptions are @samp{main} and functions defined in system headers.
2820
2821 This warning is enabled by @option{-Wall}.
2822
2823 @item -Wswitch
2824 @opindex Wswitch
2825 Warn whenever a @code{switch} statement has an index of enumerated type
2826 and lacks a @code{case} for one or more of the named codes of that
2827 enumeration.  (The presence of a @code{default} label prevents this
2828 warning.)  @code{case} labels outside the enumeration range also
2829 provoke warnings when this option is used.
2830 This warning is enabled by @option{-Wall}.
2831
2832 @item -Wswitch-default
2833 @opindex Wswitch-switch
2834 Warn whenever a @code{switch} statement does not have a @code{default}
2835 case.
2836
2837 @item -Wswitch-enum
2838 @opindex Wswitch-enum
2839 Warn whenever a @code{switch} statement has an index of enumerated type
2840 and lacks a @code{case} for one or more of the named codes of that
2841 enumeration.  @code{case} labels outside the enumeration range also
2842 provoke warnings when this option is used.
2843
2844 @item -Wtrigraphs
2845 @opindex Wtrigraphs
2846 Warn if any trigraphs are encountered that might change the meaning of
2847 the program (trigraphs within comments are not warned about).
2848 This warning is enabled by @option{-Wall}.
2849
2850 @item -Wunused-function
2851 @opindex Wunused-function
2852 Warn whenever a static function is declared but not defined or a
2853 non-inline static function is unused.
2854 This warning is enabled by @option{-Wall}.
2855
2856 @item -Wunused-label
2857 @opindex Wunused-label
2858 Warn whenever a label is declared but not used.
2859 This warning is enabled by @option{-Wall}.
2860
2861 To suppress this warning use the @samp{unused} attribute
2862 (@pxref{Variable Attributes}).
2863
2864 @item -Wunused-parameter
2865 @opindex Wunused-parameter
2866 Warn whenever a function parameter is unused aside from its declaration.
2867
2868 To suppress this warning use the @samp{unused} attribute
2869 (@pxref{Variable Attributes}).
2870
2871 @item -Wunused-variable
2872 @opindex Wunused-variable
2873 Warn whenever a local variable or non-constant static variable is unused
2874 aside from its declaration.
2875 This warning is enabled by @option{-Wall}.
2876
2877 To suppress this warning use the @samp{unused} attribute
2878 (@pxref{Variable Attributes}).
2879
2880 @item -Wunused-value
2881 @opindex Wunused-value
2882 Warn whenever a statement computes a result that is explicitly not
2883 used. To suppress this warning cast the unused expression to
2884 @samp{void}. This includes an expression-statement or the left-hand
2885 side of a comma expression that contains no side effects. For example,
2886 an expression such as @samp{x[i,j]} will cause a warning, while
2887 @samp{x[(void)i,j]} will not.
2888
2889 This warning is enabled by @option{-Wall}.
2890
2891 @item -Wunused
2892 @opindex Wunused
2893 All the above @option{-Wunused} options combined.
2894
2895 In order to get a warning about an unused function parameter, you must
2896 either specify @samp{-Wextra -Wunused} (note that @samp{-Wall} implies
2897 @samp{-Wunused}), or separately specify @option{-Wunused-parameter}.
2898
2899 @item -Wuninitialized
2900 @opindex Wuninitialized
2901 Warn if an automatic variable is used without first being initialized or
2902 if a variable may be clobbered by a @code{setjmp} call.
2903
2904 These warnings are possible only in optimizing compilation,
2905 because they require data flow information that is computed only
2906 when optimizing.  If you do not specify @option{-O}, you will not get
2907 these warnings. Instead, GCC will issue a warning about @option{-Wuninitialized}
2908 requiring @option{-O}.
2909
2910 If you want to warn about code which uses the uninitialized value of the
2911 variable in its own initializer, use the @option{-Winit-self} option.
2912
2913 These warnings occur for individual uninitialized or clobbered
2914 elements of structure, union or array variables as well as for
2915 variables which are uninitialized or clobbered as a whole.  They do
2916 not occur for variables or elements declared @code{volatile}.  Because
2917 these warnings depend on optimization, the exact variables or elements
2918 for which there are warnings will depend on the precise optimization
2919 options and version of GCC used.
2920
2921 Note that there may be no warning about a variable that is used only
2922 to compute a value that itself is never used, because such
2923 computations may be deleted by data flow analysis before the warnings
2924 are printed.
2925
2926 These warnings are made optional because GCC is not smart
2927 enough to see all the reasons why the code might be correct
2928 despite appearing to have an error.  Here is one example of how
2929 this can happen:
2930
2931 @smallexample
2932 @group
2933 @{
2934   int x;
2935   switch (y)
2936     @{
2937     case 1: x = 1;
2938       break;
2939     case 2: x = 4;
2940       break;
2941     case 3: x = 5;
2942     @}
2943   foo (x);
2944 @}
2945 @end group
2946 @end smallexample
2947
2948 @noindent
2949 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
2950 always initialized, but GCC doesn't know this.  Here is
2951 another common case:
2952
2953 @smallexample
2954 @{
2955   int save_y;
2956   if (change_y) save_y = y, y = new_y;
2957   @dots{}
2958   if (change_y) y = save_y;
2959 @}
2960 @end smallexample
2961
2962 @noindent
2963 This has no bug because @code{save_y} is used only if it is set.
2964
2965 @cindex @code{longjmp} warnings
2966 This option also warns when a non-volatile automatic variable might be
2967 changed by a call to @code{longjmp}.  These warnings as well are possible
2968 only in optimizing compilation.
2969
2970 The compiler sees only the calls to @code{setjmp}.  It cannot know
2971 where @code{longjmp} will be called; in fact, a signal handler could
2972 call it at any point in the code.  As a result, you may get a warning
2973 even when there is in fact no problem because @code{longjmp} cannot
2974 in fact be called at the place which would cause a problem.
2975
2976 Some spurious warnings can be avoided if you declare all the functions
2977 you use that never return as @code{noreturn}.  @xref{Function
2978 Attributes}.
2979
2980 This warning is enabled by @option{-Wall}.
2981
2982 @item -Wunknown-pragmas
2983 @opindex Wunknown-pragmas
2984 @cindex warning for unknown pragmas
2985 @cindex unknown pragmas, warning
2986 @cindex pragmas, warning of unknown
2987 Warn when a #pragma directive is encountered which is not understood by
2988 GCC@.  If this command line option is used, warnings will even be issued
2989 for unknown pragmas in system header files.  This is not the case if
2990 the warnings were only enabled by the @option{-Wall} command line option.
2991
2992 @item -Wno-pragmas
2993 @opindex Wno-pragmas
2994 @opindex Wpragmas
2995 Do not warn about misuses of pragmas, such as incorrect parameters,
2996 invalid syntax, or conflicts between pragmas.  See also
2997 @samp{-Wunknown-pragmas}.
2998
2999 @item -Wstrict-aliasing
3000 @opindex Wstrict-aliasing
3001 This option is only active when @option{-fstrict-aliasing} is active.
3002 It warns about code which might break the strict aliasing rules that the
3003 compiler is using for optimization.  The warning does not catch all
3004 cases, but does attempt to catch the more common pitfalls.  It is
3005 included in @option{-Wall}.
3006
3007 @item -Wstrict-aliasing=2
3008 @opindex Wstrict-aliasing=2
3009 This option is only active when @option{-fstrict-aliasing} is active.
3010 It warns about code which might break the strict aliasing rules that the
3011 compiler is using for optimization.  This warning catches more cases than
3012 @option{-Wstrict-aliasing}, but it will also give a warning for some ambiguous
3013 cases that are safe.
3014
3015 @item -Wstrict-overflow
3016 @item -Wstrict-overflow=@var{n}
3017 @opindex -Wstrict-overflow
3018 This option is only active when @option{-fstrict-overflow} is active.
3019 It warns about cases where the compiler optimizes based on the
3020 assumption that signed overflow does not occur.  Note that it does not
3021 warn about all cases where the code might overflow: it only warns
3022 about cases where the compiler implements some optimization.  Thus
3023 this warning depends on the optimization level.
3024
3025 An optimization which assumes that signed overflow does not occur is
3026 perfectly safe if the values of the variables involved are such that
3027 overflow never does, in fact, occur.  Therefore this warning can
3028 easily give a false positive: a warning about code which is not
3029 actually a problem.  To help focus on important issues, several
3030 warning levels are defined.
3031
3032 @table @option
3033 @item -Wstrict-overflow=1
3034 Warn about cases which are both questionable and easy to avoid.  For
3035 example: @code{x + 1 > x}; with @option{-fstrict-overflow}, the
3036 compiler will simplify this to @code{1}.  This level of
3037 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
3038 are not, and must be explicitly requested.
3039
3040 @item -Wstrict-overflow=2
3041 Also warn about other cases where a comparison is simplified to a
3042 constant.  For example: @code{abs (x) >= 0}.  This can only be
3043 simplified when @option{-fstrict-overflow} is in effect, because
3044 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
3045 zero.  @option{-Wstrict-overflow} (with no level) is the same as
3046 @option{-Wstrict-overflow=2}.
3047
3048 @item -Wstrict-overflow=3
3049 Also warn about other cases where a comparison is simplified.  For
3050 example: @code{x + 1 > 1} will be simplified to @code{x > 0}.
3051
3052 @item -Wstrict-overflow=4
3053 Also warn about other simplifications not covered by the above cases.
3054 For example: @code{(x * 10) / 5} will be simplified to @code{x * 2}.
3055
3056 @item -Wstrict-overflow=5
3057 Also warn about cases where the compiler reduces the magnitude of a
3058 constant involved in a comparison.  For example: @code{x + 2 > y} will
3059 be simplified to @code{x + 1 >= y}.  This is reported only at the
3060 highest warning level because this simplification applies to many
3061 comparisons, so this warning level will give a very large number of
3062 false positives.
3063 @end table
3064
3065 @item -Warray-bounds
3066 @opindex Wno-array-bounds
3067 @opindex Warray-bounds
3068 This option is only active when @option{-ftree-vrp} is active
3069 (default for -O2 and above). It warns about subscripts to arrays
3070 that are always out of bounds. This warning is enabled by @option{-Wall}.
3071
3072 @item -Wall
3073 @opindex Wall
3074 All of the above @samp{-W} options combined.  This enables all the
3075 warnings about constructions that some users consider questionable, and
3076 that are easy to avoid (or modify to prevent the warning), even in
3077 conjunction with macros.  This also enables some language-specific
3078 warnings described in @ref{C++ Dialect Options} and
3079 @ref{Objective-C and Objective-C++ Dialect Options}.
3080 @end table
3081
3082 The following @option{-W@dots{}} options are not implied by @option{-Wall}.
3083 Some of them warn about constructions that users generally do not
3084 consider questionable, but which occasionally you might wish to check
3085 for; others warn about constructions that are necessary or hard to avoid
3086 in some cases, and there is no simple way to modify the code to suppress
3087 the warning.
3088
3089 @table @gcctabopt
3090 @item -Wextra
3091 @opindex W
3092 @opindex Wextra
3093 (This option used to be called @option{-W}.  The older name is still
3094 supported, but the newer name is more descriptive.)  Print extra warning
3095 messages for these events:
3096
3097 @itemize @bullet
3098 @item
3099 A function can return either with or without a value.  (Falling
3100 off the end of the function body is considered returning without
3101 a value.)  For example, this function would evoke such a
3102 warning:
3103
3104 @smallexample
3105 @group
3106 foo (a)
3107 @{
3108   if (a > 0)
3109     return a;
3110 @}
3111 @end group
3112 @end smallexample
3113
3114 @item
3115 An unsigned value is compared against zero with @samp{<} or @samp{>=}.
3116
3117 @item @r{(C only)}
3118 Storage-class specifiers like @code{static} are not the first things
3119 in a declaration.  According to the C Standard, this usage is
3120 obsolescent.  This warning can be independently controlled by
3121 @option{-Wold-style-declaration}.
3122
3123 @item
3124 If @option{-Wall} or @option{-Wunused} is also specified, warn about unused
3125 arguments.
3126
3127 @item
3128 A comparison between signed and unsigned values could produce an
3129 incorrect result when the signed value is converted to unsigned.
3130 (But don't warn if @option{-Wno-sign-compare} is also specified.)
3131
3132 @item
3133 An aggregate has an initializer which does not initialize all members.
3134 This warning can be independently controlled by
3135 @option{-Wmissing-field-initializers}.
3136
3137 @item
3138 An initialized field without side effects is overridden when using
3139 designated initializers (@pxref{Designated Inits, , Designated
3140 Initializers}).  This warning can be independently controlled by
3141 @option{-Woverride-init}.
3142
3143 @item @r{(C only)}
3144 A function parameter is declared without a type specifier in K&R-style
3145 functions.  This warning can be independently controlled by
3146 @option{-Wmissing-parameter-type}.
3147
3148 @item
3149 An empty body occurs in an @samp{if}, @samp{else} or
3150 @samp{do while} statement. This warning can be independently
3151 controlled by @option{-Wempty-body}.
3152
3153 @item
3154 A pointer is compared against integer zero with @samp{<}, @samp{<=},
3155 @samp{>}, or @samp{>=}.
3156
3157 @item
3158 A variable might be changed by @samp{longjmp} or @samp{vfork}.
3159 This warning can be independently controlled by @option{-Wclobbered}.
3160
3161 @item @r{(C++ only)}
3162 An enumerator and a non-enumerator both appear in a conditional expression.
3163
3164 @item @r{(C++ only)}
3165 A non-static reference or non-static @samp{const} member appears in a
3166 class without constructors.
3167
3168 @item @r{(C++ only)}
3169 Ambiguous virtual bases.
3170
3171 @item @r{(C++ only)}
3172 Subscripting an array which has been declared @samp{register}.
3173
3174 @item @r{(C++ only)}
3175 Taking the address of a variable which has been declared @samp{register}.
3176
3177 @item @r{(C++ only)}
3178 A base class is not initialized in a derived class' copy constructor.
3179 @end itemize
3180
3181 @item -Wno-div-by-zero
3182 @opindex Wno-div-by-zero
3183 @opindex Wdiv-by-zero
3184 Do not warn about compile-time integer division by zero.  Floating point
3185 division by zero is not warned about, as it can be a legitimate way of
3186 obtaining infinities and NaNs.
3187
3188 @item -Wsystem-headers
3189 @opindex Wsystem-headers
3190 @cindex warnings from system headers
3191 @cindex system headers, warnings from
3192 Print warning messages for constructs found in system header files.
3193 Warnings from system headers are normally suppressed, on the assumption
3194 that they usually do not indicate real problems and would only make the
3195 compiler output harder to read.  Using this command line option tells
3196 GCC to emit warnings from system headers as if they occurred in user
3197 code.  However, note that using @option{-Wall} in conjunction with this
3198 option will @emph{not} warn about unknown pragmas in system
3199 headers---for that, @option{-Wunknown-pragmas} must also be used.
3200
3201 @item -Wfloat-equal
3202 @opindex Wfloat-equal
3203 Warn if floating point values are used in equality comparisons.
3204
3205 The idea behind this is that sometimes it is convenient (for the
3206 programmer) to consider floating-point values as approximations to
3207 infinitely precise real numbers.  If you are doing this, then you need
3208 to compute (by analyzing the code, or in some other way) the maximum or
3209 likely maximum error that the computation introduces, and allow for it
3210 when performing comparisons (and when producing output, but that's a
3211 different problem).  In particular, instead of testing for equality, you
3212 would check to see whether the two values have ranges that overlap; and
3213 this is done with the relational operators, so equality comparisons are
3214 probably mistaken.
3215
3216 @item -Wtraditional @r{(C only)}
3217 @opindex Wtraditional
3218 Warn about certain constructs that behave differently in traditional and
3219 ISO C@.  Also warn about ISO C constructs that have no traditional C
3220 equivalent, and/or problematic constructs which should be avoided.
3221
3222 @itemize @bullet
3223 @item
3224 Macro parameters that appear within string literals in the macro body.
3225 In traditional C macro replacement takes place within string literals,
3226 but does not in ISO C@.
3227
3228 @item
3229 In traditional C, some preprocessor directives did not exist.
3230 Traditional preprocessors would only consider a line to be a directive
3231 if the @samp{#} appeared in column 1 on the line.  Therefore
3232 @option{-Wtraditional} warns about directives that traditional C
3233 understands but would ignore because the @samp{#} does not appear as the
3234 first character on the line.  It also suggests you hide directives like
3235 @samp{#pragma} not understood by traditional C by indenting them.  Some
3236 traditional implementations would not recognize @samp{#elif}, so it
3237 suggests avoiding it altogether.
3238
3239 @item
3240 A function-like macro that appears without arguments.
3241
3242 @item
3243 The unary plus operator.
3244
3245 @item
3246 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating point
3247 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
3248 constants.)  Note, these suffixes appear in macros defined in the system
3249 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
3250 Use of these macros in user code might normally lead to spurious
3251 warnings, however GCC's integrated preprocessor has enough context to
3252 avoid warning in these cases.
3253
3254 @item
3255 A function declared external in one block and then used after the end of
3256 the block.
3257
3258 @item
3259 A @code{switch} statement has an operand of type @code{long}.
3260
3261 @item
3262 A non-@code{static} function declaration follows a @code{static} one.
3263 This construct is not accepted by some traditional C compilers.
3264
3265 @item
3266 The ISO type of an integer constant has a different width or
3267 signedness from its traditional type.  This warning is only issued if
3268 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
3269 typically represent bit patterns, are not warned about.
3270
3271 @item
3272 Usage of ISO string concatenation is detected.
3273
3274 @item
3275 Initialization of automatic aggregates.
3276
3277 @item
3278 Identifier conflicts with labels.  Traditional C lacks a separate
3279 namespace for labels.
3280
3281 @item
3282 Initialization of unions.  If the initializer is zero, the warning is
3283 omitted.  This is done under the assumption that the zero initializer in
3284 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
3285 initializer warnings and relies on default initialization to zero in the
3286 traditional C case.
3287
3288 @item
3289 Conversions by prototypes between fixed/floating point values and vice
3290 versa.  The absence of these prototypes when compiling with traditional
3291 C would cause serious problems.  This is a subset of the possible
3292 conversion warnings, for the full set use @option{-Wtraditional-conversion}.
3293
3294 @item
3295 Use of ISO C style function definitions.  This warning intentionally is
3296 @emph{not} issued for prototype declarations or variadic functions
3297 because these ISO C features will appear in your code when using
3298 libiberty's traditional C compatibility macros, @code{PARAMS} and
3299 @code{VPARAMS}.  This warning is also bypassed for nested functions
3300 because that feature is already a GCC extension and thus not relevant to
3301 traditional C compatibility.
3302 @end itemize
3303
3304 @item -Wtraditional-conversion @r{(C only)}
3305 @opindex Wtraditional-conversion
3306 Warn if a prototype causes a type conversion that is different from what
3307 would happen to the same argument in the absence of a prototype.  This
3308 includes conversions of fixed point to floating and vice versa, and
3309 conversions changing the width or signedness of a fixed point argument
3310 except when the same as the default promotion.
3311
3312 @item -Wdeclaration-after-statement @r{(C only)}
3313 @opindex Wdeclaration-after-statement
3314 Warn when a declaration is found after a statement in a block.  This
3315 construct, known from C++, was introduced with ISO C99 and is by default
3316 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
3317 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
3318
3319 @item -Wundef
3320 @opindex Wundef
3321 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
3322
3323 @item -Wno-endif-labels
3324 @opindex Wno-endif-labels
3325 @opindex Wendif-labels
3326 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
3327
3328 @item -Wshadow
3329 @opindex Wshadow
3330 Warn whenever a local variable shadows another local variable, parameter or
3331 global variable or whenever a built-in function is shadowed.
3332
3333 @item -Wlarger-than-@var{len}
3334 @opindex Wlarger-than
3335 Warn whenever an object of larger than @var{len} bytes is defined.
3336
3337 @item -Wunsafe-loop-optimizations
3338 @opindex Wunsafe-loop-optimizations
3339 Warn if the loop cannot be optimized because the compiler could not
3340 assume anything on the bounds of the loop indices.  With
3341 @option{-funsafe-loop-optimizations} warn if the compiler made
3342 such assumptions.
3343
3344 @item -Wpointer-arith
3345 @opindex Wpointer-arith
3346 Warn about anything that depends on the ``size of'' a function type or
3347 of @code{void}.  GNU C assigns these types a size of 1, for
3348 convenience in calculations with @code{void *} pointers and pointers
3349 to functions.  In C++, warn also when an arithmetic operation involves
3350 @code{NULL}.  This warning is also enabled by @option{-pedantic}.
3351
3352 @item -Wbad-function-cast @r{(C only)}
3353 @opindex Wbad-function-cast
3354 Warn whenever a function call is cast to a non-matching type.
3355 For example, warn if @code{int malloc()} is cast to @code{anything *}.
3356
3357 @item -Wc++-compat
3358 Warn about ISO C constructs that are outside of the common subset of
3359 ISO C and ISO C++, e.g.@: request for implicit conversion from
3360 @code{void *} to a pointer to non-@code{void} type.
3361
3362 @item -Wc++0x-compat @r{(C++ and Objective-C++ only)}
3363 Warn about C++ constructs whose meaning differs between ISO C++ 1998 and
3364 ISO C++ 200x, e.g., identifiers in ISO C++ 1998 that will become keywords
3365 in ISO C++ 200x.  This warning is enabled by @option{-Wall}.
3366
3367 @item -Wcast-qual
3368 @opindex Wcast-qual
3369 Warn whenever a pointer is cast so as to remove a type qualifier from
3370 the target type.  For example, warn if a @code{const char *} is cast
3371 to an ordinary @code{char *}.
3372
3373 @item -Wcast-align
3374 @opindex Wcast-align
3375 Warn whenever a pointer is cast such that the required alignment of the
3376 target is increased.  For example, warn if a @code{char *} is cast to
3377 an @code{int *} on machines where integers can only be accessed at
3378 two- or four-byte boundaries.
3379
3380 @item -Wwrite-strings
3381 @opindex Wwrite-strings
3382 When compiling C, give string constants the type @code{const
3383 char[@var{length}]} so that
3384 copying the address of one into a non-@code{const} @code{char *}
3385 pointer will get a warning; when compiling C++, warn about the
3386 deprecated conversion from string literals to @code{char *}.  This
3387 warning, by default, is enabled for C++ programs.
3388 These warnings will help you find at
3389 compile time code that can try to write into a string constant, but
3390 only if you have been very careful about using @code{const} in
3391 declarations and prototypes.  Otherwise, it will just be a nuisance;
3392 this is why we did not make @option{-Wall} request these warnings.
3393
3394 @item -Wclobbered
3395 @opindex Wclobbered
3396 Warn for variables that might be changed by @samp{longjmp} or
3397 @samp{vfork}.  This warning is also enabled by @option{-Wextra}.
3398
3399 @item -Wconversion
3400 @opindex Wconversion
3401 Warn for implicit conversions that may alter a value. This includes
3402 conversions between real and integer, like @code{abs (x)} when
3403 @code{x} is @code{double}; conversions between signed and unsigned,
3404 like @code{unsigned ui = -1}; and conversions to smaller types, like
3405 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
3406 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
3407 changed by the conversion like in @code{abs (2.0)}.
3408
3409 For C++, also warn for conversions between @code{NULL} and non-pointer
3410 types; confusing overload resolution for user-defined conversions; and
3411 conversions that will never use a type conversion operator:
3412 conversions to @code{void}, the same type, a base class or a reference
3413 to them.
3414
3415 @item -Wempty-body
3416 @opindex Wempty-body
3417 An empty body occurs in an @samp{if}, @samp{else} or @samp{do while}
3418 statement.  This warning is also enabled by @option{-Wextra}.
3419
3420 @item -Wsign-compare
3421 @opindex Wsign-compare
3422 @cindex warning for comparison of signed and unsigned values
3423 @cindex comparison of signed and unsigned values, warning
3424 @cindex signed and unsigned values, comparison warning
3425 Warn when a comparison between signed and unsigned values could produce
3426 an incorrect result when the signed value is converted to unsigned.
3427 This warning is also enabled by @option{-Wextra}; to get the other warnings
3428 of @option{-Wextra} without this warning, use @samp{-Wextra -Wno-sign-compare}.
3429
3430 @item -Waddress
3431 @opindex Waddress
3432 @opindex Wno-address
3433 Warn about suspicious uses of memory addresses. These include using
3434 the address of a function in a conditional expression, such as
3435 @code{void func(void); if (func)}, and comparisons against the memory
3436 address of a string literal, such as @code{if (x == "abc")}.  Such
3437 uses typically indicate a programmer error: the address of a function
3438 always evaluates to true, so their use in a conditional usually
3439 indicate that the programmer forgot the parentheses in a function
3440 call; and comparisons against string literals result in unspecified
3441 behavior and are not portable in C, so they usually indicate that the
3442 programmer intended to use @code{strcmp}.  This warning is enabled by
3443 @option{-Wall}.
3444
3445 @item -Wlogical-op
3446 @opindex Wlogical-op
3447 @opindex Wno-logical-op
3448 Warn about suspicious uses of logical operators in expressions.
3449 This includes using logical operators in contexts where a
3450 bit-wise operator is likely to be expected.
3451
3452 @item -Waggregate-return
3453 @opindex Waggregate-return
3454 Warn if any functions that return structures or unions are defined or
3455 called.  (In languages where you can return an array, this also elicits
3456 a warning.)
3457
3458 @item -Wno-attributes
3459 @opindex Wno-attributes
3460 @opindex Wattributes
3461 Do not warn if an unexpected @code{__attribute__} is used, such as
3462 unrecognized attributes, function attributes applied to variables,
3463 etc.  This will not stop errors for incorrect use of supported
3464 attributes.
3465
3466 @item -Wstrict-prototypes @r{(C only)}
3467 @opindex Wstrict-prototypes
3468 Warn if a function is declared or defined without specifying the
3469 argument types.  (An old-style function definition is permitted without
3470 a warning if preceded by a declaration which specifies the argument
3471 types.)
3472
3473 @item -Wold-style-declaration @r{(C only)}
3474 @opindex Wold-style-declaration
3475 Warn for obsolescent usages, according to the C Standard, in a
3476 declaration. For example, warn if storage-class specifiers like
3477 @code{static} are not the first things in a declaration.  This warning
3478 is also enabled by @option{-Wextra}.
3479
3480 @item -Wold-style-definition @r{(C only)}
3481 @opindex Wold-style-definition
3482 Warn if an old-style function definition is used.  A warning is given
3483 even if there is a previous prototype.
3484
3485 @item -Wmissing-parameter-type @r{(C only)}
3486 @opindex Wmissing-parameter-type
3487 A function parameter is declared without a type specifier in K&R-style
3488 functions:
3489
3490 @smallexample
3491 void foo(bar) @{ @}
3492 @end smallexample
3493
3494 This warning is also enabled by @option{-Wextra}.
3495
3496 @item -Wmissing-prototypes @r{(C only)}
3497 @opindex Wmissing-prototypes
3498 Warn if a global function is defined without a previous prototype
3499 declaration.  This warning is issued even if the definition itself
3500 provides a prototype.  The aim is to detect global functions that fail
3501 to be declared in header files.
3502
3503 @item -Wmissing-declarations @r{(C and C++ only)}
3504 @opindex Wmissing-declarations
3505 Warn if a global function is defined without a previous declaration.
3506 Do so even if the definition itself provides a prototype.
3507 Use this option to detect global functions that are not declared in
3508 header files.  In C++, no warnings are issued for function templates,
3509 or for inline functions, or for functions in anonymous namespaces.
3510
3511 @item -Wmissing-field-initializers
3512 @opindex Wmissing-field-initializers
3513 @opindex W
3514 @opindex Wextra
3515 Warn if a structure's initializer has some fields missing.  For
3516 example, the following code would cause such a warning, because
3517 @code{x.h} is implicitly zero:
3518
3519 @smallexample
3520 struct s @{ int f, g, h; @};
3521 struct s x = @{ 3, 4 @};
3522 @end smallexample
3523
3524 This option does not warn about designated initializers, so the following
3525 modification would not trigger a warning:
3526
3527 @smallexample
3528 struct s @{ int f, g, h; @};
3529 struct s x = @{ .f = 3, .g = 4 @};
3530 @end smallexample
3531
3532 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
3533 warnings without this one, use @samp{-Wextra -Wno-missing-field-initializers}.
3534
3535 @item -Wmissing-noreturn
3536 @opindex Wmissing-noreturn
3537 Warn about functions which might be candidates for attribute @code{noreturn}.
3538 Note these are only possible candidates, not absolute ones.  Care should
3539 be taken to manually verify functions actually do not ever return before
3540 adding the @code{noreturn} attribute, otherwise subtle code generation
3541 bugs could be introduced.  You will not get a warning for @code{main} in
3542 hosted C environments.
3543
3544 @item -Wmissing-format-attribute
3545 @opindex Wmissing-format-attribute
3546 @opindex Wformat
3547 Warn about function pointers which might be candidates for @code{format}
3548 attributes.  Note these are only possible candidates, not absolute ones.
3549 GCC will guess that function pointers with @code{format} attributes that
3550 are used in assignment, initialization, parameter passing or return
3551 statements should have a corresponding @code{format} attribute in the
3552 resulting type.  I.e.@: the left-hand side of the assignment or
3553 initialization, the type of the parameter variable, or the return type
3554 of the containing function respectively should also have a @code{format}
3555 attribute to avoid the warning.
3556
3557 GCC will also warn about function definitions which might be
3558 candidates for @code{format} attributes.  Again, these are only
3559 possible candidates.  GCC will guess that @code{format} attributes
3560 might be appropriate for any function that calls a function like
3561 @code{vprintf} or @code{vscanf}, but this might not always be the
3562 case, and some functions for which @code{format} attributes are
3563 appropriate may not be detected.
3564
3565 @item -Wno-multichar
3566 @opindex Wno-multichar
3567 @opindex Wmultichar
3568 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
3569 Usually they indicate a typo in the user's code, as they have
3570 implementation-defined values, and should not be used in portable code.
3571
3572 @item -Wnormalized=<none|id|nfc|nfkc>
3573 @opindex Wnormalized
3574 @cindex NFC
3575 @cindex NFKC
3576 @cindex character set, input normalization
3577 In ISO C and ISO C++, two identifiers are different if they are
3578 different sequences of characters.  However, sometimes when characters
3579 outside the basic ASCII character set are used, you can have two
3580 different character sequences that look the same.  To avoid confusion,
3581 the ISO 10646 standard sets out some @dfn{normalization rules} which
3582 when applied ensure that two sequences that look the same are turned into
3583 the same sequence.  GCC can warn you if you are using identifiers which
3584 have not been normalized; this option controls that warning.
3585
3586 There are four levels of warning that GCC supports.  The default is
3587 @option{-Wnormalized=nfc}, which warns about any identifier which is
3588 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
3589 recommended form for most uses.
3590
3591 Unfortunately, there are some characters which ISO C and ISO C++ allow
3592 in identifiers that when turned into NFC aren't allowable as
3593 identifiers.  That is, there's no way to use these symbols in portable
3594 ISO C or C++ and have all your identifiers in NFC.
3595 @option{-Wnormalized=id} suppresses the warning for these characters.
3596 It is hoped that future versions of the standards involved will correct
3597 this, which is why this option is not the default.
3598
3599 You can switch the warning off for all characters by writing
3600 @option{-Wnormalized=none}.  You would only want to do this if you
3601 were using some other normalization scheme (like ``D''), because
3602 otherwise you can easily create bugs that are literally impossible to see.
3603
3604 Some characters in ISO 10646 have distinct meanings but look identical
3605 in some fonts or display methodologies, especially once formatting has
3606 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
3607 LETTER N'', will display just like a regular @code{n} which has been
3608 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
3609 normalization scheme to convert all these into a standard form as
3610 well, and GCC will warn if your code is not in NFKC if you use
3611 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
3612 about every identifier that contains the letter O because it might be
3613 confused with the digit 0, and so is not the default, but may be
3614 useful as a local coding convention if the programming environment is
3615 unable to be fixed to display these characters distinctly.
3616
3617 @item -Wno-deprecated-declarations
3618 @opindex Wno-deprecated-declarations
3619 Do not warn about uses of functions (@pxref{Function Attributes}),
3620 variables (@pxref{Variable Attributes}), and types (@pxref{Type
3621 Attributes}) marked as deprecated by using the @code{deprecated}
3622 attribute.
3623
3624 @item -Wno-overflow
3625 @opindex Wno-overflow
3626 Do not warn about compile-time overflow in constant expressions.
3627
3628 @item -Woverride-init
3629 @opindex Woverride-init
3630 @opindex W
3631 @opindex Wextra
3632 Warn if an initialized field without side effects is overridden when
3633 using designated initializers (@pxref{Designated Inits, , Designated
3634 Initializers}).
3635
3636 This warning is included in @option{-Wextra}.  To get other
3637 @option{-Wextra} warnings without this one, use @samp{-Wextra
3638 -Wno-override-init}.
3639
3640 @item -Wpacked
3641 @opindex Wpacked
3642 Warn if a structure is given the packed attribute, but the packed
3643 attribute has no effect on the layout or size of the structure.
3644 Such structures may be mis-aligned for little benefit.  For
3645 instance, in this code, the variable @code{f.x} in @code{struct bar}
3646 will be misaligned even though @code{struct bar} does not itself
3647 have the packed attribute:
3648
3649 @smallexample
3650 @group
3651 struct foo @{
3652   int x;
3653   char a, b, c, d;
3654 @} __attribute__((packed));
3655 struct bar @{
3656   char z;
3657   struct foo f;
3658 @};
3659 @end group
3660 @end smallexample
3661
3662 @item -Wpadded
3663 @opindex Wpadded
3664 Warn if padding is included in a structure, either to align an element
3665 of the structure or to align the whole structure.  Sometimes when this
3666 happens it is possible to rearrange the fields of the structure to
3667 reduce the padding and so make the structure smaller.
3668
3669 @item -Wredundant-decls
3670 @opindex Wredundant-decls
3671 Warn if anything is declared more than once in the same scope, even in
3672 cases where multiple declaration is valid and changes nothing.
3673
3674 @item -Wnested-externs @r{(C only)}
3675 @opindex Wnested-externs
3676 Warn if an @code{extern} declaration is encountered within a function.
3677
3678 @item -Wunreachable-code
3679 @opindex Wunreachable-code
3680 Warn if the compiler detects that code will never be executed.
3681
3682 This option is intended to warn when the compiler detects that at
3683 least a whole line of source code will never be executed, because
3684 some condition is never satisfied or because it is after a
3685 procedure that never returns.
3686
3687 It is possible for this option to produce a warning even though there
3688 are circumstances under which part of the affected line can be executed,
3689 so care should be taken when removing apparently-unreachable code.
3690
3691 For instance, when a function is inlined, a warning may mean that the
3692 line is unreachable in only one inlined copy of the function.
3693
3694 This option is not made part of @option{-Wall} because in a debugging
3695 version of a program there is often substantial code which checks
3696 correct functioning of the program and is, hopefully, unreachable
3697 because the program does work.  Another common use of unreachable
3698 code is to provide behavior which is selectable at compile-time.
3699
3700 @item -Winline
3701 @opindex Winline
3702 Warn if a function can not be inlined and it was declared as inline.
3703 Even with this option, the compiler will not warn about failures to
3704 inline functions declared in system headers.
3705
3706 The compiler uses a variety of heuristics to determine whether or not
3707 to inline a function.  For example, the compiler takes into account
3708 the size of the function being inlined and the amount of inlining
3709 that has already been done in the current function.  Therefore,
3710 seemingly insignificant changes in the source program can cause the
3711 warnings produced by @option{-Winline} to appear or disappear.
3712
3713 @item -Wno-invalid-offsetof @r{(C++ only)}
3714 @opindex Wno-invalid-offsetof
3715 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
3716 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
3717 to a non-POD type is undefined.  In existing C++ implementations,
3718 however, @samp{offsetof} typically gives meaningful results even when
3719 applied to certain kinds of non-POD types. (Such as a simple
3720 @samp{struct} that fails to be a POD type only by virtue of having a
3721 constructor.)  This flag is for users who are aware that they are
3722 writing nonportable code and who have deliberately chosen to ignore the
3723 warning about it.
3724
3725 The restrictions on @samp{offsetof} may be relaxed in a future version
3726 of the C++ standard.
3727
3728 @item -Wno-int-to-pointer-cast @r{(C only)}
3729 @opindex Wno-int-to-pointer-cast
3730 Suppress warnings from casts to pointer type of an integer of a
3731 different size.
3732
3733 @item -Wno-pointer-to-int-cast @r{(C only)}
3734 @opindex Wno-pointer-to-int-cast
3735 Suppress warnings from casts from a pointer to an integer type of a
3736 different size.
3737
3738 @item -Winvalid-pch
3739 @opindex Winvalid-pch
3740 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
3741 the search path but can't be used.
3742
3743 @item -Wlong-long
3744 @opindex Wlong-long
3745 @opindex Wno-long-long
3746 Warn if @samp{long long} type is used.  This is default.  To inhibit
3747 the warning messages, use @option{-Wno-long-long}.  Flags
3748 @option{-Wlong-long} and @option{-Wno-long-long} are taken into account
3749 only when @option{-pedantic} flag is used.
3750
3751 @item -Wvariadic-macros
3752 @opindex Wvariadic-macros
3753 @opindex Wno-variadic-macros
3754 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
3755 alternate syntax when in pedantic ISO C99 mode.  This is default.
3756 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
3757
3758 @item -Wvla
3759 @opindex Wvla
3760 @opindex Wno-vla
3761 Warn if variable length array is used in the code.
3762 @option{-Wno-vla} will prevent the @option{-pedantic} warning of
3763 the variable length array.
3764
3765 @item -Wvolatile-register-var
3766 @opindex Wvolatile-register-var
3767 @opindex Wno-volatile-register-var
3768 Warn if a register variable is declared volatile.  The volatile
3769 modifier does not inhibit all optimizations that may eliminate reads
3770 and/or writes to register variables.
3771
3772 @item -Wdisabled-optimization
3773 @opindex Wdisabled-optimization
3774 Warn if a requested optimization pass is disabled.  This warning does
3775 not generally indicate that there is anything wrong with your code; it
3776 merely indicates that GCC's optimizers were unable to handle the code
3777 effectively.  Often, the problem is that your code is too big or too
3778 complex; GCC will refuse to optimize programs when the optimization
3779 itself is likely to take inordinate amounts of time.
3780
3781 @item -Wpointer-sign
3782 @opindex Wpointer-sign
3783 @opindex Wno-pointer-sign
3784 Warn for pointer argument passing or assignment with different signedness.
3785 This option is only supported for C and Objective-C@.  It is implied by
3786 @option{-Wall} and by @option{-pedantic}, which can be disabled with
3787 @option{-Wno-pointer-sign}.
3788
3789 @item -Werror
3790 @opindex Werror
3791 Make all warnings into errors.
3792
3793 @item -Werror=
3794 @opindex Werror=
3795 Make the specified warning into an errors.  The specifier for a
3796 warning is appended, for example @option{-Werror=switch} turns the
3797 warnings controlled by @option{-Wswitch} into errors.  This switch
3798 takes a negative form, to be used to negate @option{-Werror} for
3799 specific warnings, for example @option{-Wno-error=switch} makes
3800 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
3801 is in effect.  You can use the @option{-fdiagnostics-show-option}
3802 option to have each controllable warning amended with the option which
3803 controls it, to determine what to use with this option.
3804
3805 Note that specifying @option{-Werror=}@var{foo} automatically implies
3806 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
3807 imply anything.
3808
3809 @item -Wstack-protector
3810 @opindex Wstack-protector
3811 This option is only active when @option{-fstack-protector} is active.  It
3812 warns about functions that will not be protected against stack smashing.
3813
3814 @item -Woverlength-strings
3815 @opindex Woverlength-strings
3816 Warn about string constants which are longer than the ``minimum
3817 maximum'' length specified in the C standard.  Modern compilers
3818 generally allow string constants which are much longer than the
3819 standard's minimum limit, but very portable programs should avoid
3820 using longer strings.
3821
3822 The limit applies @emph{after} string constant concatenation, and does
3823 not count the trailing NUL@.  In C89, the limit was 509 characters; in
3824 C99, it was raised to 4095.  C++98 does not specify a normative
3825 minimum maximum, so we do not diagnose overlength strings in C++@.
3826
3827 This option is implied by @option{-pedantic}, and can be disabled with
3828 @option{-Wno-overlength-strings}.
3829 @end table
3830
3831 @node Debugging Options
3832 @section Options for Debugging Your Program or GCC
3833 @cindex options, debugging
3834 @cindex debugging information options
3835
3836 GCC has various special options that are used for debugging
3837 either your program or GCC:
3838
3839 @table @gcctabopt
3840 @item -g
3841 @opindex g
3842 Produce debugging information in the operating system's native format
3843 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
3844 information.
3845
3846 On most systems that use stabs format, @option{-g} enables use of extra
3847 debugging information that only GDB can use; this extra information
3848 makes debugging work better in GDB but will probably make other debuggers
3849 crash or
3850 refuse to read the program.  If you want to control for certain whether
3851 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
3852 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
3853
3854 GCC allows you to use @option{-g} with
3855 @option{-O}.  The shortcuts taken by optimized code may occasionally
3856 produce surprising results: some variables you declared may not exist
3857 at all; flow of control may briefly move where you did not expect it;
3858 some statements may not be executed because they compute constant
3859 results or their values were already at hand; some statements may
3860 execute in different places because they were moved out of loops.
3861
3862 Nevertheless it proves possible to debug optimized output.  This makes
3863 it reasonable to use the optimizer for programs that might have bugs.
3864
3865 The following options are useful when GCC is generated with the
3866 capability for more than one debugging format.
3867
3868 @item -ggdb
3869 @opindex ggdb
3870 Produce debugging information for use by GDB@.  This means to use the
3871 most expressive format available (DWARF 2, stabs, or the native format
3872 if neither of those are supported), including GDB extensions if at all
3873 possible.
3874
3875 @item -gstabs
3876 @opindex gstabs
3877 Produce debugging information in stabs format (if that is supported),
3878 without GDB extensions.  This is the format used by DBX on most BSD
3879 systems.  On MIPS, Alpha and System V Release 4 systems this option
3880 produces stabs debugging output which is not understood by DBX or SDB@.
3881 On System V Release 4 systems this option requires the GNU assembler.
3882
3883 @item -feliminate-unused-debug-symbols
3884 @opindex feliminate-unused-debug-symbols
3885 Produce debugging information in stabs format (if that is supported),
3886 for only symbols that are actually used.
3887
3888 @item -femit-class-debug-always
3889 Instead of emitting debugging information for a C++ class in only one
3890 object file, emit it in all object files using the class.  This option
3891 should be used only with debuggers that are unable to handle the way GCC
3892 normally emits debugging information for classes because using this
3893 option will increase the size of debugging information by as much as a
3894 factor of two.
3895
3896 @item -gstabs+
3897 @opindex gstabs+
3898 Produce debugging information in stabs format (if that is supported),
3899 using GNU extensions understood only by the GNU debugger (GDB)@.  The
3900 use of these extensions is likely to make other debuggers crash or
3901 refuse to read the program.
3902
3903 @item -gcoff
3904 @opindex gcoff
3905 Produce debugging information in COFF format (if that is supported).
3906 This is the format used by SDB on most System V systems prior to
3907 System V Release 4.
3908
3909 @item -gxcoff
3910 @opindex gxcoff
3911 Produce debugging information in XCOFF format (if that is supported).
3912 This is the format used by the DBX debugger on IBM RS/6000 systems.
3913
3914 @item -gxcoff+
3915 @opindex gxcoff+
3916 Produce debugging information in XCOFF format (if that is supported),
3917 using GNU extensions understood only by the GNU debugger (GDB)@.  The
3918 use of these extensions is likely to make other debuggers crash or
3919 refuse to read the program, and may cause assemblers other than the GNU
3920 assembler (GAS) to fail with an error.
3921
3922 @item -gdwarf-2
3923 @opindex gdwarf-2
3924 Produce debugging information in DWARF version 2 format (if that is
3925 supported).  This is the format used by DBX on IRIX 6.  With this
3926 option, GCC uses features of DWARF version 3 when they are useful;
3927 version 3 is upward compatible with version 2, but may still cause
3928 problems for older debuggers.
3929
3930 @item -gvms
3931 @opindex gvms
3932 Produce debugging information in VMS debug format (if that is
3933 supported).  This is the format used by DEBUG on VMS systems.
3934
3935 @item -g@var{level}
3936 @itemx -ggdb@var{level}
3937 @itemx -gstabs@var{level}
3938 @itemx -gcoff@var{level}
3939 @itemx -gxcoff@var{level}
3940 @itemx -gvms@var{level}
3941 Request debugging information and also use @var{level} to specify how
3942 much information.  The default level is 2.
3943
3944 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
3945 @option{-g}.
3946
3947 Level 1 produces minimal information, enough for making backtraces in
3948 parts of the program that you don't plan to debug.  This includes
3949 descriptions of functions and external variables, but no information
3950 about local variables and no line numbers.
3951
3952 Level 3 includes extra information, such as all the macro definitions
3953 present in the program.  Some debuggers support macro expansion when
3954 you use @option{-g3}.
3955
3956 @option{-gdwarf-2} does not accept a concatenated debug level, because
3957 GCC used to support an option @option{-gdwarf} that meant to generate
3958 debug information in version 1 of the DWARF format (which is very
3959 different from version 2), and it would have been too confusing.  That
3960 debug format is long obsolete, but the option cannot be changed now.
3961 Instead use an additional @option{-g@var{level}} option to change the
3962 debug level for DWARF2.
3963
3964 @item -feliminate-dwarf2-dups
3965 @opindex feliminate-dwarf2-dups
3966 Compress DWARF2 debugging information by eliminating duplicated
3967 information about each symbol.  This option only makes sense when
3968 generating DWARF2 debugging information with @option{-gdwarf-2}.
3969
3970 @cindex @command{prof}
3971 @item -p
3972 @opindex p
3973 Generate extra code to write profile information suitable for the
3974 analysis program @command{prof}.  You must use this option when compiling
3975 the source files you want data about, and you must also use it when
3976 linking.
3977
3978 @cindex @command{gprof}
3979 @item -pg
3980 @opindex pg
3981 Generate extra code to write profile information suitable for the
3982 analysis program @command{gprof}.  You must use this option when compiling
3983 the source files you want data about, and you must also use it when
3984 linking.
3985
3986 @item -Q
3987 @opindex Q
3988 Makes the compiler print out each function name as it is compiled, and
3989 print some statistics about each pass when it finishes.
3990
3991 @item -ftime-report
3992 @opindex ftime-report
3993 Makes the compiler print some statistics about the time consumed by each
3994 pass when it finishes.
3995
3996 @item -fmem-report
3997 @opindex fmem-report
3998 Makes the compiler print some statistics about permanent memory
3999 allocation when it finishes.
4000
4001 @item -fpre-ipa-mem-report
4002 @opindex fpre-ipa-mem-report
4003 @item -fpost-ipa-mem-report
4004 @opindex fpost-ipa-mem-report
4005 Makes the compiler print some statistics about permanent memory
4006 allocation before or after interprocedural optimization.
4007
4008 @item -fprofile-arcs
4009 @opindex fprofile-arcs
4010 Add code so that program flow @dfn{arcs} are instrumented.  During
4011 execution the program records how many times each branch and call is
4012 executed and how many times it is taken or returns.  When the compiled
4013 program exits it saves this data to a file called
4014 @file{@var{auxname}.gcda} for each source file.  The data may be used for
4015 profile-directed optimizations (@option{-fbranch-probabilities}), or for
4016 test coverage analysis (@option{-ftest-coverage}).  Each object file's
4017 @var{auxname} is generated from the name of the output file, if
4018 explicitly specified and it is not the final executable, otherwise it is
4019 the basename of the source file.  In both cases any suffix is removed
4020 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
4021 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
4022 @xref{Cross-profiling}.
4023
4024 @cindex @command{gcov}
4025 @item --coverage
4026 @opindex coverage
4027
4028 This option is used to compile and link code instrumented for coverage
4029 analysis.  The option is a synonym for @option{-fprofile-arcs}
4030 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
4031 linking).  See the documentation for those options for more details.
4032
4033 @itemize
4034
4035 @item
4036 Compile the source files with @option{-fprofile-arcs} plus optimization
4037 and code generation options.  For test coverage analysis, use the
4038 additional @option{-ftest-coverage} option.  You do not need to profile
4039 every source file in a program.
4040
4041 @item
4042 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
4043 (the latter implies the former).
4044
4045 @item
4046 Run the program on a representative workload to generate the arc profile
4047 information.  This may be repeated any number of times.  You can run
4048 concurrent instances of your program, and provided that the file system
4049 supports locking, the data files will be correctly updated.  Also
4050 @code{fork} calls are detected and correctly handled (double counting
4051 will not happen).
4052
4053 @item
4054 For profile-directed optimizations, compile the source files again with
4055 the same optimization and code generation options plus
4056 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
4057 Control Optimization}).
4058
4059 @item
4060 For test coverage analysis, use @command{gcov} to produce human readable
4061 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
4062 @command{gcov} documentation for further information.
4063
4064 @end itemize
4065
4066 With @option{-fprofile-arcs}, for each function of your program GCC
4067 creates a program flow graph, then finds a spanning tree for the graph.
4068 Only arcs that are not on the spanning tree have to be instrumented: the
4069 compiler adds code to count the number of times that these arcs are
4070 executed.  When an arc is the only exit or only entrance to a block, the
4071 instrumentation code can be added to the block; otherwise, a new basic
4072 block must be created to hold the instrumentation code.
4073
4074 @need 2000
4075 @item -ftest-coverage
4076 @opindex ftest-coverage
4077 Produce a notes file that the @command{gcov} code-coverage utility
4078 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
4079 show program coverage.  Each source file's note file is called
4080 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
4081 above for a description of @var{auxname} and instructions on how to
4082 generate test coverage data.  Coverage data will match the source files
4083 more closely, if you do not optimize.
4084
4085 @item -d@var{letters}
4086 @item -fdump-rtl-@var{pass}
4087 @opindex d
4088 Says to make debugging dumps during compilation at times specified by
4089 @var{letters}.    This is used for debugging the RTL-based passes of the
4090 compiler.  The file names for most of the dumps are made by appending a
4091 pass number and a word to the @var{dumpname}.  @var{dumpname} is generated
4092 from the name of the output file, if explicitly specified and it is not
4093 an executable, otherwise it is the basename of the source file.
4094
4095 Most debug dumps can be enabled either passing a letter to the @option{-d}
4096 option, or with a long @option{-fdump-rtl} switch; here are the possible
4097 letters for use in @var{letters} and @var{pass}, and their meanings:
4098
4099 @table @gcctabopt
4100 @item -dA
4101 @opindex dA
4102 Annotate the assembler output with miscellaneous debugging information.
4103
4104 @item -dB
4105 @itemx -fdump-rtl-bbro
4106 @opindex dB
4107 @opindex fdump-rtl-bbro
4108 Dump after block reordering, to @file{@var{file}.148r.bbro}.
4109
4110 @item -dc
4111 @itemx -fdump-rtl-combine
4112 @opindex dc
4113 @opindex fdump-rtl-combine
4114 Dump after the RTL instruction combination pass, to the file
4115 @file{@var{file}.129r.combine}.
4116
4117 @item -dC
4118 @itemx -fdump-rtl-ce1
4119 @itemx -fdump-rtl-ce2
4120 @opindex dC
4121 @opindex fdump-rtl-ce1
4122 @opindex fdump-rtl-ce2
4123 @option{-dC} and @option{-fdump-rtl-ce1} enable dumping after the
4124 first if conversion, to the file @file{@var{file}.117r.ce1}.  @option{-dC}
4125 and @option{-fdump-rtl-ce2} enable dumping after the second if
4126 conversion, to the file @file{@var{file}.130r.ce2}.
4127
4128 @item -dd
4129 @itemx -fdump-rtl-btl
4130 @itemx -fdump-rtl-dbr
4131 @opindex dd
4132 @opindex fdump-rtl-btl
4133 @opindex fdump-rtl-dbr
4134 @option{-dd} and @option{-fdump-rtl-btl} enable dumping after branch
4135 target load optimization, to @file{@var{file}.31.btl}.  @option{-dd}
4136 and @option{-fdump-rtl-dbr} enable dumping after delayed branch
4137 scheduling, to @file{@var{file}.36.dbr}.
4138
4139 @item -dD
4140 @opindex dD
4141 Dump all macro definitions, at the end of preprocessing, in addition to
4142 normal output.
4143
4144 @item -dE
4145 @itemx -fdump-rtl-ce3
4146 @opindex dE
4147 @opindex fdump-rtl-ce3
4148 Dump after the third if conversion, to @file{@var{file}.146r.ce3}.
4149
4150 @item -df
4151 @itemx -fdump-rtl-cfg
4152 @itemx -fdump-rtl-life
4153 @opindex df
4154 @opindex fdump-rtl-cfg
4155 @opindex fdump-rtl-life
4156 @option{-df} and @option{-fdump-rtl-cfg} enable dumping after control
4157 and data flow analysis, to @file{@var{file}.116r.cfg}.  @option{-df}
4158 and @option{-fdump-rtl-cfg} enable dumping dump after life analysis,
4159 to @file{@var{file}.128r.life1} and @file{@var{file}.135r.life2}.
4160
4161 @item -dg
4162 @itemx -fdump-rtl-greg
4163 @opindex dg
4164 @opindex fdump-rtl-greg
4165 Dump after global register allocation, to @file{@var{file}.139r.greg}.
4166
4167 @item -dG
4168 @itemx -fdump-rtl-gcse
4169 @itemx -fdump-rtl-bypass
4170 @opindex dG
4171 @opindex fdump-rtl-gcse
4172 @opindex fdump-rtl-bypass
4173 @option{-dG} and @option{-fdump-rtl-gcse} enable dumping after GCSE, to
4174 @file{@var{file}.114r.gcse}.  @option{-dG} and @option{-fdump-rtl-bypass}
4175 enable dumping after jump bypassing and control flow optimizations, to
4176 @file{@var{file}.115r.bypass}.
4177
4178 @item -dh
4179 @itemx -fdump-rtl-eh
4180 @opindex dh
4181 @opindex fdump-rtl-eh
4182 Dump after finalization of EH handling code, to @file{@var{file}.02.eh}.
4183
4184 @item -di
4185 @itemx -fdump-rtl-sibling
4186 @opindex di
4187 @opindex fdump-rtl-sibling
4188 Dump after sibling call optimizations, to @file{@var{file}.106r.sibling}.
4189
4190 @item -dj
4191 @itemx -fdump-rtl-jump
4192 @opindex dj
4193 @opindex fdump-rtl-jump
4194 Dump after the first jump optimization, to @file{@var{file}.112r.jump}.
4195
4196 @item -dk
4197 @itemx -fdump-rtl-stack
4198 @opindex dk
4199 @opindex fdump-rtl-stack
4200 Dump after conversion from GCC's "flat register file" registers to the
4201 x87's stack-like registers, to @file{@var{file}.152r.stack}.
4202
4203 @item -dl
4204 @itemx -fdump-rtl-lreg
4205 @opindex dl
4206 @opindex fdump-rtl-lreg
4207 Dump after local register allocation, to @file{@var{file}.138r.lreg}.
4208
4209 @item -dL
4210 @itemx -fdump-rtl-loop2
4211 @opindex dL
4212 @opindex fdump-rtl-loop2
4213 @option{-dL} and @option{-fdump-rtl-loop2} enable dumping after the
4214 loop optimization pass, to @file{@var{file}.119r.loop2},
4215 @file{@var{file}.120r.loop2_init},
4216 @file{@var{file}.121r.loop2_invariant}, and
4217 @file{@var{file}.125r.loop2_done}.
4218
4219 @item -dm
4220 @itemx -fdump-rtl-sms
4221 @opindex dm
4222 @opindex fdump-rtl-sms
4223 Dump after modulo scheduling, to @file{@var{file}.136r.sms}.
4224
4225 @item -dM
4226 @itemx -fdump-rtl-mach
4227 @opindex dM
4228 @opindex fdump-rtl-mach
4229 Dump after performing the machine dependent reorganization pass, to
4230 @file{@var{file}.155r.mach}.
4231
4232 @item -dn
4233 @itemx -fdump-rtl-rnreg
4234 @opindex dn
4235 @opindex fdump-rtl-rnreg
4236 Dump after register renumbering, to @file{@var{file}.147r.rnreg}.
4237
4238 @item -dN
4239 @itemx -fdump-rtl-regmove
4240 @opindex dN
4241 @opindex fdump-rtl-regmove
4242 Dump after the register move pass, to @file{@var{file}.132r.regmove}.
4243
4244 @item -do
4245 @itemx -fdump-rtl-postreload
4246 @opindex do
4247 @opindex fdump-rtl-postreload
4248 Dump after post-reload optimizations, to @file{@var{file}.24.postreload}.
4249
4250 @item -dr
4251 @itemx -fdump-rtl-expand
4252 @opindex dr
4253 @opindex fdump-rtl-expand
4254 Dump after RTL generation, to @file{@var{file}.104r.expand}.
4255
4256 @item -dR
4257 @itemx -fdump-rtl-sched2
4258 @opindex dR
4259 @opindex fdump-rtl-sched2
4260 Dump after the second scheduling pass, to @file{@var{file}.149r.sched2}.
4261
4262 @item -ds
4263 @itemx -fdump-rtl-cse
4264 @opindex ds
4265 @opindex fdump-rtl-cse
4266 Dump after CSE (including the jump optimization that sometimes follows
4267 CSE), to @file{@var{file}.113r.cse}.
4268
4269 @item -dS
4270 @itemx -fdump-rtl-sched1
4271 @opindex dS
4272 @opindex fdump-rtl-sched1
4273 Dump after the first scheduling pass, to @file{@var{file}.136r.sched1}.
4274
4275 @item -dt
4276 @itemx -fdump-rtl-cse2
4277 @opindex dt
4278 @opindex fdump-rtl-cse2
4279 Dump after the second CSE pass (including the jump optimization that
4280 sometimes follows CSE), to @file{@var{file}.127r.cse2}.
4281
4282 @item -dT
4283 @itemx -fdump-rtl-tracer
4284 @opindex dT
4285 @opindex fdump-rtl-tracer
4286 Dump after running tracer, to @file{@var{file}.118r.tracer}.
4287
4288 @item -dV
4289 @itemx -fdump-rtl-vpt
4290 @itemx -fdump-rtl-vartrack
4291 @opindex dV
4292 @opindex fdump-rtl-vpt
4293 @opindex fdump-rtl-vartrack
4294 @option{-dV} and @option{-fdump-rtl-vpt} enable dumping after the value
4295 profile transformations, to @file{@var{file}.10.vpt}.  @option{-dV}
4296 and @option{-fdump-rtl-vartrack} enable dumping after variable tracking,
4297 to @file{@var{file}.154r.vartrack}.
4298
4299 @item -dw
4300 @itemx -fdump-rtl-flow2
4301 @opindex dw
4302 @opindex fdump-rtl-flow2
4303 Dump after the second flow pass, to @file{@var{file}.142r.flow2}.
4304
4305 @item -dz
4306 @itemx -fdump-rtl-peephole2
4307 @opindex dz
4308 @opindex fdump-rtl-peephole2
4309 Dump after the peephole pass, to @file{@var{file}.145r.peephole2}.
4310
4311 @item -dZ
4312 @itemx -fdump-rtl-web
4313 @opindex dZ
4314 @opindex fdump-rtl-web
4315 Dump after live range splitting, to @file{@var{file}.126r.web}.
4316
4317 @item -da
4318 @itemx -fdump-rtl-all
4319 @opindex da
4320 @opindex fdump-rtl-all
4321 Produce all the dumps listed above.
4322
4323 @item -dH
4324 @opindex dH
4325 Produce a core dump whenever an error occurs.
4326
4327 @item -dm
4328 @opindex dm
4329 Print statistics on memory usage, at the end of the run, to
4330 standard error.
4331
4332 @item -dp
4333 @opindex dp
4334 Annotate the assembler output with a comment indicating which
4335 pattern and alternative was used.  The length of each instruction is
4336 also printed.
4337
4338 @item -dP
4339 @opindex dP
4340 Dump the RTL in the assembler output as a comment before each instruction.
4341 Also turns on @option{-dp} annotation.
4342
4343 @item -dv
4344 @opindex dv
4345 For each of the other indicated dump files (either with @option{-d} or
4346 @option{-fdump-rtl-@var{pass}}), dump a representation of the control flow
4347 graph suitable for viewing with VCG to @file{@var{file}.@var{pass}.vcg}.
4348
4349 @item -dx
4350 @opindex dx
4351 Just generate RTL for a function instead of compiling it.  Usually used
4352 with @samp{r} (@option{-fdump-rtl-expand}).
4353
4354 @item -dy
4355 @opindex dy
4356 Dump debugging information during parsing, to standard error.
4357 @end table
4358
4359 @item -fdump-noaddr
4360 @opindex fdump-noaddr
4361 When doing debugging dumps (see @option{-d} option above), suppress
4362 address output.  This makes it more feasible to use diff on debugging
4363 dumps for compiler invocations with different compiler binaries and/or
4364 different text / bss / data / heap / stack / dso start locations.
4365
4366 @item -fdump-unnumbered
4367 @opindex fdump-unnumbered
4368 When doing debugging dumps (see @option{-d} option above), suppress instruction
4369 numbers, line number note and address output.  This makes it more feasible to
4370 use diff on debugging dumps for compiler invocations with different
4371 options, in particular with and without @option{-g}.
4372
4373 @item -fdump-translation-unit @r{(C++ only)}
4374 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
4375 @opindex fdump-translation-unit
4376 Dump a representation of the tree structure for the entire translation
4377 unit to a file.  The file name is made by appending @file{.tu} to the
4378 source file name.  If the @samp{-@var{options}} form is used, @var{options}
4379 controls the details of the dump as described for the
4380 @option{-fdump-tree} options.
4381
4382 @item -fdump-class-hierarchy @r{(C++ only)}
4383 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
4384 @opindex fdump-class-hierarchy
4385 Dump a representation of each class's hierarchy and virtual function
4386 table layout to a file.  The file name is made by appending @file{.class}
4387 to the source file name.  If the @samp{-@var{options}} form is used,
4388 @var{options} controls the details of the dump as described for the
4389 @option{-fdump-tree} options.
4390
4391 @item -fdump-ipa-@var{switch}
4392 @opindex fdump-ipa
4393 Control the dumping at various stages of inter-procedural analysis
4394 language tree to a file.  The file name is generated by appending a switch
4395 specific suffix to the source file name.  The following dumps are possible:
4396
4397 @table @samp
4398 @item all
4399 Enables all inter-procedural analysis dumps; currently the only produced
4400 dump is the @samp{cgraph} dump.
4401
4402 @item cgraph
4403 Dumps information about call-graph optimization, unused function removal,
4404 and inlining decisions.
4405 @end table
4406
4407 @item -fdump-tree-@var{switch}
4408 @itemx -fdump-tree-@var{switch}-@var{options}
4409 @opindex fdump-tree
4410 Control the dumping at various stages of processing the intermediate
4411 language tree to a file.  The file name is generated by appending a switch
4412 specific suffix to the source file name.  If the @samp{-@var{options}}
4413 form is used, @var{options} is a list of @samp{-} separated options that
4414 control the details of the dump.  Not all options are applicable to all
4415 dumps, those which are not meaningful will be ignored.  The following
4416 options are available
4417
4418 @table @samp
4419 @item address
4420 Print the address of each node.  Usually this is not meaningful as it
4421 changes according to the environment and source file.  Its primary use
4422 is for tying up a dump file with a debug environment.
4423 @item slim
4424 Inhibit dumping of members of a scope or body of a function merely
4425 because that scope has been reached.  Only dump such items when they
4426 are directly reachable by some other path.  When dumping pretty-printed
4427 trees, this option inhibits dumping the bodies of control structures.
4428 @item raw
4429 Print a raw representation of the tree.  By default, trees are
4430 pretty-printed into a C-like representation.
4431 @item details
4432 Enable more detailed dumps (not honored by every dump option).
4433 @item stats
4434 Enable dumping various statistics about the pass (not honored by every dump
4435 option).
4436 @item blocks
4437 Enable showing basic block boundaries (disabled in raw dumps).
4438 @item vops
4439 Enable showing virtual operands for every statement.
4440 @item lineno
4441 Enable showing line numbers for statements.
4442 @item uid
4443 Enable showing the unique ID (@code{DECL_UID}) for each variable.
4444 @item all
4445 Turn on all options, except @option{raw}, @option{slim} and @option{lineno}.
4446 @end table
4447
4448 The following tree dumps are possible:
4449 @table @samp
4450
4451 @item original
4452 Dump before any tree based optimization, to @file{@var{file}.original}.
4453
4454 @item optimized
4455 Dump after all tree based optimization, to @file{@var{file}.optimized}.
4456
4457 @item inlined
4458 Dump after function inlining, to @file{@var{file}.inlined}.
4459
4460 @item gimple
4461 @opindex fdump-tree-gimple
4462 Dump each function before and after the gimplification pass to a file.  The
4463 file name is made by appending @file{.gimple} to the source file name.
4464
4465 @item cfg
4466 @opindex fdump-tree-cfg
4467 Dump the control flow graph of each function to a file.  The file name is
4468 made by appending @file{.cfg} to the source file name.
4469
4470 @item vcg
4471 @opindex fdump-tree-vcg
4472 Dump the control flow graph of each function to a file in VCG format.  The
4473 file name is made by appending @file{.vcg} to the source file name.  Note
4474 that if the file contains more than one function, the generated file cannot
4475 be used directly by VCG@.  You will need to cut and paste each function's
4476 graph into its own separate file first.
4477
4478 @item ch
4479 @opindex fdump-tree-ch
4480 Dump each function after copying loop headers.  The file name is made by
4481 appending @file{.ch} to the source file name.
4482
4483 @item ssa
4484 @opindex fdump-tree-ssa
4485 Dump SSA related information to a file.  The file name is made by appending
4486 @file{.ssa} to the source file name.
4487
4488 @item salias
4489 @opindex fdump-tree-salias
4490 Dump structure aliasing variable information to a file.  This file name
4491 is made by appending @file{.salias} to the source file name.
4492
4493 @item alias
4494 @opindex fdump-tree-alias
4495 Dump aliasing information for each function.  The file name is made by
4496 appending @file{.alias} to the source file name.
4497
4498 @item ccp
4499 @opindex fdump-tree-ccp
4500 Dump each function after CCP@.  The file name is made by appending
4501 @file{.ccp} to the source file name.
4502
4503 @item storeccp
4504 @opindex fdump-tree-storeccp
4505 Dump each function after STORE-CCP.  The file name is made by appending
4506 @file{.storeccp} to the source file name.
4507
4508 @item pre
4509 @opindex fdump-tree-pre
4510 Dump trees after partial redundancy elimination.  The file name is made
4511 by appending @file{.pre} to the source file name.
4512
4513 @item fre
4514 @opindex fdump-tree-fre
4515 Dump trees after full redundancy elimination.  The file name is made
4516 by appending @file{.fre} to the source file name.
4517
4518 @item copyprop
4519 @opindex fdump-tree-copyprop
4520 Dump trees after copy propagation.  The file name is made
4521 by appending @file{.copyprop} to the source file name.
4522
4523 @item store_copyprop
4524 @opindex fdump-tree-store_copyprop
4525 Dump trees after store copy-propagation.  The file name is made
4526 by appending @file{.store_copyprop} to the source file name.
4527
4528 @item dce
4529 @opindex fdump-tree-dce
4530 Dump each function after dead code elimination.  The file name is made by
4531 appending @file{.dce} to the source file name.
4532
4533 @item mudflap
4534 @opindex fdump-tree-mudflap
4535 Dump each function after adding mudflap instrumentation.  The file name is
4536 made by appending @file{.mudflap} to the source file name.
4537
4538 @item sra
4539 @opindex fdump-tree-sra
4540 Dump each function after performing scalar replacement of aggregates.  The
4541 file name is made by appending @file{.sra} to the source file name.
4542
4543 @item sink
4544 @opindex fdump-tree-sink
4545 Dump each function after performing code sinking.  The file name is made
4546 by appending @file{.sink} to the source file name.
4547
4548 @item dom
4549 @opindex fdump-tree-dom
4550 Dump each function after applying dominator tree optimizations.  The file
4551 name is made by appending @file{.dom} to the source file name.
4552
4553 @item dse
4554 @opindex fdump-tree-dse
4555 Dump each function after applying dead store elimination.  The file
4556 name is made by appending @file{.dse} to the source file name.
4557
4558 @item phiopt
4559 @opindex fdump-tree-phiopt
4560 Dump each function after optimizing PHI nodes into straightline code.  The file
4561 name is made by appending @file{.phiopt} to the source file name.
4562
4563 @item forwprop
4564 @opindex fdump-tree-forwprop
4565 Dump each function after forward propagating single use variables.  The file
4566 name is made by appending @file{.forwprop} to the source file name.
4567
4568 @item copyrename
4569 @opindex fdump-tree-copyrename
4570 Dump each function after applying the copy rename optimization.  The file
4571 name is made by appending @file{.copyrename} to the source file name.
4572
4573 @item nrv
4574 @opindex fdump-tree-nrv
4575 Dump each function after applying the named return value optimization on
4576 generic trees.  The file name is made by appending @file{.nrv} to the source
4577 file name.
4578
4579 @item vect
4580 @opindex fdump-tree-vect
4581 Dump each function after applying vectorization of loops.  The file name is
4582 made by appending @file{.vect} to the source file name.
4583
4584 @item vrp
4585 @opindex fdump-tree-vrp
4586 Dump each function after Value Range Propagation (VRP).  The file name
4587 is made by appending @file{.vrp} to the source file name.
4588
4589 @item all
4590 @opindex fdump-tree-all
4591 Enable all the available tree dumps with the flags provided in this option.
4592 @end table
4593
4594 @item -ftree-vectorizer-verbose=@var{n}
4595 @opindex ftree-vectorizer-verbose
4596 This option controls the amount of debugging output the vectorizer prints.
4597 This information is written to standard error, unless
4598 @option{-fdump-tree-all} or @option{-fdump-tree-vect} is specified,
4599 in which case it is output to the usual dump listing file, @file{.vect}.
4600 For @var{n}=0 no diagnostic information is reported.
4601 If @var{n}=1 the vectorizer reports each loop that got vectorized,
4602 and the total number of loops that got vectorized.
4603 If @var{n}=2 the vectorizer also reports non-vectorized loops that passed
4604 the first analysis phase (vect_analyze_loop_form) - i.e. countable,
4605 inner-most, single-bb, single-entry/exit loops.  This is the same verbosity
4606 level that @option{-fdump-tree-vect-stats} uses.
4607 Higher verbosity levels mean either more information dumped for each
4608 reported loop, or same amount of information reported for more loops:
4609 If @var{n}=3, alignment related information is added to the reports.
4610 If @var{n}=4, data-references related information (e.g. memory dependences,
4611 memory access-patterns) is added to the reports.
4612 If @var{n}=5, the vectorizer reports also non-vectorized inner-most loops
4613 that did not pass the first analysis phase (i.e. may not be countable, or
4614 may have complicated control-flow).
4615 If @var{n}=6, the vectorizer reports also non-vectorized nested loops.
4616 For @var{n}=7, all the information the vectorizer generates during its
4617 analysis and transformation is reported.  This is the same verbosity level
4618 that @option{-fdump-tree-vect-details} uses.
4619
4620 @item -frandom-seed=@var{string}
4621 @opindex frandom-string
4622 This option provides a seed that GCC uses when it would otherwise use
4623 random numbers.  It is used to generate certain symbol names
4624 that have to be different in every compiled file.  It is also used to
4625 place unique stamps in coverage data files and the object files that
4626 produce them.  You can use the @option{-frandom-seed} option to produce
4627 reproducibly identical object files.
4628
4629 The @var{string} should be different for every file you compile.
4630
4631 @item -fsched-verbose=@var{n}
4632 @opindex fsched-verbose
4633 On targets that use instruction scheduling, this option controls the
4634 amount of debugging output the scheduler prints.  This information is
4635 written to standard error, unless @option{-dS} or @option{-dR} is
4636 specified, in which case it is output to the usual dump
4637 listing file, @file{.sched} or @file{.sched2} respectively.  However
4638 for @var{n} greater than nine, the output is always printed to standard
4639 error.
4640
4641 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
4642 same information as @option{-dRS}.  For @var{n} greater than one, it
4643 also output basic block probabilities, detailed ready list information
4644 and unit/insn info.  For @var{n} greater than two, it includes RTL
4645 at abort point, control-flow and regions info.  And for @var{n} over
4646 four, @option{-fsched-verbose} also includes dependence info.
4647
4648 @item -save-temps
4649 @opindex save-temps
4650 Store the usual ``temporary'' intermediate files permanently; place them
4651 in the current directory and name them based on the source file.  Thus,
4652 compiling @file{foo.c} with @samp{-c -save-temps} would produce files
4653 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
4654 preprocessed @file{foo.i} output file even though the compiler now
4655 normally uses an integrated preprocessor.
4656
4657 When used in combination with the @option{-x} command line option,
4658 @option{-save-temps} is sensible enough to avoid over writing an
4659 input source file with the same extension as an intermediate file.
4660 The corresponding intermediate file may be obtained by renaming the
4661 source file before using @option{-save-temps}.
4662
4663 @item -time
4664 @opindex time
4665 Report the CPU time taken by each subprocess in the compilation
4666 sequence.  For C source files, this is the compiler proper and assembler
4667 (plus the linker if linking is done).  The output looks like this:
4668
4669 @smallexample
4670 # cc1 0.12 0.01
4671 # as 0.00 0.01
4672 @end smallexample
4673
4674 The first number on each line is the ``user time'', that is time spent
4675 executing the program itself.  The second number is ``system time'',
4676 time spent executing operating system routines on behalf of the program.
4677 Both numbers are in seconds.
4678
4679 @item -fvar-tracking
4680 @opindex fvar-tracking
4681 Run variable tracking pass.  It computes where variables are stored at each
4682 position in code.  Better debugging information is then generated
4683 (if the debugging information format supports this information).
4684
4685 It is enabled by default when compiling with optimization (@option{-Os},
4686 @option{-O}, @option{-O2}, ...), debugging information (@option{-g}) and
4687 the debug info format supports it.
4688
4689 @item -print-file-name=@var{library}
4690 @opindex print-file-name
4691 Print the full absolute name of the library file @var{library} that
4692 would be used when linking---and don't do anything else.  With this
4693 option, GCC does not compile or link anything; it just prints the
4694 file name.
4695
4696 @item -print-multi-directory
4697 @opindex print-multi-directory
4698 Print the directory name corresponding to the multilib selected by any
4699 other switches present in the command line.  This directory is supposed
4700 to exist in @env{GCC_EXEC_PREFIX}.
4701
4702 @item -print-multi-lib
4703 @opindex print-multi-lib
4704 Print the mapping from multilib directory names to compiler switches
4705 that enable them.  The directory name is separated from the switches by
4706 @samp{;}, and each switch starts with an @samp{@@} instead of the
4707 @samp{-}, without spaces between multiple switches.  This is supposed to
4708 ease shell-processing.
4709
4710 @item -print-prog-name=@var{program}
4711 @opindex print-prog-name
4712 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
4713
4714 @item -print-libgcc-file-name
4715 @opindex print-libgcc-file-name
4716 Same as @option{-print-file-name=libgcc.a}.
4717
4718 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
4719 but you do want to link with @file{libgcc.a}.  You can do
4720
4721 @smallexample
4722 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
4723 @end smallexample
4724
4725 @item -print-search-dirs
4726 @opindex print-search-dirs
4727 Print the name of the configured installation directory and a list of
4728 program and library directories @command{gcc} will search---and don't do anything else.
4729
4730 This is useful when @command{gcc} prints the error message
4731 @samp{installation problem, cannot exec cpp0: No such file or directory}.
4732 To resolve this you either need to put @file{cpp0} and the other compiler
4733 components where @command{gcc} expects to find them, or you can set the environment
4734 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
4735 Don't forget the trailing @samp{/}.
4736 @xref{Environment Variables}.
4737
4738 @item -print-sysroot-headers-suffix
4739 @opindex print-sysroot-headers-suffix
4740 Print the suffix added to the target sysroot when searching for
4741 headers, or give an error if the compiler is not configured with such
4742 a suffix---and don't do anything else.
4743
4744 @item -dumpmachine
4745 @opindex dumpmachine
4746 Print the compiler's target machine (for example,
4747 @samp{i686-pc-linux-gnu})---and don't do anything else.
4748
4749 @item -dumpversion
4750 @opindex dumpversion
4751 Print the compiler version (for example, @samp{3.0})---and don't do
4752 anything else.
4753
4754 @item -dumpspecs
4755 @opindex dumpspecs
4756 Print the compiler's built-in specs---and don't do anything else.  (This
4757 is used when GCC itself is being built.)  @xref{Spec Files}.
4758
4759 @item -feliminate-unused-debug-types
4760 @opindex feliminate-unused-debug-types
4761 Normally, when producing DWARF2 output, GCC will emit debugging
4762 information for all types declared in a compilation
4763 unit, regardless of whether or not they are actually used
4764 in that compilation unit.  Sometimes this is useful, such as
4765 if, in the debugger, you want to cast a value to a type that is
4766 not actually used in your program (but is declared).  More often,
4767 however, this results in a significant amount of wasted space.
4768 With this option, GCC will avoid producing debug symbol output
4769 for types that are nowhere used in the source file being compiled.
4770 @end table
4771
4772 @node Optimize Options
4773 @section Options That Control Optimization
4774 @cindex optimize options
4775 @cindex options, optimization
4776
4777 These options control various sorts of optimizations.
4778
4779 Without any optimization option, the compiler's goal is to reduce the
4780 cost of compilation and to make debugging produce the expected
4781 results.  Statements are independent: if you stop the program with a
4782 breakpoint between statements, you can then assign a new value to any
4783 variable or change the program counter to any other statement in the
4784 function and get exactly the results you would expect from the source
4785 code.
4786
4787 Turning on optimization flags makes the compiler attempt to improve
4788 the performance and/or code size at the expense of compilation time
4789 and possibly the ability to debug the program.
4790
4791 The compiler performs optimization based on the knowledge it has of
4792 the program.  Optimization levels @option{-O} and above, in
4793 particular, enable @emph{unit-at-a-time} mode, which allows the
4794 compiler to consider information gained from later functions in
4795 the file when compiling a function.  Compiling multiple files at
4796 once to a single output file in @emph{unit-at-a-time} mode allows
4797 the compiler to use information gained from all of the files when
4798 compiling each of them.
4799
4800 Not all optimizations are controlled directly by a flag.  Only
4801 optimizations that have a flag are listed.
4802
4803 @table @gcctabopt
4804 @item -O
4805 @itemx -O1
4806 @opindex O
4807 @opindex O1
4808 Optimize.  Optimizing compilation takes somewhat more time, and a lot
4809 more memory for a large function.
4810
4811 With @option{-O}, the compiler tries to reduce code size and execution
4812 time, without performing any optimizations that take a great deal of
4813 compilation time.
4814
4815 @option{-O} turns on the following optimization flags:
4816 @gccoptlist{-fdefer-pop @gol
4817 -fdelayed-branch @gol
4818 -fguess-branch-probability @gol
4819 -fcprop-registers @gol
4820 -fif-conversion @gol
4821 -fif-conversion2 @gol
4822 -fsplit-wide-types @gol
4823 -ftree-ccp @gol
4824 -ftree-dce @gol
4825 -ftree-dominator-opts @gol
4826 -ftree-dse @gol
4827 -ftree-ter @gol
4828 -ftree-sra @gol
4829 -ftree-copyrename @gol
4830 -ftree-fre @gol
4831 -ftree-ch @gol
4832 -funit-at-a-time @gol
4833 -fmerge-constants}
4834
4835 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
4836 where doing so does not interfere with debugging.
4837
4838 @item -O2
4839 @opindex O2
4840 Optimize even more.  GCC performs nearly all supported optimizations
4841 that do not involve a space-speed tradeoff.  The compiler does not
4842 perform loop unrolling or function inlining when you specify @option{-O2}.
4843 As compared to @option{-O}, this option increases both compilation time
4844 and the performance of the generated code.
4845
4846 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
4847 also turns on the following optimization flags:
4848 @gccoptlist{-fthread-jumps @gol
4849 -fcrossjumping @gol
4850 -foptimize-sibling-calls @gol
4851 -fcse-follow-jumps  -fcse-skip-blocks @gol
4852 -fgcse  -fgcse-lm  @gol
4853 -fexpensive-optimizations @gol
4854 -frerun-cse-after-loop  @gol
4855 -fcaller-saves @gol
4856 -fpeephole2 @gol
4857 -fschedule-insns  -fschedule-insns2 @gol
4858 -fsched-interblock  -fsched-spec @gol
4859 -fregmove @gol
4860 -fstrict-aliasing -fstrict-overflow @gol
4861 -fdelete-null-pointer-checks @gol
4862 -freorder-blocks  -freorder-functions @gol
4863 -falign-functions  -falign-jumps @gol
4864 -falign-loops  -falign-labels @gol
4865 -ftree-vrp @gol
4866 -ftree-pre}
4867
4868 Please note the warning under @option{-fgcse} about
4869 invoking @option{-O2} on programs that use computed gotos.
4870
4871 @item -O3
4872 @opindex O3
4873 Optimize yet more.  @option{-O3} turns on all optimizations specified by
4874 @option{-O2} and also turns on the @option{-finline-functions},
4875 @option{-funswitch-loops} and @option{-fgcse-after-reload} options.
4876
4877 @item -O0
4878 @opindex O0
4879 Reduce compilation time and make debugging produce the expected
4880 results.  This is the default.
4881
4882 @item -Os
4883 @opindex Os
4884 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
4885 do not typically increase code size.  It also performs further
4886 optimizations designed to reduce code size.
4887
4888 @option{-Os} disables the following optimization flags:
4889 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
4890 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
4891 -fprefetch-loop-arrays  -ftree-vect-loop-version}
4892
4893 If you use multiple @option{-O} options, with or without level numbers,
4894 the last such option is the one that is effective.
4895 @end table
4896
4897 Options of the form @option{-f@var{flag}} specify machine-independent
4898 flags.  Most flags have both positive and negative forms; the negative
4899 form of @option{-ffoo} would be @option{-fno-foo}.  In the table
4900 below, only one of the forms is listed---the one you typically will
4901 use.  You can figure out the other form by either removing @samp{no-}
4902 or adding it.
4903
4904 The following options control specific optimizations.  They are either
4905 activated by @option{-O} options or are related to ones that are.  You
4906 can use the following flags in the rare cases when ``fine-tuning'' of
4907 optimizations to be performed is desired.
4908
4909 @table @gcctabopt
4910 @item -fno-default-inline
4911 @opindex fno-default-inline
4912 Do not make member functions inline by default merely because they are
4913 defined inside the class scope (C++ only).  Otherwise, when you specify
4914 @w{@option{-O}}, member functions defined inside class scope are compiled
4915 inline by default; i.e., you don't need to add @samp{inline} in front of
4916 the member function name.
4917
4918 @item -fno-defer-pop
4919 @opindex fno-defer-pop
4920 Always pop the arguments to each function call as soon as that function
4921 returns.  For machines which must pop arguments after a function call,
4922 the compiler normally lets arguments accumulate on the stack for several
4923 function calls and pops them all at once.
4924
4925 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
4926
4927 @item -fforce-addr
4928 @opindex fforce-addr
4929 Force memory address constants to be copied into registers before
4930 doing arithmetic on them.
4931
4932 @item -fforward-propagate
4933 @opindex fforward-propagate
4934 Perform a forward propagation pass on RTL.  The pass tries to combine two
4935 instructions and checks if the result can be simplified.  If loop unrolling
4936 is active, two passes are performed and the second is scheduled after
4937 loop unrolling.
4938
4939 This option is enabled by default at optimization levels @option{-O2},
4940 @option{-O3}, @option{-Os}.
4941
4942 @item -fomit-frame-pointer
4943 @opindex fomit-frame-pointer
4944 Don't keep the frame pointer in a register for functions that
4945 don't need one.  This avoids the instructions to save, set up and
4946 restore frame pointers; it also makes an extra register available
4947 in many functions.  @strong{It also makes debugging impossible on
4948 some machines.}
4949
4950 On some machines, such as the VAX, this flag has no effect, because
4951 the standard calling sequence automatically handles the frame pointer
4952 and nothing is saved by pretending it doesn't exist.  The
4953 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
4954 whether a target machine supports this flag.  @xref{Registers,,Register
4955 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
4956
4957 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
4958
4959 @item -foptimize-sibling-calls
4960 @opindex foptimize-sibling-calls
4961 Optimize sibling and tail recursive calls.
4962
4963 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4964
4965 @item -fno-inline
4966 @opindex fno-inline
4967 Don't pay attention to the @code{inline} keyword.  Normally this option
4968 is used to keep the compiler from expanding any functions inline.
4969 Note that if you are not optimizing, no functions can be expanded inline.
4970
4971 @item -finline-functions
4972 @opindex finline-functions
4973 Integrate all simple functions into their callers.  The compiler
4974 heuristically decides which functions are simple enough to be worth
4975 integrating in this way.
4976
4977 If all calls to a given function are integrated, and the function is
4978 declared @code{static}, then the function is normally not output as
4979 assembler code in its own right.
4980
4981 Enabled at level @option{-O3}.
4982
4983 @item -finline-functions-called-once
4984 @opindex finline-functions-called-once
4985 Consider all @code{static} functions called once for inlining into their
4986 caller even if they are not marked @code{inline}.  If a call to a given
4987 function is integrated, then the function is not output as assembler code
4988 in its own right.
4989
4990 Enabled if @option{-funit-at-a-time} is enabled.
4991
4992 @item -fearly-inlining
4993 @opindex fearly-inlining
4994 Inline functions marked by @code{always_inline} and functions whose body seems
4995 smaller than the function call overhead early before doing
4996 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
4997 makes profiling significantly cheaper and usually inlining faster on programs
4998 having large chains of nested wrapper functions.
4999
5000 Enabled by default.
5001
5002 @item -finline-limit=@var{n}
5003 @opindex finline-limit
5004 By default, GCC limits the size of functions that can be inlined.  This flag
5005 allows the control of this limit for functions that are explicitly marked as
5006 inline (i.e., marked with the inline keyword or defined within the class
5007 definition in c++).  @var{n} is the size of functions that can be inlined in
5008 number of pseudo instructions (not counting parameter handling).  The default
5009 value of @var{n} is 600.
5010 Increasing this value can result in more inlined code at
5011 the cost of compilation time and memory consumption.  Decreasing usually makes
5012 the compilation faster and less code will be inlined (which presumably
5013 means slower programs).  This option is particularly useful for programs that
5014 use inlining heavily such as those based on recursive templates with C++.
5015
5016 Inlining is actually controlled by a number of parameters, which may be
5017 specified individually by using @option{--param @var{name}=@var{value}}.
5018 The @option{-finline-limit=@var{n}} option sets some of these parameters
5019 as follows:
5020
5021 @table @gcctabopt
5022 @item max-inline-insns-single
5023  is set to @var{n}/2.
5024 @item max-inline-insns-auto
5025  is set to @var{n}/2.
5026 @item min-inline-insns
5027  is set to 130 or @var{n}/4, whichever is smaller.
5028 @item max-inline-insns-rtl
5029  is set to @var{n}.
5030 @end table
5031
5032 See below for a documentation of the individual
5033 parameters controlling inlining.
5034
5035 @emph{Note:} pseudo instruction represents, in this particular context, an
5036 abstract measurement of function's size.  In no way does it represent a count
5037 of assembly instructions and as such its exact meaning might change from one
5038 release to an another.
5039
5040 @item -fkeep-inline-functions
5041 @opindex fkeep-inline-functions
5042 In C, emit @code{static} functions that are declared @code{inline}
5043 into the object file, even if the function has been inlined into all
5044 of its callers.  This switch does not affect functions using the
5045 @code{extern inline} extension in GNU C89@.  In C++, emit any and all
5046 inline functions into the object file.
5047
5048 @item -fkeep-static-consts
5049 @opindex fkeep-static-consts
5050 Emit variables declared @code{static const} when optimization isn't turned
5051 on, even if the variables aren't referenced.
5052
5053 GCC enables this option by default.  If you want to force the compiler to
5054 check if the variable was referenced, regardless of whether or not
5055 optimization is turned on, use the @option{-fno-keep-static-consts} option.
5056
5057 @item -fmerge-constants
5058 Attempt to merge identical constants (string constants and floating point
5059 constants) across compilation units.
5060
5061 This option is the default for optimized compilation if the assembler and
5062 linker support it.  Use @option{-fno-merge-constants} to inhibit this
5063 behavior.
5064
5065 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5066
5067 @item -fmerge-all-constants
5068 Attempt to merge identical constants and identical variables.
5069
5070 This option implies @option{-fmerge-constants}.  In addition to
5071 @option{-fmerge-constants} this considers e.g.@: even constant initialized
5072 arrays or initialized constant variables with integral or floating point
5073 types.  Languages like C or C++ require each non-automatic variable to
5074 have distinct location, so using this option will result in non-conforming
5075 behavior.
5076
5077 @item -fmodulo-sched
5078 @opindex fmodulo-sched
5079 Perform swing modulo scheduling immediately before the first scheduling
5080 pass.  This pass looks at innermost loops and reorders their
5081 instructions by overlapping different iterations.
5082
5083 @item -fno-branch-count-reg
5084 @opindex fno-branch-count-reg
5085 Do not use ``decrement and branch'' instructions on a count register,
5086 but instead generate a sequence of instructions that decrement a
5087 register, compare it against zero, then branch based upon the result.
5088 This option is only meaningful on architectures that support such
5089 instructions, which include x86, PowerPC, IA-64 and S/390.
5090
5091 The default is @option{-fbranch-count-reg}.
5092
5093 @item -fno-function-cse
5094 @opindex fno-function-cse
5095 Do not put function addresses in registers; make each instruction that
5096 calls a constant function contain the function's address explicitly.
5097
5098 This option results in less efficient code, but some strange hacks
5099 that alter the assembler output may be confused by the optimizations
5100 performed when this option is not used.
5101
5102 The default is @option{-ffunction-cse}
5103
5104 @item -fno-zero-initialized-in-bss
5105 @opindex fno-zero-initialized-in-bss
5106 If the target supports a BSS section, GCC by default puts variables that
5107 are initialized to zero into BSS@.  This can save space in the resulting
5108 code.
5109
5110 This option turns off this behavior because some programs explicitly
5111 rely on variables going to the data section.  E.g., so that the
5112 resulting executable can find the beginning of that section and/or make
5113 assumptions based on that.
5114
5115 The default is @option{-fzero-initialized-in-bss}.
5116
5117 @item -fbounds-check
5118 @opindex fbounds-check
5119 For front-ends that support it, generate additional code to check that
5120 indices used to access arrays are within the declared range.  This is
5121 currently only supported by the Java and Fortran front-ends, where
5122 this option defaults to true and false respectively.
5123
5124 @item -fmudflap -fmudflapth -fmudflapir
5125 @opindex fmudflap
5126 @opindex fmudflapth
5127 @opindex fmudflapir
5128 @cindex bounds checking
5129 @cindex mudflap
5130 For front-ends that support it (C and C++), instrument all risky
5131 pointer/array dereferencing operations, some standard library
5132 string/heap functions, and some other associated constructs with
5133 range/validity tests.  Modules so instrumented should be immune to
5134 buffer overflows, invalid heap use, and some other classes of C/C++
5135 programming errors.  The instrumentation relies on a separate runtime
5136 library (@file{libmudflap}), which will be linked into a program if
5137 @option{-fmudflap} is given at link time.  Run-time behavior of the
5138 instrumented program is controlled by the @env{MUDFLAP_OPTIONS}
5139 environment variable.  See @code{env MUDFLAP_OPTIONS=-help a.out}
5140 for its options.
5141
5142 Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to
5143 link if your program is multi-threaded.  Use @option{-fmudflapir}, in
5144 addition to @option{-fmudflap} or @option{-fmudflapth}, if
5145 instrumentation should ignore pointer reads.  This produces less
5146 instrumentation (and therefore faster execution) and still provides
5147 some protection against outright memory corrupting writes, but allows
5148 erroneously read data to propagate within a program.
5149
5150 @item -fthread-jumps
5151 @opindex fthread-jumps
5152 Perform optimizations where we check to see if a jump branches to a
5153 location where another comparison subsumed by the first is found.  If
5154 so, the first branch is redirected to either the destination of the
5155 second branch or a point immediately following it, depending on whether
5156 the condition is known to be true or false.
5157
5158 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5159
5160 @item -fsplit-wide-types
5161 @opindex -fsplit-wide-types
5162 When using a type that occupies multiple registers, such as @code{long
5163 long} on a 32-bit system, split the registers apart and allocate them
5164 independently.  This normally generates better code for those types,
5165 but may make debugging more difficult.
5166
5167 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
5168 @option{-Os}.
5169
5170 @item -fcse-follow-jumps
5171 @opindex fcse-follow-jumps
5172 In common subexpression elimination, scan through jump instructions
5173 when the target of the jump is not reached by any other path.  For
5174 example, when CSE encounters an @code{if} statement with an
5175 @code{else} clause, CSE will follow the jump when the condition
5176 tested is false.
5177
5178 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5179
5180 @item -fcse-skip-blocks
5181 @opindex fcse-skip-blocks
5182 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
5183 follow jumps which conditionally skip over blocks.  When CSE
5184 encounters a simple @code{if} statement with no else clause,
5185 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
5186 body of the @code{if}.
5187
5188 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5189
5190 @item -frerun-cse-after-loop
5191 @opindex frerun-cse-after-loop
5192 Re-run common subexpression elimination after loop optimizations has been
5193 performed.
5194
5195 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5196
5197 @item -fgcse
5198 @opindex fgcse
5199 Perform a global common subexpression elimination pass.
5200 This pass also performs global constant and copy propagation.
5201
5202 @emph{Note:} When compiling a program using computed gotos, a GCC
5203 extension, you may get better runtime performance if you disable
5204 the global common subexpression elimination pass by adding
5205 @option{-fno-gcse} to the command line.
5206
5207 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5208
5209 @item -fgcse-lm
5210 @opindex fgcse-lm
5211 When @option{-fgcse-lm} is enabled, global common subexpression elimination will
5212 attempt to move loads which are only killed by stores into themselves.  This
5213 allows a loop containing a load/store sequence to be changed to a load outside
5214 the loop, and a copy/store within the loop.
5215
5216 Enabled by default when gcse is enabled.
5217
5218 @item -fgcse-sm
5219 @opindex fgcse-sm
5220 When @option{-fgcse-sm} is enabled, a store motion pass is run after
5221 global common subexpression elimination.  This pass will attempt to move
5222 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
5223 loops containing a load/store sequence can be changed to a load before
5224 the loop and a store after the loop.
5225
5226 Not enabled at any optimization level.
5227
5228 @item -fgcse-las
5229 @opindex fgcse-las
5230 When @option{-fgcse-las} is enabled, the global common subexpression
5231 elimination pass eliminates redundant loads that come after stores to the
5232 same memory location (both partial and full redundancies).
5233
5234 Not enabled at any optimization level.
5235
5236 @item -fgcse-after-reload
5237 @opindex fgcse-after-reload
5238 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
5239 pass is performed after reload.  The purpose of this pass is to cleanup
5240 redundant spilling.
5241
5242 @item -funsafe-loop-optimizations
5243 @opindex funsafe-loop-optimizations
5244 If given, the loop optimizer will assume that loop indices do not
5245 overflow, and that the loops with nontrivial exit condition are not
5246 infinite.  This enables a wider range of loop optimizations even if
5247 the loop optimizer itself cannot prove that these assumptions are valid.
5248 Using @option{-Wunsafe-loop-optimizations}, the compiler will warn you
5249 if it finds this kind of loop.
5250
5251 @item -fcrossjumping
5252 @opindex crossjumping
5253 Perform cross-jumping transformation.  This transformation unifies equivalent code and save code size.  The
5254 resulting code may or may not perform better than without cross-jumping.
5255
5256 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5257
5258 @item -fif-conversion
5259 @opindex if-conversion
5260 Attempt to transform conditional jumps into branch-less equivalents.  This
5261 include use of conditional moves, min, max, set flags and abs instructions, and
5262 some tricks doable by standard arithmetics.  The use of conditional execution
5263 on chips where it is available is controlled by @code{if-conversion2}.
5264
5265 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5266
5267 @item -fif-conversion2
5268 @opindex if-conversion2
5269 Use conditional execution (where available) to transform conditional jumps into
5270 branch-less equivalents.
5271
5272 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5273
5274 @item -fdelete-null-pointer-checks
5275 @opindex fdelete-null-pointer-checks
5276 Use global dataflow analysis to identify and eliminate useless checks
5277 for null pointers.  The compiler assumes that dereferencing a null
5278 pointer would have halted the program.  If a pointer is checked after
5279 it has already been dereferenced, it cannot be null.
5280
5281 In some environments, this assumption is not true, and programs can
5282 safely dereference null pointers.  Use
5283 @option{-fno-delete-null-pointer-checks} to disable this optimization
5284 for programs which depend on that behavior.
5285
5286 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5287
5288 @item -fexpensive-optimizations
5289 @opindex fexpensive-optimizations
5290 Perform a number of minor optimizations that are relatively expensive.
5291
5292 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5293
5294 @item -foptimize-register-move
5295 @itemx -fregmove
5296 @opindex foptimize-register-move
5297 @opindex fregmove
5298 Attempt to reassign register numbers in move instructions and as
5299 operands of other simple instructions in order to maximize the amount of
5300 register tying.  This is especially helpful on machines with two-operand
5301 instructions.
5302
5303 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
5304 optimization.
5305
5306 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5307
5308 @item -fdelayed-branch
5309 @opindex fdelayed-branch
5310 If supported for the target machine, attempt to reorder instructions
5311 to exploit instruction slots available after delayed branch
5312 instructions.
5313
5314 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5315
5316 @item -fschedule-insns
5317 @opindex fschedule-insns
5318 If supported for the target machine, attempt to reorder instructions to
5319 eliminate execution stalls due to required data being unavailable.  This
5320 helps machines that have slow floating point or memory load instructions
5321 by allowing other instructions to be issued until the result of the load
5322 or floating point instruction is required.
5323
5324 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5325
5326 @item -fschedule-insns2
5327 @opindex fschedule-insns2
5328 Similar to @option{-fschedule-insns}, but requests an additional pass of
5329 instruction scheduling after register allocation has been done.  This is
5330 especially useful on machines with a relatively small number of
5331 registers and where memory load instructions take more than one cycle.
5332
5333 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5334
5335 @item -fno-sched-interblock
5336 @opindex fno-sched-interblock
5337 Don't schedule instructions across basic blocks.  This is normally
5338 enabled by default when scheduling before register allocation, i.e.@:
5339 with @option{-fschedule-insns} or at @option{-O2} or higher.
5340
5341 @item -fno-sched-spec
5342 @opindex fno-sched-spec
5343 Don't allow speculative motion of non-load instructions.  This is normally
5344 enabled by default when scheduling before register allocation, i.e.@:
5345 with @option{-fschedule-insns} or at @option{-O2} or higher.
5346
5347 @item -fsched-spec-load
5348 @opindex fsched-spec-load
5349 Allow speculative motion of some load instructions.  This only makes
5350 sense when scheduling before register allocation, i.e.@: with
5351 @option{-fschedule-insns} or at @option{-O2} or higher.
5352
5353 @item -fsched-spec-load-dangerous
5354 @opindex fsched-spec-load-dangerous
5355 Allow speculative motion of more load instructions.  This only makes
5356 sense when scheduling before register allocation, i.e.@: with
5357 @option{-fschedule-insns} or at @option{-O2} or higher.
5358
5359 @item -fsched-stalled-insns=@var{n}
5360 @opindex fsched-stalled-insns
5361 Define how many insns (if any) can be moved prematurely from the queue
5362 of stalled insns into the ready list, during the second scheduling pass.
5363
5364 @item -fsched-stalled-insns-dep=@var{n}
5365 @opindex fsched-stalled-insns-dep
5366 Define how many insn groups (cycles) will be examined for a dependency
5367 on a stalled insn that is candidate for premature removal from the queue
5368 of stalled insns.  Has an effect only during the second scheduling pass,
5369 and only if @option{-fsched-stalled-insns} is used and its value is not zero.
5370
5371 @item -fsched2-use-superblocks
5372 @opindex fsched2-use-superblocks
5373 When scheduling after register allocation, do use superblock scheduling
5374 algorithm.  Superblock scheduling allows motion across basic block boundaries
5375 resulting on faster schedules.  This option is experimental, as not all machine
5376 descriptions used by GCC model the CPU closely enough to avoid unreliable
5377 results from the algorithm.
5378
5379 This only makes sense when scheduling after register allocation, i.e.@: with
5380 @option{-fschedule-insns2} or at @option{-O2} or higher.
5381
5382 @item -fsched2-use-traces
5383 @opindex fsched2-use-traces
5384 Use @option{-fsched2-use-superblocks} algorithm when scheduling after register
5385 allocation and additionally perform code duplication in order to increase the
5386 size of superblocks using tracer pass.  See @option{-ftracer} for details on
5387 trace formation.
5388
5389 This mode should produce faster but significantly longer programs.  Also
5390 without @option{-fbranch-probabilities} the traces constructed may not
5391 match the reality and hurt the performance.  This only makes
5392 sense when scheduling after register allocation, i.e.@: with
5393 @option{-fschedule-insns2} or at @option{-O2} or higher.
5394
5395 @item -fsee
5396 @opindex fsee
5397 Eliminates redundant extension instructions and move the non redundant
5398 ones to optimal placement using LCM.
5399
5400 @item -freschedule-modulo-scheduled-loops
5401 @opindex fscheduling-in-modulo-scheduled-loops
5402 The modulo scheduling comes before the traditional scheduling, if a loop was modulo scheduled
5403 we may want to prevent the later scheduling passes from changing its schedule, we use this
5404 option to control that.
5405
5406 @item -fcaller-saves
5407 @opindex fcaller-saves
5408 Enable values to be allocated in registers that will be clobbered by
5409 function calls, by emitting extra instructions to save and restore the
5410 registers around such calls.  Such allocation is done only when it
5411 seems to result in better code than would otherwise be produced.
5412
5413 This option is always enabled by default on certain machines, usually
5414 those which have no call-preserved registers to use instead.
5415
5416 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5417
5418 @item -ftree-pre
5419 Perform Partial Redundancy Elimination (PRE) on trees.  This flag is
5420 enabled by default at @option{-O2} and @option{-O3}.
5421
5422 @item -ftree-fre
5423 Perform Full Redundancy Elimination (FRE) on trees.  The difference
5424 between FRE and PRE is that FRE only considers expressions
5425 that are computed on all paths leading to the redundant computation.
5426 This analysis faster than PRE, though it exposes fewer redundancies.
5427 This flag is enabled by default at @option{-O} and higher.
5428
5429 @item -ftree-copy-prop
5430 Perform copy propagation on trees.  This pass eliminates unnecessary
5431 copy operations.  This flag is enabled by default at @option{-O} and
5432 higher.
5433
5434 @item -ftree-store-copy-prop
5435 Perform copy propagation of memory loads and stores.  This pass
5436 eliminates unnecessary copy operations in memory references
5437 (structures, global variables, arrays, etc).  This flag is enabled by
5438 default at @option{-O2} and higher.
5439
5440 @item -ftree-salias
5441 Perform structural alias analysis on trees.  This flag
5442 is enabled by default at @option{-O} and higher.
5443
5444 @item -fipa-pta
5445 Perform interprocedural pointer analysis.
5446
5447 @item -ftree-sink
5448 Perform forward store motion  on trees.  This flag is
5449 enabled by default at @option{-O} and higher.
5450
5451 @item -ftree-ccp
5452 Perform sparse conditional constant propagation (CCP) on trees.  This
5453 pass only operates on local scalar variables and is enabled by default
5454 at @option{-O} and higher.
5455
5456 @item -ftree-store-ccp
5457 Perform sparse conditional constant propagation (CCP) on trees.  This
5458 pass operates on both local scalar variables and memory stores and
5459 loads (global variables, structures, arrays, etc).  This flag is
5460 enabled by default at @option{-O2} and higher.
5461
5462 @item -ftree-dce
5463 Perform dead code elimination (DCE) on trees.  This flag is enabled by
5464 default at @option{-O} and higher.
5465
5466 @item -ftree-dominator-opts
5467 Perform a variety of simple scalar cleanups (constant/copy
5468 propagation, redundancy elimination, range propagation and expression
5469 simplification) based on a dominator tree traversal.  This also
5470 performs jump threading (to reduce jumps to jumps). This flag is
5471 enabled by default at @option{-O} and higher.
5472
5473 @item -ftree-ch
5474 Perform loop header copying on trees.  This is beneficial since it increases
5475 effectiveness of code motion optimizations.  It also saves one jump.  This flag
5476 is enabled by default at @option{-O} and higher.  It is not enabled
5477 for @option{-Os}, since it usually increases code size.
5478
5479 @item -ftree-loop-optimize
5480 Perform loop optimizations on trees.  This flag is enabled by default
5481 at @option{-O} and higher.
5482
5483 @item -ftree-loop-linear
5484 Perform linear loop transformations on tree.  This flag can improve cache
5485 performance and allow further loop optimizations to take place.
5486
5487 @item -fcheck-data-deps
5488 Compare the results of several data dependence analyzers.  This option
5489 is used for debugging the data dependence analyzers.
5490
5491 @item -ftree-loop-im
5492 Perform loop invariant motion on trees.  This pass moves only invariants that
5493 would be hard to handle at RTL level (function calls, operations that expand to
5494 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
5495 operands of conditions that are invariant out of the loop, so that we can use
5496 just trivial invariantness analysis in loop unswitching.  The pass also includes
5497 store motion.
5498
5499 @item -ftree-loop-ivcanon
5500 Create a canonical counter for number of iterations in the loop for that
5501 determining number of iterations requires complicated analysis.  Later
5502 optimizations then may determine the number easily.  Useful especially
5503 in connection with unrolling.
5504
5505 @item -fivopts
5506 Perform induction variable optimizations (strength reduction, induction
5507 variable merging and induction variable elimination) on trees.
5508
5509 @item -ftree-sra
5510 Perform scalar replacement of aggregates.  This pass replaces structure
5511 references with scalars to prevent committing structures to memory too
5512 early.  This flag is enabled by default at @option{-O} and higher.
5513
5514 @item -ftree-copyrename
5515 Perform copy renaming on trees.  This pass attempts to rename compiler
5516 temporaries to other variables at copy locations, usually resulting in
5517 variable names which more closely resemble the original variables.  This flag
5518 is enabled by default at @option{-O} and higher.
5519
5520 @item -ftree-ter
5521 Perform temporary expression replacement during the SSA->normal phase.  Single
5522 use/single def temporaries are replaced at their use location with their
5523 defining expression.  This results in non-GIMPLE code, but gives the expanders
5524 much more complex trees to work on resulting in better RTL generation.  This is
5525 enabled by default at @option{-O} and higher.
5526
5527 @item -ftree-vectorize
5528 Perform loop vectorization on trees.
5529
5530 @item -ftree-vect-loop-version
5531 @opindex ftree-vect-loop-version
5532 Perform loop versioning when doing loop vectorization on trees.  When a loop
5533 appears to be vectorizable except that data alignment or data dependence cannot
5534 be determined at compile time then vectorized and non-vectorized versions of
5535 the loop are generated along with runtime checks for alignment or dependence
5536 to control which version is executed.  This option is enabled by default
5537 except at level @option{-Os} where it is disabled.
5538
5539 @item -ftree-vrp
5540 Perform Value Range Propagation on trees.  This is similar to the
5541 constant propagation pass, but instead of values, ranges of values are
5542 propagated.  This allows the optimizers to remove unnecessary range
5543 checks like array bound checks and null pointer checks.  This is
5544 enabled by default at @option{-O2} and higher.  Null pointer check
5545 elimination is only done if @option{-fdelete-null-pointer-checks} is
5546 enabled.
5547
5548 @item -ftracer
5549 @opindex ftracer
5550 Perform tail duplication to enlarge superblock size.  This transformation
5551 simplifies the control flow of the function allowing other optimizations to do
5552 better job.
5553
5554 @item -funroll-loops
5555 @opindex funroll-loops
5556 Unroll loops whose number of iterations can be determined at compile
5557 time or upon entry to the loop.  @option{-funroll-loops} implies
5558 @option{-frerun-cse-after-loop}.  This option makes code larger,
5559 and may or may not make it run faster.
5560
5561 @item -funroll-all-loops
5562 @opindex funroll-all-loops
5563 Unroll all loops, even if their number of iterations is uncertain when
5564 the loop is entered.  This usually makes programs run more slowly.
5565 @option{-funroll-all-loops} implies the same options as
5566 @option{-funroll-loops},
5567
5568 @item -fsplit-ivs-in-unroller
5569 @opindex -fsplit-ivs-in-unroller
5570 Enables expressing of values of induction variables in later iterations
5571 of the unrolled loop using the value in the first iteration.  This breaks
5572 long dependency chains, thus improving efficiency of the scheduling passes.
5573
5574 Combination of @option{-fweb} and CSE is often sufficient to obtain the
5575 same effect.  However in cases the loop body is more complicated than
5576 a single basic block, this is not reliable.  It also does not work at all
5577 on some of the architectures due to restrictions in the CSE pass.
5578
5579 This optimization is enabled by default.
5580
5581 @item -fvariable-expansion-in-unroller
5582 @opindex -fvariable-expansion-in-unroller
5583 With this option, the compiler will create multiple copies of some
5584 local variables when unrolling a loop which can result in superior code.
5585
5586 @item -fprefetch-loop-arrays
5587 @opindex fprefetch-loop-arrays
5588 If supported by the target machine, generate instructions to prefetch
5589 memory to improve the performance of loops that access large arrays.
5590
5591 This option may generate better or worse code; results are highly
5592 dependent on the structure of loops within the source code.
5593
5594 Disabled at level @option{-Os}.
5595
5596 @item -fno-peephole
5597 @itemx -fno-peephole2
5598 @opindex fno-peephole
5599 @opindex fno-peephole2
5600 Disable any machine-specific peephole optimizations.  The difference
5601 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
5602 are implemented in the compiler; some targets use one, some use the
5603 other, a few use both.
5604
5605 @option{-fpeephole} is enabled by default.
5606 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5607
5608 @item -fno-guess-branch-probability
5609 @opindex fno-guess-branch-probability
5610 Do not guess branch probabilities using heuristics.
5611
5612 GCC will use heuristics to guess branch probabilities if they are
5613 not provided by profiling feedback (@option{-fprofile-arcs}).  These
5614 heuristics are based on the control flow graph.  If some branch probabilities
5615 are specified by @samp{__builtin_expect}, then the heuristics will be
5616 used to guess branch probabilities for the rest of the control flow graph,
5617 taking the @samp{__builtin_expect} info into account.  The interactions
5618 between the heuristics and @samp{__builtin_expect} can be complex, and in
5619 some cases, it may be useful to disable the heuristics so that the effects
5620 of @samp{__builtin_expect} are easier to understand.
5621
5622 The default is @option{-fguess-branch-probability} at levels
5623 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5624
5625 @item -freorder-blocks
5626 @opindex freorder-blocks
5627 Reorder basic blocks in the compiled function in order to reduce number of
5628 taken branches and improve code locality.
5629
5630 Enabled at levels @option{-O2}, @option{-O3}.
5631
5632 @item -freorder-blocks-and-partition
5633 @opindex freorder-blocks-and-partition
5634 In addition to reordering basic blocks in the compiled function, in order
5635 to reduce number of taken branches, partitions hot and cold basic blocks
5636 into separate sections of the assembly and .o files, to improve
5637 paging and cache locality performance.
5638
5639 This optimization is automatically turned off in the presence of
5640 exception handling, for linkonce sections, for functions with a user-defined
5641 section attribute and on any architecture that does not support named
5642 sections.
5643
5644 @item -freorder-functions
5645 @opindex freorder-functions
5646 Reorder functions in the object file in order to
5647 improve code locality.  This is implemented by using special
5648 subsections @code{.text.hot} for most frequently executed functions and
5649 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
5650 the linker so object file format must support named sections and linker must
5651 place them in a reasonable way.
5652
5653 Also profile feedback must be available in to make this option effective.  See
5654 @option{-fprofile-arcs} for details.
5655
5656 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5657
5658 @item -fstrict-aliasing
5659 @opindex fstrict-aliasing
5660 Allows the compiler to assume the strictest aliasing rules applicable to
5661 the language being compiled.  For C (and C++), this activates
5662 optimizations based on the type of expressions.  In particular, an
5663 object of one type is assumed never to reside at the same address as an
5664 object of a different type, unless the types are almost the same.  For
5665 example, an @code{unsigned int} can alias an @code{int}, but not a
5666 @code{void*} or a @code{double}.  A character type may alias any other
5667 type.
5668
5669 Pay special attention to code like this:
5670 @smallexample
5671 union a_union @{
5672   int i;
5673   double d;
5674 @};
5675
5676 int f() @{
5677   a_union t;
5678   t.d = 3.0;
5679   return t.i;
5680 @}
5681 @end smallexample
5682 The practice of reading from a different union member than the one most
5683 recently written to (called ``type-punning'') is common.  Even with
5684 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
5685 is accessed through the union type.  So, the code above will work as
5686 expected.  However, this code might not:
5687 @smallexample
5688 int f() @{
5689   a_union t;
5690   int* ip;
5691   t.d = 3.0;
5692   ip = &t.i;
5693   return *ip;
5694 @}
5695 @end smallexample
5696
5697 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5698
5699 @item -fstrict-overflow
5700 @opindex fstrict-overflow
5701 Allow the compiler to assume strict signed overflow rules, depending
5702 on the language being compiled.  For C (and C++) this means that
5703 overflow when doing arithmetic with signed numbers is undefined, which
5704 means that the compiler may assume that it will not happen.  This
5705 permits various optimizations.  For example, the compiler will assume
5706 that an expression like @code{i + 10 > i} will always be true for
5707 signed @code{i}.  This assumption is only valid if signed overflow is
5708 undefined, as the expression is false if @code{i + 10} overflows when
5709 using twos complement arithmetic.  When this option is in effect any
5710 attempt to determine whether an operation on signed numbers will
5711 overflow must be written carefully to not actually involve overflow.
5712
5713 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
5714 that signed overflow is fully defined: it wraps.  When
5715 @option{-fwrapv} is used, there is no difference between
5716 @option{-fstrict-overflow} and @option{-fno-strict-overflow}.  With
5717 @option{-fwrapv} certain types of overflow are permitted.  For
5718 example, if the compiler gets an overflow when doing arithmetic on
5719 constants, the overflowed value can still be used with
5720 @option{-fwrapv}, but not otherwise.
5721
5722 The @option{-fstrict-overflow} option is enabled at levels
5723 @option{-O2}, @option{-O3}, @option{-Os}.
5724
5725 @item -falign-functions
5726 @itemx -falign-functions=@var{n}
5727 @opindex falign-functions
5728 Align the start of functions to the next power-of-two greater than
5729 @var{n}, skipping up to @var{n} bytes.  For instance,
5730 @option{-falign-functions=32} aligns functions to the next 32-byte
5731 boundary, but @option{-falign-functions=24} would align to the next
5732 32-byte boundary only if this can be done by skipping 23 bytes or less.
5733
5734 @option{-fno-align-functions} and @option{-falign-functions=1} are
5735 equivalent and mean that functions will not be aligned.
5736
5737 Some assemblers only support this flag when @var{n} is a power of two;
5738 in that case, it is rounded up.
5739
5740 If @var{n} is not specified or is zero, use a machine-dependent default.
5741
5742 Enabled at levels @option{-O2}, @option{-O3}.
5743
5744 @item -falign-labels
5745 @itemx -falign-labels=@var{n}
5746 @opindex falign-labels
5747 Align all branch targets to a power-of-two boundary, skipping up to
5748 @var{n} bytes like @option{-falign-functions}.  This option can easily
5749 make code slower, because it must insert dummy operations for when the
5750 branch target is reached in the usual flow of the code.
5751
5752 @option{-fno-align-labels} and @option{-falign-labels=1} are
5753 equivalent and mean that labels will not be aligned.
5754
5755 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
5756 are greater than this value, then their values are used instead.
5757
5758 If @var{n} is not specified or is zero, use a machine-dependent default
5759 which is very likely to be @samp{1}, meaning no alignment.
5760
5761 Enabled at levels @option{-O2}, @option{-O3}.
5762
5763 @item -falign-loops
5764 @itemx -falign-loops=@var{n}
5765 @opindex falign-loops
5766 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
5767 like @option{-falign-functions}.  The hope is that the loop will be
5768 executed many times, which will make up for any execution of the dummy
5769 operations.
5770
5771 @option{-fno-align-loops} and @option{-falign-loops=1} are
5772 equivalent and mean that loops will not be aligned.
5773
5774 If @var{n} is not specified or is zero, use a machine-dependent default.
5775
5776 Enabled at levels @option{-O2}, @option{-O3}.
5777
5778 @item -falign-jumps
5779 @itemx -falign-jumps=@var{n}
5780 @opindex falign-jumps
5781 Align branch targets to a power-of-two boundary, for branch targets
5782 where the targets can only be reached by jumping, skipping up to @var{n}
5783 bytes like @option{-falign-functions}.  In this case, no dummy operations
5784 need be executed.
5785
5786 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
5787 equivalent and mean that loops will not be aligned.
5788
5789 If @var{n} is not specified or is zero, use a machine-dependent default.
5790
5791 Enabled at levels @option{-O2}, @option{-O3}.
5792
5793 @item -funit-at-a-time
5794 @opindex funit-at-a-time
5795 Parse the whole compilation unit before starting to produce code.
5796 This allows some extra optimizations to take place but consumes
5797 more memory (in general).  There are some compatibility issues
5798 with @emph{unit-at-a-time} mode:
5799 @itemize @bullet
5800 @item
5801 enabling @emph{unit-at-a-time} mode may change the order
5802 in which functions, variables, and top-level @code{asm} statements
5803 are emitted, and will likely break code relying on some particular
5804 ordering.  The majority of such top-level @code{asm} statements,
5805 though, can be replaced by @code{section} attributes.  The
5806 @option{fno-toplevel-reorder} option may be used to keep the ordering
5807 used in the input file, at the cost of some optimizations.
5808
5809 @item
5810 @emph{unit-at-a-time} mode removes unreferenced static variables
5811 and functions.  This may result in undefined references
5812 when an @code{asm} statement refers directly to variables or functions
5813 that are otherwise unused.  In that case either the variable/function
5814 shall be listed as an operand of the @code{asm} statement operand or,
5815 in the case of top-level @code{asm} statements the attribute @code{used}
5816 shall be used on the declaration.
5817
5818 @item
5819 Static functions now can use non-standard passing conventions that
5820 may break @code{asm} statements calling functions directly.  Again,
5821 attribute @code{used} will prevent this behavior.
5822 @end itemize
5823
5824 As a temporary workaround, @option{-fno-unit-at-a-time} can be used,
5825 but this scheme may not be supported by future releases of GCC@.
5826
5827 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5828
5829 @item -fno-toplevel-reorder
5830 Do not reorder top-level functions, variables, and @code{asm}
5831 statements.  Output them in the same order that they appear in the
5832 input file.  When this option is used, unreferenced static variables
5833 will not be removed.  This option is intended to support existing code
5834 which relies on a particular ordering.  For new code, it is better to
5835 use attributes.
5836
5837 @item -fweb
5838 @opindex fweb
5839 Constructs webs as commonly used for register allocation purposes and assign
5840 each web individual pseudo register.  This allows the register allocation pass
5841 to operate on pseudos directly, but also strengthens several other optimization
5842 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
5843 however, make debugging impossible, since variables will no longer stay in a
5844 ``home register''.
5845
5846 Enabled by default with @option{-funroll-loops}.
5847
5848 @item -fwhole-program
5849 @opindex fwhole-program
5850 Assume that the current compilation unit represents whole program being
5851 compiled.  All public functions and variables with the exception of @code{main}
5852 and those merged by attribute @code{externally_visible} become static functions
5853 and in a affect gets more aggressively optimized by interprocedural optimizers.
5854 While this option is equivalent to proper use of @code{static} keyword for
5855 programs consisting of single file, in combination with option
5856 @option{--combine} this flag can be used to compile most of smaller scale C
5857 programs since the functions and variables become local for the whole combined
5858 compilation unit, not for the single source file itself.
5859
5860
5861 @item -fno-cprop-registers
5862 @opindex fno-cprop-registers
5863 After register allocation and post-register allocation instruction splitting,
5864 we perform a copy-propagation pass to try to reduce scheduling dependencies
5865 and occasionally eliminate the copy.
5866
5867 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5868
5869 @item -fprofile-generate
5870 @opindex fprofile-generate
5871
5872 Enable options usually used for instrumenting application to produce
5873 profile useful for later recompilation with profile feedback based
5874 optimization.  You must use @option{-fprofile-generate} both when
5875 compiling and when linking your program.
5876
5877 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
5878
5879 @item -fprofile-use
5880 @opindex fprofile-use
5881 Enable profile feedback directed optimizations, and optimizations
5882 generally profitable only with profile feedback available.
5883
5884 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
5885 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}
5886
5887 By default, GCC emits an error message if the feedback profiles do not
5888 match the source code.  This error can be turned into a warning by using
5889 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
5890 code.
5891 @end table
5892
5893 The following options control compiler behavior regarding floating
5894 point arithmetic.  These options trade off between speed and
5895 correctness.  All must be specifically enabled.
5896
5897 @table @gcctabopt
5898 @item -ffloat-store
5899 @opindex ffloat-store
5900 Do not store floating point variables in registers, and inhibit other
5901 options that might change whether a floating point value is taken from a
5902 register or memory.
5903
5904 @cindex floating point precision
5905 This option prevents undesirable excess precision on machines such as
5906 the 68000 where the floating registers (of the 68881) keep more
5907 precision than a @code{double} is supposed to have.  Similarly for the
5908 x86 architecture.  For most programs, the excess precision does only
5909 good, but a few programs rely on the precise definition of IEEE floating
5910 point.  Use @option{-ffloat-store} for such programs, after modifying
5911 them to store all pertinent intermediate computations into variables.
5912
5913 @item -ffast-math
5914 @opindex ffast-math
5915 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations}, @*
5916 @option{-fno-trapping-math}, @option{-ffinite-math-only},
5917 @option{-fno-rounding-math}, @option{-fno-signaling-nans},
5918 @option{-fno-signed-zeros} and @option{fcx-limited-range}.
5919
5920 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
5921
5922 This option is not turned on by any @option{-O} option since
5923 it can result in incorrect output for programs which depend on
5924 an exact implementation of IEEE or ISO rules/specifications for
5925 math functions. It may, however, yield faster code for programs
5926 that do not require the guarantees of these specifications.
5927
5928 @item -fno-math-errno
5929 @opindex fno-math-errno
5930 Do not set ERRNO after calling math functions that are executed
5931 with a single instruction, e.g., sqrt.  A program that relies on
5932 IEEE exceptions for math error handling may want to use this flag
5933 for speed while maintaining IEEE arithmetic compatibility.
5934
5935 This option is not turned on by any @option{-O} option since
5936 it can result in incorrect output for programs which depend on
5937 an exact implementation of IEEE or ISO rules/specifications for
5938 math functions. It may, however, yield faster code for programs
5939 that do not require the guarantees of these specifications.
5940
5941 The default is @option{-fmath-errno}.
5942
5943 On Darwin systems, the math library never sets @code{errno}.  There is
5944 therefore no reason for the compiler to consider the possibility that
5945 it might, and @option{-fno-math-errno} is the default.
5946
5947 @item -funsafe-math-optimizations
5948 @opindex funsafe-math-optimizations
5949 Allow optimizations for floating-point arithmetic that (a) assume
5950 that arguments and results are valid and (b) may violate IEEE or
5951 ANSI standards.  When used at link-time, it may include libraries
5952 or startup files that change the default FPU control word or other
5953 similar optimizations.
5954
5955 This option is not turned on by any @option{-O} option since
5956 it can result in incorrect output for programs which depend on
5957 an exact implementation of IEEE or ISO rules/specifications for
5958 math functions. It may, however, yield faster code for programs
5959 that do not require the guarantees of these specifications.
5960
5961 The default is @option{-fno-unsafe-math-optimizations}.
5962
5963 @item -ffinite-math-only
5964 @opindex ffinite-math-only
5965 Allow optimizations for floating-point arithmetic that assume
5966 that arguments and results are not NaNs or +-Infs.
5967
5968 This option is not turned on by any @option{-O} option since
5969 it can result in incorrect output for programs which depend on
5970 an exact implementation of IEEE or ISO rules/specifications for
5971 math functions. It may, however, yield faster code for programs
5972 that do not require the guarantees of these specifications.
5973
5974 The default is @option{-fno-finite-math-only}.
5975
5976 @item -fno-signed-zeros
5977 @opindex fno-signed-zeros
5978 Allow optimizations for floating point arithmetic that ignore the
5979 signedness of zero.  IEEE arithmetic specifies the behavior of
5980 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
5981 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
5982 This option implies that the sign of a zero result isn't significant.
5983
5984 The default is @option{-fsigned-zeros}.
5985
5986 @item -fno-trapping-math
5987 @opindex fno-trapping-math
5988 Compile code assuming that floating-point operations cannot generate
5989 user-visible traps.  These traps include division by zero, overflow,
5990 underflow, inexact result and invalid operation.  This option implies
5991 @option{-fno-signaling-nans}.  Setting this option may allow faster
5992 code if one relies on ``non-stop'' IEEE arithmetic, for example.
5993
5994 This option should never be turned on by any @option{-O} option since
5995 it can result in incorrect output for programs which depend on
5996 an exact implementation of IEEE or ISO rules/specifications for
5997 math functions.
5998
5999 The default is @option{-ftrapping-math}.
6000
6001 @item -frounding-math
6002 @opindex frounding-math
6003 Disable transformations and optimizations that assume default floating
6004 point rounding behavior.  This is round-to-zero for all floating point
6005 to integer conversions, and round-to-nearest for all other arithmetic
6006 truncations.  This option should be specified for programs that change
6007 the FP rounding mode dynamically, or that may be executed with a
6008 non-default rounding mode.  This option disables constant folding of
6009 floating point expressions at compile-time (which may be affected by
6010 rounding mode) and arithmetic transformations that are unsafe in the
6011 presence of sign-dependent rounding modes.
6012
6013 The default is @option{-fno-rounding-math}.
6014
6015 This option is experimental and does not currently guarantee to
6016 disable all GCC optimizations that are affected by rounding mode.
6017 Future versions of GCC may provide finer control of this setting
6018 using C99's @code{FENV_ACCESS} pragma.  This command line option
6019 will be used to specify the default state for @code{FENV_ACCESS}.
6020
6021 @item -frtl-abstract-sequences
6022 @opindex frtl-abstract-sequences
6023 It is a size optimization method. This option is to find identical
6024 sequences of code, which can be turned into pseudo-procedures  and
6025 then  replace  all  occurrences with  calls to  the  newly created
6026 subroutine. It is kind of an opposite of @option{-finline-functions}.
6027 This optimization runs at RTL level.
6028
6029 @item -fsignaling-nans
6030 @opindex fsignaling-nans
6031 Compile code assuming that IEEE signaling NaNs may generate user-visible
6032 traps during floating-point operations.  Setting this option disables
6033 optimizations that may change the number of exceptions visible with
6034 signaling NaNs.  This option implies @option{-ftrapping-math}.
6035
6036 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
6037 be defined.
6038
6039 The default is @option{-fno-signaling-nans}.
6040
6041 This option is experimental and does not currently guarantee to
6042 disable all GCC optimizations that affect signaling NaN behavior.
6043
6044 @item -fsingle-precision-constant
6045 @opindex fsingle-precision-constant
6046 Treat floating point constant as single precision constant instead of
6047 implicitly converting it to double precision constant.
6048
6049 @item -fcx-limited-range
6050 @itemx -fno-cx-limited-range
6051 @opindex fcx-limited-range
6052 @opindex fno-cx-limited-range
6053 When enabled, this option states that a range reduction step is not
6054 needed when performing complex division.  The default is
6055 @option{-fno-cx-limited-range}, but is enabled by @option{-ffast-math}.
6056
6057 This option controls the default setting of the ISO C99
6058 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
6059 all languages.
6060
6061 @end table
6062
6063 The following options control optimizations that may improve
6064 performance, but are not enabled by any @option{-O} options.  This
6065 section includes experimental options that may produce broken code.
6066
6067 @table @gcctabopt
6068 @item -fbranch-probabilities
6069 @opindex fbranch-probabilities
6070 After running a program compiled with @option{-fprofile-arcs}
6071 (@pxref{Debugging Options,, Options for Debugging Your Program or
6072 @command{gcc}}), you can compile it a second time using
6073 @option{-fbranch-probabilities}, to improve optimizations based on
6074 the number of times each branch was taken.  When the program
6075 compiled with @option{-fprofile-arcs} exits it saves arc execution
6076 counts to a file called @file{@var{sourcename}.gcda} for each source
6077 file.  The information in this data file is very dependent on the
6078 structure of the generated code, so you must use the same source code
6079 and the same optimization options for both compilations.
6080
6081 With @option{-fbranch-probabilities}, GCC puts a
6082 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
6083 These can be used to improve optimization.  Currently, they are only
6084 used in one place: in @file{reorg.c}, instead of guessing which path a
6085 branch is mostly to take, the @samp{REG_BR_PROB} values are used to
6086 exactly determine which path is taken more often.
6087
6088 @item -fprofile-values
6089 @opindex fprofile-values
6090 If combined with @option{-fprofile-arcs}, it adds code so that some
6091 data about values of expressions in the program is gathered.
6092
6093 With @option{-fbranch-probabilities}, it reads back the data gathered
6094 from profiling values of expressions and adds @samp{REG_VALUE_PROFILE}
6095 notes to instructions for their later usage in optimizations.
6096
6097 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
6098
6099 @item -fvpt
6100 @opindex fvpt
6101 If combined with @option{-fprofile-arcs}, it instructs the compiler to add
6102 a code to gather information about values of expressions.
6103
6104 With @option{-fbranch-probabilities}, it reads back the data gathered
6105 and actually performs the optimizations based on them.
6106 Currently the optimizations include specialization of division operation
6107 using the knowledge about the value of the denominator.
6108
6109 @item -frename-registers
6110 @opindex frename-registers
6111 Attempt to avoid false dependencies in scheduled code by making use
6112 of registers left over after register allocation.  This optimization
6113 will most benefit processors with lots of registers.  Depending on the
6114 debug information format adopted by the target, however, it can
6115 make debugging impossible, since variables will no longer stay in
6116 a ``home register''.
6117
6118 Enabled by default with @option{-funroll-loops}.
6119
6120 @item -ftracer
6121 @opindex ftracer
6122 Perform tail duplication to enlarge superblock size.  This transformation
6123 simplifies the control flow of the function allowing other optimizations to do
6124 better job.
6125
6126 Enabled with @option{-fprofile-use}.
6127
6128 @item -funroll-loops
6129 @opindex funroll-loops
6130 Unroll loops whose number of iterations can be determined at compile time or
6131 upon entry to the loop.  @option{-funroll-loops} implies
6132 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
6133 It also turns on complete loop peeling (i.e.@: complete removal of loops with
6134 small constant number of iterations).  This option makes code larger, and may
6135 or may not make it run faster.
6136
6137 Enabled with @option{-fprofile-use}.
6138
6139 @item -funroll-all-loops
6140 @opindex funroll-all-loops
6141 Unroll all loops, even if their number of iterations is uncertain when
6142 the loop is entered.  This usually makes programs run more slowly.
6143 @option{-funroll-all-loops} implies the same options as
6144 @option{-funroll-loops}.
6145
6146 @item -fpeel-loops
6147 @opindex fpeel-loops
6148 Peels the loops for that there is enough information that they do not
6149 roll much (from profile feedback).  It also turns on complete loop peeling
6150 (i.e.@: complete removal of loops with small constant number of iterations).
6151
6152 Enabled with @option{-fprofile-use}.
6153
6154 @item -fmove-loop-invariants
6155 @opindex fmove-loop-invariants
6156 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
6157 at level @option{-O1}
6158
6159 @item -funswitch-loops
6160 @opindex funswitch-loops
6161 Move branches with loop invariant conditions out of the loop, with duplicates
6162 of the loop on both branches (modified according to result of the condition).
6163
6164 @item -ffunction-sections
6165 @itemx -fdata-sections
6166 @opindex ffunction-sections
6167 @opindex fdata-sections
6168 Place each function or data item into its own section in the output
6169 file if the target supports arbitrary sections.  The name of the
6170 function or the name of the data item determines the section's name
6171 in the output file.
6172
6173 Use these options on systems where the linker can perform optimizations
6174 to improve locality of reference in the instruction space.  Most systems
6175 using the ELF object format and SPARC processors running Solaris 2 have
6176 linkers with such optimizations.  AIX may have these optimizations in
6177 the future.
6178
6179 Only use these options when there are significant benefits from doing
6180 so.  When you specify these options, the assembler and linker will
6181 create larger object and executable files and will also be slower.
6182 You will not be able to use @code{gprof} on all systems if you
6183 specify this option and you may have problems with debugging if
6184 you specify both this option and @option{-g}.
6185
6186 @item -fbranch-target-load-optimize
6187 @opindex fbranch-target-load-optimize
6188 Perform branch target register load optimization before prologue / epilogue
6189 threading.
6190 The use of target registers can typically be exposed only during reload,
6191 thus hoisting loads out of loops and doing inter-block scheduling needs
6192 a separate optimization pass.
6193
6194 @item -fbranch-target-load-optimize2
6195 @opindex fbranch-target-load-optimize2
6196 Perform branch target register load optimization after prologue / epilogue
6197 threading.
6198
6199 @item -fbtr-bb-exclusive
6200 @opindex fbtr-bb-exclusive
6201 When performing branch target register load optimization, don't reuse
6202 branch target registers in within any basic block.
6203
6204 @item -fstack-protector
6205 Emit extra code to check for buffer overflows, such as stack smashing
6206 attacks.  This is done by adding a guard variable to functions with
6207 vulnerable objects.  This includes functions that call alloca, and
6208 functions with buffers larger than 8 bytes.  The guards are initialized
6209 when a function is entered and then checked when the function exits.
6210 If a guard check fails, an error message is printed and the program exits.
6211
6212 @item -fstack-protector-all
6213 Like @option{-fstack-protector} except that all functions are protected.
6214
6215 @item -fsection-anchors
6216 @opindex fsection-anchors
6217 Try to reduce the number of symbolic address calculations by using
6218 shared ``anchor'' symbols to address nearby objects.  This transformation
6219 can help to reduce the number of GOT entries and GOT accesses on some
6220 targets.
6221
6222 For example, the implementation of the following function @code{foo}:
6223
6224 @smallexample
6225 static int a, b, c;
6226 int foo (void) @{ return a + b + c; @}
6227 @end smallexample
6228
6229 would usually calculate the addresses of all three variables, but if you
6230 compile it with @option{-fsection-anchors}, it will access the variables
6231 from a common anchor point instead.  The effect is similar to the
6232 following pseudocode (which isn't valid C):
6233
6234 @smallexample
6235 int foo (void)
6236 @{
6237   register int *xr = &x;
6238   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
6239 @}
6240 @end smallexample
6241
6242 Not all targets support this option.
6243
6244 @item --param @var{name}=@var{value}
6245 @opindex param
6246 In some places, GCC uses various constants to control the amount of
6247 optimization that is done.  For example, GCC will not inline functions
6248 that contain more that a certain number of instructions.  You can
6249 control some of these constants on the command-line using the
6250 @option{--param} option.
6251
6252 The names of specific parameters, and the meaning of the values, are
6253 tied to the internals of the compiler, and are subject to change
6254 without notice in future releases.
6255
6256 In each case, the @var{value} is an integer.  The allowable choices for
6257 @var{name} are given in the following table:
6258
6259 @table @gcctabopt
6260 @item salias-max-implicit-fields
6261 The maximum number of fields in a variable without direct
6262 structure accesses for which structure aliasing will consider trying
6263 to track each field.  The default is 5
6264
6265 @item salias-max-array-elements
6266 The maximum number of elements an array can have and its elements
6267 still be tracked individually by structure aliasing. The default is 4
6268
6269 @item sra-max-structure-size
6270 The maximum structure size, in bytes, at which the scalar replacement
6271 of aggregates (SRA) optimization will perform block copies.  The
6272 default value, 0, implies that GCC will select the most appropriate
6273 size itself.
6274
6275 @item sra-field-structure-ratio
6276 The threshold ratio (as a percentage) between instantiated fields and
6277 the complete structure size.  We say that if the ratio of the number
6278 of bytes in instantiated fields to the number of bytes in the complete
6279 structure exceeds this parameter, then block copies are not used.  The
6280 default is 75.
6281
6282 @item max-crossjump-edges
6283 The maximum number of incoming edges to consider for crossjumping.
6284 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
6285 the number of edges incoming to each block.  Increasing values mean
6286 more aggressive optimization, making the compile time increase with
6287 probably small improvement in executable size.
6288
6289 @item min-crossjump-insns
6290 The minimum number of instructions which must be matched at the end
6291 of two blocks before crossjumping will be performed on them.  This
6292 value is ignored in the case where all instructions in the block being
6293 crossjumped from are matched.  The default value is 5.
6294
6295 @item max-grow-copy-bb-insns
6296 The maximum code size expansion factor when copying basic blocks
6297 instead of jumping.  The expansion is relative to a jump instruction.
6298 The default value is 8.
6299
6300 @item max-goto-duplication-insns
6301 The maximum number of instructions to duplicate to a block that jumps
6302 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
6303 passes, GCC factors computed gotos early in the compilation process,
6304 and unfactors them as late as possible.  Only computed jumps at the
6305 end of a basic blocks with no more than max-goto-duplication-insns are
6306 unfactored.  The default value is 8.
6307
6308 @item max-delay-slot-insn-search
6309 The maximum number of instructions to consider when looking for an
6310 instruction to fill a delay slot.  If more than this arbitrary number of
6311 instructions is searched, the time savings from filling the delay slot
6312 will be minimal so stop searching.  Increasing values mean more
6313 aggressive optimization, making the compile time increase with probably
6314 small improvement in executable run time.
6315
6316 @item max-delay-slot-live-search
6317 When trying to fill delay slots, the maximum number of instructions to
6318 consider when searching for a block with valid live register
6319 information.  Increasing this arbitrarily chosen value means more
6320 aggressive optimization, increasing the compile time.  This parameter
6321 should be removed when the delay slot code is rewritten to maintain the
6322 control-flow graph.
6323
6324 @item max-gcse-memory
6325 The approximate maximum amount of memory that will be allocated in
6326 order to perform the global common subexpression elimination
6327 optimization.  If more memory than specified is required, the
6328 optimization will not be done.
6329
6330 @item max-gcse-passes
6331 The maximum number of passes of GCSE to run.  The default is 1.
6332
6333 @item max-pending-list-length
6334 The maximum number of pending dependencies scheduling will allow
6335 before flushing the current state and starting over.  Large functions
6336 with few branches or calls can create excessively large lists which
6337 needlessly consume memory and resources.
6338
6339 @item max-inline-insns-single
6340 Several parameters control the tree inliner used in gcc.
6341 This number sets the maximum number of instructions (counted in GCC's
6342 internal representation) in a single function that the tree inliner
6343 will consider for inlining.  This only affects functions declared
6344 inline and methods implemented in a class declaration (C++).
6345 The default value is 450.
6346
6347 @item max-inline-insns-auto
6348 When you use @option{-finline-functions} (included in @option{-O3}),
6349 a lot of functions that would otherwise not be considered for inlining
6350 by the compiler will be investigated.  To those functions, a different
6351 (more restrictive) limit compared to functions declared inline can
6352 be applied.
6353 The default value is 90.
6354
6355 @item large-function-insns
6356 The limit specifying really large functions.  For functions larger than this
6357 limit after inlining inlining is constrained by
6358 @option{--param large-function-growth}.  This parameter is useful primarily
6359 to avoid extreme compilation time caused by non-linear algorithms used by the
6360 backend.
6361 This parameter is ignored when @option{-funit-at-a-time} is not used.
6362 The default value is 2700.
6363
6364 @item large-function-growth
6365 Specifies maximal growth of large function caused by inlining in percents.
6366 This parameter is ignored when @option{-funit-at-a-time} is not used.
6367 The default value is 100 which limits large function growth to 2.0 times
6368 the original size.
6369
6370 @item large-unit-insns
6371 The limit specifying large translation unit.  Growth caused by inlining of
6372 units larger than this limit is limited by @option{--param inline-unit-growth}.
6373 For small units this might be too tight (consider unit consisting of function A
6374 that is inline and B that just calls A three time.  If B is small relative to
6375 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
6376 large units consisting of small inlininable functions however the overall unit
6377 growth limit is needed to avoid exponential explosion of code size.  Thus for
6378 smaller units, the size is increased to @option{--param large-unit-insns}
6379 before applying @option{--param inline-unit-growth}.  The default is 10000
6380
6381 @item inline-unit-growth
6382 Specifies maximal overall growth of the compilation unit caused by inlining.
6383 This parameter is ignored when @option{-funit-at-a-time} is not used.
6384 The default value is 30 which limits unit growth to 1.3 times the original
6385 size.
6386
6387 @item large-stack-frame
6388 The limit specifying large stack frames.  While inlining the algorithm is trying
6389 to not grow past this limit too much.  Default value is 256 bytes.
6390
6391 @item large-stack-frame-growth
6392 Specifies maximal growth of large stack frames caused by inlining in percents.
6393 The default value is 1000 which limits large stack frame growth to 11 times
6394 the original size.
6395
6396 @item max-inline-insns-recursive
6397 @itemx max-inline-insns-recursive-auto
6398 Specifies maximum number of instructions out-of-line copy of self recursive inline
6399 function can grow into by performing recursive inlining.
6400
6401 For functions declared inline @option{--param max-inline-insns-recursive} is
6402 taken into account.  For function not declared inline, recursive inlining
6403 happens only when @option{-finline-functions} (included in @option{-O3}) is
6404 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
6405 default value is 450.
6406
6407 @item max-inline-recursive-depth
6408 @itemx max-inline-recursive-depth-auto
6409 Specifies maximum recursion depth used by the recursive inlining.
6410
6411 For functions declared inline @option{--param max-inline-recursive-depth} is
6412 taken into account.  For function not declared inline, recursive inlining
6413 happens only when @option{-finline-functions} (included in @option{-O3}) is
6414 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
6415 default value is 450.
6416
6417 @item min-inline-recursive-probability
6418 Recursive inlining is profitable only for function having deep recursion
6419 in average and can hurt for function having little recursion depth by
6420 increasing the prologue size or complexity of function body to other
6421 optimizers.
6422
6423 When profile feedback is available (see @option{-fprofile-generate}) the actual
6424 recursion depth can be guessed from probability that function will recurse via
6425 given call expression.  This parameter limits inlining only to call expression
6426 whose probability exceeds given threshold (in percents).  The default value is
6427 10.
6428
6429 @item inline-call-cost
6430 Specify cost of call instruction relative to simple arithmetics operations
6431 (having cost of 1).  Increasing this cost disqualifies inlining of non-leaf
6432 functions and at the same time increases size of leaf function that is believed to
6433 reduce function size by being inlined.  In effect it increases amount of
6434 inlining for code having large abstraction penalty (many functions that just
6435 pass the arguments to other functions) and decrease inlining for code with low
6436 abstraction penalty.  The default value is 16.
6437
6438 @item min-vect-loop-bound
6439 The minimum number of iterations under which a loop will not get vectorized
6440 when @option{-ftree-vectorize} is used.  The number of iterations after
6441 vectorization needs to be greater than the value specified by this option
6442 to allow vectorization.  The default value is 0.
6443
6444 @item max-unrolled-insns
6445 The maximum number of instructions that a loop should have if that loop
6446 is unrolled, and if the loop is unrolled, it determines how many times
6447 the loop code is unrolled.
6448
6449 @item max-average-unrolled-insns
6450 The maximum number of instructions biased by probabilities of their execution
6451 that a loop should have if that loop is unrolled, and if the loop is unrolled,
6452 it determines how many times the loop code is unrolled.
6453
6454 @item max-unroll-times
6455 The maximum number of unrollings of a single loop.
6456
6457 @item max-peeled-insns
6458 The maximum number of instructions that a loop should have if that loop
6459 is peeled, and if the loop is peeled, it determines how many times
6460 the loop code is peeled.
6461
6462 @item max-peel-times
6463 The maximum number of peelings of a single loop.
6464
6465 @item max-completely-peeled-insns
6466 The maximum number of insns of a completely peeled loop.
6467
6468 @item max-completely-peel-times
6469 The maximum number of iterations of a loop to be suitable for complete peeling.
6470
6471 @item max-unswitch-insns
6472 The maximum number of insns of an unswitched loop.
6473
6474 @item max-unswitch-level
6475 The maximum number of branches unswitched in a single loop.
6476
6477 @item lim-expensive
6478 The minimum cost of an expensive expression in the loop invariant motion.
6479
6480 @item iv-consider-all-candidates-bound
6481 Bound on number of candidates for induction variables below that
6482 all candidates are considered for each use in induction variable
6483 optimizations.  Only the most relevant candidates are considered
6484 if there are more candidates, to avoid quadratic time complexity.
6485
6486 @item iv-max-considered-uses
6487 The induction variable optimizations give up on loops that contain more
6488 induction variable uses.
6489
6490 @item iv-always-prune-cand-set-bound
6491 If number of candidates in the set is smaller than this value,
6492 we always try to remove unnecessary ivs from the set during its
6493 optimization when a new iv is added to the set.
6494
6495 @item scev-max-expr-size
6496 Bound on size of expressions used in the scalar evolutions analyzer.
6497 Large expressions slow the analyzer.
6498
6499 @item omega-max-vars
6500 The maximum number of variables in an Omega constraint system.
6501 The default value is 128.
6502
6503 @item omega-max-geqs
6504 The maximum number of inequalities in an Omega constraint system.
6505 The default value is 256.
6506
6507 @item omega-max-eqs
6508 The maximum number of equalities in an Omega constraint system.
6509 The default value is 128.
6510
6511 @item omega-max-wild-cards
6512 The maximum number of wildcard variables that the Omega solver will
6513 be able to insert.  The default value is 18.
6514
6515 @item omega-hash-table-size
6516 The size of the hash table in the Omega solver.  The default value is
6517 550.
6518
6519 @item omega-max-keys
6520 The maximal number of keys used by the Omega solver.  The default
6521 value is 500.
6522
6523 @item omega-eliminate-redundant-constraints
6524 When set to 1, use expensive methods to eliminate all redundant
6525 constraints.  The default value is 0.
6526
6527 @item vect-max-version-checks
6528 The maximum number of runtime checks that can be performed when doing
6529 loop versioning in the vectorizer.  See option ftree-vect-loop-version
6530 for more information.
6531
6532 @item max-iterations-to-track
6533
6534 The maximum number of iterations of a loop the brute force algorithm
6535 for analysis of # of iterations of the loop tries to evaluate.
6536
6537 @item hot-bb-count-fraction
6538 Select fraction of the maximal count of repetitions of basic block in program
6539 given basic block needs to have to be considered hot.
6540
6541 @item hot-bb-frequency-fraction
6542 Select fraction of the maximal frequency of executions of basic block in
6543 function given basic block needs to have to be considered hot
6544
6545 @item max-predicted-iterations
6546 The maximum number of loop iterations we predict statically.  This is useful
6547 in cases where function contain single loop with known bound and other loop
6548 with unknown.  We predict the known number of iterations correctly, while
6549 the unknown number of iterations average to roughly 10.  This means that the
6550 loop without bounds would appear artificially cold relative to the other one.
6551
6552 @item tracer-dynamic-coverage
6553 @itemx tracer-dynamic-coverage-feedback
6554
6555 This value is used to limit superblock formation once the given percentage of
6556 executed instructions is covered.  This limits unnecessary code size
6557 expansion.
6558
6559 The @option{tracer-dynamic-coverage-feedback} is used only when profile
6560 feedback is available.  The real profiles (as opposed to statically estimated
6561 ones) are much less balanced allowing the threshold to be larger value.
6562
6563 @item tracer-max-code-growth
6564 Stop tail duplication once code growth has reached given percentage.  This is
6565 rather hokey argument, as most of the duplicates will be eliminated later in
6566 cross jumping, so it may be set to much higher values than is the desired code
6567 growth.
6568
6569 @item tracer-min-branch-ratio
6570
6571 Stop reverse growth when the reverse probability of best edge is less than this
6572 threshold (in percent).
6573
6574 @item tracer-min-branch-ratio
6575 @itemx tracer-min-branch-ratio-feedback
6576
6577 Stop forward growth if the best edge do have probability lower than this
6578 threshold.
6579
6580 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
6581 compilation for profile feedback and one for compilation without.  The value
6582 for compilation with profile feedback needs to be more conservative (higher) in
6583 order to make tracer effective.
6584
6585 @item max-cse-path-length
6586
6587 Maximum number of basic blocks on path that cse considers.  The default is 10.
6588
6589 @item max-cse-insns
6590 The maximum instructions CSE process before flushing. The default is 1000.
6591
6592 @item max-aliased-vops
6593
6594 Maximum number of virtual operands per function allowed to represent
6595 aliases before triggering the alias partitioning heuristic.  Alias
6596 partitioning reduces compile times and memory consumption needed for
6597 aliasing at the expense of precision loss in alias information.  The
6598 default value for this parameter is 100 for -O1, 500 for -O2 and 1000
6599 for -O3.
6600
6601 Notice that if a function contains more memory statements than the
6602 value of this parameter, it is not really possible to achieve this
6603 reduction.  In this case, the compiler will use the number of memory
6604 statements as the value for @option{max-aliased-vops}.
6605
6606 @item avg-aliased-vops
6607
6608 Average number of virtual operands per statement allowed to represent
6609 aliases before triggering the alias partitioning heuristic.  This
6610 works in conjunction with @option{max-aliased-vops}.  If a function
6611 contains more than @option{max-aliased-vops} virtual operators, then
6612 memory symbols will be grouped into memory partitions until either the
6613 total number of virtual operators is below @option{max-aliased-vops}
6614 or the average number of virtual operators per memory statement is
6615 below @option{avg-aliased-vops}.  The default value for this parameter
6616 is 1 for -O1 and -O2, and 3 for -O3.
6617
6618 @item ggc-min-expand
6619
6620 GCC uses a garbage collector to manage its own memory allocation.  This
6621 parameter specifies the minimum percentage by which the garbage
6622 collector's heap should be allowed to expand between collections.
6623 Tuning this may improve compilation speed; it has no effect on code
6624 generation.
6625
6626 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
6627 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of "RAM" is
6628 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
6629 GCC is not able to calculate RAM on a particular platform, the lower
6630 bound of 30% is used.  Setting this parameter and
6631 @option{ggc-min-heapsize} to zero causes a full collection to occur at
6632 every opportunity.  This is extremely slow, but can be useful for
6633 debugging.
6634
6635 @item ggc-min-heapsize
6636
6637 Minimum size of the garbage collector's heap before it begins bothering
6638 to collect garbage.  The first collection occurs after the heap expands
6639 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
6640 tuning this may improve compilation speed, and has no effect on code
6641 generation.
6642
6643 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit which
6644 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
6645 with a lower bound of 4096 (four megabytes) and an upper bound of
6646 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
6647 particular platform, the lower bound is used.  Setting this parameter
6648 very large effectively disables garbage collection.  Setting this
6649 parameter and @option{ggc-min-expand} to zero causes a full collection
6650 to occur at every opportunity.
6651
6652 @item max-reload-search-insns
6653 The maximum number of instruction reload should look backward for equivalent
6654 register.  Increasing values mean more aggressive optimization, making the
6655 compile time increase with probably slightly better performance.  The default
6656 value is 100.
6657
6658 @item max-cselib-memory-locations
6659 The maximum number of memory locations cselib should take into account.
6660 Increasing values mean more aggressive optimization, making the compile time
6661 increase with probably slightly better performance.  The default value is 500.
6662
6663 @item max-flow-memory-locations
6664 Similar as @option{max-cselib-memory-locations} but for dataflow liveness.
6665 The default value is 100.
6666
6667 @item reorder-blocks-duplicate
6668 @itemx reorder-blocks-duplicate-feedback
6669
6670 Used by basic block reordering pass to decide whether to use unconditional
6671 branch or duplicate the code on its destination.  Code is duplicated when its
6672 estimated size is smaller than this value multiplied by the estimated size of
6673 unconditional jump in the hot spots of the program.
6674
6675 The @option{reorder-block-duplicate-feedback} is used only when profile
6676 feedback is available and may be set to higher values than
6677 @option{reorder-block-duplicate} since information about the hot spots is more
6678 accurate.
6679
6680 @item max-sched-ready-insns
6681 The maximum number of instructions ready to be issued the scheduler should
6682 consider at any given time during the first scheduling pass.  Increasing
6683 values mean more thorough searches, making the compilation time increase
6684 with probably little benefit.  The default value is 100.
6685
6686 @item max-sched-region-blocks
6687 The maximum number of blocks in a region to be considered for
6688 interblock scheduling.  The default value is 10.
6689
6690 @item max-sched-region-insns
6691 The maximum number of insns in a region to be considered for
6692 interblock scheduling.  The default value is 100.
6693
6694 @item min-spec-prob
6695 The minimum probability (in percents) of reaching a source block
6696 for interblock speculative scheduling.  The default value is 40.
6697
6698 @item max-sched-extend-regions-iters
6699 The maximum number of iterations through CFG to extend regions.
6700 0 - disable region extension,
6701 N - do at most N iterations.
6702 The default value is 0.
6703
6704 @item max-sched-insn-conflict-delay
6705 The maximum conflict delay for an insn to be considered for speculative motion.
6706 The default value is 3.
6707
6708 @item sched-spec-prob-cutoff
6709 The minimal probability of speculation success (in percents), so that
6710 speculative insn will be scheduled.
6711 The default value is 40.
6712
6713 @item max-last-value-rtl
6714
6715 The maximum size measured as number of RTLs that can be recorded in an expression
6716 in combiner for a pseudo register as last known value of that register.  The default
6717 is 10000.
6718
6719 @item integer-share-limit
6720 Small integer constants can use a shared data structure, reducing the
6721 compiler's memory usage and increasing its speed.  This sets the maximum
6722 value of a shared integer constant's.  The default value is 256.
6723
6724 @item min-virtual-mappings
6725 Specifies the minimum number of virtual mappings in the incremental
6726 SSA updater that should be registered to trigger the virtual mappings
6727 heuristic defined by virtual-mappings-ratio.  The default value is
6728 100.
6729
6730 @item virtual-mappings-ratio
6731 If the number of virtual mappings is virtual-mappings-ratio bigger
6732 than the number of virtual symbols to be updated, then the incremental
6733 SSA updater switches to a full update for those symbols.  The default
6734 ratio is 3.
6735
6736 @item ssp-buffer-size
6737 The minimum size of buffers (i.e. arrays) that will receive stack smashing
6738 protection when @option{-fstack-protection} is used.
6739
6740 @item max-jump-thread-duplication-stmts
6741 Maximum number of statements allowed in a block that needs to be
6742 duplicated when threading jumps.
6743
6744 @item max-fields-for-field-sensitive
6745 Maximum number of fields in a structure we will treat in
6746 a field sensitive manner during pointer analysis.
6747
6748 @item prefetch-latency
6749 Estimate on average number of instructions that are executed before
6750 prefetch finishes.  The distance we prefetch ahead is proportional
6751 to this constant.  Increasing this number may also lead to less
6752 streams being prefetched (see @option{simultaneous-prefetches}).
6753
6754 @item simultaneous-prefetches
6755 Maximum number of prefetches that can run at the same time.
6756
6757 @item l1-cache-line-size
6758 The size of cache line in L1 cache, in bytes.
6759
6760 @item l1-cache-size
6761 The number of cache lines in L1 cache.
6762
6763 @item verify-canonical-types
6764 Whether the compiler should verify the ``canonical'' types used for
6765 type equality comparisons within the C++ and Objective-C++ front
6766 ends. Set to 1 (the default when GCC is configured with
6767 --enable-checking) to enable verification, 0 to disable verification
6768 (the default when GCC is configured with --disable-checking).
6769
6770 @end table
6771 @end table
6772
6773 @node Preprocessor Options
6774 @section Options Controlling the Preprocessor
6775 @cindex preprocessor options
6776 @cindex options, preprocessor
6777
6778 These options control the C preprocessor, which is run on each C source
6779 file before actual compilation.
6780
6781 If you use the @option{-E} option, nothing is done except preprocessing.
6782 Some of these options make sense only together with @option{-E} because
6783 they cause the preprocessor output to be unsuitable for actual
6784 compilation.
6785
6786 @table @gcctabopt
6787 @opindex Wp
6788 You can use @option{-Wp,@var{option}} to bypass the compiler driver
6789 and pass @var{option} directly through to the preprocessor.  If
6790 @var{option} contains commas, it is split into multiple options at the
6791 commas.  However, many options are modified, translated or interpreted
6792 by the compiler driver before being passed to the preprocessor, and
6793 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
6794 interface is undocumented and subject to change, so whenever possible
6795 you should avoid using @option{-Wp} and let the driver handle the
6796 options instead.
6797
6798 @item -Xpreprocessor @var{option}
6799 @opindex preprocessor
6800 Pass @var{option} as an option to the preprocessor.  You can use this to
6801 supply system-specific preprocessor options which GCC does not know how to
6802 recognize.
6803
6804 If you want to pass an option that takes an argument, you must use
6805 @option{-Xpreprocessor} twice, once for the option and once for the argument.
6806 @end table
6807
6808 @include cppopts.texi
6809
6810 @node Assembler Options
6811 @section Passing Options to the Assembler
6812
6813 @c prevent bad page break with this line
6814 You can pass options to the assembler.
6815
6816 @table @gcctabopt
6817 @item -Wa,@var{option}
6818 @opindex Wa
6819 Pass @var{option} as an option to the assembler.  If @var{option}
6820 contains commas, it is split into multiple options at the commas.
6821
6822 @item -Xassembler @var{option}
6823 @opindex Xassembler
6824 Pass @var{option} as an option to the assembler.  You can use this to
6825 supply system-specific assembler options which GCC does not know how to
6826 recognize.
6827
6828 If you want to pass an option that takes an argument, you must use
6829 @option{-Xassembler} twice, once for the option and once for the argument.
6830
6831 @end table
6832
6833 @node Link Options
6834 @section Options for Linking
6835 @cindex link options
6836 @cindex options, linking
6837
6838 These options come into play when the compiler links object files into
6839 an executable output file.  They are meaningless if the compiler is
6840 not doing a link step.
6841
6842 @table @gcctabopt
6843 @cindex file names
6844 @item @var{object-file-name}
6845 A file name that does not end in a special recognized suffix is
6846 considered to name an object file or library.  (Object files are
6847 distinguished from libraries by the linker according to the file
6848 contents.)  If linking is done, these object files are used as input
6849 to the linker.
6850
6851 @item -c
6852 @itemx -S
6853 @itemx -E
6854 @opindex c
6855 @opindex S
6856 @opindex E
6857 If any of these options is used, then the linker is not run, and
6858 object file names should not be used as arguments.  @xref{Overall
6859 Options}.
6860
6861 @cindex Libraries
6862 @item -l@var{library}
6863 @itemx -l @var{library}
6864 @opindex l
6865 Search the library named @var{library} when linking.  (The second
6866 alternative with the library as a separate argument is only for
6867 POSIX compliance and is not recommended.)
6868
6869 It makes a difference where in the command you write this option; the
6870 linker searches and processes libraries and object files in the order they
6871 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
6872 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
6873 to functions in @samp{z}, those functions may not be loaded.
6874
6875 The linker searches a standard list of directories for the library,
6876 which is actually a file named @file{lib@var{library}.a}.  The linker
6877 then uses this file as if it had been specified precisely by name.
6878
6879 The directories searched include several standard system directories
6880 plus any that you specify with @option{-L}.
6881
6882 Normally the files found this way are library files---archive files
6883 whose members are object files.  The linker handles an archive file by
6884 scanning through it for members which define symbols that have so far
6885 been referenced but not defined.  But if the file that is found is an
6886 ordinary object file, it is linked in the usual fashion.  The only
6887 difference between using an @option{-l} option and specifying a file name
6888 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
6889 and searches several directories.
6890
6891 @item -lobjc
6892 @opindex lobjc
6893 You need this special case of the @option{-l} option in order to
6894 link an Objective-C or Objective-C++ program.
6895
6896 @item -nostartfiles
6897 @opindex nostartfiles
6898 Do not use the standard system startup files when linking.
6899 The standard system libraries are used normally, unless @option{-nostdlib}
6900 or @option{-nodefaultlibs} is used.
6901
6902 @item -nodefaultlibs
6903 @opindex nodefaultlibs
6904 Do not use the standard system libraries when linking.
6905 Only the libraries you specify will be passed to the linker.
6906 The standard startup files are used normally, unless @option{-nostartfiles}
6907 is used.  The compiler may generate calls to @code{memcmp},
6908 @code{memset}, @code{memcpy} and @code{memmove}.
6909 These entries are usually resolved by entries in
6910 libc.  These entry points should be supplied through some other
6911 mechanism when this option is specified.
6912
6913 @item -nostdlib
6914 @opindex nostdlib
6915 Do not use the standard system startup files or libraries when linking.
6916 No startup files and only the libraries you specify will be passed to
6917 the linker.  The compiler may generate calls to @code{memcmp}, @code{memset},
6918 @code{memcpy} and @code{memmove}.
6919 These entries are usually resolved by entries in
6920 libc.  These entry points should be supplied through some other
6921 mechanism when this option is specified.
6922
6923 @cindex @option{-lgcc}, use with @option{-nostdlib}
6924 @cindex @option{-nostdlib} and unresolved references
6925 @cindex unresolved references and @option{-nostdlib}
6926 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
6927 @cindex @option{-nodefaultlibs} and unresolved references
6928 @cindex unresolved references and @option{-nodefaultlibs}
6929 One of the standard libraries bypassed by @option{-nostdlib} and
6930 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
6931 that GCC uses to overcome shortcomings of particular machines, or special
6932 needs for some languages.
6933 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
6934 Collection (GCC) Internals},
6935 for more discussion of @file{libgcc.a}.)
6936 In most cases, you need @file{libgcc.a} even when you want to avoid
6937 other standard libraries.  In other words, when you specify @option{-nostdlib}
6938 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
6939 This ensures that you have no unresolved references to internal GCC
6940 library subroutines.  (For example, @samp{__main}, used to ensure C++
6941 constructors will be called; @pxref{Collect2,,@code{collect2}, gccint,
6942 GNU Compiler Collection (GCC) Internals}.)
6943
6944 @item -pie
6945 @opindex pie
6946 Produce a position independent executable on targets which support it.
6947 For predictable results, you must also specify the same set of options
6948 that were used to generate code (@option{-fpie}, @option{-fPIE},
6949 or model suboptions) when you specify this option.
6950
6951 @item -rdynamic
6952 @opindex rdynamic
6953 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
6954 that support it. This instructs the linker to add all symbols, not
6955 only used ones, to the dynamic symbol table. This option is needed
6956 for some uses of @code{dlopen} or to allow obtaining backtraces
6957 from within a program.
6958
6959 @item -s
6960 @opindex s
6961 Remove all symbol table and relocation information from the executable.
6962
6963 @item -static
6964 @opindex static
6965 On systems that support dynamic linking, this prevents linking with the shared
6966 libraries.  On other systems, this option has no effect.
6967
6968 @item -shared
6969 @opindex shared
6970 Produce a shared object which can then be linked with other objects to
6971 form an executable.  Not all systems support this option.  For predictable
6972 results, you must also specify the same set of options that were used to
6973 generate code (@option{-fpic}, @option{-fPIC}, or model suboptions)
6974 when you specify this option.@footnote{On some systems, @samp{gcc -shared}
6975 needs to build supplementary stub code for constructors to work.  On
6976 multi-libbed systems, @samp{gcc -shared} must select the correct support
6977 libraries to link against.  Failing to supply the correct flags may lead
6978 to subtle defects.  Supplying them in cases where they are not necessary
6979 is innocuous.}
6980
6981 @item -shared-libgcc
6982 @itemx -static-libgcc
6983 @opindex shared-libgcc
6984 @opindex static-libgcc
6985 On systems that provide @file{libgcc} as a shared library, these options
6986 force the use of either the shared or static version respectively.
6987 If no shared version of @file{libgcc} was built when the compiler was
6988 configured, these options have no effect.
6989
6990 There are several situations in which an application should use the
6991 shared @file{libgcc} instead of the static version.  The most common
6992 of these is when the application wishes to throw and catch exceptions
6993 across different shared libraries.  In that case, each of the libraries
6994 as well as the application itself should use the shared @file{libgcc}.
6995
6996 Therefore, the G++ and GCJ drivers automatically add
6997 @option{-shared-libgcc} whenever you build a shared library or a main
6998 executable, because C++ and Java programs typically use exceptions, so
6999 this is the right thing to do.
7000
7001 If, instead, you use the GCC driver to create shared libraries, you may
7002 find that they will not always be linked with the shared @file{libgcc}.
7003 If GCC finds, at its configuration time, that you have a non-GNU linker
7004 or a GNU linker that does not support option @option{--eh-frame-hdr},
7005 it will link the shared version of @file{libgcc} into shared libraries
7006 by default.  Otherwise, it will take advantage of the linker and optimize
7007 away the linking with the shared version of @file{libgcc}, linking with
7008 the static version of libgcc by default.  This allows exceptions to
7009 propagate through such shared libraries, without incurring relocation
7010 costs at library load time.
7011
7012 However, if a library or main executable is supposed to throw or catch
7013 exceptions, you must link it using the G++ or GCJ driver, as appropriate
7014 for the languages used in the program, or using the option
7015 @option{-shared-libgcc}, such that it is linked with the shared
7016 @file{libgcc}.
7017
7018 @item -symbolic
7019 @opindex symbolic
7020 Bind references to global symbols when building a shared object.  Warn
7021 about any unresolved references (unless overridden by the link editor
7022 option @samp{-Xlinker -z -Xlinker defs}).  Only a few systems support
7023 this option.
7024
7025 @item -Xlinker @var{option}
7026 @opindex Xlinker
7027 Pass @var{option} as an option to the linker.  You can use this to
7028 supply system-specific linker options which GCC does not know how to
7029 recognize.
7030
7031 If you want to pass an option that takes an argument, you must use
7032 @option{-Xlinker} twice, once for the option and once for the argument.
7033 For example, to pass @option{-assert definitions}, you must write
7034 @samp{-Xlinker -assert -Xlinker definitions}.  It does not work to write
7035 @option{-Xlinker "-assert definitions"}, because this passes the entire
7036 string as a single argument, which is not what the linker expects.
7037
7038 @item -Wl,@var{option}
7039 @opindex Wl
7040 Pass @var{option} as an option to the linker.  If @var{option} contains
7041 commas, it is split into multiple options at the commas.
7042
7043 @item -u @var{symbol}
7044 @opindex u
7045 Pretend the symbol @var{symbol} is undefined, to force linking of
7046 library modules to define it.  You can use @option{-u} multiple times with
7047 different symbols to force loading of additional library modules.
7048 @end table
7049
7050 @node Directory Options
7051 @section Options for Directory Search
7052 @cindex directory options
7053 @cindex options, directory search
7054 @cindex search path
7055
7056 These options specify directories to search for header files, for
7057 libraries and for parts of the compiler:
7058
7059 @table @gcctabopt
7060 @item -I@var{dir}
7061 @opindex I
7062 Add the directory @var{dir} to the head of the list of directories to be
7063 searched for header files.  This can be used to override a system header
7064 file, substituting your own version, since these directories are
7065 searched before the system header file directories.  However, you should
7066 not use this option to add directories that contain vendor-supplied
7067 system header files (use @option{-isystem} for that).  If you use more than
7068 one @option{-I} option, the directories are scanned in left-to-right
7069 order; the standard system directories come after.
7070
7071 If a standard system include directory, or a directory specified with
7072 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
7073 option will be ignored.  The directory will still be searched but as a
7074 system directory at its normal position in the system include chain.
7075 This is to ensure that GCC's procedure to fix buggy system headers and
7076 the ordering for the include_next directive are not inadvertently changed.
7077 If you really need to change the search order for system directories,
7078 use the @option{-nostdinc} and/or @option{-isystem} options.
7079
7080 @item -iquote@var{dir}
7081 @opindex iquote
7082 Add the directory @var{dir} to the head of the list of directories to
7083 be searched for header files only for the case of @samp{#include
7084 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
7085 otherwise just like @option{-I}.
7086
7087 @item -L@var{dir}
7088 @opindex L
7089 Add directory @var{dir} to the list of directories to be searched
7090 for @option{-l}.
7091
7092 @item -B@var{prefix}
7093 @opindex B
7094 This option specifies where to find the executables, libraries,
7095 include files, and data files of the compiler itself.
7096
7097 The compiler driver program runs one or more of the subprograms
7098 @file{cpp}, @file{cc1}, @file{as} and @file{ld}.  It tries
7099 @var{prefix} as a prefix for each program it tries to run, both with and
7100 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
7101
7102 For each subprogram to be run, the compiler driver first tries the
7103 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
7104 was not specified, the driver tries two standard prefixes, which are
7105 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
7106 those results in a file name that is found, the unmodified program
7107 name is searched for using the directories specified in your
7108 @env{PATH} environment variable.
7109
7110 The compiler will check to see if the path provided by the @option{-B}
7111 refers to a directory, and if necessary it will add a directory
7112 separator character at the end of the path.
7113
7114 @option{-B} prefixes that effectively specify directory names also apply
7115 to libraries in the linker, because the compiler translates these
7116 options into @option{-L} options for the linker.  They also apply to
7117 includes files in the preprocessor, because the compiler translates these
7118 options into @option{-isystem} options for the preprocessor.  In this case,
7119 the compiler appends @samp{include} to the prefix.
7120
7121 The run-time support file @file{libgcc.a} can also be searched for using
7122 the @option{-B} prefix, if needed.  If it is not found there, the two
7123 standard prefixes above are tried, and that is all.  The file is left
7124 out of the link if it is not found by those means.
7125
7126 Another way to specify a prefix much like the @option{-B} prefix is to use
7127 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
7128 Variables}.
7129
7130 As a special kludge, if the path provided by @option{-B} is
7131 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
7132 9, then it will be replaced by @file{[dir/]include}.  This is to help
7133 with boot-strapping the compiler.
7134
7135 @item -specs=@var{file}
7136 @opindex specs
7137 Process @var{file} after the compiler reads in the standard @file{specs}
7138 file, in order to override the defaults that the @file{gcc} driver
7139 program uses when determining what switches to pass to @file{cc1},
7140 @file{cc1plus}, @file{as}, @file{ld}, etc.  More than one
7141 @option{-specs=@var{file}} can be specified on the command line, and they
7142 are processed in order, from left to right.
7143
7144 @item --sysroot=@var{dir}
7145 @opindex sysroot
7146 Use @var{dir} as the logical root directory for headers and libraries.
7147 For example, if the compiler would normally search for headers in
7148 @file{/usr/include} and libraries in @file{/usr/lib}, it will instead
7149 search @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
7150
7151 If you use both this option and the @option{-isysroot} option, then
7152 the @option{--sysroot} option will apply to libraries, but the
7153 @option{-isysroot} option will apply to header files.
7154
7155 The GNU linker (beginning with version 2.16) has the necessary support
7156 for this option.  If your linker does not support this option, the
7157 header file aspect of @option{--sysroot} will still work, but the
7158 library aspect will not.
7159
7160 @item -I-
7161 @opindex I-
7162 This option has been deprecated.  Please use @option{-iquote} instead for
7163 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
7164 Any directories you specify with @option{-I} options before the @option{-I-}
7165 option are searched only for the case of @samp{#include "@var{file}"};
7166 they are not searched for @samp{#include <@var{file}>}.
7167
7168 If additional directories are specified with @option{-I} options after
7169 the @option{-I-}, these directories are searched for all @samp{#include}
7170 directives.  (Ordinarily @emph{all} @option{-I} directories are used
7171 this way.)
7172
7173 In addition, the @option{-I-} option inhibits the use of the current
7174 directory (where the current input file came from) as the first search
7175 directory for @samp{#include "@var{file}"}.  There is no way to
7176 override this effect of @option{-I-}.  With @option{-I.} you can specify
7177 searching the directory which was current when the compiler was
7178 invoked.  That is not exactly the same as what the preprocessor does
7179 by default, but it is often satisfactory.
7180
7181 @option{-I-} does not inhibit the use of the standard system directories
7182 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
7183 independent.
7184 @end table
7185
7186 @c man end
7187
7188 @node Spec Files
7189 @section Specifying subprocesses and the switches to pass to them
7190 @cindex Spec Files
7191
7192 @command{gcc} is a driver program.  It performs its job by invoking a
7193 sequence of other programs to do the work of compiling, assembling and
7194 linking.  GCC interprets its command-line parameters and uses these to
7195 deduce which programs it should invoke, and which command-line options
7196 it ought to place on their command lines.  This behavior is controlled
7197 by @dfn{spec strings}.  In most cases there is one spec string for each
7198 program that GCC can invoke, but a few programs have multiple spec
7199 strings to control their behavior.  The spec strings built into GCC can
7200 be overridden by using the @option{-specs=} command-line switch to specify
7201 a spec file.
7202
7203 @dfn{Spec files} are plaintext files that are used to construct spec
7204 strings.  They consist of a sequence of directives separated by blank
7205 lines.  The type of directive is determined by the first non-whitespace
7206 character on the line and it can be one of the following:
7207
7208 @table @code
7209 @item %@var{command}
7210 Issues a @var{command} to the spec file processor.  The commands that can
7211 appear here are:
7212
7213 @table @code
7214 @item %include <@var{file}>
7215 @cindex %include
7216 Search for @var{file} and insert its text at the current point in the
7217 specs file.
7218
7219 @item %include_noerr <@var{file}>
7220 @cindex %include_noerr
7221 Just like @samp{%include}, but do not generate an error message if the include
7222 file cannot be found.
7223
7224 @item %rename @var{old_name} @var{new_name}
7225 @cindex %rename
7226 Rename the spec string @var{old_name} to @var{new_name}.
7227
7228 @end table
7229
7230 @item *[@var{spec_name}]:
7231 This tells the compiler to create, override or delete the named spec
7232 string.  All lines after this directive up to the next directive or
7233 blank line are considered to be the text for the spec string.  If this
7234 results in an empty string then the spec will be deleted.  (Or, if the
7235 spec did not exist, then nothing will happened.)  Otherwise, if the spec
7236 does not currently exist a new spec will be created.  If the spec does
7237 exist then its contents will be overridden by the text of this
7238 directive, unless the first character of that text is the @samp{+}
7239 character, in which case the text will be appended to the spec.
7240
7241 @item [@var{suffix}]:
7242 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
7243 and up to the next directive or blank line are considered to make up the
7244 spec string for the indicated suffix.  When the compiler encounters an
7245 input file with the named suffix, it will processes the spec string in
7246 order to work out how to compile that file.  For example:
7247
7248 @smallexample
7249 .ZZ:
7250 z-compile -input %i
7251 @end smallexample
7252
7253 This says that any input file whose name ends in @samp{.ZZ} should be
7254 passed to the program @samp{z-compile}, which should be invoked with the
7255 command-line switch @option{-input} and with the result of performing the
7256 @samp{%i} substitution.  (See below.)
7257
7258 As an alternative to providing a spec string, the text that follows a
7259 suffix directive can be one of the following:
7260
7261 @table @code
7262 @item @@@var{language}
7263 This says that the suffix is an alias for a known @var{language}.  This is
7264 similar to using the @option{-x} command-line switch to GCC to specify a
7265 language explicitly.  For example:
7266
7267 @smallexample
7268 .ZZ:
7269 @@c++
7270 @end smallexample
7271
7272 Says that .ZZ files are, in fact, C++ source files.
7273
7274 @item #@var{name}
7275 This causes an error messages saying:
7276
7277 @smallexample
7278 @var{name} compiler not installed on this system.
7279 @end smallexample
7280 @end table
7281
7282 GCC already has an extensive list of suffixes built into it.
7283 This directive will add an entry to the end of the list of suffixes, but
7284 since the list is searched from the end backwards, it is effectively
7285 possible to override earlier entries using this technique.
7286
7287 @end table
7288
7289 GCC has the following spec strings built into it.  Spec files can
7290 override these strings or create their own.  Note that individual
7291 targets can also add their own spec strings to this list.
7292
7293 @smallexample
7294 asm          Options to pass to the assembler
7295 asm_final    Options to pass to the assembler post-processor
7296 cpp          Options to pass to the C preprocessor
7297 cc1          Options to pass to the C compiler
7298 cc1plus      Options to pass to the C++ compiler
7299 endfile      Object files to include at the end of the link
7300 link         Options to pass to the linker
7301 lib          Libraries to include on the command line to the linker
7302 libgcc       Decides which GCC support library to pass to the linker
7303 linker       Sets the name of the linker
7304 predefines   Defines to be passed to the C preprocessor
7305 signed_char  Defines to pass to CPP to say whether @code{char} is signed
7306              by default
7307 startfile    Object files to include at the start of the link
7308 @end smallexample
7309
7310 Here is a small example of a spec file:
7311
7312 @smallexample
7313 %rename lib                 old_lib
7314
7315 *lib:
7316 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
7317 @end smallexample
7318
7319 This example renames the spec called @samp{lib} to @samp{old_lib} and
7320 then overrides the previous definition of @samp{lib} with a new one.
7321 The new definition adds in some extra command-line options before
7322 including the text of the old definition.
7323
7324 @dfn{Spec strings} are a list of command-line options to be passed to their
7325 corresponding program.  In addition, the spec strings can contain
7326 @samp{%}-prefixed sequences to substitute variable text or to
7327 conditionally insert text into the command line.  Using these constructs
7328 it is possible to generate quite complex command lines.
7329
7330 Here is a table of all defined @samp{%}-sequences for spec
7331 strings.  Note that spaces are not generated automatically around the
7332 results of expanding these sequences.  Therefore you can concatenate them
7333 together or combine them with constant text in a single argument.
7334
7335 @table @code
7336 @item %%
7337 Substitute one @samp{%} into the program name or argument.
7338
7339 @item %i
7340 Substitute the name of the input file being processed.
7341
7342 @item %b
7343 Substitute the basename of the input file being processed.
7344 This is the substring up to (and not including) the last period
7345 and not including the directory.
7346
7347 @item %B
7348 This is the same as @samp{%b}, but include the file suffix (text after
7349 the last period).
7350
7351 @item %d
7352 Marks the argument containing or following the @samp{%d} as a
7353 temporary file name, so that that file will be deleted if GCC exits
7354 successfully.  Unlike @samp{%g}, this contributes no text to the
7355 argument.
7356
7357 @item %g@var{suffix}
7358 Substitute a file name that has suffix @var{suffix} and is chosen
7359 once per compilation, and mark the argument in the same way as
7360 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
7361 name is now chosen in a way that is hard to predict even when previously
7362 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
7363 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
7364 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
7365 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
7366 was simply substituted with a file name chosen once per compilation,
7367 without regard to any appended suffix (which was therefore treated
7368 just like ordinary text), making such attacks more likely to succeed.
7369
7370 @item %u@var{suffix}
7371 Like @samp{%g}, but generates a new temporary file name even if
7372 @samp{%u@var{suffix}} was already seen.
7373
7374 @item %U@var{suffix}
7375 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
7376 new one if there is no such last file name.  In the absence of any
7377 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
7378 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
7379 would involve the generation of two distinct file names, one
7380 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
7381 simply substituted with a file name chosen for the previous @samp{%u},
7382 without regard to any appended suffix.
7383
7384 @item %j@var{suffix}
7385 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
7386 writable, and if save-temps is off; otherwise, substitute the name
7387 of a temporary file, just like @samp{%u}.  This temporary file is not
7388 meant for communication between processes, but rather as a junk
7389 disposal mechanism.
7390
7391 @item %|@var{suffix}
7392 @itemx %m@var{suffix}
7393 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
7394 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
7395 all.  These are the two most common ways to instruct a program that it
7396 should read from standard input or write to standard output.  If you
7397 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
7398 construct: see for example @file{f/lang-specs.h}.
7399
7400 @item %.@var{SUFFIX}
7401 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
7402 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
7403 terminated by the next space or %.
7404
7405 @item %w
7406 Marks the argument containing or following the @samp{%w} as the
7407 designated output file of this compilation.  This puts the argument
7408 into the sequence of arguments that @samp{%o} will substitute later.
7409
7410 @item %o
7411 Substitutes the names of all the output files, with spaces
7412 automatically placed around them.  You should write spaces
7413 around the @samp{%o} as well or the results are undefined.
7414 @samp{%o} is for use in the specs for running the linker.
7415 Input files whose names have no recognized suffix are not compiled
7416 at all, but they are included among the output files, so they will
7417 be linked.
7418
7419 @item %O
7420 Substitutes the suffix for object files.  Note that this is
7421 handled specially when it immediately follows @samp{%g, %u, or %U},
7422 because of the need for those to form complete file names.  The
7423 handling is such that @samp{%O} is treated exactly as if it had already
7424 been substituted, except that @samp{%g, %u, and %U} do not currently
7425 support additional @var{suffix} characters following @samp{%O} as they would
7426 following, for example, @samp{.o}.
7427
7428 @item %p
7429 Substitutes the standard macro predefinitions for the
7430 current target machine.  Use this when running @code{cpp}.
7431
7432 @item %P
7433 Like @samp{%p}, but puts @samp{__} before and after the name of each
7434 predefined macro, except for macros that start with @samp{__} or with
7435 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
7436 C@.
7437
7438 @item %I
7439 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
7440 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
7441 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
7442 and @option{-imultilib} as necessary.
7443
7444 @item %s
7445 Current argument is the name of a library or startup file of some sort.
7446 Search for that file in a standard list of directories and substitute
7447 the full name found.
7448
7449 @item %e@var{str}
7450 Print @var{str} as an error message.  @var{str} is terminated by a newline.
7451 Use this when inconsistent options are detected.
7452
7453 @item %(@var{name})
7454 Substitute the contents of spec string @var{name} at this point.
7455
7456 @item %[@var{name}]
7457 Like @samp{%(@dots{})} but put @samp{__} around @option{-D} arguments.
7458
7459 @item %x@{@var{option}@}
7460 Accumulate an option for @samp{%X}.
7461
7462 @item %X
7463 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
7464 spec string.
7465
7466 @item %Y
7467 Output the accumulated assembler options specified by @option{-Wa}.
7468
7469 @item %Z
7470 Output the accumulated preprocessor options specified by @option{-Wp}.
7471
7472 @item %a
7473 Process the @code{asm} spec.  This is used to compute the
7474 switches to be passed to the assembler.
7475
7476 @item %A
7477 Process the @code{asm_final} spec.  This is a spec string for
7478 passing switches to an assembler post-processor, if such a program is
7479 needed.
7480
7481 @item %l
7482 Process the @code{link} spec.  This is the spec for computing the
7483 command line passed to the linker.  Typically it will make use of the
7484 @samp{%L %G %S %D and %E} sequences.
7485
7486 @item %D
7487 Dump out a @option{-L} option for each directory that GCC believes might
7488 contain startup files.  If the target supports multilibs then the
7489 current multilib directory will be prepended to each of these paths.
7490
7491 @item %L
7492 Process the @code{lib} spec.  This is a spec string for deciding which
7493 libraries should be included on the command line to the linker.
7494
7495 @item %G
7496 Process the @code{libgcc} spec.  This is a spec string for deciding
7497 which GCC support library should be included on the command line to the linker.
7498
7499 @item %S
7500 Process the @code{startfile} spec.  This is a spec for deciding which
7501 object files should be the first ones passed to the linker.  Typically
7502 this might be a file named @file{crt0.o}.
7503
7504 @item %E
7505 Process the @code{endfile} spec.  This is a spec string that specifies
7506 the last object files that will be passed to the linker.
7507
7508 @item %C
7509 Process the @code{cpp} spec.  This is used to construct the arguments
7510 to be passed to the C preprocessor.
7511
7512 @item %1
7513 Process the @code{cc1} spec.  This is used to construct the options to be
7514 passed to the actual C compiler (@samp{cc1}).
7515
7516 @item %2
7517 Process the @code{cc1plus} spec.  This is used to construct the options to be
7518 passed to the actual C++ compiler (@samp{cc1plus}).
7519
7520 @item %*
7521 Substitute the variable part of a matched option.  See below.
7522 Note that each comma in the substituted string is replaced by
7523 a single space.
7524
7525 @item %<@code{S}
7526 Remove all occurrences of @code{-S} from the command line.  Note---this
7527 command is position dependent.  @samp{%} commands in the spec string
7528 before this one will see @code{-S}, @samp{%} commands in the spec string
7529 after this one will not.
7530
7531 @item %:@var{function}(@var{args})
7532 Call the named function @var{function}, passing it @var{args}.
7533 @var{args} is first processed as a nested spec string, then split
7534 into an argument vector in the usual fashion.  The function returns
7535 a string which is processed as if it had appeared literally as part
7536 of the current spec.
7537
7538 The following built-in spec functions are provided:
7539
7540 @table @code
7541 @item @code{getenv}
7542 The @code{getenv} spec function takes two arguments: an environment
7543 variable name and a string.  If the environment variable is not
7544 defined, a fatal error is issued.  Otherwise, the return value is the
7545 value of the environment variable concatenated with the string.  For
7546 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
7547
7548 @smallexample
7549 %:getenv(TOPDIR /include)
7550 @end smallexample
7551
7552 expands to @file{/path/to/top/include}.
7553
7554 @item @code{if-exists}
7555 The @code{if-exists} spec function takes one argument, an absolute
7556 pathname to a file.  If the file exists, @code{if-exists} returns the
7557 pathname.  Here is a small example of its usage:
7558
7559 @smallexample
7560 *startfile:
7561 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
7562 @end smallexample
7563
7564 @item @code{if-exists-else}
7565 The @code{if-exists-else} spec function is similar to the @code{if-exists}
7566 spec function, except that it takes two arguments.  The first argument is
7567 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
7568 returns the pathname.  If it does not exist, it returns the second argument.
7569 This way, @code{if-exists-else} can be used to select one file or another,
7570 based on the existence of the first.  Here is a small example of its usage:
7571
7572 @smallexample
7573 *startfile:
7574 crt0%O%s %:if-exists(crti%O%s) \
7575 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
7576 @end smallexample
7577
7578 @item @code{replace-outfile}
7579 The @code{replace-outfile} spec function takes two arguments.  It looks for the
7580 first argument in the outfiles array and replaces it with the second argument.  Here
7581 is a small example of its usage:
7582
7583 @smallexample
7584 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
7585 @end smallexample
7586
7587 @end table
7588
7589 @item %@{@code{S}@}
7590 Substitutes the @code{-S} switch, if that switch was given to GCC@.
7591 If that switch was not specified, this substitutes nothing.  Note that
7592 the leading dash is omitted when specifying this option, and it is
7593 automatically inserted if the substitution is performed.  Thus the spec
7594 string @samp{%@{foo@}} would match the command-line option @option{-foo}
7595 and would output the command line option @option{-foo}.
7596
7597 @item %W@{@code{S}@}
7598 Like %@{@code{S}@} but mark last argument supplied within as a file to be
7599 deleted on failure.
7600
7601 @item %@{@code{S}*@}
7602 Substitutes all the switches specified to GCC whose names start
7603 with @code{-S}, but which also take an argument.  This is used for
7604 switches like @option{-o}, @option{-D}, @option{-I}, etc.
7605 GCC considers @option{-o foo} as being
7606 one switch whose names starts with @samp{o}.  %@{o*@} would substitute this
7607 text, including the space.  Thus two arguments would be generated.
7608
7609 @item %@{@code{S}*&@code{T}*@}
7610 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
7611 (the order of @code{S} and @code{T} in the spec is not significant).
7612 There can be any number of ampersand-separated variables; for each the
7613 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
7614
7615 @item %@{@code{S}:@code{X}@}
7616 Substitutes @code{X}, if the @samp{-S} switch was given to GCC@.
7617
7618 @item %@{!@code{S}:@code{X}@}
7619 Substitutes @code{X}, if the @samp{-S} switch was @emph{not} given to GCC@.
7620
7621 @item %@{@code{S}*:@code{X}@}
7622 Substitutes @code{X} if one or more switches whose names start with
7623 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
7624 once, no matter how many such switches appeared.  However, if @code{%*}
7625 appears somewhere in @code{X}, then @code{X} will be substituted once
7626 for each matching switch, with the @code{%*} replaced by the part of
7627 that switch that matched the @code{*}.
7628
7629 @item %@{.@code{S}:@code{X}@}
7630 Substitutes @code{X}, if processing a file with suffix @code{S}.
7631
7632 @item %@{!.@code{S}:@code{X}@}
7633 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
7634
7635 @item %@{,@code{S}:@code{X}@}
7636 Substitutes @code{X}, if processing a file for language @code{S}.
7637
7638 @item %@{!,@code{S}:@code{X}@}
7639 Substitutes @code{X}, if not processing a file for language @code{S}.
7640
7641 @item %@{@code{S}|@code{P}:@code{X}@}
7642 Substitutes @code{X} if either @code{-S} or @code{-P} was given to
7643 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
7644 @code{*} sequences as well, although they have a stronger binding than
7645 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
7646 alternatives must be starred, and only the first matching alternative
7647 is substituted.
7648
7649 For example, a spec string like this:
7650
7651 @smallexample
7652 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
7653 @end smallexample
7654
7655 will output the following command-line options from the following input
7656 command-line options:
7657
7658 @smallexample
7659 fred.c        -foo -baz
7660 jim.d         -bar -boggle
7661 -d fred.c     -foo -baz -boggle
7662 -d jim.d      -bar -baz -boggle
7663 @end smallexample
7664
7665 @item %@{S:X; T:Y; :D@}
7666
7667 If @code{S} was given to GCC, substitutes @code{X}; else if @code{T} was
7668 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
7669 be as many clauses as you need.  This may be combined with @code{.},
7670 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
7671
7672
7673 @end table
7674
7675 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
7676 construct may contain other nested @samp{%} constructs or spaces, or
7677 even newlines.  They are processed as usual, as described above.
7678 Trailing white space in @code{X} is ignored.  White space may also
7679 appear anywhere on the left side of the colon in these constructs,
7680 except between @code{.} or @code{*} and the corresponding word.
7681
7682 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
7683 handled specifically in these constructs.  If another value of
7684 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
7685 @option{-W} switch is found later in the command line, the earlier
7686 switch value is ignored, except with @{@code{S}*@} where @code{S} is
7687 just one letter, which passes all matching options.
7688
7689 The character @samp{|} at the beginning of the predicate text is used to
7690 indicate that a command should be piped to the following command, but
7691 only if @option{-pipe} is specified.
7692
7693 It is built into GCC which switches take arguments and which do not.
7694 (You might think it would be useful to generalize this to allow each
7695 compiler's spec to say which switches take arguments.  But this cannot
7696 be done in a consistent fashion.  GCC cannot even decide which input
7697 files have been specified without knowing which switches take arguments,
7698 and it must know which input files to compile in order to tell which
7699 compilers to run).
7700
7701 GCC also knows implicitly that arguments starting in @option{-l} are to be
7702 treated as compiler output files, and passed to the linker in their
7703 proper position among the other output files.
7704
7705 @c man begin OPTIONS
7706
7707 @node Target Options
7708 @section Specifying Target Machine and Compiler Version
7709 @cindex target options
7710 @cindex cross compiling
7711 @cindex specifying machine version
7712 @cindex specifying compiler version and target machine
7713 @cindex compiler version, specifying
7714 @cindex target machine, specifying
7715
7716 The usual way to run GCC is to run the executable called @file{gcc}, or
7717 @file{<machine>-gcc} when cross-compiling, or
7718 @file{<machine>-gcc-<version>} to run a version other than the one that
7719 was installed last.  Sometimes this is inconvenient, so GCC provides
7720 options that will switch to another cross-compiler or version.
7721
7722 @table @gcctabopt
7723 @item -b @var{machine}
7724 @opindex b
7725 The argument @var{machine} specifies the target machine for compilation.
7726
7727 The value to use for @var{machine} is the same as was specified as the
7728 machine type when configuring GCC as a cross-compiler.  For
7729 example, if a cross-compiler was configured with @samp{configure
7730 arm-elf}, meaning to compile for an arm processor with elf binaries,
7731 then you would specify @option{-b arm-elf} to run that cross compiler.
7732 Because there are other options beginning with @option{-b}, the
7733 configuration must contain a hyphen.
7734
7735 @item -V @var{version}
7736 @opindex V
7737 The argument @var{version} specifies which version of GCC to run.
7738 This is useful when multiple versions are installed.  For example,
7739 @var{version} might be @samp{4.0}, meaning to run GCC version 4.0.
7740 @end table
7741
7742 The @option{-V} and @option{-b} options work by running the
7743 @file{<machine>-gcc-<version>} executable, so there's no real reason to
7744 use them if you can just run that directly.
7745
7746 @node Submodel Options
7747 @section Hardware Models and Configurations
7748 @cindex submodel options
7749 @cindex specifying hardware config
7750 @cindex hardware models and configurations, specifying
7751 @cindex machine dependent options
7752
7753 Earlier we discussed the standard option @option{-b} which chooses among
7754 different installed compilers for completely different target
7755 machines, such as VAX vs.@: 68000 vs.@: 80386.
7756
7757 In addition, each of these target machine types can have its own
7758 special options, starting with @samp{-m}, to choose among various
7759 hardware models or configurations---for example, 68010 vs 68020,
7760 floating coprocessor or none.  A single installed version of the
7761 compiler can compile for any model or configuration, according to the
7762 options specified.
7763
7764 Some configurations of the compiler also support additional special
7765 options, usually for compatibility with other compilers on the same
7766 platform.
7767
7768 @c This list is ordered alphanumerically by subsection name.
7769 @c It should be the same order and spelling as these options are listed
7770 @c in Machine Dependent Options
7771
7772 @menu
7773 * ARC Options::
7774 * ARM Options::
7775 * AVR Options::
7776 * Blackfin Options::
7777 * CRIS Options::
7778 * CRX Options::
7779 * Darwin Options::
7780 * DEC Alpha Options::
7781 * DEC Alpha/VMS Options::
7782 * FRV Options::
7783 * GNU/Linux Options::
7784 * H8/300 Options::
7785 * HPPA Options::
7786 * i386 and x86-64 Options::
7787 * IA-64 Options::
7788 * M32C Options::
7789 * M32R/D Options::
7790 * M680x0 Options::
7791 * M68hc1x Options::
7792 * MCore Options::
7793 * MIPS Options::
7794 * MMIX Options::
7795 * MN10300 Options::
7796 * MT Options::
7797 * PDP-11 Options::
7798 * PowerPC Options::
7799 * RS/6000 and PowerPC Options::
7800 * S/390 and zSeries Options::
7801 * Score Options::
7802 * SH Options::
7803 * SPARC Options::
7804 * SPU Options::
7805 * System V Options::
7806 * TMS320C3x/C4x Options::
7807 * V850 Options::
7808 * VAX Options::
7809 * VxWorks Options::
7810 * x86-64 Options::
7811 * Xstormy16 Options::
7812 * Xtensa Options::
7813 * zSeries Options::
7814 @end menu
7815
7816 @node ARC Options
7817 @subsection ARC Options
7818 @cindex ARC Options
7819
7820 These options are defined for ARC implementations:
7821
7822 @table @gcctabopt
7823 @item -EL
7824 @opindex EL
7825 Compile code for little endian mode.  This is the default.
7826
7827 @item -EB
7828 @opindex EB
7829 Compile code for big endian mode.
7830
7831 @item -mmangle-cpu
7832 @opindex mmangle-cpu
7833 Prepend the name of the cpu to all public symbol names.
7834 In multiple-processor systems, there are many ARC variants with different
7835 instruction and register set characteristics.  This flag prevents code
7836 compiled for one cpu to be linked with code compiled for another.
7837 No facility exists for handling variants that are ``almost identical''.
7838 This is an all or nothing option.
7839
7840 @item -mcpu=@var{cpu}
7841 @opindex mcpu
7842 Compile code for ARC variant @var{cpu}.
7843 Which variants are supported depend on the configuration.
7844 All variants support @option{-mcpu=base}, this is the default.
7845
7846 @item -mtext=@var{text-section}
7847 @itemx -mdata=@var{data-section}
7848 @itemx -mrodata=@var{readonly-data-section}
7849 @opindex mtext
7850 @opindex mdata
7851 @opindex mrodata
7852 Put functions, data, and readonly data in @var{text-section},
7853 @var{data-section}, and @var{readonly-data-section} respectively
7854 by default.  This can be overridden with the @code{section} attribute.
7855 @xref{Variable Attributes}.
7856
7857 @end table
7858
7859 @node ARM Options
7860 @subsection ARM Options
7861 @cindex ARM options
7862
7863 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
7864 architectures:
7865
7866 @table @gcctabopt
7867 @item -mabi=@var{name}
7868 @opindex mabi
7869 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
7870 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
7871
7872 @item -mapcs-frame
7873 @opindex mapcs-frame
7874 Generate a stack frame that is compliant with the ARM Procedure Call
7875 Standard for all functions, even if this is not strictly necessary for
7876 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
7877 with this option will cause the stack frames not to be generated for
7878 leaf functions.  The default is @option{-mno-apcs-frame}.
7879
7880 @item -mapcs
7881 @opindex mapcs
7882 This is a synonym for @option{-mapcs-frame}.
7883
7884 @ignore
7885 @c not currently implemented
7886 @item -mapcs-stack-check
7887 @opindex mapcs-stack-check
7888 Generate code to check the amount of stack space available upon entry to
7889 every function (that actually uses some stack space).  If there is
7890 insufficient space available then either the function
7891 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} will be
7892 called, depending upon the amount of stack space required.  The run time
7893 system is required to provide these functions.  The default is
7894 @option{-mno-apcs-stack-check}, since this produces smaller code.
7895
7896 @c not currently implemented
7897 @item -mapcs-float
7898 @opindex mapcs-float
7899 Pass floating point arguments using the float point registers.  This is
7900 one of the variants of the APCS@.  This option is recommended if the
7901 target hardware has a floating point unit or if a lot of floating point
7902 arithmetic is going to be performed by the code.  The default is
7903 @option{-mno-apcs-float}, since integer only code is slightly increased in
7904 size if @option{-mapcs-float} is used.
7905
7906 @c not currently implemented
7907 @item -mapcs-reentrant
7908 @opindex mapcs-reentrant
7909 Generate reentrant, position independent code.  The default is
7910 @option{-mno-apcs-reentrant}.
7911 @end ignore
7912
7913 @item -mthumb-interwork
7914 @opindex mthumb-interwork
7915 Generate code which supports calling between the ARM and Thumb
7916 instruction sets.  Without this option the two instruction sets cannot
7917 be reliably used inside one program.  The default is
7918 @option{-mno-thumb-interwork}, since slightly larger code is generated
7919 when @option{-mthumb-interwork} is specified.
7920
7921 @item -mno-sched-prolog
7922 @opindex mno-sched-prolog
7923 Prevent the reordering of instructions in the function prolog, or the
7924 merging of those instruction with the instructions in the function's
7925 body.  This means that all functions will start with a recognizable set
7926 of instructions (or in fact one of a choice from a small set of
7927 different function prologues), and this information can be used to
7928 locate the start if functions inside an executable piece of code.  The
7929 default is @option{-msched-prolog}.
7930
7931 @item -mhard-float
7932 @opindex mhard-float
7933 Generate output containing floating point instructions.  This is the
7934 default.
7935
7936 @item -msoft-float
7937 @opindex msoft-float
7938 Generate output containing library calls for floating point.
7939 @strong{Warning:} the requisite libraries are not available for all ARM
7940 targets.  Normally the facilities of the machine's usual C compiler are
7941 used, but this cannot be done directly in cross-compilation.  You must make
7942 your own arrangements to provide suitable library functions for
7943 cross-compilation.
7944
7945 @option{-msoft-float} changes the calling convention in the output file;
7946 therefore, it is only useful if you compile @emph{all} of a program with
7947 this option.  In particular, you need to compile @file{libgcc.a}, the
7948 library that comes with GCC, with @option{-msoft-float} in order for
7949 this to work.
7950
7951 @item -mfloat-abi=@var{name}
7952 @opindex mfloat-abi
7953 Specifies which ABI to use for floating point values.  Permissible values
7954 are: @samp{soft}, @samp{softfp} and @samp{hard}.
7955
7956 @samp{soft} and @samp{hard} are equivalent to @option{-msoft-float}
7957 and @option{-mhard-float} respectively.  @samp{softfp} allows the generation
7958 of floating point instructions, but still uses the soft-float calling
7959 conventions.
7960
7961 @item -mlittle-endian
7962 @opindex mlittle-endian
7963 Generate code for a processor running in little-endian mode.  This is
7964 the default for all standard configurations.
7965
7966 @item -mbig-endian
7967 @opindex mbig-endian
7968 Generate code for a processor running in big-endian mode; the default is
7969 to compile code for a little-endian processor.
7970
7971 @item -mwords-little-endian
7972 @opindex mwords-little-endian
7973 This option only applies when generating code for big-endian processors.
7974 Generate code for a little-endian word order but a big-endian byte
7975 order.  That is, a byte order of the form @samp{32107654}.  Note: this
7976 option should only be used if you require compatibility with code for
7977 big-endian ARM processors generated by versions of the compiler prior to
7978 2.8.
7979
7980 @item -mcpu=@var{name}
7981 @opindex mcpu
7982 This specifies the name of the target ARM processor.  GCC uses this name
7983 to determine what kind of instructions it can emit when generating
7984 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
7985 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
7986 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
7987 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
7988 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
7989 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
7990 @samp{arm8}, @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
7991 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
7992 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
7993 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
7994 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
7995 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
7996 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
7997 @samp{arm1156t2-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
7998 @samp{cortex-a8}, @samp{cortex-r4}, @samp{cortex-m3},
7999 @samp{xscale}, @samp{iwmmxt}, @samp{ep9312}.
8000
8001 @itemx -mtune=@var{name}
8002 @opindex mtune
8003 This option is very similar to the @option{-mcpu=} option, except that
8004 instead of specifying the actual target processor type, and hence
8005 restricting which instructions can be used, it specifies that GCC should
8006 tune the performance of the code as if the target were of the type
8007 specified in this option, but still choosing the instructions that it
8008 will generate based on the cpu specified by a @option{-mcpu=} option.
8009 For some ARM implementations better performance can be obtained by using
8010 this option.
8011
8012 @item -march=@var{name}
8013 @opindex march
8014 This specifies the name of the target ARM architecture.  GCC uses this
8015 name to determine what kind of instructions it can emit when generating
8016 assembly code.  This option can be used in conjunction with or instead
8017 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
8018 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
8019 @samp{armv5}, @samp{armv5t}, @samp{armv5te}, @samp{armv6}, @samp{armv6j},
8020 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv7}, @samp{armv7-a},
8021 @samp{armv7-r}, @samp{armv7-m}, @samp{iwmmxt}, @samp{ep9312}.
8022
8023 @item -mfpu=@var{name}
8024 @itemx -mfpe=@var{number}
8025 @itemx -mfp=@var{number}
8026 @opindex mfpu
8027 @opindex mfpe
8028 @opindex mfp
8029 This specifies what floating point hardware (or hardware emulation) is
8030 available on the target.  Permissible names are: @samp{fpa}, @samp{fpe2},
8031 @samp{fpe3}, @samp{maverick}, @samp{vfp}.  @option{-mfp} and @option{-mfpe}
8032 are synonyms for @option{-mfpu}=@samp{fpe}@var{number}, for compatibility
8033 with older versions of GCC@.
8034
8035 If @option{-msoft-float} is specified this specifies the format of
8036 floating point values.
8037
8038 @item -mstructure-size-boundary=@var{n}
8039 @opindex mstructure-size-boundary
8040 The size of all structures and unions will be rounded up to a multiple
8041 of the number of bits set by this option.  Permissible values are 8, 32
8042 and 64.  The default value varies for different toolchains.  For the COFF
8043 targeted toolchain the default value is 8.  A value of 64 is only allowed
8044 if the underlying ABI supports it.
8045
8046 Specifying the larger number can produce faster, more efficient code, but
8047 can also increase the size of the program.  Different values are potentially
8048 incompatible.  Code compiled with one value cannot necessarily expect to
8049 work with code or libraries compiled with another value, if they exchange
8050 information using structures or unions.
8051
8052 @item -mabort-on-noreturn
8053 @opindex mabort-on-noreturn
8054 Generate a call to the function @code{abort} at the end of a
8055 @code{noreturn} function.  It will be executed if the function tries to
8056 return.
8057
8058 @item -mlong-calls
8059 @itemx -mno-long-calls
8060 @opindex mlong-calls
8061 @opindex mno-long-calls
8062 Tells the compiler to perform function calls by first loading the
8063 address of the function into a register and then performing a subroutine
8064 call on this register.  This switch is needed if the target function
8065 will lie outside of the 64 megabyte addressing range of the offset based
8066 version of subroutine call instruction.
8067
8068 Even if this switch is enabled, not all function calls will be turned
8069 into long calls.  The heuristic is that static functions, functions
8070 which have the @samp{short-call} attribute, functions that are inside
8071 the scope of a @samp{#pragma no_long_calls} directive and functions whose
8072 definitions have already been compiled within the current compilation
8073 unit, will not be turned into long calls.  The exception to this rule is
8074 that weak function definitions, functions with the @samp{long-call}
8075 attribute or the @samp{section} attribute, and functions that are within
8076 the scope of a @samp{#pragma long_calls} directive, will always be
8077 turned into long calls.
8078
8079 This feature is not enabled by default.  Specifying
8080 @option{-mno-long-calls} will restore the default behavior, as will
8081 placing the function calls within the scope of a @samp{#pragma
8082 long_calls_off} directive.  Note these switches have no effect on how
8083 the compiler generates code to handle function calls via function
8084 pointers.
8085
8086 @item -mnop-fun-dllimport
8087 @opindex mnop-fun-dllimport
8088 Disable support for the @code{dllimport} attribute.
8089
8090 @item -msingle-pic-base
8091 @opindex msingle-pic-base
8092 Treat the register used for PIC addressing as read-only, rather than
8093 loading it in the prologue for each function.  The run-time system is
8094 responsible for initializing this register with an appropriate value
8095 before execution begins.
8096
8097 @item -mpic-register=@var{reg}
8098 @opindex mpic-register
8099 Specify the register to be used for PIC addressing.  The default is R10
8100 unless stack-checking is enabled, when R9 is used.
8101
8102 @item -mcirrus-fix-invalid-insns
8103 @opindex mcirrus-fix-invalid-insns
8104 @opindex mno-cirrus-fix-invalid-insns
8105 Insert NOPs into the instruction stream to in order to work around
8106 problems with invalid Maverick instruction combinations.  This option
8107 is only valid if the @option{-mcpu=ep9312} option has been used to
8108 enable generation of instructions for the Cirrus Maverick floating
8109 point co-processor.  This option is not enabled by default, since the
8110 problem is only present in older Maverick implementations.  The default
8111 can be re-enabled by use of the @option{-mno-cirrus-fix-invalid-insns}
8112 switch.
8113
8114 @item -mpoke-function-name
8115 @opindex mpoke-function-name
8116 Write the name of each function into the text section, directly
8117 preceding the function prologue.  The generated code is similar to this:
8118
8119 @smallexample
8120      t0
8121          .ascii "arm_poke_function_name", 0
8122          .align
8123      t1
8124          .word 0xff000000 + (t1 - t0)
8125      arm_poke_function_name
8126          mov     ip, sp
8127          stmfd   sp!, @{fp, ip, lr, pc@}
8128          sub     fp, ip, #4
8129 @end smallexample
8130
8131 When performing a stack backtrace, code can inspect the value of
8132 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
8133 location @code{pc - 12} and the top 8 bits are set, then we know that
8134 there is a function name embedded immediately preceding this location
8135 and has length @code{((pc[-3]) & 0xff000000)}.
8136
8137 @item -mthumb
8138 @opindex mthumb
8139 Generate code for the Thumb instruction set.  The default is to
8140 use the 32-bit ARM instruction set.
8141 This option automatically enables either 16-bit Thumb-1 or
8142 mixed 16/32-bit Thumb-2 instructions based on the @option{-mcpu=@var{name}}
8143 and @option{-march=@var{name}} options.
8144
8145 @item -mtpcs-frame
8146 @opindex mtpcs-frame
8147 Generate a stack frame that is compliant with the Thumb Procedure Call
8148 Standard for all non-leaf functions.  (A leaf function is one that does
8149 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
8150
8151 @item -mtpcs-leaf-frame
8152 @opindex mtpcs-leaf-frame
8153 Generate a stack frame that is compliant with the Thumb Procedure Call
8154 Standard for all leaf functions.  (A leaf function is one that does
8155 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
8156
8157 @item -mcallee-super-interworking
8158 @opindex mcallee-super-interworking
8159 Gives all externally visible functions in the file being compiled an ARM
8160 instruction set header which switches to Thumb mode before executing the
8161 rest of the function.  This allows these functions to be called from
8162 non-interworking code.
8163
8164 @item -mcaller-super-interworking
8165 @opindex mcaller-super-interworking
8166 Allows calls via function pointers (including virtual functions) to
8167 execute correctly regardless of whether the target code has been
8168 compiled for interworking or not.  There is a small overhead in the cost
8169 of executing a function pointer if this option is enabled.
8170
8171 @item -mtp=@var{name}
8172 @opindex mtp
8173 Specify the access model for the thread local storage pointer.  The valid
8174 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
8175 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
8176 (supported in the arm6k architecture), and @option{auto}, which uses the
8177 best available method for the selected processor.  The default setting is
8178 @option{auto}.
8179
8180 @end table
8181
8182 @node AVR Options
8183 @subsection AVR Options
8184 @cindex AVR Options
8185
8186 These options are defined for AVR implementations:
8187
8188 @table @gcctabopt
8189 @item -mmcu=@var{mcu}
8190 @opindex mmcu
8191 Specify ATMEL AVR instruction set or MCU type.
8192
8193 Instruction set avr1 is for the minimal AVR core, not supported by the C
8194 compiler, only for assembler programs (MCU types: at90s1200, attiny10,
8195 attiny11, attiny12, attiny15, attiny28).
8196
8197 Instruction set avr2 (default) is for the classic AVR core with up to
8198 8K program memory space (MCU types: at90s2313, at90s2323, attiny22,
8199 at90s2333, at90s2343, at90s4414, at90s4433, at90s4434, at90s8515,
8200 at90c8534, at90s8535).
8201
8202 Instruction set avr3 is for the classic AVR core with up to 128K program
8203 memory space (MCU types: atmega103, atmega603, at43usb320, at76c711).
8204
8205 Instruction set avr4 is for the enhanced AVR core with up to 8K program
8206 memory space (MCU types: atmega8, atmega83, atmega85).
8207
8208 Instruction set avr5 is for the enhanced AVR core with up to 128K program
8209 memory space (MCU types: atmega16, atmega161, atmega163, atmega32, atmega323,
8210 atmega64, atmega128, at43usb355, at94k).
8211
8212 @item -msize
8213 @opindex msize
8214 Output instruction sizes to the asm file.
8215
8216 @item -minit-stack=@var{N}
8217 @opindex minit-stack
8218 Specify the initial stack address, which may be a symbol or numeric value,
8219 @samp{__stack} is the default.
8220
8221 @item -mno-interrupts
8222 @opindex mno-interrupts
8223 Generated code is not compatible with hardware interrupts.
8224 Code size will be smaller.
8225
8226 @item -mcall-prologues
8227 @opindex mcall-prologues
8228 Functions prologues/epilogues expanded as call to appropriate
8229 subroutines.  Code size will be smaller.
8230
8231 @item -mno-tablejump
8232 @opindex mno-tablejump
8233 Do not generate tablejump insns which sometimes increase code size.
8234
8235 @item -mtiny-stack
8236 @opindex mtiny-stack
8237 Change only the low 8 bits of the stack pointer.
8238
8239 @item -mint8
8240 @opindex mint8
8241 Assume int to be 8 bit integer.  This affects the sizes of all types: A
8242 char will be 1 byte, an int will be 1 byte, an long will be 2 bytes
8243 and long long will be 4 bytes.  Please note that this option does not
8244 comply to the C standards, but it will provide you with smaller code
8245 size.
8246 @end table
8247
8248 @node Blackfin Options
8249 @subsection Blackfin Options
8250 @cindex Blackfin Options
8251
8252 @table @gcctabopt
8253 @item -momit-leaf-frame-pointer
8254 @opindex momit-leaf-frame-pointer
8255 Don't keep the frame pointer in a register for leaf functions.  This
8256 avoids the instructions to save, set up and restore frame pointers and
8257 makes an extra register available in leaf functions.  The option
8258 @option{-fomit-frame-pointer} removes the frame pointer for all functions
8259 which might make debugging harder.
8260
8261 @item -mspecld-anomaly
8262 @opindex mspecld-anomaly
8263 When enabled, the compiler will ensure that the generated code does not
8264 contain speculative loads after jump instructions.  This option is enabled
8265 by default.
8266
8267 @item -mno-specld-anomaly
8268 @opindex mno-specld-anomaly
8269 Don't generate extra code to prevent speculative loads from occurring.
8270
8271 @item -mcsync-anomaly
8272 @opindex mcsync-anomaly
8273 When enabled, the compiler will ensure that the generated code does not
8274 contain CSYNC or SSYNC instructions too soon after conditional branches.
8275 This option is enabled by default.
8276
8277 @item -mno-csync-anomaly
8278 @opindex mno-csync-anomaly
8279 Don't generate extra code to prevent CSYNC or SSYNC instructions from
8280 occurring too soon after a conditional branch.
8281
8282 @item -mlow-64k
8283 @opindex mlow-64k
8284 When enabled, the compiler is free to take advantage of the knowledge that
8285 the entire program fits into the low 64k of memory.
8286
8287 @item -mno-low-64k
8288 @opindex mno-low-64k
8289 Assume that the program is arbitrarily large.  This is the default.
8290
8291 @item -mstack-check-l1
8292 @opindex mstack-check-l1
8293 Do stack checking using information placed into L1 scratchpad memory by the
8294 uClinux kernel.
8295
8296 @item -mid-shared-library
8297 @opindex mid-shared-library
8298 Generate code that supports shared libraries via the library ID method.
8299 This allows for execute in place and shared libraries in an environment
8300 without virtual memory management.  This option implies @option{-fPIC}.
8301
8302 @item -mno-id-shared-library
8303 @opindex mno-id-shared-library
8304 Generate code that doesn't assume ID based shared libraries are being used.
8305 This is the default.
8306
8307 @item -mleaf-id-shared-library
8308 @opindex mleaf-id-shared-library
8309 Generate code that supports shared libraries via the library ID method,
8310 but assumes that this library or executable won't link against any other
8311 ID shared libraries.  That allows the compiler to use faster code for jumps
8312 and calls.
8313
8314 @item -mno-leaf-id-shared-library
8315 @opindex mno-leaf-id-shared-library
8316 Do not assume that the code being compiled won't link against any ID shared
8317 libraries.  Slower code will be generated for jump and call insns.
8318
8319 @item -mshared-library-id=n
8320 @opindex mshared-library-id
8321 Specified the identification number of the ID based shared library being
8322 compiled.  Specifying a value of 0 will generate more compact code, specifying
8323 other values will force the allocation of that number to the current
8324 library but is no more space or time efficient than omitting this option.
8325
8326 @item -msep-data
8327 @opindex msep-data
8328 Generate code that allows the data segment to be located in a different
8329 area of memory from the text segment.  This allows for execute in place in
8330 an environment without virtual memory management by eliminating relocations
8331 against the text section.
8332
8333 @item -mno-sep-data
8334 @opindex mno-sep-data
8335 Generate code that assumes that the data segment follows the text segment.
8336 This is the default.
8337
8338 @item -mlong-calls
8339 @itemx -mno-long-calls
8340 @opindex mlong-calls
8341 @opindex mno-long-calls
8342 Tells the compiler to perform function calls by first loading the
8343 address of the function into a register and then performing a subroutine
8344 call on this register.  This switch is needed if the target function
8345 will lie outside of the 24 bit addressing range of the offset based
8346 version of subroutine call instruction.
8347
8348 This feature is not enabled by default.  Specifying
8349 @option{-mno-long-calls} will restore the default behavior.  Note these
8350 switches have no effect on how the compiler generates code to handle
8351 function calls via function pointers.
8352 @end table
8353
8354 @node CRIS Options
8355 @subsection CRIS Options
8356 @cindex CRIS Options
8357
8358 These options are defined specifically for the CRIS ports.
8359
8360 @table @gcctabopt
8361 @item -march=@var{architecture-type}
8362 @itemx -mcpu=@var{architecture-type}
8363 @opindex march
8364 @opindex mcpu
8365 Generate code for the specified architecture.  The choices for
8366 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
8367 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
8368 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
8369 @samp{v10}.
8370
8371 @item -mtune=@var{architecture-type}
8372 @opindex mtune
8373 Tune to @var{architecture-type} everything applicable about the generated
8374 code, except for the ABI and the set of available instructions.  The
8375 choices for @var{architecture-type} are the same as for
8376 @option{-march=@var{architecture-type}}.
8377
8378 @item -mmax-stack-frame=@var{n}
8379 @opindex mmax-stack-frame
8380 Warn when the stack frame of a function exceeds @var{n} bytes.
8381
8382 @item -melinux-stacksize=@var{n}
8383 @opindex melinux-stacksize
8384 Only available with the @samp{cris-axis-aout} target.  Arranges for
8385 indications in the program to the kernel loader that the stack of the
8386 program should be set to @var{n} bytes.
8387
8388 @item -metrax4
8389 @itemx -metrax100
8390 @opindex metrax4
8391 @opindex metrax100
8392 The options @option{-metrax4} and @option{-metrax100} are synonyms for
8393 @option{-march=v3} and @option{-march=v8} respectively.
8394
8395 @item -mmul-bug-workaround
8396 @itemx -mno-mul-bug-workaround
8397 @opindex mmul-bug-workaround
8398 @opindex mno-mul-bug-workaround
8399 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
8400 models where it applies.  This option is active by default.
8401
8402 @item -mpdebug
8403 @opindex mpdebug
8404 Enable CRIS-specific verbose debug-related information in the assembly
8405 code.  This option also has the effect to turn off the @samp{#NO_APP}
8406 formatted-code indicator to the assembler at the beginning of the
8407 assembly file.
8408
8409 @item -mcc-init
8410 @opindex mcc-init
8411 Do not use condition-code results from previous instruction; always emit
8412 compare and test instructions before use of condition codes.
8413
8414 @item -mno-side-effects
8415 @opindex mno-side-effects
8416 Do not emit instructions with side-effects in addressing modes other than
8417 post-increment.
8418
8419 @item -mstack-align
8420 @itemx -mno-stack-align
8421 @itemx -mdata-align
8422 @itemx -mno-data-align
8423 @itemx -mconst-align
8424 @itemx -mno-const-align
8425 @opindex mstack-align
8426 @opindex mno-stack-align
8427 @opindex mdata-align
8428 @opindex mno-data-align
8429 @opindex mconst-align
8430 @opindex mno-const-align
8431 These options (no-options) arranges (eliminate arrangements) for the
8432 stack-frame, individual data and constants to be aligned for the maximum
8433 single data access size for the chosen CPU model.  The default is to
8434 arrange for 32-bit alignment.  ABI details such as structure layout are
8435 not affected by these options.
8436
8437 @item -m32-bit
8438 @itemx -m16-bit
8439 @itemx -m8-bit
8440 @opindex m32-bit
8441 @opindex m16-bit
8442 @opindex m8-bit
8443 Similar to the stack- data- and const-align options above, these options
8444 arrange for stack-frame, writable data and constants to all be 32-bit,
8445 16-bit or 8-bit aligned.  The default is 32-bit alignment.
8446
8447 @item -mno-prologue-epilogue
8448 @itemx -mprologue-epilogue
8449 @opindex mno-prologue-epilogue
8450 @opindex mprologue-epilogue
8451 With @option{-mno-prologue-epilogue}, the normal function prologue and
8452 epilogue that sets up the stack-frame are omitted and no return
8453 instructions or return sequences are generated in the code.  Use this
8454 option only together with visual inspection of the compiled code: no
8455 warnings or errors are generated when call-saved registers must be saved,
8456 or storage for local variable needs to be allocated.
8457
8458 @item -mno-gotplt
8459 @itemx -mgotplt
8460 @opindex mno-gotplt
8461 @opindex mgotplt
8462 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
8463 instruction sequences that load addresses for functions from the PLT part
8464 of the GOT rather than (traditional on other architectures) calls to the
8465 PLT@.  The default is @option{-mgotplt}.
8466
8467 @item -maout
8468 @opindex maout
8469 Legacy no-op option only recognized with the cris-axis-aout target.
8470
8471 @item -melf
8472 @opindex melf
8473 Legacy no-op option only recognized with the cris-axis-elf and
8474 cris-axis-linux-gnu targets.
8475
8476 @item -melinux
8477 @opindex melinux
8478 Only recognized with the cris-axis-aout target, where it selects a
8479 GNU/linux-like multilib, include files and instruction set for
8480 @option{-march=v8}.
8481
8482 @item -mlinux
8483 @opindex mlinux
8484 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
8485
8486 @item -sim
8487 @opindex sim
8488 This option, recognized for the cris-axis-aout and cris-axis-elf arranges
8489 to link with input-output functions from a simulator library.  Code,
8490 initialized data and zero-initialized data are allocated consecutively.
8491
8492 @item -sim2
8493 @opindex sim2
8494 Like @option{-sim}, but pass linker options to locate initialized data at
8495 0x40000000 and zero-initialized data at 0x80000000.
8496 @end table
8497
8498 @node CRX Options
8499 @subsection CRX Options
8500 @cindex CRX Options
8501
8502 These options are defined specifically for the CRX ports.
8503
8504 @table @gcctabopt
8505
8506 @item -mmac
8507 @opindex mmac
8508 Enable the use of multiply-accumulate instructions. Disabled by default.
8509
8510 @item -mpush-args
8511 @opindex mpush-args
8512 Push instructions will be used to pass outgoing arguments when functions
8513 are called. Enabled by default.
8514 @end table
8515
8516 @node Darwin Options
8517 @subsection Darwin Options
8518 @cindex Darwin options
8519
8520 These options are defined for all architectures running the Darwin operating
8521 system.
8522
8523 FSF GCC on Darwin does not create ``fat'' object files; it will create
8524 an object file for the single architecture that it was built to
8525 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
8526 @option{-arch} options are used; it does so by running the compiler or
8527 linker multiple times and joining the results together with
8528 @file{lipo}.
8529
8530 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
8531 @samp{i686}) is determined by the flags that specify the ISA
8532 that GCC is targetting, like @option{-mcpu} or @option{-march}.  The
8533 @option{-force_cpusubtype_ALL} option can be used to override this.
8534
8535 The Darwin tools vary in their behavior when presented with an ISA
8536 mismatch.  The assembler, @file{as}, will only permit instructions to
8537 be used that are valid for the subtype of the file it is generating,
8538 so you cannot put 64-bit instructions in an @samp{ppc750} object file.
8539 The linker for shared libraries, @file{/usr/bin/libtool}, will fail
8540 and print an error if asked to create a shared library with a less
8541 restrictive subtype than its input files (for instance, trying to put
8542 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
8543 for executables, @file{ld}, will quietly give the executable the most
8544 restrictive subtype of any of its input files.
8545
8546 @table @gcctabopt
8547 @item -F@var{dir}
8548 @opindex F
8549 Add the framework directory @var{dir} to the head of the list of
8550 directories to be searched for header files.  These directories are
8551 interleaved with those specified by @option{-I} options and are
8552 scanned in a left-to-right order.
8553
8554 A framework directory is a directory with frameworks in it.  A
8555 framework is a directory with a @samp{"Headers"} and/or
8556 @samp{"PrivateHeaders"} directory contained directly in it that ends
8557 in @samp{".framework"}.  The name of a framework is the name of this
8558 directory excluding the @samp{".framework"}.  Headers associated with
8559 the framework are found in one of those two directories, with
8560 @samp{"Headers"} being searched first.  A subframework is a framework
8561 directory that is in a framework's @samp{"Frameworks"} directory.
8562 Includes of subframework headers can only appear in a header of a
8563 framework that contains the subframework, or in a sibling subframework
8564 header.  Two subframeworks are siblings if they occur in the same
8565 framework.  A subframework should not have the same name as a
8566 framework, a warning will be issued if this is violated.  Currently a
8567 subframework cannot have subframeworks, in the future, the mechanism
8568 may be extended to support this.  The standard frameworks can be found
8569 in @samp{"/System/Library/Frameworks"} and
8570 @samp{"/Library/Frameworks"}.  An example include looks like
8571 @code{#include <Framework/header.h>}, where @samp{Framework} denotes
8572 the name of the framework and header.h is found in the
8573 @samp{"PrivateHeaders"} or @samp{"Headers"} directory.
8574
8575 @item -iframework@var{dir}
8576 @opindex iframework
8577 Like @option{-F} except the directory is a treated as a system
8578 directory.  The main difference between this @option{-iframework} and
8579 @option{-F} is that with @option{-iframework} the compiler does not
8580 warn about constructs contained within header files found via
8581 @var{dir}.  This option is valid only for the C family of languages.
8582
8583 @item -gused
8584 @opindex -gused
8585 Emit debugging information for symbols that are used.  For STABS
8586 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
8587 This is by default ON@.
8588
8589 @item -gfull
8590 @opindex -gfull
8591 Emit debugging information for all symbols and types.
8592
8593 @item -mmacosx-version-min=@var{version}
8594 The earliest version of MacOS X that this executable will run on
8595 is @var{version}.  Typical values of @var{version} include @code{10.1},
8596 @code{10.2}, and @code{10.3.9}.
8597
8598 The default for this option is to make choices that seem to be most
8599 useful.
8600
8601 @item -mkernel
8602 @opindex mkernel
8603 Enable kernel development mode.  The @option{-mkernel} option sets
8604 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
8605 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
8606 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
8607 applicable.  This mode also sets @option{-mno-altivec},
8608 @option{-msoft-float}, @option{-fno-builtin} and
8609 @option{-mlong-branch} for PowerPC targets.
8610
8611 @item -mone-byte-bool
8612 @opindex -mone-byte-bool
8613 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
8614 By default @samp{sizeof(bool)} is @samp{4} when compiling for
8615 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
8616 option has no effect on x86.
8617
8618 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
8619 to generate code that is not binary compatible with code generated
8620 without that switch.  Using this switch may require recompiling all
8621 other modules in a program, including system libraries.  Use this
8622 switch to conform to a non-default data model.
8623
8624 @item -mfix-and-continue
8625 @itemx -ffix-and-continue
8626 @itemx -findirect-data
8627 @opindex mfix-and-continue
8628 @opindex ffix-and-continue
8629 @opindex findirect-data
8630 Generate code suitable for fast turn around development.  Needed to
8631 enable gdb to dynamically load @code{.o} files into already running
8632 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
8633 are provided for backwards compatibility.
8634
8635 @item -all_load
8636 @opindex all_load
8637 Loads all members of static archive libraries.
8638 See man ld(1) for more information.
8639
8640 @item -arch_errors_fatal
8641 @opindex arch_errors_fatal
8642 Cause the errors having to do with files that have the wrong architecture
8643 to be fatal.
8644
8645 @item -bind_at_load
8646 @opindex bind_at_load
8647 Causes the output file to be marked such that the dynamic linker will
8648 bind all undefined references when the file is loaded or launched.
8649
8650 @item -bundle
8651 @opindex bundle
8652 Produce a Mach-o bundle format file.
8653 See man ld(1) for more information.
8654
8655 @item -bundle_loader @var{executable}
8656 @opindex bundle_loader
8657 This option specifies the @var{executable} that will be loading the build
8658 output file being linked.  See man ld(1) for more information.
8659
8660 @item -dynamiclib
8661 @opindex -dynamiclib
8662 When passed this option, GCC will produce a dynamic library instead of
8663 an executable when linking, using the Darwin @file{libtool} command.
8664
8665 @item -force_cpusubtype_ALL
8666 @opindex -force_cpusubtype_ALL
8667 This causes GCC's output file to have the @var{ALL} subtype, instead of
8668 one controlled by the @option{-mcpu} or @option{-march} option.
8669
8670 @item -allowable_client  @var{client_name}
8671 @itemx -client_name
8672 @itemx -compatibility_version
8673 @itemx -current_version
8674 @itemx -dead_strip
8675 @itemx -dependency-file
8676 @itemx -dylib_file
8677 @itemx -dylinker_install_name
8678 @itemx -dynamic
8679 @itemx -exported_symbols_list
8680 @itemx -filelist
8681 @itemx -flat_namespace
8682 @itemx -force_flat_namespace
8683 @itemx -headerpad_max_install_names
8684 @itemx -image_base
8685 @itemx -init
8686 @itemx -install_name
8687 @itemx -keep_private_externs
8688 @itemx -multi_module
8689 @itemx -multiply_defined
8690 @itemx -multiply_defined_unused
8691 @itemx -noall_load
8692 @itemx -no_dead_strip_inits_and_terms
8693 @itemx -nofixprebinding
8694 @itemx -nomultidefs
8695 @itemx -noprebind
8696 @itemx -noseglinkedit
8697 @itemx -pagezero_size
8698 @itemx -prebind
8699 @itemx -prebind_all_twolevel_modules
8700 @itemx -private_bundle
8701 @itemx -read_only_relocs
8702 @itemx -sectalign
8703 @itemx -sectobjectsymbols
8704 @itemx -whyload
8705 @itemx -seg1addr
8706 @itemx -sectcreate
8707 @itemx -sectobjectsymbols
8708 @itemx -sectorder
8709 @itemx -segaddr
8710 @itemx -segs_read_only_addr
8711 @itemx -segs_read_write_addr
8712 @itemx -seg_addr_table
8713 @itemx -seg_addr_table_filename
8714 @itemx -seglinkedit
8715 @itemx -segprot
8716 @itemx -segs_read_only_addr
8717 @itemx -segs_read_write_addr
8718 @itemx -single_module
8719 @itemx -static
8720 @itemx -sub_library
8721 @itemx -sub_umbrella
8722 @itemx -twolevel_namespace
8723 @itemx -umbrella
8724 @itemx -undefined
8725 @itemx -unexported_symbols_list
8726 @itemx -weak_reference_mismatches
8727 @itemx -whatsloaded
8728
8729 @opindex allowable_client
8730 @opindex client_name
8731 @opindex compatibility_version
8732 @opindex current_version
8733 @opindex dead_strip
8734 @opindex dependency-file
8735 @opindex dylib_file
8736 @opindex dylinker_install_name
8737 @opindex dynamic
8738 @opindex exported_symbols_list
8739 @opindex filelist
8740 @opindex flat_namespace
8741 @opindex force_flat_namespace
8742 @opindex headerpad_max_install_names
8743 @opindex image_base
8744 @opindex init
8745 @opindex install_name
8746 @opindex keep_private_externs
8747 @opindex multi_module
8748 @opindex multiply_defined
8749 @opindex multiply_defined_unused
8750 @opindex noall_load
8751 @opindex no_dead_strip_inits_and_terms
8752 @opindex nofixprebinding
8753 @opindex nomultidefs
8754 @opindex noprebind
8755 @opindex noseglinkedit
8756 @opindex pagezero_size
8757 @opindex prebind
8758 @opindex prebind_all_twolevel_modules
8759 @opindex private_bundle
8760 @opindex read_only_relocs
8761 @opindex sectalign
8762 @opindex sectobjectsymbols
8763 @opindex whyload
8764 @opindex seg1addr
8765 @opindex sectcreate
8766 @opindex sectobjectsymbols
8767 @opindex sectorder
8768 @opindex segaddr
8769 @opindex segs_read_only_addr
8770 @opindex segs_read_write_addr
8771 @opindex seg_addr_table
8772 @opindex seg_addr_table_filename
8773 @opindex seglinkedit
8774 @opindex segprot
8775 @opindex segs_read_only_addr
8776 @opindex segs_read_write_addr
8777 @opindex single_module
8778 @opindex static
8779 @opindex sub_library
8780 @opindex sub_umbrella
8781 @opindex twolevel_namespace
8782 @opindex umbrella
8783 @opindex undefined
8784 @opindex unexported_symbols_list
8785 @opindex weak_reference_mismatches
8786 @opindex whatsloaded
8787
8788 These options are passed to the Darwin linker.  The Darwin linker man page
8789 describes them in detail.
8790 @end table
8791
8792 @node DEC Alpha Options
8793 @subsection DEC Alpha Options
8794
8795 These @samp{-m} options are defined for the DEC Alpha implementations:
8796
8797 @table @gcctabopt
8798 @item -mno-soft-float
8799 @itemx -msoft-float
8800 @opindex mno-soft-float
8801 @opindex msoft-float
8802 Use (do not use) the hardware floating-point instructions for
8803 floating-point operations.  When @option{-msoft-float} is specified,
8804 functions in @file{libgcc.a} will be used to perform floating-point
8805 operations.  Unless they are replaced by routines that emulate the
8806 floating-point operations, or compiled in such a way as to call such
8807 emulations routines, these routines will issue floating-point
8808 operations.   If you are compiling for an Alpha without floating-point
8809 operations, you must ensure that the library is built so as not to call
8810 them.
8811
8812 Note that Alpha implementations without floating-point operations are
8813 required to have floating-point registers.
8814
8815 @item -mfp-reg
8816 @itemx -mno-fp-regs
8817 @opindex mfp-reg
8818 @opindex mno-fp-regs
8819 Generate code that uses (does not use) the floating-point register set.
8820 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
8821 register set is not used, floating point operands are passed in integer
8822 registers as if they were integers and floating-point results are passed
8823 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
8824 so any function with a floating-point argument or return value called by code
8825 compiled with @option{-mno-fp-regs} must also be compiled with that
8826 option.
8827
8828 A typical use of this option is building a kernel that does not use,
8829 and hence need not save and restore, any floating-point registers.
8830
8831 @item -mieee
8832 @opindex mieee
8833 The Alpha architecture implements floating-point hardware optimized for
8834 maximum performance.  It is mostly compliant with the IEEE floating
8835 point standard.  However, for full compliance, software assistance is
8836 required.  This option generates code fully IEEE compliant code
8837 @emph{except} that the @var{inexact-flag} is not maintained (see below).
8838 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
8839 defined during compilation.  The resulting code is less efficient but is
8840 able to correctly support denormalized numbers and exceptional IEEE
8841 values such as not-a-number and plus/minus infinity.  Other Alpha
8842 compilers call this option @option{-ieee_with_no_inexact}.
8843
8844 @item -mieee-with-inexact
8845 @opindex mieee-with-inexact
8846 This is like @option{-mieee} except the generated code also maintains
8847 the IEEE @var{inexact-flag}.  Turning on this option causes the
8848 generated code to implement fully-compliant IEEE math.  In addition to
8849 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
8850 macro.  On some Alpha implementations the resulting code may execute
8851 significantly slower than the code generated by default.  Since there is
8852 very little code that depends on the @var{inexact-flag}, you should
8853 normally not specify this option.  Other Alpha compilers call this
8854 option @option{-ieee_with_inexact}.
8855
8856 @item -mfp-trap-mode=@var{trap-mode}
8857 @opindex mfp-trap-mode
8858 This option controls what floating-point related traps are enabled.
8859 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
8860 The trap mode can be set to one of four values:
8861
8862 @table @samp
8863 @item n
8864 This is the default (normal) setting.  The only traps that are enabled
8865 are the ones that cannot be disabled in software (e.g., division by zero
8866 trap).
8867
8868 @item u
8869 In addition to the traps enabled by @samp{n}, underflow traps are enabled
8870 as well.
8871
8872 @item su
8873 Like @samp{u}, but the instructions are marked to be safe for software
8874 completion (see Alpha architecture manual for details).
8875
8876 @item sui
8877 Like @samp{su}, but inexact traps are enabled as well.
8878 @end table
8879
8880 @item -mfp-rounding-mode=@var{rounding-mode}
8881 @opindex mfp-rounding-mode
8882 Selects the IEEE rounding mode.  Other Alpha compilers call this option
8883 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
8884 of:
8885
8886 @table @samp
8887 @item n
8888 Normal IEEE rounding mode.  Floating point numbers are rounded towards
8889 the nearest machine number or towards the even machine number in case
8890 of a tie.
8891
8892 @item m
8893 Round towards minus infinity.
8894
8895 @item c
8896 Chopped rounding mode.  Floating point numbers are rounded towards zero.
8897
8898 @item d
8899 Dynamic rounding mode.  A field in the floating point control register
8900 (@var{fpcr}, see Alpha architecture reference manual) controls the
8901 rounding mode in effect.  The C library initializes this register for
8902 rounding towards plus infinity.  Thus, unless your program modifies the
8903 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
8904 @end table
8905
8906 @item -mtrap-precision=@var{trap-precision}
8907 @opindex mtrap-precision
8908 In the Alpha architecture, floating point traps are imprecise.  This
8909 means without software assistance it is impossible to recover from a
8910 floating trap and program execution normally needs to be terminated.
8911 GCC can generate code that can assist operating system trap handlers
8912 in determining the exact location that caused a floating point trap.
8913 Depending on the requirements of an application, different levels of
8914 precisions can be selected:
8915
8916 @table @samp
8917 @item p
8918 Program precision.  This option is the default and means a trap handler
8919 can only identify which program caused a floating point exception.
8920
8921 @item f
8922 Function precision.  The trap handler can determine the function that
8923 caused a floating point exception.
8924
8925 @item i
8926 Instruction precision.  The trap handler can determine the exact
8927 instruction that caused a floating point exception.
8928 @end table
8929
8930 Other Alpha compilers provide the equivalent options called
8931 @option{-scope_safe} and @option{-resumption_safe}.
8932
8933 @item -mieee-conformant
8934 @opindex mieee-conformant
8935 This option marks the generated code as IEEE conformant.  You must not
8936 use this option unless you also specify @option{-mtrap-precision=i} and either
8937 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
8938 is to emit the line @samp{.eflag 48} in the function prologue of the
8939 generated assembly file.  Under DEC Unix, this has the effect that
8940 IEEE-conformant math library routines will be linked in.
8941
8942 @item -mbuild-constants
8943 @opindex mbuild-constants
8944 Normally GCC examines a 32- or 64-bit integer constant to
8945 see if it can construct it from smaller constants in two or three
8946 instructions.  If it cannot, it will output the constant as a literal and
8947 generate code to load it from the data segment at runtime.
8948
8949 Use this option to require GCC to construct @emph{all} integer constants
8950 using code, even if it takes more instructions (the maximum is six).
8951
8952 You would typically use this option to build a shared library dynamic
8953 loader.  Itself a shared library, it must relocate itself in memory
8954 before it can find the variables and constants in its own data segment.
8955
8956 @item -malpha-as
8957 @itemx -mgas
8958 @opindex malpha-as
8959 @opindex mgas
8960 Select whether to generate code to be assembled by the vendor-supplied
8961 assembler (@option{-malpha-as}) or by the GNU assembler @option{-mgas}.
8962
8963 @item -mbwx
8964 @itemx -mno-bwx
8965 @itemx -mcix
8966 @itemx -mno-cix
8967 @itemx -mfix
8968 @itemx -mno-fix
8969 @itemx -mmax
8970 @itemx -mno-max
8971 @opindex mbwx
8972 @opindex mno-bwx
8973 @opindex mcix
8974 @opindex mno-cix
8975 @opindex mfix
8976 @opindex mno-fix
8977 @opindex mmax
8978 @opindex mno-max
8979 Indicate whether GCC should generate code to use the optional BWX,
8980 CIX, FIX and MAX instruction sets.  The default is to use the instruction
8981 sets supported by the CPU type specified via @option{-mcpu=} option or that
8982 of the CPU on which GCC was built if none was specified.
8983
8984 @item -mfloat-vax
8985 @itemx -mfloat-ieee
8986 @opindex mfloat-vax
8987 @opindex mfloat-ieee
8988 Generate code that uses (does not use) VAX F and G floating point
8989 arithmetic instead of IEEE single and double precision.
8990
8991 @item -mexplicit-relocs
8992 @itemx -mno-explicit-relocs
8993 @opindex mexplicit-relocs
8994 @opindex mno-explicit-relocs
8995 Older Alpha assemblers provided no way to generate symbol relocations
8996 except via assembler macros.  Use of these macros does not allow
8997 optimal instruction scheduling.  GNU binutils as of version 2.12
8998 supports a new syntax that allows the compiler to explicitly mark
8999 which relocations should apply to which instructions.  This option
9000 is mostly useful for debugging, as GCC detects the capabilities of
9001 the assembler when it is built and sets the default accordingly.
9002
9003 @item -msmall-data
9004 @itemx -mlarge-data
9005 @opindex msmall-data
9006 @opindex mlarge-data
9007 When @option{-mexplicit-relocs} is in effect, static data is
9008 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
9009 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
9010 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
9011 16-bit relocations off of the @code{$gp} register.  This limits the
9012 size of the small data area to 64KB, but allows the variables to be
9013 directly accessed via a single instruction.
9014
9015 The default is @option{-mlarge-data}.  With this option the data area
9016 is limited to just below 2GB@.  Programs that require more than 2GB of
9017 data must use @code{malloc} or @code{mmap} to allocate the data in the
9018 heap instead of in the program's data segment.
9019
9020 When generating code for shared libraries, @option{-fpic} implies
9021 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
9022
9023 @item -msmall-text
9024 @itemx -mlarge-text
9025 @opindex msmall-text
9026 @opindex mlarge-text
9027 When @option{-msmall-text} is used, the compiler assumes that the
9028 code of the entire program (or shared library) fits in 4MB, and is
9029 thus reachable with a branch instruction.  When @option{-msmall-data}
9030 is used, the compiler can assume that all local symbols share the
9031 same @code{$gp} value, and thus reduce the number of instructions
9032 required for a function call from 4 to 1.
9033
9034 The default is @option{-mlarge-text}.
9035
9036 @item -mcpu=@var{cpu_type}
9037 @opindex mcpu
9038 Set the instruction set and instruction scheduling parameters for
9039 machine type @var{cpu_type}.  You can specify either the @samp{EV}
9040 style name or the corresponding chip number.  GCC supports scheduling
9041 parameters for the EV4, EV5 and EV6 family of processors and will
9042 choose the default values for the instruction set from the processor
9043 you specify.  If you do not specify a processor type, GCC will default
9044 to the processor on which the compiler was built.
9045
9046 Supported values for @var{cpu_type} are
9047
9048 @table @samp
9049 @item ev4
9050 @itemx ev45
9051 @itemx 21064
9052 Schedules as an EV4 and has no instruction set extensions.
9053
9054 @item ev5
9055 @itemx 21164
9056 Schedules as an EV5 and has no instruction set extensions.
9057
9058 @item ev56
9059 @itemx 21164a
9060 Schedules as an EV5 and supports the BWX extension.
9061
9062 @item pca56
9063 @itemx 21164pc
9064 @itemx 21164PC
9065 Schedules as an EV5 and supports the BWX and MAX extensions.
9066
9067 @item ev6
9068 @itemx 21264
9069 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
9070
9071 @item ev67
9072 @itemx 21264a
9073 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
9074 @end table
9075
9076 @item -mtune=@var{cpu_type}
9077 @opindex mtune
9078 Set only the instruction scheduling parameters for machine type
9079 @var{cpu_type}.  The instruction set is not changed.
9080
9081 @item -mmemory-latency=@var{time}
9082 @opindex mmemory-latency
9083 Sets the latency the scheduler should assume for typical memory
9084 references as seen by the application.  This number is highly
9085 dependent on the memory access patterns used by the application
9086 and the size of the external cache on the machine.
9087
9088 Valid options for @var{time} are
9089
9090 @table @samp
9091 @item @var{number}
9092 A decimal number representing clock cycles.
9093
9094 @item L1
9095 @itemx L2
9096 @itemx L3
9097 @itemx main
9098 The compiler contains estimates of the number of clock cycles for
9099 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
9100 (also called Dcache, Scache, and Bcache), as well as to main memory.
9101 Note that L3 is only valid for EV5.
9102
9103 @end table
9104 @end table
9105
9106 @node DEC Alpha/VMS Options
9107 @subsection DEC Alpha/VMS Options
9108
9109 These @samp{-m} options are defined for the DEC Alpha/VMS implementations:
9110
9111 @table @gcctabopt
9112 @item -mvms-return-codes
9113 @opindex mvms-return-codes
9114 Return VMS condition codes from main.  The default is to return POSIX
9115 style condition (e.g.@ error) codes.
9116 @end table
9117
9118 @node FRV Options
9119 @subsection FRV Options
9120 @cindex FRV Options
9121
9122 @table @gcctabopt
9123 @item -mgpr-32
9124 @opindex mgpr-32
9125
9126 Only use the first 32 general purpose registers.
9127
9128 @item -mgpr-64
9129 @opindex mgpr-64
9130
9131 Use all 64 general purpose registers.
9132
9133 @item -mfpr-32
9134 @opindex mfpr-32
9135
9136 Use only the first 32 floating point registers.
9137
9138 @item -mfpr-64
9139 @opindex mfpr-64
9140
9141 Use all 64 floating point registers
9142
9143 @item -mhard-float
9144 @opindex mhard-float
9145
9146 Use hardware instructions for floating point operations.
9147
9148 @item -msoft-float
9149 @opindex msoft-float
9150
9151 Use library routines for floating point operations.
9152
9153 @item -malloc-cc
9154 @opindex malloc-cc
9155
9156 Dynamically allocate condition code registers.
9157
9158 @item -mfixed-cc
9159 @opindex mfixed-cc
9160
9161 Do not try to dynamically allocate condition code registers, only
9162 use @code{icc0} and @code{fcc0}.
9163
9164 @item -mdword
9165 @opindex mdword
9166
9167 Change ABI to use double word insns.
9168
9169 @item -mno-dword
9170 @opindex mno-dword
9171
9172 Do not use double word instructions.
9173
9174 @item -mdouble
9175 @opindex mdouble
9176
9177 Use floating point double instructions.
9178
9179 @item -mno-double
9180 @opindex mno-double
9181
9182 Do not use floating point double instructions.
9183
9184 @item -mmedia
9185 @opindex mmedia
9186
9187 Use media instructions.
9188
9189 @item -mno-media
9190 @opindex mno-media
9191
9192 Do not use media instructions.
9193
9194 @item -mmuladd
9195 @opindex mmuladd
9196
9197 Use multiply and add/subtract instructions.
9198
9199 @item -mno-muladd
9200 @opindex mno-muladd
9201
9202 Do not use multiply and add/subtract instructions.
9203
9204 @item -mfdpic
9205 @opindex mfdpic
9206
9207 Select the FDPIC ABI, that uses function descriptors to represent
9208 pointers to functions.  Without any PIC/PIE-related options, it
9209 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
9210 assumes GOT entries and small data are within a 12-bit range from the
9211 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
9212 are computed with 32 bits.
9213
9214 @item -minline-plt
9215 @opindex minline-plt
9216
9217 Enable inlining of PLT entries in function calls to functions that are
9218 not known to bind locally.  It has no effect without @option{-mfdpic}.
9219 It's enabled by default if optimizing for speed and compiling for
9220 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
9221 optimization option such as @option{-O3} or above is present in the
9222 command line.
9223
9224 @item -mTLS
9225 @opindex TLS
9226
9227 Assume a large TLS segment when generating thread-local code.
9228
9229 @item -mtls
9230 @opindex tls
9231
9232 Do not assume a large TLS segment when generating thread-local code.
9233
9234 @item -mgprel-ro
9235 @opindex mgprel-ro
9236
9237 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
9238 that is known to be in read-only sections.  It's enabled by default,
9239 except for @option{-fpic} or @option{-fpie}: even though it may help
9240 make the global offset table smaller, it trades 1 instruction for 4.
9241 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
9242 one of which may be shared by multiple symbols, and it avoids the need
9243 for a GOT entry for the referenced symbol, so it's more likely to be a
9244 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
9245
9246 @item -multilib-library-pic
9247 @opindex multilib-library-pic
9248
9249 Link with the (library, not FD) pic libraries.  It's implied by
9250 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
9251 @option{-fpic} without @option{-mfdpic}.  You should never have to use
9252 it explicitly.
9253
9254 @item -mlinked-fp
9255 @opindex mlinked-fp
9256
9257 Follow the EABI requirement of always creating a frame pointer whenever
9258 a stack frame is allocated.  This option is enabled by default and can
9259 be disabled with @option{-mno-linked-fp}.
9260
9261 @item -mlong-calls
9262 @opindex mlong-calls
9263
9264 Use indirect addressing to call functions outside the current
9265 compilation unit.  This allows the functions to be placed anywhere
9266 within the 32-bit address space.
9267
9268 @item -malign-labels
9269 @opindex malign-labels
9270
9271 Try to align labels to an 8-byte boundary by inserting nops into the
9272 previous packet.  This option only has an effect when VLIW packing
9273 is enabled.  It doesn't create new packets; it merely adds nops to
9274 existing ones.
9275
9276 @item -mlibrary-pic
9277 @opindex mlibrary-pic
9278
9279 Generate position-independent EABI code.
9280
9281 @item -macc-4
9282 @opindex macc-4
9283
9284 Use only the first four media accumulator registers.
9285
9286 @item -macc-8
9287 @opindex macc-8
9288
9289 Use all eight media accumulator registers.
9290
9291 @item -mpack
9292 @opindex mpack
9293
9294 Pack VLIW instructions.
9295
9296 @item -mno-pack
9297 @opindex mno-pack
9298
9299 Do not pack VLIW instructions.
9300
9301 @item -mno-eflags
9302 @opindex mno-eflags
9303
9304 Do not mark ABI switches in e_flags.
9305
9306 @item -mcond-move
9307 @opindex mcond-move
9308
9309 Enable the use of conditional-move instructions (default).
9310
9311 This switch is mainly for debugging the compiler and will likely be removed
9312 in a future version.
9313
9314 @item -mno-cond-move
9315 @opindex mno-cond-move
9316
9317 Disable the use of conditional-move instructions.
9318
9319 This switch is mainly for debugging the compiler and will likely be removed
9320 in a future version.
9321
9322 @item -mscc
9323 @opindex mscc
9324
9325 Enable the use of conditional set instructions (default).
9326
9327 This switch is mainly for debugging the compiler and will likely be removed
9328 in a future version.
9329
9330 @item -mno-scc
9331 @opindex mno-scc
9332
9333 Disable the use of conditional set instructions.
9334
9335 This switch is mainly for debugging the compiler and will likely be removed
9336 in a future version.
9337
9338 @item -mcond-exec
9339 @opindex mcond-exec
9340
9341 Enable the use of conditional execution (default).
9342
9343 This switch is mainly for debugging the compiler and will likely be removed
9344 in a future version.
9345
9346 @item -mno-cond-exec
9347 @opindex mno-cond-exec
9348
9349 Disable the use of conditional execution.
9350
9351 This switch is mainly for debugging the compiler and will likely be removed
9352 in a future version.
9353
9354 @item -mvliw-branch
9355 @opindex mvliw-branch
9356
9357 Run a pass to pack branches into VLIW instructions (default).
9358
9359 This switch is mainly for debugging the compiler and will likely be removed
9360 in a future version.
9361
9362 @item -mno-vliw-branch
9363 @opindex mno-vliw-branch
9364
9365 Do not run a pass to pack branches into VLIW instructions.
9366
9367 This switch is mainly for debugging the compiler and will likely be removed
9368 in a future version.
9369
9370 @item -mmulti-cond-exec
9371 @opindex mmulti-cond-exec
9372
9373 Enable optimization of @code{&&} and @code{||} in conditional execution
9374 (default).
9375
9376 This switch is mainly for debugging the compiler and will likely be removed
9377 in a future version.
9378
9379 @item -mno-multi-cond-exec
9380 @opindex mno-multi-cond-exec
9381
9382 Disable optimization of @code{&&} and @code{||} in conditional execution.
9383
9384 This switch is mainly for debugging the compiler and will likely be removed
9385 in a future version.
9386
9387 @item -mnested-cond-exec
9388 @opindex mnested-cond-exec
9389
9390 Enable nested conditional execution optimizations (default).
9391
9392 This switch is mainly for debugging the compiler and will likely be removed
9393 in a future version.
9394
9395 @item -mno-nested-cond-exec
9396 @opindex mno-nested-cond-exec
9397
9398 Disable nested conditional execution optimizations.
9399
9400 This switch is mainly for debugging the compiler and will likely be removed
9401 in a future version.
9402
9403 @item -moptimize-membar
9404 @opindex moptimize-membar
9405
9406 This switch removes redundant @code{membar} instructions from the
9407 compiler generated code.  It is enabled by default.
9408
9409 @item -mno-optimize-membar
9410 @opindex mno-optimize-membar
9411
9412 This switch disables the automatic removal of redundant @code{membar}
9413 instructions from the generated code.
9414
9415 @item -mtomcat-stats
9416 @opindex mtomcat-stats
9417
9418 Cause gas to print out tomcat statistics.
9419
9420 @item -mcpu=@var{cpu}
9421 @opindex mcpu
9422
9423 Select the processor type for which to generate code.  Possible values are
9424 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
9425 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
9426
9427 @end table
9428
9429 @node GNU/Linux Options
9430 @subsection GNU/Linux Options
9431
9432 These @samp{-m} options are defined for GNU/Linux targets:
9433
9434 @table @gcctabopt
9435 @item -mglibc
9436 @opindex mglibc
9437 Use the GNU C library instead of uClibc.  This is the default except
9438 on @samp{*-*-linux-*uclibc*} targets.
9439
9440 @item -muclibc
9441 @opindex muclibc
9442 Use uClibc instead of the GNU C library.  This is the default on
9443 @samp{*-*-linux-*uclibc*} targets.
9444 @end table
9445
9446 @node H8/300 Options
9447 @subsection H8/300 Options
9448
9449 These @samp{-m} options are defined for the H8/300 implementations:
9450
9451 @table @gcctabopt
9452 @item -mrelax
9453 @opindex mrelax
9454 Shorten some address references at link time, when possible; uses the
9455 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
9456 ld, Using ld}, for a fuller description.
9457
9458 @item -mh
9459 @opindex mh
9460 Generate code for the H8/300H@.
9461
9462 @item -ms
9463 @opindex ms
9464 Generate code for the H8S@.
9465
9466 @item -mn
9467 @opindex mn
9468 Generate code for the H8S and H8/300H in the normal mode.  This switch
9469 must be used either with @option{-mh} or @option{-ms}.
9470
9471 @item -ms2600
9472 @opindex ms2600
9473 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
9474
9475 @item -mint32
9476 @opindex mint32
9477 Make @code{int} data 32 bits by default.
9478
9479 @item -malign-300
9480 @opindex malign-300
9481 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
9482 The default for the H8/300H and H8S is to align longs and floats on 4
9483 byte boundaries.
9484 @option{-malign-300} causes them to be aligned on 2 byte boundaries.
9485 This option has no effect on the H8/300.
9486 @end table
9487
9488 @node HPPA Options
9489 @subsection HPPA Options
9490 @cindex HPPA Options
9491
9492 These @samp{-m} options are defined for the HPPA family of computers:
9493
9494 @table @gcctabopt
9495 @item -march=@var{architecture-type}
9496 @opindex march
9497 Generate code for the specified architecture.  The choices for
9498 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
9499 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
9500 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
9501 architecture option for your machine.  Code compiled for lower numbered
9502 architectures will run on higher numbered architectures, but not the
9503 other way around.
9504
9505 @item -mpa-risc-1-0
9506 @itemx -mpa-risc-1-1
9507 @itemx -mpa-risc-2-0
9508 @opindex mpa-risc-1-0
9509 @opindex mpa-risc-1-1
9510 @opindex mpa-risc-2-0
9511 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
9512
9513 @item -mbig-switch
9514 @opindex mbig-switch
9515 Generate code suitable for big switch tables.  Use this option only if
9516 the assembler/linker complain about out of range branches within a switch
9517 table.
9518
9519 @item -mjump-in-delay
9520 @opindex mjump-in-delay
9521 Fill delay slots of function calls with unconditional jump instructions
9522 by modifying the return pointer for the function call to be the target
9523 of the conditional jump.
9524
9525 @item -mdisable-fpregs
9526 @opindex mdisable-fpregs
9527 Prevent floating point registers from being used in any manner.  This is
9528 necessary for compiling kernels which perform lazy context switching of
9529 floating point registers.  If you use this option and attempt to perform
9530 floating point operations, the compiler will abort.
9531
9532 @item -mdisable-indexing
9533 @opindex mdisable-indexing
9534 Prevent the compiler from using indexing address modes.  This avoids some
9535 rather obscure problems when compiling MIG generated code under MACH@.
9536
9537 @item -mno-space-regs
9538 @opindex mno-space-regs
9539 Generate code that assumes the target has no space registers.  This allows
9540 GCC to generate faster indirect calls and use unscaled index address modes.
9541
9542 Such code is suitable for level 0 PA systems and kernels.
9543
9544 @item -mfast-indirect-calls
9545 @opindex mfast-indirect-calls
9546 Generate code that assumes calls never cross space boundaries.  This
9547 allows GCC to emit code which performs faster indirect calls.
9548
9549 This option will not work in the presence of shared libraries or nested
9550 functions.
9551
9552 @item -mfixed-range=@var{register-range}
9553 @opindex mfixed-range
9554 Generate code treating the given register range as fixed registers.
9555 A fixed register is one that the register allocator can not use.  This is
9556 useful when compiling kernel code.  A register range is specified as
9557 two registers separated by a dash.  Multiple register ranges can be
9558 specified separated by a comma.
9559
9560 @item -mlong-load-store
9561 @opindex mlong-load-store
9562 Generate 3-instruction load and store sequences as sometimes required by
9563 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
9564 the HP compilers.
9565
9566 @item -mportable-runtime
9567 @opindex mportable-runtime
9568 Use the portable calling conventions proposed by HP for ELF systems.
9569
9570 @item -mgas
9571 @opindex mgas
9572 Enable the use of assembler directives only GAS understands.
9573
9574 @item -mschedule=@var{cpu-type}
9575 @opindex mschedule
9576 Schedule code according to the constraints for the machine type
9577 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
9578 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
9579 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
9580 proper scheduling option for your machine.  The default scheduling is
9581 @samp{8000}.
9582
9583 @item -mlinker-opt
9584 @opindex mlinker-opt
9585 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
9586 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
9587 linkers in which they give bogus error messages when linking some programs.
9588
9589 @item -msoft-float
9590 @opindex msoft-float
9591 Generate output containing library calls for floating point.
9592 @strong{Warning:} the requisite libraries are not available for all HPPA
9593 targets.  Normally the facilities of the machine's usual C compiler are
9594 used, but this cannot be done directly in cross-compilation.  You must make
9595 your own arrangements to provide suitable library functions for
9596 cross-compilation.  The embedded target @samp{hppa1.1-*-pro}
9597 does provide software floating point support.
9598
9599 @option{-msoft-float} changes the calling convention in the output file;
9600 therefore, it is only useful if you compile @emph{all} of a program with
9601 this option.  In particular, you need to compile @file{libgcc.a}, the
9602 library that comes with GCC, with @option{-msoft-float} in order for
9603 this to work.
9604
9605 @item -msio
9606 @opindex msio
9607 Generate the predefine, @code{_SIO}, for server IO@.  The default is
9608 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
9609 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
9610 options are available under HP-UX and HI-UX@.
9611
9612 @item -mgnu-ld
9613 @opindex gnu-ld
9614 Use GNU ld specific options.  This passes @option{-shared} to ld when
9615 building a shared library.  It is the default when GCC is configured,
9616 explicitly or implicitly, with the GNU linker.  This option does not
9617 have any affect on which ld is called, it only changes what parameters
9618 are passed to that ld.  The ld that is called is determined by the
9619 @option{--with-ld} configure option, GCC's program search path, and
9620 finally by the user's @env{PATH}.  The linker used by GCC can be printed
9621 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
9622 on the 64 bit HP-UX GCC, i.e. configured with @samp{hppa*64*-*-hpux*}.
9623
9624 @item -mhp-ld
9625 @opindex hp-ld
9626 Use HP ld specific options.  This passes @option{-b} to ld when building
9627 a shared library and passes @option{+Accept TypeMismatch} to ld on all
9628 links.  It is the default when GCC is configured, explicitly or
9629 implicitly, with the HP linker.  This option does not have any affect on
9630 which ld is called, it only changes what parameters are passed to that
9631 ld.  The ld that is called is determined by the @option{--with-ld}
9632 configure option, GCC's program search path, and finally by the user's
9633 @env{PATH}.  The linker used by GCC can be printed using @samp{which
9634 `gcc -print-prog-name=ld`}.  This option is only available on the 64 bit
9635 HP-UX GCC, i.e. configured with @samp{hppa*64*-*-hpux*}.
9636
9637 @item -mlong-calls
9638 @opindex mno-long-calls
9639 Generate code that uses long call sequences.  This ensures that a call
9640 is always able to reach linker generated stubs.  The default is to generate
9641 long calls only when the distance from the call site to the beginning
9642 of the function or translation unit, as the case may be, exceeds a
9643 predefined limit set by the branch type being used.  The limits for
9644 normal calls are 7,600,000 and 240,000 bytes, respectively for the
9645 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
9646 240,000 bytes.
9647
9648 Distances are measured from the beginning of functions when using the
9649 @option{-ffunction-sections} option, or when using the @option{-mgas}
9650 and @option{-mno-portable-runtime} options together under HP-UX with
9651 the SOM linker.
9652
9653 It is normally not desirable to use this option as it will degrade
9654 performance.  However, it may be useful in large applications,
9655 particularly when partial linking is used to build the application.
9656
9657 The types of long calls used depends on the capabilities of the
9658 assembler and linker, and the type of code being generated.  The
9659 impact on systems that support long absolute calls, and long pic
9660 symbol-difference or pc-relative calls should be relatively small.
9661 However, an indirect call is used on 32-bit ELF systems in pic code
9662 and it is quite long.
9663
9664 @item -munix=@var{unix-std}
9665 @opindex march
9666 Generate compiler predefines and select a startfile for the specified
9667 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
9668 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
9669 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
9670 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
9671 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
9672 and later.
9673
9674 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
9675 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
9676 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
9677 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
9678 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
9679 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
9680
9681 It is @emph{important} to note that this option changes the interfaces
9682 for various library routines.  It also affects the operational behavior
9683 of the C library.  Thus, @emph{extreme} care is needed in using this
9684 option.
9685
9686 Library code that is intended to operate with more than one UNIX
9687 standard must test, set and restore the variable @var{__xpg4_extended_mask}
9688 as appropriate.  Most GNU software doesn't provide this capability.
9689
9690 @item -nolibdld
9691 @opindex nolibdld
9692 Suppress the generation of link options to search libdld.sl when the
9693 @option{-static} option is specified on HP-UX 10 and later.
9694
9695 @item -static
9696 @opindex static
9697 The HP-UX implementation of setlocale in libc has a dependency on
9698 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
9699 when the @option{-static} option is specified, special link options
9700 are needed to resolve this dependency.
9701
9702 On HP-UX 10 and later, the GCC driver adds the necessary options to
9703 link with libdld.sl when the @option{-static} option is specified.
9704 This causes the resulting binary to be dynamic.  On the 64-bit port,
9705 the linkers generate dynamic binaries by default in any case.  The
9706 @option{-nolibdld} option can be used to prevent the GCC driver from
9707 adding these link options.
9708
9709 @item -threads
9710 @opindex threads
9711 Add support for multithreading with the @dfn{dce thread} library
9712 under HP-UX@.  This option sets flags for both the preprocessor and
9713 linker.
9714 @end table
9715
9716 @node i386 and x86-64 Options
9717 @subsection Intel 386 and AMD x86-64 Options
9718 @cindex i386 Options
9719 @cindex x86-64 Options
9720 @cindex Intel 386 Options
9721 @cindex AMD x86-64 Options
9722
9723 These @samp{-m} options are defined for the i386 and x86-64 family of
9724 computers:
9725
9726 @table @gcctabopt
9727 @item -mtune=@var{cpu-type}
9728 @opindex mtune
9729 Tune to @var{cpu-type} everything applicable about the generated code, except
9730 for the ABI and the set of available instructions.  The choices for
9731 @var{cpu-type} are:
9732 @table @emph
9733 @item generic
9734 Produce code optimized for the most common IA32/AMD64/EM64T processors.
9735 If you know the CPU on which your code will run, then you should use
9736 the corresponding @option{-mtune} option instead of
9737 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
9738 of your application will have, then you should use this option.
9739
9740 As new processors are deployed in the marketplace, the behavior of this
9741 option will change.  Therefore, if you upgrade to a newer version of
9742 GCC, the code generated option will change to reflect the processors
9743 that were most common when that version of GCC was released.
9744
9745 There is no @option{-march=generic} option because @option{-march}
9746 indicates the instruction set the compiler can use, and there is no
9747 generic instruction set applicable to all processors.  In contrast,
9748 @option{-mtune} indicates the processor (or, in this case, collection of
9749 processors) for which the code is optimized.
9750 @item native
9751 This selects the CPU to tune for at compilation time by determining
9752 the processor type of the compiling machine.  Using @option{-mtune=native}
9753 will produce code optimized for the local machine under the constraints
9754 of the selected instruction set.  Using @option{-march=native} will
9755 enable all instruction subsets supported by the local machine (hence
9756 the result might not run on different machines).
9757 @item i386
9758 Original Intel's i386 CPU@.
9759 @item i486
9760 Intel's i486 CPU@.  (No scheduling is implemented for this chip.)
9761 @item i586, pentium
9762 Intel Pentium CPU with no MMX support.
9763 @item pentium-mmx
9764 Intel PentiumMMX CPU based on Pentium core with MMX instruction set support.
9765 @item pentiumpro
9766 Intel PentiumPro CPU@.
9767 @item i686
9768 Same as @code{generic}, but when used as @code{march} option, PentiumPro
9769 instruction set will be used, so the code will run on all i686 family chips.
9770 @item pentium2
9771 Intel Pentium2 CPU based on PentiumPro core with MMX instruction set support.
9772 @item pentium3, pentium3m
9773 Intel Pentium3 CPU based on PentiumPro core with MMX and SSE instruction set
9774 support.
9775 @item pentium-m
9776 Low power version of Intel Pentium3 CPU with MMX, SSE and SSE2 instruction set
9777 support.  Used by Centrino notebooks.
9778 @item pentium4, pentium4m
9779 Intel Pentium4 CPU with MMX, SSE and SSE2 instruction set support.
9780 @item prescott
9781 Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2 and SSE3 instruction
9782 set support.
9783 @item nocona
9784 Improved version of Intel Pentium4 CPU with 64-bit extensions, MMX, SSE,
9785 SSE2 and SSE3 instruction set support.
9786 @item core2
9787 Intel Core2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
9788 instruction set support.
9789 @item k6
9790 AMD K6 CPU with MMX instruction set support.
9791 @item k6-2, k6-3
9792 Improved versions of AMD K6 CPU with MMX and 3dNOW! instruction set support.
9793 @item athlon, athlon-tbird
9794 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and SSE prefetch instructions
9795 support.
9796 @item athlon-4, athlon-xp, athlon-mp
9797 Improved AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and full SSE
9798 instruction set support.
9799 @item k8, opteron, athlon64, athlon-fx
9800 AMD K8 core based CPUs with x86-64 instruction set support.  (This supersets
9801 MMX, SSE, SSE2, 3dNOW!, enhanced 3dNOW! and 64-bit instruction set extensions.)
9802 @item amdfam10, barcelona
9803 AMD Family 10 core based CPUs with x86-64 instruction set support.  (This
9804 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3dNOW!, enhanced 3dNOW!, ABM and 64-bit
9805 instruction set extensions.)
9806 @item winchip-c6
9807 IDT Winchip C6 CPU, dealt in same way as i486 with additional MMX instruction
9808 set support.
9809 @item winchip2
9810 IDT Winchip2 CPU, dealt in same way as i486 with additional MMX and 3dNOW!
9811 instruction set support.
9812 @item c3
9813 Via C3 CPU with MMX and 3dNOW! instruction set support.  (No scheduling is
9814 implemented for this chip.)
9815 @item c3-2
9816 Via C3-2 CPU with MMX and SSE instruction set support.  (No scheduling is
9817 implemented for this chip.)
9818 @item geode
9819 Embedded AMD CPU with MMX and 3dNOW! instruction set support.
9820 @end table
9821
9822 While picking a specific @var{cpu-type} will schedule things appropriately
9823 for that particular chip, the compiler will not generate any code that
9824 does not run on the i386 without the @option{-march=@var{cpu-type}} option
9825 being used.
9826
9827 @item -march=@var{cpu-type}
9828 @opindex march
9829 Generate instructions for the machine type @var{cpu-type}.  The choices
9830 for @var{cpu-type} are the same as for @option{-mtune}.  Moreover,
9831 specifying @option{-march=@var{cpu-type}} implies @option{-mtune=@var{cpu-type}}.
9832
9833 @item -mcpu=@var{cpu-type}
9834 @opindex mcpu
9835 A deprecated synonym for @option{-mtune}.
9836
9837 @item -m386
9838 @itemx -m486
9839 @itemx -mpentium
9840 @itemx -mpentiumpro
9841 @opindex m386
9842 @opindex m486
9843 @opindex mpentium
9844 @opindex mpentiumpro
9845 These options are synonyms for @option{-mtune=i386}, @option{-mtune=i486},
9846 @option{-mtune=pentium}, and @option{-mtune=pentiumpro} respectively.
9847 These synonyms are deprecated.
9848
9849 @item -mfpmath=@var{unit}
9850 @opindex march
9851 Generate floating point arithmetics for selected unit @var{unit}.  The choices
9852 for @var{unit} are:
9853
9854 @table @samp
9855 @item 387
9856 Use the standard 387 floating point coprocessor present majority of chips and
9857 emulated otherwise.  Code compiled with this option will run almost everywhere.
9858 The temporary results are computed in 80bit precision instead of precision
9859 specified by the type resulting in slightly different results compared to most
9860 of other chips.  See @option{-ffloat-store} for more detailed description.
9861
9862 This is the default choice for i386 compiler.
9863
9864 @item sse
9865 Use scalar floating point instructions present in the SSE instruction set.
9866 This instruction set is supported by Pentium3 and newer chips, in the AMD line
9867 by Athlon-4, Athlon-xp and Athlon-mp chips.  The earlier version of SSE
9868 instruction set supports only single precision arithmetics, thus the double and
9869 extended precision arithmetics is still done using 387.  Later version, present
9870 only in Pentium4 and the future AMD x86-64 chips supports double precision
9871 arithmetics too.
9872
9873 For the i386 compiler, you need to use @option{-march=@var{cpu-type}}, @option{-msse}
9874 or @option{-msse2} switches to enable SSE extensions and make this option
9875 effective.  For the x86-64 compiler, these extensions are enabled by default.
9876
9877 The resulting code should be considerably faster in the majority of cases and avoid
9878 the numerical instability problems of 387 code, but may break some existing
9879 code that expects temporaries to be 80bit.
9880
9881 This is the default choice for the x86-64 compiler.
9882
9883 @item sse,387
9884 Attempt to utilize both instruction sets at once.  This effectively double the
9885 amount of available registers and on chips with separate execution units for
9886 387 and SSE the execution resources too.  Use this option with care, as it is
9887 still experimental, because the GCC register allocator does not model separate
9888 functional units well resulting in instable performance.
9889 @end table
9890
9891 @item -masm=@var{dialect}
9892 @opindex masm=@var{dialect}
9893 Output asm instructions using selected @var{dialect}.  Supported
9894 choices are @samp{intel} or @samp{att} (the default one).  Darwin does
9895 not support @samp{intel}.
9896
9897 @item -mieee-fp
9898 @itemx -mno-ieee-fp
9899 @opindex mieee-fp
9900 @opindex mno-ieee-fp
9901 Control whether or not the compiler uses IEEE floating point
9902 comparisons.  These handle correctly the case where the result of a
9903 comparison is unordered.
9904
9905 @item -msoft-float
9906 @opindex msoft-float
9907 Generate output containing library calls for floating point.
9908 @strong{Warning:} the requisite libraries are not part of GCC@.
9909 Normally the facilities of the machine's usual C compiler are used, but
9910 this can't be done directly in cross-compilation.  You must make your
9911 own arrangements to provide suitable library functions for
9912 cross-compilation.
9913
9914 On machines where a function returns floating point results in the 80387
9915 register stack, some floating point opcodes may be emitted even if
9916 @option{-msoft-float} is used.
9917
9918 @item -mno-fp-ret-in-387
9919 @opindex mno-fp-ret-in-387
9920 Do not use the FPU registers for return values of functions.
9921
9922 The usual calling convention has functions return values of types
9923 @code{float} and @code{double} in an FPU register, even if there
9924 is no FPU@.  The idea is that the operating system should emulate
9925 an FPU@.
9926
9927 The option @option{-mno-fp-ret-in-387} causes such values to be returned
9928 in ordinary CPU registers instead.
9929
9930 @item -mno-fancy-math-387
9931 @opindex mno-fancy-math-387
9932 Some 387 emulators do not support the @code{sin}, @code{cos} and
9933 @code{sqrt} instructions for the 387.  Specify this option to avoid
9934 generating those instructions.  This option is the default on FreeBSD,
9935 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
9936 indicates that the target cpu will always have an FPU and so the
9937 instruction will not need emulation.  As of revision 2.6.1, these
9938 instructions are not generated unless you also use the
9939 @option{-funsafe-math-optimizations} switch.
9940
9941 @item -malign-double
9942 @itemx -mno-align-double
9943 @opindex malign-double
9944 @opindex mno-align-double
9945 Control whether GCC aligns @code{double}, @code{long double}, and
9946 @code{long long} variables on a two word boundary or a one word
9947 boundary.  Aligning @code{double} variables on a two word boundary will
9948 produce code that runs somewhat faster on a @samp{Pentium} at the
9949 expense of more memory.
9950
9951 On x86-64, @option{-malign-double} is enabled by default.
9952
9953 @strong{Warning:} if you use the @option{-malign-double} switch,
9954 structures containing the above types will be aligned differently than
9955 the published application binary interface specifications for the 386
9956 and will not be binary compatible with structures in code compiled
9957 without that switch.
9958
9959 @item -m96bit-long-double
9960 @itemx -m128bit-long-double
9961 @opindex m96bit-long-double
9962 @opindex m128bit-long-double
9963 These switches control the size of @code{long double} type.  The i386
9964 application binary interface specifies the size to be 96 bits,
9965 so @option{-m96bit-long-double} is the default in 32 bit mode.
9966
9967 Modern architectures (Pentium and newer) would prefer @code{long double}
9968 to be aligned to an 8 or 16 byte boundary.  In arrays or structures
9969 conforming to the ABI, this would not be possible.  So specifying a
9970 @option{-m128bit-long-double} will align @code{long double}
9971 to a 16 byte boundary by padding the @code{long double} with an additional
9972 32 bit zero.
9973
9974 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
9975 its ABI specifies that @code{long double} is to be aligned on 16 byte boundary.
9976
9977 Notice that neither of these options enable any extra precision over the x87
9978 standard of 80 bits for a @code{long double}.
9979
9980 @strong{Warning:} if you override the default value for your target ABI, the
9981 structures and arrays containing @code{long double} variables will change
9982 their size as well as function calling convention for function taking
9983 @code{long double} will be modified.  Hence they will not be binary
9984 compatible with arrays or structures in code compiled without that switch.
9985
9986 @item -mmlarge-data-threshold=@var{number}
9987 @opindex mlarge-data-threshold=@var{number}
9988 When @option{-mcmodel=medium} is specified, the data greater than
9989 @var{threshold} are placed in large data section.  This value must be the
9990 same across all object linked into the binary and defaults to 65535.
9991
9992 @item -msvr3-shlib
9993 @itemx -mno-svr3-shlib
9994 @opindex msvr3-shlib
9995 @opindex mno-svr3-shlib
9996 Control whether GCC places uninitialized local variables into the
9997 @code{bss} or @code{data} segments.  @option{-msvr3-shlib} places them
9998 into @code{bss}.  These options are meaningful only on System V Release 3.
9999
10000 @item -mrtd
10001 @opindex mrtd
10002 Use a different function-calling convention, in which functions that
10003 take a fixed number of arguments return with the @code{ret} @var{num}
10004 instruction, which pops their arguments while returning.  This saves one
10005 instruction in the caller since there is no need to pop the arguments
10006 there.
10007
10008 You can specify that an individual function is called with this calling
10009 sequence with the function attribute @samp{stdcall}.  You can also
10010 override the @option{-mrtd} option by using the function attribute
10011 @samp{cdecl}.  @xref{Function Attributes}.
10012
10013 @strong{Warning:} this calling convention is incompatible with the one
10014 normally used on Unix, so you cannot use it if you need to call
10015 libraries compiled with the Unix compiler.
10016
10017 Also, you must provide function prototypes for all functions that
10018 take variable numbers of arguments (including @code{printf});
10019 otherwise incorrect code will be generated for calls to those
10020 functions.
10021
10022 In addition, seriously incorrect code will result if you call a
10023 function with too many arguments.  (Normally, extra arguments are
10024 harmlessly ignored.)
10025
10026 @item -mregparm=@var{num}
10027 @opindex mregparm
10028 Control how many registers are used to pass integer arguments.  By
10029 default, no registers are used to pass arguments, and at most 3
10030 registers can be used.  You can control this behavior for a specific
10031 function by using the function attribute @samp{regparm}.
10032 @xref{Function Attributes}.
10033
10034 @strong{Warning:} if you use this switch, and
10035 @var{num} is nonzero, then you must build all modules with the same
10036 value, including any libraries.  This includes the system libraries and
10037 startup modules.
10038
10039 @item -msseregparm
10040 @opindex msseregparm
10041 Use SSE register passing conventions for float and double arguments
10042 and return values.  You can control this behavior for a specific
10043 function by using the function attribute @samp{sseregparm}.
10044 @xref{Function Attributes}.
10045
10046 @strong{Warning:} if you use this switch then you must build all
10047 modules with the same value, including any libraries.  This includes
10048 the system libraries and startup modules.
10049
10050 @item -mpc32
10051 @itemx -mpc64
10052 @itemx -mpc80
10053 @opindex mpc32
10054 @opindex mpc64
10055 @opindex mpc80
10056
10057 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
10058 is specified, the significand of floating-point operations is rounded to 24
10059 bits (single precision), @option{-mpc64} rounds the significand of
10060 floating-point operations to 53 bits (double precision) and @option{-mpc80}
10061 rounds the significand of floating-point operations to 64 bits (extended
10062 double precision).  Note that a change of default precision control may
10063 affect the results returned by some of the mathematical functions.
10064
10065 @item -mstackrealign
10066 @opindex mstackrealign
10067 Realign the stack at entry.  On the Intel x86, the
10068 @option{-mstackrealign} option will generate an alternate prologue and
10069 epilogue that realigns the runtime stack.  This supports mixing legacy
10070 codes that keep a 4-byte aligned stack with modern codes that keep a
10071 16-byte stack for SSE compatibility.  The alternate prologue and
10072 epilogue are slower and bigger than the regular ones, and the
10073 alternate prologue requires an extra scratch register; this lowers the
10074 number of registers available if used in conjunction with the
10075 @code{regparm} attribute.  The @option{-mstackrealign} option is
10076 incompatible with the nested function prologue; this is considered a
10077 hard error.  See also the attribute @code{force_align_arg_pointer},
10078 applicable to individual functions.
10079
10080 @item -mpreferred-stack-boundary=@var{num}
10081 @opindex mpreferred-stack-boundary
10082 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
10083 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
10084 the default is 4 (16 bytes or 128 bits).
10085
10086 On Pentium and PentiumPro, @code{double} and @code{long double} values
10087 should be aligned to an 8 byte boundary (see @option{-malign-double}) or
10088 suffer significant run time performance penalties.  On Pentium III, the
10089 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
10090 properly if it is not 16 byte aligned.
10091
10092 To ensure proper alignment of this values on the stack, the stack boundary
10093 must be as aligned as that required by any value stored on the stack.
10094 Further, every function must be generated such that it keeps the stack
10095 aligned.  Thus calling a function compiled with a higher preferred
10096 stack boundary from a function compiled with a lower preferred stack
10097 boundary will most likely misalign the stack.  It is recommended that
10098 libraries that use callbacks always use the default setting.
10099
10100 This extra alignment does consume extra stack space, and generally
10101 increases code size.  Code that is sensitive to stack space usage, such
10102 as embedded systems and operating system kernels, may want to reduce the
10103 preferred alignment to @option{-mpreferred-stack-boundary=2}.
10104
10105 @item -mmmx
10106 @itemx -mno-mmx
10107 @item -msse
10108 @itemx -mno-sse
10109 @item -msse2
10110 @itemx -mno-sse2
10111 @item -msse3
10112 @itemx -mno-sse3
10113 @item -mssse3
10114 @itemx -mno-ssse3
10115 @item -msse4a
10116 @item -mno-sse4a
10117 @item -m3dnow
10118 @itemx -mno-3dnow
10119 @item -mpopcnt
10120 @itemx -mno-popcnt
10121 @item -mabm
10122 @itemx -mno-abm
10123 @opindex mmmx
10124 @opindex mno-mmx
10125 @opindex msse
10126 @opindex mno-sse
10127 @opindex m3dnow
10128 @opindex mno-3dnow
10129 These switches enable or disable the use of instructions in the MMX,
10130 SSE, SSE2, SSE3, SSSE3, SSE4A, ABM or 3DNow! extended instruction sets.
10131 These extensions are also available as built-in functions: see
10132 @ref{X86 Built-in Functions}, for details of the functions enabled and
10133 disabled by these switches.
10134
10135 To have SSE/SSE2 instructions generated automatically from floating-point
10136 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
10137
10138 These options will enable GCC to use these extended instructions in
10139 generated code, even without @option{-mfpmath=sse}.  Applications which
10140 perform runtime CPU detection must compile separate files for each
10141 supported architecture, using the appropriate flags.  In particular,
10142 the file containing the CPU detection code should be compiled without
10143 these options.
10144
10145 @item -mcx16
10146 @opindex -mcx16
10147 This option will enable GCC to use CMPXCHG16B instruction in generated code.
10148 CMPXCHG16B allows for atomic operations on 128-bit double quadword (or oword)
10149 data types.  This is useful for high resolution counters that could be updated
10150 by multiple processors (or cores).  This instruction is generated as part of
10151 atomic built-in functions: see @ref{Atomic Builtins} for details.
10152
10153 @item -msahf
10154 @opindex -msahf
10155 This option will enable GCC to use SAHF instruction in generated 64-bit code.
10156 Early Intel CPUs with Intel 64 lacked LAHF and SAHF instructions supported
10157 by AMD64 until introduction of Pentium 4 G1 step in December 2005.  LAHF and
10158 SAHF are load and store instructions, respectively, for certain status flags.
10159 In 64-bit mode, SAHF instruction is used to optimize @code{fmod}, @code{drem}
10160 or @code{remainder} built-in functions: see @ref{Other Builtins} for details.
10161
10162 @item -mpush-args
10163 @itemx -mno-push-args
10164 @opindex mpush-args
10165 @opindex mno-push-args
10166 Use PUSH operations to store outgoing parameters.  This method is shorter
10167 and usually equally fast as method using SUB/MOV operations and is enabled
10168 by default.  In some cases disabling it may improve performance because of
10169 improved scheduling and reduced dependencies.
10170
10171 @item -maccumulate-outgoing-args
10172 @opindex maccumulate-outgoing-args
10173 If enabled, the maximum amount of space required for outgoing arguments will be
10174 computed in the function prologue.  This is faster on most modern CPUs
10175 because of reduced dependencies, improved scheduling and reduced stack usage
10176 when preferred stack boundary is not equal to 2.  The drawback is a notable
10177 increase in code size.  This switch implies @option{-mno-push-args}.
10178
10179 @item -mthreads
10180 @opindex mthreads
10181 Support thread-safe exception handling on @samp{Mingw32}.  Code that relies
10182 on thread-safe exception handling must compile and link all code with the
10183 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
10184 @option{-D_MT}; when linking, it links in a special thread helper library
10185 @option{-lmingwthrd} which cleans up per thread exception handling data.
10186
10187 @item -mno-align-stringops
10188 @opindex mno-align-stringops
10189 Do not align destination of inlined string operations.  This switch reduces
10190 code size and improves performance in case the destination is already aligned,
10191 but GCC doesn't know about it.
10192
10193 @item -minline-all-stringops
10194 @opindex minline-all-stringops
10195 By default GCC inlines string operations only when destination is known to be
10196 aligned at least to 4 byte boundary.  This enables more inlining, increase code
10197 size, but may improve performance of code that depends on fast memcpy, strlen
10198 and memset for short lengths.
10199
10200 @item -minline-stringops-dynamically
10201 @opindex minline-stringops-dynamically
10202 For string operation of unknown size, inline runtime checks so for small
10203 blocks inline code is used, while for large blocks library call is used.
10204
10205 @item -mstringop-strategy=@var{alg}
10206 @opindex mstringop-strategy=@var{alg}
10207 Overwrite internal decision heuristic about particular algorithm to inline
10208 string operation with.  The allowed values are @code{rep_byte},
10209 @code{rep_4byte}, @code{rep_8byte} for expanding using i386 @code{rep} prefix
10210 of specified size, @code{byte_loop}, @code{loop}, @code{unrolled_loop} for
10211 expanding inline loop, @code{libcall} for always expanding library call.
10212
10213 @item -momit-leaf-frame-pointer
10214 @opindex momit-leaf-frame-pointer
10215 Don't keep the frame pointer in a register for leaf functions.  This
10216 avoids the instructions to save, set up and restore frame pointers and
10217 makes an extra register available in leaf functions.  The option
10218 @option{-fomit-frame-pointer} removes the frame pointer for all functions
10219 which might make debugging harder.
10220
10221 @item -mtls-direct-seg-refs
10222 @itemx -mno-tls-direct-seg-refs
10223 @opindex mtls-direct-seg-refs
10224 Controls whether TLS variables may be accessed with offsets from the
10225 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
10226 or whether the thread base pointer must be added.  Whether or not this
10227 is legal depends on the operating system, and whether it maps the
10228 segment to cover the entire TLS area.
10229
10230 For systems that use GNU libc, the default is on.
10231 @end table
10232
10233 These @samp{-m} switches are supported in addition to the above
10234 on AMD x86-64 processors in 64-bit environments.
10235
10236 @table @gcctabopt
10237 @item -m32
10238 @itemx -m64
10239 @opindex m32
10240 @opindex m64
10241 Generate code for a 32-bit or 64-bit environment.
10242 The 32-bit environment sets int, long and pointer to 32 bits and
10243 generates code that runs on any i386 system.
10244 The 64-bit environment sets int to 32 bits and long and pointer
10245 to 64 bits and generates code for AMD's x86-64 architecture. For
10246 darwin only the -m64 option turns off the @option{-fno-pic} and
10247 @option{-mdynamic-no-pic} options.
10248
10249 @item -mno-red-zone
10250 @opindex no-red-zone
10251 Do not use a so called red zone for x86-64 code.  The red zone is mandated
10252 by the x86-64 ABI, it is a 128-byte area beyond the location of the
10253 stack pointer that will not be modified by signal or interrupt handlers
10254 and therefore can be used for temporary data without adjusting the stack
10255 pointer.  The flag @option{-mno-red-zone} disables this red zone.
10256
10257 @item -mcmodel=small
10258 @opindex mcmodel=small
10259 Generate code for the small code model: the program and its symbols must
10260 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
10261 Programs can be statically or dynamically linked.  This is the default
10262 code model.
10263
10264 @item -mcmodel=kernel
10265 @opindex mcmodel=kernel
10266 Generate code for the kernel code model.  The kernel runs in the
10267 negative 2 GB of the address space.
10268 This model has to be used for Linux kernel code.
10269
10270 @item -mcmodel=medium
10271 @opindex mcmodel=medium
10272 Generate code for the medium model: The program is linked in the lower 2
10273 GB of the address space but symbols can be located anywhere in the
10274 address space.  Programs can be statically or dynamically linked, but
10275 building of shared libraries are not supported with the medium model.
10276
10277 @item -mcmodel=large
10278 @opindex mcmodel=large
10279 Generate code for the large model: This model makes no assumptions
10280 about addresses and sizes of sections.
10281 @end table
10282
10283 @node IA-64 Options
10284 @subsection IA-64 Options
10285 @cindex IA-64 Options
10286
10287 These are the @samp{-m} options defined for the Intel IA-64 architecture.
10288
10289 @table @gcctabopt
10290 @item -mbig-endian
10291 @opindex mbig-endian
10292 Generate code for a big endian target.  This is the default for HP-UX@.
10293
10294 @item -mlittle-endian
10295 @opindex mlittle-endian
10296 Generate code for a little endian target.  This is the default for AIX5
10297 and GNU/Linux.
10298
10299 @item -mgnu-as
10300 @itemx -mno-gnu-as
10301 @opindex mgnu-as
10302 @opindex mno-gnu-as
10303 Generate (or don't) code for the GNU assembler.  This is the default.
10304 @c Also, this is the default if the configure option @option{--with-gnu-as}
10305 @c is used.
10306
10307 @item -mgnu-ld
10308 @itemx -mno-gnu-ld
10309 @opindex mgnu-ld
10310 @opindex mno-gnu-ld
10311 Generate (or don't) code for the GNU linker.  This is the default.
10312 @c Also, this is the default if the configure option @option{--with-gnu-ld}
10313 @c is used.
10314
10315 @item -mno-pic
10316 @opindex mno-pic
10317 Generate code that does not use a global pointer register.  The result
10318 is not position independent code, and violates the IA-64 ABI@.
10319
10320 @item -mvolatile-asm-stop
10321 @itemx -mno-volatile-asm-stop
10322 @opindex mvolatile-asm-stop
10323 @opindex mno-volatile-asm-stop
10324 Generate (or don't) a stop bit immediately before and after volatile asm
10325 statements.
10326
10327 @item -mregister-names
10328 @itemx -mno-register-names
10329 @opindex mregister-names
10330 @opindex mno-register-names
10331 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
10332 the stacked registers.  This may make assembler output more readable.
10333
10334 @item -mno-sdata
10335 @itemx -msdata
10336 @opindex mno-sdata
10337 @opindex msdata
10338 Disable (or enable) optimizations that use the small data section.  This may
10339 be useful for working around optimizer bugs.
10340
10341 @item -mconstant-gp
10342 @opindex mconstant-gp
10343 Generate code that uses a single constant global pointer value.  This is
10344 useful when compiling kernel code.
10345
10346 @item -mauto-pic
10347 @opindex mauto-pic
10348 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
10349 This is useful when compiling firmware code.
10350
10351 @item -minline-float-divide-min-latency
10352 @opindex minline-float-divide-min-latency
10353 Generate code for inline divides of floating point values
10354 using the minimum latency algorithm.
10355
10356 @item -minline-float-divide-max-throughput
10357 @opindex minline-float-divide-max-throughput
10358 Generate code for inline divides of floating point values
10359 using the maximum throughput algorithm.
10360
10361 @item -minline-int-divide-min-latency
10362 @opindex minline-int-divide-min-latency
10363 Generate code for inline divides of integer values
10364 using the minimum latency algorithm.
10365
10366 @item -minline-int-divide-max-throughput
10367 @opindex minline-int-divide-max-throughput
10368 Generate code for inline divides of integer values
10369 using the maximum throughput algorithm.
10370
10371 @item -minline-sqrt-min-latency
10372 @opindex minline-sqrt-min-latency
10373 Generate code for inline square roots
10374 using the minimum latency algorithm.
10375
10376 @item -minline-sqrt-max-throughput
10377 @opindex minline-sqrt-max-throughput
10378 Generate code for inline square roots
10379 using the maximum throughput algorithm.
10380
10381 @item -mno-dwarf2-asm
10382 @itemx -mdwarf2-asm
10383 @opindex mno-dwarf2-asm
10384 @opindex mdwarf2-asm
10385 Don't (or do) generate assembler code for the DWARF2 line number debugging
10386 info.  This may be useful when not using the GNU assembler.
10387
10388 @item -mearly-stop-bits
10389 @itemx -mno-early-stop-bits
10390 @opindex mearly-stop-bits
10391 @opindex mno-early-stop-bits
10392 Allow stop bits to be placed earlier than immediately preceding the
10393 instruction that triggered the stop bit.  This can improve instruction
10394 scheduling, but does not always do so.
10395
10396 @item -mfixed-range=@var{register-range}
10397 @opindex mfixed-range
10398 Generate code treating the given register range as fixed registers.
10399 A fixed register is one that the register allocator can not use.  This is
10400 useful when compiling kernel code.  A register range is specified as
10401 two registers separated by a dash.  Multiple register ranges can be
10402 specified separated by a comma.
10403
10404 @item -mtls-size=@var{tls-size}
10405 @opindex mtls-size
10406 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
10407 64.
10408
10409 @item -mtune=@var{cpu-type}
10410 @opindex mtune
10411 Tune the instruction scheduling for a particular CPU, Valid values are
10412 itanium, itanium1, merced, itanium2, and mckinley.
10413
10414 @item -mt
10415 @itemx -pthread
10416 @opindex mt
10417 @opindex pthread
10418 Add support for multithreading using the POSIX threads library.  This
10419 option sets flags for both the preprocessor and linker.  It does
10420 not affect the thread safety of object code produced by the compiler or
10421 that of libraries supplied with it.  These are HP-UX specific flags.
10422
10423 @item -milp32
10424 @itemx -mlp64
10425 @opindex milp32
10426 @opindex mlp64
10427 Generate code for a 32-bit or 64-bit environment.
10428 The 32-bit environment sets int, long and pointer to 32 bits.
10429 The 64-bit environment sets int to 32 bits and long and pointer
10430 to 64 bits.  These are HP-UX specific flags.
10431
10432 @item -mno-sched-br-data-spec
10433 @itemx -msched-br-data-spec
10434 @opindex -mno-sched-br-data-spec
10435 @opindex -msched-br-data-spec
10436 (Dis/En)able data speculative scheduling before reload.
10437 This will result in generation of the ld.a instructions and
10438 the corresponding check instructions (ld.c / chk.a).
10439 The default is 'disable'.
10440
10441 @item -msched-ar-data-spec
10442 @itemx -mno-sched-ar-data-spec
10443 @opindex -msched-ar-data-spec
10444 @opindex -mno-sched-ar-data-spec
10445 (En/Dis)able data speculative scheduling after reload.
10446 This will result in generation of the ld.a instructions and
10447 the corresponding check instructions (ld.c / chk.a).
10448 The default is 'enable'.
10449
10450 @item -mno-sched-control-spec
10451 @itemx -msched-control-spec
10452 @opindex -mno-sched-control-spec
10453 @opindex -msched-control-spec
10454 (Dis/En)able control speculative scheduling.  This feature is
10455 available only during region scheduling (i.e. before reload).
10456 This will result in generation of the ld.s instructions and
10457 the corresponding check instructions chk.s .
10458 The default is 'disable'.
10459
10460 @item -msched-br-in-data-spec
10461 @itemx -mno-sched-br-in-data-spec
10462 @opindex -msched-br-in-data-spec
10463 @opindex -mno-sched-br-in-data-spec
10464 (En/Dis)able speculative scheduling of the instructions that
10465 are dependent on the data speculative loads before reload.
10466 This is effective only with @option{-msched-br-data-spec} enabled.
10467 The default is 'enable'.
10468
10469 @item -msched-ar-in-data-spec
10470 @itemx -mno-sched-ar-in-data-spec
10471 @opindex -msched-ar-in-data-spec
10472 @opindex -mno-sched-ar-in-data-spec
10473 (En/Dis)able speculative scheduling of the instructions that
10474 are dependent on the data speculative loads after reload.
10475 This is effective only with @option{-msched-ar-data-spec} enabled.
10476 The default is 'enable'.
10477
10478 @item -msched-in-control-spec
10479 @itemx -mno-sched-in-control-spec
10480 @opindex -msched-in-control-spec
10481 @opindex -mno-sched-in-control-spec
10482 (En/Dis)able speculative scheduling of the instructions that
10483 are dependent on the control speculative loads.
10484 This is effective only with @option{-msched-control-spec} enabled.
10485 The default is 'enable'.
10486
10487 @item -msched-ldc
10488 @itemx -mno-sched-ldc
10489 @opindex -msched-ldc
10490 @opindex -mno-sched-ldc
10491 (En/Dis)able use of simple data speculation checks ld.c .
10492 If disabled, only chk.a instructions will be emitted to check
10493 data speculative loads.
10494 The default is 'enable'.
10495
10496 @item -mno-sched-control-ldc
10497 @itemx -msched-control-ldc
10498 @opindex -mno-sched-control-ldc
10499 @opindex -msched-control-ldc
10500 (Dis/En)able use of ld.c instructions to check control speculative loads.
10501 If enabled, in case of control speculative load with no speculatively
10502 scheduled dependent instructions this load will be emitted as ld.sa and
10503 ld.c will be used to check it.
10504 The default is 'disable'.
10505
10506 @item -mno-sched-spec-verbose
10507 @itemx -msched-spec-verbose
10508 @opindex -mno-sched-spec-verbose
10509 @opindex -msched-spec-verbose
10510 (Dis/En)able printing of the information about speculative motions.
10511
10512 @item -mno-sched-prefer-non-data-spec-insns
10513 @itemx -msched-prefer-non-data-spec-insns
10514 @opindex -mno-sched-prefer-non-data-spec-insns
10515 @opindex -msched-prefer-non-data-spec-insns
10516 If enabled, data speculative instructions will be chosen for schedule
10517 only if there are no other choices at the moment.  This will make
10518 the use of the data speculation much more conservative.
10519 The default is 'disable'.
10520
10521 @item -mno-sched-prefer-non-control-spec-insns
10522 @itemx -msched-prefer-non-control-spec-insns
10523 @opindex -mno-sched-prefer-non-control-spec-insns
10524 @opindex -msched-prefer-non-control-spec-insns
10525 If enabled, control speculative instructions will be chosen for schedule
10526 only if there are no other choices at the moment.  This will make
10527 the use of the control speculation much more conservative.
10528 The default is 'disable'.
10529
10530 @item -mno-sched-count-spec-in-critical-path
10531 @itemx -msched-count-spec-in-critical-path
10532 @opindex -mno-sched-count-spec-in-critical-path
10533 @opindex -msched-count-spec-in-critical-path
10534 If enabled, speculative dependencies will be considered during
10535 computation of the instructions priorities.  This will make the use of the
10536 speculation a bit more conservative.
10537 The default is 'disable'.
10538
10539 @end table
10540
10541 @node M32C Options
10542 @subsection M32C Options
10543 @cindex M32C options
10544
10545 @table @gcctabopt
10546 @item -mcpu=@var{name}
10547 @opindex mcpu=
10548 Select the CPU for which code is generated.  @var{name} may be one of
10549 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
10550 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
10551 the M32C/80 series.
10552
10553 @item -msim
10554 @opindex msim
10555 Specifies that the program will be run on the simulator.  This causes
10556 an alternate runtime library to be linked in which supports, for
10557 example, file I/O.  You must not use this option when generating
10558 programs that will run on real hardware; you must provide your own
10559 runtime library for whatever I/O functions are needed.
10560
10561 @item -memregs=@var{number}
10562 @opindex memregs=
10563 Specifies the number of memory-based pseudo-registers GCC will use
10564 during code generation.  These pseudo-registers will be used like real
10565 registers, so there is a tradeoff between GCC's ability to fit the
10566 code into available registers, and the performance penalty of using
10567 memory instead of registers.  Note that all modules in a program must
10568 be compiled with the same value for this option.  Because of that, you
10569 must not use this option with the default runtime libraries gcc
10570 builds.
10571
10572 @end table
10573
10574 @node M32R/D Options
10575 @subsection M32R/D Options
10576 @cindex M32R/D options
10577
10578 These @option{-m} options are defined for Renesas M32R/D architectures:
10579
10580 @table @gcctabopt
10581 @item -m32r2
10582 @opindex m32r2
10583 Generate code for the M32R/2@.
10584
10585 @item -m32rx
10586 @opindex m32rx
10587 Generate code for the M32R/X@.
10588
10589 @item -m32r
10590 @opindex m32r
10591 Generate code for the M32R@.  This is the default.
10592
10593 @item -mmodel=small
10594 @opindex mmodel=small
10595 Assume all objects live in the lower 16MB of memory (so that their addresses
10596 can be loaded with the @code{ld24} instruction), and assume all subroutines
10597 are reachable with the @code{bl} instruction.
10598 This is the default.
10599
10600 The addressability of a particular object can be set with the
10601 @code{model} attribute.
10602
10603 @item -mmodel=medium
10604 @opindex mmodel=medium
10605 Assume objects may be anywhere in the 32-bit address space (the compiler
10606 will generate @code{seth/add3} instructions to load their addresses), and
10607 assume all subroutines are reachable with the @code{bl} instruction.
10608
10609 @item -mmodel=large
10610 @opindex mmodel=large
10611 Assume objects may be anywhere in the 32-bit address space (the compiler
10612 will generate @code{seth/add3} instructions to load their addresses), and
10613 assume subroutines may not be reachable with the @code{bl} instruction
10614 (the compiler will generate the much slower @code{seth/add3/jl}
10615 instruction sequence).
10616
10617 @item -msdata=none
10618 @opindex msdata=none
10619 Disable use of the small data area.  Variables will be put into
10620 one of @samp{.data}, @samp{bss}, or @samp{.rodata} (unless the
10621 @code{section} attribute has been specified).
10622 This is the default.
10623
10624 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
10625 Objects may be explicitly put in the small data area with the
10626 @code{section} attribute using one of these sections.
10627
10628 @item -msdata=sdata
10629 @opindex msdata=sdata
10630 Put small global and static data in the small data area, but do not
10631 generate special code to reference them.
10632
10633 @item -msdata=use
10634 @opindex msdata=use
10635 Put small global and static data in the small data area, and generate
10636 special instructions to reference them.
10637
10638 @item -G @var{num}
10639 @opindex G
10640 @cindex smaller data references
10641 Put global and static objects less than or equal to @var{num} bytes
10642 into the small data or bss sections instead of the normal data or bss
10643 sections.  The default value of @var{num} is 8.
10644 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
10645 for this option to have any effect.
10646
10647 All modules should be compiled with the same @option{-G @var{num}} value.
10648 Compiling with different values of @var{num} may or may not work; if it
10649 doesn't the linker will give an error message---incorrect code will not be
10650 generated.
10651
10652 @item -mdebug
10653 @opindex mdebug
10654 Makes the M32R specific code in the compiler display some statistics
10655 that might help in debugging programs.
10656
10657 @item -malign-loops
10658 @opindex malign-loops
10659 Align all loops to a 32-byte boundary.
10660
10661 @item -mno-align-loops
10662 @opindex mno-align-loops
10663 Do not enforce a 32-byte alignment for loops.  This is the default.
10664
10665 @item -missue-rate=@var{number}
10666 @opindex missue-rate=@var{number}
10667 Issue @var{number} instructions per cycle.  @var{number} can only be 1
10668 or 2.
10669
10670 @item -mbranch-cost=@var{number}
10671 @opindex mbranch-cost=@var{number}
10672 @var{number} can only be 1 or 2.  If it is 1 then branches will be
10673 preferred over conditional code, if it is 2, then the opposite will
10674 apply.
10675
10676 @item -mflush-trap=@var{number}
10677 @opindex mflush-trap=@var{number}
10678 Specifies the trap number to use to flush the cache.  The default is
10679 12.  Valid numbers are between 0 and 15 inclusive.
10680
10681 @item -mno-flush-trap
10682 @opindex mno-flush-trap
10683 Specifies that the cache cannot be flushed by using a trap.
10684
10685 @item -mflush-func=@var{name}
10686 @opindex mflush-func=@var{name}
10687 Specifies the name of the operating system function to call to flush
10688 the cache.  The default is @emph{_flush_cache}, but a function call
10689 will only be used if a trap is not available.
10690
10691 @item -mno-flush-func
10692 @opindex mno-flush-func
10693 Indicates that there is no OS function for flushing the cache.
10694
10695 @end table
10696
10697 @node M680x0 Options
10698 @subsection M680x0 Options
10699 @cindex M680x0 options
10700
10701 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
10702 The default settings depend on which architecture was selected when
10703 the compiler was configured; the defaults for the most common choices
10704 are given below.
10705
10706 @table @gcctabopt
10707 @item -march=@var{arch}
10708 @opindex march
10709 Generate code for a specific M680x0 or ColdFire instruction set
10710 architecture.  Permissible values of @var{arch} for M680x0
10711 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
10712 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
10713 architectures are selected according to Freescale's ISA classification
10714 and the permissible values are: @samp{isaa}, @samp{isaaplus},
10715 @samp{isab} and @samp{isac}.
10716
10717 gcc defines a macro @samp{__mcf@var{arch}__} whenever it is generating
10718 code for a ColdFire target.  The @var{arch} in this macro is one of the
10719 @option{-march} arguments given above.
10720
10721 When used together, @option{-march} and @option{-mtune} select code
10722 that runs on a family of similar processors but that is optimized
10723 for a particular microarchitecture.
10724
10725 @item -mcpu=@var{cpu}
10726 @opindex mcpu
10727 Generate code for a specific M680x0 or ColdFire processor.
10728 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
10729 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
10730 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
10731 below, which also classifies the CPUs into families:
10732
10733 @multitable @columnfractions 0.20 0.80
10734 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
10735 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
10736 @item @samp{5206e} @tab @samp{5206e}
10737 @item @samp{5208} @tab @samp{5207} @samp{5208}
10738 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
10739 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
10740 @item @samp{5216} @tab @samp{5214} @samp{5216}
10741 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
10742 @item @samp{5225} @tab @samp{5224} @samp{5225}
10743 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
10744 @item @samp{5249} @tab @samp{5249}
10745 @item @samp{5250} @tab @samp{5250}
10746 @item @samp{5271} @tab @samp{5270} @samp{5271}
10747 @item @samp{5272} @tab @samp{5272}
10748 @item @samp{5275} @tab @samp{5274} @samp{5275}
10749 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
10750 @item @samp{5307} @tab @samp{5307}
10751 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
10752 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
10753 @item @samp{5407} @tab @samp{5407}
10754 @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}
10755 @end multitable
10756
10757 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
10758 @var{arch} is compatible with @var{cpu}.  Other combinations of
10759 @option{-mcpu} and @option{-march} are rejected.
10760
10761 gcc defines the macro @samp{__mcf_cpu_@var{cpu}} when ColdFire target
10762 @var{cpu} is selected.  It also defines @samp{__mcf_family_@var{family}},
10763 where the value of @var{family} is given by the table above.
10764
10765 @item -mtune=@var{tune}
10766 @opindex mtune
10767 Tune the code for a particular microarchitecture, within the
10768 constraints set by @option{-march} and @option{-mcpu}.
10769 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
10770 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
10771 and @samp{cpu32}.  The ColdFire microarchitectures
10772 are: @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
10773
10774 You can also use @option{-mtune=68020-40} for code that needs
10775 to run relatively well on 68020, 68030 and 68040 targets.
10776 @option{-mtune=68020-60} is similar but includes 68060 targets
10777 as well.  These two options select the same tuning decisions as
10778 @option{-m68020-40} and @option{-m68020-60} respectively.
10779
10780 gcc defines the macros @samp{__mc@var{arch}} and @samp{__mc@var{arch}__}
10781 when tuning for 680x0 architecture @var{arch}.  It also defines
10782 @samp{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
10783 option is used.  If gcc is tuning for a range of architectures,
10784 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
10785 it defines the macros for every architecture in the range.
10786
10787 gcc also defines the macro @samp{__m@var{uarch}__} when tuning for
10788 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
10789 of the arguments given above.
10790
10791 @item -m68000
10792 @itemx -mc68000
10793 @opindex m68000
10794 @opindex mc68000
10795 Generate output for a 68000.  This is the default
10796 when the compiler is configured for 68000-based systems.
10797 It is equivalent to @option{-march=68000}.
10798
10799 Use this option for microcontrollers with a 68000 or EC000 core,
10800 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
10801
10802 @item -m68010
10803 @opindex m68010
10804 Generate output for a 68010.  This is the default
10805 when the compiler is configured for 68010-based systems.
10806 It is equivalent to @option{-march=68010}.
10807
10808 @item -m68020
10809 @itemx -mc68020
10810 @opindex m68020
10811 @opindex mc68020
10812 Generate output for a 68020.  This is the default
10813 when the compiler is configured for 68020-based systems.
10814 It is equivalent to @option{-march=68020}.
10815
10816 @item -m68030
10817 @opindex m68030
10818 Generate output for a 68030.  This is the default when the compiler is
10819 configured for 68030-based systems.  It is equivalent to
10820 @option{-march=68030}.
10821
10822 @item -m68040
10823 @opindex m68040
10824 Generate output for a 68040.  This is the default when the compiler is
10825 configured for 68040-based systems.  It is equivalent to
10826 @option{-march=68040}.
10827
10828 This option inhibits the use of 68881/68882 instructions that have to be
10829 emulated by software on the 68040.  Use this option if your 68040 does not
10830 have code to emulate those instructions.
10831
10832 @item -m68060
10833 @opindex m68060
10834 Generate output for a 68060.  This is the default when the compiler is
10835 configured for 68060-based systems.  It is equivalent to
10836 @option{-march=68060}.
10837
10838 This option inhibits the use of 68020 and 68881/68882 instructions that
10839 have to be emulated by software on the 68060.  Use this option if your 68060
10840 does not have code to emulate those instructions.
10841
10842 @item -mcpu32
10843 @opindex mcpu32
10844 Generate output for a CPU32.  This is the default
10845 when the compiler is configured for CPU32-based systems.
10846 It is equivalent to @option{-march=cpu32}.
10847
10848 Use this option for microcontrollers with a
10849 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
10850 68336, 68340, 68341, 68349 and 68360.
10851
10852 @item -m5200
10853 @opindex m5200
10854 Generate output for a 520X ColdFire CPU.  This is the default
10855 when the compiler is configured for 520X-based systems.
10856 It is equivalent to @option{-mcpu=5206}, and is now deprecated
10857 in favor of that option.
10858
10859 Use this option for microcontroller with a 5200 core, including
10860 the MCF5202, MCF5203, MCF5204 and MCF5206.
10861
10862 @item -m5206e
10863 @opindex m5206e
10864 Generate output for a 5206e ColdFire CPU.  The option is now
10865 deprecated in favor of the equivalent @option{-mcpu=5206e}.
10866
10867 @item -m528x
10868 @opindex m528x
10869 Generate output for a member of the ColdFire 528X family.
10870 The option is now deprecated in favor of the equivalent
10871 @option{-mcpu=528x}.
10872
10873 @item -m5307
10874 @opindex m5307
10875 Generate output for a ColdFire 5307 CPU.  The option is now deprecated
10876 in favor of the equivalent @option{-mcpu=5307}.
10877
10878 @item -m5407
10879 @opindex m5407
10880 Generate output for a ColdFire 5407 CPU.  The option is now deprecated
10881 in favor of the equivalent @option{-mcpu=5407}.
10882
10883 @item -mcfv4e
10884 @opindex mcfv4e
10885 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
10886 This includes use of hardware floating point instructions.
10887 The option is equivalent to @option{-mcpu=547x}, and is now
10888 deprecated in favor of that option.
10889
10890 @item -m68020-40
10891 @opindex m68020-40
10892 Generate output for a 68040, without using any of the new instructions.
10893 This results in code which can run relatively efficiently on either a
10894 68020/68881 or a 68030 or a 68040.  The generated code does use the
10895 68881 instructions that are emulated on the 68040.
10896
10897 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
10898
10899 @item -m68020-60
10900 @opindex m68020-60
10901 Generate output for a 68060, without using any of the new instructions.
10902 This results in code which can run relatively efficiently on either a
10903 68020/68881 or a 68030 or a 68040.  The generated code does use the
10904 68881 instructions that are emulated on the 68060.
10905
10906 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
10907
10908 @item -mhard-float
10909 @itemx -m68881
10910 @opindex mhard-float
10911 @opindex m68881
10912 Generate floating-point instructions.  This is the default for 68020
10913 and above, and for ColdFire devices that have an FPU.  It defines the
10914 macro @samp{__HAVE_68881__} on M680x0 targets and @samp{__mcffpu__}
10915 on ColdFire targets.
10916
10917 @item -msoft-float
10918 @opindex msoft-float
10919 Do not generate floating-point instructions; use library calls instead.
10920 This is the default for 68000, 68010, and 68832 targets.  It is also
10921 the default for ColdFire devices that have no FPU.
10922
10923 @item -mdiv
10924 @itemx -mno-div
10925 @opindex mdiv
10926 @opindex mno-div
10927 Generate (do not generate) ColdFire hardware divide and remainder
10928 instructions.  If @option{-march} is used without @option{-mcpu},
10929 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
10930 architectures.  Otherwise, the default is taken from the target CPU
10931 (either the default CPU, or the one specified by @option{-mcpu}).  For
10932 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
10933 @option{-mcpu=5206e}.
10934
10935 gcc defines the macro @samp{__mcfhwdiv__} when this option is enabled.
10936
10937 @item -mshort
10938 @opindex mshort
10939 Consider type @code{int} to be 16 bits wide, like @code{short int}.
10940 Additionally, parameters passed on the stack are also aligned to a
10941 16-bit boundary even on targets whose API mandates promotion to 32-bit.
10942
10943 @item -mno-short
10944 @opindex -mno-short
10945 Do not consider type @code{int} to be 16 bits wide.  This is the default.
10946
10947 @item -mnobitfield
10948 @itemx -mno-bitfield
10949 @opindex mnobitfield
10950 @opindex mno-bitfield
10951 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
10952 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
10953
10954 @item -mbitfield
10955 @opindex mbitfield
10956 Do use the bit-field instructions.  The @option{-m68020} option implies
10957 @option{-mbitfield}.  This is the default if you use a configuration
10958 designed for a 68020.
10959
10960 @item -mrtd
10961 @opindex mrtd
10962 Use a different function-calling convention, in which functions
10963 that take a fixed number of arguments return with the @code{rtd}
10964 instruction, which pops their arguments while returning.  This
10965 saves one instruction in the caller since there is no need to pop
10966 the arguments there.
10967
10968 This calling convention is incompatible with the one normally
10969 used on Unix, so you cannot use it if you need to call libraries
10970 compiled with the Unix compiler.
10971
10972 Also, you must provide function prototypes for all functions that
10973 take variable numbers of arguments (including @code{printf});
10974 otherwise incorrect code will be generated for calls to those
10975 functions.
10976
10977 In addition, seriously incorrect code will result if you call a
10978 function with too many arguments.  (Normally, extra arguments are
10979 harmlessly ignored.)
10980
10981 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
10982 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
10983
10984 @item -mno-rtd
10985 @opindex mno-rtd
10986 Do not use the calling conventions selected by @option{-mrtd}.
10987 This is the default.
10988
10989 @item -malign-int
10990 @itemx -mno-align-int
10991 @opindex malign-int
10992 @opindex mno-align-int
10993 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
10994 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
10995 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
10996 Aligning variables on 32-bit boundaries produces code that runs somewhat
10997 faster on processors with 32-bit busses at the expense of more memory.
10998
10999 @strong{Warning:} if you use the @option{-malign-int} switch, GCC will
11000 align structures containing the above types  differently than
11001 most published application binary interface specifications for the m68k.
11002
11003 @item -mpcrel
11004 @opindex mpcrel
11005 Use the pc-relative addressing mode of the 68000 directly, instead of
11006 using a global offset table.  At present, this option implies @option{-fpic},
11007 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
11008 not presently supported with @option{-mpcrel}, though this could be supported for
11009 68020 and higher processors.
11010
11011 @item -mno-strict-align
11012 @itemx -mstrict-align
11013 @opindex mno-strict-align
11014 @opindex mstrict-align
11015 Do not (do) assume that unaligned memory references will be handled by
11016 the system.
11017
11018 @item -msep-data
11019 Generate code that allows the data segment to be located in a different
11020 area of memory from the text segment.  This allows for execute in place in
11021 an environment without virtual memory management.  This option implies
11022 @option{-fPIC}.
11023
11024 @item -mno-sep-data
11025 Generate code that assumes that the data segment follows the text segment.
11026 This is the default.
11027
11028 @item -mid-shared-library
11029 Generate code that supports shared libraries via the library ID method.
11030 This allows for execute in place and shared libraries in an environment
11031 without virtual memory management.  This option implies @option{-fPIC}.
11032
11033 @item -mno-id-shared-library
11034 Generate code that doesn't assume ID based shared libraries are being used.
11035 This is the default.
11036
11037 @item -mshared-library-id=n
11038 Specified the identification number of the ID based shared library being
11039 compiled.  Specifying a value of 0 will generate more compact code, specifying
11040 other values will force the allocation of that number to the current
11041 library but is no more space or time efficient than omitting this option.
11042
11043 @end table
11044
11045 @node M68hc1x Options
11046 @subsection M68hc1x Options
11047 @cindex M68hc1x options
11048
11049 These are the @samp{-m} options defined for the 68hc11 and 68hc12
11050 microcontrollers.  The default values for these options depends on
11051 which style of microcontroller was selected when the compiler was configured;
11052 the defaults for the most common choices are given below.
11053
11054 @table @gcctabopt
11055 @item -m6811
11056 @itemx -m68hc11
11057 @opindex m6811
11058 @opindex m68hc11
11059 Generate output for a 68HC11.  This is the default
11060 when the compiler is configured for 68HC11-based systems.
11061
11062 @item -m6812
11063 @itemx -m68hc12
11064 @opindex m6812
11065 @opindex m68hc12
11066 Generate output for a 68HC12.  This is the default
11067 when the compiler is configured for 68HC12-based systems.
11068
11069 @item -m68S12
11070 @itemx -m68hcs12
11071 @opindex m68S12
11072 @opindex m68hcs12
11073 Generate output for a 68HCS12.
11074
11075 @item -mauto-incdec
11076 @opindex mauto-incdec
11077 Enable the use of 68HC12 pre and post auto-increment and auto-decrement
11078 addressing modes.
11079
11080 @item -minmax
11081 @itemx -nominmax
11082 @opindex minmax
11083 @opindex mnominmax
11084 Enable the use of 68HC12 min and max instructions.
11085
11086 @item -mlong-calls
11087 @itemx -mno-long-calls
11088 @opindex mlong-calls
11089 @opindex mno-long-calls
11090 Treat all calls as being far away (near).  If calls are assumed to be
11091 far away, the compiler will use the @code{call} instruction to
11092 call a function and the @code{rtc} instruction for returning.
11093
11094 @item -mshort
11095 @opindex mshort
11096 Consider type @code{int} to be 16 bits wide, like @code{short int}.
11097
11098 @item -msoft-reg-count=@var{count}
11099 @opindex msoft-reg-count
11100 Specify the number of pseudo-soft registers which are used for the
11101 code generation.  The maximum number is 32.  Using more pseudo-soft
11102 register may or may not result in better code depending on the program.
11103 The default is 4 for 68HC11 and 2 for 68HC12.
11104
11105 @end table
11106
11107 @node MCore Options
11108 @subsection MCore Options
11109 @cindex MCore options
11110
11111 These are the @samp{-m} options defined for the Motorola M*Core
11112 processors.
11113
11114 @table @gcctabopt
11115
11116 @item -mhardlit
11117 @itemx -mno-hardlit
11118 @opindex mhardlit
11119 @opindex mno-hardlit
11120 Inline constants into the code stream if it can be done in two
11121 instructions or less.
11122
11123 @item -mdiv
11124 @itemx -mno-div
11125 @opindex mdiv
11126 @opindex mno-div
11127 Use the divide instruction.  (Enabled by default).
11128
11129 @item -mrelax-immediate
11130 @itemx -mno-relax-immediate
11131 @opindex mrelax-immediate
11132 @opindex mno-relax-immediate
11133 Allow arbitrary sized immediates in bit operations.
11134
11135 @item -mwide-bitfields
11136 @itemx -mno-wide-bitfields
11137 @opindex mwide-bitfields
11138 @opindex mno-wide-bitfields
11139 Always treat bit-fields as int-sized.
11140
11141 @item -m4byte-functions
11142 @itemx -mno-4byte-functions
11143 @opindex m4byte-functions
11144 @opindex mno-4byte-functions
11145 Force all functions to be aligned to a four byte boundary.
11146
11147 @item -mcallgraph-data
11148 @itemx -mno-callgraph-data
11149 @opindex mcallgraph-data
11150 @opindex mno-callgraph-data
11151 Emit callgraph information.
11152
11153 @item -mslow-bytes
11154 @itemx -mno-slow-bytes
11155 @opindex mslow-bytes
11156 @opindex mno-slow-bytes
11157 Prefer word access when reading byte quantities.
11158
11159 @item -mlittle-endian
11160 @itemx -mbig-endian
11161 @opindex mlittle-endian
11162 @opindex mbig-endian
11163 Generate code for a little endian target.
11164
11165 @item -m210
11166 @itemx -m340
11167 @opindex m210
11168 @opindex m340
11169 Generate code for the 210 processor.
11170 @end table
11171
11172 @node MIPS Options
11173 @subsection MIPS Options
11174 @cindex MIPS options
11175
11176 @table @gcctabopt
11177
11178 @item -EB
11179 @opindex EB
11180 Generate big-endian code.
11181
11182 @item -EL
11183 @opindex EL
11184 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
11185 configurations.
11186
11187 @item -march=@var{arch}
11188 @opindex march
11189 Generate code that will run on @var{arch}, which can be the name of a
11190 generic MIPS ISA, or the name of a particular processor.
11191 The ISA names are:
11192 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
11193 @samp{mips32}, @samp{mips32r2}, and @samp{mips64}.
11194 The processor names are:
11195 @samp{4kc}, @samp{4km}, @samp{4kp},
11196 @samp{4kec}, @samp{4kem}, @samp{4kep},
11197 @samp{5kc}, @samp{5kf},
11198 @samp{20kc},
11199 @samp{24kc}, @samp{24kf}, @samp{24kx},
11200 @samp{24kec}, @samp{24kef}, @samp{24kex},
11201 @samp{34kc}, @samp{34kf}, @samp{34kx},
11202 @samp{m4k},
11203 @samp{orion},
11204 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
11205 @samp{r4600}, @samp{r4650}, @samp{r6000}, @samp{r8000},
11206 @samp{rm7000}, @samp{rm9000},
11207 @samp{sb1},
11208 @samp{sr71000},
11209 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
11210 @samp{vr5000}, @samp{vr5400} and @samp{vr5500}.
11211 The special value @samp{from-abi} selects the
11212 most compatible architecture for the selected ABI (that is,
11213 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
11214
11215 In processor names, a final @samp{000} can be abbreviated as @samp{k}
11216 (for example, @samp{-march=r2k}).  Prefixes are optional, and
11217 @samp{vr} may be written @samp{r}.
11218
11219 GCC defines two macros based on the value of this option.  The first
11220 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
11221 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
11222 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
11223 For example, @samp{-march=r2000} will set @samp{_MIPS_ARCH}
11224 to @samp{"r2000"} and define the macro @samp{_MIPS_ARCH_R2000}.
11225
11226 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
11227 above.  In other words, it will have the full prefix and will not
11228 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
11229 the macro names the resolved architecture (either @samp{"mips1"} or
11230 @samp{"mips3"}).  It names the default architecture when no
11231 @option{-march} option is given.
11232
11233 @item -mtune=@var{arch}
11234 @opindex mtune
11235 Optimize for @var{arch}.  Among other things, this option controls
11236 the way instructions are scheduled, and the perceived cost of arithmetic
11237 operations.  The list of @var{arch} values is the same as for
11238 @option{-march}.
11239
11240 When this option is not used, GCC will optimize for the processor
11241 specified by @option{-march}.  By using @option{-march} and
11242 @option{-mtune} together, it is possible to generate code that will
11243 run on a family of processors, but optimize the code for one
11244 particular member of that family.
11245
11246 @samp{-mtune} defines the macros @samp{_MIPS_TUNE} and
11247 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
11248 @samp{-march} ones described above.
11249
11250 @item -mips1
11251 @opindex mips1
11252 Equivalent to @samp{-march=mips1}.
11253
11254 @item -mips2
11255 @opindex mips2
11256 Equivalent to @samp{-march=mips2}.
11257
11258 @item -mips3
11259 @opindex mips3
11260 Equivalent to @samp{-march=mips3}.
11261
11262 @item -mips4
11263 @opindex mips4
11264 Equivalent to @samp{-march=mips4}.
11265
11266 @item -mips32
11267 @opindex mips32
11268 Equivalent to @samp{-march=mips32}.
11269
11270 @item -mips32r2
11271 @opindex mips32r2
11272 Equivalent to @samp{-march=mips32r2}.
11273
11274 @item -mips64
11275 @opindex mips64
11276 Equivalent to @samp{-march=mips64}.
11277
11278 @item -mips16
11279 @itemx -mno-mips16
11280 @opindex mips16
11281 @opindex mno-mips16
11282 Generate (do not generate) MIPS16 code.  If GCC is targetting a
11283 MIPS32 or MIPS64 architecture, it will make use of the MIPS16e ASE@.
11284
11285 @item -mabi=32
11286 @itemx -mabi=o64
11287 @itemx -mabi=n32
11288 @itemx -mabi=64
11289 @itemx -mabi=eabi
11290 @opindex mabi=32
11291 @opindex mabi=o64
11292 @opindex mabi=n32
11293 @opindex mabi=64
11294 @opindex mabi=eabi
11295 Generate code for the given ABI@.
11296
11297 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
11298 generates 64-bit code when you select a 64-bit architecture, but you
11299 can use @option{-mgp32} to get 32-bit code instead.
11300
11301 For information about the O64 ABI, see
11302 @w{@uref{http://gcc.gnu.org/projects/mipso64-abi.html}}.
11303
11304 GCC supports a variant of the o32 ABI in which floating-point registers
11305 are 64 rather than 32 bits wide.  You can select this combination with
11306 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @samp{mthc1}
11307 and @samp{mfhc1} instructions and is therefore only supported for
11308 MIPS32R2 processors.
11309
11310 The register assignments for arguments and return values remain the
11311 same, but each scalar value is passed in a single 64-bit register
11312 rather than a pair of 32-bit registers.  For example, scalar
11313 floating-point values are returned in @samp{$f0} only, not a
11314 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
11315 remains the same, but all 64 bits are saved.
11316
11317 @item -mabicalls
11318 @itemx -mno-abicalls
11319 @opindex mabicalls
11320 @opindex mno-abicalls
11321 Generate (do not generate) code that is suitable for SVR4-style
11322 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
11323 systems.
11324
11325 @item -mshared
11326 @itemx -mno-shared
11327 Generate (do not generate) code that is fully position-independent,
11328 and that can therefore be linked into shared libraries.  This option
11329 only affects @option{-mabicalls}.
11330
11331 All @option{-mabicalls} code has traditionally been position-independent,
11332 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
11333 as an extension, the GNU toolchain allows executables to use absolute
11334 accesses for locally-binding symbols.  It can also use shorter GP
11335 initialization sequences and generate direct calls to locally-defined
11336 functions.  This mode is selected by @option{-mno-shared}.
11337
11338 @option{-mno-shared} depends on binutils 2.16 or higher and generates
11339 objects that can only be linked by the GNU linker.  However, the option
11340 does not affect the ABI of the final executable; it only affects the ABI
11341 of relocatable objects.  Using @option{-mno-shared} will generally make
11342 executables both smaller and quicker.
11343
11344 @option{-mshared} is the default.
11345
11346 @item -mxgot
11347 @itemx -mno-xgot
11348 @opindex mxgot
11349 @opindex mno-xgot
11350 Lift (do not lift) the usual restrictions on the size of the global
11351 offset table.
11352
11353 GCC normally uses a single instruction to load values from the GOT@.
11354 While this is relatively efficient, it will only work if the GOT
11355 is smaller than about 64k.  Anything larger will cause the linker
11356 to report an error such as:
11357
11358 @cindex relocation truncated to fit (MIPS)
11359 @smallexample
11360 relocation truncated to fit: R_MIPS_GOT16 foobar
11361 @end smallexample
11362
11363 If this happens, you should recompile your code with @option{-mxgot}.
11364 It should then work with very large GOTs, although it will also be
11365 less efficient, since it will take three instructions to fetch the
11366 value of a global symbol.
11367
11368 Note that some linkers can create multiple GOTs.  If you have such a
11369 linker, you should only need to use @option{-mxgot} when a single object
11370 file accesses more than 64k's worth of GOT entries.  Very few do.
11371
11372 These options have no effect unless GCC is generating position
11373 independent code.
11374
11375 @item -mgp32
11376 @opindex mgp32
11377 Assume that general-purpose registers are 32 bits wide.
11378
11379 @item -mgp64
11380 @opindex mgp64
11381 Assume that general-purpose registers are 64 bits wide.
11382
11383 @item -mfp32
11384 @opindex mfp32
11385 Assume that floating-point registers are 32 bits wide.
11386
11387 @item -mfp64
11388 @opindex mfp64
11389 Assume that floating-point registers are 64 bits wide.
11390
11391 @item -mhard-float
11392 @opindex mhard-float
11393 Use floating-point coprocessor instructions.
11394
11395 @item -msoft-float
11396 @opindex msoft-float
11397 Do not use floating-point coprocessor instructions.  Implement
11398 floating-point calculations using library calls instead.
11399
11400 @item -msingle-float
11401 @opindex msingle-float
11402 Assume that the floating-point coprocessor only supports single-precision
11403 operations.
11404
11405 @itemx -mdouble-float
11406 @opindex mdouble-float
11407 Assume that the floating-point coprocessor supports double-precision
11408 operations.  This is the default.
11409
11410 @itemx -mdsp
11411 @itemx -mno-dsp
11412 @opindex mdsp
11413 @opindex mno-dsp
11414 Use (do not use) the MIPS DSP ASE.  @xref{MIPS DSP Built-in Functions}.
11415
11416 @itemx -mdspr2
11417 @itemx -mno-dspr2
11418 @opindex mdspr2
11419 @opindex mno-dspr2
11420 Use (do not use) the MIPS DSP ASE REV 2.  @xref{MIPS DSP Built-in Functions}.
11421 The option @option{-mdspr2} implies @option{-mdsp}.
11422
11423 @itemx -mpaired-single
11424 @itemx -mno-paired-single
11425 @opindex mpaired-single
11426 @opindex mno-paired-single
11427 Use (do not use) paired-single floating-point instructions.
11428 @xref{MIPS Paired-Single Support}.  This option can only be used
11429 when generating 64-bit code and requires hardware floating-point
11430 support to be enabled.
11431
11432 @itemx -mips3d
11433 @itemx -mno-mips3d
11434 @opindex mips3d
11435 @opindex mno-mips3d
11436 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
11437 The option @option{-mips3d} implies @option{-mpaired-single}.
11438
11439 @item -mlong64
11440 @opindex mlong64
11441 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
11442 an explanation of the default and the way that the pointer size is
11443 determined.
11444
11445 @item -mlong32
11446 @opindex mlong32
11447 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
11448
11449 The default size of @code{int}s, @code{long}s and pointers depends on
11450 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
11451 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
11452 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
11453 or the same size as integer registers, whichever is smaller.
11454
11455 @item -msym32
11456 @itemx -mno-sym32
11457 @opindex msym32
11458 @opindex mno-sym32
11459 Assume (do not assume) that all symbols have 32-bit values, regardless
11460 of the selected ABI@.  This option is useful in combination with
11461 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
11462 to generate shorter and faster references to symbolic addresses.
11463
11464 @item -G @var{num}
11465 @opindex G
11466 @cindex smaller data references (MIPS)
11467 @cindex gp-relative references (MIPS)
11468 Put global and static items less than or equal to @var{num} bytes into
11469 the small data or bss section instead of the normal data or bss section.
11470 This allows the data to be accessed using a single instruction.
11471
11472 All modules should be compiled with the same @option{-G @var{num}}
11473 value.
11474
11475 @item -membedded-data
11476 @itemx -mno-embedded-data
11477 @opindex membedded-data
11478 @opindex mno-embedded-data
11479 Allocate variables to the read-only data section first if possible, then
11480 next in the small data section if possible, otherwise in data.  This gives
11481 slightly slower code than the default, but reduces the amount of RAM required
11482 when executing, and thus may be preferred for some embedded systems.
11483
11484 @item -muninit-const-in-rodata
11485 @itemx -mno-uninit-const-in-rodata
11486 @opindex muninit-const-in-rodata
11487 @opindex mno-uninit-const-in-rodata
11488 Put uninitialized @code{const} variables in the read-only data section.
11489 This option is only meaningful in conjunction with @option{-membedded-data}.
11490
11491 @item -msplit-addresses
11492 @itemx -mno-split-addresses
11493 @opindex msplit-addresses
11494 @opindex mno-split-addresses
11495 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
11496 relocation operators.  This option has been superseded by
11497 @option{-mexplicit-relocs} but is retained for backwards compatibility.
11498
11499 @item -mexplicit-relocs
11500 @itemx -mno-explicit-relocs
11501 @opindex mexplicit-relocs
11502 @opindex mno-explicit-relocs
11503 Use (do not use) assembler relocation operators when dealing with symbolic
11504 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
11505 is to use assembler macros instead.
11506
11507 @option{-mexplicit-relocs} is the default if GCC was configured
11508 to use an assembler that supports relocation operators.
11509
11510 @item -mcheck-zero-division
11511 @itemx -mno-check-zero-division
11512 @opindex mcheck-zero-division
11513 @opindex mno-check-zero-division
11514 Trap (do not trap) on integer division by zero.
11515
11516 The default is @option{-mcheck-zero-division}.
11517
11518 @item -mdivide-traps
11519 @itemx -mdivide-breaks
11520 @opindex mdivide-traps
11521 @opindex mdivide-breaks
11522 MIPS systems check for division by zero by generating either a
11523 conditional trap or a break instruction.  Using traps results in
11524 smaller code, but is only supported on MIPS II and later.  Also, some
11525 versions of the Linux kernel have a bug that prevents trap from
11526 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
11527 allow conditional traps on architectures that support them and
11528 @option{-mdivide-breaks} to force the use of breaks.
11529
11530 The default is usually @option{-mdivide-traps}, but this can be
11531 overridden at configure time using @option{--with-divide=breaks}.
11532 Divide-by-zero checks can be completely disabled using
11533 @option{-mno-check-zero-division}.
11534
11535 @item -mmemcpy
11536 @itemx -mno-memcpy
11537 @opindex mmemcpy
11538 @opindex mno-memcpy
11539 Force (do not force) the use of @code{memcpy()} for non-trivial block
11540 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
11541 most constant-sized copies.
11542
11543 @item -mlong-calls
11544 @itemx -mno-long-calls
11545 @opindex mlong-calls
11546 @opindex mno-long-calls
11547 Disable (do not disable) use of the @code{jal} instruction.  Calling
11548 functions using @code{jal} is more efficient but requires the caller
11549 and callee to be in the same 256 megabyte segment.
11550
11551 This option has no effect on abicalls code.  The default is
11552 @option{-mno-long-calls}.
11553
11554 @item -mmad
11555 @itemx -mno-mad
11556 @opindex mmad
11557 @opindex mno-mad
11558 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
11559 instructions, as provided by the R4650 ISA@.
11560
11561 @item -mfused-madd
11562 @itemx -mno-fused-madd
11563 @opindex mfused-madd
11564 @opindex mno-fused-madd
11565 Enable (disable) use of the floating point multiply-accumulate
11566 instructions, when they are available.  The default is
11567 @option{-mfused-madd}.
11568
11569 When multiply-accumulate instructions are used, the intermediate
11570 product is calculated to infinite precision and is not subject to
11571 the FCSR Flush to Zero bit.  This may be undesirable in some
11572 circumstances.
11573
11574 @item -nocpp
11575 @opindex nocpp
11576 Tell the MIPS assembler to not run its preprocessor over user
11577 assembler files (with a @samp{.s} suffix) when assembling them.
11578
11579 @item -mfix-r4000
11580 @itemx -mno-fix-r4000
11581 @opindex mfix-r4000
11582 @opindex mno-fix-r4000
11583 Work around certain R4000 CPU errata:
11584 @itemize @minus
11585 @item
11586 A double-word or a variable shift may give an incorrect result if executed
11587 immediately after starting an integer division.
11588 @item
11589 A double-word or a variable shift may give an incorrect result if executed
11590 while an integer multiplication is in progress.
11591 @item
11592 An integer division may give an incorrect result if started in a delay slot
11593 of a taken branch or a jump.
11594 @end itemize
11595
11596 @item -mfix-r4400
11597 @itemx -mno-fix-r4400
11598 @opindex mfix-r4400
11599 @opindex mno-fix-r4400
11600 Work around certain R4400 CPU errata:
11601 @itemize @minus
11602 @item
11603 A double-word or a variable shift may give an incorrect result if executed
11604 immediately after starting an integer division.
11605 @end itemize
11606
11607 @item -mfix-vr4120
11608 @itemx -mno-fix-vr4120
11609 @opindex mfix-vr4120
11610 Work around certain VR4120 errata:
11611 @itemize @minus
11612 @item
11613 @code{dmultu} does not always produce the correct result.
11614 @item
11615 @code{div} and @code{ddiv} do not always produce the correct result if one
11616 of the operands is negative.
11617 @end itemize
11618 The workarounds for the division errata rely on special functions in
11619 @file{libgcc.a}.  At present, these functions are only provided by
11620 the @code{mips64vr*-elf} configurations.
11621
11622 Other VR4120 errata require a nop to be inserted between certain pairs of
11623 instructions.  These errata are handled by the assembler, not by GCC itself.
11624
11625 @item -mfix-vr4130
11626 @opindex mfix-vr4130
11627 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
11628 workarounds are implemented by the assembler rather than by GCC,
11629 although GCC will avoid using @code{mflo} and @code{mfhi} if the
11630 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
11631 instructions are available instead.
11632
11633 @item -mfix-sb1
11634 @itemx -mno-fix-sb1
11635 @opindex mfix-sb1
11636 Work around certain SB-1 CPU core errata.
11637 (This flag currently works around the SB-1 revision 2
11638 ``F1'' and ``F2'' floating point errata.)
11639
11640 @item -mflush-func=@var{func}
11641 @itemx -mno-flush-func
11642 @opindex mflush-func
11643 Specifies the function to call to flush the I and D caches, or to not
11644 call any such function.  If called, the function must take the same
11645 arguments as the common @code{_flush_func()}, that is, the address of the
11646 memory range for which the cache is being flushed, the size of the
11647 memory range, and the number 3 (to flush both caches).  The default
11648 depends on the target GCC was configured for, but commonly is either
11649 @samp{_flush_func} or @samp{__cpu_flush}.
11650
11651 @item -mbranch-likely
11652 @itemx -mno-branch-likely
11653 @opindex mbranch-likely
11654 @opindex mno-branch-likely
11655 Enable or disable use of Branch Likely instructions, regardless of the
11656 default for the selected architecture.  By default, Branch Likely
11657 instructions may be generated if they are supported by the selected
11658 architecture.  An exception is for the MIPS32 and MIPS64 architectures
11659 and processors which implement those architectures; for those, Branch
11660 Likely instructions will not be generated by default because the MIPS32
11661 and MIPS64 architectures specifically deprecate their use.
11662
11663 @item -mfp-exceptions
11664 @itemx -mno-fp-exceptions
11665 @opindex mfp-exceptions
11666 Specifies whether FP exceptions are enabled.  This affects how we schedule
11667 FP instructions for some processors.  The default is that FP exceptions are
11668 enabled.
11669
11670 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
11671 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
11672 FP pipe.
11673
11674 @item -mvr4130-align
11675 @itemx -mno-vr4130-align
11676 @opindex mvr4130-align
11677 The VR4130 pipeline is two-way superscalar, but can only issue two
11678 instructions together if the first one is 8-byte aligned.  When this
11679 option is enabled, GCC will align pairs of instructions that it
11680 thinks should execute in parallel.
11681
11682 This option only has an effect when optimizing for the VR4130.
11683 It normally makes code faster, but at the expense of making it bigger.
11684 It is enabled by default at optimization level @option{-O3}.
11685 @end table
11686
11687 @node MMIX Options
11688 @subsection MMIX Options
11689 @cindex MMIX Options
11690
11691 These options are defined for the MMIX:
11692
11693 @table @gcctabopt
11694 @item -mlibfuncs
11695 @itemx -mno-libfuncs
11696 @opindex mlibfuncs
11697 @opindex mno-libfuncs
11698 Specify that intrinsic library functions are being compiled, passing all
11699 values in registers, no matter the size.
11700
11701 @item -mepsilon
11702 @itemx -mno-epsilon
11703 @opindex mepsilon
11704 @opindex mno-epsilon
11705 Generate floating-point comparison instructions that compare with respect
11706 to the @code{rE} epsilon register.
11707
11708 @item -mabi=mmixware
11709 @itemx -mabi=gnu
11710 @opindex mabi-mmixware
11711 @opindex mabi=gnu
11712 Generate code that passes function parameters and return values that (in
11713 the called function) are seen as registers @code{$0} and up, as opposed to
11714 the GNU ABI which uses global registers @code{$231} and up.
11715
11716 @item -mzero-extend
11717 @itemx -mno-zero-extend
11718 @opindex mzero-extend
11719 @opindex mno-zero-extend
11720 When reading data from memory in sizes shorter than 64 bits, use (do not
11721 use) zero-extending load instructions by default, rather than
11722 sign-extending ones.
11723
11724 @item -mknuthdiv
11725 @itemx -mno-knuthdiv
11726 @opindex mknuthdiv
11727 @opindex mno-knuthdiv
11728 Make the result of a division yielding a remainder have the same sign as
11729 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
11730 remainder follows the sign of the dividend.  Both methods are
11731 arithmetically valid, the latter being almost exclusively used.
11732
11733 @item -mtoplevel-symbols
11734 @itemx -mno-toplevel-symbols
11735 @opindex mtoplevel-symbols
11736 @opindex mno-toplevel-symbols
11737 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
11738 code can be used with the @code{PREFIX} assembly directive.
11739
11740 @item -melf
11741 @opindex melf
11742 Generate an executable in the ELF format, rather than the default
11743 @samp{mmo} format used by the @command{mmix} simulator.
11744
11745 @item -mbranch-predict
11746 @itemx -mno-branch-predict
11747 @opindex mbranch-predict
11748 @opindex mno-branch-predict
11749 Use (do not use) the probable-branch instructions, when static branch
11750 prediction indicates a probable branch.
11751
11752 @item -mbase-addresses
11753 @itemx -mno-base-addresses
11754 @opindex mbase-addresses
11755 @opindex mno-base-addresses
11756 Generate (do not generate) code that uses @emph{base addresses}.  Using a
11757 base address automatically generates a request (handled by the assembler
11758 and the linker) for a constant to be set up in a global register.  The
11759 register is used for one or more base address requests within the range 0
11760 to 255 from the value held in the register.  The generally leads to short
11761 and fast code, but the number of different data items that can be
11762 addressed is limited.  This means that a program that uses lots of static
11763 data may require @option{-mno-base-addresses}.
11764
11765 @item -msingle-exit
11766 @itemx -mno-single-exit
11767 @opindex msingle-exit
11768 @opindex mno-single-exit
11769 Force (do not force) generated code to have a single exit point in each
11770 function.
11771 @end table
11772
11773 @node MN10300 Options
11774 @subsection MN10300 Options
11775 @cindex MN10300 options
11776
11777 These @option{-m} options are defined for Matsushita MN10300 architectures:
11778
11779 @table @gcctabopt
11780 @item -mmult-bug
11781 @opindex mmult-bug
11782 Generate code to avoid bugs in the multiply instructions for the MN10300
11783 processors.  This is the default.
11784
11785 @item -mno-mult-bug
11786 @opindex mno-mult-bug
11787 Do not generate code to avoid bugs in the multiply instructions for the
11788 MN10300 processors.
11789
11790 @item -mam33
11791 @opindex mam33
11792 Generate code which uses features specific to the AM33 processor.
11793
11794 @item -mno-am33
11795 @opindex mno-am33
11796 Do not generate code which uses features specific to the AM33 processor.  This
11797 is the default.
11798
11799 @item -mreturn-pointer-on-d0
11800 @opindex mreturn-pointer-on-d0
11801 When generating a function which returns a pointer, return the pointer
11802 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
11803 only in a0, and attempts to call such functions without a prototype
11804 would result in errors.  Note that this option is on by default; use
11805 @option{-mno-return-pointer-on-d0} to disable it.
11806
11807 @item -mno-crt0
11808 @opindex mno-crt0
11809 Do not link in the C run-time initialization object file.
11810
11811 @item -mrelax
11812 @opindex mrelax
11813 Indicate to the linker that it should perform a relaxation optimization pass
11814 to shorten branches, calls and absolute memory addresses.  This option only
11815 has an effect when used on the command line for the final link step.
11816
11817 This option makes symbolic debugging impossible.
11818 @end table
11819
11820 @node MT Options
11821 @subsection MT Options
11822 @cindex MT options
11823
11824 These @option{-m} options are defined for Morpho MT architectures:
11825
11826 @table @gcctabopt
11827
11828 @item -march=@var{cpu-type}
11829 @opindex march
11830 Generate code that will run on @var{cpu-type}, which is the name of a system
11831 representing a certain processor type.  Possible values for
11832 @var{cpu-type} are @samp{ms1-64-001}, @samp{ms1-16-002},
11833 @samp{ms1-16-003} and @samp{ms2}.
11834
11835 When this option is not used, the default is @option{-march=ms1-16-002}.
11836
11837 @item -mbacc
11838 @opindex mbacc
11839 Use byte loads and stores when generating code.
11840
11841 @item -mno-bacc
11842 @opindex mno-bacc
11843 Do not use byte loads and stores when generating code.
11844
11845 @item -msim
11846 @opindex msim
11847 Use simulator runtime
11848
11849 @item -mno-crt0
11850 @opindex mno-crt0
11851 Do not link in the C run-time initialization object file
11852 @file{crti.o}.  Other run-time initialization and termination files
11853 such as @file{startup.o} and @file{exit.o} are still included on the
11854 linker command line.
11855
11856 @end table
11857
11858 @node PDP-11 Options
11859 @subsection PDP-11 Options
11860 @cindex PDP-11 Options
11861
11862 These options are defined for the PDP-11:
11863
11864 @table @gcctabopt
11865 @item -mfpu
11866 @opindex mfpu
11867 Use hardware FPP floating point.  This is the default.  (FIS floating
11868 point on the PDP-11/40 is not supported.)
11869
11870 @item -msoft-float
11871 @opindex msoft-float
11872 Do not use hardware floating point.
11873
11874 @item -mac0
11875 @opindex mac0
11876 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
11877
11878 @item -mno-ac0
11879 @opindex mno-ac0
11880 Return floating-point results in memory.  This is the default.
11881
11882 @item -m40
11883 @opindex m40
11884 Generate code for a PDP-11/40.
11885
11886 @item -m45
11887 @opindex m45
11888 Generate code for a PDP-11/45.  This is the default.
11889
11890 @item -m10
11891 @opindex m10
11892 Generate code for a PDP-11/10.
11893
11894 @item -mbcopy-builtin
11895 @opindex bcopy-builtin
11896 Use inline @code{movmemhi} patterns for copying memory.  This is the
11897 default.
11898
11899 @item -mbcopy
11900 @opindex mbcopy
11901 Do not use inline @code{movmemhi} patterns for copying memory.
11902
11903 @item -mint16
11904 @itemx -mno-int32
11905 @opindex mint16
11906 @opindex mno-int32
11907 Use 16-bit @code{int}.  This is the default.
11908
11909 @item -mint32
11910 @itemx -mno-int16
11911 @opindex mint32
11912 @opindex mno-int16
11913 Use 32-bit @code{int}.
11914
11915 @item -mfloat64
11916 @itemx -mno-float32
11917 @opindex mfloat64
11918 @opindex mno-float32
11919 Use 64-bit @code{float}.  This is the default.
11920
11921 @item -mfloat32
11922 @itemx -mno-float64
11923 @opindex mfloat32
11924 @opindex mno-float64
11925 Use 32-bit @code{float}.
11926
11927 @item -mabshi
11928 @opindex mabshi
11929 Use @code{abshi2} pattern.  This is the default.
11930
11931 @item -mno-abshi
11932 @opindex mno-abshi
11933 Do not use @code{abshi2} pattern.
11934
11935 @item -mbranch-expensive
11936 @opindex mbranch-expensive
11937 Pretend that branches are expensive.  This is for experimenting with
11938 code generation only.
11939
11940 @item -mbranch-cheap
11941 @opindex mbranch-cheap
11942 Do not pretend that branches are expensive.  This is the default.
11943
11944 @item -msplit
11945 @opindex msplit
11946 Generate code for a system with split I&D@.
11947
11948 @item -mno-split
11949 @opindex mno-split
11950 Generate code for a system without split I&D@.  This is the default.
11951
11952 @item -munix-asm
11953 @opindex munix-asm
11954 Use Unix assembler syntax.  This is the default when configured for
11955 @samp{pdp11-*-bsd}.
11956
11957 @item -mdec-asm
11958 @opindex mdec-asm
11959 Use DEC assembler syntax.  This is the default when configured for any
11960 PDP-11 target other than @samp{pdp11-*-bsd}.
11961 @end table
11962
11963 @node PowerPC Options
11964 @subsection PowerPC Options
11965 @cindex PowerPC options
11966
11967 These are listed under @xref{RS/6000 and PowerPC Options}.
11968
11969 @node RS/6000 and PowerPC Options
11970 @subsection IBM RS/6000 and PowerPC Options
11971 @cindex RS/6000 and PowerPC Options
11972 @cindex IBM RS/6000 and PowerPC Options
11973
11974 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
11975 @table @gcctabopt
11976 @item -mpower
11977 @itemx -mno-power
11978 @itemx -mpower2
11979 @itemx -mno-power2
11980 @itemx -mpowerpc
11981 @itemx -mno-powerpc
11982 @itemx -mpowerpc-gpopt
11983 @itemx -mno-powerpc-gpopt
11984 @itemx -mpowerpc-gfxopt
11985 @itemx -mno-powerpc-gfxopt
11986 @itemx -mpowerpc64
11987 @itemx -mno-powerpc64
11988 @itemx -mmfcrf
11989 @itemx -mno-mfcrf
11990 @itemx -mpopcntb
11991 @itemx -mno-popcntb
11992 @itemx -mfprnd
11993 @itemx -mno-fprnd
11994 @itemx -mcmpb
11995 @itemx -mno-cmpb
11996 @itemx -mmfpgpr
11997 @itemx -mno-mfpgpr
11998 @itemx -mdfp
11999 @itemx -mno-dfp
12000 @opindex mpower
12001 @opindex mno-power
12002 @opindex mpower2
12003 @opindex mno-power2
12004 @opindex mpowerpc
12005 @opindex mno-powerpc
12006 @opindex mpowerpc-gpopt
12007 @opindex mno-powerpc-gpopt
12008 @opindex mpowerpc-gfxopt
12009 @opindex mno-powerpc-gfxopt
12010 @opindex mpowerpc64
12011 @opindex mno-powerpc64
12012 @opindex mmfcrf
12013 @opindex mno-mfcrf
12014 @opindex mpopcntb
12015 @opindex mno-popcntb
12016 @opindex mfprnd
12017 @opindex mno-fprnd
12018 @opindex mcmpb
12019 @opindex mno-cmpb
12020 @opindex mmfpgpr
12021 @opindex mno-mfpgpr
12022 @opindex mdfp
12023 @opindex mno-dfp
12024 GCC supports two related instruction set architectures for the
12025 RS/6000 and PowerPC@.  The @dfn{POWER} instruction set are those
12026 instructions supported by the @samp{rios} chip set used in the original
12027 RS/6000 systems and the @dfn{PowerPC} instruction set is the
12028 architecture of the Freescale MPC5xx, MPC6xx, MPC8xx microprocessors, and
12029 the IBM 4xx, 6xx, and follow-on microprocessors.
12030
12031 Neither architecture is a subset of the other.  However there is a
12032 large common subset of instructions supported by both.  An MQ
12033 register is included in processors supporting the POWER architecture.
12034
12035 You use these options to specify which instructions are available on the
12036 processor you are using.  The default value of these options is
12037 determined when configuring GCC@.  Specifying the
12038 @option{-mcpu=@var{cpu_type}} overrides the specification of these
12039 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
12040 rather than the options listed above.
12041
12042 The @option{-mpower} option allows GCC to generate instructions that
12043 are found only in the POWER architecture and to use the MQ register.
12044 Specifying @option{-mpower2} implies @option{-power} and also allows GCC
12045 to generate instructions that are present in the POWER2 architecture but
12046 not the original POWER architecture.
12047
12048 The @option{-mpowerpc} option allows GCC to generate instructions that
12049 are found only in the 32-bit subset of the PowerPC architecture.
12050 Specifying @option{-mpowerpc-gpopt} implies @option{-mpowerpc} and also allows
12051 GCC to use the optional PowerPC architecture instructions in the
12052 General Purpose group, including floating-point square root.  Specifying
12053 @option{-mpowerpc-gfxopt} implies @option{-mpowerpc} and also allows GCC to
12054 use the optional PowerPC architecture instructions in the Graphics
12055 group, including floating-point select.
12056
12057 The @option{-mmfcrf} option allows GCC to generate the move from
12058 condition register field instruction implemented on the POWER4
12059 processor and other processors that support the PowerPC V2.01
12060 architecture.
12061 The @option{-mpopcntb} option allows GCC to generate the popcount and
12062 double precision FP reciprocal estimate instruction implemented on the
12063 POWER5 processor and other processors that support the PowerPC V2.02
12064 architecture.
12065 The @option{-mfprnd} option allows GCC to generate the FP round to
12066 integer instructions implemented on the POWER5+ processor and other
12067 processors that support the PowerPC V2.03 architecture.
12068 The @option{-mcmpb} option allows GCC to generate the compare bytes
12069 instruction implemented on the POWER6 processor and other processors
12070 that support the PowerPC V2.05 architecture.
12071 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
12072 general purpose register instructions implemented on the POWER6X
12073 processor and other processors that support the extended PowerPC V2.05
12074 architecture.
12075 The @option{-mdfp} option allows GCC to generate the decimal floating
12076 point instructions implemented on some POWER processors.
12077
12078 The @option{-mpowerpc64} option allows GCC to generate the additional
12079 64-bit instructions that are found in the full PowerPC64 architecture
12080 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
12081 @option{-mno-powerpc64}.
12082
12083 If you specify both @option{-mno-power} and @option{-mno-powerpc}, GCC
12084 will use only the instructions in the common subset of both
12085 architectures plus some special AIX common-mode calls, and will not use
12086 the MQ register.  Specifying both @option{-mpower} and @option{-mpowerpc}
12087 permits GCC to use any instruction from either architecture and to
12088 allow use of the MQ register; specify this for the Motorola MPC601.
12089
12090 @item -mnew-mnemonics
12091 @itemx -mold-mnemonics
12092 @opindex mnew-mnemonics
12093 @opindex mold-mnemonics
12094 Select which mnemonics to use in the generated assembler code.  With
12095 @option{-mnew-mnemonics}, GCC uses the assembler mnemonics defined for
12096 the PowerPC architecture.  With @option{-mold-mnemonics} it uses the
12097 assembler mnemonics defined for the POWER architecture.  Instructions
12098 defined in only one architecture have only one mnemonic; GCC uses that
12099 mnemonic irrespective of which of these options is specified.
12100
12101 GCC defaults to the mnemonics appropriate for the architecture in
12102 use.  Specifying @option{-mcpu=@var{cpu_type}} sometimes overrides the
12103 value of these option.  Unless you are building a cross-compiler, you
12104 should normally not specify either @option{-mnew-mnemonics} or
12105 @option{-mold-mnemonics}, but should instead accept the default.
12106
12107 @item -mcpu=@var{cpu_type}
12108 @opindex mcpu
12109 Set architecture type, register usage, choice of mnemonics, and
12110 instruction scheduling parameters for machine type @var{cpu_type}.
12111 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
12112 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{505},
12113 @samp{601}, @samp{602}, @samp{603}, @samp{603e}, @samp{604},
12114 @samp{604e}, @samp{620}, @samp{630}, @samp{740}, @samp{7400},
12115 @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
12116 @samp{860}, @samp{970}, @samp{8540}, @samp{ec603e}, @samp{G3},
12117 @samp{G4}, @samp{G5}, @samp{power}, @samp{power2}, @samp{power3},
12118 @samp{power4}, @samp{power5}, @samp{power5+}, @samp{power6},
12119 @samp{power6x}, @samp{common}, @samp{powerpc}, @samp{powerpc64},
12120 @samp{rios}, @samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64}.
12121
12122 @option{-mcpu=common} selects a completely generic processor.  Code
12123 generated under this option will run on any POWER or PowerPC processor.
12124 GCC will use only the instructions in the common subset of both
12125 architectures, and will not use the MQ register.  GCC assumes a generic
12126 processor model for scheduling purposes.
12127
12128 @option{-mcpu=power}, @option{-mcpu=power2}, @option{-mcpu=powerpc}, and
12129 @option{-mcpu=powerpc64} specify generic POWER, POWER2, pure 32-bit
12130 PowerPC (i.e., not MPC601), and 64-bit PowerPC architecture machine
12131 types, with an appropriate, generic processor model assumed for
12132 scheduling purposes.
12133
12134 The other options specify a specific processor.  Code generated under
12135 those options will run best on that processor, and may not run at all on
12136 others.
12137
12138 The @option{-mcpu} options automatically enable or disable the
12139 following options:
12140
12141 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
12142 -mnew-mnemonics  -mpopcntb  -mpower  -mpower2  -mpowerpc64 @gol
12143 -mpowerpc-gpopt  -mpowerpc-gfxopt  -mstring  -mmulhw  -mdlmzb  -mmfpgpr}
12144
12145 The particular options set for any particular CPU will vary between
12146 compiler versions, depending on what setting seems to produce optimal
12147 code for that CPU; it doesn't necessarily reflect the actual hardware's
12148 capabilities.  If you wish to set an individual option to a particular
12149 value, you may specify it after the @option{-mcpu} option, like
12150 @samp{-mcpu=970 -mno-altivec}.
12151
12152 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
12153 not enabled or disabled by the @option{-mcpu} option at present because
12154 AIX does not have full support for these options.  You may still
12155 enable or disable them individually if you're sure it'll work in your
12156 environment.
12157
12158 @item -mtune=@var{cpu_type}
12159 @opindex mtune
12160 Set the instruction scheduling parameters for machine type
12161 @var{cpu_type}, but do not set the architecture type, register usage, or
12162 choice of mnemonics, as @option{-mcpu=@var{cpu_type}} would.  The same
12163 values for @var{cpu_type} are used for @option{-mtune} as for
12164 @option{-mcpu}.  If both are specified, the code generated will use the
12165 architecture, registers, and mnemonics set by @option{-mcpu}, but the
12166 scheduling parameters set by @option{-mtune}.
12167
12168 @item -mswdiv
12169 @itemx -mno-swdiv
12170 @opindex mswdiv
12171 @opindex mno-swdiv
12172 Generate code to compute division as reciprocal estimate and iterative
12173 refinement, creating opportunities for increased throughput.  This
12174 feature requires: optional PowerPC Graphics instruction set for single
12175 precision and FRE instruction for double precision, assuming divides
12176 cannot generate user-visible traps, and the domain values not include
12177 Infinities, denormals or zero denominator.
12178
12179 @item -maltivec
12180 @itemx -mno-altivec
12181 @opindex maltivec
12182 @opindex mno-altivec
12183 Generate code that uses (does not use) AltiVec instructions, and also
12184 enable the use of built-in functions that allow more direct access to
12185 the AltiVec instruction set.  You may also need to set
12186 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
12187 enhancements.
12188
12189 @item -mvrsave
12190 @item -mno-vrsave
12191 @opindex mvrsave
12192 @opindex mno-vrsave
12193 Generate VRSAVE instructions when generating AltiVec code.
12194
12195 @item -msecure-plt
12196 @opindex msecure-plt
12197 Generate code that allows ld and ld.so to build executables and shared
12198 libraries with non-exec .plt and .got sections.  This is a PowerPC
12199 32-bit SYSV ABI option.
12200
12201 @item -mbss-plt
12202 @opindex mbss-plt
12203 Generate code that uses a BSS .plt section that ld.so fills in, and
12204 requires .plt and .got sections that are both writable and executable.
12205 This is a PowerPC 32-bit SYSV ABI option.
12206
12207 @item -misel
12208 @itemx -mno-isel
12209 @opindex misel
12210 @opindex mno-isel
12211 This switch enables or disables the generation of ISEL instructions.
12212
12213 @item -misel=@var{yes/no}
12214 This switch has been deprecated.  Use @option{-misel} and
12215 @option{-mno-isel} instead.
12216
12217 @item -mspe
12218 @itemx -mno-spe
12219 @opindex mspe
12220 @opindex mno-spe
12221 This switch enables or disables the generation of SPE simd
12222 instructions.
12223
12224 @item -mspe=@var{yes/no}
12225 This option has been deprecated.  Use @option{-mspe} and
12226 @option{-mno-spe} instead.
12227
12228 @item -mfloat-gprs=@var{yes/single/double/no}
12229 @itemx -mfloat-gprs
12230 @opindex mfloat-gprs
12231 This switch enables or disables the generation of floating point
12232 operations on the general purpose registers for architectures that
12233 support it.
12234
12235 The argument @var{yes} or @var{single} enables the use of
12236 single-precision floating point operations.
12237
12238 The argument @var{double} enables the use of single and
12239 double-precision floating point operations.
12240
12241 The argument @var{no} disables floating point operations on the
12242 general purpose registers.
12243
12244 This option is currently only available on the MPC854x.
12245
12246 @item -m32
12247 @itemx -m64
12248 @opindex m32
12249 @opindex m64
12250 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
12251 targets (including GNU/Linux).  The 32-bit environment sets int, long
12252 and pointer to 32 bits and generates code that runs on any PowerPC
12253 variant.  The 64-bit environment sets int to 32 bits and long and
12254 pointer to 64 bits, and generates code for PowerPC64, as for
12255 @option{-mpowerpc64}.
12256
12257 @item -mfull-toc
12258 @itemx -mno-fp-in-toc
12259 @itemx -mno-sum-in-toc
12260 @itemx -mminimal-toc
12261 @opindex mfull-toc
12262 @opindex mno-fp-in-toc
12263 @opindex mno-sum-in-toc
12264 @opindex mminimal-toc
12265 Modify generation of the TOC (Table Of Contents), which is created for
12266 every executable file.  The @option{-mfull-toc} option is selected by
12267 default.  In that case, GCC will allocate at least one TOC entry for
12268 each unique non-automatic variable reference in your program.  GCC
12269 will also place floating-point constants in the TOC@.  However, only
12270 16,384 entries are available in the TOC@.
12271
12272 If you receive a linker error message that saying you have overflowed
12273 the available TOC space, you can reduce the amount of TOC space used
12274 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
12275 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
12276 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
12277 generate code to calculate the sum of an address and a constant at
12278 run-time instead of putting that sum into the TOC@.  You may specify one
12279 or both of these options.  Each causes GCC to produce very slightly
12280 slower and larger code at the expense of conserving TOC space.
12281
12282 If you still run out of space in the TOC even when you specify both of
12283 these options, specify @option{-mminimal-toc} instead.  This option causes
12284 GCC to make only one TOC entry for every file.  When you specify this
12285 option, GCC will produce code that is slower and larger but which
12286 uses extremely little TOC space.  You may wish to use this option
12287 only on files that contain less frequently executed code.
12288
12289 @item -maix64
12290 @itemx -maix32
12291 @opindex maix64
12292 @opindex maix32
12293 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
12294 @code{long} type, and the infrastructure needed to support them.
12295 Specifying @option{-maix64} implies @option{-mpowerpc64} and
12296 @option{-mpowerpc}, while @option{-maix32} disables the 64-bit ABI and
12297 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
12298
12299 @item -mxl-compat
12300 @itemx -mno-xl-compat
12301 @opindex mxl-compat
12302 @opindex mno-xl-compat
12303 Produce code that conforms more closely to IBM XL compiler semantics
12304 when using AIX-compatible ABI.  Pass floating-point arguments to
12305 prototyped functions beyond the register save area (RSA) on the stack
12306 in addition to argument FPRs.  Do not assume that most significant
12307 double in 128-bit long double value is properly rounded when comparing
12308 values and converting to double.  Use XL symbol names for long double
12309 support routines.
12310
12311 The AIX calling convention was extended but not initially documented to
12312 handle an obscure K&R C case of calling a function that takes the
12313 address of its arguments with fewer arguments than declared.  IBM XL
12314 compilers access floating point arguments which do not fit in the
12315 RSA from the stack when a subroutine is compiled without
12316 optimization.  Because always storing floating-point arguments on the
12317 stack is inefficient and rarely needed, this option is not enabled by
12318 default and only is necessary when calling subroutines compiled by IBM
12319 XL compilers without optimization.
12320
12321 @item -mpe
12322 @opindex mpe
12323 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
12324 application written to use message passing with special startup code to
12325 enable the application to run.  The system must have PE installed in the
12326 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
12327 must be overridden with the @option{-specs=} option to specify the
12328 appropriate directory location.  The Parallel Environment does not
12329 support threads, so the @option{-mpe} option and the @option{-pthread}
12330 option are incompatible.
12331
12332 @item -malign-natural
12333 @itemx -malign-power
12334 @opindex malign-natural
12335 @opindex malign-power
12336 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
12337 @option{-malign-natural} overrides the ABI-defined alignment of larger
12338 types, such as floating-point doubles, on their natural size-based boundary.
12339 The option @option{-malign-power} instructs GCC to follow the ABI-specified
12340 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
12341
12342 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
12343 is not supported.
12344
12345 @item -msoft-float
12346 @itemx -mhard-float
12347 @opindex msoft-float
12348 @opindex mhard-float
12349 Generate code that does not use (uses) the floating-point register set.
12350 Software floating point emulation is provided if you use the
12351 @option{-msoft-float} option, and pass the option to GCC when linking.
12352
12353 @item -mmultiple
12354 @itemx -mno-multiple
12355 @opindex mmultiple
12356 @opindex mno-multiple
12357 Generate code that uses (does not use) the load multiple word
12358 instructions and the store multiple word instructions.  These
12359 instructions are generated by default on POWER systems, and not
12360 generated on PowerPC systems.  Do not use @option{-mmultiple} on little
12361 endian PowerPC systems, since those instructions do not work when the
12362 processor is in little endian mode.  The exceptions are PPC740 and
12363 PPC750 which permit the instructions usage in little endian mode.
12364
12365 @item -mstring
12366 @itemx -mno-string
12367 @opindex mstring
12368 @opindex mno-string
12369 Generate code that uses (does not use) the load string instructions
12370 and the store string word instructions to save multiple registers and
12371 do small block moves.  These instructions are generated by default on
12372 POWER systems, and not generated on PowerPC systems.  Do not use
12373 @option{-mstring} on little endian PowerPC systems, since those
12374 instructions do not work when the processor is in little endian mode.
12375 The exceptions are PPC740 and PPC750 which permit the instructions
12376 usage in little endian mode.
12377
12378 @item -mupdate
12379 @itemx -mno-update
12380 @opindex mupdate
12381 @opindex mno-update
12382 Generate code that uses (does not use) the load or store instructions
12383 that update the base register to the address of the calculated memory
12384 location.  These instructions are generated by default.  If you use
12385 @option{-mno-update}, there is a small window between the time that the
12386 stack pointer is updated and the address of the previous frame is
12387 stored, which means code that walks the stack frame across interrupts or
12388 signals may get corrupted data.
12389
12390 @item -mfused-madd
12391 @itemx -mno-fused-madd
12392 @opindex mfused-madd
12393 @opindex mno-fused-madd
12394 Generate code that uses (does not use) the floating point multiply and
12395 accumulate instructions.  These instructions are generated by default if
12396 hardware floating is used.
12397
12398 @item -mmulhw
12399 @itemx -mno-mulhw
12400 @opindex mmulhw
12401 @opindex mno-mulhw
12402 Generate code that uses (does not use) the half-word multiply and
12403 multiply-accumulate instructions on the IBM 405 and 440 processors.
12404 These instructions are generated by default when targetting those
12405 processors.
12406
12407 @item -mdlmzb
12408 @itemx -mno-dlmzb
12409 @opindex mdlmzb
12410 @opindex mno-dlmzb
12411 Generate code that uses (does not use) the string-search @samp{dlmzb}
12412 instruction on the IBM 405 and 440 processors.  This instruction is
12413 generated by default when targetting those processors.
12414
12415 @item -mno-bit-align
12416 @itemx -mbit-align
12417 @opindex mno-bit-align
12418 @opindex mbit-align
12419 On System V.4 and embedded PowerPC systems do not (do) force structures
12420 and unions that contain bit-fields to be aligned to the base type of the
12421 bit-field.
12422
12423 For example, by default a structure containing nothing but 8
12424 @code{unsigned} bit-fields of length 1 would be aligned to a 4 byte
12425 boundary and have a size of 4 bytes.  By using @option{-mno-bit-align},
12426 the structure would be aligned to a 1 byte boundary and be one byte in
12427 size.
12428
12429 @item -mno-strict-align
12430 @itemx -mstrict-align
12431 @opindex mno-strict-align
12432 @opindex mstrict-align
12433 On System V.4 and embedded PowerPC systems do not (do) assume that
12434 unaligned memory references will be handled by the system.
12435
12436 @item -mrelocatable
12437 @itemx -mno-relocatable
12438 @opindex mrelocatable
12439 @opindex mno-relocatable
12440 On embedded PowerPC systems generate code that allows (does not allow)
12441 the program to be relocated to a different address at runtime.  If you
12442 use @option{-mrelocatable} on any module, all objects linked together must
12443 be compiled with @option{-mrelocatable} or @option{-mrelocatable-lib}.
12444
12445 @item -mrelocatable-lib
12446 @itemx -mno-relocatable-lib
12447 @opindex mrelocatable-lib
12448 @opindex mno-relocatable-lib
12449 On embedded PowerPC systems generate code that allows (does not allow)
12450 the program to be relocated to a different address at runtime.  Modules
12451 compiled with @option{-mrelocatable-lib} can be linked with either modules
12452 compiled without @option{-mrelocatable} and @option{-mrelocatable-lib} or
12453 with modules compiled with the @option{-mrelocatable} options.
12454
12455 @item -mno-toc
12456 @itemx -mtoc
12457 @opindex mno-toc
12458 @opindex mtoc
12459 On System V.4 and embedded PowerPC systems do not (do) assume that
12460 register 2 contains a pointer to a global area pointing to the addresses
12461 used in the program.
12462
12463 @item -mlittle
12464 @itemx -mlittle-endian
12465 @opindex mlittle
12466 @opindex mlittle-endian
12467 On System V.4 and embedded PowerPC systems compile code for the
12468 processor in little endian mode.  The @option{-mlittle-endian} option is
12469 the same as @option{-mlittle}.
12470
12471 @item -mbig
12472 @itemx -mbig-endian
12473 @opindex mbig
12474 @opindex mbig-endian
12475 On System V.4 and embedded PowerPC systems compile code for the
12476 processor in big endian mode.  The @option{-mbig-endian} option is
12477 the same as @option{-mbig}.
12478
12479 @item -mdynamic-no-pic
12480 @opindex mdynamic-no-pic
12481 On Darwin and Mac OS X systems, compile code so that it is not
12482 relocatable, but that its external references are relocatable.  The
12483 resulting code is suitable for applications, but not shared
12484 libraries.
12485
12486 @item -mprioritize-restricted-insns=@var{priority}
12487 @opindex mprioritize-restricted-insns
12488 This option controls the priority that is assigned to
12489 dispatch-slot restricted instructions during the second scheduling
12490 pass.  The argument @var{priority} takes the value @var{0/1/2} to assign
12491 @var{no/highest/second-highest} priority to dispatch slot restricted
12492 instructions.
12493
12494 @item -msched-costly-dep=@var{dependence_type}
12495 @opindex msched-costly-dep
12496 This option controls which dependences are considered costly
12497 by the target during instruction scheduling.  The argument
12498 @var{dependence_type} takes one of the following values:
12499 @var{no}: no dependence is costly,
12500 @var{all}: all dependences are costly,
12501 @var{true_store_to_load}: a true dependence from store to load is costly,
12502 @var{store_to_load}: any dependence from store to load is costly,
12503 @var{number}: any dependence which latency >= @var{number} is costly.
12504
12505 @item -minsert-sched-nops=@var{scheme}
12506 @opindex minsert-sched-nops
12507 This option controls which nop insertion scheme will be used during
12508 the second scheduling pass.  The argument @var{scheme} takes one of the
12509 following values:
12510 @var{no}: Don't insert nops.
12511 @var{pad}: Pad with nops any dispatch group which has vacant issue slots,
12512 according to the scheduler's grouping.
12513 @var{regroup_exact}: Insert nops to force costly dependent insns into
12514 separate groups.  Insert exactly as many nops as needed to force an insn
12515 to a new group, according to the estimated processor grouping.
12516 @var{number}: Insert nops to force costly dependent insns into
12517 separate groups.  Insert @var{number} nops to force an insn to a new group.
12518
12519 @item -mcall-sysv
12520 @opindex mcall-sysv
12521 On System V.4 and embedded PowerPC systems compile code using calling
12522 conventions that adheres to the March 1995 draft of the System V
12523 Application Binary Interface, PowerPC processor supplement.  This is the
12524 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
12525
12526 @item -mcall-sysv-eabi
12527 @opindex mcall-sysv-eabi
12528 Specify both @option{-mcall-sysv} and @option{-meabi} options.
12529
12530 @item -mcall-sysv-noeabi
12531 @opindex mcall-sysv-noeabi
12532 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
12533
12534 @item -mcall-solaris
12535 @opindex mcall-solaris
12536 On System V.4 and embedded PowerPC systems compile code for the Solaris
12537 operating system.
12538
12539 @item -mcall-linux
12540 @opindex mcall-linux
12541 On System V.4 and embedded PowerPC systems compile code for the
12542 Linux-based GNU system.
12543
12544 @item -mcall-gnu
12545 @opindex mcall-gnu
12546 On System V.4 and embedded PowerPC systems compile code for the
12547 Hurd-based GNU system.
12548
12549 @item -mcall-netbsd
12550 @opindex mcall-netbsd
12551 On System V.4 and embedded PowerPC systems compile code for the
12552 NetBSD operating system.
12553
12554 @item -maix-struct-return
12555 @opindex maix-struct-return
12556 Return all structures in memory (as specified by the AIX ABI)@.
12557
12558 @item -msvr4-struct-return
12559 @opindex msvr4-struct-return
12560 Return structures smaller than 8 bytes in registers (as specified by the
12561 SVR4 ABI)@.
12562
12563 @item -mabi=@var{abi-type}
12564 @opindex mabi
12565 Extend the current ABI with a particular extension, or remove such extension.
12566 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
12567 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble}@.
12568
12569 @item -mabi=spe
12570 @opindex mabi=spe
12571 Extend the current ABI with SPE ABI extensions.  This does not change
12572 the default ABI, instead it adds the SPE ABI extensions to the current
12573 ABI@.
12574
12575 @item -mabi=no-spe
12576 @opindex mabi=no-spe
12577 Disable Booke SPE ABI extensions for the current ABI@.
12578
12579 @item -mabi=ibmlongdouble
12580 @opindex mabi=ibmlongdouble
12581 Change the current ABI to use IBM extended precision long double.
12582 This is a PowerPC 32-bit SYSV ABI option.
12583
12584 @item -mabi=ieeelongdouble
12585 @opindex mabi=ieeelongdouble
12586 Change the current ABI to use IEEE extended precision long double.
12587 This is a PowerPC 32-bit Linux ABI option.
12588
12589 @item -mprototype
12590 @itemx -mno-prototype
12591 @opindex mprototype
12592 @opindex mno-prototype
12593 On System V.4 and embedded PowerPC systems assume that all calls to
12594 variable argument functions are properly prototyped.  Otherwise, the
12595 compiler must insert an instruction before every non prototyped call to
12596 set or clear bit 6 of the condition code register (@var{CR}) to
12597 indicate whether floating point values were passed in the floating point
12598 registers in case the function takes a variable arguments.  With
12599 @option{-mprototype}, only calls to prototyped variable argument functions
12600 will set or clear the bit.
12601
12602 @item -msim
12603 @opindex msim
12604 On embedded PowerPC systems, assume that the startup module is called
12605 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
12606 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}.
12607 configurations.
12608
12609 @item -mmvme
12610 @opindex mmvme
12611 On embedded PowerPC systems, assume that the startup module is called
12612 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
12613 @file{libc.a}.
12614
12615 @item -mads
12616 @opindex mads
12617 On embedded PowerPC systems, assume that the startup module is called
12618 @file{crt0.o} and the standard C libraries are @file{libads.a} and
12619 @file{libc.a}.
12620
12621 @item -myellowknife
12622 @opindex myellowknife
12623 On embedded PowerPC systems, assume that the startup module is called
12624 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
12625 @file{libc.a}.
12626
12627 @item -mvxworks
12628 @opindex mvxworks
12629 On System V.4 and embedded PowerPC systems, specify that you are
12630 compiling for a VxWorks system.
12631
12632 @item -mwindiss
12633 @opindex mwindiss
12634 Specify that you are compiling for the WindISS simulation environment.
12635
12636 @item -memb
12637 @opindex memb
12638 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
12639 header to indicate that @samp{eabi} extended relocations are used.
12640
12641 @item -meabi
12642 @itemx -mno-eabi
12643 @opindex meabi
12644 @opindex mno-eabi
12645 On System V.4 and embedded PowerPC systems do (do not) adhere to the
12646 Embedded Applications Binary Interface (eabi) which is a set of
12647 modifications to the System V.4 specifications.  Selecting @option{-meabi}
12648 means that the stack is aligned to an 8 byte boundary, a function
12649 @code{__eabi} is called to from @code{main} to set up the eabi
12650 environment, and the @option{-msdata} option can use both @code{r2} and
12651 @code{r13} to point to two separate small data areas.  Selecting
12652 @option{-mno-eabi} means that the stack is aligned to a 16 byte boundary,
12653 do not call an initialization function from @code{main}, and the
12654 @option{-msdata} option will only use @code{r13} to point to a single
12655 small data area.  The @option{-meabi} option is on by default if you
12656 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
12657
12658 @item -msdata=eabi
12659 @opindex msdata=eabi
12660 On System V.4 and embedded PowerPC systems, put small initialized
12661 @code{const} global and static data in the @samp{.sdata2} section, which
12662 is pointed to by register @code{r2}.  Put small initialized
12663 non-@code{const} global and static data in the @samp{.sdata} section,
12664 which is pointed to by register @code{r13}.  Put small uninitialized
12665 global and static data in the @samp{.sbss} section, which is adjacent to
12666 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
12667 incompatible with the @option{-mrelocatable} option.  The
12668 @option{-msdata=eabi} option also sets the @option{-memb} option.
12669
12670 @item -msdata=sysv
12671 @opindex msdata=sysv
12672 On System V.4 and embedded PowerPC systems, put small global and static
12673 data in the @samp{.sdata} section, which is pointed to by register
12674 @code{r13}.  Put small uninitialized global and static data in the
12675 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
12676 The @option{-msdata=sysv} option is incompatible with the
12677 @option{-mrelocatable} option.
12678
12679 @item -msdata=default
12680 @itemx -msdata
12681 @opindex msdata=default
12682 @opindex msdata
12683 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
12684 compile code the same as @option{-msdata=eabi}, otherwise compile code the
12685 same as @option{-msdata=sysv}.
12686
12687 @item -msdata-data
12688 @opindex msdata-data
12689 On System V.4 and embedded PowerPC systems, put small global
12690 data in the @samp{.sdata} section.  Put small uninitialized global
12691 data in the @samp{.sbss} section.  Do not use register @code{r13}
12692 to address small data however.  This is the default behavior unless
12693 other @option{-msdata} options are used.
12694
12695 @item -msdata=none
12696 @itemx -mno-sdata
12697 @opindex msdata=none
12698 @opindex mno-sdata
12699 On embedded PowerPC systems, put all initialized global and static data
12700 in the @samp{.data} section, and all uninitialized data in the
12701 @samp{.bss} section.
12702
12703 @item -G @var{num}
12704 @opindex G
12705 @cindex smaller data references (PowerPC)
12706 @cindex .sdata/.sdata2 references (PowerPC)
12707 On embedded PowerPC systems, put global and static items less than or
12708 equal to @var{num} bytes into the small data or bss sections instead of
12709 the normal data or bss section.  By default, @var{num} is 8.  The
12710 @option{-G @var{num}} switch is also passed to the linker.
12711 All modules should be compiled with the same @option{-G @var{num}} value.
12712
12713 @item -mregnames
12714 @itemx -mno-regnames
12715 @opindex mregnames
12716 @opindex mno-regnames
12717 On System V.4 and embedded PowerPC systems do (do not) emit register
12718 names in the assembly language output using symbolic forms.
12719
12720 @item -mlongcall
12721 @itemx -mno-longcall
12722 @opindex mlongcall
12723 @opindex mno-longcall
12724 By default assume that all calls are far away so that a longer more
12725 expensive calling sequence is required.  This is required for calls
12726 further than 32 megabytes (33,554,432 bytes) from the current location.
12727 A short call will be generated if the compiler knows
12728 the call cannot be that far away.  This setting can be overridden by
12729 the @code{shortcall} function attribute, or by @code{#pragma
12730 longcall(0)}.
12731
12732 Some linkers are capable of detecting out-of-range calls and generating
12733 glue code on the fly.  On these systems, long calls are unnecessary and
12734 generate slower code.  As of this writing, the AIX linker can do this,
12735 as can the GNU linker for PowerPC/64.  It is planned to add this feature
12736 to the GNU linker for 32-bit PowerPC systems as well.
12737
12738 On Darwin/PPC systems, @code{#pragma longcall} will generate ``jbsr
12739 callee, L42'', plus a ``branch island'' (glue code).  The two target
12740 addresses represent the callee and the ``branch island''.  The
12741 Darwin/PPC linker will prefer the first address and generate a ``bl
12742 callee'' if the PPC ``bl'' instruction will reach the callee directly;
12743 otherwise, the linker will generate ``bl L42'' to call the ``branch
12744 island''.  The ``branch island'' is appended to the body of the
12745 calling function; it computes the full 32-bit address of the callee
12746 and jumps to it.
12747
12748 On Mach-O (Darwin) systems, this option directs the compiler emit to
12749 the glue for every direct call, and the Darwin linker decides whether
12750 to use or discard it.
12751
12752 In the future, we may cause GCC to ignore all longcall specifications
12753 when the linker is known to generate glue.
12754
12755 @item -pthread
12756 @opindex pthread
12757 Adds support for multithreading with the @dfn{pthreads} library.
12758 This option sets flags for both the preprocessor and linker.
12759
12760 @end table
12761
12762 @node S/390 and zSeries Options
12763 @subsection S/390 and zSeries Options
12764 @cindex S/390 and zSeries Options
12765
12766 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
12767
12768 @table @gcctabopt
12769 @item -mhard-float
12770 @itemx -msoft-float
12771 @opindex mhard-float
12772 @opindex msoft-float
12773 Use (do not use) the hardware floating-point instructions and registers
12774 for floating-point operations.  When @option{-msoft-float} is specified,
12775 functions in @file{libgcc.a} will be used to perform floating-point
12776 operations.  When @option{-mhard-float} is specified, the compiler
12777 generates IEEE floating-point instructions.  This is the default.
12778
12779 @item -mlong-double-64
12780 @itemx -mlong-double-128
12781 @opindex mlong-double-64
12782 @opindex mlong-double-128
12783 These switches control the size of @code{long double} type. A size
12784 of 64bit makes the @code{long double} type equivalent to the @code{double}
12785 type. This is the default.
12786
12787 @item -mbackchain
12788 @itemx -mno-backchain
12789 @opindex mbackchain
12790 @opindex mno-backchain
12791 Store (do not store) the address of the caller's frame as backchain pointer
12792 into the callee's stack frame.
12793 A backchain may be needed to allow debugging using tools that do not understand
12794 DWARF-2 call frame information.
12795 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
12796 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
12797 the backchain is placed into the topmost word of the 96/160 byte register
12798 save area.
12799
12800 In general, code compiled with @option{-mbackchain} is call-compatible with
12801 code compiled with @option{-mmo-backchain}; however, use of the backchain
12802 for debugging purposes usually requires that the whole binary is built with
12803 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
12804 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
12805 to build a linux kernel use @option{-msoft-float}.
12806
12807 The default is to not maintain the backchain.
12808
12809 @item -mpacked-stack
12810 @item -mno-packed-stack
12811 @opindex mpacked-stack
12812 @opindex mno-packed-stack
12813 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
12814 specified, the compiler uses the all fields of the 96/160 byte register save
12815 area only for their default purpose; unused fields still take up stack space.
12816 When @option{-mpacked-stack} is specified, register save slots are densely
12817 packed at the top of the register save area; unused space is reused for other
12818 purposes, allowing for more efficient use of the available stack space.
12819 However, when @option{-mbackchain} is also in effect, the topmost word of
12820 the save area is always used to store the backchain, and the return address
12821 register is always saved two words below the backchain.
12822
12823 As long as the stack frame backchain is not used, code generated with
12824 @option{-mpacked-stack} is call-compatible with code generated with
12825 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
12826 S/390 or zSeries generated code that uses the stack frame backchain at run
12827 time, not just for debugging purposes.  Such code is not call-compatible
12828 with code compiled with @option{-mpacked-stack}.  Also, note that the
12829 combination of @option{-mbackchain},
12830 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
12831 to build a linux kernel use @option{-msoft-float}.
12832
12833 The default is to not use the packed stack layout.
12834
12835 @item -msmall-exec
12836 @itemx -mno-small-exec
12837 @opindex msmall-exec
12838 @opindex mno-small-exec
12839 Generate (or do not generate) code using the @code{bras} instruction
12840 to do subroutine calls.
12841 This only works reliably if the total executable size does not
12842 exceed 64k.  The default is to use the @code{basr} instruction instead,
12843 which does not have this limitation.
12844
12845 @item -m64
12846 @itemx -m31
12847 @opindex m64
12848 @opindex m31
12849 When @option{-m31} is specified, generate code compliant to the
12850 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
12851 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
12852 particular to generate 64-bit instructions.  For the @samp{s390}
12853 targets, the default is @option{-m31}, while the @samp{s390x}
12854 targets default to @option{-m64}.
12855
12856 @item -mzarch
12857 @itemx -mesa
12858 @opindex mzarch
12859 @opindex mesa
12860 When @option{-mzarch} is specified, generate code using the
12861 instructions available on z/Architecture.
12862 When @option{-mesa} is specified, generate code using the
12863 instructions available on ESA/390.  Note that @option{-mesa} is
12864 not possible with @option{-m64}.
12865 When generating code compliant to the GNU/Linux for S/390 ABI,
12866 the default is @option{-mesa}.  When generating code compliant
12867 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
12868
12869 @item -mmvcle
12870 @itemx -mno-mvcle
12871 @opindex mmvcle
12872 @opindex mno-mvcle
12873 Generate (or do not generate) code using the @code{mvcle} instruction
12874 to perform block moves.  When @option{-mno-mvcle} is specified,
12875 use a @code{mvc} loop instead.  This is the default unless optimizing for
12876 size.
12877
12878 @item -mdebug
12879 @itemx -mno-debug
12880 @opindex mdebug
12881 @opindex mno-debug
12882 Print (or do not print) additional debug information when compiling.
12883 The default is to not print debug information.
12884
12885 @item -march=@var{cpu-type}
12886 @opindex march
12887 Generate code that will run on @var{cpu-type}, which is the name of a system
12888 representing a certain processor type.  Possible values for
12889 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, and @samp{z990}.
12890 When generating code using the instructions available on z/Architecture,
12891 the default is @option{-march=z900}.  Otherwise, the default is
12892 @option{-march=g5}.
12893
12894 @item -mtune=@var{cpu-type}
12895 @opindex mtune
12896 Tune to @var{cpu-type} everything applicable about the generated code,
12897 except for the ABI and the set of available instructions.
12898 The list of @var{cpu-type} values is the same as for @option{-march}.
12899 The default is the value used for @option{-march}.
12900
12901 @item -mtpf-trace
12902 @itemx -mno-tpf-trace
12903 @opindex mtpf-trace
12904 @opindex mno-tpf-trace
12905 Generate code that adds (does not add) in TPF OS specific branches to trace
12906 routines in the operating system.  This option is off by default, even
12907 when compiling for the TPF OS@.
12908
12909 @item -mfused-madd
12910 @itemx -mno-fused-madd
12911 @opindex mfused-madd
12912 @opindex mno-fused-madd
12913 Generate code that uses (does not use) the floating point multiply and
12914 accumulate instructions.  These instructions are generated by default if
12915 hardware floating point is used.
12916
12917 @item -mwarn-framesize=@var{framesize}
12918 @opindex mwarn-framesize
12919 Emit a warning if the current function exceeds the given frame size.  Because
12920 this is a compile time check it doesn't need to be a real problem when the program
12921 runs.  It is intended to identify functions which most probably cause
12922 a stack overflow.  It is useful to be used in an environment with limited stack
12923 size e.g.@: the linux kernel.
12924
12925 @item -mwarn-dynamicstack
12926 @opindex mwarn-dynamicstack
12927 Emit a warning if the function calls alloca or uses dynamically
12928 sized arrays.  This is generally a bad idea with a limited stack size.
12929
12930 @item -mstack-guard=@var{stack-guard}
12931 @item -mstack-size=@var{stack-size}
12932 @opindex mstack-guard
12933 @opindex mstack-size
12934 If these options are provided the s390 back end emits additional instructions in
12935 the function prologue which trigger a trap if the stack size is @var{stack-guard}
12936 bytes above the @var{stack-size} (remember that the stack on s390 grows downward).
12937 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
12938 the frame size of the compiled function is chosen.
12939 These options are intended to be used to help debugging stack overflow problems.
12940 The additionally emitted code causes only little overhead and hence can also be
12941 used in production like systems without greater performance degradation.  The given
12942 values have to be exact powers of 2 and @var{stack-size} has to be greater than
12943 @var{stack-guard} without exceeding 64k.
12944 In order to be efficient the extra code makes the assumption that the stack starts
12945 at an address aligned to the value given by @var{stack-size}.
12946 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
12947 @end table
12948
12949 @node Score Options
12950 @subsection Score Options
12951 @cindex Score Options
12952
12953 These options are defined for Score implementations:
12954
12955 @table @gcctabopt
12956 @item -meb
12957 @opindex meb
12958 Compile code for big endian mode.  This is the default.
12959
12960 @item -mel
12961 @opindex -mel
12962 Compile code for little endian mode. 
12963
12964 @item -mnhwloop
12965 @opindex -mnhwloop
12966 Disable generate bcnz instruction.
12967
12968 @item -muls
12969 @opindex -muls
12970 Enable generate unaligned load and store instruction.
12971
12972 @item -mmac
12973 @opindex mmac
12974 Enable the use of multiply-accumulate instructions. Disabled by default. 
12975
12976 @item -mscore5
12977 @opindex mscore5
12978 Specify the SCORE5 as the target architecture.
12979
12980 @item -mscore5u
12981 @opindex mscore5u
12982 Specify the SCORE5U of the target architecture.
12983
12984 @item -mscore7
12985 @opindex mscore7
12986 Specify the SCORE7 as the target architecture. This is the default.
12987
12988 @item -mscore7d
12989 @opindex mscore7d
12990 Specify the SCORE7D as the target architecture.
12991 @end table
12992
12993 @node SH Options
12994 @subsection SH Options
12995
12996 These @samp{-m} options are defined for the SH implementations:
12997
12998 @table @gcctabopt
12999 @item -m1
13000 @opindex m1
13001 Generate code for the SH1.
13002
13003 @item -m2
13004 @opindex m2
13005 Generate code for the SH2.
13006
13007 @item -m2e
13008 Generate code for the SH2e.
13009
13010 @item -m3
13011 @opindex m3
13012 Generate code for the SH3.
13013
13014 @item -m3e
13015 @opindex m3e
13016 Generate code for the SH3e.
13017
13018 @item -m4-nofpu
13019 @opindex m4-nofpu
13020 Generate code for the SH4 without a floating-point unit.
13021
13022 @item -m4-single-only
13023 @opindex m4-single-only
13024 Generate code for the SH4 with a floating-point unit that only
13025 supports single-precision arithmetic.
13026
13027 @item -m4-single
13028 @opindex m4-single
13029 Generate code for the SH4 assuming the floating-point unit is in
13030 single-precision mode by default.
13031
13032 @item -m4
13033 @opindex m4
13034 Generate code for the SH4.
13035
13036 @item -m4a-nofpu
13037 @opindex m4a-nofpu
13038 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
13039 floating-point unit is not used.
13040
13041 @item -m4a-single-only
13042 @opindex m4a-single-only
13043 Generate code for the SH4a, in such a way that no double-precision
13044 floating point operations are used.
13045
13046 @item -m4a-single
13047 @opindex m4a-single
13048 Generate code for the SH4a assuming the floating-point unit is in
13049 single-precision mode by default.
13050
13051 @item -m4a
13052 @opindex m4a
13053 Generate code for the SH4a.
13054
13055 @item -m4al
13056 @opindex m4al
13057 Same as @option{-m4a-nofpu}, except that it implicitly passes
13058 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
13059 instructions at the moment.
13060
13061 @item -mb
13062 @opindex mb
13063 Compile code for the processor in big endian mode.
13064
13065 @item -ml
13066 @opindex ml
13067 Compile code for the processor in little endian mode.
13068
13069 @item -mdalign
13070 @opindex mdalign
13071 Align doubles at 64-bit boundaries.  Note that this changes the calling
13072 conventions, and thus some functions from the standard C library will
13073 not work unless you recompile it first with @option{-mdalign}.
13074
13075 @item -mrelax
13076 @opindex mrelax
13077 Shorten some address references at link time, when possible; uses the
13078 linker option @option{-relax}.
13079
13080 @item -mbigtable
13081 @opindex mbigtable
13082 Use 32-bit offsets in @code{switch} tables.  The default is to use
13083 16-bit offsets.
13084
13085 @item -mfmovd
13086 @opindex mfmovd
13087 Enable the use of the instruction @code{fmovd}.
13088
13089 @item -mhitachi
13090 @opindex mhitachi
13091 Comply with the calling conventions defined by Renesas.
13092
13093 @item -mrenesas
13094 @opindex mhitachi
13095 Comply with the calling conventions defined by Renesas.
13096
13097 @item -mno-renesas
13098 @opindex mhitachi
13099 Comply with the calling conventions defined for GCC before the Renesas
13100 conventions were available.  This option is the default for all
13101 targets of the SH toolchain except for @samp{sh-symbianelf}.
13102
13103 @item -mnomacsave
13104 @opindex mnomacsave
13105 Mark the @code{MAC} register as call-clobbered, even if
13106 @option{-mhitachi} is given.
13107
13108 @item -mieee
13109 @opindex mieee
13110 Increase IEEE-compliance of floating-point code.
13111 At the moment, this is equivalent to @option{-fno-finite-math-only}.
13112 When generating 16 bit SH opcodes, getting IEEE-conforming results for
13113 comparisons of NANs / infinities incurs extra overhead in every
13114 floating point comparison, therefore the default is set to
13115 @option{-ffinite-math-only}.
13116
13117 @item -minline-ic_invalidate
13118 @opindex minline-ic_invalidate
13119 Inline code to invalidate instruction cache entries after setting up
13120 nested function trampolines.
13121 This option has no effect if -musermode is in effect and the selected
13122 code generation option (e.g. -m4) does not allow the use of the icbi
13123 instruction.
13124 If the selected code generation option does not allow the use of the icbi
13125 instruction, and -musermode is not in effect, the inlined code will
13126 manipulate the instruction cache address array directly with an associative
13127 write.  This not only requires privileged mode, but it will also
13128 fail if the cache line had been mapped via the TLB and has become unmapped.
13129
13130 @item -misize
13131 @opindex misize
13132 Dump instruction size and location in the assembly code.
13133
13134 @item -mpadstruct
13135 @opindex mpadstruct
13136 This option is deprecated.  It pads structures to multiple of 4 bytes,
13137 which is incompatible with the SH ABI@.
13138
13139 @item -mspace
13140 @opindex mspace
13141 Optimize for space instead of speed.  Implied by @option{-Os}.
13142
13143 @item -mprefergot
13144 @opindex mprefergot
13145 When generating position-independent code, emit function calls using
13146 the Global Offset Table instead of the Procedure Linkage Table.
13147
13148 @item -musermode
13149 @opindex musermode
13150 Don't generate privileged mode only code; implies -mno-inline-ic_invalidate
13151 if the inlined code would not work in user mode.
13152 This is the default when the target is @code{sh-*-linux*}.
13153
13154 @item -multcost=@var{number}
13155 @opindex multcost=@var{number}
13156 Set the cost to assume for a multiply insn.
13157
13158 @item -mdiv=@var{strategy}
13159 @opindex mdiv=@var{strategy}
13160 Set the division strategy to use for SHmedia code.  @var{strategy} must be
13161 one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, inv:call,
13162 inv:call2, inv:fp .
13163 "fp" performs the operation in floating point.  This has a very high latency,
13164 but needs only a few instructions, so it might be a good choice if
13165 your code has enough easily exploitable ILP to allow the compiler to
13166 schedule the floating point instructions together with other instructions.
13167 Division by zero causes a floating point exception.
13168 "inv" uses integer operations to calculate the inverse of the divisor,
13169 and then multiplies the dividend with the inverse.  This strategy allows
13170 cse and hoisting of the inverse calculation.  Division by zero calculates
13171 an unspecified result, but does not trap.
13172 "inv:minlat" is a variant of "inv" where if no cse / hoisting opportunities
13173 have been found, or if the entire operation has been hoisted to the same
13174 place, the last stages of the inverse calculation are intertwined with the
13175 final multiply to reduce the overall latency, at the expense of using a few
13176 more instructions, and thus offering fewer scheduling opportunities with
13177 other code.
13178 "call" calls a library function that usually implements the inv:minlat
13179 strategy.
13180 This gives high code density for m5-*media-nofpu compilations.
13181 "call2" uses a different entry point of the same library function, where it
13182 assumes that a pointer to a lookup table has already been set up, which
13183 exposes the pointer load to cse / code hoisting optimizations.
13184 "inv:call", "inv:call2" and "inv:fp" all use the "inv" algorithm for initial
13185 code generation, but if the code stays unoptimized, revert to the "call",
13186 "call2", or "fp" strategies, respectively.  Note that the
13187 potentially-trapping side effect of division by zero is carried by a
13188 separate instruction, so it is possible that all the integer instructions
13189 are hoisted out, but the marker for the side effect stays where it is.
13190 A recombination to fp operations or a call is not possible in that case.
13191 "inv20u" and "inv20l" are variants of the "inv:minlat" strategy.  In the case
13192 that the inverse calculation was nor separated from the multiply, they speed
13193 up division where the dividend fits into 20 bits (plus sign where applicable),
13194 by inserting a test to skip a number of operations in this case; this test
13195 slows down the case of larger dividends.  inv20u assumes the case of a such
13196 a small dividend to be unlikely, and inv20l assumes it to be likely.
13197
13198 @item -mdivsi3_libfunc=@var{name}
13199 @opindex mdivsi3_libfunc=@var{name}
13200 Set the name of the library function used for 32 bit signed division to
13201 @var{name}.  This only affect the name used in the call and inv:call
13202 division strategies, and the compiler will still expect the same
13203 sets of input/output/clobbered registers as if this option was not present.
13204
13205 @item -madjust-unroll
13206 @opindex madjust-unroll
13207 Throttle unrolling to avoid thrashing target registers.
13208 This option only has an effect if the gcc code base supports the
13209 TARGET_ADJUST_UNROLL_MAX target hook.
13210
13211 @item -mindexed-addressing
13212 @opindex mindexed-addressing
13213 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
13214 This is only safe if the hardware and/or OS implement 32 bit wrap-around
13215 semantics for the indexed addressing mode.  The architecture allows the
13216 implementation of processors with 64 bit MMU, which the OS could use to
13217 get 32 bit addressing, but since no current hardware implementation supports
13218 this or any other way to make the indexed addressing mode safe to use in
13219 the 32 bit ABI, the default is -mno-indexed-addressing.
13220
13221 @item -mgettrcost=@var{number}
13222 @opindex mgettrcost=@var{number}
13223 Set the cost assumed for the gettr instruction to @var{number}.
13224 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
13225
13226 @item -mpt-fixed
13227 @opindex mpt-fixed
13228 Assume pt* instructions won't trap.  This will generally generate better
13229 scheduled code, but is unsafe on current hardware.  The current architecture
13230 definition says that ptabs and ptrel trap when the target anded with 3 is 3.
13231 This has the unintentional effect of making it unsafe to schedule ptabs /
13232 ptrel before a branch, or hoist it out of a loop.  For example,
13233 __do_global_ctors, a part of libgcc that runs constructors at program
13234 startup, calls functions in a list which is delimited by @minus{}1.  With the
13235 -mpt-fixed option, the ptabs will be done before testing against @minus{}1.
13236 That means that all the constructors will be run a bit quicker, but when
13237 the loop comes to the end of the list, the program crashes because ptabs
13238 loads @minus{}1 into a target register.  Since this option is unsafe for any
13239 hardware implementing the current architecture specification, the default
13240 is -mno-pt-fixed.  Unless the user specifies a specific cost with
13241 @option{-mgettrcost}, -mno-pt-fixed also implies @option{-mgettrcost=100};
13242 this deters register allocation using target registers for storing
13243 ordinary integers.
13244
13245 @item -minvalid-symbols
13246 @opindex minvalid-symbols
13247 Assume symbols might be invalid.  Ordinary function symbols generated by
13248 the compiler will always be valid to load with movi/shori/ptabs or
13249 movi/shori/ptrel, but with assembler and/or linker tricks it is possible
13250 to generate symbols that will cause ptabs / ptrel to trap.
13251 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
13252 It will then prevent cross-basic-block cse, hoisting and most scheduling
13253 of symbol loads.  The default is @option{-mno-invalid-symbols}.
13254 @end table
13255
13256 @node SPARC Options
13257 @subsection SPARC Options
13258 @cindex SPARC options
13259
13260 These @samp{-m} options are supported on the SPARC:
13261
13262 @table @gcctabopt
13263 @item -mno-app-regs
13264 @itemx -mapp-regs
13265 @opindex mno-app-regs
13266 @opindex mapp-regs
13267 Specify @option{-mapp-regs} to generate output using the global registers
13268 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
13269 is the default.
13270
13271 To be fully SVR4 ABI compliant at the cost of some performance loss,
13272 specify @option{-mno-app-regs}.  You should compile libraries and system
13273 software with this option.
13274
13275 @item -mfpu
13276 @itemx -mhard-float
13277 @opindex mfpu
13278 @opindex mhard-float
13279 Generate output containing floating point instructions.  This is the
13280 default.
13281
13282 @item -mno-fpu
13283 @itemx -msoft-float
13284 @opindex mno-fpu
13285 @opindex msoft-float
13286 Generate output containing library calls for floating point.
13287 @strong{Warning:} the requisite libraries are not available for all SPARC
13288 targets.  Normally the facilities of the machine's usual C compiler are
13289 used, but this cannot be done directly in cross-compilation.  You must make
13290 your own arrangements to provide suitable library functions for
13291 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
13292 @samp{sparclite-*-*} do provide software floating point support.
13293
13294 @option{-msoft-float} changes the calling convention in the output file;
13295 therefore, it is only useful if you compile @emph{all} of a program with
13296 this option.  In particular, you need to compile @file{libgcc.a}, the
13297 library that comes with GCC, with @option{-msoft-float} in order for
13298 this to work.
13299
13300 @item -mhard-quad-float
13301 @opindex mhard-quad-float
13302 Generate output containing quad-word (long double) floating point
13303 instructions.
13304
13305 @item -msoft-quad-float
13306 @opindex msoft-quad-float
13307 Generate output containing library calls for quad-word (long double)
13308 floating point instructions.  The functions called are those specified
13309 in the SPARC ABI@.  This is the default.
13310
13311 As of this writing, there are no SPARC implementations that have hardware
13312 support for the quad-word floating point instructions.  They all invoke
13313 a trap handler for one of these instructions, and then the trap handler
13314 emulates the effect of the instruction.  Because of the trap handler overhead,
13315 this is much slower than calling the ABI library routines.  Thus the
13316 @option{-msoft-quad-float} option is the default.
13317
13318 @item -mno-unaligned-doubles
13319 @itemx -munaligned-doubles
13320 @opindex mno-unaligned-doubles
13321 @opindex munaligned-doubles
13322 Assume that doubles have 8 byte alignment.  This is the default.
13323
13324 With @option{-munaligned-doubles}, GCC assumes that doubles have 8 byte
13325 alignment only if they are contained in another type, or if they have an
13326 absolute address.  Otherwise, it assumes they have 4 byte alignment.
13327 Specifying this option avoids some rare compatibility problems with code
13328 generated by other compilers.  It is not the default because it results
13329 in a performance loss, especially for floating point code.
13330
13331 @item -mno-faster-structs
13332 @itemx -mfaster-structs
13333 @opindex mno-faster-structs
13334 @opindex mfaster-structs
13335 With @option{-mfaster-structs}, the compiler assumes that structures
13336 should have 8 byte alignment.  This enables the use of pairs of
13337 @code{ldd} and @code{std} instructions for copies in structure
13338 assignment, in place of twice as many @code{ld} and @code{st} pairs.
13339 However, the use of this changed alignment directly violates the SPARC
13340 ABI@.  Thus, it's intended only for use on targets where the developer
13341 acknowledges that their resulting code will not be directly in line with
13342 the rules of the ABI@.
13343
13344 @item -mimpure-text
13345 @opindex mimpure-text
13346 @option{-mimpure-text}, used in addition to @option{-shared}, tells
13347 the compiler to not pass @option{-z text} to the linker when linking a
13348 shared object.  Using this option, you can link position-dependent
13349 code into a shared object.
13350
13351 @option{-mimpure-text} suppresses the ``relocations remain against
13352 allocatable but non-writable sections'' linker error message.
13353 However, the necessary relocations will trigger copy-on-write, and the
13354 shared object is not actually shared across processes.  Instead of
13355 using @option{-mimpure-text}, you should compile all source code with
13356 @option{-fpic} or @option{-fPIC}.
13357
13358 This option is only available on SunOS and Solaris.
13359
13360 @item -mcpu=@var{cpu_type}
13361 @opindex mcpu
13362 Set the instruction set, register set, and instruction scheduling parameters
13363 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
13364 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{sparclite},
13365 @samp{f930}, @samp{f934}, @samp{hypersparc}, @samp{sparclite86x},
13366 @samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc},
13367 @samp{ultrasparc3}, and @samp{niagara}.
13368
13369 Default instruction scheduling parameters are used for values that select
13370 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
13371 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
13372
13373 Here is a list of each supported architecture and their supported
13374 implementations.
13375
13376 @smallexample
13377     v7:             cypress
13378     v8:             supersparc, hypersparc
13379     sparclite:      f930, f934, sparclite86x
13380     sparclet:       tsc701
13381     v9:             ultrasparc, ultrasparc3, niagara
13382 @end smallexample
13383
13384 By default (unless configured otherwise), GCC generates code for the V7
13385 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
13386 additionally optimizes it for the Cypress CY7C602 chip, as used in the
13387 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
13388 SPARCStation 1, 2, IPX etc.
13389
13390 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
13391 architecture.  The only difference from V7 code is that the compiler emits
13392 the integer multiply and integer divide instructions which exist in SPARC-V8
13393 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
13394 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
13395 2000 series.
13396
13397 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
13398 the SPARC architecture.  This adds the integer multiply, integer divide step
13399 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
13400 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
13401 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
13402 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
13403 MB86934 chip, which is the more recent SPARClite with FPU@.
13404
13405 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
13406 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
13407 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
13408 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
13409 optimizes it for the TEMIC SPARClet chip.
13410
13411 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
13412 architecture.  This adds 64-bit integer and floating-point move instructions,
13413 3 additional floating-point condition code registers and conditional move
13414 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
13415 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
13416 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
13417 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
13418 @option{-mcpu=niagara}, the compiler additionally optimizes it for
13419 Sun UltraSPARC T1 chips.
13420
13421 @item -mtune=@var{cpu_type}
13422 @opindex mtune
13423 Set the instruction scheduling parameters for machine type
13424 @var{cpu_type}, but do not set the instruction set or register set that the
13425 option @option{-mcpu=@var{cpu_type}} would.
13426
13427 The same values for @option{-mcpu=@var{cpu_type}} can be used for
13428 @option{-mtune=@var{cpu_type}}, but the only useful values are those
13429 that select a particular cpu implementation.  Those are @samp{cypress},
13430 @samp{supersparc}, @samp{hypersparc}, @samp{f930}, @samp{f934},
13431 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
13432 @samp{ultrasparc3}, and @samp{niagara}.
13433
13434 @item -mv8plus
13435 @itemx -mno-v8plus
13436 @opindex mv8plus
13437 @opindex mno-v8plus
13438 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
13439 difference from the V8 ABI is that the global and out registers are
13440 considered 64-bit wide.  This is enabled by default on Solaris in 32-bit
13441 mode for all SPARC-V9 processors.
13442
13443 @item -mvis
13444 @itemx -mno-vis
13445 @opindex mvis
13446 @opindex mno-vis
13447 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
13448 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
13449 @end table
13450
13451 These @samp{-m} options are supported in addition to the above
13452 on SPARC-V9 processors in 64-bit environments:
13453
13454 @table @gcctabopt
13455 @item -mlittle-endian
13456 @opindex mlittle-endian
13457 Generate code for a processor running in little-endian mode.  It is only
13458 available for a few configurations and most notably not on Solaris and Linux.
13459
13460 @item -m32
13461 @itemx -m64
13462 @opindex m32
13463 @opindex m64
13464 Generate code for a 32-bit or 64-bit environment.
13465 The 32-bit environment sets int, long and pointer to 32 bits.
13466 The 64-bit environment sets int to 32 bits and long and pointer
13467 to 64 bits.
13468
13469 @item -mcmodel=medlow
13470 @opindex mcmodel=medlow
13471 Generate code for the Medium/Low code model: 64-bit addresses, programs
13472 must be linked in the low 32 bits of memory.  Programs can be statically
13473 or dynamically linked.
13474
13475 @item -mcmodel=medmid
13476 @opindex mcmodel=medmid
13477 Generate code for the Medium/Middle code model: 64-bit addresses, programs
13478 must be linked in the low 44 bits of memory, the text and data segments must
13479 be less than 2GB in size and the data segment must be located within 2GB of
13480 the text segment.
13481
13482 @item -mcmodel=medany
13483 @opindex mcmodel=medany
13484 Generate code for the Medium/Anywhere code model: 64-bit addresses, programs
13485 may be linked anywhere in memory, the text and data segments must be less
13486 than 2GB in size and the data segment must be located within 2GB of the
13487 text segment.
13488
13489 @item -mcmodel=embmedany
13490 @opindex mcmodel=embmedany
13491 Generate code for the Medium/Anywhere code model for embedded systems:
13492 64-bit addresses, the text and data segments must be less than 2GB in
13493 size, both starting anywhere in memory (determined at link time).  The
13494 global register %g4 points to the base of the data segment.  Programs
13495 are statically linked and PIC is not supported.
13496
13497 @item -mstack-bias
13498 @itemx -mno-stack-bias
13499 @opindex mstack-bias
13500 @opindex mno-stack-bias
13501 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
13502 frame pointer if present, are offset by @minus{}2047 which must be added back
13503 when making stack frame references.  This is the default in 64-bit mode.
13504 Otherwise, assume no such offset is present.
13505 @end table
13506
13507 These switches are supported in addition to the above on Solaris:
13508
13509 @table @gcctabopt
13510 @item -threads
13511 @opindex threads
13512 Add support for multithreading using the Solaris threads library.  This
13513 option sets flags for both the preprocessor and linker.  This option does
13514 not affect the thread safety of object code produced by the compiler or
13515 that of libraries supplied with it.
13516
13517 @item -pthreads
13518 @opindex pthreads
13519 Add support for multithreading using the POSIX threads library.  This
13520 option sets flags for both the preprocessor and linker.  This option does
13521 not affect the thread safety of object code produced  by the compiler or
13522 that of libraries supplied with it.
13523
13524 @item -pthread
13525 @opindex pthread
13526 This is a synonym for @option{-pthreads}.
13527 @end table
13528
13529 @node SPU Options
13530 @subsection SPU Options
13531 @cindex SPU options
13532
13533 These @samp{-m} options are supported on the SPU:
13534
13535 @table @gcctabopt
13536 @item -mwarn-reloc
13537 @itemx -merror-reloc
13538 @opindex mwarn-reloc
13539 @opindex merror-reloc
13540
13541 The loader for SPU does not handle dynamic relocations.  By default, GCC
13542 will give an error when it generates code that requires a dynamic
13543 relocation.  @option{-mno-error-reloc} disables the error,
13544 @option{-mwarn-reloc} will generate a warning instead.
13545
13546 @item -msafe-dma
13547 @itemx -munsafe-dma
13548 @opindex msafe-dma
13549 @opindex munsafe-dma
13550
13551 Instructions which initiate or test completion of DMA must not be
13552 reordered with respect to loads and stores of the memory which is being
13553 accessed.  Users typically address this problem using the volatile
13554 keyword, but that can lead to inefficient code in places where the
13555 memory is known to not change.  Rather than mark the memory as volatile
13556 we treat the DMA instructions as potentially effecting all memory.  With
13557 @option{-munsafe-dma} users must use the volatile keyword to protect
13558 memory accesses.
13559
13560 @item -mbranch-hints
13561 @opindex mbranch-hints
13562
13563 By default, GCC will generate a branch hint instruction to avoid
13564 pipeline stalls for always taken or probably taken branches.  A hint
13565 will not be generated closer than 8 instructions away from its branch.
13566 There is little reason to disable them, except for debugging purposes,
13567 or to make an object a little bit smaller.
13568
13569 @item -msmall-mem
13570 @itemx -mlarge-mem
13571 @opindex msmall-mem
13572 @opindex mlarge-mem
13573
13574 By default, GCC generates code assuming that addresses are never larger
13575 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
13576 a full 32 bit address.
13577
13578 @item -mstdmain
13579 @opindex mstdmain
13580
13581 By default, GCC links against startup code that assumes the SPU-style
13582 main function interface (which has an unconventional parameter list).
13583 With @option{-mstdmain}, GCC will link your program against startup
13584 code that assumes a C99-style interface to @code{main}, including a
13585 local copy of @code{argv} strings.
13586
13587 @item -mfixed-range=@var{register-range}
13588 @opindex mfixed-range
13589 Generate code treating the given register range as fixed registers.
13590 A fixed register is one that the register allocator can not use.  This is
13591 useful when compiling kernel code.  A register range is specified as
13592 two registers separated by a dash.  Multiple register ranges can be
13593 specified separated by a comma.
13594
13595 @end table
13596
13597 @node System V Options
13598 @subsection Options for System V
13599
13600 These additional options are available on System V Release 4 for
13601 compatibility with other compilers on those systems:
13602
13603 @table @gcctabopt
13604 @item -G
13605 @opindex G
13606 Create a shared object.
13607 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
13608
13609 @item -Qy
13610 @opindex Qy
13611 Identify the versions of each tool used by the compiler, in a
13612 @code{.ident} assembler directive in the output.
13613
13614 @item -Qn
13615 @opindex Qn
13616 Refrain from adding @code{.ident} directives to the output file (this is
13617 the default).
13618
13619 @item -YP,@var{dirs}
13620 @opindex YP
13621 Search the directories @var{dirs}, and no others, for libraries
13622 specified with @option{-l}.
13623
13624 @item -Ym,@var{dir}
13625 @opindex Ym
13626 Look in the directory @var{dir} to find the M4 preprocessor.
13627 The assembler uses this option.
13628 @c This is supposed to go with a -Yd for predefined M4 macro files, but
13629 @c the generic assembler that comes with Solaris takes just -Ym.
13630 @end table
13631
13632 @node TMS320C3x/C4x Options
13633 @subsection TMS320C3x/C4x Options
13634 @cindex TMS320C3x/C4x Options
13635
13636 These @samp{-m} options are defined for TMS320C3x/C4x implementations:
13637
13638 @table @gcctabopt
13639
13640 @item -mcpu=@var{cpu_type}
13641 @opindex mcpu
13642 Set the instruction set, register set, and instruction scheduling
13643 parameters for machine type @var{cpu_type}.  Supported values for
13644 @var{cpu_type} are @samp{c30}, @samp{c31}, @samp{c32}, @samp{c40}, and
13645 @samp{c44}.  The default is @samp{c40} to generate code for the
13646 TMS320C40.
13647
13648 @item -mbig-memory
13649 @itemx -mbig
13650 @itemx -msmall-memory
13651 @itemx -msmall
13652 @opindex mbig-memory
13653 @opindex mbig
13654 @opindex msmall-memory
13655 @opindex msmall
13656 Generates code for the big or small memory model.  The small memory
13657 model assumed that all data fits into one 64K word page.  At run-time
13658 the data page (DP) register must be set to point to the 64K page
13659 containing the .bss and .data program sections.  The big memory model is
13660 the default and requires reloading of the DP register for every direct
13661 memory access.
13662
13663 @item -mbk
13664 @itemx -mno-bk
13665 @opindex mbk
13666 @opindex mno-bk
13667 Allow (disallow) allocation of general integer operands into the block
13668 count register BK@.
13669
13670 @item -mdb
13671 @itemx -mno-db
13672 @opindex mdb
13673 @opindex mno-db
13674 Enable (disable) generation of code using decrement and branch,
13675 DBcond(D), instructions.  This is enabled by default for the C4x.  To be
13676 on the safe side, this is disabled for the C3x, since the maximum
13677 iteration count on the C3x is @math{2^{23} + 1} (but who iterates loops more than
13678 @math{2^{23}} times on the C3x?).  Note that GCC will try to reverse a loop so
13679 that it can utilize the decrement and branch instruction, but will give
13680 up if there is more than one memory reference in the loop.  Thus a loop
13681 where the loop counter is decremented can generate slightly more
13682 efficient code, in cases where the RPTB instruction cannot be utilized.
13683
13684 @item -mdp-isr-reload
13685 @itemx -mparanoid
13686 @opindex mdp-isr-reload
13687 @opindex mparanoid
13688 Force the DP register to be saved on entry to an interrupt service
13689 routine (ISR), reloaded to point to the data section, and restored on
13690 exit from the ISR@.  This should not be required unless someone has
13691 violated the small memory model by modifying the DP register, say within
13692 an object library.
13693
13694 @item -mmpyi
13695 @itemx -mno-mpyi
13696 @opindex mmpyi
13697 @opindex mno-mpyi
13698 For the C3x use the 24-bit MPYI instruction for integer multiplies
13699 instead of a library call to guarantee 32-bit results.  Note that if one
13700 of the operands is a constant, then the multiplication will be performed
13701 using shifts and adds.  If the @option{-mmpyi} option is not specified for the C3x,
13702 then squaring operations are performed inline instead of a library call.
13703
13704 @item -mfast-fix
13705 @itemx -mno-fast-fix
13706 @opindex mfast-fix
13707 @opindex mno-fast-fix
13708 The C3x/C4x FIX instruction to convert a floating point value to an
13709 integer value chooses the nearest integer less than or equal to the
13710 floating point value rather than to the nearest integer.  Thus if the
13711 floating point number is negative, the result will be incorrectly
13712 truncated an additional code is necessary to detect and correct this
13713 case.  This option can be used to disable generation of the additional
13714 code required to correct the result.
13715
13716 @item -mrptb
13717 @itemx -mno-rptb
13718 @opindex mrptb
13719 @opindex mno-rptb
13720 Enable (disable) generation of repeat block sequences using the RPTB
13721 instruction for zero overhead looping.  The RPTB construct is only used
13722 for innermost loops that do not call functions or jump across the loop
13723 boundaries.  There is no advantage having nested RPTB loops due to the
13724 overhead required to save and restore the RC, RS, and RE registers.
13725 This is enabled by default with @option{-O2}.
13726
13727 @item -mrpts=@var{count}
13728 @itemx -mno-rpts
13729 @opindex mrpts
13730 @opindex mno-rpts
13731 Enable (disable) the use of the single instruction repeat instruction
13732 RPTS@.  If a repeat block contains a single instruction, and the loop
13733 count can be guaranteed to be less than the value @var{count}, GCC will
13734 emit a RPTS instruction instead of a RPTB@.  If no value is specified,
13735 then a RPTS will be emitted even if the loop count cannot be determined
13736 at compile time.  Note that the repeated instruction following RPTS does
13737 not have to be reloaded from memory each iteration, thus freeing up the
13738 CPU buses for operands.  However, since interrupts are blocked by this
13739 instruction, it is disabled by default.
13740
13741 @item -mloop-unsigned
13742 @itemx -mno-loop-unsigned
13743 @opindex mloop-unsigned
13744 @opindex mno-loop-unsigned
13745 The maximum iteration count when using RPTS and RPTB (and DB on the C40)
13746 is @math{2^{31} + 1} since these instructions test if the iteration count is
13747 negative to terminate the loop.  If the iteration count is unsigned
13748 there is a possibility than the @math{2^{31} + 1} maximum iteration count may be
13749 exceeded.  This switch allows an unsigned iteration count.
13750
13751 @item -mti
13752 @opindex mti
13753 Try to emit an assembler syntax that the TI assembler (asm30) is happy
13754 with.  This also enforces compatibility with the API employed by the TI
13755 C3x C compiler.  For example, long doubles are passed as structures
13756 rather than in floating point registers.
13757
13758 @item -mregparm
13759 @itemx -mmemparm
13760 @opindex mregparm
13761 @opindex mmemparm
13762 Generate code that uses registers (stack) for passing arguments to functions.
13763 By default, arguments are passed in registers where possible rather
13764 than by pushing arguments on to the stack.
13765
13766 @item -mparallel-insns
13767 @itemx -mno-parallel-insns
13768 @opindex mparallel-insns
13769 @opindex mno-parallel-insns
13770 Allow the generation of parallel instructions.  This is enabled by
13771 default with @option{-O2}.
13772
13773 @item -mparallel-mpy
13774 @itemx -mno-parallel-mpy
13775 @opindex mparallel-mpy
13776 @opindex mno-parallel-mpy
13777 Allow the generation of MPY||ADD and MPY||SUB parallel instructions,
13778 provided @option{-mparallel-insns} is also specified.  These instructions have
13779 tight register constraints which can pessimize the code generation
13780 of large functions.
13781
13782 @end table
13783
13784 @node V850 Options
13785 @subsection V850 Options
13786 @cindex V850 Options
13787
13788 These @samp{-m} options are defined for V850 implementations:
13789
13790 @table @gcctabopt
13791 @item -mlong-calls
13792 @itemx -mno-long-calls
13793 @opindex mlong-calls
13794 @opindex mno-long-calls
13795 Treat all calls as being far away (near).  If calls are assumed to be
13796 far away, the compiler will always load the functions address up into a
13797 register, and call indirect through the pointer.
13798
13799 @item -mno-ep
13800 @itemx -mep
13801 @opindex mno-ep
13802 @opindex mep
13803 Do not optimize (do optimize) basic blocks that use the same index
13804 pointer 4 or more times to copy pointer into the @code{ep} register, and
13805 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
13806 option is on by default if you optimize.
13807
13808 @item -mno-prolog-function
13809 @itemx -mprolog-function
13810 @opindex mno-prolog-function
13811 @opindex mprolog-function
13812 Do not use (do use) external functions to save and restore registers
13813 at the prologue and epilogue of a function.  The external functions
13814 are slower, but use less code space if more than one function saves
13815 the same number of registers.  The @option{-mprolog-function} option
13816 is on by default if you optimize.
13817
13818 @item -mspace
13819 @opindex mspace
13820 Try to make the code as small as possible.  At present, this just turns
13821 on the @option{-mep} and @option{-mprolog-function} options.
13822
13823 @item -mtda=@var{n}
13824 @opindex mtda
13825 Put static or global variables whose size is @var{n} bytes or less into
13826 the tiny data area that register @code{ep} points to.  The tiny data
13827 area can hold up to 256 bytes in total (128 bytes for byte references).
13828
13829 @item -msda=@var{n}
13830 @opindex msda
13831 Put static or global variables whose size is @var{n} bytes or less into
13832 the small data area that register @code{gp} points to.  The small data
13833 area can hold up to 64 kilobytes.
13834
13835 @item -mzda=@var{n}
13836 @opindex mzda
13837 Put static or global variables whose size is @var{n} bytes or less into
13838 the first 32 kilobytes of memory.
13839
13840 @item -mv850
13841 @opindex mv850
13842 Specify that the target processor is the V850.
13843
13844 @item -mbig-switch
13845 @opindex mbig-switch
13846 Generate code suitable for big switch tables.  Use this option only if
13847 the assembler/linker complain about out of range branches within a switch
13848 table.
13849
13850 @item -mapp-regs
13851 @opindex mapp-regs
13852 This option will cause r2 and r5 to be used in the code generated by
13853 the compiler.  This setting is the default.
13854
13855 @item -mno-app-regs
13856 @opindex mno-app-regs
13857 This option will cause r2 and r5 to be treated as fixed registers.
13858
13859 @item -mv850e1
13860 @opindex mv850e1
13861 Specify that the target processor is the V850E1.  The preprocessor
13862 constants @samp{__v850e1__} and @samp{__v850e__} will be defined if
13863 this option is used.
13864
13865 @item -mv850e
13866 @opindex mv850e
13867 Specify that the target processor is the V850E@.  The preprocessor
13868 constant @samp{__v850e__} will be defined if this option is used.
13869
13870 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
13871 are defined then a default target processor will be chosen and the
13872 relevant @samp{__v850*__} preprocessor constant will be defined.
13873
13874 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
13875 defined, regardless of which processor variant is the target.
13876
13877 @item -mdisable-callt
13878 @opindex mdisable-callt
13879 This option will suppress generation of the CALLT instruction for the
13880 v850e and v850e1 flavors of the v850 architecture.  The default is
13881 @option{-mno-disable-callt} which allows the CALLT instruction to be used.
13882
13883 @end table
13884
13885 @node VAX Options
13886 @subsection VAX Options
13887 @cindex VAX options
13888
13889 These @samp{-m} options are defined for the VAX:
13890
13891 @table @gcctabopt
13892 @item -munix
13893 @opindex munix
13894 Do not output certain jump instructions (@code{aobleq} and so on)
13895 that the Unix assembler for the VAX cannot handle across long
13896 ranges.
13897
13898 @item -mgnu
13899 @opindex mgnu
13900 Do output those jump instructions, on the assumption that you
13901 will assemble with the GNU assembler.
13902
13903 @item -mg
13904 @opindex mg
13905 Output code for g-format floating point numbers instead of d-format.
13906 @end table
13907
13908 @node VxWorks Options
13909 @subsection VxWorks Options
13910 @cindex VxWorks Options
13911
13912 The options in this section are defined for all VxWorks targets.
13913 Options specific to the target hardware are listed with the other
13914 options for that target.
13915
13916 @table @gcctabopt
13917 @item -mrtp
13918 @opindex mrtp
13919 GCC can generate code for both VxWorks kernels and real time processes
13920 (RTPs).  This option switches from the former to the latter.  It also
13921 defines the preprocessor macro @code{__RTP__}.
13922
13923 @item -non-static
13924 @opindex non-static
13925 Link an RTP executable against shared libraries rather than static
13926 libraries.  The options @option{-static} and @option{-shared} can
13927 also be used for RTPs (@pxref{Link Options}); @option{-static}
13928 is the default.
13929
13930 @item -Bstatic
13931 @itemx -Bdynamic
13932 @opindex Bstatic
13933 @opindex Bdynamic
13934 These options are passed down to the linker.  They are defined for
13935 compatibility with Diab.
13936
13937 @item -Xbind-lazy
13938 @opindex Xbind-lazy
13939 Enable lazy binding of function calls.  This option is equivalent to
13940 @option{-Wl,-z,now} and is defined for compatibility with Diab.
13941
13942 @item -Xbind-now
13943 @opindex Xbind-now
13944 Disable lazy binding of function calls.  This option is the default and
13945 is defined for compatibility with Diab.
13946 @end table
13947
13948 @node x86-64 Options
13949 @subsection x86-64 Options
13950 @cindex x86-64 options
13951
13952 These are listed under @xref{i386 and x86-64 Options}.
13953
13954 @node Xstormy16 Options
13955 @subsection Xstormy16 Options
13956 @cindex Xstormy16 Options
13957
13958 These options are defined for Xstormy16:
13959
13960 @table @gcctabopt
13961 @item -msim
13962 @opindex msim
13963 Choose startup files and linker script suitable for the simulator.
13964 @end table
13965
13966 @node Xtensa Options
13967 @subsection Xtensa Options
13968 @cindex Xtensa Options
13969
13970 These options are supported for Xtensa targets:
13971
13972 @table @gcctabopt
13973 @item -mconst16
13974 @itemx -mno-const16
13975 @opindex mconst16
13976 @opindex mno-const16
13977 Enable or disable use of @code{CONST16} instructions for loading
13978 constant values.  The @code{CONST16} instruction is currently not a
13979 standard option from Tensilica.  When enabled, @code{CONST16}
13980 instructions are always used in place of the standard @code{L32R}
13981 instructions.  The use of @code{CONST16} is enabled by default only if
13982 the @code{L32R} instruction is not available.
13983
13984 @item -mfused-madd
13985 @itemx -mno-fused-madd
13986 @opindex mfused-madd
13987 @opindex mno-fused-madd
13988 Enable or disable use of fused multiply/add and multiply/subtract
13989 instructions in the floating-point option.  This has no effect if the
13990 floating-point option is not also enabled.  Disabling fused multiply/add
13991 and multiply/subtract instructions forces the compiler to use separate
13992 instructions for the multiply and add/subtract operations.  This may be
13993 desirable in some cases where strict IEEE 754-compliant results are
13994 required: the fused multiply add/subtract instructions do not round the
13995 intermediate result, thereby producing results with @emph{more} bits of
13996 precision than specified by the IEEE standard.  Disabling fused multiply
13997 add/subtract instructions also ensures that the program output is not
13998 sensitive to the compiler's ability to combine multiply and add/subtract
13999 operations.
14000
14001 @item -mtext-section-literals
14002 @itemx -mno-text-section-literals
14003 @opindex mtext-section-literals
14004 @opindex mno-text-section-literals
14005 Control the treatment of literal pools.  The default is
14006 @option{-mno-text-section-literals}, which places literals in a separate
14007 section in the output file.  This allows the literal pool to be placed
14008 in a data RAM/ROM, and it also allows the linker to combine literal
14009 pools from separate object files to remove redundant literals and
14010 improve code size.  With @option{-mtext-section-literals}, the literals
14011 are interspersed in the text section in order to keep them as close as
14012 possible to their references.  This may be necessary for large assembly
14013 files.
14014
14015 @item -mtarget-align
14016 @itemx -mno-target-align
14017 @opindex mtarget-align
14018 @opindex mno-target-align
14019 When this option is enabled, GCC instructs the assembler to
14020 automatically align instructions to reduce branch penalties at the
14021 expense of some code density.  The assembler attempts to widen density
14022 instructions to align branch targets and the instructions following call
14023 instructions.  If there are not enough preceding safe density
14024 instructions to align a target, no widening will be performed.  The
14025 default is @option{-mtarget-align}.  These options do not affect the
14026 treatment of auto-aligned instructions like @code{LOOP}, which the
14027 assembler will always align, either by widening density instructions or
14028 by inserting no-op instructions.
14029
14030 @item -mlongcalls
14031 @itemx -mno-longcalls
14032 @opindex mlongcalls
14033 @opindex mno-longcalls
14034 When this option is enabled, GCC instructs the assembler to translate
14035 direct calls to indirect calls unless it can determine that the target
14036 of a direct call is in the range allowed by the call instruction.  This
14037 translation typically occurs for calls to functions in other source
14038 files.  Specifically, the assembler translates a direct @code{CALL}
14039 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
14040 The default is @option{-mno-longcalls}.  This option should be used in
14041 programs where the call target can potentially be out of range.  This
14042 option is implemented in the assembler, not the compiler, so the
14043 assembly code generated by GCC will still show direct call
14044 instructions---look at the disassembled object code to see the actual
14045 instructions.  Note that the assembler will use an indirect call for
14046 every cross-file call, not just those that really will be out of range.
14047 @end table
14048
14049 @node zSeries Options
14050 @subsection zSeries Options
14051 @cindex zSeries options
14052
14053 These are listed under @xref{S/390 and zSeries Options}.
14054
14055 @node Code Gen Options
14056 @section Options for Code Generation Conventions
14057 @cindex code generation conventions
14058 @cindex options, code generation
14059 @cindex run-time options
14060
14061 These machine-independent options control the interface conventions
14062 used in code generation.
14063
14064 Most of them have both positive and negative forms; the negative form
14065 of @option{-ffoo} would be @option{-fno-foo}.  In the table below, only
14066 one of the forms is listed---the one which is not the default.  You
14067 can figure out the other form by either removing @samp{no-} or adding
14068 it.
14069
14070 @table @gcctabopt
14071 @item -fbounds-check
14072 @opindex fbounds-check
14073 For front-ends that support it, generate additional code to check that
14074 indices used to access arrays are within the declared range.  This is
14075 currently only supported by the Java and Fortran front-ends, where
14076 this option defaults to true and false respectively.
14077
14078 @item -ftrapv
14079 @opindex ftrapv
14080 This option generates traps for signed overflow on addition, subtraction,
14081 multiplication operations.
14082
14083 @item -fwrapv
14084 @opindex fwrapv
14085 This option instructs the compiler to assume that signed arithmetic
14086 overflow of addition, subtraction and multiplication wraps around
14087 using twos-complement representation.  This flag enables some optimizations
14088 and disables others.  This option is enabled by default for the Java
14089 front-end, as required by the Java language specification.
14090
14091 @item -fexceptions
14092 @opindex fexceptions
14093 Enable exception handling.  Generates extra code needed to propagate
14094 exceptions.  For some targets, this implies GCC will generate frame
14095 unwind information for all functions, which can produce significant data
14096 size overhead, although it does not affect execution.  If you do not
14097 specify this option, GCC will enable it by default for languages like
14098 C++ which normally require exception handling, and disable it for
14099 languages like C that do not normally require it.  However, you may need
14100 to enable this option when compiling C code that needs to interoperate
14101 properly with exception handlers written in C++.  You may also wish to
14102 disable this option if you are compiling older C++ programs that don't
14103 use exception handling.
14104
14105 @item -fnon-call-exceptions
14106 @opindex fnon-call-exceptions
14107 Generate code that allows trapping instructions to throw exceptions.
14108 Note that this requires platform-specific runtime support that does
14109 not exist everywhere.  Moreover, it only allows @emph{trapping}
14110 instructions to throw exceptions, i.e.@: memory references or floating
14111 point instructions.  It does not allow exceptions to be thrown from
14112 arbitrary signal handlers such as @code{SIGALRM}.
14113
14114 @item -funwind-tables
14115 @opindex funwind-tables
14116 Similar to @option{-fexceptions}, except that it will just generate any needed
14117 static data, but will not affect the generated code in any other way.
14118 You will normally not enable this option; instead, a language processor
14119 that needs this handling would enable it on your behalf.
14120
14121 @item -fasynchronous-unwind-tables
14122 @opindex fasynchronous-unwind-tables
14123 Generate unwind table in dwarf2 format, if supported by target machine.  The
14124 table is exact at each instruction boundary, so it can be used for stack
14125 unwinding from asynchronous events (such as debugger or garbage collector).
14126
14127 @item -fpcc-struct-return
14128 @opindex fpcc-struct-return
14129 Return ``short'' @code{struct} and @code{union} values in memory like
14130 longer ones, rather than in registers.  This convention is less
14131 efficient, but it has the advantage of allowing intercallability between
14132 GCC-compiled files and files compiled with other compilers, particularly
14133 the Portable C Compiler (pcc).
14134
14135 The precise convention for returning structures in memory depends
14136 on the target configuration macros.
14137
14138 Short structures and unions are those whose size and alignment match
14139 that of some integer type.
14140
14141 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
14142 switch is not binary compatible with code compiled with the
14143 @option{-freg-struct-return} switch.
14144 Use it to conform to a non-default application binary interface.
14145
14146 @item -freg-struct-return
14147 @opindex freg-struct-return
14148 Return @code{struct} and @code{union} values in registers when possible.
14149 This is more efficient for small structures than
14150 @option{-fpcc-struct-return}.
14151
14152 If you specify neither @option{-fpcc-struct-return} nor
14153 @option{-freg-struct-return}, GCC defaults to whichever convention is
14154 standard for the target.  If there is no standard convention, GCC
14155 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
14156 the principal compiler.  In those cases, we can choose the standard, and
14157 we chose the more efficient register return alternative.
14158
14159 @strong{Warning:} code compiled with the @option{-freg-struct-return}
14160 switch is not binary compatible with code compiled with the
14161 @option{-fpcc-struct-return} switch.
14162 Use it to conform to a non-default application binary interface.
14163
14164 @item -fshort-enums
14165 @opindex fshort-enums
14166 Allocate to an @code{enum} type only as many bytes as it needs for the
14167 declared range of possible values.  Specifically, the @code{enum} type
14168 will be equivalent to the smallest integer type which has enough room.
14169
14170 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
14171 code that is not binary compatible with code generated without that switch.
14172 Use it to conform to a non-default application binary interface.
14173
14174 @item -fshort-double
14175 @opindex fshort-double
14176 Use the same size for @code{double} as for @code{float}.
14177
14178 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
14179 code that is not binary compatible with code generated without that switch.
14180 Use it to conform to a non-default application binary interface.
14181
14182 @item -fshort-wchar
14183 @opindex fshort-wchar
14184 Override the underlying type for @samp{wchar_t} to be @samp{short
14185 unsigned int} instead of the default for the target.  This option is
14186 useful for building programs to run under WINE@.
14187
14188 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
14189 code that is not binary compatible with code generated without that switch.
14190 Use it to conform to a non-default application binary interface.
14191
14192 @item -fno-common
14193 @opindex fno-common
14194 In C, allocate even uninitialized global variables in the data section of the
14195 object file, rather than generating them as common blocks.  This has the
14196 effect that if the same variable is declared (without @code{extern}) in
14197 two different compilations, you will get an error when you link them.
14198 The only reason this might be useful is if you wish to verify that the
14199 program will work on other systems which always work this way.
14200
14201 @item -fno-ident
14202 @opindex fno-ident
14203 Ignore the @samp{#ident} directive.
14204
14205 @item -finhibit-size-directive
14206 @opindex finhibit-size-directive
14207 Don't output a @code{.size} assembler directive, or anything else that
14208 would cause trouble if the function is split in the middle, and the
14209 two halves are placed at locations far apart in memory.  This option is
14210 used when compiling @file{crtstuff.c}; you should not need to use it
14211 for anything else.
14212
14213 @item -fverbose-asm
14214 @opindex fverbose-asm
14215 Put extra commentary information in the generated assembly code to
14216 make it more readable.  This option is generally only of use to those
14217 who actually need to read the generated assembly code (perhaps while
14218 debugging the compiler itself).
14219
14220 @option{-fno-verbose-asm}, the default, causes the
14221 extra information to be omitted and is useful when comparing two assembler
14222 files.
14223
14224 @item -frecord-gcc-switches
14225 @opindex frecord-gcc-switches
14226 This switch causes the command line that was used to invoke the
14227 compiler to be recorded into the object file that is being created.
14228 This switch is only implemented on some targets and the exact format
14229 of the recording is target and binary file format dependent, but it
14230 usually takes the form of a section containing ASCII text.  This
14231 switch is related to the @option{-fverbose-asm} switch, but that
14232 switch only records information in the assembler output file as
14233 comments, so it never reaches the object file.
14234
14235 @item -fpic
14236 @opindex fpic
14237 @cindex global offset table
14238 @cindex PIC
14239 Generate position-independent code (PIC) suitable for use in a shared
14240 library, if supported for the target machine.  Such code accesses all
14241 constant addresses through a global offset table (GOT)@.  The dynamic
14242 loader resolves the GOT entries when the program starts (the dynamic
14243 loader is not part of GCC; it is part of the operating system).  If
14244 the GOT size for the linked executable exceeds a machine-specific
14245 maximum size, you get an error message from the linker indicating that
14246 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
14247 instead.  (These maximums are 8k on the SPARC and 32k
14248 on the m68k and RS/6000.  The 386 has no such limit.)
14249
14250 Position-independent code requires special support, and therefore works
14251 only on certain machines.  For the 386, GCC supports PIC for System V
14252 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
14253 position-independent.
14254
14255 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
14256 are defined to 1.
14257
14258 @item -fPIC
14259 @opindex fPIC
14260 If supported for the target machine, emit position-independent code,
14261 suitable for dynamic linking and avoiding any limit on the size of the
14262 global offset table.  This option makes a difference on the m68k,
14263 PowerPC and SPARC@.
14264
14265 Position-independent code requires special support, and therefore works
14266 only on certain machines.
14267
14268 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
14269 are defined to 2.
14270
14271 @item -fpie
14272 @itemx -fPIE
14273 @opindex fpie
14274 @opindex fPIE
14275 These options are similar to @option{-fpic} and @option{-fPIC}, but
14276 generated position independent code can be only linked into executables.
14277 Usually these options are used when @option{-pie} GCC option will be
14278 used during linking.
14279
14280 @option{-fpie} and @option{-fPIE} both define the macros
14281 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
14282 for @option{-fpie} and 2 for @option{-fPIE}.
14283
14284 @item -fno-jump-tables
14285 @opindex fno-jump-tables
14286 Do not use jump tables for switch statements even where it would be
14287 more efficient than other code generation strategies.  This option is
14288 of use in conjunction with @option{-fpic} or @option{-fPIC} for
14289 building code which forms part of a dynamic linker and cannot
14290 reference the address of a jump table.  On some targets, jump tables
14291 do not require a GOT and this option is not needed.
14292
14293 @item -ffixed-@var{reg}
14294 @opindex ffixed
14295 Treat the register named @var{reg} as a fixed register; generated code
14296 should never refer to it (except perhaps as a stack pointer, frame
14297 pointer or in some other fixed role).
14298
14299 @var{reg} must be the name of a register.  The register names accepted
14300 are machine-specific and are defined in the @code{REGISTER_NAMES}
14301 macro in the machine description macro file.
14302
14303 This flag does not have a negative form, because it specifies a
14304 three-way choice.
14305
14306 @item -fcall-used-@var{reg}
14307 @opindex fcall-used
14308 Treat the register named @var{reg} as an allocable register that is
14309 clobbered by function calls.  It may be allocated for temporaries or
14310 variables that do not live across a call.  Functions compiled this way
14311 will not save and restore the register @var{reg}.
14312
14313 It is an error to used this flag with the frame pointer or stack pointer.
14314 Use of this flag for other registers that have fixed pervasive roles in
14315 the machine's execution model will produce disastrous results.
14316
14317 This flag does not have a negative form, because it specifies a
14318 three-way choice.
14319
14320 @item -fcall-saved-@var{reg}
14321 @opindex fcall-saved
14322 Treat the register named @var{reg} as an allocable register saved by
14323 functions.  It may be allocated even for temporaries or variables that
14324 live across a call.  Functions compiled this way will save and restore
14325 the register @var{reg} if they use it.
14326
14327 It is an error to used this flag with the frame pointer or stack pointer.
14328 Use of this flag for other registers that have fixed pervasive roles in
14329 the machine's execution model will produce disastrous results.
14330
14331 A different sort of disaster will result from the use of this flag for
14332 a register in which function values may be returned.
14333
14334 This flag does not have a negative form, because it specifies a
14335 three-way choice.
14336
14337 @item -fpack-struct[=@var{n}]
14338 @opindex fpack-struct
14339 Without a value specified, pack all structure members together without
14340 holes.  When a value is specified (which must be a small power of two), pack
14341 structure members according to this value, representing the maximum
14342 alignment (that is, objects with default alignment requirements larger than
14343 this will be output potentially unaligned at the next fitting location.
14344
14345 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
14346 code that is not binary compatible with code generated without that switch.
14347 Additionally, it makes the code suboptimal.
14348 Use it to conform to a non-default application binary interface.
14349
14350 @item -finstrument-functions
14351 @opindex finstrument-functions
14352 Generate instrumentation calls for entry and exit to functions.  Just
14353 after function entry and just before function exit, the following
14354 profiling functions will be called with the address of the current
14355 function and its call site.  (On some platforms,
14356 @code{__builtin_return_address} does not work beyond the current
14357 function, so the call site information may not be available to the
14358 profiling functions otherwise.)
14359
14360 @smallexample
14361 void __cyg_profile_func_enter (void *this_fn,
14362                                void *call_site);
14363 void __cyg_profile_func_exit  (void *this_fn,
14364                                void *call_site);
14365 @end smallexample
14366
14367 The first argument is the address of the start of the current function,
14368 which may be looked up exactly in the symbol table.
14369
14370 This instrumentation is also done for functions expanded inline in other
14371 functions.  The profiling calls will indicate where, conceptually, the
14372 inline function is entered and exited.  This means that addressable
14373 versions of such functions must be available.  If all your uses of a
14374 function are expanded inline, this may mean an additional expansion of
14375 code size.  If you use @samp{extern inline} in your C code, an
14376 addressable version of such functions must be provided.  (This is
14377 normally the case anyways, but if you get lucky and the optimizer always
14378 expands the functions inline, you might have gotten away without
14379 providing static copies.)
14380
14381 A function may be given the attribute @code{no_instrument_function}, in
14382 which case this instrumentation will not be done.  This can be used, for
14383 example, for the profiling functions listed above, high-priority
14384 interrupt routines, and any functions from which the profiling functions
14385 cannot safely be called (perhaps signal handlers, if the profiling
14386 routines generate output or allocate memory).
14387
14388 @item -fstack-check
14389 @opindex fstack-check
14390 Generate code to verify that you do not go beyond the boundary of the
14391 stack.  You should specify this flag if you are running in an
14392 environment with multiple threads, but only rarely need to specify it in
14393 a single-threaded environment since stack overflow is automatically
14394 detected on nearly all systems if there is only one stack.
14395
14396 Note that this switch does not actually cause checking to be done; the
14397 operating system must do that.  The switch causes generation of code
14398 to ensure that the operating system sees the stack being extended.
14399
14400 @item -fstack-limit-register=@var{reg}
14401 @itemx -fstack-limit-symbol=@var{sym}
14402 @itemx -fno-stack-limit
14403 @opindex fstack-limit-register
14404 @opindex fstack-limit-symbol
14405 @opindex fno-stack-limit
14406 Generate code to ensure that the stack does not grow beyond a certain value,
14407 either the value of a register or the address of a symbol.  If the stack
14408 would grow beyond the value, a signal is raised.  For most targets,
14409 the signal is raised before the stack overruns the boundary, so
14410 it is possible to catch the signal without taking special precautions.
14411
14412 For instance, if the stack starts at absolute address @samp{0x80000000}
14413 and grows downwards, you can use the flags
14414 @option{-fstack-limit-symbol=__stack_limit} and
14415 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
14416 of 128KB@.  Note that this may only work with the GNU linker.
14417
14418 @cindex aliasing of parameters
14419 @cindex parameters, aliased
14420 @item -fargument-alias
14421 @itemx -fargument-noalias
14422 @itemx -fargument-noalias-global
14423 @itemx -fargument-noalias-anything
14424 @opindex fargument-alias
14425 @opindex fargument-noalias
14426 @opindex fargument-noalias-global
14427 @opindex fargument-noalias-anything
14428 Specify the possible relationships among parameters and between
14429 parameters and global data.
14430
14431 @option{-fargument-alias} specifies that arguments (parameters) may
14432 alias each other and may alias global storage.@*
14433 @option{-fargument-noalias} specifies that arguments do not alias
14434 each other, but may alias global storage.@*
14435 @option{-fargument-noalias-global} specifies that arguments do not
14436 alias each other and do not alias global storage.
14437 @option{-fargument-noalias-anything} specifies that arguments do not
14438 alias any other storage.
14439
14440 Each language will automatically use whatever option is required by
14441 the language standard.  You should not need to use these options yourself.
14442
14443 @item -fleading-underscore
14444 @opindex fleading-underscore
14445 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
14446 change the way C symbols are represented in the object file.  One use
14447 is to help link with legacy assembly code.
14448
14449 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
14450 generate code that is not binary compatible with code generated without that
14451 switch.  Use it to conform to a non-default application binary interface.
14452 Not all targets provide complete support for this switch.
14453
14454 @item -ftls-model=@var{model}
14455 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
14456 The @var{model} argument should be one of @code{global-dynamic},
14457 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
14458
14459 The default without @option{-fpic} is @code{initial-exec}; with
14460 @option{-fpic} the default is @code{global-dynamic}.
14461
14462 @item -fvisibility=@var{default|internal|hidden|protected}
14463 @opindex fvisibility
14464 Set the default ELF image symbol visibility to the specified option---all
14465 symbols will be marked with this unless overridden within the code.
14466 Using this feature can very substantially improve linking and
14467 load times of shared object libraries, produce more optimized
14468 code, provide near-perfect API export and prevent symbol clashes.
14469 It is @strong{strongly} recommended that you use this in any shared objects
14470 you distribute.
14471
14472 Despite the nomenclature, @code{default} always means public ie;
14473 available to be linked against from outside the shared object.
14474 @code{protected} and @code{internal} are pretty useless in real-world
14475 usage so the only other commonly used option will be @code{hidden}.
14476 The default if @option{-fvisibility} isn't specified is
14477 @code{default}, i.e., make every
14478 symbol public---this causes the same behavior as previous versions of
14479 GCC@.
14480
14481 A good explanation of the benefits offered by ensuring ELF
14482 symbols have the correct visibility is given by ``How To Write
14483 Shared Libraries'' by Ulrich Drepper (which can be found at
14484 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
14485 solution made possible by this option to marking things hidden when
14486 the default is public is to make the default hidden and mark things
14487 public.  This is the norm with DLL's on Windows and with @option{-fvisibility=hidden}
14488 and @code{__attribute__ ((visibility("default")))} instead of
14489 @code{__declspec(dllexport)} you get almost identical semantics with
14490 identical syntax.  This is a great boon to those working with
14491 cross-platform projects.
14492
14493 For those adding visibility support to existing code, you may find
14494 @samp{#pragma GCC visibility} of use.  This works by you enclosing
14495 the declarations you wish to set visibility for with (for example)
14496 @samp{#pragma GCC visibility push(hidden)} and
14497 @samp{#pragma GCC visibility pop}.
14498 Bear in mind that symbol visibility should be viewed @strong{as
14499 part of the API interface contract} and thus all new code should
14500 always specify visibility when it is not the default ie; declarations
14501 only for use within the local DSO should @strong{always} be marked explicitly
14502 as hidden as so to avoid PLT indirection overheads---making this
14503 abundantly clear also aids readability and self-documentation of the code.
14504 Note that due to ISO C++ specification requirements, operator new and
14505 operator delete must always be of default visibility.
14506
14507 Be aware that headers from outside your project, in particular system
14508 headers and headers from any other library you use, may not be
14509 expecting to be compiled with visibility other than the default.  You
14510 may need to explicitly say @samp{#pragma GCC visibility push(default)}
14511 before including any such headers.
14512
14513 @samp{extern} declarations are not affected by @samp{-fvisibility}, so
14514 a lot of code can be recompiled with @samp{-fvisibility=hidden} with
14515 no modifications.  However, this means that calls to @samp{extern}
14516 functions with no explicit visibility will use the PLT, so it is more
14517 effective to use @samp{__attribute ((visibility))} and/or
14518 @samp{#pragma GCC visibility} to tell the compiler which @samp{extern}
14519 declarations should be treated as hidden.
14520
14521 Note that @samp{-fvisibility} does affect C++ vague linkage
14522 entities. This means that, for instance, an exception class that will
14523 be thrown between DSOs must be explicitly marked with default
14524 visibility so that the @samp{type_info} nodes will be unified between
14525 the DSOs.
14526
14527 An overview of these techniques, their benefits and how to use them
14528 is at @w{@uref{http://gcc.gnu.org/wiki/Visibility}}.
14529
14530 @end table
14531
14532 @c man end
14533
14534 @node Environment Variables
14535 @section Environment Variables Affecting GCC
14536 @cindex environment variables
14537
14538 @c man begin ENVIRONMENT
14539 This section describes several environment variables that affect how GCC
14540 operates.  Some of them work by specifying directories or prefixes to use
14541 when searching for various kinds of files.  Some are used to specify other
14542 aspects of the compilation environment.
14543
14544 Note that you can also specify places to search using options such as
14545 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
14546 take precedence over places specified using environment variables, which
14547 in turn take precedence over those specified by the configuration of GCC@.
14548 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
14549 GNU Compiler Collection (GCC) Internals}.
14550
14551 @table @env
14552 @item LANG
14553 @itemx LC_CTYPE
14554 @c @itemx LC_COLLATE
14555 @itemx LC_MESSAGES
14556 @c @itemx LC_MONETARY
14557 @c @itemx LC_NUMERIC
14558 @c @itemx LC_TIME
14559 @itemx LC_ALL
14560 @findex LANG
14561 @findex LC_CTYPE
14562 @c @findex LC_COLLATE
14563 @findex LC_MESSAGES
14564 @c @findex LC_MONETARY
14565 @c @findex LC_NUMERIC
14566 @c @findex LC_TIME
14567 @findex LC_ALL
14568 @cindex locale
14569 These environment variables control the way that GCC uses
14570 localization information that allow GCC to work with different
14571 national conventions.  GCC inspects the locale categories
14572 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
14573 so.  These locale categories can be set to any value supported by your
14574 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
14575 Kingdom encoded in UTF-8.
14576
14577 The @env{LC_CTYPE} environment variable specifies character
14578 classification.  GCC uses it to determine the character boundaries in
14579 a string; this is needed for some multibyte encodings that contain quote
14580 and escape characters that would otherwise be interpreted as a string
14581 end or escape.
14582
14583 The @env{LC_MESSAGES} environment variable specifies the language to
14584 use in diagnostic messages.
14585
14586 If the @env{LC_ALL} environment variable is set, it overrides the value
14587 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
14588 and @env{LC_MESSAGES} default to the value of the @env{LANG}
14589 environment variable.  If none of these variables are set, GCC
14590 defaults to traditional C English behavior.
14591
14592 @item TMPDIR
14593 @findex TMPDIR
14594 If @env{TMPDIR} is set, it specifies the directory to use for temporary
14595 files.  GCC uses temporary files to hold the output of one stage of
14596 compilation which is to be used as input to the next stage: for example,
14597 the output of the preprocessor, which is the input to the compiler
14598 proper.
14599
14600 @item GCC_EXEC_PREFIX
14601 @findex GCC_EXEC_PREFIX
14602 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
14603 names of the subprograms executed by the compiler.  No slash is added
14604 when this prefix is combined with the name of a subprogram, but you can
14605 specify a prefix that ends with a slash if you wish.
14606
14607 If @env{GCC_EXEC_PREFIX} is not set, GCC will attempt to figure out
14608 an appropriate prefix to use based on the pathname it was invoked with.
14609
14610 If GCC cannot find the subprogram using the specified prefix, it
14611 tries looking in the usual places for the subprogram.
14612
14613 The default value of @env{GCC_EXEC_PREFIX} is
14614 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
14615 the installed compiler. In many cases @var{prefix} is the value
14616 of @code{prefix} when you ran the @file{configure} script.
14617
14618 Other prefixes specified with @option{-B} take precedence over this prefix.
14619
14620 This prefix is also used for finding files such as @file{crt0.o} that are
14621 used for linking.
14622
14623 In addition, the prefix is used in an unusual way in finding the
14624 directories to search for header files.  For each of the standard
14625 directories whose name normally begins with @samp{/usr/local/lib/gcc}
14626 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
14627 replacing that beginning with the specified prefix to produce an
14628 alternate directory name.  Thus, with @option{-Bfoo/}, GCC will search
14629 @file{foo/bar} where it would normally search @file{/usr/local/lib/bar}.
14630 These alternate directories are searched first; the standard directories
14631 come next. If a standard directory begins with the configured
14632 @var{prefix} then the value of @var{prefix} is replaced by
14633 @env{GCC_EXEC_PREFIX} when looking for header files.
14634
14635 @item COMPILER_PATH
14636 @findex COMPILER_PATH
14637 The value of @env{COMPILER_PATH} is a colon-separated list of
14638 directories, much like @env{PATH}.  GCC tries the directories thus
14639 specified when searching for subprograms, if it can't find the
14640 subprograms using @env{GCC_EXEC_PREFIX}.
14641
14642 @item LIBRARY_PATH
14643 @findex LIBRARY_PATH
14644 The value of @env{LIBRARY_PATH} is a colon-separated list of
14645 directories, much like @env{PATH}.  When configured as a native compiler,
14646 GCC tries the directories thus specified when searching for special
14647 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
14648 using GCC also uses these directories when searching for ordinary
14649 libraries for the @option{-l} option (but directories specified with
14650 @option{-L} come first).
14651
14652 @item LANG
14653 @findex LANG
14654 @cindex locale definition
14655 This variable is used to pass locale information to the compiler.  One way in
14656 which this information is used is to determine the character set to be used
14657 when character literals, string literals and comments are parsed in C and C++.
14658 When the compiler is configured to allow multibyte characters,
14659 the following values for @env{LANG} are recognized:
14660
14661 @table @samp
14662 @item C-JIS
14663 Recognize JIS characters.
14664 @item C-SJIS
14665 Recognize SJIS characters.
14666 @item C-EUCJP
14667 Recognize EUCJP characters.
14668 @end table
14669
14670 If @env{LANG} is not defined, or if it has some other value, then the
14671 compiler will use mblen and mbtowc as defined by the default locale to
14672 recognize and translate multibyte characters.
14673 @end table
14674
14675 @noindent
14676 Some additional environments variables affect the behavior of the
14677 preprocessor.
14678
14679 @include cppenv.texi
14680
14681 @c man end
14682
14683 @node Precompiled Headers
14684 @section Using Precompiled Headers
14685 @cindex precompiled headers
14686 @cindex speed of compilation
14687
14688 Often large projects have many header files that are included in every
14689 source file.  The time the compiler takes to process these header files
14690 over and over again can account for nearly all of the time required to
14691 build the project.  To make builds faster, GCC allows users to
14692 `precompile' a header file; then, if builds can use the precompiled
14693 header file they will be much faster.
14694
14695 To create a precompiled header file, simply compile it as you would any
14696 other file, if necessary using the @option{-x} option to make the driver
14697 treat it as a C or C++ header file.  You will probably want to use a
14698 tool like @command{make} to keep the precompiled header up-to-date when
14699 the headers it contains change.
14700
14701 A precompiled header file will be searched for when @code{#include} is
14702 seen in the compilation.  As it searches for the included file
14703 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
14704 compiler looks for a precompiled header in each directory just before it
14705 looks for the include file in that directory.  The name searched for is
14706 the name specified in the @code{#include} with @samp{.gch} appended.  If
14707 the precompiled header file can't be used, it is ignored.
14708
14709 For instance, if you have @code{#include "all.h"}, and you have
14710 @file{all.h.gch} in the same directory as @file{all.h}, then the
14711 precompiled header file will be used if possible, and the original
14712 header will be used otherwise.
14713
14714 Alternatively, you might decide to put the precompiled header file in a
14715 directory and use @option{-I} to ensure that directory is searched
14716 before (or instead of) the directory containing the original header.
14717 Then, if you want to check that the precompiled header file is always
14718 used, you can put a file of the same name as the original header in this
14719 directory containing an @code{#error} command.
14720
14721 This also works with @option{-include}.  So yet another way to use
14722 precompiled headers, good for projects not designed with precompiled
14723 header files in mind, is to simply take most of the header files used by
14724 a project, include them from another header file, precompile that header
14725 file, and @option{-include} the precompiled header.  If the header files
14726 have guards against multiple inclusion, they will be skipped because
14727 they've already been included (in the precompiled header).
14728
14729 If you need to precompile the same header file for different
14730 languages, targets, or compiler options, you can instead make a
14731 @emph{directory} named like @file{all.h.gch}, and put each precompiled
14732 header in the directory, perhaps using @option{-o}.  It doesn't matter
14733 what you call the files in the directory, every precompiled header in
14734 the directory will be considered.  The first precompiled header
14735 encountered in the directory that is valid for this compilation will
14736 be used; they're searched in no particular order.
14737
14738 There are many other possibilities, limited only by your imagination,
14739 good sense, and the constraints of your build system.
14740
14741 A precompiled header file can be used only when these conditions apply:
14742
14743 @itemize
14744 @item
14745 Only one precompiled header can be used in a particular compilation.
14746
14747 @item
14748 A precompiled header can't be used once the first C token is seen.  You
14749 can have preprocessor directives before a precompiled header; you can
14750 even include a precompiled header from inside another header, so long as
14751 there are no C tokens before the @code{#include}.
14752
14753 @item
14754 The precompiled header file must be produced for the same language as
14755 the current compilation.  You can't use a C precompiled header for a C++
14756 compilation.
14757
14758 @item
14759 The precompiled header file must have been produced by the same compiler
14760 binary as the current compilation is using.
14761
14762 @item
14763 Any macros defined before the precompiled header is included must
14764 either be defined in the same way as when the precompiled header was
14765 generated, or must not affect the precompiled header, which usually
14766 means that they don't appear in the precompiled header at all.
14767
14768 The @option{-D} option is one way to define a macro before a
14769 precompiled header is included; using a @code{#define} can also do it.
14770 There are also some options that define macros implicitly, like
14771 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
14772 defined this way.
14773
14774 @item If debugging information is output when using the precompiled
14775 header, using @option{-g} or similar, the same kind of debugging information
14776 must have been output when building the precompiled header.  However,
14777 a precompiled header built using @option{-g} can be used in a compilation
14778 when no debugging information is being output.
14779
14780 @item The same @option{-m} options must generally be used when building
14781 and using the precompiled header.  @xref{Submodel Options},
14782 for any cases where this rule is relaxed.
14783
14784 @item Each of the following options must be the same when building and using
14785 the precompiled header:
14786
14787 @gccoptlist{-fexceptions -funit-at-a-time}
14788
14789 @item
14790 Some other command-line options starting with @option{-f},
14791 @option{-p}, or @option{-O} must be defined in the same way as when
14792 the precompiled header was generated.  At present, it's not clear
14793 which options are safe to change and which are not; the safest choice
14794 is to use exactly the same options when generating and using the
14795 precompiled header.  The following are known to be safe:
14796
14797 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
14798 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
14799 -fsched-verbose=<number>  -fschedule-insns  -fvisibility= @gol
14800 -pedantic-errors}
14801
14802 @end itemize
14803
14804 For all of these except the last, the compiler will automatically
14805 ignore the precompiled header if the conditions aren't met.  If you
14806 find an option combination that doesn't work and doesn't cause the
14807 precompiled header to be ignored, please consider filing a bug report,
14808 see @ref{Bugs}.
14809
14810 If you do use differing options when generating and using the
14811 precompiled header, the actual behavior will be a mixture of the
14812 behavior for the options.  For instance, if you use @option{-g} to
14813 generate the precompiled header but not when using it, you may or may
14814 not get debugging information for routines in the precompiled header.
14815
14816 @node Running Protoize
14817 @section Running Protoize
14818
14819 The program @code{protoize} is an optional part of GCC@.  You can use
14820 it to add prototypes to a program, thus converting the program to ISO
14821 C in one respect.  The companion program @code{unprotoize} does the
14822 reverse: it removes argument types from any prototypes that are found.
14823
14824 When you run these programs, you must specify a set of source files as
14825 command line arguments.  The conversion programs start out by compiling
14826 these files to see what functions they define.  The information gathered
14827 about a file @var{foo} is saved in a file named @file{@var{foo}.X}.
14828
14829 After scanning comes actual conversion.  The specified files are all
14830 eligible to be converted; any files they include (whether sources or
14831 just headers) are eligible as well.
14832
14833 But not all the eligible files are converted.  By default,
14834 @code{protoize} and @code{unprotoize} convert only source and header
14835 files in the current directory.  You can specify additional directories
14836 whose files should be converted with the @option{-d @var{directory}}
14837 option.  You can also specify particular files to exclude with the
14838 @option{-x @var{file}} option.  A file is converted if it is eligible, its
14839 directory name matches one of the specified directory names, and its
14840 name within the directory has not been excluded.
14841
14842 Basic conversion with @code{protoize} consists of rewriting most
14843 function definitions and function declarations to specify the types of
14844 the arguments.  The only ones not rewritten are those for varargs
14845 functions.
14846
14847 @code{protoize} optionally inserts prototype declarations at the
14848 beginning of the source file, to make them available for any calls that
14849 precede the function's definition.  Or it can insert prototype
14850 declarations with block scope in the blocks where undeclared functions
14851 are called.
14852
14853 Basic conversion with @code{unprotoize} consists of rewriting most
14854 function declarations to remove any argument types, and rewriting
14855 function definitions to the old-style pre-ISO form.
14856
14857 Both conversion programs print a warning for any function declaration or
14858 definition that they can't convert.  You can suppress these warnings
14859 with @option{-q}.
14860
14861 The output from @code{protoize} or @code{unprotoize} replaces the
14862 original source file.  The original file is renamed to a name ending
14863 with @samp{.save} (for DOS, the saved filename ends in @samp{.sav}
14864 without the original @samp{.c} suffix).  If the @samp{.save} (@samp{.sav}
14865 for DOS) file already exists, then the source file is simply discarded.
14866
14867 @code{protoize} and @code{unprotoize} both depend on GCC itself to
14868 scan the program and collect information about the functions it uses.
14869 So neither of these programs will work until GCC is installed.
14870
14871 Here is a table of the options you can use with @code{protoize} and
14872 @code{unprotoize}.  Each option works with both programs unless
14873 otherwise stated.
14874
14875 @table @code
14876 @item -B @var{directory}
14877 Look for the file @file{SYSCALLS.c.X} in @var{directory}, instead of the
14878 usual directory (normally @file{/usr/local/lib}).  This file contains
14879 prototype information about standard system functions.  This option
14880 applies only to @code{protoize}.
14881
14882 @item -c @var{compilation-options}
14883 Use @var{compilation-options} as the options when running @command{gcc} to
14884 produce the @samp{.X} files.  The special option @option{-aux-info} is
14885 always passed in addition, to tell @command{gcc} to write a @samp{.X} file.
14886
14887 Note that the compilation options must be given as a single argument to
14888 @code{protoize} or @code{unprotoize}.  If you want to specify several
14889 @command{gcc} options, you must quote the entire set of compilation options
14890 to make them a single word in the shell.
14891
14892 There are certain @command{gcc} arguments that you cannot use, because they
14893 would produce the wrong kind of output.  These include @option{-g},
14894 @option{-O}, @option{-c}, @option{-S}, and @option{-o} If you include these in
14895 the @var{compilation-options}, they are ignored.
14896
14897 @item -C
14898 Rename files to end in @samp{.C} (@samp{.cc} for DOS-based file
14899 systems) instead of @samp{.c}.  This is convenient if you are converting
14900 a C program to C++.  This option applies only to @code{protoize}.
14901
14902 @item -g
14903 Add explicit global declarations.  This means inserting explicit
14904 declarations at the beginning of each source file for each function
14905 that is called in the file and was not declared.  These declarations
14906 precede the first function definition that contains a call to an
14907 undeclared function.  This option applies only to @code{protoize}.
14908
14909 @item -i @var{string}
14910 Indent old-style parameter declarations with the string @var{string}.
14911 This option applies only to @code{protoize}.
14912
14913 @code{unprotoize} converts prototyped function definitions to old-style
14914 function definitions, where the arguments are declared between the
14915 argument list and the initial @samp{@{}.  By default, @code{unprotoize}
14916 uses five spaces as the indentation.  If you want to indent with just
14917 one space instead, use @option{-i " "}.
14918
14919 @item -k
14920 Keep the @samp{.X} files.  Normally, they are deleted after conversion
14921 is finished.
14922
14923 @item -l
14924 Add explicit local declarations.  @code{protoize} with @option{-l} inserts
14925 a prototype declaration for each function in each block which calls the
14926 function without any declaration.  This option applies only to
14927 @code{protoize}.
14928
14929 @item -n
14930 Make no real changes.  This mode just prints information about the conversions
14931 that would have been done without @option{-n}.
14932
14933 @item -N
14934 Make no @samp{.save} files.  The original files are simply deleted.
14935 Use this option with caution.
14936
14937 @item -p @var{program}
14938 Use the program @var{program} as the compiler.  Normally, the name
14939 @file{gcc} is used.
14940
14941 @item -q
14942 Work quietly.  Most warnings are suppressed.
14943
14944 @item -v
14945 Print the version number, just like @option{-v} for @command{gcc}.
14946 @end table
14947
14948 If you need special compiler options to compile one of your program's
14949 source files, then you should generate that file's @samp{.X} file
14950 specially, by running @command{gcc} on that source file with the
14951 appropriate options and the option @option{-aux-info}.  Then run
14952 @code{protoize} on the entire set of files.  @code{protoize} will use
14953 the existing @samp{.X} file because it is newer than the source file.
14954 For example:
14955
14956 @smallexample
14957 gcc -Dfoo=bar file1.c -aux-info file1.X
14958 protoize *.c
14959 @end smallexample
14960
14961 @noindent
14962 You need to include the special files along with the rest in the
14963 @code{protoize} command, even though their @samp{.X} files already
14964 exist, because otherwise they won't get converted.
14965
14966 @xref{Protoize Caveats}, for more information on how to use
14967 @code{protoize} successfully.